Skip to content

Commit 7948b56

Browse files
eclipse-platform-botHeikoKlare
authored andcommitted
Perform clean code of runtime/bundles/org.eclipse.e4.core.di
1 parent 2a1400a commit 7948b56

File tree

11 files changed

+213
-119
lines changed

11 files changed

+213
-119
lines changed

runtime/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/Binding.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ public String getQualifierName() {
6161
}
6262

6363
public Class<?> getImplementationClass() {
64-
if (implementationClazz != null)
64+
if (implementationClazz != null) {
6565
return implementationClazz;
66+
}
6667
return clazz;
6768
}
6869
}

runtime/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ClassRequestor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ public IObjectDescriptor[] calcDependentObjects() {
6565
@Override
6666
public String toString() {
6767
StringBuilder tmp = new StringBuilder();
68-
if (location != null)
68+
if (location != null) {
6969
tmp.append(location.getSimpleName());
70+
}
7071
tmp.append('.');
7172
tmp.append(pseudoVariable);
7273
return tmp.toString();

runtime/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ConstructorRequestor.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ public Object execute() throws InjectionException {
5252
}
5353
throw new InjectionException((originalException != null) ? originalException : e);
5454
} finally {
55-
if (pausedRecording)
55+
if (pausedRecording) {
5656
primarySupplier.resumeRecording();
57+
}
5758
clearResolvedArgs();
5859
}
5960
return result;
@@ -91,10 +92,11 @@ public Class<?> getRequestingObjectClass() {
9192
public String toString() {
9293
StringBuilder tmp = new StringBuilder();
9394
Object object = getRequestingObject();
94-
if (object != null)
95+
if (object != null) {
9596
tmp.append(object.getClass().getSimpleName());
96-
else
97+
} else {
9798
tmp.append(location.getDeclaringClass().getSimpleName());
99+
}
98100
tmp.append('(');
99101
tmp.append(')');
100102
return tmp.toString();

runtime/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/FieldRequestor.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ public FieldRequestor(Field field, IInjector injector, PrimaryObjectSupplier pri
2727

2828
@Override
2929
public Object execute() throws InjectionException {
30-
if (actualArgs == null)
30+
if (actualArgs == null) {
3131
return null; // optional field
32+
}
3233
setField(location, actualArgs[0]);
3334
clearResolvedArgs();
3435
return null;
@@ -42,8 +43,9 @@ protected IObjectDescriptor[] calcDependentObjects() {
4243

4344
private boolean setField(Field field, Object value) throws InjectionException {
4445
Object userObject = getRequestingObject();
45-
if (userObject == null)
46+
if (userObject == null) {
4647
return false;
48+
}
4749
try {
4850
field.trySetAccessible();
4951
field.set(userObject, value);
@@ -57,8 +59,9 @@ private boolean setField(Field field, Object value) throws InjectionException {
5759
public String toString() {
5860
StringBuilder tmp = new StringBuilder();
5961
Object object = getRequestingObject();
60-
if (object != null)
62+
if (object != null) {
6163
tmp.append(object.getClass().getSimpleName());
64+
}
6265
tmp.append('.');
6366
tmp.append(location.getName());
6467
return tmp.toString();

0 commit comments

Comments
 (0)