auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void shouldTryToLockValidTaskDirsAtRebalanceStart() throws IOException { expectLockObtainedFor(taskId01); expectLockFailedFor(taskId10); makeTaskFolders( <START> "0_1", <END> "1_0", "dummy" ); replay(stateDirectory); taskManager.handleRebalanceStart(singleton("topic")); verify(stateDirectory); assertThat(taskManager.lockedTaskDirectories(), is(singleton(taskId01))); }</code><technical_language>prop: I taskId01.toString() here, testing taskId01.toString() method. assumption is folder a name is equal result of taskId01.toString() 0_1</technical_language>

Target:
public void shouldTryToLockValidTaskDirsAtRebalanceStart() throws IOException { expectLockObtainedFor(taskId01); expectLockFailedFor(taskId10); makeTaskFolders( taskId01.toString(), taskId10.toString(), "dummy" ); replay(stateDirectory); taskManager.handleRebalanceStart(singleton("topic")); verify(stateDirectory); assertThat(taskManager.lockedTaskDirectories(), is(singleton(taskId01))); }
Source:
<code>public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); Bundle b = getArguments(); if (b != null) { Product product = (Product) b.getSerializable("product"); if (product != null) { code = product.getCode(); } } else { <START> Toast.makeText(activity, "Something went wrong", Toast.LENGTH_SHORT).show(); <END> activity.finish(); } }</code><technical_language>try error messages more explicit. "Something wrong add product ingredients." try giving causes, a follow-up action</technical_language>

Target:
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); Bundle b = getArguments(); if (b != null) { Product product = (Product) b.getSerializable("product"); mOfflineSavedProduct = (OfflineSavedProduct) b.getSerializable("edit_offline_product"); if (product != null) { code = product.getCode(); } if (mOfflineSavedProduct != null) { code = mOfflineSavedProduct.getBarcode(); preFillValues(); } } else { Toast.makeText(activity, R.string.error_adding_ingredients, Toast.LENGTH_SHORT).show(); activity.finish(); } if (ingredients.getText().toString().isEmpty() && productDetails.get("image_ingredients") != null && !productDetails.get("image_ingredients").isEmpty()) { extractIngredients.setVisibility(View.VISIBLE); imagePath = productDetails.get("image_ingredients"); } loadAutoSuggestions(); }
Source:
<code>public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { <START> for(Order o : ordersPlaced){ <END> if(o.getStockSymbol().equals(symbol)) throw new StockMarketExpection(); } Stock stock = m.getStockForSymbol(symbol); if( orderType == OrderType.SELL){ int size = -1; for(Order o : position){ if(o.getStockSymbol().equals(symbol)){ size = o.getSize(); } } if(size == -1 || size < volume){ throw new StockMarketExpection(); } SellOrder sellOrder = new SellOrder(symbol, volume, price, this); ordersPlaced.add(sellOrder); m.addOrder(sellOrder); }else{ double totalCost = stock.getPrice() * volume ; if(totalCost <= cashInHand){ BuyOrder buyOrder = new BuyOrder(symbol, volume, price, this); ordersPlaced.add(buyOrder); m.addOrder(buyOrder); }else{ throw new StockMarketExpection("You don't have enough cash"); } } }</code><technical_language>Variable 'o' more descriptive</technical_language>

Target:
public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { for(Order order : ordersPlaced){ if(order.getStockSymbol().equals(symbol)) throw new StockMarketExpection(); } Stock stock = m.getStockForSymbol(symbol); if( orderType == OrderType.SELL){ int size = -1; for(Order o : position){ if(o.getStockSymbol().equals(symbol)){ size = o.getSize(); } } if(size == -1 || size < volume){ throw new StockMarketExpection(); } SellOrder sellOrder = new SellOrder(symbol, volume, price, this); ordersPlaced.add(sellOrder); m.addOrder(sellOrder); }else{ double totalCost = stock.getPrice() * volume ; if(totalCost <= cashInHand){ BuyOrder buyOrder = new BuyOrder(symbol, volume, price, this); ordersPlaced.add(buyOrder); m.addOrder(buyOrder); }else{ throw new StockMarketExpection("You don't have enough cash"); } } }
Source:
<code><START> private long getClinicalId(boolean silent, String clinicalStrAux) throws CatalogDBException { <END> long clinicalId = Long.parseLong(clinicalStrAux); try { clinicalDBAdaptor.checkId(clinicalId); } catch (CatalogException e) { if (silent) { return -1L; } else { throw e; } } return clinicalId; }</code><technical_language>This method throw a CatalogException</technical_language>

Target:
private long getClinicalId(boolean silent, String clinicalStrAux) throws CatalogException { long clinicalId = Long.parseLong(clinicalStrAux); try { clinicalDBAdaptor.checkId(clinicalId); } catch (CatalogException e) { if (silent) { return -1L; } else { throw e; } } return clinicalId; }
Source:
<code><START> private void publishEvent(String event, SiteNode node) { <END> ZAP.getEventBus().publishSyncEvent(SiteMapEventPublisher.getPublisher(), new Event(SiteMapEventPublisher.getPublisher(), event, new Target(node))); }</code><technical_language>Consider adding static modifier</technical_language>

Target:
private static void publishEvent(String event, SiteNode node) { ZAP.getEventBus().publishSyncEvent(SiteMapEventPublisher.getPublisher(), new Event(SiteMapEventPublisher.getPublisher(), event, new Target(node))); }
Source:
<code>Client(Map storm_conf, String host, int port) { message_queue = new LinkedBlockingQueue<Object>(); retries = new AtomicInteger(0); channelRef = new AtomicReference<Channel>(null); being_closed = new AtomicBoolean(false); buffer_size = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_BUFFER_SIZE)); <START> max_retries = Math.max(30, Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MAX_RETRIES))); <END> base_sleep_ms = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MIN_SLEEP_MS)); max_sleep_ms = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MAX_SLEEP_MS)); int maxWorkers = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS)); if (maxWorkers > 0) { factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool(), maxWorkers); } else { factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()); } bootstrap = new ClientBootstrap(factory); bootstrap.setOption("tcpNoDelay", true); bootstrap.setOption("sendBufferSize", buffer_size); bootstrap.setOption("keepAlive", true); bootstrap.setPipelineFactory(new StormClientPipelineFactory(this)); remote_addr = new InetSocketAddress(host, port); bootstrap.connect(remote_addr); }</code><technical_language>This Math.min(). No</technical_language>

