auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void process() { byte[] frame = Arrays.copyOfRange(frameBytes, 4, frameBytes.length); TTransport input = new TMemoryInputTransport(frame); FBoundedMemoryBuffer output = new FBoundedMemoryBuffer(TNatsServiceTransport.NATS_MAX_MESSAGE_SIZE); try { processor.process(inputProtoFactory.getProtocol(input), outputProtoFactory.getProtocol(output)); } catch (TException e) { LOGGER.warning("error processing frame: " + e.getMessage()); return; } if (output.length() == 0) { return; } byte[] response = new byte[output.length() + 4]; ProtocolUtils.writeInt(output.length(), response, 0); System.arraycopy(output.getArray(), 0, response, 4, output.length()); try { conn.publish(reply, response); } catch (IOException e) { LOGGER.warning("failed to send response: " + e.getMessage()); } }

Target:
private void process() { byte[] frame = Arrays.copyOfRange(frameBytes, 4, frameBytes.length); TTransport input = new TMemoryInputTransport(frame); FBoundedMemoryBuffer output = new FBoundedMemoryBuffer(TNatsServiceTransport.NATS_MAX_MESSAGE_SIZE - 4); try { processor.process(inputProtoFactory.getProtocol(input), outputProtoFactory.getProtocol(output)); } catch (TException e) { LOGGER.warning("error processing frame: " + e.getMessage()); return; } if (output.length() == 0) { return; } byte[] response = new byte[output.length() + 4]; ProtocolUtils.writeInt(output.length(), response, 0); System.arraycopy(output.getArray(), 0, response, 4, output.length()); try { conn.publish(reply, response); } catch (IOException e) { LOGGER.warning("failed to send response: " + e.getMessage()); } }
Source:
protected void executeAppliedStereotypeCommentDeletion(final TransactionalEditingDomain domain, final View commentNode) { if (null != commentNode) { if (domain != null && TransactionUtil.getEditingDomain(commentNode) == domain) { DeleteCommand command = new DeleteCommand(commentNode); try { GMFUnsafe.write(domain, command); } catch (Exception e) { Activator.log.error(e); } } } }

Target:
protected void executeAppliedStereotypeCommentDeletion(final TransactionalEditingDomain domain, final View commentNode) { if (null != commentNode) { if (null != domain && TransactionUtil.getEditingDomain(commentNode) == domain) { DeleteCommand command = new DeleteCommand(commentNode); try { GMFUnsafe.write(domain, command); } catch (Exception e) { Activator.log.error(e); } } } }
Source:
private void onWPComEmailCheckError(boolean forceWordPressComDisplay) { if (!isAdded()) { return; } if (forceWordPressComDisplay) { showSelfHostedSignInForm(); return; } if (isUsernameEmail()) { showSelfHostedSignInForm(); } else { showPasswordFieldAndFocus(); } }

Target:
private void onWPComEmailCheckError(boolean forceWordPressComDisplay) { if (!isAdded()) { return; } if (forceWordPressComDisplay) { showPasswordFieldAndFocus(); return; } if (isUsernameEmail()) { showSelfHostedSignInForm(); } else { showPasswordFieldAndFocus(); } }
Source:
private void writeDescriptor(MetricDescriptor descriptor) throws IOException { int mask = calculateDescriptorMask(descriptor); tmpDos.writeShort(mask); if ((mask & MASK_PREFIX) == 0) { tmpDos.writeInt(getDictionaryId(descriptor.prefix())); } if ((mask & MASK_METRIC) == 0) { tmpDos.writeInt(getDictionaryId(descriptor.metric())); } if ((mask & MASK_DISCRIMINATOR) == 0) { tmpDos.writeInt(getDictionaryId(descriptor.discriminator())); } if ((mask & MASK_DISCRIMINATOR_VALUE) == 0) { tmpDos.writeInt(getDictionaryId(descriptor.discriminatorValue())); } if ((mask & MASK_UNIT) == 0) { ProbeUnit unit = descriptor.unit(); if (unit != null) { tmpDos.writeByte(unit.ordinal()); } else { tmpDos.writeByte(NULL_UNIT); } } if ((mask & MASK_EXCLUDED_TARGETS) == 0) { tmpDos.writeByte(MetricTarget.bitset(descriptor.excludedTargets())); } if ((mask & MASK_TAG_COUNT) == 0) { tmpDos.writeByte(descriptor.tagCount()); } descriptor.readTags((BiConsumerEx<String, String>) (tag, tagValue) -> { tmpDos.writeInt(getDictionaryId(tag)); tmpDos.writeInt(getDictionaryId(tagValue)); }); count++; lastDescriptor = copyDescriptor(descriptor, lastDescriptor); }

Target:
private void writeDescriptor(MetricDescriptor descriptor) throws IOException { int mask = calculateDescriptorMask(descriptor); tmpDos.writeByte(mask); if ((mask & MASK_PREFIX) == 0) { tmpDos.writeInt(getDictionaryId(descriptor.prefix())); } if ((mask & MASK_METRIC) == 0) { tmpDos.writeInt(getDictionaryId(descriptor.metric())); } if ((mask & MASK_DISCRIMINATOR) == 0) { tmpDos.writeInt(getDictionaryId(descriptor.discriminator())); } if ((mask & MASK_DISCRIMINATOR_VALUE) == 0) { tmpDos.writeInt(getDictionaryId(descriptor.discriminatorValue())); } if ((mask & MASK_UNIT) == 0) { ProbeUnit unit = descriptor.unit(); if (unit != null) { tmpDos.writeByte(unit.ordinal()); } else { tmpDos.writeByte(NULL_UNIT); } } if ((mask & MASK_EXCLUDED_TARGETS) == 0) { tmpDos.writeByte(MetricTarget.bitset(descriptor.excludedTargets())); } if ((mask & MASK_TAG_COUNT) == 0) { tmpDos.writeByte(descriptor.tagCount()); } descriptor.readTags((BiConsumerEx<String, String>) (tag, tagValue) -> { tmpDos.writeInt(getDictionaryId(tag)); tmpDos.writeInt(getDictionaryId(tagValue)); }); count++; lastDescriptor = copyDescriptor(descriptor, lastDescriptor); }
Source:
private BitRateType generateBitRate(Encoding encoding) { Integer bitRate = encoding.getVideoBitRate(); if (bitRate == null) { bitRate = DEFAULT_BIT_RATE; } BitRateType bitRateType = new BitRateType(); bitRateType.setVariable(false); bitRateType.setValue(BigInteger.valueOf(bitRate)); return bitRateType; }

Target:
private BitRateType generateBitRate(Encoding encoding) { Integer bitRate = Objects.firstNonNull(encoding.getVideoBitRate(), DEFAULT_BIT_RATE); BitRateType bitRateType = new BitRateType(); bitRateType.setVariable(true); bitRateType.setValue(BigInteger.valueOf(bitRate)); return bitRateType; }
Source:
public void linkingObjects_IllegalStateException_ifDeleted() { final Realm realm = looperThread.realm; realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { final BacklinksTarget target1 = realm.createObject(BacklinksTarget.class); target1.setId(1); final BacklinksSource source = realm.createObject(BacklinksSource.class); source.setChild(target1); } }); final BacklinksTarget target = realm.where(BacklinksTarget.class) .equalTo(BacklinksTarget.FIELD_ID, 1L).findFirst(); realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { target.deleteFromRealm(); } }); assertFalse(target.isValid()); thrown.expect(IllegalStateException.class); target.getParents(); fail(); }

Target:
public void linkingObjects_IllegalStateException_ifDeleted() { final Realm realm = looperThread.realm; realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { final BacklinksTarget target = realm.createObject(BacklinksTarget.class); target.setId(1); final BacklinksSource source = realm.createObject(BacklinksSource.class); source.setChild(target); } }); final BacklinksTarget target = realm.where(BacklinksTarget.class) .equalTo(BacklinksTarget.FIELD_ID, 1L).findFirst(); realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { target.deleteFromRealm(); } }); assertFalse(target.isValid()); thrown.expect(IllegalStateException.class); target.getParents(); fail(); }
Source:
public void fetch() { if (configService.getFeedConfigs().getFeeds().size() == 0) { LOGGER.warn("No feeds to fetch."); } for (FeedConfig feedConfig : configService.getFeedConfigs().getFeeds()) { URL url; try { url = new URL(feedConfig.getUrl()); } catch (MalformedURLException e) { LOGGER.error("Invalid Atom feed URL {}", feedConfig.getUrl()); continue; } LOGGER.trace("Fetching {}", url); try { feedFetcher.retrieveFeed(url); } catch (FeedException | IOException | FetcherException e) { LOGGER.error("Error while fetching {}: {}", feedConfig.getUrl(), e.getMessage()); } } }

Target:
public void fetch() { if (configService.getFeedConfigs().getFeeds().isEmpty()) { LOGGER.warn("No feeds to fetch."); } for (FeedConfig feedConfig : configService.getFeedConfigs().getFeeds()) { URL url; try { url = new URL(feedConfig.getUrl()); } catch (MalformedURLException e) { LOGGER.error("Invalid Atom feed URL {}", feedConfig.getUrl()); continue; } LOGGER.trace("Fetching {}", url); try { feedFetcher.retrieveFeed(url); } catch (FeedException | IOException | FetcherException e) { LOGGER.error("Error while fetching {}: {}", feedConfig.getUrl(), e.getMessage()); } } }
Source:
public void createWithPrimaryKeyField_integer() { realmSchema.createWithPrimaryKeyField("FooNonNull", "pkField", int.class); RealmObjectSchema objectSchema = realmSchema.getSchemaForClass("FooNonNull"); assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.INTEGER, objectSchema.getFieldType("pkField")); assertFalse(objectSchema.isNullable("pkField")); realmSchema.createWithPrimaryKeyField("FooNull", "pkField", Integer.class); objectSchema = realmSchema.getSchemaForClass("FooNull"); assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.INTEGER, objectSchema.getFieldType("pkField")); assertTrue(objectSchema.isNullable("pkField")); }

Target:
public void createWithPrimaryKeyField_integer() { realmSchema.createWithPrimaryKeyField("FooNonNull", "pkField", int.class); RealmObjectSchema objectSchema = realmSchema.getSchemaForClass("FooNonNull"); assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.INTEGER, objectSchema.getFieldType("pkField")); assertFalse(objectSchema.isNullable("pkField")); assertTrue(objectSchema.hasIndex("pkField")); realmSchema.createWithPrimaryKeyField("FooNull", "pkField", Integer.class); objectSchema = realmSchema.getSchemaForClass("FooNull"); assertEquals("pkField", objectSchema.getPrimaryKey()); assertEquals(RealmFieldType.INTEGER, objectSchema.getFieldType("pkField")); assertTrue(objectSchema.isNullable("pkField")); assertTrue(objectSchema.hasIndex("pkField")); }
Source:
private void showStat(ILaunchConfiguration config, ILaunch launch) throws CoreException { IPath exePath = CDebugUtils.verifyProgramPath( config ); String arguments[] = getProgramArgumentsArray(config); IPath workingDir = PerfPlugin.getDefault().getWorkingDir(); File wd = workingDir.toFile(); int runCount = config.getAttribute(PerfPlugin.ATTR_StatRunCount, PerfPlugin.ATTR_StatRunCount_default); StringBuffer args = new StringBuffer(); for (String arg : arguments) { args.append(arg); args.append(" "); } String title = renderProcessLabel("Performance counter stats for " + exePath.toOSString() + " " + args.toString() + " (" + runCount + " runs)" ); @SuppressWarnings("unchecked") List<String> configEvents = config.getAttribute(PerfPlugin.ATTR_SelectedEvents, PerfPlugin.ATTR_SelectedEvents_default); String[] statEvents = new String {}; if(!config.getAttribute(PerfPlugin.ATTR_DefaultEvent, PerfPlugin.ATTR_DefaultEvent_default)){ statEvents = (configEvents == null) ? statEvents : configEvents.toArray(new String[]{}); } StatData sd = new StatData(title, wd, exePath.toOSString(), arguments, runCount, statEvents); sd.setLaunch(launch); sd.parse(); PerfPlugin.getDefault().setStatData(sd); sd.updateStatData(); StatView.refreshView(); }

