auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private VendorAddress findVendorAddress(DisbursementVoucherPaymentInformationXml paymentInfo) { Collection<VendorAddress> vendorAddresses; try { String[] payeeArray = StringUtils.split(paymentInfo.getPayeeId(), KFSConstants.DASH); if (LOG.isInfoEnabled()) { LOG.info("findVendorAddress, vendorHeaderGeneratedIdentifier: " + payeeArray[0] + " vendorDetailAssignedIdentifier: " + payeeArray[1] + ", payee address id: " + paymentInfo.getPayeeAddressId()); } Map<String, String> fieldValues = new HashMap<String, String>(); fieldValues.put(KFSPropertyConstants.VENDOR_HEADER_GENERATED_ID, payeeArray[0]); fieldValues.put(KFSPropertyConstants.VENDOR_DETAIL_ASSIGNED_ID, payeeArray[1]); fieldValues.put(KFSPropertyConstants.VENDOR_ADDRESS_GENERATED_ID, paymentInfo.getPayeeAddressId()); fieldValues.put(KFSPropertyConstants.ACCOUNT_ACTIVE_INDICATOR, KFSConstants.ACTIVE_INDICATOR); vendorAddresses = businessObjectService.findMatching(VendorAddress.class, fieldValues); } catch (Throwable e) { LOG.error("findVendorAddress, there was an error attempting to find the vendor address", e); throw new ValidationException("Unable to find the vendor address: " + e.getMessage()); } if (CollectionUtils.isEmpty(vendorAddresses)) { throw new ValidationException("Unable to find a vendor address for vendor number " + paymentInfo.getPayeeId() + " and vendor address id " + paymentInfo.getPayeeAddressId()); } VendorAddress address = vendorAddresses.iterator().next(); return address; }

Target:
private VendorAddress findVendorAddress(DisbursementVoucherPaymentInformationXml paymentInfo) { Collection<VendorAddress> vendorAddresses; try { String[] payeeArray = StringUtils.split(paymentInfo.getPayeeId(), KFSConstants.DASH); if (LOG.isInfoEnabled()) { LOG.info("findVendorAddress, vendorHeaderGeneratedIdentifier: " + payeeArray[0] + " vendorDetailAssignedIdentifier: " + payeeArray[1] + ", payee address id: " + paymentInfo.getPayeeAddressId()); } Map<String, String> fieldValues = new HashMap<String, String>(); fieldValues.put(KFSPropertyConstants.VENDOR_HEADER_GENERATED_ID, payeeArray[0]); fieldValues.put(KFSPropertyConstants.VENDOR_DETAIL_ASSIGNED_ID, payeeArray[1]); fieldValues.put(KFSPropertyConstants.VENDOR_ADDRESS_GENERATED_ID, paymentInfo.getPayeeAddressId()); fieldValues.put(KFSPropertyConstants.ACCOUNT_ACTIVE_INDICATOR, KFSConstants.ACTIVE_INDICATOR); vendorAddresses = businessObjectService.findMatching(VendorAddress.class, fieldValues); } catch (Exception e) { LOG.error("findVendorAddress, there was an error attempting to find the vendor address", e); throw new ValidationException("Unable to find the vendor address: " + e.getMessage()); } if (CollectionUtils.isEmpty(vendorAddresses)) { throw new ValidationException("Unable to find a vendor address for vendor number " + paymentInfo.getPayeeId() + " and vendor address id " + paymentInfo.getPayeeAddressId()); } VendorAddress address = vendorAddresses.iterator().next(); return address; }
Source:
File getStateFile() { return new File(Jenkins.getInstance().getRootDir(),"last_upgrade_version"); }

Target:
File getStateFile() { return new File(Jenkins.getInstance().getRootDir(),"jenkins.install.UpgradeWizard.state"); }
Source:
public PartitionCreator withName(String name){ return withName(name, 0); }

Target:
public PartitionCreator withName(String name){ return withName(name, Conglomerate.Priority.NORMAL); }
Source:
public String render(Integer mtu) { return mtu == null || mtu == 0 ? messages.defaultMtu(defaultMtu) : mtu.toString(); }

Target:
public String render(Integer mtu) { return mtu == 0 ? messages.defaultMtu(defaultMtu) : mtu.toString(); }
Source:
public Response getUiCount(@QueryParam("branchUuid") long branchUuid) throws OseeCoreException { List<ChangeItem> changes = getChanges(branchUuid); Set<Long> newArts = new HashSet<Long>(); Set<Long> modArts = new HashSet<Long>(); Set<Long> deletedArts = new HashSet<Long>(); Set<Long> types = new HashSet<Long>(); for (ChangeItem c : changes) { types.add(c.getItemTypeId()); } Map<Integer, Pair<ChangeItem, Set<ChangeItem>>> artToChanges = new HashMap<Integer, Pair<ChangeItem, Set<ChangeItem>>>(); buildArtIdToChangeMap(changes, artToChanges); buildLists(artToChanges, newArts, modArts, deletedArts); final UICountWriter writer = new UICountWriter(orcsApi); final String fileName = String.format("STRS_Report_%s", System.currentTimeMillis()); StreamingOutput streamingOutput = new StreamingOutput() { @Override public void write(OutputStream outputStream) throws WebApplicationException, IOException { writer.write(branchUuid, newArts, modArts, deletedArts, outputStream); outputStream.flush(); } }; String contentDisposition = String.format("attachment; filename=\"%s.xml\"; creation-date=\"%s\"", fileName, new Date()); return Response.ok(streamingOutput).header("Content-Disposition", contentDisposition).type("application/xml").build(); }

