I fooled myself into thinking there was no difference. There isâŚrepeatably.
Hereâs whatâs happening: testing for inclusion in a set is resulting in boolean tests 'orâd in a different order. The logic is equivalent, but why is it different, but apparently a different parser is in use in water vs VS.
Does that make sense?
Below are the two sections that differed when build in Water vs VS. Shown are the Oxygene source, and the decompiled .class from the .jars built by Water and VS
(I set code fragments as âpreformatted textâ but the result is inconsistentâŚ)
source:
TLcorner : Char = #$DA;
TRcorner : Char = #$BF;
BLcorner : Char = #$C0;
BRcorner : Char = #$D9;
HorzLine : Char = #$C4;
VertLine : Char = #$B3;
Up_T : Char = #$C2;
Down_T : Char = #$C1;
Right_T : Char = #$B4;
Left_T : Char = #$C3;
Cross : Char = #$C5;
method tDataEntryForm.hideLineDrawChar(ch:Char):Boolean;
begin
if myTerm.fpMsgMode then begin
result := (ch in [#254,TLcorner,TRcorner,BLcorner,BRcorner,VertLine,
HorzLine,Down_T,Up_T,Right_T,Left_T,Cross]);
end else begin
result := (ch > #175) and (myTerm.LineDrawSetString.indexOf(ch) > -1);
end;
end;
-
compiled in Water:
public boolean hideLineDrawChar(char var1) {
boolean var2 = false;
if (this.myTerm.fpMsgMode) {
var2 = var1 == 254 || var1 == 194 || var1 == 193 || var1 == 180 || var1 == 197 || var1 == 195 || var1 == 196 || var1 == 191 || var1 == 218 || var1 == 192 || var1 == 179 || var1 == 217;
} else {
var2 = var1 <= 175 ? false : this.myTerm.LineDrawSetString.indexOf(Character.toString(var1)) > -1;
}
return var2;
}
-
compiled in VS:
public boolean hideLineDrawChar(char var1) {
boolean var2 = false;
if (this.myTerm.fpMsgMode) {
var2 = var1 == 254 || var1 == 218 || var1 == 191 || var1 == 192 || var1 == 217 || var1 == 179 || var1 == 196 || var1 == 193 || var1 == 194 || var1 == 180 || var1 == 195 || var1 == 197;
} else {
var2 = var1 <= 175 ? false : this.myTerm.LineDrawSetString.indexOf(Character.toString(var1)) > -1;
}
return var2;
}
source:
for i := 1 to fpBtns[ndx].numKeystrokes do begin
//donât include non-char keys in s, save for exitKey field of field leave msg
//assumes only 1 such non-char key and itâs the last one
if (fpBtns[ndx].keystrokes[i] in [13,33âŚ47,58,59,91âŚ255]) then begin
lastKey := fpBtns[ndx].keystrokes[i];
end else begin
s := s + Char(fpBtns[ndx].keystrokes[i]);
end;
if not (fpBtns[ndx].keystrokes[i] in [13,32âŚ126,128âŚ255]) then begin
keyBrdBtn := false;
break;
end;
end;
compiled in Water:
int var8 = this.fpBtns[var1].numKeystrokes & â\uffffâ & â\uffffâ;
int var12 = 1;
if (var12 <= var8) {
++var8;
do {
int var9 = this.fpBtns[var1].keystrokes[var12] & '\uffff';
if (var9 == 13 || var9 == 58 || var9 == 59 || var9 >= 91 & var9 <= 255 || var9 >= 33 & var9 <= 47) {
var14 = this.fpBtns[var1].keystrokes[var12] & '\uffff';
} else {
String var11 = Character.toString((char)(this.fpBtns[var1].keystrokes[var12] & '\uffff'));
var5 = var5 == null ? var11 : (var11 == null ? var5 : var5.concat(var11));
}
var9 = this.fpBtns[var1].keystrokes[var12] & '\uffff';
if (var9 != 13 && !(var9 >= 128 & var9 <= 255) && !(var9 >= 32 & var9 <= 126)) {
var2 = false;
break;
}
++var12;
} while(var12 != var8);
}
compiled in VS:
int var8 = this.fpBtns[var1].numKeystrokes & â\uffffâ & â\uffffâ;
int var12 = 1;
if (var12 <= var8) {
++var8;
do {
int var9 = this.fpBtns[var1].keystrokes[var12] & '\uffff';
if (var9 == 13 || var9 == 58 || var9 == 59 || var9 >= 33 & var9 <= 47 || var9 >= 91 & var9 <= 255) {
var14 = this.fpBtns[var1].keystrokes[var12] & '\uffff';
} else {
String var11 = Character.toString((char)(this.fpBtns[var1].keystrokes[var12] & '\uffff'));
var5 = var5 == null ? var11 : (var11 == null ? var5 : var5.concat(var11));
}
var9 = this.fpBtns[var1].keystrokes[var12] & '\uffff';
if (var9 != 13 && !(var9 >= 32 & var9 <= 126) && !(var9 >= 128 & var9 <= 255)) {
var2 = false;
break;
}
++var12;
} while(var12 != var8);
}