auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public VmsCpuUsageExample() { Log.printFormattedLine("Starting %s ...", getClass().getSimpleName()); CloudSim simulation = new CloudSim(); @SuppressWarnings("unused") Datacenter datacenter0 = createDatacenter(simulation); broker = new DatacenterBrokerSimple(simulation); vmlist = new ArrayList<>(NUMBER_OF_VMS); cloudletList = new ArrayList<>(NUMBER_OF_VMS); int mips = 1000; int pesNumber = 1; for (int i = 1; i <= NUMBER_OF_VMS; i++) { Vm vm = createVm(pesNumber, mips * i, i - 1); vmlist.add(vm); Cloudlet cloudlet = createCloudlet(pesNumber, i-1); cloudletList.add(cloudlet); cloudlet.setVm(vm); } broker.submitVmList(vmlist); broker.submitCloudletList(cloudletList); final double finishTime = simulation.start(); List<Cloudlet> newList = broker.getCloudletFinishedList(); new CloudletsTableBuilder(broker.getCloudletFinishedList()).build(); showCpuUtilizationForAllVms(finishTime); Log.printFormattedLine("%s finished!", getClass().getSimpleName()); }

Target:
public VmsCpuUsageExample() { Log.printFormattedLine("Starting %s ...", getClass().getSimpleName()); CloudSim simulation = new CloudSim(); @SuppressWarnings("unused") Datacenter datacenter0 = createDatacenter(simulation); broker = new DatacenterBrokerSimple(simulation); vmlist = new ArrayList<>(NUMBER_OF_VMS); cloudletList = new ArrayList<>(NUMBER_OF_VMS); int mips = 1000; int pesNumber = 1; for (int i = 1; i <= NUMBER_OF_VMS; i++) { Vm vm = createVm(pesNumber, mips * i, i - 1); vmlist.add(vm); Cloudlet cloudlet = createCloudlet(pesNumber, i-1); cloudletList.add(cloudlet); cloudlet.setVm(vm); } broker.submitVmList(vmlist); broker.submitCloudletList(cloudletList); final double finishTime = simulation.start(); new CloudletsTableBuilder(broker.getCloudletFinishedList()).build(); showCpuUtilizationForAllVms(finishTime); Log.printFormattedLine("%s finished!", getClass().getSimpleName()); }
Source:
public ComplexMetricExtractor getExtractor() { throw new UnsupportedOperationException("How can this be?"); }

Target:
public ComplexMetricExtractor getExtractor() { throw new UnsupportedOperationException("Bloom filter aggregators are query-time only"); }
Source:
protected void declareNamespaces(XQueryContext context) throws XPathException { Map.Entry<String, String> entry; for (Map.Entry<String, String> stringStringEntry : namespaces.entrySet()) { entry = stringStringEntry; context.declareNamespace( entry.getKey(), entry.getValue()); } }

Target:
protected void declareNamespaces(XQueryContext context) throws XPathException { for (Map.Entry<String, String> entry : namespaces.entrySet()) { context.declareNamespace(entry.getKey(), entry.getValue()); } }
Source:
public synchronized Request getNextRequestBlock() { if (request == null) { throw new IllegalStateException("no request body"); } int num = getCurrentNum(); int szx = getCurrentSzx(); Request block = new Request(request.getCode()); block.setType(request.getType()); block.setDestinationContext(request.getDestinationContext()); block.setOptions(new OptionSet(request.getOptions())); block.addMessageObservers(request.getMessageObservers()); block.addMessageObserver(new FailureForwardingMessageObserver(request)); if (num == 0) { block.getOptions().setSize1(request.getPayloadSize()); } if (request.isUnintendedPayload()) { block.setUnintendedPayload(); } int currentSize = getCurrentSize(); int from = num * currentSize; int to = Math.min((num + 1) * currentSize, request.getPayloadSize()); int length = to - from; byte[] blockPayload = new byte[length]; System.arraycopy(request.getPayload(), from, blockPayload, 0, length); block.setPayload(blockPayload); boolean m = (to < request.getPayloadSize()); block.getOptions().setBlock1(szx, m, num); setComplete(!m); return block; }

Target:
public synchronized Request getNextRequestBlock() { if (request == null) { throw new IllegalStateException("no request body"); } int num = getCurrentNum(); int szx = getCurrentSzx(); Request block = new Request(request.getCode()); block.setType(request.getType()); block.setDestinationContext(request.getDestinationContext()); block.setOptions(new OptionSet(request.getOptions())); block.addMessageObservers(request.getMessageObservers()); if (num == 0) { block.getOptions().setSize1(request.getPayloadSize()); } if (request.isUnintendedPayload()) { block.setUnintendedPayload(); } int currentSize = getCurrentSize(); int from = num * currentSize; int to = Math.min((num + 1) * currentSize, request.getPayloadSize()); int length = to - from; byte[] blockPayload = new byte[length]; System.arraycopy(request.getPayload(), from, blockPayload, 0, length); block.setPayload(blockPayload); boolean m = (to < request.getPayloadSize()); block.getOptions().setBlock1(szx, m, num); setComplete(!m); return block; }
Source:
public void createSchema() throws Exception { final Connection db = getConnection(); db.setAutoCommit(false); try (final Statement statement = db.createStatement()) { String autoIncrement = ""; if (driver.contains("mysql")) { autoIncrement = "AUTO_INCREMENT"; } statement.executeUpdate( "CREATE TABLE " + this.table + " (id INTEGER PRIMARY KEY " + autoIncrement + ", created VARCHAR(255)" + ", name VARCHAR(255)" + ", data TEXT" + ")"); statement.executeUpdate( "CREATE UNIQUE INDEX name_index ON " + this.table + "(name)"); db.commit(); } catch (Exception e) { db.rollback(); throw e; } finally { db.setAutoCommit(true); } }

Target:
public void createSchema() throws Exception { beginTransaction(); try (final Statement statement = getConnection().createStatement()) { String autoIncrement = ""; if (driver.contains("mysql")) { autoIncrement = "AUTO_INCREMENT"; } statement.executeUpdate( "CREATE TABLE " + this.table + " (id INTEGER PRIMARY KEY " + autoIncrement + ", created VARCHAR(255)" + ", name VARCHAR(255)" + ", data TEXT" + ")"); statement.executeUpdate( "CREATE UNIQUE INDEX name_index ON " + this.table + " (name)"); commitTransaction(); } catch (Exception e) { rollbackTransaction(); throw e; } }
Source:
public ProvisioningConfigurationParcelable toStableParcelable() { final ProvisioningConfigurationParcelable p = new ProvisioningConfigurationParcelable(); p.enableIPv4 = mEnableIPv4; p.enableIPv6 = mEnableIPv6; p.usingMultinetworkPolicyTracker = mUsingMultinetworkPolicyTracker; p.usingIpReachabilityMonitor = mUsingIpReachabilityMonitor; p.requestedPreDhcpActionMs = mRequestedPreDhcpActionMs; p.initialConfig = mInitialConfig == null ? null : mInitialConfig.toStableParcelable(); p.staticIpConfig = IpConfigurationParcelableUtil.toStableParcelable(mStaticIpConfig); p.apfCapabilities = IpConfigurationParcelableUtil.toStableParcelable(mApfCapabilities); p.provisioningTimeoutMs = mProvisioningTimeoutMs; p.ipv6AddrGenMode = mIPv6AddrGenMode; p.network = clone(mNetwork); p.displayName = mDisplayName; return p; }

Target:
public ProvisioningConfigurationParcelable toStableParcelable() { final ProvisioningConfigurationParcelable p = new ProvisioningConfigurationParcelable(); p.enableIPv4 = mEnableIPv4; p.enableIPv6 = mEnableIPv6; p.usingMultinetworkPolicyTracker = mUsingMultinetworkPolicyTracker; p.usingIpReachabilityMonitor = mUsingIpReachabilityMonitor; p.requestedPreDhcpActionMs = mRequestedPreDhcpActionMs; p.initialConfig = mInitialConfig == null ? null : mInitialConfig.toStableParcelable(); p.staticIpConfig = IpConfigurationParcelableUtil.toStableParcelable(mStaticIpConfig); p.apfCapabilities = IpConfigurationParcelableUtil.toStableParcelable(mApfCapabilities); p.provisioningTimeoutMs = mProvisioningTimeoutMs; p.ipv6AddrGenMode = mIPv6AddrGenMode; p.network = mNetwork; p.displayName = mDisplayName; return p; }
Source:
"exceptions") public void queueListeningTestCase() throws InterruptedException, JMSException, ClientConnectorException { LOGGER.info("JMS Transport Sender is sending a message to the queue " + JMSTestConstants.QUEUE_NAME_1); JMSClientConnector sender = new JMSClientConnector(); jmsServer.receiveMessagesFromQueue(); sender.send(carbonMessage, null, properties); sender.send(carbonMessage, null, properties); }

Target:
public void queueListeningTestCase() throws InterruptedException, JMSException, ClientConnectorException { logger.info("JMS Transport Sender is sending a message to the queue " + JMSTestConstants.QUEUE_NAME_1); JMSClientConnector sender = new JMSClientConnector(); jmsServer.receiveMessagesFromQueue(); sender.send(carbonMessage, null, properties); sender.send(carbonMessage, null, properties); }
Source:
protected void encode(final ChannelHandlerContext context, final RntbdContextRequest message, final ByteBuf out) throws IllegalStateException { final RntbdContextRequest request = message; out.markWriterIndex(); try { request.encode(out); } catch (final IllegalStateException error) { out.resetWriterIndex(); throw error; } Logger.debug("{}: ENCODE COMPLETE: request={}", context.channel(), request); }

Target:
protected void encode(final ChannelHandlerContext context, final RntbdContextRequest message, final ByteBuf out) throws IllegalStateException { out.markWriterIndex(); try { message.encode(out); } catch (final IllegalStateException error) { out.resetWriterIndex(); throw error; } Logger.debug("{}: ENCODE COMPLETE: request={}", context.channel(), message); }
Source:
public void onRemove() { ArrayList<VdcActionParametersBase> pb = new ArrayList<VdcActionParametersBase>(); for (Object a : sourceListModel.getSelectedItems()) { Network network = (Network) a; if (network.isExternal()) { pb.add(new RemoveNetworkParameters(network.getId(), getForce().getIsSelected())); } else { pb.add(new RemoveNetworkParameters(network.getId())); } } Frontend.getInstance().runMultipleAction(VdcActionType.RemoveNetwork, pb); sourceListModel.setConfirmWindow(null); }

Target:
public void onRemove() { ArrayList<VdcActionParametersBase> pb = new ArrayList<VdcActionParametersBase>(); for (Object a : sourceListModel.getSelectedItems()) { Network network = (Network) a; pb.add(new RemoveNetworkParameters(network.getId())); } Frontend.getInstance().runMultipleAction(VdcActionType.RemoveNetwork, pb); sourceListModel.setConfirmWindow(null); }
Source:
protected Iterable<IAnalysisModule> getDependentAnalyses() { ITmfTrace trace = getTrace(); if (trace == null) { throw new IllegalStateException(); } IAnalysisModule module = trace.getAnalysisModule(TidAnalysisModule.ID); if (module == null) { return Collections.emptySet(); } IAnalysisModule module2 = trace.getAnalysisModule(KernelAnalysisModule.ID); if (module2 == null) { return ImmutableSet.of(module); } return ImmutableSet.of(module, module2); }

Target:
protected Iterable<IAnalysisModule> getDependentAnalyses() { ITmfTrace trace = getTrace(); if (trace == null) { throw new IllegalStateException(); } IAnalysisModule tidAnalysis = trace.getAnalysisModule(TidAnalysisModule.ID); if (tidAnalysis == null) { return Collections.emptySet(); } IAnalysisModule kernelAnalysis = trace.getAnalysisModule(KernelAnalysisModule.ID); if (kernelAnalysis == null) { return ImmutableSet.of(tidAnalysis); } return ImmutableSet.of(tidAnalysis, kernelAnalysis); }
Source:
private String retrieveVcfHead(String vcfFilePath) throws IOException { String vcfHead = ""; Scanner scanner = new Scanner(new GZIPInputStream(new FileInputStream(vcfFilePath))); while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (line.startsWith("#")) { vcfHead += line + "\n"; } } scanner.close(); return vcfHead; }

Target:
private String retrieveVcfHead(String vcfFilePath) throws IOException { String vcfHead = ""; Scanner scanner = new Scanner(new GZIPInputStream(new FileInputStream(vcfFilePath))); while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (line.startsWith("#")) { vcfHead += line + "\n"; } else { break; } } scanner.close(); return vcfHead; }
Source:
public List<AggregatorFactory> getRequiredColumns() { return fields.stream() .map( input -> new CardinalityAggregatorFactory( input.getOutputName(), null, Collections.singletonList(input), byRow, round ) ).collect(Collectors.toList()); }

Target:
public List<AggregatorFactory> getRequiredColumns() { return fields.stream() .map( field -> new CardinalityAggregatorFactory( field.getOutputName(), null, Collections.singletonList(field), byRow, round ) ) .collect(Collectors.toList()); }
Source:
public void testRegisterProcessorAndGetIdShouldFailForDuplicateProcessorRegistration() { final String testHostName = "localhost"; final String testProcessId = "testProcessorId"; ProcessorData processorData1 = new ProcessorData(testHostName, testProcessId); zkUtils.registerProcessorAndGetId(processorData1); ZkUtils zkUtils1 = getZkUtils(); zkUtils1.connect(); ProcessorData duplicateProcessorData = new ProcessorData(testHostName, testProcessId); expectedException.expect(IllegalStateException.class); zkUtils1.registerProcessorAndGetId(duplicateProcessorData); }

Target:
public void testRegisterProcessorAndGetIdShouldFailForDuplicateProcessorRegistration() { final String testHostName = "localhost"; final String testProcessId = "testProcessorId"; ProcessorData processorData1 = new ProcessorData(testHostName, testProcessId); zkUtils.registerProcessorAndGetId(processorData1); ZkUtils zkUtils1 = getZkUtils(); zkUtils1.connect(); ProcessorData duplicateProcessorData = new ProcessorData(testHostName, testProcessId); expectedException.expect(SamzaException.class); zkUtils1.registerProcessorAndGetId(duplicateProcessorData); }
Source:
private Response getSearchResponse(Account account, Map<String, String> queryParams) { String url = directDebitConnectorUriGenerator.directDebitPaymentsURI(account, queryParams); Response connectorResponse = client .target(url) .request() .header(HttpHeaders.ACCEPT, APPLICATION_JSON) .get(); LOGGER.info("response from dd connector for payment search: {}", connectorResponse); if (connectorResponse.getStatus() == SC_OK) { return processResponse(connectorResponse); } throw new SearchPaymentsException(connectorResponse); }

Target:
private Response getSearchResponse(Account account, Map<String, String> queryParams) { String url = directDebitConnectorUriGenerator.directDebitPaymentsURI(account, queryParams); Response connectorResponse = client .target(url) .request() .header(HttpHeaders.ACCEPT, APPLICATION_JSON) .get(); if (connectorResponse.getStatus() == SC_OK) { return processResponse(connectorResponse); } throw new SearchPaymentsException(connectorResponse); }
Source:
public void onCreate() { super.onCreate(); if (!isPreBetaRelease()) { initExceptionHandling(); } refWatcher = Prefs.isMemoryLeakTestEnabled() ? LeakCanary.install(this) : RefWatcher.DISABLED; AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); bus = new Bus(); ViewAnimations.init(getResources()); currentTheme = unmarshalCurrentTheme(); appLanguageState = new AppLanguageState(this); funnelManager = new FunnelManager(this); sessionFunnel = new SessionFunnel(this); editTokenStorage = new EditTokenStorage(); database = new Database(this); enableWebViewDebugging(); Api.setConnectionFactory(new OkHttpConnectionFactory()); ImagePipelineConfig config = OkHttpImagePipelineConfigFactory .newBuilder(this, OkHttpConnectionFactory.getClient()) .build(); Fresco.initialize(this, config); zeroHandler = new WikipediaZeroHandler(this); pageCache = new PageCache(this); AccountUtil.createAccountForLoggedInUser(); UserOptionContentResolver.registerAppSyncObserver(this); registerReadingListPageObserver(); startService(new Intent(this, NotificationPollService.class)); }

Target:
public void onCreate() { super.onCreate(); if (!isPreBetaRelease()) { initExceptionHandling(); } refWatcher = Prefs.isMemoryLeakTestEnabled() ? LeakCanary.install(this) : RefWatcher.DISABLED; AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); bus = new Bus(); ViewAnimations.init(getResources()); currentTheme = unmarshalCurrentTheme(); appLanguageState = new AppLanguageState(this); funnelManager = new FunnelManager(this); sessionFunnel = new SessionFunnel(this); editTokenStorage = new EditTokenStorage(); database = new Database(this); enableWebViewDebugging(); Api.setConnectionFactory(new OkHttpConnectionFactory()); ImagePipelineConfig config = OkHttpImagePipelineConfigFactory .newBuilder(this, OkHttpConnectionFactory.getClient()) .build(); Fresco.initialize(this, config); zeroHandler = new WikipediaZeroHandler(this); pageCache = new PageCache(this); AccountUtil.createAccountForLoggedInUser(); UserOptionContentResolver.registerAppSyncObserver(this); registerReadingListPageObserver(); NotificationPollService.start(this); }
Source:
protected void setContent(Event event, Position position, BoundRequestBuilder requestBuilder) { if (!additionalParams.equals("")) { Map<String, List<String>> paramsToAdd = splitParams(additionalParams, "="); for (Entry<String, List<String>> en : paramsToAdd.entrySet()) { for (String value : en.getValue()) { requestBuilder.addBodyPart(new StringPart(en.getKey(), value, null, StandardCharsets.UTF_8)); } } } requestBuilder.addBodyPart(new StringPart(payloadParamName, prepareJsonPayload(event, position), "application/json", StandardCharsets.UTF_8)); }

