auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void logUnsatisfiedRequest(Map<PerformanceIndex, Long> requestPerfToCheck) { StringBuilder sb = new StringBuilder(); sb.append("Unsatisfied request: ").append(request.getUri()).append(" method=").append(request.getRestMethod()); if (request.getRestMethod() == RestMethod.POST) { sb.append("; location=").append((String) getHeader(RestUtils.Headers.LOCATION)); } sb.append("; status=").append(responseStatus.getStatusCode()); Object blobSize = getHeader(RestUtils.Headers.BLOB_SIZE); if (blobSize != null) { sb.append("; blob size=").append((String) blobSize); } for (Map.Entry<PerformanceIndex, Long> entry : requestPerfToCheck.entrySet()) { sb.append("; ").append(entry.getKey().toString()).append(": ").append(entry.getValue()); if (entry.getKey() == PerformanceIndex.AverageBandwidth) { sb.append("bytes/sec"); } else { sb.append("ms"); } } logger.warn(sb.toString()); }

Target:
private void logUnsatisfiedRequest(Map<PerformanceIndex, Long> requestPerfToCheck) { StringBuilder sb = new StringBuilder(); sb.append("Unsatisfied request: uri=").append(request.getUri()).append("; method=").append(request.getRestMethod()); if (request.getRestMethod() == RestMethod.POST) { sb.append("; location=").append((String) getHeader(RestUtils.Headers.LOCATION)); } sb.append("; status=").append(responseStatus.getStatusCode()); Object blobSize = getHeader(RestUtils.Headers.BLOB_SIZE); if (blobSize != null) { sb.append("; blob size=").append((String) blobSize); } for (Map.Entry<PerformanceIndex, Long> entry : requestPerfToCheck.entrySet()) { sb.append("; ").append(entry.getKey().toString()).append("=").append(entry.getValue()); if (entry.getKey() == PerformanceIndex.AverageBandwidth) { sb.append("bytes/sec"); } else { sb.append("ms"); } } logger.warn(sb.toString()); }
Source:
protected void execute(ProcessContext process) throws Exception { VirtualFile sourceFile = process.require(SOURCE_PARAMETER); Optional<VirtualFile> destinationDirectory = DESTINATION_PARAMETER.get(process.getContext()); boolean shouldOverwriteExisting = process.require(OVERWRITE_EXISTING_FILES_PARAMETER); final VirtualFile targetDirectory = destinationDirectory.orElseGet(() -> vfs.resolve(sourceFile.parent().path())); sourceFile.tryDownload().ifPresent(handleArchiveExtraction(process, shouldOverwriteExisting, targetDirectory)); }

Target:
protected void execute(ProcessContext process) throws Exception { VirtualFile sourceFile = process.require(SOURCE_PARAMETER); Optional<VirtualFile> destinationDirectory = DESTINATION_PARAMETER.get(process.getContext()); boolean shouldOverwriteExisting = process.require(OVERWRITE_EXISTING_FILES_PARAMETER); final VirtualFile targetDirectory = destinationDirectory.orElseGet(() -> vfs.resolve(sourceFile.parent().path())); sourceFile.tryDownload() .ifPresent(handle -> handleArchiveExtraction(process, handle, shouldOverwriteExisting, targetDirectory)); }
Source:
public static Stub authenticateStub(Stub stub, String sessionCookie, String backendURL) { long soTimeout = 5 * 60 * 1000; ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setTimeOutInMilliSeconds(soTimeout); System.out.println("XXXXXXXXXXXXXXXXXXX" + backendURL + client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", "")); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie); option.setTo(new EndpointReference(backendURL + client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", ""))); if (log.isDebugEnabled()) { log.debug("AuthenticateStub : Stub created with session " + sessionCookie); } return stub; }

Target:
public static Stub authenticateStub(Stub stub, String sessionCookie, String backendURL) { long soTimeout = 5 * 60 * 1000; ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setTimeOutInMilliSeconds(soTimeout); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie); option.setTo(new EndpointReference(backendURL + client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", ""))); if (log.isDebugEnabled()) { log.debug("AuthenticateStub : Stub created with session " + sessionCookie); } return stub; }
Source:
protected Value<Boolean> getValueGetter() { return Sponge.getRegistry().getValueFactory().createValue((Key<Value<Boolean>>) this.usedKey, getValue(), this.defaultValue); }

Target:
protected Value<Boolean> getValueGetter() { return Sponge.getRegistry().getValueFactory().createValue((Key<Value<Boolean>>) this.usedKey, this.value, this.defaultValue); }
Source:
public FVClassifier(FVEventLoop loop, SocketChannel sock) { this.loop = loop; this.switchName = "unidentified:" + sock.toString(); this.factory = new FVMessageFactory(); this.stats = new SendRecvDropStats(); try { this.msgStream = new FVMessageAsyncStream(sock, this.factory, this, this.stats); } catch (IOException e) { logger.error(this.getName()+"IOException in constructor!"); e.printStackTrace(); } this.sock = sock; this.switchInfo = null; this.doneID = false; this.floodPermsSlice = ""; this.slicerMap = new HashMap<String, FVSlicer>(); this.xidTranslator = new XidTranslator(); this.missSendLength = 128; this.switchFlowMap = null; this.activePorts = new HashSet<Short>(); this.wantStatsDescHack = true; FlowvisorImpl.addListener(this); try { setFlowTracking(FlowvisorImpl.getProxy().gettrack_flows()); } catch (ConfigError e) { setFlowTracking(false); } }

Target:
public FVClassifier(FVEventLoop loop, SocketChannel sock) { this.loop = loop; this.switchName = "unidentified:" + sock.toString(); this.factory = new FVMessageFactory(); this.stats = new SendRecvDropStats(); try { this.msgStream = new FVMessageAsyncStream(sock, this.factory, this, this.stats); } catch (IOException e) { logger.error(this.getName(),"IOException in constructor!"); e.printStackTrace(); } this.sock = sock; this.switchInfo = null; this.doneID = false; this.floodPermsSlice = ""; this.slicerMap = new HashMap<String, FVSlicer>(); this.xidTranslator = new XidTranslator(); this.missSendLength = 128; this.switchFlowMap = null; this.activePorts = new HashSet<Short>(); this.wantStatsDescHack = true; FlowvisorImpl.addListener(this); try { setFlowTracking(FlowvisorImpl.getProxy().gettrack_flows()); } catch (ConfigError e) { setFlowTracking(false); } }
Source:
public static EnvironmentVariableConfig fromJSON(JsonReader jsonReader) { String name = jsonReader.getString("name"); Boolean secure = jsonReader.optBoolean("secure").orElse(false); Optional<String> optValue = jsonReader.optString("value"); Optional<String> optEncValue = jsonReader.optString("encrypted_value"); if (!optValue.isPresent() && !optEncValue.isPresent()) { HaltApiResponses.haltBecauseOfReason("Environment variable must contain either 'value' or 'encrypted_value'"); } String value = secure ? optValue.orElse(null) : jsonReader.getString("value"); String encryptedValue = optEncValue.orElse(null); try { EnvironmentVariableConfig environmentVariableConfig = new EnvironmentVariableConfig(); environmentVariableConfig.deserialize(name, value, secure, encryptedValue); return environmentVariableConfig; } catch (CryptoException e) { throw new InvalidGoCipherTextRuntimeException(e.getMessage(), e); } }

Target:
public static EnvironmentVariableConfig fromJSON(JsonReader jsonReader) { String name = jsonReader.getString("name"); Boolean secure = jsonReader.optBoolean("secure").orElse(false); Optional<String> optValue = jsonReader.optString("value"); Optional<String> optEncValue = jsonReader.optString("encrypted_value"); if (!optValue.isPresent() && !optEncValue.isPresent()) { HaltApiResponses.haltBecauseOfReason("Environment variable must contain either 'value' or 'encrypted_value'"); } String value = secure ? optValue.orElse(null) : jsonReader.getString("value"); String encryptedValue = optEncValue.orElse(null); EnvironmentVariableConfig environmentVariableConfig = new EnvironmentVariableConfig(); try { environmentVariableConfig.deserialize(name, value, secure, encryptedValue); } catch (CryptoException e) { environmentVariableConfig.addError(name, e.getMessage()); } return environmentVariableConfig; }
Source:
public int sample_value() { checkHasParams(); if (lambda < 15) return sampleSmall(lambda); double alpha = 7.0 / 8.0; int m = (int) Math.floor(alpha * lambda); double x = Gamma.sampleVal(m, 1); int r; if (x < lambda) { Poisson poiss = new Poisson(); poiss.setParams(lambda - x); r = m + poiss.sample_value(); } else { r = Binomial.sampleVal(m - 1, lambda / x); } return r; }

Target:
public int sample_value() { checkHasParams(); return sample_value(lambda); }
Source:
protected void makeChangesAndCommit(String projectName) throws Exception { changeFilesInProject(); Thread.sleep(1000); commit(projectName); }

Target:
protected void makeChangesAndCommit(String projectName) throws Exception { changeFilesInProject(); commit(projectName); }
Source:
public void testEnforceValidityErrorsAndWarnings() throws Exception { Dictionary<String, Object> markerPluginProps = configureValidationMarkerPlugin( Collections.singletonList(SAMPLE_VALIDATOR), true, true, getAdminConfig()); ingestXmlFromResourceWaitForFailure(WARNING_METACARD); String cleanId = ingestXmlFromResourceAndWait(CLEAN_METACARD); ingestXmlFromResourceWaitForFailure(ERROR_METACARD); query(cleanId, TRANSFORMER_XML, HttpStatus.SC_OK); String warningData = getFileContent(WARNING_METACARD); String errorData = getFileContent(ERROR_METACARD); update(cleanId, warningData, MediaType.APPLICATION_XML, HttpStatus.SC_BAD_REQUEST); update(cleanId, errorData, MediaType.APPLICATION_XML, HttpStatus.SC_BAD_REQUEST); configureValidationMarkerPlugin(markerPluginProps, getAdminConfig()); }

Target:
public void testEnforceValidityErrorsAndWarnings() throws Exception { Dictionary<String, Object> markerPluginProps = configureValidationMarkerPlugin( Collections.singletonList(SAMPLE_VALIDATOR), true, true, getAdminConfig()); try { ingestXmlFromResourceWaitForFailure(WARNING_METACARD); String cleanId = ingestXmlFromResourceAndWait(CLEAN_METACARD); ingestXmlFromResourceWaitForFailure(ERROR_METACARD); query(cleanId, TRANSFORMER_XML, HttpStatus.SC_OK); String warningData = getFileContent(WARNING_METACARD); String errorData = getFileContent(ERROR_METACARD); update(cleanId, warningData, MediaType.APPLICATION_XML, HttpStatus.SC_BAD_REQUEST); update(cleanId, errorData, MediaType.APPLICATION_XML, HttpStatus.SC_BAD_REQUEST); } finally { configureValidationMarkerPlugin(markerPluginProps, getAdminConfig()); } }
Source:
public DatacenterIdListFilters paginationOptions(final PaginationOptions paginationOptions) { if (paginationOptions.orderBy() != null) { this.queryParameters.put("orderBy", paginationOptions.orderBy()); } if (paginationOptions.pageNumber() != null) { this.queryParameters.put("pageNumber", paginationOptions.pageNumber()); } if (paginationOptions.pageSize() != null) { this.queryParameters.put("pageSize", paginationOptions.pageSize()); } return this; }

Target:
public DatacenterIdListFilters paginationOptions(final PaginationOptions paginationOptions) { this.queryParameters.putAll(paginationOptions.buildQueryParameters()); return this; }
Source:
public static UdpOutboundChannelAdapterSpec outboundMulticastAdapter(String destinationExpression) { return new UdpMulticastOutboundChannelAdapterSpec(destinationExpression); }

Target:
public static UdpMulticastOutboundChannelAdapterSpec outboundMulticastAdapter(String destinationExpression) { return new UdpMulticastOutboundChannelAdapterSpec(destinationExpression); }
Source:
private Tuple getFunctionSpecificInput(String funcName, int dataStart, int dataEnd) { if (funcName.equals("first_value")) { if (dataStart <= dataEnd && dataStart >= 0 && dataStart < accumulatedInTuples.size()) { return accumulatedInTuples.get(dataStart); } } else if (funcName.equals("last_value")) { if (dataStart <= dataEnd && dataEnd >= 0 && dataEnd < accumulatedInTuples.size()) { return accumulatedInTuples.get(dataEnd); } } return null; }

Target:
private Tuple getFunctionSpecificInput(String funcName, int dataStart, int dataEnd) { if (funcName.equals("first_value")) { dataStart = Math.max(dataStart, 0); if (dataStart <= dataEnd && dataStart < accumulatedInTuples.size()) { return accumulatedInTuples.get(dataStart); } } else if (funcName.equals("last_value")) { dataEnd = Math.min(dataEnd, accumulatedInTuples.size() - 1); if (dataStart <= dataEnd && dataEnd >= 0) { return accumulatedInTuples.get(dataEnd); } } return null; }
Source:
public void resetAllRuleConfigValues() { for (RuleConfig rc : ruleConfigs.values()) { rc.reset(); } }

Target:
public void resetAllRuleConfigValues() { for (RuleConfig rc : ruleConfigs.values()) { rc.reset(); this.getConfig().setProperty(rc.getKey(), rc.getValue()); } }
Source:
public Response registerPushApplication(PushApplication pushApp) { try { validateModelClass(pushApp); } catch (ConstraintViolationException cve) { return createBadRequestResponse(cve.getConstraintViolations()).build(); } try { pushAppService.addPushApplication(pushApp); } catch (IllegalArgumentException e) { return Response.status(Status.CONFLICT).entity(e.getMessage()).build(); } URI uri = UriBuilder .fromResource(PushApplicationEndpoint.class) .path(pushApp.getPushApplicationID()) .build(); return Response .created(uri) .entity(pushApp) .build(); }

Target:
public Response registerPushApplication(PushApplication pushApp) { try { validateModelClass(pushApp); } catch (ConstraintViolationException cve) { return createBadRequestResponse(cve.getConstraintViolations()).build(); } try { pushAppService.addPushApplication(pushApp); } catch (IllegalArgumentException e) { return Response.status(Status.CONFLICT).entity(e.getMessage()).build(); } final URI uri = UriBuilder.fromResource(PushApplicationEndpoint.class) .path(pushApp.getPushApplicationID()) .build(); return Response .created(uri) .entity(pushApp) .build(); }
Source:
public LogReplicationEntry processMsgAndBuffer(LogReplicationEntry dataMessage) { if (verifyMessageType(dataMessage) == false) return null; long preTs = getPreSeq(dataMessage); long currentTs = getCurrentSeq(dataMessage); if (preTs == lastProcessedSeq) { log.trace("Received in order message={}, lastProcessed={}", currentTs, lastProcessedSeq); sinkManager.processMessage(dataMessage); ackCnt++; lastProcessedSeq = getCurrentSeq(dataMessage); processBuffer(); } else if (currentTs > lastProcessedSeq && buffer.size() < maxSize) { log.debug("Received unordered message, buffer={}, lastProcessed={}", currentTs, lastProcessedSeq); buffer.put(preTs, dataMessage); } if (shouldAck()) { LogReplicationEntryMetadata metadata = makeAckMessage(dataMessage); return new LogReplicationEntry(metadata, new byte[0]); } return null; }

Target:
public LogReplicationEntry processMsgAndBuffer(LogReplicationEntry dataMessage) { if (!verifyMessageType(dataMessage)) { log.warn("Received invalid message type {}", dataMessage.getMetadata()); return null; } long preTs = getPreSeq(dataMessage); long currentTs = getCurrentSeq(dataMessage); if (preTs <= lastProcessedSeq && currentTs > lastProcessedSeq) { log.trace("Received in order message={}, lastProcessed={}", currentTs, lastProcessedSeq); sinkManager.processMessage(dataMessage); ackCnt++; lastProcessedSeq = getCurrentSeq(dataMessage); processBuffer(); } else if (currentTs > lastProcessedSeq && buffer.size() < maxSize) { log.debug("Received unordered message, currentTs={}, lastProcessed={}", currentTs, lastProcessedSeq); buffer.put(preTs, dataMessage); } if (shouldAck()) { LogReplicationEntryMetadata metadata = makeAckMessage(dataMessage); log.trace("Sending an ACK {}", metadata); return new LogReplicationEntry(metadata); } return null; }
Source:
public void testTimedMetric() { WebClient.create(base.toExternalForm()) .path("/weather/day/status") .get(String.class); final String metricPath = "/metrics/application/weather_day_status"; assertPrometheusFormat(metricPath); assertJsonFormat(metricPath); }

Target:
public void testTimedMetric() { WebTarget webTarget = client.target(base.toExternalForm()); webTarget .path("/weather/day/status") .request().buildGet().invoke(); final String metricPath = "/metrics/application/weather_day_status"; assertPrometheusFormat(metricPath); assertJsonFormat(metricPath); }
Source:
public WebApplicationExceptionCatchingFilter(ContainerRequestFilter underlying) { this.underlying = underlying; }

Target:
public WebApplicationExceptionCatchingFilter(ContainerRequestFilter underlying) { Preconditions.checkNotNull(underlying, "Underlying ContainerRequestFilter is not set"); this.underlying = underlying; }
Source:
public Intent build() { if (mAllowNewEmailAccounts != null) { for (IdpConfig provider : mProviders) { if (provider.getProviderId().equals(EmailAuthProvider.PROVIDER_ID)) { mProviders.set(mProviders.indexOf(provider), new IdpConfig.EmailBuilder() .setAllowNewAccounts(mAllowNewEmailAccounts) .build()); break; } } } return super.build(); }

Target:
public Intent build() { if (mAllowNewEmailAccounts != null) { for (int i = 0; i < mProviders.size(); i++) { if (mProviders.get(i).getProviderId().equals(EmailAuthProvider.PROVIDER_ID)) { mProviders.set(i, new IdpConfig.EmailBuilder() .setAllowNewAccounts(mAllowNewEmailAccounts) .build()); break; } } } return super.build(); }
Source:
public void beforeSigningInTest() { passwordCredentialType = signingInPage.getCredentialType(PasswordCredentialModel.TYPE); RealmRepresentation realm = testRealmResource().toRepresentation(); testingClient.testing().ldap(TEST).createLDAPProvider(ldapRule.getConfig(), true); log.infof("LDAP Provider created"); String userName = "johnkeycloak"; String firstName = "Jonh"; String lastName = "Doe"; String email = "john@email.org"; testingClient.server().run(session -> { LDAPTestContext ctx = LDAPTestContext.init(session); RealmModel appRealm = ctx.getRealm(); LDAPTestUtils.removeAllLDAPUsers(ctx.getLdapProvider(), appRealm); LDAPObject john = LDAPTestUtils.addLDAPUser(ctx.getLdapProvider(), appRealm, userName, firstName, lastName, email, null, "1234"); LDAPTestUtils.updateLDAPPassword(ctx.getLdapProvider(), john, PASSWORD); }); testRealmLoginPage.setAuthRealm(testRealmPage); testRealmAccountPage.setAuthRealm(testRealmPage); testUser = createUserRepresentation(userName, email, firstName, lastName, true); setPasswordFor(testUser, PASSWORD); resetTestRealmSession(); }

Target:
public void beforeSigningInTest() { passwordCredentialType = signingInPage.getCredentialType(PasswordCredentialModel.TYPE); testingClient.testing().ldap(TEST).createLDAPProvider(ldapRule.getConfig(), true); log.infof("LDAP Provider created"); String userName = "johnkeycloak"; String firstName = "Jonh"; String lastName = "Doe"; String email = "john@email.org"; testingClient.server().run(session -> { LDAPTestContext ctx = LDAPTestContext.init(session); RealmModel appRealm = ctx.getRealm(); LDAPTestUtils.removeAllLDAPUsers(ctx.getLdapProvider(), appRealm); LDAPObject john = LDAPTestUtils.addLDAPUser(ctx.getLdapProvider(), appRealm, userName, firstName, lastName, email, null, "1234"); LDAPTestUtils.updateLDAPPassword(ctx.getLdapProvider(), john, PASSWORD); }); testRealmLoginPage.setAuthRealm(testRealmPage); testRealmAccountPage.setAuthRealm(testRealmPage); testUser = createUserRepresentation(userName, email, firstName, lastName, true); setPasswordFor(testUser, PASSWORD); resetTestRealmSession(); }
Source:
public Constraint getRequiredConstraint(Action.ActionEffect actionEffect, JmxAction action, JmxTarget target) { return (action.getImpact() == JmxAction.Impact.EXTRA_SENSITIVE || target.isNonFacadeMBeansSensitive() || isSensitiveAction(action.composeAction(), actionEffect) || isSensitiveResource(target, actionEffect)) ? SENSITIVE : NOT_SENSITIVE; }

Target:
public Constraint getRequiredConstraint(Action.ActionEffect actionEffect, JmxAction action, JmxTarget target) { return (action.getImpact() == JmxAction.Impact.CLASSLOADING || target.isNonFacadeMBeansSensitive()) ? SENSITIVE : NOT_SENSITIVE; }
Source:
public long getLatestModificationTimeStamp(JSONArray records) throws JSONException { long maxTimeStamp = -1; for (int i = 0; i < records.length(); i++) { String timeStampStr = JSONObjectHelper.optString(records.getJSONObject(i), modificationDateFieldName); if (timeStampStr == null) { maxTimeStamp = -1; break; } try { long timeStamp = Constants.TIMESTAMP_FORMAT.parse(timeStampStr).getTime(); maxTimeStamp = Math.max(timeStamp, maxTimeStamp); } catch (Exception e) { Log.w("SyncDownTarget.getLatestModificationTimeStamp", "Could not parse modification date field " + modificationDateFieldName, e); maxTimeStamp = -1; break; } } return maxTimeStamp; }

Target:
public long getLatestModificationTimeStamp(JSONArray records) throws JSONException { long maxTimeStamp = -1; for (int i = 0; i < records.length(); i++) { String timeStampStr = JSONObjectHelper.optString(records.getJSONObject(i), getModificationDateFieldName()); if (timeStampStr == null) { maxTimeStamp = -1; break; } try { long timeStamp = Constants.TIMESTAMP_FORMAT.parse(timeStampStr).getTime(); maxTimeStamp = Math.max(timeStamp, maxTimeStamp); } catch (Exception e) { Log.w("SyncDownTarget.getLatestModificationTimeStamp", "Could not parse modification date field " + getModificationDateFieldName(), e); maxTimeStamp = -1; break; } } return maxTimeStamp; }
Source:
private boolean shouldRetryRemotelyClosed(Exception exception, int retryCount, HttpRequest httpRequest) { boolean shouldRetry = exception instanceof IOException && containsIgnoreCase(exception.getMessage(), REMOTELY_CLOSED) && supportsRetry(httpRequest.getMethod()) && retryCount > 0; if (shouldRetry) { boolean entitySupportRetry = entitySupportRetry(httpRequest); if (entitySupportRetry) { logger.warn("Sending HTTP message failed with `" + IOException.class.getCanonicalName() + ": " + REMOTELY_CLOSED + "`. Request will be retried " + retryCount + " time(s) before failing."); } else { logger.warn("Sending HTTP message failed with `" + IOException.class.getCanonicalName() + ": " + REMOTELY_CLOSED + "`. Request will not be retried because entity not support retry."); shouldRetry = false; } } return shouldRetry; }

Target:
private boolean shouldRetryRemotelyClosed(Exception exception, int retryCount, HttpRequest httpRequest) { boolean shouldRetry = exception instanceof IOException && containsIgnoreCase(exception.getMessage(), REMOTELY_CLOSED) && supportsRetry(httpRequest.getMethod()) && retryCount > 0; if (shouldRetry) { if (entitySupportRetry(httpRequest)) { logger.warn("Sending HTTP message failed with `" + IOException.class.getCanonicalName() + ": " + REMOTELY_CLOSED + "`. Request will be retried " + retryCount + " time(s) before failing."); } else { if(logger.isDebugEnabled()) { logger.debug("Sending HTTP message failed with `" + IOException.class.getCanonicalName() + ": " + REMOTELY_CLOSED + "`. Request will not be retried because entity not support retry."); } shouldRetry = false; } } return shouldRetry; }
Source:
public synchronized void deleteQuery(final String queryId) { synchronized (executionDags) { final DAG<ExecutionVertex, MISTEdge> executionPlan = executionPlanDagMap.remove(queryId); final Collection<ExecutionVertex> vertices = executionPlan.getVertices(); for (final ExecutionVertex vertex : vertices) { final VertexInfo vertexInfo = vertexInfoMap.remove(vertex); vertexInfo.setRefCount(vertexInfo.getRefCount() - 1); if (vertexInfo.getRefCount() == 0) { final DAG<ExecutionVertex, MISTEdge> targetDag = vertexInfo.getPhysicalExecutionDag(); final ExecutionVertex deleteVertex = vertexInfo.getPhysicalExecutionVertex(); targetDag.removeVertex(vertexInfo.getPhysicalExecutionVertex()); if (deleteVertex.getType() == ExecutionVertex.Type.SOURCE) { final PhysicalSource src = (PhysicalSource)deleteVertex; executionDags.remove(src.getConfiguration()); try { src.close(); } catch (Exception e) { e.printStackTrace(); } } } } } }

Target:
public synchronized void deleteQuery(final String queryId) { synchronized (executionDags) { final DAG<ExecutionVertex, MISTEdge> executionPlan = executionPlanDagMap.remove(queryId); final Collection<ExecutionVertex> vertices = executionPlan.getVertices(); for (final ExecutionVertex vertex : vertices) { final VertexInfo vertexInfo = vertexInfoMap.remove(vertex); vertexInfo.setRefCount(vertexInfo.getRefCount() - 1); if (vertexInfo.getRefCount() == 0) { final DAG<ExecutionVertex, MISTEdge> targetDag = vertexInfo.getPhysicalExecutionDag(); final ExecutionVertex deleteVertex = vertexInfo.getPhysicalExecutionVertex(); targetDag.removeVertex(deleteVertex); if (deleteVertex.getType() == ExecutionVertex.Type.SOURCE) { final PhysicalSource src = (PhysicalSource)deleteVertex; executionDags.remove(src.getConfiguration()); try { src.close(); } catch (Exception e) { e.printStackTrace(); } } } } } }
Source:
public AbstractCorrelatingMessageHandler(MessageGroupProcessor processor, MessageGroupStore store, CorrelationStrategy correlationStrategy, ReleaseStrategy releaseStrategy) { Assert.notNull(processor); Assert.notNull(store); setMessageStore(store); this.outputProcessor = processor; this.correlationStrategy = correlationStrategy == null ? new HeaderAttributeCorrelationStrategy(IntegrationMessageHeaderAccessor.CORRELATION_ID) : correlationStrategy; this.releaseStrategy = releaseStrategy == null ? new SequenceSizeReleaseStrategy() : releaseStrategy; super.messagingTemplate.setSendTimeout(DEFAULT_SEND_TIMEOUT); sequenceAware = this.releaseStrategy instanceof SequenceSizeReleaseStrategy; }

Target:
public AbstractCorrelatingMessageHandler(MessageGroupProcessor processor, MessageGroupStore store, CorrelationStrategy correlationStrategy, ReleaseStrategy releaseStrategy) { Assert.notNull(processor); Assert.notNull(store); setMessageStore(store); this.outputProcessor = processor; this.correlationStrategy = correlationStrategy == null ? new HeaderAttributeCorrelationStrategy(IntegrationMessageHeaderAccessor.CORRELATION_ID) : correlationStrategy; this.releaseStrategy = releaseStrategy == null ? new SequenceSizeReleaseStrategy() : releaseStrategy; this.messagingTemplate.setSendTimeout(DEFAULT_SEND_TIMEOUT); sequenceAware = this.releaseStrategy instanceof SequenceSizeReleaseStrategy; }
Source:
void delete(final String rawPath, final MantaHttpHeaders requestHeaders, final Integer pruneDepth) throws IOException { Validate.notBlank(rawPath, "rawPath must not be blank"); String path = formatPath(rawPath); if (pruneDepth == null || pruneDepth == DEFAULT_PRUNE_DEPTH || startsWith(path, config.getMantaBucketsDirectory())) { LOG.debug("DELETE {}", path); httpHelper.httpDelete(path, requestHeaders); } else { PruneEmptyParentDirectoryStrategy.pruneParentDirectories(this, requestHeaders, path, pruneDepth); } }

Target:
void delete(final String rawPath, final MantaHttpHeaders requestHeaders, final Integer pruneDepth) throws IOException { Validate.notBlank(rawPath, "rawPath must not be blank"); String path = formatPath(rawPath); if (pruneDepth == null || pruneDepth == DEFAULT_PRUNE_DEPTH) { LOG.debug("DELETE {}", path); httpHelper.httpDelete(path, requestHeaders); } else if (path.startsWith(config.getMantaBucketsDirectory())) { LOG.debug("DELETE {}", path); LOG.warn("Prune Directory settings should be disabled in a Buckets Environment"); httpHelper.httpDelete(path, requestHeaders); } else { PruneEmptyParentDirectoryStrategy.pruneParentDirectories(this, requestHeaders, path, pruneDepth); } }
Source:
void sendNativeSetupNotification() { setChanged(); super.notifyObservers(new Message(NativeInterface.MessageType.INSTALL, config)); final Client client = this; try { Async.run(new Runnable() { @Override public void run() { enqueuePendingNativeReports(); } }); } catch (RejectedExecutionException ex) { Logger.warn("Failed to enqueue native reports, will retry next launch: ", ex); } }

Target:
void sendNativeSetupNotification() { setChanged(); super.notifyObservers(new Message(NativeInterface.MessageType.INSTALL, config)); try { Async.run(new Runnable() { @Override public void run() { enqueuePendingNativeReports(); } }); } catch (RejectedExecutionException ex) { Logger.warn("Failed to enqueue native reports, will retry next launch: ", ex); } }
Source:
VM createDbVm() { VM vm = new VM(); vm.setDynamicData(new VmDynamic()); vm.setId(id); vm.setName(name()); vm.setRunOnVds(SRC_HOST_ID); vm.setElapsedTime(-1.0d); return vm; }

Target:
VM createDbVm() { VM vm = new VM(); vm.setDynamicData(new VmDynamic()); vm.setId(id); vm.setName(name()); vm.setRunOnVds(SRC_HOST_ID); return vm; }
Source:
protected Key() { accountId = new Account.Id(); projectName = new Project.NameKey(); fileMatchRegex = new RegexKey(DEFAULT_REGEX); }

Target:
protected Key() { accountId = new Account.Id(); projectName = new Project.NameKey(); filter = new Filter(); }
Source:
public WheelchairFlagEncoder(int speedBits, double speedFactor) { super(speedBits, speedFactor); restrictions.add("wheelchair"); setBlockByDefault(false); absoluteBarriers.add("handrail"); absoluteBarriers.add("wall"); absoluteBarriers.add("turnstile"); potentialBarriers.add("kerb"); potentialBarriers.add("cattle_grid"); potentialBarriers.add("motorcycle_barrier"); safeHighwayTags.add("footway"); safeHighwayTags.add("pedestrian"); safeHighwayTags.add("living_street"); safeHighwayTags.add("residential"); safeHighwayTags.add("service"); safeHighwayTags.add("platform"); avoidHighwayTags.add("trunk"); avoidHighwayTags.add("trunk_link"); avoidHighwayTags.add("primary"); avoidHighwayTags.add("primary_link"); avoidHighwayTags.add("secondary"); avoidHighwayTags.add("secondary_link"); avoidHighwayTags.add("tertiary"); avoidHighwayTags.add("tertiary_link"); avoidHighwayTags.add("steps"); avoidHighwayTags.add("track"); avoidSurfaces.add("cobblestone"); avoidSurfaces.add("gravel"); avoidSurfaces.add("sand"); avoidSmoothness.add("bad"); avoidSmoothness.add("very_bad"); avoidSmoothness.add("horrible"); avoidSmoothness.add("very_horrible"); avoidSmoothness.add("impassable"); allowedHighwayTags.addAll(safeHighwayTags); allowedHighwayTags.addAll(avoidHighwayTags); allowedHighwayTags.add("cycleway"); allowedHighwayTags.add("unclassified"); allowedHighwayTags.add("road"); maxPossibleSpeed = FERRY_SPEED; speedDefault = MEAN_SPEED; init(); }

Target:
public WheelchairFlagEncoder(int speedBits, double speedFactor) { super(speedBits, speedFactor); restrictions.add("wheelchair"); setBlockByDefault(false); absoluteBarriers.add("handrail"); absoluteBarriers.add("wall"); absoluteBarriers.add("turnstile"); potentialBarriers.add("kerb"); potentialBarriers.add("cattle_grid"); potentialBarriers.add("motorcycle_barrier"); safeHighwayTags.add("footway"); safeHighwayTags.add("pedestrian"); safeHighwayTags.add("living_street"); safeHighwayTags.add("residential"); safeHighwayTags.add("service"); safeHighwayTags.add("platform"); excludeHighwayTags.add("trunk"); excludeHighwayTags.add("trunk_link"); excludeHighwayTags.add("primary"); excludeHighwayTags.add("primary_link"); excludeHighwayTags.add("secondary"); excludeHighwayTags.add("secondary_link"); excludeHighwayTags.add("tertiary"); excludeHighwayTags.add("tertiary_link"); excludeHighwayTags.add("steps"); excludeHighwayTags.add("track"); excludeSurfaces.add("cobblestone"); excludeSurfaces.add("gravel"); excludeSurfaces.add("sand"); excludeSmoothness.add("bad"); excludeSmoothness.add("very_bad"); excludeSmoothness.add("horrible"); excludeSmoothness.add("very_horrible"); excludeSmoothness.add("impassable"); allowedHighwayTags.addAll(safeHighwayTags); allowedHighwayTags.addAll(excludeHighwayTags); allowedHighwayTags.add("cycleway"); allowedHighwayTags.add("unclassified"); allowedHighwayTags.add("road"); maxPossibleSpeed = FERRY_SPEED; speedDefault = MEAN_SPEED; speedTwoDirections = true; init(); }
Source:
private List<RequestInfo> pollForRequests() { idsToDelete.clear(); putManager.getIdsToDelete(idsToDelete); for (String blobId : idsToDelete) { deleteManager .submitDeleteBlobOperation(operationIdGenerator.incrementAndGet(), blobId, new FutureResult<Void>(), null); } List<RequestInfo> requests = new ArrayList<RequestInfo>(); putManager.poll(requests); getManager.poll(requests); deleteManager.poll(requests); return requests; }

Target:
private List<RequestInfo> pollForRequests() { idsToDelete.clear(); putManager.getIdsToDelete(idsToDelete); for (String blobId : idsToDelete) { deleteManager.submitDeleteBlobOperation(blobId, new FutureResult<Void>(), null); } List<RequestInfo> requests = new ArrayList<RequestInfo>(); putManager.poll(requests); getManager.poll(requests); deleteManager.poll(requests); return requests; }
Source:
public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { DocumentCursor<BaseDocument> cursor = null; try { DocumentEntity<BaseDocument> targetDoc = arangoDriver.getDocument(table, key, BaseDocument.class); BaseDocument aDocument = targetDoc.getEntity(); this.fillMap(result, aDocument.getProperties(), fields); return Status.OK; } catch (ArangoException e) { if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DOCUMENT_NOT_FOUND) { logger.error("Fail to read: " + table + " " + key, e); } else { logger.debug("Trying to read document not exist: {}", table, key); return Status.NOT_FOUND; } } catch (Exception e) { logger.error("Exception while trying read " + table + " " + key, e); } finally { if (cursor != null) { try { cursor.close(); } catch (ArangoException e) { logger.error("Fail to close cursor", e); } } } return Status.ERROR; }

Target:
public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { try { DocumentEntity<BaseDocument> targetDoc = arangoDriver.getDocument(table, key, BaseDocument.class); BaseDocument aDocument = targetDoc.getEntity(); if (!this.fillMap(result, aDocument.getProperties(), fields)) { return Status.ERROR; } return Status.OK; } catch (ArangoException e) { if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DOCUMENT_NOT_FOUND) { logger.error("Fail to read: with ex {}", table, key, e.toString()); } else { logger.debug("Trying to read document not exist: {}", table, key); return Status.NOT_FOUND; } } catch (RuntimeException e) { logger.error("Exception while trying read with ex {}", table, key, e.toString()); } return Status.ERROR; }
Source:
public Appendable write(Appendable appendable, Context context) throws IOException { appendable.append('@'); annotationName.write(appendable, context); if (!memberMap.isEmpty()) { appendable.append('('); if (memberMap.size() == 1) { Entry<String, Writable> onlyEntry = Iterables.getOnlyElement(memberMap.entrySet()); if (!onlyEntry.getKey().equals("value")) { appendable.append(onlyEntry.getKey()).append(" = "); } onlyEntry.getValue().write(appendable, context); } else { boolean first = true; for (Entry<String, Writable> entry : memberMap.entrySet()) { if (!first) { appendable.append(", "); } first = false; appendable.append(entry.getKey()).append(" = "); entry.getValue().write(appendable, context); } } appendable.append(')'); } return appendable; }

Target:
public Appendable write(Appendable appendable, Context context) throws IOException { appendable.append('@'); annotationName.write(appendable, context); if (!memberMap.isEmpty()) { appendable.append('('); if (memberMap.size() == 1) { Entry<String, Writable> onlyEntry = Iterables.getOnlyElement(memberMap.entrySet()); if (!onlyEntry.getKey().equals("value")) { appendable.append(onlyEntry.getKey()).append(" = "); } onlyEntry.getValue().write(appendable, context); } else { String sep = ""; for (Entry<String, Writable> entry : memberMap.entrySet()) { appendable.append(sep).append(entry.getKey()).append(" = "); entry.getValue().write(appendable, context); sep = ", "; } } appendable.append(')'); } return appendable; }
Source:
private void scanProjects(final File dir, final String prefix, final SortedSet<Project.NameKey> names) { final File[] ls = dir.listFiles(); if (ls == null) { return; } for (File f : ls) { String name = f.getName(); if (FileKey.isGitRepository(f, FS.DETECTED)) { if (name.equals(Constants.DOT_GIT)) { name = prefix.substring(0, prefix.length() - 1); } else if (name.endsWith(Constants.DOT_GIT_EXT)) { name = prefix + name.substring(0, name.length() - 4); } else { name = prefix + name; } Project.NameKey nameKey = new Project.NameKey(name); if (!isUnreasonableName(nameKey)) { names.add(nameKey); } } else if (f.isDirectory()) { scanProjects(f, prefix + f.getName() + "/", names); } } }

Target:
private void scanProjects(final File dir, final String prefix, final SortedSet<Project.NameKey> names) { final File[] ls = dir.listFiles(); if (ls == null) { return; } for (File f : ls) { String name = f.getName(); if (FileKey.isGitRepository(f, FS.DETECTED)) { if (name.equals(Constants.DOT_GIT)) { name = prefix.substring(0, prefix.length() - 1); } else if (name.endsWith(Constants.DOT_GIT_EXT)) { int newLen = name.length() - Constants.DOT_GIT_EXT.length(); name = prefix + name.substring(0, newLen); } else { name = prefix + name; } Project.NameKey nameKey = new Project.NameKey(name); if (!isUnreasonableName(nameKey)) { names.add(nameKey); } } else if (f.isDirectory()) { scanProjects(f, prefix + f.getName() + "/", names); } } }
Source:
public void sendEmail(String subject, String templateName, Map<String, Object> templateData) throws IOException, TemplateException, EmailException { sendEmail(fromAddress, subject, templateName, templateData); }

Target:
public void sendEmail(String subject, String templateName, Map<String, Object> templateData) throws IOException, TemplateException, EmailException { sendEmail(defaultToAddress, subject, templateName, templateData); }
Source:
public RequestBody toBody(Object object, Type type) { try { String json = LoganSquare.serialize(object); return RequestBody.create(MEDIA_TYPE, json); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public RequestBody toBody(Object object, Type type) { try { String json; if (List.class.isAssignableFrom(object.getClass())) { List<Object> list = (List<Object>) object; if (list.isEmpty()) { json = "[]"; } else { json = LoganSquare.serialize(list, (Class<Object>) list.get(0).getClass()); } } else { json = LoganSquare.serialize(object); } return RequestBody.create(MEDIA_TYPE, json); } catch (Exception e) { e.printStackTrace(); throw new AssertionError(e); } }
Source:
private void removeBricksFromVolumeInDb(List<GlusterBrickEntity> brickList) { GlusterVolumeEntity volume = getGlusterVolume(); for (GlusterBrickEntity brick : brickList) { getGlusterBrickDao().removeBrick(brick.getId()); } if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_REPLICATE && volume.getReplicaCount() == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.REPLICATE); } if (volume.getVolumeType().isReplicatedType()) { int replicaCount = (getParameters().getReplicaCount() == 0) ? volume.getReplicaCount() : getParameters().getReplicaCount(); volume.setReplicaCount(replicaCount); getGlusterVolumeDao().updateGlusterVolume(volume); } if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_STRIPE && volume.getStripeCount() == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.STRIPE); getGlusterVolumeDao().updateGlusterVolume(volume); } if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_STRIPED_REPLICATE && (volume.getStripeCount() * volume.getReplicaCount()) == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.STRIPED_REPLICATE); getGlusterVolumeDao().updateGlusterVolume(volume); } }

