/** * Writes the classpath in a sharable format (VCM-wise) only when necessary, that is, if it is semantically different * from the existing one in file. Will never write an identical one. * * @param newClasspath IClasspathEntry[] * @param newOutputLocation IPath * @return boolean Return whether the .classpath file was modified. * @throws JavaModelException */ public boolean writeFileEntries(IClasspathEntry[] newClasspath, IClasspathEntry[] referencedEntries, IPath newOutputLocation) throws JavaModelException { if (!this.project.isAccessible()) return false; Map unknownElements = new HashMap(); IClasspathEntry[][] fileEntries = readFileEntries(unknownElements); if (fileEntries[0] != JavaProject.INVALID_CLASSPATH && areClasspathsEqual(newClasspath, newOutputLocation, fileEntries[0]) && (referencedEntries == null || areClasspathsEqual(referencedEntries, fileEntries[1])) ) { // no need to save it, it is the same return false; } // actual file saving try { setSharedProperty(JavaProject.CLASSPATH_FILENAME, encodeClasspath(newClasspath, referencedEntries, newOutputLocation, true, unknownElements)); return true; } catch (CoreException e) { throw new JavaModelException(e); } } public boolean writeFileEntries(IClasspathEntry[] newClasspath, IPath newOutputLocation) throws JavaModelException {
/** * Writes the classpath in a sharable format (VCM-wise) only when necessary, that is, if it is semantically different * from the existing one in file. Will never write an identical one. * * @param newClasspath IClasspathEntry[] * @param newOutputLocation IPath * @return boolean Return whether the .classpath file was modified. * @throws JavaModelException */ public boolean writeFileEntries(IClasspathEntry[] newClasspath, IClasspathEntry[] referencedEntries, IPath newOutputLocation) throws JavaModelException { if (!this.project.isAccessible()) return false; Map unknownElements = new HashMap(); IClasspathEntry[][] fileEntries = readFileEntries(unknownElements); if (fileEntries[0] != JavaProject.INVALID_CLASSPATH && areClasspathsEqual(newClasspath, newOutputLocation, fileEntries[0]) && (referencedEntries == null || areClasspathsEqual(referencedEntries, fileEntries[1])) ) { // no need to save it, it is the same return false; } // actual file saving try { setSharedProperty(JavaProject.CLASSPATH_FILENAME, encodeClasspath(newClasspath, referencedEntries, newOutputLocation, true, unknownElements)); return true; } catch (CoreException e) { throw new JavaModelException(e); } } public boolean writeFileEntries(IClasspathEntry[] newClasspath, IPath newOutputLocation) throws JavaModelException {
/** * Writes the classpath in a sharable format (VCM-wise) only when necessary, that is, if it is semantically different * from the existing one in file. Will never write an identical one. * * @param newClasspath IClasspathEntry[] * @param newOutputLocation IPath * @return boolean Return whether the .classpath file was modified. * @throws JavaModelException */ public boolean writeFileEntries(IClasspathEntry[] newClasspath, IClasspathEntry[] referencedEntries, IPath newOutputLocation) throws JavaModelException { if (!this.project.isAccessible()) return false; Map unknownElements = new HashMap(); IClasspathEntry[][] fileEntries = readFileEntries(unknownElements); if (fileEntries[0] != JavaProject.INVALID_CLASSPATH && areClasspathsEqual(newClasspath, newOutputLocation, fileEntries[0]) && (referencedEntries == null || areClasspathsEqual(referencedEntries, fileEntries[1])) ) { // no need to save it, it is the same return false; } // actual file saving try { setSharedProperty(JavaProject.CLASSPATH_FILENAME, encodeClasspath(newClasspath, referencedEntries, newOutputLocation, true, unknownElements)); return true; } catch (CoreException e) { throw new JavaModelException(e); } } public boolean writeFileEntries(IClasspathEntry[] newClasspath, IPath newOutputLocation) throws JavaModelException {
/** * Writes the classpath in a sharable format (VCM-wise) only when necessary, that is, if it is semantically different * from the existing one in file. Will never write an identical one. * * @param newClasspath IClasspathEntry[] * @param newOutputLocation IPath * @return boolean Return whether the .classpath file was modified. * @throws JavaModelException */ public boolean writeFileEntries(IClasspathEntry[] newClasspath, IClasspathEntry[] referencedEntries, IPath newOutputLocation) throws JavaModelException { if (!this.project.isAccessible()) return false; Map unknownElements = new HashMap(); IClasspathEntry[][] fileEntries = readFileEntries(unknownElements); if (fileEntries[0] != JavaProject.INVALID_CLASSPATH && areClasspathsEqual(newClasspath, newOutputLocation, fileEntries[0]) && (referencedEntries == null || areClasspathsEqual(referencedEntries, fileEntries[1])) ) { // no need to save it, it is the same return false; } // actual file saving try { setSharedProperty(JavaProject.CLASSPATH_FILENAME, encodeClasspath(newClasspath, referencedEntries, newOutputLocation, true, unknownElements)); return true; } catch (CoreException e) { throw new JavaModelException(e); } } public boolean writeFileEntries(IClasspathEntry[] newClasspath, IPath newOutputLocation) throws JavaModelException {
/** * Writes the classpath in a sharable format (VCM-wise) only when necessary, that is, if it is semantically different * from the existing one in file. Will never write an identical one. * * @param newClasspath IClasspathEntry[] * @param newOutputLocation IPath * @return boolean Return whether the .classpath file was modified. * @throws JavaModelException */ public boolean writeFileEntries(IClasspathEntry[] newClasspath, IClasspathEntry[] referencedEntries, IPath newOutputLocation) throws JavaModelException { if (!this.project.isAccessible()) return false; Map unknownElements = new HashMap(); IClasspathEntry[][] fileEntries = readFileEntries(unknownElements); if (fileEntries[0] != JavaProject.INVALID_CLASSPATH && areClasspathsEqual(newClasspath, newOutputLocation, fileEntries[0]) && (referencedEntries == null || areClasspathsEqual(referencedEntries, fileEntries[1])) ) { // no need to save it, it is the same return false; } // actual file saving try { setSharedProperty(JavaProject.CLASSPATH_FILENAME, encodeClasspath(newClasspath, referencedEntries, newOutputLocation, true, unknownElements)); return true; } catch (CoreException e) { throw new JavaModelException(e); } } public boolean writeFileEntries(IClasspathEntry[] newClasspath, IPath newOutputLocation) throws JavaModelException {
/** * Writes the classpath in a sharable format (VCM-wise) only when necessary, that is, if it is semantically different * from the existing one in file. Will never write an identical one. * * @param newClasspath IClasspathEntry[] * @param newOutputLocation IPath * @return boolean Return whether the .classpath file was modified. * @throws JavaModelException */ public boolean writeFileEntries(IClasspathEntry[] newClasspath, IClasspathEntry[] referencedEntries, IPath newOutputLocation) throws JavaModelException { if (!this.project.isAccessible()) return false; Map unknownElements = new HashMap(); IClasspathEntry[][] fileEntries = readFileEntries(unknownElements); if (fileEntries[0] != JavaProject.INVALID_CLASSPATH && areClasspathsEqual(newClasspath, newOutputLocation, fileEntries[0]) && (referencedEntries == null || areClasspathsEqual(referencedEntries, fileEntries[1])) ) { // no need to save it, it is the same return false; } // actual file saving try { setSharedProperty(JavaProject.CLASSPATH_FILENAME, encodeClasspath(newClasspath, referencedEntries, newOutputLocation, true, unknownElements)); return true; } catch (CoreException e) { throw new JavaModelException(e); } } public boolean writeFileEntries(IClasspathEntry[] newClasspath, IPath newOutputLocation) throws JavaModelException {
if (this.oldRawClasspath != null && !JavaProject.areClasspathsEqual(this.oldRawClasspath, newRawClasspath, this.oldOutputLocation, newOutputLocation)) { delta.changed(this.project, IJavaElementDelta.F_CLASSPATH_CHANGED); result |= HAS_DELTA; if (this.oldResolvedClasspath != null && JavaProject.areClasspathsEqual(this.oldResolvedClasspath, newResolvedClasspath, this.oldOutputLocation, newOutputLocation)) return result;
if (this.oldRawClasspath != null && !JavaProject.areClasspathsEqual(this.oldRawClasspath, newRawClasspath, this.oldOutputLocation, newOutputLocation)) { delta.changed(this.project, IJavaElementDelta.F_CLASSPATH_CHANGED); result |= HAS_DELTA; if (this.oldResolvedClasspath != null && JavaProject.areClasspathsEqual(this.oldResolvedClasspath, newResolvedClasspath, this.oldOutputLocation, newOutputLocation)) return result;
if (this.oldRawClasspath != null && !JavaProject.areClasspathsEqual(this.oldRawClasspath, newRawClasspath, this.oldOutputLocation, newOutputLocation)) { delta.changed(this.project, IJavaElementDelta.F_CLASSPATH_CHANGED); result |= HAS_DELTA; if (this.oldResolvedClasspath != null && JavaProject.areClasspathsEqual(this.oldResolvedClasspath, newResolvedClasspath, this.oldOutputLocation, newOutputLocation)) return result;
if (this.oldRawClasspath != null && !JavaProject.areClasspathsEqual(this.oldRawClasspath, newRawClasspath, this.oldOutputLocation, newOutputLocation)) { delta.changed(this.project, IJavaElementDelta.F_CLASSPATH_CHANGED); result |= HAS_DELTA; if (this.oldResolvedClasspath != null && JavaProject.areClasspathsEqual(this.oldResolvedClasspath, newResolvedClasspath, this.oldOutputLocation, newOutputLocation)) return result;
if (this.oldRawClasspath != null && !JavaProject.areClasspathsEqual(this.oldRawClasspath, newRawClasspath, this.oldOutputLocation, newOutputLocation)) { delta.changed(this.project, IJavaElementDelta.F_CLASSPATH_CHANGED); result |= HAS_DELTA; if (this.oldResolvedClasspath != null && JavaProject.areClasspathsEqual(this.oldResolvedClasspath, newResolvedClasspath, this.oldOutputLocation, newOutputLocation)) return result;
if (this.oldRawClasspath != null && !JavaProject.areClasspathsEqual(this.oldRawClasspath, newRawClasspath, this.oldOutputLocation, newOutputLocation)) { delta.changed(this.project, IJavaElementDelta.F_CLASSPATH_CHANGED); result |= HAS_DELTA; if (this.oldResolvedClasspath != null && JavaProject.areClasspathsEqual(this.oldResolvedClasspath, newResolvedClasspath, this.oldOutputLocation, newOutputLocation)) return result;