Project

General

Profile

Bug #4425

Lost frame_id when converting code with missing field names to update

Added by Roger Borrello over 4 years ago. Updated about 4 years ago.

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

100%

billable:
No
vendor_id:
GCD
case_num:
version:

History

#1 Updated by Roger Borrello over 4 years ago

General

A typo in code resulted in update not having any field names passed to it. This creates a conversion issue for FWD, but not for Progress. However, the Progress execution skips the entire block that follows. We'll have to mimic this behavior.

Update: The fix is in branch 4207a revision 11345

P2J Branch

This is being handled in Branch 4207a

Testcase

Checked into testcase_repo:
uast/update_no_parms/update_no_parms.p

define variable choice as character init "End".
define frame f choice.

/* Alter choice screen buffer value, to determine if there is a hidden assign performed. */
choice:screen-value = "Begin".

/* The line below is the correct line. The frame will be displayed and held for input. */
/*  update choice with frame f */
/*
 * This line is mangled as there is no widget, but Progress doesn't complain. 
 * The frame is displayed, but the program exits
 */
  update with frame f
    editing:
      readkey.
      apply lastkey.
    end.

/* Display shows "End", so no hidden assignment */    
display choice with frame f.

Artifacts

Execution Log

     [java] ------------------------------------------------------------------------------
     [java] Core Code Conversion
     [java] ------------------------------------------------------------------------------
     [java] 
     [java] Optional rule set [customer_specific_conversion] not found.
     [java] ./abl/update_no_parms.p
     [java] Elapsed job time:  00:00:00.652
     [java] EXPRESSION EXECUTION ERROR:
     [java] ---------------------------
     [java] throwException(errmsg)
     [java] ^  { Missing frame-id for node id 12884901962 ( [FRAME_SCOPE]:12884901962 @0:0
     [java] ) [FRAME_SCOPE id <12884901962> 0:0] }
     [java] ---------------------------
     [java] EXPRESSION EXECUTION ERROR:
     [java] ---------------------------
     [java] javaname = execLib("get_framename", this)
     [java]            ^  { Expression execution error @1:1 }
     [java] ---------------------------
     [java] ERROR:
     [java] com.goldencode.p2j.pattern.TreeWalkException: ERROR!  Active Rule:
     [java] -----------------------
     [java]       RULE REPORT      
     [java] -----------------------
     [java] Rule Type :   WALK
     [java] Source AST:  [  ] BLOCK/FRAME_SCOPE/ @0:0 {12884901962}
     [java] Copy AST  :  [  ] BLOCK/FRAME_SCOPE/ @0:0 {12884901962}
     [java] Condition :  throwException(errmsg)
     [java] Loop      :  false
     [java] --- END RULE REPORT ---
     [java] 
     [java] 
     [java] 
     [java]     at com.goldencode.p2j.pattern.PatternEngine.run(PatternEngine.java:1070)
     [java]     at com.goldencode.p2j.convert.TransformDriver.processTrees(TransformDriver.java:542)
     [java]     at com.goldencode.p2j.convert.ConversionDriver.back(ConversionDriver.java:580)
     [java]     at com.goldencode.p2j.convert.TransformDriver.executeJob(TransformDriver.java:876)
     [java]     at com.goldencode.p2j.convert.ConversionDriver.main(ConversionDriver.java:983)
     [java] Caused by: com.goldencode.expr.ExpressionException: Expression execution error @1:12 [FRAME_SCOPE id=12884901962]
     [java]     at com.goldencode.p2j.pattern.AstWalker.walk(AstWalker.java:275)
     [java]     at com.goldencode.p2j.pattern.AstWalker.walk(AstWalker.java:210)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.apply(PatternEngine.java:1633)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.processAst(PatternEngine.java:1531)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.processAst(PatternEngine.java:1479)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.run(PatternEngine.java:1034)
     [java]     ... 4 more
     [java] Caused by: com.goldencode.expr.ExpressionException: Expression execution error @1:12
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:484)
     [java]     at com.goldencode.p2j.pattern.Rule.apply(Rule.java:497)
     [java]     at com.goldencode.p2j.pattern.Rule.executeActions(Rule.java:745)
     [java]     at com.goldencode.p2j.pattern.Rule.coreProcessing(Rule.java:712)
     [java]     at com.goldencode.p2j.pattern.Rule.apply(Rule.java:534)
     [java]     at com.goldencode.p2j.pattern.RuleContainer.apply(RuleContainer.java:585)
     [java]     at com.goldencode.p2j.pattern.RuleSet.apply(RuleSet.java:98)
     [java]     at com.goldencode.p2j.pattern.RuleContainer.apply(RuleContainer.java:585)
     [java]     at com.goldencode.p2j.pattern.RuleSet.apply(RuleSet.java:98)
     [java]     at com.goldencode.p2j.pattern.AstWalker.walk(AstWalker.java:262)
     [java]     ... 9 more
     [java] Caused by: com.goldencode.expr.ExpressionException: Expression execution error @1:1
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:484)
     [java]     at com.goldencode.p2j.pattern.Rule.apply(Rule.java:497)
     [java]     at com.goldencode.p2j.pattern.Rule.executeActions(Rule.java:745)
     [java]     at com.goldencode.p2j.pattern.Rule.coreProcessing(Rule.java:712)
     [java]     at com.goldencode.p2j.pattern.Rule.apply(Rule.java:534)
     [java]     at com.goldencode.p2j.pattern.NamedFunction.execute(NamedFunction.java:450)
     [java]     at com.goldencode.p2j.pattern.AstSymbolResolver.execute(AstSymbolResolver.java:712)
     [java]     at com.goldencode.p2j.pattern.CommonAstSupport$Library.execLib(CommonAstSupport.java:1534)
     [java]     at com.goldencode.expr.CE10679.execute(Unknown Source)
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:391)
     [java]     ... 18 more
     [java] Caused by: com.goldencode.p2j.pattern.CommonAstSupport$UserGeneratedException: Missing frame-id for node id 12884901962 ( [FRAME_SCOPE]:12884901962 @0:0
     [java] ) [FRAME_SCOPE id <12884901962> 0:0]
     [java]     at com.goldencode.p2j.pattern.CommonAstSupport$Library.throwException(CommonAstSupport.java:2817)
     [java]     at com.goldencode.p2j.pattern.CommonAstSupport$Library.throwException(CommonAstSupport.java:2802)
     [java]     at com.goldencode.expr.CE10702.execute(Unknown Source)
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:391)
     [java]     ... 27 more

