auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected String[] getIndexNames() { List<String> repositoryNames = getElasticSearchAdmin().getRepositoryNames(); String indices[] = new String[repositoryNames.size()]; int i = 0; for (String repo : repositoryNames) { indices[i++] = getElasticSearchAdmin().getIndexNameForRepository(repo); } return indices; }

Target:
protected String[] getIndexNames() { ElasticSearchAdmin esa = Framework.getService(ElasticSearchAdmin.class); List<String> repositoryNames = Framework.getService(ElasticSearchAdmin.class).getRepositoryNames(); String indices[] = new String[repositoryNames.size()]; int i = 0; for (String repo : repositoryNames) { indices[i++] = esa.getIndexNameForRepository(repo); } return indices; }
Source:
public synchronized void send(String command) throws NodeJsDebuggerException { LOG.debug("Execute: {}", command); if (!process.isAlive()) { throw new NodeJsDebuggerTerminatedException("NodeJs process is terminated."); } try { processWriter.write(command); processWriter.newLine(); processWriter.flush(); } catch (IOException e) { LOG.error(String.format("Command execution <%s> failed", command), e); } try { sleep(100); } catch (InterruptedException ignored) { } }

Target:
public synchronized void send(String command) throws NodeJsDebuggerException { LOG.debug("Execute: {}", command); if (!process.isAlive()) { throw new NodeJsDebuggerTerminatedException("NodeJs process is terminated."); } try { processWriter.write(command); processWriter.newLine(); processWriter.flush(); } catch (IOException e) { LOG.error(String.format("Command execution <%s> failed", command), e); } }
Source:
public RedisTokenEntry fetchTokenEntry(String processorName, int segment, String owner, Instant currentTimestamp, Instant expirationFromTimestamp) { String redisOutput = (String) tryEvalSha1(FETCH_TOKEN_SCRIPT, FETCH_TOKEN_SHA1, getHashKeyList(processorName, segment), Arrays.asList( processorName, Integer.toString(segment), owner, Long.toString(currentTimestamp.toEpochMilli()), Long.toString(expirationFromTimestamp.toEpochMilli()))); if (redisOutput != null) { JSONObject tokenEntry = new JSONObject(redisOutput); String tokenEntryProcessorName = null; int tokenEntrySegment = 0; String tokenEntryOwner = null; String tokenEntryTimestamp = null; byte[] tokenEntryToken = null; String tokenEntryTokenType = null; if (tokenEntry.has("processorName")) { tokenEntryProcessorName = tokenEntry.getString("processorName"); } if (tokenEntry.has("segment")) { tokenEntrySegment = Integer.parseInt(tokenEntry.getString("segment")); } if (tokenEntry.has("owner")) { tokenEntryOwner = tokenEntry.getString("owner"); } if (tokenEntry.has("timestamp")) { tokenEntryTimestamp = Instant.ofEpochMilli(Long.parseLong(tokenEntry.getString("timestamp"))).toString(); } if (tokenEntry.has("token")) { tokenEntryToken = Base64.getDecoder().decode(tokenEntry.getString("token")); } if (tokenEntry.has("tokenType")) { tokenEntryTokenType = tokenEntry.getString("tokenType"); } return new RedisTokenEntry(tokenEntryToken, tokenEntryTokenType, tokenEntryTimestamp, tokenEntryOwner, tokenEntryProcessorName, tokenEntrySegment); } else { return null; } }

Target:
public RedisTokenEntry fetchTokenEntry(String processorName, int segment, String owner, Instant currentTimestamp, Instant expirationFromTimestamp) { String redisOutput = (String) tryEvalSha1( FETCH_TOKEN_SCRIPT, FETCH_TOKEN_SHA1, getHashKeyList(processorName, segment), Arrays.asList( processorName, Integer.toString(segment), owner, Long.toString(currentTimestamp.toEpochMilli()), Long.toString(expirationFromTimestamp.toEpochMilli()))); return mapRedisTokenEntry(redisOutput); }
Source:
public Response getRefund(@PathParam("accountId") Long accountId, @PathParam("chargeId") String chargeId, @PathParam("refundId") String refundId, @Context UriInfo uriInfo) { return chargeService.findCharge(chargeId, accountId) .map(chargeEntity -> getRefundResponse(chargeEntity, refundId, accountId, uriInfo)) .orElseGet(() -> responseWithChargeNotFound(chargeId)); }

Target:
public Response getRefund(@PathParam("accountId") Long accountId, @PathParam("chargeId") String chargeId, @PathParam("refundId") String refundId, @Context UriInfo uriInfo) { return chargeService.findCharge(chargeId, accountId) .map(charge -> getRefundResponse(charge, refundId, accountId, uriInfo)) .orElseGet(() -> responseWithChargeNotFound(chargeId)); }
Source:
protected void finalize() throws Throwable { super.finalize(); if(channel!=null) { channel.send(new Unexport(channel.newIoId(),oid)); oid = -1; } }

Target:
protected void finalize() throws Throwable { super.finalize(); if(channel != null && oid != -1) { channel.send(new Unexport(channel.newIoId(),oid)); oid = -1; } }
Source:
public boolean steady(final List<ServerHolder> serverHolders) { double totalCost = 0; double maxCost = Double.MIN_VALUE; double minCost = Double.MAX_VALUE; for (ServerHolder server : serverHolders) { double serverCost = calculateServerCost(server); totalCost += serverCost; maxCost = Math.max(maxCost, serverCost); minCost = Math.min(minCost, serverCost); } double average = (double) totalCost / serverHolders.size(); double floor = (double) Math.floor(average * (1 - balancerSlop)); double ceiling = (double) Math.ceil(average * (1 + balancerSlop)); if (maxCost < ceiling && minCost > floor) { return true; } return false; }

Target:
public boolean steady(final List<ServerHolder> serverHolders) { if (balancerSlope <= BalancerStrategy.DEFAULT_BALANCER_SLOPE) { return false; } double totalCost = 0; double maxCost = Double.MIN_VALUE; double minCost = Double.MAX_VALUE; for (ServerHolder server : serverHolders) { double serverCost = calculateServerCost(server); totalCost += serverCost; maxCost = Math.max(maxCost, serverCost); minCost = Math.min(minCost, serverCost); } double average = totalCost / serverHolders.size(); double floor = average * (1 - balancerSlope); double ceiling = average * (1 + balancerSlope); if (maxCost < ceiling && minCost > floor) { return true; } return false; }
Source:
public static synchronized void closeAll() { FullTextSettings.closeAll(); }

