auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void handleConnection(final Socket client) { logger.debug("Client connected", client.getRemoteSocketAddress()); try { <START> <END> LanguageServerImpl languageServer = Guice.createInjector(new RuntimeServerModule()) .getInstance(LanguageServerImpl.class); Launcher<LanguageClient> launcher = LSPLauncher.createServerLauncher(languageServer, client.getInputStream(), client.getOutputStream()); languageServer.connect(launcher.getRemoteProxy()); Future<?> future = launcher.startListening(); future.get(); } catch (IOException e) { logger.error("Error communicating with the LSP client", e); } catch (InterruptedException e) { } catch (ExecutionException e) { logger.error("Error running the Language Server", e); } logger.debug("Client disconnected", client.getRemoteSocketAddress()); }</code><technical_language>remove empty line</technical_language>

Target:
private void handleConnection(final Socket client) { logger.debug("Client connected", client.getRemoteSocketAddress()); try { LanguageServerImpl languageServer = Guice.createInjector(new RuntimeServerModule()) .getInstance(LanguageServerImpl.class); Launcher<LanguageClient> launcher = LSPLauncher.createServerLauncher(languageServer, client.getInputStream(), client.getOutputStream()); languageServer.connect(launcher.getRemoteProxy()); Future<?> future = launcher.startListening(); future.get(); } catch (IOException e) { logger.warn("Error communicating with LSP client {}", client.getRemoteSocketAddress()); } catch (InterruptedException e) { } catch (ExecutionException e) { logger.error("Error running the Language Server", e); } logger.debug("Client disconnected", client.getRemoteSocketAddress()); }
Source:
<code>public void awaitCompletion() { if (getQueue() == null) return; while (!getQueue().isEmpty()) { processInput(); <START> } <END> }</code><technical_language>In callContexts (aka callContextQueue) field case - if input queue is null empty, awaitCompletion() process input input queue is empty - then, awaitCompletion() call awaitTermination() thread pool For background, output input cases differ in that: - In output case, main thread awaits termination signal start of work of receiving output. - In input case, main thread awaits termination work of providing of input</technical_language>

Target:
public void awaitCompletion() { try { if (getQueue() == null) return; while (getQueue() != null && !getQueue().isEmpty()) { processInput(); } getCallerThreadPoolExecutor().awaitTermination(); } catch (Throwable throwable) { throw new RuntimeException("Error occurred while awaiting termination "+throwable.getMessage()); } }
Source:
<code>public void deactivate() { <START> getDiagramEventBroker().removeNotificationListener(hostView.eContainer(), this); <END> super.deactivate(); }</code><technical_language>"unsubscribe(hostView.eContainer);" instead</technical_language>

Target:
public void deactivate() { unsubscribe(hostView.eContainer()); super.deactivate(); }
Source:
<code>private Json getTags(CreateFreeIpaRequest source, Stack stack, String userCrn, String userName) { try { Map<String, String> userDefined = source.getTags(); if (userDefined == null) { userDefined = new HashMap<>(); } return new Json(new StackTags(userDefined, new HashMap<>(), getDefaultTags(stack, userCrn, userName))); } catch (Exception ignored) { <START> throw new BadRequestException("Failed to convert dynamic tags." + ignored.getMessage()); <END> } }</code><technical_language>conflict change</technical_language>

Target:
private Json getTags(CreateFreeIpaRequest source, Stack stack, String userCrn, String userName) { try { Map<String, String> userDefined = source.getTags(); if (userDefined == null) { userDefined = new HashMap<>(); } return new Json(new StackTags(userDefined, new HashMap<>(), getDefaultTags(stack, userCrn, userName))); } catch (Exception ignored) { throw new BadRequestException("Failed to convert dynamic tags: " + ignored.getMessage(), ignored); } }
Source:
<code>@Override protected boolean onDone(@Nullable Boolean res, @Nullable Throwable err, boolean cancel) { lock.lock(); try { if (!super.onDone(res, err, cancel)) return false; if (!(cctx.database() instanceof GridCacheDatabaseSharedManager)) return true; <START> ((GridCacheDatabaseSharedManager)cctx.database()).removeCheckpointListener(checkpointLsnr); <END> if (!isCancelled() && !isFailed()) return true; if (log.isInfoEnabled()) log.info("Cancelling File preloading [topVer=" + topVer + "]"); if (snapshotFut != null && !snapshotFut.isDone()) { if (log.isDebugEnabled()) log.debug("Cancelling snapshot creation [fut=" + snapshotFut + "]"); snapshotFut.cancel(); } for (GridFutureAdapter fut : futAssigns.values()) fut.onDone(); if (isFailed()) log.error("File preloading failed [topVer=" + topVer + "]", err); return true; } catch (IgniteCheckedException e) { if (err != null) e.addSuppressed(err); log.error("Failed to cancel File preloading.", e); } finally { lock.unlock(); } return false; }</code><technical_language>clarify kind of race is here? This piece of code executed once</technical_language>

Target:
@Override protected boolean onDone(@Nullable Boolean res, @Nullable Throwable err, boolean cancel) { lock.lock(); try { if (!super.onDone(res, err, cancel)) return false; if (!(cctx.database() instanceof GridCacheDatabaseSharedManager)) return true; restoreHnd.stop(); if (!isCancelled() && !isFailed()) return true; if (log.isInfoEnabled()) log.info("Cancelling File preloading [topVer=" + topVer + "]"); if (snapshotFut != null && !snapshotFut.isDone()) { if (log.isDebugEnabled()) log.debug("Cancelling snapshot creation [fut=" + snapshotFut + "]"); snapshotFut.cancel(); } for (GridFutureAdapter fut : futAssigns.values()) fut.onDone(); if (isFailed()) log.error("File preloading failed [topVer=" + topVer + "]", err); return true; } catch (IgniteCheckedException e) { if (err != null) e.addSuppressed(err); log.error("Failed to cancel File preloading.", e); } finally { lock.unlock(); } return false; }
Source:
<code>protected void onMethodInvocationFound(MethodInvocationTree mit) { <START> reportIssue(mit, "Validate argument is not coming from a user input. Sanitize it if this is the case."); <END> }</code><technical_language>RSPEC highlight: First: potentially corrupted data populated in JavaBean Second: method populating JavaBean</technical_language>

