mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 08:45:44 +02:00
Fix hashCode() and equals() for type-info objects.
This commit is contained in:
parent
d63c249a01
commit
1b27065ccd
1 changed files with 6 additions and 0 deletions
|
@ -531,6 +531,7 @@ public class IndexTypeInfo implements ITypeInfo, IFunctionInfo {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + elementType;
|
result = prime * result + elementType;
|
||||||
|
result = prime * result + ((fileLocal == null) ? 0 : fileLocal.hashCode());
|
||||||
result = prime * result + IndexTypeInfo.hashCode(fqn);
|
result = prime * result + IndexTypeInfo.hashCode(fqn);
|
||||||
result = prime * result + IndexTypeInfo.hashCode(params);
|
result = prime * result + IndexTypeInfo.hashCode(params);
|
||||||
return result;
|
return result;
|
||||||
|
@ -550,6 +551,11 @@ public class IndexTypeInfo implements ITypeInfo, IFunctionInfo {
|
||||||
IndexTypeInfo other = (IndexTypeInfo) obj;
|
IndexTypeInfo other = (IndexTypeInfo) obj;
|
||||||
if (elementType != other.elementType)
|
if (elementType != other.elementType)
|
||||||
return false;
|
return false;
|
||||||
|
if (fileLocal == null) {
|
||||||
|
if (other.fileLocal != null)
|
||||||
|
return false;
|
||||||
|
} else if (!fileLocal.equals(other.fileLocal))
|
||||||
|
return false;
|
||||||
if (!Arrays.equals(fqn, other.fqn))
|
if (!Arrays.equals(fqn, other.fqn))
|
||||||
return false;
|
return false;
|
||||||
if (!Arrays.equals(params, other.params))
|
if (!Arrays.equals(params, other.params))
|
||||||
|
|
Loading…
Add table
Reference in a new issue