Target:
public static void closeAll() { FullTextSettings.closeAll(); }
Source:
private ContentSummary getContentSummary() { if( contentSummary != null ) return contentSummary; try { if (fileStatus.isFile()) { long length = fileStatus.getLen(); contentSummary = new ContentSummary.Builder().length(length). fileCount(1).directoryCount(0).spaceConsumed(length).build(); } else { long[] summary = {0, 0, 1}; for (FileStatus s : listRoot()) { long length = s.getLen(); ContentSummary c = s.isDirectory() ? fs.getContentSummary(s.getPath()) : new ContentSummary.Builder().length(length). fileCount(1).directoryCount(0).spaceConsumed(length).build(); summary[0] += c.getLength(); summary[1] += c.getFileCount(); summary[2] += c.getDirectoryCount(); } contentSummary = new ContentSummary.Builder().length(summary[0]). fileCount(summary[1]).directoryCount(summary[2]). spaceConsumed(summary[0]).build(); } } catch (IOException ioe) { LOG.error("Unexpected error getting content summary. We ignore it for now, but you should probably check it out:", ioe); contentSummary = new ContentSummary(0L, 0L, 0L); } return contentSummary; }

Target:
private ContentSummary getContentSummary() { if( contentSummary != null ) return contentSummary; try { if (fileStatus.isFile()) { long length = fileStatus.getLen(); contentSummary = new ContentSummary.Builder().length(length). fileCount(1).directoryCount(0).spaceConsumed(length).build(); } else { long length = 0, fileCount = 0, dirCount = 1; for (FileStatus s : listRoot()) { if( s.isDirectory() ) { ContentSummary c = fs.getContentSummary(s.getPath()); length += c.getLength(); fileCount += c.getFileCount(); dirCount += c.getDirectoryCount(); } else { length += s.getLen(); fileCount++; } } contentSummary = new ContentSummary.Builder().length(length). fileCount(fileCount).directoryCount(dirCount). spaceConsumed(length).build(); } } catch (IOException ioe) { LOG.error("Unexpected error getting content summary. We ignore it for now, but you should probably check it out:", ioe); contentSummary = new ContentSummary(0L, 0L, 0L); } return contentSummary; }
Source:
public Map<String, String> getFields() { return Collections.unmodifiableMap(fields); }

Target:
public Map<String, String> getFields() { return fields; }
Source:
public void startPeers() { log.info("starting peers"); Map<String, ServiceReservation> peers = null; try { Method method = this.getClass().getMethod("getMetaData"); ServiceType st = (ServiceType) method.invoke(null); peers = st.getPeers(); } catch (Exception e) { } if (peers == null) { return; } Set<Class<?>> ancestry = new HashSet<Class<?>>(); Class<?> targetClass = this.getClass(); while (targetClass.getCanonicalName().startsWith("org.myrobotlab") && !targetClass.getCanonicalName().startsWith("org.myrobotlab.framework")) { ancestry.add(targetClass); targetClass = targetClass.getSuperclass(); } for (Class<?> sourceClass : ancestry) { Field fields[] = sourceClass.getDeclaredFields(); for (int j = 0, m = fields.length; j < m; j++) { try { Field f = fields[j]; f.setAccessible(true); Field targetField = sourceClass.getDeclaredField(f.getName()); targetField.setAccessible(true); if (peers.containsKey(f.getName())) { if (f.get(this) != null) { log.info("peer already assigned", f.getName()); continue; } log.info("assinging {}.{} = startPeer({})", sourceClass.getSimpleName(), f.getName(), f.getName()); Object o = startPeer(f.getName()); targetField.set(this, o); } } catch (Exception e) { log.error("copy failed", e); } } } }

