auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected CONNECTCXFClient(ServicePortDescriptor<T> portDescriptor, String url, AssertionType assertion, ServicePortBuilder<T> portBuilder, String subscriptionId) { serviceEndpoint = super.configureBasePort(portBuilder.createPort(), subscriptionId, assertion != null ? assertion.getTransactionTimeout() : null); <START> configCNCheck(); <END> }</code><technical_language>remove this method</technical_language>

Target:
protected CONNECTCXFClient(ServicePortDescriptor<T> portDescriptor, String url, AssertionType assertion, ServicePortBuilder<T> portBuilder, String subscriptionId) { serviceEndpoint = super.configureBasePort(portBuilder.createPort(), subscriptionId, assertion != null ? assertion.getTransactionTimeout() : null); }
Source:
<code>private void checkProblemSubDirectory(File dir) throws AppException { AppExceptionUtil.assertNotNull(dir); File[] files = dir.listFiles(); boolean hasProblemInfo = false; for (File current : files) { String fileName = current.getName(); if ("problemInfo.xml".equals(fileName)) { hasProblemInfo = true; } } if (!hasProblemInfo) { throw new AppException("No description file in problem information directory."); } <START> new ZipDataChecker().check(dir); <END> }</code><technical_language>problems here, I prefer create a ZipDataChecker object in class a field</technical_language>

Target:
private void checkProblemSubDirectory(File dir) throws AppException { AppExceptionUtil.assertNotNull(dir); File[] files = dir.listFiles(); boolean hasProblemInfo = false; for (File current : files) { String fileName = current.getName(); if ("problemInfo.xml".equals(fileName)) { hasProblemInfo = true; } } if (!hasProblemInfo) { throw new AppException("No description file in problem information directory."); } zipDataChecker.check(dir); }
Source:
<code>void decodeAttributeBody(byte[] attributeValue, char offset, char length) { <START> while (length >= offset && attributeValue[length] == 0) <END> { length--; } username = new byte[length]; System.arraycopy(attributeValue, offset, username, 0, length); }</code><technical_language>wondering "length >= offset" check, sense? 'offset' is represented a position in array 'length' is a length...for example offset '100' length '20' (including padding 0's), be, say, '18'...but remove zeroes 'length >= offset' check fail immediately (offset + length) >= offset</technical_language>

Target:
void decodeAttributeBody(byte[] attributeValue, char offset, char length) { while (length > 0 && attributeValue[offset + length] == 0) { length--; } username = new byte[length]; System.arraycopy(attributeValue, offset, username, 0, length); }
Source:
<code>public String getActualName() { <START> return StringUtils.hasText(this.name) ? this.name : this.declaredName; <END> }</code><technical_language>a property matter update setDeclaredName() is called? over-optimization, - curious is opinion :smile:</technical_language>

Target:
public String getActualName() { return this.actualName; }
Source:
<code>private MenuManager createWindowMenu() { MenuManager menu = new MenuManager( IDEWorkbenchMessages.Workbench_window, IWorkbenchActionConstants.M_WINDOW); addMacWindowMenuItems(menu); menu.add(newWindowAction); menu.add(new Separator()); menu.add(addShowView()); menu.add(addPerspectiveActions()); menu.add(new Separator()); addKeyboardShortcuts(menu); Separator sep = new Separator(IWorkbenchActionConstants.MB_ADDITIONS); sep.setVisible(!Util.isMac()); menu.add(sep); if(Util.isCocoa()) menu.add(arrangeWindowsItem); ActionContributionItem openPreferencesItem = new ActionContributionItem(openPreferencesAction); openPreferencesItem.setVisible(!Util.isMac()); menu.add(openPreferencesItem); String menuProxy = System.getenv("UBUNTU_MENUPROXY"); String desktopSession = System.getenv("DESKTOP_SESSION"); String os = Platform.getOS(); boolean radioButtonsMightCauseCrash = ((menuProxy == null) || !menuProxy.equals("0")) <START> && SWT.getPlatform().equals("gtk") END> && os.equals(Platform.OS_LINUX) && (desktopSession == null || desktopSession.equals("ubuntu")); if (!radioButtonsMightCauseCrash) { menu.add(ContributionItemFactory.OPEN_WINDOWS.create(getWindow())); } return menu; }</code><technical_language>preference is org.eclipse.core.runtime.Platform.getWS() getOS()</technical_language>

Target:
private MenuManager createWindowMenu() { MenuManager menu = new MenuManager( IDEWorkbenchMessages.Workbench_window, IWorkbenchActionConstants.M_WINDOW); addMacWindowMenuItems(menu); menu.add(newWindowAction); menu.add(new Separator()); menu.add(addShowView()); menu.add(addPerspectiveActions()); menu.add(new Separator()); addKeyboardShortcuts(menu); Separator sep = new Separator(IWorkbenchActionConstants.MB_ADDITIONS); sep.setVisible(!Util.isMac()); menu.add(sep); if(Util.isCocoa()) menu.add(arrangeWindowsItem); ActionContributionItem openPreferencesItem = new ActionContributionItem(openPreferencesAction); openPreferencesItem.setVisible(!Util.isMac()); menu.add(openPreferencesItem); String menuProxy = System.getenv("UBUNTU_MENUPROXY"); String desktopSession = System.getenv("DESKTOP_SESSION"); String os = Platform.getOS(); String ws = Platform.getWS(); boolean workaroundEnabled = !"false".equals(System.getProperty("eclipse.workaround.bug461311")); boolean radioButtonsMightCauseCrash = ((menuProxy == null) || !menuProxy.equals("0")) && Platform.WS_GTK.equals(ws) && Platform.OS_LINUX.equals(os) && (desktopSession == null || desktopSession.equals("ubuntu")) && workaroundEnabled; if (!radioButtonsMightCauseCrash) { menu.add(ContributionItemFactory.OPEN_WINDOWS.create(getWindow())); } return menu; }
Source:
<code>public final boolean canProceed(final K key, final int tokens) { TokenBucket tokenBucket = null; try { tokenBucket = tokenBucketCache.get(key); } catch (ExecutionException e) { LOGGER.error("error=ExecutionException method=canProceed key={} tokens={} exception={}", key, tokens, e); } if (tokenBucket == null) { <START> return false; <END> } return tokenBucket.tryConsume(tokens); }</code><technical_language>return true exception happens? want prevent people accessing app if is wrong end. ok more if is wrong end</technical_language>

Target:
public final boolean canProceed(final K key, final int tokens) { TokenBucket tokenBucket = null; try { tokenBucket = tokenBucketCache.get(key); } catch (ExecutionException e) { LOGGER.error("error=ExecutionException method=canProceed key={} tokens={} exception={}", key, tokens, e); } if (tokenBucket == null) { return true; } return tokenBucket.tryConsume(tokens); }
Source:
<code>public void downloadBlobStatus(HttpServletRequest request, HttpServletResponse response, String key, String reason) throws IOException { TransientStore ts = Framework.getService(TransientStoreService.class).getStore(STORE_NAME); try { if (!ts.exists(key)) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; } List<Blob> blobs = ts.getBlobs(key); if (blobs == null || blobs.isEmpty()) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; } if (blobs.size() > 1) { throw new IllegalArgumentException("multipart download not yet implemented"); } if (ts.getParameter(key, ERROR) != null) { response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, <START> ((Throwable) ts.getParameter(key, ERROR)).getMessage()); <END> } else { AsyncBlob blob = null; if (ts.isCompleted(key)) { blob = new AsyncBlob(key, true, 100); } else { Serializable progress = ts.getParameter(key, PROGRESS); blob = new AsyncBlob(key, false, progress != null ? (int) progress : -1); } downloadBlob(request, response, null, null, blob, blob.getFilename(), reason); } } finally { } }</code><technical_language>call ts.getParameter(key, ERROR) twice, put in a local variable</technical_language>