Target:
protected void onMethodInvocationFound(MethodInvocationTree mit) { reportIssue(mit, "Validate that properties are not set by user input. Sanitize it if this is the case."); }
Source:
<code>private MenuItem updateChangeMilestoneMenuItem() { Optional<GuiElement> item = listView.getSelectedItem(); if (item.isPresent()) { changeMilestoneMenuItem.setDisable(false); } else { <START> changeMilestoneMenuItem.setDisable(true); <END> } return changeMilestoneMenuItem; }</code><technical_language>item.isPresent() argument directly</technical_language>

Target:
private MenuItem updateChangeMilestoneMenuItem() { Optional<GuiElement> selectedItem = listView.getSelectedItem(); changeMilestoneMenuItem.setDisable(!selectedItem.isPresent()); return changeMilestoneMenuItem; }
Source:
<code>public void onPlayerDeath(PlayerDeathEvent e) { Player player = e.getEntity().getPlayer(); DamageCause dmgCause = player.getLastDamageCause().getCause(); <START> if (dmgCause != DamageCause.VOID || !Talisman.checkFor(e, SlimefunItems.TALISMAN_RESURRECTED)) return; <END> Location loc = e.getEntity().getPlayer().getBedSpawnLocation(); if (loc == null) loc = player.getLocation().getWorld().getSpawnLocation(); final Location respawnLocation = loc; Bukkit.getScheduler().runTaskLater(SlimefunPlugin.instance(), () -> { player.teleport(respawnLocation); }, 2); }</code><technical_language>Missing curvy brackets</technical_language>

Target:
public void onPlayerDeath(PlayerDeathEvent e) { Player player = e.getEntity(); DamageCause dmgCause = player.getLastDamageCause().getCause(); ItemStack talisman = Talisman.tryActivateAndGet(e, SlimefunItems.TALISMAN_RESURRECTED); if (dmgCause == DamageCause.VOID && talisman != null) { SlimefunPlugin.runSync(() -> PaperLib.teleportAsync(player, getSafeRespawnLocation(talisman, player)), 2); } }
Source:
<code>private static TempFile createSingleColumnMapFileWithNullValues(Type mapType, int rows) throws IOException, ReflectiveOperationException, SerDeException { @SuppressWarnings("deprecation") Serializer serde = new OrcSerde(); TempFile tempFile = new TempFile(); FileSinkOperator.RecordWriter writer = createOrcRecordWriter(tempFile.getFile(), ORC_12, CompressionKind.NONE, mapType); SettableStructObjectInspector objectInspector = createSettableStructObjectInspector("test", mapType); Object row = objectInspector.create(); StructField field = objectInspector.getAllStructFieldRefs().get(0); for (int i = 1; i <= rows; i++) { HashMap<Long, Long> map = new HashMap<Long, Long>(); for (int j = 1; j <= 8; j++) { Long value = Long.valueOf(j); map.put(value, value); } <START> <END> map.put(null, Long.valueOf(0)); map.put(Long.valueOf(0), null); objectInspector.setStructFieldData(row, field, map); Writable record = serde.serialize(row, objectInspector); writer.write(record); } writer.close(false); return tempFile; }</code><technical_language>HashMap<Long, Long> map = new HashMap<>();</technical_language>

Target:
private static TempFile createSingleColumnMapFileWithNullValues(Type mapType, int rows) throws IOException, ReflectiveOperationException, SerDeException { Serializer serde = new OrcSerde(); TempFile tempFile = new TempFile(); FileSinkOperator.RecordWriter writer = createOrcRecordWriter(tempFile.getFile(), ORC_12, CompressionKind.NONE, mapType); SettableStructObjectInspector objectInspector = createSettableStructObjectInspector("test", mapType); Object row = objectInspector.create(); StructField field = objectInspector.getAllStructFieldRefs().get(0); for (int i = 1; i <= rows; i++) { HashMap<Long, Long> map = new HashMap<>(); for (int j = 1; j <= 8; j++) { Long value = (long) j; map.put(value, value); } map.put(null, 0L); map.put(0L, null); objectInspector.setStructFieldData(row, field, map); Writable record = serde.serialize(row, objectInspector); writer.write(record); } writer.close(false); return tempFile; }
Source:
<code>private Object[] ensureCapacity(int capacity) { Object[] array = (Object[]) holder; if (capacity > array.length) { <START> array = Arrays.copyOf(array, Math.max(capacity, array.length * 2)); <END> holder = array; } return array; }</code><technical_language>A bit shift faster ? check for integer overflow issues</technical_language>

Target:
private Object[] ensureCapacity(int capacity) { Object[] array = (Object[]) holder; if (capacity > array.length) { int newCapacity = array.length << 1; if (newCapacity < 0) newCapacity = MAX_ARRAY_SIZE; if (capacity < 0 || capacity > newCapacity) { throw new OutOfMemoryError(); } array = Arrays.copyOf(array, Math.max(capacity, newCapacity)); holder = array; } return array; }
Source:
<code>public void update() { if (screenGrabber.isTakingScreenshot()) { <START> fullScale.set(renderingConfig.getScreenshotSize().getWidth(Display.getWidth()), <END> renderingConfig.getScreenshotSize().getHeight(Display.getHeight())); regenerateFbos(); wasTakingScreenshotLastFrame = true; } else { if (wasTakingScreenshotLastFrame) { updateFullScale(); regenerateFbos(); wasTakingScreenshotLastFrame = false; } } }</code><technical_language>Hmmm... this read well. Please rename set methods setDimensions</technical_language>

Target:
public void update() { if (!screenGrabber.isTakingScreenshot()) { if (wasTakingScreenshotLastFrame) { updateFullScale(); regenerateFbos(); wasTakingScreenshotLastFrame = false; } } else { ScreenshotSize screenshotSize = renderingConfig.getScreenshotSize(); fullScale.setDimensions(screenshotSize.getWidth(Display.getWidth()), screenshotSize.getHeight(Display.getHeight())); regenerateFbos(); wasTakingScreenshotLastFrame = true; } }
Source:
<code>public int anyUpdateQuery(QueryBuilder query) { <START> try (Connection c = ds.getConnection()) { <END> LOGGER.log(Level.FINEST, query.toString()); PreparedStatement stmt = query.toStatement(c); try { return stmt.executeUpdate(); } finally { stmt.close(); } } catch (SQLException ex) { throw new IllegalStateException("UpdateQuery Failed",ex); } }</code><technical_language>try-with-resources; move logging body is a slightly ordering, need resources</technical_language>

