auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private void writeLoop(LedgerMetadata currentLocal, CompletableFuture<LedgerMetadata> promise) { <END> LOG.info("{} starting write loop iteration, attempt {}", logContext, writeLoopCounter.incrementAndGet()); try { if (needsTransformation.needsUpdate(currentLocal)) { LedgerMetadata transformed = transform.apply(currentLocal); writeToStore(ledgerId, transformed) .whenComplete((writtenMetadata, ex) -> { if (ex == null) { if (updateLocalValue.test(currentLocal, writtenMetadata)) { LOG.info("{} success", logContext); promise.complete(writtenMetadata); } else { LOG.info("{} local value changed while we were writing, try again", logContext); writeLoop(currentLocalValue.get(), promise); } } else if (ex instanceof BKException.BKMetadataVersionException) { LOG.info("{} conflict writing metadata to store, update local value and try again", logContext); updateFromStore(ledgerId).whenComplete((readMetadata, readEx) -> { if (readEx == null) { writeLoop(readMetadata, promise); } else { LOG.info("{} error updating local value", logContext); promise.completeExceptionally(readEx); } }); } else { LOG.info("{} Error writing metadata to store", logContext, ex); promise.completeExceptionally(ex); } }); } else { LOG.info("{} Update not needed, completing", logContext); promise.complete(currentLocal); } } catch (Exception e) { LOG.error("{} Exception updating", logContext, e); promise.completeExceptionally(e); } }</code><technical_language>a today</technical_language>

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

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

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

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

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

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

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

Target:
public void setActualSizeFromDiskImage(long size) { actualSizeInBytes = size; setActualSize(getActualSizeInBytes() * 1.0 / (1024 * 1024 * 1024)); }
Source:
<code>public SqlToRelConverter( RelOptTable.ViewExpander viewExpander, SqlValidator validator, Prepare.CatalogReader catalogReader, RelOptCluster cluster, SqlRexConvertletTable convertletTable) { this.viewExpander = viewExpander; this.opTab = (validator == null) ? SqlStdOperatorTable.instance() : validator.getOperatorTable(); this.validator = validator; this.catalogReader = catalogReader; this.defaultValueFactory = new NullDefaultValueFactory(); this.subqueryConverter = new NoOpSubqueryConverter(); this.rexBuilder = cluster.getRexBuilder(); this.typeFactory = rexBuilder.getTypeFactory(); this.cluster = Preconditions.checkNotNull(cluster); this.shouldConvertTableAccess = true; this.exprConverter = new SqlNodeToRexConverterImpl(convertletTable); decorrelationEnabled = true; trimUnusedFields = false; shouldCreateValuesRel = true; isExplain = false; nDynamicParamsInExplain = 0; <START> inSubqueryThreshold = DEFAULT_IN_SUBQUERY_THRESHOLD; <END> }</code><technical_language>properties a default instance of Config implementation. SqlToConverter constructor config default config instance. this(viewExpander, validator, catalogReader, cluster, convertletTable, default_config) Move line 289-303 constructor config parameter, full logic</technical_language>

Target:
public SqlToRelConverter( RelOptTable.ViewExpander viewExpander, SqlValidator validator, Prepare.CatalogReader catalogReader, RelOptCluster cluster, SqlRexConvertletTable convertletTable) { this(viewExpander, validator, catalogReader, cluster, convertletTable, Config.DEFAULT); }
Source:
<code>private IPermissionAuthority getPermissionAuthority() { if (permissionAuthority == null && object instanceof EObject) { Session session = new EObjectQuery((EObject) object).getSession(); if (session != null) { permissionAuthority = <START> session.getModelAccessor().getPermissionAuthority(); <END> } } return permissionAuthority; }</code><technical_language>Warning: in existing code is a check of getModelAccessor() != null</technical_language>

Target:
private IPermissionAuthority getPermissionAuthority() { if (permissionAuthority == null && object instanceof EObject) { Session session = new EObjectQuery((EObject) object).getSession(); if (session != null) { ModelAccessor modelAccessor = session.getModelAccessor(); if (modelAccessor != null) { permissionAuthority = modelAccessor.getPermissionAuthority(); } } } return permissionAuthority; }
Source:
<code>public boolean invalidate(K key) { try { boolean removed = remove(key); if (removed) { nearCacheStats.incrementInvalidations(); } return removed; } finally { <START> nearCacheStats.incrementInvalidationEvents(); <END> } }</code><technical_language>do calls this method result of invalidation events? _local_ invalidations triggered calling methods imap#remove, imap#put</technical_language>

Target:
public boolean invalidate(K key) { try { boolean removed = remove(key); if (removed) { nearCacheStats.incrementInvalidations(); } return removed; } finally { nearCacheStats.incrementInvalidationRequests(); } }
Source:
<code>public ActionXAxisDistance(final TourChart tourChart) { super(Messages.Tour_Action_show_distance_on_x_axis, AS_RADIO_BUTTON); this.fTourChart = tourChart; setToolTipText(Messages.Tour_Action_show_distance_on_x_axis_tooltip); <START> String imagePath = Messages.Image__show_distance_on_x_axis; String disabledImagePath = Messages.Image__show_distance_on_x_axis_disabled; if (!UI.UNIT_IS_METRIC) { imagePath = Messages.Image__show_distance_on_x_axis_imperial; disabledImagePath = Messages.Image__show_distance_on_x_axis_imperial_disabled; } setImageDescriptor(TourbookPlugin.getImageDescriptor(imagePath)); setDisabledImageDescriptor(TourbookPlugin.getImageDescriptor(disabledImagePath)); <END> setChecked(!tourChart.getTourChartConfig().isShowTimeOnXAxis); }</code><technical_language>like, measurement system is changed, this image is updated. TourChart a pref listener net.tourbook.ui.tourChart.TourChart.addPrefListeners() checks measurement system, action image updated, access action is tourAction = _allTourChartActions.get(ACTION_ID_X_AXIS_DISTANCE);</technical_language>

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

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

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

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

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

Target:
private void assertValidIssuerClaim(String issuer, List<String> value) { if (issuer == null || !value.contains(issuer)) { throw new InvalidClaimException("The Claim 'iss' value doesn't match the required issuer."); } }
Source:
<code>public void getCreateAccountInfo() { <START> new CreateAccountInfoClient().request(wiki, <END> new CreateAccountInfo.Callback() { @Override public void success(@NonNull Call<MwQueryResponse<CreateAccountInfo>> call, @NonNull CreateAccountInfoResult result) { if (result.token() == null) { handleError(getString(R.string.create_account_generic_error)); } else if (result.hasCaptcha()) { captchaHandler.handleCaptcha(result.token(), new CaptchaResult(result.captchaId())); } else { doCreateAccount(result.token()); } } @Override public void failure(@NonNull Call<MwQueryResponse<CreateAccountInfo>> call, @NonNull Throwable caught) { handleError(caught.getMessage()); L.e(caught); } }); }</code><technical_language>I recommend keeping a reference client. previous implementation appears omitted request management Activity destruction a future patch add</technical_language>

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

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

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

Target:
private void restartRoom() { fireEvent(new ControllerEvent(this, ControllerEvent.RESTARTROOM, "Room restarted")); Model.restartRoom(); List<PowerUp> powers = Model.getPowerUps(); for (PowerUp power: powers) { power.reset(); } collisionHandler.addCollidable(Model.getCurrentRoom().getCollidables()); }
Source:
<code>public void updateLastFoundKey(ByteString key) { this.lastFoundKey = key; <START> rowCount++; <END> }</code><technical_language>sense add a sanity check key is >= previous lastFoundKey</technical_language>

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

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

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

Target:
public void addBreakpoint(final Breakpoint breakpoint) { if (isConnected()) { Promise<Void> promise = service.addBreakpoint(debugSessionDto.getId(), toDto(breakpoint)); promise .then( it -> { for (DebuggerObserver observer : observers) { observer.onBreakpointAdded(breakpoint); } }) .catchError( error -> { Log.error(AbstractDebugger.class, error.getMessage()); }); } }
Source:
<code>public PerTargetPropagater(LinkedPointSet targets, AnalysisTask task, int[][] travelTimesToStopsForIteration, int[] nonTransitTravelTimesToTargets) { this.targets = targets; this.request = task; this.travelTimesToStopsForIteration = travelTimesToStopsForIteration; this.nonTransitTravelTimesToTargets = nonTransitTravelTimesToTargets; this.calculateComponents = task.makeStaticSite; StreetMode egressMode = LegMode.getDominantStreetMode(task.egressModes); speedMillimetersPerSecond = (int) (request.getSpeedForMode(egressMode) * MM_PER_METER); <START> egressLegTimeLimitSeconds = (int) request.getMaxAccessTimeForMode(egressMode) * SECONDS_PER_MINUTE; <END> nIterations = travelTimesToStopsForIteration.length; nStops = travelTimesToStopsForIteration[0].length; invertTravelTimes(); }</code><technical_language>If multiplication operands ints result int. If of is floating point result floating point. request.getSpeedForMode returns a float, result of multiplication is a float, need explicit cast truncate for storage in integer variable. request.getMaxAccessTimeForMode returns int though, result of multiplication is int cast is redundant. IDE show redundant. aware operator precedence of casting is higher multiplication division, casting output of getMaxAccessTimeForMode (which is int) int multiplying it. If getMaxAccessTimeForMode a method returning a floating point value, this truncate multiplication, bad</technical_language>

