Skip to content

Commit 017c398

Browse files
committed
fix #601, revise BuchiProgramDebugIdentifier
1 parent d7ca78f commit 017c398

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

trunk/source/BuchiProgramProduct/src/de/uni_freiburg/informatik/ultimate/buchiprogramproduct/productgenerator/ProductLocationNameGenerator.java

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ protected static DebugIdentifier generateStateName(final BoogieIcfgLocation loc)
6161
*/
6262
protected static DebugIdentifier generateStateName(final BoogieIcfgLocation loc, final String nwaName) {
6363
if (nwaName == null) {
64-
return new BuchiProgramDebugIdentifier(loc, NONWA);
64+
return new BuchiProgramDebugIdentifier(loc.getDebugIdentifier(), NONWA);
65+
} else {
66+
return new BuchiProgramDebugIdentifier(loc.getDebugIdentifier(), nwaName);
6567
}
66-
return new BuchiProgramDebugIdentifier(loc, nwaName);
6768
}
6869

6970
protected DebugIdentifier generateHelperStateName(final DebugIdentifier location) {
@@ -83,51 +84,49 @@ protected static boolean isHelperState(final BoogieIcfgLocation loc) {
8384

8485
private static final class BuchiProgramDebugIdentifier extends DebugIdentifier {
8586

86-
private final int mIcfgHashcode;
87-
private final DebugIdentifier mIcfgIdentifier;
88-
private final String mNwaLocation;
87+
private final DebugIdentifier mIcfgDebugIdentifier;
88+
private final String mNwaState;
8989

90-
public BuchiProgramDebugIdentifier(final BoogieIcfgLocation loc, final String nwaLocation) {
91-
mIcfgIdentifier = Objects.requireNonNull(loc).getDebugIdentifier();
92-
mIcfgHashcode = loc.hashCode();
93-
mNwaLocation = Objects.requireNonNull(nwaLocation);
90+
public BuchiProgramDebugIdentifier(final DebugIdentifier icfgDebugIdentifier, final String nwaState) {
91+
mIcfgDebugIdentifier = Objects.requireNonNull(icfgDebugIdentifier);
92+
mNwaState = Objects.requireNonNull(nwaState);
9493
}
9594

9695
@Override
9796
public String toString() {
98-
return mIcfgIdentifier.toString() + "_" + mNwaLocation;
97+
return mIcfgDebugIdentifier.toString() + "_" + mNwaState;
9998
}
10099

101100
@Override
102101
public int hashCode() {
103102
final int prime = 31;
104103
int result = 1;
105-
result = prime * result + mIcfgHashcode;
106-
result = prime * result + mNwaLocation.hashCode();
104+
result = prime * result + ((mIcfgDebugIdentifier == null) ? 0 : mIcfgDebugIdentifier.hashCode());
105+
result = prime * result + ((mNwaState == null) ? 0 : mNwaState.hashCode());
107106
return result;
108107
}
109108

110109
@Override
111110
public boolean equals(final Object obj) {
112-
if (this == obj) {
111+
if (this == obj)
113112
return true;
114-
}
115-
if (obj == null) {
113+
if (obj == null)
116114
return false;
117-
}
118-
if (getClass() != obj.getClass()) {
115+
if (getClass() != obj.getClass())
119116
return false;
120-
}
121117
final BuchiProgramDebugIdentifier other = (BuchiProgramDebugIdentifier) obj;
122-
if (mIcfgHashcode != other.mIcfgHashcode) {
118+
if (mIcfgDebugIdentifier == null) {
119+
if (other.mIcfgDebugIdentifier != null)
120+
return false;
121+
} else if (!mIcfgDebugIdentifier.equals(other.mIcfgDebugIdentifier))
123122
return false;
124-
}
125-
if (!mNwaLocation.equals(other.mNwaLocation)) {
123+
if (mNwaState == null) {
124+
if (other.mNwaState != null)
125+
return false;
126+
} else if (!mNwaState.equals(other.mNwaState))
126127
return false;
127-
}
128128
return true;
129129
}
130-
131130
}
132131

133132
private static final class BuchiProgramHelperStateDebugIdentifier extends DuplicatedDebugIdentifier {

0 commit comments

Comments
 (0)