Target:
Client(Map storm_conf, String host, int port) { message_queue = new LinkedBlockingQueue<Object>(); retries = new AtomicInteger(0); channelRef = new AtomicReference<Channel>(null); being_closed = new AtomicBoolean(false); buffer_size = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_BUFFER_SIZE)); max_retries = Math.min(30, Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MAX_RETRIES))); base_sleep_ms = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MIN_SLEEP_MS)); max_sleep_ms = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MAX_SLEEP_MS)); int maxWorkers = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS)); if (maxWorkers > 0) { factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool(), maxWorkers); } else { factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()); } bootstrap = new ClientBootstrap(factory); bootstrap.setOption("tcpNoDelay", true); bootstrap.setOption("sendBufferSize", buffer_size); bootstrap.setOption("keepAlive", true); bootstrap.setPipelineFactory(new StormClientPipelineFactory(this)); remote_addr = new InetSocketAddress(host, port); bootstrap.connect(remote_addr); }
Source:
<code>protected boolean isVmNotInPreviewSnapshot() { return getVmId() != null && <START> validate(getSnapshotsValidator().vmNotDuringSnapshot(getVmId())) && <END> validate(getSnapshotsValidator().vmNotInPreview(getVmId())); }</code><technical_language>I creating SnapshotsValidator objects other</technical_language>

Target:
protected boolean isVmNotInPreviewSnapshot() { final SnapshotsValidator snapshotsValidator = getSnapshotsValidator(); return getVmId() != null && validate(snapshotsValidator.vmNotDuringSnapshot(getVmId())) && validate(snapshotsValidator.vmNotInPreview(getVmId())); }
Source:
<code>public void testOur404Handler(String wiki, String inputPath, String expectedPath) { String wikiBase = urlBuilder.getUrlForWiki(wiki); String inputUrl = wikiBase + inputPath; String expectedUrl = expectedPath; <START> if (!expectedUrl.startsWith("http://")) { <END> expectedUrl = wikiBase + expectedUrl; } driver.get(inputUrl); String actualUrl = driver.getCurrentUrl(); Assertion.assertEquals(actualUrl, expectedUrl); }</code><technical_language>I flip condition special case is protocol, otherwise: java if (expectedUrl.startsWith("http://")) { expectedUrl = expectedPath }</technical_language>

Target:
public void testOur404Handler(String wiki, String inputPath, String expectedPath) { String wikiBase = urlBuilder.getUrlForWiki(wiki); String inputUrl = wikiBase + inputPath; String expectedUrl = wikiBase + expectedPath; if (expectedPath.startsWith("http://")) { expectedUrl = expectedPath; } driver.get(inputUrl); String actualUrl = driver.getCurrentUrl(); Assertion.assertEquals(actualUrl, expectedUrl); }
Source:
<code>private boolean isStringConcat(Node childNode, Node baseNode) { Node currentNode = childNode; <START> for (int i = 0; i < 10 && currentNode != null && currentNode != baseNode; i++) { <END> currentNode = currentNode.jjtGetParent(); if (currentNode instanceof ASTAdditiveExpression) { return true; } } return false; }</code><technical_language>this is arbitrary... limit? able get basenode childNode is guaranteed a descendant</technical_language>

Target:
private boolean isStringConcat(Node childNode, Node baseNode) { Node currentNode = childNode; while (currentNode != baseNode) { currentNode = currentNode.jjtGetParent(); if (currentNode instanceof ASTAdditiveExpression) { return true; } } return false; }
Source:
<code>private synchronized void startSplit(PrioritizedSplitRunner split) { allSplits.add(split); waitingSplits.offer(split); <START> log.debug("%s is started", split.toString()); <END> }</code><technical_language>log variable part end, logs easier read search: java log.debug("Started %s", split); Also, call toString() logger do if level is enabled (thus is free if disabled)</technical_language>

Target:
private synchronized void startSplit(PrioritizedSplitRunner split) { allSplits.add(split); waitingSplits.offer(split); log.debug("Started %s", split); }
Source:
<code><START> private static String getProperty(String propertyName) { <END> return AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(propertyName)); }</code><technical_language>Annotate method @Nullable</technical_language>

Target:
private String getProperty(String propertyName) { return propertyCache.computeIfAbsent( propertyName, p -> AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty(p))); }
Source:
<code>private boolean readState() { IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(GdbPlugin.PLUGIN_ID); boolean terminate = true; if (preferences != null) { terminate = preferences.getBoolean(IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, true); } <START> return terminate; <END> }</code><technical_language>Platform.getPreferencesService().getBoolean() read preference</technical_language>

Target:
private boolean readState() { return Platform.getPreferencesService().getBoolean(GdbPlugin.PLUGIN_ID, IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, true, null); }
Source:
<code>public void sharedPoolsConfigured() { if (managementRegistry != null) { LOGGER.trace("sharedPoolsConfigured()"); CompletableFuture.allOf(ehcacheStateService.getSharedResourcePools() .entrySet() .stream() .map(e -> managementRegistry.register(new PoolBinding(e.getKey(), e.getValue(), PoolBinding.AllocationType.SHARED))) .collect(Collectors.toList()) <START> .toArray(new CompletableFuture<?>[0])) <END> .thenRun(() -> { managementRegistry.refresh(); managementRegistry.pushServerEntityNotification(PoolBinding.ALL_SHARED, EHCACHE_RESOURCE_POOLS_CONFIGURED.name()); }); } }</code><technical_language>this line collapsed in .toArray(CompletableFuture[]::new)</technical_language>

Target:
public void sharedPoolsConfigured() { if (managementRegistry != null) { LOGGER.trace("sharedPoolsConfigured()"); CompletableFuture.allOf(ehcacheStateService.getSharedResourcePools() .entrySet() .stream() .map(e -> managementRegistry.register(new PoolBinding(e.getKey(), e.getValue(), PoolBinding.AllocationType.SHARED))) .toArray(CompletableFuture<?>[]::new)) .thenRun(() -> { managementRegistry.refresh(); managementRegistry.pushServerEntityNotification(PoolBinding.ALL_SHARED, EHCACHE_RESOURCE_POOLS_CONFIGURED.name()); }); } }
Source:
<code>public static int runBackupToolFromOtherJvmToGetExitCode( File neo4jHome, String... args ) throws Exception { List<String> allArgs = new ArrayList<>( Arrays.asList( ProcessUtil.getJavaExecutable().toString(), "-cp", ProcessUtil.getClassPath(), AdminTool.class.getName() ) ); allArgs.add( "backup" ); allArgs.addAll( Arrays.asList( args ) ); Process process = Runtime.getRuntime().exec( allArgs.toArray( new String[allArgs.size()] ), new String[] {"NEO4J_HOME=" + neo4jHome.getAbsolutePath()} ); <START> return new ProcessStreamHandler( process, false ).waitForResult(); <END> }</code><technical_language>this intentionally left "not quiet"</technical_language>

Target:
public static int runBackupToolFromOtherJvmToGetExitCode( File neo4jHome, String... args ) throws Exception { List<String> allArgs = new ArrayList<>( Arrays.asList( ProcessUtil.getJavaExecutable().toString(), "-cp", ProcessUtil.getClassPath(), AdminTool.class.getName() ) ); allArgs.add( "backup" ); allArgs.addAll( Arrays.asList( args ) ); Process process = Runtime.getRuntime().exec( allArgs.toArray( new String[allArgs.size()] ), new String[] {"NEO4J_HOME=" + neo4jHome.getAbsolutePath()} ); return new ProcessStreamHandler( process, true ).waitForResult(); }
Source:
<code>public void setColorFilter(ColorFilter cf) { <START> bitmapPaint.setColorFilter(cf); <END> }</code><technical_language>This is stomp set in constructor. Change to: java throw new UnsupportedOperationException();</technical_language>

Target:
@Override public void setColorFilter(ColorFilter cf) { throw new UnsupportedOperationException("Custom ColorFilters not supported"); }
Source:
<code>public void testFilterOnTimeExtract() throws Exception { testQuery( "SELECT COUNT(*) FROM druid.foo\n" + "WHERE EXTRACT(YEAR FROM __time) = 2000\n" + "AND EXTRACT(MONTH FROM __time) = 1", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) <START> .intervals(QSS(Intervals.of("-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"))) <END> .granularity(Granularities.ALL) .aggregators(AGGS(new CountAggregatorFactory("a0"))) .filters( AND( EXPRESSION_FILTER("(timestamp_extract(\"__time\",'YEAR','UTC') == 2000)"), EXPRESSION_FILTER("(timestamp_extract(\"__time\",'MONTH','UTC') == 1)") ) ) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{3L} ) ); }</code><technical_language>This .intervals(QSS(Filtration.eternity()))</technical_language>

Target:
public void testFilterOnTimeExtract() throws Exception { testQuery( "SELECT COUNT(*) FROM druid.foo\n" + "WHERE EXTRACT(YEAR FROM __time) = 2000\n" + "AND EXTRACT(MONTH FROM __time) = 1", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(QSS(Filtration.eternity())) .granularity(Granularities.ALL) .aggregators(AGGS(new CountAggregatorFactory("a0"))) .filters( AND( EXPRESSION_FILTER("(timestamp_extract(\"__time\",'YEAR','UTC') == 2000)"), EXPRESSION_FILTER("(timestamp_extract(\"__time\",'MONTH','UTC') == 1)") ) ) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{3L} ) ); }
Source:
<code>public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); final byte[][] valuesBytes = new byte[values.size()][]; int valuesBytesSize = 0; int index = 0; boolean hasNull = false; for (String value : values) { if (value == null) { hasNull = true; } <START> valuesBytes[index] = StringUtils.toUtf8(StringUtils.nullToEmptyNonDruidDataString(value)); <END> valuesBytesSize += valuesBytes[index].length + 1; ++index; } byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); ByteBuffer filterCacheKey = ByteBuffer.allocate(5 + dimensionBytes.length + valuesBytesSize + extractionFnBytes.length) .put(DimFilterUtils.IN_CACHE_ID) .put(dimensionBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(extractionFnBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(hasNull ? (byte) 1 : (byte) 0) .put(DimFilterUtils.STRING_SEPARATOR); for (byte[] bytes : valuesBytes) { filterCacheKey.put(bytes) .put((byte) 0xFF); } return filterCacheKey.array(); }</code><technical_language>question. E. g. in constructor, NullHandling.emptyToNullIfNeeded(value). self-review usages of emptyToNullIfNeeded(), emptyToNullNonDruidDataString(), Strings.emptyToNull() (if remaining in codebase), reverse methods</technical_language>

Target:
public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); final byte[][] valuesBytes = new byte[values.size()][]; int valuesBytesSize = 0; int index = 0; boolean hasNull = false; for (String value : values) { if (value == null) { hasNull = true; } valuesBytes[index] = StringUtils.toUtf8(Strings.nullToEmpty(value)); valuesBytesSize += valuesBytes[index].length + 1; ++index; } byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); ByteBuffer filterCacheKey = ByteBuffer.allocate(5 + dimensionBytes.length + valuesBytesSize + extractionFnBytes.length) .put(DimFilterUtils.IN_CACHE_ID) .put(dimensionBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(extractionFnBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(hasNull ? NullHandling.IS_NULL_BYTE : NullHandling.IS_NOT_NULL_BYTE) .put(DimFilterUtils.STRING_SEPARATOR); for (byte[] bytes : valuesBytes) { filterCacheKey.put(bytes) .put((byte) 0xFF); } return filterCacheKey.array(); }
Source:
<code>public FormValidation doReRegister() { if (!manageHook) { <START> return FormValidation.error("Works only when jenkins manages hooks"); <END> } int triggered = 0; for (AbstractProject<?,?> job : Jenkins.getInstance().getAllItems(AbstractProject.class)) { GitHubPushTrigger trigger = job.getTrigger(GitHubPushTrigger.class); if (trigger!=null) { LOGGER.log(Level.FINE, "Calling registerHooks() for {0}", job.getFullName()); trigger.registerHooks(); triggered++; } } LOGGER.log(Level.INFO, "Called registerHooks() for {0} jobs", triggered); return FormValidation.ok("Called registerHooks() for " + triggered + " jobs"); }</code><technical_language>**J**enkins</technical_language>

Target:
public FormValidation doReRegister() { if (!manageHook) { return FormValidation.error("Works only when Jenkins manages hooks"); } int triggered = 0; for (AbstractProject<?,?> job : getJenkinsInstance().getAllItems(AbstractProject.class)) { if (!job.isBuildable()) { continue; } GitHubPushTrigger trigger = job.getTrigger(GitHubPushTrigger.class); if (trigger!=null) { LOGGER.log(Level.FINE, "Calling registerHooks() for {0}", job.getFullName()); trigger.registerHooks(); triggered++; } } LOGGER.log(Level.INFO, "Called registerHooks() for {0} jobs", triggered); return FormValidation.ok("Called re-register hooks for " + triggered + " jobs"); }
Source:
<code>public static void deleteFile(@Nonnull File f) throws IOException { if (!f.delete()) { if(!f.exists()) return; makeWritable(f); makeWritable(f.getParentFile()); if(!f.delete() && f.exists()) { <START> Files.delete(f.toPath()); <END> File[] files = f.listFiles(); if(files!=null && files.length>0) throw new IOException("Unable to delete " + f.getPath()+" - files in dir: "+Arrays.asList(files)); throw new IOException("Unable to delete " + f.getPath()); } } }</code><technical_language>replace original call Files.deleteIfExists(f.toPath())</technical_language>

Target:
public static void deleteFile(@Nonnull File f) throws IOException { if (!f.delete()) { if(!f.exists()) return; makeWritable(f); makeWritable(f.getParentFile()); if(!f.delete() && f.exists()) { Files.deleteIfExists(f.toPath()); File[] files = f.listFiles(); if(files!=null && files.length>0) throw new IOException("Unable to delete " + f.getPath()+" - files in dir: "+Arrays.asList(files)); throw new IOException("Unable to delete " + f.getPath()); } } }
Source:
<code>public DepthObjectWalk(ObjectReader or, int depth, final RevFlag shallow, final Collection<? extends ObjectId> clientShallows) { super(or); this.depth = depth; <START> SHALLOW = shallow == null ? newFlag("SHALLOW") : shallow; <END> this.clientShallows = clientShallows; BOUNDARY = newFlag("BOUNDARY"); }</code><technical_language>above, flag part of public API</technical_language>

Target:
DepthObjectWalk(ObjectReader or, int depth, final RevFlag shallow, final Collection<? extends ObjectId> clientShallows) { super(or); this.depth = depth; SHALLOW = shallow == null ? newFlag("SHALLOW") : shallow; this.clientShallows = clientShallows; BOUNDARY = newFlag("BOUNDARY"); }
Source:
<code>public void setBufferSize(final int bufferSize) { <START> this.bufferSize = 1; <END> }</code><technical_language>I prefer if int bufferSize is a property of AbstractEmitter, instead a property of BatchEmitter only. SimpleEmitter implement getBufferSize() return 1 BatchEmitter implement return this.bufferSize. I consider raising exception if try setBufferSize SimpleEmitter. (I appreciate this do current issue)</technical_language>

Target:
public void setBufferSize(final int bufferSize) { if (bufferSize != 1) { LOGGER.debug("Noop. SimpleEmitter buffer size must always be 1."); } }
Source:
<code>public synchronized void addListener(File file, String path, ResourceListener listener) { if( watcher == null ){ <START> Disposer disposer = GeoServerExtensions.bean(Disposer.class); <END> watcher = new FileSystemWatcher(); if(disposer!=null) { disposer.register(watcher); } else { LOGGER.warning("Disposer not available to register for disposal. FileSystemWatcher may not be closed at application shutdown."); } } watcher.addListener( file, path, listener ); }</code><technical_language>This code block is repeated (lookup, register log...) a static method in Disposer</technical_language>

Target:
public synchronized void addListener(File file, String path, ResourceListener listener) { if( watcher == null ){ watcher = new FileSystemWatcher(); } watcher.addListener( file, path, listener ); }
Source:
<code>public void objectFreq() { jedis.set(key, "test1"); <START> jedis.configSet("maxmemory-policy", "allkeys-lfu"); <END> jedis.get(key); Long count = jedis.objectFreq(key); assertTrue(count > 0); count = jedis.objectFreq(binaryKey); assertTrue(count > 0); jedis.configSet("maxmemory-policy", "noeviction"); }</code><technical_language>do this config file (Makefile). create a new Redis instance modify+reuse a *safe* instance, REDIS8_CONF port 6386</technical_language>

Target:
public void objectFreq() { lfuJedis.set(key, "test1"); lfuJedis.get(key); Long count = lfuJedis.objectFreq(key); assertTrue(count > 0); count = lfuJedis.objectFreq(binaryKey); assertTrue(count > 0); assertNull(lfuJedis.objectFreq("no_such_key")); try { jedis.set(key, "test2"); jedis.objectFreq(key); fail("Freq is only allowed with LFU policy"); }catch(JedisDataException e) }
Source:
<code>protected Object doReceive() { AbstractFileInfo<F> file = poll(); if (file != null) { String remotePath = remotePath(file); Session<?> session = this.remoteFileTemplate.getSession(); try { AbstractIntegrationMessageBuilder<InputStream> builder = getMessageBuilderFactory() .withPayload(session.readRaw(remotePath)) .setHeader(IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE, session) .setHeader(FileHeaders.REMOTE_DIRECTORY, file.getRemoteDirectory()) .setHeader(FileHeaders.REMOTE_FILE, file.getFilename()); if (getObjectMapper() != null) { try { <START> builder.setHeader(FileHeaders.REMOTE_FILE_INFO, getObjectMapper().toJson(file)); <END> } catch (Exception e) { logger.info("Failed to transform file info to json: " + file, e); } } return builder.build(); } catch (IOException e) { throw new MessagingException("IOException when retrieving " + remotePath, e); } } return null; }</code><technical_language>transfer FileHeaders.REMOTE_FILE_INFO a regular FileInfo instance if want JSON downstream is in memory</technical_language>

Target:
protected Object doReceive() { AbstractFileInfo<F> file = poll(); if (file != null) { String remotePath = remotePath(file); Session<?> session = this.remoteFileTemplate.getSession(); try { return getMessageBuilderFactory() .withPayload(session.readRaw(remotePath)) .setHeader(IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE, session) .setHeader(FileHeaders.REMOTE_DIRECTORY, file.getRemoteDirectory()) .setHeader(FileHeaders.REMOTE_FILE, file.getFilename()) .setHeader(FileHeaders.REMOTE_FILE_INFO, this.fileInfoJson ? (file.toJson()) : file) .build(); } catch (IOException e) { throw new MessagingException("IOException when retrieving " + remotePath, e); } } return null; }
Source:
<code>public Response startAttempt(RestSessionAttemptRequest request) throws ResourceNotFoundException, ResourceConflictException { ProjectStore rs = rm.getProjectStore(getSiteId()); StoredWorkflowDefinitionWithProject def = rs.getWorkflowDefinitionById(request.getWorkflowId()); Optional<Long> resumingAttemptId = request.getResume() .transform(r -> r.getAttemptId()); List<Long> resumingTasks = request.getResume() .transform(r -> collectResumingTasks(r)) .or(ImmutableList.of()); AttemptRequest ar = attemptBuilder.buildFromStoredWorkflow( def, request.getParams(), ScheduleTime.runNow(request.getSessionTime()), request.getRetryAttemptName(), resumingAttemptId, resumingTasks); try { StoredSessionAttemptWithSession attempt = executor.submitWorkflow(getSiteId(), ar, def); RestSessionAttempt res = RestModels.attempt(attempt, def.getProject().getName()); return Response.ok(res).build(); } catch (LimitExceededException ex) { <START> return Response.status(Response.Status.FORBIDDEN).entity(ex.getMessage()).build(); <END> } catch (SessionAttemptConflictException ex) { StoredSessionAttemptWithSession conflicted = ex.getConflictedSession(); RestSessionAttempt res = RestModels.attempt(conflicted, def.getProject().getName()); return Response.status(Response.Status.CONFLICT).entity(res).build(); } }</code><technical_language>403 Forbidden is typically e.g. user sufficient permissions. I 400 Bad Request more suitable</technical_language>

Target:
public Response startAttempt(RestSessionAttemptRequest request) throws ResourceNotFoundException, ResourceConflictException { ProjectStore rs = rm.getProjectStore(getSiteId()); StoredWorkflowDefinitionWithProject def = rs.getWorkflowDefinitionById(request.getWorkflowId()); Optional<Long> resumingAttemptId = request.getResume() .transform(r -> r.getAttemptId()); List<Long> resumingTasks = request.getResume() .transform(r -> collectResumingTasks(r)) .or(ImmutableList.of()); AttemptRequest ar = attemptBuilder.buildFromStoredWorkflow( def, request.getParams(), ScheduleTime.runNow(request.getSessionTime()), request.getRetryAttemptName(), resumingAttemptId, resumingTasks); try { StoredSessionAttemptWithSession attempt = executor.submitWorkflow(getSiteId(), ar, def); RestSessionAttempt res = RestModels.attempt(attempt, def.getProject().getName()); return Response.ok(res).build(); } catch (SessionAttemptConflictException ex) { StoredSessionAttemptWithSession conflicted = ex.getConflictedSession(); RestSessionAttempt res = RestModels.attempt(conflicted, def.getProject().getName()); return Response.status(Response.Status.CONFLICT).entity(res).build(); } }
Source:
<code>public State terminate(AkkaRpcActor<?> akkaRpcActor) { akkaRpcActor.mainThreadValidator.enterMainThread(); CompletableFuture<Void> terminationFuture; try { terminationFuture = akkaRpcActor.rpcEndpoint.internalCallOnStop(); } catch (Throwable t) { String errorMsg = String.format("Failure while stopping RpcEndpoint %s.", akkaRpcActor.rpcEndpoint.getEndpointId()); <START> LoggerFactory.getLogger(akkaRpcActor.rpcEndpoint.getClass()).error(errorMsg, t); <END> terminationFuture = FutureUtils.completedExceptionally(new AkkaRpcException(errorMsg, t)); akkaRpcActor.rpcEndpoint.getTerminationFuture().completeExceptionally(t); } finally { akkaRpcActor.mainThreadValidator.exitMainThread(); } terminationFuture.whenComplete((ignored, throwable) -> akkaRpcActor.stop(RpcEndpointTerminationResult.of(throwable))); return TerminatingState.TERMINATING; }</code><technical_language>suggest akkaRpcActor.log instead of creating a new logger</technical_language>

Target:
default State terminate(AkkaRpcActor<?> akkaRpcActor) { throw new AkkaRpcInvalidStateException(invalidStateTransitionMessage(TerminatingState.TERMINATING)); }
Source:
<code>public Object visit(ASTAttachmentDecl node, Object data) { String connector = node.getConnector(); HashSet<String> ports = node.getAllPorts(); if (!connectors.containsKey(connector)) { ToolError.reportError(ErrorMessage.MEMBER_NOT_DECLARED, node.getLocation(), "connector", connector); } if (attachments.putIfAbsent(connector, ports) != null) { ToolError.reportError(ErrorMessage.DUPLICATE_CONNECTOR_USE, node.getLocation(), connector); } for (String portFull : ports) { String[] portParts = portFull.split("\\.", 2); String component = portParts[0]; String port = portParts[1]; <START> String type = components.get(component).getType(); <END> if (type == null) { ToolError.reportError(ErrorMessage.MEMBER_NOT_DECLARED, node.getLocation(), "component", component); } ASTComponentTypeDecl typeDecl = componentTypes .get(type); if (!typeDecl.getReqs().containsKey(port) && !typeDecl.getProvs().containsKey(port)) { ToolError.reportError(ErrorMessage.MEMBER_NOT_DECLARED, node.getLocation(), "port", port); } } return super.visit(node, data); }</code><technical_language>bug I mentioned exists well. Components declared attachments</technical_language>

Target:
public Object visit(ASTAttachmentDecl node, Object data) { String connector = node.getConnector(); HashSet<String> ports = node.getAllPorts(); if (attachments.putIfAbsent(connector, ports) != null) { ToolError.reportError(ErrorMessage.DUPLICATE_CONNECTOR_USE, node.getLocation(), connector); } for (String portFull : ports) { String[] portParts = portFull.split("\\.", 2); String component = portParts[0]; String port = portParts[1]; ASTComponentDecl comp = components.get(component); if (comp == null) { ToolError.reportError(ErrorMessage.MEMBER_NOT_DECLARED, node.getLocation(), "component", component); } ASTComponentTypeDecl typeDecl = componentTypes .get(comp.getType()); if (!typeDecl.getReqs().containsKey(port) && !typeDecl.getProvs().containsKey(port)) { ToolError.reportError(ErrorMessage.MEMBER_NOT_DECLARED, node.getLocation(), "port", port); } } return super.visit(node, data); }
Source:
<code>void putReserved(final ThriftTransportKey key, final CachedConnection connection) { executeWithinLock(key, <START> () -> getOrCreateCachedConnections(key).reserved.put(connection.transport, connection)); <END> }</code><technical_language>access map of executeWithinLock</technical_language>

Target:
void putReserved(final ThriftTransportKey key, final CachedConnection connection) { var connections = getOrCreateCachedConnections(key); executeWithinLock(key, () -> connections.reserved.put(connection.transport, connection)); }
Source:
<code>public static byte[] get(PresignedUrl url) throws IOException { try { HttpURLConnection conn = (HttpURLConnection) new URI(url.base).toURL().openConnection(); conn.setRequestMethod("GET"); for (Map.Entry<String, String> e : url.fields.entrySet()) { conn.setRequestProperty(e.getKey(), e.getValue()); } try { InputStream in = conn.getInputStream(); <START> ByteArrayOutputStream resp = new ByteArrayOutputStream(); <END> byte[] buf = new byte[4096]; int r; while ((r = in.read(buf)) >= 0) resp.write(buf, 0, r); return resp.toByteArray(); } catch (IOException e) { InputStream err = conn.getErrorStream(); ByteArrayOutputStream resp = new ByteArrayOutputStream(); byte[] buf = new byte[4096]; int r; while ((r = err.read(buf)) >= 0) resp.write(buf, 0, r); throw new IOException(new String(resp.toByteArray()), e); } } catch (URISyntaxException e) { throw new RuntimeException(e); } }</code><technical_language>coud refactor out copy BAOS</technical_language>

Target:
public static byte[] get(PresignedUrl url) throws IOException { try { HttpURLConnection conn = (HttpURLConnection) new URI(url.base).toURL().openConnection(); conn.setConnectTimeout(10_000); conn.setReadTimeout(60_000); conn.setRequestMethod("GET"); for (Map.Entry<String, String> e : url.fields.entrySet()) { conn.setRequestProperty(e.getKey(), e.getValue()); } try { InputStream in = conn.getInputStream(); return Serialize.readFully(in); } catch (IOException e) { InputStream err = conn.getErrorStream(); byte[] errBody = Serialize.readFully(err); throw new IOException(new String(errBody), e); } } catch (URISyntaxException e) { throw new RuntimeException(e); } }
Source:
<code>public Set<Feature> getFeatures(Constituent c) throws EdisonException { String classifier = "ChunkWindowThreeBefore"; TextAnnotation ta = c.getTextAnnotation(); TOKENS = ta.getView(ViewNames.TOKENS); SHALLOW_PARSE = ta.getView(ViewNames.SHALLOW_PARSE); int startspan = c.getStartSpan(); int endspan = c.getEndSpan(); int k = -2; List<Constituent> wordstwobefore = getwordskfrom(TOKENS, startspan, endspan, k); String[] labels = new String[2]; Set<Feature> result = new LinkedHashSet<Feature>(); int i = 0; if (wordstwobefore.size() == 0) { return result; } for (Constituent token : wordstwobefore) { List<String> Chunk_label = SHALLOW_PARSE.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan()); if (Chunk_label.size() != 1) { <START> logger.info("Error token has more than one POS tag or Chunk Label."); <END> } labels[i] = Chunk_label.get(0); String __value = "(" + labels[i] + ")"; String __id = classifier + ":" + (i++); result.add(new DiscreteFeature(__id + __value)); } return result; }</code><technical_language>change logger.warn()</technical_language>

Target:
public Set<Feature> getFeatures(Constituent c) throws EdisonException { String classifier = "ChunkWindowThreeBefore"; TextAnnotation ta = c.getTextAnnotation(); TOKENS = ta.getView(ViewNames.TOKENS); SHALLOW_PARSE = ta.getView(ViewNames.SHALLOW_PARSE); int startspan = c.getStartSpan(); int endspan = c.getEndSpan(); int k = -2; List<Constituent> wordstwobefore = getwordskfrom(TOKENS, startspan, endspan, k); String[] labels = new String[2]; Set<Feature> result = new LinkedHashSet<Feature>(); int i = 0; if (wordstwobefore.size() == 0) { return result; } for (Constituent token : wordstwobefore) { List<String> Chunk_label = SHALLOW_PARSE.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan()); if (Chunk_label.size() != 1) { logger.warn("Error token has more than one POS tag or Chunk Label."); } labels[i] = Chunk_label.get(0); String __value = "(" + labels[i] + ")"; String __id = classifier + ":" + (i++); result.add(new DiscreteFeature(__id + __value)); } return result; }
Source:
<code>private static II getLivingSubjectId(PRPAMT201306UV02LivingSubjectId id) { II oII = null; <START> if (id != null && id.getValue() != null) { <END> oII = id.getValue().get(0); } return oII; }</code><technical_language>getValue() tested for emptiness well, due subsequent .get(0)</technical_language>

