auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void prepareTestCase() throws MCSException, MalformedURLException, CloudException { URI uri = sourceDatasetHelper.prepareDatasetWithRecordsInside(SOURCE_PROVIDER_ID, SOURCE_DATASET_NAME, SOURCE_REPRESENTATION_NAME, SOURCE_REVISION_NAME, Tags.PUBLISHED.getTag(), RECORDS_NUMBERS); LOGGER.info("The source dataSet has been created! It is url is {}", SOURCE_DATASET_NAME, uri); destinationDatasetHelper.prepareEmptyDataset(DESTINATION_PROVIDER_ID, DESTINATION_DATASET_NAME); LOGGER.info("The destination dataSet has been created! It is url is ", DESTINATION_DATASET_NAME, uri); List<Representation> representations = sourceDatasetHelper.getRepresentationsInsideDataSetByName(SOURCE_PROVIDER_ID, SOURCE_DATASET_NAME, SOURCE_REPRESENTATION_NAME); for (Representation representation : representations) { destinationDatasetHelper.assignRepresentationVersionToDataSet(DESTINATION_PROVIDER_ID, DESTINATION_DATASET_NAME, representation.getCloudId(), representation.getRepresentationName(), representation.getVersion()); sourceDatasetHelper.grantPermissionToVersion(representation.getCloudId(), representation.getRepresentationName(), representation.getVersion(), appProperties.getProperty("destinationUserName"), Permission.READ); revisionServiceClient.addRevision(representation.getCloudId(), representation.getRepresentationName(), representation.getVersion(), DESTINATION_REVISION_NAME, DESTINATION_PROVIDER_ID, Tags.PUBLISHED.getTag()); } }

Target:
private void prepareTestCase() throws MCSException, MalformedURLException, CloudException { URI uri = sourceDatasetHelper.prepareDatasetWithRecordsInside(SOURCE_PROVIDER_ID, SOURCE_DATASET_NAME, SOURCE_REPRESENTATION_NAME, SOURCE_REVISION_NAME, Tags.PUBLISHED.getTag(), RECORDS_NUMBERS); LOGGER.info("The source dataSet has been created! Its url is {}", SOURCE_DATASET_NAME, uri); destinationDatasetHelper.prepareEmptyDataset(DESTINATION_PROVIDER_ID, DESTINATION_DATASET_NAME); LOGGER.info("The destination dataSet has been created! Its url is ", DESTINATION_DATASET_NAME, uri); List<Representation> representations = sourceDatasetHelper.getRepresentationsInsideDataSetByName(SOURCE_PROVIDER_ID, SOURCE_DATASET_NAME, SOURCE_REPRESENTATION_NAME); for (Representation representation : representations) { destinationDatasetHelper.assignRepresentationVersionToDataSet(DESTINATION_PROVIDER_ID, DESTINATION_DATASET_NAME, representation.getCloudId(), representation.getRepresentationName(), representation.getVersion()); sourceDatasetHelper.grantPermissionToVersion(representation.getCloudId(), representation.getRepresentationName(), representation.getVersion(), appProperties.getProperty("destinationUserName"), Permission.READ); revisionServiceClient.addRevision(representation.getCloudId(), representation.getRepresentationName(), representation.getVersion(), DESTINATION_REVISION_NAME, DESTINATION_PROVIDER_ID, Tags.PUBLISHED.getTag()); } }
Source:
public void testDistributedDistanceQuery() { assertUpdate(format("CREATE TABLE distance_partitioning AS SELECT spatial_partitioning(ST_Point(x, y), 100) as v " + "FROM (VALUES (0, 0, '0_0'), (1, 0, '1_0'), (3, 0, '3_0'), (10, 0, '10_0')) as a (x, y, name)"), 1); Session session = Session.builder(getSession()) .setSystemProperty(SPATIAL_PARTITIONING_TABLE_NAME, "distance_partitioning") .build(); testDistanceQuery(session); }

Target:
public void testDistributedDistanceQuery() { assertUpdate(format("CREATE TABLE distance_partitioning AS SELECT spatial_partitioning(ST_Point(x, y)) as v " + "FROM (VALUES (0, 0, '0_0'), (1, 0, '1_0'), (3, 0, '3_0'), (10, 0, '10_0')) as a (x, y, name)"), 1); Session session = Session.builder(getSession()) .setSystemProperty(SPATIAL_PARTITIONING_TABLE_NAME, "distance_partitioning") .build(); testDistanceQuery(session); }
Source:
public static OpenstackVolumeAuthenticationKeyUsageType fromValue(String v) { try { return valueOf(v.toUpperCase()); } catch (IllegalArgumentException e) { return null; } }

Target:
public static OpenstackVolumeAuthenticationKeyUsageType fromValue(String v) { try { return valueOf(v.toUpperCase()); } catch (IllegalArgumentException e) { log.error("The value isn't a valid Open Stack volume authentication key usage", v); log.error("Exception", e); return null; } }
Source:
public Mono<VoidResponse> stageBlockFromURL(String base64BlockID, URL sourceURL, BlobRange sourceRange) { return this.stageBlockFromURLWithResponse(base64BlockID, sourceURL, sourceRange, null, null, null); }

Target:
public Mono<Void> stageBlockFromURL(String base64BlockID, URL sourceURL, BlobRange sourceRange) { return this.stageBlockFromURLWithResponse(base64BlockID, sourceURL, sourceRange, null, null, null) .flatMap(FluxUtil::toMono); }
Source:
public static MapParser create(File file) throws IOException { String name = file.getName(); Matcher stuff = SESSION_PATTERN.matcher(name); if(!stuff.matches()) { return null; } long sessionId = Long.parseUnsignedLong(stuff.group(1), 16); LineIterator iter = FileUtils.lineIterator(file); NavigableMap<Long, MapEntry> entries = new TreeMap<>(); while (iter.hasNext()) { String line = iter.next(); Matcher matcher = MAPFILE_PATTERN.matcher(line); matcher.matches(); long addrLow = Long.parseUnsignedLong(matcher.group(1), 16); long addrHigh = Long.parseUnsignedLong(matcher.group(2), 16); Perms perms = Perms.create(matcher.group(3)); long offset = Long.parseLong(matcher.group(4), 16); char deviceHigh = (char) Integer.parseInt(matcher.group(5), 16); char deviceLow = (char) Integer.parseInt(matcher.group(6), 16); long iNode = Long.parseLong(matcher.group(7), 16); String pathName = matcher.group(8); entries.put(addrLow, new MapEntry(addrLow, addrHigh, perms, offset, deviceLow, deviceHigh, iNode, pathName)); } return new MapParser(sessionId, entries); }