Target:
private void removeBricksFromVolumeInDb(List<GlusterBrickEntity> brickList) { GlusterVolumeEntity volume = getGlusterVolume(); getGlusterBrickDao().removeAllInBatch(brickList); if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_REPLICATE && volume.getReplicaCount() == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.REPLICATE); } if (volume.getVolumeType().isReplicatedType()) { int replicaCount = (getParameters().getReplicaCount() == 0) ? volume.getReplicaCount() : getParameters().getReplicaCount(); volume.setReplicaCount(replicaCount); getGlusterVolumeDao().updateGlusterVolume(volume); } if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_STRIPE && volume.getStripeCount() == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.STRIPE); getGlusterVolumeDao().updateGlusterVolume(volume); } if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_STRIPED_REPLICATE && (volume.getStripeCount() * volume.getReplicaCount()) == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.STRIPED_REPLICATE); getGlusterVolumeDao().updateGlusterVolume(volume); } }
Source:
public synchronized Set<CommandMapping> getAll(String alias) { Set<CommandMapping> set = new HashSet<CommandMapping>(); Optional<CommandMapping> mapping = Optional.fromNullable(this.commands.get(alias.toLowerCase())); if (mapping.isPresent()) { set.add(mapping.get()); } return set; }

Target:
public synchronized Set<CommandMapping> getAll(String alias) { Set<CommandMapping> set = new HashSet<CommandMapping>(); CommandMapping mapping = this.commands.get(alias.toLowerCase()); if (mapping != null) { set.add(mapping); } return set; }
Source:
private SSLSetup setupSSLIfNeeded(SocketChannel sc, boolean clientMode) throws IOException { if (m_sslContext == null) { return null; } ByteBuffer remnant; SSLEngine sslEngine = m_sslContext.createSSLEngine(); sslEngine.setUseClientMode(clientMode); sslEngine.setNeedClientAuth(false); Set<String> enabled = ImmutableSet.copyOf(sslEngine.getEnabledCipherSuites()); Set<String> intersection = Sets.intersection(SSLConfiguration.PREFERRED_CIPHERS, enabled); if (intersection.isEmpty()) { hostLog.warn("Preferred cipher suites are not available"); intersection = enabled; } sslEngine.setEnabledCipherSuites(intersection.toArray(new String[0])); boolean handshakeStatus; try { sc.socket().setTcpNoDelay(true); TLSHandshaker handshaker = new TLSHandshaker(sc, sslEngine); handshakeStatus = handshaker.handshake(); remnant = handshaker.getRemnantUnencrypted(); } catch (IOException e) { try { sc.close(); } catch (IOException e1) { hostLog.warn("failed to close channel",e1); } throw new IOException("Rejected accepting new internal connection, SSL handshake failed: " + e.getMessage(), e); } if (!handshakeStatus) { try { sc.close(); } catch (IOException e) { } throw new IOException("Rejected accepting new internal connection, SSL handshake failed."); } LOG.info("SSL enabled on internal connection " + sc.socket().getRemoteSocketAddress() + " with protocol " + sslEngine.getSession().getProtocol() + " and with cipher " + sslEngine.getSession().getCipherSuite()); return new SSLSetup(sslEngine, remnant); }

