auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Class<?> getClassForType(final String typeName) { Assert.requireNonNull(typeName, "typeName"); <START> Map<String, Class<?>> mapping = configuration.getTypeMapping(); <END> if(mapping.containsKey(typeName)) { Class<?> cls = mapping.get(typeName); if(cls == null) { throw new IllegalStateException("null value specified for type " + typeName); } return cls; } try { return classLoader.loadClass(typeName); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Can not find class for type " + typeName, e); } }</code><technical_language>Add final keyword</technical_language>

Target:
private Class<?> getClassForType(final String typeName) { Assert.requireNonNull(typeName, "typeName"); final Map<String, Class<?>> mapping = configuration.getTypeMapping(); if(mapping.containsKey(typeName)) { final Class<?> cls = mapping.get(typeName); if(cls == null) { throw new IllegalStateException("null value specified for type " + typeName); } return cls; } try { return classLoader.loadClass(typeName); } catch (final ClassNotFoundException e) { throw new IllegalArgumentException("Can not find class for type " + typeName, e); } }
Source:
<code>public VdsDeploy(VDS vds) { _vds = vds; _messages = new InstallerMessages(_vds); _dialog = new EngineSSHDialog(); _parser = new MachineDialogParser(); _thread = new Thread( new Runnable() { @Override public void run() { _threadMain(); } }, "VdsDeploy" ); if (s_deployPackage == null) { String cacheDir = System.getenv("ENGINE_CACHE"); if (cacheDir == null) { log.warn("ENGINE_CACHE environment variable not found, using tmpdir instead."); <START> cacheDir = System.getProperty("java.io.tmpdir"); <END> } s_deployPackage = new CachedTar( new File( LocalConfig.getInstance().getCacheDir(), Config.<String> GetValue(ConfigValues.BootstrapPackageName) ), new File(Config.<String> GetValue(ConfigValues.BootstrapPackageDirectory)) ); } }</code><technical_language>Well, if clean up, remove entire hang... cacheDir is I :) replaced getCacheDir() bellow. strange rename ends assignment</technical_language>

Target:
public VdsDeploy(VDS vds) { _vds = vds; _messages = new InstallerMessages(_vds); _dialog = new EngineSSHDialog(); _parser = new MachineDialogParser(); _thread = new Thread( new Runnable() { @Override public void run() { _threadMain(); } }, "VdsDeploy" ); if (s_deployPackage == null) { s_deployPackage = new CachedTar( new File( LocalConfig.getInstance().getCacheDir(), Config.<String> GetValue(ConfigValues.BootstrapPackageName) ), new File(Config.<String> GetValue(ConfigValues.BootstrapPackageDirectory)) ); } }
Source:
<code>public Right register(RightDescription rightDescription) throws UnableToRegisterRightException { <START> return register(rightDescription, Collections.singleton(Right.ADMIN)); <END> }</code><technical_language>Hmm sure. Feels weird a right is implied PROGRAM, pretty people forget add PROGRAM ADMIN want right in implied EDIT</technical_language>

Target:
public Right register(RightDescription rightDescription) throws UnableToRegisterRightException { return register(rightDescription, new HashSet<>(DEFAULT_IMPLIED_BY_RIGHTS)); }
Source:
<code>private void newVM(UnitVmModel model) { <START> Cluster cluster = model.getSelectedCluster(); <END> BiosType vmBiosType = model.getBiosType().getSelectedItem(); if (cluster.getArchitecture().getFamily() != ArchitectureType.x86 || getEffectiveBiosType(vmBiosType, cluster).getChipsetType() == ChipsetType.I440FX) { saveNewVm(model); return; } Guid templateId = model.getTemplateWithVersion().getSelectedItem().getTemplateVersion().getId(); AsyncDataProvider.getInstance().isVmTemplateI440fx(new AsyncQuery<>(isI440fx -> { if (!isI440fx) { saveNewVm(model); } else { setCurrentVmModel(model); confirmQ35VmDeviceChanges(); } }), templateId); }</code><technical_language>I prefer move logic UnitVmModel methold "vmAndTemplateChipsetsCompatible" (or wih name) - return boolean. ListModel handle confirmation dialog opening/closing</technical_language>

Target:
private void newVM(UnitVmModel model) { model.needsQ35VmDeviceChanges( () -> saveNewVm(model), () -> { setCurrentVmModel(model); confirmQ35VmDeviceChanges(); } ); }
Source:
<code>public BinaryManagerStatus garbageCollectBinaries(boolean delete) { TransactionHelper.commitOrRollbackTransaction(); TransactionHelper.startTransaction(BINARY_GC_TX_TIMEOUT_SEC); List<BinaryGarbageCollector> gcs = getGarbageCollectors(); long start = System.currentTimeMillis(); for (BinaryGarbageCollector gc : gcs) { gc.start(); } RepositoryService repositoryService = Framework.getService(RepositoryService.class); for (String repositoryName : repositoryService.getRepositoryNames()) { Repository repository = repositoryService.getRepository(repositoryName); repository.markReferencedBinaries(); } BinaryManagerStatus globalStatus = new BinaryManagerStatus(); for (BinaryGarbageCollector gc : gcs) { gc.stop(delete); BinaryManagerStatus status = gc.getStatus(); globalStatus.numBinaries += status.numBinaries; globalStatus.sizeBinaries += status.sizeBinaries; globalStatus.numBinariesGC += status.numBinariesGC; globalStatus.sizeBinariesGC += status.sizeBinariesGC; } globalStatus.gcDuration = System.currentTimeMillis() - start; TransactionHelper.commitOrRollbackTransaction(); <START> TransactionHelper.startTransaction(); <END> return globalStatus; }</code><technical_language>starting a new transaction, check a transaction entering #garbageCollectBinaries method? weird start a new transaction if transaction before. WDYT @efge</technical_language>

Target:
public BinaryManagerStatus garbageCollectBinaries(boolean delete) { return runInTransaction(() -> { List<BinaryGarbageCollector> gcs = getGarbageCollectors(); long start = System.currentTimeMillis(); for (BinaryGarbageCollector gc : gcs) { gc.start(); } RepositoryService repositoryService = Framework.getService(RepositoryService.class); for (String repositoryName : repositoryService.getRepositoryNames()) { Repository repository = repositoryService.getRepository(repositoryName); repository.markReferencedBinaries(); } BinaryManagerStatus globalStatus = new BinaryManagerStatus(); for (BinaryGarbageCollector gc : gcs) { gc.stop(delete); BinaryManagerStatus status = gc.getStatus(); globalStatus.numBinaries += status.numBinaries; globalStatus.sizeBinaries += status.sizeBinaries; globalStatus.numBinariesGC += status.numBinariesGC; globalStatus.sizeBinariesGC += status.sizeBinariesGC; } globalStatus.gcDuration = System.currentTimeMillis() - start; return globalStatus; }, BINARY_GC_TX_TIMEOUT_SEC); }
Source:
<code>public void testWindowsEndsOfLineWithLinuxSources() throws Exception { this.validateCheckstyle( <START> "Bar.java", false, <END> Matchers.containsString("LICENSE found") ); }</code><technical_language>@prahladyeri false next line</technical_language>

Target:
public void testWindowsEndsOfLineWithLinuxSources() throws Exception { this.validateCheckstyle( "WindowsEolLinux.java", false, Matchers.containsString("LICENSE found") ); }
Source:
<code>public ListenableFuture<List<SampleRowKeysResponse>> sampleRowKeysAsync( SampleRowKeysRequest request) { <START> ReadAsync<SampleRowKeysRequest, SampleRowKeysResponse> readAsync = <END> new ReadAsync<SampleRowKeysRequest, SampleRowKeysResponse>() { @Override public ListenableFuture<List<SampleRowKeysResponse>> readAsync(SampleRowKeysRequest request) { ClientCall<SampleRowKeysRequest, SampleRowKeysResponse> call = channel.newCall(BigtableServiceGrpc.METHOD_SAMPLE_ROW_KEYS, CallOptions.DEFAULT); CollectingStreamObserver<SampleRowKeysResponse> responseBuffer = new CollectingStreamObserver<>(call); ClientCalls.asyncServerStreamingCall( call, request, responseBuffer); return Futures.transform( responseBuffer.getResponseCompleteFuture(), IMMUTABLE_LIST_FUNCTION); }}; if (retryOptions.enableRetries()) { ReadFallback<SampleRowKeysRequest, SampleRowKeysResponse> readFallback = new ReadFallback<>(request, readAsync); return Futures.withFallback(readAsync.readAsync(request), readFallback); } return readAsync.readAsync(request); }</code><technical_language>this a member variable</technical_language>

Target:
public ListenableFuture<List<SampleRowKeysResponse>> sampleRowKeysAsync( SampleRowKeysRequest request) { return doReadAsync(request, sampleRowKeysAsync); }
Source:
<code>public static boolean isValidOverWhiteListPatterns(String input, String... whiteListPatterns) { if (ArrayUtils.isEmpty(whiteListPatterns)) { throw new IllegalArgumentException("Should provide at least one white list pattern"); } boolean isValid = false; <START> if (input != null) { <END> for (String key : whiteListPatterns) { if (validatorConfig.getPattern(key) != null) { isValid = validatorConfig.getPattern(key).matcher(input).matches(); if (isValid) { break; } } } } return isValid; }</code><technical_language>if input is null valid for blacklist patterns ? if input is null valid for blacklist patterns ? I throw illegal argument exception consider null valid. I prefer considered valid caller need unnecessarily check for null of input time</technical_language>

Target:
public static boolean isValidOverWhiteListPatterns(String input, String... whiteListPatterns) { if (ArrayUtils.isEmpty(whiteListPatterns)) { throw new IllegalArgumentException("Should provide at least one white list pattern"); } if (StringUtils.isEmpty(input)) { return true; } boolean isValid = false; for (String key : whiteListPatterns) { if (validatorConfig.getPattern(key) != null) { isValid = validatorConfig.getPattern(key).matcher(input).matches(); if (isValid) { break; } } } return isValid; }
Source:
<code>private static void printQuery(PreparedStatement s, StringBuilder sb) throws SQLException { ResultSet set = null; try { set = s.executeQuery(); ResultSetMetaData metaData = set.getMetaData(); for (int i = 1; i <= metaData.getColumnCount(); i++) { if (i == 1) sb.append("||"); sb.append(metaData.getColumnName(i) + "||"); } sb.append("\n"); while (set.next()) { for (int i = 1; i <= metaData.getColumnCount(); i++) { if (i == 1) sb.append("|"); sb.append(set.getString(i) + "|"); } sb.append("\n"); } } finally { try { <START> set.close(); <END> } catch (Throwable ignore) { } try { s.close(); } catch (Throwable ignore) { } } }</code><technical_language>set null here</technical_language>

Target:
private static void printQuery(PreparedStatement s, StringBuilder sb) throws SQLException { ResultSet set = null; try { set = s.executeQuery(); ResultSetMetaData metaData = set.getMetaData(); for (int i = 1; i <= metaData.getColumnCount(); i++) { if (i == 1) sb.append("||"); sb.append(metaData.getColumnName(i) + "||"); } sb.append("\n"); while (set.next()) { for (int i = 1; i <= metaData.getColumnCount(); i++) { if (i == 1) sb.append("|"); sb.append(set.getString(i) + "|"); } sb.append("\n"); } } finally { try { if (set != null) { set.close(); } } catch (Throwable ignore) { } try { if (s != null) { s.close(); } } catch (Throwable ignore) { } } }
Source:
<code>TransferSegmentStatus synchronousStateTransfer( Stream<TransferBatchRequest> batchStream, long totalNeeded) { long accTransferred = 0L; Iterator<TransferBatchRequest> iterator = batchStream.iterator(); while (iterator.hasNext()) { TransferBatchRequest nextBatch = iterator.next(); TransferBatchResponse response = batchProcessor.transfer(nextBatch).join(); if (response.getStatus() == TransferStatus.FAILED) { Optional<TransferSegmentException> causeOfFailure = Optional.of(response.getCauseOfFailure() .map(TransferSegmentException::new) .orElse(new TransferSegmentException("Failed to transfer."))); return TransferSegmentStatus .builder() .totalTransferred(0L) .segmentState(FAILED) .causeOfFailure(causeOfFailure) .build(); } accTransferred += response.getTransferBatchRequest().getAddresses().size(); } if (accTransferred == totalNeeded) { <START> return TransferSegmentStatus <END> .builder() .totalTransferred(accTransferred) .segmentState(TRANSFERRED) .build(); } String errorMsg = String.format("Needed: %s, but transferred: %s", totalNeeded, accTransferred); return TransferSegmentStatus .builder() .totalTransferred(0L) .segmentState(FAILED) .causeOfFailure(Optional.of(new TransferSegmentException(errorMsg))) .build(); }</code><technical_language>Layout segment transfer segments (i.e. subSegments) different, do want conflate two</technical_language>

Target:
TransferSegmentStatus synchronousStateTransfer( Stream<TransferBatchRequest> batchStream, long totalNeeded) { long accTransferred = 0L; Iterator<TransferBatchRequest> iterator = batchStream.iterator(); while (iterator.hasNext()) { TransferBatchRequest nextBatch = iterator.next(); TransferBatchResponse response = batchProcessor.transfer(nextBatch).join(); if (response.getStatus() == TransferStatus.FAILED) { Optional<TransferSegmentException> causeOfFailure = Optional.of(response.getCauseOfFailure() .map(TransferSegmentException::new) .orElse(new TransferSegmentException("Failed to transfer."))); return TransferSegmentStatus .builder() .totalTransferred(accTransferred) .segmentState(FAILED) .causeOfFailure(causeOfFailure) .build(); } accTransferred += response.getTransferBatchRequest().getAddresses().size(); } if (accTransferred == totalNeeded) { return TransferSegmentStatus .builder() .totalTransferred(accTransferred) .segmentState(TRANSFERRED) .build(); } String errorMsg = String.format("Needed: %s, but transferred: %s", totalNeeded, accTransferred); return TransferSegmentStatus .builder() .totalTransferred(0L) .segmentState(FAILED) .causeOfFailure(Optional.of(new TransferSegmentException(errorMsg))) .build(); }
Source:
<code>public Response doDisable() { final Worker worker = curatorCoordinator.getWorker(); <START> final Worker newWorker = new Worker(worker.getHost(), worker.getIp(), worker.getCapacity(), ""); <END> try { curatorCoordinator.updateWorkerAnnouncement(newWorker); return Response.ok(ImmutableMap.of(worker.getHost(), "disabled")).build(); } catch (Exception e) { return Response.serverError().build(); } }</code><technical_language>Extract this a constant</technical_language>

Target:
public Response doDisable() { try { curatorCoordinator.updateWorkerAnnouncement(disabledWorker); return Response.ok(ImmutableMap.of(disabledWorker.getHost(), "disabled")).build(); } catch (Exception e) { return Response.serverError().build(); } }
Source:
<code>public void getMandateTransfers() throws Exception { String mandateId = "15397886"; List<Transfer> transfers = this.api.getMandateApi().getTransfers("15397886", new Pagination(1, 1), null); assertNotNull(transfers); <START> assertTrue(transfers.size() > 0); <END> }</code><technical_language>Assert is 1, test pagination</technical_language>

Target:
public void getMandateTransfers() throws Exception { String mandateId = "15397886"; List<Transfer> transfers = this.api.getMandateApi().getTransfers("15397886", new Pagination(1, 1), null); assertNotNull(transfers); assertTrue(transfers.size() == 1); }
Source:
<code>public static RangePredicate range( int propertyKeyId, ValueGroup valueGroup ) { if ( valueGroup == ValueGroup.GEOMETRY ) { <START> throw new IllegalArgumentException( "Cannot create GeometryRangePredicate without at specified CRS" ); <END> } return new RangePredicate<>( propertyKeyId, valueGroup, null, true, null, true ); }</code><technical_language>-> a</technical_language>

Target:
public static RangePredicate range( int propertyKeyId, ValueGroup valueGroup ) { if ( valueGroup == ValueGroup.GEOMETRY ) { throw new IllegalArgumentException( "Cannot create GeometryRangePredicate without a specified CRS" ); } return new RangePredicate<>( propertyKeyId, valueGroup, null, true, null, true ); }
Source:
<code>public void registerPublisher(EventPublisher publisher, String... eventTypes) { if (publisher == null) { throw new InvalidParameterException("Publisher must not be null"); } if (eventTypes == null || eventTypes.length == 0) { throw new InvalidParameterException("At least one event type must be specified"); } regMgmtLock.lock(); try { <START> final String publisherName = publisher.getPublisherName(); <END> if (nameToPublisher.get(publisherName) != null) { throw new InvalidParameterException( "Publisher with name " + publisherName + " already registered by " + nameToPublisher .get(publisherName) .getPublisher() .getClass() .getCanonicalName()); } log.debug("registerPublisher " + publisherName); RegisteredPublisher regProd = new RegisteredPublisher(publisher, new HashSet<>(asList(eventTypes))); danglingConsumers.removeIf( regCon -> { if (regCon.getPublisherName().equals(publisherName)) { regProd.addConsumer(regCon); return true; } return false; }); nameToPublisher.put(publisherName, regProd); } finally { regMgmtLock.unlock(); } }</code><technical_language>Generally add final needed</technical_language>

Target:
public void registerPublisher(EventPublisher publisher, String... eventTypes) { if (publisher == null) { throw new InvalidParameterException("Publisher must not be null"); } if (eventTypes == null || eventTypes.length == 0) { throw new InvalidParameterException("At least one event type must be specified"); } regMgmtLock.lock(); try { String publisherName = publisher.getPublisherName(); if (nameToPublisher.get(publisherName) != null) { throw new InvalidParameterException( "Publisher with name " + publisherName + " already registered by " + nameToPublisher .get(publisherName) .getPublisher() .getClass() .getCanonicalName()); } log.debug("registerPublisher " + publisherName); RegisteredPublisher regProd = new RegisteredPublisher(publisher, new HashSet<>(asList(eventTypes))); moveConsumers( danglingConsumers, consumer -> consumer.getPublisherName().equals(publisherName), regProd::addConsumer); nameToPublisher.put(publisherName, regProd); } finally { regMgmtLock.unlock(); } }
Source:
<code>public void start() { if (!enabled) { logger.info(format("Diagnostics disabled. To enable add -D%s=true to the JVM arguments.", ENABLED.getName())); return; } <START> if (stdout) { <END> this.diagnosticsLog = new DiagnosticsStdout(this); } else { this.diagnosticsLog = new DiagnosticsLogFile(this); } this.scheduler = new ScheduledThreadPoolExecutor(1, new DiagnosticSchedulerThreadFactory()); logger.info("Diagnostics started"); }</code><technical_language>convert this a ternary operator? this.diagnosticsLogs = stdOut ? new DiagnosticsStdout(this) : new DiagnosticsLogFile(this); code verbose</technical_language>

Target:
public void start() { if (!enabled) { logger.info(format("Diagnostics disabled. To enable add -D%s=true to the JVM arguments.", ENABLED.getName())); return; } this.diagnosticsLog = stdout ? new DiagnosticsStdout(this) : new DiagnosticsLogFile(this); this.scheduler = new ScheduledThreadPoolExecutor(1, new DiagnosticSchedulerThreadFactory()); logger.info("Diagnostics started"); }
Source:
<code>public AssertionError assertionError(String message, Object actual, Object expected) { <START> return assertionFailedError(message, actual, expected).orElse(createAssertionError(message)); <END> }</code><technical_language>I prefer previous code wording is more consistent (no create) more importantly I a point of creating AssertionFailedError if give actual expected. I clear enough in idea is throw AssertionFailedError actual expected provided a visual difference (from IDEs) helpful. if other reasons do seeing, of changes in file reverted, refactoring of assertionFailedError tryInstantiateAssertionFailedError</technical_language>

Target:
public AssertionError assertionError(String message, Object actual, Object expected) { return new LazyAssertionFailedErrorCreator(message, actual, expected).assertionErrorIfCantBeCreated(); }
Source:
<code>public TObject minKey(String key, AccessToken creds, TransactionToken transaction, String environment) throws TException { checkAccess(creds, transaction); AtomicSupport store = getStore(transaction, environment); AtomicOperation atomic = null; TObject min = null; while (atomic == null || !atomic.commit()) { atomic = store.startAtomicOperation(); try { Map<TObject, Set<Long>> data = atomic.browse(key); <START> for (Entry<TObject, Set<Long>> entry : data.entrySet()) { <END> min = entry.getKey(); break; } } catch (AtomicStateException e) { atomic = null; min = null; } } return min; }</code><technical_language>Iterables.getFirst</technical_language>

Target:
public TObject minKey(String key, AccessToken creds, TransactionToken transaction, String environment) throws TException { checkAccess(creds, transaction); AtomicSupport store = getStore(transaction, environment); AtomicOperation atomic = null; TObject min = null; while (atomic == null || !atomic.commit()) { atomic = store.startAtomicOperation(); try { Map<TObject, Set<Long>> data = atomic.browse(key); min = Iterables.getFirst(data.keySet(), min); } catch (AtomicStateException e) { atomic = null; min = null; } } return min; }
Source:
<code>public static void assertNoErrors(Response response) throws MultipleFailureException{ List<Throwable> errors = new ArrayList<Throwable>(); for(Error error : response.getErrors()){ <START> Exception e = new Exception(error.getMessage(), error); <END> e.printStackTrace(); errors.add(e); } if(!errors.isEmpty()){ throw new MultipleFailureException(errors); } }</code><technical_language>Error extends RuntimeException, this is unnecessary overhead</technical_language>

Target:
public static void assertNoErrors(Response response) throws MultipleFailureException{ List<Throwable> errors = new ArrayList<Throwable>(response.getErrors()); if(!errors.isEmpty()){ throw new MultipleFailureException(errors); } }
Source:
<code>private void reportIssue(NewClassTree newClassTree, String typeName) { context.reportIssue(this, reportTree(newClassTree), <START> String.format("Implement \"Comparable\" in \"%s\" or switch key type.%s", <END> typeName, context.getJavaVersion().java8CompatibilityMessage())); }</code><technical_language>I understand part "or switch key type" tbh</technical_language>

Target:
private void reportIssue(NewClassTree newClassTree, String typeName) { context.reportIssue(this, reportTree(newClassTree), String.format("Implement \"Comparable\" in \"%s\" or change the key type of this map.%s", typeName, context.getJavaVersion().java8CompatibilityMessage())); }
Source:
<code><START> public void releaseUserCodeClassLoader_willRegisterOnce() throws Exception { <END> final BlobLibraryCacheManager libraryCacheManager = new TestingBlobLibraryCacheManagerBuilder().build(); final LibraryCacheManager.ClassLoaderLease classLoaderLease = libraryCacheManager.registerClassLoaderLease(new JobID()); final UserCodeClassLoader userCodeClassLoader = classLoaderLease.getOrResolveClassLoader(Collections.emptyList(), Collections.emptyList()); final OneShotLatch releaseHookLatch = new OneShotLatch(); userCodeClassLoader.registerReleaseHookIfAbsent("test", releaseHookLatch::trigger); userCodeClassLoader.registerReleaseHookIfAbsent("test", () -> { throw new RuntimeException("This hook is not expected to be executed"); }); classLoaderLease.release(); releaseHookLatch.await(); }</code><technical_language>suggestion public void releaseUserCodeClassLoader_willRegisterOnce() throws IOException, InterruptedException {</technical_language>

Target:
public void releaseUserCodeClassLoader_willRegisterOnce() throws IOException, InterruptedException { final BlobLibraryCacheManager libraryCacheManager = new TestingBlobLibraryCacheManagerBuilder().build(); final LibraryCacheManager.ClassLoaderLease classLoaderLease = libraryCacheManager.registerClassLoaderLease(new JobID()); final UserCodeClassLoader userCodeClassLoader = classLoaderLease.getOrResolveClassLoader(Collections.emptyList(), Collections.emptyList()); final OneShotLatch releaseHookLatch = new OneShotLatch(); userCodeClassLoader.registerReleaseHookIfAbsent("test", releaseHookLatch::trigger); userCodeClassLoader.registerReleaseHookIfAbsent("test", () -> { throw new RuntimeException("This hook is not expected to be executed"); }); classLoaderLease.release(); releaseHookLatch.await(); }
Source:
<code>public static int insertToTable(Connection c, String storageKey, Persistable p){ Pair<String, List<Object>> mPair = DatabaseHelper.getTableInsertData(storageKey, p); try { PreparedStatement preparedStatement = c.prepareStatement(mPair.first); for(int i=0; i<mPair.second.size(); i++){ Object obj = mPair.second.get(i); if(obj instanceof String){ preparedStatement.setString(i + 1, (String) obj); } else if(obj instanceof Blob){ preparedStatement.setBlob(i+1, (Blob) obj); } else if(obj instanceof Integer){ preparedStatement.setInt(i + 1, ((Integer) obj).intValue()); } else if(obj instanceof byte[]){ preparedStatement.setBinaryStream(i+1,new ByteArrayInputStream((byte[]) obj), ((byte[]) obj).length); } } int affectedRows = preparedStatement.executeUpdate(); if (affectedRows == 0) { throw new SQLException("Creating user failed, no rows affected."); } <START> try (ResultSet generatedKeys = preparedStatement.getGeneratedKeys()) { <END> if (generatedKeys.next()) { int id = generatedKeys.getInt(1); p.setID(id); return id; } else { throw new SQLException("Creating user failed, no ID obtained."); } } } catch (SQLException e) { System.out.println("e: " + e); e.printStackTrace(); } return -1; }</code><technical_language>this file need J2ME compat? Regardless, Try-with-resource requires Android API 19, need explicitly close result set a finally block</technical_language>

Target:
public static int insertToTable(Connection c, String storageKey, Persistable p) { Pair<String, List<Object>> mPair = DatabaseHelper.getTableInsertData(storageKey, p); PreparedStatement preparedStatement = null; try { preparedStatement = c.prepareStatement(mPair.first); for (int i = 0; i < mPair.second.size(); i++) { Object obj = mPair.second.get(i); if (obj instanceof String) { preparedStatement.setString(i + 1, (String)obj); } else if (obj instanceof Blob) { preparedStatement.setBlob(i + 1, (Blob)obj); } else if (obj instanceof Integer) { preparedStatement.setInt(i + 1, (Integer) obj); } else if (obj instanceof byte[]) { preparedStatement.setBinaryStream(i + 1, new ByteArrayInputStream((byte[])obj), ((byte[])obj).length); } } int affectedRows = preparedStatement.executeUpdate(); if (affectedRows == 0) { throw new SQLException("Creating user failed, no rows affected."); } try (ResultSet generatedKeys = preparedStatement.getGeneratedKeys()) { if (generatedKeys.next()) { int id = generatedKeys.getInt(1); p.setID(id); return id; } else { throw new SQLException("Creating user failed, no ID obtained."); } } } catch (SQLException e) { throw new RuntimeException(e); } finally { if (preparedStatement != null) { try { preparedStatement.close(); } catch (SQLException e) { e.printStackTrace(); } } } }
Source:
<code>public CouponInArrearsCalculation(CapletStripper stripper, List<CapFloor> caps, double[] mrkPrices, MarketDataType type, double[] errors, DoubleMatrix1D guess, MulticurveProviderInterface curves) { <START> <END> long t0 = System.nanoTime(); _capletStrippingResult = stripper.solve(mrkPrices, type, errors, guess); long t1 = System.nanoTime(); _time = (t1 - t0) * 1e-9; _curves = curves; DoublesPair[] expStrikes = _capletStrippingResult.getPricer().getExpiryStrikeArray(); DoubleMatrix1D vols = _capletStrippingResult.getCapletVols(); CombinedInterpolatorExtrapolator interpolator = CombinedInterpolatorExtrapolatorFactory.getInterpolator( Interpolator1DFactory.LINEAR, Interpolator1DFactory.LINEAR_EXTRAPOLATOR); GridInterpolator2D interpolator2D = new GridInterpolator2D(interpolator, interpolator); _surface = new InterpolatedDoublesSurface(expStrikes, vols.getData(), interpolator2D); }</code><technical_language>Copy mrkPrices errors construction</technical_language>

Target:
public CouponInArrearsCalculation(CapletStripper stripper, List<CapFloor> caps, double[] mrkPrices, MarketDataType type, double[] errors, DoubleMatrix1D guess, MulticurveProviderInterface curves) { ArgumentChecker.notNull(stripper, "stripper"); ArgumentChecker.notNull(caps, "caps"); ArgumentChecker.notNull(type, "type"); ArgumentChecker.notNull(guess, "guess"); ArgumentChecker.notNull(curves, "curves"); ArgumentChecker.notNull(mrkPrices, "mrkPrices"); ArgumentChecker.notNull(errors, "errors"); _mrkPrices = Arrays.copyOf(mrkPrices, mrkPrices.length); _errors = Arrays.copyOf(errors, errors.length); long t0 = System.nanoTime(); _capletStrippingResult = stripper.solve(_mrkPrices, type, _errors, guess); long t1 = System.nanoTime(); _time = (t1 - t0) * 1e-9; _curves = curves; DoublesPair[] expStrikes = _capletStrippingResult.getPricer().getExpiryStrikeArray(); DoubleMatrix1D vols = _capletStrippingResult.getCapletVols(); CombinedInterpolatorExtrapolator interpolator = CombinedInterpolatorExtrapolatorFactory.getInterpolator( Interpolator1DFactory.LINEAR, Interpolator1DFactory.LINEAR_EXTRAPOLATOR); GridInterpolator2D interpolator2D = new GridInterpolator2D(interpolator, interpolator); _surface = new InterpolatedDoublesSurface(expStrikes, vols.getData(), interpolator2D); }
Source:
<code>public Shell open(Display display) { shell = new Shell(display); shell.setLayout(new FillLayout()); shell.addShellListener(new ShellAdapter() { @Override public void shellClosed(ShellEvent e) { e.doit = closeAddressBook(); } }); createMenuBar(); searchDialog = new SearchDialog(shell); searchDialog.setSearchAreaNames(columnNames); searchDialog.setSearchAreaLabel(resAddressBook.getString("Column")); searchDialog.addFindListener(() -> findEntry()); table = new Table(shell, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION); table.setHeaderVisible(true); table.setMenu(createPopUpMenu()); table.addSelectionListener(widgetDefaultSelectedAdapter(e -> { TableItem[] items = table.getSelection(); if (items.length > 0) editEntry(items[0]); })); for(int i = 0; i < columnNames.length; i++) { TableColumn column = new TableColumn(table, SWT.NONE); column.setText(columnNames[i]); column.setWidth(150); final int columnIndex = i; column.addSelectionListener(widgetSelectedAdapter(e -> { <START> sort(columnIndex); <END> })); } newAddressBook(); shell.setSize(table.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, 300); shell.open(); return shell; }</code><technical_language>Put in line</technical_language>

Target:
public Shell open(Display display) { shell = new Shell(display); shell.setLayout(new FillLayout()); shell.addShellListener(new ShellAdapter() { @Override public void shellClosed(ShellEvent e) { e.doit = closeAddressBook(); } }); createMenuBar(); searchDialog = new SearchDialog(shell); searchDialog.setSearchAreaNames(columnNames); searchDialog.setSearchAreaLabel(resAddressBook.getString("Column")); searchDialog.addFindListener(() -> findEntry()); table = new Table(shell, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION); table.setHeaderVisible(true); table.setMenu(createPopUpMenu()); table.addSelectionListener(widgetDefaultSelectedAdapter(e -> { TableItem[] items = table.getSelection(); if (items.length > 0) editEntry(items[0]); })); for(int i = 0; i < columnNames.length; i++) { TableColumn column = new TableColumn(table, SWT.NONE); column.setText(columnNames[i]); column.setWidth(150); final int columnIndex = i; column.addSelectionListener(widgetSelectedAdapter(e -> sort(columnIndex))); } newAddressBook(); shell.setSize(table.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, 300); shell.open(); return shell; }
Source:
<code>public LedgerChildElement getChild(String name, int multiplicity) { <START> if (multiplicity == TreeReference.INDEX_TEMPLATE) { <END> return LedgerChildElement.TemplateElement(this); } if (name.equals(LedgerChildElement.NAME)) { getLedgers(); if (ledgers.size() == 0) { return LedgerChildElement.TemplateElement(this); } return ledgers.elementAt(multiplicity); } return null; }</code><technical_language>checking thiis for name multiplicity. IE: wanna return ledger/case template if request templates for a "ledger" template, a "test" tempalte</technical_language>

Target:
public LedgerChildElement getChild(String name, int multiplicity) { if ((multiplicity == TreeReference.INDEX_TEMPLATE) && "ledger".equals(name)) { return LedgerChildElement.TemplateElement(this); } if (name.equals(LedgerChildElement.NAME)) { getLedgers(); if (ledgers.size() == 0) { return LedgerChildElement.TemplateElement(this); } return ledgers.elementAt(multiplicity); } return null; }
Source:
<code>public void testSnapshotAfterEndOfPartition() throws Exception { VerifyRecordsDataOutput<Long> output = new VerifyRecordsDataOutput<>(); LongSerializer inSerializer = LongSerializer.INSTANCE; int numInputChannels = 1; StreamTestSingleInputGate<Long> inputGate = new StreamTestSingleInputGate<>(numInputChannels, 0, inSerializer, 1024); TestRecordDeserializer[] deserializers = IntStream.range(0, numInputChannels) .mapToObj(index -> new TestRecordDeserializer(ioManager.getSpillingDirectoriesPaths())) .toArray(TestRecordDeserializer[]::new); StreamTaskNetworkInput<Long> input = new StreamTaskNetworkInput<>( new CheckpointedInputGate( inputGate.getInputGate(), new CheckpointBarrierUnaligner( <START> new int[] { 1 }, <END> ChannelStateWriter.NO_OP, "test", new DummyCheckpointInvokable())), inSerializer, new StatusWatermarkValve(1, output), 0, deserializers); inputGate.sendEvent(new CheckpointBarrier(0, 0, CheckpointOptions.forCheckpointWithDefaultLocation()), 0); inputGate.sendElement(new StreamRecord<>(42L), 0); assertHasNextElement(input, output); assertHasNextElement(input, output); assertEquals(1, output.getNumberOfEmittedRecords()); inputGate.sendEvent(EndOfPartitionEvent.INSTANCE, 0); input.emitNext(output); assertNull(deserializers[0]); CompletableFuture<Void> completableFuture = input.prepareSnapshot(ChannelStateWriter.NO_OP, 0); completableFuture.join(); }</code><technical_language>1 -> numInputChannels</technical_language>

Target:
public void testSnapshotAfterEndOfPartition() throws Exception { int numInputChannels = 1; int channelId = 0; int checkpointId = 0; VerifyRecordsDataOutput<Long> output = new VerifyRecordsDataOutput<>(); LongSerializer inSerializer = LongSerializer.INSTANCE; StreamTestSingleInputGate<Long> inputGate = new StreamTestSingleInputGate<>(numInputChannels, 0, inSerializer, 1024); TestRecordDeserializer[] deserializers = IntStream.range(0, numInputChannels) .mapToObj(index -> new TestRecordDeserializer(ioManager.getSpillingDirectoriesPaths())) .toArray(TestRecordDeserializer[]::new); StreamTaskNetworkInput<Long> input = new StreamTaskNetworkInput<>( new CheckpointedInputGate( inputGate.getInputGate(), new CheckpointBarrierUnaligner( new int[] { numInputChannels }, ChannelStateWriter.NO_OP, "test", new DummyCheckpointInvokable())), inSerializer, new StatusWatermarkValve(numInputChannels, output), 0, deserializers); inputGate.sendEvent( new CheckpointBarrier(checkpointId, 0L, CheckpointOptions.forCheckpointWithDefaultLocation()), channelId); inputGate.sendElement(new StreamRecord<>(42L), channelId); assertHasNextElement(input, output); assertHasNextElement(input, output); assertEquals(1, output.getNumberOfEmittedRecords()); inputGate.sendEvent(EndOfPartitionEvent.INSTANCE, channelId); input.emitNext(output); assertNull(deserializers[channelId]); CompletableFuture<Void> completableFuture = input.prepareSnapshot(ChannelStateWriter.NO_OP, checkpointId); completableFuture.join(); }
Source:
<code>public Optional<LocalServer> getLocalServer() { <START> return Optional.ofNullable((LocalServer) theIntegratedServer); <END> }</code><technical_language>this</technical_language>

Target:
public Optional<LocalServer> getLocalServer() { return Optional.ofNullable((LocalServer) this.theIntegratedServer); }
Source:
<code><START> public List<Object> getJsonPatchOperations() { <END> return Collections.unmodifiableList(operations); }</code><technical_language>this return a List<JsonPatchOperation> instead</technical_language>

Target:
public List<JsonPatchOperation> getJsonPatchOperations() { return Collections.unmodifiableList(operations); }
Source:
<code>public ExchangeClient( DataSize bufferCapacity, DataSize maxResponseSize, int concurrentRequestMultiplier, Duration maxErrorDuration, boolean acknowledgePages, double responseSizeExponentialMovingAverageDecayingAlpha, HttpClient httpClient, ScheduledExecutorService scheduler, LocalMemoryContext systemMemoryContext, Executor pageBufferClientCallbackExecutor) { <START> checkArgument(responseSizeExponentialMovingAverageDecayingAlpha >= 0.0 && responseSizeExponentialMovingAverageDecayingAlpha <= 1.0, "averageBytesEMAALpha must be between 0 and 1: %s", responseSizeExponentialMovingAverageDecayingAlpha); <END> this.bufferCapacity = bufferCapacity.toBytes(); this.maxResponseSize = maxResponseSize; this.concurrentRequestMultiplier = concurrentRequestMultiplier; this.maxErrorDuration = maxErrorDuration; this.acknowledgePages = acknowledgePages; this.httpClient = httpClient; this.scheduler = scheduler; this.systemMemoryContext = systemMemoryContext; this.maxBufferRetainedSizeInBytes = Long.MIN_VALUE; this.pageBufferClientCallbackExecutor = requireNonNull(pageBufferClientCallbackExecutor, "pageBufferClientCallbackExecutor is null"); this.responseSizeExponentialMovingAverage = new ExponentialMovingAverage(responseSizeExponentialMovingAverageDecayingAlpha, DEFAULT_MAX_PAGE_SIZE_IN_BYTES); }</code><technical_language>s/averageBytesEMAALpha/responseSizeExponentialMovingAverageDecayingAlpha/</technical_language>

Target:
public ExchangeClient( DataSize bufferCapacity, DataSize maxResponseSize, int concurrentRequestMultiplier, Duration maxErrorDuration, boolean acknowledgePages, double responseSizeExponentialMovingAverageDecayingAlpha, HttpClient httpClient, ScheduledExecutorService scheduler, LocalMemoryContext systemMemoryContext, Executor pageBufferClientCallbackExecutor) { checkArgument(responseSizeExponentialMovingAverageDecayingAlpha >= 0.0 && responseSizeExponentialMovingAverageDecayingAlpha <= 1.0, "responseSizeExponentialMovingAverageDecayingAlpha must be between 0 and 1: %s", responseSizeExponentialMovingAverageDecayingAlpha); this.bufferCapacity = bufferCapacity.toBytes(); this.maxResponseSize = maxResponseSize; this.concurrentRequestMultiplier = concurrentRequestMultiplier; this.maxErrorDuration = maxErrorDuration; this.acknowledgePages = acknowledgePages; this.httpClient = httpClient; this.scheduler = scheduler; this.systemMemoryContext = systemMemoryContext; this.maxBufferRetainedSizeInBytes = Long.MIN_VALUE; this.pageBufferClientCallbackExecutor = requireNonNull(pageBufferClientCallbackExecutor, "pageBufferClientCallbackExecutor is null"); this.responseSizeExponentialMovingAverage = new ExponentialMovingAverage(responseSizeExponentialMovingAverageDecayingAlpha, DEFAULT_MAX_PAGE_SIZE_IN_BYTES); }
Source:
<code>public void run() { try { EntryDialog dialog = new EntryDialog("Override Commit", getText() + "\n\nEnter Reason"); if (dialog.open() == 0) { Result result = atsApi.getBranchService().getCommitOverrideOps().setCommitOverride(teamWf, branch, dialog.getEntry()); if (result.isFalse()) { <START> AWorkbench.popup(getText(), result.getText()); <END> } else if (commitManager != null) { commitManager.loadTable(); } } } catch (OseeCoreException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }</code><technical_language>need this line need send in commitManager</technical_language>

Target:
public void run() { try { EntryDialog dialog = new EntryDialog("Override Commit", getText() + "\n\nEnter Reason"); if (dialog.open() == 0) { Result result = atsApi.getBranchService().getCommitOverrideOps().setCommitOverride(teamWf, branch, dialog.getEntry()); if (result.isFalse()) { AWorkbench.popup(getText(), result.getText()); } } } catch (OseeCoreException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }
Source:
<code>public Mono<AccessToken> getToken(TokenRequestContext request) { if (pubClient == null) { try { PersistentTokenCacheAccessAspect accessAspect = new PersistentTokenCacheAccessAspect(); pubClient = PublicClientApplication.builder(this.clientId) .setTokenCacheAccessAspect(accessAspect) .build(); } catch (Exception e) { return Mono.error(e); } } return Mono.fromFuture(pubClient.getAccounts()) .flatMap(set -> { IAccount requestedAccount; Map<String, IAccount> accounts = new HashMap<>(); for (IAccount cached : set) { if (username == null || username.equals(cached.username())) { if (!accounts.containsKey(cached.homeAccountId())) { accounts.put(cached.homeAccountId(), cached); } } } if (accounts.size() == 0) { if (username == null) { <START> return Mono.error(new RuntimeException("SharedTokenCacheCredential authentication unavailable. No accounts were discovered in the cache.")); <END> } else { return Mono.error(new RuntimeException(String.format("SharedTokenCacheCredential authentication unavailable. No account " + "matching the specified %s was found in the cache.", username))); } } else if (accounts.size() > 1) { if (username == null) { return Mono.error(new RuntimeException("SharedTokenCacheCredential authentication unavailable. " + "Multiple accounts were found in the cache. Use username and tenant id to disambiguate.")); } else { return Mono.error(new RuntimeException(String.format("SharedTokenCacheCredential authentication unavailable. Multiple accounts matching the specified " + " %s were found in the cache.", username))); } } else { requestedAccount = accounts.values().iterator().next(); } SilentParameters params = SilentParameters.builder( new HashSet<>(request.getScopes()), requestedAccount).build(); CompletableFuture<IAuthenticationResult> future; try { future = pubClient.acquireTokenSilently(params); return Mono.fromFuture(() -> future).map(result -> new AccessToken(result.accessToken(), result.expiresOnDate().toInstant().atOffset(ZoneOffset.UTC))); } catch (MalformedURLException e) { e.printStackTrace(); return Mono.error(new RuntimeException("Token was not found")); } }); }</code><technical_language>This is removing instructions for user resolve/fix issue. instructions users updated resolve issue</technical_language>

Target:
public Mono<AccessToken> getToken(TokenRequestContext request) { return Mono.defer(() -> { if (cachedToken.get() != null) { return identityClient.authenticateWithPublicClientCache(request, cachedToken.get().getAccount()) .onErrorResume(t -> Mono.empty()); } else { return Mono.empty(); } }).switchIfEmpty( Mono.defer(() -> identityClient.authenticateWithSharedTokenCache(request, username))) .map(msalToken -> { cachedToken.set(msalToken); return msalToken; }); }
Source:
<code>protected abstract KeyStore keyStoreInstance() throws KeyStoreException; <START> private char[] passwordStringToCharArray(String password) { <END> return password == null ? EMPTY_CHAR_ARRAY : password.toCharArray(); }</code><technical_language>Nit: static</technical_language>

Target:
protected abstract KeyStore keyStoreInstance() throws KeyStoreException; private static char[] passwordStringToCharArray(String password) { return password == null ? EMPTY_CHAR_ARRAY : password.toCharArray(); }
Source:
<code>public HybridFile(OpenMode mode, String path, String name, boolean isDirectory) { this.mode = mode; if (path.startsWith("smb://") || isSmb()) { <START> if (!isDirectory) this.path = path + name; <END> else if (!name.endsWith("/")) this.path = path + name + "/"; else this.path = path + name; } else if(path.startsWith("ssh://") || isSftp()) { this.path = path + "/" + name; } else this.path = path + "/" + name; }</code><technical_language>reason for this</technical_language>

Target:
public HybridFile(OpenMode mode, String path, String name, boolean isDirectory) { this.mode = mode; if (path.startsWith("smb://") || isSmb()) { if (!isDirectory) this.path += name; else if (!name.endsWith("/")) this.path += name + "/"; else this.path += name; } else if(path.startsWith("ssh://") || isSftp()) { this.path += "/" + name; } else if (isRoot() && path.equals("/")) { this.path += name; } else { this.path += "/" + name; } }
Source:
<code>private boolean canConnect(VDS vds) { boolean returnValue = true; if (vds.getvds_type() == VDSType.VDS && Config.<Boolean> GetValue(ConfigValues.InstallVds)) { SSHClient sshclient = null; try { Long timeout = TimeUnit.SECONDS.toMillis(Config.<Integer> GetValue(ConfigValues.ConnectToServerTimeoutInSeconds)); sshclient = getSSHClient(); sshclient.setHardTimeout(timeout); sshclient.setSoftTimeout(timeout); sshclient.setHost(vds.gethost_name()); <START> sshclient.setUser("root"); <END> sshclient.setPassword(getParameters().getRootPassword()); sshclient.connect(); sshclient.authenticate(); } catch (Exception e) { log.errorFormat( "Failed to establish session with host {0}", vds.getvds_name(), e ); addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_CONNECT_TO_SERVER); returnValue = false; } finally { if (sshclient != null) { sshclient.disconnect(); } } } return returnValue; }</code><technical_language>consider a constant</technical_language>

Target:
private boolean canConnect(VDS vds) { boolean returnValue = true; if (vds.getvds_type() == VDSType.VDS && Config.<Boolean> GetValue(ConfigValues.InstallVds)) { SSHClient sshclient = null; try { Long timeout = TimeUnit.SECONDS.toMillis(Config.<Integer> GetValue(ConfigValues.ConnectToServerTimeoutInSeconds)); sshclient = getSSHClient(); sshclient.setHardTimeout(timeout); sshclient.setSoftTimeout(timeout); sshclient.setHost(vds.gethost_name()); sshclient.setUser(USER_NAME); sshclient.setPassword(getParameters().getRootPassword()); sshclient.connect(); sshclient.authenticate(); } catch (Exception e) { log.errorFormat( "Failed to establish session with host {0}", vds.getvds_name(), e ); addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_CONNECT_TO_SERVER); returnValue = false; } finally { if (sshclient != null) { sshclient.disconnect(); } } } return returnValue; }
Source:
<code>private void setFragmentBuilder() throws JClassAlreadyExistsException { <START> fragmentBuilderClass = generatedClass._class(PUBLIC | STATIC, "FragmentBuilder" + ModelConstants.generationSuffix()); <END> narrowBuilderClass = narrow(fragmentBuilderClass); generify(fragmentBuilderClass); JClass superClass = refClass(org.androidannotations.api.builder.FragmentBuilder.class); superClass = superClass.narrow(narrowBuilderClass, getAnnotatedClass()); fragmentBuilderClass._extends(superClass); fragmentArgumentsBuilderField = ref("args"); setFragmentBuilderBuild(); setFragmentBuilderCreate(); }</code><technical_language>IntentBuilder</technical_language>

Target:
private void setFragmentBuilder() throws JClassAlreadyExistsException { fragmentBuilderClass = generatedClass._class(PUBLIC | STATIC, "FragmentBuilder" + generationSuffix()); narrowBuilderClass = narrow(fragmentBuilderClass); generify(fragmentBuilderClass); JClass superClass = refClass(org.androidannotations.api.builder.FragmentBuilder.class); superClass = superClass.narrow(narrowBuilderClass, getAnnotatedClass()); fragmentBuilderClass._extends(superClass); fragmentArgumentsBuilderField = ref("args"); setFragmentBuilderBuild(); setFragmentBuilderCreate(); }
Source:
<code>public void analyzeSentimentBatchNullInput() { <START> StepVerifier.create(client.analyzeSentimentBatch(null, null, (TextAnalyticsRequestOptions) null)) <END> .verifyErrorSatisfies(exception -> { assertEquals(NullPointerException.class, exception.getClass()); assertTrue(INVALID_DOCUMENT_BATCH_NPE_MESSAGE.equals(exception.getMessage())); }); }</code><technical_language>Consider providing empty object</technical_language>

Target:
public void analyzeSentimentBatchNullInput() { StepVerifier.create(client.analyzeSentimentBatch(null, null, new TextAnalyticsRequestOptions())) .verifyErrorSatisfies(exception -> { assertEquals(NullPointerException.class, exception.getClass()); assertTrue(INVALID_DOCUMENT_BATCH_NPE_MESSAGE.equals(exception.getMessage())); }); }
Source:
<code>public byte[] getTextBytes(int fieldId) { <START> return new byte[0]; <END> }</code><technical_language>change static variable</technical_language>

Target:
public byte[] getTextBytes(int fieldId) { return NULL_TEXT_BYTES; }
Source:
<code>public void invalidateEmailLink() { FlowParameters flowParameters = getFlowParams(); flowParameters.emailLink = null; <START> setIntent(new Intent().putExtra(ExtraConstants.FLOW_PARAMS, <END> flowParameters)); }</code><technical_language>I safer start getIntent() override single extra want change, call setIntent() in case other in relying (or rely in future)</technical_language>

Target:
public void invalidateEmailLink() { FlowParameters flowParameters = getFlowParams(); flowParameters.emailLink = null; setIntent(getIntent().putExtra(ExtraConstants.FLOW_PARAMS, flowParameters)); }