Target:
public static MapParser create(File file) throws IOException { String name = file.getName(); Matcher sessionName = SESSION_PATTERN.matcher(name); if (!sessionName.matches()) { return null; } long sessionId = Long.parseUnsignedLong(sessionName.group(1), 16); LineIterator iter = FileUtils.lineIterator(file); NavigableMap<Long, MapEntry> entries = new TreeMap<>(); while (iter.hasNext()) { String line = iter.next(); Matcher matcher = MAPFILE_PATTERN.matcher(line); matcher.matches(); long addrLow = Long.parseUnsignedLong(matcher.group(1), 16); long addrHigh = Long.parseUnsignedLong(matcher.group(2), 16); Perms perms = Perms.create(matcher.group(3)); long offset = Long.parseLong(matcher.group(4), 16); char deviceHigh = (char) Integer.parseInt(matcher.group(5), 16); char deviceLow = (char) Integer.parseInt(matcher.group(6), 16); long iNode = Long.parseLong(matcher.group(7), 16); String pathName = matcher.group(8); entries.put(addrLow, new MapEntry(addrLow, addrHigh, perms, offset, deviceLow, deviceHigh, iNode, pathName)); } return new MapParser(sessionId, entries); }
Source:
public Void call() throws Exception { Objects.requireNonNull(acls, "New acls to be added not specified."); OzoneAddress address = new OzoneAddress(uri); address.ensureBucketAddress(); OzoneClient client = address.createClient(createOzoneConfiguration()); String volumeName = address.getVolumeName(); String bucketName = address.getBucketName(); if (isVerbose()) { System.out.printf("Volume Name : %s%n", volumeName); System.out.printf("Bucket Name : %s%n", bucketName); } OzoneObj obj = OzoneObjInfo.Builder.newBuilder() .setBucketName(bucketName) .setVolumeName(volumeName) .setResType(OzoneObj.ResourceType.BUCKET) .setStoreType(storeType == null ? OZONE : OzoneObj.StoreType.valueOf(storeType)) .build(); boolean result = client.getObjectStore().setAcl(obj, OzoneAcl.parseAcls(acls)); System.out.printf("%s%n", JsonUtils.toJsonStringWithDefaultPrettyPrinter( JsonUtils.toJsonString("Acl set successfully: " + result))); return null; }

Target:
public Void call() throws Exception { Objects.requireNonNull(acls, "Acls to be set not specified."); OzoneAddress address = new OzoneAddress(uri); address.ensureBucketAddress(); OzoneClient client = address.createClient(createOzoneConfiguration()); String volumeName = address.getVolumeName(); String bucketName = address.getBucketName(); if (isVerbose()) { System.out.printf("Volume Name : %s%n", volumeName); System.out.printf("Bucket Name : %s%n", bucketName); } OzoneObj obj = OzoneObjInfo.Builder.newBuilder() .setBucketName(bucketName) .setVolumeName(volumeName) .setResType(OzoneObj.ResourceType.BUCKET) .setStoreType(storeType == null ? OZONE : OzoneObj.StoreType.valueOf(storeType)) .build(); boolean result = client.getObjectStore().setAcl(obj, OzoneAcl.parseAcls(acls)); System.out.printf("%s%n", JsonUtils.toJsonStringWithDefaultPrettyPrinter( JsonUtils.toJsonString("Acl set successfully: " + result))); client.close(); return null; }
Source:
public static WebArchive deployment() { WebArchive war = ShrinkWrap.create(WebArchive.class, DEPLOYMENT); war.add(new UrlAsset(JspWithUnusedDoubleTestCase.class.getResource("jsp-with-unused-double.jsp")), "jsp-with-unused-double.jsp"); war.as(ZipExporter.class).exportTo(new File("/tmp", war.getName()), true); return war; }

Target:
public static WebArchive deployment() { WebArchive war = ShrinkWrap.create(WebArchive.class, DEPLOYMENT); war.add(new UrlAsset(JspWithUnusedDoubleTestCase.class.getResource("jsp-with-unused-double.jsp")), "jsp-with-unused-double.jsp"); return war; }
Source:
public CoordinatorConfig(Properties config) { _config = config; _properties = new VerifiableProperties(config); _cluster = _properties.getString(CONFIG_CLUSTER); _zkAddress = _properties.getString(CONFIG_ZK_ADDRESS); _zkSessionTimeout = _properties.getInt(CONFIG_ZK_SESSION_TIMEOUT, ZkClient.DEFAULT_SESSION_TIMEOUT); _zkConnectionTimeout = _properties.getInt(CONFIG_ZK_CONNECTION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT); _retryIntervalMs = _properties.getInt(CONFIG_RETRY_INTERVAL, 1000 ); _heartbeatPeriodMs = _properties.getLong(CONFIG_HEARTBEAT_PERIOD_MS, Duration.ofMinutes(1).toMillis()); _defaultTransportProviderName = _properties.getString(CONFIG_DEFAULT_TRANSPORT_PROVIDER, ""); _assignmentChangeThreadPoolThreadCount = _properties.getInt(CONFIG_DEFAULT_ASSIGNMENT_THREAD_COUNT, 1); }

Target:
public CoordinatorConfig(Properties config) { _config = config; _properties = new VerifiableProperties(config); _cluster = _properties.getString(CONFIG_CLUSTER); _zkAddress = _properties.getString(CONFIG_ZK_ADDRESS); _zkSessionTimeout = _properties.getInt(CONFIG_ZK_SESSION_TIMEOUT, ZkClient.DEFAULT_SESSION_TIMEOUT); _zkConnectionTimeout = _properties.getInt(CONFIG_ZK_CONNECTION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT); _retryIntervalMs = _properties.getInt(CONFIG_RETRY_INTERVAL, 1000 ); _heartbeatPeriodMs = _properties.getLong(CONFIG_HEARTBEAT_PERIOD_MS, Duration.ofMinutes(1).toMillis()); _defaultTransportProviderName = _properties.getString(CONFIG_DEFAULT_TRANSPORT_PROVIDER, ""); }
Source:
public long getTargetTxnId(String replPolicy, long sourceTxnId) throws MetaException { try { Connection dbConn = null; Statement stmt = null; try { lockInternal(); dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED); stmt = dbConn.createStatement(); List<Long> targetTxnIds = getTargetTxnIdList(replPolicy, Collections.singletonList(sourceTxnId), stmt); if (targetTxnIds.isEmpty()) { LOG.info("Txn not present for repl policy {}", sourceTxnId, replPolicy); return -1; } assert (targetTxnIds.size() == 1); return targetTxnIds.get(0); } catch (SQLException e) { LOG.debug("Going to rollback"); rollbackDBConn(dbConn); checkRetryable(dbConn, e, "getTargetTxnId(" + replPolicy + sourceTxnId + ")"); throw new MetaException("Unable to update transaction database " + StringUtils.stringifyException(e)); } finally { close(null, stmt, dbConn); unlockInternal(); } } catch (RetryException e) { return getTargetTxnId(replPolicy, sourceTxnId); } }

