auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void navigate() { FinderNavigation navi; if (ConfigUtils.isDomain()) { navi = new FinderNavigation(browser, DomainConfigEntryPoint.class) .addAddress(FinderNames.CONFIGURATION, FinderNames.PROFILES) <START> .addAddress(FinderNames.PROFILE, "full"); <END> } else { navi = new FinderNavigation(browser, StandaloneConfigEntryPoint.class) .addAddress(FinderNames.CONFIGURATION, FinderNames.SUBSYSTEMS); } navi.addAddress(FinderNames.SUBSYSTEM, "Batch").selectRow().invoke(FinderNames.VIEW); Application.waitUntilVisible(); }</code><technical_language>loading profile name org.jboss.hal.testsuite.util.ConfigUtils#getDefaultProfile</technical_language>

Target:
public void navigate() { FinderNavigation navi; if (ConfigUtils.isDomain()) { navi = new FinderNavigation(browser, DomainConfigEntryPoint.class) .addAddress(FinderNames.CONFIGURATION, FinderNames.PROFILES) .addAddress(FinderNames.PROFILE, ConfigUtils.getDefaultProfile()); } else { navi = new FinderNavigation(browser, StandaloneConfigEntryPoint.class) .addAddress(FinderNames.CONFIGURATION, FinderNames.SUBSYSTEMS); } navi.addAddress(FinderNames.SUBSYSTEM, "Batch").selectRow().invoke(FinderNames.VIEW); Application.waitUntilVisible(); }
Source:
<code>public void queryBackend() { boolean nfs = false; if(currentTab == ProfileTabSelected.NFS) { nfs = true; } final VolumeProfileStatisticsModel profileStatsModel = this; <START> profileStatsModel.startProgress(ConstantsManager.getInstance().getConstants().fetchingDataMessage()); <END> AsyncDataProvider.getGlusterVolumeProfilingStatistics(new AsyncQuery(new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { profileStatsModel.stopProgress(); VdcQueryReturnValue vdcValue = (VdcQueryReturnValue) returnValue; GlusterVolumeProfileInfo profileInfoEntity =vdcValue.getReturnValue(); setProfileInfo(profileInfoEntity); if((profileInfoEntity == null) || (!vdcValue.getSucceeded())) { volumeListModel.showProfileErrorWindow(); } else { setConfirmWindow(null); if(getWindow() == null) { setTitle(ConstantsManager.getInstance().getMessages().volumeProfilingStatsTitle(volumeName)); if(currentTab == ProfileTabSelected.NFS) { showNfsProfileStats(profileInfoEntity); } else { showProfileStats(profileInfoEntity); } volumeListModel.setProfileWindow(profileStatsModel); } } } }), clusterId, volumeId, nfs); }</code><technical_language>startProgress</technical_language>

Target:
public void queryBackend() { boolean nfs = false; if(currentTab == ProfileTabSelected.NFS) { nfs = true; } final VolumeProfileStatisticsModel profileStatsModel = this; startProgress(ConstantsManager.getInstance().getConstants().fetchingDataMessage()); AsyncDataProvider.getGlusterVolumeProfilingStatistics(new AsyncQuery(new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { stopProgress(); VdcQueryReturnValue vdcValue = (VdcQueryReturnValue) returnValue; GlusterVolumeProfileInfo profileInfoEntity =vdcValue.getReturnValue(); setProfileInfo(profileInfoEntity); if((profileInfoEntity == null) || (!vdcValue.getSucceeded())) { volumeListModel.showProfileErrorWindow(); } else { setConfirmWindow(null); if(getWindow() == null) { setTitle(ConstantsManager.getInstance().getMessages().volumeProfilingStatsTitle(volumeName)); if(currentTab == ProfileTabSelected.NFS) { showNfsProfileStats(profileInfoEntity); } else { showProfileStats(profileInfoEntity); } volumeListModel.setProfileWindow(profileStatsModel); } } } }), clusterId, volumeId, nfs); }
Source:
<code>public void requestInterstitialAd(Context context, MediationInterstitialListener listener, Bundle serverParameters, MediationAdRequest mediationAdRequest, Bundle mediationExtras) { onLog("requestInterstitialAd"); mInterstitialListener = listener; if (!(context instanceof Activity)) { Log.d(TAG, "IronSource SDK requires an Activity context to initialize"); onISAdFailedToLoad(AdRequest.ERROR_CODE_INVALID_REQUEST); return; } try { if (mediationExtras != null) { <START> if (mediationExtras.containsKey(KEY_TEST_MODE)) { <END> this.mIsTestEnabled = mediationExtras.getBoolean(KEY_TEST_MODE, false); } } String appKey = serverParameters.getString(KEY_APP_KEY); if (TextUtils.isEmpty(appKey)) { onLog("onInitializationFailed, make sure that 'appKey' server parameter is added"); onISAdFailedToLoad(AdRequest.ERROR_CODE_INVALID_REQUEST); return; } this.mInstanceID = serverParameters.getString(KEY_INTANCE_ID, "0"); onLog("Server params for IS | appKey: " + appKey + " | isTestEnabled: " + this.mIsTestEnabled + " | InstanceID: " + this.mInstanceID ); IronSource.setISDemandOnlyInterstitialListener(this); initIronSourceSDK(context, appKey, IronSource.AD_UNIT.INTERSTITIAL); loadISIronSourceSDK(); } catch (Exception e) { onLog("onInitializationFailed, error: " + e.getMessage()); onISAdFailedToLoad(AdRequest.ERROR_CODE_INTERNAL_ERROR); } }</code><technical_language>MediationAdRequest's [isTesting()](<LINK_0> determine if a publisher is requesting test ads. Please note this requires Google Mobile Ads Android SDK version 11.8.0 higher</technical_language>