Target:
public Response getUiCount(@QueryParam("branchUuid") long branchUuid) throws OseeCoreException { List<ChangeItem> changes = getChanges(branchUuid); Set<Long> newArts = new HashSet<Long>(); Set<Long> modArts = new HashSet<Long>(); Set<Long> deletedArts = new HashSet<Long>(); Set<Long> types = new HashSet<Long>(); for (ChangeItem c : changes) { types.add(c.getItemTypeId()); } Map<Integer, Pair<ChangeItem, Set<ChangeItem>>> artToChanges = new HashMap<Integer, Pair<ChangeItem, Set<ChangeItem>>>(); buildArtIdToChangeMap(changes, artToChanges); buildLists(artToChanges, newArts, modArts, deletedArts); final UICountWriter writer = new UICountWriter(orcsApi); final String fileName = String.format("UI_Couunt_Report_%s", System.currentTimeMillis()); StreamingOutput streamingOutput = new StreamingOutput() { @Override public void write(OutputStream outputStream) throws WebApplicationException, IOException { writer.write(branchUuid, newArts, modArts, deletedArts, outputStream); outputStream.flush(); } }; String contentDisposition = String.format("attachment; filename=\"%s.xml\"; creation-date=\"%s\"", fileName, new Date()); return Response.ok(streamingOutput).header("Content-Disposition", contentDisposition).type("application/xml").build(); }
Source:
private void setupConsentEmailChangeTest(String originalEmail, String newEmail, boolean shouldBeChanged, boolean expectedSendEmail) { reset(sendMailService); Study original = TestUtils.getValidStudy(StudyServiceMockTest.class); original.setConsentNotificationEmail(originalEmail); when(studyDao.getStudy(any())).thenReturn(original); Study update = TestUtils.getValidStudy(StudyServiceMockTest.class); update.setConsentNotificationEmail(newEmail); update.setConsentNotificationEmailVerified(true); service.updateStudy(update, true); if (shouldBeChanged && expectedSendEmail) { verify(sendMailService).sendEmail(any()); } else { verify(sendMailService, never()).sendEmail(any()); } if (shouldBeChanged) { assertFalse(update.isConsentNotificationEmailVerified()); } else { assertTrue(update.isConsentNotificationEmailVerified()); } }

Target:
private void setupConsentEmailChangeTest(String originalEmail, String newEmail, boolean shouldBeChanged, boolean expectedSendEmail) { reset(sendMailService); Study original = TestUtils.getValidStudy(StudyServiceMockTest.class); original.setConsentNotificationEmail(originalEmail); when(studyDao.getStudy(any())).thenReturn(original); Study update = TestUtils.getValidStudy(StudyServiceMockTest.class); update.setConsentNotificationEmail(newEmail); update.setConsentNotificationEmailVerified(true); service.updateStudy(update, true); if (expectedSendEmail) { verify(sendMailService).sendEmail(any()); } else { verify(sendMailService, never()).sendEmail(any()); } if (shouldBeChanged) { assertFalse(update.isConsentNotificationEmailVerified()); } else { assertTrue(update.isConsentNotificationEmailVerified()); } }
Source:
public static boolean[] getBits(int value) { String zeroBitString = String.format("%0" + 8 + 'd', 0); String binaryString = Integer.toBinaryString(value); binaryString = zeroBitString.substring(binaryString.length()) + binaryString; boolean[] bits = new boolean[8]; for (int pos = 7; pos > 0; pos--) { bits[7 - pos] = binaryString.substring(pos, pos + 1) .equalsIgnoreCase("1") ? true : false; } for (boolean bit : bits) { String b = bit == true ? "1" : "0"; System.out.print(b); } return bits; }

Target:
public static boolean[] getBits(int value) { String zeroBitString = String.format("%0" + 8 + 'd', 0); String binaryString = Integer.toBinaryString(value); binaryString = zeroBitString.substring(binaryString.length()) + binaryString; boolean[] bits = new boolean[8]; for (int pos = 7; pos > 0; pos--) { bits[7 - pos] = binaryString.substring(pos, pos + 1) .equalsIgnoreCase("1") ? true : false; } for (boolean bit : bits) { String b = bit == true ? "1" : "0"; } return bits; }
Source:
public void onReceive(Context context, Intent intent) { ProvisionLogger.logd("ACTION_PROFILE_PROVISIONING_COMPLETE broadcast received by mdm"); final Intent primaryProfileSuccessIntent = new Intent(ACTION_MANAGED_PROFILE_PROVISIONED); primaryProfileSuccessIntent.setPackage(mMdmPackageName); primaryProfileSuccessIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES | Intent.FLAG_RECEIVER_FOREGROUND); primaryProfileSuccessIntent.putExtra(Intent.EXTRA_USER, mManagedUserHandle); if (mMigratedAccount != null) { primaryProfileSuccessIntent.putExtra(EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE, mMigratedAccount); finishAccountMigration(context, primaryProfileSuccessIntent); } else { context.sendBroadcast(primaryProfileSuccessIntent); } ProvisioningManager.getInstance(context).finalizationCompleted(); }

Target:
public void onReceive(Context context, Intent intent) { ProvisionLogger.logd("ACTION_PROFILE_PROVISIONING_COMPLETE broadcast received by mdm"); final Intent primaryProfileSuccessIntent = new Intent(ACTION_MANAGED_PROFILE_PROVISIONED); primaryProfileSuccessIntent.setPackage(mMdmPackageName); primaryProfileSuccessIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES | Intent.FLAG_RECEIVER_FOREGROUND); primaryProfileSuccessIntent.putExtra(Intent.EXTRA_USER, mManagedUserHandle); if (mMigratedAccount != null) { primaryProfileSuccessIntent.putExtra(EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE, mMigratedAccount); finishAccountMigration(context, primaryProfileSuccessIntent); } else { context.sendBroadcast(primaryProfileSuccessIntent); ProvisioningManager.getInstance(context).finalizationCompleted(); } }
Source:
public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception { final ChildData child = event.getData(); if (child == null) { return; } final ContainerHolder holder = containers.get(containerKey); if (holder == null) { return; } final String inventoryKey = ZKPaths.getNodeFromPath(child.getPath()); if (inventoryKey == null) { return; } switch (event.getType()) { case CHILD_ADDED: case CHILD_UPDATED: final InventoryClass inventory = strategy.deserializeInventory(child.getData()); synchronized (holder) { holder.setContainer(strategy.addInventory(holder.getContainer(), inventoryKey, inventory)); } break; case CHILD_REMOVED: synchronized (holder) { holder.setContainer(strategy.removeInventory(holder.getContainer(), inventoryKey)); } break; } }

Target:
public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception { final ChildData child = event.getData(); if (child == null) { return; } final ContainerHolder holder = containers.get(containerKey); if (holder == null) { return; } final String inventoryKey = ZKPaths.getNodeFromPath(child.getPath()); switch (event.getType()) { case CHILD_ADDED: case CHILD_UPDATED: final InventoryClass inventory = strategy.deserializeInventory(child.getData()); synchronized (holder) { holder.setContainer(strategy.addInventory(holder.getContainer(), inventoryKey, inventory)); } break; case CHILD_REMOVED: synchronized (holder) { holder.setContainer(strategy.removeInventory(holder.getContainer(), inventoryKey)); } break; } }
Source:
public void testProcessorIgnoresDuplicateZone() { String query = "1D 1D"; List<Suggestion> suggestions = processor.enhanceResults(new LinkedList<>(), query); List<String> detectedMgrsStrings = processor.getMgrsCoordinateStrings(query); assertThat(detectedMgrsStrings, both(hasSize(2)).and(contains("1D", "1D"))); assertThat( cast(suggestions).get(0).getGeo(), hasSize(4)); }

Target:
public void testProcessorIgnoresDuplicateZone() { List<String> detectedMgrsStrings = processor.getMgrsCoordinateStrings("1D 1D"); assertThat(detectedMgrsStrings, both(hasSize(1)).and(contains("1D"))); }
Source:
public boolean apply(SamzaSqlRelMessage message) { long startProcessing = System.nanoTime(); Object[] result = new Object[1]; try { expr.execute(translatorContext.getExecutionContext(), context, translatorContext.getDataContext(), message.getSamzaSqlRelRecord().getFieldValues().toArray(), result); } catch (Exception e) { String errMsg = String.format("Handling the following rel message ran into an error. %s", message); LOG.error(errMsg, e); throw new SamzaException(errMsg, e); } if (result[0] instanceof Boolean) { boolean retVal = (Boolean) result[0]; LOG.debug( String.format("return value for input %s is %s", Arrays.asList(message.getSamzaSqlRelRecord().getFieldValues()).toString(), retVal)); updateMetrics(startProcessing, retVal, System.nanoTime()); return retVal; } else { LOG.error("return value is not boolean for rel message: %s", message); return false; } }

Target:
public boolean apply(SamzaSqlRelMessage message) { long startProcessing = System.nanoTime(); Object[] result = new Object[1]; try { expr.execute(translatorContext.getExecutionContext(), context, translatorContext.getDataContext(), message.getSamzaSqlRelRecord().getFieldValues().toArray(), result); } catch (Exception e) { String errMsg = String.format("Handling the following rel message ran into an error. %s", message); LOG.error(errMsg, e); throw new SamzaException(errMsg, e); } if (result[0] instanceof Boolean) { boolean retVal = (Boolean) result[0]; LOG.debug( String.format("return value for input %s is %s", Arrays.asList(message.getSamzaSqlRelRecord().getFieldValues()).toString(), retVal)); updateMetrics(startProcessing, retVal, System.nanoTime()); return retVal; } else { LOG.error("return value is not boolean for rel message: {}", message); return false; } }
Source:
private Drawable getServerBubble(ArrayList<String> serverList, int position) { String firstLetter = String.valueOf(serverList.get(position).charAt(0)); ColorGenerator generator = ColorGenerator.MATERIAL; int color = generator.getColor(serverList.get(position)); TextDrawable drawable = TextDrawable.builder() .buildRound(firstLetter, color); return drawable; }

Target:
private Drawable getServerBubble(ArrayList<String> serverList, int position) { String firstLetter = String.valueOf(serverList.get(position).charAt(0)); TextDrawable drawable = TextDrawable.builder() .buildRound(firstLetter, ColorGenerator.MATERIAL.getColor(serverList.get(position))); return drawable; }
Source:
public <R> R computeWith( SchemaComputer<R> computer ) { throw new NotImplementedException( "Not implemented" ); }

Target:
public <R> R computeWith( SchemaComputer<R> computer ) { throw new UnsupportedOperationException( "Not an valid operation for multitoken schema" ); }
Source:
protected void configure() { binder().requireExplicitBindings(); requireBinding(MidolmanConfig.class); requireBinding(DatapathConnectionPool.class); requireBinding(HostIdProviderService.class); requireBinding(UpcallDatapathConnectionManager.class); requireBinding(FlowStateStorageFactory.class); requireBinding(NetlinkChannelFactory.class); bindMidolmanActorsService(); expose(MidolmanActorsService.class); bind(NanoClock.class).toInstance(NanoClock$.MODULE$.DEFAULT()); expose(NanoClock.class); bind(UnixClock.class).toInstance(UnixClock$.MODULE$.DEFAULT()); expose(UnixClock.class); bind(SupervisorActor.class); bind(VirtualTopologyActor.class); bind(VirtualToPhysicalMapper.class); bind(DatapathController.class); bind(PacketsEntryPoint.class); bind(NetlinkCallbackDispatcher.class); bind(MetadataServiceManagerActor.class); bind(FlowWriter.class); bind(RoutingManagerActor.class); bind(HealthMonitor.class); }

Target:
protected void configure() { binder().requireExplicitBindings(); requireBinding(MidolmanConfig.class); requireBinding(DatapathConnectionPool.class); requireBinding(HostIdProviderService.class); requireBinding(UpcallDatapathConnectionManager.class); requireBinding(FlowStateStorageFactory.class); requireBinding(NetlinkChannelFactory.class); bindMidolmanActorsService(); expose(MidolmanActorsService.class); bind(NanoClock.class).toInstance(NanoClock$.MODULE$.DEFAULT()); expose(NanoClock.class); bind(UnixClock.class).toInstance(UnixClock$.MODULE$.DEFAULT()); expose(UnixClock.class); bind(SupervisorActor.class); bind(VirtualTopologyActor.class); bind(VirtualToPhysicalMapper.class); bind(DatapathController.class); bind(PacketsEntryPoint.class); bind(NetlinkCallbackDispatcher.class); bind(MetadataServiceManagerActor.class); bind(RoutingManagerActor.class); bind(HealthMonitor.class); bind(FlowWriter.class); }
Source:
private boolean minDataSpreadCheckForAfricanDiseaseGroup() { Set<Integer> distinctCountries = occurrenceCountPerCountry.keySet(); boolean distinctCountriesCheck = distinctCountries.size() >= minDistinctCountries; Set<Integer> highFrequencyOccurrenceCountries = extractHighFrequencyCountries(); boolean highFrequencyCountriesCheck = highFrequencyOccurrenceCountries.size() >= minHighFrequencyCountries; return (distinctCountriesCheck & highFrequencyCountriesCheck); }