Target:
public long getTargetTxnId(String replPolicy, long sourceTxnId) throws MetaException { try { Connection dbConn = null; Statement stmt = null; try { lockInternal(); dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED); stmt = dbConn.createStatement(); List<Long> targetTxnIds = getTargetTxnIdList(replPolicy, Collections.singletonList(sourceTxnId), stmt); if (targetTxnIds.isEmpty()) { LOG.info("Txn not present for repl policy {}", sourceTxnId, replPolicy); return -1; } assert (targetTxnIds.size() == 1); return targetTxnIds.get(0); } catch (SQLException e) { LOG.debug("Going to rollback"); rollbackDBConn(dbConn); checkRetryable(dbConn, e, "getTargetTxnId(" + replPolicy + sourceTxnId + ")"); throw new MetaException("Unable to get target transaction id " + StringUtils.stringifyException(e)); } finally { close(null, stmt, dbConn); unlockInternal(); } } catch (RetryException e) { return getTargetTxnId(replPolicy, sourceTxnId); } }
Source:
public boolean prepare() throws Exception { if (!prepared) { prepared = true; super.prepare(); ProjectLauncher launcher = getProjectLauncher(); if (port > 0) { launcher.getRunProperties() .put(TESTER_PORT, "" + port); if (host != null) launcher.getRunProperties() .put(TESTER_HOST, "" + host); } launcher.getRunProperties() .put(TESTER_UNRESOLVED, getProject().getProperty(Constants.TESTUNRESOLVED, "true")); launcher.getRunProperties() .put(TESTER_DIR, getReportDir().getAbsolutePath()); launcher.getRunProperties() .put(TESTER_CONTINUOUS, "" + getContinuous()); if (getProject().isRunTrace()) launcher.getRunProperties() .put(TESTER_TRACE, "true"); Collection<String> testnames = getTests(); if (testnames.size() > 0) { launcher.getRunProperties() .put(TESTER_NAMES, Processor.join(testnames.stream() .map(ProjectTesterImpl::maybeQuote) .collect(Collectors.toList()))); } launcher.addDefault(Constants.DEFAULT_TESTER_BSN); launcher.prepare(); } return true; }

Target:
public boolean prepare() throws Exception { if (!prepared) { prepared = true; super.prepare(); ProjectLauncher launcher = getProjectLauncher(); if (port > 0) { launcher.getRunProperties() .put(TESTER_PORT, "" + port); if (host != null) launcher.getRunProperties() .put(TESTER_HOST, "" + host); } launcher.getRunProperties() .put(TESTER_UNRESOLVED, getProject().getProperty(Constants.TESTUNRESOLVED, "true")); launcher.getRunProperties() .put(TESTER_DIR, getReportDir().getAbsolutePath()); launcher.getRunProperties() .put(TESTER_CONTINUOUS, "" + getContinuous()); if (getProject().isRunTrace()) launcher.getRunProperties() .put(TESTER_TRACE, "true"); Collection<String> testnames = getTests(); if (testnames.size() > 0) { launcher.getRunProperties() .put(TESTER_NAMES, testnames.stream() .map(ProjectTesterImpl::maybeQuote) .collect(Collectors.joining(","))); } launcher.addDefault(Constants.DEFAULT_TESTER_BSN); launcher.prepare(); } return true; }
Source:
private static Object tryToGetTargetId(Message commandMessage) { try { final Object id = ID_FUNCTION.getId(commandMessage, CommandContext.getDefaultInstance()); return id; } catch (MissingEntityIdException | ClassCastException ignored) { return null; } }

Target:
static Object tryToGetTargetId(Message commandMessage) { try { final Object id = ID_FUNCTION.getId(commandMessage, CommandContext.getDefaultInstance()); return id; } catch (MissingEntityIdException | ClassCastException ignored) { return null; } }
Source:
public Properties getProviderSpecificProperties() { return null; }