Target:
public void startPeers() { log.info("starting peers"); Map<String, ServiceReservation> peers = null; try { Method method = this.getClass().getMethod("getMetaData"); ServiceType st = (ServiceType) method.invoke(null); peers = st.getPeers(); } catch (Exception e) { } if (peers == null) { return; } Set<Class<?>> ancestry = new HashSet<Class<?>>(); Class<?> targetClass = this.getClass(); while (targetClass.getCanonicalName().startsWith("org.myrobotlab") && !targetClass.getCanonicalName().startsWith("org.myrobotlab.framework")) { ancestry.add(targetClass); targetClass = targetClass.getSuperclass(); } for (Class<?> sourceClass : ancestry) { Field fields[] = sourceClass.getDeclaredFields(); for (int j = 0, m = fields.length; j < m; j++) { try { Field f = fields[j]; f.setAccessible(true); Field targetField = sourceClass.getDeclaredField(f.getName()); targetField.setAccessible(true); if (peers.containsKey(f.getName())) { ServiceReservation sr = peers.get(f.getName()); if (sr.autoStart == null || sr.autoStart == false) { log.info("peer defined - but configured to not autoStart"); continue; } if (f.get(this) != null) { log.info("peer already assigned", f.getName()); continue; } log.info("assinging {}.{} = startPeer({})", sourceClass.getSimpleName(), f.getName(), f.getName()); Object o = startPeer(f.getName()); targetField.set(this, o); } } catch (Exception e) { log.error("copy failed", e); } } } }
Source:
private static String timestamp() { SimpleDateFormat sdfr = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss"); return sdfr.format(new Date()); }

Target:
private static String timestamp() { return LogKitten.TIMESTAMP_FORMAT.format(new Date()); }
Source:
private <T> T execute(String type, ResponseHandler<T> responseHandler, String sparql) { log.trace("Running SPARQL: {}", sparql); long startQuery = System.currentTimeMillis(); final ContentResponse response; try { response = retryer.call(() -> makeRequest(type, sparql, responseHandler.acceptHeader()).send()); if (response.getStatus() != HttpStatus.OK_200) { throw new ContainedException("Non-200 response from triple store: " + response + " body=\n" + responseBodyAsString(response)); } log.debug("Completed in ms", System.currentTimeMillis() - startQuery); return responseHandler.parse(response); } catch (ExecutionException | RetryException | IOException e) { throw new FatalException("Error updating triple store", e); } }

Target:
private <T> T execute(String type, ResponseHandler<T> responseHandler, String sparql) { log.trace("Running SPARQL: {}", sparql); long startQuery = System.currentTimeMillis(); final ContentResponse response; try { response = retryer.call(() -> makeRequest(type, sparql, responseHandler.acceptHeader()).send()); if (response.getStatus() != HttpStatus.OK_200) { throw new ContainedException("Non-200 response from triple store: " + response + " body=\n" + response.getContentAsString()); } log.debug("Completed in ms", System.currentTimeMillis() - startQuery); return responseHandler.parse(response); } catch (ExecutionException | RetryException | IOException e) { throw new FatalException("Error updating triple store", e); } }
Source:
private void hotSetMemlog(HotSetAmountOfMemoryParameters params, VdcReturnValueBase setAmountOfMemoryResult) { if (!setAmountOfMemoryResult.isValid()) { AuditLogableBase logable = new HotSetAmountOfMemoryCommand<>(params, null); List<String> validationMessages = getBackend().getErrorsTranslator(). translateErrorText(setAmountOfMemoryResult.getValidationMessages()); logable.addCustomValue(HotSetAmountOfMemoryCommand.LOGABLE_FIELD_ERROR_MESSAGE, StringUtils.join(validationMessages, ",")); auditLogDirector.log(logable, AuditLogType.FAILED_HOT_SET_MEMORY); } }

Target:
private void hotSetMemlog(HotSetAmountOfMemoryParameters params, VdcReturnValueBase setAmountOfMemoryResult) { if (!setAmountOfMemoryResult.isValid()) { AuditLogableBase logable = new HotSetAmountOfMemoryCommand<>(params, null); List<String> validationMessages = getBackend().getErrorsTranslator(). translateErrorText(setAmountOfMemoryResult.getValidationMessages()); logable.addCustomValue(HotSetAmountOfMemoryCommand.LOGABLE_FIELD_ERROR_MESSAGE, StringUtils.join(validationMessages, ",")); auditLogDirector.log(logable, AuditLogType.FAILED_HOT_SET_NUMBER_OF_CPUS); } }
Source:
protected boolean checkIfImageDiskCanBeAdded(VM vm, DiskValidator diskValidator) { if (Guid.Empty.equals(getParameters().getStorageDomainId()) && Guid.Empty.equals(getStorageDomainId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_SPECIFIED); } boolean returnValue; StorageDomainValidator storageDomainValidator = createStorageDomainValidator(); returnValue = validate(storageDomainValidator.isDomainExistAndActive()) && !isShareableDiskOnGlusterDomain() && checkImageConfiguration() && validate(storageDomainValidator.hasSpaceForNewDisk(getDiskImageInfo())) && validate(storageDomainValidator.isDomainWithinThresholds()) && checkExceedingMaxBlockDiskSize() && canAddShareableDisk() && validate(diskValidator.isVirtIoScsiValid(vm)) && validate(diskValidator.isDiskInterfaceSupported(getVm())); if (returnValue && vm != null) { StoragePool sp = getStoragePool(); returnValue = validate(new StoragePoolValidator(sp).isUp()) && isStoragePoolMatching(vm) && isVmNotLocked() && isVmNotInPreviewSnapshot(); } return returnValue; }

Target:
protected boolean checkIfImageDiskCanBeAdded(VM vm, DiskValidator diskValidator) { if (Guid.Empty.equals(getStorageDomainId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_SPECIFIED); } boolean returnValue; StorageDomainValidator storageDomainValidator = createStorageDomainValidator(); returnValue = validate(storageDomainValidator.isDomainExistAndActive()) && !isShareableDiskOnGlusterDomain() && checkImageConfiguration() && validate(storageDomainValidator.hasSpaceForNewDisk(getDiskImageInfo())) && validate(storageDomainValidator.isDomainWithinThresholds()) && checkExceedingMaxBlockDiskSize() && canAddShareableDisk() && validate(diskValidator.isVirtIoScsiValid(vm)) && validate(diskValidator.isDiskInterfaceSupported(getVm())); if (returnValue && vm != null) { StoragePool sp = getStoragePool(); returnValue = validate(new StoragePoolValidator(sp).isUp()) && isStoragePoolMatching(vm) && isVmNotLocked() && isVmNotInPreviewSnapshot(); } return returnValue; }
Source:
protected void executeQueryCommand() { VmDeviceDAO dao = DbFacade.getInstance().getVmDeviceDAO(); List<VmDevice> disks = new ArrayList(dao.getVmDeviceByVmIdAndType(getParameters().getId(), VmDeviceType.DISK.getName())); for (VmDevice disk: disks) { if (VmPayload.IsPayload(disk.getSpecParams())) { VmPayload payload = new VmPayload(VmDeviceType.valueOf(disk.getType().toUpperCase()), disk.getSpecParams()); payload.setType(VmDeviceType.valueOf(disk.getDevice().toUpperCase())); payload.setContent(new String(Base64.decodeBase64(payload.getContent()))); getQueryReturnValue().setReturnValue(payload); } } }

Target:
protected void executeQueryCommand() { VmDeviceDAO dao = DbFacade.getInstance().getVmDeviceDAO(); List<VmDevice> disks = dao.getVmDeviceByVmIdAndType(getParameters().getId(), VmDeviceType.DISK.getName()); for (VmDevice disk: disks) { if (VmPayload.isPayload(disk.getSpecParams())) { VmPayload payload = new VmPayload(VmDeviceType.valueOf(disk.getType().toUpperCase()), disk.getSpecParams()); payload.setType(VmDeviceType.valueOf(disk.getDevice().toUpperCase())); payload.setContent(new String(Base64.decodeBase64(payload.getContent()))); getQueryReturnValue().setReturnValue(payload); } } }
Source:
public static Properties readProperties(final String propertyFile) throws IOException { final Properties props = new Properties(); final InputStream input = Arguments.class.getClassLoader().getResourceAsStream(propertyFile); if (input != null) { props.load(input); return props; } return null; }

Target:
public static Properties readProperties(final String propertyFile) throws IOException { final Properties props = new Properties(); final InputStream input = Arguments.class.getClassLoader().getResourceAsStream(propertyFile); if (input != null) { props.load(input); return props; } props.put("version", "N/a"); props.put("build.date", "N/a"); return props; }
Source:
public ComponentDefinition set(@Nullable String ns, @NotNull String key, @NotNull String value) { attributes.put((ns != null ? (ns + ":") : "") + key, value); return this; }

Target:
public ComponentDefinition set(@Nullable String ns, @NotNull String key, @NotNull String value) { String prefix = (ns != null ? (ns + ":") : ""); attributes.put(prefix + key, value); return this; }
Source:
public Response getUserStatsAppStatus(@Context final Request request, @PathParam("streams_app") final String appName) { switch (appName) { case "site_statistics": return Response.ok(ImmutableMap.of("running", SiteStatisticsStreamsApplication.getAppStatus().get("running"))).build(); case "user_statistics": return Response.ok(ImmutableMap.of("running", UserStatisticsStreamsApplication.getAppStatus().get("running"))).build(); default: return Response.ok(ImmutableMap.of("running", false)).build(); } }

Target:
public Response getUserStatsAppStatus(@Context final Request request, @PathParam("streams_app") final String appName) { switch (appName) { case "site_statistics": return Response.ok(ImmutableMap.of("running", SiteStatisticsStreamsApplication.getAppStatus().get("running"))).build(); case "user_statistics": return Response.ok(ImmutableMap.of("running", UserStatisticsStreamsApplication.getAppStatus().get("running"))).build(); case "anonymous_events": return Response.ok(ImmutableMap.of("running", AnonymousEventsStreamsApplication.getAppStatus().get("running"))).build(); default: return new SegueErrorResponse(Status.NOT_FOUND, "Invalid streams app name provided.").toResponse(); } }
Source:
public boolean isWeightParam(Layer layer, String key) { return weightKeys(layer).contains(key); }

Target:
public boolean isWeightParam(Layer layer, String key) { return WEIGHT_KEY.equals(key) || (hasLayerNorm(layer) && GAIN_KEY.equals(key)); }
Source:
protected void eventHandle(ITmfEvent event) { String functionEntryName = functionEntry(event); if (functionEntryName != null) { long timestamp = event.getTimestamp().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); String thread = threadName(event); int quark = ss.getQuarkAbsoluteAndAdd(THREADS, thread, CALL_STACK); ITmfStateValue value = TmfStateValue.newValueString(functionEntryName); try { ss.pushAttribute(timestamp, value, quark); } catch (TimeRangeException e) { e.printStackTrace(); } catch (AttributeNotFoundException e) { e.printStackTrace(); } catch (StateValueTypeException e) { e.printStackTrace(); } } else { String functionExitName = functionExit(event); if (functionExitName != null) { long timestamp = event.getTimestamp().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); String thread = threadName(event); int quark = ss.getQuarkAbsoluteAndAdd(THREADS, thread, CALL_STACK); try { ss.popAttribute(timestamp, quark); } catch (AttributeNotFoundException e) { e.printStackTrace(); } catch (TimeRangeException e) { e.printStackTrace(); } catch (StateValueTypeException e) { e.printStackTrace(); } } } }