Target:
public int anyUpdateQuery(QueryBuilder query) { LOGGER.log(Level.FINEST, query.toString()); try (Connection c = ds.getConnection()) { try (PreparedStatement stmt = query.toStatement(c)) { return stmt.executeUpdate(); } } catch (SQLException ex) { throw new IllegalStateException("UpdateQuery Failed",ex); } }
Source:
<code><START> public void testNewTempDir() { <END> int CREATE_CNT = 2000; Collection<File> folders = new ArrayList<File>(CREATE_CNT); try { for (int i = 0; i < CREATE_CNT; i++) { try { folders.add(Os.newTempDir(OsTest.class)); } catch (IllegalStateException e) { log.warn("testNewTempDir failed at " + i + " iteration."); Exceptions.propagate(e); } } } finally { for (File folder : folders) { folder.delete(); } } }</code><technical_language>again, groups="Integration" file system is fast</technical_language>

Target:
public void testNewTempDir() { int CREATE_CNT = 5000; Collection<File> folders = new ArrayList<File>(CREATE_CNT); try { for (int i = 0; i < CREATE_CNT; i++) { try { folders.add(Os.newTempDir(OsTest.class)); } catch (IllegalStateException e) { log.warn("testNewTempDir failed at " + i + " iteration."); Exceptions.propagate(e); } } } finally { for (File folder : folders) { folder.delete(); } } }
Source:
<code><START> public static <END> boolean isValidFile(IFile file) { String fileExtension = file.getFileExtension(); if (!fileExtension.equals(JS_EXT)) { return false; } if (file.exists() && file.isAccessible()) { String filePath = file.getFullPath().toOSString(); if (filePath != null && !filePath.contains(NODE_MODULES_FOLDER) && !filePath.contains(BOWER_COMPONENTS_FOLDER)) { return true; } } return false; }</code><technical_language>need 'public static'? Is this method outside</technical_language>

Target:
private boolean isValidFile(IFile file) { String fileExtension = file.getFileExtension(); if (!fileExtension.equals(JS_EXT)) { return false; } if (file.exists() && file.isAccessible()) { String filePath = file.getFullPath().toOSString(); if (filePath != null && !filePath.contains(NODE_MODULES_FOLDER) && !filePath.contains(BOWER_COMPONENTS_FOLDER)) { return true; } } return false; }
Source:
<code>private void setParagraphConfig(InterpreterContext context) { String replName = context.getReplName(); if (StringUtils.equals(currentReplName, replName)) { currentReplName = context.getReplName(); needUpdateConfig = true; } if (needUpdateConfig) { needUpdateConfig = false; <START> if (currentReplName.equals("submarine") || currentReplName.isEmpty()) { <END> context.getConfig().put("editorHide", true); context.getConfig().put("title", false); } else { context.getConfig().put("editorHide", false); context.getConfig().put("title", true); } } }</code><technical_language>IIRC, interpreter name is configurable? eg. spark is spark2 in some config. hard code submarine</technical_language>

Target:
private void setParagraphConfig(InterpreterContext context) { context.getConfig().put("editorHide", true); context.getConfig().put("title", false); }
Source:
<code>protected IStatus run(IProgressMonitor monitor) { final List<EventSet> sets; synchronized (fQueue) { sets = new ArrayList<>(fQueue); fQueue.clear(); } <START> for (EventSet <END> set : sets) { if (!requiresExpressionEvaluation(set)) { dispatch(set); } else { Job job = new AbstractDispatchJob("JDI Expression Evaluation Event Dispatch") { @Override protected IStatus run(IProgressMonitor monitor) { dispatch(set); return Status.OK_STATUS; } }; job.setSystem(true); job.schedule(); } } return Status.OK_STATUS; }</code><technical_language>I add if(isShutdown()) return; right "for"</technical_language>

Target:
protected IStatus run(IProgressMonitor monitor) { final List<EventSet> sets; synchronized (fQueue) { sets = new ArrayList<>(fQueue); fQueue.clear(); } for (EventSet set : sets) { if (isShutdown()) { return Status.CANCEL_STATUS; } if (!requiresExpressionEvaluation(set)) { dispatch(set); } else { Job job = new AbstractDispatchJob("JDI Expression Evaluation Event Dispatch") { @Override protected IStatus run(IProgressMonitor monitor) { dispatch(set); return Status.OK_STATUS; } }; job.setSystem(true); job.schedule(); } } return Status.OK_STATUS; }
Source:
<code><START> public JdbcSecurityRealm(List<QueryConfiguration> queryConfiguration) { <END> this.queryConfiguration = queryConfiguration; }</code><technical_language>If a builder lets constructor visibility reduced prevent use</technical_language>

Target:
JdbcSecurityRealm(List<QueryConfiguration> queryConfiguration) { this.queryConfiguration = queryConfiguration; }
Source:
<code>public String generateName(Sample t) { if (!LimsUtils.isDetailedSample(t)) { throw new IllegalArgumentException("Can only generate an alias for detailed samples"); } SampleAdditionalInfo detailed = (SampleAdditionalInfo) t; for (SampleAdditionalInfo parent = detailed.getParent(); parent != null; parent = parent.getParent()) { <START> if (isAliquotSample(parent) || isStockSample(parent)) { <END> return parent.getAlias() + getSiblingTag(detailed); } if (isTissueSample(parent)) { return parent.getAlias() + getSiblingTag(detailed); } if (isIdentitySample(parent)) { if (!isTissueSample(detailed)) throw new IllegalArgumentException("Missing parent tissue"); return generateTissueAlias((SampleTissue) detailed, (Identity) parent); } } throw new IllegalArgumentException("Cannot generate alias for Identities"); }</code><technical_language>earlier change correct. condition if (isAliquotSample(parent)). In case direct parent is a stock, for alias derivation purposes - aliquot part is appended tissue's alias</technical_language>