Target:
public void downloadBlobStatus(HttpServletRequest request, HttpServletResponse response, String key, String reason) throws IOException { this.downloadBlob(request, response, key, reason, true); }
Source:
<code>private void determineApiTypes() { collectedTypes.stream(). map(ClassTypeInfo::getRaw). flatMap(Helper.instanceOf(ClassTypeInfo.class)). filter(t -> !t.getPackageName().equals(ifaceFQCN)). forEach(importedTypes::add); collectedTypes.stream(). map(ClassTypeInfo::getRaw). flatMap(Helper.instanceOf(ApiTypeInfo.class)). filter(t -> !t.equals(type.getRaw())). forEach(referencedTypes::add); collectedTypes.stream(). map(ClassTypeInfo::getRaw). flatMap(Helper.instanceOf(ClassTypeInfo.class)). filter(t -> t.getKind() == ClassKind.DATA_OBJECT). forEach(referencedDataObjectTypes::add); <START> collectedTypes.stream(). <END> map(ClassTypeInfo::getRaw). flatMap(Helper.instanceOf(EnumTypeInfo.class)). filter(t -> t.getKind() == ClassKind.ENUM). forEach(referencedEnumTypes::add); }</code><technical_language>build immutable collection foreach add a mutable container</technical_language>

Target:
private void determineApiTypes() { importedTypes = collectedTypes.stream(). map(ClassTypeInfo::getRaw). flatMap(Helper.instanceOf(ClassTypeInfo.class)). filter(t -> !t.getPackageName().equals(ifaceFQCN)). collect(Collectors.toSet()); referencedTypes = collectedTypes.stream(). map(ClassTypeInfo::getRaw). flatMap(Helper.instanceOf(ApiTypeInfo.class)). filter(t -> !t.equals(type.getRaw())). collect(Collectors.toSet()); referencedDataObjectTypes = collectedTypes.stream(). map(ClassTypeInfo::getRaw). flatMap(Helper.instanceOf(ClassTypeInfo.class)). filter(t -> t.getKind() == ClassKind.DATA_OBJECT). collect(Collectors.toSet()); referencedEnumTypes = collectedTypes.stream(). map(ClassTypeInfo::getRaw). flatMap(Helper.instanceOf(EnumTypeInfo.class)). filter(t -> t.getKind() == ClassKind.ENUM). collect(Collectors.toSet()); }
Source:
<code>protected ISchedulingRule getEnabledStateSchedulingRule(IDebugCommandRequest request) { <START> return new ExclusiveRule(); <END> }</code><technical_language>work static. In imagination results in ExclusiveRule command instance</technical_language>

Target:
protected ISchedulingRule getEnabledStateSchedulingRule(IDebugCommandRequest request) { return exclusiveRule; }
Source:
<code>public void fill(Menu menu, int index) { HashMap<String, Boolean> isSheetEmptyMap = OfficeView.getOpenedView().getIsSheetEmptyMap(); <START> for (String sheetName : isSheetEmptyMap.keySet()) { <END> MenuItem menuItem = new MenuItem(menu, SWT.CHECK, index); menuItem.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { OfficeView.getOpenedView().selectSheet(menuItem.getText()); } @Override public void widgetDefaultSelected(SelectionEvent e) { OfficeView.getOpenedView().selectSheet(menuItem.getText()); } }); if (OfficeView.getOpenedView().getSelectedSheetName().contentEquals(sheetName)) menuItem.setSelection(true); if (isSheetEmptyMap.get(sheetName)) menuItem.setText(sheetName); else { menuItem.setText(sheetName + " (Empty)"); menuItem.setEnabled(false); } } }</code><technical_language>a null check here? clearSelection() set map null all</technical_language>

Target:
public void fill(Menu menu, int index) { HashMap<String, Boolean> isSheetEmptyMap = OfficeView.getOpenedView().getIsSheetEmptyMap(); if (isSheetEmptyMap == null) return; for (String sheetName : isSheetEmptyMap.keySet()) { MenuItem menuItem = new MenuItem(menu, SWT.CHECK, index); menuItem.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { OfficeView.getOpenedView().selectSheet(menuItem.getText()); } @Override public void widgetDefaultSelected(SelectionEvent e) { OfficeView.getOpenedView().selectSheet(menuItem.getText()); } }); if (OfficeView.getOpenedView().getSelectedSheetName().contentEquals(sheetName)) menuItem.setSelection(true); if (isSheetEmptyMap.get(sheetName)) menuItem.setText(sheetName); else { menuItem.setText(sheetName + " (Empty)"); menuItem.setEnabled(false); } } }
Source:
<code>public static PartitionDesc buildPartitionDesc(String partitionName) { PartitionDesc partitionDesc = new PartitionDesc(); partitionDesc.setPartitionName(partitionName); String[] partitionNames = partitionName.split("/"); List<PartitionKeyProto> partitionKeyList = new ArrayList<>(); <START> for (String partitionName1 : partitionNames) { <END> String[] splits = partitionName1.split("="); String columnName = "", partitionValue = ""; if (splits.length == 2) { columnName = splits[0]; partitionValue = splits[1]; } else if (splits.length == 1) { if (partitionName1.charAt(0) == '=') { partitionValue = splits[0]; } else { columnName = ""; } } PartitionKeyProto.Builder builder = PartitionKeyProto.newBuilder(); builder.setColumnName(columnName); builder.setPartitionValue(partitionValue); partitionKeyList.add(builder.build()); } partitionDesc.setPartitionKeys(partitionKeyList); partitionDesc.setPath("hdfs://xxx.com/warehouse/" + partitionName); return partitionDesc; }</code><technical_language>This is valid, a good convention</technical_language>

