diff options
Diffstat (limited to 'build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/InfoContext.java')
-rw-r--r-- | build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/InfoContext.java | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/InfoContext.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/InfoContext.java index bce752a313d..a0e6b865482 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/InfoContext.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/InfoContext.java @@ -21,51 +21,51 @@ public final class InfoContext { private String fInstanceId; private ILanguage fLanguage; - public InfoContext(IProject project){ + public InfoContext(IProject project) { this(project, null); } - public InfoContext(IProject project, String instanceId){ + public InfoContext(IProject project, String instanceId) { this.fProject = project; - this.fInstanceId = instanceId != null ? instanceId : ""; //$NON-NLS-1$ + this.fInstanceId = instanceId != null ? instanceId : ""; //$NON-NLS-1$ } - + /** * @since 7.1 */ - public InfoContext(IProject project, String instanceId, ILanguage language){ + public InfoContext(IProject project, String instanceId, ILanguage language) { this.fProject = project; - this.fInstanceId = instanceId != null ? instanceId : ""; //$NON-NLS-1$ + this.fInstanceId = instanceId != null ? instanceId : ""; //$NON-NLS-1$ this.fLanguage = language; } - - public String getInstanceId(){ + + public String getInstanceId() { return fInstanceId; } - + /** * @since 7.1 */ - public ILanguage getLanguage(){ + public ILanguage getLanguage() { return fLanguage; } - + @Override public boolean equals(Object obj) { - if(obj == this) + if (obj == this) return true; - - if(!(obj instanceof InfoContext)) + + if (!(obj instanceof InfoContext)) return false; - - InfoContext other = (InfoContext)obj; - if(fProject == null){ - if(other.fProject != null) + + InfoContext other = (InfoContext) obj; + if (fProject == null) { + if (other.fProject != null) return false; - } else if(!fProject.equals(other.fProject)) + } else if (!fProject.equals(other.fProject)) return false; - - if(!fInstanceId.equals(other.fInstanceId)) + + if (!fInstanceId.equals(other.fInstanceId)) return false; return true; @@ -74,45 +74,45 @@ public final class InfoContext { @Override public int hashCode() { int code = fProject != null ? fProject.hashCode() : 0; - + code += fInstanceId.hashCode(); - + return code; } @Override public String toString() { StringBuilder buf = new StringBuilder(); - - if(fProject != null) + + if (fProject != null) buf.append(fProject.toString()); else - buf.append("no project"); //$NON-NLS-1$ - if(fInstanceId.length() != 0){ - buf.append(" , instance: "); //$NON-NLS-1$ + buf.append("no project"); //$NON-NLS-1$ + if (fInstanceId.length() != 0) { + buf.append(" , instance: "); //$NON-NLS-1$ buf.append(fInstanceId); } - + return buf.toString(); } - + /** * a convenience method that specifies whether this is a default context, * i.e. the one defined for the project with no extension filters - * + * * @return boolean */ - public boolean isDefaultContext(){ -// if(fProject == null) -// return false; - - if(fInstanceId.length() != 0) + public boolean isDefaultContext() { + // if(fProject == null) + // return false; + + if (fInstanceId.length() != 0) return false; - + return true; } - - public IProject getProject(){ + + public IProject getProject() { return fProject; } } |