auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void batchUpdate(final String ryaInstanceName, final String pcjId) throws InstanceDoesNotExistException, PCJDoesNotExistException, RyaClientException { requireNonNull(ryaInstanceName); requireNonNull(pcjId); <START> Preconditions.checkState(instanceExists.exists(ryaInstanceName), "The instance: " + ryaInstanceName + " does not exist."); <END> verifyPCJState(ryaInstanceName, pcjId, mongoClient); updatePCJResults(ryaInstanceName, pcjId, mongoClient); updatePCJMetadata(ryaInstanceName, pcjId, mongoClient); }</code><technical_language>Static import</technical_language>

Target:
public void batchUpdate(final String ryaInstanceName, final String pcjId) throws InstanceDoesNotExistException, PCJDoesNotExistException, RyaClientException { requireNonNull(ryaInstanceName); requireNonNull(pcjId); checkState(instanceExists.exists(ryaInstanceName), "The instance: " + ryaInstanceName + " does not exist."); verifyPCJState(ryaInstanceName, pcjId, mongoClient); updatePCJResults(ryaInstanceName, pcjId, mongoClient); updatePCJMetadata(ryaInstanceName, pcjId, mongoClient); }
Source:
<code>private Score score(Item subject, Item candidate) { <START> return subject.getYear().equals(candidate.getYear()) ? matchScore : Score.nullScore(); <END> }</code><technical_language>I this needs account if year is empty for both, want match them</technical_language>

Target:
private Score score(Item subject, Item candidate) { if (subject.getYear() == null || candidate.getYear() == null) { return Score.nullScore(); } return subject.getYear().equals(candidate.getYear()) ? matchScore : Score.ZERO; }
Source:
<code>public ConsolePasswordFinder(Console console, String promptFormat, int maxTries) { this.console = console; <START> this.promptFormat = promptFormat; <END> this.maxTries = maxTries; this.numTries = 0; }</code><technical_language>checking format of prompt here, constructor is public. I need builder, 3 parameters. fine a constructor. In case need do check also</technical_language>

Target:
public ConsolePasswordFinder(Console console, String promptFormat, int maxTries) { checkFormatString(promptFormat); this.console = console; this.promptFormat = promptFormat; this.maxTries = maxTries; this.numTries = 0; }
Source:
<code>private void addChildren(ITmfStateSystem ss, Builder<@NonNull TimeGraphEntryModel> builder, int quark, long parentId) { for (Integer child : ss.getSubAttributes(quark, false)) { long childId = getId(child); builder.add(new TimeGraphEntryModel(childId, parentId, ss.getAttributeName(child), ss.getStartTime(), <START> Long.MAX_VALUE)); <END> addChildren(ss, builder, child, childId); } }</code><technical_language>ss.getCurrentEndTime</technical_language>

Target:
private void addChildren(ITmfStateSystem ss, Builder<@NonNull TimeGraphEntryModel> builder, int quark, long parentId) { for (Integer child : ss.getSubAttributes(quark, false)) { long childId = getId(child); builder.add(new TimeGraphEntryModel(childId, parentId, ss.getAttributeName(child), ss.getStartTime(), ss.getCurrentEndTime())); addChildren(ss, builder, child, childId); } }
Source:
<code>protected int localInstancesCount(IgniteUuid srvcId) { Collection<ServiceContextImpl> ctxs = locServices.get(srvcId); <START> return ctxs != null ? ctxs.size() : 0; <END> }</code><technical_language>Missing synchronization</technical_language>

Target:
int localInstancesCount(IgniteUuid srvcId) { Collection<ServiceContextImpl> ctxs = locServices.get(srvcId); if (ctxs == null) return 0; synchronized (ctxs) { return ctxs.size(); } }
Source:
<code>protected Collection<String> getSuggestedNames(final HaxeExpression expression) { Collection<String> candidates = new LinkedHashSet<String>(); String text = expression.getText(); if (expression instanceof HaxeCallExpression) { final HaxeExpression callee = ((HaxeCallExpression)expression).getExpression(); text = callee.getText(); } else if (expression instanceof HaxeRegularExpression) { text = "REGEX"; } else if (expression instanceof HaxeLiteralExpression) { text = "CONST_" + expression.getText().toUpperCase(); } if (text != null) { candidates.addAll(HaxeNameSuggesterUtil.generateNames(text)); } if (candidates.isEmpty()) { candidates.add("x"); <START> } <END> final Set<String> usedNames = HaxeRefactoringUtil.collectUsedNames(expression); usedNames.addAll(HaxeRefactoringUtil.collectKeywords()); final Collection<String> result = new ArrayList<String>(); for (String candidate : candidates) { int index = 0; String suffix = ""; while (usedNames.contains(candidate + suffix)) { suffix = Integer.toString(++index); } result.add(candidate + suffix); } return result; }</code><technical_language>Java extract variable refactoring suggest name based type of expression, if is variant is found. i for Int, s for String, b for Boolean, arr for Array, etc. provide functionality</technical_language>

Target:
protected Collection<String> getSuggestedNames(final HaxeExpression expression) { return HaxeNameSuggesterUtil.getSuggestedNames(expression, false); }
Source:
<code>public void deleteSecurityTeam(PerunSession sess, SecurityTeam securityTeam, boolean forceDelete) throws SecurityTeamNotExistsException, InternalErrorException, RelationExistsException { List<User> blacklist = getSecurityTeamsManagerImpl().getBlacklist(sess, Collections.singletonList(securityTeam)); if (blacklist != null && !blacklist.isEmpty() && !forceDelete) { throw new RelationExistsException("SecurityTeam has blacklisted users."); <START> } <END> if (blacklist != null) { for (User blacklistedUser : blacklist) { getPerunBl().getSecurityTeamsManagerBl().removeUserFromBlacklist(sess, securityTeam, blacklistedUser); } } List<Facility> facilities = getPerunBl().getFacilitiesManagerBl().getAssignedFacilities(sess, securityTeam); if (facilities != null && !facilities.isEmpty() && !forceDelete) { throw new RelationExistsException("SecurityTeam is assigned to some facilities."); } if (facilities != null) { for (Facility facility : facilities) { getPerunBl().getFacilitiesManagerBl().removeSecurityTeam(sess, facility, securityTeam); } } getSecurityTeamsManagerImpl().deleteSecurityTeam(sess, securityTeam); getPerunBl().getAuditer().log(sess,new SecurityTeamDeleted(securityTeam)); }</code><technical_language>In this case, blackList null. method returns null. Actually, problem is in if statement above. blacklist != null removed</technical_language>

