aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/src
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-08 03:16:40 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-08 03:16:40 +0200
commit93ce335dc0dad2f420d1b7b1d426ad7bfa3574ad (patch)
treee37a88693a2de065eb8c6c56f35b053bcf951c4a /runtime/src
parentf33600d4d5507f3aa02d7cacfc34fe910d6b858f (diff)
downloadaspectj-93ce335dc0dad2f420d1b7b1d426ad7bfa3574ad.tar.gz
aspectj-93ce335dc0dad2f420d1b7b1d426ad7bfa3574ad.zip
Unnecessary unboxing
Reports "unboxing", e.g. explicit unwrapping of wrapped primitive values. Unboxing is unnecessary under Java 5 and newer, and can be safely removed. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/main/java/org/aspectj/lang/Aspects.java6
-rw-r--r--runtime/src/main/java/org/aspectj/lang/Aspects14.java6
-rw-r--r--runtime/src/main/java/org/aspectj/runtime/internal/Conversions.java4
3 files changed, 8 insertions, 8 deletions
diff --git a/runtime/src/main/java/org/aspectj/lang/Aspects.java b/runtime/src/main/java/org/aspectj/lang/Aspects.java
index 726b7ed63..ecc388bdb 100644
--- a/runtime/src/main/java/org/aspectj/lang/Aspects.java
+++ b/runtime/src/main/java/org/aspectj/lang/Aspects.java
@@ -94,7 +94,7 @@ public class Aspects {
*/
public static boolean hasAspect(Class<?> aspectClass) throws NoAspectBoundException {
try {
- return ((Boolean)getSingletonOrThreadHasAspect(aspectClass).invoke(null, EMPTY_OBJECT_ARRAY)).booleanValue();
+ return (Boolean) getSingletonOrThreadHasAspect(aspectClass).invoke(null, EMPTY_OBJECT_ARRAY);
} catch (Exception e) {
return false;
}
@@ -108,7 +108,7 @@ public class Aspects {
*/
public static boolean hasAspect(Class<?> aspectClass, Object perObject) throws NoAspectBoundException {
try {
- return ((Boolean)getPerObjectHasAspect(aspectClass).invoke(null, new Object[]{perObject})).booleanValue();
+ return (Boolean) getPerObjectHasAspect(aspectClass).invoke(null, new Object[]{perObject});
} catch (Exception e) {
return false;
}
@@ -122,7 +122,7 @@ public class Aspects {
*/
public static boolean hasAspect(Class<?> aspectClass, Class<?> perTypeWithin) throws NoAspectBoundException {
try {
- return ((Boolean)getPerTypeWithinHasAspect(aspectClass).invoke(null, new Object[]{perTypeWithin})).booleanValue();
+ return (Boolean) getPerTypeWithinHasAspect(aspectClass).invoke(null, new Object[]{perTypeWithin});
} catch (Exception e) {
return false;
}
diff --git a/runtime/src/main/java/org/aspectj/lang/Aspects14.java b/runtime/src/main/java/org/aspectj/lang/Aspects14.java
index b59374d76..4ddb6b123 100644
--- a/runtime/src/main/java/org/aspectj/lang/Aspects14.java
+++ b/runtime/src/main/java/org/aspectj/lang/Aspects14.java
@@ -95,7 +95,7 @@ public class Aspects14 {
*/
public static boolean hasAspect(Class aspectClass) throws NoAspectBoundException {
try {
- return ((Boolean)getSingletonOrThreadHasAspect(aspectClass).invoke(null, EMPTY_OBJECT_ARRAY)).booleanValue();
+ return (Boolean) getSingletonOrThreadHasAspect(aspectClass).invoke(null, EMPTY_OBJECT_ARRAY);
} catch (Exception e) {
return false;
}
@@ -110,7 +110,7 @@ public class Aspects14 {
*/
public static boolean hasAspect(Class aspectClass, Object perObject) throws NoAspectBoundException {
try {
- return ((Boolean)getPerObjectHasAspect(aspectClass).invoke(null, new Object[]{perObject})).booleanValue();
+ return (Boolean) getPerObjectHasAspect(aspectClass).invoke(null, new Object[]{perObject});
} catch (Exception e) {
return false;
}
@@ -125,7 +125,7 @@ public class Aspects14 {
*/
public static boolean hasAspect(Class aspectClass, Class perTypeWithin) throws NoAspectBoundException {
try {
- return ((Boolean)getPerTypeWithinHasAspect(aspectClass).invoke(null, new Object[]{perTypeWithin})).booleanValue();
+ return (Boolean) getPerTypeWithinHasAspect(aspectClass).invoke(null, new Object[]{perTypeWithin});
} catch (Exception e) {
return false;
}
diff --git a/runtime/src/main/java/org/aspectj/runtime/internal/Conversions.java b/runtime/src/main/java/org/aspectj/runtime/internal/Conversions.java
index 6fb5f916f..0d784266b 100644
--- a/runtime/src/main/java/org/aspectj/runtime/internal/Conversions.java
+++ b/runtime/src/main/java/org/aspectj/runtime/internal/Conversions.java
@@ -112,7 +112,7 @@ public final class Conversions {
if (o == null) {
return 0;
} else if (o instanceof Character) {
- return ((Character)o).charValue();
+ return (Character) o;
} else {
throw new ClassCastException(o.getClass().getName() +
" can not be converted to char");
@@ -122,7 +122,7 @@ public final class Conversions {
if (o == null) {
return false;
} else if (o instanceof Boolean) {
- return ((Boolean)o).booleanValue();
+ return (Boolean) o;
} else {
throw new ClassCastException(o.getClass().getName() +
" can not be converted to boolean");