Target:
private static II getLivingSubjectId(PRPAMT201306UV02LivingSubjectId id) { II oII = null; if (id != null && id.getValue() != null && !id.getValue().isEmpty()) { oII = id.getValue().get(0); } return oII; }
Source:
<code>public void updateOptions(Options options) { options.addOption(Option.builder("l") .longOpt("log-name") .desc("Monitor consumers latency for this LOG, must be a computation Record, " + "can be a comma separated list of log names or ALL") .required() .hasArg() .argName("LOG_NAME") .build()); options.addOption(Option.builder() .longOpt("api-key") .desc("Datadog API KEY") .required() .hasArg() .argName("API_KEY") .build()); options.addOption(Option.builder() .longOpt("tags") .desc("A comma separated list of Datadog tags, for instance: project:foo,staging:bar") .hasArg() .argName("TAGS") .build()); options.addOption(Option.builder().longOpt("partition").desc("Report metrics for each partition").build()); options.addOption(Option.builder("i") .longOpt("interval") .desc("send latency spaced at the specified interval in seconds") .hasArg() .argName("INTERVAL") .build()); options.addOption(Option.builder("c") .longOpt("count") <START> .desc("number of time to send the latency information") <END> .hasArg() .argName("COUNT") .build()); options.addOption(Option.builder() .longOpt("prefix") .desc("The metric prefix to use if not server_<hostname>_nuxeo_streams.") .hasArg() .argName("PREFIX") .build()); options.addOption(Option.builder() .longOpt("codec") .desc("Codec used to read record, can be: java, avro, avroBinary, avroJson") .hasArg() .argName("CODEC") .build()); options.addOption(Option.builder().longOpt("verbose").build()); }</code><technical_language>suggestion .desc("number of times latency information is sent")</technical_language>

