File tree Expand file tree Collapse file tree 4 files changed +15
-10
lines changed
main/java/de/tum/cit/ase/ares/api
architecture/java/archunit/postcompile
test/resources/de/tum/cit/ase/ares/integration/testuser/securitypolicies Expand file tree Collapse file tree 4 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -96,10 +96,10 @@ public static String getArchitectureRuleFileContent(String key) {
96
96
public static ArchRule noClassesShouldImportForbiddenPackages (Set <String > allowedPackages ) {
97
97
return ArchRuleDefinition .noClasses ()
98
98
.should ()
99
- .transitivelyDependOnClassesThat (new DescribedPredicate <>("imports package" ) {
99
+ .dependOnClassesThat (new DescribedPredicate <>("imports package" ) {
100
100
@ Override
101
101
public boolean test (JavaClass javaClass ) {
102
- return allowedPackages .stream ().allMatch (allowedPackage -> allowedPackage . startsWith ( javaClass .getPackageName ()));
102
+ return allowedPackages .stream ().noneMatch (allowedPackage -> javaClass .getPackageName (). startsWith ( allowedPackage ));
103
103
}
104
104
});
105
105
}
Original file line number Diff line number Diff line change 22
22
import javax .annotation .Nonnull ;
23
23
import java .nio .file .Path ;
24
24
import java .nio .file .Paths ;
25
- import java .util .ArrayList ;
26
- import java .util .Arrays ;
27
- import java .util .HashSet ;
28
- import java .util .List ;
25
+ import java .util .*;
29
26
import java .util .function .Supplier ;
30
27
import java .util .stream .IntStream ;
31
28
import java .util .stream .Stream ;
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ regardingTheSupervisedCode:
11
11
- importTheFollowingPackage : " java.io"
12
12
- importTheFollowingPackage : " java.lang"
13
13
- importTheFollowingPackage : " java.util"
14
- - importTheFollowingPackage : " de.tum.cit.ase.ares.api.aop.aspectj.adviceandpointcut"
15
- - importTheFollowingPackage : " java.nio.file "
14
+ - importTheFollowingPackage : " de.tum.cit.ase.ares.api.aop.java. aspectj.adviceandpointcut"
15
+ - importTheFollowingPackage : " java.nio"
16
16
- importTheFollowingPackage : " org.java.aspectj"
17
+ - importTheFollowingPackage : " org.aspectj"
18
+ - importTheFollowingPackage : " jdk.internal"
19
+ - importTheFollowingPackage : " java.net"
20
+ - importTheFollowingPackage : " sun.reflect"
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ regardingTheSupervisedCode:
18
18
- importTheFollowingPackage : " java.io"
19
19
- importTheFollowingPackage : " java.lang"
20
20
- importTheFollowingPackage : " java.util"
21
- - importTheFollowingPackage : " de.tum.cit.ase.ares.api.aop.aspectj.adviceandpointcut"
22
- - importTheFollowingPackage : " java.nio.file "
21
+ - importTheFollowingPackage : " de.tum.cit.ase.ares.api.aop.java. aspectj.adviceandpointcut"
22
+ - importTheFollowingPackage : " java.nio"
23
23
- importTheFollowingPackage : " org.java.aspectj"
24
+ - importTheFollowingPackage : " org.aspectj"
25
+ - importTheFollowingPackage : " jdk.internal"
26
+ - importTheFollowingPackage : " java.net"
27
+ - importTheFollowingPackage : " sun.reflect"
You can’t perform that action at this time.
0 commit comments