Target:
protected void eventHandle(ITmfEvent event) { String functionEntryName = functionEntry(event); try { if (functionEntryName != null) { long timestamp = event.getTimestamp().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); String thread = threadName(event); int quark = ss.getQuarkAbsoluteAndAdd(THREADS, thread, CALL_STACK); ITmfStateValue value = TmfStateValue.newValueString(functionEntryName); ss.pushAttribute(timestamp, value, quark); } else if (functionExit(event) != null) { long timestamp = event.getTimestamp().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); String thread = threadName(event); int quark = ss.getQuarkAbsoluteAndAdd(THREADS, thread, CALL_STACK); ss.popAttribute(timestamp, quark); } } catch (TimeRangeException e) { e.printStackTrace(); } catch (AttributeNotFoundException e) { e.printStackTrace(); } catch (StateValueTypeException e) { e.printStackTrace(); } }
Source:
public AggregateReduceFunctionsRule(Class<? extends Aggregate> aggregateClass, RelBuilderFactory relBuilderFactory, EnumSet<SqlKind> functionsToReduce) { super(operand(aggregateClass, any()), relBuilderFactory, null); Preconditions.checkArgument(functionsToReduce != null, "Error: expecting a valid handle for AggregateFunctionsToReduce"); this.functionsToReduce = EnumSet.noneOf(SqlKind.class); for (SqlKind function : functionsToReduce) { if (SqlKind.AVG_AGG_FUNCTIONS.contains(function) || SqlKind.COVAR_AVG_AGG_FUNCTIONS.contains(function) || function == SqlKind.SUM) { this.functionsToReduce.add(function); } else { throw new IllegalArgumentException( "AggregateReduceFunctionsRule doesn't support function: " + function.sql); } } }

Target:
public AggregateReduceFunctionsRule(Class<? extends Aggregate> aggregateClass, RelBuilderFactory relBuilderFactory, EnumSet<SqlKind> functionsToReduce) { super(operand(aggregateClass, any()), relBuilderFactory, null); Objects.requireNonNull(functionsToReduce, "Expecting a valid handle for AggregateFunctionsToReduce"); this.functionsToReduce = EnumSet.noneOf(SqlKind.class); for (SqlKind function : functionsToReduce) { if (SqlKind.AVG_AGG_FUNCTIONS.contains(function) || SqlKind.COVAR_AVG_AGG_FUNCTIONS.contains(function) || function == SqlKind.SUM) { this.functionsToReduce.add(function); } else { throw new IllegalArgumentException( "AggregateReduceFunctionsRule doesn't support function: " + function.sql); } } }
Source:
public boolean isValid(CruiseConfig preprocessedConfig) { preprocessedConfig.getPackageRepositories().validate(new ConfigSaveValidationContext(preprocessedConfig)); PackageRepository packageRepository = preprocessedConfig.getPackageRepositories().find(this.repository.getRepoId()); packageRepository.validate(new ConfigSaveValidationContext(preprocessedConfig.getPackageRepositories())); BasicCruiseConfig.copyErrors(packageRepository, this.repository); return getAllErrors(this.repository).isEmpty(); }

Target:
public boolean isValid(CruiseConfig preprocessedConfig) { PackageRepositories repositories = preprocessedConfig.getPackageRepositories(); this.preprocessedRepository = repositories.find(this.repository.getRepoId()); preprocessedRepository.validate(null); repositories.validate(null); boolean isValidConfiguration = packageRepositoryService.validatePluginId(preprocessedRepository) && packageRepositoryService.validateRepositoryConfiguration(preprocessedRepository); BasicCruiseConfig.copyErrors(preprocessedRepository, this.repository); return getAllErrors(this.repository).isEmpty() && isValidConfiguration && result.isSuccessful(); }
Source:
private Crypter getCrypter() throws EncryptionException { synchronized (crypterSync) { if (crypter != null) { return crypter; } try { String pathToKeys = rootPath.get() + "/WEB-INF/keystore"; crypter = new Crypter(pathToKeys); return crypter; } catch (KeyczarException e) { throw new EncryptionException(e); } } }