Target:
public void updateOptions(Options options) { options.addOption(Option.builder("l") .longOpt("log-name") .desc("Monitor consumers latency for this LOG, must be a computation Record, " + "can be a comma separated list of log names or ALL") .required() .hasArg() .argName("LOG_NAME") .build()); options.addOption(Option.builder() .longOpt("api-key") .desc("Datadog API KEY") .required() .hasArg() .argName("API_KEY") .build()); options.addOption(Option.builder() .longOpt("tags") .desc("A comma separated list of Datadog tags, for instance: project:foo,staging:bar") .hasArg() .argName("TAGS") .build()); options.addOption(Option.builder().longOpt("partition").desc("Report metrics for each partition").build()); options.addOption(Option.builder("i") .longOpt("interval") .desc("send latency spaced at the specified interval in seconds") .hasArg() .argName("INTERVAL") .build()); options.addOption(Option.builder("c") .longOpt("count") .desc("number of times the latency information is sent") .hasArg() .argName("COUNT") .build()); options.addOption(Option.builder() .longOpt("prefix") .desc("The metric prefix to use if not nuxeo.streams.") .hasArg() .argName("PREFIX") .build()); options.addOption(Option.builder() .longOpt("codec") .desc("Codec used to read record, can be: java, avro, avroBinary, avroJson") .hasArg() .argName("CODEC") .build()); options.addOption(Option.builder().longOpt("verbose").build()); }
Source:
<code>public CsvTupleWriter(final char separator, final OutputStream out) { <START> final CsvPreference sepratorPreference = <END> new CsvPreference.Builder(Character.toChars(CsvPreference.STANDARD_PREFERENCE.getQuoteChar())[0], separator, CsvPreference.STANDARD_PREFERENCE.getEndOfLineSymbols()).build(); csvWriter = new CsvListWriter(new BufferedWriter(new OutputStreamWriter(out)), sepratorPreference); }</code><technical_language>typo in name</technical_language>

Target:
public CsvTupleWriter(final char separator, final OutputStream out) { final CsvPreference separatorPreference = new CsvPreference.Builder(Character.toChars(CsvPreference.STANDARD_PREFERENCE.getQuoteChar())[0], separator, CsvPreference.STANDARD_PREFERENCE.getEndOfLineSymbols()).build(); csvWriter = new CsvListWriter(new BufferedWriter(new OutputStreamWriter(out)), separatorPreference); }
Source:
<code>public QueryDetail() { modelName = "No Name"; queryText = new ArrayList<String>(); <START> queryText.add("Default Select Statement"); <END> }</code><technical_language>Empty list more sense</technical_language>

Target:
public QueryDetail() { modelName = ""; queryText = new ArrayList<String>(); queryText.add(""); }
Source:
<code>public String getId() { <START> return "org.eclipse.debug.ui.toolbar.openNewView"; END> }</code><technical_language>a cdt in there. about: org.eclipse.cdt.debug.ui.toolbar.openNewView</technical_language>