Target:
public PerTargetPropagater(LinkedPointSet targets, AnalysisTask task, int[][] travelTimesToStopsForIteration, int[] nonTransitTravelTimesToTargets) { this.targets = targets; this.request = task; this.travelTimesToStopsForIteration = travelTimesToStopsForIteration; this.nonTransitTravelTimesToTargets = nonTransitTravelTimesToTargets; this.calculateComponents = task.makeStaticSite; StreetMode egressMode = LegMode.getDominantStreetMode(task.egressModes); speedMillimetersPerSecond = (int) (request.getSpeedForMode(egressMode) * MM_PER_METER); egressLegTimeLimitSeconds = request.getMaxAccessTimeForMode(egressMode) * SECONDS_PER_MINUTE; nIterations = travelTimesToStopsForIteration.length; nStops = travelTimesToStopsForIteration[0].length; invertTravelTimes(); }
Source:
<code>private void mkAssignments(String scratchTopoId) throws Exception { try { if (!isReadyForMKAssignments()) { return; } IStormClusterState state = stormClusterState; Map<String, StormBase> bases; Map<String, TopologyDetails> tds = new HashMap<>(); synchronized (submitLock) { bases = state.topologyBases(); for (Iterator<Entry<String, StormBase>> it = bases.entrySet().iterator(); it.hasNext(); ) { Entry<String, StormBase> entry = it.next(); String id = entry.getKey(); try { tds.put(id, readTopologyDetails(id, entry.getValue())); } catch (KeyNotFoundException e) { it.remove(); } } } List<String> assignedTopologyIds = state.assignments(null); Map<String, Assignment> existingAssignments = new HashMap<>(); for (String id : assignedTopologyIds) { if (!id.equals(scratchTopoId)) { Assignment currentAssignment = state.assignmentInfo(id, null); if (!currentAssignment.is_set_owner()) { TopologyDetails td = tds.get(id); if (td != null) { currentAssignment.set_owner(td.getTopologySubmitter()); <START> currentAssignment.set_topology_hb_timeout_ms(getTopologyHbTimeoutMs(td.getConf())); <END> state.setAssignment(id, currentAssignment, td.getConf()); } } existingAssignments.put(id, currentAssignment); } } lockingMkAssignments(existingAssignments, bases, scratchTopoId, assignedTopologyIds, state, tds); } catch (Exception e) { this.mkAssignmentsErrors.mark(); throw e; } }</code><technical_language>do need</technical_language>

Target:
private void mkAssignments(String scratchTopoId) throws Exception { try { if (!isReadyForMKAssignments()) { return; } IStormClusterState state = stormClusterState; Map<String, StormBase> bases; Map<String, TopologyDetails> tds = new HashMap<>(); synchronized (submitLock) { bases = state.topologyBases(); for (Iterator<Entry<String, StormBase>> it = bases.entrySet().iterator(); it.hasNext(); ) { Entry<String, StormBase> entry = it.next(); String id = entry.getKey(); try { tds.put(id, readTopologyDetails(id, entry.getValue())); } catch (KeyNotFoundException e) { it.remove(); } } } List<String> assignedTopologyIds = state.assignments(null); Map<String, Assignment> existingAssignments = new HashMap<>(); for (String id : assignedTopologyIds) { if (!id.equals(scratchTopoId)) { Assignment currentAssignment = state.assignmentInfo(id, null); if (!currentAssignment.is_set_owner()) { TopologyDetails td = tds.get(id); if (td != null) { currentAssignment.set_owner(td.getTopologySubmitter()); state.setAssignment(id, currentAssignment, td.getConf()); } } existingAssignments.put(id, currentAssignment); } } lockingMkAssignments(existingAssignments, bases, scratchTopoId, assignedTopologyIds, state, tds); } catch (Exception e) { this.mkAssignmentsErrors.mark(); throw e; } }
Source:
<code>private void chunkGc() { <START> cubeCache.takeOutGarbage(); <END> }</code><technical_language>.. point of ChunkGc separate class unloading logic in class. moved CubeCache</technical_language>

