From 206383906f30cf889a5c12946999715f9ba73547 Mon Sep 17 00:00:00 2001 From: tsantalis Date: Wed, 4 Sep 2024 16:00:32 -0400 Subject: [PATCH] Simplifying solution in previous commit --- .../java/gr/uom/java/xmi/UMLModelASTReader.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/main/java/gr/uom/java/xmi/UMLModelASTReader.java b/src/main/java/gr/uom/java/xmi/UMLModelASTReader.java index e211f985c..bb447a266 100644 --- a/src/main/java/gr/uom/java/xmi/UMLModelASTReader.java +++ b/src/main/java/gr/uom/java/xmi/UMLModelASTReader.java @@ -240,17 +240,8 @@ private List 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();