Target:
public static PartitionDesc buildPartitionDesc(String partitionName) { PartitionDesc partitionDesc = new PartitionDesc(); partitionDesc.setPartitionName(partitionName); String[] partitionNames = partitionName.split("/"); List<PartitionKeyProto> partitionKeyList = new ArrayList<>(); for (String partition : partitionNames) { String[] splits = partition.split("="); String columnName = "", partitionValue = ""; if (splits.length == 2) { columnName = splits[0]; partitionValue = splits[1]; } else if (splits.length == 1) { if (partition.charAt(0) == '=') { partitionValue = splits[0]; } else { columnName = ""; } } PartitionKeyProto.Builder builder = PartitionKeyProto.newBuilder(); builder.setColumnName(columnName); builder.setPartitionValue(partitionValue); partitionKeyList.add(builder.build()); } partitionDesc.setPartitionKeys(partitionKeyList); partitionDesc.setPath("hdfs://xxx.com/warehouse/" + partitionName); return partitionDesc; }
Source:
<code>private void testBoundedTextFileSource(FailoverType failoverType) throws Exception { final File testDir = TMP_FOLDER.newFolder(); writeAllFiles(testDir); writeHiddenJunkFiles(testDir); final FileSource<String> source = FileSource .forRecordStreamFormat(new TextLineFormat(), Path.fromLocalFile(testDir)) .build(); final StreamExecutionEnvironment env = new TestStreamEnvironment(miniCluster, PARALLELISM); env.setParallelism(PARALLELISM); <START> env.enableCheckpointing(10L); <END> final DataStream<String> stream = env.fromSource( source, WatermarkStrategy.noWatermarks(), "file-source"); final DataStream<String> streamFailingInTheMiddleOfReading = RecordCounterToFail.wrapWithFailureAfter(stream, LINES.length / 2); final ClientAndIterator<String> client = DataStreamUtils.collectWithClient( streamFailingInTheMiddleOfReading, "Bounded TextFiles Test"); final JobID jobId = client.client.getJobID(); RecordCounterToFail.waitToFail(); triggerFailover(failoverType, jobId, RecordCounterToFail::continueProcessing); final List<String> result = new ArrayList<>(); while (client.iterator.hasNext()) { result.add(client.iterator.next()); } verifyResult(result); }</code><technical_language>I bounded case explicitly checkpointing enabled, recovery re-executes fully (goes beginning)</technical_language>

Target:
private void testBoundedTextFileSource(FailoverType failoverType) throws Exception { final File testDir = TMP_FOLDER.newFolder(); writeAllFiles(testDir); writeHiddenJunkFiles(testDir); final FileSource<String> source = FileSource .forRecordStreamFormat(new TextLineFormat(), Path.fromLocalFile(testDir)) .build(); final StreamExecutionEnvironment env = new TestStreamEnvironment(miniCluster, PARALLELISM); env.setParallelism(PARALLELISM); final DataStream<String> stream = env.fromSource( source, WatermarkStrategy.noWatermarks(), "file-source"); final DataStream<String> streamFailingInTheMiddleOfReading = RecordCounterToFail.wrapWithFailureAfter(stream, LINES.length / 2); final ClientAndIterator<String> client = DataStreamUtils.collectWithClient( streamFailingInTheMiddleOfReading, "Bounded TextFiles Test"); final JobID jobId = client.client.getJobID(); RecordCounterToFail.waitToFail(); triggerFailover(failoverType, jobId, RecordCounterToFail::continueProcessing); final List<String> result = new ArrayList<>(); while (client.iterator.hasNext()) { result.add(client.iterator.next()); } verifyResult(result); }
Source:
<code>public static KeyWrapper getClientPublicKeyWrapper(KeycloakSession session, ClientModel client, JWSInput input) { <START> String kid = input.getHeader().getKeyId(); <END> PublicKey verifyKey = getClientPublicKey(session, client, input); if (verifyKey == null) return null; KeyWrapper keyWrapper = new KeyWrapper(); keyWrapper.setKid(kid); keyWrapper.setAlgorithm(input.getHeader().getAlgorithm().name()); keyWrapper.setVerifyKey(verifyKey); return keyWrapper; }</code><technical_language>kid set input. is assuming correct keys for jws, case. Further, this prevent support of rolling keys in future</technical_language>

Target:
public static KeyWrapper getClientPublicKeyWrapper(KeycloakSession session, ClientModel client, JWSInput input) { String kid = input.getHeader().getKeyId(); PublicKeyStorageProvider keyStorage = session.getProvider(PublicKeyStorageProvider.class); String modelKey = PublicKeyStorageUtils.getClientModelCacheKey(client.getRealm().getId(), client.getId()); ClientPublicKeyLoader loader = new ClientPublicKeyLoader(session, client); return keyStorage.getPublicKey(modelKey, kid, loader); }
Source:
<code>List<Map<String, Object>> getNetworkInterfaces(VM vm){ Map<String, Object> resultMap = new HashMap(); <START> List<String> inet6Adsreess = new ArrayList<>(); <END> List<String> inet4Adsress = new ArrayList<>(); List<Map<String, Object>> nets = new ArrayList<>(); resultMap.put("name", "eth0"); inet6Adsreess.add("fe80::21a:4aff:fe16:2016"); inet6Adsreess.add("2620:52:0:2380:21a:4aff:fe16:2016"); resultMap.put("inet6", inet6Adsreess); inet4Adsress.add(vm.getIp()); resultMap.put("inet", inet4Adsress); resultMap.put("hw", vm.getMacAddress()); nets.add(resultMap); log.debug("network list is {}", nets.toString()); return nets; }</code><technical_language>inet6Adsreess -> inet6Addresses</technical_language>