Target:
public Properties getProviderSpecificProperties() { return new Properties(); }
Source:
private long getCommittedWriteSize(String uploadId) throws IOException { QueryWriteStatusRequest request = QueryWriteStatusRequest.newBuilder().setUploadId(uploadId).build(); SimpleResponseObserver<QueryWriteStatusResponse> responseObserver = new SimpleResponseObserver<>(); Retryer<Boolean> retryer = RetryerBuilder.<Boolean>newBuilder() .retryIfExceptionOfType(IOException.class) .retryIfRuntimeException() .withWaitStrategy(WaitStrategies.exponentialWait(2, 20_000, MILLISECONDS)) .withStopStrategy(StopStrategies.stopAfterAttempt(UPLOAD_RETRIES)) .build(); try { retryer.call( () -> { stub.withDeadlineAfter(QUERY_WRITE_STATUS_TIMEOUT.toMillis(), MILLISECONDS) .queryWriteStatus(request, responseObserver); try { responseObserver.done.await(); if (responseObserver.hasError()) { throw new IOException(responseObserver.getError()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } return null; }); } catch (Exception e) { throw new IOException( String.format("Failed to get committed write size for '%s'", getResourceString()), e); } return responseObserver.getResponse().getCommittedSize(); }

Target:
private long getCommittedWriteSize(String uploadId) throws IOException { QueryWriteStatusRequest request = QueryWriteStatusRequest.newBuilder().setUploadId(uploadId).build(); SimpleResponseObserver<QueryWriteStatusResponse> responseObserver = new SimpleResponseObserver<>(); Retryer retryer = getRetryer(); try { retryer.call( () -> { stub.withDeadlineAfter(QUERY_WRITE_STATUS_TIMEOUT.toMillis(), MILLISECONDS) .queryWriteStatus(request, responseObserver); responseObserver.done.await(); if (responseObserver.hasError()) { throw new IOException(responseObserver.getError()); } return null; }); } catch (Exception e) { if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } throw new IOException( String.format("Failed to get committed write size for '%s'", getResourceString()), e); } return responseObserver.getResponse().getCommittedSize(); }
Source:
private PhysicalOperation createMergeSource(RemoteSourceNode node, LocalExecutionPlanContext context) { context.setDriverInstanceCount(1); checkArgument(node.getOrderingScheme().isPresent(), "orderingScheme is absent"); OrderingScheme orderingScheme = node.getOrderingScheme().get(); List<Type> types = getSourceOperatorTypes(node, context.getTypes()); Map<Symbol, Integer> sourceLayout = makeLayoutFromOutputSymbols(node.getOutputSymbols()); List<Symbol> orderBySymbols = orderingScheme.getOrderBy(); List<Integer> sortChannels = getChannelsForSymbols(orderBySymbols, sourceLayout); List<SortOrder> sortOrder = orderingScheme.getOrderingList(); ImmutableList<Integer> outputChannels = IntStream.range(0, types.size()).boxed().collect(toImmutableList()); OperatorFactory operatorFactory = new MergeOperatorFactory( context.getNextOperatorId(), node.getId(), exchangeClientSupplier, new PagesSerdeFactory(blockEncodingSerde, isExchangeCompressionEnabled(session)), new SimplePageWithPositionComparator.Factory(), types, outputChannels, sortChannels, sortOrder); return new PhysicalOperation(operatorFactory, makeLayout(node), UNGROUPED_EXECUTION); }

Target:
private PhysicalOperation createMergeSource(RemoteSourceNode node, LocalExecutionPlanContext context) { context.setDriverInstanceCount(1); checkArgument(node.getOrderingScheme().isPresent(), "orderingScheme is absent"); OrderingScheme orderingScheme = node.getOrderingScheme().get(); List<Type> types = getSourceOperatorTypes(node, context.getTypes()); Map<Symbol, Integer> sourceLayout = makeLayoutFromOutputSymbols(node.getOutputSymbols()); List<Symbol> orderBySymbols = orderingScheme.getOrderBy(); List<Integer> sortChannels = getChannelsForSymbols(orderBySymbols, sourceLayout); List<SortOrder> sortOrder = orderingScheme.getOrderingList(); ImmutableList<Integer> outputChannels = IntStream.range(0, types.size()) .boxed() .collect(toImmutableList()); OperatorFactory operatorFactory = new MergeOperatorFactory( context.getNextOperatorId(), node.getId(), exchangeClientSupplier, new PagesSerdeFactory(blockEncodingSerde, isExchangeCompressionEnabled(session)), orderingCompiler, types, outputChannels, sortChannels, sortOrder); return new PhysicalOperation(operatorFactory, makeLayout(node), UNGROUPED_EXECUTION); }
Source:
public void init(final T model) { super.init(model); model.getPropertyChangedEvent().addListener((ev, sender, args) -> { NetworkModel model1 = (NetworkModel) sender; String propertyName = args.propertyName; if ("Message".equals(propertyName)) { getView().setMessageLabel(model1.getMessage()); } }); getView().toggleSubnetVisibility(model.getExport().getEntity()); model.getExport().getEntityChangedEvent().addListener((ev, sender, args) -> getView().toggleSubnetVisibility(model.getExport().getEntity())); getView().toggleProfilesVisibility(model.getProfiles().getIsAvailable()); model.getProfiles().getPropertyChangedEvent().addListener((ev, sender, args) -> { if ("IsAvailable".equals(args.propertyName)) { getView().toggleProfilesVisibility(model.getProfiles().getIsAvailable()); } }); getView().getQosButton().setCommand(model.getAddQosCommand()); getView().getQosButton().addClickHandler(event -> getView().getQosButton().getCommand().execute()); getView().addMtuEditor(); }

Target:
public void init(final T model) { super.init(model); model.getPropertyChangedEvent().addListener((ev, sender, args) -> { NetworkModel senderModel = (NetworkModel) sender; String propertyName = args.propertyName; if ("Message".equals(propertyName)) { getView().setMessageLabel(senderModel.getMessage()); } }); getView().toggleSubnetVisibility(model.getExport().getEntity()); model.getExport().getEntityChangedEvent().addListener((ev, sender, args) -> getView().toggleSubnetVisibility(model.getExport().getEntity())); getView().toggleProfilesVisibility(model.getProfiles().getIsAvailable()); model.getProfiles().getPropertyChangedEvent().addListener((ev, sender, args) -> { if ("IsAvailable".equals(args.propertyName)) { getView().toggleProfilesVisibility(model.getProfiles().getIsAvailable()); } }); getView().getQosButton().setCommand(model.getAddQosCommand()); getView().getQosButton().addClickHandler(event -> getView().getQosButton().getCommand().execute()); getView().addMtuEditor(); }
Source:
private void refreshExecutors() { synchronized (activeExecutors) { List<Pair<Executor, Future<String>>> futures = new ArrayList<Pair<Executor, Future<String>>>(); for (final Executor executor : activeExecutors) { Future<String> fetchExecutionInfo = executorInforRefresherService.submit(new Callable<String>() { @Override public String call() throws Exception { return callExecutorForJsonString(executor.getHost(), executor.getPort(), "/serverstatistics", null); } }); futures.add(new Pair<Executor, Future<String>>(executor, fetchExecutionInfo)); } boolean wasSuccess = true; for (Pair<Executor, Future<String>> refreshPair : futures) { Executor executor = refreshPair.getFirst(); try { String jsonString = refreshPair.getSecond().get(5, TimeUnit.SECONDS); executor.setExecutorInfo(ExecutorInfo.fromJSONString(jsonString)); logger.info("Successfully refreshed ExecutorInfo for executor: " + executor); } catch (TimeoutException e) { wasSuccess = false; logger.error("Timed out while waiting for ExecutorInfo refresh" + executor, e); } catch (Exception e) { wasSuccess = false; logger.error("Failed to update ExecutorInfo for executor : " + executor, e); } } if (wasSuccess) { lastSuccessfulExecutorInfoRefresh = System.currentTimeMillis(); } } }

Target:
private void refreshExecutors() { synchronized (activeExecutors) { List<Pair<Executor, Future<String>>> futures = new ArrayList<Pair<Executor, Future<String>>>(); for (final Executor executor : activeExecutors) { Future<String> fetchExecutionInfo = executorInforRefresherService.submit(new Callable<String>() { @Override public String call() throws Exception { return callExecutorForJsonString(executor.getHost(), executor.getPort(), "/serverStatistics", null); } }); futures.add(new Pair<Executor, Future<String>>(executor, fetchExecutionInfo)); } boolean wasSuccess = true; for (Pair<Executor, Future<String>> refreshPair : futures) { Executor executor = refreshPair.getFirst(); try { String jsonString = refreshPair.getSecond().get(5, TimeUnit.SECONDS); executor.setExecutorInfo(ExecutorInfo.fromJSONString(jsonString)); logger.info("Successfully refreshed ExecutorInfo for executor: " + executor); } catch (TimeoutException e) { wasSuccess = false; logger.error("Timed out while waiting for ExecutorInfo refresh" + executor, e); } catch (Exception e) { wasSuccess = false; logger.error("Failed to update ExecutorInfo for executor : " + executor, e); } } if (wasSuccess) { lastSuccessfulExecutorInfoRefresh = System.currentTimeMillis(); } } }
Source:
public void initialise() { renderingConfig = config.getRendering(); requiresCondition(() -> (renderingConfig.isVrSupport() && vrProvider != null && vrProvider.isInitialized() )); leftEye = requiresFBO(new FBOConfig(LEFT_EYE_FBO, FULL_SCALE, FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs); rightEye = requiresFBO(new FBOConfig(RIGHT_EYE_FBO,FULL_SCALE, FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs); if (this.vrProvider != null) { logger.info("Left eye FBOID:" + Integer.toString(leftEye.fboId)); logger.info("Right eye FBOID:" + Integer.toString(leftEye.fboId)); logger.info("OpenVR init done."); vrProvider.texType[0].handle = leftEye.colorBufferTextureId; vrProvider.texType[0].eColorSpace = JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma; vrProvider.texType[0].eType = JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL; vrProvider.texType[0].write(); vrProvider.texType[1].handle = rightEye.colorBufferTextureId; vrProvider.texType[1].eColorSpace = JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma; vrProvider.texType[1].eType = JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL; vrProvider.texType[1].write(); } addDesiredStateChange(new EnableMaterial("engine:prog.defaultTextured")); }

Target:
public void initialise() { renderingConfig = config.getRendering(); requiresCondition(() -> (renderingConfig.isVrSupport() && vrProvider.isInitialized() )); leftEye = requiresFBO(new FBOConfig(LEFT_EYE_FBO, FULL_SCALE, FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs); rightEye = requiresFBO(new FBOConfig(RIGHT_EYE_FBO,FULL_SCALE, FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs); if (vrProvider != null) { vrProvider.texType[0].handle = leftEye.colorBufferTextureId; vrProvider.texType[0].eColorSpace = JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma; vrProvider.texType[0].eType = JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL; vrProvider.texType[0].write(); vrProvider.texType[1].handle = rightEye.colorBufferTextureId; vrProvider.texType[1].eColorSpace = JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma; vrProvider.texType[1].eType = JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL; vrProvider.texType[1].write(); } addDesiredStateChange(new EnableMaterial("engine:prog.defaultTextured")); }
Source:
private Node convertAzkabanNodeToNode(final AzkabanNode azkabanNode, final String flowName, final File flowFile) { final Node node = new Node(azkabanNode.getName()); node.setType(azkabanNode.getType()); node.setPropsSource(flowFile.getName()); node.setJobSource(flowFile.getName()); if (azkabanNode.getType().equals(Constants.FLOW_NODE_TYPE)) { final String embeddedFlowId = flowName + Constants.PATH_DELIMITER + node.getId(); node.setEmbeddedFlowId(embeddedFlowId); final Flow flow_node = convertAzkabanFlowToFlow((AzkabanFlow) azkabanNode, embeddedFlowId, flowFile); flow_node.setEmbeddedFlow(true); this.flowMap.put(flow_node.getId(), flow_node); } return node; }

Target:
private Node convertAzkabanNodeToNode(final AzkabanNode azkabanNode, final String flowName, final File flowFile) { final Node node = new Node(azkabanNode.getName()); node.setType(azkabanNode.getType()); node.setPropsSource(flowFile.getName()); node.setJobSource(flowFile.getName()); if (azkabanNode.getType().equals(Constants.FLOW_NODE_TYPE)) { final String embeddedFlowId = flowName + Constants.PATH_DELIMITER + node.getId(); node.setEmbeddedFlowId(embeddedFlowId); final Flow flowNode = convertAzkabanFlowToFlow((AzkabanFlow) azkabanNode, embeddedFlowId, flowFile); flowNode.setEmbeddedFlow(true); this.flowMap.put(flowNode.getId(), flowNode); } return node; }
Source:
public int isMicMuted() { try { return mIm.isMicMuted(); } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } }

Target:
public boolean isMicMuted() { try { return mIm.isMicMuted(); } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } }
Source:
protected PGPKeysServerClientHttps(URI uri) throws URISyntaxException, CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException { super(uri); if ("hkps://hkps.pool.sks-keyservers.net".equalsIgnoreCase(uri.toString())) { final CertificateFactory cf = CertificateFactory.getInstance("X.509"); final Certificate ca = cf.generateCertificate(getClass().getClassLoader().getResourceAsStream("sks-keyservers.netCA.pem")); final KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); keyStore.load(null, null); keyStore.setCertificateEntry("ca", ca); final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init(keyStore); final SSLContext context = SSLContext.getInstance("TLS"); context.init(null, tmf.getTrustManagers(), null); this.sslSocketFactory = context.getSocketFactory(); } else { this.sslSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault(); } }

Target:
protected PGPKeysServerClientHttps(URI uri) throws URISyntaxException, CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException { super(uri); if ("hkps.pool.sks-keyservers.net".equalsIgnoreCase(uri.getHost())) { final CertificateFactory cf = CertificateFactory.getInstance("X.509"); final Certificate ca = cf.generateCertificate(getClass().getClassLoader().getResourceAsStream("sks-keyservers.netCA.pem")); final KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); keyStore.load(null, null); keyStore.setCertificateEntry("ca", ca); final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init(keyStore); final SSLContext context = SSLContext.getInstance("TLS"); context.init(null, tmf.getTrustManagers(), null); this.sslSocketFactory = context.getSocketFactory(); } else { this.sslSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault(); } }
Source:
public static boolean hasChunkedEncodingRequestBug( int[] version, HttpServletRequest request) { return compare(version, v1_7_5) == 0 && isChunked(request); }

Target:
public static boolean hasChunkedEncodingRequestBug( int[] version, HttpServletRequest request) { return false; }
Source:
public static boolean isPartitionsSystemTable(SchemaTableName tableName) { return tableName.getTableName().endsWith(PARTITIONS_TABLE_SUFFIX) && !tableName.getTableName().equals(PARTITIONS_TABLE_SUFFIX); }

Target:
public static boolean isPartitionsSystemTable(SchemaTableName tableName) { return tableName.getTableName().endsWith(PARTITIONS_TABLE_SUFFIX) && tableName.getTableName().length() > PARTITIONS_TABLE_SUFFIX.length(); }
Source:
private static String getFormattedMessage(String message, List<String> arguments){ if (arguments == null) { return message; } else { StringBuffer buffer = new StringBuffer(message); for (int i = 0; i < buffer.length(); ++i) { if (buffer.charAt(i) == '%') { if (buffer.charAt(++i) != '0' && Character.isDigit(buffer.charAt(i)) && !Character.isDigit(buffer.charAt(i + 1))) { int argumentNumber = Character.getNumericValue(buffer.charAt(i)) - 1; String argumentValue = arguments.get(argumentNumber); buffer.replace(i - 1, i + 1, argumentValue); i += argumentValue.length() - 2; } } } return buffer.toString(); } }

Target:
private static String getFormattedMessage(String message, List<String> arguments){ if (arguments == null || arguments.isEmpty()) { return message; } else { StringBuffer buffer = new StringBuffer(message); for (int i = 0; i < buffer.length(); ++i) { if (buffer.charAt(i) == '%') { if (buffer.charAt(++i) != '0' && Character.isDigit(buffer.charAt(i)) && !Character.isDigit(buffer.charAt(i + 1))) { int argumentNumber = Character.getNumericValue(buffer.charAt(i)) - 1; String argumentValue = arguments.get(argumentNumber); buffer.replace(i - 1, i + 1, argumentValue); i += argumentValue.length() - 2; } } } return buffer.toString(); } }
Source:
public Obs getObs(Obs obs, String view) { File file = getComplexDataFile(obs); if (ComplexObsHandler.RAW_VIEW.equals(view)) { try { String[] names = obs.getValueComplex().split("\\|"); String originalFilename = names[0]; originalFilename = originalFilename.replace(",", "").replace(" ", ""); FileInputStream mediaStream = new FileInputStream(file); ComplexData complexData = new ComplexData(originalFilename, mediaStream); String mimeType = getMimeTypeFromFile(file); mimeType = mimeType != null ? mimeType : "application/octet-stream"; complexData.setMimeType(mimeType); complexData.setLength(file.length()); obs.setComplexData(complexData); } catch (FileNotFoundException e) { log.error("Trying to create media file stream from " + file.getAbsolutePath(), e); } } else { return null; } return obs; }

Target:
public Obs getObs(Obs obs, String view) { File file = getComplexDataFile(obs); if (ComplexObsHandler.RAW_VIEW.equals(view)) { try { String[] names = obs.getValueComplex().split("\\|"); String originalFilename = names[0]; originalFilename = originalFilename.replace(",", "").replace(" ", ""); FileInputStream mediaStream = new FileInputStream(file); ComplexData complexData = new ComplexData(originalFilename, mediaStream); String mimeType = OpenmrsUtil.getFileMimeType(file); complexData.setMimeType(mimeType); complexData.setLength(file.length()); obs.setComplexData(complexData); } catch (FileNotFoundException e) { log.error("Trying to create media file stream from " + file.getAbsolutePath(), e); } } else { return null; } return obs; }
Source:
public void trimMemory(int level) { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "trimMemory, level=" + level); } if (level >= android.content.ComponentCallbacks2.TRIM_MEMORY_BACKGROUND) { clearMemory(); } else if (level >= android.content.ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) { trimToSize(getMaxSize() / 2); } else if (level == android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL) { trimToSize(getMaxSize() / 2); } }

