Skip to content

Commit

Permalink
Simplifying solution in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Sep 4, 2024
1 parent 4d1c0cd commit 2063839
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/main/java/gr/uom/java/xmi/UMLModelASTReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,8 @@ private List<UMLComment> extractInternalComments(CompilationUnit cu, String sour
else if(comment.isBlockComment()) {
locationInfo = generateLocationInfo(cu, sourceFile, comment, CodeElementType.BLOCK_COMMENT);
}
else if(comment.isDocComment()) {
if(comment.getStartPosition() + comment.getLength() + 1 <= javaFileContent.length()) {
String textFollowing = javaFileContent.substring(comment.getStartPosition() + comment.getLength() + 1, javaFileContent.length());
String[] lines = textFollowing.split("\\r?\\n|\\r");
if(lines.length > 0) {
String firstLine = lines[0];
if(!firstLine.contains("public") && !firstLine.contains("private") && !firstLine.contains("protected") && !firstLine.contains("@") && !firstLine.contains("static")) {
locationInfo = generateLocationInfo(cu, sourceFile, comment, CodeElementType.BLOCK_COMMENT);
}
}
}
else if(comment.isDocComment() && comment.getParent() == null) {
locationInfo = generateLocationInfo(cu, sourceFile, comment, CodeElementType.BLOCK_COMMENT);
}
if(locationInfo != null) {
int start = comment.getStartPosition();
Expand Down

0 comments on commit 2063839

Please sign in to comment.