/** * @deprecated */ public boolean includes(char[][][] qualifiedNames, char[][] simpleNames) { return includes(qualifiedNames, simpleNames, null); }
protected ReferenceCollection(char[][][] qualifiedNameReferences, char[][] simpleNameReferences, char[][] rootReferences) { this.qualifiedNameReferences = internQualifiedNames(qualifiedNameReferences, false); this.simpleNameReferences = internSimpleNames(simpleNameReferences, true); this.rootReferences = internSimpleNames(rootReferences, false); }
protected void addAffectedSourceFiles(Set<String> qualifiedSet, Set<String> simpleSet, Set<String> rootSet, Set<String> affectedTypes) { char[][][] internedQualifiedNames = ReferenceCollection.internQualifiedNames(qualifiedSet); char[][] internedSimpleNames = ReferenceCollection.internSimpleNames(simpleSet, true); char[][] internedRootNames = ReferenceCollection.internSimpleNames(rootSet, false); if (affectedTypes != null && !affectedTypes.contains(typeLocator)) continue next; ReferenceCollection refs = (ReferenceCollection) valueTable[i]; if (refs.includes(internedQualifiedNames, internedSimpleNames, internedRootNames)) { IFile file = this.javaBuilder.currentProject.getFile(typeLocator); SourceFile sourceFile = findSourceFile(file, true);
for (int i = typeNameDependencies.length; --i >= 0;) qNames[i] = CharOperation.splitOn('.', typeNameDependencies[i].toCharArray()); qNames = internQualifiedNames(qNames, false); while (!includes(qualifiedTypeName)) { if (!includes(qualifiedTypeName[qualifiedTypeName.length - 1])) { int length = this.simpleNameReferences.length; System.arraycopy(this.simpleNameReferences, 0, this.simpleNameReferences = new char[length + 1][], 0, length); this.simpleNameReferences[length] = qualifiedTypeName[qualifiedTypeName.length - 1]; if (!insideRoot(qualifiedTypeName[0])) { int length = this.rootReferences.length; System.arraycopy(this.rootReferences, 0, this.rootReferences = new char[length + 1][], 0, length); char[][][] temp = internQualifiedNames(new char[][][] {qualifiedTypeName}, false); if (temp == EmptyQualifiedNames) continue next; // qualifiedTypeName is a well known name
newState.recordLocatorForType(in.readUTF(), internedTypeLocators[in.readInt()]); char[][] internedRootNames = ReferenceCollection.internSimpleNames(readNames(in), false); char[][] internedSimpleNames = ReferenceCollection.internSimpleNames(readNames(in), false); char[][][] internedQualifiedNames = new char[length = in.readInt()][][]; for (int i = 0; i < length; i++) { internedQualifiedNames[i] = qName; internedQualifiedNames = ReferenceCollection.internQualifiedNames(internedQualifiedNames, false); for (int j = 0, m = rNames.length; j < m; j++) rNames[j] = internedRootNames[in.readInt()]; collection = new ReferenceCollection(qNames, sNames, rNames);
boolean foundRoot = false; for (int i = 0, l = rootNames.length; !foundRoot && i < l; i++) foundRoot = insideRoot(rootNames[i]); if (!foundRoot) return false; } else if (qualifiedNames == null) { for (int i = 0, l = simpleNames.length; i < l; i++) { if (includes(simpleNames[i])) { if (JavaBuilder.DEBUG) System.out.println("Found match in well known package to " + new String(simpleNames[i])); //$NON-NLS-1$ for (int i = 0, l = qualifiedNames.length; i < l; i++) { char[][] qualifiedName = qualifiedNames[i]; if (qualifiedName.length == 1 ? includes(qualifiedName[0]) : includes(qualifiedName)) { if (JavaBuilder.DEBUG) System.out.println("Found well known match in " + CharOperation.toString(qualifiedName)); //$NON-NLS-1$ if (sLength <= qLength) { for (int i = 0; i < sLength; i++) { if (includes(simpleNames[i])) { for (int j = 0; j < qLength; j++) { char[][] qualifiedName = qualifiedNames[j]; if (qualifiedName.length == 1 ? includes(qualifiedName[0]) : includes(qualifiedName)) { if (JavaBuilder.DEBUG) System.out.println("Found match in " + CharOperation.toString(qualifiedName) //$NON-NLS-1$ for (int i = 0; i < qLength; i++) { char[][] qualifiedName = qualifiedNames[i];
/** * @deprecated */ public static char[][] internSimpleNames(StringSet simpleStrings) { return internSimpleNames(simpleStrings, true); }
public static char[][][] internQualifiedNames(char[][][] qualifiedNames) { return internQualifiedNames(qualifiedNames, false); }
void record(String typeLocator, char[][][] qualifiedRefs, char[][] simpleRefs, char[][] rootRefs, char[] mainTypeName, ArrayList typeNames) { if (typeNames.size() == 1 && CharOperation.equals(mainTypeName, (char[]) typeNames.get(0))) { this.references.put(typeLocator, new ReferenceCollection(qualifiedRefs, simpleRefs, rootRefs)); } else { char[][] definedTypeNames = new char[typeNames.size()][]; // can be empty when no types are defined typeNames.toArray(definedTypeNames); this.references.put(typeLocator, new AdditionalTypeCollection(definedTypeNames, qualifiedRefs, simpleRefs, rootRefs)); } }
protected void recordParticipantResult(CompilationParticipantResult result) { // any added/changed/deleted generated files have already been taken care // just record the problems and dependencies - do not expect there to be many // must be called after we're finished with the compilation unit results but before incremental loop adds affected files CategorizedProblem[] problems = result.problems; if (problems != null && problems.length > 0) { // existing problems have already been removed so just add these as new problems this.notifier.updateProblemCounts(problems); try { storeProblemsFor(result.sourceFile, problems); } catch (CoreException e) { // must continue with compile loop so just log the CoreException Util.log(e, "JavaBuilder logging CompilationParticipant's CoreException to help debugging"); //$NON-NLS-1$ } } String[] dependencies = result.dependencies; if (dependencies != null) { ReferenceCollection refs = (ReferenceCollection) this.newState.references.get(result.sourceFile.typeLocator()); if (refs != null) refs.addDependencies(dependencies); } }
protected void addAffectedSourceFiles(StringSet qualifiedSet, StringSet simpleSet, StringSet rootSet, StringSet affectedTypes) { char[][][] internedQualifiedNames = ReferenceCollection.internQualifiedNames(qualifiedSet); char[][] internedSimpleNames = ReferenceCollection.internSimpleNames(simpleSet, true); char[][] internedRootNames = ReferenceCollection.internSimpleNames(rootSet, false); if (affectedTypes != null && !affectedTypes.includes(typeLocator)) continue next; ReferenceCollection refs = (ReferenceCollection) valueTable[i]; if (refs.includes(internedQualifiedNames, internedSimpleNames, internedRootNames)) { IFile file = this.javaBuilder.currentProject.getFile(typeLocator); SourceFile sourceFile = findSourceFile(file, true);
for (int i = typeNameDependencies.length; --i >= 0;) qNames[i] = CharOperation.splitOn('.', typeNameDependencies[i].toCharArray()); qNames = internQualifiedNames(qNames, false); while (!includes(qualifiedTypeName)) { if (!includes(qualifiedTypeName[qualifiedTypeName.length - 1])) { int length = this.simpleNameReferences.length; System.arraycopy(this.simpleNameReferences, 0, this.simpleNameReferences = new char[length + 1][], 0, length); this.simpleNameReferences[length] = qualifiedTypeName[qualifiedTypeName.length - 1]; if (!insideRoot(qualifiedTypeName[0])) { int length = this.rootReferences.length; System.arraycopy(this.rootReferences, 0, this.rootReferences = new char[length + 1][], 0, length); char[][][] temp = internQualifiedNames(new char[][][] {qualifiedTypeName}, false); if (temp == EmptyQualifiedNames) continue next; // qualifiedTypeName is a well known name
newState.recordLocatorForType(in.readUTF(), internedTypeLocators[in.readInt()]); char[][] internedRootNames = ReferenceCollection.internSimpleNames(readNames(in), false); char[][] internedSimpleNames = ReferenceCollection.internSimpleNames(readNames(in), false); char[][][] internedQualifiedNames = new char[length = in.readInt()][][]; for (int i = 0; i < length; i++) { internedQualifiedNames[i] = qName; internedQualifiedNames = ReferenceCollection.internQualifiedNames(internedQualifiedNames, false); for (int j = 0, m = rNames.length; j < m; j++) rNames[j] = internedRootNames[in.readInt()]; collection = new ReferenceCollection(qNames, sNames, rNames);
boolean foundRoot = false; for (int i = 0, l = rootNames.length; !foundRoot && i < l; i++) foundRoot = insideRoot(rootNames[i]); if (!foundRoot) return false; } else if (qualifiedNames == null) { for (int i = 0, l = simpleNames.length; i < l; i++) { if (includes(simpleNames[i])) { if (JavaBuilder.DEBUG) System.out.println("Found match in well known package to " + new String(simpleNames[i])); //$NON-NLS-1$ for (int i = 0, l = qualifiedNames.length; i < l; i++) { char[][] qualifiedName = qualifiedNames[i]; if (qualifiedName.length == 1 ? includes(qualifiedName[0]) : includes(qualifiedName)) { if (JavaBuilder.DEBUG) System.out.println("Found well known match in " + CharOperation.toString(qualifiedName)); //$NON-NLS-1$ if (sLength <= qLength) { for (int i = 0; i < sLength; i++) { if (includes(simpleNames[i])) { for (int j = 0; j < qLength; j++) { char[][] qualifiedName = qualifiedNames[j]; if (qualifiedName.length == 1 ? includes(qualifiedName[0]) : includes(qualifiedName)) { if (JavaBuilder.DEBUG) System.out.println("Found match in " + CharOperation.toString(qualifiedName) //$NON-NLS-1$ for (int i = 0; i < qLength; i++) { char[][] qualifiedName = qualifiedNames[i];
/** * @deprecated */ public static char[][] internSimpleNames(StringSet simpleStrings) { return internSimpleNames(simpleStrings, true); }
public static char[][][] internQualifiedNames(char[][][] qualifiedNames) { return internQualifiedNames(qualifiedNames, false); }
void record(String typeLocator, char[][][] qualifiedRefs, char[][] simpleRefs, char[][] rootRefs, char[] mainTypeName, ArrayList typeNames) { if (typeNames.size() == 1 && CharOperation.equals(mainTypeName, (char[]) typeNames.get(0))) { this.references.put(typeLocator, new ReferenceCollection(qualifiedRefs, simpleRefs, rootRefs)); } else { char[][] definedTypeNames = new char[typeNames.size()][]; // can be empty when no types are defined typeNames.toArray(definedTypeNames); this.references.put(typeLocator, new AdditionalTypeCollection(definedTypeNames, qualifiedRefs, simpleRefs, rootRefs)); } }
protected void recordParticipantResult(CompilationParticipantResult result) { // any added/changed/deleted generated files have already been taken care // just record the problems and dependencies - do not expect there to be many // must be called after we're finished with the compilation unit results but before incremental loop adds affected files CategorizedProblem[] problems = result.problems; if (problems != null && problems.length > 0) { // existing problems have already been removed so just add these as new problems this.notifier.updateProblemCounts(problems); try { storeProblemsFor(result.sourceFile, problems); } catch (CoreException e) { // must continue with compile loop so just log the CoreException Util.log(e, "JavaBuilder logging CompilationParticipant's CoreException to help debugging"); //$NON-NLS-1$ } } String[] dependencies = result.dependencies; if (dependencies != null) { ReferenceCollection refs = (ReferenceCollection) this.newState.references.get(result.sourceFile.typeLocator()); if (refs != null) refs.addDependencies(dependencies); } }
protected void addAffectedSourceFiles(StringSet qualifiedSet, StringSet simpleSet, StringSet rootSet, StringSet affectedTypes) { char[][][] internedQualifiedNames = ReferenceCollection.internQualifiedNames(qualifiedSet); char[][] internedSimpleNames = ReferenceCollection.internSimpleNames(simpleSet, true); char[][] internedRootNames = ReferenceCollection.internSimpleNames(rootSet, false); if (affectedTypes != null && !affectedTypes.includes(typeLocator)) continue next; ReferenceCollection refs = (ReferenceCollection) valueTable[i]; if (refs.includes(internedQualifiedNames, internedSimpleNames, internedRootNames)) { IFile file = this.javaBuilder.currentProject.getFile(typeLocator); SourceFile sourceFile = findSourceFile(file, true);
for (int i = typeNameDependencies.length; --i >= 0;) qNames[i] = CharOperation.splitOn('.', typeNameDependencies[i].toCharArray()); qNames = internQualifiedNames(qNames, false); while (!includes(qualifiedTypeName)) { if (!includes(qualifiedTypeName[qualifiedTypeName.length - 1])) { int length = this.simpleNameReferences.length; System.arraycopy(this.simpleNameReferences, 0, this.simpleNameReferences = new char[length + 1][], 0, length); this.simpleNameReferences[length] = qualifiedTypeName[qualifiedTypeName.length - 1]; if (!insideRoot(qualifiedTypeName[0])) { int length = this.rootReferences.length; System.arraycopy(this.rootReferences, 0, this.rootReferences = new char[length + 1][], 0, length); char[][][] temp = internQualifiedNames(new char[][][] {qualifiedTypeName}, false); if (temp == EmptyQualifiedNames) continue next; // qualifiedTypeName is a well known name