Target:
private void chunkGc() { Iterator<Cube> cubeIt = cubeCache.cubesIterator(); while(cubeIt.hasNext()) { if(cubeCache.tryUnloadCube(cubeIt.next())) { cubeIt.remove(); } } Iterator<Column> columnIt = cubeCache.columnsIterator(); while(columnIt.hasNext()) { if(cubeCache.tryUnloadColumn(columnIt.next())) { columnIt.remove(); } } }
Source:
<code>public void destroy() throws Exception { if (restAPIPublisher != null) { for (int j = 0; j < numberOfAPIs; j++) { String APIVersion = "1.0.0"; restAPIPublisher.deleteAPI(createdAPIs.get(j).getId()); } } <START> super.cleanUpUsingRest(); <END> }</code><technical_language>cleanUp method I modified support latest rest api calls. for confusion</technical_language>

Target:
public void destroy() throws Exception { if (restAPIPublisher != null) { for (int j = 0; j < numberOfAPIs; j++) { String APIVersion = "1.0.0"; restAPIPublisher.deleteAPI(createdAPIs.get(j).getId()); } } super.cleanUp(); }
Source:
<code>public void addExecuteStatement( CodeBlock.Builder methodBuilder, String helperFieldName, ExecutableElement methodElement, Map<Name, TypeElement> typeParameters) { TypeName returnTypeName = GeneratedCodePatterns.getTypeName(methodElement.getReturnType(), typeParameters); methodBuilder.addStatement( <START> "return ($T) producer.execute(boundStatement, context, $L)", <END> returnTypeName, helperFieldName); }</code><technical_language>This statement produces compiler warnings: [INFO] [...] FruitDaoReactiveImpl__MapperGenerated.java unchecked unsafe operations. [INFO] [...] Recompile -Xlint:unchecked for details. --- extract result a local variable annotate @SuppressWarnings("unchecked")? Alternatively, consider annotating class @SuppressWarnings("all")</technical_language>

Target:
public void addExecuteStatement( CodeBlock.Builder methodBuilder, String helperFieldName, ExecutableElement methodElement, Map<Name, TypeElement> typeParameters) { methodBuilder.addStatement("execute(boundStatement)"); }
Source:
<code>public static final <T> T execute(@NonNull SshClientTemplate template) { SSHClient client = SshConnectionPool.getInstance().getConnection(template.url); T retval = null; if (client != null) { try { retval = Single.fromCallable((Callable<T>) () -> template.execute(client)) .subscribeOn(Schedulers.io()) <START> .doOnError(Throwable::printStackTrace) <END> .blockingGet(); } catch (Exception e) { Log.e(TAG, "Error executing template method", e); } finally { if (template.closeClientOnFinish) { tryDisconnect(client); } } } return retval; }</code><technical_language>Is catch block needed this change is redundant</technical_language>

Target:
public static final <T> T execute(@NonNull SshClientTemplate template) { SSHClient client = SshConnectionPool.getInstance().getConnection(template.url); T retval = null; if (client != null) { try { retval = Single.fromCallable((Callable<T>) () -> template.execute(client)) .subscribeOn(Schedulers.io()) .blockingGet(); } catch (Exception e) { Log.e(TAG, "Error executing template method", e); } finally { if (template.closeClientOnFinish) { tryDisconnect(client); } } } return retval; }
Source:
<code>private CreateRequest(ContentFormat format, LwM2mPath target, Integer instanceId, LwM2mResource[] resources) { super(target); if (!target.isObject() && !target.isObjectInstance()) throw new InvalidRequestException("Create request must target an object or object instance"); if (instanceId != null && instanceId == LwM2mObjectInstance.UNDEFINED) { instanceId = null; } if (target.isObjectInstance()) { if (instanceId == null) { instanceId = target.getObjectInstanceId(); } else { <START> if (instanceId.equals(target.getObjectInstanceId())) { <END> throw new InvalidRequestException("Conflict between path instance id and node instance id"); } } } if (instanceId != null && instanceId < 0) throw new InvalidRequestException("Invalid instance id: " + instanceId); this.instanceId = instanceId; this.resources = Collections.unmodifiableList(Arrays.asList(resources)); this.contentFormat = format != null ? format : ContentFormat.TLV; }</code><technical_language>meant !equals</technical_language>