Target:
private void showStat(ILaunchConfiguration config, ILaunch launch) throws CoreException { IPath exePath = CDebugUtils.verifyProgramPath( config ); String arguments[] = getProgramArgumentsArray(config); IPath workingDir = PerfPlugin.getDefault().getWorkingDir(); File wd = workingDir.toFile(); int runCount = config.getAttribute(PerfPlugin.ATTR_StatRunCount, PerfPlugin.ATTR_StatRunCount_default); StringBuffer args = new StringBuffer(); for (String arg : arguments) { args.append(arg); args.append(" "); } Object[] titleArgs = new Object[]{exePath.toOSString(), args.toString(), String.valueOf(runCount)}; String title = MessageFormat.format(Messages.PerfLaunchConfigDelegate_stat_title, titleArgs); @SuppressWarnings("unchecked") List<String> configEvents = config.getAttribute(PerfPlugin.ATTR_SelectedEvents, PerfPlugin.ATTR_SelectedEvents_default); String[] statEvents = new String {}; if(!config.getAttribute(PerfPlugin.ATTR_DefaultEvent, PerfPlugin.ATTR_DefaultEvent_default)){ statEvents = (configEvents == null) ? statEvents : configEvents.toArray(new String[]{}); } StatData sd = new StatData(title, wd, exePath.toOSString(), arguments, runCount, statEvents); sd.setLaunch(launch); sd.parse(); PerfPlugin.getDefault().setStatData(sd); sd.updateStatData(); StatView.refreshView(); }
Source:
public boolean canBePloted(World world, int x, int y, int z) { for (GhostGroupElement element : elementList) { if (!Eln.ghostManager.canCreateGhostAt(world, new BlockPos( + element.x, y + element.y, z + element.z))) return false; } return true; }

Target:
public boolean canBePloted(World world, int x, int y, int z) { for (GhostGroupElement element : elementList) { if (!Eln.ghostManager.canCreateGhostAt(world, new BlockPos( x + element.x, y + element.y, z + element.z))) return false; } return true; }
Source:
RubricStatistics(List<FeedbackResponseAttributes> responses, FeedbackRubricQuestionDetails questionDetails) { int numOfRubricSubQuestions = questionDetails.numOfRubricSubQuestions; int numOfRubricChoices = questionDetails.numOfRubricChoices; int responseTotalIndex = numOfRubricChoices; responseFrequency = new int[numOfRubricSubQuestions][numOfRubricChoices + 1]; percentageFrequencyAndAverage = new float[numOfRubricSubQuestions][numOfRubricChoices + 1]; for (FeedbackResponseAttributes response : responses) { FeedbackRubricResponseDetails frd = (FeedbackRubricResponseDetails) response.getResponseDetails(); for (int i = 0; i < numOfRubricSubQuestions; i++) { int chosenChoice = frd.getAnswer(i); if (chosenChoice != -1) { responseFrequency[i][chosenChoice] += 1; responseFrequency[i][responseTotalIndex] += 1; } } } for (int i = 0; i < percentageFrequencyAndAverage.length; i++) { int totalForSubQuestion = responseFrequency[i][responseTotalIndex]; if (totalForSubQuestion == 0) { continue; } for (int j = 0; j < numOfRubricChoices; j++) { percentageFrequencyAndAverage[i][j] = (float) responseFrequency[i][j] / totalForSubQuestion; } if (questionDetails.hasAssignedWeights) { for (int j = 0; j < numOfRubricChoices; j++) { float choiceWeight = (float) (questionDetails.rubricWeights.get(j) * percentageFrequencyAndAverage[i][j]); percentageFrequencyAndAverage[i][numOfRubricChoices] += choiceWeight; } } } }

Target:
RubricStatistics(List<FeedbackResponseAttributes> responses, FeedbackRubricQuestionDetails questionDetails) { this.responses = responses; this.questionDetails = questionDetails; this.numOfRubricSubQuestions = questionDetails.numOfRubricSubQuestions; this.numOfRubricChoices = questionDetails.numOfRubricChoices; this.responseTotalIndex = numOfRubricChoices; calculateResponseFrequency(); calculatePercentageFrequencyAndAverage(); }
Source:
public void spec104_mustSignalOnErrorWhenFails_shouldBeSkippedWhenNoErrorPublisherGiven() throws Throwable { requireTestSkip(new ThrowingRunnable() { @Override public void run() throws Throwable { noopPublisherVerification().spec104_mustSignalOnErrorWhenFails(); } }, "Skipping because no error state Publisher provided, and the test requires it. Please implement PublisherVerification#createErrorStatePublisher to run this test."); }

Target:
public void spec104_mustSignalOnErrorWhenFails_shouldBeSkippedWhenNoErrorPublisherGiven() throws Throwable { requireTestSkip(new ThrowingRunnable() { @Override public void run() throws Throwable { noopPublisherVerification().spec104_mustSignalOnErrorWhenFails(); } }, PublisherVerification.SKIPPING_NO_ERROR_PUBLISHER_AVAILABLE); }
Source:
private NetcdfFileWriteable createFileWith2DCharVariable(String[] data) throws IOException, InvalidRangeException { File tempFile = File.createTempFile("test", ".nc"); try { NetcdfFileWriteable ncfile = NetcdfFileWriteable.createNew(tempFile.getAbsolutePath(), false); Dimension dim1 = ncfile.addDimension("dim1", data.length); Dimension dim2 = ncfile.addDimension("dim2", calcMaxLength(data)); ArrayList<Dimension> dimensions = new ArrayList<Dimension>(); dimensions.add(dim1); dimensions.add(dim2); ncfile.addVariable("variable", DataType.CHAR, dimensions); ncfile.create(); ArrayChar dataArray = new ArrayChar.D2(dim1.getLength(), dim2.getLength()); for (int i=0; i<data.length; i++) { dataArray.setString(i, data[i]); } ncfile.write("variable", dataArray); ncfile.flush(); return ncfile; } finally { ; } }

Target:
private NetcdfFileWriteable createFileWith2DCharVariable(String[] data) throws IOException { File tempFile = File.createTempFile("test", ".nc"); try { NetcdfFileWriteable ncfile = NetcdfFileWriteable.createNew(tempFile.getAbsolutePath(), false); Dimension dim1 = ncfile.addDimension("dim1", data.length); Dimension dim2 = ncfile.addDimension("dim2", calcMaxLength(data)); ArrayList<Dimension> dimensions = new ArrayList<Dimension>(); dimensions.add(dim1); dimensions.add(dim2); ncfile.addVariable("variable", DataType.CHAR, dimensions); ncfile.create(); ArrayChar dataArray = new ArrayChar.D2(dim1.getLength(), dim2.getLength()); for (int i=0; i < data.length; i++) { dataArray.setString(i, data[i]); } ncfile.write("variable", dataArray); ncfile.flush(); return ncfile; } catch (Exception e) { tempFile.delete(); throw new RuntimeException(e); } }
Source:
protected void createCacheManagers() throws Throwable { createCluster(new ConfigurationBuilder(), 2); timeService = new ControlledTimeService(); ConfigurationBuilder replConfig = new ConfigurationBuilder(); replConfig.clustering().cacheMode(CacheMode.REPL_SYNC).hash().numSegments(4); for (EmbeddedCacheManager manager : managers()) { TestingUtil.replaceComponent(manager, TimeService.class, timeService, true); manager.defineConfiguration(CACHE_NAME, replConfig.build()); } }

