@Test public void java2groovyUpperFolder() { Smell instance = new Smell("MIM", "method#a.b.d$myInnerClass$AnotherInnerClass", j2gRename.newFile); Commit commit = new Commit(j2gRename.sha1, 1); mockPreviousQualifiedName("a.b.c"); SmellDuplicationChecker checker = getDuplicationChecker(); Smell original = checker.original(instance, commit, parent); assertNotNull(original); assertEquals("method#a.b.c$myInnerClass$AnotherInnerClass", original.instance); assertEquals(j2gRename.oldFile, original.file); }
public Smell original(Smell instance, Commit commit, Commit previous) { logger.trace("==> Trying to guess original smell for: " + instance); int index = fileRenamings.indexOf(FileRenameEntry.fromSmell(instance, commit)); if (index > -1) { logger.trace(" ==> Guessing new original smell!"); return guessOriginalSmell(instance, previous, fileRenamings.get(index)); } logger.trace(" ==> No original smell found"); return null; }
SmellDuplicationChecker { public Smell original(Smell instance, Commit commit, Commit previous) { logger.trace("==> Trying to guess original smell for: " + instance); int index = fileRenamings.indexOf(FileRenameEntry.fromSmell(instance, commit)); if (index > -1) { logger.trace(" ==> Guessing new original smell!"); return guessOriginalSmell(instance, previous, fileRenamings.get(index)); } logger.trace(" ==> No original smell found"); return null; } }
SmellDuplicationChecker { public Smell original(Smell instance, Commit commit, Commit previous) { logger.trace("==> Trying to guess original smell for: " + instance); int index = fileRenamings.indexOf(FileRenameEntry.fromSmell(instance, commit)); if (index > -1) { logger.trace(" ==> Guessing new original smell!"); return guessOriginalSmell(instance, previous, fileRenamings.get(index)); } logger.trace(" ==> No original smell found"); return null; } SmellDuplicationChecker(int projectId, Persistence persistence, QueryEngine queryEngine); }
SmellDuplicationChecker { public Smell original(Smell instance, Commit commit, Commit previous) { logger.trace("==> Trying to guess original smell for: " + instance); int index = fileRenamings.indexOf(FileRenameEntry.fromSmell(instance, commit)); if (index > -1) { logger.trace(" ==> Guessing new original smell!"); return guessOriginalSmell(instance, previous, fileRenamings.get(index)); } logger.trace(" ==> No original smell found"); return null; } SmellDuplicationChecker(int projectId, Persistence persistence, QueryEngine queryEngine); Smell original(Smell instance, Commit commit, Commit previous); }
SmellDuplicationChecker { public Smell original(Smell instance, Commit commit, Commit previous) { logger.trace("==> Trying to guess original smell for: " + instance); int index = fileRenamings.indexOf(FileRenameEntry.fromSmell(instance, commit)); if (index > -1) { logger.trace(" ==> Guessing new original smell!"); return guessOriginalSmell(instance, previous, fileRenamings.get(index)); } logger.trace(" ==> No original smell found"); return null; } SmellDuplicationChecker(int projectId, Persistence persistence, QueryEngine queryEngine); Smell original(Smell instance, Commit commit, Commit previous); static final String QUALIFIED_NAME; }