Target:
public void requestInterstitialAd(Context context, MediationInterstitialListener listener, Bundle serverParameters, MediationAdRequest mediationAdRequest, Bundle mediationExtras) { onLog("requestInterstitialAd"); mInterstitialListener = listener; if (!(context instanceof Activity)) { Log.d(TAG, "IronSource SDK requires an Activity context to initialize"); onISAdFailedToLoad(AdRequest.ERROR_CODE_INVALID_REQUEST); return; } try { this.mIsLogEnabled = mediationAdRequest.isTesting(); String appKey = serverParameters.getString(KEY_APP_KEY); if (TextUtils.isEmpty(appKey)) { onLog("onInitializationFailed, make sure that 'appKey' server parameter is added"); onISAdFailedToLoad(AdRequest.ERROR_CODE_INVALID_REQUEST); return; } this.mInstanceID = serverParameters.getString(KEY_INTANCE_ID, "0"); onLog("Server params for IS | appKey: " + appKey + " | isTestEnabled: " + this.mIsLogEnabled + " | InstanceID: " + this.mInstanceID ); IronSource.setISDemandOnlyInterstitialListener(this); initIronSourceSDK(context, appKey, IronSource.AD_UNIT.INTERSTITIAL); loadISIronSourceSDK(); } catch (Exception e) { onLog("onInitializationFailed, error: " + e.getMessage()); onISAdFailedToLoad(AdRequest.ERROR_CODE_INTERNAL_ERROR); } }
Source:
<code><START> public int compareTo(JavaVersion other) { <END> if (this.equals(other)) { return 0; } return this.discard < other.discard ? -1 : this.discard > other.discard ? 1 : this.major < other.major ? -1 : this.major > other.major ? 1 : this.minor < other.minor ? -1 : this.minor > other.minor ? 1 : this.update < other.update ? -1 : this.update > other.update ? 1 : this.build < other.build ? -1 : 1; }</code><technical_language>explicitly @Override here</technical_language>

Target:
public int compareTo(JavaVersion other) { return this.discard != other.discard ? this.discard - other.discard : this.major != other.major ? this.major - other.major : this.minor != other.minor ? this.minor - other.minor : this.update != other.update ? this.update - other.update : this.build != other.build ? this.build - other.build : 0; }
Source:
<code>void sendError(HttpResponseStatus status, Throwable ex) { String msg; if (ex instanceof InvocationTargetException) { msg = String.format("Exception Encountered while processing request : %s", <START> ((InvocationTargetException) ex).getTargetException().getMessage()); <END> } else { msg = String.format("Exception Encountered while processing request: %s", ex.getMessage()); } responder.sendString(status, msg, ImmutableMultimap.of(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.CLOSE)); }</code><technical_language>to: <LINK_0>, ex.getCause()</technical_language>

Target:
void sendError(HttpResponseStatus status, Throwable ex) { String msg; if (ex instanceof InvocationTargetException) { msg = String.format("Exception Encountered while processing request : %s", Objects.firstNonNull(ex.getCause(), ex).getMessage()); } else { msg = String.format("Exception Encountered while processing request: %s", ex.getMessage()); } responder.sendString(status, msg, ImmutableMultimap.of(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.CLOSE)); }
Source:
<code>private void settings(final int buttonNo) { ObservableList<Node> buttons; buttons = rootNode(stage).getScene().getRoot() .getChildrenUnmodifiable(); if (buttonNo <= SETTINGS_SOUNDEFFECTS) { clickOn(buttons.get(buttonNo), MouseButton.PRIMARY); } else { clickOn(buttons.get(buttonNo), MouseButton.PRIMARY); press(MouseButton.PRIMARY); <START> moveTo(MOVE_X_SLIDER, MOVE_Y_SLIDER); <END> release(MouseButton.PRIMARY); } sleep(SHORT); }</code><technical_language>safer moveBy(double, double) here. this, E2E properly function smaller screens, moveTo moves absolute position screen. that, revert assertEquals(0, volume) failed earlier. <testing, logic</technical_language>

