auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static NodeList query(Document dom, String query, Node context) throws XPathExpressionException { NodeList nodeList; XPath xpath = XPathFactory.newInstance().newXPath(); xpath.setNamespaceContext(new NamespaceContext() { public String getNamespaceURI(String prefix) { String result = null; if (prefix.equals("samlp")) result = Constants.NS_SAMLP; else if (prefix.equals("saml")) result = Constants.NS_SAML; else if (prefix.equals("ds")) result = Constants.NS_DS; else if (prefix.equals("xenc")) result = Constants.NS_XENC; return result; } public String getPrefix(String namespaceURI) { return null; } @SuppressWarnings("rawtypes") public Iterator getPrefixes(String namespaceURI) { return null; } }); if (context == null) nodeList = (NodeList) xpath.evaluate(query, dom, XPathConstants.NODESET); else nodeList = (NodeList) xpath.evaluate(query, context, XPathConstants.NODESET); return nodeList; }

Target:
public static NodeList query(Document dom, String query, Node context) throws XPathExpressionException { NodeList nodeList; XPath xpath = XPathFactory.newInstance().newXPath(); xpath.setNamespaceContext(new NamespaceContext() { public String getNamespaceURI(String prefix) { String result = null; if (prefix.equals("samlp") || prefix.equals("samlp2")) result = Constants.NS_SAMLP; else if (prefix.equals("saml") || prefix.equals("saml2")) result = Constants.NS_SAML; else if (prefix.equals("ds")) result = Constants.NS_DS; else if (prefix.equals("xenc")) result = Constants.NS_XENC; return result; } public String getPrefix(String namespaceURI) { return null; } @SuppressWarnings("rawtypes") public Iterator getPrefixes(String namespaceURI) { return null; } }); if (context == null) nodeList = (NodeList) xpath.evaluate(query, dom, XPathConstants.NODESET); else nodeList = (NodeList) xpath.evaluate(query, context, XPathConstants.NODESET); return nodeList; }
Source:
public Iterator<Identity> enter(final Request request) throws IOException { return Collections.singleton( PsLinkedin.parse(this.luserjson .fetch(new Href("<LINK_1>") .with("grant_type", "authorization_code") .toString(), "<LINK_0>,first-name,last-name,picture-url)", new RqHref.Base(request).href() ) ) ).iterator(); }

Target:
public Iterator<Identity> enter(final Request request) throws IOException { final Href href = new RqHref.Base(request).href(); final Iterator<String> code = href.param("code").iterator(); if (!code.hasNext()) { throw new IllegalArgumentException("code is not provided"); } return Collections.singleton( this.fetch(this.token(href.toString(), code.next())) ).iterator(); }
Source:
public Map<String, Boolean> validateResourcesForWagedRebalance(String clusterName, List<String> resourceNames) { if (clusterName == null || clusterName.isEmpty()) { throw new HelixException("Cluster name is invalid!"); } if (resourceNames == null || resourceNames.isEmpty()) { throw new HelixException("Resource name list is invalid!"); } HelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<>(_zkClient)); Builder keyBuilder = accessor.keyBuilder(); List<String> liveInstances = accessor.getChildNames(keyBuilder.liveInstances()); if (validateInstancesForWagedRebalance(clusterName, liveInstances).containsValue(false)) { throw new HelixException(String .format("Instance capacities haven't been configured properly for cluster %s", clusterName)); } Map<String, Boolean> result = new HashMap<>(); ClusterConfig clusterConfig = _configAccessor.getClusterConfig(clusterName); for (String resourceName : resourceNames) { IdealState idealState = getResourceIdealState(clusterName, resourceName); if (idealState == null || !idealState.isValid()) { result.put(resourceName, false); continue; } ResourceConfig resourceConfig = _configAccessor.getResourceConfig(clusterName, resourceName); if (resourceConfig == null || !resourceConfig.isValid()) { result.put(resourceName, false); continue; } result.put(resourceName, validateWeightForResourceConfig(clusterConfig, resourceConfig, idealState)); } return result; }

Target:
public Map<String, Boolean> validateResourcesForWagedRebalance(String clusterName, List<String> resourceNames) { if (clusterName == null || clusterName.isEmpty()) { throw new HelixException("Cluster name is invalid!"); } if (resourceNames == null || resourceNames.isEmpty()) { throw new HelixException("Resource name list is invalid!"); } HelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<>(_zkClient)); Builder keyBuilder = accessor.keyBuilder(); List<String> instances = accessor.getChildNames(keyBuilder.instanceConfigs()); if (validateInstancesForWagedRebalance(clusterName, instances).containsValue(false)) { throw new HelixException(String .format("Instance capacities haven't been configured properly for cluster %s", clusterName)); } Map<String, Boolean> result = new HashMap<>(); ClusterConfig clusterConfig = _configAccessor.getClusterConfig(clusterName); for (String resourceName : resourceNames) { IdealState idealState = getResourceIdealState(clusterName, resourceName); if (idealState == null || !idealState.isValid()) { result.put(resourceName, false); continue; } ResourceConfig resourceConfig = _configAccessor.getResourceConfig(clusterName, resourceName); result.put(resourceName, validateWeightForResourceConfig(clusterConfig, resourceConfig, idealState)); } return result; }
Source:
public void enhanceMetadata(Context context) { super.enhanceMetadata(context); context.put(RuleMetadata.CATEGORY, "Core"); }

Target:
public void enhanceMetadata(Context context) { super.enhanceMetadata(context); context.put(RuleMetadata.CATEGORY, "Java"); }
Source:
public void testAdd() throws InterruptedException { String testKey = "key"; String testValue = "value"; CountDownLatch latch = new CountDownLatch(1); StringBuilder actualKey = new StringBuilder(); StringBuilder actualValue = new StringBuilder(); metadataStore.addListener(new MetadataStoreListenerAdapter() { @Override public void onAdd(String key, String value) { actualKey.append(key); actualValue.append(value); latch.countDown(); } }); metadataStore.put(testKey, testValue); latch.await(2, TimeUnit.SECONDS); assertEquals(0, latch.getCount()); assertEquals(testKey, actualKey.toString()); assertEquals(testValue, actualValue.toString()); }

Target:
public void testAdd() throws InterruptedException { String testKey = "key"; String testValue = "value"; CountDownLatch latch = new CountDownLatch(1); AtomicReference<String> actualKey = new AtomicReference<String>(); AtomicReference<String> actualValue = new AtomicReference<String>(); metadataStore.addListener(new MetadataStoreListenerAdapter() { @Override public void onAdd(String key, String value) { actualKey.set(key); actualValue.set(value); latch.countDown(); } }); metadataStore.put(testKey, testValue); latch.await(2, TimeUnit.SECONDS); assertEquals(0, latch.getCount()); assertEquals(testKey, actualKey.get()); assertEquals(testValue, actualValue.get()); }
Source:
private void collectIds(Long id) { int keepTrying = 0; long curser = -1; do { try { twitter4j.IDs ids = null; if( endpoint.equals("followers") ) ids = client.friendsFollowers().getFollowersIDs(id.longValue(), curser, max_per_page); else if( endpoint.equals("friends") ) ids = client.friendsFollowers().getFriendsIDs(id.longValue(), curser, max_per_page); Preconditions.checkNotNull(ids); Preconditions.checkArgument(ids.getIDs().length > 0); for (long otherId : ids.getIDs()) { try { Follow follow; if( endpoint.equals("followers") ) { follow = new Follow() .withFollowee(new User().withId(id)) .withFollower(new User().withId(otherId)); } else if( endpoint.equals("friends") ) { follow = new Follow() .withFollowee(new User().withId(otherId)) .withFollower(new User().withId(id)); } else { throw new Exception("endpoint must be set to 'friends' or 'followers'"); } ComponentUtils.offerUntilSuccess(new StreamsDatum(follow), provider.providerQueue); } catch (Exception e) { LOGGER.warn(e.getMessage()); } } if( ids.hasNext() ) curser = ids.getNextCursor(); else break; } catch(TwitterException twitterException) { keepTrying += TwitterErrorHandler.handleTwitterError(client, twitterException); } catch(Exception e) { keepTrying += TwitterErrorHandler.handleTwitterError(client, e); } } while (curser != 0 && keepTrying < 10); }

Target:
private void collectIds(Long id) { int keepTrying = 0; long curser = -1; do { try { twitter4j.IDs ids = null; if( endpoint.equals("followers") ) ids = client.friendsFollowers().getFollowersIDs(id.longValue(), curser, max_per_page); else if( endpoint.equals("friends") ) ids = client.friendsFollowers().getFriendsIDs(id.longValue(), curser, max_per_page); Preconditions.checkNotNull(ids); Preconditions.checkArgument(ids.getIDs().length > 0); for (long otherId : ids.getIDs()) { try { Follow follow = null; if( endpoint.equals("followers") ) { follow = new Follow() .withFollowee(new User().withId(id)) .withFollower(new User().withId(otherId)); } else if( endpoint.equals("friends") ) { follow = new Follow() .withFollowee(new User().withId(otherId)) .withFollower(new User().withId(id)); } ComponentUtils.offerUntilSuccess(new StreamsDatum(follow), provider.providerQueue); Preconditions.checkNotNull(follow); } catch (Exception e) { LOGGER.warn("Exception: {}", e); } } if( ids.hasNext() ) curser = ids.getNextCursor(); else break; } catch(TwitterException twitterException) { keepTrying += TwitterErrorHandler.handleTwitterError(client, twitterException); } catch(Exception e) { keepTrying += TwitterErrorHandler.handleTwitterError(client, e); } } while (curser != 0 && keepTrying < 10); }
Source:
public void updateGlobalPieChart() { if (getGlobalPC() == null) { fGlobalPC = new PieChart(this, SWT.NONE); getGlobalPC().getTitle().setText(fGlobalPCname); getGlobalPC().getAxisSet().getXAxis(0).getTitle().setText(""); getGlobalPC().getLegend().setVisible(true); getGlobalPC().getLegend().setPosition(SWT.RIGHT); getGlobalPC().addListener(SWT.MouseMove, fMouseListener); } else if (getGlobalPC().isDisposed()) { return; } updatePieChartWithData(fGlobalPC, fGlobalEventTypes, MIN_PRECENTAGE_TO_SHOW_SLICE, fOthersSliceName); }

Target:
void updateGlobalPieChart() { if (getGlobalPC() == null) { fGlobalPC = new PieChart(this, SWT.NONE); getGlobalPC().getTitle().setText(fGlobalPCname); getGlobalPC().getAxisSet().getXAxis(0).getTitle().setText(""); getGlobalPC().getLegend().setVisible(true); getGlobalPC().getLegend().setPosition(SWT.RIGHT); getGlobalPC().addListener(SWT.MouseMove, fMouseListener); } else if (getGlobalPC().isDisposed() || fModel == null || fModel.getPieChartGlobalModel() == null) { return; } Map<String, Long> totalEventCountForChart = getTotalEventCountForChart(true); if(totalEventCountForChart == null){ return; } updatePieChartWithData(fGlobalPC, totalEventCountForChart, MIN_PRECENTAGE_TO_SHOW_SLICE, fOthersSliceName); }
Source:
public void eachNonZeroInColumn(int j, MatrixProcedure procedure) { for (int i = 0; i < rows; i++) { if (get(i, j) > Matrices.EPS) procedure.apply(i,j,get(i,j)); } }

Target:
public void eachNonZeroInColumn(int j, MatrixProcedure procedure) { for (int i = 0; i < rows; i++) { if (Math.abs(get(i, j)) > Matrices.EPS) { procedure.apply(i, j, get(i, j)); } } }
Source:
public void initialize() throws Exception { String stringDoCommit = dspace.getConfigurationService().getProperty("discovery.index.commit"); if(stringDoCommit!=null) { doCommit = Boolean.parseBoolean(stringDoCommit); } }

Target:
public void initialize() throws Exception { softCommit = dspace.getConfigurationService().getPropertyAsType("discovery.index.nrt", true); }
Source:
public void testPojoSerialization() throws IOException { SomeClassWithNoDefaultConstructors foo = new SomeClassWithNoDefaultConstructors("hello", 123); SomeClassWithNoDefaultConstructors foo2 = (SomeClassWithNoDefaultConstructors) codec.deserialize( codec.serialize(foo), SomeClassWithNoDefaultConstructors.class); assertEquals(foo, foo2); }