Target:
public String generateName(Sample t) { if (!LimsUtils.isDetailedSample(t)) { throw new IllegalArgumentException("Can only generate an alias for detailed samples"); } SampleAdditionalInfo detailed = (SampleAdditionalInfo) t; for (SampleAdditionalInfo parent = (SampleAdditionalInfo) detailed.getParent(); parent != null; parent = (SampleAdditionalInfo) parent.getParent()) { if (isAliquotSample(parent)) { return parent.getAlias() + getSiblingTag(detailed); } if (isTissueSample(parent)) { return parent.getAlias() + getSiblingTag(detailed); } if (isIdentitySample(parent)) { if (!isTissueSample(detailed)) throw new IllegalArgumentException("Missing parent tissue"); return generateTissueAlias((SampleTissue) detailed, (Identity) parent); } } throw new IllegalArgumentException("Cannot generate alias for Identities"); }
Source:
<code>private JobContext prepareJobContext(String instance) { <START> Set<Integer> _taskPartitionSet; Map<Integer, TaskPartitionState> _taskPartitionStateMap; Map<Integer, String> _partitionToTaskIDMap; Map<Integer, String> _taskToInstanceMap; _taskPartitionSet = new HashSet<>(); _taskPartitionStateMap = new HashMap<>(); _partitionToTaskIDMap = new HashMap<>(); _taskToInstanceMap = new HashMap<>(); <END> _taskPartitionSet.add(0); _taskPartitionStateMap.put(0, TaskPartitionState.RUNNING); _partitionToTaskIDMap.put(0, "0"); String someInstance = INSTANCE_PREFIX + 0; _taskToInstanceMap.put(0, someInstance); ZNRecord record = new ZNRecord(JOB_NAME); JobContext jobContext = new JobContext(record); jobContext.setStartTime(0L); jobContext.setName(JOB_NAME); jobContext.setStartTime(0L); jobContext.setPartitionState(0, TaskPartitionState.RUNNING); jobContext.setPartitionTarget(0, instance); jobContext.setPartitionTarget(0, TARGET_RESOURCES + "_0"); return jobContext; }</code><technical_language>do local variables underscores</technical_language>

Target:
private JobContext prepareJobContext(String instance) { ZNRecord record = new ZNRecord(JOB_NAME); JobContext jobContext = new JobContext(record); jobContext.setStartTime(0L); jobContext.setName(JOB_NAME); jobContext.setStartTime(0L); jobContext.setPartitionState(0, TaskPartitionState.RUNNING); jobContext.setPartitionTarget(0, instance); jobContext.setPartitionTarget(0, TARGET_RESOURCES + "_0"); return jobContext; }
Source:
<code>public void onDeviceOnLine() { this.logger.info("ISY is now online"); UDProxyDevice device = getDevice(); if (device == null) { return; } if (this.logger.isDebugEnabled()) { this.logger.debug("Supported controls:"); try { for (UDControl control : getControls().values()) { this.logger.debug(String.format(" %s, %s %s", control.name, control.desc, control.isNumeric && control.numericUnit != null ? control.numericUnit : "")); if (control.actions != null && !control.actions.isEmpty()) { for (UDAction action : control.actions.values()) { this.logger.debug(String.format(" %s %s %s", action.name, action.label, action.desc != null ? action.desc : "")); } } } } catch (NoDeviceException e) { this.logger.warn("Failed to get device", e); } } if (device.isSecurityEnabled() || device.securityLevel > UPnPSecurity.NO_SECURITY) { if (device.isAuthenticated && device.isOnline) { return; } try { this.logger.info("Authenticating..."); if (!authenticate(this.user, this.password)) { this.logger.warn("Authentication failed"); return; } else { this.logger.info("Authenticated"); } } catch (NoDeviceException ne) { <START> this.logger.error("No device", ne); <END> } } else { device.subscribeToEvents(true); } }</code><technical_language>This a warn, error</technical_language>

Target:
public void onDeviceOnLine() { this.logger.info("ISY is now online"); UDProxyDevice device = getDevice(); if (device == null) { return; } if (this.logger.isDebugEnabled()) { this.logger.debug("Supported controls:"); try { for (UDControl control : getControls().values()) { this.logger.debug(String.format(" %s, %s %s", control.name, control.desc, control.isNumeric && control.numericUnit != null ? control.numericUnit : "")); if (control.actions != null && !control.actions.isEmpty()) { for (UDAction action : control.actions.values()) { this.logger.debug(String.format(" %s %s %s", action.name, action.label, action.desc != null ? action.desc : "")); } } } } catch (NoDeviceException e) { this.logger.warn("Failed to get device", e); } } if (device.isSecurityEnabled() || device.securityLevel > UPnPSecurity.NO_SECURITY) { if (device.isAuthenticated && device.isOnline) { return; } try { this.logger.info("Authenticating..."); if (!authenticate(this.user, this.password)) { this.logger.warn("Authentication failed"); return; } else { this.logger.info("Authenticated"); } } catch (NoDeviceException ne) { this.logger.warn("No device", ne); } } else { device.subscribeToEvents(true); } }
Source:
<code>public void removeAccount(Account account) { notNull(account, "account"); try { restTemplate.delete(account.getUri()); } catch (GoodDataException | RestClientException e) { <START> throw new GoodDataException("Unable to create account", e); <END> } }</code><technical_language>create</technical_language>

Target:
public void removeAccount(Account account) { notNull(account, "account"); try { restTemplate.delete(account.getUri()); } catch (GoodDataRestException e) { if (HttpStatus.NOT_FOUND.value() == e.getStatusCode()) { throw new AccountNotFoundException(account.getUri(), e); } else { throw e; } } catch (GoodDataException e) { throw new GoodDataException("Unable to remove account", e); } }
Source:
<code>void start() throws Exception { advertisedGcTimetamp = LongUtil.fromByteArray(curator.getData().forPath(ZookeeperPath.ORACLE_GC_TIMESTAMP)); TimerTask tt = new TimerTask() { @Override public void run() { try { updateGcTimestamp(); } catch (Exception e) { log.warn("Failed to update GC timestamp.", e); } } }; TimerTask logTask = new TimerTask() { @Override public void run() { <START> log.warn("Loging the current timestamp: ", currentTs); <END> } }; timer = new Timer("Oracle gc update timer", true); long updatePeriod = env.getConfiguration().getLong(FluoConfigurationImpl.ZK_UPDATE_PERIOD_PROP, FluoConfigurationImpl.ZK_UPDATE_PERIOD_MS_DEFAULT); long nextPeriod = 5 * 60 * 1000L; timer.schedule(tt, updatePeriod, updatePeriod); timer.schedule(logTask, nextPeriod, nextPeriod); }</code><technical_language>simplified log.warn("Current timestamp: {}", currentTs);</technical_language>

