Project

General

Profile

Bug #9792

Frame handle: Can't query side-labels

Added by Dănuț Filimon over 1 year ago. Updated over 1 year ago.

Status:
Test
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

100%

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

History

#1 Updated by Dănuț Filimon over 1 year ago

Example

define frame f1 with side-labels.
message can-query(frame f1:handle, "side-label":U).
message frame f1:handle:side-label.

4GL:

yes
yes

FWD:

no
yes

#3 Updated by Greg Shah over 1 year ago

  • Assignee set to Eugenie Lyzenko

Let's just clear this now.

#4 Updated by Eugenie Lyzenko over 1 year ago

Greg Shah wrote:

Let's just clear this now.

OK.

But what does SIDE-LABEL mean for frame widget? The same as SIDE-LABELS? I do not see the SIDE-LABEL attribute in OE Reference book.

#5 Updated by Eugenie Lyzenko over 1 year ago

Made some research and found the SIDE-LABEL is just an abbreviation for SIDE-LABELS. In 4GL it is possible to use any abbreviated keyword from SIDE-LAB to SIDE-LABELS. And for conversion we actually do this properly.

But at runtime the call can-query(frame f1:handle, "side-label":U) attempts to use exactly SIDE-LABEL. And it fails because our reflection usage has registered annotation for SIDE-LABELS only. Moreover we can have only one runtime annotation, for exactly full attribute name.

The solution is to convert abbreviated keyword on the fly to the full one. The fix is pretty simple(HandleOps.canQuery() method):

...
+import com.goldencode.p2j.uast.*;
...
   public static logical canQuery(final handle h, final String attributeOrMethodName)
   {
      if (h == null || h.isUnknown())
      {
         return logical.UNKNOWN;
      }

      final Object res = h.get();
      if (res == null)
      {
         return logical.FALSE;
      }

-      final String upcased = attributeOrMethodName.toUpperCase();
+      final String upcased = ProgressAst._keyword(attributeOrMethodName).toUpperCase();

      if (isHandleAttribute(upcased))
      {
         return logical.TRUE;
      }

      if (res instanceof HandleChain && invalidChainAttribute((HandleChain) res, upcased, true))
      {
         return logical.FALSE;
      }

      // check getters first
...

Are you OK with this fix?

I could even to include this fix in 9787a branch to speed the process.

#6 Updated by Eugenie Lyzenko over 1 year ago

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

#7 Updated by Eugenie Lyzenko over 1 year ago

  • Status changed from WIP to Review

#8 Updated by Greg Shah over 1 year ago

  • Status changed from Review to Internal Test

Code Review #9792-5

I agree completely. Good fix.

You can add it to 9787a. Is there something else to fix here?

#9 Updated by Eugenie Lyzenko over 1 year ago

  • % Done changed from 50 to 100

Greg Shah wrote:

Code Review #9792-5

I agree completely. Good fix.

You can add it to 9787a. Is there something else to fix here?

OK. I see nothing more to fix here.

#10 Updated by Eugenie Lyzenko over 1 year ago

The fix committed to 9787a revision 15781. Waiting for review and merge notification.

#11 Updated by Hynek Cihlar over 1 year ago

  • reviewer Hynek Cihlar added

#12 Updated by Hynek Cihlar over 1 year ago

  • reviewer Greg Shah added
  • reviewer deleted (Hynek Cihlar)

#13 Updated by Eugenie Lyzenko over 1 year ago

  • version_reported set to trunk revision 15808

The fix merged to trunk as revision 15808.

#14 Updated by Greg Shah over 1 year ago

  • Subject changed from Frame handle: Can't query side-lables to Frame handle: Can't query side-labels
  • Status changed from Internal Test to Test

#15 Updated by Greg Shah over 1 year ago

  • version_reported deleted (trunk revision 15808)
  • version_resolved set to trunk revision 15808

Also available in: Atom PDF