auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void syncUsers(Collection<ServiceAccount> serviceAccounts) { if (!fiatClientConfigurationProperties.isEnabled() || !fiatService.isPresent() || serviceAccounts == null || !fiatConfigurationProperties.getRoleSync().isEnabled()) { return; } try { List<String> rolesToSync = serviceAccounts.stream() .map(sa -> sa.getMemberOf()) .flatMap(Collection::stream) .distinct() .collect(Collectors.toList()); fiatService.get().sync(rolesToSync); <START> log.debug("Synced users with roles: ", rolesToSync); <END> Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (auth != null) fiatPermissionEvaluator.invalidatePermission((String) auth.getPrincipal()); } catch (RetrofitError re) { log.warn("Error syncing users", re); } }</code><technical_language>suggestion log.debug("Synced users roles: {}", rolesToSync);</technical_language>

Target:
private void syncUsers(Collection<ServiceAccount> serviceAccounts) { if (!fiatClientConfigurationProperties.isEnabled() || !fiatService.isPresent() || serviceAccounts == null || !fiatConfigurationProperties.getRoleSync().isEnabled()) { return; } try { List<String> rolesToSync = serviceAccounts.stream() .map(sa -> sa.getMemberOf()) .flatMap(Collection::stream) .distinct() .collect(Collectors.toList()); fiatService.get().sync(rolesToSync); log.debug("Synced users with roles: {}", rolesToSync); Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (auth != null) { fiatPermissionEvaluator.invalidatePermission((String) auth.getPrincipal()); } } catch (RetrofitError re) { log.warn("Error syncing users", re); } }
Source:
<code>public void signUpWithIntentToParticipate() throws Exception { String email = TestUtils.makeRandomTestEmail(AuthenticationServiceTest.class); StudyParticipant participant = new StudyParticipant.Builder() .withEmail(email) .withPassword("P@ssword`1").build(); <START> IdentifierHolder holder = null; <END> try { IntentToParticipate intent = new IntentToParticipate.Builder() .withScope(SharingScope.NO_SHARING) .withPhone(TestConstants.PHONE) .withStudy(TestConstants.TEST_STUDY_IDENTIFIER) .withOsName(OperatingSystem.ANDROID) .withConsentSignature(new ConsentSignature.Builder() .withName("Name") .withBirthdate("1970-01-01").build()) .withSubpopGuid(TestConstants.TEST_STUDY_IDENTIFIER).build(); intentService.submitIntentToParticipate(intent); study.setEmailVerificationEnabled(false); holder = authService.signUp(study, participant, true); CriteriaContext context = new CriteriaContext.Builder() .withStudyIdentifier(TestConstants.TEST_STUDY) .build(); SignIn signIn = new SignIn.Builder().withStudy(TestConstants.TEST_STUDY_IDENTIFIER).withEmail(email) .withPassword("P@ssword`1").build(); authService.signIn(study, context, signIn); } finally { if (holder != null) { userAdminService.deleteUser(study, holder.getIdentifier()); } } }</code><technical_language>want move real dependencies in unit tests. a test in AuthenticationServiceMockTest tests dataflow wiring, this test in Integ Tests instead</technical_language>

Target:
public void signUpWithIntentToParticipate() throws Exception { String email = TestUtils.makeRandomTestEmail(AuthenticationServiceTest.class); StudyParticipant participant = new StudyParticipant.Builder() .withPhone(TestConstants.PHONE) .withEmail(email) .withPassword(PASSWORD).build(); IdentifierHolder holder = null; try { IntentToParticipate intent = new IntentToParticipate.Builder() .withScope(SharingScope.NO_SHARING) .withPhone(TestConstants.PHONE) .withStudyId(TestConstants.TEST_STUDY_IDENTIFIER) .withOsName(OperatingSystem.ANDROID) .withConsentSignature(new ConsentSignature.Builder() .withName("Name") .withBirthdate("1970-01-01").build()) .withSubpopGuid(TestConstants.TEST_STUDY_IDENTIFIER).build(); intentService.submitIntentToParticipate(intent); study.setEmailVerificationEnabled(false); holder = authService.signUp(study, participant, true); CriteriaContext context = new CriteriaContext.Builder() .withStudyIdentifier(TestConstants.TEST_STUDY) .build(); SignIn signIn = new SignIn.Builder().withStudy(TestConstants.TEST_STUDY_IDENTIFIER) .withEmail(email).withPassword(PASSWORD).build(); authService.signIn(study, context, signIn); } finally { if (holder != null) { userAdminService.deleteUser(study, holder.getIdentifier()); } } }
Source:
<code><START> public HttpResponse addDocument(String apiName, String version, String provider, String docName, String docType, <END> String sourceType, String docUrl, String summary, String docLocation) throws APIManagerIntegrationTestException { try { checkAuthentication(); return HttpRequestUtil.doPost(new URL(backEndUrl + "/publisher/site/blocks/documentation/ajax/docs.jag") , "action=addDocumentation&provider=" + provider + "&apiName=" + apiName + "&version=" + version + "&docName=" + docName + "&docType=" + docType + "&sourceType=" + sourceType + "&docUrl" + docUrl + "=&summary=" + summary + "&docLocation=" + docLocation, requestHeaders); } catch (Exception e) { throw new APIManagerIntegrationTestException("Exception when Adding document to a API", e); } }</code><technical_language>Method is parameters.. introduce a bean hold values pass it</technical_language>

Target:
public HttpResponse addDocument(String apiName, String version, String provider, String docName, String docType, String sourceType, String docUrl, String summary, String docLocation) throws APIManagerIntegrationTestException { try { checkAuthentication(); return HttpRequestUtil.doPost( new URL(backendURL + "/publisher/site/blocks/documentation/ajax/docs.jag"), "action=addDocumentation&provider=" + provider + "&apiName=" + apiName + "&version=" + version + "&docName=" + docName + "&docType=" + docType + "&sourceType=" + sourceType + "&docUrl" + docUrl + "=&summary=" + summary + "&docLocation=" + docLocation, requestHeaders); } catch (Exception e) { throw new APIManagerIntegrationTestException("Exception when Adding document to a API", e); } }
Source:
<code><START> public void shouldFailAStripeNotificationWithAnUnexpectedContentType() throws Exception { <END> String transactionId = randomId(); createNewChargeWith(AUTHORISATION_SUCCESS, transactionId); given() .port(testContext.getPort()) .body("") .contentType(TEXT_XML) .post(NOTIFICATION_PATH) .then() .statusCode(415); }</code><technical_language>unneeded throws Exception</technical_language>

