-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JavaClasses of Arrays (e.g. com.myapp.SomeClass[]) now have getPackag…
…eName() == 'com.myapp' instead of '' like before. This change is due to the fact that users usually want to see a dependency com.foo -> com.bar, if a Class com.foo.Foo declares and array com.bar.Bar[]. Note that array types can never be directly imported and thus will always have attached a simple JavaPackage object containing only themselves (like stubs). Signed-off-by: Peter Gafert <[email protected]>
- Loading branch information
1 parent
f212109
commit cf6461f
Showing
10 changed files
with
120 additions
and
38 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
.../src/main/java/com/tngtech/archunit/example/cycle/complexcycles/slice1/UnrelatedEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.tngtech.archunit.example.cycle.complexcycles.slice1; | ||
|
||
// This was just added for the integration tests since it creates some synthetic byte code | ||
@SuppressWarnings("SwitchStatementWithTooFewBranches") | ||
public enum UnrelatedEnum { | ||
INSTANCE; | ||
|
||
static void doSomeSwitching(UnrelatedEnum unrelatedEnum) { | ||
switch (unrelatedEnum) { | ||
case INSTANCE: | ||
throw new UnsupportedOperationException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...tngtech/archunit/core/importer/testexamples/arrays/ClassAccessingOneDimensionalArray.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.tngtech.archunit.core.importer.testexamples.arrays; | ||
|
||
public class ClassAccessingOneDimensionalArray { | ||
ClassUsedInArray[] array; | ||
|
||
ClassUsedInArray access() { | ||
return array[1]; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...tngtech/archunit/core/importer/testexamples/arrays/ClassAccessingTwoDimensionalArray.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.tngtech.archunit.core.importer.testexamples.arrays; | ||
|
||
@SuppressWarnings({"WeakerAccess", "unused"}) | ||
public class ClassAccessingTwoDimensionalArray { | ||
ClassUsedInArray[][] array; | ||
|
||
ClassUsedInArray access() { | ||
return array[1][1]; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...rc/test/java/com/tngtech/archunit/core/importer/testexamples/arrays/ClassUsedInArray.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.tngtech.archunit.core.importer.testexamples.arrays; | ||
|
||
public class ClassUsedInArray { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters