correct version number

This commit is contained in:
Dmitry Avdeev
2015-07-17 16:30:11 +03:00
parent b1deb88795
commit 531f53cf55
3 changed files with 11 additions and 5 deletions
@@ -103,6 +103,6 @@ public class DomFileIndex extends ScalarIndexExtension<String>{
@Override
public int getVersion() {
return DomApplicationComponent.getInstance().getCumulativeVersion();
return DomApplicationComponent.getInstance().getCumulativeVersion(false);
}
}
@@ -105,11 +105,17 @@ public class DomApplicationComponent {
return ServiceManager.getService(DomApplicationComponent.class);
}
public int getCumulativeVersion() {
public int getCumulativeVersion(boolean forStubs) {
int result = 0;
for (DomFileDescription description : getAllFileDescriptions()) {
if (description.hasStubs()) {
result += description.getStubVersion();
if (forStubs) {
if (description.hasStubs()) {
result += description.getStubVersion();
result += description.getRootTagName().hashCode(); // so that a plugin enabling/disabling could trigger the reindexing
}
}
else {
result += description.getVersion();
result += description.getRootTagName().hashCode(); // so that a plugin enabling/disabling could trigger the reindexing
}
}
@@ -92,6 +92,6 @@ public class DomStubBuilder implements BinaryFileStubBuilder {
@Override
public int getStubVersion() {
return 21 + DomApplicationComponent.getInstance().getCumulativeVersion();
return 21 + DomApplicationComponent.getInstance().getCumulativeVersion(true);
}
}