auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Iterator<Entry<KeyType>> iterator(final boolean sorted) { if (!initialized) { throw new ISE("Grouper is not initialized"); } if (closed) { throw new ISE("Grouper is closed"); } final List<Iterator<Entry<KeyType>>> sortedIterators = sorted && isParallelizable() ? parallelSortAndGetGroupersIterator() : getGroupersIterator(sorted); if (sorted && spilling && isParallelizable()) { <START> final List<String> mergedDictionary = mergeDictionary(); <END> if (mergedDictionary != null) { return parallelCombine(sortedIterators, mergedDictionary); } } return Groupers.mergeIterators(sortedIterators, sorted ? keyObjComparator : null); }</code><technical_language>merge/merged -- choose</technical_language>

Target:
public CloseableIterator<Entry<KeyType>> iterator(final boolean sorted) { if (!initialized) { throw new ISE("Grouper is not initialized"); } if (closed) { throw new ISE("Grouper is closed"); } final List<CloseableIterator<Entry<KeyType>>> sortedIterators = sorted && isParallelizable() ? parallelSortAndGetGroupersIterator() : getGroupersIterator(sorted); if (sorted && spilling && parallelCombiner != null) { final List<String> dictionary = tryMergeDictionary(); if (dictionary != null) { return parallelCombiner.combine(sortedIterators, dictionary); } } return sorted ? CloseableIterators.mergeSorted(sortedIterators, keyObjComparator) : CloseableIterators.concat(sortedIterators); }
Source:
<code>public void testGetTicketInControlMemberOfTeam() { User user = createUser(); User teammate = createUser(); createTicketForUser(teammate); Team team = createTeamWithCaptain(user); <START> team.addMember(teammate); <END> given(). header(getXAuthTokenHeaderForUser(user)). when(). get(TICKETS_ENDPOINT + "/teammembers"). then(). statusCode(HttpStatus.SC_OK). body("owner.username", containsInAnyOrder(teammate.getUsername())); }</code><technical_language>here, this change is persisted</technical_language>

Target:
public void testGetTicketInControlMemberOfTeam() { User user = createUser(); User teammate = createUser(); createTicketForUser(teammate); Team team = createTeamWithCaptain(user); addMemberToTeam(team, teammate); given(). header(getXAuthTokenHeaderForUser(user)). when(). get(TICKETS_ENDPOINT + "/teammembers"). then(). statusCode(HttpStatus.SC_OK). body("owner.username", containsInAnyOrder(teammate.getUsername())); }
Source:
<code>public void testServerSpanNoURLClientSpanNoURL() throws RetryAttemptException { SpanCache spanCacheMock = Mockito.mock(SpanCache.class); NodeDetailsDeriver nodeDetailsDeriver = new NodeDetailsDeriver(spanCacheMock); Annotation cs = new Annotation(); cs.setTimestamp(0); cs.setValue("cs"); Annotation cr = new Annotation(); cr.setValue("cr"); cr.setTimestamp(1000); Span clientSpan = new Span(Collections.emptyList(), Arrays.asList(cs, cr)); clientSpan.setId("2"); clientSpan.setTraceId("1"); clientSpan.setTimestamp(0L); <START> clientSpan.setDuration(cr.getTimestamp() - cs.getTimestamp()); <END> Annotation sr = new Annotation(); sr.setValue("sr"); sr.setTimestamp(0); Annotation ss = new Annotation(); ss.setTimestamp(1000); ss.setValue("ss"); Span serverSpan = new Span(Collections.emptyList(), Arrays.asList(sr, ss)); serverSpan.setId("2"); serverSpan.setTraceId("1"); serverSpan.setTimestamp(0L); serverSpan.setDuration(ss.getTimestamp() - sr.getTimestamp()); Mockito.when(spanCacheMock.get(null, SpanUniqueIdGenerator.getClientId(serverSpan.getId()))) .thenReturn(clientSpan); assertNull(nodeDetailsDeriver.processOneToOne(null, serverSpan)); }</code><technical_language>necessary timestamp duration</technical_language>

