consultingwerk / proparse

Proparse, forked from http://www.oehive.org/proparse/
Other
18 stars 9 forks source link

Null Pointer exception with reduced redundancy #10

Closed mikefechner closed 7 years ago

mikefechner commented 7 years ago

@marianedu I was to quick with testing the latest changes. Looks like the current proparse (from the redundancy branch) fails to parse class files with include files, like this here:

ROUTINE-LEVEL ON ERROR UNDO, THROW.

USING Consultingwerk.* FROM PROPATH .
USING Progress.Lang.*  FROM PROPATH .

CLASS Consultingwerk.CharacterHolder:

    {Consultingwerk/JsonSerializableProperty.i Value CHARACTER} .

END CLASS.

Here's the include file:

&IF 1=0 &THEN
/**********************************************************************
 * Copyright (C) 2006-2013 by Consultingwerk Ltd. ("CW") -            *
 * www.consultingwerk.de and other contributors as listed             *
 * below.  All Rights Reserved.                                       *
 *                                                                    *
 *  Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY    *
 *   KIND, either express or implied.                                 *
 *                                                                    *
 *  Contributors:                                                     *
 *                                                                    *
 **********************************************************************/
/*------------------------------------------------------------------------
    File        : JsonSerializableProperty.i
    Purpose     : Defines a Serializable Property in a child class of
                  Consultingwerk.JsonSerializable and Consultingwerk.XmlSerializable

    Syntax      : {Consultingwerk/JsonSerializableProperty.i Name Data-Type "Other Definition"}

                  Dynamic extent Array-Support, currently only for array's of objects, not primitives:
                  {Consultingwerk/JsonSerializableProperty.i Name "Data-Type EXTENT" "Other Definition"}

                  The third parameter (Other Definition) is optional

    Description : This version of the file provides backwards compatibility with
                  the XML based serialization (OpenEdge 10.2B). If you do not
                  require the backwards compatibility, please just the new
                  JsonSerializableProperty11.i include file

    Author(s)   : Mike Fechner / Consultingwerk Ltd.
    Created     : Fri Jun 29 19:32:14 CEST 2012
    Notes       : You are not supposed to use the SerializableProperties
                  for other purposes than using it in the JsonSerializable
                  base class - as we may be changing the format of this
                  property without warning.
  ----------------------------------------------------------------------*/
&ENDIF

    DEFINE PUBLIC PROPERTY {1} AS {2} NO-UNDO {3}
    GET.
    SET.

&IF "{&SerializableProperties}":U NE "":U &THEN
&GLOBAL-DEFINE SerializableProperties {&SerializableProperties},{1},{2}
&ELSE
&GLOBAL-DEFINE SerializableProperties {1},{2}
&ENDIF

And this is the error:

org.prorefactor.refactor.RefactorException: java.lang.RuntimeException: java.lang.NullPointerException

java.lang.RuntimeException: java.lang.NullPointerException

java.lang.NullPointerException: 

Call Stack:
ParseFile Consultingwerk.Studio.Proparse.ProparseHelper at line 1565  (.\Consultingwerk\Studio\Proparse\ProparseHelper.r)
OpenFileForParsing Consultingwerk.Studio.Proparse.ProparseTreeViewForm at line 1215  (.\Consultingwerk\Studio\Proparse\ProparseTreeViewForm.r)
OpenFileForParsing Consultingwerk.Studio.Proparse.ProparseTreeViewForm at line 1194  (.\Consultingwerk\Studio\Proparse\ProparseTreeViewForm.r)
ultraToolbarsManager1_ToolClick Consultingwerk.Studio.Proparse.ProparseTreeViewForm at line 1281  (.\Consultingwerk\Studio\Proparse\ProparseTreeViewForm.r)
Consultingwerk/Studio/Proparse/start.p at line 482  (.\Consultingwerk\Studio\Proparse\start.r)

.NET Stack Trace:
   bei org.prorefactor.treeparser.ParseUnit.parse(File file, String fileContent)

   bei org.prorefactor.treeparser.ParseUnit.parse()

   bei org.prorefactor.treeparser.ParseUnit.treeParser01()

My parsing code, is basically the code in this slide deck here. 2017 Proparse EN.pdf

akera-io commented 7 years ago

will give that a try, time to add a new test case for include files… those seems to be automatically added to parse unit when encountered and environment propath is used (have to find out how that is set-up)

Marian Edu

Acorn IT www.acorn-it.comhttp://www.acorn-it.com www.akera.iohttp://www.akera.io +40 740 036 212

On 11 Jun 2017, at 20:00, Mike Fechner notifications@github.com<mailto:notifications@github.com> wrote:

Assigned #10https://github.com/consultingwerk/proparse/issues/10 to @akera-iohttps://github.com/akera-io.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/consultingwerk/proparse/issues/10#event-1118584139, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOgnoHewXk8hiAOZ7c-F0P-lyitP5xKkks5sDB1AgaJpZM4N2cvt.

mikefechner commented 7 years ago

There are ABL Samples in my presentation PDF

Sent from Ninehttp://www.9folders.com/