Target:
protected void setContent(Event event, Position position, BoundRequestBuilder requestBuilder) { if (additionalParams != null && !additionalParams.isEmpty()) { Map<String, List<String>> paramsToAdd = splitIntoKeyValues(additionalParams, "="); for (Entry<String, List<String>> param : paramsToAdd.entrySet()) { for (String singleParamValue : param.getValue()) { requestBuilder.addBodyPart(new StringPart(param.getKey(), singleParamValue, null, StandardCharsets.UTF_8)); } } } requestBuilder.addBodyPart(new StringPart(payloadParamName, prepareJsonPayload(event, position), "application/json", StandardCharsets.UTF_8)); }
Source:
public CacheImpl(String name) { this.name = name; this.encoderClass = IdentityEncoder.class; this.wrapperClass = ByteArrayWrapper.class; }

Target:
public CacheImpl(String name) { this.name = name; this.keyEncoderClass = IdentityEncoder.class; this.valueEncoderClass = IdentityEncoder.class; this.keyWrapperClass = ByteArrayWrapper.class; this.valueWrapperClass = ByteArrayWrapper.class; }
Source:
public void removeUnsupportedAttributes(DisplayerSettings displayerSettings) { String componentId = displayerSettings.getComponentId(); Map<String,String> settingsMap = displayerSettings.getSettingsFlatMap(); for (String setting : new HashSet<>(settingsMap.keySet())) { if (!supportedEditorAttrStrings.contains(setting) && componentId != null && !setting.startsWith(componentId)) { displayerSettings.removeDisplayerSetting(setting); } } }

