Skip to content

Instantly share code, notes, and snippets.

@neomatrix369
Created December 27, 2012 13:14
Show Gist options
  • Save neomatrix369/4388322 to your computer and use it in GitHub Desktop.
Save neomatrix369/4388322 to your computer and use it in GitHub Desktop.
Changed logic behind how CanSubclassChecker checks for mutability in src/main/java/org/mutabilitydetector/checkers/CanSubclassChecker.java b/src/main/java/org/mutabilitydetector/checkers/CanSubclassChecker.java
diff --git a/src/main/java/org/mutabilitydetector/checkers/CanSubclassChecker.java b/src/main/java/org/mutabilitydetector/checkers/CanSubclassChecker.java
index 947cd5e..c8baaf2 100644
--- a/src/main/java/org/mutabilitydetector/checkers/CanSubclassChecker.java
+++ b/src/main/java/org/mutabilitydetector/checkers/CanSubclassChecker.java
@@ -39,7 +39,7 @@ public final class CanSubclassChecker extends AbstractMutabilityChecker {
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- if (MethodIs.aConstructor(name) && method(access).isNotPrivate()) {
+ if (MethodIs.aConstructor(name) && (method(access).isNotPrivate()) && method(access).isNotSynthetic()) {
hasOnlyPrivateConstructors = false;
}
return super.visitMethod(access, name, desc, signature, exceptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment