public void conflictingPackagesFromOtherModules(ImportReference currentPackage, Set<ModuleBinding> declaringModules) { String moduleNames = declaringModules.stream() .map(p -> String.valueOf(p.name())) .sorted() .collect(Collectors.joining(", ")); //$NON-NLS-1$ String[] arguments = new String[] { CharOperation.toString(currentPackage.tokens), moduleNames }; this.handle(IProblem.ConflictingPackageFromOtherModules, arguments, arguments, currentPackage.sourceStart, currentPackage.sourceEnd); } public void incompatibleExceptionInThrowsClause(SourceTypeBinding type, MethodBinding currentMethod, MethodBinding inheritedMethod, ReferenceBinding exceptionType) {
public void conflictingPackagesFromOtherModules(ImportReference currentPackage, Set<ModuleBinding> declaringModules) { String moduleNames = declaringModules.stream() .map(p -> String.valueOf(p.name())) .sorted() .collect(Collectors.joining(", ")); //$NON-NLS-1$ String[] arguments = new String[] { CharOperation.toString(currentPackage.tokens), moduleNames }; this.handle(IProblem.ConflictingPackageFromOtherModules, arguments, arguments, currentPackage.sourceStart, currentPackage.sourceEnd); } public void incompatibleExceptionInThrowsClause(SourceTypeBinding type, MethodBinding currentMethod, MethodBinding inheritedMethod, ReferenceBinding exceptionType) {
public void conflictingPackagesFromModules(PackageBinding pack, Set<ModuleBinding> modules, int sourceStart, int sourceEnd) { String moduleNames = modules.stream() .map(p -> String.valueOf(p.name())) .sorted() .collect(Collectors.joining(", ")); //$NON-NLS-1$ String[] arguments = new String[] { CharOperation.toString(pack.compoundName), moduleNames }; this.handle( IProblem.ConflictingPackageFromModules, arguments, arguments, sourceStart, sourceEnd); } public void conflictingPackagesFromOtherModules(ImportReference currentPackage, Set<ModuleBinding> declaringModules) {
public void conflictingPackagesFromModules(PackageBinding pack, Set<ModuleBinding> modules, int sourceStart, int sourceEnd) { String moduleNames = modules.stream() .map(p -> String.valueOf(p.name())) .sorted() .collect(Collectors.joining(", ")); //$NON-NLS-1$ String[] arguments = new String[] { CharOperation.toString(pack.compoundName), moduleNames }; this.handle( IProblem.ConflictingPackageFromModules, arguments, arguments, sourceStart, sourceEnd); } public void conflictingPackagesFromOtherModules(ImportReference currentPackage, Set<ModuleBinding> declaringModules) {
public void deprecatedModule(ModuleReference moduleReference, ModuleBinding requiredModule) { String sinceValue = deprecatedSinceValue(() -> requiredModule.getAnnotations()); boolean isTerminally = (requiredModule.tagBits & TagBits.AnnotationTerminallyDeprecated) != 0; if (sinceValue != null) { String[] args = { String.valueOf(requiredModule.name()), sinceValue }; handle( isTerminally ? IProblem.UsingTerminallyDeprecatedSinceVersionModule : IProblem.UsingDeprecatedSinceVersionModule, args, args, moduleReference.sourceStart, moduleReference.sourceEnd); } else { String[] args = { String.valueOf(requiredModule.name()) }; handle( isTerminally ? IProblem.UsingTerminallyDeprecatedModule : IProblem.UsingDeprecatedModule, args, args, moduleReference.sourceStart, moduleReference.sourceEnd); } } String deprecatedSinceValue(Supplier<AnnotationBinding[]> annotations) {
private void matchModuleReferences(MatchLocator locator, ModulePattern modulePattern, ModuleBinding[] refs) throws CoreException { if (refs == null) return; for (ModuleBinding ref : refs) { char[] name = ref.name(); if (name == null) continue; int level = locator.patternLocator.resolveLevel(ref); if (level == PatternLocator.IMPOSSIBLE_MATCH) continue; int accuracy = level == PatternLocator.ACCURATE_MATCH ? SearchMatch.A_ACCURATE : SearchMatch.A_INACCURATE; ModuleReferenceMatch match = locator.newModuleReferenceMatch(this.moduleDesc, null, accuracy, -1, 0, null); locator.report(match); } } private void matchPackageReferences(SearchPattern pattern, MatchLocator locator) throws CoreException {
private void matchModuleReferences(MatchLocator locator, ModulePattern modulePattern, ModuleBinding[] refs) throws CoreException { if (refs == null) return; for (ModuleBinding ref : refs) { char[] name = ref.name(); if (name == null) continue; int level = locator.patternLocator.resolveLevel(ref); if (level == PatternLocator.IMPOSSIBLE_MATCH) continue; int accuracy = level == PatternLocator.ACCURATE_MATCH ? SearchMatch.A_ACCURATE : SearchMatch.A_INACCURATE; ModuleReferenceMatch match = locator.newModuleReferenceMatch(this.moduleDesc, null, accuracy, -1, 0, null); locator.report(match); } } private void matchPackageReferences(SearchPattern pattern, MatchLocator locator) throws CoreException {
return restrictions.includes(ALL_UNNAMED); else return restrictions.includes(client.name());
return restrictions.includes(ALL_UNNAMED); else return restrictions.includes(client.name());