Target:
public void trimMemory(int level) { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "trimMemory, level=" + level); } if (level >= android.content.ComponentCallbacks2.TRIM_MEMORY_BACKGROUND) { clearMemory(); } else if (level >= android.content.ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN || level == android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL) { trimToSize(getMaxSize() / 2); } }
Source:
public void run() { Throttle throttle = new SustainedConnectionThrottle(1); try { while (!doneFuture.isDone()) { Optional<SustainedConnection> currentConnection = SustainedConnectionWorker.this.findConnectionToMaintain(); if (currentConnection.isPresent()) { currentConnection.get().refresh(); } else { throttle.increment(); } } } catch (Exception e) { SustainedConnectionWorker.this.totalAborts.incrementAndGet(); SustainedConnectionWorker.log.error("Abort while maintaining sustained connections", e.getMessage()); } }

Target:
public void run() { try { while (!doneFuture.isDone()) { Optional<SustainedConnection> currentConnection = SustainedConnectionWorker.this.findConnectionToMaintain(); if (currentConnection.isPresent()) { currentConnection.get().refresh(); } else { SustainedConnectionWorker.SYSTEM_TIME.sleep(SustainedConnectionWorker.BACKOFF_PERIOD_MS); } } } catch (Exception e) { SustainedConnectionWorker.this.totalAbortedThreads.incrementAndGet(); SustainedConnectionWorker.log.error("Aborted thread while maintaining sustained connections", e); } }
Source:
public void testInstallStagedApk_VerifyPostReboot() throws Exception { assumeTrue("Current user is not system user", isSystemUser()); int sessionId = retrieveLastSessionId(); assertSessionApplied(sessionId); assertThat(getInstalledVersion(TEST_APP_A)).isEqualTo(1); }

