auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void refreshPoolsWithRegeneration(Owner owner, boolean lazy) { log.info("Refreshing pools for owner: " + owner.getKey()); List<String> subIds = subAdapter.getSubscriptionIds(owner); log.debug("Found " + subIds.size() + " existing subscriptions."); List<String> deletedSubs = new LinkedList<String>(); for (String subId : subIds) { Subscription sub = subAdapter.getSubscription(subId); if (sub == null) { deletedSubs.add(subId); log.warn("Couldn't load subscription, assuming it has been deleted: " + subId); continue; } if (isExpired(sub)) { deletedSubs.add(subId); log.info("Deleting expired subscription: " + sub); subAdapter.deleteSubscription(sub); continue; } refreshPoolsForSubscription(sub, lazy); } Pool ueberPool = this.findUeberPool(owner); String ueberPoolId = ueberPool != null ? ueberPool.getId() : null; subIds.removeAll(deletedSubs); List<Pool> poolsToDelete = new ArrayList<Pool>(); for (Pool p : poolCurator.getPoolsFromBadSubs(owner, subIds)) { if ((p.getType() == PoolType.NORMAL || p.getType() == PoolType.BONUS) && (ueberPoolId == null || !ueberPoolId.equals(p.getId()))) { poolsToDelete.add(p); } } if (!poolsToDelete.isEmpty()) { <START> deletePools(poolsToDelete); <END> } List<Pool> floatingPools = poolCurator.getOwnersFloatingPools(owner); updateFloatingPools(floatingPools, lazy); }</code><technical_language>Delete pools empty do check -- yourself, remove if here</technical_language>

Target:
void refreshPoolsWithRegeneration(Owner owner, boolean lazy) { log.info("Refreshing pools for owner: " + owner.getKey()); List<String> subIds = subAdapter.getSubscriptionIds(owner); log.debug("Found " + subIds.size() + " existing subscriptions."); List<String> deletedSubs = new LinkedList<String>(); for (String subId : subIds) { Subscription sub = subAdapter.getSubscription(subId); if (sub == null) { deletedSubs.add(subId); log.warn("Couldn't load subscription, assuming it has been deleted: " + subId); continue; } if (isExpired(sub)) { deletedSubs.add(subId); log.info("Deleting expired subscription: " + sub); subAdapter.deleteSubscription(sub); continue; } refreshPoolsForSubscription(sub, lazy); } Pool ueberPool = this.findUeberPool(owner); String ueberPoolId = ueberPool != null ? ueberPool.getId() : null; subIds.removeAll(deletedSubs); List<Pool> poolsToDelete = new ArrayList<Pool>(); for (Pool p : poolCurator.getPoolsFromBadSubs(owner, subIds)) { if ((p.getType() == PoolType.NORMAL || p.getType() == PoolType.BONUS) && (ueberPoolId == null || !ueberPoolId.equals(p.getId()))) { poolsToDelete.add(p); } } deletePools(poolsToDelete); List<Pool> floatingPools = poolCurator.getOwnersFloatingPools(owner); updateFloatingPools(floatingPools, lazy); }
Source:
<code>public void run() { if (!isComplete()) { encryptJobMetricsTracker.onJobProcessingStart(); ByteBuffer encryptedBlobContent = null; ByteBuffer encryptedUserMetadata = null; ByteBuffer encryptedKey = null; Exception exception = null; if (!isComplete()) { try { if (blobContentToEncrypt != null) { encryptedBlobContent = cryptoService.encrypt(blobContentToEncrypt, perBlobKey); } if (userMetadataToEncrypt != null) { encryptedUserMetadata = cryptoService.encrypt(userMetadataToEncrypt, perBlobKey); } Object containerKey = kms.getKey(accountId, containerId); encryptedKey = cryptoService.encryptKey(perBlobKey, containerKey); } catch (Exception e) { exception = e; } finally { encryptJobMetricsTracker.onJobProcessingComplete(); } <START> completeJob( <END> exception == null ? new EncryptJobResult(encryptedKey, encryptedBlobContent, encryptedUserMetadata) : null, exception); } } }</code><technical_language>is this moved out of finally purpose (don't a difference, curious why)</technical_language>

Target:
public void run() { if (!isComplete()) { encryptJobMetricsTracker.onJobProcessingStart(); ByteBuffer encryptedBlobContent = null; ByteBuffer encryptedUserMetadata = null; ByteBuffer encryptedKey = null; Exception exception = null; if (!isComplete()) { try { if (blobContentToEncrypt != null) { encryptedBlobContent = cryptoService.encrypt(blobContentToEncrypt, perBlobKey); } if (userMetadataToEncrypt != null) { encryptedUserMetadata = cryptoService.encrypt(userMetadataToEncrypt, perBlobKey); } Object containerKey = kms.getKey(accountId, containerId); encryptedKey = cryptoService.encryptKey(perBlobKey, containerKey); } catch (Exception e) { exception = e; } finally { encryptJobMetricsTracker.onJobProcessingComplete(); completeJob( exception == null ? new EncryptJobResult(encryptedKey, encryptedBlobContent, encryptedUserMetadata) : null, exception); } } } }
Source:
<code>private void checkInputPriorities(ExecNode<?, ?> node) { TreeMap<Integer, List<Integer>> inputPriorityGroupMap = new TreeMap<>(); Preconditions.checkState( node.getInputNodes().size() == node.getInputEdges().size(), "Number of inputs nodes does not equal to number of input edges for node " + node.getClass().getName() + ". This is a bug."); <START> for (int i = 0; i < node.getInputNodes().size(); i++) { <END> int priority = node.getInputEdges().get(i).getPriority(); inputPriorityGroupMap.computeIfAbsent(priority, k -> new ArrayList<>()).add(i); } List<List<Integer>> inputPriorityGroups = new ArrayList<>(inputPriorityGroupMap.values()); for (int i = 0; i + 1 < inputPriorityGroups.size(); i++) { List<Integer> higherGroup = inputPriorityGroups.get(i); List<Integer> lowerGroup = inputPriorityGroups.get(i + 1); for (int higher : higherGroup) { for (int lower : lowerGroup) { addTopologyEdges(node, higher, lower); } } } }</code><technical_language>nit: node.getInputEdges().size(), consistent body of for</technical_language>

Target:
private void checkInputPriorities(ExecNode<?, ?> node) { TreeMap<Integer, List<Integer>> inputPriorityGroupMap = new TreeMap<>(); Preconditions.checkState( node.getInputNodes().size() == node.getInputEdges().size(), "Number of inputs nodes does not equal to number of input edges for node " + node.getClass().getName() + ". This is a bug."); for (int i = 0; i < node.getInputEdges().size(); i++) { int priority = node.getInputEdges().get(i).getPriority(); inputPriorityGroupMap.computeIfAbsent(priority, k -> new ArrayList<>()).add(i); } List<List<Integer>> inputPriorityGroups = new ArrayList<>(inputPriorityGroupMap.values()); for (int i = 0; i + 1 < inputPriorityGroups.size(); i++) { List<Integer> higherGroup = inputPriorityGroups.get(i); List<Integer> lowerGroup = inputPriorityGroups.get(i + 1); for (int higher : higherGroup) { for (int lower : lowerGroup) { addTopologyEdges(node, higher, lower); } } } }
Source:
<code>public MulticlassMetrics (MulticlassConfusionMatrix multiclassConfusionMatrix) { this.multiclassConfusionMatrix = multiclassConfusionMatrix; double[][] matrix = multiclassConfusionMatrix.getMatrix(); double truePositive = matrix[0][0]; double falseNegative = matrix[0][1]; double falsePositive = matrix[1][0]; double trueNegative = matrix[1][1]; this.f1Score = (2 * truePositive / (2 * truePositive + falsePositive + falseNegative)); this.accuracy = ((truePositive + trueNegative) / (truePositive + trueNegative + falsePositive + falseNegative)) * 100; this.precision = (truePositive / (truePositive + falsePositive)) * 100; <START> this.recall = (truePositive / (truePositive + falseNegative)) * 100; <END> }</code><technical_language>Verify divide 0 ! Matrix values 0</technical_language>

Target:
public MulticlassMetrics (MulticlassConfusionMatrix multiclassConfusionMatrix) { this.multiclassConfusionMatrix = multiclassConfusionMatrix; double[][] matrix = multiclassConfusionMatrix.getMatrix(); double truePositive = matrix[0][0]; double falseNegative = matrix[0][1]; double falsePositive = matrix[1][0]; double trueNegative = matrix[1][1]; if (isDenominatorZero(truePositive, falsePositive, falseNegative)) { this.f1Score = 0; } else { this.f1Score = (2 * truePositive / (2 * truePositive + falsePositive + falseNegative)); } if (isDenominatorZero(truePositive, trueNegative, falsePositive, falseNegative)) { this.accuracy = 0; } else { this.accuracy = ((truePositive + trueNegative) / (truePositive + trueNegative + falsePositive + falseNegative)) * 100; } if (isDenominatorZero(truePositive, falsePositive)) { this.precision = 0; } else { this.precision = (truePositive / (truePositive + falsePositive)) * 100; } if (isDenominatorZero(truePositive, falseNegative)) { this.recall = 0; } else { this.recall = (truePositive / (truePositive + falseNegative)) * 100; } }
Source:
<code>private static File getDevServerPortFile(File npmFolder) { String threadGroup = String <START> .valueOf(Thread.currentThread().getThreadGroup().hashCode()); <END> String frontendBuildPath = npmFolder.getAbsolutePath(); String uniqueUid = UUID .nameUUIDFromBytes((threadGroup + frontendBuildPath) .getBytes(StandardCharsets.UTF_8)) .toString(); return new File(System.getProperty("java.io.tmpdir"), uniqueUid); }</code><technical_language>I understand here: thread group restart ? forced</technical_language>

Target:
private static File getDevServerPortFile(File npmFolder) { String jvmUuid = System.getProperty(WEBPACK_PORTFILE_UUID_PROPERTY); if (jvmUuid == null) { jvmUuid = UUID.randomUUID().toString(); System.setProperty(WEBPACK_PORTFILE_UUID_PROPERTY, jvmUuid); } String frontendBuildPath = npmFolder.getAbsolutePath(); String uniqueUid = UUID.nameUUIDFromBytes( (jvmUuid + frontendBuildPath).getBytes(StandardCharsets.UTF_8)) .toString(); return new File(System.getProperty("java.io.tmpdir"), uniqueUid); }
Source:
<code>protected ICommand getReparentViewCommand(IGraphicalEditPart gep) { <START> if (gep instanceof ConnectionEditPart) { <END> return EmptyExecutableCommand.INSTANCE; } return super.getReparentViewCommand(gep); }</code><technical_language>"null" work</technical_language>

Target:
protected ICommand getReparentViewCommand(IGraphicalEditPart gep) { if (gep instanceof ConnectionEditPart && gep.getParent() instanceof DiagramRootEditPart) { return null; } return super.getReparentViewCommand(gep); }
Source:
<code>public Boolean getXD_JMX_ENABLED() { <START> return (jmxEnabled != null && jmxEnabled) ? jmxEnabled : null; <END> }</code><technical_language>odd return null if explicitly set FALSE</technical_language>

Target:
public Boolean getXD_JMX_ENABLED() { return jmxEnabled; }
Source:
<code><START> private void addAllExpectedMsgs() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, <END> InvocationTargetException, InstantiationException { for (File file : inputFiles) { String fileClassName = this.getClass().getPackage().getName() + "." + file.getName().substring(0, file.getName().indexOf(".swift")); RuleTest ruleTest = (RuleTest) Class.forName(fileClassName).getConstructor().newInstance(); ruleTest.inputFile = new File(TEST_INPUT_DIR + ruleTest.getInputFilePath()); ruleTest.expectedMessages = new ArrayList<>(); ruleTest.addAllExpectedMsgs(); this.expectedMessages.addAll(ruleTest.expectedMessages); } }</code><technical_language>of Exceptions replaced java throws ReflectiveOperationException</technical_language>

Target:
private void addAllExpectedMsgs() throws ReflectiveOperationException { for (File file : inputFiles) { String fileClassName = this.getClass().getPackage().getName() + "." + file.getName().substring(0, file.getName().indexOf(".swift")); RuleTest ruleTest = (RuleTest) Class.forName(fileClassName).getConstructor().newInstance(); ruleTest.inputFile = new File(TEST_INPUT_DIR + ruleTest.getInputFilePath()); ruleTest.expectedMessages = new ArrayList<>(); ruleTest.addAllExpectedMsgs(); this.expectedMessages.addAll(ruleTest.expectedMessages); } }
Source:
<code>public void testConsumerAlreadyExistsMultipleCalls() throws Exception { final CompletableFuture<DescribeStreamSummaryResponse> dssFuture = CompletableFuture .completedFuture(createDescribeStreamSummaryResponse()); final CompletableFuture<DescribeStreamConsumerResponse> dscFuture = CompletableFuture .completedFuture(createDescribeStreamConsumerResponse(ConsumerStatus.ACTIVE)); when(client.describeStreamSummary(any(DescribeStreamSummaryRequest.class))).thenReturn(dssFuture); when(client.describeStreamConsumer(any(DescribeStreamConsumerRequest.class))).thenReturn(dscFuture); final String firstCall = consumerRegistration.getOrCreateStreamConsumerArn(); final String secondCall = consumerRegistration.getOrCreateStreamConsumerArn(); assertThat(firstCall, equalTo(CONSUMER_ARN)); assertThat(secondCall, equalTo(CONSUMER_ARN)); verify(client, times(2)).describeStreamConsumer(any(DescribeStreamConsumerRequest.class)); <START> verify(client).describeStreamSummary(any(DescribeStreamSummaryRequest.class)); <END> verify(client, never()).registerStreamConsumer(any(RegisterStreamConsumerRequest.class)); }</code><technical_language>above, This test is harder recreate existing consumer calling multiple times. Do care verifying expected increase in internal API call (.describeStreamConsumer), care do register existing consumer? Note: If this API strict TPS limits (Like DescribeStream), do care anytime this API is invoked</technical_language>

Target:
public void testConsumerAlreadyExistsMultipleCalls() throws Exception { final CompletableFuture<DescribeStreamSummaryResponse> dssFuture = CompletableFuture .completedFuture(createDescribeStreamSummaryResponse()); final CompletableFuture<DescribeStreamConsumerResponse> dscFuture = CompletableFuture .completedFuture(createDescribeStreamConsumerResponse(ConsumerStatus.ACTIVE)); when(client.describeStreamSummary(any(DescribeStreamSummaryRequest.class))).thenReturn(dssFuture); when(client.describeStreamConsumer(any(DescribeStreamConsumerRequest.class))).thenReturn(dscFuture); final String firstCall = consumerRegistration.getOrCreateStreamConsumerArn(); final String secondCall = consumerRegistration.getOrCreateStreamConsumerArn(); assertThat(firstCall, equalTo(CONSUMER_ARN)); assertThat(secondCall, equalTo(CONSUMER_ARN)); verify(client, never()).registerStreamConsumer(any(RegisterStreamConsumerRequest.class)); }
Source:
<code>public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (contentRepository != null) { AuthorizationResult authorizationResult = context.authorize(operation, ACTION_EFFECT_SET); if (authorizationResult.getDecision() == AuthorizationResult.Decision.DENY) { throw ControllerLogger.ROOT_LOGGER.unauthorized(operation.get(ModelDescriptionConstants.OP).asString(), PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)), authorizationResult.getExplanation()); } try { InputStream is = getContentInputStream(context, operation); try { byte[] hash = contentRepository.addContent(is); context.getResult().set(hash); } finally { safeClose(is); } } catch (IOException e) { <START> throw new RuntimeException(e); <END> } } context.stepCompleted(); }</code><technical_language>important, changed type of exception</technical_language>

