auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void monitorProgress(Connection connection, Long rowId) throws SQLException { addMonitorShutdownHook(rowId); long rowCount = getTotalRowCount(connection, rowId); long initialRowCount, insertedRowsCount; initialRowCount = getInsertedRowsCount(connection, rowId); Long startedTimeMillis = null; insertedRowsCount = initialRowCount; while ( !isComplete ) { if ( insertedRowsCount < rowCount ) { if ( startedTimeMillis == null && insertedRowsCount > 0 ) { startedTimeMillis = System.currentTimeMillis(); } insertedRowsCount = getInsertedRowsCount(connection, rowId); } <START> isComplete = getIsComplete(connection, rowId); <END> displayProgress(rowCount, insertedRowsCount, initialRowCount, startedTimeMillis); try { Thread.sleep(UPDATE_PERIOD_MILLIS); } catch ( InterruptedException e) } displayLine(""); }</code><technical_language>leave this loop rowId is removed</technical_language>

Target:
private void monitorProgress(Connection connection, Long rowId) throws SQLException, MissingBootstrapRowException { addMonitorShutdownHook(rowId); long rowCount = getTotalRowCount(connection, rowId); long initialRowCount, insertedRowsCount; initialRowCount = getInsertedRowsCount(connection, rowId); Long startedTimeMillis = null; insertedRowsCount = initialRowCount; while ( !isComplete ) { if ( insertedRowsCount < rowCount ) { if ( startedTimeMillis == null && insertedRowsCount > 0 ) { startedTimeMillis = System.currentTimeMillis(); } insertedRowsCount = getInsertedRowsCount(connection, rowId); } isComplete = getIsComplete(connection, rowId); displayProgress(rowCount, insertedRowsCount, initialRowCount, startedTimeMillis); try { Thread.sleep(UPDATE_PERIOD_MILLIS); } catch ( InterruptedException e) } displayLine(""); }
Source:
<code>private void releaseYoutubePlayer(){ <START> try { <END> if (youTubePlayer != null){ youTubePlayer.release(); youTubePlayer = null; } } catch (IllegalStateException ex) { logger.error(ex); } }</code><technical_language>is need of try-catch block</technical_language>