Target:
public void testPojoSerialization() throws IOException { SomeClassWithNoDefaultConstructors foo = new SomeClassWithNoDefaultConstructors("hello", 123); SomeClassWithNoDefaultConstructors foo2 = codec.decode( codec.encode(foo), SomeClassWithNoDefaultConstructors.class); assertEquals(foo, foo2); }
Source:
public void setUp() throws Exception { workspaceManager = spy(new WorkspaceManager(workspaceDao, runtimes, eventService, machineManager, userManager, false, false)); workspaceManager.setHooks(workspaceHooks); when(workspaceDao.create(any(WorkspaceImpl.class))).thenAnswer(invocation -> invocation.getArguments()[0]); when(workspaceDao.update(any(WorkspaceImpl.class))).thenAnswer(invocation -> invocation.getArguments()[0]); EnvironmentContext.setCurrent(new EnvironmentContext() { @Override public Subject getSubject() { return new SubjectImpl(NAMESPACE, USER_ID, "token", new ArrayList<>(), false); } }); }

Target:
public void setUp() throws Exception { workspaceManager = spy(new WorkspaceManager(workspaceDao, runtimes, eventService, machineManager, userManager, false, false)); workspaceManager.setHooks(workspaceHooks); when(workspaceDao.create(any(WorkspaceImpl.class))).thenAnswer(invocation -> invocation.getArguments()[0]); when(workspaceDao.update(any(WorkspaceImpl.class))).thenAnswer(invocation -> invocation.getArguments()[0]); EnvironmentContext.setCurrent(new EnvironmentContext() { @Override public Subject getSubject() { return new SubjectImpl(NAMESPACE, USER_ID, "token", null, false); } }); }
Source:
public static String getSessionToken(String url) { String token = "undefined"; try { String decodedURL = URLDecoder.decode(url, "UTF-8"); String[] splitedURL = decodedURL.split("\\?"); if (splitedURL.length == 2) { String params = splitedURL[1]; for (String param : params.split("\\&")) { if (param.startsWith("sessionToken=")) { token = param.split("\\=")[1]; } } } } catch (UnsupportedEncodingException e) { log.error(e.toString()); } return token; }

Target:
public static String getSessionToken(String url) { String token = "undefined"; try { String decodedURL = URLDecoder.decode(url, "UTF-8"); String[] splitURL = decodedURL.split("\\?"); if (splitURL.length == 2) { String params = splitURL[1]; for (String param : params.split("\\&")) { if (param.startsWith("sessionToken=")) { token = param.split("\\=")[1]; } } } } catch (UnsupportedEncodingException e) { log.error(e.toString()); } return token; }
Source:
public static int indexOfChangeId(String message, String delimiter) { String[] lines = message.split(delimiter); int footerFirstLine = findFirstFooterLine(lines); if (footerFirstLine == lines.length) return -1; int indexOfFooter = 0; for (int i = 0; i < footerFirstLine; ++i) { indexOfFooter += lines[i].length() + delimiter.length(); } return message.indexOf(CHANGE_ID, indexOfFooter); }

Target:
public static int indexOfChangeId(String message, String delimiter) { String[] lines = message.split(delimiter); int footerFirstLine = indexOfFirstFooterLine(lines); if (footerFirstLine == lines.length) return -1; int indexOfFooter = 0; for (int i = 0; i < footerFirstLine; ++i) { indexOfFooter += lines[i].length() + delimiter.length(); } return message.indexOf(CHANGE_ID, indexOfFooter); }
Source:
private void writeLoop(LedgerMetadata currentLocal, CompletableFuture<LedgerMetadata> promise) { LOG.info("{} starting write loop iteration, attempt {}", logContext, writeLoopCounter.incrementAndGet()); try { if (needsTransformation.needsUpdate(currentLocal)) { LedgerMetadata transformed = transform.apply(currentLocal); writeToStore(ledgerId, transformed) .whenComplete((writtenMetadata, ex) -> { if (ex == null) { if (updateLocalValue.test(currentLocal, writtenMetadata)) { LOG.info("{} success", logContext); promise.complete(writtenMetadata); } else { LOG.info("{} local value changed while we were writing, try again", logContext); writeLoop(currentLocalValue.get(), promise); } } else if (ex instanceof BKException.BKMetadataVersionException) { LOG.info("{} conflict writing metadata to store, update local value and try again", logContext); updateFromStore(ledgerId).whenComplete((readMetadata, readEx) -> { if (readEx == null) { writeLoop(readMetadata, promise); } else { LOG.info("{} error updating local value", logContext); promise.completeExceptionally(readEx); } }); } else { LOG.info("{} Error writing metadata to store", logContext, ex); promise.completeExceptionally(ex); } }); } else { LOG.info("{} Update not needed, completing", logContext); promise.complete(currentLocal); } } catch (Exception e) { LOG.error("{} Exception updating", logContext, e); promise.completeExceptionally(e); } }

Target:
private void writeLoop(LedgerMetadata currentLocal, CompletableFuture<LedgerMetadata> promise) { LOG.debug("{} starting write loop iteration, attempt {}", logContext, WRITE_LOOP_COUNT_UPDATER.incrementAndGet(this)); try { if (needsTransformation.needsUpdate(currentLocal)) { LedgerMetadata transformed = transform.transform(currentLocal); writeToStore(ledgerId, transformed) .whenComplete((writtenMetadata, ex) -> { if (ex == null) { if (updateLocalValue.updateValue(currentLocal, writtenMetadata)) { LOG.debug("{} success", logContext); promise.complete(writtenMetadata); } else { LOG.debug("{} local value changed while we were writing, try again", logContext); writeLoop(currentLocalValue.get(), promise); } } else if (ex instanceof BKException.BKMetadataVersionException) { LOG.info("{} conflict writing metadata to store, update local value and try again", logContext); updateLocalValueFromStore(ledgerId).whenComplete((readMetadata, readEx) -> { if (readEx == null) { writeLoop(readMetadata, promise); } else { promise.completeExceptionally(readEx); } }); } else { LOG.error("{} Error writing metadata to store", logContext, ex); promise.completeExceptionally(ex); } }); } else { LOG.debug("{} Update not needed, completing", logContext); promise.complete(currentLocal); } } catch (Exception e) { LOG.error("{} Exception updating", logContext, e); promise.completeExceptionally(e); } }
Source:
public KafkaExportDecoder(AdvertisedDataSource source) { super(source); if (m_encodeFormat == EncodeFormat.AVRO) { m_decoder = new AvroDecoder.Builder().build(); } else { CSVStringDecoder.Builder builder = CSVStringDecoder.builder(); builder .dateFormatter(Constants.ODBC_DATE_FORMAT_STRING) .timeZone(m_timeZone) .binaryEncoding(m_binaryEncoding) .skipInternalFields(m_skipInternals) ; m_decoder = builder.build(); } if (ExportManagerInterface.instance().getExportMode() == ExportMode.BASIC) { m_es = CoreUtils.getListeningSingleThreadExecutor( "Kafka Export decoder for partition " + source.tableName + " - " + source.partitionId, CoreUtils.MEDIUM_STACK_SIZE); } else { m_es = null; } m_decoderProducerConfig = new Properties(); m_decoderProducerConfig.putAll(m_producerConfig); }

Target:
public KafkaExportDecoder(AdvertisedDataSource source) { super(source); if (m_encodeFormat == EncodeFormat.AVRO) { m_tableAvroDecoderMap = new ConcurrentHashMap<>(); } else { CSVStringDecoder.Builder builder = CSVStringDecoder.builder(); builder .dateFormatter(Constants.ODBC_DATE_FORMAT_STRING) .timeZone(m_timeZone) .binaryEncoding(m_binaryEncoding) .skipInternalFields(m_skipInternals) ; m_csvDecoder = builder.build(); } if (ExportManagerInterface.instance().getExportMode() == ExportMode.BASIC) { m_es = CoreUtils.getListeningSingleThreadExecutor( "Kafka Export decoder for partition " + source.tableName + " - " + source.partitionId, CoreUtils.MEDIUM_STACK_SIZE); } else { m_es = null; } m_decoderProducerConfig = new Properties(); m_decoderProducerConfig.putAll(m_producerConfig); }
Source:
public void update(final String path, final byte[] bytes) { final ZKPaths.PathAndNode pathAndNode = ZKPaths.getPathAndNode(path); final String parentPath = pathAndNode.getPath(); final String nodePath = pathAndNode.getNode(); ConcurrentMap<String, byte[]> subPaths = announcements.get(parentPath); if (subPaths == null || subPaths.get(nodePath) == null) { announce(path, bytes); return; } try { byte[] oldBytes = subPaths.get(nodePath); if (!Arrays.equals(oldBytes, bytes)) { subPaths.put(nodePath, bytes); updateAnnouncement(path, bytes); } } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
public void update(final String path, final byte[] bytes) { final ZKPaths.PathAndNode pathAndNode = ZKPaths.getPathAndNode(path); final String parentPath = pathAndNode.getPath(); final String nodePath = pathAndNode.getNode(); ConcurrentMap<String, byte[]> subPaths = announcements.get(parentPath); if (subPaths == null || subPaths.get(nodePath) == null) { throw new ISE("Cannot update a path[%s] that hasn't been announced!", path); } synchronized (subPaths) { try { byte[] oldBytes = subPaths.get(nodePath); if (!Arrays.equals(oldBytes, bytes)) { subPaths.put(nodePath, bytes); updateAnnouncement(path, bytes); } } catch (Exception e) { throw Throwables.propagate(e); } } }
Source:
private ConveyorTile getMetatilingReponse(ConveyorTile tile, boolean tryCache) throws GeoWebCacheException { long[] gridLoc = tile.getTileIndex(); GridSubset gridSubset = subSets.get(tile.getGridSetId()); MimeType mimeType = tile.getMimeType(); Map<String, String> fullParameters = tile.getFilteringParameters(); if (fullParameters.isEmpty()) { fullParameters = getDefaultParameterFilters(); } WMSMetaTile metaTile = new WMSMetaTile(this, gridSubset, mimeType, this.getFormatModifier(tile.getMimeType()), gridLoc, metaWidthHeight[0], metaWidthHeight[1], fullParameters); if (saveExpirationHeaders) { metaTile.setExpiresHeader(GWCVars.CACHE_USE_WMS_BACKEND_VALUE); } String metaKey = buildLockKey(tile, metaTile); Lock lock = null; try { lock = lockProvider.getLock(metaKey); if (tryCache && tryCacheFetch(tile)) { return finalizeTile(tile); } tile.setCacheResult(CacheResult.MISS); ByteArrayResource buffer = getImageBuffer(WMS_BUFFER); if (saveExpirationHeaders) { metaTile.setExpiresHeader(GWCVars.CACHE_USE_WMS_BACKEND_VALUE); } long requestTime = System.currentTimeMillis(); sourceHelper.makeRequest(metaTile, buffer); if (metaTile.getError()) { throw new GeoWebCacheException("Empty metatile, error message: " + metaTile.getErrorMessage()); } if (saveExpirationHeaders) { saveExpirationInformation((int) (tile.getExpiresHeader() / 1000)); } metaTile.setImageBytes(buffer); saveTiles(metaTile, tile, requestTime); } finally { if(lock != null) { lock.release(); } metaTile.dispose(); } return finalizeTile(tile); }

Target:
private ConveyorTile getMetatilingReponse(ConveyorTile tile, boolean tryCache) throws GeoWebCacheException { long[] gridLoc = tile.getTileIndex(); GridSubset gridSubset = subSets.get(tile.getGridSetId()); MimeType mimeType = tile.getMimeType(); Map<String, String> filteringParameters = tile.getFilteringParameters(); if (filteringParameters.isEmpty()) { filteringParameters = getDefaultParameterFilters(); } WMSMetaTile metaTile = new WMSMetaTile(this, gridSubset, mimeType, this.getFormatModifier(tile.getMimeType()), gridLoc, metaWidthHeight[0], metaWidthHeight[1], filteringParameters); if (saveExpirationHeaders) { metaTile.setExpiresHeader(GWCVars.CACHE_USE_WMS_BACKEND_VALUE); } String metaKey = buildLockKey(tile, metaTile); Lock lock = null; try { lock = lockProvider.getLock(metaKey); if (tryCache && tryCacheFetch(tile)) { return finalizeTile(tile); } tile.setCacheResult(CacheResult.MISS); ByteArrayResource buffer = getImageBuffer(WMS_BUFFER); if (saveExpirationHeaders) { metaTile.setExpiresHeader(GWCVars.CACHE_USE_WMS_BACKEND_VALUE); } long requestTime = System.currentTimeMillis(); sourceHelper.makeRequest(metaTile, buffer); if (metaTile.getError()) { throw new GeoWebCacheException("Empty metatile, error message: " + metaTile.getErrorMessage()); } if (saveExpirationHeaders) { saveExpirationInformation((int) (tile.getExpiresHeader() / 1000)); } metaTile.setImageBytes(buffer); saveTiles(metaTile, tile, requestTime); } finally { if(lock != null) { lock.release(); } metaTile.dispose(); } return finalizeTile(tile); }
Source:
public void printMessage( Messager messager, Diagnostic.Kind kind, String message ) { messager.printMessage( kind, message ); }

Target:
public void printMessage( Messager messager, Diagnostic.Kind kind, String message ) { messager.printMessage( kind, message, positionHintElement ); }
Source:
private long updateOffsetLimits(final TopicPartition partition) { if (!offsetLimits.containsKey(partition)) { throw new IllegalArgumentException("Topic is not both a source and a changelog: " + partition); } final Map<TopicPartition, Long> newLimits = committedOffsetForPartition(updateableOffsetLimits); final Long previousLimit = offsetLimits.get(partition); final Long newLimit = newLimits.get(partition); if (previousLimit != null && previousLimit > newLimit) { throw new IllegalStateException("Offset limit should monotonically increase, but was reduced. " + "New limit: " + newLimit + ". Previous limit: " + previousLimit); } offsetLimits.putAll(newLimits); updateableOffsetLimits.clear(); return newLimit; }

Target:
private long updateOffsetLimits(final TopicPartition partition) { if (!offsetLimits.containsKey(partition)) { throw new IllegalArgumentException("Topic is not both a source and a changelog: " + partition); } final Map<TopicPartition, Long> newLimits = committedOffsetForPartitions(offsetLimits.keySet()); for (final Map.Entry<TopicPartition, Long> newlimit : newLimits.entrySet()) { final Long previousLimit = offsetLimits.get(newlimit.getKey()); if (previousLimit != null && previousLimit > newlimit.getValue()) { throw new IllegalStateException("Offset limit should monotonically increase, but was reduced. " + "New limit: " + newlimit.getValue() + ". Previous limit: " + previousLimit); } } offsetLimits.putAll(newLimits); updateOffsetLimits = false; return offsetLimits.get(partition); }
Source:
public String toString() { StringBuilder sb = new StringBuilder(100); sb.append("GMSMember["); if (name != null && name.length() > 0) { sb.append("name=").append(name).append(';'); } sb.append("addr=").append(inetAddr).append(";port=").append(udpPort) .append(";kind=").append(vmKind).append(";processId=").append(processId) .append(";viewId=").append(vmViewId); if (getVersionOrdinal() != Version.CURRENT_ORDINAL) { sb.append(";version=").append(getVersionOrdinal()); } sb.append("]"); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(100); sb.append("MemberData["); if (name != null && name.length() > 0) { sb.append("name=").append(name).append(';'); } sb.append("addr=").append(inetAddr).append(";port=").append(udpPort) .append(";kind=").append(vmKind).append(";processId=").append(processId) .append(";viewId=").append(vmViewId); if (getVersionOrdinal() != Version.CURRENT_ORDINAL) { sb.append(";version=").append(getVersionOrdinal()); } sb.append("]"); return sb.toString(); }
Source:
public void setActualSizeFromDiskImage(long size) { actualSizeFromDiskImageDynamic = size; setActualSize(getActualSizeInBytes() * 1.0 / (1024 * 1024 * 1024)); }

Target:
public void setActualSizeFromDiskImage(long size) { actualSizeInBytes = size; setActualSize(getActualSizeInBytes() * 1.0 / (1024 * 1024 * 1024)); }
Source:
public SqlToRelConverter( RelOptTable.ViewExpander viewExpander, SqlValidator validator, Prepare.CatalogReader catalogReader, RelOptCluster cluster, SqlRexConvertletTable convertletTable) { this.viewExpander = viewExpander; this.opTab = (validator == null) ? SqlStdOperatorTable.instance() : validator.getOperatorTable(); this.validator = validator; this.catalogReader = catalogReader; this.defaultValueFactory = new NullDefaultValueFactory(); this.subqueryConverter = new NoOpSubqueryConverter(); this.rexBuilder = cluster.getRexBuilder(); this.typeFactory = rexBuilder.getTypeFactory(); this.cluster = Preconditions.checkNotNull(cluster); this.shouldConvertTableAccess = true; this.exprConverter = new SqlNodeToRexConverterImpl(convertletTable); decorrelationEnabled = true; trimUnusedFields = false; shouldCreateValuesRel = true; isExplain = false; nDynamicParamsInExplain = 0; inSubqueryThreshold = DEFAULT_IN_SUBQUERY_THRESHOLD; }

Target:
public SqlToRelConverter( RelOptTable.ViewExpander viewExpander, SqlValidator validator, Prepare.CatalogReader catalogReader, RelOptCluster cluster, SqlRexConvertletTable convertletTable) { this(viewExpander, validator, catalogReader, cluster, convertletTable, Config.DEFAULT); }
Source:
private IPermissionAuthority getPermissionAuthority() { if (permissionAuthority == null && object instanceof EObject) { Session session = new EObjectQuery((EObject) object).getSession(); if (session != null) { permissionAuthority = session.getModelAccessor().getPermissionAuthority(); } } return permissionAuthority; }

Target:
private IPermissionAuthority getPermissionAuthority() { if (permissionAuthority == null && object instanceof EObject) { Session session = new EObjectQuery((EObject) object).getSession(); if (session != null) { ModelAccessor modelAccessor = session.getModelAccessor(); if (modelAccessor != null) { permissionAuthority = modelAccessor.getPermissionAuthority(); } } } return permissionAuthority; }
Source:
public boolean invalidate(K key) { try { boolean removed = remove(key); if (removed) { nearCacheStats.incrementInvalidations(); } return removed; } finally { nearCacheStats.incrementInvalidationEvents(); } }

Target:
public boolean invalidate(K key) { try { boolean removed = remove(key); if (removed) { nearCacheStats.incrementInvalidations(); } return removed; } finally { nearCacheStats.incrementInvalidationRequests(); } }
Source:
public ActionXAxisDistance(final TourChart tourChart) { super(Messages.Tour_Action_show_distance_on_x_axis, AS_RADIO_BUTTON); this.fTourChart = tourChart; setToolTipText(Messages.Tour_Action_show_distance_on_x_axis_tooltip); String imagePath = Messages.Image__show_distance_on_x_axis; String disabledImagePath = Messages.Image__show_distance_on_x_axis_disabled; if (!UI.UNIT_IS_METRIC) { imagePath = Messages.Image__show_distance_on_x_axis_imperial; disabledImagePath = Messages.Image__show_distance_on_x_axis_imperial_disabled; } setImageDescriptor(TourbookPlugin.getImageDescriptor(imagePath)); setDisabledImageDescriptor(TourbookPlugin.getImageDescriptor(disabledImagePath)); setChecked(!tourChart.getTourChartConfig().isShowTimeOnXAxis); }

Target:
public ActionXAxisDistance(final TourChart tourChart) { super(Messages.Tour_Action_show_distance_on_x_axis, AS_RADIO_BUTTON); this.fTourChart = tourChart; setToolTipText(Messages.Tour_Action_show_distance_on_x_axis_tooltip); setImages(); setChecked(!tourChart.getTourChartConfig().isShowTimeOnXAxis); }
Source:
public void doesNotFireIfRuleNotChangePlan() { tester().assertThat(pickTableLayout.pickTableLayoutForPredicate()) .on(p -> p.filter(expression("nationkey % 17 = BIGINT '44'"), p.tableScan( nationTableHandle, ImmutableList.of(p.symbol("nationkey", BIGINT)), ImmutableMap.of(p.symbol("nationkey", BIGINT), new TpchColumnHandle("nationkey", BIGINT)), Optional.of(nationTableLayoutHandle), TupleDomain.all()))) .doesNotFire(); }

Target:
public void doesNotFireIfRuleNotChangePlan() { tester().assertThat(pickTableLayout.pickTableLayoutForPredicate()) .on(p -> p.filter(expression("nationkey % 17 = BIGINT '44' AND nationkey % 15 = BIGINT '43'"), p.tableScan( nationTableHandle, ImmutableList.of(p.symbol("nationkey", BIGINT)), ImmutableMap.of(p.symbol("nationkey", BIGINT), new TpchColumnHandle("nationkey", BIGINT)), Optional.of(nationTableLayoutHandle), TupleDomain.all()))) .doesNotFire(); }
Source:
public void setChangeInfo(GerritRepository gerritRepository, ChangeInfo element) { filesTab.setGerritRepository(gerritRepository); fChangeInfo.reset(); fChangeInfo.setNumber(element.get_number()); fChangeInfo.setId(element.getId()); fChangeInfo.setChange_id(element.getChange_id()); fChangeInfo.setStatus(element.getStatus()); fChangeInfo.setProject(element.getProject()); fChangeInfo.setBranch(element.getBranch()); fChangeInfo.setUpdated(element.getUpdated()); fChangeInfo.setTopic(element.getTopic()); fChangeInfo.setCodeReviewedTally(element.getCodeReviewedTally()); fChangeInfo.setVerifiedTally(element.getVerifiedTally()); fChangeInfo.setLabels(element.getLabels()); setCurrentRevisionAndMessageTab(gerritRepository, element.getChange_id()); summaryTab.setTabs(gerritRepository, element); fSubmit.setEnabled(true); buttonsEnablement(); }

Target:
public void setChangeInfo(GerritRepository gerritRepository, ChangeInfo element) { filesTab.setGerritRepository(gerritRepository); fChangeInfo.reset(); fChangeInfo.setNumber(element.get_number()); fChangeInfo.setId(element.getId()); fChangeInfo.setChange_id(element.getChange_id()); fChangeInfo.setStatus(element.getStatus()); fChangeInfo.setProject(element.getProject()); fChangeInfo.setBranch(element.getBranch()); fChangeInfo.setUpdated(element.getUpdated()); fChangeInfo.setTopic(element.getTopic()); fChangeInfo.setCodeReviewedTally(element.getCodeReviewedTally()); fChangeInfo.setVerifiedTally(element.getVerifiedTally()); fChangeInfo.setLabels(element.getLabels()); setCurrentRevisionAndMessageTab(gerritRepository, element.getChange_id()); summaryTab.setTabs(gerritRepository, element); buttonsEnablement(); }
Source:
public final Response loginAsData(@Context final HttpServletRequest request) { Response response = null; try { List<Map<String, Object>> loginAsUsers = this.helper.getLoginAsUsers(); Iterator<Map<String, Object>> iter = loginAsUsers.iterator(); InitDataObject initData = webResource.init(null, true, request, true, null); User currentUser = initData.getUser(); String currentUserId = currentUser != null ? currentUser.getUserId() : ""; while (iter.hasNext()) { Map<String, Object> user = iter.next(); if (currentUserId.equalsIgnoreCase(user.get("userId").toString())) { iter.remove(); } } response = Response.ok(new ResponseEntityView(map("users", loginAsUsers))).build(); } catch (Exception e) { SecurityLogger.logInfo(UserResource.class, "An error occurred when processing the request. " + e.getMessage()); response = ExceptionMapperUtil.createResponse(e, Response.Status.INTERNAL_SERVER_ERROR); } return response; }

Target:
public final Response loginAsData(@Context final HttpServletRequest request) { Response response = null; try { List<Map<String, Object>> loginAsUsers = this.helper.getLoginAsUsers(); Iterator<Map<String, Object>> iter = loginAsUsers.iterator(); InitDataObject initData = webResource.init(null, true, request, true, null); User currentUser = initData.getUser(); String currentUserId = currentUser != null ? currentUser.getUserId() : StringUtils.EMPTY; while (iter.hasNext()) { Map<String, Object> user = iter.next(); if (currentUserId.equalsIgnoreCase(user.get("userId").toString())) { iter.remove(); } } response = Response.ok(new ResponseEntityView(map("users", loginAsUsers))).build(); } catch (Exception e) { SecurityLogger.logInfo(UserResource.class, "An error occurred when processing the request. " + e.getMessage()); response = ExceptionMapperUtil.createResponse(e, Response.Status.INTERNAL_SERVER_ERROR); } return response; }
Source:
public URL getLibraryIndexLocation() { switch(getEntryKind()) { case IClasspathEntry.CPE_LIBRARY : String sharedIndexLocationDir= System.getProperty(IndexManager.SHARED_INDEX_LOCATION); if (sharedIndexLocationDir != null) { try { String pathString= getPath().toOSString(); CRC32 checksumCalculator= new CRC32(); checksumCalculator.update(pathString.getBytes()); String fileName= Long.toString(checksumCalculator.getValue()) + ".index"; return new URL("file", null, Paths.get(sharedIndexLocationDir, fileName).toString()); } catch (MalformedURLException e1) { } } break; case IClasspathEntry.CPE_VARIABLE : break; default : return null; } if (this.extraAttributes == null) return null; for (int i= 0; i < this.extraAttributes.length; i++) { IClasspathAttribute attrib= this.extraAttributes[i]; if (IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME.equals(attrib.getName())) { String value = attrib.getValue(); try { return new URL(value); } catch (MalformedURLException e) { return null; } } } return null; }

Target:
public URL getLibraryIndexLocation() { switch(getEntryKind()) { case IClasspathEntry.CPE_LIBRARY : String sharedIndexLocationDir = System.getProperty(IndexManager.SHARED_INDEX_LOCATION); if (sharedIndexLocationDir != null) { try { String pathString = getPath().toOSString(); CRC32 checksumCalculator = new CRC32(); checksumCalculator.update(pathString.getBytes()); String fileName = Long.toString(checksumCalculator.getValue()) + ".index"; return new URL("file", null, Paths.get(sharedIndexLocationDir, fileName).toString()); } catch (MalformedURLException e1) { Util.log(e1); } } break; case IClasspathEntry.CPE_VARIABLE : break; default : return null; } if (this.extraAttributes == null) return null; for (int i= 0; i < this.extraAttributes.length; i++) { IClasspathAttribute attrib= this.extraAttributes[i]; if (IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME.equals(attrib.getName())) { String value = attrib.getValue(); try { return new URL(value); } catch (MalformedURLException e) { return null; } } } return null; }
Source:
private void assertValidIssuerClaim(String issuer, List<String> value) { if (issuer == null || !value.contains(issuer)) { throw new InvalidClaimException(String.format("The Claim '%s' value doesn't match the required issuer.", PublicClaims.ISSUER)); } }

Target:
private void assertValidIssuerClaim(String issuer, List<String> value) { if (issuer == null || !value.contains(issuer)) { throw new InvalidClaimException("The Claim 'iss' value doesn't match the required issuer."); } }
Source:
public void getCreateAccountInfo() { new CreateAccountInfoClient().request(wiki, new CreateAccountInfo.Callback() { @Override public void success(@NonNull Call<MwQueryResponse<CreateAccountInfo>> call, @NonNull CreateAccountInfoResult result) { if (result.token() == null) { handleError(getString(R.string.create_account_generic_error)); } else if (result.hasCaptcha()) { captchaHandler.handleCaptcha(result.token(), new CaptchaResult(result.captchaId())); } else { doCreateAccount(result.token()); } } @Override public void failure(@NonNull Call<MwQueryResponse<CreateAccountInfo>> call, @NonNull Throwable caught) { handleError(caught.getMessage()); L.e(caught); } }); }

Target:
public void getCreateAccountInfo() { createAccountInfoClient.request(wiki, new CreateAccountInfoClient.Callback() { @Override public void success(@NonNull Call<MwQueryResponse<CreateAccountInfo>> call, @NonNull CreateAccountInfoResult result) { if (result.token() == null) { handleError(getString(R.string.create_account_generic_error)); } else if (result.hasCaptcha()) { captchaHandler.handleCaptcha(result.token(), new CaptchaResult(result.captchaId())); } else { doCreateAccount(result.token()); } } @Override public void failure(@NonNull Call<MwQueryResponse<CreateAccountInfo>> call, @NonNull Throwable caught) { handleError(caught.getMessage()); L.e(caught); } }); }
Source:
private byte[] mirrorImage(byte[] data) { ByteArrayInputStream inputStream = new ByteArrayInputStream(data); Bitmap photo = BitmapFactory.decodeStream(inputStream); Matrix m = new Matrix(); m.preScale(-1, 1); Bitmap mirroredImage = Bitmap.createBitmap(photo, 0, 0, photo.getWidth(), photo.getHeight(), m, true); byte[] result = null; try { result = compress(mirroredImage, 85); } catch (OutOfMemoryError e) { try { result = compress(mirroredImage, 70); } catch (OutOfMemoryError e2) { e.printStackTrace(); } } try { inputStream.close(); } catch (IOException e) { e.printStackTrace(); } return result; }

Target:
private byte[] mirrorImage(byte[] data) { ByteArrayInputStream inputStream = new ByteArrayInputStream(data); Bitmap photo = BitmapFactory.decodeStream(inputStream); Matrix m = new Matrix(); m.preScale(-1, 1); Bitmap mirroredImage = Bitmap.createBitmap(photo, 0, 0, photo.getWidth(), photo.getHeight(), m, false); byte[] result = null; try { result = compress(mirroredImage, 85); } catch (OutOfMemoryError e) { try { result = compress(mirroredImage, 70); } catch (OutOfMemoryError e2) { e.printStackTrace(); } } try { inputStream.close(); } catch (IOException e) { e.printStackTrace(); } return result; }
Source:
public void shouldPublishAndConsumeJmsMessageWithTraceHeaders() throws Exception { String message = "{\"hello\": \"world\"}"; String traceId = UUID.randomUUID().toString(); String spanId = UUID.randomUUID().toString(); String parentSpanId = UUID.randomUUID().toString(); String sampled = "1"; String reported = "0"; Topic topic = operations.buildTopic("publishJmsGroupWithTrace", "topic"); operations.createSubscription(topic, "subscription", jmsEndpointAddress(JMS_TOPIC_NAME)); WebTarget client = ClientBuilder.newClient().target(FRONTEND_URL).path("topics").path(topic.getQualifiedName()); jmsEndpoint.expectMessages(TestMessage.of("hello", "world")); Response response = client .request() .header("Trace-Id", traceId) .header("Span-Id", spanId) .header("Parent-Span-Id", parentSpanId) .header("Trace-Sampled", sampled) .header("Trace-Reported", reported) .post(Entity.entity(message, MediaType.APPLICATION_JSON)); assertThat(response).hasStatus(Response.Status.CREATED); Message lastMessage = jmsEndpoint.waitAndGetLastMessage(); assertThat(lastMessage).assertStringProperty("TraceId", traceId); assertThat(lastMessage).assertStringProperty("SpanId", spanId); assertThat(lastMessage).assertStringProperty("ParentSpanId", parentSpanId); assertThat(lastMessage).assertStringProperty("TraceSampled", sampled); assertThat(lastMessage).assertStringProperty("TraceReported", reported); }

Target:
public void shouldPublishAndConsumeJmsMessageWithTraceHeaders() throws Exception { String message = "{\"hello\": \"world\"}"; TraceContext trace = TraceContext.random(); Topic topic = operations.buildTopic("publishJmsGroupWithTrace", "topic"); operations.createSubscription(topic, "subscription", jmsEndpointAddress(JMS_TOPIC_NAME)); jmsEndpoint.expectMessages(TestMessage.of("hello", "world")); Invocation.Builder request = createRequestWithTraceHeaders(FRONTEND_URL, topic.getQualifiedName(), trace);; Response response = request.post(Entity.entity(message, MediaType.APPLICATION_JSON)); assertThat(response).hasStatus(Response.Status.CREATED); Message lastMessage = jmsEndpoint.waitAndGetLastMessage(); assertThat(lastMessage).assertStringProperty("TraceId", trace.getTraceId()) .assertStringProperty("SpanId", trace.getSpanId()) .assertStringProperty("ParentSpanId", trace.getParentSpanId()) .assertStringProperty("TraceSampled", trace.getTraceSampled()) .assertStringProperty("TraceReported", trace.getTraceReported()); }
Source:
private void restartRoom() { fireEvent(new ControllerEvent(this, ControllerEvent.RESTARTROOM, "Room restarted")); Model.restartRoom(); ArrayList<PowerUp> powers = Model.getPowerUps(); for (PowerUp power : powers) { power.reset(); } collisionHandler.addCollidable(Model.getCurrentRoom().getCollidables()); }

Target:
private void restartRoom() { fireEvent(new ControllerEvent(this, ControllerEvent.RESTARTROOM, "Room restarted")); Model.restartRoom(); List<PowerUp> powers = Model.getPowerUps(); for (PowerUp power: powers) { power.reset(); } collisionHandler.addCollidable(Model.getCurrentRoom().getCollidables()); }
Source:
public void updateLastFoundKey(ByteString key) { this.lastFoundKey = key; rowCount++; }

Target:
void updateLastFoundKey(ByteString key) { this.lastFoundKey = key; rowCount++; }
Source:
public Object evaluate(GenericRow genericRow) { Map<String, Object> params = new HashMap<>(); for (String argument : _arguments) { params.put(argument, genericRow.getValue(argument)); } if (params.containsValue(null)) { return null; } else { Binding binding = new Binding(); for (String argument : _arguments) { binding.setVariable(argument, params.get(argument)); } GroovyShell shell = new GroovyShell(binding); return shell.evaluate(_script); } }

Target:
public Object evaluate(GenericRow genericRow) { Map<String, Object> params = new HashMap<>(); for (String argument : _arguments) { Object value = genericRow.getValue(argument); if (value == null) { return null; } params.put(argument, value); } Binding binding = new Binding(); for (String argument : _arguments) { binding.setVariable(argument, params.get(argument)); } GroovyShell shell = new GroovyShell(binding); return shell.evaluate(_script); }
Source:
public void exitTest() throws IOException { final Response response = new RsWithStatus( new RsWithType( new RsWithBody("<html>This is test response</html>"), "text/html" ), 200 ); MatcherAssert.assertThat( new PsByFlag( ImmutableMap.of( "key", (Pass) new PsFake(true) ) ).exit(response, Mockito.mock(Identity.class)), Matchers.is(response) ); }

Target:
public void exitTest() throws IOException { final Response response = new RsWithStatus( new RsWithType( new RsWithBody("<html>This is test response</html>"), "text/html" ), 200 ); MatcherAssert.assertThat( new PsByFlag( ImmutableMap.<String, Pass>of("key", new PsFake(true)) ).exit(response, Mockito.mock(Identity.class)), Matchers.is(response) ); }
Source:
public void addBreakpoint(final Breakpoint breakpoint) { if (isConnected()) { Location location = breakpoint.getLocation(); LocationDto locationDto = dtoFactory.createDto(LocationDto.class); locationDto.setLineNumber(location.getLineNumber()); locationDto.setTarget(location.getTarget()); locationDto.setResourceProjectPath(location.getResourceProjectPath()); BreakpointConfiguration breakpointConfiguration = breakpoint.getBreakpointConfiguration(); BreakpointConfigurationDto conditions = dtoFactory .createDto(BreakpointConfigurationDto.class) .withCondition(breakpointConfiguration.getCondition()) .withHitCount(breakpointConfiguration.getHitCount()); BreakpointDto breakpointDto = dtoFactory .createDto(BreakpointDto.class) .withLocation(locationDto) .withEnabled(true) .withBreakpointConfiguration(conditions); Promise<Void> promise = service.addBreakpoint(debugSessionDto.getId(), breakpointDto); promise .then( it -> { for (DebuggerObserver observer : observers) { observer.onBreakpointAdded(breakpoint); } }) .catchError( error -> { Log.error(AbstractDebugger.class, error.getMessage()); }); } }

Target:
public void addBreakpoint(final Breakpoint breakpoint) { if (isConnected()) { Promise<Void> promise = service.addBreakpoint(debugSessionDto.getId(), toDto(breakpoint)); promise .then( it -> { for (DebuggerObserver observer : observers) { observer.onBreakpointAdded(breakpoint); } }) .catchError( error -> { Log.error(AbstractDebugger.class, error.getMessage()); }); } }
Source:
public PerTargetPropagater(LinkedPointSet targets, AnalysisTask task, int[][] travelTimesToStopsForIteration, int[] nonTransitTravelTimesToTargets) { this.targets = targets; this.request = task; this.travelTimesToStopsForIteration = travelTimesToStopsForIteration; this.nonTransitTravelTimesToTargets = nonTransitTravelTimesToTargets; this.calculateComponents = task.makeStaticSite; StreetMode egressMode = LegMode.getDominantStreetMode(task.egressModes); speedMillimetersPerSecond = (int) (request.getSpeedForMode(egressMode) * MM_PER_METER); egressLegTimeLimitSeconds = (int) request.getMaxAccessTimeForMode(egressMode) * SECONDS_PER_MINUTE; nIterations = travelTimesToStopsForIteration.length; nStops = travelTimesToStopsForIteration[0].length; invertTravelTimes(); }

Target:
public PerTargetPropagater(LinkedPointSet targets, AnalysisTask task, int[][] travelTimesToStopsForIteration, int[] nonTransitTravelTimesToTargets) { this.targets = targets; this.request = task; this.travelTimesToStopsForIteration = travelTimesToStopsForIteration; this.nonTransitTravelTimesToTargets = nonTransitTravelTimesToTargets; this.calculateComponents = task.makeStaticSite; StreetMode egressMode = LegMode.getDominantStreetMode(task.egressModes); speedMillimetersPerSecond = (int) (request.getSpeedForMode(egressMode) * MM_PER_METER); egressLegTimeLimitSeconds = request.getMaxAccessTimeForMode(egressMode) * SECONDS_PER_MINUTE; nIterations = travelTimesToStopsForIteration.length; nStops = travelTimesToStopsForIteration[0].length; invertTravelTimes(); }