Target:
List<Map<String, Object>> getNetworkInterfaces(VM vm){ Map<String, Object> resultMap = new HashMap(); List<String> inet6Addresses = new ArrayList<>(); List<String> inet4Addresses = new ArrayList<>(); List<Map<String, Object>> nets = new ArrayList<>(); resultMap.put("name", "eth0"); inet6Addresses.add("fe80::21a:4aff:fe16:2016"); inet6Addresses.add("2620:52:0:2380:21a:4aff:fe16:2016"); resultMap.put("inet6", inet6Addresses); inet4Addresses.add(vm.getIp()); resultMap.put("inet", inet4Addresses); resultMap.put("hw", vm.getMacAddress()); nets.add(resultMap); log.debug("network list is {}", nets.toString()); return nets; }
Source:
<code>public void endVisit(@Nonnull JMethodCall call) { Collection<JMethod> targets = call.getMethodId().getMethods(); if (targets.size() != 1) { return; } JMethod target = targets.iterator().next(); if (target.isAbstract() || target.isNative()) { return; } List<JAnnotation> annotationList = target.getAnnotations(forceInlineAnnotationType); <START> if (annotationList.isEmpty()) { return; } call.addMarker(new InlineMarker(target)); return; <END> }</code><technical_language>nit: simpler read (and need for 'return') if (!annotationList.isEmpty()) { call.addMarker(new InlineMarker(target)); }</technical_language>

Target:
public void endVisit(@Nonnull JMethodCall call) { Collection<JMethod> targets = call.getMethodId().getMethods(); if (targets.size() != 1) { return; } JMethod target = targets.iterator().next(); if (target.isAbstract() || target.isNative()) { return; } Location location = target.getEnclosingType().getLocation(); if (location instanceof TypeInInputLibraryLocation) { InputLibrary inputLibrary = ((TypeInInputLibraryLocation) location).getInputLibrary(); if (inputLibrary.containsFileType(FileType.PREBUILT)) { return; } } List<JAnnotation> annotationList = target.getAnnotations(forceInlineAnnotationType); if (!annotationList.isEmpty()) { call.addMarker(new InlineMarker(target)); } }
Source:
<code>public static boolean isModifiedEtag(HttpServletRequest request, HttpServletResponse response,String assetId, long _lastModified, long fileSize) { int _daysCache = Config.getIntProperty("asset.cache.control.max.days", 30); GregorianCalendar expiration = new GregorianCalendar(); expiration.add(java.util.Calendar.DAY_OF_MONTH, _daysCache); int seconds = (_daysCache * 24 * 60 * 60); if(_lastModified < 0) { _lastModified = 0; } _lastModified = _lastModified / 1000; _lastModified = _lastModified * 1000; Date _lastModifiedDate = new java.util.Date(_lastModified); String _eTag = "dot:" + assetId + ":" + _lastModified + ":" + fileSize; <START> response.setHeader("Expires", httpDate.get().format(expiration.getTime())); <END> if (!response.containsHeader(HttpHeaders.CACHE_CONTROL)) { response.setHeader(HttpHeaders.CACHE_CONTROL, "public, max-age=" + seconds); } String ifModifiedSince = request.getHeader("If-Modified-Since"); String ifNoneMatch = request.getHeader("If-None-Match"); if(ifNoneMatch != null){ if(_eTag.equals(ifNoneMatch) || ifNoneMatch.equals("*")){ response.setStatus(HttpServletResponse.SC_NOT_MODIFIED ); return false; } } if(ifModifiedSince != null){ try{ Date ifModifiedSinceDate = httpDate.get().parse(ifModifiedSince); if(_lastModifiedDate.getTime() <= ifModifiedSinceDate.getTime()){ response.setStatus(HttpServletResponse.SC_NOT_MODIFIED ); return false; } } catch(Exception e){} } response.setHeader("Last-Modified", httpDate.get().format(_lastModifiedDate)); response.setHeader("ETag", _eTag); return true; }</code><technical_language>I apply logic Expires header</technical_language>

Target:
public static boolean isModifiedEtag(HttpServletRequest request, HttpServletResponse response,String assetId, long _lastModified, long fileSize) { int _daysCache = Config.getIntProperty("asset.cache.control.max.days", 30); GregorianCalendar expiration = new GregorianCalendar(); expiration.add(java.util.Calendar.DAY_OF_MONTH, _daysCache); int seconds = (_daysCache * 24 * 60 * 60); if(_lastModified < 0) { _lastModified = 0; } _lastModified = _lastModified / 1000; _lastModified = _lastModified * 1000; Date _lastModifiedDate = new java.util.Date(_lastModified); String _eTag = "dot:" + assetId + ":" + _lastModified + ":" + fileSize; if (!response.containsHeader(EXPIRES)) { response.setHeader(EXPIRES, httpDate.get().format(expiration.getTime())); } if (!response.containsHeader(CACHE_CONTROL)) { response.setHeader(CACHE_CONTROL, "public, max-age=" + seconds); } String ifModifiedSince = request.getHeader("If-Modified-Since"); String ifNoneMatch = request.getHeader("If-None-Match"); if(ifNoneMatch != null){ if(_eTag.equals(ifNoneMatch) || ifNoneMatch.equals("*")){ response.setStatus(HttpServletResponse.SC_NOT_MODIFIED ); return false; } } if(ifModifiedSince != null){ try{ Date ifModifiedSinceDate = httpDate.get().parse(ifModifiedSince); if(_lastModifiedDate.getTime() <= ifModifiedSinceDate.getTime()){ response.setStatus(HttpServletResponse.SC_NOT_MODIFIED ); return false; } } catch(Exception e){} } response.setHeader("Last-Modified", httpDate.get().format(_lastModifiedDate)); response.setHeader("ETag", _eTag); return true; }
Source:
<code>public void allBindingsChanged(BindingProvider provider) { logger.debug("allBindingsChanged()"); logger.debug("Provider items count: {}", provider.getItemNames().size()); itemUpdateDisabled = true; if (provider.getItemNames().size() > 0) { triggerItemsUpdate = true; } itemCount = provider.getItemNames().size(); super.allBindingsChanged(provider); <START> } <END></code><technical_language>Nice feature -- refresh .items file changed, right</technical_language>

Target:
public void allBindingsChanged(BindingProvider provider) { logger.debug("allBindingsChanged(): Provider items count: {}", provider.getItemNames().size()); itemUpdateDisabled = true; if (provider.getItemNames().size() > 0) { triggerItemsUpdate = true; } itemCount = provider.getItemNames().size(); super.allBindingsChanged(provider); }
Source:
<code>void indexRedirectsToOverview() throws Exception { perform(get("/")) .andExpect(status().isFound()) <START> .andExpect(header().string("Location", "/web/overview")); <END> }</code><technical_language>es gibt einen .andExpect(redirectedUrl("XXXXXXX")); matcher</technical_language>

Target:
void indexRedirectsToOverview() throws Exception { perform(get("/")) .andExpect(status().isFound()) .andExpect(redirectedUrl("/web/overview")); }
Source:
<code>private Status check() { if (mJobId == null) { return Status.FAILED; } JobInfo jobInfo; try { jobInfo = mClient.getJobStatus(mJobId); } catch (IOException e) { LOG.warn("Failed to get status for job (jobId={})", mJobId, e); return Status.FAILED; } boolean finished = true; for (JobInfo child : jobInfo.getChildren()) { if (!child.getStatus().isFinished()) { finished = false; break; } } if (finished) { if (jobInfo.getStatus().equals(Status.FAILED)) { System.out.println(String.format("Attempt %s to load %s failed because: %s", mRetryPolicy.getAttemptCount(), mJobConfig.getFilePath(), jobInfo.getErrorMessage())); } else if (jobInfo.getStatus().equals(Status.COMPLETED)) { <START> System.out.println(String.format("Attempt %s to load %s completed", <END> mRetryPolicy.getAttemptCount(), mJobConfig.getFilePath())); } return jobInfo.getStatus(); } return Status.RUNNING; }</code><technical_language>word this a bit differently, Successfully loaded path %s %d attempts? Also, is for this spammy if a large number of files is loaded</technical_language>

Target:
private Status check() { if (mJobId == null) { return Status.FAILED; } JobInfo jobInfo; try { jobInfo = mClient.getJobStatus(mJobId); } catch (IOException e) { LOG.warn("Failed to get status for job (jobId={})", mJobId, e); return Status.FAILED; } boolean finished = true; for (JobInfo child : jobInfo.getChildren()) { if (!child.getStatus().isFinished()) { finished = false; break; } } if (finished) { if (jobInfo.getStatus().equals(Status.FAILED)) { System.out.println(String.format("Attempt %d to load %s failed because: %s", mRetryPolicy.getAttemptCount(), mJobConfig.getFilePath(), jobInfo.getErrorMessage())); } else if (jobInfo.getStatus().equals(Status.COMPLETED)) { System.out.println(String.format("Successfully loaded path %s after %d attempts", mJobConfig.getFilePath(), mRetryPolicy.getAttemptCount())); } return jobInfo.getStatus(); } return Status.RUNNING; }
Source:
<code>private void hideDangerousDeveloperPrefsIfNeeded() { if (!GlobalPrivilegesManager.isAdvancedSettingsAccessEnabled() && !BuildConfig.DEBUG) { <START> PreferenceScreen prefScreen = getPreferenceScreen(); <END> for (String key : getNonWhitelistedKeys()) { Preference pref = findPreference(key); if (pref != null) { prefScreen.removePreference(pref); } } } }</code><technical_language>iterate this prefScreen.getPreferenceCount -> prefScreen.getPReference(cout) hide show in whitelisted keys, a bit verbose (and error prone) building lists diffing</technical_language>

Target:
private void hideDangerousDeveloperPrefsIfNeeded() { if (!GlobalPrivilegesManager.isAdvancedSettingsAccessEnabled() && !BuildConfig.DEBUG) { PreferenceScreen prefScreen = getPreferenceScreen(); for (int i = 0; i < prefScreen.getPreferenceCount(); i++) { Preference pref = prefScreen.getPreference(i); if (pref != null && !WHITELISTED_DEVELOPER_PREF_KEYS.contains(pref.getKey())) { prefScreen.removePreference(pref); } } } }
Source:
<code>public void onBackPressed() { if (contributionsFragment != null && activeFragment == ActiveFragment.CONTRIBUTIONS) { <START> if (ContributionsFragment.mediaDetailPagerFragment==null) { END> super.onBackPressed(); } else if (ContributionsFragment.mediaDetailPagerFragment!=null) { if(!ContributionsFragment.mediaDetailPagerFragment.isVisible()){ super.onBackPressed(); } else { contributionsFragment.backButtonClicked(); } } } else if (nearbyParentFragment != null && activeFragment == ActiveFragment.NEARBY) { nearbyParentFragment.backButtonClicked(); } else if (exploreFragment != null && activeFragment == ActiveFragment.EXPLORE) { exploreFragment.onBackPressed(); } else if (bookmarkFragment != null && activeFragment == ActiveFragment.BOOKMARK) { bookmarkFragment.onBackPressed(); } else { super.onBackPressed(); } }</code><technical_language>This is a good practice a fragment static reaching classname. object oriented approaches instead. leaks</technical_language>

Target:
public void onBackPressed() { if (contributionsFragment != null && activeFragment == ActiveFragment.CONTRIBUTIONS) { mediaDetailPagerFragment=contributionsFragment.getMediaDetailPagerFragment(); if (mediaDetailPagerFragment ==null) { super.onBackPressed(); } else if (mediaDetailPagerFragment!=null) { if(!mediaDetailPagerFragment.isVisible()){ super.onBackPressed(); } else { contributionsFragment.backButtonClicked(); } } } else if (nearbyParentFragment != null && activeFragment == ActiveFragment.NEARBY) { nearbyParentFragment.backButtonClicked(); } else if (exploreFragment != null && activeFragment == ActiveFragment.EXPLORE) { exploreFragment.onBackPressed(); } else if (bookmarkFragment != null && activeFragment == ActiveFragment.BOOKMARK) { bookmarkFragment.onBackPressed(); } else { super.onBackPressed(); } }
Source:
<code>public void test() { NestedGenericClass<List<Object>> nestedGenericClass = new NestedGenericClass<List<Object>>(new java.util.ArrayList<Object>()); nestedGenericClass.genericMethod(new java.util.LinkedList<Object>()); ComplexNestedGenericClass<List<Object>> complexNestedGenericClass = new ComplexNestedGenericClass<List<Object>>(new java.util.ArrayList<Object>()); complexNestedGenericClass.complexGenericMethod(new java.util.LinkedList<Object>()); <START> } <END></code><technical_language>testing situations there. side I tested cases, encountering issues: ComplexNestedGenericClass v1 = new ComplexNestedGenericClass(new java.util.ArrayList<Object>()); ComplexNestedGenericClass<U> v2 = new ComplexNestedGenericClass<U>(myU); ComplexNestedGenericClass<? extends List<Object>> v3 = new ComplexNestedGenericClass<List<Object>>(new java.util.ArrayList<Object>());</technical_language>