Target:
private boolean minDataSpreadCheckForAfricanDiseaseGroup() { Set<Integer> distinctCountries = occurrenceCountPerCountry.keySet(); boolean distinctCountriesCheck = (distinctCountries.size() >= minDistinctCountries); Set<Integer> highFrequencyOccurrenceCountries = extractHighFrequencyCountries(); boolean highFrequencyCountriesCheck = (highFrequencyOccurrenceCountries.size() >= minHighFrequencyCountries); return (distinctCountriesCheck & highFrequencyCountriesCheck); }
Source:
public <T extends Comparable<? super T>> void assertIsBetween(AssertionInfo info, T actual, T start, T end, boolean inclusiveStart, boolean inclusiveEnd) { assertNotNull(info, actual); checkNotNull(start, "The start range to compare actual with should not be null"); checkNotNull(end, "The end range to compare actual with should not be null"); checkArgument(comparisonStrategy.isLessThanOrEqualTo(start, end), String.format("The end value <%s> must not be less than the start value <%s>%s!", end, start, (comparisonStrategy.isStandard() ? "" : " (using " + comparisonStrategy + ")"))); boolean checkLowerBoundaryRange = inclusiveStart ? !isGreaterThan(start, actual) : isLessThan(start, actual); boolean checkUpperBoundaryRange = inclusiveEnd ? !isGreaterThan(actual, end) : isLessThan(actual, end); if (checkLowerBoundaryRange && checkUpperBoundaryRange) return; throw failures.failure(info, shouldBeBetween(actual, start, end, inclusiveStart, inclusiveEnd, comparisonStrategy)); }

Target:
public <T extends Comparable<? super T>> void assertIsBetween(AssertionInfo info, T actual, T start, T end, boolean inclusiveStart, boolean inclusiveEnd) { assertNotNull(info, actual); checkNotNull(start, "The start range to compare actual with should not be null"); checkNotNull(end, "The end range to compare actual with should not be null"); checkArgument(inclusiveEnd && inclusiveStart && comparisonStrategy.isLessThanOrEqualTo(start, end) || !inclusiveEnd && !inclusiveStart && comparisonStrategy.isLessThan(start, end), String.format("The end value <%s> must not be %s the start value <%s>%s!", end, (inclusiveEnd && inclusiveStart ? "less than" : "less than or equal to" ), start, (comparisonStrategy.isStandard() ? "" : " (using " + comparisonStrategy + ")"))); boolean checkLowerBoundaryRange = inclusiveStart ? !isGreaterThan(start, actual) : isLessThan(start, actual); boolean checkUpperBoundaryRange = inclusiveEnd ? !isGreaterThan(actual, end) : isLessThan(actual, end); if (checkLowerBoundaryRange && checkUpperBoundaryRange) return; throw failures.failure(info, shouldBeBetween(actual, start, end, inclusiveStart, inclusiveEnd, comparisonStrategy)); }
Source:
if ((fsyncWarningThreshold = Long.getLong("zookeeper.fsync.warningthresholdms")) == null) fsyncWarningThreshold = Long.getLong("fsync.warningthresholdms", 1000); fsyncWarningThresholdMS = fsyncWarningThreshold; } long lastMaxZxidSeen; volatile BufferedOutputStream logStream = null; volatile OutputArchive oa; volatile FileOutputStream fos = null; File logDir; private final boolean forceSync = !System.getProperty("zookeeper.forceSync", "yes").equals("no"); long dbId; private LinkedList<FileOutputStream> streamsToFlush = new LinkedList<FileOutputStream>(); long currentSize; File logFileWrite = null; private volatile long syncElapsedMS = -1L; public FileTxnLog(File logDir) { this.logDir = logDir; }

Target:
if ((fsyncWarningThreshold = Long.getLong("zookeeper.fsync.warningthresholdms")) == null) fsyncWarningThreshold = Long.getLong("fsync.warningthresholdms", 1000); fsyncWarningThresholdMS = fsyncWarningThreshold; } long lastZxidSeen; volatile BufferedOutputStream logStream = null; volatile OutputArchive oa; volatile FileOutputStream fos = null; File logDir; private final boolean forceSync = !System.getProperty("zookeeper.forceSync", "yes").equals("no"); long dbId; private LinkedList<FileOutputStream> streamsToFlush = new LinkedList<FileOutputStream>(); long currentSize; File logFileWrite = null; private volatile long syncElapsedMS = -1L; public FileTxnLog(File logDir) { this.logDir = logDir; }
Source:
public void validate(IValidatable<String> validatable) { String uriSpec = validatable.getValue(); try { URI uri = new URI(uriSpec); if (uri.getScheme() != null && !"file".equals(uri.getScheme())) { if (delegate != null) { delegate.validate(validatable); InputStream is = null; try { URLConnection connection = uri.toURL().openConnection(); connection.setConnectTimeout(10000); is = connection.getInputStream(); } catch (Exception e) { IValidationError err = new ValidationError("FileExistsValidator.unreachable") .addKey("FileExistsValidator.unreachable") .setVariable("file", uriSpec); validatable.error(err); } finally { IOUtils.closeQuietly(is); } } return; } else { String path = uri.getPath(); if (path != null && new File(path).exists()) { return; } } } catch (URISyntaxException e) { } File relFile = null; GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); if (baseDirectory != null) { relFile = Resources.find(Resources.fromURL(Files.asResource(baseDirectory), uriSpec), true); } else if (loader != null) { relFile = loader.url(uriSpec); } if (relFile == null || !relFile.exists()) { IValidationError err = new ValidationError("FileExistsValidator.fileNotFoundError") .addKey("FileExistsValidator.fileNotFoundError") .setVariable("file", uriSpec); validatable.error(err); } }

Target:
public void validate(IValidatable<String> validatable) { String uriSpec = validatable.getValue(); try { URI uri = new URI(uriSpec); if (uri.getScheme() != null && !"file".equals(uri.getScheme())) { if (delegate != null) { delegate.validate(validatable); InputStream is = null; try { URLConnection connection = uri.toURL().openConnection(); connection.setConnectTimeout(10000); is = connection.getInputStream(); } catch (Exception e) { IValidationError err = new ValidationError("FileExistsValidator.unreachable") .addKey("FileExistsValidator.unreachable") .setVariable("file", uriSpec); validatable.error(err); } finally { IOUtils.closeQuietly(is); } } return; } else { String path = uri.getPath(); if (path != null && new File(path).exists()) { return; } } } catch (URISyntaxException e) { } File relFile = null; GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); if (baseDirectory != null) { relFile = Files.url(baseDirectory, uriSpec); } else if (loader != null) { relFile = Resources.find( Resources.fromURL(Files.asResource(loader.getBaseDirectory()), uriSpec), true); } if (relFile == null || !relFile.exists()) { IValidationError err = new ValidationError("FileExistsValidator.fileNotFoundError") .addKey("FileExistsValidator.fileNotFoundError") .setVariable("file", uriSpec); validatable.error(err); } }
Source:
private Optimizer(PlanNodeIdAllocator idAllocator, PlanVariableAllocator variableAllocator, Metadata metadata, StandardFunctionResolution functionResolution) { this.idAllocator = requireNonNull(idAllocator, "idAllocator is null"); this.variableAllocator = requireNonNull(variableAllocator, "variableAllocator is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.functionResolution = functionResolution; }

Target:
private Optimizer(PlanNodeIdAllocator idAllocator, PlanVariableAllocator variableAllocator, Metadata metadata, StandardFunctionResolution functionResolution) { this.idAllocator = requireNonNull(idAllocator, "idAllocator is null"); this.variableAllocator = requireNonNull(variableAllocator, "variableAllocator is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.functionResolution = requireNonNull(functionResolution, "functionResolution is null"); }
Source:
public boolean hasNext() { if ( recordReader.hasNext()) { return true; } return false; }

Target:
public boolean hasNext() { return recordReader.hasNext(); }
Source:
TableMasterClient provideCatalogMasterClient(AlluxioHiveMetastoreConfig config) { InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults()); String addr = config.getMasterAddress(); String[] parts = addr.split(":", 2); conf.set(PropertyKey.MASTER_HOSTNAME, parts[0]); if (parts.length > 1) { conf.set(PropertyKey.MASTER_RPC_PORT, parts[1]); } MasterClientContext context = MasterClientContext .newBuilder(ClientContext.create(new InstancedConfiguration(ConfigurationUtils.defaults()))).build(); return new RetryHandlingTableMasterClient(context); }

Target:
TableMasterClient provideCatalogMasterClient(AlluxioHiveMetastoreConfig config) { InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults()); String address = config.getMasterAddress(); String[] parts = address.split(":", 2); conf.set(PropertyKey.MASTER_HOSTNAME, parts[0]); if (parts.length > 1) { conf.set(PropertyKey.MASTER_RPC_PORT, parts[1]); } MasterClientContext context = MasterClientContext.newBuilder(ClientContext.create(new InstancedConfiguration(ConfigurationUtils.defaults()))).build(); return new RetryHandlingTableMasterClient(context); }
Source:
private ValidationResult hostStatusValid() { VDSStatus hostStatus = getVds().getStatus(); if ((hostStatus != VDSStatus.Maintenance) && (hostStatus != VDSStatus.Up) && (hostStatus != VDSStatus.NonOperational)) { addCanDoActionMessage(VdcBllMessages.VAR__HOST_STATUS__UP_MAINTENANCE_OR_NON_OPERATIONAL); new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL); } return ValidationResult.VALID; }

Target:
private ValidationResult hostStatusValid() { VDSStatus hostStatus = getVds().getStatus(); if (hostStatus != VDSStatus.Maintenance && hostStatus != VDSStatus.Up && hostStatus != VDSStatus.NonOperational) { addCanDoActionMessage(VdcBllMessages.VAR__HOST_STATUS__UP_MAINTENANCE_OR_NON_OPERATIONAL); new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL); } return ValidationResult.VALID; }
Source:
public static int getZoneID(Configuration config, BridgeHandler bridge) { if (config == null || config.get(DigitalSTROMBindingConstants.ZONE_ID) == null) { return -2; } if (bridge == null) { return -3; } String configZoneID = config.get(DigitalSTROMBindingConstants.ZONE_ID).toString(); int zoneID; StructureManager strucMan = bridge.getStructureManager(); if (strucMan != null) { try { zoneID = Integer.parseInt(configZoneID); if (!strucMan.checkZoneID(zoneID)) { zoneID = -1; } } catch (NumberFormatException e) { zoneID = strucMan.getZoneId(configZoneID); } return zoneID; } return -1; }

Target:
public static int getZoneID(Configuration config, BridgeHandler bridge) { if (config == null || config.get(DigitalSTROMBindingConstants.ZONE_ID) == null) { return ZONE_ID_NOT_SET; } if (bridge == null) { return BRIDGE_IS_NULL; } String configZoneID = config.get(DigitalSTROMBindingConstants.ZONE_ID).toString(); int zoneID; StructureManager strucMan = bridge.getStructureManager(); if (strucMan != null) { try { zoneID = Integer.parseInt(configZoneID); if (!strucMan.checkZoneID(zoneID)) { zoneID = ZONE_ID_NOT_EXISTS; } } catch (NumberFormatException e) { zoneID = strucMan.getZoneId(configZoneID); } return zoneID; } return ZONE_ID_NOT_EXISTS; }
Source:
public void testInvalidTransactionAttributeWarnLogged() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream oldOut = System.out; System.setOut(new PrintStream(baos)); deployer.deploy("invalidtransactionattribute"); System.setOut(oldOut); String output = new String(baos.toByteArray()); Assert.assertFalse(output.contains("WFLYEJB0463")); deployer.undeploy("invalidtransactionattribute"); }

Target:
public void testInvalidTransactionAttributeWarnLogged() { PrintStream oldOut = System.out; ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { System.setOut(new PrintStream(baos)); deployer.deploy("invalidtransactionattribute"); try { System.setOut(oldOut); String output = new String(baos.toByteArray()); Assert.assertFalse(output, output.contains("WFLYEJB0463")); Assert.assertFalse(output, output.contains("ERROR")); } finally { deployer.undeploy("invalidtransactionattribute"); } } finally { System.setOut(oldOut); } }
Source:
private List<String> dereferenceAgentClasses(final Collection<String> agentClasses) { final Session internalSession = sessionFactory.getInternalSession(); final IdentifierConverter<Resource, FedoraResource> translator = new DefaultIdentifierTranslator(internalSession); final List<String> members = new ArrayList<>(); agentClasses.stream() .distinct() .forEach(x -> { if (x.startsWith(FEDORA_INTERNAL_PREFIX)) { final FedoraResource resource = nodeService.find( internalSession, x.substring(FEDORA_INTERNAL_PREFIX.length())); members.addAll(getFoafMembers(translator, resource)); } else if (x.startsWith(FOAF_NAMESPACE_VALUE)) { members.add(x); } else { LOGGER.info("Ignoring agentClass: {}", x); } }); if (LOGGER.isDebugEnabled() && !agentClasses.isEmpty()) { LOGGER.debug("Found members in agentClass resources", members.size(), agentClasses.size()); } return members; }