Target:
public void testInstallStagedApk_VerifyPostReboot() throws Exception { assumeSystemUser(); int sessionId = retrieveLastSessionId(); assertSessionApplied(sessionId); assertThat(getInstalledVersion(TEST_APP_A)).isEqualTo(1); }
Source:
public void testList() { for (Vault vault : api().listVaults()) { assertNotNull(vault.name()); VaultProperties props = vault.properties(); assertNotNull(props); } }

Target:
public void testList() { for (Vault vault : api().listVaults()) { assertTrue(!vault.name().isEmpty()); } }
Source:
private static void validateKafkaConfig(List<ImportConfigurationType> configs) { if (configs.isEmpty()) { return; } HashMap<String, HashSet<String>> groupidToTopics = new HashMap<>(); for (ImportConfigurationType config : configs) { String groupid = ""; HashSet<String> topics = new HashSet<>(); for (PropertyType pt : config.getProperty()) { if (pt.getName().equals("topics")) { topics.addAll(Arrays.asList(pt.getValue().split("\\s*,\\s*"))); } else if (pt.getName().equals("groupid")) { groupid = pt.getValue(); } } if (groupidToTopics.containsKey(groupid)) { HashSet<String> union = new HashSet<>(groupidToTopics.get(groupid)); union.addAll(topics); if (union.size() == topics.size() + groupidToTopics.get(groupid).size()) { groupidToTopics.put(groupid, union); } else { VoltDB.crashLocalVoltDB("Two kafka configurations cannot have the same topic and groupid"); } } else { groupidToTopics.put(groupid, topics); } } }