Target:
private void settings(final int buttonNo) { ObservableList<Node> buttons; buttons = rootNode(stage).getScene().getRoot() .getChildrenUnmodifiable(); if (buttonNo <= SETTINGS_SOUNDEFFECTS) { clickOn(buttons.get(buttonNo), MouseButton.PRIMARY); } else { clickOn(buttons.get(buttonNo), MouseButton.PRIMARY); press(MouseButton.PRIMARY); moveBy(MOVE_X_SLIDER, MOVE_Y_SLIDER); release(MouseButton.PRIMARY); } sleep(SHORT); }
Source:
<code>private WebElement getActiveDialog() { WebElement dialog = null; List<WebElement> elements = driver.findElements(By.cssSelector(".discussion-dialog.is-visible")); if (elements.isEmpty()) { dialog = driver.findElement(By.cssSelector(".discussion-dialog.is-visible.modal-dialog-approve")); } else if (1 < elements.size()) { throw new IllegalStateException("Only one modal dialog should be visible!"); } else { dialog = elements.get(0); } <START> return dialog; <END> }</code><technical_language>Remove pre-defined variable? private WebElement getActiveDialog() { List<WebElement> elements = driver.findElements(By.cssSelector(".discussion-dialog.is-visible")); if (elements.isEmpty()) { // allow selenium throw exception return driver.findElement(By.cssSelector(".discussion-dialog.is-visible.modal-dialog-approve")); } else if (1 < elements.size()) { // modal dialog visible throw new IllegalStateException("Only modal dialog visible!"); } else { return elements.get(0); }</technical_language>

Target:
private WebElement getActiveDialog() { List<WebElement> elements = driver.findElements(By.cssSelector(".discussion-dialog.is-visible")); if (elements.isEmpty()) { return driver.findElement(By.cssSelector(".discussion-dialog.is-visible.modal-dialog-approve")); } else if (1 < elements.size()) { throw new IllegalStateException("Only one modal dialog should be visible!"); } else { return elements.get(0); } }
Source:
<code>public LongWrappingDimensionSelector(LongColumnSelector selector, ExtractionFn extractionFn) { this.delegate = selector; <START> this.exFn = extractionFn; <END> }</code><technical_language>This selector is throw NPE get() if extractionFn is null, throw in construction: this.extractionFn = Preconditions.checkNotNull(extractionFn, "extractionFn");</technical_language>

Target:
public LongWrappingDimensionSelector(LongColumnSelector selector, ExtractionFn extractionFn) { this.selector = selector; this.extractionFn = extractionFn; }
Source:
<code>public void load(EngineLocalConfig config) throws ConfigurationException { File customExtensionsDir = config.getCustomExtensionsDir(); <START> File builtInExtensionsDir = config.getBuiltInExtensionsDir(); <END> load(customExtensionsDir); load(builtInExtensionsDir); activate(); }</code><technical_language>do need temp variables...</technical_language>

Target:
public void load(EngineLocalConfig config) throws ConfigurationException { for (File directory : config.getExtensionsDirectories()) { load(directory); } activate(); }
Source:
<code><START> @Test public void test() { <END> byte[] key = new byte[1024]; int[] position = new int[slots.size()]; int offset = ScanUtil.setKey(schema, slots, ScanUtil.getDefaultSlotSpans(slots.size()), position, bound, key, 0, 0, slots.size()); byte[] actualKey = new byte[offset]; System.arraycopy(key, 0, actualKey, 0, offset); assertArrayEquals(expectedKey, actualKey); }</code><technical_language>nit: a line</technical_language>

Target:
public void test() { byte[] key = new byte[1024]; int[] position = new int[slots.size()]; int offset = ScanUtil.setKey(schema, slots, ScanUtil.getDefaultSlotSpans(slots.size()), position, bound, key, 0, 0, slots.size()); byte[] actualKey = new byte[offset]; System.arraycopy(key, 0, actualKey, 0, offset); assertArrayEquals(expectedKey, actualKey); }
Source:
<code>public List<BaragonResponse> getResponsesForService(String serviceId, int limit) { final List<String> nodes = getChildren(String.format(RESPONSE_HISTORIES_FOR_SERVICE_FORMAT, serviceId)); final List<BaragonResponse> responses = Lists.newArrayListWithCapacity(Math.min(nodes.size(), limit)); Iterator<String> nodeIterator = nodes.iterator(); <START> for (int i = 0; nodeIterator.hasNext() && i < limit; i++) { <END> String requestId = nodeIterator.next(); try { responses.addAll(readFromZk(String.format(RESPONSE_HISTORY_FORMAT, serviceId, requestId), BaragonResponse.class).asSet()); } catch (Exception e) { LOG.error(String.format("Could not fetch info for group %s due to error %s", requestId, e)); } } return responses; }</code><technical_language>preferable .subList() instead of this iterator stuff</technical_language>

Target:
public List<BaragonResponse> getResponsesForService(String serviceId, int limit) { final List<String> nodes = getChildren(String.format(RESPONSE_HISTORIES_FOR_SERVICE_FORMAT, serviceId)); final List<BaragonResponse> responses = Lists.newArrayListWithCapacity(Math.min(nodes.size(), limit)); for (String requestId : nodes.subList(0, Math.min(nodes.size(), limit))) { try { responses.addAll(readFromZk(String.format(RESPONSE_HISTORY_FORMAT, serviceId, requestId), BaragonResponse.class).asSet()); } catch (Exception e) { LOG.error(String.format("Could not fetch info for group %s due to error %s", requestId, e)); } } return responses; }
Source:
<code>public void testGetAll() { Group group0 = ObjectsFactory.getRandomGroup(); saveAndEvict(group0); Group group1 = ObjectsFactory.getRandomGroup(); saveAndEvict(group1); List<Group> actual = groupDao.getAll(); <START> Collections.sort(actual, new Comparator<Group>() { <END> @Override public int compare(@Nonnull Group group, @Nonnull Group group1) { return Long.compareUnsigned(group.getId(), group1.getId()); } }); assertEquals(actual.size(), 2); assertReflectionEquals(actual.get(0), group0); assertReflectionEquals(actual.get(1), group1); }</code><technical_language>tests declarative, please move this a separate method sortById(List<Group>)</technical_language>

Target:
public void testGetAll() { Group group0 = ObjectsFactory.getRandomGroup(); saveAndEvict(group0); Group group1 = ObjectsFactory.getRandomGroup(); saveAndEvict(group1); List<Group> actual = groupDao.getAll(); sortById(actual); assertEquals(actual.size(), 2); assertReflectionEquals(actual.get(0), group0); assertReflectionEquals(actual.get(1), group1); }
Source:
<code>public boolean isTransportAutoWire() { <START> return Config.getBooleanProperty("AUTOWIRE_CLUSTER_TRANSPORT", true) && LicenseUtil.getLevel()> 200; <END> }</code><technical_language>hardcoded License Level replaced enum LicenseLevel.STANDARD</technical_language>

Target:
public boolean isTransportAutoWire() { return Config.getBooleanProperty("AUTOWIRE_CLUSTER_TRANSPORT", true) && LicenseUtil.getLevel()> LicenseLevel.STANDARD.level; }
Source:
<code>private void startAgedFilesLoad(long runTimeMillis) { long threadID = Thread.currentThread().getId(); LOG.info("AGED LOADGEN: Started Aged IO Thread:{}.", threadID); String threadName = Thread.currentThread().getName(); long startTime = Time.monotonicNow(); while (isWriteThreadRunning.get() && (Time.monotonicNow() < startTime + runTimeMillis)) { String keyName = null; try { if (agedWriteProbability.isTrue()) { keyName = writeData(agedFileWrittenIndex.getAndIncrement(), agedLoadBucket, threadName); } else { Optional<Integer> index = randomKeyToRead(); if (index.isPresent()) { keyName = getKeyName(index.get(), threadName); <START> readData(agedLoadBucket, keyName); <END> } } } catch (Throwable t) { LOG.error("AGED LOADGEN: Exiting due to exception", keyName, t); break; } } isWriteThreadRunning.set(false); LOG.info("Terminating IO thread:{}.", threadID); }</code><technical_language>lets pass index readData, eliminate split function read</technical_language>

Target:
private void startAgedFilesLoad(long runTimeMillis) { long threadID = Thread.currentThread().getId(); LOG.info("AGED LOADGEN: Started Aged IO Thread:{}.", threadID); String threadName = Thread.currentThread().getName(); long startTime = Time.monotonicNow(); while (isWriteThreadRunning.get() && (Time.monotonicNow() < startTime + runTimeMillis)) { String keyName = null; try { if (agedWriteProbability.isTrue()) { keyName = writeData(agedFileWrittenIndex.getAndIncrement(), agedLoadBucket, threadName); } else { Optional<Integer> index = randomKeyToRead(); if (index.isPresent()) { keyName = getKeyName(index.get(), threadName); readData(agedLoadBucket, keyName, index.get()); } } } catch (Throwable t) { LOG.error("AGED LOADGEN: Exiting due to exception", keyName, t); break; } } isWriteThreadRunning.set(false); LOG.info("Terminating IO thread:{}.", threadID); }
Source:
<code>private boolean updateClusterCompatibilityVersionToOldCluster(boolean disableLock) { Version oldClusterVersion = getVm().getClusterCompatibilityVersionOrigin(); oldClusterVersion = oldClusterVersion == null ? Version.v3_6 : oldClusterVersion; if (isRestoreMemory() && getVm().getCustomCompatibilityVersion() == null && oldClusterVersion.less(getVm().getClusterCompatibilityVersion())) { <START> VM vmFromDb = vmDao.get(getVmId()); <END> return updateVm(vmFromDb, oldClusterVersion, disableLock); } return true; }</code><technical_language>need for besides static part here, right? if so, please vmStaticDao instead</technical_language>

Target:
private boolean updateClusterCompatibilityVersionToOldCluster(boolean disableLock) { Version oldClusterVersion = getVm().getClusterCompatibilityVersionOrigin(); oldClusterVersion = oldClusterVersion == null ? Version.v3_6 : oldClusterVersion; if (isRestoreMemory() && getVm().getCustomCompatibilityVersion() == null && oldClusterVersion.less(getVm().getClusterCompatibilityVersion())) { VmStatic vmFromDb = vmStaticDao.get(getVmId()); return updateVm(vmFromDb, oldClusterVersion, disableLock); } return true; }
Source:
<code>private List<Map<String, Object>> exitCodeAssertions() { List<Map<String, Object>> assertStatus = getConfig(ASSERT_STATUS); if (assertStatus.isEmpty()) { <START> Map<String, Object> shouldSucceed = ImmutableMap.<String,Object>of(EQUALS, SUCCESS); <END> assertStatus.add(shouldSucceed); } return assertStatus; }</code><technical_language>nice define this a member variable DEFAULT_ASSERTION like, for clarity</technical_language>

Target:
private List<Map<String, Object>> exitCodeAssertions() { List<Map<String, Object>> assertStatus = getAssertions(this, ASSERT_STATUS); List<Map<String, Object>> assertOut = getAssertions(this, ASSERT_OUT); List<Map<String, Object>> assertErr = getAssertions(this, ASSERT_ERR); if (assertStatus.isEmpty() && assertOut.isEmpty() && assertErr.isEmpty()) { Map<String, Object> shouldSucceed = DEFAULT_ASSERTION; assertStatus.add(shouldSucceed); } return assertStatus; }
Source:
<code>public DataObjectDeletedEvent(String source, DataModel currentModel, DataObject currentDataObject) { <START> super(null, source, currentModel, currentDataObject); <END> }</code><technical_language>a lover of passing nulls methods constructors.. another constructor contextId better</technical_language>

Target:
public DataObjectDeletedEvent(String source, DataModel currentModel, DataObject currentDataObject) { super(source, currentModel, currentDataObject); }
Source:
<code>private void connector(IProject prj) { try { IRemoteConnection irc = Util.getRemoteConnection(prj); if(irc == null) return; Activator.log("Connection for project: '" + prj.getName() + "' is '" + irc + "'"); Activator.log("Connection address is " + irc.getAddress()); final ITerminalView tvr = (ITerminalView) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage() .showView("org.eclipse.tm.terminal.view.TerminalView"); ITerminalConnector[] itcarray = TerminalConnectorExtension .makeTerminalConnectors(); int remoteTools = 0; for (int i = 0; i < itcarray.length; i++) { <START> if("Remote Tools".equals(itcarray[i].getName())) { <END> remoteTools = i; break; } } if(itcarray.length==0) { Activator.log("Could not find a terminal connection for "+prj.getName()); return; } final ITerminalConnector inner = itcarray[remoteTools]; Activator.log("inner="+inner.getId()+","+inner.getName()+","+inner.getSettingsSummary()); ITerminalConnector connector = new ConnectorWrapper(inner,prj); tvr.newTerminal(connector); } catch (CoreException e1) { Activator.log(e1); } }</code><technical_language>I change this "Remote Services" for terminal work. Note is for work coincidence if "Remote Services" is entry in array</technical_language>

Target:
private void connector(IProject prj) { try { IRemoteConnection irc = Util.getRemoteConnection(prj); if(irc == null) return; Activator.log("Connection for project: '" + prj.getName() + "' is '" + irc + "'"); Activator.log("Connection address is " + irc.getAddress()); final ITerminalView tvr = (ITerminalView) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage() .showView("org.eclipse.tm.terminal.view.TerminalView"); ITerminalConnector[] itcarray = TerminalConnectorExtension .makeTerminalConnectors(); int remoteTools = -1; for (int i = 0; i < itcarray.length; i++) { if("Remote Tools".equals(itcarray[i].getName()) || "Remote Services".equals(itcarray[i].getName()) || "org.eclipse.ptp.remote.internal.terminal.RemoteToolsConnector".equals(itcarray[i].getId())) { remoteTools = i; break; } } if(itcarray.length==0) { Activator.log("Could not find a terminal connection for "+prj.getName()); return; } if(remoteTools >= 0) { final ITerminalConnector inner = itcarray[remoteTools]; Activator.log("inner="+inner.getId()+","+inner.getName()+","+inner.getSettingsSummary()); ITerminalConnector connector = inner; ISettingsStore store = new HashSettingsStore(); connector.save(store); store.put(RemoteSettings.PROJECT_NAME, prj.getName()); connector.load(store); tvr.newTerminal(connector); } } catch (CoreException e1) { Activator.log(e1); } }
Source:
<code>public PropertyValues getClassPropertyValues(String wikiName, String className, String propertyName, Integer limit, List<String> filterParameters, Boolean isExactMatch) throws XWikiRestException { DocumentReference classReference = this.resolver.resolve(className, new WikiReference(wikiName)); ClassPropertyReference classPropertyReference = new ClassPropertyReference(propertyName, classReference); if (!this.authorization.hasAccess(Right.VIEW, classPropertyReference)) { throw new WebApplicationException(Status.UNAUTHORIZED); } if (!exists(classPropertyReference)) { throw new WebApplicationException(Status.NOT_FOUND); } URI propertyURI = Utils.createURI(this.uriInfo.getBaseUri(), ClassPropertyResource.class, wikiName, className, propertyName); Link propertyLink = this.objectFactory.createLink(); propertyLink.setHref(propertyURI.toString()); propertyLink.setRel(Relations.PROPERTY); PropertyValues propertyValues; if (isExactMatch) { <START> propertyValues = this.propertyValuesProvider.getValue(classPropertyReference, filterParameters.toArray()); <END> } else { propertyValues = this.propertyValuesProvider .getValues(classPropertyReference, limit, filterParameters.toArray()); } propertyValues.getLinks().add(propertyLink); return propertyValues; }</code><technical_language>call getValue for raw in filterParameters collect results in PropertyValues. This allow client side a single request resolve selected values making multiple requests, selected value</technical_language>

Target:
public PropertyValues getClassPropertyValues(String wikiName, String className, String propertyName, Integer limit, List<String> filterParameters, Boolean isExactMatch) throws XWikiRestException { DocumentReference classReference = this.resolver.resolve(className, new WikiReference(wikiName)); ClassPropertyReference classPropertyReference = new ClassPropertyReference(propertyName, classReference); if (!this.authorization.hasAccess(Right.VIEW, classPropertyReference)) { throw new WebApplicationException(Status.UNAUTHORIZED); } if (!exists(classPropertyReference)) { throw new WebApplicationException(Status.NOT_FOUND); } URI propertyURI = Utils.createURI(this.uriInfo.getBaseUri(), ClassPropertyResource.class, wikiName, className, propertyName); Link propertyLink = this.objectFactory.createLink(); propertyLink.setHref(propertyURI.toString()); propertyLink.setRel(Relations.PROPERTY); PropertyValues propertyValues = new PropertyValues(); if (isExactMatch) { for (String filterParameter : filterParameters) { PropertyValue value = this.propertyValuesProvider.getValue(classPropertyReference, filterParameter); if (value != null) { propertyValues.getPropertyValues().add(value); } } } else { propertyValues = this.propertyValuesProvider .getValues(classPropertyReference, limit, filterParameters.toArray()); } propertyValues.getLinks().add(propertyLink); return propertyValues; }
Source:
<code>public void visitVariableIdentifier(VariableIdentifierTree tree) { if (!isBuiltInVariable(tree)) { if (classMemberUsageState == null) { createOrUseVariableIdentifierSymbol(tree); } else { if (classMemberUsageState.isSelfMember && classScope != null && classMemberUsageState.isStatic) { Symbol symbol = classScope.getSymbol(tree.text(), Symbol.Kind.FIELD); if (symbol != null) { symbol.addUsage(tree); <START> symbolTable.associateSymbol(tree, symbol); <END> } } Symbol symbol = currentScope.getSymbol(tree.text(), Symbol.Kind.VARIABLE, Symbol.Kind.PARAMETER); if (symbol != null) { symbol.addUsage(tree); symbolTable.associateSymbol(tree, symbol); } classMemberUsageState = null; } } }</code><technical_language>call associateSymbol time call addUsage. factorizing that</technical_language>

Target:
public void visitVariableIdentifier(VariableIdentifierTree tree) { if (!isBuiltInVariable(tree)) { if (classMemberUsageState == null) { createOrUseVariableIdentifierSymbol(tree); } else { if (classMemberUsageState.isSelfMember && classScope != null && classMemberUsageState.isStatic) { Symbol symbol = classScope.getSymbol(tree.text(), Symbol.Kind.FIELD); if (symbol != null) { associateSymbol(tree, symbol); } } Symbol symbol = currentScope.getSymbol(tree.text(), Symbol.Kind.VARIABLE, Symbol.Kind.PARAMETER); if (symbol != null) { associateSymbol(tree, symbol); } classMemberUsageState = null; } } }
Source:
<code>protected void registerFactorComparator(FactorComparator<T> comparator){ if (null == comparator || Integer.MAX_VALUE - this.getTotalWeight() < comparator.getWeight() ) { logger.info( <START> "skipping registerFactorComparator as the comaractor is null or has an invalid weight value."); <END> return; } this.factorComparatorList.put(comparator.getFactorName(),comparator); logger.info(String.format("Factor comparator added for '%s'. Weight = '%s'", comparator.getFactorName(), comparator.getWeight())); }</code><technical_language>more sense throw Exception silently accept comparator is null invalid weight</technical_language>

Target:
protected void registerFactorComparator(FactorComparator<T> comparator){ if (null == comparator || Integer.MAX_VALUE - this.getTotalWeight() < comparator.getWeight() ) { throw new IllegalArgumentException("unable to register comparator."+ " The passed comparator is null or has an invalid weight value."); } this.factorComparatorList.put(comparator.getFactorName(),comparator); logger.info(String.format("Factor comparator added for '%s'. Weight = '%s'", comparator.getFactorName(), comparator.getWeight())); }
Source:
<code>public void run() { while (running) { try { numBytes += serialInput.read(buf, start + numBytes, buf.length - numBytes); while (true) { int numRead = peel(buf, start, numBytes); if (numRead == 0) { break; } start += numRead; numBytes -= numRead; } for (int i = 0; i < numBytes; i++) { buf[i] = buf[start + i]; } start = 0; try { Thread.sleep(asleepTime); } catch (InterruptedException e) { new RobobuggyLogicNotification("sleep .... interrupted?", RobobuggyMessageLevel.EXCEPTION); } <START> } catch (IOException | NullPointerException | IndexOutOfBoundsException e) { <END> sp.close(); setNodeState(NodeState.DISCONNECTED); e.printStackTrace(); } } }</code><technical_language>exceptions part of spec</technical_language>

Target:
public void run() { while (running) { try { numBytes += serialInput.read(buf, start + numBytes, buf.length - numBytes); while (true) { int numRead = peel(buf, start, numBytes); if (numRead == 0) { break; } start += numRead; numBytes -= numRead; } for (int i = 0; i < numBytes; i++) { buf[i] = buf[start + i]; } start = 0; try { Thread.sleep(asleepTime); } catch (InterruptedException e) { new RobobuggyLogicNotification("sleep .... interrupted?", RobobuggyMessageLevel.EXCEPTION); } } catch (IOException e) { sp.close(); setNodeState(NodeState.DISCONNECTED); e.printStackTrace(); } } }
Source:
<code>public static List<Rule> createRules(ResourceBundle messages, Language language, Word2VecModel word2vecModel) { List<ScoredConfusionSet> confusionSets; try(InputStream confusionSetsStream = new FileInputStream(word2vecModel.getPath() + File.separator + CONFUSION_SET_FILENAME)) { confusionSets = ScoredConfusionSetLoader.loadConfusionSet(confusionSetsStream); } catch (IOException e) { <START> System.err.println("Error: " + CONFUSION_SET_FILENAME + " not found for " + language.getShortCode() + "."); <END> return new ArrayList<>(0); } List<Rule> neuralNetworkRules = new ArrayList<>(); for(ScoredConfusionSet confusionSet : confusionSets) { neuralNetworkRules.add(new NeuralNetworkRule(messages, language, confusionSet, word2vecModel)); } return neuralNetworkRules; }</code><technical_language>throw exception</technical_language>

Target:
public static List<Rule> createRules(ResourceBundle messages, Language language, Word2VecModel word2vecModel) throws IOException { List<ScoredConfusionSet> confusionSets; try(InputStream confusionSetsStream = new FileInputStream(word2vecModel.getPath() + File.separator + CONFUSION_SET_FILENAME)) { confusionSets = ScoredConfusionSetLoader.loadConfusionSet(confusionSetsStream); } catch (FileNotFoundException e) { System.err.println("Warning: " + CONFUSION_SET_FILENAME + " not found for " + language.getShortCode() + "."); return new ArrayList<>(0); } List<Rule> neuralNetworkRules = new ArrayList<>(); for(ScoredConfusionSet confusionSet : confusionSets) { neuralNetworkRules.add(new NeuralNetworkRule(messages, language, confusionSet, word2vecModel)); } return neuralNetworkRules; }
Source:
<code>synchronized CompletableFuture<List<Map<Address, InternalCacheEntry<K, V>>>> requestState() { assert future == null; if (trace) log.tracef("Attempting to receive replicas for segment %s from %s with topology %s", segmentId, replicaHosts, topology); List<CompletableFuture<Void>> completableFutures = new ArrayList<>(); for (Address replica : replicaHosts) { if (replica.equals(rpcManager.getAddress())) { dataContainer.forEach(entry -> { int keySegment = topology.getDistribution(entry.getKey()).segmentId(); if (keySegment == segmentId) { addKeyToReplicaMap(replica, entry); } }); } else { InboundTransferTask transferTask = createTransferTask(segmentId, replica, topology); transferTaskMap.put(replica, transferTask); completableFutures.add(transferTask.requestSegments()); } } future = CompletableFuture <START> .allOf(completableFutures.toArray(new CompletableFuture[completableFutures.size()])) <END> .thenApply(aVoid -> { List<Map<Address, InternalCacheEntry<K, V>>> retVal = keyReplicaMap.entrySet().stream() .map(Map.Entry::getValue) .collect(Collectors.toList()); keyReplicaMap.clear(); transferTaskMap.clear(); requestMap.remove(segmentId); return Collections.unmodifiableList(retVal); }); future.exceptionally(throwable -> { if (trace) log.tracef(throwable, "Exception when processing InboundTransferTask for cache %s", cacheName); cancel(throwable); return null; }); return future; }</code><technical_language>I limiting degree of parallelism here. I recall issues in 32 node tests, a node joining cluster requested state other nodes - other 31 nodes started sending it, effectively DDoSing poor joiner</technical_language>

Target:
synchronized CompletableFuture<List<Map<Address, CacheEntry<K, V>>>> requestState() { assert future == null; if (trace) log.tracef("Attempting to receive replicas for segment %s from %s with topology %s", segmentId, replicaHosts, topology); List<CompletableFuture<Void>> completableFutures = new ArrayList<>(); for (Address replica : replicaHosts) { if (replica.equals(rpcManager.getAddress())) { dataContainer.forEach(entry -> { int keySegment = topology.getDistribution(entry.getKey()).segmentId(); if (keySegment == segmentId) { addKeyToReplicaMap(replica, entry); } }); } else { InboundTransferTask transferTask = createTransferTask(segmentId, replica, topology); transferTaskMap.put(replica, transferTask); completableFutures.add(transferTask.requestSegments()); } } future = CompletableFuture .allOf(completableFutures.toArray(new CompletableFuture[completableFutures.size()])) .thenApply(aVoid -> { List<Map<Address, CacheEntry<K, V>>> retVal = keyReplicaMap.entrySet().stream() .map(Map.Entry::getValue) .collect(Collectors.toList()); keyReplicaMap.clear(); transferTaskMap.clear(); requestMap.remove(segmentId); return Collections.unmodifiableList(retVal); }); future.exceptionally(throwable -> { if (trace) log.tracef(throwable, "Exception when processing InboundTransferTask for cache %s", cacheName); cancel(throwable); return null; }); return future; }
Source:
<code>public void close() { try { Closeables.close(pathChildrenCache, true); } catch (IOException exc) { <START> logger.warn("IOException should not have been thrown.", exc); <END> } }</code><technical_language>If want maintain behavior log this ERROR guava is logging SEVERE</technical_language>

Target:
public void close() { try { Closeables.close(pathChildrenCache, true); } catch (IOException exc) { logger.error("IOException should not have been thrown.", exc); } }
Source:
<code>public boolean initialize(AndroidCommCarePlatform instance, boolean isUpgrade) throws ResourceInitializationException { if (localLocation == null) { <START> throw new ResourceInitializationException("The user restore file location is null!"); <END> } if (isUpgrade) { wipeSandboxForCurrentDemoUser(instance); } OfflineUserRestore offlineUserRestore = new OfflineUserRestore(localLocation); instance.registerDemoUserRestore(offlineUserRestore); return true; }</code><technical_language>This crash crashed now, right? installer able save this flag set, right? I feel crash save is crash runtime</technical_language>

Target:
public boolean initialize(AndroidCommCarePlatform instance, boolean isUpgrade) throws ResourceInitializationException { instance.registerDemoUserRestore(initDemoUserRestore()); return true; }
Source:
<code>public static Slice stPoint(@SqlType(StandardTypes.DOUBLE) double x, @SqlType(StandardTypes.DOUBLE) double y) { <START> OGCGeometry geometry = createFromEsriGeometry(new Point(x, y), SpatialReference.create(4326)); <END> return serialize(geometry); }</code><technical_language>this constant value? Please a static final give a proper name it</technical_language>

Target:
public static Slice stPoint(@SqlType(StandardTypes.DOUBLE) double x, @SqlType(StandardTypes.DOUBLE) double y) { OGCGeometry geometry = createFromEsriGeometry(new Point(x, y), DEFAULT_SPATIAL_REFERENCE); return serialize(geometry); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_budget); mBudgetName = (EditText) findViewById(R.id.budget_name); mBudgetAmount = (EditText) findViewById(R.id.budget_amount); mBudgetDate = (DatePicker) findViewById(R.id.budget_date); mRecurring = (CheckBox) findViewById(R.id.budget_recur); mBudgetDuration = (Spinner) findViewById(R.id.budget_duration); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.duration_array, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mBudgetDuration.setAdapter(adapter); findViewById(R.id.create_budget_button).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { attemptAddBudget(); } }); <START> findViewById(R.id.clear_budget_button).setOnClickListener( <END> new View.OnClickListener() { @Override public void onClick(View v) { attemptAddBudget(); } }); }</code><technical_language>clear button calls attemptAddBudget() clicked instead of clearing fields</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_budget); mBudgetNameView = (EditText) findViewById(R.id.budget_name); mBudgetAmountView = (EditText) findViewById(R.id.budget_amount); mBudgetDateView = (DatePicker) findViewById(R.id.budget_date); mRecurringView = (CheckBox) findViewById(R.id.budget_recur); mBudgetDurationView = (Spinner) findViewById(R.id.budget_duration); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.duration_array, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mBudgetDurationView.setAdapter(adapter); findViewById(R.id.create_budget_button).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { attemptAddBudget(); } }); findViewById(R.id.clear_budget_button).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { AddBudgetActivity.this.clearEntry(null); } }); }
Source:
<code>private static Duration measureMinimalRacyInterval(Path dir) { LOG.debug("{}: start measure minimal racy interval in {}", Thread.currentThread(), dir); int failures = 0; long racyNanos = 0; <START> final int COUNT = 10000; <END> ArrayList<Long> deltas = new ArrayList<>(); Path probe = dir.resolve(".probe-" + UUID.randomUUID()); try { Files.createFile(probe); for (int i = 0; i < COUNT; i++) { write(probe, "a"); FileSnapshot snapshot = FileSnapshot.save(probe.toFile()); read(probe); write(probe, "b"); if (!snapshot.isModified(probe.toFile())) { deltas.add(Long.valueOf(snapshot.wasDelta())); racyNanos = snapshot.wasRacyThreshold(); failures++; } } } catch (IOException e) { LOG.error(e.getMessage(), e); return FALLBACK_MIN_RACY_INTERVAL; } finally { deleteProbe(probe); } if (failures > 0) { Stats stats = new Stats(); for (Long d : deltas) { stats.add(d); } LOG.debug( "delta [ns] since modification FileSnapshot failed to detect\n" + "count, failures, racy limit [ns], delta min [ns]," + " delta max [ns], delta avg [ns]," + " delta stddev [ns]\n" + "{}, {}, {}, {}, {}, {}, {}", COUNT, failures, racyNanos, stats.min(), stats.max(), stats.avg(), stats.stddev()); return Duration .ofNanos(Double.valueOf(stats.max()).longValue()); } LOG.debug("{}: no failures when measuring minimal racy interval", Thread.currentThread()); return Duration.ZERO; }</code><technical_language>for records, today 4ms - 6ms timestamp resolution for changes (patch set 12)</technical_language>

