protected void addDependentsOf(IPath path, boolean isStructuralChange) { addDependentsOf(path, isStructuralChange, this.qualifiedStrings, this.simpleStrings, this.rootStrings); }
protected void addDependentsOf(IPath path, boolean isStructuralChange) { addDependentsOf(path, isStructuralChange, this.qualifiedStrings, this.simpleStrings, this.rootStrings); }
protected void addDependentsOf(IPath path, boolean isStructuralChange) { addDependentsOf(path, isStructuralChange, this.qualifiedStrings, this.simpleStrings, this.rootStrings); }
protected void addDependentsOf(IPath path, boolean isStructuralChange) { addDependentsOf(path, isStructuralChange, this.qualifiedStrings, this.simpleStrings, this.rootStrings); }
protected void addDependentsOf(IPath path, boolean isStructuralChange) { addDependentsOf(path, isStructuralChange, this.qualifiedStrings, this.simpleStrings, this.rootStrings); }
protected void addDependentsOf(IPath path, boolean isStructuralChange) { addDependentsOf(path, isStructuralChange, this.qualifiedStrings, this.simpleStrings, this.rootStrings); }
protected void rebuildTypesAffectedBySecondaryTypes() { // to compile types that could not find 'missing' secondary types because of multiple // compile groups, we need to incrementally recompile all affected types as if the missing // secondary types have just been added, see bug 146324 if (this.incrementalBuilder == null) this.incrementalBuilder = new IncrementalImageBuilder(this, this.compilationGroup); int count = this.secondaryTypes.size(); Set<String> qualifiedNames = new HashSet<>(count * 2); Set<String> simpleNames = new HashSet<>(count); Set<String> rootNames = new HashSet<>(3); while (--count >=0) { char[] secondaryTypeName = (char[]) this.secondaryTypes.get(count); IPath path = new Path(null, new String(secondaryTypeName)); this.incrementalBuilder.addDependentsOf(path, false, qualifiedNames, simpleNames, rootNames); } this.incrementalBuilder.addAffectedSourceFiles( qualifiedNames, simpleNames, rootNames, this.typeLocatorsWithUndefinedTypes); }
protected void removeClassFile(IPath typePath, IContainer outputFolder) throws CoreException { if (typePath.lastSegment().indexOf('$') == -1) { // is not a nested type this.newState.removeQualifiedTypeName(typePath.toString()); // add dependents even when the type thinks it does not exist to be on the safe side if (JavaBuilder.DEBUG) System.out.println("Found removed type " + typePath); //$NON-NLS-1$ addDependentsOf(typePath, true); // when member types are removed, their enclosing type is structurally changed } IFile classFile = outputFolder.getFile(typePath.addFileExtension(SuffixConstants.EXTENSION_class)); if (classFile.exists()) { if (JavaBuilder.DEBUG) System.out.println("Deleting class file of removed type " + typePath); //$NON-NLS-1$ classFile.delete(IResource.FORCE, null); } }
protected void rebuildTypesAffectedBySecondaryTypes() { // to compile types that could not find 'missing' secondary types because of multiple // compile groups, we need to incrementally recompile all affected types as if the missing // secondary types have just been added, see bug 146324 if (this.incrementalBuilder == null) this.incrementalBuilder = new IncrementalImageBuilder(this); int count = this.secondaryTypes.size(); StringSet qualifiedNames = new StringSet(count * 2); StringSet simpleNames = new StringSet(count); StringSet rootNames = new StringSet(3); while (--count >=0) { char[] secondaryTypeName = (char[]) this.secondaryTypes.get(count); IPath path = new Path(null, new String(secondaryTypeName)); this.incrementalBuilder.addDependentsOf(path, false, qualifiedNames, simpleNames, rootNames); } this.incrementalBuilder.addAffectedSourceFiles( qualifiedNames, simpleNames, rootNames, this.typeLocatorsWithUndefinedTypes); }
protected void rebuildTypesAffectedBySecondaryTypes() { // to compile types that could not find 'missing' secondary types because of multiple // compile groups, we need to incrementally recompile all affected types as if the missing // secondary types have just been added, see bug 146324 if (this.incrementalBuilder == null) this.incrementalBuilder = new IncrementalImageBuilder(this); int count = this.secondaryTypes.size(); StringSet qualifiedNames = new StringSet(count * 2); StringSet simpleNames = new StringSet(count); StringSet rootNames = new StringSet(3); while (--count >=0) { char[] secondaryTypeName = (char[]) this.secondaryTypes.get(count); IPath path = new Path(null, new String(secondaryTypeName)); this.incrementalBuilder.addDependentsOf(path, false, qualifiedNames, simpleNames, rootNames); } this.incrementalBuilder.addAffectedSourceFiles( qualifiedNames, simpleNames, rootNames, this.typeLocatorsWithUndefinedTypes); }
protected void rebuildTypesAffectedBySecondaryTypes() { // to compile types that could not find 'missing' secondary types because of multiple // compile groups, we need to incrementally recompile all affected types as if the missing // secondary types have just been added, see bug 146324 if (this.incrementalBuilder == null) this.incrementalBuilder = new IncrementalImageBuilder(this); int count = this.secondaryTypes.size(); StringSet qualifiedNames = new StringSet(count * 2); StringSet simpleNames = new StringSet(count); StringSet rootNames = new StringSet(3); while (--count >=0) { char[] secondaryTypeName = (char[]) this.secondaryTypes.get(count); IPath path = new Path(null, new String(secondaryTypeName)); this.incrementalBuilder.addDependentsOf(path, false, qualifiedNames, simpleNames, rootNames); } this.incrementalBuilder.addAffectedSourceFiles( qualifiedNames, simpleNames, rootNames, this.typeLocatorsWithUndefinedTypes); }
protected void removeClassFile(IPath typePath, IContainer outputFolder) throws CoreException { if (typePath.lastSegment().indexOf('$') == -1) { // is not a nested type this.newState.removeQualifiedTypeName(typePath.toString()); // add dependents even when the type thinks it does not exist to be on the safe side if (JavaBuilder.DEBUG) System.out.println("Found removed type " + typePath); //$NON-NLS-1$ addDependentsOf(typePath, true); // when member types are removed, their enclosing type is structurally changed } IFile classFile = outputFolder.getFile(typePath.addFileExtension(SuffixConstants.EXTENSION_class)); if (classFile.exists()) { if (JavaBuilder.DEBUG) System.out.println("Deleting class file of removed type " + typePath); //$NON-NLS-1$ classFile.delete(IResource.FORCE, null); } }
protected void removeClassFile(IPath typePath, IContainer outputFolder) throws CoreException { if (typePath.lastSegment().indexOf('$') == -1) { // is not a nested type this.newState.removeQualifiedTypeName(typePath.toString()); // add dependents even when the type thinks it does not exist to be on the safe side if (JavaBuilder.DEBUG) System.out.println("Found removed type " + typePath); //$NON-NLS-1$ addDependentsOf(typePath, true); // when member types are removed, their enclosing type is structurally changed } IFile classFile = outputFolder.getFile(typePath.addFileExtension(SuffixConstants.EXTENSION_class)); if (classFile.exists()) { if (JavaBuilder.DEBUG) System.out.println("Deleting class file of removed type " + typePath); //$NON-NLS-1$ classFile.delete(IResource.FORCE, null); } }
protected void rebuildTypesAffectedBySecondaryTypes() { // to compile types that could not find 'missing' secondary types because of multiple // compile groups, we need to incrementally recompile all affected types as if the missing // secondary types have just been added, see bug 146324 if (this.incrementalBuilder == null) this.incrementalBuilder = new IncrementalImageBuilder(this); int count = this.secondaryTypes.size(); StringSet qualifiedNames = new StringSet(count * 2); StringSet simpleNames = new StringSet(count); StringSet rootNames = new StringSet(3); while (--count >=0) { char[] secondaryTypeName = (char[]) this.secondaryTypes.get(count); IPath path = new Path(null, new String(secondaryTypeName)); this.incrementalBuilder.addDependentsOf(path, false, qualifiedNames, simpleNames, rootNames); } this.incrementalBuilder.addAffectedSourceFiles( qualifiedNames, simpleNames, rootNames, this.typeLocatorsWithUndefinedTypes); }
protected void rebuildTypesAffectedBySecondaryTypes() { // to compile types that could not find 'missing' secondary types because of multiple // compile groups, we need to incrementally recompile all affected types as if the missing // secondary types have just been added, see bug 146324 if (this.incrementalBuilder == null) this.incrementalBuilder = new IncrementalImageBuilder(this); int count = this.secondaryTypes.size(); StringSet qualifiedNames = new StringSet(count * 2); StringSet simpleNames = new StringSet(count); StringSet rootNames = new StringSet(3); while (--count >=0) { char[] secondaryTypeName = (char[]) this.secondaryTypes.get(count); IPath path = new Path(null, new String(secondaryTypeName)); this.incrementalBuilder.addDependentsOf(path, false, qualifiedNames, simpleNames, rootNames); } this.incrementalBuilder.addAffectedSourceFiles( qualifiedNames, simpleNames, rootNames, this.typeLocatorsWithUndefinedTypes); }
protected void removeClassFile(IPath typePath, IContainer outputFolder) throws CoreException { if (typePath.lastSegment().indexOf('$') == -1) { // is not a nested type this.newState.removeQualifiedTypeName(typePath.toString()); // add dependents even when the type thinks it does not exist to be on the safe side if (JavaBuilder.DEBUG) System.out.println("Found removed type " + typePath); //$NON-NLS-1$ addDependentsOf(typePath, true); // when member types are removed, their enclosing type is structurally changed } IFile classFile = outputFolder.getFile(typePath.addFileExtension(SuffixConstants.EXTENSION_class)); if (classFile.exists()) { if (JavaBuilder.DEBUG) System.out.println("Deleting class file of removed type " + typePath); //$NON-NLS-1$ classFile.delete(IResource.FORCE, null); } }
protected void removeClassFile(IPath typePath, IContainer outputFolder) throws CoreException { if (typePath.lastSegment().indexOf('$') == -1) { // is not a nested type this.newState.removeQualifiedTypeName(typePath.toString()); // add dependents even when the type thinks it does not exist to be on the safe side if (JavaBuilder.DEBUG) System.out.println("Found removed type " + typePath); //$NON-NLS-1$ addDependentsOf(typePath, true); // when member types are removed, their enclosing type is structurally changed } IFile classFile = outputFolder.getFile(typePath.addFileExtension(SuffixConstants.EXTENSION_class)); if (classFile.exists()) { if (JavaBuilder.DEBUG) System.out.println("Deleting class file of removed type " + typePath); //$NON-NLS-1$ classFile.delete(IResource.FORCE, null); } }
protected void removeClassFile(IPath typePath, IContainer outputFolder) throws CoreException { if (typePath.lastSegment().indexOf('$') == -1) { // is not a nested type this.newState.removeQualifiedTypeName(typePath.toString()); // add dependents even when the type thinks it does not exist to be on the safe side if (JavaBuilder.DEBUG) System.out.println("Found removed type " + typePath); //$NON-NLS-1$ addDependentsOf(typePath, true); // when member types are removed, their enclosing type is structurally changed } IFile classFile = outputFolder.getFile(typePath.addFileExtension(SuffixConstants.EXTENSION_class)); if (classFile.exists()) { if (JavaBuilder.DEBUG) System.out.println("Deleting class file of removed type " + typePath); //$NON-NLS-1$ classFile.delete(IResource.FORCE, null); } }
protected boolean writeClassFileCheck(IFile file, String fileName, byte[] newBytes) throws CoreException { try { byte[] oldBytes = Util.getResourceContentsAsByteArray(file); notEqual : if (newBytes.length == oldBytes.length) { for (int i = newBytes.length; --i >= 0;) if (newBytes[i] != oldBytes[i]) break notEqual; return false; // bytes are identical so skip them } URI location = file.getLocationURI(); if (location == null) return false; // unable to determine location of this class file String filePath = location.getSchemeSpecificPart(); ClassFileReader reader = new ClassFileReader(oldBytes, filePath.toCharArray()); // ignore local types since they're only visible inside a single method if (!(reader.isLocal() || reader.isAnonymous()) && reader.hasStructuralChanges(newBytes)) { if (JavaBuilder.DEBUG) System.out.println("Type has structural changes " + fileName); //$NON-NLS-1$ addDependentsOf(new Path(fileName), true); this.newState.wasStructurallyChanged(fileName); } } catch (ClassFormatException e) { addDependentsOf(new Path(fileName), true); this.newState.wasStructurallyChanged(fileName); } return true; }
protected boolean writeClassFileCheck(IFile file, String fileName, byte[] newBytes) throws CoreException { try { byte[] oldBytes = Util.getResourceContentsAsByteArray(file); notEqual : if (newBytes.length == oldBytes.length) { for (int i = newBytes.length; --i >= 0;) if (newBytes[i] != oldBytes[i]) break notEqual; return false; // bytes are identical so skip them } URI location = file.getLocationURI(); if (location == null) return false; // unable to determine location of this class file String filePath = location.getSchemeSpecificPart(); ClassFileReader reader = new ClassFileReader(oldBytes, filePath.toCharArray()); // ignore local types since they're only visible inside a single method if (!(reader.isLocal() || reader.isAnonymous()) && reader.hasStructuralChanges(newBytes)) { if (JavaBuilder.DEBUG) System.out.println("Type has structural changes " + fileName); //$NON-NLS-1$ addDependentsOf(new Path(fileName), true); this.newState.wasStructurallyChanged(fileName); } } catch (ClassFormatException e) { addDependentsOf(new Path(fileName), true); this.newState.wasStructurallyChanged(fileName); } return true; }