Target:
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (contentRepository != null) { AuthorizationResult authorizationResult = context.authorize(operation, ACTION_EFFECT_SET); if (authorizationResult.getDecision() == AuthorizationResult.Decision.DENY) { throw ControllerLogger.ROOT_LOGGER.unauthorized(operation.get(ModelDescriptionConstants.OP).asString(), PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)), authorizationResult.getExplanation()); } try { InputStream is = getContentInputStream(context, operation); try { byte[] hash = contentRepository.addContent(is); context.getResult().set(hash); } finally { safeClose(is); } } catch (IOException e) { throw DEPLOYMENT_LOGGER.caughtIOExceptionUploadingContent(e); } } context.stepCompleted(); }
Source:
<code>public void testNetworks() throws Exception { assumeTrue("Docker API should be at least v1.21 to support Container Creation with " + "HostConfig, got " + sut.version().apiVersion(), compareVersion(sut.version().apiVersion(), "1.21") >= 0); assumeFalse(CIRCLECI); final String networkName = randomName(); final Ipam ipam = Ipam.builder().driver("default").config("192.168.0.0/24", "192.168.0.0/24", "192.168.0.1") .build(); final NetworkConfig networkConfig = NetworkConfig.builder().name(networkName).driver("bridge").checkDuplicate(true).ipam(ipam) .build(); final NetworkCreation networkCreation = sut.createNetwork(networkConfig); assertThat(networkCreation.id(), is(notNullValue())); assertThat(networkCreation.getWarnings(), is(nullValue())); final List<Network> networks = sut.listNetworks(); assertTrue(networks.size() > 0); Network network = null; for (Network n : networks) { if (n.name().equals(networkName)) { network = n; } } assertThat(network, is(notNullValue())); assertThat(network.id(), is(notNullValue())); assertThat(sut.inspectNetwork(network.id()).name(), is(networkName)); assertThat(network.ipam(), equalTo(ipam)); sut.removeNetwork(network.id()); <START> try { <END> sut.inspectNetwork(network.id()); fail(); } catch (NetworkNotFoundException e) { } catch (Exception e) { fail(); } }</code><technical_language>@Rule ExpectedException cleaner here? I.e. exception.expect(NetworkNotFoundException.class)</technical_language>