Target:
private static Duration measureMinimalRacyInterval(Path dir) { LOG.debug("{}: start measure minimal racy interval in {}", Thread.currentThread(), dir); int n = 0; int failures = 0; long racyNanos = 0; ArrayList<Long> deltas = new ArrayList<>(); Path probe = dir.resolve(".probe-" + UUID.randomUUID()); Instant end = Instant.now().plusSeconds(3); try { Files.createFile(probe); do { n++; write(probe, "a"); FileSnapshot snapshot = FileSnapshot.save(probe.toFile()); read(probe); write(probe, "b"); if (!snapshot.isModified(probe.toFile())) { deltas.add(Long.valueOf(snapshot.wasDelta())); racyNanos = snapshot.wasRacyThreshold(); failures++; } } while (Instant.now().compareTo(end) < 0); } catch (IOException e) { LOG.error(e.getMessage(), e); return FALLBACK_MIN_RACY_INTERVAL; } finally { deleteProbe(probe); } if (failures > 0) { Stats stats = new Stats(); for (Long d : deltas) { stats.add(d); } LOG.debug( "delta [ns] since modification FileSnapshot failed to detect\n" + "count, failures, racy limit [ns], delta min [ns]," + " delta max [ns], delta avg [ns]," + " delta stddev [ns]\n" + "{}, {}, {}, {}, {}, {}, {}", n, failures, racyNanos, stats.min(), stats.max(), stats.avg(), stats.stddev()); return Duration .ofNanos(Double.valueOf(stats.max()).longValue()); } LOG.debug("{}: no failures when measuring minimal racy interval", Thread.currentThread()); return Duration.ZERO; }
Source:
<code>public void getResourcesSpecifiedByVoWhereUserIsAdmin() throws Exception { System.out.println(CLASS_NAME + "getResourcesSpecifiedByVoWhereUserIsAdmin"); vo = setUpVo(); member = setUpMember(vo); facility = setUpFacility(); Facility facility2 = new Facility(); facility2.setName("ResourcesManagerTestFacility2"); facility2 = perun.getFacilitiesManager().createFacility(sess, facility2); resource = setUpResource(); Resource resource2 = new Resource(); resource2.setName("name"); resource2 = resourcesManager.createResource(sess, resource2, vo, facility2); User u = perun.getUsersManagerBl().getUserByMember(sess, member); resourcesManager.addAdmin(sess, resource, u); resourcesManager.addAdmin(sess, resource2, u); List<Resource> resources = resourcesManager.getResourcesWhereUserIsAdmin(sess, vo, u); <START> assertNotNull(resources); assertTrue(resources.contains(resource)); assertTrue(resources.contains(resource2)); <END> }</code><technical_language>Nit: This done easily assertJ: assertThat(resources).containsOnly(resource, resource2); This is import need for method: import static org.assertj.core.api.Assertions.assertThat;</technical_language>

