auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void deleteData(SchemaBuilder schemaBuilder, long viewTTL) throws SQLException { String viewName = schemaBuilder.getEntityTenantViewName(); Properties props = new Properties(); String tenantConnectUrl = getUrl() + ';' + TENANT_ID_ATTRIB + '=' + schemaBuilder.getDataOptions() .getTenantId(); try (Connection deleteConnection = DriverManager.getConnection(tenantConnectUrl, props); final Statement statement = deleteConnection.createStatement()) { deleteConnection.setAutoCommit(true); final String deleteIfExpiredStatement = String.format("delete from %s where %s", viewName, <START> String.format("((TO_NUMBER(CURRENT_DATE()) - TO_NUMBER(phoenix_row_timestamp())) < %d)" , viewTTL)); <END> Preconditions.checkNotNull(deleteIfExpiredStatement); final PhoenixStatement pstmt = statement.unwrap(PhoenixStatement.class); int deleteCount = pstmt.executeUpdate(deleteIfExpiredStatement); } }</code><technical_language>diff btw CURRENT_DATE() NOW()</technical_language>

Target:
private void deleteData(SchemaBuilder schemaBuilder, long viewTTL) throws SQLException { String viewName = schemaBuilder.getEntityTenantViewName(); Properties props = new Properties(); String tenantConnectUrl = getUrl() + ';' + TENANT_ID_ATTRIB + '=' + schemaBuilder.getDataOptions() .getTenantId(); try (Connection deleteConnection = DriverManager.getConnection(tenantConnectUrl, props); final Statement statement = deleteConnection.createStatement()) { deleteConnection.setAutoCommit(true); final String deleteIfExpiredStatement = String.format("delete from %s where %s", viewName, String.format( "((TO_NUMBER(CURRENT_TIME()) - TO_NUMBER(phoenix_row_timestamp())) < %d)", viewTTL)); Preconditions.checkNotNull(deleteIfExpiredStatement); final PhoenixStatement pstmt = statement.unwrap(PhoenixStatement.class); int deleteCount = pstmt.executeUpdate(deleteIfExpiredStatement); } }
Source:
<code>public static void updateId(Connection c, String storageKey, Persistable p) { HashMap<String, Object> map = DatabaseHelper.getMetaFieldsAndValues(p); String[] fieldnames = map.keySet().toArray(new String[0]); Object[] values = map.values().toArray(new Object[0]); Pair<String, String[]> where = org.commcare.modern.database.DatabaseHelper.createWhere(fieldnames, values, p); String query = "UPDATE " + storageKey + " SET " + DatabaseHelper.DATA_COL + " = ? WHERE " + where.first + ";"; PreparedStatement preparedStatement; try { preparedStatement = c.prepareStatement(query); byte[] blob = org.commcare.modern.database.TableBuilder.toBlob(p); preparedStatement.setBinaryStream(1, new ByteArrayInputStream((byte[])blob), ((byte[])blob).length); for (int i = 2; i < where.second.length + 2; i++) { Object obj = where.second[i - 2]; if (obj instanceof String) { preparedStatement.setString(i, (String)obj); } else if (obj instanceof Blob) { preparedStatement.setBlob(i, (Blob)obj); } else if (obj instanceof Integer) { preparedStatement.setInt(i, ((Integer)obj).intValue()); } else if (obj instanceof byte[]) { preparedStatement.setBinaryStream(i, new ByteArrayInputStream((byte[])obj), ((byte[])obj).length); } else if (obj == null) { preparedStatement.setNull(i, 0); <START> } <END> } preparedStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } }</code><technical_language>of instanceof branches get used? Test coverage shows instanceof String branch executed, linter convinced of satisfied (stupid robots), confused for-loop indexes. strange loop indexing instanceof checks necessary? Thanks</technical_language>

Target:
public static void updateId(Connection c, String storageKey, Persistable p) { HashMap<String, Object> map = DatabaseHelper.getMetaFieldsAndValues(p); String[] fieldNames = map.keySet().toArray(new String[map.keySet().size()]); Object[] values = map.values().toArray(new Object[map.values().size()]); Pair<String, String[]> where = org.commcare.modern.database.DatabaseHelper.createWhere(fieldNames, values, p); String query = "UPDATE " + storageKey + " SET " + DatabaseHelper.DATA_COL + " = ? WHERE " + where.first + ";"; PreparedStatement preparedStatement = null; try { preparedStatement = c.prepareStatement(query); byte[] blob = org.commcare.modern.database.TableBuilder.toBlob(p); preparedStatement.setBinaryStream(1, new ByteArrayInputStream(blob), (blob).length); for (int i = 2; i < where.second.length + 2; i++) { Object obj = where.second[i - 2]; if (obj instanceof String) { preparedStatement.setString(i, (String)obj); } else if (obj instanceof Blob) { preparedStatement.setBlob(i, (Blob)obj); } else if (obj instanceof Integer) { preparedStatement.setInt(i, (Integer)obj); } else if (obj instanceof byte[]) { preparedStatement.setBinaryStream(i, new ByteArrayInputStream((byte[])obj), ((byte[])obj).length); } else if (obj == null) { preparedStatement.setNull(i, 0); } } preparedStatement.executeUpdate(); } catch (SQLException e) { throw new RuntimeException(e); } finally { if (preparedStatement != null) { try { preparedStatement.close(); } catch (SQLException e) { e.printStackTrace(); } } } }
Source:
<code>public void testCatalogCreate()throws Exception { <START> final String bomYaml = "brooklyn.catalog:\n id: simple-tomcat\n version: 1.0\n itemType: template\n" + <END> " iconUrl: <LINK_1>\n name: Simple Tomcat\n license: Apache-2.0\n" + " item:\n brooklyn.config:\n simple.confg: someValue\n services:\n" + " - type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer\n id: tomcat\n" + " name: Tomcat\n war: <LINK_0>"; final Response response = api.getCatalogApi().create(bomYaml); Asserts.assertEquals(response.getStatus(),201); }</code><technical_language>Put a new line in \n this readable. alternatively put blueprint in a file in src/test/resources/path/to/file.yaml load new ResourceUtils(this).getResourceAsString("classpath://path/to/file.yaml")</technical_language>

Target:
public void testCatalogCreate()throws Exception { final Response response = api.getCatalogApi().create(getFileContentsAsString("catalog/test-catalog.bom")); Asserts.assertEquals(response.getStatus(),201); }
Source:
<code>public void shouldThrowExceptionIfNoTypeMappingWasFoundWithoutAffectingContentProviderAsObservable() { final StorIOContentResolver storIOContentResolver = mock(StorIOContentResolver.class); final StorIOContentResolver.Internal internal = mock(StorIOContentResolver.Internal.class); when(storIOContentResolver.internal()).thenReturn(internal); when(storIOContentResolver.delete()).thenReturn(new PreparedDelete.Builder(storIOContentResolver)); final TestSubscriber<DeleteResult> testSubscriber = new TestSubscriber<DeleteResult>(); storIOContentResolver .delete() .object(TestItem.newInstance()) .prepare() .createObservable() .subscribe(testSubscriber); testSubscriber.awaitTerminalEvent(); testSubscriber.assertNoValues(); <START> testSubscriber.assertError(StorIOException.class); <END> verify(storIOContentResolver).delete(); verify(storIOContentResolver).internal(); verify(internal).typeMapping(TestItem.class); verify(internal, never()).delete(any(DeleteQuery.class)); verifyNoMoreInteractions(storIOContentResolver, internal); }</code><technical_language>Please add assertion for exception type message, expected exception</technical_language>

Target:
public void shouldThrowExceptionIfNoTypeMappingWasFoundWithoutAffectingContentProviderAsObservable() { final StorIOContentResolver storIOContentResolver = mock(StorIOContentResolver.class); final StorIOContentResolver.Internal internal = mock(StorIOContentResolver.Internal.class); when(storIOContentResolver.internal()).thenReturn(internal); when(storIOContentResolver.delete()).thenReturn(new PreparedDelete.Builder(storIOContentResolver)); final TestSubscriber<DeleteResult> testSubscriber = new TestSubscriber<DeleteResult>(); storIOContentResolver .delete() .object(TestItem.newInstance()) .prepare() .createObservable() .subscribe(testSubscriber); testSubscriber.awaitTerminalEvent(); testSubscriber.assertNoValues(); TestUtils.checkException(testSubscriber, StorIOException.class, IllegalStateException.class); verify(storIOContentResolver).delete(); verify(storIOContentResolver).internal(); verify(internal).typeMapping(TestItem.class); verify(internal, never()).delete(any(DeleteQuery.class)); verifyNoMoreInteractions(storIOContentResolver, internal); }
Source:
<code>public void submit() { driver.switchTo().defaultContent(); <START> postButton.click(); <END> }</code><technical_language>log ()</technical_language>

Target:
public void submit() { driver.switchTo().defaultContent(); postButton.click(); PageObjectLogging.log("submit", "message submitted", true); }
Source:
<code>private void write(Object msg, boolean flush, ChannelPromise promise) { ObjectUtil.checkNotNull(msg, "msg"); try { if (isNotValidPromise(promise, true)) { ReferenceCountUtil.release(msg); return; } } catch (RuntimeException e) { ReferenceCountUtil.release(msg); throw e; } <START> final AbstractChannelHandlerContext next = findContextOutbound(flush ? (MASK_WRITE | MASK_FLUSH) : MASK_WRITE); <END> EventExecutor executor = executor(); if (executor.inEventLoop()) { if (flush) { next.invokeWriteAndFlush(msg, promise); } else { next.invokeWrite(msg, promise); } } else { final AbstractWriteTask task; if (flush) { task = WriteAndFlushTask.newInstance(this, msg, promise); } else { task = WriteTask.newInstance(this, msg, promise); } if (!safeExecute(executor, task, promise, msg)) { task.cancel(); } } }</code><technical_language>I this is meant moved if (executor.inEventLoop()) { block below</technical_language>

Target:
private void write(Object msg, boolean flush, ChannelPromise promise) { ObjectUtil.checkNotNull(msg, "msg"); try { if (isNotValidPromise(promise, true)) { ReferenceCountUtil.release(msg); return; } } catch (RuntimeException e) { ReferenceCountUtil.release(msg); throw e; } EventExecutor executor = executor(); if (executor.inEventLoop()) { final AbstractChannelHandlerContext next = findContextOutbound(flush ? (MASK_WRITE | MASK_FLUSH) : MASK_WRITE); if (flush) { next.invokeWriteAndFlush(msg, promise); } else { next.invokeWrite(msg, promise); } } else { final AbstractWriteTask task; if (flush) { task = WriteAndFlushTask.newInstance(this, msg, promise); } else { task = WriteTask.newInstance(this, msg, promise); } if (!safeExecute(executor, task, promise, msg)) { task.cancel(); } } }
Source:
<code>protected String getModFilePath() { <START> return path.toString() + "/" + LOCAL_GO_MOD_FILENAME; <END> }</code><technical_language>**File.separator** for Windows compatibility</technical_language>

Target:
protected String getModFilePath() { return path.toString() + File.separator + LOCAL_GO_MOD_FILENAME; }
Source:
<code>public void stopDebugging(IServer server, IProgressMonitor monitor) throws CoreException { IDeploymentConfig dc = OpenShiftServerUtils.getDeploymentConfig(server); if(dc == null) { terminateRemoteDebugger(server); return; } DebuggingContext debugContext = getDebuggingContext(dc); IDebugListener listener = new IDebugListener() { public void onDebugChange(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { terminateRemoteDebugger(server); unMapPortForwarding(debuggingContext.getPod()); } @Override public void onPodRestart(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { } }; debugContext.setDebugListener(listener); <START> disableDebugMode(dc, debugContext, monitor); <END> }</code><technical_language>actual problem is making disableDebug undo changes deploymentconfig, done debugging (unsetting env vars, port)</technical_language>

Target:
public void stopDebugging(IServer server, IProgressMonitor monitor) throws CoreException { IDeploymentConfig dc = OpenShiftServerUtils.getDeploymentConfig(server); if(dc == null) { terminateRemoteDebugger(server); return; } DebuggingContext debugContext = getDebuggingContext(dc); IDebugListener listener = new IDebugListener() { @Override public void onDebugChange(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { terminateRemoteDebugger(server); unMapPortForwarding(debuggingContext.getPod()); } @Override public void onPodRestart(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { } }; debugContext.setDebugListener(listener); disableDebugMode(dc, debugContext, monitor); }
Source:
<code>public synchronized void close() { <START> frameBuffer.clear(); <END> try { frameBuffer.put(FRAME_BUFFER_CLOSED); } catch (InterruptedException e) { LOGGER.warn("NATS transport could not close frame buffer: " + e.getMessage()); } isOpen = false; }</code><technical_language>is this needed for</technical_language>

Target:
public synchronized void close() { frameBuffer.clear(); try { frameBuffer.put(FRAME_BUFFER_CLOSED); } catch (InterruptedException e) { LOGGER.warn("HTTP transport could not close frame buffer: " + e.getMessage()); } isOpen = false; }
Source:
<code>public void testUpdated() { loadTestingData(); CacheQuery cacheQuery = createCacheQuery(cache, "name", "Goat"); List<Object> found = cacheQuery.list(); assertEquals("Size of list should be 2", 2, found.size()); assertTrue("The search should have person2", found.contains(person2)); cache.put(key2, person1); cacheQuery = createCacheQuery(cache, "name", "Goat"); found = cacheQuery.list(); assertEquals("Size of list should be 1", 1, found.size()); <START> assertTrue("Person 2 should not be found now", !found.contains(person2)); <END> assertTrue("Person 1 should not be found because it does not meet the search criteria", !found.contains(person1)); StaticTestingErrorHandler.assertAllGood(cache); }</code><technical_language>observation - playing a lot persons in this cache - is worth create a custom assertion for those? is example <LINK_0></technical_language>

Target:
public void testUpdated() { loadTestingData(); CacheQuery cacheQuery = createCacheQuery(cache, "name", "Goat"); List<Object> found = cacheQuery.list(); assertPeopleInList(found, person2, person3); cache.put(key2, person1); cacheQuery = createCacheQuery(cache, "name", "Goat"); found = cacheQuery.list(); assertPeopleInList(found, person3); StaticTestingErrorHandler.assertAllGood(cache); }
Source:
<code>private static String getTimeZoneRepresentation(TimeZone tz) { long hours = TimeUnit.MILLISECONDS.toHours(tz.getRawOffset()); long minutes = TimeUnit.MILLISECONDS.toMinutes(tz.getRawOffset()) - TimeUnit.HOURS.toMinutes(hours); minutes = Math.abs(minutes); <START> String result = ""; <END> if (hours > 0) { result = String.format(POSITIVE_OFFSET_FORMAT, tz.getID(), hours, minutes); } else if (hours < 0) { result = String.format(NEGATIVE_OFFSET_FORMAT, tz.getID(), hours, minutes); } else { result = String.format(NO_OFFSET_FORMAT, tz.getDisplayName(Locale.getDefault())); } return result; }</code><technical_language>final String result; ensure result needs assigned in of branches need assign twice</technical_language>

Target:
private static String getTimeZoneRepresentation(TimeZone tz) { long hours = TimeUnit.MILLISECONDS.toHours(tz.getRawOffset()); long minutes = TimeUnit.MILLISECONDS.toMinutes(tz.getRawOffset()) - TimeUnit.HOURS.toMinutes(hours); minutes = Math.abs(minutes); final String result; if (hours > 0) { result = String.format(POSITIVE_OFFSET_FORMAT, tz.getID(), hours, minutes); } else if (hours < 0) { result = String.format(NEGATIVE_OFFSET_FORMAT, tz.getID(), hours, minutes); } else { result = String.format(NO_OFFSET_FORMAT, tz.getDisplayName(Locale.getDefault())); } return result; }
Source:
<code>private static Map<Integer, String> createExtra44Map() { Map<Integer, String> result = new HashMap<>(); result.put(1, "no CAN bus, (firmware derived from CANCMD)."); result.put(2, "integrated CANISB (firmware derived from CANCMD)."); result.put(3, "integrated CANISB (firmware derived from CANCMD)."); result.put(4, "System booster"); <START> result.put(4, "integrated CANISB (firmware derived from CANCMD)."); <END> result.put(6, "Isolated CANUSB and CBUS node."); return Collections.unmodifiableMap(result); }</code><technical_language>Map 4 defined 5 skipped - is this intentional</technical_language>

Target:
private static Map<Integer, String> createExtra44Map() { Map<Integer, String> result = new HashMap<>(); result.put(1, "no CAN bus, (firmware derived from CANCMD)."); result.put(2, "integrated CANISB (firmware derived from CANCMD)."); result.put(3, "integrated CANISB (firmware derived from CANCMD)."); result.put(4, "System booster"); result.put(5, "integrated CANISB (firmware derived from CANCMD)."); result.put(6, "Isolated CANUSB and CBUS node."); return Collections.unmodifiableMap(result); }
Source:
<code>public void addFiles(List<Long> fileObjectIds) throws IngestStreamClosedException, TskCoreException { synchronized(this) { if (isClosed) { throw new IngestStreamClosedException("Can not add files - ingest stream is closed"); } if (dataSource == null) { <START> throw new TskCoreException("Files can not be added without a data source"); <END> } fileIdQueue.addAll(fileObjectIds); } }</code><technical_language>thinking this a TskDataException instead of a TskCoreException. IllegalStreamStateException. I latter</technical_language>

Target:
public void addFiles(List<Long> fileObjectIds) throws IngestStreamClosedException { synchronized(this) { if (isClosed) { throw new IngestStreamClosedException("Can not add files - ingest stream is closed"); } if (dataSource == null) { throw new IllegalStateException("Files can not be added before a data source"); } fileIdQueue.addAll(fileObjectIds); } }
Source:
<code>private void processSourceMessage(MessageViewInfo messageViewInfo) { try { switch (action) { case REPLY: case REPLY_ALL: { processMessageToReplyTo(messageViewInfo); break; } case FORWARD: { processMessageToForward(messageViewInfo, false); break; } case FORWARD_AS_ATTACHMENT: { processMessageToForward(messageViewInfo, true); break; } case EDIT_DRAFT: { processDraftMessage(messageViewInfo); break; } default: { Timber.w("processSourceMessage() called with unsupported action"); break; } } <START> } catch (MessagingException | IOException e) { <END> Timber.e(e, "Error while processing source message: "); } finally { relatedMessageProcessed = true; changesMadeSinceLastSave = false; } updateMessageFormat(); }</code><technical_language>this a bad idea, wrap IOException a MessagingException stack visible IOExceptions happen handled this way</technical_language>

Target:
private void processSourceMessage(MessageViewInfo messageViewInfo) { try { switch (action) { case REPLY: case REPLY_ALL: { processMessageToReplyTo(messageViewInfo); break; } case FORWARD: { processMessageToForward(messageViewInfo, false); break; } case FORWARD_AS_ATTACHMENT: { processMessageToForward(messageViewInfo, true); break; } case EDIT_DRAFT: { processDraftMessage(messageViewInfo); break; } default: { Timber.w("processSourceMessage() called with unsupported action"); break; } } } catch (MessagingException e) { Timber.e(e, "Error while processing source message: "); } finally { relatedMessageProcessed = true; changesMadeSinceLastSave = false; } updateMessageFormat(); }
Source:
<code>private static boolean isMoving(ArrayList<Position> positions, int index, TripsConfig tripsConfig, double speedThreshold) { if (tripsConfig.getMinimalNoDataDuration() > 0 && (index < positions.size() - 1 && positions.get(index + 1).getFixTime().getTime() - positions.get(index).getFixTime().getTime() >= tripsConfig.getMinimalNoDataDuration()) || index > 0 <START> && positions.get(index).getFixTime().getTime() - positions.get(index - 1).getFixTime().getTime() <END> >= tripsConfig.getMinimalNoDataDuration()) { return false; } if (positions.get(index).getAttributes().containsKey(Position.KEY_MOTION) && positions.get(index).getAttributes().get(Position.KEY_MOTION) instanceof Boolean) { return positions.get(index).getBoolean(Position.KEY_MOTION); } else { return positions.get(index).getSpeed() > speedThreshold; } }</code><technical_language>please split parts of this expression variables. hard understand on</technical_language>

Target:
private static boolean isMoving(ArrayList<Position> positions, int index, TripsConfig tripsConfig, double speedThreshold) { if (tripsConfig.getMinimalNoDataDuration() > 0) { boolean beforeGap = index < positions.size() - 1 && positions.get(index + 1).getFixTime().getTime() - positions.get(index).getFixTime().getTime() >= tripsConfig.getMinimalNoDataDuration(); boolean afterGap = index > 0 && positions.get(index).getFixTime().getTime() - positions.get(index - 1).getFixTime().getTime() >= tripsConfig.getMinimalNoDataDuration(); if (beforeGap || afterGap) { return false; } } if (positions.get(index).getAttributes().containsKey(Position.KEY_MOTION) && positions.get(index).getAttributes().get(Position.KEY_MOTION) instanceof Boolean) { return positions.get(index).getBoolean(Position.KEY_MOTION); } else { return positions.get(index).getSpeed() > speedThreshold; } }
Source:
<code>public Construct exec(Target t, com.laytonsmith.core.environments.Environment environment, Construct... args) throws ConfigRuntimeException { MCLocation loc = ObjectGenerator.GetGenerator().location(args[0], null, t); if(loc.getBlock().isCommandBlock()) { MCCommandBlock cb = loc.getBlock().getCommandBlock(); String cmd = ""; if(args.length == 2) { <START> if(!(args[1] instanceof CString)) { <END> throw new ConfigRuntimeException("Parameter 2 of " + getName() + " must be a string", ExceptionType.CastException, t); } cmd = args[1].val(); } cb.setCommand(cmd); return new CVoid(t); } else { throw new ConfigRuntimeException("The block at the specified location is not a command block", ExceptionType.FormatException, t); } }</code><technical_language>interesting allow CNull here, actually, allow for more flexible code. Setting a CNull clear command</technical_language>

Target:
public Construct exec(Target t, com.laytonsmith.core.environments.Environment environment, Construct... args) throws ConfigRuntimeException { String cmd = null; if(args.length == 2 && !(args[1] instanceof CNull)) { if(!(args[1] instanceof CString)) { throw new ConfigRuntimeException("Parameter 2 of " + getName() + " must be a string or null", ExceptionType.CastException, t); } cmd = args[1].val(); } MCLocation loc = ObjectGenerator.GetGenerator().location(args[0], null, t); if(loc.getBlock().isCommandBlock()) { MCCommandBlock cb = loc.getBlock().getCommandBlock(); cb.setCommand(cmd); return new CVoid(t); } else { throw new ConfigRuntimeException("The block at the specified location is not a command block", ExceptionType.FormatException, t); } }
Source:
<code>public void setup() { metadata = createTestMetadataManager(); domainTranslator = new RowExpressionDomainTranslator(metadata); columnExtractor = new SubfieldExtractor( new FunctionResolution(metadata.getFunctionManager()), (rowExpression, level, session) -> rowExpression, <START> TestingSession.SESSION, true).toColumnExtractor(); <END> }</code><technical_language>Create session property true</technical_language>

Target:
public void setup() { metadata = createTestMetadataManager(); domainTranslator = new RowExpressionDomainTranslator(metadata); columnExtractor = new SubfieldExtractor( new FunctionResolution(metadata.getFunctionManager()), (rowExpression, level, session) -> rowExpression, new TestingConnectorSession( new HiveSessionProperties( new HiveClientConfig().setNestedColumnsFilterEnabled(true), new OrcFileWriterConfig(), new ParquetFileWriterConfig()).getSessionProperties())).toColumnExtractor(); }
Source:
<code>public Page getOutput() { if (state != State.HAS_OUTPUT) { return null; } <START> if (!mergedPages.process() || mergedPages.isFinished()) { <END> state = State.FINISHED; return null; } Page resultPage = mergedPages.getResult(); Block[] blocksArray = new Block[outputChannels.length]; updateMemoryUsage(false); for (int i = 0; i < outputChannels.length; i++) { blocksArray[i] = resultPage.getBlock(outputChannels[i]); } return new Page(resultPage.getPositionCount(), blocksArray); }</code><technical_language>!mergedPages.process() process finished. Convert processor iterator easier in this context</technical_language>

Target:
public Page getOutput() { if (state != State.HAS_OUTPUT) { return null; } if (!sortedPages.hasNext()) { state = State.FINISHED; return null; } Page resultPage = sortedPages.next(); Block[] blocksArray = new Block[outputChannels.length]; for (int i = 0; i < outputChannels.length; i++) { blocksArray[i] = resultPage.getBlock(outputChannels[i]); } return new Page(resultPage.getPositionCount(), blocksArray); }
Source:
<code>private FilePosition(int line, int column) { this.line = line; <START> this.column = column; <END> }</code><technical_language>@sbrannen This warrant another issue, I line column need precondition guards ensure positive (> 0) numbers, personally sense for line column numbers in source files 1</technical_language>

Target:
private FilePosition(int line, int column) { Preconditions.condition(line > 0, "line number must be greater than zero"); Preconditions.condition(column > 0, "column number must be greater than zero"); this.line = line; this.column = Integer.valueOf(column); }
Source:
<code>public boolean equals(LogicalWindow window) { <START> if(normal_.equals(window.normal_)) <END> return true; return false; }</code><technical_language>simplify return normal_.equals(window.normal_)</technical_language>

Target:
public boolean equals(LogicalWindow window) { return normal_.equals(window.normal_); }
Source:
<code>List<PermissionRule> getOverridden(String permissionName) { <START> List<PermissionRule> r = overridden.get(permissionName); return r != null ? r : Collections.<PermissionRule> emptyList(); <END> }</code><technical_language>guava's firstNonNull: return firstNonNull( overridden.get(permissionName), Collections.<PermissionRule> emptyList());</technical_language>

Target:
List<PermissionRule> getOverridden(String permissionName) { return firstNonNull( overridden.get(permissionName), Collections.<PermissionRule> emptyList()); }
Source:
<code>private void renameApplicationToApplicationName() throws DeploymentException { if (!FilenameUtils.getBaseName(deploymentConfiguration.getApplication().getName()) .equals(deploymentConfiguration.getApplicationName())) { try { File destApplication = new File(deploymentConfiguration.getApplication().getParentFile(), deploymentConfiguration.getApplicationName() + ".jar"); FileUtils.copyFile(deploymentConfiguration.getApplication(), destApplication); deploymentConfiguration.setApplication(destApplication); } catch (IOException e) { <START> throw new DeploymentException("Couldn't rename [" + deploymentConfiguration.getApplication() + "] to [" <END> + deploymentConfiguration.getApplicationName() + "]"); } } }</code><technical_language>"Couldn't rename [" -> Fail rename</technical_language>

Target:
private void renameApplicationToApplicationName() throws DeploymentException { if (!FilenameUtils.getBaseName(deploymentConfiguration.getApplication().getName()) .equals(deploymentConfiguration.getApplicationName())) { try { File destApplication = new File(deploymentConfiguration.getApplication().getParentFile(), deploymentConfiguration.getApplicationName() + ".jar"); FileUtils.copyFile(deploymentConfiguration.getApplication(), destApplication); deploymentConfiguration.setApplication(destApplication); } catch (IOException e) { throw new DeploymentException("Fail to rename [" + deploymentConfiguration.getApplication() + "] to [" + deploymentConfiguration.getApplicationName() + "]"); } } }
Source:
<code>public void onClickIdentifierOptions(final int position, View view) { PopupMenu popup = new PopupMenu(getContext(), view); popup.getMenuInflater().inflate(R.menu.menu_client_identifier, popup.getMenu()); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.menu_remove_identifier: new AlertDialog.Builder(getActivity(), R.style.MaterialAlertDialogStyle) <START> .setMessage("Do you really want to delete?") <END> .setPositiveButton("Delete", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { mClientIdentifiersPresenter. deleteIdentifier(clientId, identifiers. get(position).getId(), position); } }) .setNegativeButton("Cancel", null).show(); break; case R.id.menu_identifier_documents: DocumentListFragment documentListFragment = DocumentListFragment .newInstance( Constants.ENTITY_TYPE_CLIENT_IDENTIFIERS, identifiers.get(position).getId()); FragmentTransaction fragmentTransaction = getActivity().getSupportFragmentManager().beginTransaction(); fragmentTransaction.addToBackStack(FragmentConstants .FRAG_CLIENT_IDENTIFIER); fragmentTransaction.replace(R.id.container, documentListFragment); fragmentTransaction.commit(); break; default: break; } return true; } }); popup.show(); }</code><technical_language>Please hardcoded strings java code, add string in strings.xml file dynamically</technical_language>

Target:
public void onClickIdentifierOptions(final int position, View view) { PopupMenu popup = new PopupMenu(getContext(), view); popup.getMenuInflater().inflate(R.menu.menu_client_identifier, popup.getMenu()); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.menu_remove_identifier: new AlertDialog.Builder(getActivity(), R.style.MaterialAlertDialogStyle) .setMessage(R.string.confirm_delete_identifiers) .setPositiveButton(R.string.dialog_action_delete, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { mClientIdentifiersPresenter. deleteIdentifier(clientId, identifiers. get(position).getId(), position); } }) .setNegativeButton(R.string.cancel, null).show(); break; case R.id.menu_identifier_documents: DocumentListFragment documentListFragment = DocumentListFragment .newInstance( Constants.ENTITY_TYPE_CLIENT_IDENTIFIERS, identifiers.get(position).getId()); FragmentTransaction fragmentTransaction = getActivity().getSupportFragmentManager().beginTransaction(); fragmentTransaction.addToBackStack(FragmentConstants .FRAG_CLIENT_IDENTIFIER); fragmentTransaction.replace(R.id.container, documentListFragment); fragmentTransaction.commit(); break; default: break; } return true; } }); popup.show(); }
Source:
<code>private void calcMedicalSupportHoursNeeded() { int activePersonnelCount = getCampaign().getActivePersonnel().size(); int numSquads = new BigDecimal(activePersonnelCount) .divide(new BigDecimal(7), 0, RoundingMode.DOWN).intValue(); int leftOver = activePersonnelCount - (numSquads * 7); medSupportNeeded = (numSquads * 4) + <START> (new BigDecimal(leftOver).divide( <END> new BigDecimal(5), 0, RoundingMode.HALF_EVEN).intValue()); if(medSupportNeeded != 0){ medSupportNeeded += 3; } }</code><technical_language>~This cancels out contribution of left units 5 personnel.~ Re-reading section in FM:Mr(Rev) examples provided, logic work: // Calculated based 7-person squads int numSquads = (int)(activePersonnelCount / 7); // integer division intended // squad takes 4.4 hours (3 + 7/5) rounded nearest hour int medSupportNeeded = numSquads * 4; int leftOver = activePersonnelCount - (numSquads * 7); if (leftOver > 0) { // left overs form a squad needs (3 + N / 5) rounded hours medSupportNeeded += (int)Math.round(3 + leftOver / 5.0); }</technical_language>

Target:
private void calcMedicalSupportHoursNeeded() { int activePersonnelCount = getCampaign().getActivePersonnel().size(); int numSquads = (int) (activePersonnelCount / 7); medSupportNeeded = numSquads * 4; int leftOver = activePersonnelCount - (numSquads * 7); if (leftOver > 0) { medSupportNeeded += (int) Math.round(3 + leftOver / 5.0); } }
Source:
<code>public void idTokenWithAudience_incorrect() throws IOException { <START> final String accessToken1 = "1/MkSJoj1xsli0AccessToken_NKPY2"; <END> MockTokenServerTransportFactory transportFactory = new MockTokenServerTransportFactory(); MockTokenServerTransport transport = transportFactory.transport; ServiceAccountCredentials credentials = ServiceAccountCredentials.fromPkcs8( SA_CLIENT_ID, SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID, SCOPES, transportFactory, null); transport.addServiceAccount(SA_CLIENT_EMAIL, accessToken1); TestUtils.assertContainsBearerToken(credentials.getRequestMetadata(CALL_URI), accessToken1); String targetAudience = "https://bar"; IdTokenCredentials tokenCredential = IdTokenCredentials.create(credentials, targetAudience); tokenCredential.refresh(); assertNotEquals( targetAudience, (String) tokenCredential.getIdToken().getJsonWebSignature().getPayload().getAudience()); }</code><technical_language>google style is final local variables required</technical_language>

Target:
public void idTokenWithAudience_incorrect() throws IOException { String accessToken1 = "1/MkSJoj1xsli0AccessToken_NKPY2"; MockTokenServerTransportFactory transportFactory = new MockTokenServerTransportFactory(); MockTokenServerTransport transport = transportFactory.transport; ServiceAccountCredentials credentials = ServiceAccountCredentials.fromPkcs8( SA_CLIENT_ID, SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID, SCOPES, transportFactory, null); transport.addServiceAccount(SA_CLIENT_EMAIL, accessToken1); TestUtils.assertContainsBearerToken(credentials.getRequestMetadata(CALL_URI), accessToken1); String targetAudience = "https://bar"; IdTokenCredentials tokenCredential = IdTokenCredentials.newBuilder() .setIdTokenProvider(credentials) .setTargetAudience(targetAudience) .build(); tokenCredential.refresh(); assertNotEquals( targetAudience, (String) tokenCredential.getIdToken().getJsonWebSignature().getPayload().getAudience()); }
Source:
<code>public int hashCode() { <START> return Objects.hash(getId(), getUrl(), getTitle(), _ignoreCertificateErrors, getTriggeringEventName()); <END> }</code><technical_language>accessors members; preference is members</technical_language>

Target:
public int hashCode() { return Objects.hash(_id, _uri, _title, _ignoreCertificateErrors, _triggeringEventName); }
Source:
<code>public void onPartitionBecomeDroppedFromOffline(String partitionName) { PartitionStateChangeListener storageManagerListener = partitionStateChangeListeners.get(StateModelListenerType.StorageManagerListener); if (storageManagerListener != null) { try { storageManagerListener.onPartitionBecomeDroppedFromOffline(partitionName); } catch (Exception e) { participantMetrics.offlineCount.addAndGet(-1); participantMetrics.errorStateCount.addAndGet(1); throw e; } } <START> participantMetrics.offlineCount.addAndGet(-1); <END> participantMetrics.partitionDroppedCount.inc(); }</code><technical_language>finally</technical_language>

Target:
public void onPartitionBecomeDroppedFromOffline(String partitionName) { PartitionStateChangeListener storageManagerListener = partitionStateChangeListeners.get(StateModelListenerType.StorageManagerListener); try { if (storageManagerListener != null) { storageManagerListener.onPartitionBecomeDroppedFromOffline(partitionName); } } catch (Exception e) { participantMetrics.errorStateCount.addAndGet(1); throw e; } finally { participantMetrics.offlineCount.addAndGet(-1); } participantMetrics.partitionDroppedCount.inc(); }
Source:
<code>public int hashCode() { return Objects.hash(proposalNumber, status, projectTitle, startDate, stopDate, directCostAmount, indirectCostAmount, totalAmount, grantNumber, grantDescription, federalPassThrough, federalPassThroughAgencyNumber, cfdaNumber, organizationCode, costShareRequired, finalReportDueDate, principalAndCoPrincipalInvestigators, <START> principalAndCoPrincipalInvestigators); <END> }</code><technical_language>"principalAndCoPrincipalInvestigators" list is hashed twice. I suggest building hashCode</technical_language>

Target:
public int hashCode() { return Objects.hash(proposalNumber, status, projectTitle, startDate, stopDate, directCostAmount, indirectCostAmount, totalAmount, grantNumber, grantDescription, federalPassThrough, federalPassThroughAgencyNumber, cfdaNumber, organizationCode, costShareRequired, finalReportDueDate, principalAndCoPrincipalInvestigators); }
Source:
<code>private List<Question> handleSaveQuestions(final Long accountId, final DateTime todayLocal, final DateTime expireDate, final List<Question> questions, final ImmutableList<AccountQuestionResponses> todayQuestionResponseList) { final List<Question> savedQuestions = Lists.newArrayList(); for (Question question : questions) { final Optional<Long> savedAccountQuestionId = savedAccountQuestion(question, todayQuestionResponseList); final Boolean alreadySaved = savedAccountQuestionId.isPresent(); <START> if (alreadySaved) { <END> final Question savedQuestion = Question.withAccountQId(question, savedAccountQuestionId.get()); savedQuestions.add(savedQuestion); } else if (!alreadySaved) { final Long accountQuestionId = saveQuestion(accountId, question, todayLocal, expireDate); final Question savedQuestion = Question.withAccountQId(question, accountQuestionId); savedQuestions.add(savedQuestion); } } return savedQuestions; }</code><technical_language>final Question savedQuestion; if (savedAccountQuestionId.isPresent()) { savedQuestion = Question.withAccountQId(question, savedAccountQuestionId.get()); } else { final Long accountQuestionId = saveQuestion(accountId, question, todayLocal, expireDate); savedQuestion = Question.withAccountQId(question, accountQuestionId); } savedQuestions.add(savedQuestion);</technical_language>

Target:
private List<Question> handleSaveQuestions(final Long accountId, final DateTime todayLocal, final DateTime expireDate, final List<Question> questions, final ImmutableList<AccountQuestionResponses> todayQuestionResponseList) { final List<Question> savedQuestions = Lists.newArrayList(); for (final Question question : questions) { final Optional<Long> savedAccountQuestionId = savedAccountQuestion(question, todayQuestionResponseList); final Long accountQuestionId; if (savedAccountQuestionId.isPresent()) { accountQuestionId = savedAccountQuestionId.get(); } else { accountQuestionId = saveQuestion(accountId, question, todayLocal, expireDate); } final Question savedQuestion = Question.withAccountQId(question, accountQuestionId); savedQuestions.add(savedQuestion); } return savedQuestions; }
Source:
<code>void createItem (TreeItem item, long parentIter, int index) { item.handle = OS.g_malloc (GTK.GtkTreeIter_sizeof ()); if (item.handle == 0) error(SWT.ERROR_NO_HANDLES); if (index == 0) { <START> GTK.gtk_tree_store_insert (modelHandle, item.handle, parentIter, index); <END> } else if (index == -1) { GTK.gtk_tree_store_append (modelHandle, item.handle, parentIter); } else { int count = GTK.gtk_tree_model_iter_n_children (modelHandle, parentIter); if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE); if (index == count) { GTK.gtk_tree_store_append (modelHandle, item.handle, parentIter); } else { GTK.gtk_tree_store_insert (modelHandle, item.handle, parentIter, index); } } int id = getId (item.handle, false); items [id] = item; modelChanged = true; }</code><technical_language>gtk_tree_store_prepend() here</technical_language>

Target:
void createItem (TreeItem item, long parentIter, int index) { if (index == 0) { item.handle = OS.g_malloc (GTK.GtkTreeIter_sizeof ()); if (item.handle == 0) error(SWT.ERROR_NO_HANDLES); GTK.gtk_tree_store_prepend (modelHandle, item.handle, parentIter); } else if (index == -1) { item.handle = OS.g_malloc (GTK.GtkTreeIter_sizeof ()); if (item.handle == 0) error(SWT.ERROR_NO_HANDLES); GTK.gtk_tree_store_append (modelHandle, item.handle, parentIter); } else { int count = GTK.gtk_tree_model_iter_n_children (modelHandle, parentIter); if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE); item.handle = OS.g_malloc (GTK.GtkTreeIter_sizeof ()); if (item.handle == 0) error(SWT.ERROR_NO_HANDLES); if (index == count) { GTK.gtk_tree_store_append (modelHandle, item.handle, parentIter); } else { GTK.gtk_tree_store_insert (modelHandle, item.handle, parentIter, index); } } int id = getId (item.handle, false); items [id] = item; modelChanged = true; }
Source:
<code>public boolean sessionIsValid(String ssoTicket) { <START> return new IAMRestClient().isSSOTicketValid(iamURL + IAMConfiguration.IAM_TICKET_REQUEST + "/" + ssoTicket); <END> }</code><technical_language>instantiate IAMRestClient save it</technical_language>

Target:
public boolean sessionIsValid(String ssoTicket) { return iamRestClient.isSSOTicketValid(iamURL + IAMConfiguration.IAM_TICKET_REQUEST + "/" + ssoTicket); }
Source:
<code>private void printResult(PluginWrapper.PluginDisableResult oneResult, int indent) { PluginWrapper.PluginDisableStatus status = oneResult.getStatus(); if(quiet && (PluginWrapper.PluginDisableStatus.DISABLED.equals(status) || PluginWrapper.PluginDisableStatus.ALREADY_DISABLED.equals(status))) { return; } printIndented(indent, Messages.DisablePluginCommand_StatusMessage(oneResult.getPlugin(), oneResult.getStatus(), oneResult.getMessage())); if(oneResult.getDependantsDisableStatus().size() > 0) { <START> indent = (indent == 0) ? INDENT_SPACE : indent*2; <END> for (PluginWrapper.PluginDisableResult oneDependantResult : oneResult.getDependantsDisableStatus()) { printResult(oneDependantResult, indent); } } }</code><technical_language>nit: indent * 2 (add spaces operators)</technical_language>

Target:
private void printResult(PluginWrapper.PluginDisableResult oneResult, int indent) { PluginWrapper.PluginDisableStatus status = oneResult.getStatus(); if (quiet && (PluginWrapper.PluginDisableStatus.DISABLED.equals(status) || PluginWrapper.PluginDisableStatus.ALREADY_DISABLED.equals(status))) { return; } printIndented(indent, Messages.DisablePluginCommand_StatusMessage(oneResult.getPlugin(), oneResult.getStatus(), oneResult.getMessage())); if (oneResult.getDependantsDisableStatus().size() > 0) { indent += INDENT_SPACE; for (PluginWrapper.PluginDisableResult oneDependantResult : oneResult.getDependantsDisableStatus()) { printResult(oneDependantResult, indent); } } }
Source:
<code>public Optional<byte[]> checkSplit(boolean force) { if (this.getRegionInfo().isMetaRegion()) { return Optional.empty(); } if (this.isClosing()) { return Optional.empty(); } if (!force && !splitPolicy.shouldSplit()) { <START> return null; <END> } byte[] ret = splitPolicy.getSplitPoint(); if (ret != null) { try { checkRow(ret, "calculated split"); } catch (IOException e) { LOG.error("Ignoring invalid split for region {}", this, e); return Optional.empty(); } return Optional.of(ret); } else { return Optional.empty(); } }</code><technical_language>return Optional.empty()</technical_language>

Target:
public Optional<byte[]> checkSplit(boolean force) { if (this.getRegionInfo().isMetaRegion()) { return Optional.empty(); } if (this.isClosing()) { return Optional.empty(); } if (!force && !splitPolicy.shouldSplit()) { return Optional.empty(); } byte[] ret = splitPolicy.getSplitPoint(); if (ret != null) { try { checkRow(ret, "calculated split"); } catch (IOException e) { LOG.error("Ignoring invalid split for region {}", this, e); return Optional.empty(); } return Optional.of(ret); } else { return Optional.empty(); } }
Source:
<code>public void testMultiplePositions(double maxStandardError) { DescriptiveStatistics stats = new DescriptiveStatistics(); for (int i = 0; i < 500; ++i) { int uniques = ThreadLocalRandom.current().nextInt(getUniqueValuesCount()) + 1; List<Object> values = createRandomSample(uniques, (int) (uniques * 1.5)); long actual = estimateGroupByCount(values, maxStandardError); double error = (actual - uniques) * 1.0 / uniques; stats.addValue(error); } assertLessThan(stats.getMean(), 1.0e-2); <START> assertLessThan(Math.abs(stats.getStandardDeviation()), 1.0e-2 + maxStandardError); <END> }</code><technical_language>static import abs</technical_language>

Target:
public void testMultiplePositions(double maxStandardError) { DescriptiveStatistics stats = new DescriptiveStatistics(); for (int i = 0; i < 500; ++i) { int uniques = ThreadLocalRandom.current().nextInt(getUniqueValuesCount()) + 1; List<Object> values = createRandomSample(uniques, (int) (uniques * 1.5)); long actual = estimateGroupByCount(values, maxStandardError); double error = (actual - uniques) * 1.0 / uniques; stats.addValue(error); } assertLessThan(stats.getMean(), 1.0e-2); assertLessThan(stats.getStandardDeviation(), 1.0e-2 + maxStandardError); }
Source:
<code>private void handleFullTasksCircularBuffer(Runnable r, int sleepMillis) { final Thread currentThread = Thread.currentThread(); if (eventThread == currentThread) { int size = tasks.size(); if (size == tasks.capacity()) { try { while (size > 0) { tasks.pollUnsafe().run(); size--; } } catch (RuntimeException e) { logger.error("", e); throw e; } catch (Exception e) { logger.error("", e); throw new RuntimeException(e); } } else { logger.error("Failed to add Runnable to tasks and size is not equal to capacity {}.", r, tasks, size, tasks.capacity()); throw new IllegalStateException("size " + size + " should be equal to capacity " + tasks.capacity()); } } else { selector.wakeup(); try { sleep(sleepMillis); } catch (InterruptedException ex) { <START> logger.error("Interrupted", ex); <END> throw new RuntimeException(ex); } } }</code><technical_language>debug</technical_language>

Target:
private void handleFullTasksCircularBuffer(Runnable r, int sleepMillis) { final Thread currentThread = Thread.currentThread(); if (eventThread == currentThread) { int size = tasks.size(); if (size == tasks.capacity()) { while (size > 0) { tasks.pollUnsafe().run(); size--; } } else { logger.error("Failed to add Runnable to tasks and size is not equal to capacity {}.", r, tasks, size, tasks.capacity()); throw new IllegalStateException("size " + size + " should be equal to capacity " + tasks.capacity()); } } else { selector.wakeup(); try { sleep(sleepMillis); } catch (InterruptedException e) { throw new RuntimeException(e); } } }
Source:
<code>public void setup() { if (!initialized) { registerUser(USER_NAME_1, USER_PASSWORD_1); registerUser(USER_NAME_2, USER_PASSWORD_2); <START> registerUser(USER_NAME_3, USER_PASSWORD_3); <END> initialized = true; } scenario = new Scenario((RandomUtilMock) randomUtil); }</code><technical_language>methods instead of new CTF</technical_language>

Target:
public void setup() { scenario = new Scenario((RandomUtilMock) randomUtil); if (!initialized) { scenario .registerUser(USER_NAME_1, USER_PASSWORD_1) .registerUser(USER_NAME_2, USER_PASSWORD_2) .registerUser(USER_NAME_3, USER_PASSWORD_3); initialized = true; } }
Source:
<code><START> public DomainNameList(List<String> values) { <END> this.values = values; }</code><technical_language>immutable copy</technical_language>

Target:
public DomainNameList(List<String> values) { this.values = ImmutableList.copyOf(values); }
Source:
<code>public void clear(final Collection<Long> records) { <START> execute(new Callable<Void>() { <END> @Override public Void call() throws Exception { for (Long record: records) { client.clear1(record, creds, transaction); } return null; } }); }</code><technical_language>implementation call clear(record) method above. Basically want do public void clear(Collection<Long> records) { for(long record: records){ clear(record); } }</technical_language>

Target:
public void clear(final Collection<Long> records) { for (Long record: records) { clear(record); } }
Source:
<code>private void executeRefUpdates() throws UpdateException { if (batchRefUpdate.getCommands().isEmpty()) { return; } try { inserter.flush(); batchRefUpdate.execute(revWalk, NullProgressMonitor.INSTANCE); boolean ok = true; for (ReceiveCommand cmd : batchRefUpdate.getCommands()) { if (cmd.getResult() != ReceiveCommand.Result.OK) { ok = false; break; } } if (!ok) { throw new UpdateException("BatchRefUpdate failed: " + batchRefUpdate); } <START> gitRefUpdated.fire(project, batchRefUpdate); <END> } catch (IOException e) { throw new UpdateException(e); } }</code><technical_language>Yes, this shows useful this class is. Ensuring this code is distributed code base is a nightmare..</technical_language>

Target:
private void executeRefUpdates() throws UpdateException { if (batchRefUpdate.getCommands().isEmpty()) { return; } try { inserter.flush(); batchRefUpdate.execute(revWalk, NullProgressMonitor.INSTANCE); boolean ok = true; for (ReceiveCommand cmd : batchRefUpdate.getCommands()) { if (cmd.getResult() != ReceiveCommand.Result.OK) { ok = false; break; } } if (!ok) { throw new UpdateException("BatchRefUpdate failed: " + batchRefUpdate); } } catch (IOException e) { throw new UpdateException(e); } }