Skip to content

Commit f9dc4dc

Browse files
committed
[MAINTENANCE] Simplify triple negation usage
1 parent 7068212 commit f9dc4dc

File tree

37 files changed

+81
-81
lines changed

37 files changed

+81
-81
lines changed

blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/ext/AbstractPropertyPlaceholderExt.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ protected Metadata processServiceMetadata(ServiceMetadata component) {
204204
}
205205

206206
List<MapEntry> entries = new ArrayList<MapEntry>(component.getServiceProperties());
207-
if(!!! entries.isEmpty()) {
207+
if(! entries.isEmpty()) {
208208

209209
try {
210210
if(component instanceof MutableServiceMetadata) {
@@ -284,7 +284,7 @@ private Metadata processServiceReferenceMetadata(ServiceReferenceMetadata compon
284284
protected Metadata processPropsMetadata(PropsMetadata metadata) {
285285

286286
List<MapEntry> entries = new ArrayList<MapEntry>(metadata.getEntries());
287-
if(!!! entries.isEmpty()) {
287+
if(! entries.isEmpty()) {
288288

289289
try {
290290
if(metadata instanceof MutablePropsMetadata) {
@@ -311,7 +311,7 @@ protected Metadata processPropsMetadata(PropsMetadata metadata) {
311311

312312
protected Metadata processMapMetadata(MapMetadata metadata) {
313313
List<MapEntry> entries = new ArrayList<MapEntry>(metadata.getEntries());
314-
if(!!! entries.isEmpty()) {
314+
if(! entries.isEmpty()) {
315315

316316
try {
317317
if(metadata instanceof MutableMapMetadata) {
@@ -359,7 +359,7 @@ protected List<MapEntry> processMapEntries(List<MapEntry> entries) {
359359
protected Metadata processCollectionMetadata(CollectionMetadata metadata) {
360360

361361
List<Metadata> values = new ArrayList<Metadata>(metadata.getValues());
362-
if(!!! values.isEmpty()) {
362+
if(! values.isEmpty()) {
363363

364364
try {
365365
if(metadata instanceof MutableCollectionMetadata) {

blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/ReflectionUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public static PropertyDescriptor[] getPropertyDescriptors(Class clazz, boolean a
292292
if (allowFieldInjection) {
293293
for (Class cl = clazz; cl != null && cl != Object.class; cl = cl.getSuperclass()) {
294294
for (Field field : cl.getDeclaredFields()) {
295-
if (!!!Modifier.isStatic(field.getModifiers())) {
295+
if (!Modifier.isStatic(field.getModifiers())) {
296296
String name = decapitalize(field.getName());
297297
PropertyDescriptor desc = props.get(name);
298298
if (desc == null) {
@@ -311,7 +311,7 @@ public static PropertyDescriptor[] getPropertyDescriptors(Class clazz, boolean a
311311

312312
List<PropertyDescriptor> result = new ArrayList<PropertyDescriptor>();
313313
for (PropertyDescriptor prop : props.values()) {
314-
if (!!!illegalProperties.contains(prop.getName())) result.add(prop);
314+
if (!illegalProperties.contains(prop.getName())) result.add(prop);
315315
}
316316

317317
properties[index] = result.toArray(new PropertyDescriptor[result.size()]);
@@ -536,7 +536,7 @@ public Boolean run() throws Exception {
536536
return Boolean.FALSE;
537537
}
538538
});
539-
if(!!!wasSet) {
539+
if(!wasSet) {
540540
doInternalSet(container, instance, value);
541541
}
542542
} catch (PrivilegedActionException pae) {

blueprint/blueprint-noosgi/src/main/java/org/apache/aries/blueprint/ext/AbstractPropertyPlaceholder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ protected Metadata processBeanMetadata(BeanMetadata component) {
198198
protected Metadata processPropsMetadata(PropsMetadata metadata) {
199199

200200
List<MapEntry> entries = new ArrayList<MapEntry>(metadata.getEntries());
201-
if(!!! entries.isEmpty()) {
201+
if(! entries.isEmpty()) {
202202

203203
try {
204204
if(metadata instanceof MutablePropsMetadata) {
@@ -225,7 +225,7 @@ protected Metadata processPropsMetadata(PropsMetadata metadata) {
225225

226226
protected Metadata processMapMetadata(MapMetadata metadata) {
227227
List<MapEntry> entries = new ArrayList<MapEntry>(metadata.getEntries());
228-
if(!!! entries.isEmpty()) {
228+
if(! entries.isEmpty()) {
229229

230230
try {
231231
if(metadata instanceof MutableMapMetadata) {
@@ -273,7 +273,7 @@ protected List<MapEntry> processMapEntries(List<MapEntry> entries) {
273273
protected Metadata processCollectionMetadata(CollectionMetadata metadata) {
274274

275275
List<Metadata> values = new ArrayList<Metadata>(metadata.getValues());
276-
if(!!! values.isEmpty()) {
276+
if(! values.isEmpty()) {
277277

278278
try {
279279
if(metadata instanceof MutableCollectionMetadata) {

jmx/jmx-core-whiteboard/src/main/java/org/apache/aries/jmx/core/whiteboard/Activator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ private <T> void registerMBean(String type, Factory<T> factory, String objectNam
220220
synchronized (result) {
221221
ServiceRegistration reg = registerAnMbean(type, factory, objectName);
222222

223-
if (!!!result.compareAndSet(null, reg)) {
223+
if (!result.compareAndSet(null, reg)) {
224224
reg.unregister();
225225
}
226226
}

jndi/jndi-core/src/main/java/org/apache/aries/jndi/startup/Activator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ private boolean isPropertyEnabled(BundleContext context, String key) {
231231
if (null != value) return true;
232232
Object revision = context.getBundle().adapt(BundleRevision.class);
233233
// in a unit test adapt() may return an incompatible object
234-
if (!!! (revision instanceof BundleRevision)) return false;
234+
if (! (revision instanceof BundleRevision)) return false;
235235
final BundleRevision bundleRevision = (BundleRevision) revision;
236236
return bundleRevision.getDeclaredCapabilities(key).size() > 0;
237237
}

proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/AbstractProxyManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private Object duplicateProxy(Collection<Class<?>> classes, Callable<Object> dis
153153

154154
classToProxy = classes.iterator().next();
155155

156-
if(!!!isProxyClass(classToProxy))
156+
if(!isProxyClass(classToProxy))
157157
classToProxy = null;
158158
}
159159

proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/AsmProxyManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public Object createNewProxy(Bundle clientBundle, Collection<Class<?>> classes,
6464
Set<Class<?>> interfaces = new HashSet<Class<?>>();
6565

6666
for (Class<?> clazz : classes) {
67-
if (!!!clazz.isInterface()) {
67+
if (!clazz.isInterface()) {
6868
notInterfaces.add(clazz);
6969
} else {
7070
interfaces.add(clazz);
@@ -224,7 +224,7 @@ private Class<?> getLowestSubclass(Set<Class<?>> notInterfaces) throws
224224
//potential can be widened to classToProxy, and is therefore
225225
//a lower subclass
226226
classToProxy = potential;
227-
} else if (!!!potential.isAssignableFrom(classToProxy)){
227+
} else if (!potential.isAssignableFrom(classToProxy)){
228228
//classToProxy is not a subclass of potential - This is
229229
//an error, we can't be part of two hierarchies at once!
230230
throw new UnableToProxyException(classToProxy, "The requested classes "
@@ -242,7 +242,7 @@ private boolean isConcrete(Class<?> classToProxy) {
242242
private boolean implementsAll(Class<?> classToProxy, Set<Class<?>> interfaces) {
243243
//If we can't widen to one of the interfaces then we need to do some more work
244244
for(Class<?> iface : interfaces) {
245-
if(!!!iface.isAssignableFrom(classToProxy))
245+
if(!iface.isAssignableFrom(classToProxy))
246246
return false;
247247
}
248248
return true;

proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/JdkProxyManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public Object createNewProxy(Bundle clientBundle, Collection<Class<?>> classes,
3939
private static final Class<?>[] getInterfaces(Collection<Class<?>> classes) throws UnableToProxyException
4040
{
4141
for (Class<?> clazz : classes) {
42-
if (!!!clazz.isInterface()) {
42+
if (!clazz.isInterface()) {
4343
throw new UnableToProxyException(clazz, String.format("The class %s is not an interface and therefore a proxy cannot be generated.", clazz.getName()));
4444
}
4545
}

proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/MethodCopyingClassAdapter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ public final MethodVisitor visitMethod(final int access, String name, String des
9898
MethodVisitor mv = null;
9999
//As in WovenProxyAdapter, we only care about "real" methods, but also not
100100
//abstract ones!.
101-
if (!!!name.equals("<init>") && !!!name.equals("<clinit>")
101+
if (!name.equals("<init>") && !name.equals("<clinit>")
102102
&& (access & (ACC_STATIC | ACC_PRIVATE | ACC_SYNTHETIC | ACC_ABSTRACT
103103
| ACC_NATIVE | ACC_BRIDGE)) == 0) {
104104

105105
// identify the target method parameters and return type
106106
Method currentTransformMethod = new Method(name, desc);
107107
// We don't want to duplicate a method we already overrode!
108-
if(!!!knownMethods.add(currentTransformMethod))
108+
if(!knownMethods.add(currentTransformMethod))
109109
return null;
110110

111111
// found a method we should weave
@@ -116,7 +116,7 @@ public final MethodVisitor visitMethod(final int access, String name, String des
116116
// We can't call up to a default access method if we aren't in the same
117117
// package
118118
if((access & (ACC_PUBLIC | ACC_PROTECTED | ACC_PRIVATE)) == 0) {
119-
if(!!!samePackage) {
119+
if(!samePackage) {
120120
methodHiddenException(name);
121121
}
122122
}

proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/OSGiFriendlyClassWriter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected final String getCommonSuperClass(String arg0, String arg1) {
8585
return OBJECT_INTERNAL_NAME; //arg0 is an interface
8686
}
8787
aRunning = false; //old arg00 was java.lang.Object
88-
} else if(!!!names.add(arg00)) {
88+
} else if(!names.add(arg00)) {
8989
return arg00;
9090
}
9191
} else {
@@ -104,7 +104,7 @@ protected final String getCommonSuperClass(String arg0, String arg1) {
104104
return OBJECT_INTERNAL_NAME; //arg1 is an interface
105105
}
106106
bRunning = false; //old arg11 was java.lang.Object
107-
} else if(!!!names.add(arg11)) {
107+
} else if(!names.add(arg11)) {
108108
return arg11;
109109
}
110110
} else {

0 commit comments

Comments
 (0)