Target:
public void testNetworks() throws Exception { assumeTrue("Docker API should be at least v1.21 to support Container Creation with " + "HostConfig, got " + sut.version().apiVersion(), compareVersion(sut.version().apiVersion(), "1.21") >= 0); assumeFalse(CIRCLECI); final String networkName = randomName(); final Ipam ipam = Ipam.builder().driver("default").config("192.168.0.0/24", "192.168.0.0/24", "192.168.0.1") .build(); final NetworkConfig networkConfig = NetworkConfig.builder().name(networkName).driver("bridge").checkDuplicate(true).ipam(ipam) .build(); final NetworkCreation networkCreation = sut.createNetwork(networkConfig); assertThat(networkCreation.id(), is(notNullValue())); assertThat(networkCreation.warnings(), is(nullValue())); final List<Network> networks = sut.listNetworks(); assertTrue(networks.size() > 0); Network network = null; for (Network n : networks) { if (n.name().equals(networkName)) { network = n; } } assertThat(network, is(notNullValue())); assertThat(network.id(), is(notNullValue())); assertThat(sut.inspectNetwork(network.id()).name(), is(networkName)); assertThat(network.ipam(), equalTo(ipam)); sut.removeNetwork(network.id()); exception.expect(NetworkNotFoundException.class); sut.inspectNetwork(network.id()); }
Source:
<code>public Connection createConnection() throws SQLException { Connection con = null; <START> if (username != null && pass != null) { con = DriverManager.getConnection(connectionUrl, username, pass); } else { con = DriverManager.getConnection(connectionUrl); } return con; <END> }</code><technical_language>I older version checked empty string this change removes check username</technical_language>

Target:
private Connection createConnection() throws SQLException { return JDBCUtils.createConnection(connectionUrl, username, pass); }
Source:
<code>public Result loadInBackground() { try { return actOn(request.execute()); } catch (Failure failure) { if (failure.getCause() instanceof HttpRequest.HttpRequestException) { return Result.NETWORK_FAILURE; } else { <START> if (failure.getMessage().equals("")) { <END> return Result.FAILURE; } else { Result result = Result.ERROR; result.setResultMessage(failure.getMessage()); return result; } } } }</code><technical_language>Simplify please, I hate nested if/else</technical_language>

Target:
public Result loadInBackground() { try { return actOn(request.execute()); } catch (Failure failure) { return actOnFailure(failure); } }
Source:
<code>public void testSetAttribute_multiple_set() { Connection ept = new Connection(defaultConnectionDefinition); Value v = new BooleanValue(true); ept.setAttribute("v", v); <START> Value v2 = new BooleanValue(false); <END> ept.setAttribute("v", v2); }</code><technical_language>Test setting a StringValue</technical_language>

Target:
public void testSetAttribute_multiple_set() { Connection ept = new Connection(defaultConnectionDefinition); Type boolType = new BooleanType(); Value v = new BooleanValue(boolType, true); ept.setAttribute("v", v); Value v2 = new BooleanValue(boolType, false); ept.setAttribute("v", v2); }
Source:
<code>public TestingPhoenixServer() { this.conf.setInt(HConstants.MASTER_INFO_PORT, -1); this.conf.setInt(HConstants.REGIONSERVER_INFO_PORT, -1); this.conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1); this.conf.set("hbase.regionserver.wal.codec", "org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec"); this.conf.setBoolean("phoenix.schema.isNamespaceMappingEnabled", true); this.htu = new HBaseTestingUtility(conf); try { this.port = randomPort(); this.htu.startMiniZKCluster(1, port); MiniHBaseCluster hbm = htu.startMiniHBaseCluster(1, 4); hbm.waitForActiveAndReadyMaster(); LOG.info("Phoenix server ready: %s", getJdbcUrl()); } catch (Exception e) { throw new IllegalStateException("Can't start phoenix server.", e); } <START> Runtime.getRuntime().addShutdownHook(new Thread(() -> { <END> if (htu != null) { try { LOG.info("Shutting down HBase cluster."); htu.shutdownMiniHBaseCluster(); htu.shutdownMiniZKCluster(); } catch (IOException e) { Thread.currentThread().interrupt(); throw new PrestoException(SERVER_SHUTTING_DOWN, "Failed to shutdown HTU instance", e); } htu = null; } })); }</code><technical_language>instead of this add regular close() method</technical_language>

Target:
public TestingPhoenixServer() { this.conf.setInt(HConstants.MASTER_INFO_PORT, -1); this.conf.setInt(HConstants.REGIONSERVER_INFO_PORT, -1); this.conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1); this.conf.set("hbase.regionserver.wal.codec", "org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec"); this.conf.setBoolean("phoenix.schema.isNamespaceMappingEnabled", true); this.hbaseTestingUtility = new HBaseTestingUtility(conf); try { this.port = randomPort(); this.hbaseTestingUtility.startMiniZKCluster(1, port); MiniHBaseCluster hbm = hbaseTestingUtility.startMiniHBaseCluster(1, 4); hbm.waitForActiveAndReadyMaster(); LOG.info("Phoenix server ready: %s", getJdbcUrl()); } catch (Exception e) { throw new IllegalStateException("Can't start phoenix server.", e); } Runtime.getRuntime().addShutdownHook(new Thread(() -> { close(); })); }
Source:
<code><START> public String systemStreamToStreamId(SystemStream systemStream) { <END> List<String> streamIds = getStreamIdsForSystem(systemStream.getSystem()).stream() .filter(streamId -> systemStream.getStream().equals(getPhysicalName(streamId))).collect(Collectors.toList()); if (streamIds.size() > 1) { throw new IllegalStateException(String.format("There was more than one stream found for system stream %s", systemStream)); } return streamIds.isEmpty() ? null : streamIds.get(0); }</code><technical_language>this private? private before</technical_language>

Target:
private String systemStreamToStreamId(SystemStream systemStream) { List<String> streamIds = getStreamIdsForSystem(systemStream.getSystem()).stream() .filter(streamId -> systemStream.getStream().equals(getPhysicalName(streamId))).collect(Collectors.toList()); if (streamIds.size() > 1) { throw new IllegalStateException(String.format("There was more than one stream found for system stream %s", systemStream)); } return streamIds.isEmpty() ? null : streamIds.get(0); }
Source:
<code>public double getDistanceSafely() throws InvalidSensorException { <START> return super.readSensor()[0]; <END> }</code><technical_language>is CAN_SENSOR_MODE longer a constant? previously super.read(CANUltrasonicDistanceSensor.CAN_SENSOR_MODE); super.readSensor()[CANUltrasonicDistanceSensor.CAN_SENSOR_MODE];, no</technical_language>