Target:
public void removeUnsupportedAttributes(DisplayerSettings displayerSettings) { String componentId = displayerSettings.getComponentId(); if (componentId != null) { Map<String, String> settingsMap = displayerSettings.getSettingsFlatMap(); for (String setting : new HashSet<>(settingsMap.keySet())) { if (!supportedEditorAttrStrings.contains(setting) && !setting.startsWith(componentId)) { displayerSettings.removeDisplayerSetting(setting); } } } }
Source:
public void visitToken(DetailAST ast) { if (isInEnumClassOrRecordBlock(ast)) { final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS); switch (ast.getType()) { case TokenTypes.ENUM_DEF: if (violateImpliedStaticOnNestedEnum && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; case TokenTypes.INTERFACE_DEF: if (violateImpliedStaticOnNestedInterface && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; case TokenTypes.RECORD_DEF: if (violateImpliedStaticOnNestedRecord && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; default: throw new IllegalStateException(ast.toString()); } } }

Target:
public void visitToken(DetailAST ast) { if (isInTypeBlock(ast)) { final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS); switch (ast.getType()) { case TokenTypes.ENUM_DEF: if (violateImpliedStaticOnNestedEnum && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; case TokenTypes.INTERFACE_DEF: if (violateImpliedStaticOnNestedInterface && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; case TokenTypes.RECORD_DEF: if (violateImpliedStaticOnNestedRecord && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; default: throw new IllegalStateException(ast.toString()); } } }
Source:
public void visitNode(AstNode node) { if (node.is(PythonGrammar.NOT_TEST)) { checkAtom(node.getFirstChild().getNextSibling()); } else { node.getChildren(PythonGrammar.ATOM).forEach(this::checkAtom); } }

Target:
public void visitNode(AstNode node) { List<AstNode> children = node.getChildren(); boolean hasParentheses = children.size() == 3 && children.get(0).is(PythonPunctuator.LPARENTHESIS); if (hasParentheses) { AstNode child1 = children.get(1); if(child1.getChildren(PythonGrammar.TEST).size() == 1 && child1.getFirstChild(PythonPunctuator.COMMA) == null && !child1.hasDirectChildren(PythonGrammar.COMP_FOR)) { AstNode test = child1.getFirstChild(PythonGrammar.TEST); if (!test.hasDirectChildren(PythonKeyword.IF)) { AstNode testChild0 = test.getFirstChild(); if (testChild0.is(PythonGrammar.ATOM) && testChild0.getFirstChild().is(PythonPunctuator.LPARENTHESIS)) { addIssue(children.get(0), MESSAGE).secondary(children.get(2), null); } } } } }
Source:
public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(this.getDimension()); byte[] lowerBytes = this.getLower() == null ? new byte[0] : StringUtils.toUtf8(this.getLower()); byte[] upperBytes = this.getUpper() == null ? new byte[0] : StringUtils.toUtf8(this.getUpper()); byte boundType = 0x1; if (this.getLower() == null) { boundType = 0x2; } else if (this.getUpper() == null) { boundType = 0x3; } byte lowerStrictByte = (this.isLowerStrict() == false) ? 0x0 : (byte) 1; byte upperStrictByte = (this.isUpperStrict() == false) ? 0x0 : (byte) 1; byte AlphaNumericByte = (this.isAlphaNumeric() == false) ? 0x0 : (byte) 1; byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); byte[] orderingBytes = StringUtils.toUtf8(ordering); ByteBuffer boundCacheBuffer = ByteBuffer.allocate( 10 + dimensionBytes.length + upperBytes.length + lowerBytes.length + extractionFnBytes.length + orderingBytes.length ); boundCacheBuffer.put(DimFilterUtils.BOUND_CACHE_ID) .put(boundType) .put(upperStrictByte) .put(lowerStrictByte) .put(AlphaNumericByte) .put(DimFilterUtils.STRING_SEPARATOR) .put(dimensionBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(upperBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(lowerBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(extractionFnBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(orderingBytes); return boundCacheBuffer.array(); }

Target:
public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(this.getDimension()); byte[] lowerBytes = this.getLower() == null ? new byte[0] : StringUtils.toUtf8(this.getLower()); byte[] upperBytes = this.getUpper() == null ? new byte[0] : StringUtils.toUtf8(this.getUpper()); byte boundType = 0x1; if (this.getLower() == null) { boundType = 0x2; } else if (this.getUpper() == null) { boundType = 0x3; } byte lowerStrictByte = (this.isLowerStrict() == false) ? 0x0 : (byte) 1; byte upperStrictByte = (this.isUpperStrict() == false) ? 0x0 : (byte) 1; byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); byte[] orderingBytes = ordering.getCacheKey(); ByteBuffer boundCacheBuffer = ByteBuffer.allocate( 9 + dimensionBytes.length + upperBytes.length + lowerBytes.length + extractionFnBytes.length + orderingBytes.length ); boundCacheBuffer.put(DimFilterUtils.BOUND_CACHE_ID) .put(boundType) .put(upperStrictByte) .put(lowerStrictByte) .put(DimFilterUtils.STRING_SEPARATOR) .put(dimensionBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(upperBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(lowerBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(extractionFnBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(orderingBytes); return boundCacheBuffer.array(); }
Source:
public Object[] getParametersForDocumentation(Object p, ParameterInfoContext context) { return new Object[0]; }

Target:
public Object[] getParametersForDocumentation(Object p, ParameterInfoContext context) { return EMPTY_ARRAY; }
Source:
public Group drawDiagram(final StackedMutationContainer container, final int zoomLevel, final double width) { Map<Integer, StackedMutationContainer> containers = container .mapLevelStackedMutation(); Group root = new Group(); StackedMutationContainer stack = containers.get(Math.max(1, Math.min(zoomLevel, container.getLevel() - 1))); int stacks = stack.getStack().size(); for (int index = 0; index < stacks; index++) { StackView stackView = new StackView(stack.getStack().get(index), (width / stacks), stack.getMaxMutations()); stackView.setLayoutX(index * (width / stacks)); root.getChildren().add(stackView); } return root; }

Target:
public Group drawDiagram(final StackedMutationContainer container, final int zoomLevel, final double width) { Map<Integer, StackedMutationContainer> containers = container .mapLevelStackedMutation(); int stackLevel = Math.max(1, Math.min(zoomLevel, container.getLevel())); StackedMutationContainer stack = containers.get(stackLevel); return drawStackContainer(stack, width); }
Source:
public void scheduleUpdater() { ExecutorService executorService = Executors.newFixedThreadPool(STARTUP_THREAD_COUNT); Set<ScheduledTask> jobsAtStartup = Sets.newHashSet(); if (Boolean.parseBoolean(updaterEnabled) && Boolean.parseBoolean(channelEquivEnabled)) { log.info("Channel equivalence enabled"); addEquivalenceJobs(jobsAtStartup); } for (ScheduledTask scheduledTask : jobsAtStartup) { executorService.submit(scheduledTask); } }

Target:
public void scheduleUpdater() { ExecutorService executorService = Executors.newFixedThreadPool(STARTUP_THREAD_COUNT); Set<ScheduledTask> jobsAtStartup = Sets.newHashSet(); if (Boolean.parseBoolean(updaterEnabled) && Boolean.parseBoolean(channelEquivEnabled)) { log.info("Channel equivalence enabled"); addEquivalenceJobs(jobsAtStartup); } jobsAtStartup.forEach(executorService::submit); }
Source:
public synchronized void updated(final Map<String, Object> properties) { logger.debug(message.updatingWireService() + properties); this.extractProperties(properties); try { this.createWires(); } catch (final KuraException e) { logger.error(ThrowableUtil.stackTraceAsString(e)); } logger.debug(message.updatingWireServiceDone()); }

Target:
public synchronized void updated(final Map<String, Object> properties) { logger.debug(message.updatingWireService() + properties); this.extractProperties(properties); try { this.createWires(); } catch (final KuraException e) { logger.error(e.getMessage(), e); } logger.debug(message.updatingWireServiceDone()); }
Source:
public void computeCompletionProposals(final TextEditor textEditor, final int offset, final CodeAssistCallback callback) { if (buildContext.isBuilding()) { errorMessage = "Code Assistant currently unavailable due to project build."; } else { errorMessage = null; } if (errorMessage != null) { return; } this.eventLogger.log(this, "Autocompleting"); final FileNode file = editor.getEditorInput().getFile(); String projectPath; if (file.getPath().startsWith("/")) { projectPath = "/" + file.getPath().substring(1).split("/")[0]; } else { projectPath = "/" + file.getPath().split("/")[0]; } this.worker.computeCAProposals(textEditor.getDocument().getContents(), offset, file.getName(), projectPath, new JavaParserWorker.WorkerCallback<WorkerProposal>() { @Override public void onResult(final Array<WorkerProposal> problems) { handleCAResponse(callback, problems); } }); }

Target:
public void computeCompletionProposals(final TextEditor textEditor, final int offset, final CodeAssistCallback callback) { if (buildContext.isBuilding()) { errorMessage = "Code Assistant currently unavailable due to project build."; } else { errorMessage = null; } if (errorMessage != null) { return; } this.eventLogger.log(this, "Autocompleting"); final String fileName = editor.getEditorInput().getFile().getName(); final String projectPath = this.appContext.getCurrentProject().getProjectDescription().getPath(); this.worker.computeCAProposals(textEditor.getDocument().getContents(), offset, fileName, projectPath, new JavaParserWorker.WorkerCallback<WorkerProposal>() { @Override public void onResult(final Array<WorkerProposal> problems) { handleCAResponse(callback, problems); } }); }
Source:
protected void decode(ChannelHandlerContext ctx, ByteBuf buffer) throws InterruptedException { if (pristine && stack.isEmpty() && buffer.isReadable()) { if (debugEnabled) { logger.debug("{} Received response without a command context (empty stack)", logPrefix()); } if (consumeResponse(buffer)) { pristine = false; } return; } while (canDecode(buffer)) { RedisCommand<?, ?, ?> command = stack.peek(); if (debugEnabled) { logger.debug("{} Stack contains: commands", logPrefix(), stack.size()); } pristine = false; try { if (!decode(ctx, buffer, command)) { return; } } catch (Exception e) { ctx.close(); throw e; } if (isProtectedMode(command)) { onProtectedMode(command.getOutput().getError()); } else { stack.poll(); try { command.complete(); } catch (Exception e) { logger.warn("{} Unexpected exception during request: {}", logPrefix, e.toString(), e); } } discardReadBytesIfNeeded(buffer); afterComplete(ctx, command); } }

Target:
protected void decode(ChannelHandlerContext ctx, ByteBuf buffer) throws InterruptedException { if (pristine && stack.isEmpty() && buffer.isReadable()) { if (debugEnabled) { logger.debug("{} Received response without a command context (empty stack)", logPrefix()); } if (consumeResponse(buffer)) { pristine = false; } return; } while (canDecode(buffer)) { RedisCommand<?, ?, ?> command = stack.peek(); if (debugEnabled) { logger.debug("{} Stack contains: commands", logPrefix(), stack.size()); } pristine = false; try { if (!decode(ctx, buffer, command)) { return; } } catch (Exception e) { ctx.close(); throw e; } if (isProtectedMode(command)) { onProtectedMode(command.getOutput().getError()); } else { stack.poll(); try { command.complete(); } catch (Exception e) { logger.warn("{} Unexpected exception during request: {}", logPrefix, e.toString(), e); } } if (buffer.refCnt() != 0) { buffer.discardSomeReadBytes(); } afterComplete(ctx, command); } }
Source:
public void setPartials(List<PartialConfig> partials) { this.partials = new Cloner().deepClone(partials); }

Target:
public void setPartials(List<PartialConfig> partials) { this.partials = partials; }
Source:
public void verifySslTrust() throws Exception { System.setProperty("javax.net.ssl.trustStore", this.getClass().getResource("/ssl/trusted/cacerts.jks").getPath()); System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); Properties properties = new Properties(); properties.setProperty(GeneralOption.HOST.getKey(), "localhost"); properties.setProperty(GeneralOption.PORT.getKey(), Integer.toString(trustedService.httpsPort())); properties.setProperty(GeneralOption.USE_HTTPS.getKey(), "true"); properties.setProperty(GeneralOption.VERIFY_SSL.getKey(), "true"); ConnectorDetails connectorDetails = new ConnectorDetails(ConfigurationBuilder.initFromProperties(properties)); HttpHelper httpHelper = new HttpHelper(); HttpHost httpHost = httpHelper.buildHttpHost(connectorDetails); CloseableHttpClient closeableHttpClient = httpHelper.buildClient(httpHost, connectorDetails); CloseableHttpResponse response = closeableHttpClient.execute(httpHost, new HttpGet("/hello")); assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200); }

Target:
public void verifySslTrust() throws Exception { setSystemTrustStore(); ConnectorDetails connectorDetails = buildConnectorDetails("localhost", trustedService.httpsPort(), "true", "true"); HttpHelper httpHelper = new HttpHelper(); HttpHost httpHost = httpHelper.buildHttpHost(connectorDetails); CloseableHttpClient closeableHttpClient = httpHelper.buildClient(httpHost, connectorDetails); CloseableHttpResponse response = closeableHttpClient.execute(httpHost, new HttpGet("/hello")); assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200); }
Source:
AesCbcHmacSha2Decryptor(String name, byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { Triple<byte[], byte[], Mac> parameters = getAlgorithmParameters(name, key); hmac = parameters.getRight(); hmacKey = parameters.getMiddle(); inner = new AesCbc.AesCbcDecryptor(parameters.getLeft(), iv, provider); aadLength = toBigEndian(authenticationData.length * 8L); tag = authenticationTag; hmac.update(authenticationData); hmac.update(iv); }

Target:
AesCbcHmacSha2Decryptor(String name, byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException { Triplet<byte[], byte[], Mac> parameters = getAlgorithmParameters(name, key); hmac = parameters.getRight(); hmacKey = parameters.getMiddle(); inner = new AesCbc.AesCbcDecryptor(parameters.getLeft(), iv, provider); aadLength = toBigEndian(authenticationData.length * BYTE_TO_BITS); tag = authenticationTag; hmac.update(authenticationData); hmac.update(iv); }
Source:
protected boolean attachUserToSession() { if (!StringUtils.isEmpty(getParameters().getSessionId())) { if (SessionDataContainer.getInstance() .getValidTo(getParameters().getSessionId()).compareTo(new Date()) < 0) { SessionDataContainer.getInstance().removeSession(getParameters().getSessionId()); return failCanDoAction(VdcBllMessages.USER_CANNOT_LOGIN_SESSION_MISSING); } SessionDataContainer.getInstance().setUser(getParameters().getSessionId(), getCurrentUser()); } else { if (!SessionDataContainer.getInstance().setUser(getCurrentUser())) { return failCanDoAction(VdcBllMessages.USER_CANNOT_LOGIN_SESSION_MISSING); } Date validTo = DateUtils.addMinutes(new Date(), Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval)); try { Date fromExtension = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ").parse(authRecord.<String> get(AuthRecord.VALID_TO)); validTo = validTo.compareTo(fromExtension) < 0 ? validTo : fromExtension; } catch (ParseException e) { log.warn("Error parsing AuthRecord.VALID_TO . Default VALID_TO value will be set on session"); } SessionDataContainer.getInstance().setValidTo(validTo); } return true; }

Target:
protected boolean attachUserToSession() { if (!StringUtils.isEmpty(getParameters().getSessionId())) { SessionDataContainer.getInstance().setUser(getParameters().getSessionId(), getCurrentUser()); } else if (!SessionDataContainer.getInstance().setUser(getCurrentUser())) { return failCanDoAction(VdcBllMessages.USER_CANNOT_LOGIN_SESSION_MISSING); } return true; }
Source:
public URL getShareUrl() { String shareURLString = String.format("%s/%s", azureFileStorageClient.getUrl(), shareName); if (snapshot != null) { shareURLString = String.format("%s?snapshot=%s", shareURLString, snapshot); } try { return new URL(shareURLString); } catch (MalformedURLException e) { throw logger.logExceptionAsError(new RuntimeException( String.format("Invalid URL on %s: %s" + getClass().getSimpleName(), shareURLString), e)); } }

Target:
public URL getShareUrl() { StringBuilder shareURLString = new StringBuilder(azureFileStorageClient.getUrl()).append("/").append(shareName); if (snapshot != null) { shareURLString.append("?snapshot=").append(snapshot); } try { return new URL(shareURLString.toString()); } catch (MalformedURLException e) { throw logger.logExceptionAsError(new RuntimeException( String.format("Invalid URL on %s: %s" + getClass().getSimpleName(), shareURLString), e)); } }
Source:
private static ExecutorService getCommonPool() { return AccessController.doPrivileged((PrivilegedAction<ExecutorService>) () -> { return ForkJoinPool.commonPool(); }); }

Target:
private static ExecutorService getCommonPool() { if (System.getSecurityManager() != null) { return AccessController.doPrivileged((PrivilegedAction<ExecutorService>) () -> { return ForkJoinPool.commonPool(); }); } else { return ForkJoinPool.commonPool(); } }
Source:
public DataWord and(DataWord word) { byte[] newData = this.getData(); for (int i = 0; i < this.data.length; ++i) { newData[i] &= word.data[i]; } return new DataWord(newData); }

Target:
public DataWord and(DataWord word) { byte[] newData = this.copyData(); for (int i = 0; i < this.data.length; ++i) { newData[i] &= word.data[i]; } return new DataWord(newData); }
Source:
public void removeWarehouse(Warehouse warehouse) { notNull(warehouse, "warehouse"); try { restTemplate.delete(warehouse.getSelfLink()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to delete Warehouse", e); } }

Target:
public void removeWarehouse(Warehouse warehouse) { notNull(warehouse, "warehouse"); try { restTemplate.delete(warehouse.getSelfLink()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to delete Warehouse, uri: " + warehouse.getSelfLink(), e); } }
Source:
void handleResponse(ResponseInfo responseInfo) { int correlationId = ((PutRequest) responseInfo.getRequest()).getCorrelationId(); PutOperation putOperation = correlationIdToPutOperation.remove(correlationId); if (putOperations.contains(putOperation)) { try { putOperation.handleResponse(responseInfo); } catch (Exception e) { putOperation.setOperationException(new RouterException("Put handleResponse encountered unexpected error", e, RouterErrorCode.UnexpectedInternalError)); } if (putOperation.isOperationComplete() && putOperations.remove(putOperation)) { onComplete(putOperation); } } else { routerMetrics.ignoredResponseCount.inc(); } }

Target:
void handleResponse(ResponseInfo responseInfo) { int correlationId = ((PutRequest) responseInfo.getRequest()).getCorrelationId(); PutOperation putOperation = correlationIdToPutOperation.remove(correlationId); if (putOperations.contains(putOperation)) { try { putOperation.handleResponse(responseInfo); } catch (Exception e) { putOperation.setOperationExceptionAndComplete(new RouterException("Put handleResponse encountered unexpected error", e, RouterErrorCode.UnexpectedInternalError)); } if (putOperation.isOperationComplete() && putOperations.remove(putOperation)) { onComplete(putOperation); } } else { routerMetrics.ignoredResponseCount.inc(); } }
Source:
public boolean isAbbreviatedName(String journalName) { String journal = journalName.trim(); boolean isAbbreviated = customAbbreviations.stream().anyMatch(abbreviation -> isMatchedAbbreviated(journal, abbreviation)); if (isAbbreviated) { return true; } return abbreviationToFull.containsKey(journal); }

Target:
public boolean isAbbreviatedName(String journalName) { String journal = journalName.trim(); return customAbbreviations.stream().anyMatch(abbreviation -> isMatchedAbbreviated(journal, abbreviation)) || abbreviationToFull.containsKey(journal); }
Source:
CommitMessageWithCaretPosition calculateCommitMessageAndCaretPosition() { StringBuilder finalMessage = new StringBuilder(); int caretPosition = CommitMessageWithCaretPosition.NO_POSITION; for (ICommitMessageProvider provider : providers) { String messagePart = ""; try { if (provider instanceof ICommitMessageProvider2) { CommitMessageWithCaretPosition commitMessageWithPosition = ((ICommitMessageProvider2) provider) .getCommitMessageWithPosition(resourcesArray); messagePart = getCommitMessage( commitMessageWithPosition, finalMessage.length() == 0); if (commitMessageWithPosition != null) { caretPosition = getUpdatedCaretPosition(finalMessage, caretPosition, commitMessageWithPosition, (ICommitMessageProvider2) provider); } } else { messagePart = getCommitMessage(provider, finalMessage.length() == 0); } } catch (RuntimeException e) { Activator.logError(e.getMessage(), e); } finalMessage.append(messagePart); } return new CommitMessageWithCaretPosition(finalMessage.toString(), Math.max(0, caretPosition)); }

Target:
CommitMessageWithCaretPosition calculateCommitMessageAndCaretPosition() { StringBuilder finalMessage = new StringBuilder(); int caretPosition = CommitMessageWithCaretPosition.NO_POSITION; for (ICommitMessageProvider provider : providers) { String message = ""; try { if (provider instanceof ICommitMessageProvider2) { CommitMessageWithCaretPosition commitMessageWithPosition = ((ICommitMessageProvider2) provider) .getCommitMessageWithPosition(resourcesArray); message = getCommitMessage( commitMessageWithPosition, finalMessage.length() == 0); if (commitMessageWithPosition != null) { caretPosition = getUpdatedCaretPosition(finalMessage, caretPosition, commitMessageWithPosition, (ICommitMessageProvider2) provider); } } else { message = buildCommitMessage( provider.getMessage(resourcesArray), finalMessage.length() == 0); } } catch (RuntimeException e) { Activator.logError(e.getMessage(), e); } finalMessage.append(message); } return new CommitMessageWithCaretPosition(finalMessage.toString(), Math.max(0, caretPosition)); }
Source:
public boolean equals(final Object o) { if (!(o instanceof Window)) { return false; } Window<T> window = (Window<T>) o; if (this.getLatestWatermark() == null && window.getLatestWatermark() == null) { return true; } if (this.getLatestWatermark() == null || window.getLatestWatermark() == null) { return false; } return this.getStart() == window.getStart() && this.getEnd() == window.getEnd() && this.getLatestTimestamp() == window.getLatestTimestamp() && this.getLatestWatermark().getTimestamp() == window.getLatestWatermark().getTimestamp() && this.getDataCollection().equals(window.getDataCollection()); }

Target:
public boolean equals(final Object o) { if (!(o instanceof Window)) { return false; } Window<T> window = (Window<T>) o; if (this.getLatestWatermark() == null ^ window.getLatestWatermark() == null) { return false; } return ((this.getLatestWatermark() == null && window.getLatestWatermark() == null) || this.getLatestWatermark().getTimestamp() == window.getLatestWatermark().getTimestamp()) && this.getStart() == window.getStart() && this.getEnd() == window.getEnd() && this.getLatestTimestamp() == window.getLatestTimestamp() && this.getDataCollection().equals(window.getDataCollection()); }
Source:
public void renderAFeatureWithNoScenario() { assertPrettyIdentical("Feature: hello\n"); }

Target:
void renderAFeatureWithNoScenario() { assertPrettyIdentical("Feature: hello\n"); }
Source:
protected boolean canDoAction() { Guid userId = getParameters().getUserProfile().getUserId(); if (userId == null) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_PROFILE_NOT_EXISTS); } else { if (userId.equals(Guid.Empty)) { userId = getUserId(); getParameters().getUserProfile().setUserId(userId); } else if (!userId.equals(getUserId())) { return failCanDoAction(EngineMessage.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION); } } String sshPublicKey = getParameters().getUserProfile().getSshPublicKey(); if (sshPublicKey == null || sshPublicKey.isEmpty()) { return true; } if (!OpenSSHUtils.isPublicKeyValid(sshPublicKey)) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_INVALID_PUBLIC_SSH_KEY); } return true; }

Target:
protected boolean canDoAction() { Guid userId = getParameters().getUserProfile().getUserId(); if (Guid.isNullOrEmpty(userId)) { userId = getUserId(); getParameters().getUserProfile().setUserId(userId); } else if (!userId.equals(getUserId())) { return failCanDoAction(EngineMessage.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION); } String sshPublicKey = getParameters().getUserProfile().getSshPublicKey(); if (sshPublicKey == null || sshPublicKey.isEmpty()) { return true; } if (!OpenSSHUtils.isPublicKeyValid(sshPublicKey)) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_INVALID_PUBLIC_SSH_KEY); } return true; }
Source:
public ITokenCacheStore getCache() { if (mBrokerProxy.canSwitchToBroker()) { return new ITokenCacheStore() { private static final long serialVersionUID = 1L; @Override public void setItem(String key, TokenCacheItem item) { } @Override public void removeItem(String key) { } @Override public void removeAll() { mBrokerProxy.removeAccounts(); } @Override public TokenCacheItem getItem(String key) { return null; } @Override public boolean contains(String key) { return false; } }; } return mTokenCacheStore; }

Target:
public ITokenCacheStore getCache() { if (mBrokerProxy.canSwitchToBroker()) { return new ITokenCacheStore() { private static final long serialVersionUID = 1L; @Override public void setItem(String key, TokenCacheItem item) { throw new UnsupportedOperationException( "Broker cache does not support direct setItem operation"); } @Override public void removeItem(String key) { throw new UnsupportedOperationException( "Broker cache does not support direct removeItem operation"); } @Override public void removeAll() { mBrokerProxy.removeAccounts(); } @Override public TokenCacheItem getItem(String key) { throw new UnsupportedOperationException( "Broker cache does not support direct getItem operation"); } @Override public boolean contains(String key) { throw new UnsupportedOperationException( "Broker cache does not support contains operation"); } }; } return mTokenCacheStore; }
Source:
public List<StopAtDistance> findNearbyStopsViaStreets ( Set<Vertex> originVertices, boolean reverseDirection, boolean removeTempEdges, RoutingRequest routingRequest ) { routingRequest.setRoutingContext(graph, originVertices, null); routingRequest.arriveBy = reverseDirection; int walkTime = (int) (radiusMeters / new RoutingRequest().walkSpeed); routingRequest.worstTime = routingRequest.dateTime + (reverseDirection ? -walkTime : walkTime); routingRequest.disableRemainingWeightHeuristic = true; routingRequest.rctx.remainingWeightHeuristic = new TrivialRemainingWeightHeuristic(); routingRequest.dominanceFunction = new DominanceFunction.MinimumWeight(); ShortestPathTree spt = astar.getShortestPathTree(routingRequest); List<StopAtDistance> stopsFound = Lists.newArrayList(); if (spt != null) { for (State state : spt.getAllStates()) { Vertex targetVertex = state.getVertex(); if (originVertices.contains(targetVertex)) continue; if (targetVertex instanceof TransitStopVertex && state.isFinal()) { stopsFound.add(stopAtDistanceForState(state)); } } } for (Vertex vertex : originVertices) { if (vertex instanceof TransitStopVertex) { stopsFound.add( new StopAtDistance( (TransitStopVertex) vertex, 0, Collections.emptyList(), null, new State(vertex, routingRequest) )); } } if (removeTempEdges) { routingRequest.cleanup(); } return stopsFound; }

Target:
public List<StopAtDistance> findNearbyStopsViaStreets ( Set<Vertex> originVertices, boolean reverseDirection, boolean removeTempEdges, RoutingRequest routingRequest ) { routingRequest.arriveBy = reverseDirection; if (!reverseDirection) { routingRequest.setRoutingContext(graph, originVertices, null); } else { routingRequest.setRoutingContext(graph, null, originVertices); } int walkTime = (int) (radiusMeters / new RoutingRequest().walkSpeed); routingRequest.worstTime = routingRequest.dateTime + (reverseDirection ? -walkTime : walkTime); routingRequest.disableRemainingWeightHeuristic = true; routingRequest.rctx.remainingWeightHeuristic = new TrivialRemainingWeightHeuristic(); routingRequest.dominanceFunction = new DominanceFunction.MinimumWeight(); ShortestPathTree spt = astar.getShortestPathTree(routingRequest); List<StopAtDistance> stopsFound = Lists.newArrayList(); if (spt != null) { for (State state : spt.getAllStates()) { Vertex targetVertex = state.getVertex(); if (originVertices.contains(targetVertex)) continue; if (targetVertex instanceof TransitStopVertex && state.isFinal()) { stopsFound.add(stopAtDistanceForState(state)); } } } for (Vertex vertex : originVertices) { if (vertex instanceof TransitStopVertex) { stopsFound.add( new StopAtDistance( (TransitStopVertex) vertex, 0, Collections.emptyList(), null, new State(vertex, routingRequest) )); } } if (removeTempEdges) { routingRequest.cleanup(); } return stopsFound; }
Source:
public RoomWindow newRoom(int roomId){ RoomWindow newRoom=new RoomWindow(roomId); roomWindowMap.put((Integer)roomId,newRoom); newRoom.setVisible(true); return newRoom; }

Target:
public RoomWindow newRoom(int roomId){ RoomWindow room=new RoomWindow(roomId); roomWindowMap.put((Integer)roomId,room); room.setVisible(true); return room; }