Target:
public void deleteSecurityTeam(PerunSession sess, SecurityTeam securityTeam, boolean forceDelete) throws SecurityTeamNotExistsException, InternalErrorException, RelationExistsException { List<User> blacklist = getSecurityTeamsManagerImpl().getBlacklist(sess, Collections.singletonList(securityTeam)); if (!blacklist.isEmpty() && !forceDelete) { throw new RelationExistsException("SecurityTeam has blacklisted users."); } for (User blacklistedUser : blacklist) { getPerunBl().getSecurityTeamsManagerBl().removeUserFromBlacklist(sess, securityTeam, blacklistedUser); } List<Facility> facilities = getPerunBl().getFacilitiesManagerBl().getAssignedFacilities(sess, securityTeam); if (!facilities.isEmpty() && !forceDelete) { throw new RelationExistsException("SecurityTeam is assigned to some facilities."); } for (Facility facility : facilities) { getPerunBl().getFacilitiesManagerBl().removeSecurityTeam(sess, facility, securityTeam); } getSecurityTeamsManagerImpl().deleteSecurityTeam(sess, securityTeam); getPerunBl().getAuditer().log(sess,new SecurityTeamDeleted(securityTeam)); }
Source:
<code>private boolean isFeedbackParticipantNameVisibleToUser( FeedbackQuestionAttributes question, FeedbackResponseAttributes response, String userEmail, UserRole role, boolean isGiverName, CourseRoster roster) { List<FeedbackParticipantType> showNameTo = isGiverName ? question.showGiverNameTo : question.showRecipientNameTo; for (FeedbackParticipantType type : showNameTo) { switch (type) { case INSTRUCTORS: if (roster.getInstructorForEmail(userEmail) != null && role == UserRole.INSTRUCTOR) { return true; } break; case OWN_TEAM_MEMBERS: case OWN_TEAM_MEMBERS_INCLUDING_SELF: if (roster.isStudentsInSameTeam(response.giver, userEmail)) { return true; } break; case RECEIVER: if (question.recipientType.isTeam()) { if (roster.isStudentInTeam(userEmail, response.recipient)) { return true; } break; } else if (response.recipient.equals(userEmail)) { return true; } else { break; } case RECEIVER_TEAM_MEMBERS: if (question.recipientType.isTeam()) { if (roster.isStudentInTeam(userEmail, response.recipient)) { return true; } break; } else if (roster.isStudentsInSameTeam(response.recipient, userEmail)) { return true; } break; case STUDENTS: if (roster.isStudentInCourse(userEmail)) { return true; } break; default: Assumption.fail("Invalid FeedbackParticipantType for showNameTo in " <START> + "FeedbackResponseLogic.shouldFeedbackParticipantNameBeVisibleToUser()"); <END> break; } } return false; }</code><technical_language>Need change this consistent current method name</technical_language>

Target:
private boolean isFeedbackParticipantNameVisibleToUser( FeedbackQuestionAttributes question, FeedbackResponseAttributes response, String userEmail, UserRole role, boolean isGiverName, CourseRoster roster) { List<FeedbackParticipantType> showNameTo = isGiverName ? question.showGiverNameTo : question.showRecipientNameTo; for (FeedbackParticipantType type : showNameTo) { switch (type) { case INSTRUCTORS: if (roster.getInstructorForEmail(userEmail) != null && role == UserRole.INSTRUCTOR) { return true; } break; case OWN_TEAM_MEMBERS: case OWN_TEAM_MEMBERS_INCLUDING_SELF: if (roster.isStudentsInSameTeam(response.giver, userEmail)) { return true; } break; case RECEIVER: if (question.recipientType.isTeam()) { if (roster.isStudentInTeam(userEmail, response.recipient)) { return true; } break; } else if (response.recipient.equals(userEmail)) { return true; } else { break; } case RECEIVER_TEAM_MEMBERS: if (question.recipientType.isTeam()) { if (roster.isStudentInTeam(userEmail, response.recipient)) { return true; } break; } else if (roster.isStudentsInSameTeam(response.recipient, userEmail)) { return true; } break; case STUDENTS: if (roster.isStudentInCourse(userEmail)) { return true; } break; default: Assumption.fail("Invalid FeedbackParticipantType for showNameTo in " + "FeedbackResponseLogic.isFeedbackParticipantNameVisibleToUser()"); break; } } return false; }
Source:
<code>default void onConfigurationSuccess(ITestResult itr) { <START> throw new UnsupportedOperationException("Method is not implemented"); <END> }</code><technical_language>here. I dont throwing exceptions.We instead empty implementations</technical_language>

Target:
default void onConfigurationSuccess(ITestResult itr) { }
Source:
<code>public void testOnlyOneErrorForMissingRequiredProperty() throws Exception { EObject testModel = parseHelper.parse("use testmodel.* TestModel {}"); AssertableDiagnostics assertDiag = tester.validate(testModel).assertDiagnosticsCount(1); assertDiag.assertErrorContains("The required feature"); <START> diagnosticConverter.convertValidatorDiagnostic(assertDiag.getDiagnostic(), new IAcceptor<Issue>() { <END> @Override public void accept(Issue t) { assertEquals("lineNumber", Integer.valueOf(1), t.getLineNumber()); assertEquals("length", Integer.valueOf("TestModel {".length()), t.getLength()); } }); }</code><technical_language>This is sufficient - imagine if anon IAcceptor called - test passes, do I mean? want do write IAcceptor impl. assert accept() called</technical_language>