Target:
public void shouldFailAStripeNotificationWithAnUnexpectedContentType() { String transactionId = randomId(); createNewChargeWith(AUTHORISATION_SUCCESS, transactionId); given() .port(testContext.getPort()) .body("") .contentType(TEXT_XML) .post(NOTIFICATION_PATH) .then() .statusCode(415); }
Source:
<code>public void testLogReturnDoesntLogWhenLogLevelInactive() throws Exception { Log log = mock(Log.class); <START> when(log.isDebugEnabled()).thenReturn(false); <END> LoggedUtils.logReturn(log, "", new LoggedOverridingSubclass(), new Object()); }</code><technical_language>need mock, this is default value</technical_language>

Target:
public void testLogReturnDoesntLogWhenLogLevelInactive() throws Exception { Log log = mock(Log.class); LoggedUtils.logReturn(log, "", new LoggedOverridingSubclass(), new Object()); verify(log, never()).traceFormat(any(String.class), any()); verify(log, never()).debugFormat(any(String.class), any()); verify(log, never()).infoFormat(any(String.class), any()); verify(log, never()).warnFormat(any(String.class), any()); verify(log, never()).errorFormat(any(String.class), any()); verify(log, never()).fatalFormat(any(String.class), any()); }
Source:
<code>protected void render0(FunctionRenderContext context) { <START> Object[] jsonPathElements = new Object[context.getArgumentsSize() - 1]; <END> for (int i = 1; i < context.getArgumentsSize(); i++) { try { jsonPathElements[i - 1] = Integer.parseInt(JpqlFunctionUtil.unquoteSingleQuotes(context.getArgument(i))); } catch (NumberFormatException e) { jsonPathElements[i - 1] = JpqlFunctionUtil.unquoteDoubleQuotes(JpqlFunctionUtil.unquoteSingleQuotes(context.getArgument(i))); } } String jsonPath = toJsonPath(jsonPathElements, jsonPathElements.length, true); context.addChunk("coalesce(json_value("); context.addArgument(0); context.addChunk(" format json,'"); context.addChunk(jsonPath); context.addChunk("'),json_query("); context.addArgument(0); context.addChunk(" format json,'"); context.addChunk(jsonPath); context.addChunk("'))"); }</code><technical_language>for JSON_SET. A utility method accepts FunctionRenderContext context, int offset more appropriate. Object[] jsonPathElements = new Object[context.getArgumentsSize() - offset]; for (int i = 0; i < jsonPathElements.length; i++) { try { jsonPathElements[i] = Integer.parseInt(JpqlFunctionUtil.unquoteSingleQuotes(context.getArgument(i + offset))); } catch (NumberFormatException e) { jsonPathElements[i] = JpqlFunctionUtil.unquoteDoubleQuotes(JpqlFunctionUtil.unquoteSingleQuotes(context.getArgument(i + offset))); } } return jsonPathElements;</technical_language>

Target:
protected void render0(FunctionRenderContext context) { List<Object> jsonPathElements = AbstractJsonGetFunction.retrieveJsonPathElements(context, 1); String jsonPath = toJsonPath(jsonPathElements, jsonPathElements.size(), true); context.addChunk("coalesce(json_value("); context.addArgument(0); context.addChunk(" format json,'"); context.addChunk(jsonPath); context.addChunk("'),json_query("); context.addArgument(0); context.addChunk(" format json,'"); context.addChunk(jsonPath); context.addChunk("'))"); }
Source:
<code>private void populateOptions(Configuration configuration) { batchAccount = configuration.getExecution().getOptions().get("batchAccount"); batchKey = configuration.getExecution().getOptions().get("batchKey"); batchUri = configuration.getExecution().getOptions().get("batchUri"); batchServicePoolId = configuration.getExecution().getOptions().get("batchServicePoolId"); dockerImageName = configuration.getExecution().getOptions().get("dockerImageName"); <START> dockerArgs = configuration.getExecution().getOptions().get("dockerArgs"); <END> }</code><technical_language>Please, create public static final fields accepted option keys</technical_language>

Target:
private void populateOptions(Configuration configuration) { batchAccount = configuration.getExecution().getOptions().get(BATCH_ACCOUNT); batchKey = configuration.getExecution().getOptions().get(BATCH_KEY); batchUri = configuration.getExecution().getOptions().get(BATCH_URI); batchPoolId = configuration.getExecution().getOptions().get(BATCH_POOL_ID); dockerImageName = configuration.getExecution().getOptions().get(DOCKER_IMAGE_NAME); dockerArgs = configuration.getExecution().getOptions().get(DOCKER_ARGS); }
Source:
<code>private Optional<String> getGraphUUID() { final Diagram diagram = getDiagram(); if (Objects.isNull(diagram)) { return Optional.empty(); } final Graph graph = diagram.getGraph(); if (Objects.isNull(graph)) { return Optional.empty(); } return Optional.of(graph.getUUID()); <START> } <END></code><technical_language>I simplify this method this: java private Optional<String> getGraphUUID() { if (Objects.isNull(getDiagram()) || Objects.isNull(getGraph())) { return Optional.empty(); } return Optional.of(getGraph().getUUID()); } ..but feel free is :-)</technical_language>

Target:
private Optional<String> getGraphUUID() { if (Objects.isNull(getGraph())) { return Optional.empty(); } return Optional.of(getGraph().getUUID()); }
Source:
<code><START> public static float parseDistance(final String distanceText, final DistanceUnit unit) <END> throws NumberFormatException { return convertDistance(Float.parseFloat(distanceText), unit); }</code><technical_language>good. replace calls other parseDistance method calls this method? Afterwards, inline convertDistance method</technical_language>