Target:
public void testServerSpanNoURLClientSpanNoURL() throws RetryAttemptException { SpanCache spanCacheMock = Mockito.mock(SpanCache.class); NodeDetailsDeriver nodeDetailsDeriver = new NodeDetailsDeriver(spanCacheMock); Annotation cs = new Annotation(); cs.setValue("cs"); Annotation cr = new Annotation(); cr.setValue("cr"); Span clientSpan = new Span(Collections.emptyList(), Arrays.asList(cs, cr)); clientSpan.setId("2"); clientSpan.setTraceId("1"); Annotation sr = new Annotation(); sr.setValue("sr"); Annotation ss = new Annotation(); ss.setValue("ss"); Span serverSpan = new Span(Collections.emptyList(), Arrays.asList(sr, ss)); serverSpan.setId("2"); serverSpan.setTraceId("1"); Mockito.when(spanCacheMock.get(null, SpanUniqueIdGenerator.getClientId(serverSpan.getId()))) .thenReturn(clientSpan); assertNull(nodeDetailsDeriver.processOneToOne(null, serverSpan)); }
Source:
<code>public void render(TankTileEntity tile, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { FluidTankAnimated tank = tile.getInternalTank(); FluidStack liquid = tank.getFluid(); <START> if (liquid != null) { <END> float height = (liquid.getAmount() - tank.renderOffset) / tank.getCapacity(); if (tank.renderOffset > 1.2f || tank.renderOffset < -1.2f) { tank.renderOffset -= (tank.renderOffset / 12f + 0.1f) * partialTicks; } else { tank.renderOffset = 0; } IVertexBuilder builder = bufferIn.getBuffer(RenderUtil.FLUID_RENDER_TYPE); float d = RenderUtil.FLUID_OFFSET; if (liquid.getFluid().getAttributes().isGaseous(liquid)) { RenderUtil.renderFluidCuboid(liquid, matrixStackIn, builder, combinedLightIn, d, 1f - (d + height), d, 1f - d, 1f - d, 1f - d); } else { RenderUtil.renderFluidCuboid(liquid, matrixStackIn, builder, combinedLightIn, d, d, d, 1f - d, height - d, 1f - d); } } }</code><technical_language>liquid.isEmpty() for 1.15</technical_language>

Target:
public void render(TankTileEntity tile, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { FluidTankAnimated tank = tile.getInternalTank(); FluidStack liquid = tank.getFluid(); if (!liquid.isEmpty()) { float height = (liquid.getAmount() - tank.getRenderOffset()) / tank.getCapacity(); if (tank.getRenderOffset() > 1.2f || tank.getRenderOffset() < -1.2f) { tank.setRenderOffset(tank.getRenderOffset() - ((tank.getRenderOffset() / 12f + 0.1f) * partialTicks)); } else { tank.setRenderOffset(0); } IVertexBuilder builder = bufferIn.getBuffer(RenderUtil.getBlockRenderType()); float d = RenderUtil.FLUID_OFFSET; if (liquid.getFluid().getAttributes().isGaseous(liquid)) { RenderUtil.renderFluidCuboid(liquid, matrixStackIn, builder, combinedLightIn, d, 1f - (d + height), d, 1f - d, 1f - d, 1f - d); } else { RenderUtil.renderFluidCuboid(liquid, matrixStackIn, builder, combinedLightIn, d, d, d, 1f - d, height - d, 1f - d); } } }
Source:
<code>public void edit(final UnitVmModel model) { driver.edit(model); model.getStorageDomain().getItemsChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { addDiskAllocation(model); } }); model.getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { String propName = ((PropertyChangedEventArgs) args).propertyName; if ("Message".equals(propName)) { appendMessage(model.getMessage()); } } }); subTemplateExpanderContent.setVisible(false); model.getIsSubTemplate().getEntityChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { subTemplateExpanderContent.setVisible(model.getIsSubTemplate().getEntity()); <START> nameEditor.setEnabled(!model.getIsSubTemplate().getEntity()); <END> if (!model.getIsSubTemplate().getEntity()) { model.getName().setEntity(""); } else { model.getBaseTemplate().setEntity(model.getTemplate().getEntity()); model.getTemplateVersionName().setEntity(model.getName().getEntity()); model.getName().setEntity(model.getBaseTemplate().getSelectedItem().getName()); } } }); model.getBaseTemplate().getSelectedItemChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { if (model.getBaseTemplate().getSelectedItem() != null && model.getIsSubTemplate().getEntity()) { model.getName().setEntity(model.getBaseTemplate().getSelectedItem().getName()); } } }); }</code><technical_language>This logic is supposed in widget (expect already: subTemplateExpanderContent.setVisible(model.getIsSubTemplate().getEntity()); this is a widget, define view binding model. is supposed manipulate model, some real logic. rest is a logic, model (or specific model behavior). In this case NewTemplateVmModelBehavior</technical_language>

Target:
public void edit(final UnitVmModel model) { driver.edit(model); model.getStorageDomain().getItemsChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { addDiskAllocation(model); } }); model.getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { String propName = ((PropertyChangedEventArgs) args).propertyName; if ("Message".equals(propName)) { appendMessage(model.getMessage()); } } }); subTemplateExpanderContent.setVisible(false); model.getIsSubTemplate().getEntityChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { subTemplateExpanderContent.setVisible(model.getIsSubTemplate().getEntity()); nameEditor.setEnabled(!model.getIsSubTemplate().getEntity()); } }); }
Source:
<code>public void beforeTask(TaskExecution taskExecution) { this.taskExecution = taskExecution; if(this.commandLineArgsProvider == null) { SimpleCommandLineArgsProvider provider = new SimpleCommandLineArgsProvider(); <START> provider.onTaskStartup(taskExecution); <END> this.commandLineArgsProvider = provider; } }</code><technical_language>is this created this instead of listener correctly? This implies deprication sense in place..</technical_language>

Target:
public void beforeTask(TaskExecution taskExecution) { this.taskExecution = taskExecution; if(this.commandLineArgsProvider == null) { SimpleCommandLineArgsProvider provider = new SimpleCommandLineArgsProvider(taskExecution); this.commandLineArgsProvider = provider; } }
Source:
<code>public TestObjectAsync() { try { <START> Thread.sleep(100); <END> Thread.sleep(100); counter = 1; } catch (InterruptedException ie) { throw new RuntimeException(ie); } }</code><technical_language>Is necessary wait 100 milliseconds? Thread.sleep(1). Thread.yield()</technical_language>

Target:
public TestObjectAsync() { try { Thread.sleep(1); Thread.sleep(1); counter = 1; } catch (InterruptedException ie) { throw new RuntimeException(ie); } }
Source:
<code>private boolean validateExtension(String path) { boolean isValid = false; String extension = <START> new org.eclipse.core.runtime.Path(path).getFileExtension(); <END> for (ImageFileFormat element : ImageFileFormat.VALUES) { if (element.getName().equalsIgnoreCase(extension)) { isValid = true; break; } } return isValid; }</code><technical_language>do qualified name a standard import ? call Path.fromOSString(path)</technical_language>

Target:
private boolean validateExtension(String path) { boolean isValid = false; String extension = new Path(path).getFileExtension(); for (ImageFileFormat element : ImageFileFormat.VALUES) { if (element.getName().equalsIgnoreCase(extension)) { isValid = true; break; } } return isValid; }
Source:
<code>public Status update(String table, String key, Map<String, ByteIterator> values) { try { User user = dataStore.get(key); List<String> allFields = Arrays.asList(FIELDS); for (String field : values.keySet()) { if (GoraBenchmarkUtils.isFieldUpdatable(field, values)) { int indexOfFieldInArray = allFields.indexOf(field); user.put(indexOfFieldInArray, values.get(field).toString()); user.setDirty(indexOfFieldInArray); } } dataStore.put(user.getUserId().toString(), user); } catch (Exception e) { <START> LOG.info("There is a problem updating the records \n"+e.getMessage(), e); <END> return Status.ERROR; } return Status.OK; }</code><technical_language>Please parameterized logging, avoid concatenation of Strings</technical_language>

