Comments (3)
This would only be relevant when the class is also FINAL
, right?
(Also, relevant issue from the past: #104 )
from abap-cleaner.
Let me get back to this before the thread becomes stale :)
I do agree with the need to differentiate between FINAL and non-FINAL.
as in: Sometimes, the create public
is needed, sometimes it can be removed as not needed.
as in: Somtimes, the exporting
argument in a method call is needed, sometimes it can be removed as not needed :)
So I am voting for having an option in one of the rules to remove the create public if not needed, and that is if it is a abstract final class.
from abap-cleaner.
Hi PhiL,
as mentioned by ConjuringCoffee, CREATE PUBLIC would still make sense for an abstract non-final class, because this information is then inherited by its subclasses:
- if the superclass is ABSTRACT CREATE PUBLIC and the subclass does not explicitly specify a more restricted CREATE level, the subclass can't declare its constructor in the PROTECTED SECTION, otherwise you get a syntax error.
- if you then change the superclass(!) to CREATE PROTECTED, the syntax error in the subclass is gone.
By contrast, for an ABSTRACT FINAL class, no constructor can be declared anywhere, so as far as I can see, you're right that CREATE {PUBLIC|PROTECTED|PRIVATE} could be removed in such a case. I could just imagine this to be a hint in the sense of "for now, we'll prevent instantiation of this class, but if we ever change our minds and remove the FINAL, we then want the class to be CREATE PUBLIC" (but that may be a bit far-fetched…)
Therefore, not entirely sure what to do with this. One argument that came up in a different place is that unfortunately, ABAP classes are by default CREATE PUBLIC (while CREATE PRIVATE would be desirable to enforce static CREATE methods with good, semantic names); therefore, you should keep CREATE PUBLIC in the code as a reminder that the class design is not yet ideal. (But admittedly, that's a different story).
Kind regards,
Jörg-Michael
from abap-cleaner.
Related Issues (20)
- Add 'insert empty line before ANY statement' option to rule "Standardize empty lines within methods" HOT 1
- fyi: Referential Integrity Problem HOT 4
- String template is proposed for JSON string without any need HOT 4
- Feature Request: Point out NULL-reference HOT 1
- Packaging: Jar file contains resources twice HOT 4
- CORRESPONDING ... EXCEPT and LOOP AT ... GROUP BY indentation HOT 6
- variable is assigned but never used not working correctly HOT 3
- Align SELECT...FROM...JOIN HOT 2
- Delete unused variables HOT 2
- ABAP Cleaner Menu greyed out for one system but not for another HOT 1
- Wrong formatting a line comment within type declaration in class HOT 7
- Feature Request: Captions for Read-Only Code Preview HOT 2
- Option: Align Parameters and Components - Issue HOT 2
- CLI parameter `--version` to show version
- Update from 1.16.2 to newer version deinstalled ABAP Cleaner and now i am not able to install ABAP Cleaner HOT 1
- Installation with Eclipse & ADT 2024-06 (4.32)
- Adjustion alignment of parameters and conditional expressions HOT 2
- Alignment of select-options and parameters
- Feature Request: ABAP cleaner on an entire package
- perhaps interesting for ABAP Cleaner too: Sort combined DATA statements (ABAP Quick Fixes 1.1.5)?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abap-cleaner.