Skip to content

Commit

Permalink
Exception fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Jan 5, 2025
1 parent 3695d99 commit b69e49d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java
Original file line number Diff line number Diff line change
Expand Up @@ -4456,9 +4456,14 @@ else if(mapping instanceof CompositeStatementObjectMapping && !mapper.getNonMapp
}

private static boolean samePackage(AbstractCodeMapping mapping) {
String filePathBefore = mapping.getFragment1().getLocationInfo().getFilePath().substring(0, mapping.getFragment1().getLocationInfo().getFilePath().lastIndexOf("/"));
String filePathAfter = mapping.getFragment2().getLocationInfo().getFilePath().substring(0, mapping.getFragment2().getLocationInfo().getFilePath().lastIndexOf("/"));
return filePathBefore.equals(filePathAfter);
String filePath1 = mapping.getFragment1().getLocationInfo().getFilePath();
String filePath2 = mapping.getFragment2().getLocationInfo().getFilePath();
if(filePath1.contains("/") && filePath2.contains("/")) {
String filePathBefore = filePath1.substring(0, filePath1.lastIndexOf("/"));
String filePathAfter = filePath2.substring(0, filePath2.lastIndexOf("/"));
return filePathBefore.equals(filePathAfter);
}
return false;
}

private boolean skipRefactoring(Set<AbstractCodeMapping> mappings) {
Expand Down

0 comments on commit b69e49d

Please sign in to comment.