Target:
private static void validateKafkaConfig(List<ImportConfigurationType> configs) { if (configs.isEmpty()) { return; } HashMap<String, HashSet<String>> groupidToTopics = new HashMap<>(); for (ImportConfigurationType config : configs) { String groupid = ""; HashSet<String> topics = new HashSet<>(); for (PropertyType pt : config.getProperty()) { if (pt.getName().equals("topics")) { topics.addAll(Arrays.asList(pt.getValue().split("\\s*,\\s*"))); } else if (pt.getName().equals("groupid")) { groupid = pt.getValue(); } } if (groupidToTopics.containsKey(groupid)) { HashSet<String> union = new HashSet<>(groupidToTopics.get(groupid)); union.addAll(topics); if (union.size() == (topics.size() + groupidToTopics.get(groupid).size())) { groupidToTopics.put(groupid, union); } else { throw new RuntimeException("Invalid import configuration. Two Kafka entries have the same groupid and topic."); } } else { groupidToTopics.put(groupid, topics); } } }
Source:
public void setUniverse(int universe) { if (universe < 1) { this.universe = 1; logger.warn("coercing universe number to allowed minimum of 1"); } else if (universe > 63999) { this.universe = 63999; logger.warn("coercing universe number to allowes maximum of 63999"); } else { this.universe = universe; } rawPacket[113] = (byte) (this.universe / 256); rawPacket[114] = (byte) (this.universe % 256); String senderName = new String("openHAB DMX <" + String.format("%05d", this.universe) + ">"); byte[] senderNameBytes = senderName.getBytes(StandardCharsets.UTF_8); for (int i = 0; i < senderName.length(); i++) { rawPacket[44 + i] = senderNameBytes[i]; } broadcastNode = new E131Node(new String( "239.255." + String.format("%d", rawPacket[113]) + "." + String.format("%d", rawPacket[114]))); logger.debug("set packet universe to {}", this.universe); }

Target:
public void setUniverse(int universe) { if (universe < 1) { this.universe = 1; logger.warn("coercing universe number to allowed minimum of 1"); } else if (universe > 63999) { this.universe = 63999; logger.warn("coercing universe number to allowed maximum of 63999"); } else { this.universe = universe; } rawPacket[113] = (byte) (this.universe / 256); rawPacket[114] = (byte) (this.universe % 256); String senderName = new String("openHAB DMX <" + String.format("%05d", this.universe) + ">"); byte[] senderNameBytes = senderName.getBytes(StandardCharsets.UTF_8); for (int i = 0; i < senderName.length(); i++) { rawPacket[44 + i] = senderNameBytes[i]; } broadcastNode = new E131Node(new String( "239.255." + String.format("%d", rawPacket[113]) + "." + String.format("%d", rawPacket[114]))); logger.debug("set packet universe to {}", this.universe); }
Source:
public WebClient() { super(BrowserVersion.FIREFOX_38); setPageCreator(HudsonPageCreator.INSTANCE); clients.add(this); setAjaxController(new AjaxController() { private static final long serialVersionUID = -5844060943564822678L; public boolean processSynchron(HtmlPage page, WebRequest settings, boolean async) { return false; } }); setCssErrorHandler(new ErrorHandler() { final ErrorHandler defaultHandler = new DefaultCssErrorHandler(); public void warning(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.warning(exception); } public void error(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.error(exception); } public void fatalError(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.fatalError(exception); } private boolean ignore(CSSParseException e) { String uri = e.getURI(); return uri.contains("/yui/") || uri.contains("/css/style.css") || uri.contains("/css/responsive-grid.css"); } }); getJavaScriptEngine().getContextFactory().addListener(new ContextFactory.Listener() { public void contextCreated(Context cx) { if (cx.getDebugger() == null) cx.setDebugger(jsDebugger, null); } public void contextReleased(Context cx) { } }); }

Target:
public WebClient() { super(BrowserVersion.FIREFOX_38); setPageCreator(HudsonPageCreator.INSTANCE); clients.add(this); setAjaxController(new AjaxController() { private static final long serialVersionUID = -76034615893907856L; public boolean processSynchron(HtmlPage page, WebRequest settings, boolean async) { return false; } }); setCssErrorHandler(new ErrorHandler() { final ErrorHandler defaultHandler = new DefaultCssErrorHandler(); public void warning(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.warning(exception); } public void error(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.error(exception); } public void fatalError(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.fatalError(exception); } private boolean ignore(CSSParseException e) { String uri = e.getURI(); return uri.contains("/yui/") || uri.contains("/css/style.css") || uri.contains("/css/responsive-grid.css"); } }); getJavaScriptEngine().getContextFactory().addListener(new ContextFactory.Listener() { public void contextCreated(Context cx) { if (cx.getDebugger() == null) cx.setDebugger(jsDebugger, null); } public void contextReleased(Context cx) { } }); }
Source:
public int hashCode() { int result = (int) (_networkId ^ (_networkId >>> 32)); result = 31 * result + (_networkDomainUuid != null ? _networkDomainUuid.hashCode() : 0); result = 31 * result + (_networkUuid != null ? _networkUuid.hashCode() : 0); result = 31 * result + (_networkName != null ? _networkName.hashCode() : 0); result = 31 * result + (_vpcOrSubnetUuid != null ? _vpcOrSubnetUuid.hashCode() : 0); result = 31 * result + (_isL2Network ? 1 : 0); result = 31 * result + (_isL3Network ? 1 : 0); result = 31 * result + (_isVpc ? 1 : 0); result = 31 * result + (_isShared ? 1 : 0); result = 31 * result + (_domainTemplateName != null ? _domainTemplateName.hashCode() : 0); result = 31 * result + (_isFirewallServiceSupported ? 1 : 0); result = 31 * result + (_dnsServers != null ? _dnsServers.hashCode() : 0); result = 31 * result + (_ingressFirewallRules != null ? _ingressFirewallRules.hashCode() : 0); result = 31 * result + (_egressFirewallRules != null ? _egressFirewallRules.hashCode() : 0); result = 31 * result + (_acsFipUuid != null ? _acsFipUuid.hashCode() : 0); result = 31 * result + (_egressDefaultPolicy ? 1 : 0); return result; }

