/** * Check if the receiver has structural changes compare to the byte array in argument. * Structural changes are: * - modifiers changes for the class, the this.fields or the this.methods * - signature changes for this.fields or this.methods. * - changes in the number of this.fields or this.methods * - changes for field constants * - changes for thrown exceptions * - change for the super class or any super interfaces. * - changes for member types name or modifiers * If any of these changes occurs, the method returns true. false otherwise. * The synthetic fields are included and the members are not required to be sorted. * @param newBytes the bytes of the .class file we want to compare the receiver to * @return boolean Returns true is there is a structural change between the two .class files, false otherwise */ public boolean hasStructuralChanges(byte[] newBytes) { return hasStructuralChanges(newBytes, true, true); }
/** * Check if the receiver has structural changes compare to the byte array in argument. * Structural changes are: * - modifiers changes for the class, the this.fields or the this.methods * - signature changes for this.fields or this.methods. * - changes in the number of this.fields or this.methods * - changes for field constants * - changes for thrown exceptions * - change for the super class or any super interfaces. * - changes for member types name or modifiers * If any of these changes occurs, the method returns true. false otherwise. * The synthetic fields are included and the members are not required to be sorted. * @param newBytes the bytes of the .class file we want to compare the receiver to * @return boolean Returns true is there is a structural change between the two .class files, false otherwise */ public boolean hasStructuralChanges(byte[] newBytes) { return hasStructuralChanges(newBytes, true, true); }
/** * Check if the receiver has structural changes compare to the byte array in argument. * Structural changes are: * - modifiers changes for the class, the this.fields or the this.methods * - signature changes for this.fields or this.methods. * - changes in the number of this.fields or this.methods * - changes for field constants * - changes for thrown exceptions * - change for the super class or any super interfaces. * - changes for member types name or modifiers * If any of these changes occurs, the method returns true. false otherwise. * The synthetic fields are included and the members are not required to be sorted. * @param newBytes the bytes of the .class file we want to compare the receiver to * @return boolean Returns true is there is a structural change between the two .class files, false otherwise */ public boolean hasStructuralChanges(byte[] newBytes) { return hasStructuralChanges(newBytes, true, true); }
/** * Check if the receiver has structural changes compare to the byte array in argument. * Structural changes are: * - modifiers changes for the class, the this.fields or the this.methods * - signature changes for this.fields or this.methods. * - changes in the number of this.fields or this.methods * - changes for field constants * - changes for thrown exceptions * - change for the super class or any super interfaces. * - changes for member types name or modifiers * If any of these changes occurs, the method returns true. false otherwise. * The synthetic fields are included and the members are not required to be sorted. * @param newBytes the bytes of the .class file we want to compare the receiver to * @return boolean Returns true is there is a structural change between the two .class files, false otherwise */ public boolean hasStructuralChanges(byte[] newBytes) { return hasStructuralChanges(newBytes, true, true); }
/** * Check if the receiver has structural changes compare to the byte array in argument. * Structural changes are: * - modifiers changes for the class, the this.fields or the this.methods * - signature changes for this.fields or this.methods. * - changes in the number of this.fields or this.methods * - changes for field constants * - changes for thrown exceptions * - change for the super class or any super interfaces. * - changes for member types name or modifiers * If any of these changes occurs, the method returns true. false otherwise. * The synthetic fields are included and the members are not required to be sorted. * @param newBytes the bytes of the .class file we want to compare the receiver to * @return boolean Returns true is there is a structural change between the two .class files, false otherwise */ public boolean hasStructuralChanges(byte[] newBytes) { return hasStructuralChanges(newBytes, true, true); }
/** * Check if the receiver has structural changes compare to the byte array in argument. * Structural changes are: * - modifiers changes for the class, the this.fields or the this.methods * - signature changes for this.fields or this.methods. * - changes in the number of this.fields or this.methods * - changes for field constants * - changes for thrown exceptions * - change for the super class or any super interfaces. * - changes for member types name or modifiers * If any of these changes occurs, the method returns true. false otherwise. * The synthetic fields are included and the members are not required to be sorted. * @param newBytes the bytes of the .class file we want to compare the receiver to * @return boolean Returns true is there is a structural change between the two .class files, false otherwise */ public boolean hasStructuralChanges(byte[] newBytes) { return hasStructuralChanges(newBytes, true, true); }
/** * Check if the receiver has structural changes compare to the byte array in argument. * Structural changes are: * - modifiers changes for the class, the this.fields or the this.methods * - signature changes for this.fields or this.methods. * - changes in the number of this.fields or this.methods * - changes for field constants * - changes for thrown exceptions * - change for the super class or any super interfaces. * - changes for member types name or modifiers * If any of these changes occurs, the method returns true. false otherwise. * The synthetic fields are included and the members are not required to be sorted. * @param newBytes the bytes of the .class file we want to compare the receiver to * @return boolean Returns true is there is a structural change between the two .class files, false otherwise */ public boolean hasStructuralChanges(byte[] newBytes) { return hasStructuralChanges(newBytes, true, true); }
/** * Check if the receiver has structural changes compare to the byte array in argument. * Structural changes are: * - modifiers changes for the class, the this.fields or the this.methods * - signature changes for this.fields or this.methods. * - changes in the number of this.fields or this.methods * - changes for field constants * - changes for thrown exceptions * - change for the super class or any super interfaces. * - changes for member types name or modifiers * If any of these changes occurs, the method returns true. false otherwise. * The synthetic fields are included and the members are not required to be sorted. * @param newBytes the bytes of the .class file we want to compare the receiver to * @return boolean Returns true is there is a structural change between the two .class files, false otherwise */ public boolean hasStructuralChanges(byte[] newBytes) { return hasStructuralChanges(newBytes, true, true); }
/** * Check if the receiver has structural changes compare to the byte array in argument. * Structural changes are: * - modifiers changes for the class, the this.fields or the this.methods * - signature changes for this.fields or this.methods. * - changes in the number of this.fields or this.methods * - changes for field constants * - changes for thrown exceptions * - change for the super class or any super interfaces. * - changes for member types name or modifiers * If any of these changes occurs, the method returns true. false otherwise. * The synthetic fields are included and the members are not required to be sorted. * @param newBytes the bytes of the .class file we want to compare the receiver to * @return boolean Returns true is there is a structural change between the two .class files, false otherwise */ public boolean hasStructuralChanges(byte[] newBytes) { return hasStructuralChanges(newBytes, true, true); }
/** * Check if the receiver has structural changes compare to the byte array in argument. * Structural changes are: * - modifiers changes for the class, the this.fields or the this.methods * - signature changes for this.fields or this.methods. * - changes in the number of this.fields or this.methods * - changes for field constants * - changes for thrown exceptions * - change for the super class or any super interfaces. * - changes for member types name or modifiers * If any of these changes occurs, the method returns true. false otherwise. * The synthetic fields are included and the members are not required to be sorted. * @param newBytes the bytes of the .class file we want to compare the receiver to * @return boolean Returns true is there is a structural change between the two .class files, false otherwise */ public boolean hasStructuralChanges(byte[] newBytes) { return hasStructuralChanges(newBytes, true, true); }
/** * Check if the receiver has structural changes compare to the byte array in argument. * Structural changes are: * - modifiers changes for the class, the this.fields or the this.methods * - signature changes for this.fields or this.methods. * - changes in the number of this.fields or this.methods * - changes for field constants * - changes for thrown exceptions * - change for the super class or any super interfaces. * - changes for member types name or modifiers * If any of these changes occurs, the method returns true. false otherwise. * The synthetic fields are included and the members are not required to be sorted. * @param newBytes the bytes of the .class file we want to compare the receiver to * @return boolean Returns true is there is a structural change between the two .class files, false otherwise */ public boolean hasStructuralChanges(byte[] newBytes) { return hasStructuralChanges(newBytes, true, 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; }
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; }
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; }
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; }