Target:
private SSLSetup setupSSLIfNeeded(SocketChannel sc, boolean clientMode) throws IOException { if (m_sslContext == null) { return null; } ByteBuffer remnant; SSLEngine sslEngine = m_sslContext.createSSLEngine(); sslEngine.setUseClientMode(clientMode); sslEngine.setNeedClientAuth(false); Set<String> enabled = ImmutableSet.copyOf(sslEngine.getEnabledCipherSuites()); Set<String> intersection = Sets.intersection(SSLConfiguration.PREFERRED_CIPHERS, enabled); if (intersection.isEmpty()) { hostLog.warn("Preferred cipher suites are not available"); intersection = enabled; } sslEngine.setEnabledCipherSuites(intersection.toArray(new String[0])); boolean handshakeStatus; sc.socket().setTcpNoDelay(true); TLSHandshaker handshaker = new TLSHandshaker(sc, sslEngine); handshakeStatus = handshaker.handshake(); remnant = handshaker.getRemnantUnencrypted(); if (!handshakeStatus) { throw new IOException("Rejected accepting new internal connection, SSL handshake failed."); } LOG.info("SSL enabled on internal connection " + sc.socket().getRemoteSocketAddress() + " with protocol " + sslEngine.getSession().getProtocol() + " and with cipher " + sslEngine.getSession().getCipherSuite()); return new SSLSetup(sslEngine, remnant); }
Source:
private String formatMetadataRequestKey(String key) { return "metadata[" + key + "]"; }

