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
While refactoring similar code in Liberty Tools for IntelliJ I noticed that it is looping over all methods on the application's class looking for annotations that seem to just apply to properties (accessor methods). Should this code be checking every method or should it filter the list so it only checks property methods? It seems like we might report false-positives but should probably check whether this is aligned with the Jakarta Persistence spec.
for (IMethod method : methods) {
List<IAnnotation> mapKeyJoinCols = new ArrayList<IAnnotation>();
boolean hasMapKeyAnnotation = false;
boolean hasMapKeyClassAnnotation = false;
allAnnotations = method.getAnnotations();
for (IAnnotation annotation : allAnnotations) {
String matchedAnnotation = DiagnosticUtils.getMatchedJavaElementName(type,
annotation.getElementName(),
Constants.SET_OF_PERSISTENCE_ANNOTATIONS);
if (matchedAnnotation != null) {
if (Constants.MAPKEY.equals(matchedAnnotation))
hasMapKeyAnnotation = true;
else if (Constants.MAPKEYCLASS.equals(matchedAnnotation))
hasMapKeyClassAnnotation = true;
else if (Constants.MAPKEYJOINCOLUMN.equals(matchedAnnotation)) {
mapKeyJoinCols.add(annotation);
}
}
}
The text was updated successfully, but these errors were encountered:
While refactoring similar code in Liberty Tools for IntelliJ I noticed that it is looping over all methods on the application's class looking for annotations that seem to just apply to properties (accessor methods). Should this code be checking every method or should it filter the list so it only checks property methods? It seems like we might report false-positives but should probably check whether this is aligned with the Jakarta Persistence spec.
The text was updated successfully, but these errors were encountered: