auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private JCheckBox getChkInjectableQueryString() { if (chkInjectableQueryString == null) { chkInjectableQueryString = new JCheckBox(); chkInjectableQueryString.setText(Constant.messages.getString("variant.options.injectable.querystring.label")); chkInjectableQueryString.addItemListener(new ItemListener() { @Override <START> public void itemStateChanged(ItemEvent e) { <END> getChkAddQueryParam().setEnabled(e.getStateChange() == ItemEvent.SELECTED); } }); } return chkInjectableQueryString; }</code><technical_language>a lambda, code</technical_language>

Target:
private JCheckBox getChkInjectableQueryString() { if (chkInjectableQueryString == null) { chkInjectableQueryString = new JCheckBox(); chkInjectableQueryString.setText(Constant.messages.getString("variant.options.injectable.querystring.label")); chkInjectableQueryString.addItemListener(e -> getChkAddQueryParam().setEnabled(e.getStateChange() == ItemEvent.SELECTED)); } return chkInjectableQueryString; }
Source:
<code>private DataSource newDataSource() { DataSource dataSource; try { Class.forName("com.mysql.jdbc.Driver"); if (useResinDataSource()) { InitialContext jndiContext = new InitialContext(); dataSource = (DataSource) jndiContext.lookup("java:comp/env/jdbc/hello_world"); } <START> else try(HikariDataSource ds = new HikariDataSource();) <END> { ds.setJdbcUrl("jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"); ds.setDriverClassName("com.mysql.jdbc.Driver"); ds.setUsername("benchmarkdbuser"); ds.setPassword("benchmarkdbpass"); dataSource = ds; } } catch (Exception x) { throw new RuntimeException("Cannot create the data source", x); } return dataSource; }</code><technical_language>This close data source right setup</technical_language>

Target:
private DataSource newDataSource() { DataSource dataSource; try { Class.forName("com.mysql.jdbc.Driver"); if (useResinDataSource()) { InitialContext jndiContext = new InitialContext(); dataSource = (DataSource) jndiContext.lookup("java:comp/env/jdbc/hello_world"); } else { @SuppressWarnings("resource") HikariDataSource ds = new HikariDataSource(); ds.setJdbcUrl("jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"); ds.setDriverClassName("com.mysql.jdbc.Driver"); ds.setUsername("benchmarkdbuser"); ds.setPassword("benchmarkdbpass"); dataSource = ds; } } catch (Exception x) { throw new RuntimeException("Cannot create the data source", x); } return dataSource; }
Source:
<code>public void testKeeperOrderDependenceTwoDistinctClusters() { <START> final Log log = Log.getInstance(OpticalDuplicateFinderTest.class); <END> final OpticalDuplicateFinder finder = new OpticalDuplicateFinder(OpticalDuplicateFinder.DEFAULT_READ_NAME_REGEX, 100, log); List<PhysicalLocation> locs = Arrays.asList( loc(1, 100, 190), loc(1, 100, 280), loc(1, 300, 500), loc(1, 300, 590), loc(1, 300, 670), loc(1, 300, 760) ); List<PhysicalLocation> locsReordered = Arrays.asList( loc(1, 100, 190), loc(1, 100, 280), loc(1, 300, 500), loc(1, 300, 760), loc(1, 300, 670), loc(1, 300, 590) ); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locs, locs.get(0))),4); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locsReordered, locsReordered.get(0))),4); }</code><technical_language>API supports a null log need for a test, test is testing log output</technical_language>

Target:
public void testKeeperOrderDependenceTwoDistinctClusters() { final OpticalDuplicateFinder finder = new OpticalDuplicateFinder(OpticalDuplicateFinder.DEFAULT_READ_NAME_REGEX, 100, null); final List<PhysicalLocation> locs = Arrays.asList( loc(1, 100, 190), loc(1, 100, 280), loc(1, 300, 500), loc(1, 300, 590), loc(1, 300, 670), loc(1, 300, 760) ); final List<PhysicalLocation> locsReordered = Arrays.asList( loc(1, 100, 190), loc(1, 100, 280), loc(1, 300, 500), loc(1, 300, 760), loc(1, 300, 670), loc(1, 300, 590) ); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locs, locs.get(0))), 4); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locsReordered, locsReordered.get(0))), 4); }
Source:
<code>public EObject updateCreatedObject(EObject newObject, String loadedVersion) { <START> return null; <END> }</code><technical_language>return newObject; null</technical_language>

Target:
public EObject updateCreatedObject(EObject newObject, String loadedVersion) { return newObject; }
Source:
<code>public static void makeBucketWithPeriod_test() throws Exception { if (!mintEnv) { System.out.println("Test: makeBucket(String bucketName, String region)"); } long startTime = System.currentTimeMillis(); String name = getRandomName() + ".withperiod"; try { client.makeBucket(name, "eu-central-1"); client.removeBucket(name); mintLog("makeBucket(String bucketName, String region)", "name: " + name + ", region: eu-central-1", System.currentTimeMillis() - startTime, PASS, null, null, <START> null); <END> } catch (Exception e) { mintLog("makeBucket(String bucketName, String region)", "name: " + name + ", region: eu-central-1", System.currentTimeMillis() - startTime, FAILED, null, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }</code><technical_language>Passing args in new line a weird me. specific reasons for this? If follow style follow for other API calls - client.makeBucket(name, "eu-central-1");</technical_language>

Target:
public static void makeBucketWithPeriod_test() throws Exception { if (!mintEnv) { System.out.println("Test: makeBucket(String bucketName, String region)"); } long startTime = System.currentTimeMillis(); String name = getRandomName() + ".withperiod"; try { client.makeBucket(name, "eu-central-1"); client.removeBucket(name); mintSuccessLog("makeBucket(String bucketName, String region)", "name: " + name + ", region: eu-central-1", startTime); } catch (Exception e) { mintFailedLog("makeBucket(String bucketName, String region)", "name: " + name + ", region: eu-central-1", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }
Source:
<code>public static String normalizeLineEndings(String s) { <START> return s.replaceAll(CRLF, LF).replaceAll(CR, LF); <END> }</code><technical_language>CR a line delimiter nowadays</technical_language>

Target:
public static String normalizeLineEndings(String s) { return s.replaceAll(CRLF, LF).replace(CR_CHAR, LF_CHAR); }
Source:
<code>protected void pulsePhysics() { Location velLoc = location.clone().add(velocity); final Block block = velLoc.getBlock(); if (block.getType().isOccluding()) { Location velLocY = location.clone().add(0, velocity.getY(), 0); if (velLocY.getBlock().getType().isOccluding()) { velocity.setY(0); } Location velLocX = location.clone().add(velocity.getX(), 0, 0); if (velLocX.getBlock().getType().isOccluding()) { velocity.setX(0); } Location velLocZ = location.clone().add(0, 0, velocity.getZ()); if (velLocZ.getBlock().getType().isOccluding()) { velocity.setZ(0); } collide(block); } else { if (hasFriction()) { if (location.getBlock().getType() == Material.WATER) { velocity.multiply(liquidDrag); velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } else if (location.getBlock().getType() == Material.LAVA) { velocity.multiply(liquidDrag - 0.3); velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } else { velocity.setY(airDrag * (velocity.getY() + getGravityAccel().getY())); if (isOnGround()) { velocity.setX(velocity.getX() * slipMultiplier); velocity.setZ(velocity.getZ() * slipMultiplier); } else { horizontalAirDrag = 0.91; velocity.setX(velocity.getX() * horizontalAirDrag); <START> velocity.setZ(velocity.getZ() * 0.91); <END> } } } else if (hasGravity() && !isOnGround()) { switch (location.getBlock().getType()) { case WATER: case LAVA: velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); break; default: velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } } setRawLocation(velLoc); } }</code><technical_language>horizontalAirDrag well</technical_language>

Target:
protected void pulsePhysics() { Location velLoc = location.clone().add(velocity); final Block block = velLoc.getBlock(); if (block.getType().isOccluding()) { Location velLocY = location.clone().add(0, velocity.getY(), 0); if (velLocY.getBlock().getType().isOccluding()) { velocity.setY(0); } Location velLocX = location.clone().add(velocity.getX(), 0, 0); if (velLocX.getBlock().getType().isOccluding()) { velocity.setX(0); } Location velLocZ = location.clone().add(0, 0, velocity.getZ()); if (velLocZ.getBlock().getType().isOccluding()) { velocity.setZ(0); } collide(block); } else { if (hasFriction()) { if (location.getBlock().getType() == Material.WATER) { velocity.multiply(liquidDrag); velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } else if (location.getBlock().getType() == Material.LAVA) { velocity.multiply(liquidDrag - 0.3); velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } else { velocity.setY(airDrag * (velocity.getY() + getGravityAccel().getY())); if (isOnGround()) { velocity.setX(velocity.getX() * slipMultiplier); velocity.setZ(velocity.getZ() * slipMultiplier); } else { velocity.setX(velocity.getX() * horizontalAirDrag); velocity.setZ(velocity.getZ() * horizontalAirDrag); } } } else if (hasGravity() && !isOnGround()) { switch (location.getBlock().getType()) { case WATER: case LAVA: velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); break; default: velocity.setY(velocity.getY() + getGravityAccel().getY() / 4d); } } setRawLocation(velLoc); } }
Source:
<code>public void registerDisputeAgent(String disputeAgentType, String registrationKey) { if (!p2PService.isBootstrapped()) throw new IllegalStateException("p2p service is not bootstrapped yet"); if (config.baseCurrencyNetwork.isMainnet() || config.baseCurrencyNetwork.isDaoBetaNet() || !config.useLocalhostForP2P) throw new IllegalStateException("dispute agents must be registered in a Bisq UI"); if (!registrationKey.equals(DEV_PRIVILEGE_PRIV_KEY)) throw new IllegalArgumentException("invalid registration key"); switch (disputeAgentType) { case "arbitrator": throw new IllegalArgumentException("arbitrators must be registered in a Bisq UI"); case "mediator": case "refundagent": NodeAddress nodeAddress = new NodeAddress( InetAddress.getLoopbackAddress().getHostAddress(), config.nodePort); List<String> languageCodes = Arrays.asList("de", "en", "es", "fr"); <START> ECKey ecKey = mediatorManager.getRegistrationKey(registrationKey); String signature = mediatorManager.signStorageSignaturePubKey(Objects.requireNonNull(ecKey)); <END> if (disputeAgentType.equals("mediator")) registerMediator(nodeAddress, languageCodes, ecKey, signature); else registerRefundAgent(nodeAddress, languageCodes, ecKey, signature); return; default: throw new IllegalArgumentException("unknown dispute agent type " + disputeAgentType); } }</code><technical_language>of work moment, correct specific manager depending case. a disputeAgentManager set type is registered, move specific registration code switch cases</technical_language>

Target:
public void registerDisputeAgent(String disputeAgentType, String registrationKey) { if (!p2PService.isBootstrapped()) throw new IllegalStateException("p2p service is not bootstrapped yet"); if (config.baseCurrencyNetwork.isMainnet() || config.baseCurrencyNetwork.isDaoBetaNet() || !config.useLocalhostForP2P) throw new IllegalStateException("dispute agents must be registered in a Bisq UI"); if (!registrationKey.equals(DEV_PRIVILEGE_PRIV_KEY)) throw new IllegalArgumentException("invalid registration key"); ECKey ecKey; String signature; switch (disputeAgentType) { case "arbitrator": throw new IllegalArgumentException("arbitrators must be registered in a Bisq UI"); case "mediator": ecKey = mediatorManager.getRegistrationKey(registrationKey); signature = mediatorManager.signStorageSignaturePubKey(Objects.requireNonNull(ecKey)); registerMediator(nodeAddress, languageCodes, ecKey, signature); return; case "refundagent": ecKey = refundAgentManager.getRegistrationKey(registrationKey); signature = refundAgentManager.signStorageSignaturePubKey(Objects.requireNonNull(ecKey)); registerRefundAgent(nodeAddress, languageCodes, ecKey, signature); return; default: throw new IllegalArgumentException("unknown dispute agent type " + disputeAgentType); } }
Source:
<code>private void setupNamedStatement(ObjList<BindVariableSetter> bindVariableSetters, CharSequenceObjHashMap<NamedStatementWrapper> namedStatementMap, CharSequence statementName) throws SqlException { <START> if (statementName != null) { <END> final NamedStatementWrapper wrapper = namedStatementMap.get(statementName); if (wrapper.selectFactory != null) { queryTag = TAG_SELECT; currentFactory = wrapper.selectFactory; } else if (wrapper.insertStatement != null) { queryTag = TAG_INSERT; currentInsertStatement = wrapper.insertStatement; } if (wrapper.bindVariableTypes != null) { bindVariableSetters.clear(); setupCachedBindVariables(bindVariableSetters, wrapper.bindVariableTypes); } } }</code><technical_language>for performance reasons this null check done of method call. rationale is method call happen statement is null</technical_language>

Target:
private void setupNamedStatement(ObjList<BindVariableSetter> bindVariableSetters, CharSequenceObjHashMap<NamedStatementWrapper> namedStatementMap, CharSequence statementName) throws SqlException { final NamedStatementWrapper wrapper = namedStatementMap.get(statementName); if (wrapper.selectFactory != null) { queryTag = TAG_SELECT; currentFactory = wrapper.selectFactory; } else if (wrapper.insertStatement != null) { queryTag = TAG_INSERT; currentInsertStatement = wrapper.insertStatement; } if (wrapper.bindVariableTypes != null) { bindVariableSetters.clear(); setupCachedBindVariables(bindVariableSetters, wrapper.bindVariableTypes); } }
Source:
<code>public static Double doubleArrayMinMax(MethodHandle compareMethodHandle, Type elementType, Block block) { try { if (block.getPositionCount() == 0) { return null; } double selectedValue = elementType.getDouble(block, 0); for (int i = 0; i < block.getPositionCount(); i++) { if (block.isNull(i)) { return null; } double value = elementType.getDouble(block, i); if (isNaN(value)) { <START> return value; <END> } else if ((boolean) compareMethodHandle.invokeExact(value, selectedValue)) { selectedValue = value; } } return selectedValue; } catch (Throwable t) { throw internalError(t); } }</code><technical_language>nit: returning NaN</technical_language>

Target:
public static Double doubleArrayMinMax(MethodHandle compareMethodHandle, Type elementType, Block block) { try { if (block.getPositionCount() == 0) { return null; } boolean containNull = false; double selectedValue = elementType.getDouble(block, 0); for (int i = 0; i < block.getPositionCount(); i++) { if (block.isNull(i)) { containNull = true; } double value = elementType.getDouble(block, i); if ((boolean) compareMethodHandle.invokeExact(value, selectedValue)) { selectedValue = value; } else if (isNaN(value)) { return NaN; } } return containNull ? null : selectedValue; } catch (Throwable t) { throw internalError(t); } }
Source:
<code>public int hashCode() { int result = cursor.hashCode(); <START> result = 31 * result + (events != null ? events.hashCode() : 0); <END> result = 31 * result + (metadata != null ? metadata.hashCode() : 0); return result; }</code><technical_language>events null</technical_language>

Target:
public int hashCode() { int result = cursor.hashCode(); result = 31 * result + events.hashCode(); result = 31 * result + (metadata != null ? metadata.hashCode() : 0); return result; }
Source:
<code>public CubemapAttribute (final long type, final Cubemap texture) { this(type); <START> textureDescription.set(texture, texture.getMinFilter(), texture.getMagFilter(), texture.getUWrap(), texture.getVWrap()); <END> }</code><technical_language>This change is needed (and unwanted), please undo this</technical_language>

Target:
public CubemapAttribute (final long type, final Cubemap texture) { this(type); textureDescription.texture = texture; }
Source:
<code>public SegmentsAndMetadata finish( final TransactionalSegmentPublisher publisher, final Committer committer ) throws InterruptedException { final SegmentsAndMetadata segmentsAndMetadata = publishAll(publisher, wrapCommitter(committer)); if (segmentsAndMetadata != null) { log.info("Awaiting handoff..."); <START> synchronized (handoffMonitor) { <END> while (!appenderator.getSegments().isEmpty()) { handoffMonitor.wait(); } } return new SegmentsAndMetadata( segmentsAndMetadata.getSegments(), ((FiniteAppenderatorDriverMetadata) segmentsAndMetadata.getCommitMetadata()).getCallerMetadata() ); } else { return null; } }</code><technical_language>a blocker: this honor handoffConditionTimeout</technical_language>

Target:
public SegmentsAndMetadata finish( final TransactionalSegmentPublisher publisher, final Committer committer ) throws InterruptedException { final SegmentsAndMetadata segmentsAndMetadata = publishAll(publisher, wrapCommitter(committer)); if (segmentsAndMetadata != null) { final long giveUpAt = handoffConditionTimeout > 0 ? System.currentTimeMillis() + handoffConditionTimeout : 0; log.info("Awaiting handoff..."); synchronized (handoffMonitor) { while (!appenderator.getSegments().isEmpty()) { if (giveUpAt == 0) { handoffMonitor.wait(); } else { final long remaining = giveUpAt - System.currentTimeMillis(); if (remaining > 0) { handoffMonitor.wait(remaining); } else { throw new ISE( "Segment handoff wait timeout. Segments not yet handed off: [%s]", Joiner.on(", ").join(appenderator.getSegments()) ); } } } } return new SegmentsAndMetadata( segmentsAndMetadata.getSegments(), ((FiniteAppenderatorDriverMetadata) segmentsAndMetadata.getCommitMetadata()).getCallerMetadata() ); } else { return null; } }
Source:
<code>private Mono<PagedResponse<KeyProperties>> listKeyVersionsFirstPage(String name, Context context) { try { return service.getKeyVersions(vaultUrl, name, DEFAULT_MAX_PAGE_RESULTS, apiVersion, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context.addData(AZ_TRACING_NAMESPACE_KEY, KEYVAULT_TRACING_NAMESPACE_VALUE)) .doOnRequest(ignored -> logger.info("Listing key versions - {}", name)) .doOnSuccess(response -> { if (response.getValue().size() == 0) { <START> throw new ResourceNotFoundException(String.format("Key with name: %s not found", name), null); <END> } else { logger.info("Listed key versions - {}", name); } }) .doOnError(error -> logger.warning(String.format("Failed to list key versions - %s", name), error)); } catch (RuntimeException ex) { return monoError(logger, ex); } }</code><technical_language>service, check service response. If sending 404, need properly map in KeyService.class</technical_language>

Target:
private Mono<PagedResponse<KeyProperties>> listKeyVersionsFirstPage(String name, Context context) { try { return service.getKeyVersions(vaultUrl, name, DEFAULT_MAX_PAGE_RESULTS, apiVersion, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context.addData(AZ_TRACING_NAMESPACE_KEY, KEYVAULT_TRACING_NAMESPACE_VALUE)) .doOnRequest(ignored -> logger.info("Listing key versions - {}", name)) .doOnSuccess(response -> logger.info("Listed key versions - {}", name)) .doOnError(error -> logger.warning(String.format("Failed to list key versions - %s", name), error)); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
<code><START> public void updates_rows_to_BRANCH() throws SQLException { <END> insertRow(1, "SHORT"); insertRow(2, "LONG"); insertRow(3, "SHORT"); insertRow(4, "LONG"); assertThat(countRowsWithValue(null)).isEqualTo(4); assertThat(countRowsWithValue(KEY_TYPE_BRANCH)).isEqualTo(0); underTest.execute(); assertThat(countRowsWithValue(null)).isEqualTo(0); assertThat(countRowsWithValue(KEY_TYPE_BRANCH)).isEqualTo(4); }</code><technical_language>suggestion: test updated_at is updated</technical_language>

Target:
public void updates_rows_to_BRANCH() throws SQLException { insertRow(1, "SHORT"); insertRow(2, "LONG"); insertRow(3, "SHORT"); insertRow(4, "LONG"); String countUpdatedAtSQL = "select count(uuid) from " + TABLE_NAME + " where updated_at = "; assertThat(countRowsWithValue(null)).isEqualTo(4); assertThat(countRowsWithValue(DEFAULT_KEY_TYPE)).isEqualTo(0); assertThat(dbTester.countSql(countUpdatedAtSQL + PAST)).isEqualTo(4); underTest.execute(); assertThat(countRowsWithValue(null)).isEqualTo(0); assertThat(countRowsWithValue(DEFAULT_KEY_TYPE)).isEqualTo(4); assertThat(dbTester.countSql(countUpdatedAtSQL + NOW)).isEqualTo(4); }
Source:
<code><START> public @CheckForNull String getOut() { <END> return out; }</code><technical_language>sense. @Nonnull, weird code in launch cleaned up. java try { result.setStatus(procStarter.quiet(quiet).cmds(args).envs(launchEnv).stdout(out).stderr(err).join()); return result; } finally { try { result.setOut(out.toString()); out.close(); } finally { result.setErr(err.toString()); err.close(); } } simplified java result.setStatus(procStarter.quiet(quiet).cmds(args).envs(launchEnv).stdout(out).stderr(err).join()); result.setOut(out.toString()); result.setErr(err.toString()); return result; (If join throws exception, is point adjusting result. If returns normally, assume stdio flushed. a ByteArrayOutputStream need closed.)</technical_language>

Target:
public @Nonnull String getOut() { return out; }
Source:
<code>String buildClientResponse() { <START> final String sbOauth2 = USER + username + ImapClientConstants.SOH + AUTH_BEARER <END> + token + ImapClientConstants.SOH + ImapClientConstants.SOH; return Base64.encodeBase64String(sbOauth2.getBytes(StandardCharsets.UTF_8)); }</code><technical_language>change StringBuilder()</technical_language>

Target:
String buildClientResponse() { final int len = USER.length() + username.length() + token.length() + EXTRA_LEN; final StringBuilder sbOauth2 = new StringBuilder(len).append(USER).append(username).append(ImapClientConstants.SOH).append(AUTH_BEARER) .append(token).append(ImapClientConstants.SOH).append(ImapClientConstants.SOH); return Base64.encodeBase64String(sbOauth2.toString().getBytes(StandardCharsets.UTF_8)); }
Source:
<code>public void decorate(World world, Random random, Chunk source) { int sourceX = (source.getX() << 4) + random.nextInt(16); int sourceZ = (source.getZ() << 4) + random.nextInt(16); int sourceY = random.nextInt(random.nextInt(type == Material.LAVA ? random.nextInt(240) + 8 : 248) + 8); Block block = world.getBlockAt(sourceX, sourceY, sourceZ); if ((block.getType() == Material.STONE || block.getType() == Material.AIR) && block.getRelative(BlockFace.DOWN).getType() == Material.STONE && block.getRelative(BlockFace.UP).getType() == Material.STONE) { int stoneBlockCount = 0; for (BlockFace face : SIDES) { if (block.getRelative(face).getType() == Material.STONE) { stoneBlockCount++; } } if (stoneBlockCount == 3) { int airBlockCount = 0; for (BlockFace face : SIDES) { if (block.getRelative(face).isEmpty()) { airBlockCount++; } } if (airBlockCount == 1) { BlockState state = block.getState(); state.setType(type); state.update(true); <START> ((GlowWorld) block.getWorld()).requestSinglePulse((GlowBlock) block, 20); <END> } } } }</code><technical_language>Set delay 0</technical_language>

Target:
public void decorate(World world, Random random, Chunk source) { int sourceX = (source.getX() << 4) + random.nextInt(16); int sourceZ = (source.getZ() << 4) + random.nextInt(16); int sourceY = random.nextInt(random.nextInt(type == Material.LAVA ? random.nextInt(240) + 8 : 248) + 8); Block block = world.getBlockAt(sourceX, sourceY, sourceZ); if ((block.getType() == Material.STONE || block.getType() == Material.AIR) && block.getRelative(BlockFace.DOWN).getType() == Material.STONE && block.getRelative(BlockFace.UP).getType() == Material.STONE) { int stoneBlockCount = 0; for (BlockFace face : SIDES) { if (block.getRelative(face).getType() == Material.STONE) { stoneBlockCount++; } } if (stoneBlockCount == 3) { int airBlockCount = 0; for (BlockFace face : SIDES) { if (block.getRelative(face).isEmpty()) { airBlockCount++; } } if (airBlockCount == 1) { BlockState state = block.getState(); state.setType(type); state.update(true); ((GlowWorld) block.getWorld()).requestSinglePulse((GlowBlock) block, 0); } } } }
Source:
<code>private void disableHook() { if (getWindow() != null) { return; } if (getSelectedItems() == null || getSelectedItems().size() == 0) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().confirmDisableGlusterHooks()); model.setHashName("disable_hooks"); model.setMessage(ConstantsManager.getInstance().getConstants().disableGlusterHooksMessage()); if (getSelectedItems() == null) { return; <START> } <END> ArrayList<String> list = new ArrayList<String>(); for (Object item : getSelectedItems()) { GlusterHookEntity hook = (GlusterHookEntity) item; list.add(hook.getName()); } model.setItems(list); UICommand okCommand = new UICommand("OnDisableHook", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("OnCancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }</code><technical_language>duplicate line (80)</technical_language>

Target:
private void disableHook() { if (getWindow() != null) { return; } if (getSelectedItems() == null || getSelectedItems().size() == 0) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().confirmDisableGlusterHooks()); model.setHashName("disable_hooks"); model.setMessage(ConstantsManager.getInstance().getConstants().disableGlusterHooksMessage()); ArrayList<String> list = new ArrayList<String>(); for (Object item : getSelectedItems()) { GlusterHookEntity hook = (GlusterHookEntity) item; list.add(hook.getName()); } model.setItems(list); UICommand okCommand = new UICommand("OnDisableHook", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("OnCancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }
Source:
<code>public Image pull(String name, String tag) { Objects.requireNonNull(name); Objects.requireNonNull(tag); findImage(new ImageNamePredicate(name, tag)); LOG.info(String.format("Pulling %s:%s", name, tag)); HttpRequest request = new HttpRequest(POST, "/images/create") .addQueryParameter("fromImage", name) .addQueryParameter("tag", tag); HttpResponse res = client.execute(request); if (res.getStatus() != HTTP_OK) { throw new WebDriverException("Unable to pull container: " + name); } <START> LOG.fine(String.format("Pull of %s:%s complete", name, tag)); <END> return findImage(new ImageNamePredicate(name, tag)) .orElseThrow(() -> new DockerException( String.format("Cannot find image matching: %s:%s", name, tag))); }</code><technical_language>Waiting for pull takes a long time. This message informs user of images pulled is available. Please leave</technical_language>

Target:
public Image pull(String name, String tag) { Objects.requireNonNull(name); Objects.requireNonNull(tag); findImage(new ImageNamePredicate(name, tag)); LOG.info(String.format("Pulling %s:%s", name, tag)); HttpRequest request = new HttpRequest(POST, "/images/create") .addQueryParameter("fromImage", name) .addQueryParameter("tag", tag); HttpResponse res = client.execute(request); if (res.getStatus() != HTTP_OK) { throw new WebDriverException("Unable to pull container: " + name); } LOG.info(String.format("Pull of %s:%s complete", name, tag)); return findImage(new ImageNamePredicate(name, tag)) .orElseThrow(() -> new DockerException( String.format("Cannot find image matching: %s:%s", name, tag))); }
Source:
<code>public static InFlightCache create( Config config, Monitors monitors ) { Type type = config.get( CausalClusteringSettings.in_flight_cache_type ); <START> switch ( type ) <END> { case NONE: return new VoidInFlightCache(); case CONSECUTIVE: return new ConsecutiveInFlightCache( config.get( in_flight_cache_max_entries ), config.get( in_flight_cache_max_bytes ), monitors.newMonitor( InFlightCacheMonitor.class ), false ); case UNBOUNDED: return new UnboundedInFlightCache(); default: throw new IllegalArgumentException( "Unrecognized type" ); } }</code><technical_language>This logic included in enum overridden method</technical_language>

Target:
public static InFlightCache create( Config config, Monitors monitors ) { return config.get( CausalClusteringSettings.in_flight_cache_type ).create( config, monitors ); }
Source:
<code>public static ImageService getInstance() { if (Objects.equals(instance, null)) { <START> synchronized (FilterService.class) { <END> if (Objects.equals(instance, null)) { instance = new ImageService(); } } } return instance; }</code><technical_language>synchronizing FilterService.class ImageService.class ImageService class</technical_language>

Target:
public static ImageService getInstance() { if (Objects.equals(instance, null)) { synchronized (ImageService.class) { if (Objects.equals(instance, null)) { instance = new ImageService(); } } } return instance; }
Source:
<code>void openResponse() throws IOException { final int status = HttpSupport.response(conn); if (!((status == HttpConnection.HTTP_OK) <START> || (status == HttpConnection.HTTP_MOVED_PERM) <END> || (status == HttpConnection.HTTP_MOVED_TEMP))) { throw new TransportException(uri, status + " " + conn.getResponseMessage()); } final String contentType = conn.getContentType(); if ((status == HttpConnection.HTTP_OK) && !responseType.equals(contentType)) { conn.getInputStream().close(); throw wrongContentType(responseType, contentType); } }</code><technical_language>More work done conn is a POST request opened in TransportHttp$Service.openStream() method, response handled TransportHttp.connect() method above</technical_language>

Target:
void openResponse() throws IOException { final int status = HttpSupport.response(conn); if (status != HttpConnection.HTTP_OK) { throw new TransportException(uri, status + " " + conn.getResponseMessage()); } final String contentType = conn.getContentType(); if (!responseType.equals(contentType)) { conn.getInputStream().close(); throw wrongContentType(responseType, contentType); } }
Source:
<code>public void addRecipients(ExtendedEmailPublisherContext context, EnvVars env, Set<InternetAddress> to, Set<InternetAddress> cc, Set<InternetAddress> bcc) { ExtendedEmailPublisherDescriptor descriptor = Jenkins.getInstance().getDescriptorByType(ExtendedEmailPublisherDescriptor.class); descriptor.debug(context.getListener().getLogger(), "Sending email to upstream committer(s)."); AbstractBuild<?, ?> cur; <START> Cause.UpstreamCause upc = context.getBuild().getCause(Cause.UpstreamCause.class); <END> while (upc != null) { AbstractProject<?, ?> p = (AbstractProject<?, ?>) Jenkins.getInstance().getItemByFullName(upc.getUpstreamProject()); if(p == null) break; cur = p.getBuildByNumber(upc.getUpstreamBuild()); upc = cur.getCause(Cause.UpstreamCause.class); addUpstreamCommittersTriggeringBuild(cur, to, cc, bcc, env, context.getListener()); } }</code><technical_language>spacing is</technical_language>

Target:
public void addRecipients(ExtendedEmailPublisherContext context, EnvVars env, Set<InternetAddress> to, Set<InternetAddress> cc, Set<InternetAddress> bcc) { descriptor.debug(context.getListener().getLogger(), "Sending email to upstream committer(s)."); AbstractBuild<?, ?> cur; Cause.UpstreamCause upc = context.getBuild().getCause(Cause.UpstreamCause.class); while (upc != null) { AbstractProject<?, ?> p = (AbstractProject<?, ?>) Jenkins.getInstance().getItemByFullName(upc.getUpstreamProject()); if(p == null) break; cur = p.getBuildByNumber(upc.getUpstreamBuild()); upc = cur.getCause(Cause.UpstreamCause.class); addUpstreamCommittersTriggeringBuild(cur, to, cc, bcc, env, context.getListener()); } }
Source:
<code>@Override protected void tearDown() throws Exception { long dur = System.currentTimeMillis() - ts; info(">>> Stopping test: " + testDescription() + " in " + dur + " ms <<<"); TestCounters cntrs = getTestCounters(); if (isDebug()) info("Test counters [numOfTests=" + cntrs.getNumberOfTests() + ", started=" + cntrs.getStarted() + ", stopped=" + cntrs.getStopped() + ']'); try { afterTest(); } finally { serializedObj.clear(); Exception err = null; if (isLastTest()) { info(">>> Stopping test class: " + testClassDescription() + " <<<"); TestCounters counters = getTestCounters(); GridTestUtils.stopThreads(log); getTestResources().stopThreads(); counters.setReset(true); try { afterTestsStopped(); } catch (Exception e){ err = e; } if(isSafeTopology()) stopAllGrids(false); tests.remove(getClass()); GridClassLoaderCache.clear(); U.clearClassCache(); MarshallerExclusions.clearCache(); BinaryEnumCache.clear(); } Thread.currentThread().setContextClassLoader(clsLdr); clsLdr = null; cleanReferences(); if (isLastTest()) { <START> if (err != null) <END> throw err; else if (isSafeTopology() && stopGridErr) throw new RuntimeException("Not all Ignite instances has been stopped. Please, see log for details."); } } }</code><technical_language>RuntimeException(String message, Throwable cause) constructor reduce this if-else statement. I see, nullable</technical_language>

Target:
@Override protected void tearDown() throws Exception { long dur = System.currentTimeMillis() - ts; info(">>> Stopping test: " + testDescription() + " in " + dur + " ms <<<"); TestCounters cntrs = getTestCounters(); if (isDebug()) info("Test counters [numOfTests=" + cntrs.getNumberOfTests() + ", started=" + cntrs.getStarted() + ", stopped=" + cntrs.getStopped() + ']'); try { afterTest(); } finally { serializedObj.clear(); Exception err = null; if (isLastTest()) { info(">>> Stopping test class: " + testClassDescription() + " <<<"); TestCounters counters = getTestCounters(); GridTestUtils.stopThreads(log); getTestResources().stopThreads(); counters.setReset(true); try { afterTestsStopped(); } catch (Exception e){ err = e; } if (isSafeTopology()) { stopAllGrids(false); if (stopGridErr) err = new RuntimeException("Not all Ignite instances has been stopped. " + "Please, see log for details.", err); } tests.remove(getClass()); GridClassLoaderCache.clear(); U.clearClassCache(); MarshallerExclusions.clearCache(); BinaryEnumCache.clear(); } Thread.currentThread().setContextClassLoader(clsLdr); clsLdr = null; cleanReferences(); if (err != null) throw err; } }
Source:
<code>private Function<PollResponse<CertificateOperation>, Mono<PollResponse<CertificateOperation>>> createPollOperation(String certificateName) { return prePollResponse -> { try { <START> System.out.println("Calling Polling Function"); <END> return service.getCertificateOperation(endpoint, certificateName, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .flatMap(this::processCertificateOperationResponse); } catch (HttpRequestException e) { logger.logExceptionAsError(e); return Mono.just(new PollResponse<>(PollResponse.OperationStatus.FAILED, null)); } }; }</code><technical_language>logger instead</technical_language>

Target:
private Function<PollResponse<CertificateOperation>, Mono<PollResponse<CertificateOperation>>> createPollOperation(String certificateName) { return prePollResponse -> { try { return withContext(context -> service.getCertificateOperation(endpoint, certificateName, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .flatMap(this::processCertificateOperationResponse)); } catch (HttpRequestException e) { logger.logExceptionAsError(e); return Mono.just(new PollResponse<>(PollResponse.OperationStatus.FAILED, null)); } }; }
Source:
<code>private boolean executeWithoutTransaction() { boolean functionReturnValue = false; boolean exceptionOccurred = true; try { logRunningCommand(); executeCommand(); functionReturnValue = getSucceeded(); exceptionOccurred = false; } catch <START> (EJBTransactionRolledbackException e) <END> { Throwable cause = e.getCause(); if (cause != null && cause instanceof EngineException) { processEngineException((EngineException) cause); } else { processRuntimeException(e); } } catch (EngineException e) { processEngineException(e); } catch (OpenStackResponseException e) { if (returnValue.getExecuteFailedMessages().isEmpty()) { processExceptionToClient(new EngineFault(e, EngineError.ENGINE)); } log.error("Command '{}' failed: {}", getClass().getName(), e.getMessage()); log.error("Exception", e); } catch (RuntimeException e) { processRuntimeException(e); } finally { if (!exceptionOccurred) { setCommandExecuted(); } if (exceptionOccurred || !getSucceeded()) { setSucceeded(false); compensate(); if (commandStatus == CommandStatus.ACTIVE) { setCommandStatus(noAsyncOperations() ? CommandStatus.ENDED_WITH_FAILURE : CommandStatus.EXECUTION_FAILED); } } else { ENDED_SUCCESSFULLY if the status is ACTIVE if (getReturnValue().getVdsmTaskIdList().isEmpty() && getReturnValue().getInternalVdsmTaskIdList().isEmpty() && getCallback() == null && commandStatus == CommandStatus.ACTIVE) { setCommandStatus(CommandStatus.ENDED_SUCCESSFULLY); } getCompensationContext().cleanupCompensationDataAfterSuccessfulCommand(); } } return functionReturnValue; }</code><technical_language>try simplify attempt if is EngineException OpenStackResponseException, handle such. Else, treat a RuntimeException. example in next draft</technical_language>

Target:
private boolean executeWithoutTransaction() { boolean functionReturnValue = false; boolean exceptionOccurred = true; try { logRunningCommand(); executeCommand(); functionReturnValue = getSucceeded(); exceptionOccurred = false; } catch (EngineException e) { processEngineException(e); } catch (OpenStackResponseException e) { processOpenStackException(e); } catch (RuntimeException e) { Throwable cause = e.getCause(); if (cause != null && cause instanceof EngineException) { processEngineException((EngineException) cause); } else if (cause != null && cause instanceof OpenStackResponseException) { processOpenStackException((OpenStackResponseException) cause); } else { processRuntimeException(e); } } finally { if (!exceptionOccurred) { setCommandExecuted(); } if (exceptionOccurred || !getSucceeded()) { setSucceeded(false); compensate(); if (commandStatus == CommandStatus.ACTIVE) { setCommandStatus(noAsyncOperations() ? CommandStatus.ENDED_WITH_FAILURE : CommandStatus.EXECUTION_FAILED); } } else { ENDED_SUCCESSFULLY if the status is ACTIVE if (getReturnValue().getVdsmTaskIdList().isEmpty() && getReturnValue().getInternalVdsmTaskIdList().isEmpty() && getCallback() == null && commandStatus == CommandStatus.ACTIVE) { setCommandStatus(CommandStatus.ENDED_SUCCESSFULLY); } getCompensationContext().cleanupCompensationDataAfterSuccessfulCommand(); } } return functionReturnValue; }
Source:
<code>private static String buildResolutionString(Dimension dimension) { <START> return String.format("%sx%s", dimension.width, dimension.height); <END> }</code><technical_language>I if takes this n x n string a real times/by character (**x**) instead of a crude, primitive x. I some people appreciate fine touches. Also, %s %d</technical_language>

Target:
private static String buildResolutionString(Dimension dimension) { return String.format("%dx%d", dimension.width, dimension.height); }
Source:
<code>public void removeCredentialsForCluster(String clusterName, Set<String> aliases) throws KeystoreServiceException { synchronized (this) { KeyStore ks = getCredentialStoreForCluster(clusterName); if (ks != null) { try { for (String alias : aliases) { if (ks.containsAlias(alias)) { ks.deleteEntry(alias); } <START> removeFromCache(clusterName, alias); <END> } final Path keyStoreFilePath = keyStoreDirPath.resolve(clusterName + CREDENTIALS_SUFFIX); writeKeyStoreToFile(ks, keyStoreFilePath, masterService.getMasterSecret()); } catch (KeyStoreException | IOException | CertificateException | NoSuchAlgorithmException e) { LOG.failedToRemoveCredentialForCluster(clusterName, e); } } } }</code><technical_language>Instead of invalidating entry a time bulk invalidate [invalidateAll(keys)](<LINK_0> API</technical_language>

Target:
public void removeCredentialsForCluster(String clusterName, Set<String> aliases) throws KeystoreServiceException { synchronized (this) { KeyStore ks = getCredentialStoreForCluster(clusterName); if (ks != null) { try { for (String alias : aliases) { if (ks.containsAlias(alias)) { ks.deleteEntry(alias); } } removeFromCache(clusterName, aliases); final Path keyStoreFilePath = keyStoreDirPath.resolve(clusterName + CREDENTIALS_SUFFIX); writeKeyStoreToFile(ks, keyStoreFilePath, masterService.getMasterSecret()); } catch (KeyStoreException | IOException | CertificateException | NoSuchAlgorithmException e) { LOG.failedToRemoveCredentialForCluster(clusterName, e); } } } }
Source:
<code>public void run(StreamApplication app) { try { ExecutionPlan plan = getExecutionPlan(app); List<StreamSpec> intStreams = plan.getIntermediateStreams(); if (!intStreams.isEmpty()) { if (coordination != null) { Latch initLatch = coordination.getLatch(1, LATCH_INIT); <START> coordination.getLeaderElector().tryBecomeLeader(() -> { <END> getStreamManager().createStreams(intStreams); initLatch.countDown(); }); initLatch.await(LATCH_TIMEOUT, TimeUnit.MINUTES); } else { getStreamManager().createStreams(intStreams); } } plan.getJobConfigs().forEach(jobConfig -> { log.info("Starting job StreamProcessor with config {}", jobConfig.getName(), jobConfig); Object taskFactory = TaskFactoryUtil.createTaskFactory(config, app, this); StreamProcessor processor = createStreamProcessor(jobConfig, taskFactory); processor.addLifeCycleAware(new LocalProcessorListener(processor)); processors.add(processor); processor.start(); }); appStatus = ApplicationStatus.Running; latch.await(); if (throwable.get() != null) { appStatus = ApplicationStatus.UnsuccessfulFinish; throw throwable.get(); } else { appStatus = ApplicationStatus.SuccessfulFinish; } } catch (Throwable t) { throw new SamzaException("Failed to run application", t); } finally { coordination.reset(); } }</code><technical_language>if local process failed leader? waiting for timeout? a validation check leader election phase s.t. a follower, validate streams created exit, otherwise, re-try a leader fail some retries? is this tryBecomeLeader() non-blocking</technical_language>

Target:
public void run(StreamApplication app) { try { ExecutionPlan plan = getExecutionPlan(app); createStreams(plan.getIntermediateStreams()); if (plan.getJobConfigs().isEmpty()) { throw new SamzaException("No jobs to run."); } LocalProcessorListener listener = new LocalProcessorListener(); plan.getJobConfigs().forEach(jobConfig -> { log.info("Starting job StreamProcessor with config {}", jobConfig.getName(), jobConfig); StreamProcessor processor = createStreamProcessor(jobConfig, app, listener); processor.start(); processors.add(processor); }); appStatus = ApplicationStatus.Running; awaitComplete(); } catch (Throwable t) { appStatus = ApplicationStatus.UnsuccessfulFinish; throw new SamzaException("Failed to run application", t); } finally { if (coordination != null) { coordination.reset(); } } }
Source:
<code>public String getServerType() { <START> return strings.getString("glowstone.server-type.vanilla"); <END> }</code><technical_language>I this mutable</technical_language>

Target:
public String getServerType() { return "VANILLA"; }
Source:
<code>void testRecursion() { Math f = new Math() { @Override <START> public String powerOfTwo(int n) { <END> return n == 0 ? 1 : 2 * powerOfTwo(n -1); } }; }</code><technical_language>int powerOfTwo(int n);</technical_language>

Target:
void testRecursion() { Math f = new Math() { @Override public int powerOfTwo(int n) { return n == 0 ? 1 : 2 * powerOfTwo(n -1); } }; }
Source:
<code><START> private static boolean checkDistinguishedName(final String userName) { <END> Name name = null; try { name = new LdapName(userName); } catch (final Exception e) { LOG.warn("Not a Valid Distinguished Name, setting the value from Certificate: {}", e.getLocalizedMessage()); LOG.trace("Exception checking DN: {}", e.getLocalizedMessage(), e); } return name == null ? false : true; }</code><technical_language>do need static this private method? Please update javac doc</technical_language>

Target:
private static boolean checkDistinguishedName(final String userName) { Name name = null; try { name = new LdapName(userName); } catch (final Exception e) { LOG.trace("Exception checking DN: {}", e.getLocalizedMessage(), e); } return name != null; }
Source:
<code>protected void autoLoad() { if (SessionContext.isLoggedIn() && (entryId != 0 || (className != null <START> && classPK != 0)) || (portletItemName != null && !portletItemName.equals(""))) { <END> loadAsset(); } }</code><technical_language>do comparison other</technical_language>

Target:
protected void autoLoad() { boolean hasClassName = className != null && classPK != 0; boolean hasPortletItemName = portletItemName != null && !"".equals(portletItemName); if (SessionContext.isLoggedIn() && (entryId != 0 || hasClassName || hasPortletItemName)) { loadAsset(); } }
Source:
<code>public synchronized void writeSelf(File file, long pos) { try (FileOutputStream fos = new FileOutputStream(file, true); FileChannel fc = fos.getChannel();) { fc.position(pos); try (ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeInt(ATTRIB_TREE_MAGIC_NUMBER); List<String[]> list = new ArrayList<>(attributeList.size()); String[] prevFullAttribute = null, curFullAttribute = null; for (Attribute entry : this.attributeList) { <START> curFullAttribute = (prevFullAttribute == null) ? entry.getFullAttribute() : encodeFullAttribute(prevFullAttribute, entry.getFullAttribute()); <END> list.add(curFullAttribute); prevFullAttribute = curFullAttribute; } oos.writeObject(list); } } catch (IOException e) { e.printStackTrace(); } }</code><technical_language>This { '*', '*', 'myAttrib' }</technical_language>

Target:
public synchronized void writeSelf(File file, long pos) { try (FileOutputStream fos = new FileOutputStream(file, true); FileChannel fc = fos.getChannel();) { fc.position(pos); try (ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeInt(ATTRIB_TREE_MAGIC_NUMBER); List<String[]> list = new ArrayList<>(attributeList.size()); String[] prevFullAttribute = null, curFullAttribute = null, curEncodedAttribute = null; for (Attribute entry : this.attributeList) { curFullAttribute = entry.getFullAttribute(); curEncodedAttribute = encodeFullAttribute(prevFullAttribute, entry.getFullAttribute()); list.add(curEncodedAttribute); prevFullAttribute = curFullAttribute; } oos.writeObject(list); } } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>public void sourceConfInit(FlowProcess<JobConf> flowProcess, Tap<JobConf, RecordReader, OutputCollector> tap, JobConf conf ) { if (conf.getBoolean(DelegateCombineFileInputFormat.USE_COMBINED_INPUT_FORMAT, false)) { DeprecatedInputFormatWrapper.setInputFormat(DelegateCombineFileInputFormat.class, conf); DelegateCombineFileInputFormat.setCombinedInputFormatDelegate(LzoTextInputFormat.class, conf); } else { conf.setInputFormat(DeprecatedLzoTextInputFormat.class); <START> } <END> }</code><technical_language>factor out this logic? I 5 times. Sounds a DelegateCombineFileInputFormat.setInputFormat(conf) do this logic</technical_language>

Target:
public void sourceConfInit(FlowProcess<JobConf> flowProcess, Tap<JobConf, RecordReader, OutputCollector> tap, JobConf conf ) { DelegateCombineFileInputFormat.setDelegateInputFormat(conf, LzoTextInputFormat.class); }