IntIntMaplet: for consistency with TIntIntHashMap use 0 instead of -1 value as 'empty' value

This commit is contained in:
Eugene Zhuravlev
2012-07-14 20:11:43 +02:00
parent 59781af46a
commit 6955697b40
2 changed files with 7 additions and 8 deletions
@@ -86,7 +86,7 @@ public class IntIntPersistentMaplet extends IntIntMaplet {
@Override
public int get(final int key) {
final Object obj = myCache.get(key);
return obj == NULL_OBJ? -1 : (Integer)obj;
return obj == NULL_OBJ? 0 : (Integer)obj;
}
@Override
@@ -557,7 +557,7 @@ public class Mappings {
final int fileName = myClassToSourceFile.get(className);
if (fileName < 0) {
if (fileName <= 0) {
debug("No source file detected for class ", className);
debug("End of affectSubclasses");
return;
@@ -1710,7 +1710,7 @@ public class Mappings {
final int fileName = myClassToSourceFile.get(c.myName);
if (fileName != 0) {
if (fileName > 0) {
myDelta.myChangedFiles.add(fileName);
}
@@ -1769,7 +1769,7 @@ public class Mappings {
public boolean execute(final int depClass) {
final int depFile = myClassToSourceFile.get(depClass);
if (depFile != 0) {
if (depFile > 0) {
final File theFile = new File(myContext.getValue(depFile));
if (myAffectedFiles.contains(theFile) || myCompiledFiles.contains(theFile)) {
@@ -2159,11 +2159,10 @@ public class Mappings {
final ClassRepr repr = getReprByName(rootClassName);
if (repr != null && fileName != 0) {
if (repr != null && fileName > 0) {
if (repr.addUsage(UsageRepr.createClassUsage(myContext, iname))) {
mySourceFileToClasses.put(fileName, repr);
}
;
}
}
}
@@ -2277,9 +2276,9 @@ public class Mappings {
assert (myChangedClasses != null && myChangedFiles != null);
myChangedClasses.add(it);
final Integer file = myClassToSourceFile.get(it);
final int file = myClassToSourceFile.get(it);
if (file != null) {
if (file > 0) {
myChangedFiles.add(file);
}
}