Target:
private List<String> dereferenceAgentClasses(final Collection<String> agentClasses) { final Session internalSession = sessionFactory.getInternalSession(); final IdentifierConverter<Resource, FedoraResource> translator = new DefaultIdentifierTranslator(internalSession); final List<String> members = new ArrayList<>(); agentClasses.stream() .distinct() .forEach(x -> { if (x.startsWith(FEDORA_INTERNAL_PREFIX)) { final FedoraResource resource = nodeService.find( internalSession, x.substring(FEDORA_INTERNAL_PREFIX.length())); members.addAll(getAgentMembers(translator, resource)); } else if (x.equals(FOAF_AGENT_VALUE)) { members.add(x); } else { LOGGER.info("Ignoring agentClass: {}", x); } }); if (LOGGER.isDebugEnabled() && !agentClasses.isEmpty()) { LOGGER.debug("Found members in agentClass resources", members.size(), agentClasses.size()); } return members; }
Source:
public GsonBuilder newGsonBuilder() { if (!isJson()) { throw new IllegalStateException(String.format("%s is not JSON", this)); } GsonBuilder gb = new GsonBuilder(); if (this == OutputFormat.JSON) { gb.setPrettyPrinting(); } return gb; }

Target:
public GsonBuilder newGsonBuilder() { if (!isJson()) { throw new IllegalStateException(String.format("%s is not JSON", this)); } GsonBuilder gb = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .registerTypeAdapter(Timestamp.class, new SqlTimestampDeserializer()); if (this == OutputFormat.JSON) { gb.setPrettyPrinting(); } return gb; }
Source:
public MinPension(Context context) { super(context); TAG = "MinPension"; NAME = "Min Pension.se"; NAME_SHORT = "minpension"; BANKTYPE_ID = IBankTypes.MINPENSION; INPUT_TYPE_USERNAME = InputType.TYPE_CLASS_PHONE; INPUT_TYPE_PASSWORD = InputType.TYPE_CLASS_PHONE; INPUT_HINT_USERNAME = "ÅÅÅÅMMDDXXXX"; }