Target:
public void test() { NestedGenericClass<List<Object>> nestedGenericClass = new NestedGenericClass<List<Object>>(new java.util.ArrayList<Object>()); nestedGenericClass.genericMethod(new java.util.LinkedList<Object>()); ComplexNestedGenericClass<List<Object>> complexNestedGenericClass = new ComplexNestedGenericClass<List<Object>>(new java.util.ArrayList<Object>()); complexNestedGenericClass.complexGenericMethod(new java.util.LinkedList<Object>()); ComplexNestedGenericClass v1 = new ComplexNestedGenericClass(new java.util.ArrayList<Object>()); ComplexNestedGenericClass<U> v2 = new ComplexNestedGenericClass<U>(new U()); ComplexNestedGenericClass<? extends List<Object>> v3 = new ComplexNestedGenericClass<List<Object>>(new java.util.ArrayList<Object>()); }
Source:
<code>public void itemWriterForPojos() throws Exception { <START> AvroItemWriter avroItemWriter = new AvroItemWriter(output,plainOldUserSchemaResource, PlainOldUser.class); <END> avroItemWriter.afterPropertiesSet(); avroItemWriter.open(new ExecutionContext()); avroItemWriter.write(this.plainOldUsers()); avroItemWriter.close(); verifyRecordsWithEmbeddedHeader(outputStream.toByteArray(), this.plainOldUsers(), PlainOldUser.class); }</code><technical_language>generic type avoid warnings: AvroItemWriter< PlainOldUser >. a couple of in this test class</technical_language>

Target:
public void itemWriterForPojos() throws Exception { AvroItemWriter<PlainOldUser> avroItemWriter = new AvroItemWriter(output,plainOldUserSchemaResource, PlainOldUser.class); avroItemWriter.open(new ExecutionContext()); avroItemWriter.write(this.plainOldUsers()); avroItemWriter.close(); verifyRecordsWithEmbeddedHeader(outputStream.toByteArray(), this.plainOldUsers(), PlainOldUser.class); }
Source:
<code>private void testAutoServer(boolean port) throws Exception { if (config.memory || config.networked) { return; } deleteDb(getTestName()); String url = getURL(getTestName() + ";AUTO_SERVER=TRUE", true); if (port) { url += ";AUTO_SERVER_PORT=11111"; } String user = getUser(), password = getPassword(); Connection connServer = getConnection(url + ";OPEN_NEW=TRUE", user, password); <START> int i = ITERATIONS; <END> for (; i > 0; i--) { Thread.sleep(100); SortedProperties prop = SortedProperties.loadProperties( getBaseDir() + "/" + getTestName() + ".lock.db"); String key = prop.getProperty("id"); String server = prop.getProperty("server"); if (server != null) { String u2 = url.substring(url.indexOf(';')); u2 = "jdbc:h2:tcp://" + server + "/" + key + u2; Connection conn = DriverManager.getConnection(u2, user, password); conn.close(); int gotPort = Integer.parseInt(server.substring(server.lastIndexOf(':') + 1)); if (port) { assertEquals(11111, gotPort); } break; } } if (i <= 0) { fail(); } try (Connection conn = getConnection(url + ";OPEN_NEW=TRUE")) { Statement stat = conn.createStatement(); if (config.big) { try { stat.execute("SHUTDOWN"); } catch (SQLException e) { assertKnownException(e); } } } connServer.close(); deleteDb("autoServer"); }</code><technical_language>indentation is large below</technical_language>

Target:
private void testAutoServer(boolean port) throws Exception { if (config.memory || config.networked) { return; } deleteDb(getTestName()); String url = getURL(getTestName() + ";AUTO_SERVER=TRUE", true); if (port) { url += ";AUTO_SERVER_PORT=11111"; } String user = getUser(), password = getPassword(); try (Connection connServer = getConnection(url + ";OPEN_NEW=TRUE", user, password)) { int i = ITERATIONS; for (; i > 0; i--) { Thread.sleep(100); SortedProperties prop = SortedProperties.loadProperties( getBaseDir() + "/" + getTestName() + ".lock.db"); String key = prop.getProperty("id"); String server = prop.getProperty("server"); if (server != null) { String u2 = url.substring(url.indexOf(';')); u2 = "jdbc:h2:tcp://" + server + "/" + key + u2; Connection conn = DriverManager.getConnection(u2, user, password); conn.close(); int gotPort = Integer.parseInt(server.substring(server.lastIndexOf(':') + 1)); if (port) { assertEquals(11111, gotPort); } break; } } if (i <= 0) { fail(); } try (Connection conn = getConnection(url + ";OPEN_NEW=TRUE")) { Statement stat = conn.createStatement(); if (config.big) { try { stat.execute("SHUTDOWN"); } catch (SQLException e) { assertKnownException(e); } } } } deleteDb("autoServer"); }
Source:
<code>public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = View.inflate(getContext(), R.layout.contributor_item, null); ViewHolder viewHolder = new ViewHolder(); <START> viewHolder.contributorName = (TextView) convertView.findViewById(R.id.contributorName); <END> viewHolder.contributorAvatar = (ImageView) convertView.findViewById(R.id.contributorIcon); convertView.setTag(viewHolder); } Contributor contributor = getItem(position); ViewHolder viewHolder = (ViewHolder) convertView.getTag(); viewHolder.contributorName.setText(contributor.getLogin()); if (!TextUtils.isEmpty(contributor.getAvatarUrl())) { Picasso.with(getContext()).load(contributor.getAvatarUrl()).into(viewHolder.contributorAvatar); } return convertView; }</code><technical_language>ButterKnife annotate contributorName field, findViewById lines removed</technical_language>