Target:
public String getId() { return "org.eclipse.cdt.debug.ui.toolbar.openNewView"; }
Source:
<code>public void typeToSearchInput(String value) { seleniumWebDriverHelper.waitVisibility(searchStackField).clear(); searchStackField.sendKeys(value); <START> WaitUtils.sleepQuietly(1); <END> }</code><technical_language>commands replaced one: seleniumWebDriverHelper.setText(...)</technical_language>

Target:
public void typeToSearchInput(String value) { seleniumWebDriverHelper.setValue(searchStackField, value); }
Source:
<code>public KRunState rewrite(ConstrainedTerm constrainedTerm, int bound) { if (useFastRewriting) { this.theFastMatcher = new FastRuleMatcher(constrainedTerm.termContext(), allRuleBits.length(), 90); } stopwatch.start(); KRunState finalState = null; int step = 1; while (step <= bound || bound < 0) { List<ConstrainedTerm> results; if (useFastRewriting) { results = fastComputeRewriteStep(constrainedTerm, true); } else { results = computeRewriteStep(constrainedTerm, step, true); } if (!results.isEmpty()) { constrainedTerm = results.get(0); if (step == bound) { finalState = new JavaKRunState(constrainedTerm, counter, Optional.of(step)); } } else { finalState = new JavaKRunState(constrainedTerm, counter, Optional.of(step - 1)); break; } step++; } stopwatch.stop(); <START> System.err.println("[" + step + ", " + stopwatch + " ]"); <END> return finalState; }</code><technical_language>this if removed</technical_language>

Target:
public KRunState rewrite(ConstrainedTerm constrainedTerm, int bound) { if (useFastRewriting) { this.theFastMatcher = new FastRuleMatcher(constrainedTerm.termContext(), allRuleBits.length(), 90); } stopwatch.start(); int step = 0; List<ConstrainedTerm> results; while (step != bound && !(results = computeRewriteStep(constrainedTerm, step, true)).isEmpty()) { constrainedTerm = results.get(0); step++; } KRunState finalState = new JavaKRunState(constrainedTerm, counter, Optional.of(step)); stopwatch.stop(); if (constrainedTerm.termContext().global().krunOptions.experimental.statistics) { System.err.println("[" + step + ", " + stopwatch + " ]"); } return finalState; }
Source:
<code>public SimilarToGraphQuery querySimilarTo(Graph graph, String[] similarToFields, String similarToText, Authorizations authorizations) { return new ElasticSearchSearchGraphQuery( getClient(), getConfig().getIndicesToQuery(), graph, similarToFields, similarToText, getAllPropertyDefinitions(), getConfig().getScoringStrategy(), <START> getConfig().getNameSubstitutionStrategy(), <END> authorizations); }</code><technical_language>this a field create time</technical_language>

Target:
public SimilarToGraphQuery querySimilarTo(Graph graph, String[] similarToFields, String similarToText, Authorizations authorizations) { return new ElasticSearchSearchGraphQuery( getClient(), getConfig().getIndicesToQuery(), graph, similarToFields, similarToText, getAllPropertyDefinitions(), getConfig().getScoringStrategy(), this.nameSubstitutionStrategy, authorizations); }
Source:
<code>protected void parseObjectStoreEnvironmentElementAndEnrichOperation(final XMLExtendedStreamReader reader, ModelNode operation) throws XMLStreamException { final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case RELATIVE_TO: TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO.parseAndSetParameter(value, operation, reader); relativeToEncountered = true; break; case PATH: TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.parseAndSetParameter(value, operation, reader); if (!value.equals(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.getDefaultValue())) { <START> relativeToEncountered = true; <END> } break; default: throw unexpectedAttribute(reader, i); } } requireNoContent(reader); }</code><technical_language>this variable 'needsDefaultRelativeTo' a default of true L217 sets false? I a years a future colleague in SET is this hard time understanding a for PATH results in "relativeToEncountered = true". a minutes figure out a diff I understand goal of change well</technical_language>

Target:
protected void parseObjectStoreEnvironmentElementAndEnrichOperation(final XMLExtendedStreamReader reader, ModelNode operation) throws XMLStreamException { final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case RELATIVE_TO: TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO.parseAndSetParameter(value, operation, reader); needsDefaultRelativeTo = false; break; case PATH: TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.parseAndSetParameter(value, operation, reader); if (!value.equals(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.getDefaultValue())) { needsDefaultRelativeTo = false; } break; default: throw unexpectedAttribute(reader, i); } } requireNoContent(reader); }
Source:
<code>void link(Collection<org.onebusaway.gtfs.model.Stop> gtfsStops) { for (org.onebusaway.gtfs.model.Stop gtfsStop : gtfsStops) { if (gtfsStop.getLocationType() == 0 && gtfsStop.getParentStation() != null) { Stop otpStop = getOtpStop(gtfsStop); Station otpStation = getOtpParentStation(gtfsStop); if (otpStation == null) { LOG.warn("Parent station not found. Stop will not be linked to a parent" + " station.", gtfsStop.getParentStation(), gtfsStop.getId().getId()); <START> continue; <END> } otpStop.setParentStation(otpStation); otpStation.addChildStop(otpStop); } } }</code><technical_language>This a GraphBuilderAnnotation</technical_language>

Target:
void link(Collection<org.onebusaway.gtfs.model.Stop> gtfsStops) { for (org.onebusaway.gtfs.model.Stop gtfsStop : gtfsStops) { if (gtfsStop.getLocationType() == 0 && gtfsStop.getParentStation() != null) { Stop otpStop = getOtpStop(gtfsStop); Station otpStation = getOtpParentStation(gtfsStop); if (otpStation == null) { addBuilderAnnotation.addBuilderAnnotation( new ParentStationNotFoundAnnotation( otpStop, gtfsStop.getParentStation() ) ); continue; } otpStop.setParentStation(otpStation); otpStation.addChildStop(otpStop); } } }