Target:
protected void createCacheManagers() throws Throwable { createCluster(new ConfigurationBuilder(), 2); timeService = new ControlledTimeService(); ConfigurationBuilder replConfig = new ConfigurationBuilder(); replConfig.clustering().cacheMode(cacheMode).hash().numSegments(4); for (EmbeddedCacheManager manager : managers()) { TestingUtil.replaceComponent(manager, TimeService.class, timeService, true); manager.defineConfiguration(CACHE_NAME, replConfig.build()); } }
Source:
public MongoDbMetadataStore(MongoTemplate template) { this(template, null); }

Target:
public MongoDbMetadataStore(MongoTemplate template) { this(template, DEFAULT_COLLECTION_NAME); }
Source:
public void upgradeClusterRuntime(Set<ClusterComponent> components, boolean patchUpgrade) throws CloudbreakException { try { ClustersResourceApi clustersResourceApi = clouderaManagerApiFactory.getClustersResourceApi(apiClient); ParcelResourceApi parcelResourceApi = clouderaManagerApiFactory.getParcelResourceApi(apiClient); MgmtServiceResourceApi mgmtServiceResourceApi = clouderaManagerApiFactory.getMgmtServiceResourceApi(apiClient); ClouderaManagerResourceApi clouderaManagerResourceApi = clouderaManagerApiFactory.getClouderaManagerResourceApi(apiClient); startClouderaManager(); checkParcelApiAvailability(); Set<ClouderaManagerProduct> services = getServices(components); ClouderaManagerProduct cdhService = getCdhService(services); setParcelRepo(services, clouderaManagerResourceApi); refreshParcelRepos(clouderaManagerResourceApi); if (patchUpgrade) { installServices(services, parcelResourceApi); restartServices(clustersResourceApi); } else { upgradeNonCdhServices(services, cdhService.getName(), parcelResourceApi); upgradeCdh(clustersResourceApi, parcelResourceApi, cdhService); restartStaleServices(mgmtServiceResourceApi, clustersResourceApi); } removeUnusedParcels(components); configService.enableKnoxAutorestartIfCmVersionAtLeast(CLOUDERAMANAGER_VERSION_7_1_0, apiClient, stack.getName()); } catch (ApiException e) { LOGGER.info("Could not upgrade Cloudera Runtime services", e); throw new ClouderaManagerOperationFailedException(e.getMessage(), e); } }

Target:
public void upgradeClusterRuntime(Set<ClusterComponent> components, boolean patchUpgrade) throws CloudbreakException { try { LOGGER.info("Starting to upgrade cluster runtimes. Patch upgrade: {}", patchUpgrade); ClustersResourceApi clustersResourceApi = clouderaManagerApiFactory.getClustersResourceApi(apiClient); ParcelResourceApi parcelResourceApi = clouderaManagerApiFactory.getParcelResourceApi(apiClient); ClouderaManagerResourceApi clouderaManagerResourceApi = clouderaManagerApiFactory.getClouderaManagerResourceApi(apiClient); startClouderaManager(); checkParcelApiAvailability(); Set<ClouderaManagerProduct> products = getProducts(components); setParcelRepo(products, clouderaManagerResourceApi); refreshParcelRepos(clouderaManagerResourceApi); if (patchUpgrade) { downloadAndActivateParcels(products, parcelResourceApi); restartServices(clustersResourceApi); } else { ClouderaManagerProduct cdhProduct = getCdhProducts(products); upgradeNonCdhProducts(products, cdhProduct.getName(), parcelResourceApi); upgradeCdh(clustersResourceApi, parcelResourceApi, cdhProduct); restartStaleServices(clustersResourceApi); } removeUnusedParcelVersions(parcelResourceApi, products); configService.enableKnoxAutorestartIfCmVersionAtLeast(CLOUDERAMANAGER_VERSION_7_1_0, apiClient, stack.getName()); LOGGER.info("Cluster runtime upgrade finished"); } catch (ApiException e) { LOGGER.info("Could not upgrade Cloudera Runtime services", e); throw new ClouderaManagerOperationFailedException(e.getMessage(), e); } }
Source:
protected void syncSearch() { if (getEntity() == null) { return; } super.syncSearch(); IdQueryParameters tempVar = new IdQueryParameters(getEntity().getId()); tempVar.setRefresh(getIsQueryFirstTime()); Frontend.getInstance().runQuery(QueryType.GetAllNetworksByClusterId, tempVar, new AsyncQuery<>((AsyncCallback<QueryReturnValue>) returnValue -> { final List<Network> newItems = returnValue.getReturnValue(); Collections.sort(newItems, Comparator.comparing((Network n) -> n.getCluster().isManagement()).reversed() .thenComparing(Network::getName, new LexoNumericComparator()) ); for (Network network : newItems) { network.getCluster().setId(new NetworkClusterId(tempVar.getId(), network.getId())); } setItems(newItems); })); }

Target:
protected void syncSearch() { if (getEntity() == null) { return; } super.syncSearch(); Guid clusterId = getEntity().getId(); IdQueryParameters tempVar = new IdQueryParameters(clusterId); tempVar.setRefresh(getIsQueryFirstTime()); Frontend.getInstance().runQuery(QueryType.GetAllNetworksByClusterId, tempVar, new AsyncQuery<>((AsyncCallback<QueryReturnValue>) returnValue -> { final List<Network> newItems = returnValue.getReturnValue(); Collections.sort(newItems, Comparator.comparing((Network n) -> n.getCluster().isManagement()).reversed() .thenComparing(Network::getName, new LexoNumericComparator()) ); for (Network network : newItems) { network.getCluster().setId(new NetworkClusterId(clusterId, network.getId())); } setItems(newItems); })); }
Source:
public BootstrapEvent next() { if (!databaseEventProcessed) { FSDatabaseEvent event = new FSDatabaseEvent(hiveConf, next.toString()); databaseEventProcessed = true; return postProcessing(event); } if (replicationState != null) { return eventForReplicationState(); } String currentPath = next.toString(); if (currentPath.contains(Path.SEPARATOR + FUNCTIONS_ROOT_DIR_NAME)) { LOG.debug("functions directory: {}", next.toString()); return postProcessing(new FSFunctionEvent(next)); } return postProcessing(new FSTableEvent(hiveConf, next.toString())); }