Target:
private CreateRequest(ContentFormat format, LwM2mPath target, Integer instanceId, LwM2mResource[] resources) { super(target); if (!target.isObject() && !target.isObjectInstance()) throw new InvalidRequestException("Create request must target an object or object instance"); if (instanceId != null && instanceId == LwM2mObjectInstance.UNDEFINED) { instanceId = null; } if (target.isObjectInstance()) { if (instanceId == null) { instanceId = target.getObjectInstanceId(); } else { if (!instanceId.equals(target.getObjectInstanceId())) { throw new InvalidRequestException("Conflict between path instance id and node instance id"); } } } if (instanceId != null && instanceId < 0) throw new InvalidRequestException("Invalid instance id: " + instanceId); this.instanceId = instanceId; this.resources = Collections.unmodifiableList(Arrays.asList(resources)); this.contentFormat = format != null ? format : ContentFormat.TLV; }
Source:
<code>public CommonXAxisModelBuilder addYSeries(IYSeries ySeries) { <START> if (fXValues.length == 0) { throw new IllegalStateException("X values must be set before setting Y values"); } <END> if (fXValues.length != ySeries.getDatapoints().length) { throw new IllegalStateException("All series in list must be of length : " + fXValues.length); } fYSeries.put(ySeries.getLabel(), ySeries); fModel = null; return this; }</code><technical_language>if query a single timestamp</technical_language>

Target:
public CommonXAxisModelBuilder addYSeries(IYSeries ySeries) { if (fXValues.length != ySeries.getDatapoints().length) { throw new IllegalStateException("All series in list must be of length : " + fXValues.length); } fYSeries.put(ySeries.getLabel(), ySeries); fModel = null; return this; }
Source:
<code>public void testInitialization() { SimpleIgnoreCache cache = new SimpleIgnoreCache(ignoreTestDir); File test = new File(ignoreTestDir.getAbsolutePath() + "/new/a/b1/test.stp"); assertTrue("Missing file " + test.getAbsolutePath(), test.exists()); try { cache.partiallyInitialize(test); } catch (IOException e) { fail("IOException when attempting to lazy initialize"); <START> e.printStackTrace(); <END> } boolean result = cache.isIgnored(test); assertFalse("Unexpected match for " + test.toString(), result); File folder = test.getParentFile(); IgnoreNode rules = null; while (!folder.getAbsolutePath().equals(ignoreTestDir.getAbsolutePath()) && folder.getAbsolutePath().length() > 0) { rules = cache.getRules(folder.getAbsolutePath()); assertNotNull("Ignore file was not initialized for " + folder.getAbsolutePath(), rules); assertEquals(1, rules.getRules().size()); folder = folder.getParentFile(); } if (rules != null) { assertEquals(1, rules.getRules().size()); } else { fail("Ignore nodes not initialized"); } }</code><technical_language>This stack trace, other in this file, get printed fail(String) method exception thrown. Personally, I tend declare exceptions in test method I JGit convention here</technical_language>

Target:
public void testInitialization() { SimpleIgnoreCache cache = new SimpleIgnoreCache(ignoreTestDir); File test = new File(ignoreTestDir.getAbsolutePath() + "/new/a/b1/test.stp"); assertTrue("Missing file " + test.getAbsolutePath(), test.exists()); try { cache.partiallyInitialize(test); } catch (IOException e) { e.printStackTrace(); fail("IOException when attempting to lazy initialize"); } boolean result = cache.isIgnored(test); assertFalse("Unexpected match for " + test.toString(), result); File folder = test.getParentFile(); IgnoreNode rules = null; while (!folder.getAbsolutePath().equals(ignoreTestDir.getAbsolutePath()) && folder.getAbsolutePath().length() > 0) { rules = cache.getRules(folder.getAbsolutePath()); assertNotNull("Ignore file was not initialized for " + folder.getAbsolutePath(), rules); assertEquals(1, rules.getRules().size()); folder = folder.getParentFile(); } if (rules != null) { assertEquals(1, rules.getRules().size()); } else { fail("Ignore nodes not initialized"); } }
Source:
<code>private String socketToStr(Socket socket) { if (socket == null) { return ""; <START> } else { <END> return socket.getLocalAddress().toString() + ":" + socket.getPort(); } }</code><technical_language>else statement removed</technical_language>

Target:
private String socketToStr(Socket socket) { if (socket == null) { return ""; } return socket.getLocalAddress().toString() + ":" + socket.getPort(); }