BUILD FAILED

AST Snippet

    <ast col="0" id="12884901963" line="0" text="" type="FRAME_SCOPE">
      <annotation datatype="java.lang.Long" key="frame-id" value="12884901964"/>
    </ast>
    <ast col="0" id="12884901962" line="0" text="" type="FRAME_SCOPE"/>
    <ast col="0" id="12884901890" line="0" text="statement" type="STATEMENT">
      <ast col="1" id="12884901891" line="1" text="define" type="DEFINE_VARIABLE">
        <annotation datatype="java.lang.String" key="name" value="choice"/>
        <annotation datatype="java.lang.Long" key="type" value="373"/>
        <annotation datatype="java.lang.Boolean" key="vardef" value="true"/>
        <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
        <annotation datatype="java.lang.String" key="javaname" value="choice"/>
        <annotation datatype="java.lang.String" key="classname" value="character"/>
        <ast col="17" id="12884901895" line="1" text="choice" type="SYMBOL"/>
        <ast col="24" id="12884901897" line="1" text="as" type="KW_AS">
          <ast col="27" id="12884901899" line="1" text="character" type="KW_CHAR"/>
        </ast>
      </ast>
    </ast>

#3 Updated by Greg Shah over 4 years ago

The fix is in branch 4207a revision 11342.

#4 Updated by Roger Borrello over 4 years ago

Greg Shah wrote:

The fix is in branch 4207a revision 11342.

Added additional testcases to demonstrate prompt-for and set behavior

Testcase: uast/update_no_parms/prompt-for_no_parms.p

define variable choice as character init "End".
define frame f choice.

/* Alter choice screen buffer value, to determine if there is a hidden assign performed. */
choice:screen-value = "Begin".

/* 
 * The line below is the correct line. The frame will be displayed and held for input. 
 * prompt-for choice with frame f
 */   
/*
 * This line is mangled as there is no widget, but Progress doesn't complain. 
 * The frame is displayed, but the program exits
 */
    prompt-for with frame f
    editing:
      readkey.
      apply lastkey.
    end.

/* Display shows "End", so no hidden assignment */    
display choice with frame f.

Testcase: uast/update_no_parms/set_no_parms.p

define variable choice as character init "End".
define frame f choice.

/* Alter choice screen buffer value, to determine if there is a hidden assign performed. */
choice:screen-value = "Begin".

/* 
 * The line below is the correct line. The frame will be displayed and held for input. 
 * set choice with frame f
 */   
/*
 * This line is mangled as there is no widget, but Progress doesn't complain. 
 * The frame is displayed, but the program exits
 */
    set with frame f
    editing:
      readkey.
      apply lastkey.
    end.

/* Display shows "End", so no hidden assignment */    
display choice with frame f.

#5 Updated by Greg Shah over 4 years ago

This change caused a bad regression that dropped all prompt-for/set/update statements. Fixed in rev 11343.

#6 Updated by Greg Shah over 4 years ago

  • Assignee set to Greg Shah
  • % Done changed from 0 to 100
  • Status changed from New to Test

#7 Updated by Roger Borrello over 4 years ago

Greg Shah wrote:

This change caused a bad regression that dropped all prompt-for/set/update statements. Fixed in rev 11343.

There's minor typo in the comment (TABLE-HADNLE). I can check in an update, if warranted.

#8 Updated by Greg Shah over 4 years ago

Sure.

#9 Updated by Roger Borrello over 4 years ago

Greg Shah wrote:

Sure.

Updated in 4207a-11345

#10 Updated by Roger Borrello about 4 years ago

Task branch 4207a was merged to trunk as revision 11344.

#11 Updated by Greg Shah about 4 years ago

  • Status changed from Test to Closed

Also available in: Atom PDF