Target:
public BootstrapEvent next() { if (!databaseEventProcessed) { FSDatabaseEvent event = new FSDatabaseEvent(hiveConf, next.toString()); databaseEventProcessed = true; return postProcessing(event); } if (replicationState != null) { return eventForReplicationState(); } String currentPath = next.toString(); if (currentPath.contains(Path.SEPARATOR + FUNCTIONS_ROOT_DIR_NAME + Path.SEPARATOR)) { LOG.debug("functions directory: {}", next.toString()); return postProcessing(new FSFunctionEvent(next)); } return postProcessing(new FSTableEvent(hiveConf, next.toString())); }
Source:
protected Service createService(GatewayServices gatewayServices, ServiceType serviceType, GatewayConfig gatewayConfig, Map<String, String> options, String implementation) throws ServiceLifecycleException { Service service = null; if (shouldCreateService(implementation)) { final AliasService defaultAliasService = new DefaultAliasService(); ((DefaultAliasService) defaultAliasService).setMasterService(getMasterService(gatewayServices)); ((DefaultAliasService) defaultAliasService).setKeystoreService(getKeystoreService(gatewayServices)); defaultAliasService.init(gatewayConfig, options); cacheService(serviceType, EMPTY_DEFAULT_IMPLEMENTATION, defaultAliasService); if (matchesImplementation(implementation, DefaultAliasService.class, true)) { service = defaultAliasService; } else if (matchesImplementation(implementation, HashicorpVaultAliasService.class)) { service = new HashicorpVaultAliasService(defaultAliasService); } else if (matchesImplementation(implementation, RemoteAliasService.class)) { service = new RemoteAliasService(defaultAliasService, getMasterService(gatewayServices)); } else if (matchesImplementation(implementation, ZookeeperRemoteAliasService.class)) { final boolean useLocalAliasService = options == null ? true : Boolean.valueOf(options.getOrDefault(USE_LOCAL_ALIAS_IN_ZK_IMPL_PARAM_NAME, "true")); service = new ZookeeperRemoteAliasServiceProvider().newInstance(useLocalAliasService ? defaultAliasService : null, getMasterService(gatewayServices)); } logServiceUsage(implementation, serviceType); } return service; }

Target:
protected Service createService(GatewayServices gatewayServices, ServiceType serviceType, GatewayConfig gatewayConfig, Map<String, String> options, String implementation) throws ServiceLifecycleException { Service service = null; if (shouldCreateService(implementation)) { final AliasService defaultAliasService = new DefaultAliasService(); ((DefaultAliasService) defaultAliasService).setMasterService(getMasterService(gatewayServices)); ((DefaultAliasService) defaultAliasService).setKeystoreService(getKeystoreService(gatewayServices)); defaultAliasService.init(gatewayConfig, options); if (matchesImplementation(implementation, DefaultAliasService.class, true)) { service = defaultAliasService; } else if (matchesImplementation(implementation, HashicorpVaultAliasService.class)) { service = new HashicorpVaultAliasService(defaultAliasService); } else if (matchesImplementation(implementation, RemoteAliasService.class)) { service = new RemoteAliasService(defaultAliasService, getMasterService(gatewayServices)); } else if (matchesImplementation(implementation, ZookeeperRemoteAliasService.class)) { service = new ZookeeperRemoteAliasServiceProvider().newInstance(gatewayServices, defaultAliasService, getMasterService(gatewayServices)); } logServiceUsage(implementation, serviceType); } return service; }
Source:
private int parseDetails(BufferedReader in, GCModel model, ParseInformation pos, int lineNumber, GCEvent event, String beginningOfLine) throws IOException { Matcher memoryMatcher = PATTERN_MEMORY.matcher(""); pos.setIndex(0); boolean isInDetailedEvent = true; String line; while (isInDetailedEvent && (line = in.readLine()) != null) { ++lineNumber; pos.setLineNumber(lineNumber); pos.setIndex(0); if (line.length() == 0) { continue; } if (beginningOfLine != null) { line = beginningOfLine + line; beginningOfLine = null; model.add(parseLine(line, pos)); continue; } if (line.indexOf("Eden") >= 0) { parseMemoryDetails(event, line, pos); } else if (line.charAt(0) != ' ' && !hasTimes && (nextIsDatestamp(line, pos) || nextIsTimestamp(line, pos))) { model.add(parseLine(line, pos)); isInDetailedEvent = false; } else if (line.indexOf(INCOMPLETE_CONCURRENT_EVENT_INDICATOR) >= 0) { parseIncompleteConcurrentEvent(model, event, line, pos); } else { memoryMatcher.reset(line); if (memoryMatcher.matches()) { setMemoryExtended(event, line, pos); } } if (line.indexOf(TIMES) >= 0) { isInDetailedEvent = false; hasTimes = true; } } if (event.getTotal() == 0) { if (LOG.isLoggable(Level.FINE)) LOG.fine("line " + lineNumber + ": no memory information found (" + event.toString() + ")"); } model.add(event); return lineNumber; }