Target:
public double getDistanceSafely() throws InvalidSensorException { return super.readSensor()[CANInfraredDistanceSensor.DISTANCE_SENSOR_ARRAY_INDEX]; }
Source:
<code>public BlockFamily createBlockFamily(BlockFamilyDefinition definition, BlockShape shape, BlockBuilderHelper blockBuilder) { <START> switch( shape.getBlockShapePlacement().getType() ) { END> case Edge: return edge.createBlockFamily(definition, shape, blockBuilder); case HorizontalSide: return horizontal.createBlockFamily(definition, shape, blockBuilder); default: return symmetric.createBlockFamily(definition, shape, blockBuilder); } }</code><technical_language>fixme here. Instead is add explict handling for cases default section. bug finding tools warn is a new constant get handled</technical_language>

Target:
public BlockFamily createBlockFamily(BlockFamilyDefinition definition, BlockShape shape, BlockBuilderHelper blockBuilder) { switch( shape.getBlockShapePlacement().getType() ) { case SIDE: return side.createBlockFamily(definition, shape, blockBuilder); case EDGE: return edge.createBlockFamily(definition, shape, blockBuilder); case CORNER: return corner.createBlockFamily(definition, shape, blockBuilder); case HORIZONTAL_SIDE: return horizontal.createBlockFamily(definition, shape, blockBuilder); case CUBE: return symmetric.createBlockFamily(definition, shape, blockBuilder); } return symmetric.createBlockFamily(definition, shape, blockBuilder); }
Source:
<code>private static Connector createTestSessionConnector() { return new Connector() { @Override public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly) { return new ConnectorTransactionHandle() {}; } @Override public ConnectorMetadata getMetadata(ConnectorTransactionHandle transaction) { <START> return new TestingConnectorMetadata(new SystemTablesMetadata(new ConnectorId("test_session_connector"), <END> new StaticSystemTablesProvider(ImmutableSet.of()))); } @Override public ConnectorSplitManager getSplitManager() { throw new UnsupportedOperationException(); } }; }</code><technical_language>do need wrap in a TestingConnectorMetadata (which do call delegated connectorMetadata)</technical_language>

Target:
private static Connector createTestSessionConnector() { return new Connector() { @Override public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly) { return new ConnectorTransactionHandle() {}; } @Override public ConnectorMetadata getMetadata(ConnectorTransactionHandle transaction) { return new SystemTablesMetadata(new ConnectorId("test_session_connector"), new StaticSystemTablesProvider(ImmutableSet.of())); } @Override public ConnectorSplitManager getSplitManager() { throw new UnsupportedOperationException(); } }; }
Source:
<code>protected void forceCommit() { log.info("Force commit after a move"); <START> final Map<TopicPartition, OffsetAndMetadata> offsets = new HashMap<>(topicPartitions.size()); <END> topicPartitions.forEach(topicPartition -> offsets.put(topicPartition, new OffsetAndMetadata(consumer.position(topicPartition)))); consumer.commitSync(offsets); offsets.forEach((topicPartition, offset) -> lastCommittedOffsets.put(topicPartition, offset.offset())); consumerMoved = false; lastOffsets.clear(); }</code><technical_language>final for local variables (noise for reader). needed for lambda compiler detect _effectively final_</technical_language>

Target:
protected void forceCommit() { log.info("Force commit after a move"); Map<TopicPartition, OffsetAndMetadata> offsets = topicPartitions.stream().collect(toMap(tp -> tp, tp -> new OffsetAndMetadata(consumer.position(tp)))); consumer.commitSync(offsets); offsets.forEach((topicPartition, offset) -> lastCommittedOffsets.put(topicPartition, offset.offset())); consumerMoved = false; lastOffsets.clear(); }
Source:
<code>private EObject getEObjectUsingURIFragmentAsId(String uriFragment) { if (isLoading) { EObject eObject = super.getEObject(uriFragment); if (eObject != null) { String fragment = EcoreUtil.getURI(eObject).fragment(); if (fragment != null) { setID(eObject, fragment); } } return eObject; } else { EObject eObject = getEObjectByID(uriFragment); <START> if (eObject == null) { eObject = super.getEObject(uriFragment); if (eObject != null) { String fragment = EcoreUtil.getURI(eObject).fragment(); if (fragment != null) { setID(eObject, fragment); return getEObject(uriFragment); } } <END> } return eObject; } }</code><technical_language>This part is duplicated part of isLoading block. duplication removed restructuring code a little</technical_language>

Target:
private EObject getEObjectUsingURIFragmentAsId(String uriFragment) { EObject eObject = null; if (isLoading) { eObject = getEObjectAndUpdateIDMap(uriFragment); } else { eObject = getEObjectByID(uriFragment); if (eObject == null) { eObject = getEObjectAndUpdateIDMap(uriFragment); } } return eObject; }
Source:
<code>public void createTable(String tableName, String... columnFamilies) throws IOException { final StringBuilder createTableBuilder = new StringBuilder(); createTableBuilder.append("create").append(" "); createTableBuilder.append(String.format("'%s'", tableName)).append(","); <START> for (final String columnFamily : columnFamilies) { createTableBuilder .append(String.format("{NAME=>'%s'}", columnFamily)) .append(","); } createTableBuilder.deleteCharAt(createTableBuilder.lastIndexOf(",")); <END> executeHBaseShell(createTableBuilder.toString()); }</code><technical_language>simplify to: createTableBuilder.append(Arrays.stream(columnFamilies) .map(cf -> String.format("{NAME=>'%s'}", cf)) .collect(Collectors.joining(",")));</technical_language>

Target:
public void createTable(String tableName, String... columnFamilies) throws IOException { final String createTable = String.format("create '%s',", tableName) + Arrays.stream(columnFamilies) .map(cf -> String.format("{NAME=>'%s'}", cf)) .collect(Collectors.joining(",")); executeHBaseShell(createTable); }
Source:
<code>public void processQualifier_useInvalidUsername_getUsernameWarning() { TurboUser user = new TurboUser(REPO, "fox", "charlie"); IModel model = TestUtils.singletonModel(new Model(REPO, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(Arrays.asList(user)))); verifyUserWarning(model, "involves:bOb", Arrays.asList(String.format( USER_WARNING_ERROR_FORMAT, "bOb", REPO))); verifyUserWarning(model, "involves:foxX", Arrays.asList(String.format( USER_WARNING_ERROR_FORMAT, "foxX", REPO))); verifyUserWarning(model, "author:alice", Arrays.asList(String.format( <START> USER_WARNING_ERROR_FORMAT, "alice", REPO))); <END> }</code><technical_language>Try line wrap higher levels of expression. e.g. java verifyUserWarning(model, "involves:bOb", Arrays.asList(String.format(USER_WARNING_ERROR_FORMAT, "bOb", REPO)));</technical_language>

Target:
public void processQualifier_useInvalidUsername_getUsernameWarning() { TurboUser user = new TurboUser(REPO, "fox", "charlie"); IModel model = TestUtils.singletonModel(createModelFromUsers(REPO, user)); verifyUserWarning(model, "involves:bOb", Arrays.asList(String.format(USER_WARNING_ERROR_FORMAT, "bOb", REPO))); verifyUserWarning(model, "involves:foxX", Arrays.asList(String.format(USER_WARNING_ERROR_FORMAT, "foxX", REPO))); verifyUserWarning(model, "author:alice", Arrays.asList(String.format(USER_WARNING_ERROR_FORMAT, "alice", REPO))); }
Source:
<code>public AssignmentMetadataStore(HelixManager helixManager) { _dataAccessor = new ZkBucketDataAccessor(helixManager.getMetadataStoreConnectionString()); _baselinePath = "/" + helixManager.getClusterName() + "/" + ASSIGNMENT_METADATA_KEY + "/" + BASELINE_KEY; <START> _bestPossiblePath = "/" + helixManager.getClusterName() + "/" + ASSIGNMENT_METADATA_KEY + "/" <END> + BEST_POSSIBLE_KEY; }</code><technical_language>a template path string String BASE_LINE = "/%s/something/%s" code is cleaner</technical_language>

Target:
AssignmentMetadataStore(HelixManager helixManager) { _dataAccessor = new ZkBucketDataAccessor(helixManager.getMetadataStoreConnectionString()); _baselinePath = String.format(BASELINE_TEMPLATE, helixManager.getClusterName(), ASSIGNMENT_METADATA_KEY); _bestPossiblePath = String.format(BEST_POSSIBLE_TEMPLATE, helixManager.getClusterName(), ASSIGNMENT_METADATA_KEY); }
Source:
<code>protected IDataSet getDataSet() throws Exception { <START> try (java.io.InputStream resourceAsStream = getClass() <END> .getClassLoader() .getResourceAsStream("dbunit/data.xml")) { return new FlatXmlDataSetBuilder().build(resourceAsStream); } }</code><technical_language>imports this</technical_language>

Target:
protected IDataSet getDataSet() throws Exception { try (InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream("dbunit/data.xml")) { return new FlatXmlDataSetBuilder().build(resourceAsStream); } }
Source:
<code>private void updateDiseaseOccurrenceFinalWeighting(DiseaseOccurrence occurrence, Set<DiseaseOccurrence> pendingSave) { double locationResolutionWeighting = occurrence.getLocation().getResolutionWeighting(); double feedWeighting = occurrence.getAlert().getFeed().getWeighting(); double diseaseGroupTypeWeighting = occurrence.getDiseaseGroup().getWeighting(); double weighting; if (locationResolutionWeighting == 0.0 || diseaseGroupTypeWeighting == 0.0) { weighting = 0.0; } else { <START> weighting = average(Arrays.asList(locationResolutionWeighting, feedWeighting, diseaseGroupTypeWeighting, <END> occurrence.getValidationWeighting())); } if (occurrence.getFinalWeighting() == null || occurrence.getFinalWeighting() != weighting) { pendingSave.add(occurrence); occurrence.setFinalWeighting(weighting); } }</code><technical_language>Nice, I thought of that</technical_language>

Target:
private void updateDiseaseOccurrenceFinalWeighting(DiseaseOccurrence occurrence, Set<DiseaseOccurrence> pendingSave) { double locationResolutionWeighting = occurrence.getLocation().getResolutionWeighting(); double feedWeighting = occurrence.getAlert().getFeed().getWeighting(); double diseaseGroupTypeWeighting = occurrence.getDiseaseGroup().getWeighting(); double weighting; if (locationResolutionWeighting == 0.0 || diseaseGroupTypeWeighting == 0.0) { weighting = 0.0; } else { weighting = (double) avg(Arrays.asList(locationResolutionWeighting, feedWeighting, diseaseGroupTypeWeighting, occurrence.getValidationWeighting())); } if (hasWeightingChanged(occurrence.getFinalWeighting(), weighting)) { pendingSave.add(occurrence); occurrence.setFinalWeighting(weighting); } }
Source:
<code>protected boolean canDoAction() { <START> boolean returnValue = checkStoragePool(); END> if (returnValue) { if (getStoragePool().getStatus() == StoragePoolStatus.Uninitialized) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL); return false; } else if (getStorageDomain() != null && getStorageDomain().getStatus() != null && getStorageDomain().getStatus() == StorageDomainStatus.Active) { addStorageDomainStatusIllegalMessage(); returnValue = false; } else if (electNewMaster(false) != null) { getReturnValue().getCanDoActionMessages().add( VdcBllMessages.STORAGE_POOL_REINITIALIZE_WITH_MORE_THAN_ONE_DATA_DOMAIN.toString()); returnValue = false; } else { StorageDomain domain = getNewMasterDomain(); if (domain.getStorageDomainSharedStatus() != StorageDomainSharedStatus.Unattached) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL); returnValue = false; } } } return returnValue && initializeVds(); }</code><technical_language>Definately of sort. worthwhile extracting a helper</technical_language>

Target:
protected boolean canDoAction() { boolean returnValue = checkStoragePool(); if (!validate(new StorageDomainValidator(getStorageDomain()).isInProcess()) || !validate(new StoragePoolValidator(getStoragePool()).isAnyDomainInProcess())) { return false; } if (returnValue) { if (getStoragePool().getStatus() == StoragePoolStatus.Uninitialized) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL); return false; } else if (getStorageDomain() != null && getStorageDomain().getStatus() != null && getStorageDomain().getStatus() == StorageDomainStatus.Active) { addStorageDomainStatusIllegalMessage(); returnValue = false; } else if (electNewMaster(false) != null) { getReturnValue().getCanDoActionMessages().add( VdcBllMessages.STORAGE_POOL_REINITIALIZE_WITH_MORE_THAN_ONE_DATA_DOMAIN.toString()); returnValue = false; } else { StorageDomain domain = getNewMasterDomain(); if (domain.getStorageDomainSharedStatus() != StorageDomainSharedStatus.Unattached) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL); returnValue = false; } } } return returnValue && initializeVds(); }
Source:
<code>public void aboutToBeShown() { this.getController().onNewLabel(new IConsumer<String>() { @Override public void apply(String value) { if (!label.isDisposed() && !(label.getText() != null && label.getText().equals(value))) { label.setText(value); } } }); this.getController().onNewHelp(new IConsumer<String>() { @Override public void apply(String value) { if (help != null && !help.isDisposed() && !(help.getText() != null && help.getText().equals(value))) { help.setToolTipText(value); } } }); this.getController().onValidation(new IConsumer<List<IValidationRuleResult>>() { @Override public void apply(List<IValidationRuleResult> validationRuleResults) { IMessageManager messageManager = page.getForm().getMessageManager(); <START> for (IValidationRuleResult validationRuleResult : validationRuleResults) { if (validationRuleResult instanceof IInvalidValidationRuleResult) { IInvalidValidationRuleResult result = (IInvalidValidationRuleResult) validationRuleResult; messageManager.addMessage(result.getValidationRule(), result.getMessage(), result.getData(), result.getSeverity(), getValidationControl()); } else { messageManager.removeMessage(validationRuleResult.getValidationRule(), getValidationControl()); } <END> } } }); }</code><technical_language>code in group lifecycle manager</technical_language>

Target:
public void aboutToBeShown() { super.aboutToBeShown(); this.getController().onNewLabel(new IConsumer<String>() { @Override public void apply(String value) { if (!label.isDisposed() && !(label.getText() != null && label.getText().equals(value))) { label.setText(value); } } }); this.getController().onNewHelp(new IConsumer<String>() { @Override public void apply(String value) { if (help != null && !help.isDisposed() && !(help.getText() != null && help.getText().equals(value))) { help.setToolTipText(value); } } }); }
Source:
<code>public boolean acceptsTurnRelation(OSMTurnRelation relation) { <START> if (relation.isVehicleTypeConcernedByTurnRestriction(restrictions)) { <END> return true; } return false; }</code><technical_language>return relation.isVehicleTypeConcernedByTurnRestriction(restrictions) (here in other encoders)</technical_language>

Target:
public boolean acceptsTurnRelation(OSMTurnRelation relation) { return relation.isVehicleTypeConcernedByTurnRestriction(restrictions); }
Source:
<code>public String toString() { return String.format("%s{table=%s}", getClass().getName(), <START> transitions.stream().map(Object::toString).collect(Collectors.joining(", "))); <END> }</code><technical_language>transitionMap group state</technical_language>

Target:
public String toString() { return String.format("%s{transitions=%s}", getClass().getName(), transitions.stream().map(Object::toString).collect(Collectors.joining(", "))); }
Source:
<code>public void refresh() { isRefreshCancelled = false; savedPagesCompleted = 0; progressDialog.show(); for (int i = 0; i < savedPages.size(); i++) { final SavedPage savedPage = savedPages.get(i); new RefreshSavedPageTask(activity, savedPage) { @Override public void onBeforeExecute() { if (isRefreshCancelled) { cancel(); return; } Log.d("Wikipedia", "refreshing start: " + savedPage.getTitle().getDisplayText()); } @Override public void onFinish(List<Section> result) { if (!progressDialog.isShowing()) { isRefreshCancelled = true; return; } savedPagesCompleted++; progressDialog.setProgress(savedPagesCompleted); Log.d("Wikipedia", "Count is " + savedPagesCompleted + " of " + savedPages.size()); if (savedPagesCompleted == savedPages.size()) { progressDialog.dismiss(); <START> FeedbackUtil.showMessage(activity, R.string.saved_pages_refresh_pages_complete); <END> } Log.d("Wikipedia", "refreshing end: " + savedPage.getTitle().getDisplayText()); } @Override public void onCatch(Throwable caught) { isRefreshCancelled = true; if (!progressDialog.isShowing()) { return; } progressDialog.dismiss(); getErrorDialog().show(); } }.execute(); } }</code><technical_language>Hmm, I end this device. needed progress dialog enough</technical_language>

Target:
public void refresh() { isRefreshCancelled = false; savedPagesCompleted = 0; progressDialog.show(); for (int i = 0; i < savedPages.size(); i++) { final SavedPage savedPage = savedPages.get(i); new RefreshSavedPageTask(context, savedPage) { @Override public void onBeforeExecute() { if (isRefreshCancelled) { cancel(); return; } Log.d("Wikipedia", "refreshing start: " + savedPage.getTitle().getDisplayText()); } @Override public void onFinish(List<Section> result) { if (!progressDialog.isShowing()) { isRefreshCancelled = true; return; } savedPagesCompleted++; progressDialog.setProgress(savedPagesCompleted); Log.d("Wikipedia", "Count is " + savedPagesCompleted + " of " + savedPages.size()); if (savedPagesCompleted == savedPages.size()) { progressDialog.dismiss(); } Log.d("Wikipedia", "refreshing end: " + savedPage.getTitle().getDisplayText()); } @Override public void onCatch(Throwable caught) { isRefreshCancelled = true; if (!progressDialog.isShowing()) { return; } progressDialog.dismiss(); getErrorDialog().show(); } }.execute(); } }
Source:
<code>public StateChange getDefaultInstance() { if (defaultInstance == null) { DisplayResolutionDependentFBOs displayResolutionDependentFBOs = CoreRegistry.get(DisplayResolutionDependentFBOs.class); <START> assert(displayResolutionDependentFBOs != null); <END> defaultInstance = new SetViewportToSizeOf(displayResolutionDependentFBOs.getGBufferPair().getWriteFbo()); } return defaultInstance; }</code><technical_language>of a sudden worried this fboManager null? is of initialized in WorldRendererImpl.initRenderGraph(). Nodes state changes exist that, I thought</technical_language>