Target:
public MinPension(Context context) { super(context); TAG = "MinPension"; NAME = "Min Pension.se"; NAME_SHORT = "minpension"; BANKTYPE_ID = IBankTypes.MINPENSION; INPUT_TYPE_USERNAME = InputType.TYPE_CLASS_PHONE; INPUT_TYPE_PASSWORD = InputType.TYPE_CLASS_PHONE | InputType.TYPE_TEXT_VARIATION_PASSWORD;; INPUT_HINT_USERNAME = res.getText(R.string.pno).toString(); }
Source:
public Response execute(Request request) throws IOException { Map<String, String> headersMap = MutableMap.of(); for (Header header: request.getHeaders()) { headersMap.put(header.getName(), header.getValue()); } String mimeType = "text/plain"; byte[] content = null; TypedOutput body = request.getBody(); if (body != null) { mimeType = request.getBody().mimeType(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { body.writeTo(baos); content = baos.toByteArray(); } catch (IOException e) { throw e; } finally { Streams.closeQuietly(baos); } } final HttpResponse response = httpExecutor.execute(new HttpRequest.Builder() .headers(headersMap) .uri(URI.create(request.getUrl())) .method(request.getMethod()) .body(content) .build()); List<Header> responseHeaders = Lists.newArrayList(); for (Map.Entry<String, String> entry: response.headers().entries()) { responseHeaders.add(new Header(entry.getKey(), entry.getValue())); } TypedInput responseBody = new TypedByteArray(mimeType, ByteStreams.toByteArray(response.getContent())); return new Response(request.getUrl(), response.code(), (response.reasonPhrase() != null) ? response.reasonPhrase() : "", responseHeaders, responseBody); }

Target:
public Response execute(Request request) throws IOException { Map<String, String> headersMap = MutableMap.of(); for (Header header: request.getHeaders()) { headersMap.put(header.getName(), header.getValue()); } String mimeType = "text/plain"; byte[] content = null; TypedOutput body = request.getBody(); if (body != null) { mimeType = request.getBody().mimeType(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { body.writeTo(baos); content = baos.toByteArray(); } finally { Streams.closeQuietly(baos); } } final HttpResponse response = httpExecutor.execute(new HttpRequest.Builder() .headers(headersMap) .uri(URI.create(request.getUrl())) .method(request.getMethod()) .body(content) .build()); List<Header> responseHeaders = Lists.newArrayList(); for (Map.Entry<String, String> entry: response.headers().entries()) { responseHeaders.add(new Header(entry.getKey(), entry.getValue())); } TypedInput responseBody = new TypedByteArray(mimeType, ByteStreams.toByteArray(response.getContent())); return new Response(request.getUrl(), response.code(), (response.reasonPhrase() != null) ? response.reasonPhrase() : "", responseHeaders, responseBody); }
Source:
public AbstractTestQueries(QueryRunnerSupplier supplier) { this(supplier, FeatureSelection.all()); }

Target:
protected AbstractTestQueries(QueryRunnerSupplier supplier) { this(allFeatures(), supplier); }
Source:
public void tearDown() throws IOException { firstProject = null; secondProject = null; }

Target:
public void tearDown() throws IOException { }
Source:
public void setName(String name) { Objects.requireNonNull(name); this.name = name; }

Target:
public void setName(String name) { this.name = requireNonNull(name); }
Source:
private static File locateExecutable(String executableName) { if (!PlatformUtil.isWindowsOS()) { return null; } String executableToFindName = Paths.get(PlatformUtil.is64BitOS() ? PLASO64 : PLASO32, executableName).toString(); File exeFile = InstalledFileLocator.getDefault().locate(executableToFindName, PlasoIngestModule.class.getPackage().getName(), false); if (null == exeFile) { return null; } else { return exeFile.canExecute() ? exeFile : null; } }

Target:
private static File locateExecutable(String executableName) { if (!PlatformUtil.isWindowsOS()) { return null; } String executableToFindName = Paths.get(PlatformUtil.is64BitOS() ? PLASO64 : PLASO32, executableName).toString(); File exeFile = InstalledFileLocator.getDefault().locate(executableToFindName, PlasoIngestModule.class.getPackage().getName(), false); if (null != exeFile && exeFile.canExecute()) { return exeFile; } return null; }
Source:
public boolean submit(boolean verify) throws IOException, MessagingException { Set<File> sourceFiles = searchForSourceFiles(fileNames); db(sourceFiles.size() + " source files found"); if (sourceFiles.size() == 0) { String s = "No source files were found."; throw new IllegalStateException(s); } else if (sourceFiles.size() < 3) { String s = "Too few source files were submitted. 3 or more must be submitted."; throw new IllegalStateException(s); } if (verify && !verifySubmission(sourceFiles)) { return false; } this.submitTime = new Date(); File jarFile = makeJarFileWith(sourceFiles); mailTA(jarFile, sourceFiles); mailReceipt(sourceFiles); return true; }

Target:
public boolean submit(boolean verify) throws IOException, MessagingException { Set<File> sourceFiles = searchForSourceFiles(fileNames); db(sourceFiles.size() + " source files found"); if (sourceFiles.size() == 0) { String s = "No source files were found."; throw new IllegalStateException(s); } else if (sourceFiles.size() < 3) { String s = "Too few source files were submitted. Each project requires at least 3 files be" + " submitted. You only submitted " + sourceFiles.size() + " files"; throw new IllegalStateException(s); } if (verify && !verifySubmission(sourceFiles)) { return false; } this.submitTime = new Date(); File jarFile = makeJarFileWith(sourceFiles); mailTA(jarFile, sourceFiles); mailReceipt(sourceFiles); return true; }
Source:
public List<RowMap> jsonMaps() { ArrayList<RowMap> list = new ArrayList<>(); Object avalue; Object bvalue; for (Iterator<Pair<Row>> p = filteredRowsBeforeAndAfter().iterator(); p.hasNext(); ) { Pair<Row> rowpair = p.next(); Row after = rowpair.getAfter(); Row before = rowpair.getBefore(); RowMap rowMap = new RowMap( getType(), getDatabase().getName(), getTable().getName(), getHeader().getTimestamp() / 1000, table.getPKList(), this.getNextBinlogPosition()); Iterator<Column> aftIter = after.getColumns().iterator(); Iterator<Column> befIter = before.getColumns().iterator(); Iterator<ColumnDef> defIter = table.getColumnList().iterator(); while ( aftIter.hasNext() && defIter.hasNext() && befIter.hasNext() ) { Column a = aftIter.next(); ColumnDef d = defIter.next(); Column b = befIter.next(); if ( a instanceof DatetimeColumn) { avalue = ((DatetimeColumn) a).getLongValue(); } else { avalue = a.getValue(); } if ( b instanceof DatetimeColumn) { bvalue = ((DatetimeColumn) b).getLongValue(); } else { bvalue = b.getValue(); } if (avalue != null) { avalue = d.asJSON(avalue); if ( !avalue.equals(d.asJSON(bvalue)) ) { bvalue = bvalue != null ? d.asJSON(bvalue) : bvalue; rowMap.putOldData(d.getName(), bvalue); } } else if (bvalue != null) { bvalue = d.asJSON(bvalue); rowMap.putOldData(d.getName(), bvalue); } rowMap.putData(d.getName(), avalue); } list.add(rowMap); } return list; }

Target:
public List<RowMap> jsonMaps() { ArrayList<RowMap> list = new ArrayList<>(); Object afterValue; Object beforeValue; for (Pair<Row> p : filteredRowsBeforeAndAfter() ) { Row after = p.getAfter(); Row before = p.getBefore(); RowMap rowMap = buildRowMap(); Iterator<Column> aftIter = after.getColumns().iterator(); Iterator<Column> befIter = before.getColumns().iterator(); Iterator<ColumnDef> defIter = table.getColumnList().iterator(); while ( aftIter.hasNext() && defIter.hasNext() && befIter.hasNext() ) { Column afterColumn = aftIter.next(); ColumnDef columnDef = defIter.next(); Column beforeColumn = befIter.next(); afterValue = valueForJson(afterColumn); if ( afterValue != null ) { afterValue = columnDef.asJSON(afterValue); } beforeValue = valueForJson(beforeColumn); if ( beforeValue != null) { beforeValue = columnDef.asJSON(beforeValue); } if ( !Objects.equals(afterValue,beforeValue) ) { rowMap.putOldData(columnDef.getName(), beforeValue); } rowMap.putData(columnDef.getName(), afterValue); } list.add(rowMap); } return list; }
Source:
public void drop() { db.activateOnCurrentThread(); db.drop(); }

Target:
public void drop() { activateOnCurrentThread(); db.drop(); }
Source:
public void testNegativeTimes() throws IOException, TimeRangeException, StateSystemDisposedException { long startTime = -1001; IStateHistoryBackend backend = getBackendForBuilding(startTime); for (long t = startTime; t <= 200; t += 10) { backend.insertPastState(t, t + 10, 0, t); } backend.finishedBuilding(210); IStateHistoryBackend backendQuery = getBackendForQuerying(backend); backendQuery.doSingularQuery(-1, 0); }

Target:
public void testNegativeTimes() throws IOException, TimeRangeException, StateSystemDisposedException { long startTime = -1001; IStateHistoryBackend backend = getBackendForBuilding(startTime); for (long t = startTime; t <= 200; t += 10) { backend.insertPastState(t, t + 10, 0, t); } backend.finishedBuilding(210); IStateHistoryBackend backendQuery = getBackendForQuerying(backend); ITmfStateInterval poisonInterval = backendQuery.doSingularQuery(-1, 0); assertNotNull(poisonInterval); assertEquals(-11L, poisonInterval.getValue()); }
Source:
public static void release(Jedis j, byte[] lockKey, byte[] lockValue) { if (lockValue != null) { j.watch(lockKey); byte[] prevousLockValue = j.get(lockKey); if (Arrays.equals(prevousLockValue, lockValue)) { Transaction transaction = j.multi(); transaction.del(lockKey); boolean succeed = transaction.exec() != null; if (!succeed) { LOG.warn( "Failed to release lock for key {}, meaning the key probably expired because of acquiring the lock for too long (more than {}ms)", new String(lockKey), LOCK_EXP); } } else { LOG.warn( "Nothing to release for key {}, meaning the key probably expired because of acquiring the lock for too long (more than {}ms)", new String(lockKey), LOCK_EXP); j.unwatch(); } if (Arrays.equals(j.get(lockKey), lockValue)) { Long deleted = j.del(lockKey); if (deleted != 1) { } } } else { LOG.warn("Trying to release a lock for with a null value", new String(lockKey)); } }

Target:
public static void release(Jedis j, byte[] lockKey, byte[] lockValue) { if (lockValue != null) { j.watch(lockKey); byte[] prevousLockValue = j.get(lockKey); if (Arrays.equals(prevousLockValue, lockValue)) { Transaction transaction = j.multi(); transaction.del(lockKey); boolean succeed = transaction.exec() != null; if (!succeed) { LOG.warn( "Failed to release lock for key {}/{}, meaning the key probably expired because of acquiring the lock for too long (more than {}ms)", new String(lockKey), Hex.encodeHexString(lockValue), LOCK_EXP); } } else { LOG.warn( "Nothing to release for key {}/{}, meaning the key probably expired because of acquiring the lock for too long (more than {}ms)", new String(lockKey), Hex.encodeHexString(lockValue), LOCK_EXP); j.unwatch(); } } else { LOG.warn("Trying to release a lock for with a null value", new String(lockKey)); } }
Source:
public final Object toNearRefWithoutResultPromise(final Object[] args) { Actor current = EventualMessage.getActorCurrentMessageIsExecutionOn(); SteppingType step = getStepping(); DirectMessage msg = new DirectMessage(EventualMessage.getCurrentExecutingMessage(), EventualMessage.getCurrentExecutingMessageId(), current, selector, args, current, null, onReceive, messageReceiverBreakpoint.executeCheckIsSetAndEnabled(), promiseResolverBreakpoint.executeCheckIsSetAndEnabled()); msg.setTriggerStepping(step); current.send(msg); return Nil.nilObject; }

Target:
public final Object toNearRefWithoutResultPromise(final Object[] args) { Actor current = EventualMessage.getActorCurrentMessageIsExecutionOn(); DirectMessage msg = new DirectMessage(EventualMessage.getCurrentExecutingMessageId(), current, selector, args, current, null, onReceive, hasMessageReceiverBreakpoint(null), promiseResolverBreakpoint.executeCheckIsSetAndEnabled()); current.send(msg, actorPool); return Nil.nilObject; }
Source:
public boolean doesRemoteFileExist(Path remotePath) throws BackupRestoreException { boolean exists = false; try { exists = s3Client.doesObjectExist(getShard(), remotePath.toString()); } catch (Exception ex) { logger.error( "Exception while checking existence of object: {}. Error: {}", remotePath, ex.getMessage()); } return exists; }

Target:
public boolean doesRemoteFileExist(Path remotePath) throws BackupRestoreException { boolean exists = false; try { exists = s3Client.doesObjectExist(getShard(), remotePath.toString()); } catch (AmazonClientException ex) { logger.error( "Exception while checking existence of object: {}. Error: {}", remotePath, ex.getMessage()); } return exists; }
Source:
synchronized Observable waitForLastAddConfirmedUpdate(long previousLAC, Observer observe) { if ((null != lac && lac > previousLAC) || isClosed || ((stateBits & STATE_FENCED_BIT) == STATE_FENCED_BIT)) { LOG.trace("Wait For LAC , {}", this.lac, previousLAC); return null; } addObserver(observe); return this; }

Target:
synchronized Observable waitForLastAddConfirmedUpdate(long previousLAC, Observer observe) { if ((null != lac && lac > previousLAC) || isClosed || ((stateBits & STATE_FENCED_BIT) == STATE_FENCED_BIT)) { if (LOG.isTraceEnabled()) { LOG.trace("Wait For LAC , {}", this.lac, previousLAC); } return null; } addObserver(observe); return this; }
Source:
public byte[] propose(final long seq, @Nullable byte[] bytes) throws PaxosRoundFailureException { final PaxosProposalId proposalId = new PaxosProposalId(proposalNumber.incrementAndGet(), uuid); PaxosValue toPropose = new PaxosValue(uuid, seq, bytes); final PaxosValue finalValue = phaseOne(seq, proposalId, toPropose); phaseTwo(seq, proposalId, finalValue); for (final PaxosLearner learner : learners.keySet()) { if (localLearner == learner) { continue; } ExecutorService executor = learners.get(learner); executor.execute(() -> { try { learner.learn(seq, finalValue); } catch (Throwable e) { log.warn("Failed to teach learner the value at sequence {}", UnsafeArg.of("value", bytes), SafeArg.of("sequence", seq), e); } }); } localLearner.learn(seq, finalValue); return finalValue.getData(); }

Target:
public byte[] propose(final long seq, @Nullable byte[] bytes) throws PaxosRoundFailureException { final PaxosProposalId proposalId = new PaxosProposalId(proposalNumber.incrementAndGet(), uuid); PaxosValue toPropose = new PaxosValue(uuid, seq, bytes); final PaxosValue finalValue = phaseOne(seq, proposalId, toPropose); phaseTwo(seq, proposalId, finalValue); for (final PaxosLearner learner : learners) { if (localLearner == learner) { continue; } executor.execute(() -> { try { learner.learn(seq, finalValue); } catch (Throwable e) { log.warn("Failed to teach learner the value at sequence {}", UnsafeArg.of("value", bytes), SafeArg.of("sequence", seq), e); } }); } localLearner.learn(seq, finalValue); return finalValue.getData(); }
Source:
public String getMessage(String key, String defaultMessage, Locale locale) { ResourceBundle bundle = getBundle(locale); try { String msg = new String(bundle.getString(key).getBytes("ISO-8859-1"), "UTF-8"); return MessageFormat.format(msg, new Object[]{}); } catch (MissingResourceException e) { log.debug("Couldn't load the property " + key); return defaultMessage; } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Couldn't load property from resource bundle", e); } }

Target:
public String getMessage(String key, String defaultMessage, Locale locale) { ResourceBundle bundle = getBundle(locale); try { String msg = new String(bundle.getString(key).getBytes("ISO-8859-1"), "UTF-8"); return MessageFormat.format(msg, new Object[]{}); } catch (MissingResourceException e) { log.debug("Couldn't load the property: ", key); return defaultMessage; } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Couldn't load property from resource bundle", e); } }
Source:
public String toString() { return toStringHelper() .add("networkAddress", networkAddress) .add("networkLength", networkLength) .add("portSubnet", portSubnet) .add("portAddress", portAddress) .add("portMac", portMac) .add("routerId", routerId) .add("routeIds", routeIds) .add("serviceContainerIds", serviceContainerId) .toString(); }

Target:
public String toString() { return toStringHelper() .add("networkAddress", networkAddress) .add("networkLength", networkLength) .add("portSubnet", portSubnet) .add("portAddress", portAddress) .add("portMac", portMac) .add("routerId", routerId) .add("routeIds", routeIds) .toString(); }