Project

General

Profile

Bug #3023

error when frame initialization fails

Added by Ovidiu Maxiniuc about 8 years ago. Updated about 8 years ago.

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

0%

billable:
No
vendor_id:
GCD
case_num:

History

#1 Updated by Ovidiu Maxiniuc about 8 years ago

If the shared frames do not match with their master frame, the initialization should raise 683 condition and the procedure should not be executed but because it was called with NO-ERROR, the execution should continue on calling procedure.

There is a bug in P2J that cases some an Abnormal end with some exception stacktraces to be printed to console when a frame initialization fails. Since the frame is incompletely set up, the frameDelete() procedure will attempt to delete resources incorrectly and the following NPE will be printed to console as the top cause:

Caused by: java.lang.NullPointerException
        at com.goldencode.p2j.ui.GenericFrame.lambda$allWidgets$7(GenericFrame.java:13149)
        at com.goldencode.p2j.ui.GenericFrame$$Lambda$7/558789337.compare(Unknown Source)
        at java.util.TimSort.countRunAndMakeAscending(TimSort.java:351)
        at java.util.TimSort.sort(TimSort.java:216)
        at java.util.Arrays.sort(Arrays.java:1512)
        at java.util.ArrayList.sort(ArrayList.java:1454)
        at java.util.Collections.sort(Collections.java:175)
        at com.goldencode.p2j.ui.GenericFrame.allWidgets(GenericFrame.java:13149)
        at com.goldencode.p2j.ui.GenericFrame.access$3700(GenericFrame.java:821)
        at com.goldencode.p2j.ui.GenericFrame$SharedFrameCleaner.finished(GenericFrame.java:12689)
        at com.goldencode.p2j.ui.GenericFrame$SharedFrameCleaner.initFailure(GenericFrame.java:12719)
        at com.goldencode.p2j.util.TransactionManager$$Lambda$12/1081481511.accept(Unknown Source)
        at java.util.ArrayList.forEach(ArrayList.java:1249)
        at com.goldencode.p2j.util.TransactionManager.cleanupDeferredFinalizables(TransactionManager.java:1206)
        [...]

At this moment this defect is not visible in testcases (in both majic and ETF) because they always have matching shared frames.

To duplicate this behavior, please use the testcases from uast/frames/shared2, and in a2862_2.p comment out the first widget (b AT 1 at line 17) so the frame sf1 won't match its master.

Also available in: Atom PDF