Target:
public static float parseDistance(final String distanceText, final DistanceUnit unit) throws NumberFormatException { return convertDistance(Float.parseFloat(distanceText.replace(',', '.')), unit); }
Source:
<code>public static boolean compareCurrentPatients(Object patient1, Object patient2) { Patient p1 = (Patient) patient1; Patient p2 = (Patient) patient2; if (p1.getIdentifier().size() == p2.getIdentifier().size()) { for (int i = 0; i < p1.getIdentifier().size(); i++) { if (!p1.getIdentifier().get(i).equalsDeep(p2.getIdentifier().get(i))) { return false; } } <START> } <END> if (p1.getName().size() > 0 && p2.getName().size() > 0) { if (!p1.getName().get(0).equalsDeep(p2.getName().get(0))) { return false; } } if (p1.getTelecom().size() > 0 && p2.getTelecom().size() > 0) { if (!p1.getTelecom().get(0).equalsDeep(p2.getTelecom().get(0))) { return false; } } if (null != p1.getGender()) { if (!p1.getGender().equals(p2.getGender())) { return false; } } if (null != p1.getDeceased()) { if (!p1.getDeceased().equalsDeep(p2.getDeceased())) { return false; } } if (p1.getAddress().size() > 0 && p2.getAddress().size() > 0) { if (!p1.getAddress().get(0).equalsDeep(p2.getAddress().get(0))) { return false; } } if (null != p1.getMaritalStatus()) { if (!p1.getMaritalStatus().equalsDeep(p2.getMaritalStatus())) { return false; } } if (null != p1.getMultipleBirth()) { if (!p1.getMultipleBirth().equalsDeep(p2.getMultipleBirth())) { return false; } } if (null != p1.getGeneralPractitioner()) { if (!p1.getGeneralPractitioner().equals(p2.getGeneralPractitioner())) { return false; } } return p1.getActive() == p2.getActive(); }</code><technical_language>I 'else' statement 'return false;' line</technical_language>

Target:
public static boolean compareCurrentPatients(Object patient1, Object patient2) { Patient p1 = (Patient) patient1; Patient p2 = (Patient) patient2; if (p1.getIdentifier().size() == p2.getIdentifier().size()) { for (int i = 0; i < p1.getIdentifier().size(); i++) { if (!p1.getIdentifier().get(i).equalsDeep(p2.getIdentifier().get(i))) { return false; } } } else { return false; } if (p1.getName().size() > 0 && p2.getName().size() > 0) { if (!p1.getName().get(0).equalsDeep(p2.getName().get(0))) { return false; } } if (p1.getTelecom().size() > 0 && p2.getTelecom().size() > 0) { if (!p1.getTelecom().get(0).equalsDeep(p2.getTelecom().get(0))) { return false; } } if (null != p1.getGender()) { if (!p1.getGender().equals(p2.getGender())) { return false; } } if (null != p1.getDeceased()) { if (!p1.getDeceased().equalsDeep(p2.getDeceased())) { return false; } } if (p1.getAddress().size() > 0 && p2.getAddress().size() > 0) { if (!p1.getAddress().get(0).equalsDeep(p2.getAddress().get(0))) { return false; } } if (null != p1.getMaritalStatus()) { if (!p1.getMaritalStatus().equalsDeep(p2.getMaritalStatus())) { return false; } } if (null != p1.getMultipleBirth()) { if (!p1.getMultipleBirth().equalsDeep(p2.getMultipleBirth())) { return false; } } if (null != p1.getGeneralPractitioner()) { if (!p1.getGeneralPractitioner().equals(p2.getGeneralPractitioner())) { return false; } } return p1.getActive() == p2.getActive(); }
Source:
<code>protected static SimpleClusterTierClientEntity createClientEntity(String name, ServerStoreConfiguration configuration, boolean create) throws Exception { Connection connection = CONNECTION_SERVICE.connect(CLUSTER_URI, new Properties()); ClusterTierManagerClientEntityFactory entityFactory = new ClusterTierManagerClientEntityFactory(connection); if (create) { <START> entityFactory.create(name, new ServerSideConfiguration("defaultResource", Collections.<String, ServerSideConfiguration.Pool>emptyMap())); <END> } else { entityFactory.retrieve(name, null); } SimpleClusterTierClientEntity clientEntity = (SimpleClusterTierClientEntity) entityFactory.fetchOrCreateClusteredStoreEntity(name, name, configuration, true); clientEntity.validate(configuration); return clientEntity; }</code><technical_language>typing requested of some inference issue</technical_language>

Target:
protected static SimpleClusterTierClientEntity createClientEntity(String name, ServerStoreConfiguration configuration, boolean create) throws Exception { Connection connection = CONNECTION_SERVICE.connect(CLUSTER_URI, new Properties()); ClusterTierManagerClientEntityFactory entityFactory = new ClusterTierManagerClientEntityFactory(connection); if (create) { entityFactory.create(name, new ServerSideConfiguration("defaultResource", Collections.emptyMap())); } SimpleClusterTierClientEntity clientEntity = (SimpleClusterTierClientEntity) entityFactory.fetchOrCreateClusteredStoreEntity(name, name, configuration, true); clientEntity.validate(configuration); return clientEntity; }
Source:
<code>public void testGetLong_pos8() { fixture.position(8); long result = fixture.getLong(); assertEquals(result, 0x0102030405060708L); <START> } <END></code><technical_language>Alex, I merged. getLong is missing in code base. Committing this patch test a bad idea me</technical_language>

Target:
public void testGetLong_pos8() throws CTFReaderException { fixture.position(8); final long result = fixture.getLong(); assertEquals(result, 0x0102030405060708L); }
Source:
<code>private SafeHtml navigateDiff(final FileInfo info) { SafeHtmlBuilder b = new SafeHtmlBuilder(); if (Gerrit.isSignedIn() && DiffView.UNIFIED_DIFF.equals(Gerrit.getUserAccount() .getGeneralPreferences().getDiffView()) && !info.binary()) { b.openAnchor().setAttribute("href", diffUrl(info, "side-by-side")) .setAttribute("title", <START> "Switch to Side-By-Side view") <END> .append("Side_By-Side").closeAnchor(); } else if (Gerrit.isSignedIn() && DiffView.SIDE_BY_SIDE.equals(Gerrit.getUserAccount() .getGeneralPreferences().getDiffView())) { b.openAnchor().setAttribute("href", diffUrl(info, "unified")) .setAttribute("title", "Switch to Unified view").append("Unified") .closeAnchor(); } return b; }</code><technical_language>This a constant</technical_language>

Target:
private SafeHtml navigateDiff(final FileInfo info) { SafeHtmlBuilder b = new SafeHtmlBuilder(); if (Gerrit.isSignedIn()) { if (DiffView.UNIFIED_DIFF.equals(Gerrit.getUserAccount() .getGeneralPreferences().getDiffView()) && !info.binary()) { b.openAnchor().setAttribute("href", diffUrl(info, "side-by-side")) .setAttribute("title", Util.C.sideBySideView()) .append("Side_By-Side").closeAnchor(); } else if (DiffView.SIDE_BY_SIDE.equals(Gerrit.getUserAccount() .getGeneralPreferences().getDiffView())) { b.openAnchor().setAttribute("href", diffUrl(info, "unified")) .setAttribute("title", Util.C.unifiedView()).append("Unified") .closeAnchor(); } } return b; }
Source:
<code><START> private static File extract(@NonNull String libResPath, @NonNull String targetDir) throws Exception { <END> final File targetFile = new File(targetDir, new File(libResPath).getName()); if (targetFile.exists()) { return targetFile; } final File dir = new File(targetDir); if (!dir.mkdirs() && !dir.exists()) { throw new IOException("Cannot create target directory: " + dir.getAbsolutePath()); } InputStream in = null; FileOutputStream out = null; try { in = NativeLibrary.class.getResourceAsStream(libResPath); if (in == null) { throw new IOException("Native library not found at " + libResPath); } out = new FileOutputStream(targetFile); final byte[] buffer = new byte[1024]; int bytesRead = 0; while ((bytesRead = in.read(buffer)) != -1) { out.write(buffer, 0, bytesRead); } } finally { if (in != null) { try { in.close(); } catch (IOException e) { } } if (out != null) { try { out.close(); } catch (IOException e) { } } } if (!System.getProperty("os.name").toLowerCase().contains("windows")) { Runtime.getRuntime().exec(new String[] {"chmod", "755", targetFile.getAbsolutePath()}).waitFor(); } return targetFile; }</code><technical_language>I this throws IOException, no</technical_language>

Target:
private static File extract(@NonNull String libResPath, @NonNull String targetDir) throws IOException, InterruptedException { final File targetFile = new File(targetDir, new File(libResPath).getName()); if (targetFile.exists()) { return targetFile; } final File dir = new File(targetDir); if (!dir.mkdirs() && !dir.exists()) { throw new IOException("Cannot create target directory: " + dir.getAbsolutePath()); } InputStream in = null; FileOutputStream out = null; try { in = NativeLibrary.class.getResourceAsStream(libResPath); if (in == null) { throw new IOException("Native library not found at " + libResPath); } out = new FileOutputStream(targetFile); final byte[] buffer = new byte[1024]; int bytesRead = 0; while ((bytesRead = in.read(buffer)) != -1) { out.write(buffer, 0, bytesRead); } } finally { if (in != null) { try { in.close(); } catch (IOException e) { } } if (out != null) { try { out.close(); } catch (IOException e) { } } } if (!System.getProperty("os.name").toLowerCase().contains("windows")) { Runtime.getRuntime().exec(new String[] {"chmod", "755", targetFile.getAbsolutePath()}).waitFor(); } return targetFile; }
Source:
<code>public void enqueue(Lifespan lifespan, int partition, List<SerializedPage> pages) { <START> requireNonNull(lifespan, "lifespan is null"); <END> checkState(partition == 0, "Expected partition number to be zero"); checkState(lifespanCompletionCallback != null, "lifespanCompletionCallback has to be set before starting enqueue data"); enqueue(lifespan, pages); }</code><technical_language>This is check in overriden enqueue method. I this check is extra here</technical_language>

Target:
public void enqueue(Lifespan lifespan, int partition, List<SerializedPage> pages) { checkState(partition == 0, "Expected partition number to be zero"); enqueue(lifespan, pages); }
Source:
<code>public void testFilePageStoreManagerShouldThrowExceptionWhenFactoryClassCannotBeLoaded() throws Exception { String instanceName = getTestIgniteInstanceName(0); ClassLoader externalClsLdr = getExternalClassLoader(); <START> IgniteConfiguration cfg = optimize(getConfiguration(instanceName)); <END> cfg.setCacheConfiguration(getCacheConfiguration(externalClsLdr)); cfg.setClassLoader(externalClsLdr); IgniteEx ignite = (IgniteEx)startGrid(instanceName, cfg, null); ignite.cluster().active(true); ignite.context().config().setClassLoader(U.gridClassLoader()); GridCacheSharedContext sharedCtx = ignite.context().cache().context(); FilePageStoreManager pageStore = (FilePageStoreManager)sharedCtx.pageStore(); assertNotNull(pageStore); Throwable e = GridTestUtils.assertThrowsWithCause((Callable<Void>)() -> { pageStore.readCacheConfigurations(); return null; }, ClassNotFoundException.class); assertNotNull(e); assertTrue(e.getMessage().startsWith(ERR_MESSAGE)); }</code><technical_language>move this getConfiguration(String) simply call startGrid(String)</technical_language>

Target:
public void testFilePageStoreManagerShouldThrowExceptionWhenFactoryClassCannotBeLoaded() throws Exception { withFactory = true; IgniteEx ignite = (IgniteEx)startGrid(); ignite.cluster() .active(true); IgniteCache<Integer, String> cache = ignite.cache(TEST_CACHE); cache.put(1, "test value"); GridCacheSharedContext sharedCtx = ignite.context().cache().context(); FilePageStoreManager pageStore = (FilePageStoreManager)sharedCtx.pageStore(); assertNotNull(pageStore); File cacheData = new File( pageStore.cacheWorkDir(ignite.context().cache().cacheConfiguration(TEST_CACHE)), CACHE_DATA_FILENAME ); assertTrue(cacheData.exists()); stopGrid(); withFactory = false; GridTestUtils.assertThrowsAnyCause( new NullLogger(), this::startGrid, IgniteCheckedException.class, "An error occurred during cache configuration loading from file" ); assertTrue(cacheData.delete()); ignite = (IgniteEx)startGrid(); ignite.cluster() .active(true); cache = ignite.cache(TEST_CACHE); assertEquals("test value", cache.get(1)); }
Source:
<code>static List<TypeName> list(Type[] types) { List<TypeName> result = new ArrayList<>(types.length); <START> for (int i = 0; i < types.length; i++) { <END> result.add(get(types[i])); } return result; }</code><technical_language>This is bytecode equivalent for-each syntax array</technical_language>

Target:
static List<TypeName> list(Type[] types) { List<TypeName> result = new ArrayList<>(types.length); for (Type type : types) { result.add(get(type)); } return result; }
Source:
<code>public static final void checkJVMVersion() { <START> String jvmVersionRegex = System.getProperty("test.jvm.version.regex"); <END> if (jvmVersionRegex != null) { if (!System.getProperty("java.version").matches(jvmVersionRegex)) { System.err.printf("JVM version '%s' does not match '%s'\n", System.getProperty("java.version"), jvmVersionRegex); System.exit(1); } } }</code><technical_language>system properties access Java (as opposed Maven-only) start infinispan.test</technical_language>

Target:
public static final void checkJVMVersion() { String jvmVersionRegex = System.getProperty("infinispan.test.jvm.version.regex"); if (jvmVersionRegex != null) { if (!System.getProperty("java.version").matches(jvmVersionRegex)) { String message = String.format("JVM version '%s' does not match '%s'\n", System.getProperty("java.version"), jvmVersionRegex); throw new RuntimeException(message); } } }
Source:
<code>@Override public String getContext() { String contextName = String.valueOf(execute(DriverCommand.GET_CURRENT_CONTEXT_HANDLE).getValue()); <START> if ("null".equalsIgnoreCase(String.valueOf(contextName))) { <END> return null; } return contextName; }</code><technical_language>this done java Optional class</technical_language>

Target:
@Override public String getContext() { String contextName = String.valueOf(execute(DriverCommand.GET_CURRENT_CONTEXT_HANDLE).getValue()); if ("null".equalsIgnoreCase(contextName)) { return null; } return contextName; }
Source:
<code>public String substitute(Function<SqlNode, String> fn) { final SqlShuttle shuttle = new SqlShuttle() { @Override public SqlNode visit(SqlIdentifier id) { if (id.isStar()) { return id; } final SqlIdentifier toReplace = identifiersMap.get(id.getParserPosition()); <START> if (toReplace != null && id.names.size() >= toReplace.names.size()) { <END> return id; } return toReplace; } }; final SqlNode substituted = this.oriNode.accept(shuttle); return fn.apply(substituted); }</code><technical_language>this rather: if (toReplace == null || id.names.size() >= toReplace.names.size()) {</technical_language>

Target:
public String substitute(Function<SqlNode, String> fn) { final SqlShuttle shuttle = new SqlShuttle() { @Override public SqlNode visit(SqlCall call) { SqlOperator operator = call.getOperator(); if (operator instanceof SqlUnresolvedFunction) { final SqlUnresolvedFunction unresolvedFunction = (SqlUnresolvedFunction) operator; final SqlIdentifier functionID = unresolvedFunction.getSqlIdentifier(); if (functionID.isSimple() && funcNameToId.containsKey(functionID.getSimple())) { SqlUnresolvedFunction newFunc = new SqlUnresolvedFunction( funcNameToId.get(functionID.getSimple()), unresolvedFunction.getReturnTypeInference(), unresolvedFunction.getOperandTypeInference(), unresolvedFunction.getOperandTypeChecker(), unresolvedFunction.getParamTypes(), unresolvedFunction.getFunctionType()); return newFunc.createCall( call.getFunctionQuantifier(), call.getParserPosition(), call.getOperandList().toArray(new SqlNode[0])); } } return super.visit(call); } @Override public SqlNode visit(SqlIdentifier id) { if (id.isStar()) { return id; } final SqlIdentifier toReplace = identifiersMap.get(id.getParserPosition()); if (toReplace == null || id.names.size() >= toReplace.names.size()) { return id; } return toReplace; } }; final SqlNode substituted = this.oriNode.accept(shuttle); return fn.apply(substituted); }
Source:
<code>public void findOneTest() throws Exception { context.turnOffAuthorisationSystem(); <START> ePersonService.setPassword(eperson, password); <END> String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/eperson/epersons/" + admin.getID())) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$", is( EPersonMatcher.matchEPersonOnEmail(admin.getEmail() ) ))); }</code><technical_language>is this dead code</technical_language>

Target:
public void findOneTest() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@fake-email.com") .build(); EPerson ePerson2 = EPersonBuilder.createEPerson(context) .withNameInMetadata("Jane", "Smith") .withEmail("janesmith@fake-email.com") .build(); String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform(get("/api/eperson/epersons/" + ePerson2.getID())) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$", is( EPersonMatcher.matchEPersonEntry(ePerson2) ))) .andExpect(jsonPath("$", Matchers.not( is( EPersonMatcher.matchEPersonEntry(ePerson) ) ))); }
Source:
<code>public ActionConfigurationBuilder addKeySequenceFor(Action action, String... sequences) { <START> verifyActionExists(action); <END> final Set<KeyStroke> keyStrokes = new LinkedHashSet<KeyStroke>(); try { for (final String sequence : sequences) { keyStrokes.add(KeyStroke.getInstance(sequence)); } } catch (final ParseException ex) { throw new IllegalArgumentException("Invalid key sequence"); } addKeyStrokeFor(action, keyStrokes.toArray(new KeyStroke[] {})); return this; }</code><technical_language>this a weird builder? call methods a builder in order. this enforces order. pass actions constructor</technical_language>

Target:
public ActionConfigurationBuilder addKeySequenceFor(Action action, String... sequences) { verifyActionExists(action); final Set<KeyStroke> strokes = new LinkedHashSet<KeyStroke>(); try { for (final String sequence : sequences) { strokes.add(KeyStroke.getInstance(sequence)); } } catch (final ParseException ex) { throw new IllegalArgumentException("Invalid key sequence"); } addKeyStrokeFor(action.getId(), strokes.toArray(new KeyStroke[] {})); return this; }
Source:
<code>public void completesTerminationFutureIfActorStops() { final ActorSystem actorSystem = actorSystemResource.getActorSystem(); final ActorRef supervisor = SupervisorActor.startSupervisorActor(actorSystem, actorSystem.getDispatcher()); final SupervisorActor.StartAkkaRpcActorResponse startResponse = SupervisorActor.startAkkaRpcActor( supervisor, terminationFuture -> Props.create(SimpleActor.class, terminationFuture), "foobar"); <START> final SupervisorActor.ActorRegistration actorRegistration = startResponse.orElseThrow(cause -> new AssertionError("Expected the start to succeed.", cause)); <END> final CompletableFuture<Void> terminationFuture = actorRegistration.getTerminationFuture(); assertThat(terminationFuture.isDone(), is(false)); actorRegistration.getActorRef().tell(TerminateWithFutureCompletion.normal(), ActorRef.noSender()); terminationFuture.join(); }</code><technical_language>implementations for throwableFunction in this test. is a de-deduplicate this line: final SupervisorActor.ActorRegistration actorRegistration = startResponse.orElseThrow(cause -> new AssertionError("Expected start succeed.", cause));</technical_language>

Target:
public void completesTerminationFutureIfActorStops() { final ActorSystem actorSystem = actorSystemResource.getActorSystem(); final ActorRef supervisor = SupervisorActor.startSupervisorActor(actorSystem, actorSystem.getDispatcher()); final SupervisorActor.ActorRegistration actorRegistration = startAkkaRpcActor(supervisor, "foobar"); final CompletableFuture<Void> terminationFuture = actorRegistration.getTerminationFuture(); assertThat(terminationFuture.isDone(), is(false)); actorRegistration.getActorRef().tell(TerminateWithFutureCompletion.normal(), ActorRef.noSender()); terminationFuture.join(); }
Source:
<code>public synchronized void updateSubscription(Subscription newSubscription) { boolean endpointUpdated = !this.subscription.getEndpoint().equals(newSubscription.getEndpoint()); boolean subscriptionPolicyUpdated = !Objects.equals(this.subscription.getSerialSubscriptionPolicy(), newSubscription.getSerialSubscriptionPolicy()); if (requestTimeoutMs != newSubscription.getSerialSubscriptionPolicy().getRequestTimeout()) { requestTimeoutMs = newSubscription.getSerialSubscriptionPolicy().getRequestTimeout(); <START> } <END> this.subscription = newSubscription; if (endpointUpdated || subscriptionPolicyUpdated) { this.messageSender = messageSenderFactory.create(newSubscription); } }</code><technical_language>assignment enough if statement :P</technical_language>

Target:
public synchronized void updateSubscription(Subscription newSubscription) { boolean endpointUpdated = !this.subscription.getEndpoint().equals(newSubscription.getEndpoint()); boolean subscriptionPolicyUpdated = !Objects.equals(this.subscription.getSerialSubscriptionPolicy(), newSubscription.getSerialSubscriptionPolicy()); this.requestTimeoutMs = newSubscription.getSerialSubscriptionPolicy().getRequestTimeout(); this.subscription = newSubscription; if (endpointUpdated || subscriptionPolicyUpdated) { this.messageSender = messageSenderFactory.create(newSubscription); } }
Source:
<code>public void testEmptyHostConfig() throws Exception { String line = "embed-host-controller --std-out=echo --host-config=host-empty-cli.xml --domain-config=domain-cli.xml --empty-host-config" + JBOSS_HOME; cli.sendLine(line); cli.sendLine("ls /host"); CLIOpResult result = cli.readAllAsOpResult(); ModelNode mn = result.getResponseNode(); assertNull(mn); cli.sendLine("ls /host=foo", true); final String output = cli.readOutput(); <START> assertEquals("WFLYDC0033: Operation targets host foo but that host is not registered", output); <END> assertTrue(cli.isConnected()); cli.sendLine(":read-children-names(child-type=host)"); result = cli.readAllAsOpResult(); mn = result.getResponseNode(); assertEquals(SUCCESS, mn.get(OUTCOME).asString()); assertEquals(0, mn.get(RESULT).asList().size()); assertTrue(cli.isConnected()); }</code><technical_language>This assert presence of message code, text, a system default locale. text change</technical_language>

Target:
public void testEmptyHostConfig() throws Exception { String line = "embed-host-controller --std-out=echo --host-config=host-empty-cli.xml --domain-config=domain-cli.xml --empty-host-config" + JBOSS_HOME; cli.sendLine(line); cli.sendLine("ls /host"); CLIOpResult result = cli.readAllAsOpResult(); ModelNode mn = result.getResponseNode(); assertNull(mn); cli.sendLine("ls /host=foo", true); final String output = cli.readOutput(); assertTrue(output.startsWith("WFLYDC0033:")); assertTrue(cli.isConnected()); cli.sendLine(":read-children-names(child-type=host)"); result = cli.readAllAsOpResult(); mn = result.getResponseNode(); assertEquals(SUCCESS, mn.get(OUTCOME).asString()); assertEquals(0, mn.get(RESULT).asList().size()); assertTrue(cli.isConnected()); }
Source:
<code>protected String signJWTWithRSA(JWTClaimsSet jwtClaimsSet, OAuthTokenReqMessageContext request) throws IdentityOAuth2Exception { try { String tenantDomain = request.getOauth2AccessTokenReqDTO().getTenantDomain(); if (tenantDomain == null) { tenantDomain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME; <START> } <END> int tenantId = OAuth2Util.getTenantId(tenantDomain); Key privateKey; if (!(privateKeys.containsKey(tenantId))) { KeyStoreManager tenantKSM = KeyStoreManager.getInstance(tenantId); if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { String ksName = tenantDomain.trim().replace(".", "-"); String jksName = ksName + ".jks"; privateKey = tenantKSM.getPrivateKey(jksName, tenantDomain); } else { try { privateKey = tenantKSM.getDefaultPrivateKey(); } catch (Exception e) { throw new IdentityOAuth2Exception("Error while obtaining private key for super tenant", e); } } privateKeys.put(tenantId, privateKey); } else { privateKey = privateKeys.get(tenantId); } JWSSigner signer = new RSASSASigner((RSAPrivateKey) privateKey); SignedJWT signedJWT = new SignedJWT(new JWSHeader((JWSAlgorithm) signatureAlgorithm), jwtClaimsSet); signedJWT.sign(signer); return signedJWT.serialize(); } catch (JOSEException e) { throw new IdentityOAuth2Exception("Error occurred while signing JWT", e); } }</code><technical_language>IINM this condition is needed do building OAuth2AccessTokenReqDTO</technical_language>