Target:
void start() throws Exception { advertisedGcTimetamp = LongUtil.fromByteArray(curator.getData().forPath(ZookeeperPath.ORACLE_GC_TIMESTAMP)); TimerTask tt = new TimerTask() { @Override public void run() { try { updateGcTimestamp(); } catch (Exception e) { log.warn("Failed to update GC timestamp.", e); } } }; TimerTask logTask = new TimerTask() { @Override public void run() { log.info("Current timestamp: {}", currentTs); } }; timer = new Timer("Oracle gc update timer", true); long updatePeriod = env.getConfiguration().getLong(FluoConfigurationImpl.ZK_UPDATE_PERIOD_PROP, FluoConfigurationImpl.ZK_UPDATE_PERIOD_MS_DEFAULT); long nextPeriod = 5 * 60 * 1000L; timer.schedule(tt, updatePeriod, updatePeriod); timer.schedule(logTask, 0L, nextPeriod); }
Source:
<code><START> static public void resetLevel() <END> { level.remove(); }</code><technical_language>above, skip public</technical_language>

Target:
static void resetLevel() { level.remove(); }
Source:
<code>public BlockRegion intersection(BlockRegion other, BlockRegion dest) { <START> dest.minX = Math.max(minX, other.minX); <END> dest.minY = Math.max(minY, other.minY); dest.minZ = Math.max(minZ, other.minZ); dest.maxX = Math.min(maxX, other.maxX); dest.maxY = Math.min(maxY, other.maxY); dest.maxZ = Math.min(maxZ, other.maxZ); return dest; }</code><technical_language>Math.min/max() in unionBlock()</technical_language>

Target:
public BlockRegion intersection(BlockRegion other, BlockRegion dest) { this.aabb.intersection(other.aabb, dest.aabb); return dest; }
Source:
<code>public Guid getEntityGuid(Object entity) { if (entity instanceof BusinessEntity) { Object id = ((BusinessEntity<?>) entity).getId(); if (id instanceof Guid) { return (Guid) id; } } if (entity instanceof VmPool) { return ((VmPool) entity).getVmPoolId(); } else if (entity instanceof DbUser) { return ((DbUser) entity).getId(); } else if (entity instanceof DbGroup) { return ((DbGroup) entity).getId(); } else if (entity instanceof Job) { <START> return ((Job) entity).getId(); <END> } else { return Guid.Empty; } }</code><technical_language>do need frontend changes plan expose Jobs in webadmin view other entities (hosts, VMs, ...)</technical_language>

Target:
public Guid getEntityGuid(Object entity) { if (entity instanceof BusinessEntity) { Object id = ((BusinessEntity<?>) entity).getId(); if (id instanceof Guid) { return (Guid) id; } } if (entity instanceof VmPool) { return ((VmPool) entity).getVmPoolId(); } else if (entity instanceof DbUser) { return ((DbUser) entity).getId(); } else if (entity instanceof DbGroup) { return ((DbGroup) entity).getId(); } else { return Guid.Empty; } }
Source:
<code>public List<PatientProgram> getPatientProgramByAttributeNameAndValue(String attributeName, String attributeValue) { FlushMode flushMode = sessionFactory.getCurrentSession().getFlushMode(); sessionFactory.getCurrentSession().setFlushMode(FlushMode.MANUAL); Query query; try { query = sessionFactory.getCurrentSession().createQuery( <START> "SELECT bpp FROM BahmniPatientProgram bpp " + <END> "INNER JOIN bpp.attributes attr " + "INNER JOIN attr.attributeType attr_type " + "WHERE attr.valueReference = :attributeValue " + "AND attr_type.name = :attributeName " + "AND bpp.voided = 0") .setParameter("attributeName", attributeName) .setParameter("attributeValue", attributeValue); return query.list(); } finally { sessionFactory.getCurrentSession().setFlushMode(flushMode); } }</code><technical_language>@brayoh This query calls Bahmni specific classes</technical_language>

Target:
public List<PatientProgram> getPatientProgramByAttributeNameAndValue(String attributeName, String attributeValue) { FlushMode flushMode = sessionFactory.getCurrentSession().getFlushMode(); sessionFactory.getCurrentSession().setFlushMode(FlushMode.MANUAL); Query query; try { query = sessionFactory.getCurrentSession().createQuery( "SELECT pp FROM patient_program pp " + "INNER JOIN pp.attributes attr " + "INNER JOIN attr.attributeType attr_type " + "WHERE attr.valueReference = :attributeValue " + "AND attr_type.name = :attributeName " + "AND pp.voided = 0") .setParameter("attributeName", attributeName) .setParameter("attributeValue", attributeValue); return query.list(); } finally { sessionFactory.getCurrentSession().setFlushMode(flushMode); } }
Source:
<code>public List<Tree.Kind> nodesToVisit() { <START> return ImmutableList.of(Tree.Kind.ANNOTATION); <END> }</code><technical_language>Collections.singletonList is a bit better. Avoid depending of guava in this case</technical_language>

Target:
public List<Tree.Kind> nodesToVisit() { return Collections.singletonList(Tree.Kind.ANNOTATION); }
Source:
<code>public void getUserMetadata(User user) { try { GHMyself myself = github.getMyself(); User.Profile profile = new User.Profile(); profile.name = myself.getName(); profile.email = myself.getEmail(); profile.avatarURL = myself.getAvatarUrl(); profile.bio = myself.getBlog(); profile.location = myself.getLocation(); profile.company = myself.getCompany(); profile.username = myself.getLogin(); Map<String, User.Profile> userProfile = user.getUserProfiles(); userProfile.put(TokenType.GITHUB_COM.toString(), profile); user.setAvatarUrl(myself.getAvatarUrl()); } catch (IOException ex) { <START> LOG.info("Could not find user information for user " + user.getUsername()); <END> } }</code><technical_language>this, a mission log exceptions I this LOG.error</technical_language>

