Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Add repo option to force old serializer for CLAS #2491
I noticed that the "old" serializer seems to create the result when stuff gets rearranged in ADT, which is already used by abapGit as a fallback if the new one is not available. So I just added an option to always use it instead for CLAS.
The approach I chose to inject the read access to the repo setting in ZCL_ABAPGIT_OO_BASE is not very pretty. I could not find any existing dependencies from OBJECT_* classes to REPO so I am not sure how to handle it in a nice way.
Just fyi, the function module name gets saved that way in ADT and you cannot change it. I'll change it back in SE37 once the strategy is clear.
I guess the options are the following:
In my opinion it should be possible to give the OBJECT_* classes some additional settings based on the repository settings. I'd favor the structure approach described in 2, as it could also be used for things other than serialization in the future, should the need arise.
Not in ADT as far as I know. If you use the source based class editor in SE24 it automatically sorts the method implementations and leaves the definition sections alone I think? Form based SE24 will also reorganize everything in the definitions. There's also this "reorganize sections" button somewhere in the menu bar. Will check on monday.
Do you think this problem should not be solved by abapGit?
Just exploring options, there is some overlap in git/editor/CI setup here. Plus from an implementation point of view, the solution does not fit very nicely into abapGit, due to the architecture.
The problem we are trying to solve is avoiding diffs after import of classes, and there is no diff when methods are sorted alphabetically.
If I implement a new method using vscode(yeah, I'm crazy), then the same problem would occur. So another approach could be implementing a check for method sorting in abaplint which would run as a CI task. Plus a code inspector check to help the SE24/ADT user, perhaps add a keyboard shortcut in Eclipse.
I dont like having the git client change sources(but sometimes it does anyhow), ideally, it should show the same source as the developer entered. But again, everything has to fit together end to end.
Well, let's see:
Force old class serializer
Sure, the abaplint solution would be the way to go to check for the problem in an environment where changes come from multiple "unconnected" SAP systems like in the open source world or where changes come from other editors (even using the web interface in GitHub).
If this is not something that belongs in abapGit, I am also happy to just maintain a modification that changes like 3 lines of code to use the old serializer for all classes within our namespace.
(And just to reiterate: If SAP would fix the bug so that the code you type in the editor is also the one that's saved, this problem would not exist.)