auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Observable<D2Progress> uploadDataValues(List<DataValue> dataValues) { return Observable.defer(() -> { if (dataValues.isEmpty()) { return Observable.empty(); } else { D2ProgressManager progressManager = new D2ProgressManager(2); return systemInfoDownloader.downloadMetadata().andThen(Observable.create(emitter -> { emitter.onNext(progressManager.increaseProgress(SystemInfo.class, false)); markPartitionsAsUploading(dataValues); DataValueSet dataValueSet = new DataValueSet(dataValues); <START> DataValueImportSummary dataValueImportSummary = apiCallExecutor.executeObjectCall( <END> dataValueService.postDataValues(dataValueSet)); dataValueImportHandler.handleImportSummary(dataValueSet, dataValueImportSummary); emitter.onNext(progressManager.increaseProgress(DataValue.class, true)); emitter.onComplete(); })); } }); }</code><technical_language>Wrap this part in a try-catch mark partition error in case response response is error. partition remain in UPLOADING state</technical_language>

Target:
public Observable<D2Progress> uploadDataValues(List<DataValue> dataValues) { return Observable.defer(() -> { if (dataValues.isEmpty()) { return Observable.empty(); } else { D2ProgressManager progressManager = new D2ProgressManager(2); return systemInfoDownloader.downloadMetadata().andThen(Observable.create(emitter -> { emitter.onNext(progressManager.increaseProgress(SystemInfo.class, false)); markPartitionsAs(dataValues, State.UPLOADING); try { DataValueSet dataValueSet = new DataValueSet(dataValues); DataValueImportSummary dataValueImportSummary = apiCallExecutor.executeObjectCall( dataValueService.postDataValues(dataValueSet)); dataValueImportHandler.handleImportSummary(dataValueSet, dataValueImportSummary); } catch (Exception e) { markPartitionsAs(dataValues, State.ERROR); throw e; } emitter.onNext(progressManager.increaseProgress(DataValue.class, true)); emitter.onComplete(); })); } }); }
Source:
<code>ReliableChannel( Function<ClientChannelConfiguration, Result<ClientChannel>> chFactory, ClientConfiguration clientCfg ) throws ClientException { if (chFactory == null) throw new NullPointerException("chFactory"); if (clientCfg == null) throw new NullPointerException("clientCfg"); this.chFactory = chFactory; this.clientCfg = clientCfg; List<InetSocketAddress> addrs = parseAddresses(clientCfg.getAddresses()); srvCnt = addrs.size(); primary = addrs.get(new Random().nextInt(addrs.size())); for (InetSocketAddress a : addrs) { if (a != primary) backups.add(a); } ClientConnectionException lastEx = null; for (int i = 0; i < addrs.size(); i++) { try { <START> ch = chFactory.apply(new ClientChannelConfiguration(clientCfg).setAddress(addrs.get(i))).get(); <END> return; } catch (ClientConnectionException e) { lastEx = e; changeServer(ch); } } throw lastEx; }</code><technical_language>Another point about. do need establish a connection eagerly ReliableChannel/ThinClient instance creation? do lazily</technical_language>