Target:
private Crypter getCrypter() throws EncryptionException { synchronized (crypterSync) { if (crypter != null) { return crypter; } try { String pathToKeys = rootPath.get() + "WEB-INF/keystore"; crypter = new Crypter(pathToKeys); return crypter; } catch (KeyczarException e) { throw new EncryptionException(e); } } }
Source:
private int handleEnd(@NonNull ITmfEvent event, ITmfStateSystemBuilder ss, long timestamp, String processName) { ITmfStateValue functionExitState = functionExit(event); if (functionExitState != null) { return endHandle(event, ss, timestamp, processName); } return -1; }

Target:
private int handleEnd(@NonNull ITmfEvent event, ITmfStateSystemBuilder ss, long timestamp, String processName) { ITmfStateValue functionExitState = functionExit(event); if (functionExitState != null) { String pName = processName; if (pName == null) { int processId = getProcessId(event); pName = (processId == UNKNOWN_PID) ? UNKNOWN : Integer.toString(processId); } String threadName = getThreadName(event); if (threadName == null) { threadName = Long.toString(getThreadId(event)); } int quark = ss.getQuarkAbsoluteAndAdd(PROCESSES, pName, threadName, CALL_STACK); ss.popAttribute(timestamp, quark); return ss.queryOngoingState(quark).unboxInt() + quark; } return -1; }
Source:
public MessagingMessageConverterAdapter(Object bean, Method method) { this.bean = bean; this.method = method; this.inferredArgumentType = determineInferredType(); }

Target:
private MessagingMessageConverterAdapter(Object bean, Method method) { this.bean = bean; this.method = method; this.inferredArgumentType = determineInferredType(); if (logger.isDebugEnabled() && this.inferredArgumentType != null) { logger.debug("Inferred argument type for " + method.toString() + " is " + this.inferredArgumentType); } }
Source:
private void transitToNextState() { final State currentState = (State) stateMachine.getCurrentState(); switch (currentState) { case INIT: stateMachine.setState(State.RUN); LOG.log(Level.INFO, String.format("State transition: %s -> %s", State.INIT, State.RUN)); break; case RUN: stateMachine.setState(State.RUN_FINISHING); LOG.log(Level.INFO, String.format("State transition: %s -> %s", State.RUN, State.RUN_FINISHING)); break; case RUN_FINISHING: stateMachine.setState(State.CLEANUP); LOG.log(Level.INFO, String.format("State transition: %s -> %s", State.RUN_FINISHING, State.CLEANUP)); break; case CLEANUP: throw new RuntimeException(String.format("No more transition is allowed after %s state", State.CLEANUP)); default: throw new RuntimeException(String.format("Invalid state: %s", currentState)); } }

Target:
private synchronized void transitToNextState() { final State currentState = (State) stateMachine.getCurrentState(); switch (currentState) { case INIT: stateMachine.setState(State.RUN); LOG.log(Level.INFO, String.format("State transition: %s -> %s", State.INIT, State.RUN)); break; case RUN: stateMachine.setState(State.RUN_FINISHING); LOG.log(Level.INFO, String.format("State transition: %s -> %s", State.RUN, State.RUN_FINISHING)); break; case RUN_FINISHING: stateMachine.setState(State.CLEANUP); LOG.log(Level.INFO, String.format("State transition: %s -> %s", State.RUN_FINISHING, State.CLEANUP)); break; case CLEANUP: throw new RuntimeException(String.format("No more transition is allowed after %s state", State.CLEANUP)); default: throw new RuntimeException(String.format("Invalid state: %s", currentState)); } }
Source:
public void addNote(String user, String text) { if (user == null || text == null) { throw new IllegalArgumentException("Note mut have non-null user and text"); } getNotes().add(new Note(user, text)); }

Target:
public void addNote(String user, String text) { if (user == null || text == null) { throw new IllegalArgumentException("Note must have non-null user and text"); } getNotes().add(new Note(user, text)); }
Source:
public static void main(String[] args) throws Exception { Builder processingGraphBuilder = Builder.createBuilder(); processingGraphBuilder.newSource(SmartWatchReading::new) .setName("incoming-watch-readings") .reduceByKeyAndWindow( reading -> reading.getJoggerId(), reading -> reading.getFeetRun(), WindowConfig.TumblingTimeWindow(Duration.ofSeconds(10)), (cumulative, incoming) -> cumulative + incoming ) .setName("reduce-to-total-distance-per-jogger") .map(keyWindow -> { long totalFeetRun = keyWindow.getValue(); long startTime = keyWindow.getKey().getWindow().getStartTime(); long endTime = keyWindow.getKey().getWindow().getEndTime(); long timeLengthMillis = endTime - startTime; LOG.info( String.format("Calculating the average speed for jogger %s from time %d to %d", keyWindow.getKey().getKey(), startTime, endTime ) ); float feetPerMinute = totalFeetRun / (float) (timeLengthMillis / 1000); String paceString = new DecimalFormat("#.##").format(feetPerMinute); return new KeyValue<>(keyWindow.getKey().getKey(), paceString); }) .setName("calculate-average-speed") .consume(kv -> { String logMessage = String.format("(runner: %s, avgFeetPerMinute: %s)", kv.getKey(), kv.getValue()); LOG.info(logMessage); }); Config config = new Config(); String topologyName = StreamletUtils.getTopologyName(args); new Runner().run(topologyName, config, processingGraphBuilder); }

Target:
public static void main(String[] args) throws Exception { Builder processingGraphBuilder = Builder.createBuilder(); processingGraphBuilder.newSource(SmartWatchReading::new) .setName("incoming-watch-readings") .reduceByKeyAndWindow( reading -> reading.getJoggerId(), reading -> reading.getFeetRun(), WindowConfig.TumblingTimeWindow(Duration.ofSeconds(10)), (cumulative, incoming) -> cumulative + incoming ) .setName("reduce-to-total-distance-per-jogger") .map(keyWindow -> { long totalFeetRun = keyWindow.getValue(); long startTime = keyWindow.getKey().getWindow().getStartTime(); long endTime = keyWindow.getKey().getWindow().getEndTime(); long timeLengthMillis = endTime - startTime; float feetPerMinute = totalFeetRun / (float) (timeLengthMillis / 1000); String paceString = new DecimalFormat("#.##").format(feetPerMinute); return new KeyValue<>(keyWindow.getKey().getKey(), paceString); }) .setName("calculate-average-speed") .consume(kv -> { String logMessage = String.format("(runner: %s, avgFeetPerMinute: %s)", kv.getKey(), kv.getValue()); LOG.info(logMessage); }); Config config = new Config(); String topologyName = StreamletUtils.getTopologyName(args); new Runner().run(topologyName, config, processingGraphBuilder); }
Source:
public int read(byte[] buf, int offset, int byteCount) throws IOException { Platform.blockGuardOnNetwork(); checkOpen(); ArrayUtils.checkOffsetAndCount(buf.length, offset, byteCount); if (byteCount == 0) { return 0; } synchronized (readLock) { synchronized (stateLock) { if (state == STATE_CLOSED) { throw new SocketException("socket is closed"); } if (DBG_STATE) assertReadableOrWriteableState(); } int ret = NativeCrypto.SSL_read(sslNativePointer, Platform.getFileDescriptor(socket), OpenSSLSocketImpl.this, buf, offset, byteCount, getSoTimeout()); if (ret == -1 && socket != this) { synchronized (stateLock) { if (state == STATE_CLOSED) { throw new SocketException("socket is closed"); } } } return ret; } }

