@@ -61,9 +61,10 @@ protected static DebugIdentifier generateStateName(final BoogieIcfgLocation loc)
61
61
*/
62
62
protected static DebugIdentifier generateStateName (final BoogieIcfgLocation loc , final String nwaName ) {
63
63
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 );
65
67
}
66
- return new BuchiProgramDebugIdentifier (loc , nwaName );
67
68
}
68
69
69
70
protected DebugIdentifier generateHelperStateName (final DebugIdentifier location ) {
@@ -83,51 +84,49 @@ protected static boolean isHelperState(final BoogieIcfgLocation loc) {
83
84
84
85
private static final class BuchiProgramDebugIdentifier extends DebugIdentifier {
85
86
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 ;
89
89
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 );
94
93
}
95
94
96
95
@ Override
97
96
public String toString () {
98
- return mIcfgIdentifier .toString () + "_" + mNwaLocation ;
97
+ return mIcfgDebugIdentifier .toString () + "_" + mNwaState ;
99
98
}
100
99
101
100
@ Override
102
101
public int hashCode () {
103
102
final int prime = 31 ;
104
103
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 () );
107
106
return result ;
108
107
}
109
108
110
109
@ Override
111
110
public boolean equals (final Object obj ) {
112
- if (this == obj ) {
111
+ if (this == obj )
113
112
return true ;
114
- }
115
- if (obj == null ) {
113
+ if (obj == null )
116
114
return false ;
117
- }
118
- if (getClass () != obj .getClass ()) {
115
+ if (getClass () != obj .getClass ())
119
116
return false ;
120
- }
121
117
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 ))
123
122
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 ))
126
127
return false ;
127
- }
128
128
return true ;
129
129
}
130
-
131
130
}
132
131
133
132
private static final class BuchiProgramHelperStateDebugIdentifier extends DuplicatedDebugIdentifier {
0 commit comments