Target:
private int parseDetails(BufferedReader in, GCModel model, ParseInformation pos, int lineNumber, GCEvent event, String beginningOfLine) throws ParseException, IOException { Matcher memoryMatcher = PATTERN_MEMORY.matcher(""); pos.setIndex(0); boolean isInDetailedEvent = true; String line; while (isInDetailedEvent && (line = in.readLine()) != null) { ++lineNumber; pos.setLineNumber(lineNumber); pos.setIndex(0); if (line.length() == 0) { continue; } if (beginningOfLine != null) { line = beginningOfLine + line; beginningOfLine = null; model.add(parseLine(line, pos)); continue; } if (line.indexOf("Eden") >= 0) { parseMemoryDetails(event, line, pos); } else if (line.charAt(0) != ' ' && !hasTimes && (nextIsDatestamp(line, pos) || nextIsTimestamp(line, pos))) { model.add(parseLine(line, pos)); isInDetailedEvent = false; } else if (line.indexOf(INCOMPLETE_CONCURRENT_EVENT_INDICATOR) >= 0) { parseIncompleteConcurrentEvent(model, event, line, pos); } else { memoryMatcher.reset(line); if (memoryMatcher.matches()) { setMemoryExtended(event, line, pos); } } if (line.indexOf(TIMES) >= 0) { isInDetailedEvent = false; hasTimes = true; } } if (event.getTotal() == 0) { if (LOG.isLoggable(Level.FINE)) LOG.fine("line " + lineNumber + ": no memory information found (" + event.toString() + ")"); } model.add(event); return lineNumber; }
Source:
public UMLDiffExtensionPostProcessor() { super(null, null); }

Target:
public UMLDiffExtensionPostProcessor() { super(Pattern.compile("<LINK_0>\\d.\\d.\\d/UML"), null); }
Source:
public int onStartCommand(Intent intent, int flags, int startId) { if (intent != null) { if (intent.getExtras() != null) { if (null != intent.getExtras().getString(EXTRA_GEOCODE)) { int listId = intent.getIntExtra(EXTRA_LIST_ID, StoredList.STANDARD_LIST_ID); QueueItem item = new QueueItem(intent.getExtras().getString(EXTRA_GEOCODE), startId, listId, intent.getExtras().containsKey(EXTRA_REFRESH) ? OperationType.REFRESH : OperationType.STORE); try { if (!queue.contains(item)) { queue.put(item); ActivityMixin.showShortToast(this, (getString(R.string.download_service_queued_cache, item.geocode))); notifyChanges(); } } catch (InterruptedException e) { e.printStackTrace(); } if (!downloadTaskRunning) { downloadTaskRunning = true; new DownloadCachesTask().execute(); } } } } return START_STICKY; }

Target:
public int onStartCommand(Intent intent, int flags, int startId) { if (intent == null) { return START_NOT_STICKY; } if (!intent.hasExtra(EXTRA_GEOCODE)) { return START_NOT_STICKY; } int listId = intent.getIntExtra(EXTRA_LIST_ID, StoredList.STANDARD_LIST_ID); QueueItem item = new QueueItem(intent.getStringExtra(EXTRA_GEOCODE), startId, listId, intent.hasExtra(EXTRA_REFRESH) ? OperationType.REFRESH : OperationType.STORE); if (intent.hasExtra(EXTRA_PRIORITY)) { item.setMaxPriority(); } synchronized (queue) { if (!queue.contains(item)) { queue.put(item); if (item.priority) { queue.put(item.getGhostInstance()); } if (lastCacheAdded + 1000 < System.currentTimeMillis()) { ActivityMixin.showShortToast(this, (getString(R.string.download_service_queued_cache, item.geocode))); lastCacheAdded = System.currentTimeMillis(); } notifyChanges(); } if (!downloadTaskRunning) { downloadTaskRunning = true; new DownloadCachesTask().execute(); } } return START_STICKY; }
Source:
public Observable<List<Product>> getProducts(final int page, final Long collectionId, final Set<String> tags, final Collection.SortOrder sortOrder) { if (page < 1) { throw new IllegalArgumentException("page is a 1-based index, value cannot be less than 1"); } if (collectionId == null) { throw new NullPointerException("collectionId cannot be null"); } final String sortOrderStr = sortOrder != null ? sortOrder.toString() : Collection.SortOrder.COLLECTION_DEFAULT.toString(); final String tagsQueryStr = tags != null && !tags.isEmpty() ? TextUtils.join(",", tags.toArray()) : null; return retrofitService .getProducts(appId, collectionId, tagsQueryStr, sortOrderStr, page, pageSize) .retryWhen(networkRetryPolicyProvider.provide()) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>()) .compose(new UnwrapRetrofitBodyTransformer<ProductListings, List<Product>>()) .onErrorResumeNext(new BuyClientExceptionHandler<List<Product>>()) .observeOn(callbackScheduler); }

Target:
public Observable<List<Product>> getProducts(final int page, final Long collectionId, final Set<String> tags, final Collection.SortOrder sortOrder) { if (page < 1) { throw new IllegalArgumentException("page is a 1-based index, value cannot be less than 1"); } if (collectionId == null) { throw new NullPointerException("collectionId cannot be null"); } final String sortOrderStr = sortOrder != null ? sortOrder.toString() : Collection.SortOrder.COLLECTION_DEFAULT.toString(); final String tagsQueryStr = formatQueryString(tags); return retrofitService .getProducts(appId, collectionId, tagsQueryStr, sortOrderStr, page, pageSize) .retryWhen(networkRetryPolicyProvider.provide()) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>()) .compose(new UnwrapRetrofitBodyTransformer<ProductListings, List<Product>>()) .onErrorResumeNext(new BuyClientExceptionHandler<List<Product>>()) .observeOn(callbackScheduler); }
Source:
public DatabaseStack(Network network, DatabaseServer databaseServer, Tags tags, String template) { this.network = network; this.databaseServer = databaseServer; this.tags = tags; this.template = template; }

Target:
public DatabaseStack(Network network, DatabaseServer databaseServer, Tags tags, String template) { this.network = network; this.databaseServer = databaseServer; this.tags = new Tags(tags); this.template = template; }
Source:
protected void updateNetworkChangability() { super.updateNetworkChangability(); if (!getNetwork().getIsChangable()) { return; } boolean isPlugged = isPluggedBeforeAndAfterEdit(); boolean isPortMirroring = (Boolean) getPortMirroring().getEntity(); if (isVmUp() && isPlugged) { if (!hotUpdateSupported) { getNetwork().setChangeProhibitionReason(ConstantsManager.getInstance() .getMessages() .hotNetworkUpdateNotSupported(getClusterCompatibilityVersion().toString())); } else if (selectedNetworkExternal()) { getNetwork().setChangeProhibitionReason(ConstantsManager.getInstance() .getConstants() .hotNetworkUpdateNotSupportedExternalNetworks()); } else if (isPortMirroring) { getNetwork().setChangeProhibitionReason(ConstantsManager.getInstance() .getConstants() .hotNetworkUpdateNotSupportedWithPortMirroring()); } else { return; } getNetwork().setIsChangable(false); } }