Target:
private void releaseYoutubePlayer() { if (youTubePlayer != null) { youTubePlayer.release(); youTubePlayer = null; } }
Source:
<code>public boolean equals(Object obj) { <START> if (obj == null) <END> return false; if (!(obj instanceof XBee64BitAddress)) return false; XBee64BitAddress addr = (XBee64BitAddress)obj; return Arrays.equals(addr.getValue(), getValue()); }</code><technical_language>check for null is needed instanceof operator: "When instanceof operator, in mind null is instance of anything." (<LINK_0></technical_language>

Target:
public boolean equals(Object obj) { if (!(obj instanceof XBee64BitAddress)) return false; XBee64BitAddress addr = (XBee64BitAddress)obj; return Arrays.equals(addr.getValue(), getValue()); }
Source:
<code>public Stream<DocumentWriteOperation> splitWriteOperations(JsonParser input, String inputName) { if (input == null) { throw new IllegalArgumentException("Input cannot be null"); } if (getUriMaker() == null) { JSONSplitter.UriMakeImpl uriMaker = new UriMakeImpl(); setUriMaker(uriMaker); } getUriMaker().setInputName(inputName); if (getUriMaker().getInputName() == null) { <START> ((JSONSplitter.UriMakeImpl) getUriMaker()).setExtension("json"); <END> } JSONSplitter.DocumentWriteOperationSpliterator spliterator = new JSONSplitter.DocumentWriteOperationSpliterator<>(this, input); return StreamSupport.stream(spliterator, true); }</code><technical_language>lines 174 176 move a UriMakeImpl.setInputName() override calls super.setInputName()? If user provides URI maker, responsibility handle case of a null input name? concern applies some of other splitters</technical_language>

Target:
public Stream<DocumentWriteOperation> splitWriteOperations(JsonParser input, String inputName) { if (input == null) { throw new IllegalArgumentException("Input cannot be null"); } count = 0; this.inputName = inputName; JSONSplitter.DocumentWriteOperationSpliterator spliterator = new JSONSplitter.DocumentWriteOperationSpliterator<>(this, input); return StreamSupport.stream(spliterator, true); }
Source:
<code>String format(int invocationIndex, Object... arguments) { String result = namePattern.replace("{index}", String.valueOf(invocationIndex)); if (result.contains("{arguments}")) { String replacement = IntStream.range(0, arguments.length) .mapToObj(index -> "{" + index + "}") .collect(joining(", ")); result = result.replace("{arguments}", replacement); } for (int i = 0; i < arguments.length; i++) { arguments[i] = StringUtils.nullSafeToString(arguments[i]); } try { return MessageFormat.format(result, arguments); } catch (IllegalArgumentException ex) { <START> String message = "The naming pattern defined for the parameterized tests is invalid: " + ex.getMessage(); <END> throw new JUnitException(message, ex); } }</code><technical_language>Please append ex.getMessage() message</technical_language>

Target:
String format(int invocationIndex, Object... arguments) { String result = namePattern.replace("{index}", String.valueOf(invocationIndex)); if (result.contains("{arguments}")) { String replacement = IntStream.range(0, arguments.length) .mapToObj(index -> "{" + index + "}") .collect(joining(", ")); result = result.replace("{arguments}", replacement); } Object[] humanReadableArguments = new String[arguments.length]; for (int i = 0; i < arguments.length; i++) { humanReadableArguments[i] = StringUtils.nullSafeToString(arguments[i]); } try { return MessageFormat.format(result, humanReadableArguments); } catch (IllegalArgumentException ex) { String message = "The naming pattern defined for the parameterized tests is invalid. " + "The nested exception contains more details."; throw new JUnitException(message, ex); } }
Source:
<code>private void generateUpperRangeCheck(Versions ifVersions, Versions ifNotVersions, CodeBuffer buffer) { if (ifMember != null) { buffer.printf("if (version <= %d) {%n", containingVersions.highest()); buffer.incrementIndent(); ifMember.generate(ifVersions); buffer.decrementIndent(); if (ifNotMember != null) { buffer.printf("} else {%n"); buffer.incrementIndent(); ifNotMember.generate(ifNotVersions); buffer.decrementIndent(); buffer.printf("}%n"); } else { <START> buffer.printf("}%n"); <END> } } else if (ifNotMember != null) { buffer.printf("if (version > %d) {%n", containingVersions.highest()); buffer.incrementIndent(); ifNotMember.generate(ifNotVersions); buffer.decrementIndent(); buffer.printf("}%n"); } }</code><technical_language>nit: too</technical_language>

Target:
private void generateUpperRangeCheck(Versions ifVersions, Versions ifNotVersions, CodeBuffer buffer) { if (ifMember != null) { buffer.printf("if (version <= %d) {%n", containingVersions.highest()); buffer.incrementIndent(); ifMember.generate(ifVersions); buffer.decrementIndent(); if (ifNotMember != null) { buffer.printf("} else {%n"); buffer.incrementIndent(); ifNotMember.generate(ifNotVersions); buffer.decrementIndent(); } buffer.printf("}%n"); } else if (ifNotMember != null) { buffer.printf("if (version > %d) {%n", containingVersions.highest()); buffer.incrementIndent(); ifNotMember.generate(ifNotVersions); buffer.decrementIndent(); buffer.printf("}%n"); } }
Source:
<code>public Holiday get(UniqueId uniqueId) { Holiday holiday = _calendarHolidays.get(ExternalId.of(uniqueId.getScheme(), uniqueId.getValue())); if (holiday == null) { <START> throw new DataNotFoundException("Holiday with id " + uniqueId + " not found"); <END> } return holiday; }</code><technical_language>"holiday calendar" found, right</technical_language>

Target:
public Holiday get(UniqueId uniqueId) { Holiday holiday = _calendarHolidays.get(ExternalId.of(uniqueId.getScheme(), uniqueId.getValue())); if (holiday == null) { throw new DataNotFoundException("Calendar with id " + uniqueId + " not found"); } return holiday; }
Source:
<code>public void run() { try { <START> Resource resource = moduleResolver.resolve(groupId, artifactId, version, "exec", "jar"); <END> JarFileArchive jarFileArchive = new JarFileArchive(resource.getFile()); ModuleJarLauncher jarLauncher = new ModuleJarLauncher(jarFileArchive); jarLauncher.launch(args); } catch (IOException e) { e.printStackTrace(); } }</code><technical_language>args in a order in <LINK_0> moduleResolver.resolve(groupId, artifactId, "jar", "exec", version);</technical_language>

Target:
public void run() { try { Resource resource = moduleResolver.resolve(coordinates.groupId, coordinates.artifactId, coordinates.extension, coordinates.classifier, coordinates.version); JarFileArchive jarFileArchive = new JarFileArchive(resource.getFile()); ModuleJarLauncher jarLauncher = new ModuleJarLauncher(jarFileArchive); jarLauncher.launch(args); } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>public void testStatsBeingAutomaticallyRefreshed() { ExecutorService executor = Executors.newFixedThreadPool(4); LoadingCache<GuidePostsKey, GuidePostsInfo> cache = CacheBuilder.newBuilder() .refreshAfterWrite(1000, TimeUnit.MILLISECONDS) .maximumWeight(QueryServicesOptions.DEFAULT_STATS_MAX_CACHE_SIZE) .weigher(new Weigher<GuidePostsKey, GuidePostsInfo>() { @Override public int weigh(GuidePostsKey key, GuidePostsInfo info) { return info.getEstimatedSize(); } }) .removalListener(new GuidePostsCache.PhoenixStatsCacheRemovalListener()) .build(new PhoenixStatsCacheLoader(new TestStatsLoaderImpl(), executor)); GuidePostsKey guidePostsKey = new GuidePostsKey(new byte[4], new byte[4]); GuidePostsInfo guidePostsInfo = getStats(cache, guidePostsKey); assertTrue(guidePostsInfo.getMaxLength() == 1); sleep(3000); <START> guidePostsInfo = getStats(cache, guidePostsKey); <END> assertTrue(guidePostsInfo.getMaxLength() == 1); sleep(3000); guidePostsInfo = getStats(cache, guidePostsKey); assertTrue(guidePostsInfo.getMaxLength() == 2); }</code><technical_language>this instead of actual time tests faster reliable. <LINK_0></technical_language>

Target:
public void testStatsBeingAutomaticallyRefreshed() { ExecutorService executor = Executors.newFixedThreadPool(4); CountDownLatch firstTimeRefreshedSignal = new CountDownLatch(1); CountDownLatch secondTimeRefreshedSignal = new CountDownLatch(2); Configuration config = HBaseFactoryProvider.getConfigurationFactory().getConfiguration(); LoadingCache<GuidePostsKey, GuidePostsInfo> cache = CacheBuilder.newBuilder() .refreshAfterWrite(100, TimeUnit.MILLISECONDS) .maximumWeight(QueryServicesOptions.DEFAULT_STATS_MAX_CACHE_SIZE) .weigher(new Weigher<GuidePostsKey, GuidePostsInfo>() { @Override public int weigh(GuidePostsKey key, GuidePostsInfo info) { return info.getEstimatedSize(); } }) .removalListener(new GuidePostsCache.PhoenixStatsCacheRemovalListener()) .build(new PhoenixStatsCacheLoader(new TestStatsLoaderImpl( firstTimeRefreshedSignal, secondTimeRefreshedSignal), config)); try { GuidePostsKey guidePostsKey = new GuidePostsKey(new byte[4], new byte[4]); GuidePostsInfo guidePostsInfo = getStats(cache, guidePostsKey); assertTrue(guidePostsInfo.getMaxLength() == 1); sleep(150); guidePostsInfo = getStats(cache, guidePostsKey); assertTrue(guidePostsInfo.getMaxLength() >= 1); firstTimeRefreshedSignal.await(); sleep(150); guidePostsInfo = getStats(cache, guidePostsKey); assertTrue(guidePostsInfo.getMaxLength() >= 2); secondTimeRefreshedSignal.await(); } catch (InterruptedException e) { assertFalse(true); } }
Source:
<code>protected Composite getComposite(final Composite parent) { parent.setBackgroundMode(SWT.INHERIT_FORCE); final PGroup group = new PGroup(parent, SWT.SMOOTH); <START> if (getVElement().getName() != null) { <END> group.setText(getVElement().getName()); } group.addExpandListener(new ExpandListener() { @Override public void itemCollapsed(ExpandEvent e) { EMFFormsSWTLayoutUtil.adjustParentSize(group); getVElement().setCollapsed(true); } @Override public void itemExpanded(ExpandEvent e) { EMFFormsSWTLayoutUtil.adjustParentSize(group); getVElement().setCollapsed(false); } }); group.setExpanded(!getVElement().isCollapsed()); return group; }</code><technical_language>name instead of label</technical_language>

Target:
protected Composite getComposite(final Composite parent) { parent.setBackgroundMode(SWT.INHERIT_FORCE); final PGroup group = new PGroup(parent, SWT.SMOOTH); if (getVElement().getLabel() != null) { group.setText(getVElement().getLabel()); } group.addExpandListener(new ExpandListener() { @Override public void itemCollapsed(ExpandEvent e) { EMFFormsSWTLayoutUtil.adjustParentSize(group); getVElement().setCollapsed(true); } @Override public void itemExpanded(ExpandEvent e) { EMFFormsSWTLayoutUtil.adjustParentSize(group); getVElement().setCollapsed(false); } }); group.setExpanded(!getVElement().isCollapsed()); return group; }
Source:
<code>private void closeConnection() <START> { <END> try { stat.close(); conn.close(); } catch (SQLException e) { e.printStackTrace(); } }</code><technical_language>Brace next method definition please</technical_language>

Target:
private void closeConnection() { try { statement.close(); connection.close(); } catch (SQLException e) { e.printStackTrace(); } }
Source:
<code>public Constraint getRequiredConstraint(Action.ActionEffect actionEffect, JmxAction action, JmxTarget target) { <START> return isAuditOperation(action.composeAction()) ? AUDIT : NOT_AUDIT; <END> }</code><technical_language>This simply return NOT_AUDIT</technical_language>

Target:
public Constraint getRequiredConstraint(Action.ActionEffect actionEffect, JmxAction action, JmxTarget target) { return NOT_AUDIT; }
Source:
<code>public void setUp() throws Exception { activityActivityTestRule.getActivity() <START> .getSupportFragmentManager().beginTransaction(); <END> context = getInstrumentation().getTargetContext(); }</code><technical_language>I tell, this removed. I missing something</technical_language>

Target:
public void setUp() throws Exception { context = getInstrumentation().getTargetContext(); }
Source:
<code>public Record beforeAppend(Record record) { if (record.getData().length <= getThresholdSize()) { return record; } <START> log.debug("Record: overflow value of size: {}", record.getKey(), record.getData().length); <END> EnumSet<Record.Flag> flags = EnumSet.copyOf(record.getFlags()); flags.add(Record.Flag.INTERNAL1); storeValue(record.getKey(), record.getData()); return new Record(record.getKey(), null, record.getWatermark(), flags); }</code><technical_language>lambdas. a backport want instead if (log.isDebugEnabled()) regular string concat. down</technical_language>

Target:
public Record beforeAppend(Record record) { if (record.getData().length <= getThresholdSize()) { return record; } if (log.isDebugEnabled()) { log.debug(String.format("Record: %s overflow value of size: %d", record.getKey(), record.getData().length)); } EnumSet<Record.Flag> flags = EnumSet.copyOf(record.getFlags()); flags.add(Record.Flag.EXTERNAL_VALUE); storeValue(record.getKey(), record.getData()); return new Record(record.getKey(), null, record.getWatermark(), flags); }
Source:
<code>public Capable canUpload() { Capable result = projectControl.canPushToAtLeastOneRef(); if (result != Capable.OK) { return result; } <START> result = MagicBranch.checkMagicBranchRefs(repo, project); <END> return Capable.OK; }</code><technical_language>ignore result here. need return result</technical_language>

Target:
public Capable canUpload() { Capable result = projectControl.canPushToAtLeastOneRef(); if (result != Capable.OK) { return result; } return MagicBranch.checkMagicBranchRefs(repo, project); }
Source:
<code>private Action getConfigureSymbolsAction() { if (fConfigureSymbolsAction != null) { return fConfigureSymbolsAction; } <START> fConfigureSymbolsAction = new Action("get symbols") { END> @Override public void run() { SymbolProviderConfigDialog dialog = new SymbolProviderConfigDialog(getSite().getShell(), getProviderPages()); if (dialog.open() == IDialogConstants.OK_ID) { } } }; fConfigureSymbolsAction.setToolTipText("get symbols"); fConfigureSymbolsAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(SYMBOL_MAPPING_ICON_PATH)); fConfigureSymbolsAction.setEnabled(true); return fConfigureSymbolsAction; }</code><technical_language>externalize. I already, need find correct Message class</technical_language>

Target:
private Action getConfigureSymbolsAction() { if (fConfigureSymbolsAction != null) { return fConfigureSymbolsAction; } fConfigureSymbolsAction = new Action(Messages.FlameGraphView_ConfigureSymbolProvidersText) { @Override public void run() { SymbolProviderConfigDialog dialog = new SymbolProviderConfigDialog(getSite().getShell(), getProviderPages()); if (dialog.open() == IDialogConstants.OK_ID) { } } }; fConfigureSymbolsAction.setToolTipText(Messages.FlameGraphView_ConfigureSymbolProvidersTooltip); fConfigureSymbolsAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(SYMBOL_MAPPING_ICON_PATH)); fConfigureSymbolsAction.setEnabled(true); return fConfigureSymbolsAction; }
Source:
<code>private byte[] getBytesFromStream(@NonNull InputStream in) { final ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buff = new byte[MAX_CACHED_CONTENT_LENGTH]; try { int n; <START> while ((n = in.read(buff)) > 0) { out.write(buff, 0, n); } <END> buff = out.toByteArray(); } catch (IOException e) { final String msg = "Failed reading blob content stream: " + in; Log.w(DOMAIN, msg, e); throw new IllegalStateException(msg, e); } finally { try { out.close(); } catch (IOException ignore) { } } blobLength = cacheContent(buff); return buff; }</code><technical_language>Java doc: total number of bytes read buffer, -1 if is more data end of stream reached. Is safer check for -1 >= 0</technical_language>

