Bug 492971 - Remove new String() from org.eclipse.e4.core.tests and
org.eclipse.core.tests.runtime
Change-Id: I3859dac7ff5a0ae72c358be1430230a4da08013b
Signed-off-by: Björn Arnelid <bjorn.arnelid@gmail.com>
diff --git a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/QualifiedNameTest.java b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/QualifiedNameTest.java
index 70a3dc1..c65b9c1 100644
--- a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/QualifiedNameTest.java
+++ b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/QualifiedNameTest.java
@@ -111,7 +111,7 @@
assertTrue("1.1", qN2.equals(qN1));
assertEquals("1.2", qN1.hashCode(), qN2.hashCode());
- assertTrue("2.0", !qN1.equals(new String("org.eclipse.runtime.myClass")));
+ assertTrue("2.0", !qN1.equals("org.eclipse.runtime.myClass"));
QualifiedName qN3 = new QualifiedName(null, "myClass");
assertTrue("3.0", !qN1.equals(qN3));
diff --git a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/ContextDynamicTest.java b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/ContextDynamicTest.java
index 4d1df79..89148c9 100644
--- a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/ContextDynamicTest.java
+++ b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/ContextDynamicTest.java
@@ -51,7 +51,7 @@
@Test
public synchronized void testAddRemove() {
Integer testInt = Integer.valueOf(123);
- String testString = new String("abc");
+ String testString = "abc";
Double testDouble = Double.valueOf(1.23);
Float testFloat = Float.valueOf(12.3f);
Character testChar = Character.valueOf('v');
@@ -114,7 +114,7 @@
@Test
public synchronized void testParentAddRemove() {
Integer testInt = Integer.valueOf(123);
- String testString = new String("abc");
+ String testString = "abc";
Double testDouble = Double.valueOf(1.23);
Float testFloat = Float.valueOf(12.3f);
Character testChar = Character.valueOf('v');
diff --git a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/AnnotationsInjectionTest.java b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/AnnotationsInjectionTest.java
index fe2258d..b392696 100644
--- a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/AnnotationsInjectionTest.java
+++ b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/AnnotationsInjectionTest.java
@@ -114,7 +114,7 @@
@Test
public synchronized void testInjection() {
Integer testInt = Integer.valueOf(123);
- String testString = new String("abc");
+ String testString = "abc";
Double testDouble = Double.valueOf(1.23);
Float testFloat = Float.valueOf(12.3f);
Character testChar = Character.valueOf('v');
@@ -214,7 +214,7 @@
assertNull(userObject.f);
// add optional services
- String testString = new String("abc");
+ String testString = "abc";
Double testDouble = Double.valueOf(1.23);
Float testFloat = Float.valueOf(12.3f);
context.set(String.class, testString);
@@ -265,7 +265,7 @@
public void testInheritedSpecialMethods() {
IEclipseContext context = EclipseContextFactory.create();
context.set(Integer.class, Integer.valueOf(123));
- context.set(String.class, new String("abc"));
+ context.set(String.class, "abc");
context.set(Float.class, Float.valueOf(12.3f));
ObjectSubClass userObject = new ObjectSubClass();
diff --git a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/ContextInjectionTest.java b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/ContextInjectionTest.java
index 4c284ce..103b78a 100644
--- a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/ContextInjectionTest.java
+++ b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/ContextInjectionTest.java
@@ -114,7 +114,7 @@
@Test
public synchronized void testInjection() {
Integer testInt = Integer.valueOf(123);
- String testString = new String("abc");
+ String testString = "abc";
Double testDouble = Double.valueOf(1.23);
Float testFloat = Float.valueOf(12.3f);
Character testChar = Character.valueOf('v');
@@ -152,7 +152,7 @@
@Test
public synchronized void testInjectionFromParent() {
Integer testInt = Integer.valueOf(123);
- String testString = new String("abc");
+ String testString = "abc";
Double testDouble = Double.valueOf(1.23);
Float testFloat = Float.valueOf(12.3f);
Character testChar = Character.valueOf('v');
@@ -193,7 +193,7 @@
@Test
public synchronized void testInjectionAndInheritance() {
Integer testInt = Integer.valueOf(123);
- String testString = new String("abc");
+ String testString = "abc";
Float testFloat = Float.valueOf(12.3f);
// create context
@@ -276,7 +276,7 @@
@Test
public synchronized void testInjectionCloseOverride() {
Integer testInt = Integer.valueOf(123);
- String testString = new String("abc");
+ String testString = "abc";
Double testDouble = Double.valueOf(12.3);
Boolean testBoolean = Boolean.TRUE;
diff --git a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/OptionalAnnotations.java b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/OptionalAnnotations.java
index 4f8c758..42ea285 100644
--- a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/OptionalAnnotations.java
+++ b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/OptionalAnnotations.java
@@ -21,7 +21,7 @@
public Float f = null;
public Double d;
- public String s = new String("ouch");
+ public String s = "ouch";
public Integer i;
public int methodOptionalCalled = 0;