diff --git a/src/main/java/org/codetracker/BlockTrackerChangeHistory.java b/src/main/java/org/codetracker/BlockTrackerChangeHistory.java index d601b784b8d..e5f9e31e40b 100644 --- a/src/main/java/org/codetracker/BlockTrackerChangeHistory.java +++ b/src/main/java/org/codetracker/BlockTrackerChangeHistory.java @@ -448,6 +448,8 @@ else if (mapping instanceof LeafMapping && mapping.getFragment1() instanceof Sta Method methodAfter = Method.of(mergeOperationRefactoring.getNewMethodAfterMerge(), currentVersion); if (equalMethod.test(methodAfter)) { int mergeMatches = 0; + AbstractCodeFragment fragment2 = null; + int fragment2Matches = 0; for (UMLOperationBodyMapper bodyMapper : mergeOperationRefactoring.getMappers()) { for (AbstractCodeMapping mapping : bodyMapper.getMappings()) { if (mapping instanceof CompositeStatementObjectMapping) { @@ -491,10 +493,42 @@ else if (mapping instanceof LeafMapping && mapping.getFragment1() instanceof Sta } } } + for (CompositeStatementObject composite : bodyMapper.getNonMappedInnerNodesT2()) { + Block blockAfter = Block.of(composite, bodyMapper.getContainer2(), currentVersion); + if (blockAfter.equalIdentifierIgnoringVersion(rightBlock)) { + if (fragment2 == null) { + fragment2 = composite; + } + else if (fragment2.equals(composite)) { + fragment2Matches++; + } + } + } + for (AbstractCodeFragment fragment : bodyMapper.getNonMappedLeavesT2()) { + if (fragment instanceof StatementObject) { + Block blockAfter = Block.of((StatementObject) fragment, bodyMapper.getContainer2(), currentVersion); + if (blockAfter.equalIdentifierIgnoringVersion(rightBlock)) { + if (fragment2 == null) { + fragment2 = fragment; + } + else if (fragment2.equals(fragment)) { + fragment2Matches++; + } + } + } + } } if(mergeMatches > 0) { return true; } + if(fragment2 != null && mergeOperationRefactoring.getMappers().size() == fragment2Matches + 1) { + Block blockBefore = Block.of(fragment2 instanceof StatementObject ? (StatementObject) fragment2 : (CompositeStatementObject) fragment2, mergeOperationRefactoring.getNewMethodAfterMerge(), parentVersion); + Block blockAfter = Block.of(fragment2 instanceof StatementObject ? (StatementObject) fragment2 : (CompositeStatementObject) fragment2, mergeOperationRefactoring.getNewMethodAfterMerge(), currentVersion); + blockChangeHistory.handleAdd(blockBefore, blockAfter, "new block"); + elements.add(blockBefore); + blockChangeHistory.connectRelatedNodes(); + return true; + } } break; } diff --git a/src/main/java/org/codetracker/BlockTrackerImpl.java b/src/main/java/org/codetracker/BlockTrackerImpl.java index ba1a38e214a..f6690f08c18 100644 --- a/src/main/java/org/codetracker/BlockTrackerImpl.java +++ b/src/main/java/org/codetracker/BlockTrackerImpl.java @@ -146,7 +146,12 @@ else if (leftOperation instanceof UMLInitializer && rightOperation instanceof UM { //Local Refactoring List refactorings = umlModelDiffLocal.getRefactorings(); - boolean found = changeHistory.checkForExtractionOrInline(currentVersion, parentVersion, equalMethod, rightBlock, refactorings); + boolean found = changeHistory.isMergeMultiMapping(currentVersion, parentVersion, equalMethod, rightBlock, refactorings); + if (found) { + historyReport.step4PlusPlus(); + break; + } + found = changeHistory.checkForExtractionOrInline(currentVersion, parentVersion, equalMethod, rightBlock, refactorings); if (found) { historyReport.step4PlusPlus(); break; @@ -435,7 +440,12 @@ else if (leftOperation instanceof UMLInitializer && rightOperation instanceof UM { //Local Refactoring List refactorings = umlModelDiffLocal.getRefactorings(); - boolean found = changeHistory.checkForExtractionOrInline(currentVersion, parentVersion, equalMethod, rightBlock, refactorings); + boolean found = changeHistory.isMergeMultiMapping(currentVersion, parentVersion, equalMethod, rightBlock, refactorings); + if (found) { + historyReport.step4PlusPlus(); + break; + } + found = changeHistory.checkForExtractionOrInline(currentVersion, parentVersion, equalMethod, rightBlock, refactorings); if (found) { historyReport.step4PlusPlus(); break; diff --git a/src/main/java/org/codetracker/BlockTrackerWithLocalFiles.java b/src/main/java/org/codetracker/BlockTrackerWithLocalFiles.java index 0d6b86e73d1..9ee3f33a45f 100644 --- a/src/main/java/org/codetracker/BlockTrackerWithLocalFiles.java +++ b/src/main/java/org/codetracker/BlockTrackerWithLocalFiles.java @@ -175,7 +175,12 @@ else if (leftOperation instanceof UMLInitializer && rightOperation instanceof UM { //Local Refactoring List refactorings = umlModelDiffLocal.getRefactorings(); - boolean found = changeHistory.checkForExtractionOrInline(currentVersion, parentVersion, equalMethod, rightBlock, refactorings); + boolean found = changeHistory.isMergeMultiMapping(currentVersion, parentVersion, equalMethod, rightBlock, refactorings); + if (found) { + historyReport.step4PlusPlus(); + break; + } + found = changeHistory.checkForExtractionOrInline(currentVersion, parentVersion, equalMethod, rightBlock, refactorings); if (found) { historyReport.step4PlusPlus(); break; diff --git a/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-FOR_STATEMENT.json b/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-FOR_STATEMENT.json index 95b3c04ca7e..b22df8dddb8 100644 --- a/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-FOR_STATEMENT.json +++ b/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-FOR_STATEMENT.json @@ -25,52 +25,23 @@ "parentCommitId": "9ecff8f961c321098c2598097fb5289e968ef1ac", "commitId": "0bfd6048574d61c138fd417051ae2a1bcb44638f", "commitTime": 1450450613, - "changeType": "body change", + "changeType": "introduced", "elementFileBefore": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$for(63-78)", + "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)$for(41-54)", "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)$for(45-68)" - }, - { - "parentCommitId": "ee3114d07c9ca89a00f4c1028b70fc2fab184301", - "commitId": "c07f55ac92d1e931260711edae987b51bee0be3d", - "commitTime": 1450157856, - "changeType": "body change", - "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$for(63-78)", - "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$for(63-78)" - }, - { - "parentCommitId": "a52c510810f896fcafa78033b29148b49c7db7ca", - "commitId": "4c90a2e04a83646597a506a80b5a885d5c515bf0", - "commitTime": 1438563686, - "changeType": "body change", - "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$for(65-80)", - "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$for(63-78)" + "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)$for(45-68)", + "comment": "Merge Method [public authenticate(proxy Proxy, response Response) : Request, public authenticateProxy(proxy Proxy, response Response) : Request] to public authenticate(route Route, response Response) : Request in class okhttp3.internal.http.AuthenticatorAdapter" }, { - "parentCommitId": "b6d8f809e33d989895a49c9454c4a492119d344c", - "commitId": "d111f4cd19d3d69558dd2186d778efb69b90b1e3", - "commitTime": 1399736107, - "changeType": "body change", - "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$for(63-78)", - "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$for(63-78)" - }, - { - "parentCommitId": "f5111c28356431c6c5d1e71dd1bbced9a8016cd8", - "commitId": "e920196fbd71822fc284ab76204bf75f95d3265a", - "commitTime": 1398096023, + "parentCommitId": "9ecff8f961c321098c2598097fb5289e968ef1ac", + "commitId": "0bfd6048574d61c138fd417051ae2a1bcb44638f", + "commitTime": 1450450613, "changeType": "introduced", - "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$for(63-78)", - "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$for(63-78)", - "comment": "added with method" + "elementFileBefore": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", + "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$for(63-78)", + "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", + "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)$for(45-68)", + "comment": "Merge Method [public authenticate(proxy Proxy, response Response) : Request, public authenticateProxy(proxy Proxy, response Response) : Request] to public authenticate(route Route, response Response) : Request in class okhttp3.internal.http.AuthenticatorAdapter" } ] } \ No newline at end of file diff --git a/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT-2.json b/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT-2.json index 3fea5de390e..a3a119f6209 100644 --- a/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT-2.json +++ b/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT-2.json @@ -25,32 +25,23 @@ "parentCommitId": "9ecff8f961c321098c2598097fb5289e968ef1ac", "commitId": "0bfd6048574d61c138fd417051ae2a1bcb44638f", "commitTime": 1450450613, - "changeType": "expression change", + "changeType": "introduced", "elementFileBefore": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$if(72-72)", + "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)$if(48-48)", "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)$if(62-67)" + "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)$if(62-67)", + "comment": "Merge Method [public authenticate(proxy Proxy, response Response) : Request, public authenticateProxy(proxy Proxy, response Response) : Request] to public authenticate(route Route, response Response) : Request in class okhttp3.internal.http.AuthenticatorAdapter" }, { "parentCommitId": "9ecff8f961c321098c2598097fb5289e968ef1ac", "commitId": "0bfd6048574d61c138fd417051ae2a1bcb44638f", "commitTime": 1450450613, - "changeType": "body change", + "changeType": "introduced", "elementFileBefore": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$if(72-72)", "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)$if(62-67)" - }, - { - "parentCommitId": "f5111c28356431c6c5d1e71dd1bbced9a8016cd8", - "commitId": "e920196fbd71822fc284ab76204bf75f95d3265a", - "commitTime": 1398096023, - "changeType": "introduced", - "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$if(72-72)", - "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$if(72-72)", - "comment": "added with method" + "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)$if(62-67)", + "comment": "Merge Method [public authenticate(proxy Proxy, response Response) : Request, public authenticateProxy(proxy Proxy, response Response) : Request] to public authenticate(route Route, response Response) : Request in class okhttp3.internal.http.AuthenticatorAdapter" } ] } \ No newline at end of file diff --git a/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT.json b/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT.json index ece41096d8f..463f3ca2dad 100644 --- a/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT.json +++ b/src/main/resources/oracle/block/training/okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT.json @@ -12,25 +12,26 @@ "startCommitId": "8e2116fddcc1f9ad2b15d03fbc8918e30831d6a2", "expectedChanges": [ { - "parentCommitId": "ee3114d07c9ca89a00f4c1028b70fc2fab184301", - "commitId": "c07f55ac92d1e931260711edae987b51bee0be3d", - "commitTime": 1450157856, - "changeType": "expression change", - "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$if(65-65)", - "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$if(65-65)" + "parentCommitId": "9ecff8f961c321098c2598097fb5289e968ef1ac", + "commitId": "0bfd6048574d61c138fd417051ae2a1bcb44638f", + "commitTime": 1450450613, + "changeType": "introduced", + "elementFileBefore": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", + "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)$if(43-43)", + "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", + "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)$if(47-47)", + "comment": "Merge Method [public authenticate(proxy Proxy, response Response) : Request, public authenticateProxy(proxy Proxy, response Response) : Request] to public authenticate(route Route, response Response) : Request in class okhttp3.internal.http.AuthenticatorAdapter" }, { - "parentCommitId": "f5111c28356431c6c5d1e71dd1bbced9a8016cd8", - "commitId": "e920196fbd71822fc284ab76204bf75f95d3265a", - "commitTime": 1398096023, + "parentCommitId": "9ecff8f961c321098c2598097fb5289e968ef1ac", + "commitId": "0bfd6048574d61c138fd417051ae2a1bcb44638f", + "commitTime": 1450450613, "changeType": "introduced", - "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$if(65-65)", - "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$if(65-65)", - "comment": "added with method" + "elementFileBefore": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", + "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)$if(65-65)", + "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", + "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)$if(47-47)", + "comment": "Merge Method [public authenticate(proxy Proxy, response Response) : Request, public authenticateProxy(proxy Proxy, response Response) : Request] to public authenticate(route Route, response Response) : Request in class okhttp3.internal.http.AuthenticatorAdapter" } ] } \ No newline at end of file diff --git a/src/main/resources/oracle/method/training/okhttp-JavaNetAuthenticator-authenticate.json b/src/main/resources/oracle/method/training/okhttp-JavaNetAuthenticator-authenticate.json index 36025716548..0a9ee3177aa 100644 --- a/src/main/resources/oracle/method/training/okhttp-JavaNetAuthenticator-authenticate.json +++ b/src/main/resources/oracle/method/training/okhttp-JavaNetAuthenticator-authenticate.json @@ -7,7 +7,7 @@ "functionKey": "okhttp-urlconnection/src/main/java/okhttp3.JavaNetAuthenticator#authenticate(Route, Response)", "functionStartLine": 32, "expectedChanges": [ - { + { "parentCommitId": "abe5d62bcf18781c4b32418932f60e62cfea1703", "commitId": "b3ecb0a6c9bf3a213377b889f2b3077a940363e2", "commitTime": 1504210735, @@ -15,7 +15,8 @@ "elementFileBefore": "okhttp-urlconnection/src/main/java/okhttp3/JavaNetAuthenticator.java", "elementNameBefore": "okhttp-urlconnection/src/main/java/okhttp3.JavaNetAuthenticator#authenticate(Route, Response)", "elementFileAfter": "okhttp-urlconnection/src/main/java/okhttp3/JavaNetAuthenticator.java", - "elementNameAfter": "okhttp-urlconnection/src/main/java/okhttp3.JavaNetAuthenticator#authenticate(Route, Response)" + "elementNameAfter": "okhttp-urlconnection/src/main/java/okhttp3.JavaNetAuthenticator#authenticate(Route, Response)", + "comment": "Body Change" }, { "parentCommitId": "937bedf91995ead193beeb94178143f694aead21", @@ -32,54 +33,34 @@ "parentCommitId": "9ecff8f961c321098c2598097fb5289e968ef1ac", "commitId": "0bfd6048574d61c138fd417051ae2a1bcb44638f", "commitTime": 1450450613, - "changeType": "rename", - "elementFileBefore": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", - "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)", - "comment": "Rename Method public authenticateProxy(proxy Proxy, response Response) : Request renamed to public authenticate(route Route, response Response) : Request in class okhttp3.internal.http.AuthenticatorAdapter" - }, - { - "parentCommitId": "9ecff8f961c321098c2598097fb5289e968ef1ac", - "commitId": "0bfd6048574d61c138fd417051ae2a1bcb44638f", - "commitTime": 1450450613, - "changeType": "parameter change", + "changeType": "method merge", "elementFileBefore": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)", - "comment": "Localize Parameter proxy : Proxy to proxy : Proxy in method public authenticate(route Route, response Response) : Request from class okhttp3.internal.http.AuthenticatorAdapter" + "comment": "Merge Method [public authenticate(proxy Proxy, response Response) : Request, public authenticateProxy(proxy Proxy, response Response) : Request] to public authenticate(route Route, response Response) : Request in class okhttp3.internal.http.AuthenticatorAdapter" }, { "parentCommitId": "9ecff8f961c321098c2598097fb5289e968ef1ac", "commitId": "0bfd6048574d61c138fd417051ae2a1bcb44638f", "commitTime": 1450450613, - "changeType": "parameter change", + "changeType": "method merge", "elementFileBefore": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", + "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)", - "comment": "Add Parameter route : Route in method public authenticate(route Route, response Response) : Request from class okhttp3.internal.http.AuthenticatorAdapter" + "comment": "Merge Method [public authenticate(proxy Proxy, response Response) : Request, public authenticateProxy(proxy Proxy, response Response) : Request] to public authenticate(route Route, response Response) : Request in class okhttp3.internal.http.AuthenticatorAdapter" }, { - "parentCommitId": "9ecff8f961c321098c2598097fb5289e968ef1ac", - "commitId": "0bfd6048574d61c138fd417051ae2a1bcb44638f", - "commitTime": 1450450613, - "changeType": "documentation change", - "elementFileBefore": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", - "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)" - }, - { - "parentCommitId": "9ecff8f961c321098c2598097fb5289e968ef1ac", - "commitId": "0bfd6048574d61c138fd417051ae2a1bcb44638f", - "commitTime": 1450450613, - "changeType": "body change", - "elementFileBefore": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", + "parentCommitId": "54dc2df914f2aae37fb48cc2c2f7560ee664bc2b", + "commitId": "c9a89876de476983f273edbf108c365127c18c5e", + "commitTime": 1450247699, + "changeType": "container change", + "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", + "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Route, Response)" + "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", + "comment": "Move Class com.squareup.okhttp.internal.http.AuthenticatorAdapter moved to okhttp3.internal.http.AuthenticatorAdapter" }, { "parentCommitId": "54dc2df914f2aae37fb48cc2c2f7560ee664bc2b", @@ -87,9 +68,9 @@ "commitTime": 1450247699, "changeType": "container change", "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", - "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", + "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", "elementFileAfter": "okhttp/src/main/java/okhttp3/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", + "elementNameAfter": "okhttp/src/main/java/okhttp3.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", "comment": "Move Class com.squareup.okhttp.internal.http.AuthenticatorAdapter moved to okhttp3.internal.http.AuthenticatorAdapter" }, { @@ -100,7 +81,19 @@ "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)" + "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", + "comment": "Body Change" + }, + { + "parentCommitId": "ee3114d07c9ca89a00f4c1028b70fc2fab184301", + "commitId": "c07f55ac92d1e931260711edae987b51bee0be3d", + "commitTime": 1450157856, + "changeType": "body change", + "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", + "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", + "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", + "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", + "comment": "Body Change" }, { "parentCommitId": "f3529652aa4e130840e48e2081cdeebbd6c6fb91", @@ -110,7 +103,19 @@ "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)" + "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", + "comment": "Body Change" + }, + { + "parentCommitId": "f3529652aa4e130840e48e2081cdeebbd6c6fb91", + "commitId": "93d547dcdaecddfa456aee0571131db2342e5abb", + "commitTime": 1450123908, + "changeType": "body change", + "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", + "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", + "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", + "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", + "comment": "Body Change" }, { "parentCommitId": "a52c510810f896fcafa78033b29148b49c7db7ca", @@ -120,7 +125,30 @@ "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)" + "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", + "comment": "Body Change" + }, + { + "parentCommitId": "a52c510810f896fcafa78033b29148b49c7db7ca", + "commitId": "4c90a2e04a83646597a506a80b5a885d5c515bf0", + "commitTime": 1438563686, + "changeType": "body change", + "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", + "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", + "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", + "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", + "comment": "Body Change" + }, + { + "parentCommitId": "8161318f2f8e3defaa7a41771a4ef6e9e4017221", + "commitId": "2b236fd66abbfffeb1c07a22dde5dcb8d3a2032c", + "commitTime": 1431452360, + "changeType": "body change", + "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", + "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", + "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", + "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", + "comment": "Body Change" }, { "parentCommitId": "85a3e9bfc58040c9ffb2ee906b39702bb26a84a5", @@ -133,6 +161,17 @@ "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", "comment": "Move Class com.squareup.okhttp.internal.huc.AuthenticatorAdapter moved to com.squareup.okhttp.internal.http.AuthenticatorAdapter" }, + { + "parentCommitId": "85a3e9bfc58040c9ffb2ee906b39702bb26a84a5", + "commitId": "0676d8b1733589a869098b9980118644b3bade4f", + "commitTime": 1400374846, + "changeType": "container change", + "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", + "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticate(Proxy, Response)", + "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/http/AuthenticatorAdapter.java", + "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.http.AuthenticatorAdapter#authenticate(Proxy, Response)", + "comment": "Move Class com.squareup.okhttp.internal.huc.AuthenticatorAdapter moved to com.squareup.okhttp.internal.http.AuthenticatorAdapter" + }, { "parentCommitId": "b6d8f809e33d989895a49c9454c4a492119d344c", "commitId": "d111f4cd19d3d69558dd2186d778efb69b90b1e3", @@ -141,7 +180,19 @@ "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", - "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)" + "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", + "comment": "Body Change" + }, + { + "parentCommitId": "b6d8f809e33d989895a49c9454c4a492119d344c", + "commitId": "d111f4cd19d3d69558dd2186d778efb69b90b1e3", + "commitTime": 1399736107, + "changeType": "body change", + "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", + "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticate(Proxy, Response)", + "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", + "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticate(Proxy, Response)", + "comment": "Body Change" }, { "parentCommitId": "f5111c28356431c6c5d1e71dd1bbced9a8016cd8", @@ -153,6 +204,17 @@ "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticateProxy(Proxy, Response)", "comment": "added with new class" + }, + { + "parentCommitId": "f5111c28356431c6c5d1e71dd1bbced9a8016cd8", + "commitId": "e920196fbd71822fc284ab76204bf75f95d3265a", + "commitTime": 1398096023, + "changeType": "introduced", + "elementFileBefore": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", + "elementNameBefore": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticate(Proxy, Response)", + "elementFileAfter": "okhttp/src/main/java/com/squareup/okhttp/internal/huc/AuthenticatorAdapter.java", + "elementNameAfter": "okhttp/src/main/java/com.squareup.okhttp.internal.huc.AuthenticatorAdapter#authenticate(Proxy, Response)", + "comment": "added with new class" } ] } \ No newline at end of file diff --git a/src/test/resources/block/training-expected.txt b/src/test/resources/block/training-expected.txt index 4bc4be961c5..cc6661167dd 100644 --- a/src/test/resources/block/training-expected.txt +++ b/src/test/resources/block/training-expected.txt @@ -768,10 +768,10 @@ okhttp-Http2Connection-newStream-IF_STATEMENT.json, 1, 0, 0 okhttp-Http2Connection-newStream-SYNCHRONIZED_STATEMENT-1.json, 26, 0, 0 okhttp-Http2Connection-newStream-SYNCHRONIZED_STATEMENT.json, 18, 0, 0 okhttp-Http2Connection-pushStream-IF_STATEMENT.json, 1, 0, 0 -okhttp-JavaNetAuthenticator-authenticate-FOR_STATEMENT.json, 6, 0, 0 +okhttp-JavaNetAuthenticator-authenticate-FOR_STATEMENT.json, 2, 0, 0 okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT-1.json, 1, 0, 0 -okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT-2.json, 4, 0, 0 -okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT.json, 2, 0, 0 +okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT-2.json, 2, 0, 0 +okhttp-JavaNetAuthenticator-authenticate-IF_STATEMENT.json, 1, 0, 0 okhttp-OkHttpURLConnection-getResponse-CATCH_CLAUSE-1.json, 1, 0, 0 okhttp-OkHttpURLConnection-getResponse-CATCH_CLAUSE.json, 2, 0, 0 okhttp-OkHttpURLConnection-getResponse-IF_STATEMENT-1.json, 5, 0, 0 diff --git a/src/test/resources/method/okhttp-JavaNetAuthenticator-authenticate.json b/src/test/resources/method/okhttp-JavaNetAuthenticator-authenticate.json index 63c75ef3b94..9f805c7c33e 100644 --- a/src/test/resources/method/okhttp-JavaNetAuthenticator-authenticate.json +++ b/src/test/resources/method/okhttp-JavaNetAuthenticator-authenticate.json @@ -1 +1 @@ -{"commitLogMap":{"8e2116fddcc1f9ad2b15d03fbc8918e30831d6a2":["b3ecb0a6c9bf3a213377b889f2b3077a940363e2","0c3e06764069ea601df5ee7db30721fdf70a42af","d9abee71f870d31d992402d2b855313987bf53ee"],"937bedf91995ead193beeb94178143f694aead21":["0bfd6048574d61c138fd417051ae2a1bcb44638f","c9a89876de476983f273edbf108c365127c18c5e"],"54dc2df914f2aae37fb48cc2c2f7560ee664bc2b":["c07f55ac92d1e931260711edae987b51bee0be3d","93d547dcdaecddfa456aee0571131db2342e5abb","4c90a2e04a83646597a506a80b5a885d5c515bf0","2b236fd66abbfffeb1c07a22dde5dcb8d3a2032c","0676d8b1733589a869098b9980118644b3bade4f"],"85a3e9bfc58040c9ffb2ee906b39702bb26a84a5":["d111f4cd19d3d69558dd2186d778efb69b90b1e3","e920196fbd71822fc284ab76204bf75f95d3265a"]}} \ No newline at end of file +{"commitLogMap":{"8e2116fddcc1f9ad2b15d03fbc8918e30831d6a2":["b3ecb0a6c9bf3a213377b889f2b3077a940363e2","0c3e06764069ea601df5ee7db30721fdf70a42af","d9abee71f870d31d992402d2b855313987bf53ee"],"937bedf91995ead193beeb94178143f694aead21":["0bfd6048574d61c138fd417051ae2a1bcb44638f","c9a89876de476983f273edbf108c365127c18c5e"],"54dc2df914f2aae37fb48cc2c2f7560ee664bc2b":["c07f55ac92d1e931260711edae987b51bee0be3d","93d547dcdaecddfa456aee0571131db2342e5abb","4c90a2e04a83646597a506a80b5a885d5c515bf0","2b236fd66abbfffeb1c07a22dde5dcb8d3a2032c","0676d8b1733589a869098b9980118644b3bade4f"],"85a3e9bfc58040c9ffb2ee906b39702bb26a84a5":["d111f4cd19d3d69558dd2186d778efb69b90b1e3","e920196fbd71822fc284ab76204bf75f95d3265a"],"9ecff8f961c321098c2598097fb5289e968ef1ac":["c9a89876de476983f273edbf108c365127c18c5e"]}} \ No newline at end of file diff --git a/src/test/resources/method/training-expected.txt b/src/test/resources/method/training-expected.txt index 7db492705a2..c45d5e35222 100644 --- a/src/test/resources/method/training-expected.txt +++ b/src/test/resources/method/training-expected.txt @@ -84,7 +84,7 @@ okhttp-Http2Connection-headers.json, 49, 0, 0 okhttp-Http2Connection-newStream.json, 20, 0, 0 okhttp-Http2Connection-newStream2.json, 37, 0, 0 okhttp-Http2Connection-pushStream.json, 9, 0, 0 -okhttp-JavaNetAuthenticator-authenticate.json, 13, 0, 0 +okhttp-JavaNetAuthenticator-authenticate.json, 11, 0, 0 okhttp-OkHttpURLConnection-getResponse.json, 41, 0, 0 okhttp-RealCall-execute.json, 44, 0, 0 okhttp-RealConnection-connect.json, 71, 0, 0