Target:
public void testOnlyOneErrorForMissingRequiredProperty() throws Exception { EObject testModel = parseHelper.parse("use testmodel.* TestModel {}"); AssertableDiagnostics assertDiag = tester.validate(testModel).assertDiagnosticsCount(1); assertDiag.assertErrorContains("The required feature"); final AtomicBoolean acceptPassed = new AtomicBoolean(); new MyDiagnosticConverter(diagnosticConverter).convertValidatorDiagnostic(assertDiag.getDiagnostic(), new IAcceptor<Issue>() { @Override public void accept(Issue t) { assertEquals("lineNumber", Integer.valueOf(1), t.getLineNumber()); assertEquals("length", Integer.valueOf("TestModel {".length()), t.getLength()); acceptPassed.set(true); } }); assertTrue("accept run", acceptPassed.get()); }
Source:
<code>private static double process() { SwapPricePerformance test = new SwapPricePerformance(); long start = System.nanoTime(); double total = 0d; for (int i = 0; i < 10000; i++) { total += test.test_VanillaFixedVsLibor1mSwap(); total += test.test_VanillaFixedVsLibor3mSwap(); total += test.test_VanillaFixedVsLibor3mSwapWithFixing(); total += test.test_BasisLibor3mVsLibor6mSwapWithSpread(); total += test.test_BasisCompoundedLibor1mVsLibor3mSwap(); if (total < -1_000_000d) { System.out.println("negative"); } } <START> System.out.println("positive " + total); <END> long end = System.nanoTime(); System.out.println((end - start) / 1000000000d + " s"); return total; }</code><technical_language>'positive' refer here</technical_language>

Target:
private static double process() { SwapPricePerformance test = new SwapPricePerformance(); long start = System.nanoTime(); double total = 0d; for (int i = 0; i < 10_000; i++) { total += test.test_VanillaFixedVsLibor1mSwap(); total += test.test_VanillaFixedVsLibor3mSwap(); total += test.test_VanillaFixedVsLibor3mSwapWithFixing(); total += test.test_BasisLibor3mVsLibor6mSwapWithSpread(); total += test.test_BasisCompoundedLibor1mVsLibor3mSwap(); } System.out.println("Total: " + total); long end = System.nanoTime(); System.out.println((end - start) / 1_000_000_000d + " s"); return total; }
Source:
<code>public void testRemoteMapReduceWithStreams() throws Exception { String cacheName = "testRemoteMapReduce_Streams"; ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); builder.dataContainer().keyEquivalence(new AnyServerEquivalence()).valueEquivalence(new AnyServerEquivalence()).compatibility().enable().marshaller(new GenericJBossMarshaller()); defineInAll(cacheName, builder); RemoteCache<String, String> cache = clients.get(0).getCache(cacheName); RemoteCache<String, String> scriptCache = clients.get(0).getCache(SCRIPT_CACHE); loadData(cache, "/macbeth.txt"); loadScript(scriptCache, "/wordCountStream.js"); <START> HashMap<String, Long> results = cache.execute("wordCountStream.js", new HashMap<String, String>()); <END> assertEquals(3209, results.size()); assertTrue(results.get("macbeth").equals(Long.valueOf(287))); }</code><technical_language>please Map interface (and implementation)</technical_language>

Target:
public void testRemoteMapReduceWithStreams() throws Exception { String cacheName = "testRemoteMapReduce_Streams"; ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); builder.dataContainer().keyEquivalence(new AnyServerEquivalence()).valueEquivalence(new AnyServerEquivalence()).compatibility().enable().marshaller(new GenericJBossMarshaller()); defineInAll(cacheName, builder); RemoteCache<String, String> cache = clients.get(0).getCache(cacheName); RemoteCache<String, String> scriptCache = clients.get(0).getCache(SCRIPT_CACHE); loadData(cache, "/macbeth.txt"); loadScript(scriptCache, "/wordCountStream.js"); Map<String, Long> results = cache.execute("wordCountStream.js", new HashMap<String, String>()); assertEquals(3209, results.size()); assertTrue(results.get("macbeth").equals(Long.valueOf(287))); }
Source:
<code><START> public static void beforeInitPageStores(File workDir, IgniteLogger log) throws IgniteCheckedException { <END> batchRenameDefragmentedCacheGroupPartitions(workDir, log); U.delete(defragmentationCompletionMarkerFile(workDir)); for (File file : workDir.listFiles()) { String fileName = file.getName(); if ( fileName.startsWith(DFRG_PARTITION_FILE_PREFIX) || fileName.startsWith(DFRG_INDEX_FILE_NAME) || fileName.startsWith(DFRG_LINK_MAPPING_FILE_PREFIX) ) U.delete(file); } }</code><technical_language>This method once, I suggest inline it</technical_language>

Target:
public static void beforeInitPageStores(File workDir, IgniteLogger log) throws IgniteCheckedException { try { batchRenameDefragmentedCacheGroupPartitions(workDir, log); U.delete(defragmentationCompletionMarkerFile(workDir)); for (File file : workDir.listFiles()) { String fileName = file.getName(); if ( fileName.startsWith(DFRG_PARTITION_FILE_PREFIX) || fileName.startsWith(DFRG_INDEX_FILE_NAME) || fileName.startsWith(DFRG_LINK_MAPPING_FILE_PREFIX) ) U.delete(file); } } catch (IgniteException e) { throw new IgniteCheckedException(e); } }
Source:
<code>public static WindowsConfiguration create(final boolean provisionVMAgent, final WinRM winRM, final AdditionalUnattendContent additionalUnattendContent, final boolean enableAutomaticUpdates, final List<String> secrets) { return new AutoValue_OSProfile_WindowsConfiguration(provisionVMAgent, winRM, <START> additionalUnattendContent, enableAutomaticUpdates, secrets); <END> }</code><technical_language>secrets immutable list if present</technical_language>

