View | Details | Raw Unified | Return to bug 134541 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceLocation.java (+22 lines)
Lines 61-66 Link Here
61
61
62
	public File getSourceFile() {
62
	public File getSourceFile() {
63
		if (null == file) {
63
		if (null == file) {
64
			hashCode = 0;
64
			if (filename==null) {
65
			if (filename==null) {
65
//            if ((null == result) 
66
//            if ((null == result) 
66
//                || (null == result.fileName)
67
//                || (null == result.fileName)
Lines 136-139 Link Here
136
        if (getOffset()>=0) { sb.append("::").append(getOffset()); }
137
        if (getOffset()>=0) { sb.append("::").append(getOffset()); }
137
        return sb.toString();
138
        return sb.toString();
138
    }
139
    }
140
    
141
    public boolean equals(Object other) {
142
        if (! (other instanceof EclipseSourceLocation)) return false;
143
        EclipseSourceLocation o = (EclipseSourceLocation) other;
144
        return (o.startPos == startPos) 
145
        	&& (o.endPos == endPos)
146
        	&& o.getSourceFile().equals(getSourceFile());
147
    }
148
149
	private volatile int hashCode = 0;
150
    public int hashCode() {
151
    	if (hashCode == 0) {
152
            int result = 17;
153
            result = 37*result + startPos;
154
            result = 37*result + endPos;
155
            result = 37*result + getSourceFile().hashCode();
156
            hashCode = result;			
157
		}
158
        return hashCode;
159
    }
160
    
139
}
161
}

Return to bug 134541