Von: Akera notifications@github.com Gesendet: 12.06.2017 7:30 vorm. An: consultingwerk/proparse Cc: Mike Fechner; Author Betreff: Re: [consultingwerk/proparse] Null Pointer exception with reduced redundancy (#10)

will give that a try, time to add a new test case for include files… those seems to be automatically added to parse unit when encountered and environment propath is used (have to find out how that is set-up)

Marian Edu

Acorn IT www.acorn-it.comhttp://www.acorn-it.com www.akera.iohttp://www.akera.io +40 740 036 212

On 11 Jun 2017, at 20:00, Mike Fechner notifications@github.com<mailto:notifications@github.com> wrote:

Assigned #10https://github.com/consultingwerk/proparse/issues/10 to @akera-iohttps://github.com/akera-io.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/consultingwerk/proparse/issues/10#event-1118584139, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOgnoHewXk8hiAOZ7c-F0P-lyitP5xKkks5sDB1AgaJpZM4N2cvt.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/consultingwerk/proparse/issues/10#issuecomment-307693249, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMm7E0Z1Sm7__q6laDGgL9uSz9Dfusw_ks5sDMzigaJpZM4N2cvt.

marianedu commented 7 years ago

right, missed that at the end… only saw the 4gl code part :)

On 12 Jun 2017, at 08:31, Mike Fechner notifications@github.com wrote:

There are ABL Samples in my presentation PDF

Sent from Ninehttp://www.9folders.com/


Von: Akera notifications@github.com Gesendet: 12.06.2017 7:30 vorm. An: consultingwerk/proparse Cc: Mike Fechner; Author Betreff: Re: [consultingwerk/proparse] Null Pointer exception with reduced redundancy (#10)

will give that a try, time to add a new test case for include files… those seems to be automatically added to parse unit when encountered and environment propath is used (have to find out how that is set-up)

Marian Edu

Acorn IT www.acorn-it.comhttp://www.acorn-it.com www.akera.iohttp://www.akera.io +40 740 036 212

On 11 Jun 2017, at 20:00, Mike Fechner notifications@github.com<mailto:notifications@github.com> wrote:

Assigned #10https://github.com/consultingwerk/proparse/issues/10 to @akera-iohttps://github.com/akera-io.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/consultingwerk/proparse/issues/10#event-1118584139, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOgnoHewXk8hiAOZ7c-F0P-lyitP5xKkks5sDB1AgaJpZM4N2cvt.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/consultingwerk/proparse/issues/10#issuecomment-307693249, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMm7E0Z1Sm7__q6laDGgL9uSz9Dfusw_ks5sDMzigaJpZM4N2cvt. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/consultingwerk/proparse/issues/10#issuecomment-307693396, or mute the thread https://github.com/notifications/unsubscribe-auth/AChpB-JD-B4KlEmdKdTg2FRVwQJGS-7oks5sDM03gaJpZM4N2cvt.

akera-io commented 7 years ago

done, pushed a new commit on redundancy branch fixing parsing with include file reference and added test unit script for this case…

Marian Edu

Acorn IT www.acorn-it.comhttp://www.acorn-it.com www.akera.iohttp://www.akera.io +40 740 036 212

On 12 Jun 2017, at 08:33, Marian Edu notifications@github.com<mailto:notifications@github.com> wrote:

right, missed that at the end… only saw the 4gl code part :)

On 12 Jun 2017, at 08:31, Mike Fechner notifications@github.com<mailto:notifications@github.com> wrote:

There are ABL Samples in my presentation PDF

Sent from Ninehttp://www.9folders.com/


Von: Akera notifications@github.com<mailto:notifications@github.com> Gesendet: 12.06.2017 7:30 vorm. An: consultingwerk/proparse Cc: Mike Fechner; Author Betreff: Re: [consultingwerk/proparse] Null Pointer exception with reduced redundancy (#10)

will give that a try, time to add a new test case for include files… those seems to be automatically added to parse unit when encountered and environment propath is used (have to find out how that is set-up)

Marian Edu

Acorn IT www.acorn-it.comhttp://www.acorn-it.comhttp://www.acorn-it.com www.akera.iohttp://www.akera.iohttp://www.akera.io +40 740 036 212

On 11 Jun 2017, at 20:00, Mike Fechner notifications@github.com<mailto:notifications@github.commailto:notifications@github.com> wrote:

Assigned #10https://github.com/consultingwerk/proparse/issues/10 to @akera-iohttps://github.com/akera-io.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/consultingwerk/proparse/issues/10#event-1118584139, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOgnoHewXk8hiAOZ7c-F0P-lyitP5xKkks5sDB1AgaJpZM4N2cvt.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/consultingwerk/proparse/issues/10#issuecomment-307693249, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMm7E0Z1Sm7__q6laDGgL9uSz9Dfusw_ks5sDMzigaJpZM4N2cvt. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/consultingwerk/proparse/issues/10#issuecomment-307693396, or mute the thread https://github.com/notifications/unsubscribe-auth/AChpB-JD-B4KlEmdKdTg2FRVwQJGS-7oks5sDM03gaJpZM4N2cvt.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/consultingwerk/proparse/issues/10#issuecomment-307693602, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOgnoPqQF2IZq-rgU3F7YQJHBgZfuqRrks5sDM2zgaJpZM4N2cvt.

mikefechner commented 7 years ago

Seems to work now @ build 4.1.0.1169