Target:
public void getResourcesSpecifiedByVoWhereUserIsAdmin() throws Exception { System.out.println(CLASS_NAME + "getResourcesSpecifiedByVoWhereUserIsAdmin"); vo = setUpVo(); member = setUpMember(vo); facility = setUpFacility(); Facility facility2 = new Facility(); facility2.setName("ResourcesManagerTestFacility2"); facility2 = perun.getFacilitiesManager().createFacility(sess, facility2); resource = setUpResource(); Resource resource2 = new Resource(); resource2.setName("name"); resource2 = resourcesManager.createResource(sess, resource2, vo, facility2); User u = perun.getUsersManagerBl().getUserByMember(sess, member); resourcesManager.addAdmin(sess, resource, u); resourcesManager.addAdmin(sess, resource2, u); List<Resource> resources = resourcesManager.getResourcesWhereUserIsAdmin(sess, vo, u); assertNotNull(resources); assertThat(resources).containsOnly(resource, resource2); }
Source:
<code>public void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast( new LoggingHandler(LogLevel.DEBUG), new HAProxyMessageDecoder(), <START> new ChannelInboundHandlerAdapter() { <END> @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HAProxyMessage) { System.out.println("proxy message: " + msg); } else if (msg instanceof ByteBuf) { System.out.println("bytebuf message: " + ByteBufUtil.prettyHexDump((ByteBuf) msg)); } super.channelRead(ctx, msg); } }); }</code><technical_language>consider SimpleChannelInboundHandler consume message in channelRead0. This is correctly released hitting tail of pipeline</technical_language>

