Project

General

Profile

Bug #7175

substitute: incorrect handling of unknown longchar values

Added by Vladimir Tsichevski over 3 years ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Vladimir Tsichevski
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

History

#2 Updated by Vladimir Tsichevski over 3 years ago

An unknown lonchar value passed as an formatting parameter for substitute is formatted as null instead of expected ?:

DEFINE VARIABLE v AS LONGCHAR NO-UNDO.
v = ?.
MESSAGE SUBSTITUTE("Longchar '&1'", v).

Note: before OE 11.7 the formatted value in OE was empty string instead of ? :-(
Note: this bug was first mentioned in #7143-33.

#3 Updated by Vladimir Tsichevski over 3 years ago

  • Status changed from New to WIP
  • % Done changed from 0 to 90

This patch fixes this issue:

=== modified file 'src/com/goldencode/p2j/util/TextOps.java'
--- src/com/goldencode/p2j/util/TextOps.java    2023-01-18 13:51:25 +0000
+++ src/com/goldencode/p2j/util/TextOps.java    2023-03-06 22:04:10 +0000
@@ -6825,9 +6825,9 @@
                         // this is required because P4GL uses yes/no instead of true/false
                         sb.append(new logical(((Boolean) obj)));
                      }
-                     else if (obj instanceof character)
+                     else if (obj instanceof Text)
                      {
-                        character ch = (character) obj;
+                        Text ch = (Text) obj;
                         sb.append(ch.isUnknown() ? "?" : ch.getValue());
                      }
                      else if (obj instanceof object)

#4 Updated by Vladimir Tsichevski over 3 years ago

  • Status changed from WIP to Review
  • % Done changed from 90 to 100

Committed as 3827a rev. 14502.

#5 Updated by Vladimir Tsichevski 8 months ago

  • reviewer Hynek Cihlar added

#6 Updated by Vladimir Tsichevski 8 months ago

  • Status changed from Review to Internal Test

This issue does not exist anymore and should be closed.

#7 Updated by Greg Shah 8 months ago

  • Status changed from Internal Test to Closed

Also available in: Atom PDF