Target:
protected String signJWTWithRSA(JWTClaimsSet jwtClaimsSet, OAuthTokenReqMessageContext request) throws IdentityOAuth2Exception { try { String tenantDomain = request.getAuthorizedUser().getTenantDomain(); int tenantId = IdentityTenantUtil.getTenantId(tenantDomain); Key privateKey; if (!(privateKeys.containsKey(tenantId))) { KeyStoreManager tenantKSM = KeyStoreManager.getInstance(tenantId); if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { String ksName = tenantDomain.trim().replace(".", "-"); String jksName = ksName + ".jks"; privateKey = tenantKSM.getPrivateKey(jksName, tenantDomain); } else { try { privateKey = tenantKSM.getDefaultPrivateKey(); } catch (Exception e) { throw new IdentityOAuth2Exception("Error while obtaining private key for super tenant", e); } } privateKeys.put(tenantId, privateKey); } else { privateKey = privateKeys.get(tenantId); } JWSSigner signer = new RSASSASigner((RSAPrivateKey) privateKey); SignedJWT signedJWT = new SignedJWT(new JWSHeader((JWSAlgorithm) signatureAlgorithm), jwtClaimsSet); signedJWT.sign(signer); return signedJWT.serialize(); } catch (JOSEException e) { throw new IdentityOAuth2Exception("Error occurred while signing JWT", e); } }
Source:
<code>public void testUpsertOnSCNSetTxnTable() throws SQLException { <START> String trnx = "CREATE TABLE transaction_table (METRIC_ID CHAR(15) NOT NULL,\n" + <END> "METRIC_VALUE VARCHAR(50) \n" + "CONSTRAINT PK PRIMARY KEY(METRIC_ID)) TRANSACTION_PROVIDER='TEPHRA',TRANSACTIONAL=true"; Properties props = new Properties(); Connection conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute(trnx); props.setProperty("CurrentSCN", Long.toString(System.currentTimeMillis())); conn = DriverManager.getConnection(getUrl(), props); conn.setAutoCommit(true); String upsert = "UPSERT INTO transaction_table(METRIC_ID, METRIC_VALUE) VALUES (?,?)"; PreparedStatement prep = conn.prepareStatement(upsert); prep.setString(1,"abc"); prep.setString(2,"This is the first comment!"); exception.expect(SQLException.class); exception.expectMessage(containsString("ERROR 1075 (44A06): Cannot use a " + "connection with SCN set for a transactional table.")); prep.executeUpdate(); }</code><technical_language>a generateUniqueName() create tables unique names tests extend ParallelStatsDisabledIT share cluster</technical_language>

Target:
public void testUpsertOnSCNSetTxnTable() throws SQLException { helpTestUpserWithSCNIT(false, true, false, false, false); exception.expect(SQLException.class); exception.expectMessage(containsString(String.valueOf( SQLExceptionCode .CANNOT_SPECIFY_SCN_FOR_TXN_TABLE .getErrorCode()))); prep.executeUpdate(); }
Source:
<code>public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) { View view = ((View) object); container.removeView(view); <START> view.setTag(-1); <END> }</code><technical_language>tag relate action</technical_language>

Target:
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) { View view = ((View) object); container.removeView(view); }
Source:
<code>private void deleteVM(ClaudiaData claudiaData, EnvironmentInstance envInstance) throws InvalidEntityException { try { <START> log.info("Deleting Virtual Machines for environmetn instance " + envInstance.getBlueprintName()); <END> envInstance.setStatus(Status.UNDEPLOYING); envInstance = environmentInstanceDao.update(envInstance); infrastructureManager.deleteEnvironment(claudiaData, envInstance); } catch (Exception e) { log.error("It is not possible to delete the environment " + envInstance.getName() + " : " + e.getMessage()); throw new InvalidEntityException(EnvironmentInstance.class, e); } }</code><technical_language>Deleting Virtual Machines for environment instance</technical_language>

Target:
private void deleteVM(ClaudiaData claudiaData, EnvironmentInstance envInstance) throws InvalidEntityException { try { log.info("Deleting Virtual Machines for environment instance " + envInstance.getBlueprintName()); envInstance.setStatus(Status.UNDEPLOYING); envInstance = environmentInstanceDao.update(envInstance); infrastructureManager.deleteEnvironment(claudiaData, envInstance); } catch (Exception e) { log.error("It is not possible to delete the environment " + envInstance.getName() + " : " + e.getMessage()); throw new InvalidEntityException(EnvironmentInstance.class, e); } }
Source:
<code>public void example1Pointers() { JsonPointer pointer1 = JsonPointer.from("/hello/world"); <START> JsonPointer pointer2 = JsonPointer.fromURI(URI.create("#/hello/world")); <END> JsonPointer pointer3 = JsonPointer.create() .append("hello") .append("world"); }</code><technical_language>URI translated other languages</technical_language>

Target:
public void example1Pointers() { JsonPointer pointer1 = JsonPointer.from("/hello/world"); JsonPointer pointer2 = JsonPointer.create() .append("hello") .append("world"); }
Source:
<code>private boolean updateVms() { List<VM> vmList = getVmDao().getAllForCluster(getParameters().getCluster().getId()); <START> Cluster oldCluster = getClusterDao().get(getCluster().getId()); <END> for (VM vm : vmList) { if (!vm.isExternalVm() && !vm.isHostedEngine()) { VmManagementParametersBase updateParams = new VmManagementParametersBase(vm); if (!Objects.equals(oldCluster.getCompatibilityVersion(), getParameters().getCluster().getCompatibilityVersion())) { updateParams.setClusterLevelChangeToVersion(getParameters().getCluster().getCompatibilityVersion()); } VdcReturnValueBase result = runInternalAction( VdcActionType.UpdateVm, updateParams, cloneContextAndDetachFromParent()); if (!result.getSucceeded()) { getReturnValue().setFault(result.getFault()); return false; } } } return true; }</code><technical_language>I some mess.. backported this change 4.0 branch.</technical_language>

Target:
private boolean updateVms() { List<VM> vmList = getVmDao().getAllForCluster(getParameters().getCluster().getId()); for (VM vm : vmList) { if (!vm.isExternalVm() && !vm.isHostedEngine()) { VmManagementParametersBase updateParams = new VmManagementParametersBase(vm); if (!Objects.equals(oldCluster.getCompatibilityVersion(), getParameters().getCluster().getCompatibilityVersion())) { updateParams.setClusterLevelChangeToVersion(getParameters().getCluster().getCompatibilityVersion()); } VdcReturnValueBase result = runInternalAction( VdcActionType.UpdateVm, updateParams, cloneContextAndDetachFromParent()); if (!result.getSucceeded()) { getReturnValue().setFault(result.getFault()); return false; } } } return true; }
Source:
<code><START> private static final TypeKind toPrimitiveIntegralTypeKind(TypeMirror type) { <END> TypeKind typeKind = NumberUtils.unboxPrimitive(type); if (isPrimitiveIntegral(typeKind)) { return typeKind; } throw new BugInCF(type.toString() + " expected to be an integral type."); }</code><technical_language>final add for a private method</technical_language>