Target:
public void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast( new LoggingHandler(LogLevel.DEBUG), new HAProxyMessageDecoder(), new SimpleChannelInboundHandler() { @Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HAProxyMessage) { System.out.println("proxy message: " + msg); } else if (msg instanceof ByteBuf) { System.out.println("bytebuf message: " + ByteBufUtil.prettyHexDump((ByteBuf) msg)); } } }); }
Source:
<code>protected void fillPinnedList(VmNumaNode vmNumaNode, List<VdsNumaNode> vdsNumaNodes){ for (Pair<Guid, Pair<Boolean, Integer>> pair : vmNumaNode.getVdsNumaNodeList()) { if (pair.getSecond() != null && pair.getSecond().getFirst()) { Integer index = pair.getSecond().getSecond(); Guid numaId = pair.getFirst(); for (VdsNumaNode vdsNumaNode : vdsNumaNodes) { if ( (index != null && vdsNumaNode.getIndex() == index) <START> || vdsNumaNode.getId().equals(numaId)) { <END> pair.setFirst(vdsNumaNode.getId()); pair.getSecond().setSecond(vdsNumaNode.getIndex()); break; } } } } }</code><technical_language>I start removing id parts dependant index only</technical_language>

Target:
protected void fillPinnedList(VmNumaNode vmNumaNode, List<VdsNumaNode> vdsNumaNodes){ for (Pair<Guid, Pair<Boolean, Integer>> pair : vmNumaNode.getVdsNumaNodeList()) { if (pair.getSecond() == null || !pair.getSecond().getFirst()) { continue; } Integer index = pair.getSecond().getSecond(); if (index == null) { continue; } VdsNumaNode vdsNode = NumaUtils.getVdsNumaNodeByIndex(vdsNumaNodes, index); if (vdsNode != null) { pair.setFirst(vdsNode.getId()); } } }
Source:
<code>private boolean authorSatisfies(IModel model, TurboIssue issue) { if (!content.isPresent()) return false; Optional<TurboUser> author = model.getAuthorOfIssue(issue); String content = this.content.get().toLowerCase(); String login = issue.getCreator().toLowerCase(); String name = ""; if (author.isPresent()) { name = author.get().getRealName() == null ? "" : author.get().getRealName().toLowerCase(); <START> } <END> return login.contains(content) || name.contains(content); }</code><technical_language>simplify this part a bit: java String name = author.map(TurboUser::getRealName) .orElse("").toLowerCase();</technical_language>