Target:
public int read(byte[] buf, int offset, int byteCount) throws IOException { Platform.blockGuardOnNetwork(); checkOpen(); ArrayUtils.checkOffsetAndCount(buf.length, offset, byteCount); if (byteCount == 0) { return 0; } synchronized (readLock) { synchronized (stateLock) { if (state == STATE_CLOSED) { throw new SocketException("socket is closed"); } if (DBG_STATE) assertReadableOrWriteableState(); } int ret = NativeCrypto.SSL_read(sslNativePointer, Platform.getFileDescriptor(socket), OpenSSLSocketImpl.this, buf, offset, byteCount, getSoTimeout()); if (ret == -1) { synchronized (stateLock) { if (state == STATE_CLOSED) { throw new SocketException("socket is closed"); } } } return ret; } }
Source:
public static String getActionUrl(String itUrl,Action action) { String urlName = action.getUrlName(); if(urlName==null) return null; try { if (new URI(urlName).isAbsolute()) { return urlName; } } catch (URISyntaxException x) { Logger.getLogger(Functions.class.getName()).log(Level.WARNING, "Failed to parse URL for {0}: {1}", new Object[] {action, x}); return null; } if(urlName.startsWith("/")) return joinPath(Stapler.getCurrentRequest().getContextPath(),urlName); else return joinPath(Stapler.getCurrentRequest().getContextPath()+'/'+itUrl,urlName); }

Target:
public static @CheckForNull String getActionUrl(String itUrl,Action action) { String urlName = action.getUrlName(); if(urlName==null) return null; try { if (new URI(urlName).isAbsolute()) { return urlName; } } catch (URISyntaxException x) { Logger.getLogger(Functions.class.getName()).log(Level.WARNING, "Failed to parse URL for {0}: {1}", new Object[] {action, x}); return null; } if(urlName.startsWith("/")) return joinPath(Stapler.getCurrentRequest().getContextPath(),urlName); else return joinPath(Stapler.getCurrentRequest().getContextPath()+'/'+itUrl,urlName); }
Source:
public void before() throws IOException, InterruptedException { lightblue.getControllerInstance().cleanupMongoCollections("country"); if (lightblue.getControllerInstance().getIdentityManager() != null) { lightblue.changeIdentityManager(null); Thread.sleep(5000); } }

Target:
public void before() throws IOException { lightblue.getControllerInstance().cleanupMongoCollections("country"); if (lightblue.getControllerInstance().getIdentityManager() != null) { lightblue.changeIdentityManager(null); } }
Source:
public default GraphTraversal<S, E> property(final VertexProperty.Cardinality cardinality, final Object key, final Object value, final Object... keyValues) { if (null == cardinality) this.asAdmin().getBytecode().addStep(Symbols.property, key, value, keyValues); else this.asAdmin().getBytecode().addStep(Symbols.property, cardinality, key, value, keyValues); Step endStep = this.asAdmin().getEndStep(); while (endStep instanceof AddPropertyStep) { endStep = endStep.getPreviousStep(); } if ((endStep instanceof AddVertexStep || endStep instanceof AddEdgeStep || endStep instanceof AddVertexStartStep || endStep instanceof AddEdgeStartStep) && keyValues.length == 0 && null == cardinality) { ((Mutating) endStep).addPropertyMutations(key, value); } else { this.asAdmin().addStep(new AddPropertyStep(this.asAdmin(), cardinality, key, value)); ((AddPropertyStep) this.asAdmin().getEndStep()).addPropertyMutations(keyValues); } return this; }

Target:
public default GraphTraversal<S, E> property(final VertexProperty.Cardinality cardinality, final Object key, final Object value, final Object... keyValues) { if (null == cardinality) this.asAdmin().getBytecode().addStep(Symbols.property, key, value, keyValues); else this.asAdmin().getBytecode().addStep(Symbols.property, cardinality, key, value, keyValues); Step endStep = this.asAdmin().getEndStep(); while (endStep instanceof AddPropertyStep) { endStep = endStep.getPreviousStep(); } if ((endStep instanceof AddEdgeStep || endStep instanceof AddEdgeStartStep) || ((endStep instanceof AddVertexStep || endStep instanceof AddVertexStartStep) && keyValues.length == 0 && (key instanceof T || (key instanceof String && null == cardinality) || key instanceof Traversal))) { ((Mutating) endStep).addPropertyMutations(key, value); } else { final AddPropertyStep<Element> addPropertyStep = new AddPropertyStep<>(this.asAdmin(), cardinality, key, value); this.asAdmin().addStep(addPropertyStep); addPropertyStep.addPropertyMutations(keyValues); } return this; }
Source:
public void deleteService(final Integer nodeId, final InetAddress addr, final String svcName) { final OnmsMonitoredService service = m_monitoredServiceDao.get(nodeId, addr, svcName); if (service != null) { final OnmsIpInterface iface = service.getIpInterface(); final OnmsNode node = iface.getNode(); final boolean lastService = (iface.getMonitoredServices().size() == 1); final boolean lastInterface = (node.getIpInterfaces().size() == 1); final DeleteEventVisitor visitor = new DeleteEventVisitor(m_eventForwarder); iface.removeMonitoredService(service); m_nodeDao.saveOrUpdate(node); m_nodeDao.flush(); service.visit(visitor); if (lastService) { node.removeIpInterface(iface); m_nodeDao.saveOrUpdate(node); m_nodeDao.flush(); iface.visit(visitor); if (lastInterface) { m_nodeDao.delete(node); m_nodeDao.flush(); node.visit(visitor); } } } }