Target:
public void getUserMetadata(User user) { try { GHMyself myself = github.getMyself(); User.Profile profile = new User.Profile(); profile.name = myself.getName(); profile.email = myself.getEmail(); profile.avatarURL = myself.getAvatarUrl(); profile.bio = myself.getBlog(); profile.location = myself.getLocation(); profile.company = myself.getCompany(); profile.username = myself.getLogin(); Map<String, User.Profile> userProfile = user.getUserProfiles(); userProfile.put(TokenType.GITHUB_COM.toString(), profile); user.setAvatarUrl(myself.getAvatarUrl()); } catch (IOException ex) { LOG.info("Could not find user information for user " + user.getUsername(), ex); } }
Source:
<code>public static GiraphMasterScenarioWrapper readMasterScenarioFromTrace(String jobId, long superstepNo, DebugTrace debugTrace) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException { if (!EnumSet.of(DebugTrace.MASTER_ALL, DebugTrace.MASTER_EXCEPTION, DebugTrace.MASTER_REGULAR).contains(debugTrace)) { throw new IllegalArgumentException( "DebugTrace type is invalid. Use REGULAR, EXCEPTION or ALL_VERTICES"); } FileSystem fs = ServerUtils.getFileSystem(); GiraphMasterScenarioWrapper giraphScenarioWrapper = new GiraphMasterScenarioWrapper(); if (debugTrace == DebugTrace.MASTER_REGULAR || debugTrace == DebugTrace.MASTER_ALL) { String traceFilePath = ServerUtils.getTraceFilePath(jobId, superstepNo, DebugTrace.MASTER_REGULAR, null ); try { giraphScenarioWrapper.loadFromHDFS(fs, traceFilePath); return giraphScenarioWrapper; } catch(FileNotFoundException e) { if ( debugTrace == DebugTrace.MASTER_ALL) { Debug.println("readMasterScenarioFromTrace", "Regular file not found. Ignoring."); } else <START> { <END> throw e; } } } String traceFilePath = ServerUtils.getTraceFilePath(jobId, superstepNo, DebugTrace.MASTER_EXCEPTION, null ); giraphScenarioWrapper.loadFromHDFS(fs, traceFilePath); return giraphScenarioWrapper; }</code><technical_language>move { next else</technical_language>

Target:
public static GiraphMasterScenarioWrapper readMasterScenarioFromTrace(String jobId, long superstepNo, DebugTrace debugTrace) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException { if (!EnumSet.of(DebugTrace.MASTER_ALL, DebugTrace.MASTER_EXCEPTION, DebugTrace.MASTER_REGULAR).contains(debugTrace)) { throw new IllegalArgumentException( "DebugTrace type is invalid. Use REGULAR, EXCEPTION or ALL_VERTICES"); } FileSystem fs = ServerUtils.getFileSystem(); GiraphMasterScenarioWrapper giraphScenarioWrapper = new GiraphMasterScenarioWrapper(); if (debugTrace == DebugTrace.MASTER_REGULAR || debugTrace == DebugTrace.MASTER_ALL) { String traceFilePath = ServerUtils.getMasterTraceFilePath(jobId, superstepNo, DebugTrace.MASTER_REGULAR); try { giraphScenarioWrapper.loadFromHDFS(fs, traceFilePath); return giraphScenarioWrapper; } catch(FileNotFoundException e) { if ( debugTrace == DebugTrace.MASTER_ALL) { Debug.println("readMasterScenarioFromTrace", "Regular file not found. Ignoring."); } else { throw e; } } } String traceFilePath = ServerUtils.getMasterTraceFilePath(jobId, superstepNo, DebugTrace.MASTER_EXCEPTION); giraphScenarioWrapper.loadFromHDFS(fs, traceFilePath); return giraphScenarioWrapper; }
Source:
<code>public Iterable<Directive> process(final XML xml) throws IOException { final Shell shell = new TalkShells(xml).get(); final String dir = xml.xpath("/talk/daemon/dir/text()").get(0); final int exit = new Script("end.sh").exec(xml); final Directives dirs = new Directives(); if (exit == 0) { Logger.info( this, "the daemon is still running in %s (%s)", dir, xml.xpath("/talk/@name").get(0) ); } else { <START> final XML node = xml.node("/p/entry[@key='assets']/entry"); <END> boolean deprecate = false; if(EndsDaemon.IMAGE.equals(node.xpath(" deprecate=true; } dirs.append(this.end(shell, dir,deprecate)); } return dirs; }</code><technical_language>@sebing compilation problems</technical_language>

Target:
public Iterable<Directive> process(final XML xml) throws IOException { final Shell shell = new TalkShells(xml).get(); final String dir = xml.xpath("/talk/daemon/dir/text()").get(0); final int exit = new Script("end.sh").exec(xml); final Directives dirs = new Directives(); if (exit == 0) { Logger.info( this, "the daemon is still running in %s (%s)", dir, xml.xpath("/talk/@name").get(0) ); } else { dirs.append(this.end(shell, dir)); } return dirs; }
Source:
<code>private void loadNormalizationIds(final File bpmFile) { IlluminaBPMFile illuminaBPMFile; try (final DataInputStream inputStream = new DataInputStream(new FileInputStream(bpmFile))) { <START> illuminaBPMFile = new IlluminaBPMFile(inputStream); <END> allNormalizationIds = illuminaBPMFile.getAllNormalizationIds(); uniqueNormalizationIds = illuminaBPMFile.getUniqueNormalizationIds(); } catch (IOException e) { throw new PicardException("Error reading bpm file '" + bpmFile.getAbsolutePath() + "'", e); } }</code><technical_language>suggestion illuminaBPMFile = new IlluminaBPMFile(bpmFile); IlluminaBPMFile autocloseable</technical_language>

Target:
private void loadNormalizationIds(final File bpmFile) { try (IlluminaBPMFile illuminaBPMFile = new IlluminaBPMFile(bpmFile)) { allNormalizationIds = illuminaBPMFile.getAllNormalizationIds(); uniqueNormalizationIds = illuminaBPMFile.getUniqueNormalizationIds(); } catch (IOException e) { throw new PicardException("Error reading bpm file '" + bpmFile.getAbsolutePath() + "'", e); } }
Source:
<code>public ListFactoryBean ldapPasswordSynchronizationAuthenticationPostProcessorListFactoryBean() { val bean = new ListFactoryBean() { @Override protected void destroyInstance(final List list) { list.forEach(Unchecked.consumer(postProcessor -> { ((DisposableBean) postProcessor).destroy(); })); } }; <START> bean.setSourceList(new ArrayList()); <END> return bean; }</code><technical_language>suggestion bean.setSourceList(new ArrayList<>());</technical_language>

Target:
public ListFactoryBean ldapPasswordSynchronizationAuthenticationPostProcessorListFactoryBean() { val bean = new ListFactoryBean() { @Override protected void destroyInstance(final List list) { list.forEach(Unchecked.consumer(postProcessor -> ((DisposableBean) postProcessor).destroy() )); } }; bean.setSourceList(new ArrayList<>()); return bean; }
Source:
<code>private void startTracingContainersStartup(Pod pod) { for (Container container : pod.getSpec().getContainers()) { String machineName = Names.machineName(pod, container); machineStartupTraces.put( machineName, tracer <START> .buildSpan("container-create") <END> .asChildOf(tracer.activeSpan()) .withTag(CheTags.MACHINE_NAME.getKey(), machineName) .start()); } }</code><technical_language>container creation machine starting includes container creation, machine bootstrapping, server checking</technical_language>

Target:
private void startTracingContainersStartup(Pod pod) { if (tracer == null) { return; } for (Container container : pod.getSpec().getContainers()) { String machineName = Names.machineName(pod, container); machineStartupTraces.put( machineName, tracer .buildSpan("machine.create") .asChildOf(tracer.activeSpan()) .withTag(TracingTags.MACHINE_NAME.getKey(), machineName) .start()); } }
Source:
<code>public Post() { <START> this.postContent = randomAlphanumeric(100); <END> }</code><technical_language>set in field declaration</technical_language>

Target:
public Post()
Source:
<code>public DownloadTracker(Tracker tracker, TrackMe baseTrackMe) { mTracker = tracker; mBaseTrackMe = baseTrackMe; Piwik piwik = tracker.getPiwik(); mPreferences = piwik.getSharedPreferences(); mContext = piwik.getContext(); mPackageName = mContext.getPackageName(); mPackMan = mContext.getPackageManager(); try { PackageInfo pkgInfo = mPackMan.getPackageInfo(mContext.getPackageName(), 0); mVersion = Integer.toString(pkgInfo.versionCode); mName = pkgInfo.packageName; } <START> catch (PackageManager.NameNotFoundException e) { <END> e.printStackTrace(); } }</code><technical_language>new line here</technical_language>

Target:
public DownloadTracker(Tracker tracker, TrackMe baseTrackMe) { mTracker = tracker; mBaseTrackMe = baseTrackMe; Piwik piwik = tracker.getPiwik(); mPreferences = piwik.getSharedPreferences(); mContext = piwik.getContext(); mPackageName = mContext.getPackageName(); mPackMan = mContext.getPackageManager(); try { mPkgInfo = mPackMan.getPackageInfo(mPackageName, 0); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } }
Source:
<code>protected void decorateRequired() { if (decoration != null) { <START> throw new IllegalStateException(); <END> } decoration = new ControlDecoration(getLabelControl(), SWT.TOP | SWT.RIGHT); decoration.setDescriptionText(Messages.AbstractAttributeEditor_AttributeIsRequired); decoration.setMarginWidth(0); Image image = FieldDecorationRegistry.getDefault() .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR) .getImage(); decoration.setImage(image); getLabelControl().addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { if (decoration != null) { decoration.dispose(); decoration = null; } } }); }</code><technical_language>this is called decorate(), assume is called decoration is non-null</technical_language>

Target:
protected void decorateRequired() { if (decoration == null) { decoration = new ControlDecoration(getLabelControl(), SWT.TOP | SWT.RIGHT); decoration.setDescriptionText(Messages.AbstractAttributeEditor_AttributeIsRequired); decoration.setMarginWidth(0); Image image = FieldDecorationRegistry.getDefault() .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR) .getImage(); decoration.setImage(image); getLabelControl().addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { if (decoration != null) { decoration.dispose(); decoration = null; } } }); } }
Source:
<code>public boolean validate() { <START> if(getChoiceGroupNone().getEntity() && !getChoiceGroupTotal().getEntity() && !getChoiceGroupReadWrite().getEntity() ) { <END> return true; } validateValue(getTotal(), (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(maxTotal)); validateValue(getRead(), (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(maxRead)); validateValue(getWrite(), (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(maxWrite)); if (getTotal().getEntity() != null && (getRead().getEntity() != null || getWrite().getEntity() != null)) { setErrorMsg(getTotal()); setErrorMsg(getRead()); setErrorMsg(getWrite()); } setIsValid(getTotal().getIsValid() && getRead().getIsValid() && getWrite().getIsValid()); return getIsValid(); }</code><technical_language>check for none.</technical_language>

Target:
public boolean validate() { if(getChoiceGroupNone().getEntity()) { return true; } validateValue(getTotal(), (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(maxTotal)); validateValue(getRead(), (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(maxRead)); validateValue(getWrite(), (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(maxWrite)); if (getTotal().getEntity() != null && (getRead().getEntity() != null || getWrite().getEntity() != null)) { setErrorMsg(getTotal()); setErrorMsg(getRead()); setErrorMsg(getWrite()); } setIsValid(getTotal().getIsValid() && getRead().getIsValid() && getWrite().getIsValid()); return getIsValid(); }
Source:
<code>public final void invoke() throws Exception { try { beforeInvoke(); if (canceled) { throw new CancelTaskException(); } runMailboxLoop(); if (canceled) { throw new CancelTaskException(); } afterInvoke(); <START> } <END> catch (Exception invokeException) { LOG.error("Invoke Error", invokeException); try { cleanUpInvoke(); } catch (Throwable cleanUpException) { throw (Exception) ExceptionUtils.firstOrSuppressed(cleanUpException, invokeException); } throw invokeException; } cleanUpInvoke(); }</code><technical_language>This method disposes operators throw encountered errors (not log). get a log this: closing operator x closing operator y Invoke Error operator y dispose error message IMO is confusing</technical_language>

Target:
public final void invoke() throws Exception { try { beforeInvoke(); if (canceled) { throw new CancelTaskException(); } runMailboxLoop(); if (canceled) { throw new CancelTaskException(); } afterInvoke(); } catch (Exception invokeException) { try { cleanUpInvoke(); } catch (Throwable cleanUpException) { Throwable throwable = ExceptionUtils.firstOrSuppressed(cleanUpException, invokeException); throw (throwable instanceof Exception ? (Exception) throwable : new Exception(throwable)); } throw invokeException; } cleanUpInvoke(); }
Source:
<code>private void doHandle(Request request, HttpServletResponse httpServletResponse) throws IOException { String queries = request.getUri().getQuery(); if (s_logger.isTraceEnabled()) s_logger.trace("Handle WebSocket Console request " + queries); String[] content = new String[]{"<html>", "<head>", "<script type=\"text/javascript\" language=\"javascript\" src=\"/resource/js/jquery.js\"></script>", "<script> \n" + " $(function(){\n" + " $(\"#vncpage\").load(\"/resource/noVNC/novnc.html\"); \n" + " });\n" + " </script>", " <body> \n" + " <div id=\"vncpage\"></div>\n" + " </body> ", "</head>", "</html>"}; StringBuffer sb = new StringBuffer(); for (int i = 0; i < content.length; i++) <START> sb.append(content[i]); <END> sendResponse(httpServletResponse, "text/html", sb.toString()); }</code><technical_language>this string stored a static file in resource consume load this file a resource (from jar)? In this code, converting array a stringbuffer a string, this change (1) read file, (2) string</technical_language>

Target:
private void doHandle(Request request, HttpServletResponse httpServletResponse) throws IOException { String queries = request.getHttpURI().getQuery(); if (s_logger.isTraceEnabled()) { s_logger.trace("Handle WebSocket Console request " + queries); } if (queries != null) { Map<String, String> queryMap = ConsoleProxyHttpHandlerHelper.getQueryMap(queries); String host = queryMap.get("host"); String portStr = queryMap.get("port"); String tag = queryMap.get("tag"); ConsoleProxyClientParam param = new ConsoleProxyClientParam(); param.setClientHostAddress(host); param.setClientHostPort(NumbersUtil.parseInt(portStr, 80)); param.setClientTag(tag); ConsoleProxy.removeViewer(param); } sendResponse(httpServletResponse, "text/html", getFile("noVNC/start.html")); }
Source:
<code>public void onWritePossible() throws IOException { while (output.isReady()) { if (writeComplete()) { asyncContext.complete(); return; } if (page == null) { page = serializedPages.poll(); int bufferPosition = 0; slice.setInt(bufferPosition, page.getPositionCount()); bufferPosition += SIZE_OF_INT; slice.setByte(bufferPosition, page.getPageCodecMarkers()); bufferPosition += SIZE_OF_BYTE; slice.setInt(bufferPosition, page.getUncompressedSizeInBytes()); bufferPosition += SIZE_OF_INT; slice.setInt(bufferPosition, page.getSizeInBytes()); bufferPosition += SIZE_OF_INT; <START> output.write(buffer, 0, bufferPosition); <END> } else { Object base = page.getSlice().getBase(); if (base instanceof byte[]) { output.write((byte[]) base, (int) ((page.getSlice().getAddress() - ARRAY_BYTE_BASE_OFFSET)), page.getSizeInBytes()); } else { output.write(page.getSlice().getBytes(), 0, page.getSizeInBytes()); } page = null; } } }</code><technical_language>is obvious operations slice affect buffer. output.write(slice.byteArray(), 0, bufferPosition);</technical_language>

Target:
public void onWritePossible() throws IOException { while (output.isReady()) { if (writeComplete()) { asyncContext.complete(); return; } if (page == null) { page = serializedPages.poll(); int bufferPosition = 0; slice.setInt(bufferPosition, page.getPositionCount()); bufferPosition += SIZE_OF_INT; slice.setByte(bufferPosition, page.getPageCodecMarkers()); bufferPosition += SIZE_OF_BYTE; slice.setInt(bufferPosition, page.getUncompressedSizeInBytes()); bufferPosition += SIZE_OF_INT; slice.setInt(bufferPosition, page.getSizeInBytes()); bufferPosition += SIZE_OF_INT; output.write(slice.byteArray(), 0, bufferPosition); } else { Object base = page.getSlice().getBase(); checkArgument(base instanceof byte[], "serialization type only supports byte[]"); output.write((byte[]) base, (int) ((page.getSlice().getAddress() - ARRAY_BYTE_BASE_OFFSET)), page.getSizeInBytes()); page = null; } } }
Source:
<code>void completePlayerSetup(boolean asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaPlayer); <START> PlayerDomain domain1 = new PlayerDomain(domain); <END> Options options = new Options.Builder().setShowPromoImage(false).setUseExoPlayer(true).build(); player = new OoyalaPlayer(pcode, domain1, options); SkinOptions skinOptions = new SkinOptions.Builder().build(); controller = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); controller.addObserver(this); player.addObserver(this); OoyalaIMAManager imaManager = new OoyalaIMAManager(player, skinLayout); imaManager.setAdUrlOverride("<LINK_0>[referrer_url]&description_url=[description_url]&correlator=[timestamp]"); if (player.setEmbedCode(embedCode)) { } }</code><technical_language>call variable playerDomain instead of domain1</technical_language>

Target:
void completePlayerSetup(boolean asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaPlayer); PlayerDomain playerDomain = new PlayerDomain(domain); Options options = new Options.Builder().setShowPromoImage(false).setUseExoPlayer(true).build(); player = new OoyalaPlayer(pcode, playerDomain, options); SkinOptions skinOptions = new SkinOptions.Builder().build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); OoyalaIMAManager imaManager = new OoyalaIMAManager(player, skinLayout); imaManager.setAdUrlOverride("<LINK_0>[referrer_url]&description_url=[description_url]&correlator=[timestamp]"); if (player.setEmbedCode(embedCode)) { } }
Source:
<code>private String readFile(File directory, String fileName) throws IOException { byte[] content = IO.readFully(new File(directory, fileName)); return RawParseUtils.decode(content, 0, RawParseUtils <START> .nextLF(content, 0) - 1); <END> }</code><technical_language>Nak. This strips line. want, is it? trim trailing LF(s), use: int end = content.length; while (0 < end && content[end - 1] == '\n') end--; return RawParseUtils.decode(content, 0, end);</technical_language>

Target:
private String readFile(File directory, String fileName) throws IOException { byte[] content = IO.readFully(new File(directory, fileName)); int end = content.length; while (0 < end && content[end - 1] == '\n') end--; return RawParseUtils.decode(content, 0, end); }