Target:
public Status update(String table, String key, Map<String, ByteIterator> values) { try { User user = dataStore.get(key); List<String> allFields = Arrays.asList(FIELDS); for (String field : values.keySet()) { if (GoraBenchmarkUtils.isFieldUpdatable(field, values)) { int indexOfFieldInArray = allFields.indexOf(field); user.put(indexOfFieldInArray, values.get(field).toString()); user.setDirty(indexOfFieldInArray); } } dataStore.put(user.getUserId().toString(), user); } catch (Exception e) { LOG.info("There is a problem updating the records \n {}", e.getMessage(), e); return Status.ERROR; } return Status.OK; }
Source:
<code><START> public VaultRawSecret obtainSecretInternal(String vaultSecretId) { <END> Path secretPath = vaultPath.resolve(vaultSecretId); if (!Files.exists(secretPath)) { logger.warnf("Cannot find secret %s in %s", vaultSecretId, secretPath); return DefaultVaultRawSecret.forBuffer(Optional.empty()); } try (FileChannel fileChannel = (FileChannel) Files.newByteChannel(secretPath, EnumSet.of(StandardOpenOption.READ))) { MappedByteBuffer mappedByteBuffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, fileChannel.size()); return DefaultVaultRawSecret.forBuffer(Optional.of(mappedByteBuffer)); } catch (IOException e) { throw new RuntimeException(e); } }</code><technical_language>suggestion protected VaultRawSecret obtainSecretInternal(String vaultSecretId) {</technical_language>

Target:
protected VaultRawSecret obtainSecretInternal(String vaultSecretId) { Path secretPath = vaultPath.resolve(vaultSecretId); if (!Files.exists(secretPath)) { logger.warnf("Cannot find secret %s in %s", vaultSecretId, secretPath); return DefaultVaultRawSecret.forBuffer(Optional.empty()); } try (FileChannel fileChannel = (FileChannel) Files.newByteChannel(secretPath, EnumSet.of(StandardOpenOption.READ))) { MappedByteBuffer mappedByteBuffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, fileChannel.size()); return DefaultVaultRawSecret.forBuffer(Optional.of(mappedByteBuffer)); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code><START> public double pidGetSafely() { <END> return pidGet(); }</code><technical_language>utilize safely methods catch exceptions. read a spark encoder throw exception? super confident won't, throw catch errors in manner CANEncoder</technical_language>

Target:
public double pidGetSafely() throws InvalidSensorException { switch (pidSource) { case kDisplacement: return getDistance(); case kRate: return getRate(); default: return getDistance(); } }
Source:
<code>public void endVisit(@Nonnull JSynchronizedBlock jSyncBock) { if <START> (!jSyncBock.getLockExpr().getType().isSameType(ams)) <END> { return; } JBlock newSyncBody = new JBlock(jSyncBock.getSourceInfo()); newSyncBody.addStmt(makeBoostCall(jSyncBock.getSourceInfo())); JLocal catchVar = new JLocal( jSyncBock.getSourceInfo(), "blr.ex", throwable, JModifier.SYNTHETIC, (JMethodBody) method.getBody()); JTryStatement tryStmt = makeTryStatement(jSyncBock.getSourceInfo(), jSyncBock.getSynchronizedBlock(), catchVar); newSyncBody.addStmt(tryStmt); TransformationRequest tr = new TransformationRequest(jSyncBock.getParent()); tr.append(new Replace(jSyncBock.getSynchronizedBlock(), newSyncBody)); tr.commit(); System.out.println("Inserted boost / reset Calls."); }</code><technical_language>isSameType that? Other</technical_language>

Target:
public void endVisit(@Nonnull JSynchronizedBlock jSyncBock) { assert ams != null && throwable != null && boostMethodId != null && resetMethodId != null; if (!jSyncBock.getLockExpr().getType().isSameType(ams)) { return; } JBlock newSyncBody = new JBlock(jSyncBock.getSourceInfo()); newSyncBody.addStmt(makeBoostCall(jSyncBock.getSourceInfo())); JLocal catchVar = new JLocal( jSyncBock.getSourceInfo(), "blr.ex", throwable, JModifier.SYNTHETIC, (JMethodBody) method.getBody()); JTryStatement tryStmt = makeTryStatement(jSyncBock.getSourceInfo(), jSyncBock.getSynchronizedBlock(), catchVar); newSyncBody.addStmt(tryStmt); tr.append(new Replace(jSyncBock.getSynchronizedBlock(), newSyncBody)); }
Source:
<code>private boolean isConflictVsMoveAndDelete(Diff target, boolean leftToRight) { <START> boolean moveAndDeleteConflict = false; <END> if (!ConflictKind.REAL.equals(target.getConflict().getKind())) { return moveAndDeleteConflict; } Conflict conflict = target.getConflict(); Collection<Diff> deleteDiffs = Collections2.filter(conflict.getDifferences(), ofKind(DifferenceKind.DELETE)); Collection<Diff> moveDiffs = Collections2.filter(conflict.getDifferences(), ofKind(DifferenceKind.MOVE)); if (moveDiffs.size() == 1) { IEqualityHelper equalityHelper = target.getMatch().getComparison().getEqualityHelper(); ReferenceChange moveDiff = (ReferenceChange)moveDiffs.iterator().next(); ReferenceChange deleteDiff = null; for (Diff diff : deleteDiffs) { if (diff instanceof ReferenceChange) { ReferenceChange temp = (ReferenceChange)diff; boolean matchingAttributeValues = equalityHelper.matchingAttributeValues(moveDiff .getValue(), temp.getValue()); if (matchingAttributeValues) { deleteDiff = temp; } } } if (deleteDiff != null) { if (leftToRight && DifferenceSource.LEFT.equals(moveDiff.getSource())) { if (moveDiff.getMatch().getLeft() != null && deleteDiff.getMatch().getRight() == null) { moveAndDeleteConflict = true; } } else if (!leftToRight && DifferenceSource.RIGHT.equals(moveDiff.getSource())) { if (moveDiff.getMatch().getRight() != null && deleteDiff.getMatch().getLeft() == null) { moveAndDeleteConflict = true; } } } } return moveAndDeleteConflict; }</code><technical_language>name "result"</technical_language>

Target:
private boolean isConflictVsMoveAndDelete(Diff target, boolean leftToRight) { boolean result = false; if (target.getConflict().getKind() != REAL) { return false; } Conflict conflict = target.getConflict(); ReferenceChange moveDiff = null; ReferenceChange deleteDiff; if (target.getKind() == DELETE) { deleteDiff = (ReferenceChange)target; Collection<Diff> moveDiffs = Collections2.filter(conflict.getDifferences(), ofKind(MOVE)); if (moveDiffs.size() == 1) { moveDiff = (ReferenceChange)moveDiffs.iterator().next(); } } else { return false; } if (moveDiff != null) { IEqualityHelper equalityHelper = target.getMatch().getComparison().getEqualityHelper(); result = equalityHelper.matchingAttributeValues(moveDiff.getValue(), deleteDiff.getValue()); } return result; }
Source:
<code>protected ISeries addSeries(String seriesName) { if (seriesName == null) { return null; } ISeriesSet seriesSet = getSwtChart().getSeriesSet(); int seriesCount = seriesSet.getSeries().length; ICommonXAxisModel currentModel = getModel(); IYSeries ySeries = currentModel.findSeries(seriesName); if (ySeries == null) { setSeries(seriesName, new double[currentModel.getXAxis().length]); currentModel = getModel(); ySeries = currentModel.findSeries(seriesName); } if (ySeries == null) { return null; } String colorTxt = ySeries.getColor(); Color color = getColor(seriesName, colorTxt); if (ySeries.getSeriesType() == IYSeries.BAR) { <START> IBarSeries barSeries = (IBarSeries) seriesSet.createSeries(SeriesType.BAR, seriesName); barSeries.enableStack(true); barSeries.setBarColor(color); barSeries.setBarPadding(0); barSeries.setVisible(true); <END> return barSeries; } ILineSeries lineSeries = (ILineSeries) seriesSet.createSeries(SeriesType.LINE, seriesName); boolean isScatter = IYSeries.SCATTER.equals(ySeries.getSeriesType()); lineSeries.enableArea(IYSeries.AREA.equals(ySeries.getSeriesType())); lineSeries.setLineStyle(!isScatter ? LINE_STYLES.get(getLineStyle(ySeries.getSeriesType(), seriesCount)) : LineStyle.NONE); lineSeries.setSymbolType(isScatter ? PlotSymbolType.DIAMOND : PlotSymbolType.NONE); lineSeries.setLineColor(color); lineSeries.setVisible(true); return lineSeries; }</code><technical_language>extract createBarSeries</technical_language>

Target:
protected ILineSeries addSeries(String seriesName) { if (seriesName == null) { return null; } ISeriesSet seriesSet = getSwtChart().getSeriesSet(); int seriesCount = seriesSet.getSeries().length; ICommonXAxisModel currentModel = getModel(); IYSeries ySeries = currentModel.findSeries(seriesName); if (ySeries == null) { setSeries(seriesName, new double[currentModel.getXAxis().length]); currentModel = getModel(); ySeries = currentModel.findSeries(seriesName); } if (ySeries == null) { return null; } ILineSeries series = (ILineSeries) seriesSet.createSeries(SeriesType.LINE, seriesName); boolean isScatter = IYSeries.SCATTER.equals(ySeries.getSeriesType()); series.setVisible(true); series.enableArea(IYSeries.AREA.equals(ySeries.getSeriesType())); series.setLineStyle(!isScatter ? LINE_STYLES.get(getLineStyle(ySeries.getSeriesType(), seriesCount)) : LineStyle.NONE); series.setSymbolType(isScatter ? PlotSymbolType.DIAMOND : PlotSymbolType.NONE); String colorTxt = ySeries.getColor(); series.setLineColor(getColor(seriesName, colorTxt)); return series; }
Source:
<code>private void addCrossCompilationOptions(final ImmutableList.Builder<String> command) { if (shouldCrossCompile()) { command.add("-j"); javacOptions.appendOptionsTo(new OptionsConsumer() { @Override public void addOptionValue(String option, String value) { if (!option.equals("sourcepath")) { command.add("-J" + String.format("%s=%s", option, value)); <START> } <END> } @Override public void addFlag(String flagName) { command.add("-F" + flagName); } @Override public void addExtras(Collection<String> extras) { for (String extra : extras) { if (extra.startsWith("-")) { addFlag(extra.substring(1)); } else { addFlag(extra); } } } }, filesystem.getAbsolutifier()); } }</code><technical_language>This logic a tiny bit clearer if a return in if block common case</technical_language>

Target:
private void addCrossCompilationOptions(final ImmutableList.Builder<String> command) { if (shouldCrossCompile()) { command.add("-j"); javacOptions.appendOptionsTo(new OptionsConsumer() { @Override public void addOptionValue(String option, String value) { if (option.equals("sourcepath")) { return; } command.add("-J" + String.format("%s=%s", option, value)); } @Override public void addFlag(String flagName) { command.add("-F" + flagName); } @Override public void addExtras(Collection<String> extras) { for (String extra : extras) { if (extra.startsWith("-")) { addFlag(extra.substring(1)); } else { addFlag(extra); } } } }, filesystem.getAbsolutifier()); } }
Source:
<code>private static boolean isHandsontableAttribute(Node attribute) { return checkForAttributeWithSpecificValue(attribute, "id", "enrollSpreadsheet") <START> || checkForAttributeWithSpecificValue(attribute, "id", "dataSpreadsheet"); <END> }</code><technical_language>give class name check for instead</technical_language>

Target:
private static boolean isHandsontableAttribute(Node attribute) { return checkForAttributeWithSpecificValue(attribute, "id", "enrollSpreadsheet") || checkForAttributeWithSpecificValue(attribute, "id", "existingDataSpreadsheet"); }
Source:
<code>static HAProxyMessage decodeHeader(String header) { if (header == null) { throw new HAProxyProtocolException("header"); } String[] parts = header.split(" "); int numParts = parts.length; if (numParts < 2) { throw new HAProxyProtocolException( "invalid header: " + header + " (expected: 'PROXY' and proxied protocol values)"); } if (!"PROXY".equals(parts[0])) { throw new HAProxyProtocolException("unknown identifier: " + parts[0]); } HAProxyProxiedProtocol protAndFam; try { protAndFam = HAProxyProxiedProtocol.valueOf(parts[1]); } catch (IllegalArgumentException e) { throw new HAProxyProtocolException(e); } if (protAndFam != HAProxyProxiedProtocol.TCP4 && protAndFam != HAProxyProxiedProtocol.TCP6 && protAndFam != HAProxyProxiedProtocol.UNKNOWN) { throw new HAProxyProtocolException("unsupported v1 proxied protocol: " + parts[1]); } if (protAndFam == HAProxyProxiedProtocol.UNKNOWN) { return unknownMsg(HAProxyProtocolVersion.V1, HAProxyCommand.PROXY); } if (numParts != 6) { throw new HAProxyProtocolException("invalid TCP4/6 header: " + header + " (expected: 6 parts)"); } try { return new HAProxyMessage( HAProxyProtocolVersion.V1, HAProxyCommand.PROXY, protAndFam, parts[2], parts[3], parts[4], parts[5]); <START> } catch (Exception e) { <END> throw new HAProxyProtocolException("invalid HAProxy message", e); } }</code><technical_language>this catch RuntimeException</technical_language>

Target:
static HAProxyMessage decodeHeader(String header) { if (header == null) { throw new HAProxyProtocolException("header"); } String[] parts = header.split(" "); int numParts = parts.length; if (numParts < 2) { throw new HAProxyProtocolException( "invalid header: " + header + " (expected: 'PROXY' and proxied protocol values)"); } if (!"PROXY".equals(parts[0])) { throw new HAProxyProtocolException("unknown identifier: " + parts[0]); } HAProxyProxiedProtocol protAndFam; try { protAndFam = HAProxyProxiedProtocol.valueOf(parts[1]); } catch (IllegalArgumentException e) { throw new HAProxyProtocolException(e); } if (protAndFam != HAProxyProxiedProtocol.TCP4 && protAndFam != HAProxyProxiedProtocol.TCP6 && protAndFam != HAProxyProxiedProtocol.UNKNOWN) { throw new HAProxyProtocolException("unsupported v1 proxied protocol: " + parts[1]); } if (protAndFam == HAProxyProxiedProtocol.UNKNOWN) { return unknownMsg(HAProxyProtocolVersion.V1, HAProxyCommand.PROXY); } if (numParts != 6) { throw new HAProxyProtocolException("invalid TCP4/6 header: " + header + " (expected: 6 parts)"); } try { return new HAProxyMessage( HAProxyProtocolVersion.V1, HAProxyCommand.PROXY, protAndFam, parts[2], parts[3], parts[4], parts[5]); } catch (RuntimeException e) { throw new HAProxyProtocolException("invalid HAProxy message", e); } }
Source:
<code>public void cantHandleConnectionsWithWrongDomainOnOrigin() throws Exception { final String head = new RsPrint( new TkCORS( new TkFixed(new RsText()), "<LINK_0>", "<LINK_1>" ).act( new RqWithHeaders( new RqFake(), new HashSet<String>( Arrays.asList("Origin: <LINK_2>") ) ) ) ).printHead(); MatcherAssert.assertThat( "It was expected a 403 HTTP status.", head, <START> Matchers.containsString("HTTP/1.1 403") <END> ); MatcherAssert.assertThat( "Wrong value on Access Control Allow Credentias param.", head, Matchers.containsString("Access-Control-Allow-Credentials: false") ); }</code><technical_language>@antonini Matchers.allOf() combine assertions get rid of one-time variable head</technical_language>

Target:
public void cantHandleConnectionsWithWrongDomainOnOrigin() throws Exception { MatcherAssert.assertThat( "Wrong value on header.", new RsPrint( new TkCORS( new TkFixed(new RsText()), "<LINK_0>", "<LINK_1>" ).act( new RqWithHeaders( new RqFake(), "Origin: <LINK_2>" ) ) ).printHead(), Matchers.allOf( Matchers.containsString("HTTP/1.1 403"), Matchers.containsString( "Access-Control-Allow-Credentials: false" ) ) ); }
Source:
<code>public void prepareRun(BatchSinkContext context) throws DatasetManagementException { Map<String, String> properties = getProperties(); if (pluginConfig.containsMacro(Properties.BatchReadableWritable.NAME)) { <START> if (!context.datasetExists(properties.get(Properties.BatchReadableWritable.NAME))) { <END> context.createDataset(properties.get(Properties.BatchReadableWritable.NAME), properties.get(Properties.BatchReadableWritable.TYPE), DatasetProperties.builder().addAll(properties).build()); } } context.addOutput(properties.get(Properties.BatchReadableWritable.NAME)); }</code><technical_language>this, I a BatchReadableWritableConfig a single macro enabled name field other configs extend</technical_language>

Target:
public void prepareRun(BatchSinkContext context) throws DatasetManagementException { Map<String, String> properties = getProperties(); if (batchReadableWritableConfig.containsMacro(Properties.BatchReadableWritable.NAME)) { if (!context.datasetExists(properties.get(Properties.BatchReadableWritable.NAME))) { context.createDataset(properties.get(Properties.BatchReadableWritable.NAME), properties.get(Properties.BatchReadableWritable.TYPE), DatasetProperties.builder().addAll(properties).build()); } } context.addOutput(properties.get(Properties.BatchReadableWritable.NAME)); }
Source:
<code>public boolean isValid(BashPsiBuilder builder) { IElementType token = builder.rawLookup(1); return token != null && builder.getTokenType() == WORD <START> && "!".equals(builder.getTokenText()) <END> && !ParserUtil.isWhitespaceOrLineFeed(token); }</code><technical_language>again, similar</technical_language>

Target:
public boolean isValid(BashPsiBuilder builder) { IElementType token = builder.rawLookup(1); return token != null && ParserUtil.isWord(builder, "!") && !ParserUtil.isWhitespaceOrLineFeed(token); }
Source:
<code>public List<Attribute> getAttributesByAttributeDefinition(PerunSession sess, AttributeDefinition attributeDefinition) throws InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException, PrivilegeException { Utils.checkPerunSession(sess); getAttributesManagerBl().checkAttributeExists(sess, attributeDefinition); if(!AuthzResolver.isAuthorized(sess, Role.PERUNADMIN) && !AuthzResolver.isAuthorized(sess, Role.PERUNOBSERVER)) { <START> throw new PrivilegeException("For getting entityless attributes principal need to be PerunAdmin or PerunObserver."); <END> } return getAttributesManagerBl().setWritableTrue(sess, getAttributesManagerBl().getAttributesByAttributeDefinition(sess, attributeDefinition)); }</code><technical_language>this method process type of attributes, exception text is misleading. get eg. facility attributes non-null facilities attribute definition</technical_language>

Target:
public List<Attribute> getAttributesByAttributeDefinition(PerunSession sess, AttributeDefinition attributeDefinition) throws InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException, PrivilegeException { Utils.checkPerunSession(sess); getAttributesManagerBl().checkAttributeExists(sess, attributeDefinition); if(!AuthzResolver.isAuthorized(sess, Role.PERUNADMIN) && !AuthzResolver.isAuthorized(sess, Role.PERUNOBSERVER)) { throw new PrivilegeException("For getting the attributes, you need to be PerunAdmin or PerunObserver."); } return getAttributesManagerBl().setWritableTrue(sess, getAttributesManagerBl().getAttributesByAttributeDefinition(sess, attributeDefinition)); }
Source:
<code>default void addConversant(Conversant conversant) { <START> addConversant(conversant, ExternalChatHandlers.deleteAll()); <END> }</code><technical_language>this some kind of default archetype</technical_language>

Target:
default void addConversant(Conversant conversant) { addConversant(conversant, getArchetype().getDefaultChatHandlerType()); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { RepositoryGroups groups = new RepositoryGroups(); Optional<String> <START> optionalGroupName = <END> getNewGroupName( getActiveShell(event), UIText.RepositoriesView_AddRepoGroup_title, groups, ""); if (optionalGroupName.isPresent()) { String group = optionalGroupName.get(); Optional<UUID> groupUUID = groups.addGroup(group); if (groupUUID.isPresent()) { List<String> repoDirs = getSelectedRepositories(event); if (!repoDirs.isEmpty()) { groups.addRepositoriesToGroup(groupUUID.get(), repoDirs); } getView(event).refresh(); } } return null; }</code><technical_language>"groupName"</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { RepositoryGroups groups = new RepositoryGroups(); String groupName = getNewGroupName( getActiveShell(event), UIText.RepositoriesView_RepoGroup_Add_Title, groups, ""); if (groupName != null) { UUID groupId = groups.addGroup(groupName); List<String> repoDirs = getSelectedRepositories(event); if (!repoDirs.isEmpty()) { groups.addRepositoriesToGroup(groupId, repoDirs); } getView(event).refresh(); } return null; }
Source:
<code>void findNextHostAndQuery() { try { Host host; while (!isDone.get() && (host = queryPlan.next()) != null && !queryStateRef.get().isCancelled()) { <START> HostConnectionPool pool = manager.pools.get(host); <END> if (pool == null || pool.isClosed()) continue; if (logger.isTraceEnabled()) logger.trace("[{}] Querying node {}", id, host); if (query(host)) return; } reportNoMoreHosts(this); } catch (Exception e) { setFinalException(null, new DriverInternalError("An unexpected error happened while sending requests", e)); } }</code><technical_language>is motivation for checking pool _and_ query method</technical_language>

Target:
void findNextHostAndQuery() { try { Host host; while (!isDone.get() && (host = queryPlan.next()) != null && !queryStateRef.get().isCancelled()) { if (query(host)) return; } reportNoMoreHosts(this); } catch (Exception e) { setFinalException(null, new DriverInternalError("An unexpected error happened while sending requests", e)); } }
Source:
<code>public void keepDirectoryImportByHttpsUrlTest() throws Exception { currentProjectName = keepDirectoryRepo.getName() + "Https"; projectExplorer.waitProjectExplorer(); makeKeepDirectoryFromGitUrl( keepDirectoryRepo.getHtmlUrl(), currentProjectName, DIRECTORY_NAME_2); projectExplorer.waitItem(currentProjectName); projectExplorer.expandPathInProjectExplorerAndOpenFile( currentProjectName + "/my-lib/src/test/java/hello", "SayHelloTest.java"); editor.waitActive(); projectExplorer.waitItemInvisibility(currentProjectName + "/my-lib/src/main"); projectExplorer.waitItemInvisibility(currentProjectName + "/my-webapp"); projectExplorer.openContextMenuByPathSelectedItem(currentProjectName + "/my-lib/src/test"); projectExplorer.clickOnItemInContextMenu(GO_INTO); <START> projectExplorer.waitDisappearItemByPath(currentProjectName + "/src/my-lib"); <END> projectExplorer.waitVisibilityByName("test"); projectExplorer.waitVisibilityByName("java"); projectExplorer.waitVisibilityByName("hello"); projectExplorer.waitVisibilityByName("SayHelloTest.java"); projectExplorer.openContextMenuByPathSelectedItem(currentProjectName + "/my-lib/src/test"); projectExplorer.clickOnItemInContextMenu(GO_BACK); projectExplorer.waitItem(currentProjectName + "/my-lib/src"); }</code><technical_language>divide action part ffrom verification part of test empty row test scenario more obvious</technical_language>

Target:
public void keepDirectoryImportByHttpsUrlTest() throws Exception { projectExplorer.waitProjectExplorer(); currentProjectName = keepDirectoryRepo.getName() + "Https"; makeKeepDirectoryFromGitUrl(keepDirectoryRepo.getHtmlUrl(), currentProjectName, TEST_DIRECTORY); projectExplorer.waitItem(currentProjectName); projectExplorer.expandPathInProjectExplorerAndOpenFile( currentProjectName + "/my-lib/src/test/java/hello", "SayHelloTest.java"); editor.waitActive(); projectExplorer.waitItemInvisibility(currentProjectName + "/my-lib/src/main"); projectExplorer.waitItemInvisibility(currentProjectName + "/my-webapp"); projectExplorer.openContextMenuByPathSelectedItem(currentProjectName + "/my-lib/src/test"); projectExplorer.clickOnItemInContextMenu(GO_INTO); projectExplorer.waitDisappearItemByPath(currentProjectName + "/src/my-lib"); projectExplorer.waitVisibilityByName("test"); projectExplorer.waitVisibilityByName("java"); projectExplorer.waitVisibilityByName("hello"); projectExplorer.waitVisibilityByName("SayHelloTest.java"); projectExplorer.openContextMenuByPathSelectedItem(currentProjectName + "/my-lib/src/test"); projectExplorer.clickOnItemInContextMenu(GO_BACK); projectExplorer.waitItem(currentProjectName + "/my-lib/src"); }
Source:
<code>public HttpResponse doStopBuild(@CheckForNull @QueryParameter(fixEmpty = true) String runExtId) { lock.writeLock().lock(); try { if (executable != null) { if (runExtId == null || runExtId.isEmpty() || (executable instanceof Run && runExtId.equals(((Run<?,?>) executable).getExternalizableId()))) { <START> getParentOf(executable).getOwnerTask().checkAbortPermission(); <END> interrupt(); } } } finally { lock.writeLock().unlock(); } return HttpResponses.forwardToPreviousPage(); }</code><technical_language>safer behavior in case a Run object? avoid modifying behavior</technical_language>

Target:
public HttpResponse doStopBuild(@CheckForNull @QueryParameter(fixEmpty = true) String runExtId) { lock.writeLock().lock(); try { if (executable != null) { if (runExtId == null || runExtId.isEmpty() || ! (executable instanceof Run) || (executable instanceof Run && runExtId.equals(((Run<?,?>) executable).getExternalizableId()))) { getParentOf(executable).getOwnerTask().checkAbortPermission(); interrupt(); } } } finally { lock.writeLock().unlock(); } return HttpResponses.forwardToPreviousPage(); }
Source:
<code>public MaildirMessageName delete(final MailboxSession session, final MessageUid uid) throws MailboxException { return locker.executeWithLock(session, path, () -> { File uidList = uidFile; FileReader fileReader = null; BufferedReader reader = null; PrintWriter writer = null; MaildirMessageName deletedMessage = null; try { fileReader = new FileReader(uidList); reader = new BufferedReader(fileReader); readUidListHeader(reader.readLine()); ArrayList<String> lines = new ArrayList<>(); String line; int lineNumber = 1; <START> for (; (line = reader.readLine()) != null; lineNumber++) { <END> int gap = line.indexOf(" "); if (gap == -1) { LOGGER.info("Corrupted entry in uid-file line {}", uidList, lineNumber); continue; } if (uid.equals(MessageUid.of(Long.valueOf(line.substring(0, line.indexOf(" ")))))) { deletedMessage = newMaildirMessageName(MaildirFolder.this, line.substring(gap + 1, line.length())); messageCount--; } else { lines.add(line); } } if (deletedMessage != null) { FileUtils.forceDelete(deletedMessage.getFile()); writer = new PrintWriter(uidList); writer.println(createUidListHeader()); for (String entry : lines) writer.println(entry); } return deletedMessage; } catch (IOException e) { throw new MailboxException("Unable to delete msg with uid " + uid, e); } finally { IOUtils.closeQuietly(writer); IOUtils.closeQuietly(reader); IOUtils.closeQuietly(fileReader); } }, true); }</code><technical_language>idem</technical_language>

Target:
public MaildirMessageName delete(final MailboxSession session, final MessageUid uid) throws MailboxException { return locker.executeWithLock(session, path, () -> { File uidList = uidFile; FileReader fileReader = null; BufferedReader reader = null; PrintWriter writer = null; MaildirMessageName deletedMessage = null; try { fileReader = new FileReader(uidList); reader = new BufferedReader(fileReader); readUidListHeader(reader.readLine()); ArrayList<String> lines = new ArrayList<>(); String line; int lineNumber = 0; while ((line = reader.readLine()) != null) { lineNumber++; int gap = line.indexOf(" "); if (gap == -1) { LOGGER.info("Corrupted entry in uid-file line {}", uidList, lineNumber); continue; } if (uid.equals(MessageUid.of(Long.valueOf(line.substring(0, line.indexOf(" ")))))) { deletedMessage = newMaildirMessageName(MaildirFolder.this, line.substring(gap + 1, line.length())); messageCount--; } else { lines.add(line); } } if (deletedMessage != null) { FileUtils.forceDelete(deletedMessage.getFile()); writer = new PrintWriter(uidList); writer.println(createUidListHeader()); for (String entry : lines) writer.println(entry); } return deletedMessage; } catch (IOException e) { throw new MailboxException("Unable to delete msg with uid " + uid, e); } finally { IOUtils.closeQuietly(writer); IOUtils.closeQuietly(reader); IOUtils.closeQuietly(fileReader); } }, true); }
Source:
<code>public byte[] serialize() { <START> byte[] value = new byte[0]; <END> if (this.bool){ value = new byte[1]; } return value; }</code><technical_language>arrays static finals. save allocating new time</technical_language>

Target:
public byte[] serialize() { if (this.bool){ return TRUE_SERIAL; } else { return FALSE_SERIAL; } }
Source:
<code><START> public static Set<String> getAllProvidedQueriesNameForBusinessObject(final BusinessObject businessObject) { <END> final Set<String> queryNames = new HashSet<String>(); if (!containsQuertWithName(businessObject, getQueryName(Field.PERSISTENCE_ID))) { final SimpleField persistenceIdField = new SimpleField(); persistenceIdField.setName(Field.PERSISTENCE_ID); persistenceIdField.setType(FieldType.LONG); queryNames.add(createQueryNameForField(persistenceIdField)); } for (final UniqueConstraint uc : businessObject.getUniqueConstraints()) { queryNames.add(createQueryNameForUniqueConstraint(uc)); } for (final Field f : businessObject.getFields()) { if (f instanceof SimpleField) { if (f.isCollection() == null || !f.isCollection()) { queryNames.add(createQueryNameForField(f)); } } } queryNames.add(createSelectAllQueryName()); return queryNames; }</code><technical_language>remove "all" in this method name? bring</technical_language>

Target:
public static Set<String> getAllProvidedQueriesNameForBusinessObject(final BusinessObject businessObject) { final Set<String> queryNames = new HashSet<String>(); if (!containsQueryWithName(businessObject, getQueryName(Field.PERSISTENCE_ID))) { final SimpleField persistenceIdField = new SimpleField(); persistenceIdField.setName(Field.PERSISTENCE_ID); persistenceIdField.setType(FieldType.LONG); queryNames.add(createQueryNameForField(persistenceIdField)); } for (final UniqueConstraint uc : businessObject.getUniqueConstraints()) { queryNames.add(createQueryNameForUniqueConstraint(uc)); } for (final Field f : businessObject.getFields()) { if (f instanceof SimpleField) { if (f.isCollection() == null || !f.isCollection()) { queryNames.add(createQueryNameForField(f)); } } } queryNames.add(createSelectAllQueryName()); return queryNames; }
Source:
<code>public void run() { Set<PartitionId> partitionIds = storageManager.getPartitionIds(); Pair<StatsSnapshot, List<String>> result = collectAndAggregate(partitionIds); List<String> unreachableStores = result.getSecond(); StatsHeader statsHeader = new StatsHeader(Description.QUOTA, SystemTime.getInstance().milliseconds(), partitionIds.size(), partitionIds.size() - unreachableStores.size(), unreachableStores); try { publish(new StatsWrapper(statsHeader, result.getFirst())); logger.info("Stats snapshot published to " + statsOutputFile.getAbsolutePath()); } catch (IOException e) { <START> logger.error("IOException when publishing stats to " + statsOutputFile.getAbsolutePath(), e); <END> } }</code><technical_language>metrics useful errors propagated swallowed. other useful metrics (how long etc)</technical_language>

Target:
public void run() { long totalFetchAndAggregateStartTimeMs = time.milliseconds(); StatsSnapshot aggregatedSnapshot = new StatsSnapshot(0L, null); List<String> unreachableStores = new ArrayList<>(); Iterator<PartitionId> iterator = totalPartitionIds.iterator(); while (!cancelled && iterator.hasNext()) { PartitionId partitionId = iterator.next(); collectAndAggregate(aggregatedSnapshot, partitionId, unreachableStores); } if (!cancelled) { metrics.totalFetchAndAggregateTime.update(time.milliseconds() - totalFetchAndAggregateStartTimeMs); StatsHeader statsHeader = new StatsHeader(Description.QUOTA, time.milliseconds(), totalPartitionIds.size(), totalPartitionIds.size() - unreachableStores.size(), unreachableStores); try { publish(new StatsWrapper(statsHeader, aggregatedSnapshot)); logger.info("Stats snapshot published to {}", statsOutputFile.getAbsolutePath()); } catch (IOException e) { metrics.statsPublishFailureCount.inc(); logger.error("IOException when publishing stats to {}", statsOutputFile.getAbsolutePath(), e); } } }
Source:
<code>public List<String> validateQuestionDetails() { List<String> errors = new ArrayList<>(); if (recommendedLength != null && recommendedLength < 0) { <START> errors.add(Const.FeedbackQuestion.TEXT_ERROR_INVALID_RECOMMENDED_LENGTH); <END> } return errors; }</code><technical_language>this time fix validation logic: recommendedLength more 0, recommendedLength = 0 sense</technical_language>

Target:
public List<String> validateQuestionDetails() { List<String> errors = new ArrayList<>(); if (recommendedLength != null && recommendedLength < 1) { errors.add(Const.FeedbackQuestion.TEXT_ERROR_INVALID_RECOMMENDED_LENGTH); } return errors; }
Source:
<code>public void testParseRowKeepNullColumns() throws IOException { final JsonInputFormat format = new JsonInputFormat( new JSONPathSpec( true, ImmutableList.of( new JSONPathFieldSpec(JSONPathFieldType.PATH, "path_omg", "$.o.mg") ), true ), null ); final ByteEntity source = new ByteEntity( StringUtils.toUtf8("{\"timestamp\":\"2019-01-01\",\"bar\":null,\"foo\":\"x\",\"o\":{\"mg\":null}}") ); final InputEntityReader reader = format.createReader( new InputRowSchema( new TimestampSpec("timestamp", "iso", null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(Collections.emptyList())), Collections.emptyList() ), source, null ); final int numExpectedIterations = 1; try (CloseableIterator<InputRow> iterator = reader.read()) { int numActualIterations = 0; while (iterator.hasNext()) { final InputRow row = iterator.next(); Assert.assertEquals(Arrays.asList("path_omg", "timestamp", "bar", "foo"), row.getDimensions()); <START> Assert.assertEquals(Collections.emptyList(), row.getDimension("bar")); <END> Assert.assertEquals("x", Iterables.getOnlyElement(row.getDimension("foo"))); Assert.assertEquals(Collections.emptyList(), row.getDimension("path_omg")); numActualIterations++; } } }</code><technical_language>nit: Assert.assertTrue(row.getDimension("bar").isEmpty());</technical_language>

Target:
public void testParseRowKeepNullColumns() throws IOException { final JsonInputFormat format = new JsonInputFormat( new JSONPathSpec( true, ImmutableList.of( new JSONPathFieldSpec(JSONPathFieldType.PATH, "path_omg", "$.o.mg") ) ), null, true ); final ByteEntity source = new ByteEntity( StringUtils.toUtf8("{\"timestamp\":\"2019-01-01\",\"bar\":null,\"foo\":\"x\",\"o\":{\"mg\":null}}") ); final InputEntityReader reader = format.createReader( new InputRowSchema( new TimestampSpec("timestamp", "iso", null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(Collections.emptyList())), Collections.emptyList() ), source, null ); final int numExpectedIterations = 1; try (CloseableIterator<InputRow> iterator = reader.read()) { int numActualIterations = 0; while (iterator.hasNext()) { final InputRow row = iterator.next(); Assert.assertEquals(Arrays.asList("path_omg", "timestamp", "bar", "foo"), row.getDimensions()); Assert.assertTrue(row.getDimension("bar").isEmpty()); Assert.assertEquals("x", Iterables.getOnlyElement(row.getDimension("foo"))); Assert.assertTrue(row.getDimension("path_omg").isEmpty()); numActualIterations++; } Assert.assertEquals(numExpectedIterations, numActualIterations); } }
Source:
<code>public void abort() { try (Connection connection = this.connection; PreparedStatement statement = this.statement) { connection.rollback(); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } finally { try { <START> jdbcClient.rollbackCreateTable(handle); <END> } catch (Exception e) { log.warn(e, format("Failed to cleanup temporary table: %s", handle.getTemporaryTableName())); } } }</code><technical_language>is this needed if transaction is rollbacked, table dropped well, I right? JdbcPageSink created this table, fishy drops this</technical_language>

Target:
public void abort() { try (Connection connection = this.connection; PreparedStatement statement = this.statement) { connection.rollback(); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } }
Source:
<code>public Map<String, String> get() { <START> if (tags == null) { return Collections.unmodifiableMap(new HashMap<>()); } <END> return Collections.unmodifiableMap(tags); }</code><technical_language>suggestion return Collections.unmodifiableMap(tags == null ? new HashMap<>() : tags)</technical_language>

Target:
public Map<String, String> get() { return Collections.unmodifiableMap(tags == null ? new HashMap<>() : tags); }