Target:
public void deleteService(final Integer nodeId, final InetAddress addr, final String svcName) { LOG.debug("deleteService: nodeId={}, addr={}, service={}", nodeId, addr, svcName); final OnmsMonitoredService service = m_monitoredServiceDao.get(nodeId, addr, svcName); if (service != null) { final OnmsIpInterface iface = service.getIpInterface(); final OnmsNode node = iface.getNode(); final boolean lastService = (iface.getMonitoredServices().size() == 1); final boolean lastInterface = (node.getIpInterfaces().size() == 1); final DeleteEventVisitor visitor = new DeleteEventVisitor(m_eventForwarder); iface.removeMonitoredService(service); m_nodeDao.saveOrUpdate(node); m_nodeDao.flush(); service.visit(visitor); if (lastService) { LOG.debug("Deleting interface from node {}", InetAddressUtils.str(iface.getIpAddress()), nodeId); node.removeIpInterface(iface); m_nodeDao.saveOrUpdate(node); m_nodeDao.flush(); iface.visit(visitor); if (lastInterface) { LOG.debug("Deleting node {}", nodeId); m_nodeDao.delete(node); m_nodeDao.flush(); node.visit(visitor); } } } }
Source:
public static boolean containsSearchAnnotations(XClass mappedClass) { List<XClass> hierarchy = ReflectionHelper.createXClassHierarchy( mappedClass ); for ( XClass clazz : hierarchy ) { if ( containsLocalSearchAnnotation( clazz ) ) { return true; } } return false; }

Target:
public static boolean containsSearchAnnotations(XClass mappedClass) { List<XClass> hierarchy = createXClassHierarchy( mappedClass ); for ( XClass clazz : hierarchy ) { if ( containsLocalSearchAnnotation( clazz ) ) { return true; } } return false; }
Source:
private PerfData test(int characters) { PerfData ret = new PerfData(); String a = DiffTestDataGenerator.generateSequence(characters, 971, 3); String b = DiffTestDataGenerator.generateSequence(characters, 1621, 5); CharArray ac = new CharArray(a); CharArray bc = new CharArray(b); CharCmp cmp = new CharCmp(); MyersDiff<CharArray> myersDiff = null; int cpuTimeChanges = 0; long lastReadout = 0; long interimTime = 0; int repetitions = 0; stopwatch.start(); while (cpuTimeChanges < minCPUTimerTicks && interimTime < longTaskBoundary) { myersDiff = new MyersDiff<CharArray>(cmp, ac, bc); repetitions++; interimTime = stopwatch.readout(); if (interimTime != lastReadout) { cpuTimeChanges++; lastReadout = interimTime; } } ret.runningTime = stopwatch.stop() / repetitions; ret.N = cmp.size(ac) + cmp.size(bc); ret.D = myersDiff.getEdits().size(); return ret; }

Target:
private PerfData test(int characters) { PerfData ret = new PerfData(); String a = DiffTestDataGenerator.generateSequence(characters, 971, 3); String b = DiffTestDataGenerator.generateSequence(characters, 1621, 5); CharArray ac = new CharArray(a); CharArray bc = new CharArray(b); CharCmp cmp = new CharCmp(); MyersDiff<CharArray> myersDiff = null; int cpuTimeChanges = 0; long lastReadout = 0; long interimTime = 0; int repetitions = 0; stopwatch.start(); while (cpuTimeChanges < minCPUTimerTicks && interimTime < longTaskBoundary) { myersDiff = new MyersDiff<CharArray>(cmp, ac, bc); repetitions++; interimTime = stopwatch.readout(); if (interimTime != lastReadout) { cpuTimeChanges++; lastReadout = interimTime; } } ret.runningTime = stopwatch.stop() / repetitions; ret.N = ac.size() + bc.size(); ret.D = myersDiff.getEdits().size(); return ret; }
Source:
public IResourceVariant[] getMembers(IProgressMonitor progress) throws IOException { if (members != null) try { return members; } finally { progress.done(); } Repository repo = getRepository(); TreeWalk tw = new TreeWalk(repo); tw.reset(); int nth = tw.addTree(getObjectId()); int iteratorNth = tw.addTree(new FileTreeIterator(repo)); tw.setFilter(new NotIgnoredFilter(iteratorNth)); IProgressMonitor monitor = SubMonitor.convert(progress); monitor.beginTask( NLS.bind(CoreText.GitFolderResourceVariant_fetchingMembers, this), tw.getTreeCount()); List<IResourceVariant> result = new ArrayList<IResourceVariant>(); try { while (tw.next()) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } ObjectId newObjectId = tw.getObjectId(nth); String path = getPath() + "/" + new String(tw.getRawPath()); if (!newObjectId.equals(zeroId())) if (tw.isSubtree()) result.add(new GitFolderResourceVariant(repo, newObjectId, path)); else result.add(new GitBlobResourceVariant(repo, newObjectId, path)); monitor.worked(1); } members = result.toArray(new IResourceVariant[result.size()]); return members; } finally { monitor.done(); } }

Target:
public IResourceVariant[] getMembers(IProgressMonitor progress) throws IOException { if (members != null) try { return members; } finally { progress.done(); } Repository repo = getRepository(); TreeWalk tw = new TreeWalk(repo); tw.reset(); int nth = tw.addTree(getObjectId()); int iteratorNth = tw.addTree(new FileTreeIterator(repo)); tw.setFilter(new NotIgnoredFilter(iteratorNth)); IProgressMonitor monitor = SubMonitor.convert(progress); monitor.beginTask( NLS.bind(CoreText.GitFolderResourceVariant_fetchingMembers, this), tw.getTreeCount()); List<IResourceVariant> result = new ArrayList<IResourceVariant>(); try { while (tw.next()) { if (monitor.isCanceled()) throw new OperationCanceledException(); ObjectId newObjectId = tw.getObjectId(nth); String path = getPath() + "/" + new String(tw.getRawPath()); if (!newObjectId.equals(zeroId())) if (tw.isSubtree()) result.add(new GitFolderResourceVariant(repo, newObjectId, path)); else result.add(new GitBlobResourceVariant(repo, newObjectId, path)); monitor.worked(1); } members = result.toArray(new IResourceVariant[result.size()]); return members; } finally { monitor.done(); } }
Source:
public void setUp() { MockitoAnnotations.initMocks(this); caseActionService = new CaseActionServiceImpl(commcareCaseService); eventHandler = new CaseEventHandler(caseActionService); Map<String, String> caseProperties = new HashMap<>(); caseProperties.put("field1", "value1"); caseProperties.put("field2", "value2"); Map<String, Object> createCaseParams = new HashMap<>(); createCaseParams.put(EventDataKeys.CASE_TYPE, CASE_TYPE); createCaseParams.put(EventDataKeys.OWNER_ID, OWNER_ID); createCaseParams.put(EventDataKeys.CASE_NAME, CASE_NAME); createCaseParams.put(EventDataKeys.FIELD_VALUES, caseProperties); createCaseEvent = new MotechEvent(EventSubjects.CREATE_CASE + ".config1", createCaseParams); Map<String, Object> updateCaseParams = new HashMap<>(); updateCaseParams.put(EventDataKeys.CASE_ID, CASE_ID); updateCaseParams.put(EventDataKeys.OWNER_ID, OWNER_ID); updateCaseParams.put(EventDataKeys.FIELD_VALUES, caseProperties); updateCaseEvent = new MotechEvent(EventSubjects.UPDATE_CASE + ".config1", updateCaseParams); }