Target:
public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = View.inflate(getContext(), R.layout.contributor_item, null); ViewHolder viewHolder = new ViewHolder(convertView); convertView.setTag(viewHolder); } Contributor contributor = getItem(position); ViewHolder viewHolder = (ViewHolder) convertView.getTag(); viewHolder.contributorName.setText(contributor.getLogin()); if (!TextUtils.isEmpty(contributor.getAvatarUrl())) { App.getInstance().getPicasso() .load(contributor.getAvatarUrl()) .into(viewHolder.contributorAvatar); } return convertView; }
Source:
<code>public void addTerrain(Geocache cache) { if (cache.getTerrain() > 0) { if (ECConnector.getInstance().canHandle(cache.getGeocode())) { <START> addStars(R.string.cache_terrain, cache.getTerrain(), 7); <END> } else { addStars(R.string.cache_terrain, cache.getTerrain()); } } }</code><technical_language>Please do if-then-else differentiation 5 7 stars. Instead create a new method in connector interface, implement return 7 for connector, 5 for AbstractConnector, other connector is derived from</technical_language>

Target:
public void addTerrain(Geocache cache) { if (cache.getTerrain() > 0) { addStars(R.string.cache_terrain, cache.getTerrain(), ConnectorFactory.getConnector(cache).getMaxTerrain()); } }
Source:
<code>public static @Nullable Integer getThreadPrio(KernelAnalysis module, Integer threadId, long ts) { Integer execPrio = null; ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return execPrio; } try { <START> Integer execPrioQuark = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.PRIO); <END> ITmfStateInterval interval = ss.querySingleState(ts, execPrioQuark); ITmfStateValue prioValue = interval.getStateValue(); execPrio = prioValue.unboxInt(); } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { } return execPrio; }</code><technical_language>This "int" instead of Integer here, avoid unneeded boxing/unboxing (since int)</technical_language>

Target:
public static @Nullable Integer getThreadPrio(KernelAnalysis module, Integer threadId, long ts) { Integer execPrio = null; ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return execPrio; } try { int execPrioQuark = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.PRIO); ITmfStateInterval interval = ss.querySingleState(ts, execPrioQuark); ITmfStateValue prioValue = interval.getStateValue(); execPrio = prioValue.unboxInt(); } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { } return execPrio; }
Source:
<code>private void generatePasswordIfNoneProvided(Template template) { TemplateOptions options = template.getOptions(); if (options.getLoginPassword() == null) { Optional<String> passwordOptional = template.getImage().getDefaultCredentials().getOptionalPassword(); <START> if (passwordOptional.isPresent()) { <END> options.overrideLoginPassword(passwordOptional.get()); return; } else { options.overrideLoginPassword(Passwords.generate()); } } }</code><technical_language>More concise version: options.overrideLoginPassword(passwordOptional.or(Passwords.generate()))</technical_language>

Target:
private void generatePasswordIfNoneProvided(Template template) { TemplateOptions options = template.getOptions(); if (options.getLoginPassword() == null) { Optional<String> passwordOptional = template.getImage().getDefaultCredentials().getOptionalPassword(); options.overrideLoginPassword(passwordOptional.or(Passwords.generate())); } }
Source:
<code>private void savePreferences() { try { List<String> groupIds = new ArrayList<>(); for (RepositoryGroup group : groupMap.values()) { String groupId = group.getGroupId().toString(); groupIds.add(groupId); String name = group.getName(); preferences.put(PREFS_GROUP_NAME_PREFIX + groupId, name); <START> List<String> repos = group.getRepositoryDirectories(); preferences.put(PREFS_GROUP_PREFIX + groupId, StringUtils.join(repos, SEPARATOR)); <END> } preferences.put(PREFS_GROUPS, StringUtils.join(groupIds, SEPARATOR)); preferences.flush(); } catch (BackingStoreException e) { Activator.logError( UIText.RepositoriesView_RepoGroup_ErrorSavePreferences, e); } }</code><technical_language>String repos = group.getRepositoryDirectories().stream() .map(File::toString) .collect(Collectors.joining(SEPARATOR)); preferences.put(PREFS_GROUP_PREFIX + groupId, repos);</technical_language>

Target:
private void savePreferences() { try { List<String> groupIds = new ArrayList<>(); for (RepositoryGroup group : groupMap.values()) { String groupId = group.getGroupId().toString(); groupIds.add(groupId); String name = group.getName(); preferences.put(PREFS_GROUP_NAME_PREFIX + groupId, name); String repos = group.getRepositoryDirectories().stream() .map(File::toString) .collect(Collectors.joining(SEPARATOR)); preferences.put(PREFS_GROUP_PREFIX + groupId, repos); } preferences.put(PREFS_GROUPS, StringUtils.join(groupIds, SEPARATOR)); preferences.flush(); } catch (BackingStoreException e) { Activator.logError( UIText.RepositoriesView_RepoGroup_ErrorSavePreferences, e); } }
Source:
<code>public void checkStateChanged(CheckStateChangedEvent event) { TmfXYChartViewer chartViewer = getChartViewer(); if (chartViewer == null) { return; } <START> if (fTreeViewer == null || fTreeViewer.getTrace() == null) { <END> return; } ICheckable checkboxTree = event.getCheckable(); if (checkboxTree instanceof CheckboxTreeViewer) { Set<@NonNull Integer> quarks = new TreeSet<>(); for (Object checkedElement : fTriStateFilteredCheckboxTree.getCheckedElements()) { if (checkedElement instanceof CounterTreeViewerEntry) { quarks.add(((CounterTreeViewerEntry) checkedElement).getQuark()); } } if (chartViewer instanceof CounterChartViewer) { ((CounterChartViewer) chartViewer).updateChart(quarks); } } }</code><technical_language>If tree viewer's trace is null, empty input elements, send CheckStateChangedEvent</technical_language>

Target:
public void checkStateChanged(CheckStateChangedEvent event) { TmfXYChartViewer chartViewer = getChartViewer(); if (chartViewer == null) { return; } ICheckable checkboxTree = event.getCheckable(); if (checkboxTree instanceof CheckboxTreeViewer) { Set<@NonNull Integer> quarks = new TreeSet<>(); for (Object checkedElement : fTriStateFilteredCheckboxTree.getCheckedElements()) { if (checkedElement instanceof CounterTreeViewerEntry) { quarks.add(((CounterTreeViewerEntry) checkedElement).getQuark()); } } if (chartViewer instanceof CounterChartViewer) { ((CounterChartViewer) chartViewer).updateChart(quarks); } } }
Source:
<code>public String getName() { if(getEcoreClassifier() == null) { <START> return "null"; <END> } return getEcoreClassifier().getName(); }</code><technical_language>I return ""</technical_language>