Target:
private static TypeKind toPrimitiveIntegralTypeKind(TypeMirror type) { TypeKind typeKind = NumberUtils.unboxPrimitive(type); if (isPrimitiveIntegral(typeKind)) { return typeKind; } throw new BugInCF(type.toString() + " expected to be an integral type."); }
Source:
<code>private void addToUnsecuredCookies(VariableTree variableTree) { ExpressionTree initializer = variableTree.initializer(); <START> if (initializer != null && variableTree.symbol().isVariableSymbol() && variableTree.symbol().owner().isMethodSymbol()) { <END> boolean isInitializedWithConstructor = initializer.is(Tree.Kind.NEW_CLASS); boolean isMatchedType = isCookieClass(variableTree.symbol().type()) || isCookieClass(initializer.symbolType()); if (isInitializedWithConstructor && isMatchedType && isSecureParamFalse((NewClassTree) initializer)) { unsecuredCookies.add((Symbol.VariableSymbol) variableTree.symbol()); } } }</code><technical_language>Extract variableTree.symbol() instead of calling 3 times</technical_language>

Target:
private void addToUnsecuredCookies(VariableTree variableTree) { ExpressionTree initializer = variableTree.initializer(); Symbol variableTreeSymbol = variableTree.symbol(); if (initializer != null && variableTreeSymbol.isVariableSymbol() && variableTreeSymbol.owner().isMethodSymbol()) { boolean isInitializedWithConstructor = initializer.is(Tree.Kind.NEW_CLASS); boolean isMatchedType = isCookieClass(variableTreeSymbol.type()) || isCookieClass(initializer.symbolType()); if (isInitializedWithConstructor && isMatchedType && isSecureParamFalse((NewClassTree) initializer)) { unsecuredCookies.add((Symbol.VariableSymbol) variableTreeSymbol); } } }
Source:
<code><START> public static Item getFrameFromType(FrameType type) { <END> switch (type) { case JEWEL: return GadgetItems.jewel_item_frame.get(); case ALUMINUM_BRASS: return GadgetItems.aluminum_brass_item_frame.get(); case COBALT: return GadgetItems.cobalt_item_frame.get(); case ARDITE: return GadgetItems.ardite_item_frame.get(); case MANYULLYN: return GadgetItems.manyullyn_item_frame.get(); case GOLD: return GadgetItems.gold_item_frame.get(); case CLEAR: return GadgetItems.clear_item_frame.get(); default: return Items.ITEM_FRAME; } }</code><technical_language>If fancy frames EnumObject, this method return GadgetItems.item_frame.get(type);</technical_language>

Target:
public static Item getFrameFromType(FrameType type) { return GadgetItems.item_frame.get(type); }
Source:
<code><START> private void setNotificationOngoing(Bundle extras, NotificationCompat.Builder mBuilder) { <END> String ongoingString = extras.getString(ONGOING); if (ongoingString != null) { try { Boolean ongoing = Boolean.valueOf(ongoingString); mBuilder.setOngoing(ongoing); } catch (RuntimeException e) { e.printStackTrace(); } } }</code><technical_language>This method written more succinctly as: boolean ongoing = extras.optBoolean(ONGOING, false); mBuilder.setOngoing(ongoing);</technical_language>

Target:
private void setNotificationOngoing(Bundle extras, NotificationCompat.Builder mBuilder) { boolean ongoing = extras.optBoolean(ONGOING, false); mBuilder.setOngoing(ongoing); }
Source:
<code>public void should_instanciate_a_process_with_given_inputs() throws Exception { final Map<String, Serializable> expectedComplexInput = aComplexInput(); when(processAPI.startProcessWithInputs(PROCESS_DEFINITION_ID, expectedComplexInput)).thenReturn(new ProcessInstanceImpl("complexProcessInstance")); when(processAPI.getProcessContract(PROCESS_DEFINITION_ID)).thenReturn(contractDefinition); final Response response = request(URL_API_PROCESS_INSTANTIATION_TEST).post(VALID_COMPLEX_POST_BODY); assertThat(response).hasStatus(Status.SUCCESS_OK); assertThat(response.getEntityAsText()) .isEqualTo( <START> "{\"processInstanceId\":0}"); <END> verify(processAPI).startProcessWithInputs(PROCESS_DEFINITION_ID, expectedComplexInput); }</code><technical_language>caseId instead of processInstanceId antyhing web side,</technical_language>

Target:
public void should_instanciate_a_process_with_given_inputs() throws Exception { final Map<String, Serializable> expectedComplexInput = aComplexInput(); when(processAPI.startProcessWithInputs(PROCESS_DEFINITION_ID, expectedComplexInput)).thenReturn(new ProcessInstanceImpl("complexProcessInstance")); when(processAPI.getProcessContract(PROCESS_DEFINITION_ID)).thenReturn(contractDefinition); final Response response = request(URL_API_PROCESS_INSTANTIATION_TEST).post(VALID_COMPLEX_POST_BODY); assertThat(response).hasStatus(Status.SUCCESS_OK); assertThat(response.getEntityAsText()) .isEqualTo( "{\"caseId\":0}"); verify(processAPI).startProcessWithInputs(PROCESS_DEFINITION_ID, expectedComplexInput); }
Source:
<code>@Override protected void afterTest() throws Exception { super.afterTest(); mbSrv.clear(); <START> for (String cacheName : grid(0).cacheNames()) <END> if (!(EXISTING_CACHE_NAME.equals(cacheName) || DEFAULT_CACHE_NAME.equals(cacheName))) grid(0).cache(cacheName).destroy(); }</code><technical_language>Multiline for statement wrapped braces</technical_language>

Target:
@Override protected void afterTest() throws Exception { super.afterTest(); mbSrv.clear(); for (String cacheName : grid(0).cacheNames()) { if (!(EXISTING_CACHE_NAME.equals(cacheName) || DEFAULT_CACHE_NAME.equals(cacheName))) grid(0).cache(cacheName).destroy(); } }