From 264220f34a579bcd9b2c1efb03a29f9c6f8cab1f Mon Sep 17 00:00:00 2001 From: Peter Gafert Date: Fri, 10 Jan 2020 17:30:01 +0100 Subject: [PATCH] Review: Minor class renaming I think `InnerMemberClass` is more narrow than `NonStaticNestedClass`, because technically a local or anonymous class also is a non-static nested class. It might not always be relevant in the context, but `InnerMemberClass` at least gives me a quick understanding of exactly what type of class this is. Also `ClassAccessingLocalClass` is AFAIS a `ClassBeingAccessedByLocalClass` (it does not access the local class, but vice versa, and this is also correct for the test). Signed-off-by: Peter Gafert --- .../syntax/elements/ClassesShouldTest.java | 10 +++---- .../syntax/elements/GivenClassesThatTest.java | 26 +++++++++---------- ...GivenMembersDeclaredInClassesThatTest.java | 26 +++++++++---------- .../elements/ShouldClassesThatTest.java | 12 ++++----- .../elements/ShouldOnlyByClassesThatTest.java | 22 ++++++++-------- 5 files changed, 48 insertions(+), 48 deletions(-) diff --git a/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ClassesShouldTest.java b/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ClassesShouldTest.java index 192acb1898..e6139e44f2 100644 --- a/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ClassesShouldTest.java +++ b/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ClassesShouldTest.java @@ -1491,12 +1491,12 @@ public void notBeMemberClasses(ArchRule rule, Class satisfied, Class viola @DataProvider public static Object[][] beInnerClasses_rules() { - Class nonStaticNestedClass = NestedClassWithSomeMoreClasses.NonStaticNestedClass.class; + Class innerMemberClass = NestedClassWithSomeMoreClasses.InnerMemberClass.class; Class staticNestedClass = NestedClassWithSomeMoreClasses.StaticNestedClass.class; return $$( - $(classes().should().beInnerClasses(), nonStaticNestedClass, staticNestedClass), - $(classes().should(ArchConditions.beInnerClasses()), nonStaticNestedClass, staticNestedClass) + $(classes().should().beInnerClasses(), innerMemberClass, staticNestedClass), + $(classes().should(ArchConditions.beInnerClasses()), innerMemberClass, staticNestedClass) ); } @@ -1513,7 +1513,7 @@ public void beInnerClasses(ArchRule rule, Class satisfied, Class violated) @DataProvider public static Object[][] notBeInnerClasses_rules() { - Class nonStaticNestedClass = NestedClassWithSomeMoreClasses.NonStaticNestedClass.class; + Class nonStaticNestedClass = NestedClassWithSomeMoreClasses.InnerMemberClass.class; Class staticNestedClass = NestedClassWithSomeMoreClasses.StaticNestedClass.class; return $$( @@ -1952,7 +1952,7 @@ static class StaticNestedClass { } @SuppressWarnings("InnerClassMayBeStatic") - class NonStaticNestedClass { + class InnerMemberClass { } static Class getAnonymousClass() { diff --git a/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/GivenClassesThatTest.java b/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/GivenClassesThatTest.java index 9cd4cd4bd4..50ebef4969 100644 --- a/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/GivenClassesThatTest.java +++ b/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/GivenClassesThatTest.java @@ -658,7 +658,7 @@ public void areNotEnums_predicate() { public void areTopLevelClasses_predicate() { List classes = filterResultOf(classes().that().areTopLevelClasses()) .on(List.class, Map.class, Map.Entry.class, NestedClassWithSomeMoreClasses.class, - NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, + NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatClasses(classes).matchInAnyOrder(List.class, Map.class); @@ -668,12 +668,12 @@ public void areTopLevelClasses_predicate() { public void areNotTopLevelClasses_predicate() { List classes = filterResultOf(classes().that().areNotTopLevelClasses()) .on(List.class, Map.class, Map.Entry.class, NestedClassWithSomeMoreClasses.class, - NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, + NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatClasses(classes) .matchInAnyOrder(Map.Entry.class, NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); } @@ -681,12 +681,12 @@ public void areNotTopLevelClasses_predicate() { public void areNestedClasses_predicate() { List classes = filterResultOf(classes().that().areNestedClasses()) .on(List.class, Map.class, Map.Entry.class, NestedClassWithSomeMoreClasses.class, - NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, + NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatClasses(classes) .matchInAnyOrder(Map.Entry.class, NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); } @@ -694,7 +694,7 @@ public void areNestedClasses_predicate() { public void areNotNestedClasses_predicate() { List classes = filterResultOf(classes().that().areNotNestedClasses()) .on(List.class, Map.class, Map.Entry.class, NestedClassWithSomeMoreClasses.class, - NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, + NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatClasses(classes).matchInAnyOrder(List.class, Map.class); @@ -704,19 +704,19 @@ public void areNotNestedClasses_predicate() { public void areMemberClasses_predicate() { List classes = filterResultOf(classes().that().areMemberClasses()) .on(List.class, Map.class, Map.Entry.class, NestedClassWithSomeMoreClasses.class, - NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, + NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatClasses(classes) .matchInAnyOrder(Map.Entry.class, NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class); + NestedClassWithSomeMoreClasses.InnerMemberClass.class); } @Test public void areNotMemberClasses_predicate() { List classes = filterResultOf(classes().that().areNotMemberClasses()) .on(List.class, Map.class, Map.Entry.class, NestedClassWithSomeMoreClasses.class, - NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, + NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatClasses(classes).matchInAnyOrder(List.class, Map.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), @@ -727,11 +727,11 @@ public void areNotMemberClasses_predicate() { public void areInnerClasses_predicate() { List classes = filterResultOf(classes().that().areInnerClasses()) .on(List.class, Map.class, Map.Entry.class, NestedClassWithSomeMoreClasses.class, - NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, + NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatClasses(classes) - .matchInAnyOrder(NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + .matchInAnyOrder(NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); } @@ -739,7 +739,7 @@ public void areInnerClasses_predicate() { public void areNotInnerClasses_predicate() { List classes = filterResultOf(classes().that().areNotInnerClasses()) .on(List.class, Map.class, Map.Entry.class, NestedClassWithSomeMoreClasses.class, - NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, + NestedClassWithSomeMoreClasses.StaticNestedClass.class, NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatClasses(classes).matchInAnyOrder(List.class, Map.class, Map.Entry.class, NestedClassWithSomeMoreClasses.class, @@ -911,7 +911,7 @@ static class StaticNestedClass { } @SuppressWarnings("InnerClassMayBeStatic") - class NonStaticNestedClass { + class InnerMemberClass { } static Class getAnonymousClass() { diff --git a/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/GivenMembersDeclaredInClassesThatTest.java b/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/GivenMembersDeclaredInClassesThatTest.java index b5071d6a8f..0273c78e15 100644 --- a/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/GivenMembersDeclaredInClassesThatTest.java +++ b/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/GivenMembersDeclaredInClassesThatTest.java @@ -655,7 +655,7 @@ public void areNotEnums_predicate() { public void areTopLevelClasses_predicate() { List members = filterResultOf(members().that().areDeclaredInClassesThat().areTopLevelClasses()) .on(String.class, NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatMembers(members).matchInAnyOrderMembersOf(String.class); @@ -665,12 +665,12 @@ public void areTopLevelClasses_predicate() { public void areNotTopLevelClasses_predicate() { List members = filterResultOf(members().that().areDeclaredInClassesThat().areNotTopLevelClasses()) .on(String.class, NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatMembers(members) .matchInAnyOrderMembersOf(NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); } @@ -678,12 +678,12 @@ public void areNotTopLevelClasses_predicate() { public void areNestedClasses_predicate() { List members = filterResultOf(members().that().areDeclaredInClassesThat().areNestedClasses()) .on(String.class, NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatMembers(members) .matchInAnyOrderMembersOf(NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); } @@ -691,7 +691,7 @@ public void areNestedClasses_predicate() { public void areNotNestedClasses_predicate() { List members = filterResultOf(members().that().areDeclaredInClassesThat().areNotNestedClasses()) .on(String.class, NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatMembers(members).matchInAnyOrderMembersOf(String.class); @@ -701,19 +701,19 @@ public void areNotNestedClasses_predicate() { public void areMemberClasses_predicate() { List members = filterResultOf(members().that().areDeclaredInClassesThat().areMemberClasses()) .on(String.class, NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatMembers(members) .matchInAnyOrderMembersOf(NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class); + NestedClassWithSomeMoreClasses.InnerMemberClass.class); } @Test public void areNotMemberClasses_predicate() { List members = filterResultOf(members().that().areDeclaredInClassesThat().areNotMemberClasses()) .on(String.class, NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatMembers(members).matchInAnyOrderMembersOf(String.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), @@ -724,10 +724,10 @@ public void areNotMemberClasses_predicate() { public void areInnerClasses_predicate() { List members = filterResultOf(members().that().areDeclaredInClassesThat().areInnerClasses()) .on(String.class, NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); - assertThatMembers(members).matchInAnyOrderMembersOf(NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, + assertThatMembers(members).matchInAnyOrderMembersOf(NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); } @@ -735,7 +735,7 @@ public void areInnerClasses_predicate() { public void areNotInnerClasses_predicate() { List members = filterResultOf(members().that().areDeclaredInClassesThat().areNotInnerClasses()) .on(String.class, NestedClassWithSomeMoreClasses.class, NestedClassWithSomeMoreClasses.StaticNestedClass.class, - NestedClassWithSomeMoreClasses.NonStaticNestedClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), + NestedClassWithSomeMoreClasses.InnerMemberClass.class, NestedClassWithSomeMoreClasses.getAnonymousClass(), NestedClassWithSomeMoreClasses.getLocalClass()); assertThatMembers(members) @@ -905,7 +905,7 @@ static class StaticNestedClass { } @SuppressWarnings("InnerClassMayBeStatic") - class NonStaticNestedClass { + class InnerMemberClass { String member; } diff --git a/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ShouldClassesThatTest.java b/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ShouldClassesThatTest.java index 1e4498d96a..15e1c8d056 100644 --- a/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ShouldClassesThatTest.java +++ b/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ShouldClassesThatTest.java @@ -837,9 +837,9 @@ public void areNotMemberClasses_predicate(ClassesThat public void areInnerClasses_predicate(ClassesThat noClassesShouldThatRuleStart) { Set classes = filterClassesAppearingInFailureReport( noClassesShouldThatRuleStart.areInnerClasses()) - .on(ClassAccessingNonStaticNestedClass.class, ClassAccessingTopLevelClass.class); + .on(ClassAccessingInnerMemberClass.class, ClassAccessingTopLevelClass.class); - assertThatClasses(classes).matchInAnyOrder(ClassAccessingNonStaticNestedClass.class); + assertThatClasses(classes).matchInAnyOrder(ClassAccessingInnerMemberClass.class); } @Test @@ -847,7 +847,7 @@ public void areInnerClasses_predicate(ClassesThat noCl public void areNotInnerClasses_predicate(ClassesThat noClassesShouldThatRuleStart) { Set classes = filterClassesAppearingInFailureReport( noClassesShouldThatRuleStart.areNotInnerClasses()) - .on(ClassAccessingNonStaticNestedClass.class, ClassAccessingTopLevelClass.class); + .on(ClassAccessingInnerMemberClass.class, ClassAccessingTopLevelClass.class); assertThatClasses(classes).matchInAnyOrder(ClassAccessingTopLevelClass.class); } @@ -1821,14 +1821,14 @@ static void access() { } } - private static class ClassAccessingNonStaticNestedClass { + private static class ClassAccessingInnerMemberClass { @SuppressWarnings("unused") void access() { - new NonStaticNestedClass().access(); + new InnerMemberClass().access(); } @SuppressWarnings("InnerClassMayBeStatic") - private class NonStaticNestedClass { + private class InnerMemberClass { void access() { } } diff --git a/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ShouldOnlyByClassesThatTest.java b/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ShouldOnlyByClassesThatTest.java index befd0abb7b..2e8c4043cd 100644 --- a/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ShouldOnlyByClassesThatTest.java +++ b/archunit/src/test/java/com/tngtech/archunit/lang/syntax/elements/ShouldOnlyByClassesThatTest.java @@ -962,7 +962,7 @@ public void areNotMemberClasses_predicate(ClassesThat public void areInnerClasses_predicate(ClassesThat classesShouldOnlyBeBy) { Set classes = filterClassesAppearingInFailureReport( classesShouldOnlyBeBy.areInnerClasses()) - .on(ClassAccessingNonStaticNestedClass.class, NonStaticNestedClassBeingAccessed.class, + .on(ClassAccessingInnerMemberClass.class, InnerMemberClassBeingAccessed.class, ClassAccessingOtherClass.class, ClassBeingAccessedByOtherClass.class); assertThatClasses(classes).matchInAnyOrder(ClassAccessingOtherClass.class, ClassBeingAccessedByOtherClass.class); @@ -973,10 +973,10 @@ public void areInnerClasses_predicate(ClassesThat clas public void areNotInnerClasses_predicate(ClassesThat classesShouldOnlyBeBy) { Set classes = filterClassesAppearingInFailureReport( classesShouldOnlyBeBy.areNotInnerClasses()) - .on(ClassAccessingNonStaticNestedClass.class, NonStaticNestedClassBeingAccessed.class, + .on(ClassAccessingInnerMemberClass.class, InnerMemberClassBeingAccessed.class, ClassAccessingOtherClass.class, ClassBeingAccessedByOtherClass.class); - assertThatClasses(classes).matchInAnyOrder(ClassAccessingNonStaticNestedClass.class, NonStaticNestedClassBeingAccessed.class); + assertThatClasses(classes).matchInAnyOrder(ClassAccessingInnerMemberClass.class, InnerMemberClassBeingAccessed.class); } @Test @@ -1006,7 +1006,7 @@ public void areNotAnonymousClasses_predicate(ClassesThat classesShouldOnlyBeBy) { Set classes = filterClassesAppearingInFailureReport( classesShouldOnlyBeBy.areLocalClasses()) - .on(ClassAccessingLocalClass.class, ClassAccessingLocalClass.getLocalClass(), + .on(ClassBeingAccessedByLocalClass.class, ClassBeingAccessedByLocalClass.getLocalClass(), ClassAccessingOtherClass.class, ClassBeingAccessedByOtherClass.class); assertThatClasses(classes).matchInAnyOrder(ClassAccessingOtherClass.class, ClassBeingAccessedByOtherClass.class); @@ -1017,10 +1017,10 @@ public void areLocalClasses_predicate(ClassesThat clas public void areNotLocalClasses_predicate(ClassesThat classesShouldOnlyBeBy) { Set classes = filterClassesAppearingInFailureReport( classesShouldOnlyBeBy.areNotLocalClasses()) - .on(ClassAccessingLocalClass.class, ClassAccessingLocalClass.getLocalClass(), + .on(ClassBeingAccessedByLocalClass.class, ClassBeingAccessedByLocalClass.getLocalClass(), ClassAccessingOtherClass.class, ClassBeingAccessedByOtherClass.class); - assertThatClasses(classes).matchInAnyOrder(ClassAccessingLocalClass.class, ClassAccessingLocalClass.getLocalClass()); + assertThatClasses(classes).matchInAnyOrder(ClassBeingAccessedByLocalClass.class, ClassBeingAccessedByLocalClass.getLocalClass()); } @Test @@ -1323,15 +1323,15 @@ void access() { private static class StaticNestedClassBeingAccessed { } - private class ClassAccessingNonStaticNestedClass { + private class ClassAccessingInnerMemberClass { @SuppressWarnings("unused") void access() { - new NonStaticNestedClassBeingAccessed(); + new InnerMemberClassBeingAccessed(); } } @SuppressWarnings("InnerClassMayBeStatic") - private class NonStaticNestedClassBeingAccessed { + private class InnerMemberClassBeingAccessed { } private static class ClassAccessingAnonymousClass { @@ -1348,12 +1348,12 @@ public void run() { } }; - private static class ClassAccessingLocalClass { + private static class ClassBeingAccessedByLocalClass { static Class getLocalClass() { class LocalClass { @SuppressWarnings("unused") void access() { - new ClassAccessingLocalClass(); + new ClassBeingAccessedByLocalClass(); } } return LocalClass.class;