Target:
private byte[] getBytesFromStream(@NonNull InputStream in) { final ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buff = new byte[MAX_CACHED_CONTENT_LENGTH]; try { int n; while ((n = in.read(buff)) >= 0) { out.write(buff, 0, n); } buff = out.toByteArray(); } catch (IOException e) { final String msg = "Failed reading blob content stream: " + in; Log.w(DOMAIN, msg, e); throw new IllegalStateException(msg, e); } finally { try { out.close(); } catch (IOException ignore) { } } blobLength = cacheContent(buff); return buff; }
Source:
<code>protected String getLaunchDebugCommand(JBossServer jbossServer) throws CoreException { String programArguments = getLaunchProgramArgs(); String vmArguments = getLaunchVMArgs(); String jar = getJar(jbossServer.getServer()); String debugPort = getDebugPort(); String debugArgs = "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=" + debugPort + " -Xdebug "; <START> String command = "java " + debugArgs + vmArguments + " -jar " + jar + " " + IJBossRuntimeConstants.SPACE + programArguments + "&"; <END> return command; }</code><technical_language>" " + IJBossRuntimeConstants.SPACE</technical_language>

Target:
protected String getLaunchDebugCommand(JBossServer jbossServer) throws CoreException { String programArguments = getLaunchProgramArgs(); String vmArguments = getLaunchVMArgs(); String jar = getJar(jbossServer.getServer()); String debugPort = getDebugPort(); String debugArgs = "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=" + debugPort + " -Xdebug "; String command = "java " + debugArgs + vmArguments + " -jar " + jar + IJBossRuntimeConstants.SPACE + programArguments + "&"; return command; }
Source:
<code>public void handleTask(Task task) throws InterruptedException { var time = task.getTime(); Thread.sleep(time); <START> System.out.println("It takes " + time + " milliseconds to finish the task"); <END> task.setFinished(); }</code><technical_language>Instead of printing system output stream, a proper logger</technical_language>