Target:
public static WindowsConfiguration create(final boolean provisionVMAgent, final WinRM winRM, final AdditionalUnattendContent additionalUnattendContent, final boolean enableAutomaticUpdates, final List<String> secrets) { return new AutoValue_OSProfile_WindowsConfiguration(provisionVMAgent, winRM, additionalUnattendContent, enableAutomaticUpdates, secrets == null ? null : ImmutableList.copyOf(secrets)); }
Source:
<code>protected void processBuilder(Builder builder) { String bsn = builder.getProperty(Constants.BUNDLE_SYMBOLICNAME); builder.setProperty(Constants.BUNDLE_SYMBOLICNAME, bsn + "-tests"); <START> builder.setProperty(Constants.TESTCASES, testCases.filter()); <END> if (fragment) { builder.setProperty(Constants.FRAGMENT_HOST, bsn); builder.setProperty("-fixupmessages.missing.host", "\"Host " + bsn + "= for this fragment...\";is:=ignore"); } }</code><technical_language>Wrap testCases.filter() ${sort;${uniq; here</technical_language>

Target:
protected void processBuilder(Builder builder) throws MojoFailureException { String defaultBsn = project.getArtifactId(); if (artifactFragment) { builder.setProperty(Constants.BUNDLE_SYMBOLICNAME, defaultBsn + "-tests"); builder.setProperty(Constants.FRAGMENT_HOST, defaultBsn); builder.setProperty("-fixupmessages.missing.host", "\"Host " + defaultBsn + "= for this fragment...\";is:=ignore"); } else if (builder.getProperty(Constants.BUNDLE_SYMBOLICNAME) == null) { builder.setProperty(Constants.BUNDLE_SYMBOLICNAME, defaultBsn + "-tests"); } if (testCases != TestCases.useTestCasesHeader) { builder.setProperty(Constants.TESTCASES, "${sort;${uniq;" + testCases.filter() + "}}"); } else if (builder.getProperty(Constants.TESTCASES) == null) { throw new MojoFailureException( "<testCases> specified " + TestCases.useTestCasesHeader + " but no Test-Cases header was found"); } }
Source:
<code>public void mergeSegments(Layout currentLayout) throws OutrankedException { Layout newLayout; if (currentLayout.getSegments().size() > 1) { log.info("mergeSegments: layout is {}", currentLayout); sealEpoch(currentLayout); Predicate<Layout> shouldMergeSegments = layout -> { <START> if(layout.getSegments().size() > 1){ <END> return Sets.difference( layout.getSegments().get(1).getAllLogServers(), layout.getSegments().get(0).getAllLogServers()).isEmpty(); } return false; }; while(shouldMergeSegments.test(currentLayout)){ LayoutBuilder layoutBuilder = new LayoutBuilder(currentLayout); currentLayout = layoutBuilder .mergePreviousSegment(1) .build(); } newLayout = currentLayout; attemptConsensus(newLayout); } else { log.info("mergeSegments: skipping, no segments to merge {}", currentLayout); newLayout = currentLayout; } reconfigureSequencerServers(currentLayout, newLayout, false); }</code><technical_language>nit: add spaces if {</technical_language>

Target:
public void mergeSegments(Layout currentLayout) { Layout tempLayout = currentLayout; Layout newLayout; Predicate<Layout> shouldMergeSegments = layout -> { if (layout.getSegments().size() > 1) { return Sets.difference( layout.getSegments().get(1).getAllLogServers(), layout.getSegments().get(0).getAllLogServers()).isEmpty(); } return false; }; if (shouldMergeSegments.test(tempLayout)) { log.info("mergeSegments: layout is {}", tempLayout); sealEpoch(tempLayout); while (shouldMergeSegments.test(tempLayout)) { LayoutBuilder layoutBuilder = new LayoutBuilder(tempLayout); tempLayout = layoutBuilder .mergePreviousSegment(1) .build(); } newLayout = tempLayout; attemptConsensus(newLayout); } else { log.info("mergeSegments: skipping, no segments to merge {}", tempLayout); newLayout = tempLayout; } reconfigureSequencerServers(tempLayout, newLayout, false); }
Source:
<code>public void blockingStreamShouldNotPreventDiagnosis() throws Exception { FastPipedInputStream in = new FastPipedInputStream(); <START> try (FastPipedOutputStream out = new FastPipedOutputStream(in)) { <END> out.write(payload); } ClassicCommandTransport ct = (ClassicCommandTransport) new ChannelBuilder("dummy",null) .withMode(Mode.BINARY) .withBaseLoader(getClass().getClassLoader()) .negotiate(in, new NullOutputStream()); verify(ct); }</code><technical_language>stream opening statements try resources? suggestion try (FastPipedInputStream in = new FastPipedInputStream(); FastPipedOutputStream out = new FastPipedOutputStream(in)) {</technical_language>

Target:
public void blockingStreamShouldNotPreventDiagnosis() throws Exception { try (FastPipedInputStream in = new FastPipedInputStream(); FastPipedOutputStream out = new FastPipedOutputStream(in)) { out.write(payload); ClassicCommandTransport ct = (ClassicCommandTransport) new ChannelBuilder("dummy",null) .withMode(Mode.BINARY) .withBaseLoader(getClass().getClassLoader()) .negotiate(in, new NullOutputStream()); verify(ct); } }
Source:
<code>public void testDifferentGAVsWithAlias() throws Exception { Long oldPid = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION); assertThat(oldPid).isNotNull(); assertThat(oldPid).isGreaterThan(0); ProcessInstance processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, oldPid); assertThat(processInstance).isNotNull(); assertThat(processInstance.getContainerId()).isEqualTo(CONTAINER_ID); ReleaseId differentReleaseId101 = new ReleaseId("org.kie.server.different", "different-gav-definition-project", "1.0.1.Final"); KieContainerResource containerResource = new KieContainerResource(CONTAINER_ID_101, differentReleaseId101); containerResource.setContainerAlias(CONTAINER_ALIAS); client.createContainer(CONTAINER_ID_101, containerResource); if(configuration.isRest()) { <START> assertClientException( <END> () -> processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION_2), 404, MessageFormat.format(PROCESS_DEFINITION_NOT_FOUND, PROCESS_ID_EVALUATION_2, CONTAINER_ALIAS)); } else { assertClientException( () -> processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION_2), 404, MessageFormat.format(NO_PROCESS_AVAILABLE_WITH_ID, PROCESS_ID_EVALUATION_2)); } Long pid = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION); assertThat(pid).isNotNull(); assertThat(pid).isGreaterThan(0); processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, pid); assertThat(processInstance).isNotNull(); assertThat(processInstance.getContainerId()).isEqualTo(CONTAINER_ID); }</code><technical_language>@tsurdilo assertClientException(ThrowableAssert.ThrowingCallable callable, int expectedHttpCode, String restMessage, String jmsMessage) - this avoid if statements in tests</technical_language>

Target:
public void testDifferentGAVsWithAlias() throws Exception { Long oldPid = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION); assertThat(oldPid).isNotNull(); assertThat(oldPid).isGreaterThan(0); ProcessInstance processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, oldPid); assertThat(processInstance).isNotNull(); assertThat(processInstance.getContainerId()).isEqualTo(CONTAINER_ID); ReleaseId differentReleaseId101 = new ReleaseId("org.kie.server.different", "different-gav-definition-project", "1.0.1.Final"); KieContainerResource containerResource = new KieContainerResource(CONTAINER_ID_101, differentReleaseId101); containerResource.setContainerAlias(CONTAINER_ALIAS); client.createContainer(CONTAINER_ID_101, containerResource); assertClientException(() -> processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION_2), 404, MessageFormat.format(PROCESS_DEFINITION_NOT_FOUND, PROCESS_ID_EVALUATION_2, CONTAINER_ALIAS), MessageFormat.format(NO_PROCESS_AVAILABLE_WITH_ID, PROCESS_ID_EVALUATION_2)); Long pid = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION); assertThat(pid).isNotNull(); assertThat(pid).isGreaterThan(0); processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, pid); assertThat(processInstance).isNotNull(); assertThat(processInstance.getContainerId()).isEqualTo(CONTAINER_ID); }
Source:
<code>private boolean doesConfigReplicationFactorMatchWithCluster() { return clientPool.run(client -> { try { CassandraVerifier.currentRfOnKeyspaceMatchesDesiredRf(client, configManager.getConfig(), false); return true; } catch (Exception e) { <START> return false; <END> } }); }</code><technical_language>For sure, log exception message instead of swallowing it</technical_language>

Target:
private boolean doesConfigReplicationFactorMatchWithCluster() { return clientPool.run(client -> { try { CassandraVerifier.currentRfOnKeyspaceMatchesDesiredRf(client, configManager.getConfig(), false); return true; } catch (Exception e) { log.warn("The config and Cassandra cluster do not agree on the replication factor.", e); return false; } }); }
Source:
<code>public List<RpslObject> handleQuery(final Query query, final HttpServletRequest request) { <START> final int contextId = System.identityHashCode(Thread.currentThread()); <END> final InetAddress remoteAddress = InetAddresses.forString(request.getRemoteAddr()); final List<RpslObject> result = Lists.newArrayList(); try { queryHandler.streamResults(query, remoteAddress, contextId, new ApiResponseHandler() { @Override public void handle(final ResponseObject responseObject) { if (responseObject instanceof RpslObject) { result.add((RpslObject) responseObject); } } }); return result; } catch (final QueryException e) { if (e.getCompletionInfo() == QueryCompletionInfo.BLOCKED) { throw tooManyRequests(); } else { LOGGER.error(e.getMessage(), e); throw new IllegalStateException("query error"); } } }</code><technical_language>this? Is necessary? 0</technical_language>

Target:
public List<RpslObject> handleQuery(final Query query, final HttpServletRequest request) { final InetAddress remoteAddress = InetAddresses.forString(request.getRemoteAddr()); final List<RpslObject> result = Lists.newArrayList(); try { queryHandler.streamResults(query, remoteAddress, 0, new ApiResponseHandler() { @Override public void handle(final ResponseObject responseObject) { if (responseObject instanceof RpslObject) { result.add((RpslObject) responseObject); } } }); return result; } catch (final QueryException e) { if (e.getCompletionInfo() == QueryCompletionInfo.BLOCKED) { throw tooManyRequests(); } else { LOGGER.error(e.getMessage(), e); throw new IllegalStateException("query error"); } } }
Source:
<code>public void init() throws IOException { <START> final String confFile = "client/conf/configuration.properties"; <END> configuration = new Properties(); configuration.load(new FileInputStream(confFile)); baseURI = configuration.getProperty("baseURI"); login = configuration.getProperty("login"); password = configuration.getProperty("password"); }</code><technical_language>a work profiles in Server</technical_language>

Target:
public void init() throws IOException { final String confFile = "conf/configuration.properties"; configuration = new Properties(); configuration.load(new FileInputStream(confFile)); baseURI = configuration.getProperty("baseURI"); login = configuration.getProperty("login"); password = configuration.getProperty("password"); }
Source:
<code>public void testValidDepth() { SubsetParameters sp = SubsetParameters.parse("TIME,2009-01-01T00:00:00.000Z,2009-12-25T23:04:00.000Z;LATITUDE,-33.433849,-32.150743;LONGITUDE,114.15197,115.741219;DEPTH,43.567,100.0"); <START> assertEquals((Object) sp.getVerticalRange().start, 43.567); <END> assertEquals((Object) sp.getVerticalRange().end, 100.0); }</code><technical_language>Do need cast Object here? required for getLonMin</technical_language>

Target:
public void testValidDepth() { SubsetParameters sp = SubsetParameters.parse("TIME,2009-01-01T00:00:00.000Z,2009-12-25T23:04:00.000Z;LATITUDE,-33.433849,-32.150743;LONGITUDE,114.15197,115.741219;DEPTH,43.567,100.0"); assertEquals(sp.getVerticalRange().getMin().doubleValue(), 43.567, 0.000001); assertEquals(sp.getVerticalRange().getMax().doubleValue(), 100.0, 0.000001); }
Source:
<code>private <T extends Described> T createMerged(Iterable<? extends T> sortedEquivalents) { T highestPrecedenceContent = sortedEquivalents.iterator().next(); T mostSpecificTypeContent = highestPrecedenceContent; for (T next : ImmutableList.copyOf(sortedEquivalents)) { if (!mostSpecificTypeContent.getClass().equals(next.getClass()) && mostSpecificTypeContent.getClass().isAssignableFrom(next.getClass())) { mostSpecificTypeContent = next; } } T merged = (T) mostSpecificTypeContent.createNew(); merged = highestPrecedenceContent.copyToPreferNonNull(merged); IdAndPublisher idAndPublisher = findLowestIdContent(sortedEquivalents); Id id = idAndPublisher.getId(); merged.setId(id); Publisher publisher = idAndPublisher.getPublisher(); merged.setPublisher(publisher); Set<EquivalenceRef> equivs = Sets.newHashSet(merged.getEquivalentTo()); equivs.remove(EquivalenceRef.valueOf(merged)); <START> merged.setEquivalentTo(equivs); <END> return merged; }</code><technical_language>highest precedent content missing equiv set if is idAndPublisher I believe</technical_language>

Target:
private <T extends Described> T createMerged(Iterable<? extends T> sortedEquivalents) { T highestPrecedenceContent = sortedEquivalents.iterator().next(); T mostSpecificTypeContent = highestPrecedenceContent; for (T next : ImmutableList.copyOf(sortedEquivalents)) { if (!mostSpecificTypeContent.getClass().equals(next.getClass()) && mostSpecificTypeContent.getClass().isAssignableFrom(next.getClass())) { mostSpecificTypeContent = next; } } T merged = (T) mostSpecificTypeContent.createNew(); merged = mostSpecificTypeContent.copyToPreferNonNull(merged); merged = highestPrecedenceContent.copyToPreferNonNull(merged); T lowestIdContent = findLowestIdContent(sortedEquivalents); merged.setId(lowestIdContent.getId()); merged.setPublisher(lowestIdContent.getSource()); merged.setEquivalentTo(lowestIdContent.getEquivalentTo()); return merged; }
Source:
<code>private void testNullability(MutableRealmIntegerTypes c1) { MutableRealmInteger r1 = c1.columnMutableRealmInteger; c1.columnMutableRealmInteger.set(0L); assertFalse(c1.columnMutableRealmInteger.isNull()); assertFalse(r1.isNull()); c1.columnMutableRealmInteger.set(null); assertFalse(c1.columnMutableRealmInteger == null); assertTrue(c1.columnMutableRealmInteger.isNull()); assertTrue(r1.isNull()); assertTrue(c1.columnMutableRealmInteger.get() == null); assertTrue(r1.get() == null); try { c1.columnMutableRealmInteger.increment(5); fail("Attempt to increment a null valued MutableRealmInteger should throw NPE"); } <START> catch (IllegalArgumentException ignore) { } <END> try { c1.columnMutableRealmInteger.decrement(5); fail("Attempt to decrement a null valued MutableRealmInteger should throw NPE"); } catch (IllegalArgumentException ignore) { } }</code><technical_language>IlegalStateException more accurate? message for fail() needs changed</technical_language>

Target:
private void testNullability(MutableRealmIntegerTypes c1) { MutableRealmInteger r1 = c1.columnMutableRealmInteger; c1.columnMutableRealmInteger.set(0L); assertFalse(c1.columnMutableRealmInteger.isNull()); assertFalse(r1.isNull()); c1.columnMutableRealmInteger.set(null); assertFalse(c1.columnMutableRealmInteger == null); assertTrue(c1.columnMutableRealmInteger.isNull()); assertTrue(r1.isNull()); assertTrue(c1.columnMutableRealmInteger.get() == null); assertTrue(r1.get() == null); try { c1.columnMutableRealmInteger.increment(5); fail("Attempt to increment a null valued MutableRealmInteger should throw NPE"); } catch (IllegalStateException ignore) { } try { c1.columnMutableRealmInteger.decrement(5); fail("Attempt to decrement a null valued MutableRealmInteger should throw NPE"); } catch (IllegalStateException ignore) { } }
Source:
<code>public void testLogSegmentValidDataSize() throws InterruptedException, StoreException, IOException { <START> for (long i = 0; i <= state.time.milliseconds() + TEST_TIME_INTERVAL_IN_MS; i += TEST_TIME_INTERVAL_IN_MS) { <END> TimeRange timeRange = new TimeRange(i, 0L); verifyLogSegmentValidSize(timeRange); } }</code><technical_language>provide times in future</technical_language>

Target:
public void testLogSegmentValidDataSize() throws InterruptedException, StoreException, IOException { for (long i = 0; i <= state.time.milliseconds() + TEST_TIME_INTERVAL_IN_MS; i += TEST_TIME_INTERVAL_IN_MS) { TimeRange timeRange = new TimeRange(i, 0L); verifyAndGetLogSegmentValidSize(timeRange); } }
Source:
<code>private static SelectiveStreamReader[] createStreamReaders( OrcDataSource orcDataSource, List<OrcType> types, DateTimeZone hiveStorageTimeZone, Map<Integer, Type> includedColumns, List<Integer> outputColumns, Map<Integer, TupleDomainFilter> filters, Map<Integer, List<Subfield>> requiredSubfields, AggregatedMemoryContext systemMemoryContext) { List<StreamDescriptor> streamDescriptors = createStreamDescriptor("", "", 0, types, orcDataSource).getNestedStreams(); OrcType rowType = types.get(0); SelectiveStreamReader[] streamReaders = new SelectiveStreamReader[rowType.getFieldCount()]; for (int columnId = 0; columnId < rowType.getFieldCount(); columnId++) { if (includedColumns.containsKey(columnId)) { StreamDescriptor streamDescriptor = streamDescriptors.get(columnId); streamReaders[columnId] = createStreamReader( streamDescriptor, Optional.ofNullable(filters.get(columnId)), <START> outputColumns.contains(columnId) ? Optional.of(includedColumns.get(columnId)) : Optional.empty(), <END> Optional.ofNullable(requiredSubfields.get(columnId)).orElse(ImmutableList.of()), hiveStorageTimeZone, systemMemoryContext); } } return streamReaders; }</code><technical_language>do Optional.ofNullable(includedColumns.get(columnId)), consistent line</technical_language>

Target:
private static SelectiveStreamReader[] createStreamReaders( OrcDataSource orcDataSource, List<OrcType> types, DateTimeZone hiveStorageTimeZone, Map<Integer, Type> includedColumns, List<Integer> outputColumns, Map<Integer, TupleDomainFilter> filters, Map<Integer, List<Subfield>> requiredSubfields, AggregatedMemoryContext systemMemoryContext) { List<StreamDescriptor> streamDescriptors = createStreamDescriptor("", "", 0, types, orcDataSource).getNestedStreams(); OrcType rowType = types.get(0); SelectiveStreamReader[] streamReaders = new SelectiveStreamReader[rowType.getFieldCount()]; for (int columnId = 0; columnId < rowType.getFieldCount(); columnId++) { if (includedColumns.containsKey(columnId)) { StreamDescriptor streamDescriptor = streamDescriptors.get(columnId); streamReaders[columnId] = createStreamReader( streamDescriptor, Optional.ofNullable(filters.get(columnId)), Optional.ofNullable(includedColumns.get(columnId)), Optional.ofNullable(requiredSubfields.get(columnId)).orElse(ImmutableList.of()), hiveStorageTimeZone, systemMemoryContext); } } return streamReaders; }
Source:
<code>public void refreshLayout(Form form) { super.refreshLayout(form); if (form.getName().equals(Form.MAIN)) { allFormatDefs = getPossibleFormatValues(); <START> createFormatValues(); <END> Widget w = form.getWidget(FORMAT_PROPERTIES_NAME); if (!allFormatDefs.isEmpty() && w != null) { updateProperties(); form.replaceRow(FORMAT_PROPERTIES_NAME, formatProperties.getForm(Form.MAIN)); } else if (!allFormatDefs.isEmpty() && w == null) { updateProperties(); form.addRow(formatProperties.getForm(Form.MAIN)); } form.getWidget(format.getName()).setReadonly(allFormatDefs.isEmpty()); } }</code><technical_language>createFormatValue() implements code allFormatDefs = getPossibleFormatValues();</technical_language>