Target:
public StateChange getDefaultInstance() { if (defaultInstance == null) { defaultInstance = new SetViewportToSizeOf(CoreRegistry.get(DisplayResolutionDependentFBOs.class).getGBufferPair().getLastUpdatedFbo()); } return defaultInstance; }
Source:
<code>private void injectImplicitUriParameters(Node node, List<String> templates) { Node parametersNode = NodeSelector.selectFrom(URI_PARAMETERS, node); if (parametersNode != null) { for (Node child : parametersNode.getChildren()) { String parameterName = ((SimpleTypeNode) ((KeyValueNode) child).getKey()).getLiteralValue(); templates.remove(parameterName.endsWith("?") ? parameterName.substring(0, parameterName.length() - 1) : parameterName); } } else if (!templates.isEmpty()) { StringNodeImpl uriParameters = new StringNodeImpl(URI_PARAMETERS); ObjectNodeImpl objectNode = new ObjectNodeImpl(); addUriParameters(templates, objectNode); node.addChild(new KeyValueNodeImpl(uriParameters, objectNode)); } <START> if (parametersNode != null && !templates.isEmpty()) <END> { addUriParameters(templates, parametersNode); } }</code><technical_language>This block of condition</technical_language>

Target:
private void injectImplicitUriParameters(Node node, List<String> templates) { Node parametersNode = NodeSelector.selectFrom(URI_PARAMETERS, node); if (parametersNode != null) { for (Node child : parametersNode.getChildren()) { String parameterName = ((SimpleTypeNode) ((KeyValueNode) child).getKey()).getLiteralValue(); templates.remove(parameterName.endsWith("?") ? parameterName.substring(0, parameterName.length() - 1) : parameterName); } if (!templates.isEmpty()) { addUriParameters(templates, parametersNode); } } else if (!templates.isEmpty()) { StringNodeImpl uriParameters = new StringNodeImpl(URI_PARAMETERS); ObjectNodeImpl objectNode = new ObjectNodeImpl(); addUriParameters(templates, objectNode); node.addChild(new KeyValueNodeImpl(uriParameters, objectNode)); } }
Source:
<code>public void cacheManagerStarting(GlobalComponentRegistry gcr, GlobalConfiguration globalConfiguration) { BasicComponentRegistry bcr = gcr.getComponent(BasicComponentRegistry.class); Interpreter interpreter = new Interpreter(); <START> bcr.registerComponent(Interpreter.class, interpreter, true); <END> if (globalConfiguration.statistics()) { try { CacheManagerJmxRegistration jmxRegistration = bcr.getComponent(CacheManagerJmxRegistration.class).running(); jmxRegistration.registerMBean(interpreter); } catch (Exception e) { log.jmxRegistrationFailed(); } } }</code><technical_language>1 interpreter is JMX now</technical_language>

Target:
public void cacheManagerStarting(GlobalComponentRegistry gcr, GlobalConfiguration globalConfiguration) { if (globalConfiguration.statistics()) { BasicComponentRegistry bcr = gcr.getComponent(BasicComponentRegistry.class); Interpreter interpreter = new Interpreter(); bcr.registerComponent(Interpreter.class, interpreter, true); try { CacheManagerJmxRegistration jmxRegistration = bcr.getComponent(CacheManagerJmxRegistration.class).running(); jmxRegistration.registerMBean(interpreter); } catch (Exception e) { throw log.jmxRegistrationFailed(e); } } }
Source:
<code>public void deleteAddress() { List<Address> addresses = selectedDomain.getAddress(); for (int i = 0; i < addresses.size(); i++) { if (addresses.get(i).getEmailAddress().equals(getEmailAddress())) { <START> addresses.remove(i); <END> } } UpdateDomain updateDomain = new UpdateDomain(); updateDomain.setDomain(selectedDomain); directService.updateDomain(updateDomain); }</code><technical_language>break out of for loop address is found</technical_language>

Target:
public void deleteAddress() { List<Address> addresses = selectedDomain.getAddress(); for (int i = 0; i < addresses.size(); i++) { if (addresses.get(i).getEmailAddress().equals(getEmailAddress())) { addresses.remove(i); break; } } UpdateDomain updateDomain = new UpdateDomain(); updateDomain.setDomain(selectedDomain); directService.updateDomain(updateDomain); }
Source:
<code>public FileSetRepository getFileSetRepository() throws Exception { if (fileSetRepository != null) { return fileSetRepository; } if (includeDependencyManagement) { includeDependencyManagement(project, artifactFactory); } DependencyResolver dependencyResolver = new DependencyResolver(project, repositorySession, resolver, system, scopes); <START> String name = (project.getName() != "") ? project.getName() : project.getArtifactId(); <END> return fileSetRepository = dependencyResolver.getFileSetRepository(name, bundles, useMavenDependencies); }</code><technical_language>I this is as: java String name = project.getName().isEmpty() ? project.getArtifactId() : project.getName();</technical_language>

Target:
public FileSetRepository getFileSetRepository() throws Exception { if (fileSetRepository != null) { return fileSetRepository; } if (includeDependencyManagement) { includeDependencyManagement(project, artifactFactory); } DependencyResolver dependencyResolver = new DependencyResolver(project, repositorySession, resolver, system, scopes); String name = project.getName() .isEmpty() ? project.getArtifactId() : project.getName(); return fileSetRepository = dependencyResolver.getFileSetRepository(name, bundles, useMavenDependencies); }
Source:
<code>protected WebRequest getWebRequest() { BroadleafRequestContext requestContext = BroadleafRequestContext.getBroadleafRequestContext(); <START> return new ServletWebRequest(requestContext.getRequest(), requestContext.getResponse()); <END> }</code><technical_language>able replace this with: java return requestContext.getWebRequest() If unset a bug somewhere</technical_language>

Target:
protected WebRequest getWebRequest() { return BroadleafRequestContext.getBroadleafRequestContext().getWebRequest(); }
Source:
<code>public static <T extends Serializable> void cleanRepoSerializable(final JpaRepository<T, Long> repo) { try { repo.deleteAllInBatch(); } catch (final Exception e) { <START> System.err.println(e); <END> } }</code><technical_language>System.err!!?? a logger instance</technical_language>

Target:
public static <T extends Serializable> void cleanRepoSerializable(final JpaRepository<T, Long> repo) { try { repo.deleteAllInBatch(); } catch (final Exception ex) { LOGGER.error(ex.getMessage()); } }