Target:
ReliableChannel( Function<ClientChannelConfiguration, Result<ClientChannel>> chFactory, ClientConfiguration clientCfg ) throws ClientException { if (chFactory == null) throw new NullPointerException("chFactory"); if (clientCfg == null) throw new NullPointerException("clientCfg"); this.chFactory = chFactory; this.clientCfg = clientCfg; List<InetSocketAddress> addrs = parseAddresses(clientCfg.getAddresses()); srvCnt = addrs.size(); primary = addrs.get(new Random().nextInt(addrs.size())); for (InetSocketAddress a : addrs) { if (a != primary) backups.add(a); } ClientConnectionException lastEx = null; for (int i = 0; i < addrs.size(); i++) { try { ch = chFactory.apply(new ClientChannelConfiguration(clientCfg).setAddress(primary)).get(); return; } catch (ClientConnectionException e) { lastEx = e; rollAddress(); } } throw lastEx; }
Source:
<code>private long profile( PagedFile file ) throws IOException { long pagesInMemory = 0; File outputNext = profileOutputFileNext( file ); try ( OutputStream outputStream = compressedOutputStream( outputNext ); PageCursor cursor = file.io( 0, PF_SHARED_READ_LOCK | PF_NO_FAULT ) ) { <START> int stepper = 7; <END> int b = 0; for ( ; ; ) { if ( stopped ) { return pagesInMemory; } if ( !cursor.next() ) { break; } b >>= 1; if ( cursor.getCurrentPageId() != PageCursor.UNBOUND_PAGE_ID ) { pagesInMemory++; b += 0b1000_0000; } if ( stepper == 0 ) { outputStream.write( b ); b = 0; stepper = 7; } else { stepper--; } } b >>= stepper + 1; outputStream.write( b ); outputStream.flush(); } File outputFinal = profileOutputFileFinal( file ); fs.renameFile( outputNext, outputFinal, StandardCopyOption.REPLACE_EXISTING ); return pagesInMemory; }</code><technical_language>While correct, this shifting dizzy, I suggest: { int stepper = 0; int b = 0; for ( ; ; ) { if ( stopped ) { return pagesInMemory; } if ( !cursor.next() ) { break; // Exit loop if more pages. } if ( cursor.getCurrentPageId() != PageCursor.UNBOUND_PAGE_ID ) { pagesInMemory++; b |= (1 << stepper); } stepper++; if ( stepper == 8 ) { outputStream.write( b ); b = 0; stepper = 0; } } outputStream.write( b ); outputStream.flush(); } instead</technical_language>

Target:
private long profile( PagedFile file ) throws IOException { long pagesInMemory = 0; File outputNext = profileOutputFileNext( file ); try ( OutputStream outputStream = compressedOutputStream( outputNext ); PageCursor cursor = file.io( 0, PF_SHARED_READ_LOCK | PF_NO_FAULT ) ) { int stepper = 0; int b = 0; for ( ; ; ) { if ( stopped ) { return pagesInMemory; } if ( !cursor.next() ) { break; } if ( cursor.getCurrentPageId() != PageCursor.UNBOUND_PAGE_ID ) { pagesInMemory++; b |= 1 << stepper; } stepper++; if ( stepper == 8 ) { outputStream.write( b ); b = 0; stepper = 0; } } outputStream.write( b ); outputStream.flush(); } File outputFinal = profileOutputFileFinal( file ); fs.renameFile( outputNext, outputFinal, StandardCopyOption.REPLACE_EXISTING ); return pagesInMemory; }
Source:
<code>AuthenticationResult getAccessTokenUsingAssertion() throws AuthenticationException { final String methodName = ":getAccessTokenUsingAssertion"; final AuthenticationResult result = acquireTokenWithAssertion(); if (result != null && !StringExtensions.isNullOrBlank(result.getAccessToken())) { try { mTokenCacheAccessor.updateTokenCache(mAuthRequest, result); } catch (MalformedURLException e) { <START> Logger.v(TAG + methodName, "Access token fetched but unable to update token cache"); <END> throw new AuthenticationException(ADALError.DEVELOPER_AUTHORITY_IS_NOT_VALID_URL, e.getMessage(), e); } } return result; }</code><technical_language>log this error a warning, instead of verbose</technical_language>

Target:
AuthenticationResult getAccessTokenUsingAssertion() throws AuthenticationException { final String methodName = ":getAccessTokenUsingAssertion"; final AuthenticationResult result = acquireTokenWithAssertion(); if (result != null && !StringExtensions.isNullOrBlank(result.getAccessToken())) { try { mTokenCacheAccessor.updateTokenCache(mAuthRequest, result); } catch (MalformedURLException e) { Logger.w(TAG + methodName, "Access token fetched but unable to update token cache"); throw new AuthenticationException(ADALError.DEVELOPER_AUTHORITY_IS_NOT_VALID_URL, e.getMessage(), e); } } return result; }
Source:
<code>public void ensureCatchNoParametersSearch() throws AvroRemoteException { try { SearchGenotypePhenotypeRequest request = SearchGenotypePhenotypeRequest.newBuilder().build(); SearchGenotypePhenotypeResponse response = client.genotypePhenotype.searchGenotypePhenotype(request); <START> fail("should have thrown error"); <END> } catch ( Exception e) { } }</code><technical_language>Utils.catchGAWrapperException catch exception. automatically fail if exception is thrown thunk wraps</technical_language>

Target:
public void ensureCatchNoParametersSearch() throws AvroRemoteException { SearchGenotypePhenotypeRequest request = SearchGenotypePhenotypeRequest.newBuilder().build(); final GAWrapperException didThrow = catchGAWrapperException(() -> client.genotypePhenotype.searchGenotypePhenotype(request) ); assertThat(didThrow.getHttpStatusCode()).isEqualTo(HttpURLConnection.HTTP_BAD_REQUEST); }
Source:
<code>private static boolean isSnapshot(File jarFile) { <START> return jarFile.getName() <END> .matches(".*SNAPSHOT(-selfcontained)?\\.jar$"); }</code><technical_language>(non-blocker) hood this Pattern p = Pattern.compile(regex); Matcher m = p.matcher(input); for jar file. Is simply a static Matcher, Pattern? Note Matcher instances thread safe Pattern is</technical_language>

Target:
static boolean isSnapshot(File jarFile) { return SNAPSHOT_JAR.matcher(jarFile.getName()).matches(); }
Source:
<code>public int getLanguagePosition() { String lang = LanguageUtils.getLanguage(); int i; <START> for(i = 0;i<languageList.length;i++) { <END> if(lang.equals(languageList[i])) break; } return i; }</code><technical_language>Format this file code style</technical_language>

Target:
public int getLanguagePosition() { String lang = LanguageUtils.getLanguage(); String[] languageList = ApplicationConstants.OpenMRSlanguage.LANGUAGE_LIST; int i; for (i = 0; i < languageList.length; i++) { if (lang.equals(languageList[i])) { return i; } } return 0; }
Source:
<code>protected static void createDirIfNotExists(File file) { if (!file.exists()) { try { file.mkdir(); logger.info("The " + file.getName() + " directory is created"); } catch (Exception e) { <START> logger.error("Couldn't create destination directory!"); <END> System.exit(1); } } else { logger.info("The given local path " + file.getName() + " already exists"); } }</code><technical_language>add file.getName() error message</technical_language>

Target:
static void createDirIfNotExists(File file) { if (!file.exists()) { try { file.mkdir(); logger.info("The " + file.getName() + " directory is created"); } catch (Exception e) { logger.error("Couldn't create destination directory! " + file.getName()); System.exit(1); } } else { logger.info("The given local path " + file.getName() + " already exists"); } }
Source:
<code>public Process runServer() throws IOException { <START> final String serverConsoleLogPath = "/Users/maxi/Projects/tmp/test.result"; END> File logPath = new File(getCorfuServerLogPath(host, port)); if (!logPath.exists()) { logPath.mkdir(); } ProcessBuilder builder = new ProcessBuilder(); builder.command("sh", "-c", "bin/corfu_replication_server " + getOptionsString()); builder.directory(new File(CORFU_PROJECT_DIR)); Process corfuReplicationServerProcess = builder.start(); StreamGobbler streamGobbler = new StreamGobbler(corfuReplicationServerProcess.getInputStream(), serverConsoleLogPath); Executors.newSingleThreadExecutor().submit(streamGobbler); return corfuReplicationServerProcess; }</code><technical_language>remove</technical_language>

Target:
public Process runServer() throws IOException { final String serverConsoleLogPath = CORFU_LOG_PATH + File.separator + host + "_" + port + "_consolelog"; File logPath = new File(getCorfuServerLogPath(host, port)); if (!logPath.exists()) { logPath.mkdir(); } ProcessBuilder builder = new ProcessBuilder(); builder.command("sh", "-c", "bin/corfu_replication_server " + getOptionsString()); builder.directory(new File(CORFU_PROJECT_DIR)); Process corfuReplicationServerProcess = builder.start(); StreamGobbler streamGobbler = new StreamGobbler(corfuReplicationServerProcess.getInputStream(), serverConsoleLogPath); Executors.newSingleThreadExecutor().submit(streamGobbler); return corfuReplicationServerProcess; }
Source:
<code>public String getVersion(){ if (mVersion != null){ return mVersion; } <START> else if (mPkgInfo != null){ <END> return Integer.toString(mPkgInfo.versionCode); } return null; }</code><technical_language>new line. drop else if mVersion check early abort. getVersion() return null this lead unforseen behavior of other methods. return null reach this if mPkgInfo is null (Constructor crash)</technical_language>

Target:
public String getVersion(){ if (mVersion != null){ return mVersion; } mVersion = Integer.toString(mPkgInfo.versionCode); return mVersion; }
Source:
<code>public static void validateCacheGroupName(String name) throws IllegalArgumentException { if (name != null) <START> A.ensure(name.length() <= MAX_FILE_NAME_LENGTH, "Length of cache group name can not exceed "+ MAX_FILE_NAME_LENGTH +"."); <END> }</code><technical_language>Code style issue - whitespace " +</technical_language>

Target:
public static void validateCacheGroupName(String name) throws IllegalArgumentException { if (name != null) A.ensure(name.length() <= CACHE_NAME_MAX_LENGTH, "Length of cache group name can not exceed " + CACHE_NAME_MAX_LENGTH + "."); }
Source:
<code>public String generaterRandomDNAString(int n, String vertexId) { char[] chars = "ACGT".toCharArray(); StringBuilder sb = new StringBuilder(); while (true) { <START> sb = new StringBuilder(); <END> for (int i = 0; i < n; i++) { char c = chars[randGenerator.nextInt(chars.length)]; sb.append(c); } if (!existKmerString.contains(vertexId + sb.toString())) break; } existKmerString.add(vertexId + sb.toString()); return vertexId + sb.toString(); }</code><technical_language>initiation loop is unnecessary</technical_language>

Target:
public String generaterRandomDNAString(int n, String vertexId) { char[] chars = "ACGT".toCharArray(); StringBuilder sb; while (true) { sb = new StringBuilder(); for (int i = 0; i < n; i++) { char c = chars[randGenerator.nextInt(chars.length)]; sb.append(c); } if (!existKmerString.contains(vertexId + sb.toString())) break; } existKmerString.add(vertexId + sb.toString()); return vertexId + sb.toString(); }
Source:
<code>public List<NotificationAction> getActions() { return new <START> ArrayList<>(); <END> }</code><technical_language>Collections.emptyList()</technical_language>

Target:
public List<NotificationAction> getActions() { return Collections.emptyList(); }
Source:
<code>static MonotonicCounter newAtomicMonotonicCounter() { return new MonotonicCounter() { private final AtomicLong value = new AtomicLong( 0L ); @Override public long increment() { int initialValue; int incrementedValue; do { initialValue = value.intValue(); incrementedValue = initialValue < 0 ? 0 : initialValue + 1; } while ( !value.compareAndSet( initialValue, incrementedValue ) ); <START> return incrementedValue; <END> } }; }</code><technical_language>This produce a sequence of 1, 2, 3 Integer.MAX_VALUE, Integer.MIN_VALUE, 0, 1, 2, 3 a bug. implementation</technical_language>

Target:
static MonotonicCounter newAtomicMonotonicCounter() { return new MonotonicCounter() { private final AtomicLong value = new AtomicLong( 0L ); @Override public long incrementAndGet() { return value.incrementAndGet(); } }; }
Source:
<code>public StringSchema.Builder load() { StringSchema.Builder builder = StringSchema.builder(); ls.schemaJson().maybe("minLength").map(JsonValue::requireInteger).ifPresent(builder::minLength); ls.schemaJson().maybe("maxLength").map(JsonValue::requireInteger).ifPresent(builder::maxLength); if (useDefault) <START> ls.schemaJson().maybe("default").map(JsonValue::requireString).ifPresent(builder::defaultValue); <END> ls.schemaJson().maybe("pattern").map(JsonValue::requireString).ifPresent(builder::pattern); ls.schemaJson().maybe("format").map(JsonValue::requireString) .ifPresent(format -> addFormatValidator(builder, format)); return builder; }</code><technical_language>this removed (you unified loading in SchemaLoader#load())</technical_language>

Target:
public StringSchema.Builder load() { StringSchema.Builder builder = StringSchema.builder(); ls.schemaJson().maybe("minLength").map(JsonValue::requireInteger).ifPresent(builder::minLength); ls.schemaJson().maybe("maxLength").map(JsonValue::requireInteger).ifPresent(builder::maxLength); ls.schemaJson().maybe("pattern").map(JsonValue::requireString).ifPresent(builder::pattern); ls.schemaJson().maybe("format").map(JsonValue::requireString) .ifPresent(format -> addFormatValidator(builder, format)); return builder; }
Source:
<code>public void validate_javadoc_retention() { FreeStyleJob job = jenkins.jobs.create(); setup(job); Build b = job.startBuild().shouldSucceed(); assertThat(job, hasAction(JAVADOC_ACTION)); try { assertThat(b, hasAction(JAVADOC_ACTION)); Assert.fail("Build #1 should not have Javadoc action"); <START> } catch (AssertionError ex) <END> this.setupForRetention(job); b = job.startBuild().shouldSucceed(); assertThat(job, hasAction(JAVADOC_ACTION)); assertThat(b, hasAction(JAVADOC_ACTION)); }</code><technical_language>should, is reason prefer hamcrest</technical_language>

Target:
public void validate_javadoc_retention() { FreeStyleJob job = jenkins.jobs.create(); setup(job); Build b = job.startBuild().shouldSucceed(); assertThat(job, hasAction(JAVADOC_ACTION)); assertThat("Build #1 should not have Javadoc action", b, not(hasAction(JAVADOC_ACTION))); this.setupForRetention(job); b = job.startBuild().shouldSucceed(); assertThat(job, hasAction(JAVADOC_ACTION)); assertThat(b, hasAction(JAVADOC_ACTION)); }
Source:
<code>private List<HttpHeaders> getHeadersList() { List<HttpHeaders> headersList = new ArrayList<HttpHeaders>(); HttpHeaders headers = new DefaultHttpHeaders(); headers.add(HttpHeaders.Names.CONTENT_LENGTH, new Random().nextLong()); headersList.add(headers); headers = new DefaultHttpHeaders(); headers.add(INVALID_HEADER_KEY_PREFIX + "1", "headerValue1"); headers.add(HttpHeaders.Names.CONTENT_LENGTH, new Random().nextLong()); headersList.add(headers); headers = new DefaultHttpHeaders(); <START> headers.add(INVALID_HEADER_KEY_PREFIX + "1", "headerVxalue1"); <END> headers.add(INVALID_HEADER_KEY_PREFIX + "2", "headerValue2"); headersList.add(headers); headers = new DefaultHttpHeaders(); headers.add(HttpHeaders.Names.HOST, "host1"); headers.add(HttpHeaders.Names.CONTENT_LENGTH, new Random().nextLong()); headers.add(RestUtils.Headers.CONTENT_TYPE, "content-type1"); headersList.add(headers); return headersList; }</code><technical_language>typo:</technical_language>

Target:
private List<HttpHeaders> getHeadersList() { List<HttpHeaders> headersList = new ArrayList<HttpHeaders>(); HttpHeaders headers = new DefaultHttpHeaders(); headers.add(HttpHeaders.Names.CONTENT_TYPE, "content-type1"); headersList.add(headers); headers = new DefaultHttpHeaders(); headers.add(NOT_LOGGED_HEADER_KEY + "1", "headerValue1"); headers.add(HttpHeaders.Names.CONTENT_TYPE, "content-type2"); headersList.add(headers); headers = new DefaultHttpHeaders(); headers.add(NOT_LOGGED_HEADER_KEY + "1", "headerValue1"); headers.add(NOT_LOGGED_HEADER_KEY + "2", "headerValue2"); headersList.add(headers); headers = new DefaultHttpHeaders(); headers.add(HttpHeaders.Names.HOST, "host1"); headers.add(RestUtils.Headers.CONTENT_TYPE, "content-type3"); headers.add(EchoMethodHandler.RESPONSE_HEADER_KEY_1, "responseHeaderValue1"); headers.add(EchoMethodHandler.RESPONSE_HEADER_KEY_2, "responseHeaderValue1"); headersList.add(headers); return headersList; }
Source:
<code>public void doubleClickOnReference(String visibleText) { <START> Actions action = actionsFactory.createAction(seleniumWebDriver); <END> clickOnReference(visibleText); waitReferenceSelection(visibleText); action.doubleClick().perform(); }</code><technical_language>seleniumWebDriverHelper.getAction()</technical_language>

Target:
public void doubleClickOnReference(String visibleText) { clickOnReference(visibleText); waitReferenceSelection(visibleText); seleniumWebDriverHelper.doubleClick(); }
Source:
<code>private static boolean runExistingTasksFrom(Queue<Runnable> taskQueue) { Runnable task = pollTaskFrom(taskQueue); if (task == null) { return false; } <START> int remaining = taskQueue.size(); <END> safeExecute(task); while (remaining-- > 0 && (task = taskQueue.poll()) != null) { safeExecute(task); } return true; }</code><technical_language>maxPendingTasks account ? int remaining = Math.min(maxPendingTasks, taskQueue.size());</technical_language>

Target:
private boolean runExistingTasksFrom(Queue<Runnable> taskQueue) { Runnable task = pollTaskFrom(taskQueue); if (task == null) { return false; } int remaining = Math.min(maxPendingTasks, taskQueue.size()); safeExecute(task); while (remaining-- > 0 && (task = taskQueue.poll()) != null) { safeExecute(task); } return true; }
Source:
<code>public void setValue(EObject object, EStructuralFeature feature, Object value, int position) { if (migrationNeeded) { Object newValue = RepresentationsFileMigrationService.getInstance().getValue(object, feature, value, version); if (newValue != null) { super.setValue(object, feature, newValue, position); } else if <START> (!(object instanceof DRepresentation && REPRESENTATION_NAME_FEATURE_LABEL.equals(feature.getName())) && !(object instanceof DRepresentation && REPRESENTATION_DOCUMENTATION_FEATURE_LABEL.equals(feature.getName()))) { <END> super.setValue(object, feature, value, position); } } else { super.setValue(object, feature, value, position); } }</code><technical_language>I suggest: !(object instanceof DRep && (NAME.equals(feature.getName()) || DOC.equals(feature.getName())) !(object instanceof DRep && ignoreFeatures.contains(features.getName()))</technical_language>

Target:
public void setValue(EObject object, EStructuralFeature feature, Object value, int position) { if (migrationNeeded) { Object newValue = RepresentationsFileMigrationService.getInstance().getValue(object, feature, value, version); if (newValue != null) { super.setValue(object, feature, newValue, position); } else if (!(object instanceof DRepresentation && (REPRESENTATION_NAME_FEATURE_LABEL.equals(feature.getName()) || REPRESENTATION_DOCUMENTATION_FEATURE_LABEL.equals(feature.getName())))) { super.setValue(object, feature, value, position); } } else { super.setValue(object, feature, value, position); } }
Source:
<code>public void testContainerNotRecoveredAfterExhaustingRecoveryBackOff() throws Exception { SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(mock(ConnectionFactory.class)); container.setQueueNames("foo"); container.setRecoveryBackOff(new FixedBackOff(100, 3)); container.setConcurrentConsumers(10); container.afterPropertiesSet(); <START> container.start(); <END> int n = 0; while (container.isActive() && n++ < 10) { Thread.sleep(100); } assertThat(n, lessThanOrEqualTo(10)); }</code><technical_language>This needs some polishing avoid > 2015-05-07 11:20:11,855 WARN SimpleAsyncTaskExecutor-1 [org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer] - <Consumer raised exception, processing restart if connection factory supports it> > java.lang.IllegalArgumentException: Connection null</technical_language>

Target:
public void testContainerNotRecoveredAfterExhaustingRecoveryBackOff() throws Exception { SimpleMessageListenerContainer container = spy(new SimpleMessageListenerContainer(mock(ConnectionFactory.class))); container.setQueueNames("foo"); container.setRecoveryBackOff(new FixedBackOff(100, 3)); container.setConcurrentConsumers(3); doAnswer(new Answer<BlockingQueueConsumer>() { @Override public BlockingQueueConsumer answer(InvocationOnMock invocation) throws Throwable { BlockingQueueConsumer consumer = spy((BlockingQueueConsumer) invocation.callRealMethod()); doThrow(RuntimeException.class).when(consumer).start(); return consumer; } }).when(container).createBlockingQueueConsumer(); container.afterPropertiesSet(); container.start(); int n = 0; while (container.isActive() && n++ < 10) { Thread.sleep(100); } assertThat(n, lessThanOrEqualTo(10)); }
Source:
<code>public Mono<ThroughputResponse> readThroughput() { return this.read() .flatMap(response -> this.database.getDocClientWrapper() .queryOffers(database.getOfferQuerySpecFromResourceId(response .getProperties() .getResourceId()) , new FeedOptions()) .single() .flatMap(offerFeedResponse -> { if (offerFeedResponse.getResults().isEmpty()) { return Mono.error(BridgeInternal .createCosmosClientException( HttpConstants.StatusCodes.BADREQUEST, <START> "No offers found for the resource")); <END> } return this.database.getDocClientWrapper() .readOffer(offerFeedResponse.getResults() .get(0) .getSelfLink()) .single(); }) .map(ModelBridgeInternal::createThroughputRespose)); }</code><technical_language>is worth including name of database container in sdk generated error message</technical_language>

Target:
public Mono<ThroughputResponse> readThroughput() { return this.read() .flatMap(response -> this.database.getDocClientWrapper() .queryOffers(database.getOfferQuerySpecFromResourceId(response .getProperties() .getResourceId()) , new FeedOptions()) .single() .flatMap(offerFeedResponse -> { if (offerFeedResponse.getResults().isEmpty()) { return Mono.error(BridgeInternal .createCosmosClientException( HttpConstants.StatusCodes.BADREQUEST, "No offers found for the resource " + this.getId())); } return this.database.getDocClientWrapper() .readOffer(offerFeedResponse.getResults() .get(0) .getSelfLink()) .single(); }) .map(ModelBridgeInternal::createThroughputRespose)); }
Source:
<code><START> protected PageDataSink createPageDataSink(FileSystem fileSystem, Path path) <END> throws IOException { return new OutputStreamPageDataSink(fileSystem.create(path), pagesSerde); }</code><technical_language>note: Generally a composition based factory is preferred. ORC writer is implemented this - for consistency</technical_language>

Target:
protected DataSink createPageDataSink(FileSystem fileSystem, Path path) throws IOException { return new OutputStreamDataSink(fileSystem.create(path)); }
Source:
<code><START> static List<NationalAppealChamberJudgment> createNacJudgmentListWithRandomData(int size){ <END> List<NationalAppealChamberJudgment> judgments = new ArrayList<>(size); for(int i=0; i<size; ++i){ String prefix = i + "__"; NationalAppealChamberJudgment judgment = createNacJudgmentWithRandomData(prefix, i); judgments.add(judgment); } return judgments; }</code><technical_language>public</technical_language>

Target:
public static List<NationalAppealChamberJudgment> createNacJudgmentListWithRandomData(int size){ List<NationalAppealChamberJudgment> judgments = new ArrayList<>(size); for(int i=0; i<size; ++i){ String prefix = i + "__"; NationalAppealChamberJudgment judgment = createNacJudgmentWithRandomData(prefix, i); judgments.add(judgment); } return judgments; }
Source:
<code>private boolean considerBinding(IBinding binding, ASTNode node) { if (!(binding instanceof IVariableBinding)) return false; boolean result= Bindings.equals(fFieldBinding, ((IVariableBinding)binding).getVariableDeclaration()); if (!result || (fEncapsulateDeclaringClass <START> && !fGetter.isEmpty() && !fSetter.isEmpty())) <END> return result; AbstractTypeDeclaration type= ASTNodes.getParent(node, AbstractTypeDeclaration.class); if (type != null) { ITypeBinding declaringType= type.resolveBinding(); return !Bindings.equals(fDeclaringClassBinding, declaringType); } return true; }</code><technical_language>this here, (in createInvocation) avoid replacing field references/assignment get/set. valid replace field getter if setter is enabled, replace assignment of field setter if getter is enabled</technical_language>

Target:
private boolean considerBinding(IBinding binding, ASTNode node) { if (!(binding instanceof IVariableBinding)) return false; boolean result= Bindings.equals(fFieldBinding, ((IVariableBinding)binding).getVariableDeclaration()); if (!result || fEncapsulateDeclaringClass) return result; if (binding instanceof IVariableBinding) { AbstractTypeDeclaration type= ASTNodes.getParent(node, AbstractTypeDeclaration.class); if (type != null) { ITypeBinding declaringType= type.resolveBinding(); return !Bindings.equals(fDeclaringClassBinding, declaringType); } } return true; }
Source:
<code>public Object parseDefaultString(FieldType fieldType, String defaultStr) throws SQLException { try { return LocalTime.parse(defaultStr, DateTimeFormatter.ofPattern("HH:mm:ss[.SSSSSS]")); } catch (NumberFormatException e) { throw SqlExceptionUtil.create("Problems with field " + fieldType + <START> " parsing default LocalDateTime value: " + defaultStr, e); <END> } }</code><technical_language>This "LocalTime"</technical_language>

Target:
public Object parseDefaultString(FieldType fieldType, String defaultStr) throws SQLException { return LocalTime.parse(defaultStr, new DateTimeFormatterBuilder() .appendPattern("HH:mm:ss") .appendFraction(ChronoField.NANO_OF_SECOND, 0, 9, true) .toFormatter()); }
Source:
<code>public Object[] transform(I input) { if (input instanceof QueryableEntry) { Object[] result = new Object[attributePaths.length]; for (int i = 0; i < attributePaths.length; i++) { <START> result[i] = extractAttributeValue((QueryableEntry) input, attributePaths[i], fromName(attributePaths[i])); <END> } return result; } throw new IllegalArgumentException("The given map entry is not extractable"); }</code><technical_language>Minor: QueryFieldType.fromName fromName more readable</technical_language>

Target:
public Object[] transform(I input) { if (input instanceof QueryableEntry) { Object[] result = new Object[attributePaths.length]; for (int i = 0; i < attributePaths.length; i++) { result[i] = extractAttributeValue((QueryableEntry) input, attributePaths[i], getAttributeOrigin(i)); } return result; } throw new IllegalArgumentException("The given map entry is not extractable"); }
Source:
<code>public ConnectorSplitSource getSplits(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorTableLayoutHandle layoutHandle) { MemoryTableLayoutHandle layout = (MemoryTableLayoutHandle) layoutHandle; <START> Map<HostAddress, Long> rowsOnHosts = layout.getHosts(); <END> ImmutableList.Builder<ConnectorSplit> splits = ImmutableList.builder(); for (Map.Entry<HostAddress, Long> rowsOnHost : rowsOnHosts.entrySet()) { for (int i = 0; i < splitsPerNode; i++) { splits.add( new MemorySplit( layout.getTable(), i, splitsPerNode, ImmutableList.of(rowsOnHost.getKey()), rowsOnHost.getValue())); } } return new FixedSplitSource(splits.build()); }</code><technical_language>This wrappered for visibility - - class InMemoryFragment { HostAddress, long }</technical_language>

Target:
public ConnectorSplitSource getSplits(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorTableLayoutHandle layoutHandle) { MemoryTableLayoutHandle layout = (MemoryTableLayoutHandle) layoutHandle; List<MemoryDataFragment> dataFragments = layout.getDataFragments(); ImmutableList.Builder<ConnectorSplit> splits = ImmutableList.builder(); for (MemoryDataFragment dataFragment : dataFragments) { for (int i = 0; i < splitsPerNode; i++) { splits.add( new MemorySplit( layout.getTable(), i, splitsPerNode, dataFragment.getHostAddress(), dataFragment.getRows())); } } return new FixedSplitSource(splits.build()); }
Source:
<code>public void testGetAllSnapshotsForLeaf() { List<DiskImage> images = dao.getAllSnapshotsForLeaf(FixturesTool.IMAGE_ID); <START> <END> assertFalse(images.isEmpty()); }</code><technical_language>add assert template is returned</technical_language>

Target:
public void testGetAllSnapshotsForLeaf() { List<DiskImage> images = dao.getAllSnapshotsForLeaf(FixturesTool.IMAGE_ID); assertFalse(images.isEmpty()); assertFalse(CollectionUtils.exists(images, new Predicate() { public boolean evaluate(Object disk) { return ((DiskImage) disk).getVmEntityType() == VmEntityType.TEMPLATE; } })); }
Source:
<code>public void onMouseEnteredClanTag() { clanService.getClanByTag(player.getClan()).thenAccept(optionalClan -> { if (!optionalClan.isPresent()) { return; } if (!clanMenu.getItems().isEmpty()) { clanMenu.getItems().clear(); <START> } <END> Clan clan = optionalClan.get(); if (playerService.isOnline(clan.getLeader().getId())) { MenuItem messageLeaderItem = new MenuItem(i18n.get("clan.messageLeader")); messageLeaderItem.setOnAction(event -> eventBus.post(new InitiatePrivateChatEvent(clan.getLeader().getUsername()))); clanMenu.getItems().add(messageLeaderItem); } MenuItem visitClanPageAction = new MenuItem(i18n.get("clan.visitPage")); visitClanPageAction.setOnAction(event -> { platformService.showDocument(clan.getWebsiteUrl()); }); clanMenu.getItems().add(visitClanPageAction); if (clanMenu.getTooltip() != null) { clanTooltipController.setClan(clan); return; } Tooltip clanTooltip = new Tooltip(); clanTooltipController = uiService.loadFxml("theme/chat/clan_tooltip.fxml"); clanTooltip.setMaxHeight(clanTooltipController.getRoot().getHeight()); clanTooltip.setGraphic(clanTooltipController.getRoot()); clanTooltipController.setClan(clan); clanMenu.setTooltip(clanTooltip); clanTooltip.show(StageHolder.getStage()); }); }</code><technical_language>do call clear() if empty? Clearing empty list effect</technical_language>

Target:
public void onMouseEnteredClanTag() { clanService.getClanByTag(player.getClan()).thenAccept(optionalClan -> { if (!optionalClan.isPresent()) { return; } clanMenu.getItems().clear(); Clan clan = optionalClan.get(); if (playerService.isOnline(clan.getLeader().getId())) { MenuItem messageLeaderItem = new MenuItem(i18n.get("clan.messageLeader")); messageLeaderItem.setOnAction(event -> eventBus.post(new InitiatePrivateChatEvent(clan.getLeader().getUsername()))); clanMenu.getItems().add(messageLeaderItem); } MenuItem visitClanPageAction = new MenuItem(i18n.get("clan.visitPage")); visitClanPageAction.setOnAction(event -> { platformService.showDocument(clan.getWebsiteUrl()); }); clanMenu.getItems().add(visitClanPageAction); if (clanMenu.getTooltip() != null) { clanTooltipController.setClan(clan); return; } Tooltip clanTooltip = new Tooltip(); clanTooltipController = uiService.loadFxml("theme/chat/clan_tooltip.fxml"); clanTooltip.setMaxHeight(clanTooltipController.getRoot().getHeight()); clanTooltip.setGraphic(clanTooltipController.getRoot()); clanTooltipController.setClan(clan); clanMenu.setTooltip(clanTooltip); clanTooltip.show(StageHolder.getStage()); }); }
Source:
<code>public void close() { if (!isClosed) { isClosed = true; AeronCloseHelper.close(errorHandler, logFactory); AeronCloseHelper.close(errorHandler, lossReport); IoUtil.unmap(lossReportBuffer); lossReportBuffer = null; if (errorHandler instanceof AutoCloseable) { CloseHelper.quietClose((AutoCloseable)errorHandler); } IoUtil.unmap(cncByteBuffer); cncByteBuffer = null; if (dirDeleteOnShutdown && null != aeronDirectory()) { <START> CloseHelper.quietClose(this::deleteAeronDirectory); <END> } super.close(); } }</code><technical_language>Delete handled this. <LINK_0></technical_language>

Target:
public void close() { if (!isClosed) { isClosed = true; AeronCloseHelper.close(errorHandler, logFactory); AeronCloseHelper.close(errorHandler, lossReport); IoUtil.unmap(lossReportBuffer); lossReportBuffer = null; if (errorHandler instanceof AutoCloseable) { CloseHelper.quietClose((AutoCloseable)errorHandler); } IoUtil.unmap(cncByteBuffer); cncByteBuffer = null; if (dirDeleteOnShutdown && null != aeronDirectory()) { deleteAeronDirectory(); } super.close(); } }
Source:
<code>public static void main(String[] args) { <START> System.out.println("Support for Kafka version 0.8 is being deprecated. The default kafkaloader is Kafka version 0.10."); <END> final KafkaExternalLoaderCLIArguments cfg = new KafkaExternalLoaderCLIArguments(); cfg.parse(KafkaExternalLoader.class.getName(), args); KafkaExternalLoader kloader = new KafkaExternalLoader(cfg); try { kloader.initialize(); kloader.processKafkaMessages(); } catch (Exception e) { kloader.close(); m_log.error("Exception in KafkaExternalLoader", e); System.exit(-1); } System.exit(0); }</code><technical_language>"Support for Kafka version 0.8 deprecated. default kafkaloader is Kafka version 0.10."</technical_language>

Target:
public static void main(String[] args) { System.out.println("Support for Kafka version 0.8 has been deprecated. The default kafkaloader is Kafka version 0.10."); final KafkaExternalLoaderCLIArguments cfg = new KafkaExternalLoaderCLIArguments(); cfg.parse(KafkaExternalLoader.class.getName(), args); KafkaExternalLoader kloader = new KafkaExternalLoader(cfg); try { kloader.initialize(); kloader.processKafkaMessages(); } catch (Exception e) { kloader.close(); m_log.error("Exception in KafkaExternalLoader", e); System.exit(-1); } System.exit(0); }
Source:
<code>public static Geometry deserialize(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); input.skip(SIZE_OF_INT); if (input.available() == 0) { return GEOMETRY_FACTORY.createGeometryCollection(); } List<Geometry> geometries = new ArrayList<>(); while (input.available() > 0) { int length = input.readInt(); geometries.add(readGeometry(input.readSlice(length).getInput())); } if (geometries.size() == 1) { return geometries.get(0); } <START> Geometry res = GEOMETRY_FACTORY.createGeometryCollection(geometries.toArray(new Geometry[0])); <END> return res; }</code><technical_language>unnecessary change; please revert</technical_language>

Target:
public static Geometry deserialize(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); int geometryType = input.readByte(); if (geometryType != GeometryUtils.GeometryTypeName.GEOMETRY_COLLECTION.code()) { return readGeometry(input); } if (input.available() == 0) { return GEOMETRY_FACTORY.createGeometryCollection(); } List<Geometry> geometries = new ArrayList<>(); while (input.available() > 0) { int length = input.readInt(); geometries.add(readGeometry(input.readSlice(length).getInput())); } return GEOMETRY_FACTORY.createGeometryCollection(geometries.toArray(new Geometry[0])); }
Source:
<code>public ProjectInformation(String groupId, String artifactId, String version, String packaging, Path projectBaseFolder, Path buildDirectory) { <START> this.groupId = groupId; <END> this.artifactId = artifactId; this.version = version; this.packaging = packaging; this.projectBaseFolder = projectBaseFolder; this.buildDirectory = buildDirectory; }</code><technical_language>Please this constructor private force users builder, forcing validations</technical_language>

Target:
private ProjectInformation(String groupId, String artifactId, String version, String packaging, Path projectBaseFolder, Path buildDirectory) { this.groupId = groupId; this.artifactId = artifactId; this.version = version; this.packaging = packaging; this.projectBaseFolder = projectBaseFolder; this.buildDirectory = buildDirectory; }
Source:
<code>public ObjectCachingColumnSelectorFactory(ColumnSelectorFactory delegate, boolean concurrentEventAdd) { this.delegate = delegate; if (concurrentEventAdd) { <START> longColumnSelectorMap = Maps.newConcurrentMap(); <END> floatColumnSelectorMap = Maps.newConcurrentMap(); objectColumnSelectorMap = Maps.newConcurrentMap(); } else { longColumnSelectorMap = Maps.newHashMap(); floatColumnSelectorMap = Maps.newHashMap(); objectColumnSelectorMap = Maps.newHashMap(); } }</code><technical_language>Please ConcurrentHashMap, implementation Maps.newConcurrentMap() higher overhead is scalable</technical_language>

Target:
public ObjectCachingColumnSelectorFactory(ColumnSelectorFactory delegate, boolean concurrentEventAdd) { this.delegate = delegate; if (concurrentEventAdd) { longColumnSelectorMap = new ConcurrentHashMap<>(); floatColumnSelectorMap = new ConcurrentHashMap<>(); objectColumnSelectorMap = new ConcurrentHashMap<>(); } else { longColumnSelectorMap = new HashMap<>(); floatColumnSelectorMap = new HashMap<>(); objectColumnSelectorMap = new HashMap<>(); } }
Source:
<code>public static Slice truncateToLength(Slice slice, int maxLength) { requireNonNull(slice, "slice is null"); if (maxLength < 0) { throw new IllegalArgumentException("Max length must be greater or equal than zero"); } if (maxLength == 0) { return Slices.EMPTY_SLICE; } <START> int indexEnd = getTruncatedEndIndex(slice, 0, maxLength); <END> if (indexEnd < 0) { return slice; } return slice.slice(0, indexEnd); }</code><technical_language>endIndex</technical_language>

Target:
public static Slice truncateToLength(Slice slice, int maxLength) { requireNonNull(slice, "slice is null"); if (maxLength < 0) { throw new IllegalArgumentException("Max length must be greater or equal than zero"); } if (maxLength == 0) { return Slices.EMPTY_SLICE; } return slice.slice(0, byteCount(slice, 0, slice.length(), maxLength)); }
Source:
<code>void epollInReady() { assert eventLoop().inEventLoop(); DatagramChannelConfig config = config(); if (shouldBreakEpollInReady(config)) { clearEpollIn0(); return; } final EpollRecvByteAllocatorHandle allocHandle = recvBufAllocHandle(); allocHandle.edgeTriggered(isFlagSet(Native.EPOLLET)); final ChannelPipeline pipeline = pipeline(); final ByteBufAllocator allocator = config.getAllocator(); allocHandle.reset(config); epollInBefore(); Throwable exception = null; try { try { boolean connected = isConnected(); do { ByteBuf byteBuf = allocHandle.allocate(allocator); final boolean read; if (connected) { read = connectedRead(allocHandle, byteBuf); } else { int writerIndex = byteBuf.writerIndex(); <START> int size = byteBuf.capacity() - writerIndex; <END> int datagramSize = config().getMaxDatagramPacketSize(); int numDatagram = datagramSize == 0 ? 1 : size / datagramSize; if (numDatagram <= 1) { read = read(allocHandle, byteBuf); } else { read = scatteringRead(allocHandle, byteBuf, datagramSize, numDatagram); } } if (read) { readPending = false; } else { break; } } while (allocHandle.continueReading()); } catch (Throwable t) { exception = t; } allocHandle.readComplete(); pipeline.fireChannelReadComplete(); if (exception != null) { pipeline.fireExceptionCaught(exception); } } finally { epollInFinally(config); } }</code><technical_language>nit: I lines size = byteBuf.writableBytes() now? (sorry left changes)</technical_language>

Target:
void epollInReady() { assert eventLoop().inEventLoop(); DatagramChannelConfig config = config(); if (shouldBreakEpollInReady(config)) { clearEpollIn0(); return; } final EpollRecvByteAllocatorHandle allocHandle = recvBufAllocHandle(); allocHandle.edgeTriggered(isFlagSet(Native.EPOLLET)); final ChannelPipeline pipeline = pipeline(); final ByteBufAllocator allocator = config.getAllocator(); allocHandle.reset(config); epollInBefore(); Throwable exception = null; try { try { boolean connected = isConnected(); do { ByteBuf byteBuf = allocHandle.allocate(allocator); final boolean read; if (connected) { read = connectedRead(allocHandle, byteBuf); } else { int datagramSize = config().getMaxDatagramPayloadSize(); int numDatagram = datagramSize == 0 ? 1 : byteBuf.writableBytes() / datagramSize; if (numDatagram <= 1) { read = read(allocHandle, byteBuf, datagramSize); } else { read = scatteringRead(allocHandle, byteBuf, datagramSize, numDatagram); } } if (read) { readPending = false; } else { break; } } while (allocHandle.continueReading()); } catch (Throwable t) { exception = t; } allocHandle.readComplete(); pipeline.fireChannelReadComplete(); if (exception != null) { pipeline.fireExceptionCaught(exception); } } finally { epollInFinally(config); } }
Source:
<code>protected void onCreate(Bundle icicle) { super.onCreate(icicle); addPreferencesFromResource(R.xml.cdma_call_privacy); SubscriptionInfoHelper subInfoHelper = new SubscriptionInfoHelper(this, getIntent()); subInfoHelper.setActionBarTitle( getActionBar(), getResources(), R.string.labelCdmaMore_with_label); mButtonVoicePrivacy = (SwitchPreference) findPreference(BUTTON_VP_KEY); PersistableBundle carrierConfig; if (subInfoHelper.hasSubId()) { carrierConfig = PhoneGlobals.getInstance().getCarrierConfigForSubId( subInfoHelper.getSubId()); } else { carrierConfig = PhoneGlobals.getInstance().getCarrierConfig(); } if (subInfoHelper.getPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_CDMA || carrierConfig.getBoolean(CarrierConfigManager.KEY_VOICE_PRIVACY_DISABLE_UI_BOOL)) { mButtonVoicePrivacy.setEnabled(false); } Preference callForwardingPref = getPreferenceScreen().findPreference(CALL_FORWARDING_KEY); callForwardingPref.setIntent(subInfoHelper.getIntent(CdmaCallForwardOptions.class)); CdmaCallWaitingPreference callWaitingPref = (CdmaCallWaitingPreference)getPreferenceScreen() .findPreference(CALL_WAITING_KEY); <START> callWaitingPref.setEnabled(true); <END> callWaitingPref.init(this, subInfoHelper.getPhone()); }</code><technical_language>this need manually set enabled if enabled call waiting query completes</technical_language>

Target:
protected void onCreate(Bundle icicle) { super.onCreate(icicle); addPreferencesFromResource(R.xml.cdma_call_privacy); SubscriptionInfoHelper subInfoHelper = new SubscriptionInfoHelper(this, getIntent()); subInfoHelper.setActionBarTitle( getActionBar(), getResources(), R.string.labelCdmaMore_with_label); mButtonVoicePrivacy = (SwitchPreference) findPreference(BUTTON_VP_KEY); PersistableBundle carrierConfig; if (subInfoHelper.hasSubId()) { carrierConfig = PhoneGlobals.getInstance().getCarrierConfigForSubId( subInfoHelper.getSubId()); } else { carrierConfig = PhoneGlobals.getInstance().getCarrierConfig(); } if (subInfoHelper.getPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_CDMA || carrierConfig.getBoolean(CarrierConfigManager.KEY_VOICE_PRIVACY_DISABLE_UI_BOOL)) { mButtonVoicePrivacy.setEnabled(false); } Preference callForwardingPref = getPreferenceScreen().findPreference(CALL_FORWARDING_KEY); callForwardingPref.setIntent(subInfoHelper.getIntent(CdmaCallForwardOptions.class)); CdmaCallWaitingPreference callWaitingPref = (CdmaCallWaitingPreference)getPreferenceScreen() .findPreference(CALL_WAITING_KEY); callWaitingPref.init(this, subInfoHelper.getPhone()); }
Source:
<code>public static int getNumberOfCounters() { if (!isKernelModuleLoaded() && OprofileProject.getProfilingBinary().equals(OprofileProject.OPCONTROL_BINARY)){ return 0; } try { Process p = RuntimeProcessFactory.getFactory().exec( new String {"operf", "--version"}, OprofileProject.getProject()); if (p == null) { return 0; } } catch (IOException e) { return 0; } <START> if (info== null) { <END> initializeOprofileCore(); } return info.getNrCounters(); }</code><technical_language>I this is right. if info is null this point kernel module is believed loaded, OpInfo.getInfo() returns null. initializeOProfileCore() fix issue, I guess isKernelModuleLoaded() is returning false true. if this is case, if so, detect loaded Power ? Currently check for existence of "/dev/oprofile/cpu_type" "/proc/sys/dev/oprofile/cpu_type"</technical_language>

Target:
public static int getNumberOfCounters() { if (!isKernelModuleLoaded() && OprofileProject.getProfilingBinary().equals(OprofileProject.OPCONTROL_BINARY)){ return 0; } try { Process p = RuntimeProcessFactory.getFactory().exec( new String {"operf", "--version"}, OprofileProject.getProject()); if (p == null) { return 0; } } catch (IOException e) { return 0; } return info.getNrCounters(); }
Source:
<code>public Builder setMaxReconnectAttempts(int maxReconnectAttempts) throws IllegalArgumentException { <START> checkNotNullParam("reconnectAttempts", maxReconnectAttempts); <END> if (maxReconnectAttempts < -1) { throw audit.badReconnectAttemptsNumber(maxReconnectAttempts); } this.maxReconnectAttempts = maxReconnectAttempts; return this; }</code><technical_language>This null check removed maxReconnectAttempts is int</technical_language>

Target:
public Builder setMaxReconnectAttempts(int maxReconnectAttempts) throws IllegalArgumentException { if (maxReconnectAttempts < -1) { throw audit.badReconnectAttemptsNumber(maxReconnectAttempts); } this.maxReconnectAttempts = maxReconnectAttempts; return this; }
Source:
<code>public void endElement(String uri, String localName, String qName) throws SAXException { if ("sitemap".equals(currentElement())) { maybeAddSiteMap(); } else if ("sitemapindex".equals(currentElement())) { sitemap.setProcessed(true); } else if ("loc".equals(currentElement())) { <START> locFound = true; <END> } }</code><technical_language>want set locFound = false in endElement() method, for get </loc>? matter..</technical_language>

Target:
public void endElement(String uri, String localName, String qName) throws SAXException { if ("sitemap".equals(currentElement())) { maybeAddSiteMap(); } else if ("sitemapindex".equals(currentElement())) { sitemap.setProcessed(true); } else if ("loc".equals(currentElement())) { locClosed = true; } }