Target:
protected void updateNetworkChangability() { super.updateNetworkChangability(); if (!getNetwork().getIsChangable()) { return; } boolean isPlugged = isPluggedBeforeAndAfterEdit(); boolean isPortMirroring = (Boolean) getPortMirroring().getEntity(); if (isVmUp() && isPlugged) { if (!hotUpdateSupported) { getNetwork().setChangeProhibitionReason(ConstantsManager.getInstance() .getMessages() .hotNetworkUpdateNotSupported(getClusterCompatibilityVersion().toString())); } else if (selectedNetworkExternal()) { getNetwork().setChangeProhibitionReason(ConstantsManager.getInstance() .getConstants() .hotNetworkUpdateNotSupportedExternalNetworks()); } else if (isPortMirroring) { getNetwork().setChangeProhibitionReason(ConstantsManager.getInstance() .getConstants() .hotNetworkUpdateNotSupportedWithPortMirroring()); } else { return; } getNetwork().setIsChangable(false); getNetworkBehavior().initSelectedNetwork(getNetwork(), getNic()); } }
Source:
boolean replaceQuerySource(QueryTaskSource taskSource) throws Exception { QueryTaskSourceOption option = taskSource.getSelectedSource(); taskSource.reset(); if (option == null) { return false; } QueryTaskSourceOption newOption = meshQueryMaster.getReplacementQueryTaskOption(option.queryReference); for (int i = 0; i < taskSource.options.length; i++) { if (taskSource.options[i] == option) { taskSource.options[i] = newOption; } } return newOption.tryActivate(meshy, queryOptions); }

Target:
boolean replaceQuerySource(QueryTaskSource taskSource) throws Exception { QueryTaskSourceOption option = taskSource.getSelectedSource(); taskSource.reset(); QueryTaskSourceOption newOption = meshQueryMaster.getReplacementQueryTaskOption(option.queryReference); for (int i = 0; i < taskSource.options.length; i++) { if (taskSource.options[i] == option) { taskSource.options[i] = newOption; } } return newOption.tryActivate(meshy, queryOptions); }
Source:
public static long binToLong(String bits, boolean unsignd) throws IrregularStringOfBitsException { if ((bits.length() > 64) || (unsignd && bits.length() == 64 && bits.charAt(0) == '1') || !isBinaryString(bits)) { throw new IrregularStringOfBitsException(); } if (!unsignd && bits.length() == 64 && isOverflow(bits)) { return (long)(-Math.pow(2.0, 63.0)); } if (bits.length() == 0) { return 0; } if (unsignd) { return getUnsignedLongValue(bits); } else { if (bits.charAt(0) == '0') { return Converter.binToLong(bits.substring(1), true); } else { String s = Converter.twoComplement(bits); return -1 * Converter.binToLong(s, true); } } }

Target:
public static long binToLong(String bits, boolean unsignd) throws IrregularStringOfBitsException { if ((bits.length() > 64) || (unsignd && bits.length() == 64 && bits.charAt(0) == '1') || !isBinaryString(bits)) { throw new IrregularStringOfBitsException(); } if (!unsignd && bits.length() == 64 && isOverflow(bits)) { return OVERFLOW_64; } if (bits.length() == 0) { return 0; } if (unsignd) { return getUnsignedLongValue(bits); } else { if (bits.charAt(0) == '0') { return Converter.binToLong(bits.substring(1), true); } else { String s = Converter.twoComplement(bits); return -1 * Converter.binToLong(s, true); } } }
Source:
public Builder error(GraphQLError error) { return errors(Collections.singletonList(assertNotNull(error))); }

Target:
public Builder error(GraphQLError error) { errors.add(assertNotNull(error)); return this; }
Source:
public boolean prepareConnectHostToStoragePoolServers(ConnectHostToStoragePoolServersParameters parameters, List<StorageServerConnections> connections) { List<StorageServerConnections> res = updateIfaces(connections, parameters.getVds().getId()); connections.clear(); connections.addAll(res); return true; }

Target:
public void prepareConnectHostToStoragePoolServers(ConnectHostToStoragePoolServersParameters parameters, List<StorageServerConnections> connections) { List<StorageServerConnections> res = updateIfaces(connections, parameters.getVds().getId()); connections.clear(); connections.addAll(res); }
Source:
public void authenticateWhenInvalidDestinationThenThrowAuthenticationException() { this.exception.expect(authenticationMatcher(Saml2ErrorCodes.INVALID_DESTINATION)); Response response = TestOpenSamlObjects.response(DESTINATION + "invalid", ASSERTING_PARTY_ENTITY_ID); response.getAssertions().add(TestOpenSamlObjects.assertion()); TestOpenSamlObjects.signed(response, TestSaml2X509Credentials.assertingPartySigningCredential(), RELYING_PARTY_ENTITY_ID, SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256); Saml2AuthenticationToken token = token(response, TestSaml2X509Credentials.relyingPartyVerifyingCredential()); this.provider.authenticate(token); }

Target:
public void authenticateWhenInvalidDestinationThenThrowAuthenticationException() { Response response = TestOpenSamlObjects.response(DESTINATION + "invalid", ASSERTING_PARTY_ENTITY_ID); response.getAssertions().add(TestOpenSamlObjects.assertion()); TestOpenSamlObjects.signed(response, TestSaml2X509Credentials.assertingPartySigningCredential(), RELYING_PARTY_ENTITY_ID); Saml2AuthenticationToken token = token(response, verifying(registration())); assertThatExceptionOfType(Saml2AuthenticationException.class) .isThrownBy(() -> this.provider.authenticate(token)) .satisfies(errorOf(Saml2ErrorCodes.INVALID_DESTINATION)); }
Source:
private boolean sendMessageIfNeeded(Message message, Optional<Topic> topic, String contextName) { if (topic.isPresent() && isNotStale(message)) { sendMessage(message, topic.get()); return true; } else { logger.warn("Not stale message {}", contextName, message.getId(), topic.get().getQualifiedName(), new String(message.getData(), Charset.defaultCharset())); return true; } }