Target:
public String getName() { if(getEcoreClassifier() == null) { return ""; } return getEcoreClassifier().getName(); }
Source:
<code>private int readNoFilter(int[] positions, int positionCount) throws IOException { int streamPosition = 0; allNulls = false; <START> offsetVector = new int[positionCount + 1]; <END> int offsetVectorIndex = 0; offsetVector[offsetVectorIndex] = 0; boolean isCharType = streamDescriptor.getOrcType().getOrcTypeKind() == OrcType.OrcTypeKind.CHAR; int maxCodePointCount = getMaxCodePointCount(streamDescriptor.getOrcType()); for (int i = 0; i < positionCount; i++) { int position = positions[i]; if (position > streamPosition) { skipData(streamPosition, position); streamPosition = position; } if (isNullVector != null && isNullVector[position]) { int prev = offsetVector[offsetVectorIndex]; offsetVector[++offsetVectorIndex] = prev; nulls[i] = true; } else { int currentOffSet = offsetVector[offsetVectorIndex]; int currentLength = lengthVector[lengthIndex]; int truncatedLength = 0; if (currentLength > 0) { dataStream.next(data, currentOffSet, currentOffSet + currentLength); truncatedLength = computeTruncatedLength(slice, currentOffSet, currentLength, maxCodePointCount, isCharType); Verify.verify(truncatedLength >= 0); } offsetVector[++offsetVectorIndex] = currentOffSet + truncatedLength; lengthIndex++; } streamPosition++; } outputPositionCount = positionCount; outputPositions = positions; return streamPosition; }</code><technical_language>reason reuse offsetVector</technical_language>

Target:
private int readNoFilter(int[] positions, int positionCount) throws IOException { int streamPosition = 0; allNulls = false; for (int i = 0; i < positionCount; i++) { int position = positions[i]; if (position > streamPosition) { skipData(streamPosition, position - streamPosition); streamPosition = position; } int offset = offsets[i]; if (presentStream != null && isNullVector[position]) { if (offsets != null) { offsets[i + 1] = offset; } nulls[i] = true; } else { int length = lengthVector[lengthIndex]; int truncatedLength = 0; if (length > 0) { dataStream.next(data, offset, offset + length); truncatedLength = computeTruncatedLength(dataAsSlice, offset, length, maxCodePointCount, isCharType); } offsets[i + 1] = offset + truncatedLength; lengthIndex++; if (presentStream != null) { nulls[i] = false; } } streamPosition++; } outputPositionCount = positionCount; return streamPosition; }
Source:
<code>private Address(String address, String personal, boolean parse) { if (address == null) { <START> throw new NullPointerException("address"); <END> } if (parse) { Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(address); if (tokens.length > 0) { Rfc822Token token = tokens[0]; if (token.getAddress() == null) { throw new NullPointerException("token.getAddress()"); } mAddress = token.getAddress(); String name = token.getName(); if (!TextUtils.isEmpty(name)) { mPersonal = name; } else { mPersonal = (personal == null) ? null : personal.trim(); } } else { Timber.e("Invalid address: %s", address); } } else { mAddress = address; mPersonal = personal; } }</code><technical_language>typically IllegalArgumentException for kinds of checks</technical_language>

Target:
private Address(String address, String personal, boolean parse) { if (address == null) { throw new IllegalArgumentException("address"); } if (parse) { Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(address); if (tokens.length > 0) { Rfc822Token token = tokens[0]; if (token.getAddress() == null) { throw new IllegalArgumentException("token.getAddress()"); } mAddress = token.getAddress(); String name = token.getName(); if (!TextUtils.isEmpty(name)) { mPersonal = name; } else { mPersonal = (personal == null) ? null : personal.trim(); } } else { Timber.e("Invalid address: %s", address); } } else { mAddress = address; mPersonal = personal; } }
Source:
<code>public void testBinEchoPrintsArguments() throws Exception { Spawn spawn; if (OS.getCurrent() == OS.WINDOWS) { <START> spawn = createSpawn("C:/windows/system32/cmd.exe", "/c", "echo", "Hello,", "world."); <END> } else { spawn = createSpawn("/bin/echo", "Hello,", "world."); } run(spawn); assertThat(out()).isEqualTo("Hello, world." + System.lineSeparator()); assertThat(err()).isEmpty(); }</code><technical_language>tests assumed running arbitrary windows machine do operate in some sort of controlled environment (I.e. need for real windows installation in c:\windows). If tests executed a real machine, I a bit optimistic assume windows is installed in C:\WINDOWS. %WinDir% %SystemDrive% environment variables in order figure out actual location</technical_language>

Target:
public void testBinEchoPrintsArguments() throws Exception { Spawn spawn; if (OS.getCurrent() == OS.WINDOWS) { spawn = createSpawn(CMD_EXE, "/c", "echo", "Hello,", "world."); } else { spawn = createSpawn("/bin/echo", "Hello,", "world."); } run(spawn); assertThat(out()).isEqualTo("Hello, world." + System.lineSeparator()); assertThat(err()).isEmpty(); }
Source:
<code>@Override public int selectString(Options options) throws IOException { int p = peeked; if (p == PEEKED_NONE) { p = doPeek(); } if (p != PEEKED_DOUBLE_QUOTED) { return -1; } int result = source.select(options.doubleQuoteSuffix); if (result == -1) { String nextString = nextString(); for (int i = 0, size = options.strings.length; i < size; i++) { if (nextString.equals(options.strings[i])) { result = i; peeked = PEEKED_NONE; pathIndices[stackSize - 1]++; <START> break; <END> } } if (result == -1) { peeked = PEEKED_BUFFERED; peekedString = nextString; pathIndices[stackSize - 1]--; } } else { peeked = PEEKED_NONE; pathIndices[stackSize - 1]++; } return result; }</code><technical_language>replace break return</technical_language>

Target:
@Override public int selectString(Options options) throws IOException { int p = peeked; if (p == PEEKED_NONE) { p = doPeek(); } if (p < PEEKED_SINGLE_QUOTED || p > PEEKED_BUFFERED) { return -1; } int result = source.select(options.doubleQuoteSuffix); if (result != -1) { peeked = PEEKED_NONE; pathIndices[stackSize - 1]++; return result; } String nextString = nextString(); for (int i = 0, size = options.strings.length; i < size; i++) { if (nextString.equals(options.strings[i])) { peeked = PEEKED_NONE; pathIndices[stackSize - 1]++; return i; } } peeked = PEEKED_BUFFERED; peekedString = nextString; pathIndices[stackSize - 1]--; return -1; }