Target:
public void setUp() { MockitoAnnotations.initMocks(this); eventHandler = new CaseEventHandler(caseActionService); Map<String, String> caseProperties = new HashMap<>(); caseProperties.put("field1", "value1"); caseProperties.put("field2", "value2"); Map<String, Object> createCaseParams = new HashMap<>(); createCaseParams.put(EventDataKeys.CASE_TYPE, CASE_TYPE); createCaseParams.put(EventDataKeys.OWNER_ID, OWNER_ID); createCaseParams.put(EventDataKeys.CASE_NAME, CASE_NAME); createCaseParams.put(EventDataKeys.FIELD_VALUES, caseProperties); createCaseEvent = new MotechEvent(EventSubjects.CREATE_CASE + '.' + CONFIG_NAME, createCaseParams); Map<String, Object> updateCaseParams = new HashMap<>(); updateCaseParams.put(EventDataKeys.CASE_ID, CASE_ID); updateCaseParams.put(EventDataKeys.OWNER_ID, OWNER_ID); updateCaseParams.put(EventDataKeys.FIELD_VALUES, caseProperties); updateCaseEvent = new MotechEvent(EventSubjects.UPDATE_CASE + '.' + CONFIG_NAME, updateCaseParams); }
Source:
public RankedBitVectorImpl(long initialSize, int countBlockSize, int findPositionBlockSize) { if (countBlockSize < 1) { throw new IllegalArgumentException( "Block size must be a positive number. The received value was: " + countBlockSize + "."); } if (findPositionBlockSize < 0x40) { throw new IllegalArgumentException("Block size is too small: " + findPositionBlockSize + ". The minimum is " + 0x40 + "."); } this.bitVector = new BitVectorImpl(initialSize); this.countBitsArray = new CountBitsArray(this.bitVector, countBlockSize); this.findPositionOfFalse = new FindPositionArray(this.bitVector, false, findPositionBlockSize); this.findPositionOfTrue = new FindPositionArray(this.bitVector, true, findPositionBlockSize); }

Target:
public RankedBitVectorImpl(long initialSize, int countBlockSize, int findPositionBlockSize) { this.bitVector = new BitVectorImpl(initialSize); this.countBitsArray = new CountBitsArray(this.bitVector, countBlockSize); this.findPositionOfFalse = new FindPositionArray(this.bitVector, false, findPositionBlockSize); this.findPositionOfTrue = new FindPositionArray(this.bitVector, true, findPositionBlockSize); }
Source:
private void parse(boolean isSecure) throws URIException, HttpMalformedHeaderException { mIsSecure = isSecure; Matcher matcher = patternRequestLine.matcher(mStartLine); if (!matcher.find()) { mMalformedHeader = true; throw new HttpMalformedHeaderException("Failed to find pattern " + patternRequestLine + " in: " + mStartLine); } mMethod = matcher.group(1); String sUri = matcher.group(2); mVersion = matcher.group(3); if (!mVersion.equalsIgnoreCase(HTTP09) && !mVersion.equalsIgnoreCase(HTTP10) && !mVersion.equalsIgnoreCase(HTTP11)) { mMalformedHeader = true; throw new HttpMalformedHeaderException("Unexpected version: " + mVersion); } if (mMethod.equalsIgnoreCase(CONNECT)) { String hostHeader; hostHeader = sUri; parseHostName(hostHeader); mUri = parseURI(mHostName); } else { mUri = parseURI(sUri); if (mUri.getScheme() == null || mUri.getScheme().equals("")) { mUri = new URI(HTTP + "://" + getHeader(HOST) + mUri.toString(), true); } if (isSecure() && mUri.getScheme().equalsIgnoreCase(HTTP)) { mUri = new URI(mUri.toString().replaceFirst(HTTP, HTTPS), true); } if (mUri.getScheme().equalsIgnoreCase(HTTPS)) { setSecure(true); } mHostName = mUri.getHost(); setHostPort(mUri.getPort()); } }

Target:
private void parse(boolean isSecure) throws URIException, HttpMalformedHeaderException { mIsSecure = isSecure; Matcher matcher = patternRequestLine.matcher(mStartLine); if (!matcher.find()) { mMalformedHeader = true; throw new HttpMalformedHeaderException("Failed to find pattern " + patternRequestLine + " in: " + mStartLine); } mMethod = matcher.group(1); String sUri = matcher.group(2); mVersion = matcher.group(3); if (!mVersion.equalsIgnoreCase(HTTP09) && !mVersion.equalsIgnoreCase(HTTP10) && !mVersion.equalsIgnoreCase(HTTP11)) { mMalformedHeader = true; throw new HttpMalformedHeaderException("Unexpected version: " + mVersion); } if (mMethod.equalsIgnoreCase(CONNECT)) { parseHostName(sUri); mUri = parseURI(mHostName); } else { mUri = parseURI(sUri); if (mUri.getScheme() == null || mUri.getScheme().equals("")) { mUri = new URI(HTTP + "://" + getHeader(HOST) + mUri.toString(), true); } if (isSecure() && mUri.getScheme().equalsIgnoreCase(HTTP)) { mUri = new URI(mUri.toString().replaceFirst(HTTP, HTTPS), true); } if (mUri.getScheme().equalsIgnoreCase(HTTPS)) { setSecure(true); } mHostName = mUri.getHost(); setHostPort(mUri.getPort()); } }
Source:
public VoltCompiler(boolean standaloneCompiler, boolean isXDCR) { this.standaloneCompiler = standaloneCompiler; this.m_isXDCR = isXDCR; cachedAddedClasses.clear(); }

Target:
public VoltCompiler(boolean standaloneCompiler, boolean isXDCR) { this.standaloneCompiler = standaloneCompiler; this.m_isXDCR = isXDCR; m_cachedAddedClasses.clear(); }