Target:
private String formatMetadataRequestKey(String key) { return String.format("metadata[%s]", key); }
Source:
public boolean hasChildren(Object element) { if (!(element instanceof PathNode)) return false; IPath parent = ((PathNode) element).path; for (IPath childPath : leftPathsWithChildren) { if (childPath.removeLastSegments(1).equals(parent)) { return true; } } for (IPath mapPath : leftVersionMap.keySet()) { if (mapPath.removeLastSegments(1).equals(parent) && (showEquals || !equalContentPaths.contains(mapPath))) { return true; } } return false; }

Target:
public boolean hasChildren(Object element) { if (!(element instanceof PathNode)) return false; IPath parent = ((PathNode) element).path; for (IPath childPath : baseVersionPathsWithChildren) { if (childPath.removeLastSegments(1).equals(parent)) return true; } for (IPath mapPath : baseVersionMap.keySet()) { if (mapPath.removeLastSegments(1).equals(parent) && (showEquals || !equalContentPaths.contains(mapPath))) { return true; } } return false; }
Source:
private boolean shouldUpdateVmsAndTemplates() { return isVersionChanged() || isBiosTypeChanged() || isCpuNameChanged() || oldCluster.getArchitecture() == getArchitecture(); }

Target:
private boolean shouldUpdateVmsAndTemplates() { return isVersionChanged() || isBiosTypeChanged() || isCpuNameChanged() || oldCluster.getArchitecture() != getArchitecture(); }
Source:
private void initialize() { try { ExchangeInfoType exInfo = ExchangeInfoDAOFileImpl.getInstance().loadExchangeInfo(); long interval = exInfo.getRefreshInterval(); if (interval <= 0) { refreshInterval = DEFAULT_EXCHANGE_REFRESH_INTERVAL * MINUTES_TO_MILLIS; } else { refreshInterval = interval * MINUTES_TO_MILLIS; } } catch (ExchangeManagerException ex) { LOG.error("Unable to load exchange information {}", ex.getLocalizedMessage(), ex); } }