Target:
private boolean authorSatisfies(IModel model, TurboIssue issue) { if (!content.isPresent()) return false; Optional<TurboUser> author = model.getAuthorOfIssue(issue); String content = this.content.get().toLowerCase(); String login = issue.getCreator().toLowerCase(); String name = author.map(TurboUser::getRealName).orElse("").toLowerCase(); return login.contains(content) || name.contains(content); }
Source:
<code>protected void processFiltered(File file, FileText fileText) { final UniqueProperties properties = new UniqueProperties(); try { <START> loadProperties(file, properties); <END> } catch (IOException ex) { log(0, MSG_IO_EXCEPTION_KEY, file.getPath(), ex.getLocalizedMessage()); } for (Entry<String> duplication : properties .getDuplicatedKeys().entrySet()) { final String keyName = duplication.getElement(); final int lineNumber = getLineNumber(fileText, keyName); log(lineNumber, MSG_KEY, keyName, duplication.getCount() + 1); } }</code><technical_language>need move fileInputStream out of TRY scope merge TRYs, finally part of top TRY</technical_language>

Target:
protected void processFiltered(File file, FileText fileText) { final UniqueProperties properties = new UniqueProperties(); FileInputStream fileInputStream = null; try { fileInputStream = new FileInputStream(file); properties.load(fileInputStream); } catch (IOException ex) { log(0, MSG_IO_EXCEPTION_KEY, file.getPath(), ex.getLocalizedMessage()); } finally { Closeables.closeQuietly(fileInputStream); } for (Entry<String> duplication : properties .getDuplicatedKeys().entrySet()) { final String keyName = duplication.getElement(); final int lineNumber = getLineNumber(fileText, keyName); log(lineNumber, MSG_KEY, keyName, duplication.getCount() + 1); } }
Source:
<code>public boolean isPermanentFail() { return (this == OPERATOR_BARRED) || (this == MISSING_UNKNOWN_APN) || (this == UNKNOWN_PDP_ADDRESS_TYPE) || (this == USER_AUTHENTICATION) || <START> (this == ACTIVATION_REJECT_GGSN) || (this == SERVICE_OPTION_NOT_SUPPORTED) || <END> (this == SERVICE_OPTION_NOT_SUBSCRIBED) || (this == NSAPI_IN_USE) || (this == PROTOCOL_ERRORS); }</code><technical_language>add ONLY_IPV4_ALLOWED ONLY_IPV6_ALLOWED too. Lets add isEventLoggable below</technical_language>

Target:
public boolean isPermanentFail() { return (this == OPERATOR_BARRED) || (this == MISSING_UNKNOWN_APN) || (this == UNKNOWN_PDP_ADDRESS_TYPE) || (this == USER_AUTHENTICATION) || (this == ACTIVATION_REJECT_GGSN) || (this == SERVICE_OPTION_NOT_SUPPORTED) || (this == SERVICE_OPTION_NOT_SUBSCRIBED) || (this == NSAPI_IN_USE) || (this == PROTOCOL_ERRORS) || (this == SIGNAL_LOST) || (this == RADIO_POWER_OFF) || (this == TETHERED_CALL_ACTIVE); }