Target:
public void refreshLayout(Form form) { super.refreshLayout(form); if (form.getName().equals(Form.MAIN)) { createFormatValues(); Widget w = form.getWidget(FORMAT_PROPERTIES_NAME); if (!allFormatDefs.isEmpty() && w != null) { updateProperties(); form.replaceRow(FORMAT_PROPERTIES_NAME, formatProperties.getForm(Form.MAIN)); } else if (!allFormatDefs.isEmpty() && w == null) { updateProperties(); form.addRow(formatProperties.getForm(Form.MAIN)); } form.getWidget(format.getName()).setReadonly(allFormatDefs.isEmpty()); } }
Source:
<code>public GenericRow extract(GenericRecord from, GenericRow to) { if (_extractAll) { <START> List<Schema.Field> fields = from.getSchema().getFields(); <END> fields.forEach(field -> { String fieldName = field.name(); to.putValue(fieldName, AvroUtils.convert(from.get(fieldName))); }); } else { _fields.forEach(fieldName -> to.putValue(fieldName, AvroUtils.convert(from.get(fieldName)))); } return to; }</code><technical_language>Suggest non-functional for performance concern</technical_language>

Target:
public GenericRow extract(GenericRecord from, GenericRow to) { if (_extractAll) { List<Schema.Field> fields = from.getSchema().getFields(); for (Schema.Field field : fields) { String fieldName = field.name(); to.putValue(fieldName, AvroUtils.convert(from.get(fieldName))); } } else { for (String fieldName : _fields) { to.putValue(fieldName, AvroUtils.convert(from.get(fieldName))); } } return to; }
Source:
<code>Name decomposeName(CompositeName compositeName) throws NamingException { if (compositeName.isEmpty()) { return new SimpleName(); } final NameParser parser = getNativeNameParser(); <START> final Name name = new SimpleName(); <END> for (int i = 0; i < compositeName.size(); i ++) { final String part = compositeName.get(i); final Name parsed = parser.parse(part); if (parsed.isEmpty()) parsed.add(""); name.addAll(parsed); } return name; }</code><technical_language>I this context's naming parser, compatible SimpleName</technical_language>

Target:
Name decomposeName(CompositeName compositeName) throws NamingException { if (compositeName.isEmpty()) { return new SimpleName(); } final NameParser parser = getNativeNameParser(); final Name name = parser.parse(compositeName.get(0)); if(name.isEmpty())name.add(""); for (int i = 1; i < compositeName.size(); i ++) { final String part = compositeName.get(i); final Name parsed = parser.parse(part); if (parsed.isEmpty()) parsed.add(""); name.addAll(parsed); } return name; }
Source:
<code>public Map activateStorageDomain(String sdUUID, String spUUID) { try { log.info("Activating storage domain, spUUID: sdUUID: {}", new Object[] { spUUID, sdUUID }); final StorageDomain storageDomain = getDataCenterById(spUUID).getStorageDomainMap().get(sdUUID); if (storageDomain != null) { activateClearance(storageDomain); log.info("storage were activated {}", storageDomain.getName(), sdUUID); <START> }else { <END> log.warn("no storage domains were activated"); } return getOKStatus(); } catch (Exception e) { throw error(e); } }</code><technical_language>Please reformat: } else {</technical_language>

Target:
public Map activateStorageDomain(String sdUUID, String spUUID) { try { log.info("Activating storage domain, spUUID: sdUUID: {}", new Object[] { spUUID, sdUUID }); final StorageDomain storageDomain = getDataCenterById(spUUID).getStorageDomainMap().get(sdUUID); if (storageDomain != null) { activateClearance(storageDomain); log.info("storage were activated {}", storageDomain.getName(), sdUUID); } else { log.warn("No storage domains were activated for storage domain '{}' and storage pool '{}'", sdUUID, spUUID); } return getOKStatus(); } catch (Exception e) { throw error(e); } }
Source:
<code>private boolean isNodeSupportGoInto(Object node) { <START> return node != null && node instanceof Node && ((Node)node).supportGoInto(); <END> }</code><technical_language>checking for nullable parent added specially, project node simply meaning</technical_language>

Target:
private boolean isNodeSupportGoInto(Object node) { return node instanceof Node && ((Node)node).supportGoInto(); }
Source:
<code>public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity player) { <START> if(!(target instanceof PlayerEntity) && !target.world.isRemote) <END> { target.addPotionEffect(new EffectInstance(effect, duration, effectTier)); } return super.hitEntity(stack, target, player); }</code><technical_language>reason in give effect players</technical_language>

Target:
public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity player) { if((!(target instanceof PlayerEntity) || giveToPlayers) && !target.world.isRemote) { target.addPotionEffect(new EffectInstance(effect.get(), duration, effectTier)); } return super.hitEntity(stack, target, player); }
Source:
<code>public VmCheckpointInfo(Map<String, Object> innerMap) { super(innerMap); if (innerMap.containsKey(VdsProperties.jobError)) { Map<String, Object> errorInfo = (Map<String, Object>) innerMap.get(VdsProperties.jobError); Integer code = (Integer) errorInfo.get(VdsProperties.jobErrorCode); String message = (String) errorInfo.get(VdsProperties.jobErrorMessage); error = new VDSError(EngineError.forValue(code), message); } Object[] tempObj = (Object[]) innerMap.get(VdsProperties.CHECKPOINT_IDS); <START> if (tempObj != null) { checkpointsUuids = new String[tempObj.length]; for (int i = 0; i < tempObj.length; i++) { checkpointsUuids[i] = (String) tempObj[i]; } <END> } }</code><technical_language>shorter & more modern built-in options: <LINK_0> For example: checkpointsUuids = Arrays.stream(tempObj).toArray(String[]::new); suggest "System.arraycopy"</technical_language>

