You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JavaLayoutUtil class is a pure utility class. All methods are stateless and threadsafe.
In the current implementation, it is instantiated twice per resource. Once as private field in JavaSourceOrClassFileResource and once in the parent class JavaResource.
It would be better to follow the typical design of utility classes:
make the class final
make the constructor private
make the methods static
let the consumers call the static methods and not initializing any instances of JavaResource
While JavaSourceOrClassFileResource is a manually maintained class, JavaResource is generated by EMF Text an moving it into the manually maintained source folder is not a reasonable change.
The EMF Text code generation should be adapted to generate JavaLayoutUtil as a real utility class and generate JavaResource in such a way that it makes use of the static utlity methods.
I did identify the Utility class generator in EMF Text but not the generator for the concrete resource generator. So I hope the issue will find it's way when I leave it here.
The text was updated successfully, but these errors were encountered:
The JavaLayoutUtil class is a pure utility class. All methods are stateless and threadsafe.
In the current implementation, it is instantiated twice per resource. Once as private field in
JavaSourceOrClassFileResource
and once in the parent classJavaResource
.It would be better to follow the typical design of utility classes:
While JavaSourceOrClassFileResource is a manually maintained class, JavaResource is generated by EMF Text an moving it into the manually maintained source folder is not a reasonable change.
The EMF Text code generation should be adapted to generate JavaLayoutUtil as a real utility class and generate JavaResource in such a way that it makes use of the static utlity methods.
I did identify the Utility class generator in EMF Text but not the generator for the concrete resource generator. So I hope the issue will find it's way when I leave it here.
The text was updated successfully, but these errors were encountered: