@Test public void shouldSupportInvocationsOnArrayTypes() throws Exception { ConflictChecker checker = new ConflictChecker(); final List<Conflict> conflicts = checker.check(projectArtifact, Arrays.asList(projectArtifact, rt), Arrays.asList(projectArtifact, rt) ); assertThat(conflicts).isEmpty(); }
public List<Conflict> check(Artifact projectArtifact, List<Artifact> artifactsToCheck, List<Artifact> allArtifacts) { final CheckerStateBuilder stateBuilder = new CheckerStateBuilder(); createCanonicalClassMapping(stateBuilder, allArtifacts); CheckerState state = stateBuilder.build(); Set<TypeDescriptor> reachableClasses = reachableFrom(projectArtifact.classes().values(), state.knownClasses()); final List<Conflict> conflicts = new ArrayList<>(); for (Artifact artifact : artifactsToCheck) { for (DeclaredClass clazz : artifact.classes().values()) { if (!reachableClasses.contains(clazz.className())) { continue; } for (DeclaredMethod method : clazz.methods().values()) { conflicts.addAll(checkForBrokenMethodCalls(state, artifact, clazz, method)); conflicts.addAll(checkForBrokenFieldAccess(state, artifact, clazz, method)); } } } return conflicts; }
ConflictChecker { public List<Conflict> check(Artifact projectArtifact, List<Artifact> artifactsToCheck, List<Artifact> allArtifacts) { final CheckerStateBuilder stateBuilder = new CheckerStateBuilder(); createCanonicalClassMapping(stateBuilder, allArtifacts); CheckerState state = stateBuilder.build(); Set<TypeDescriptor> reachableClasses = reachableFrom(projectArtifact.classes().values(), state.knownClasses()); final List<Conflict> conflicts = new ArrayList<>(); for (Artifact artifact : artifactsToCheck) { for (DeclaredClass clazz : artifact.classes().values()) { if (!reachableClasses.contains(clazz.className())) { continue; } for (DeclaredMethod method : clazz.methods().values()) { conflicts.addAll(checkForBrokenMethodCalls(state, artifact, clazz, method)); conflicts.addAll(checkForBrokenFieldAccess(state, artifact, clazz, method)); } } } return conflicts; } }
ConflictChecker { public List<Conflict> check(Artifact projectArtifact, List<Artifact> artifactsToCheck, List<Artifact> allArtifacts) { final CheckerStateBuilder stateBuilder = new CheckerStateBuilder(); createCanonicalClassMapping(stateBuilder, allArtifacts); CheckerState state = stateBuilder.build(); Set<TypeDescriptor> reachableClasses = reachableFrom(projectArtifact.classes().values(), state.knownClasses()); final List<Conflict> conflicts = new ArrayList<>(); for (Artifact artifact : artifactsToCheck) { for (DeclaredClass clazz : artifact.classes().values()) { if (!reachableClasses.contains(clazz.className())) { continue; } for (DeclaredMethod method : clazz.methods().values()) { conflicts.addAll(checkForBrokenMethodCalls(state, artifact, clazz, method)); conflicts.addAll(checkForBrokenFieldAccess(state, artifact, clazz, method)); } } } return conflicts; }  }
ConflictChecker { public List<Conflict> check(Artifact projectArtifact, List<Artifact> artifactsToCheck, List<Artifact> allArtifacts) { final CheckerStateBuilder stateBuilder = new CheckerStateBuilder(); createCanonicalClassMapping(stateBuilder, allArtifacts); CheckerState state = stateBuilder.build(); Set<TypeDescriptor> reachableClasses = reachableFrom(projectArtifact.classes().values(), state.knownClasses()); final List<Conflict> conflicts = new ArrayList<>(); for (Artifact artifact : artifactsToCheck) { for (DeclaredClass clazz : artifact.classes().values()) { if (!reachableClasses.contains(clazz.className())) { continue; } for (DeclaredMethod method : clazz.methods().values()) { conflicts.addAll(checkForBrokenMethodCalls(state, artifact, clazz, method)); conflicts.addAll(checkForBrokenFieldAccess(state, artifact, clazz, method)); } } } return conflicts; }  List<Conflict> check(Artifact projectArtifact,
                              List<Artifact> artifactsToCheck,
                              List<Artifact> allArtifacts); }
ConflictChecker { public List<Conflict> check(Artifact projectArtifact, List<Artifact> artifactsToCheck, List<Artifact> allArtifacts) { final CheckerStateBuilder stateBuilder = new CheckerStateBuilder(); createCanonicalClassMapping(stateBuilder, allArtifacts); CheckerState state = stateBuilder.build(); Set<TypeDescriptor> reachableClasses = reachableFrom(projectArtifact.classes().values(), state.knownClasses()); final List<Conflict> conflicts = new ArrayList<>(); for (Artifact artifact : artifactsToCheck) { for (DeclaredClass clazz : artifact.classes().values()) { if (!reachableClasses.contains(clazz.className())) { continue; } for (DeclaredMethod method : clazz.methods().values()) { conflicts.addAll(checkForBrokenMethodCalls(state, artifact, clazz, method)); conflicts.addAll(checkForBrokenFieldAccess(state, artifact, clazz, method)); } } } return conflicts; }  List<Conflict> check(Artifact projectArtifact,
                              List<Artifact> artifactsToCheck,
                              List<Artifact> allArtifacts); static final ArtifactName UNKNOWN_ARTIFACT_NAME; }