Target:
private void initialize() { try { ExchangeInfoType exInfo = ExchangeInfoDAOFileImpl.getInstance().loadExchangeInfo(); long interval = exInfo.getRefreshInterval(); if (interval <= 0) { refreshInterval = TimeUnit.MINUTES.toMillis(DEFAULT_EXCHANGE_REFRESH_INTERVAL); } else { refreshInterval = TimeUnit.MINUTES.toMillis(interval); } } catch (ExchangeManagerException ex) { LOG.error("Unable to load exchange information {}", ex.getLocalizedMessage(), ex); } }
Source:
public void send(byte[] data) { ByteBuffer buffer = ByteBuffer.allocateDirect(data.length); CANJNI.FRCNetCommCANSessionMuxSendMessage(this.outboundArbitrationId, buffer, CANJNI.CAN_SEND_PERIOD_NO_REPEAT); }

Target:
public void send(byte[] data) { ByteBuffer buffer = ByteBuffer.allocateDirect(data.length); buffer.put(data); CANJNI.FRCNetCommCANSessionMuxSendMessage(this.outboundArbitrationId, buffer, CANJNI.CAN_SEND_PERIOD_NO_REPEAT); }
Source:
public CountryVersion(String uid, String country, int version, Date lastUpdate, String reference, String name) { setUid(required(uid,"UID is required")); setCountry(required(country,"country is required")); setVersion(required(version,"version is required")); setLastUpdate(required(lastUpdate,"version is required")); setReference(required(reference,"reference is required")); setName(name); }

Target:
public CountryVersion(String uid, String country, int version, Date lastUpdate, String reference, String name) { this.uid = (required(uid, "UID is required")); this.country = (required(country, "country is required")); this.version = (required(version, "version is required")); this.lastUpdate = (required(lastUpdate, "version is required")); this.reference = (required(reference, "reference is required")); this.name = name; }
Source:
public static String loadFile(String path) { String result = ""; Scanner sc = new Scanner(ResourcesUtil.class.getClassLoader().getResourceAsStream(path)); while (sc.hasNextLine()) { result += sc.nextLine(); } sc.close(); return result; }

Target:
public static String loadFile(String path) { String result = ""; Scanner sc = null; try { sc = new Scanner(ResourcesUtil.class.getClassLoader().getResourceAsStream(path)); while (sc.hasNextLine()) { result += sc.nextLine(); } sc.close(); } finally { if (sc != null) { sc.close(); } } return result; }
Source:
public AbstractListDataView<T> addItem(T item) { final ListDataProvider<T> dataProvider = getDataProvider(); if (!contains(item)) { dataProvider.getItems().add(item); dataProvider.refreshAll(); } return this; }

Target:
public AbstractListDataView<T> addItem(T item) { final ListDataProvider<T> dataProvider = getDataProvider(); if (!contains(item, dataProvider)) { dataProvider.getItems().add(item); dataProvider.refreshAll(); } return this; }