Target:
public int hashCode() { int result = super.hashCode(); result = 31 * result + (int) (_networkId ^ (_networkId >>> 32)); result = 31 * result + (_networkDomainUuid != null ? _networkDomainUuid.hashCode() : 0); result = 31 * result + (_networkUuid != null ? _networkUuid.hashCode() : 0); result = 31 * result + (_networkName != null ? _networkName.hashCode() : 0); result = 31 * result + (_vpcOrSubnetUuid != null ? _vpcOrSubnetUuid.hashCode() : 0); result = 31 * result + (_isL2Network ? 1 : 0); result = 31 * result + (_isL3Network ? 1 : 0); result = 31 * result + (_isVpc ? 1 : 0); result = 31 * result + (_isShared ? 1 : 0); result = 31 * result + (_domainTemplateName != null ? _domainTemplateName.hashCode() : 0); result = 31 * result + (_isFirewallServiceSupported ? 1 : 0); result = 31 * result + (_dnsServers != null ? _dnsServers.hashCode() : 0); result = 31 * result + (_ingressFirewallRules != null ? _ingressFirewallRules.hashCode() : 0); result = 31 * result + (_egressFirewallRules != null ? _egressFirewallRules.hashCode() : 0); result = 31 * result + (_acsFipUuid != null ? _acsFipUuid.hashCode() : 0); result = 31 * result + (_egressDefaultPolicy ? 1 : 0); return result; }
Source:
protected EditableConfiguration transform(Configuration value) { try { EditableConfiguration val = this.getValue(); if (val != null) { val.close(); }; return new EditableConfiguration( value, valueOrEmptyCollection(configServer.iocs()), valueOrEmptyCollection(configServer.componentDetails()), valueOrEmptyCollection(configServer.pvs())); } catch (RuntimeException e) { LoggerUtils.logErrorWithStackTrace(LOG, e.getMessage(), e); throw e; } }

Target:
protected EditableConfiguration transform(Configuration value) { try { EditableConfiguration val = this.getValue(); if (val != null) { val.close(); } return new EditableConfiguration( value, valueOrEmptyCollection(configServer.iocs()), valueOrEmptyCollection(configServer.componentDetails()), valueOrEmptyCollection(configServer.pvs())); } catch (RuntimeException e) { LoggerUtils.logErrorWithStackTrace(LOG, e.getMessage(), e); throw e; } }
Source:
public void setCustomAttribute(String attributeName, String attributeValue) { requireCustomAttributesEnabled("setCustomAttribute"); requireNotNullOrEmpty(attributeName, "attributeName must not be null or empty"); synchronized (customAttributes) { customAttributes.put(attributeName, attributeValue); } }

Target:
public void setCustomAttribute(String attributeName, String attributeValue) { requireCustomAttributesEnabled(); requireNotNullOrEmpty(attributeName, "attributeName must not be null or empty"); failIfRegistered(attributeName); requireCustomAttributes(); customAttributes.put(attributeName, attributeValue); }
Source:
private HashSet<NativeType> getTypes(TypeDefinition typeDefinition){ HashSet<NativeType> choiceTypes = new HashSet<>(); if (typeDefinition instanceof TypeChoiceDefinition){ choiceTypes = getTypes(((TypeChoiceDefinition) typeDefinition).left()); HashSet<NativeType> right = getTypes(((TypeChoiceDefinition) typeDefinition).right()); if (right!=null){ choiceTypes.addAll(right); } } else if (typeDefinition instanceof TypeDefinitionLink){ return getTypes(((TypeDefinitionLink) typeDefinition).linkedType()); } else if (typeDefinition instanceof TypeInlineDefinition){ choiceTypes.add(((TypeInlineDefinition) typeDefinition).nativeType()); } return choiceTypes; }

Target:
private Set<NativeType> getTypes(TypeDefinition typeDefinition){ Set<NativeType> choiceTypes = new HashSet<>(); if (typeDefinition instanceof TypeChoiceDefinition){ choiceTypes = getTypes(((TypeChoiceDefinition) typeDefinition).left()); Set<NativeType> right = getTypes(((TypeChoiceDefinition) typeDefinition).right()); if (right!=null){ choiceTypes.addAll(right); } } else if (typeDefinition instanceof TypeDefinitionLink){ return getTypes(((TypeDefinitionLink) typeDefinition).linkedType()); } else if (typeDefinition instanceof TypeInlineDefinition){ choiceTypes.add(((TypeInlineDefinition) typeDefinition).nativeType()); } return choiceTypes; }
Source:
private boolean addToAssignmentRecord(AssignableReplica replica, Map<String, Set<String>> currentAssignments) { String resourceName = replica.getResourceName(); if (currentAssignments.containsKey(resourceName)) { return currentAssignments.get(resourceName).add(replica.getPartitionName()); } else { Set<String> replicaSet = new HashSet<>(); replicaSet.add(replica.getPartitionName()); currentAssignments.put(resourceName, replicaSet); return true; } }

Target:
private boolean addToAssignmentRecord(AssignableReplica replica, Map<String, Set<String>> currentAssignments) { return currentAssignments.computeIfAbsent(replica.getResourceName(), k -> new HashSet<>()) .add(replica.getPartitionName()); }
Source:
public XYChartConsumer(List<XYSeriesConsumer> series, @Nullable IConsumerAggregator xAggregator, @Nullable IConsumerAggregator yAggregator) { fSeries = series; fXAggregator = xAggregator; fYAggregator = yAggregator; }

Target:
public XYChartConsumer(List<XYSeriesConsumer> series, @Nullable IConsumerAggregator xAggregator, @Nullable IConsumerAggregator yAggregator) { fSeries = ImmutableList.copyOf(series); fXAggregator = xAggregator; fYAggregator = yAggregator; }