Target:
public VmCheckpointInfo(Map<String, Object> innerMap) { super(innerMap); if (innerMap.containsKey(VdsProperties.jobError)) { Map<String, Object> errorInfo = (Map<String, Object>) innerMap.get(VdsProperties.jobError); Integer code = (Integer) errorInfo.get(VdsProperties.jobErrorCode); String message = (String) errorInfo.get(VdsProperties.jobErrorMessage); error = new VDSError(EngineError.forValue(code), message); } Object[] tempObj = (Object[]) innerMap.get(VdsProperties.CHECKPOINT_IDS); if (tempObj != null) { checkpointsIds = Arrays.stream(tempObj).map(s -> (String) s).collect(Collectors.toList()); } }
Source:
<code>public boolean append( RecordCursor<RECORD> cursor, RECORD[] array, long id, int index ) { RECORD record = array[index]; if ( !cursor.next( id, record, RecordLoad.CHECK ) || (filter != null && !filter.test( record )) ) { return false; } <START> return true; <END> }</code><technical_language>This simplified return expression. null-check avoided initialising filter field Predicates.alwaysTrue if filter is in constructor</technical_language>

Target:
public boolean append( RecordCursor<RECORD> cursor, RECORD[] array, long id, int index ) { RECORD record = array[index]; return cursor.next( id, record, RecordLoad.CHECK ) && filter.test( record ); }
Source:
<code>public static DataType<?> of(String typeName, List<Integer> parameters) { DataType<?> dataType = ofNameOrNull(typeName); if (dataType == null) { throw new IllegalArgumentException("Cannot find data type: " + typeName); } if (!parameters.isEmpty()) { if (dataType.id() == StringType.ID) { <START> if (parameters.size() != 1) { throw new IllegalArgumentException( "The number of parameters for the text data is wrong: " + parameters.size()); } return StringType.of(parameters.get(0)); <END> } throw new IllegalArgumentException( "The '" + typeName + "' type doesn't support type parameters."); } else { return dataType; } }</code><technical_language>a of overload for StringType takes a list move validation there? StringType responsible for knowing valid parameters, DataTypes</technical_language>

Target:
public static DataType<?> of(String typeName, List<Integer> parameters) { DataType<?> dataType = ofNameOrNull(typeName); if (dataType == null) { throw new IllegalArgumentException("Cannot find data type: " + typeName); } if (!parameters.isEmpty()) { if (dataType.id() == StringType.ID) { return StringType.of(parameters); } throw new IllegalArgumentException( "The '" + typeName + "' type doesn't support type parameters."); } else { return dataType; } }
Source:
<code>public static Boolean equal(@SqlType(GEOMETRY_TYPE_NAME) Slice left, @SqlType(GEOMETRY_TYPE_NAME) Slice right) { <START> if (left == null) { <END> return right == null; } if (right == null) { return false; } return deserialize(left).Equals(deserialize(right)); }</code><technical_language>need for explicit null checks here. parameters marked @SqlNullable, engine apply default semantics null is</technical_language>

Target:
public static Boolean equal(@SqlType(GEOMETRY_TYPE_NAME) Slice left, @SqlType(GEOMETRY_TYPE_NAME) Slice right) { return deserialize(left).Equals(deserialize(right)); }
Source:
<code>public void testIsSigned_signed() { <START> IntegerDeclaration fixture_signed = new IntegerDeclaration(2, true, <END> 1, ByteOrder.BIG_ENDIAN, Encoding.ASCII, null, 8); boolean result = fixture_signed.isSigned(); assertEquals(true, result); }</code><technical_language>Do c_style_variable_names in CDT? ;) Coding style in LT is camelCase, signedFixture unsignedFixture</technical_language>

Target:
public void testIsSigned_signed() { IntegerDeclaration fixtureSigned = new IntegerDeclaration(2, true, 1, ByteOrder.BIG_ENDIAN, Encoding.ASCII, null, 8); boolean result = fixtureSigned.isSigned(); assertEquals(true, result); }
Source:
<code>protected void executeCommand() { ManagedBlockStorage managedBlockStorage = cinderStorageDao.get(getParameters().getStorageDomainId()); Guid volumeId = Guid.newGuid(); CinderlibReturnValue returnValue; List<String> extraParams = new ArrayList<>(); extraParams.add(volumeId.toString()); Number sizeInGiB = SizeConverter.convert(getParameters().getDiskInfo().getSize(), SizeConverter.SizeUnit.BYTES, SizeConverter.SizeUnit.GiB); extraParams.add(Long.toString(sizeInGiB.longValue())); try { CinderlibCommandParameters params = new CinderlibCommandParameters(JsonHelper.mapToJson(managedBlockStorage.getDriverOptions(), false), extraParams); returnValue = cinderlibExecutor.runCommand(CinderlibCommand.CREATE_VOLUME, params); <START> if (!returnValue.getSucceed()) { setSucceeded(false); return; } saveDisk(volumeId); <END> } catch (Exception e) { log.error("Failed executing volume creation", e); setSucceeded(false); return; } getReturnValue().setActionReturnValue(volumeId); setSucceeded(true); }</code><technical_language>this try block</technical_language>

Target:
protected void executeCommand() { ManagedBlockStorage managedBlockStorage = cinderStorageDao.get(getParameters().getStorageDomainId()); Guid volumeId = Guid.newGuid(); List<String> extraParams = new ArrayList<>(); extraParams.add(volumeId.toString()); Number sizeInGiB = SizeConverter.convert(getParameters().getDiskInfo().getSize(), SizeConverter.SizeUnit.BYTES, SizeConverter.SizeUnit.GiB); extraParams.add(Long.toString(sizeInGiB.longValue())); CinderlibReturnValue returnValue; try { CinderlibCommandParameters params = new CinderlibCommandParameters(JsonHelper.mapToJson(managedBlockStorage.getDriverOptions(), false), extraParams); returnValue = cinderlibExecutor.runCommand(CinderlibCommand.CREATE_VOLUME, params); } catch (Exception e) { log.error("Failed executing volume creation", e); return; } if (!returnValue.getSucceed()) { return; } saveDisk(volumeId); getReturnValue().setActionReturnValue(volumeId); setSucceeded(true); }