Target:
private boolean sendMessageIfNeeded(Message message, Optional<Topic> topic, String contextName) { if (topic.isPresent() && isNotStale(message)) { sendMessage(message, topic.get()); return true; } else { logger.warn("Not stale message {}", contextName, message.getId(), topic.get().getQualifiedName(), new String(message.getData(), Charset.defaultCharset())); return false; } }
Source:
@Test public void configRoundtrip() throws Exception { Folder d = r.jenkins.createProject(Folder.class, "d"); r.configRoundtrip(d); assertNull(d.getProperties().get(JiraFolderProperty.class)); List<JiraSite> list = new ArrayList<>(); list.add(new JiraSite("<LINK_1>")); JiraFolderProperty foo = new JiraFolderProperty(); foo.setSites(list); foo.setSites(new JiraSite("<LINK_0>")); d.getProperties().add(foo); r.configRoundtrip(d); JiraFolderProperty prop = d.getProperties().get(JiraFolderProperty.class); assertNotNull(prop); List<JiraSite> actual = prop.getSites(); r.assertEqualDataBoundBeans(list, actual); }

Target:
public void configRoundtrip() throws Exception { Folder d = r.jenkins.createProject(Folder.class, "d"); r.configRoundtrip(d); assertNull(d.getProperties().get(JiraFolderProperty.class)); List<JiraSite> list = new ArrayList<>(); list.add(new JiraSite("<LINK_1>")); JiraFolderProperty foo = new JiraFolderProperty(); foo.setSites(list); foo.setSites(new JiraSite("<LINK_0>")); d.getProperties().add(foo); r.configRoundtrip(d); JiraFolderProperty prop = d.getProperties().get(JiraFolderProperty.class); assertNotNull(prop); List<JiraSite> actual = Arrays.asList(prop.getSites()); r.assertEqualDataBoundBeans(list, actual); }
Source:
public boolean hasDelayedMetrics(long ingestTime) { if ( getDelayTime(ingestTime) > TRACKER_DELAYED_METRICS_MILLIS ) { return true; } else { return false; } }

Target:
public boolean hasDelayedMetrics(long ingestTime) { return getDelayTime(ingestTime) > TRACKER_DELAYED_METRICS_MILLIS; }
Source:
protected boolean set(TileEntityFurnace container, Integer value) { if (container.getStackInSlot(0) == null) { return false; } container.setField(3, value); return true; }

Target:
protected boolean set(TileEntityFurnace container, Integer value) { if(container.getStackInSlot(0) == null) return false; container.setField(3, value); return true; }
Source:
private void initIncludedInAction(ChangeInfo info) { if (info.status().isClosed()) { includedInAction = new IncludedInAction( info.legacy_id(), style, headerLine, includedIn); includedIn.setVisible(true); } }

Target:
private void initIncludedInAction(ChangeInfo info) { if (info.status() == Status.MERGED) { includedInAction = new IncludedInAction( info.legacy_id(), style, headerLine, includedIn); includedIn.setVisible(true); } }
Source:
public void start(final StartContext context) throws StartException { if (runOnce.get()) { return; } runOnce.set(true); StabilityMonitor monitor = new StabilityMonitor(); for (ServiceController controller : serviceControllers) { monitor.addController(controller); } try { monitor.awaitStability(); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new RuntimeException(ex); } finally { monitor.clear(); } ClassLoader oldTccl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(classLoader); bootstrap.getValue().getBootstrap().endInitialization(); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); } }

Target:
public void start(final StartContext context) throws StartException { if (!runOnce.compareAndSet(false, true)) { return; } final ExecutorService executor = executorService.getValue(); final Runnable task = new Runnable() { @Override public void run() { StabilityMonitor monitor = new StabilityMonitor(); for (ServiceController controller : serviceControllers) { monitor.addController(controller); } try { monitor.awaitStability(); } catch (InterruptedException ex) { context.failed(new StartException(ex)); Thread.currentThread().interrupt(); throw new RuntimeException(ex); } finally { monitor.clear(); } ClassLoader oldTccl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(classLoader); bootstrap.getValue().getBootstrap().endInitialization(); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); context.complete(); } } }; try { executor.execute(task); } catch (RejectedExecutionException e) { task.run(); } finally { context.asynchronous(); } }
Source:
void create(String tableName, NewTableConfiguration ntc) throws AccumuloSecurityException, AccumuloException, TableExistsException; @Deprecated void importTable(String tableName, String importDirs) throws TableExistsException, AccumuloException, AccumuloSecurityException; void importTable(String tableName, Set<String> importDirs) throws TableExistsException, AccumuloException, AccumuloSecurityException; void exportTable(String tableName, String exportDir) throws TableNotFoundException, AccumuloException, AccumuloSecurityException; void addSplits(String tableName, SortedSet<Text> partitionKeys) throws TableNotFoundException, AccumuloException, AccumuloSecurityException; @Deprecated default Collection<Text> getSplits(String tableName) throws TableNotFoundException { try { return listSplits(tableName); } catch (AccumuloSecurityException | AccumuloException e) { throw new RuntimeException(e); } }

Target:
void create(String tableName, NewTableConfiguration ntc) throws AccumuloSecurityException, AccumuloException, TableExistsException; default void importTable(String tableName, String importDir) throws TableExistsException, AccumuloException, AccumuloSecurityException { importTable(tableName, Set.of(importDir)); }
Source:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getName()).append(" {"); Map<String, Object> attributes = constructSerializationAttributes(); if (attributes != null && !attributes.isEmpty()) { Iterator<Entry<String, Object>> i = attributes.entrySet().iterator(); builder.append(i.next()); while (i.hasNext()) { builder.append(", ").append(i.next()); } } builder.append("}"); return builder.toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getName()).append(" {"); Map<String, Object> attributes = constructStringAttributes(); if (attributes != null && !attributes.isEmpty()) { Iterator<Entry<String, Object>> i = attributes.entrySet().iterator(); appendEntry(builder, i.next()); while (i.hasNext()) { builder.append(", "); appendEntry(builder, i.next()); } } builder.append("}"); return builder.toString(); }
Source:
if (property != null) { try { count = Integer.parseInt(property); if (count < 0 ) { throw new IllegalArgumentException("Skip count should be greater than or equal to 0"); } } catch (Exception ex) { throw new IllegalArgumentException("Error parsing skip count value"); } }

Target:
if (property != null) { try { long value = Long.decode(property); if (value < 0 ) { logger.warn("Log gap should be greater than or equal to 0, setting to default"); } else { ERROR_LOG_GAP = value; } } catch (Exception ex) { logger.warn("Unable to parse the log gap property, setting to default", ex); } }