Target:
public void handleTask(Task task) throws InterruptedException { var time = task.getTime(); Thread.sleep(time); LOGGER.info("It takes " + time + " milliseconds to finish the task"); task.setFinished(); }
Source:
<code>public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { if (!(item instanceof SwitchItem || item instanceof RollershutterItem || item instanceof NumberItem || item instanceof ContactItem || item instanceof StringItem)) { throw new BindingConfigParseException("item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() <START> + "', this Item is not allowed - please check your *.items configuration" <END> + ", only SwitchItem, RollershutterItem, NumberItem ContactItem and StringItem are allowed / supported for now"); } }</code><technical_language>"'. This item is allowed. Please check *.items configuration."</technical_language>

Target:
public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { if (!(item instanceof SwitchItem || item instanceof RollershutterItem || item instanceof NumberItem || item instanceof ContactItem || item instanceof StringItem)) { throw new BindingConfigParseException( "item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() + "'. This Item is not allowed - please check your *.items configuration." + "Only SwitchItem, RollershutterItem, NumberItem ContactItem and StringItem are allowed."); } }
Source:
<code>public Node visitDropCheckConstraint(SqlBaseParser.DropCheckConstraintContext context) { <START> Table table = (Table) visit(context.alterTableDefinition()); StringLiteral ident = (StringLiteral) visit(context.ident()); return new DropCheckConstraint<>(table, ident.getValue()); <END> }</code><technical_language>suggestion Table<?> table = (Table<?>) visit(context.alterTableDefinition()); return new DropCheckConstraint<>(table, getIdentText(context.ident()));</technical_language>

Target:
public Node visitDropCheckConstraint(SqlBaseParser.DropCheckConstraintContext context) { Table<?> table = (Table<?>) visit(context.alterTableDefinition()); return new DropCheckConstraint<>(table, getIdentText(context.ident())); }
Source:
<code>protected void handleRemoteBrowseSelected() { IHost currentConnectionSelected = getCurrentConnection(); SystemRemoteFileDialog dlg = new SystemRemoteFileDialog(getControl() .getShell(), Messages.RemoteCMainTab_Remote_Path_Browse_Button_Title, currentConnectionSelected); dlg.setBlockOnOpen(true); if (dlg.open() == Window.OK) { Object retObj = dlg.getSelectedObject(); if (retObj instanceof IRemoteFile) { IRemoteFile selectedFile = (IRemoteFile) retObj; String absPath = selectedFile.getAbsolutePath(); if (selectedFile.isDirectory()) { IPath appPath = new Path(fProgText.getText().trim()); String lastSegment = appPath.lastSegment(); if (lastSegment != null && lastSegment.trim().length() > 0) { IPath remotePath = new Path(selectedFile.getAbsolutePath()).append(lastSegment.trim()); <START> absPath = remotePath.toOSString(); <END> } } remoteProgText.setText(absPath); } } }</code><technical_language>This inadvertently change path separator host OS witch match target OS path. In case of remote debugging of a Linux App WindowsOS host this change path. instead of "/home/user/workspace/project.elf" changed path "\home\user\workspace\project.elf" debug session fail. Solutions change "remotePath.toPortableString()" option manually append separators IRemoteFile API, i.e. selectedFile.getAbsolutePath() + selectedFile.getSeparator() + lastSegment.trim()</technical_language>

Target:
protected void handleRemoteBrowseSelected() { IHost currentConnectionSelected = getCurrentConnection(); SystemRemoteFileDialog dlg = new SystemRemoteFileDialog(getControl() .getShell(), Messages.RemoteCMainTab_Remote_Path_Browse_Button_Title, currentConnectionSelected); dlg.setBlockOnOpen(true); if (dlg.open() == Window.OK) { Object retObj = dlg.getSelectedObject(); if (retObj instanceof IRemoteFile) { IRemoteFile selectedFile = (IRemoteFile) retObj; String absPath = selectedFile.getAbsolutePath(); if (selectedFile.isDirectory()) { IPath appPath = new Path(fProgText.getText().trim()); String lastSegment = appPath.lastSegment(); if (lastSegment != null && lastSegment.trim().length() > 0) { IPath remotePath = new Path(selectedFile.getAbsolutePath()).append(lastSegment.trim()); absPath = remotePath.toPortableString(); } } remoteProgText.setText(absPath); } } }
Source:
<code>static void transformMappedBys(EntityType entityType, Map<String, Attribute> newAttributes) { if (newAttributes.isEmpty()) { return; } stream(entityType.getAtomicAttributes()) <START> .filter(attr -> attr.getDataType() == ONE_TO_MANY) <END> .forEach(attr -> transformMappedBy(attr, newAttributes)); }</code><technical_language>This code work for other mappedBy data types (i.e. prepared for bidirectional many-to-many) suggestion .filter(Attribute::isMappedBy)</technical_language>

Target:
static void transformMappedBys(EntityType entityType, Map<String, Attribute> newAttributes) { if (newAttributes.isEmpty()) { return; } stream(entityType.getAtomicAttributes()) .filter(Attribute::isMappedBy) .forEach(attr -> transformMappedBy(attr, newAttributes)); }
Source:
<code>public <N, EK, EV> StateMapView<N, EK, EV> getStateMapView( String stateName, boolean supportNullKey, TypeSerializer<EK> keySerializer, TypeSerializer<EV> valueSerializer) { final MapStateDescriptor<EK, EV> mapStateDescriptor = new MapStateDescriptor<>( stateName, keySerializer, valueSerializer); if (stateTtlConfig.isEnabled()) { <START> mapStateDescriptor.enableTimeToLive(stateTtlConfig); <END> } final MapState<EK, EV> mapState = ctx.getMapState(mapStateDescriptor); if (supportNullKey) { final ValueStateDescriptor<EV> nullStateDescriptor = new ValueStateDescriptor<>( stateName + NULL_STATE_POSTFIX, valueSerializer); final ValueState<EV> nullState = ctx.getState(nullStateDescriptor); return new StateMapView.KeyedStateMapViewWithKeysNullable<>(mapState, nullState); } else { return new StateMapView.KeyedStateMapViewWithKeysNotNull<>(mapState); } }</code><technical_language>need nullStateDescriptor aware of TTL</technical_language>

Target:
public <N, EK, EV> StateMapView<N, EK, EV> getStateMapView( String stateName, boolean supportNullKey, TypeSerializer<EK> keySerializer, TypeSerializer<EV> valueSerializer) { final MapStateDescriptor<EK, EV> mapStateDescriptor = new MapStateDescriptor<>( stateName, keySerializer, valueSerializer); if (stateTtlConfig.isEnabled()) { mapStateDescriptor.enableTimeToLive(stateTtlConfig); } final MapState<EK, EV> mapState = ctx.getMapState(mapStateDescriptor); if (supportNullKey) { final ValueStateDescriptor<EV> nullStateDescriptor = new ValueStateDescriptor<>( stateName + NULL_STATE_POSTFIX, valueSerializer); if (stateTtlConfig.isEnabled()) { nullStateDescriptor.enableTimeToLive(stateTtlConfig); } final ValueState<EV> nullState = ctx.getState(nullStateDescriptor); return new StateMapView.KeyedStateMapViewWithKeysNullable<>(mapState, nullState); } else { return new StateMapView.KeyedStateMapViewWithKeysNotNull<>(mapState); } }
Source:
<code>public void setUp() throws IOException { conf = new Configuration(); <START> conf.setBoolean("dfs.client.block.write.replace-datanode-on-failure.enable", true); <END> conf.set("dfs.client.block.write.replace-datanode-on-failure.policy", "NEVER"); cluster = createDFSCluster(conf); cluster.waitActive(); url = "hdfs://" + cluster.getNameNode().getClientNamenodeAddress(); fs = cluster.getFileSystem(); Properties props = createProps(); connectorConfig = new HdfsSinkConnectorConfig(props); topicsDir = connectorConfig.getString(HdfsSinkConnectorConfig.TOPIC_DIR_CONFIG); }</code><technical_language>important settings need advise of for testing</technical_language>

Target:
public void setUp() throws Exception { conf = new Configuration(); if (dfsCluster) { cluster = createDFSCluster(conf); cluster.waitActive(); url = "hdfs://" + cluster.getNameNode().getClientNamenodeAddress(); fs = cluster.getFileSystem(); } else { url = "memory://"; } Properties props = createProps(); connectorConfig = new HdfsSinkConnectorConfig(props); topicsDir = connectorConfig.getString(HdfsSinkConnectorConfig.TOPIC_DIR_CONFIG); int schemaCacheSize = connectorConfig.getInt(HdfsSinkConnectorConfig.SCHEMA_CACHE_SIZE_CONFIG); avroData = new AvroData(schemaCacheSize); assignment = new HashSet<>(); assignment.add(TOPIC_PARTITION); assignment.add(TOPIC_PARTITION2); context = new MockSinkTaskContext(); }
Source:
<code>public static void main(String[] argArray) throws IOException { <START> long now = System.nanoTime(); <END> Arguments arguments = new Arguments(); arguments.parse(argArray); int result = run(arguments); if (result != 0) { System.exit(result); } if (args.profileConcurrency) { System.out.println("DX TIME: " + ((System.nanoTime() - now)/1000000L)); } }</code><technical_language>nit: indentation (or this a gerrit problem?)</technical_language>

Target:
public static void main(String[] argArray) throws IOException { Arguments arguments = new Arguments(); arguments.parse(argArray); int result = run(arguments); if (result != 0) { System.exit(result); } }
Source:
<code>public static FileUtils.FileCopyResult unzip(final File pulledFile, final File outDir) throws IOException { if (!(outDir.exists() && outDir.isDirectory())) { throw new ISE("outDir[%s] must exist and be a directory", outDir); } log.info("Unzipping file[%s] to [%s]", pulledFile, outDir); final ArrayList<FileUtils.FileCopyResult> children = new ArrayList<>(); try (final ZipFile zipFile = new ZipFile(pulledFile)) { final Enumeration<? extends ZipEntry> enumeration = zipFile.entries(); while (enumeration.hasMoreElements()) { final ZipEntry entry = enumeration.nextElement(); children.add( FileUtils.retryCopy( new ByteSource() { @Override public InputStream openStream() throws IOException { return new BufferedInputStream(zipFile.getInputStream(entry)); } }, <START> FileUtils.MD5ERROR, <END> Paths.get(outDir.getAbsolutePath(), entry.getName()).toFile(), DEFAULT_RETRY_COUNT ) ); } } return new FileUtils.FileCopyResult(outDir.toPath(), children); }</code><technical_language>guard retries here. retry a read file, if checksums match time, match time, no? Otherwise, this memory corruption issues, in case bigger problems</technical_language>

Target:
public static FileUtils.FileCopyResult unzip(final File pulledFile, final File outDir) throws IOException { if (!(outDir.exists() && outDir.isDirectory())) { throw new ISE("outDir[%s] must exist and be a directory", outDir); } log.info("Unzipping file[%s] to [%s]", pulledFile, outDir); final FileUtils.FileCopyResult result = new FileUtils.FileCopyResult(); try (final ZipFile zipFile = new ZipFile(pulledFile)) { final Enumeration<? extends ZipEntry> enumeration = zipFile.entries(); while (enumeration.hasMoreElements()) { final ZipEntry entry = enumeration.nextElement(); result.addFiles( FileUtils.retryCopy( new ByteSource() { @Override public InputStream openStream() throws IOException { return new BufferedInputStream(zipFile.getInputStream(entry)); } }, new File(outDir, entry.getName()), FileUtils.IS_EXCEPTION, DEFAULT_RETRY_COUNT ).getFiles() ); } } return result; }
Source:
<code>public long deserialize(DataTree dt, Map<Long, Integer> sessions) throws IOException { List<File> snapList = findNValidSnapshots(100); if (snapList.size() == 0) { return -1L; } File snap = null; <START> long snapZxid = 0; <END> boolean foundValid = false; for (int i = 0, snapListSize = snapList.size(); i < snapListSize; i++) { snap = snapList.get(i); LOG.info("Reading snapshot {}", snap); snapZxid = Util.getZxidFromName(snap.getName(), SNAPSHOT_FILE_PREFIX); try (CheckedInputStream snapIS = SnapStream.getInputStream(snap)) { InputArchive ia = BinaryInputArchive.getArchive(snapIS); deserialize(dt, sessions, ia); SnapStream.checkSealIntegrity(snapIS, ia); if (dt.deserializeZxidDigest(ia, snapZxid)) { SnapStream.checkSealIntegrity(snapIS, ia); } foundValid = true; break; } catch (IOException e) { LOG.warn("problem reading snap file {}", snap, e); } } if (!foundValid) { throw new IOException("Not able to find valid snapshots in " + snapDir); } dt.lastProcessedZxid = snapZxid; lastSnapshotInfo = new SnapshotInfo(dt.lastProcessedZxid, snap.lastModified() / 1000); if (dt.getDigestFromLoadedSnapshot() != null) { dt.compareSnapshotDigests(dt.lastProcessedZxid); } return dt.lastProcessedZxid; }</code><technical_language>default of snapZxid -1 instead of 0? -1 is Util.getZxidFromName returns if finds valid</technical_language>

Target:
public long deserialize(DataTree dt, Map<Long, Integer> sessions) throws IOException { List<File> snapList = findNValidSnapshots(100); if (snapList.size() == 0) { return -1L; } File snap = null; long snapZxid = -1; boolean foundValid = false; for (int i = 0, snapListSize = snapList.size(); i < snapListSize; i++) { snap = snapList.get(i); LOG.info("Reading snapshot {}", snap); snapZxid = Util.getZxidFromName(snap.getName(), SNAPSHOT_FILE_PREFIX); try (CheckedInputStream snapIS = SnapStream.getInputStream(snap)) { InputArchive ia = BinaryInputArchive.getArchive(snapIS); deserialize(dt, sessions, ia); SnapStream.checkSealIntegrity(snapIS, ia); if (dt.deserializeZxidDigest(ia, snapZxid)) { SnapStream.checkSealIntegrity(snapIS, ia); } foundValid = true; break; } catch (IOException e) { LOG.warn("problem reading snap file {}", snap, e); } } if (!foundValid) { throw new IOException("Not able to find valid snapshots in " + snapDir); } dt.lastProcessedZxid = snapZxid; lastSnapshotInfo = new SnapshotInfo(dt.lastProcessedZxid, snap.lastModified() / 1000); if (dt.getDigestFromLoadedSnapshot() != null) { dt.compareSnapshotDigests(dt.lastProcessedZxid); } return dt.lastProcessedZxid; }
Source:
<code>public <K, V> Ehcache<K, V> createCache(Class<K> keyClazz, Class<V> valueClazz, ServiceConfiguration<?>... config) { <START> return new HeapCache<K, V>(LoggerFactory.getLogger(Ehcache.class + "HeapCache")); <END> }</code><technical_language>This misses separator '-'</technical_language>

Target:
public <K, V> Ehcache<K, V> createCache(Class<K> keyClazz, Class<V> valueClazz, ServiceConfiguration<?>... config) { return new HeapCache<K, V>(LoggerFactory.getLogger(Ehcache.class + "-" + "HeapCache")); }
Source:
<code>protected void updateFollowFilter() { if (currentWalk instanceof FollowingSWTWalk) { List<DiffEntry> renamedEntries = ((FollowingSWTWalk) currentWalk).getRenamedEntries(); List<String> pathList = new ArrayList<String>(renamedEntries.size()); for (DiffEntry entry : renamedEntries) { <START> if (!pathList.contains(entry.getOldPath())) { <END> pathList.add(entry.getOldPath()); } if (!pathList.contains(entry.getNewPath())) { pathList.add(entry.getNewPath()); } } if (pathList.size() > 0) { TreeWalk fileWalker = fileViewer.getTreeWalk(); fileWalker.setFilter(AndTreeFilter.create(PathFilterGroup .createFromStrings(pathList), TreeFilter.ANY_DIFF)); } } }</code><technical_language>style-nit; surplus braces</technical_language>

Target:
protected void updateFollowFilter() { if (currentWalk instanceof FollowingSWTWalk) { List<DiffEntry> renamedEntries = ((FollowingSWTWalk) currentWalk).getRenamedEntries(); List<String> pathList = new ArrayList<String>(renamedEntries.size()); for (DiffEntry entry : renamedEntries) { if (!pathList.contains(entry.getOldPath())) pathList.add(entry.getOldPath()); if (!pathList.contains(entry.getNewPath())) pathList.add(entry.getNewPath()); } if (pathList.size() > 0) { TreeWalk fileWalker = fileViewer.getTreeWalk(); fileWalker.setFilter(AndTreeFilter.create(PathFilterGroup .createFromStrings(pathList), TreeFilter.ANY_DIFF)); } } }
Source:
<code>protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result; OCShare share = getStorageManager().getShareById(mLocalId); if (share != null) { RemoveRemoteShareOperation operation = new RemoveRemoteShareOperation((int) share.getRemoteId()); result = operation.execute(client); OCFile file = getStorageManager().getFileByPath(share.getPath()); if (result.isSuccess()) { Log_OC.d(TAG, "Share id = " + share.getRemoteId() + " deleted"); ShareType shareType = share.getShareType(); if (ShareType.PUBLIC_LINK.equals(shareType)) { <START> file.setSharedViaLink(false); <END> } else if (ShareType.USER.equals(shareType) || ShareType.GROUP.equals(shareType) || ShareType.FEDERATED.equals(shareType)){ ArrayList <OCShare> sharesWith = getStorageManager(). getPrivateSharesForAFile(share.getPath(), getStorageManager().getAccount().name); if (sharesWith.size() == 1) { file.setSharedWithSharee(false); } } getStorageManager().saveFile(file); getStorageManager().removeShare(share); } else if (result.getCode() != ResultCode.SERVICE_UNAVAILABLE && !existsFile(client, share.getPath())) { getStorageManager().removeFile(file, true, true); } } else { result = new RemoteOperationResult(ResultCode.SHARE_NOT_FOUND); } return result; }</code><technical_language>This needs updated, in a similar next else if. multiple links bound a file, save file shared of links removed</technical_language>

Target:
protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result; OCShare share = getStorageManager().getShareById(mLocalId); if (share != null) { RemoveRemoteShareOperation operation = new RemoveRemoteShareOperation((int) share.getRemoteId()); result = operation.execute(client); OCFile file = getStorageManager().getFileByPath(share.getPath()); if (result.isSuccess()) { Log_OC.d(TAG, "Share id = " + share.getRemoteId() + " deleted"); ShareType shareType = share.getShareType(); if (ShareType.PUBLIC_LINK.equals(shareType)) { ArrayList<OCShare> publicShares = getStorageManager(). getPublicSharesForAFile(share.getPath(), getStorageManager().getAccount().name); if (publicShares.size() == 1) { file.setSharedViaLink(false); } } else if (ShareType.USER.equals(shareType) || ShareType.GROUP.equals(shareType) || ShareType.FEDERATED.equals(shareType)){ ArrayList <OCShare> sharesWith = getStorageManager(). getPrivateSharesForAFile(share.getPath(), getStorageManager().getAccount().name); if (sharesWith.size() == 1) { file.setSharedWithSharee(false); } } getStorageManager().saveFile(file); getStorageManager().removeShare(share); } else if (result.getCode() != ResultCode.SERVICE_UNAVAILABLE && notExistFile(client, share.getPath())) { getStorageManager().removeFile(file, true, true); } } else { result = new RemoteOperationResult(ResultCode.SHARE_NOT_FOUND); } return result; }
Source:
<code><START> public String mimeType() { <END> return "multipart/form-data; boundary=" + boundary; }</code><technical_language>@Override this line</technical_language>

Target:
@Override public String mimeType() { return "multipart/form-data; boundary=" + boundary; }
Source:
<code>protected void EndSuccessfully() { setVm(DbFacade.getInstance().getVmDAO().getById(getVmId())); if (getVm() != null) { vm_pools vmPool = getVmPool(); <START> <END> if (DbFacade.getInstance().getDiskImageDAO().getAllStatelessVmImageMapsForVm(getVm().getvm_guid()).size() > 0) { setSucceeded(Backend.getInstance().endAction(VdcActionType.RunVm, getParameters().getImagesParameters().get(0), getCompensationContext()).getSucceeded()); if (!getSucceeded()) { log.warn("EndSuccessfully: EndAction of RunVm failed, detaching user from Vm"); detachUserFromVmFromPool(); getReturnValue().setEndActionTryAgain(false); } } else { log.warn("EndSuccessfully: No images were created for Vm, detaching user from Vm"); detachUserFromVmFromPool(); getReturnValue().setEndActionTryAgain(false); } } else { setCommandShouldBeLogged(false); log.warn("AttachUserToVmFromPoolAndRunCommand::EndSuccessfully: Vm is null - not performing full EndAction"); setSucceeded(true); } }</code><technical_language>need check that, tje check is done RunVm, if is successes EndSuccessfully called</technical_language>

Target:
protected void EndSuccessfully() { if (getVm() != null) { vm_pools vmPool = getVmPool(); if (DbFacade.getInstance().getDiskImageDAO().getAllStatelessVmImageMapsForVm(getVm().getvm_guid()).size() > 0) { setSucceeded(Backend.getInstance().endAction(VdcActionType.RunVm, getParameters().getImagesParameters().get(0), getCompensationContext()).getSucceeded()); if (!getSucceeded()) { log.warn("EndSuccessfully: EndAction of RunVm failed, detaching user from Vm"); detachUserFromVmFromPool(); getReturnValue().setEndActionTryAgain(false); } } else { log.warn("EndSuccessfully: No images were created for Vm, detaching user from Vm"); detachUserFromVmFromPool(); getReturnValue().setEndActionTryAgain(false); } } else { setCommandShouldBeLogged(false); log.warn("AttachUserToVmFromPoolAndRunCommand::EndSuccessfully: Vm is null - not performing full EndAction"); setSucceeded(true); } }
Source:
<code>private DocumentReference createDocRef(DocumentReference baseDocRef, long num) { <START> String name = baseDocRef.getName() + num; <END> SpaceReference parent = References.extractRef(baseDocRef, SpaceReference.class).get(); return References.create(DocumentReference.class, name, parent); }</code><technical_language>Please StringBuilder</technical_language>

Target:
private DocumentReference createDocRef(DocumentReference baseDocRef, long num) { String name = new StringBuilder(baseDocRef.getName()).append(num).toString(); SpaceReference parent = References.extractRef(baseDocRef, SpaceReference.class).get(); return References.create(DocumentReference.class, name, parent); }
Source:
<code>public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { String refreshIntervalString = (String) config.get("refresh"); if (StringUtils.isNotBlank(refreshIntervalString)) { refreshInterval = Long.parseLong(refreshIntervalString); } boolean changed = false; if (serialPortname != (String) config.get("serialPort")) { serialPortname = (String) config.get("serialPort"); changed = true; } String dummy = (String) config.get("baud"); try { if (serialBaudrate != Integer.parseInt(dummy)) { serialBaudrate = Integer.parseInt(dummy); changed = true; } } catch (NumberFormatException e) { logger.info("reading exception"); } if (changed | (baseStation == null)) { if (baseStation != null) baseStation.closeSerialPort(); baseStation = new BaseStation(serialPortname, serialBaudrate, this); logger.debug("Smarthomatic Binding:update creates new basestation"); } Enumeration<String> keys = config.keys(); for (int i = 0; i < config.size(); i++) { String key = keys.nextElement(); StringTokenizer tokens = new StringTokenizer(key, ":"); if (tokens.nextToken().equals("device")) { if (tokens.hasMoreElements()) { dummy = tokens.nextToken(); int deviceID = Integer.parseInt(dummy); String name = (String) config.get(key); SmarthomaticGenericBindingProvider.addDevice(name, deviceID); logger.debug("Smarthomatic device can be indexed by name {}", new String[] { dummy, name }); } } <START> logger.debug("KEY:" + key); <END> } setProperlyConfigured(true); } }</code><technical_language>Please slf4j parametrization instead of string concatenation</technical_language>

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { String refreshIntervalString = (String) config.get("refresh"); if (StringUtils.isNotBlank(refreshIntervalString)) { refreshInterval = Long.parseLong(refreshIntervalString); } boolean changed = false; if (serialPortname != (String) config.get("serialPort")) { serialPortname = (String) config.get("serialPort"); changed = true; } String dummy = (String) config.get("baud"); try { if (serialBaudrate != Integer.parseInt(dummy)) { serialBaudrate = Integer.parseInt(dummy); changed = true; } } catch (NumberFormatException e) { logger.info("reading exception"); } if (changed | (baseStation == null)) { if (baseStation != null) baseStation.closeSerialPort(); baseStation = new BaseStation(serialPortname, serialBaudrate, this); logger.debug("Smarthomatic Binding:update creates new basestation"); } Enumeration<String> keys = config.keys(); for (int i = 0; i < config.size(); i++) { String key = keys.nextElement(); StringTokenizer tokens = new StringTokenizer(key, ":"); if (tokens.nextToken().equals("device")) { if (tokens.hasMoreElements()) { dummy = tokens.nextToken(); int deviceID = Integer.parseInt(dummy); String name = (String) config.get(key); SmarthomaticGenericBindingProvider.addDevice(name, deviceID); logger.debug("Smarthomatic device can be indexed by name {}", new String[] { dummy, name }); } } logger.debug("KEY: {}", key); } setProperlyConfigured(true); } }
Source:
<code>private Map<Integer, List<InstanceId>> getRoundRobinAllocation( int numContainer, Map<String, Integer> parallelismMap) { Map<Integer, List<InstanceId>> allocation = new HashMap<>(); <START> int totalInstance = <END> parallelismMap.values().stream().collect(Collectors.summingInt(Integer::intValue)); if (numContainer > totalInstance) { throw new RuntimeException("More containers allocated than instance."); } for (int i = 1; i <= numContainer; ++i) { allocation.put(i, new ArrayList<InstanceId>()); } int index = 1; int globalTaskIndex = 1; for (String component : parallelismMap.keySet()) { int numInstance = parallelismMap.get(component); for (int i = 0; i < numInstance; ++i) { allocation.get(index).add(new InstanceId(component, globalTaskIndex, i)); index = (index == numContainer) ? 1 : index + 1; globalTaskIndex++; } } return allocation; }</code><technical_language>TopologyUtils.getTotalInstance() work? worth adding this code TopologyUtils a util function</technical_language>

Target:
private Map<Integer, List<InstanceId>> getRoundRobinAllocation( int numContainer, Map<String, Integer> parallelismMap) { Map<Integer, List<InstanceId>> allocation = new HashMap<>(); int totalInstance = TopologyUtils.getTotalInstance(parallelismMap); if (numContainer > totalInstance) { throw new RuntimeException("More containers allocated than instance."); } for (int i = 1; i <= numContainer; ++i) { allocation.put(i, new ArrayList<InstanceId>()); } int index = 1; int globalTaskIndex = 1; for (String component : parallelismMap.keySet()) { int numInstance = parallelismMap.get(component); for (int i = 0; i < numInstance; ++i) { allocation.get(index).add(new InstanceId(component, globalTaskIndex, i)); index = (index == numContainer) ? 1 : index + 1; globalTaskIndex++; } } return allocation; }
Source:
<code>static Stream<Arguments> getTestParameters() { List<Arguments> argumentsList = new ArrayList<>(); getHttpClients() .forEach(httpClient -> { <START> for (SecretServiceVersion serviceVersion : SecretServiceVersion.values()) { <END> argumentsList.add(Arguments.of(httpClient, serviceVersion)); } }); return argumentsList.stream(); }</code><technical_language>Also, default, PR builds run tests latest version if environment variable run tests for versions is set, do this</technical_language>

Target:
static Stream<Arguments> getTestParameters() { List<Arguments> argumentsList = new ArrayList<>(); getHttpClients() .forEach(httpClient -> { Arrays.stream(SecretServiceVersion.values()).filter(SecretClientTestBase::shouldServiceVersionBeTested) .forEach(serviceVersion -> argumentsList.add(Arguments.of(httpClient, serviceVersion))); }); return argumentsList.stream(); }
Source:
<code>public List<StoreKeyAndSizeAndOffset> getStoreKeysInByteRange(long start, long end) { if (end < start || start < 0L || end >= totalSize) { <START> throw new IllegalArgumentException("Bad input parameters, start="+start+" end="+end+" totalSize="+totalSize); <END> } int idx = Collections.binarySearch(offsets, start); if (idx < 0) { idx = -idx-2; } List<StoreKeyAndSizeAndOffset> ans = new ArrayList<>(); while(idx < keys.size() && offsets.get(idx) <= end) { ans.add(keysAndSizesAndOffsets.get(idx)); idx++; } return ans; }</code><technical_language>format this file please</technical_language>

Target:
public List<ChunkMetadata> getStoreKeysInByteRange(long start, long end) { if (end < start || start < 0L || end >= totalSize) { throw new IllegalArgumentException( "Bad input parameters, start=" + start + " end=" + end + " totalSize=" + totalSize); } int startIdx = Collections.binarySearch(offsets, start); if (startIdx < 0) { startIdx = -startIdx - 2; } int endIdx = Collections.binarySearch(offsets, end); if (endIdx < 0) { endIdx = -endIdx - 2; } endIdx++; return chunkMetadataList.subList(startIdx, endIdx); }
Source:
<code>public void skip() { try { in.skipFully(length); <START> } catch (IOException e) { <END> throw new ParquetDecodingException("could not skip bytes at offset " + in.position(), e); } catch (RuntimeException e) { throw new ParquetDecodingException("could not skip bytes at offset " + in.position(), e); } }</code><technical_language>moved Java 7, a single catch block IOException | RuntimeException</technical_language>

Target:
public void skip() { try { in.skipFully(length); } catch (IOException | RuntimeException e) { throw new ParquetDecodingException("could not skip bytes at offset " + in.position(), e); } }