auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitVarDeclaration(@NotNull GoVarDeclaration o) { super.visitVarDeclaration(o); for (GoVarSpec spec : o.getVarSpecList()) { checkVar(spec); } } @Override public void visitShortVarDeclaration(@NotNull GoShortVarDeclaration o) { super.visitShortVarDeclaration(o); checkVar(o); } @Override public void visitConstDeclaration(@NotNull GoConstDeclaration o) { super.visitConstDeclaration(o); for (GoConstSpec spec : o.getConstSpecList()) { checkConst(spec); } } private void checkVar(@NotNull GoVarSpec spec) { if (spec.getType() != null) return; checkExpressions(spec.getRightExpressionsList()); } private void checkConst(@NotNull GoConstSpec spec) { if (spec.getType() != null) return; checkExpressions(spec.getExpressionList()); } private void checkExpressions(@NotNull List<GoExpression> expressions) { for (GoExpression expr : expressions) { ProgressManager.checkCanceled(); if (expr instanceof GoReferenceExpressionImpl) { GoReferenceExpressionImpl ref = (GoReferenceExpressionImpl)expr; PsiElement resolve = ref.resolve(); if (ref.getIdentifier().textMatches(GoConstants.NIL) && resolve != null && GoPsiImplUtil.builtin(resolve)) { holder.registerProblem(expr, "Cannot assign nil without explicit type", GENERIC_ERROR_OR_WARNING); } } } } }; }

Target:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitVarDeclaration(@NotNull GoVarDeclaration o) { for (GoVarSpec spec : o.getVarSpecList()) { checkVar(spec); } } @Override public void visitShortVarDeclaration(@NotNull GoShortVarDeclaration o) { checkVar(o); } @Override public void visitConstDeclaration(@NotNull GoConstDeclaration o) { for (GoConstSpec spec : o.getConstSpecList()) { checkConst(spec); } } private void checkVar(@NotNull GoVarSpec spec) { if (spec.getType() != null) return; checkExpressions(spec.getRightExpressionsList()); } private void checkConst(@NotNull GoConstSpec spec) { if (spec.getType() != null) return; checkExpressions(spec.getExpressionList()); } private void checkExpressions(@NotNull List<GoExpression> expressions) { for (GoExpression expr : expressions) { ProgressManager.checkCanceled(); if (expr instanceof GoReferenceExpressionImpl) { GoReferenceExpressionImpl ref = (GoReferenceExpressionImpl)expr; PsiElement resolve = ref.resolve(); if (ref.getIdentifier().textMatches(GoConstants.NIL) && resolve != null && GoPsiImplUtil.builtin(resolve)) { holder.registerProblem(expr, "Cannot assign nil without explicit type", GENERIC_ERROR_OR_WARNING); } } } } }; }
Source:
public MarketHistory(Market market) { super(); this.market = market; history = new HashMap<String, List<Double>>(); }

Target:
public MarketHistory(Market market) { this.market = market; history = new HashMap<String, List<Double>>(); }
Source:
public int double getScreenWidth() { return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth(); }

Target:
public int getScreenWidth() { return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth(); }
Source:
public void commit() throws IOException { if (basicFuture != null) { long beforeWait = System.currentTimeMillis(); try { JestResult result = basicFuture.get(); if (result == null) { throw new RuntimeException(); } long msWaited = System.currentTimeMillis() - beforeWait; LOG.info("Previous took in ms " + millis + ", including wait " + msWaited); } catch (InterruptedException | ExecutionException e) { LOG.error("Error waiting for result ", e); } basicFuture = null; } if (bulkBuilder != null) { if (bulkDocs > 0) { basicFuture = new BasicFuture<>(null); millis = System.currentTimeMillis(); client.executeAsync(bulkBuilder.build(), new JestResultHandler<BulkResult>() { @Override public void completed(BulkResult bulkResult) { basicFuture.completed(bulkResult); millis = System.currentTimeMillis() - millis; } @Override public void failed(Exception e) { basicFuture.completed(null); LOG.error("Failed result: ", e); } }); } bulkBuilder = null; } if (createNewBulk) { bulkBuilder = new Bulk.Builder() .defaultIndex(defaultIndex) .defaultType(defaultType); bulkDocs = 0; bulkLength = 0; } }

Target:
public void commit() throws IOException { if (basicFuture != null) { long beforeWait = System.currentTimeMillis(); try { JestResult result = basicFuture.get(); if (result == null) { throw new RuntimeException(); } long msWaited = System.currentTimeMillis() - beforeWait; LOG.info("Previous took in ms {}, including wait {}", millis, msWaited); } catch (InterruptedException | ExecutionException e) { LOG.error("Error waiting for result ", e); } basicFuture = null; } if (bulkBuilder != null) { if (bulkDocs > 0) { basicFuture = new BasicFuture<>(null); millis = System.currentTimeMillis(); client.executeAsync(bulkBuilder.build(), new JestResultHandler<BulkResult>() { @Override public void completed(BulkResult bulkResult) { basicFuture.completed(bulkResult); millis = System.currentTimeMillis() - millis; } @Override public void failed(Exception e) { basicFuture.completed(null); LOG.error("Failed result: ", e); } }); } bulkBuilder = null; } if (createNewBulk) { bulkBuilder = new Bulk.Builder().defaultIndex(defaultIndex) .defaultType(defaultType); bulkDocs = 0; bulkLength = 0; } }
Source:
@Override public OutputStream openOutputStream() { return stream; }

Target:
@Override public OutputStream openOutputStream() throws IOException { Path parent = path.getParent(); if (!Files.exists(parent)) fileSystemProvider.createDirectory(parent); return fileSystemProvider.newOutputStream(path); }
Source:
public StringBuilder getNegatedQuery() { StringBuilder builder = new StringBuilder(); int counter = 1; builder.append( "(" ); for ( Predicate<StringBuilder> child : children ) { builder.append( ( (NegatablePredicate<StringBuilder>) child ).getNegatedQuery() ); builder.append( ")" ); if ( counter++ < children.size() ) { builder.append( " and (" ); } } return builder; }

Target:
public InfinispanRemoteQueryBuilder getNegatedQuery() { return new InfinispanRemoteQueryBuilder( "and", true, children ); }
Source:
public boolean isSameRM(XAResource xares) throws XAException { log.infof("isSameRM returning false to xares: %s", xares); return false; }

Target:
public boolean isSameRM(XAResource xares) throws XAException { log.tracef("isSameRM returning false to xares: %s", xares); return false; }
Source:
public void setter_nonLatinFieldName() { RealmConfiguration config = configFactory.createConfigurationBuilder().name("greekWTF").schema(NonLatinFieldNames.class).build(); Realm realm = Realm.getInstance(config); try { realm.beginTransaction(); RealmObjectSchema schema = realm.getSchema().get(NonLatinFieldNames.class.getSimpleName()); schema.getFieldType("델타"); NonLatinFieldNames obj = realm.createObject(NonLatinFieldNames.class); obj.setΔέλτα(0); realm.commitTransaction(); } finally { realm.close(); } }

Target:
public void setter_nonLatinFieldName() { realm.beginTransaction(); NonLatinFieldNames obj = realm.createObject(NonLatinFieldNames.class); obj.setΔέλτα(42); realm.commitTransaction(); }
Source:
protected void initShareFragment(boolean afterLogin) { ShareIntentReceiverFragment shareIntentReceiverFragment = ShareIntentReceiverFragment .newInstance(!isSharingText(), loadLastUsedBlogLocalId(), afterLogin); getSupportFragmentManager() .beginTransaction() .replace(R.id.fragment_container, shareIntentReceiverFragment, ShareIntentReceiverFragment.TAG) .commit(); }

Target:
private void initShareFragment(boolean afterLogin) { ShareIntentReceiverFragment shareIntentReceiverFragment = ShareIntentReceiverFragment .newInstance(!isSharingText(), loadLastUsedBlogLocalId(), afterLogin); getSupportFragmentManager() .beginTransaction() .replace(R.id.fragment_container, shareIntentReceiverFragment, ShareIntentReceiverFragment.TAG) .commit(); }
Source:
public void deleteUser(String username) { throw new RuntimeException("Deleting a user is not supporting in LDAP"); }

Target:
public void deleteUser(String username) { throw new UnsupportedOperationException("Deleting a user is not supporting in LDAP"); }
Source:
private void drawVariables(List<UserVariable> variableList, Batch batch) { if (variableList == null) { return; } if (variableToShow.isDummy()) { drawText(batch, Utils.getStringfromResource(R.string.no_variable_selected), xPosition, yPosition, color); } else { for (UserVariable variable : variableList) { if (variable.getName().equals(variableToShow.getName())) { String variableValue = variable.getValue().toString(); if (variable.getVisible()) { if (isNumberAndInteger(variableValue)) { drawText(batch, variableValueWithoutDecimal, xPosition, yPosition, color); } else { drawText(batch, variableValue, xPosition, yPosition, color); } } break; } } } }

Target:
private void drawVariables(List<UserVariable> variableList, Batch batch) { if (variableList == null) { return; } if (variableToShow.isDummy()) { drawText(batch, Utils.getStringfromResource(R.string.no_variable_selected), xPosition, yPosition, color); } else { for (UserVariable variable : variableList) { if (variable.getName().equals(variableToShow.getName())) { String variableValue = variable.getValue().toString(); if (variable.getVisible()) { if (isNumberAndInteger(variableValue)) { drawText(batch, variableValueWithoutDecimal, xPosition, yPosition, color); } else if (variableValue.isEmpty()) { return; } else { drawText(batch, variableValue, xPosition, yPosition, color); } } break; } } } }
Source:
public static void ensureZkDirectoryStructureExists(Directory rootDir, String basePath) throws KeeperException, InterruptedException { ensureBasePathExists(rootDir, basePath); PathBuilder pathMgr = new PathBuilder(basePath); for (String path : Setup.getTopLevelPaths(pathMgr)) { if (!rootDir.has(path)) { rootDir.ensureHas(path, null); } } if (!rootDir.has(pathMgr.getVniCounterPath())) { rootDir.ensureHas(pathMgr.getVniCounterPath(), Integer.toString(MIN_VNI).getBytes()); } if (!rootDir.has(pathMgr.getWriteVersionPath())) { rootDir.ensureHas(pathMgr.getWriteVersionPath(), DataWriteVersion.CURRENT.getBytes()); } }

Target:
public static void ensureZkDirectoryStructureExists(Directory rootDir, String basePath) throws KeeperException, InterruptedException { ensureBasePathExists(rootDir, basePath); PathBuilder pathMgr = new PathBuilder(basePath); for (String path : Setup.getTopLevelPaths(pathMgr)) { rootDir.ensureHas(path, null); } rootDir.ensureHas(pathMgr.getVniCounterPath(), Integer.toString(MIN_VNI).getBytes()); rootDir.ensureHas(pathMgr.getWriteVersionPath(), DataWriteVersion.CURRENT.getBytes()); }
Source:
public void deregesterSpecialPathSet( SpecialPathSet pathSet ) { if ( !pkgtypes.containsKey( pathSet.getPackageType() ) ) { logger.warn( "[Galley] The package does not contain the path set for this package type {}, no deregister operation there", pathSet.getPackageType() ); } pkgtypes.remove( pathSet.getPackageType() ); }

Target:
public SpecialPathSet deregesterSpecialPathSet( SpecialPathSet pathSet ) { if ( !pkgtypes.containsKey( pathSet.getPackageType() ) ) { logger.warn( "[Galley] The package does not contain the path set for this package type {}, no deregister operation there", pathSet.getPackageType() ); } return pkgtypes.remove( pathSet.getPackageType() ); }
Source:
public void testNonCyclicHashFunction() { HashFunctionIdentity hfi = new HashFunctionIdentity() { @Override public String getName() { return "Testing-NonCyclic-Hash"; } @Override public ProcessType getProcessType() { return ProcessType.ITERATIVE; } @Override public String getProvider() { return "Apache Commons Collection Testing"; } @Override public long getSignature() { return 0; } @Override public Signedness getSignedness() { return Signedness.SIGNED; } }; try { new CachingHasher(hfi, new long[][] { { 1, 4 }, { 3, 6 } }); fail("Should have thrown exception"); } catch (IllegalArgumentException expected) { } }

Target:
public void testNonCyclicHashFunction() { HashFunctionIdentity hfi = new HashFunctionIdentityImpl("Apache Commons Collection Testing", "Testing-NonCyclic-Hash", Signedness.SIGNED, ProcessType.ITERATIVE, 0 ); try { new CachingHasher(hfi, new long[][] { { 1, 4 }, { 3, 6 } }); fail("Should have thrown exception"); } catch (IllegalArgumentException expected) { } }
Source:
public void run() { connectionTimeout = config.getConnectionTimeout(); poolElf.setValidationTimeout(config.getValidationTimeout()); leakTask.updateLeakDetectionThreshold(config.getLeakDetectionThreshold()); final long now = clockSource.currentTime(); final long idleTimeout = config.getIdleTimeout(); if (now < previous || now > clockSource.plusMillis(previous, (2 * HOUSEKEEPING_PERIOD_MS))) { LOGGER.warn("{} - Unusual system clock change detected, soft-evicting connections from pool.", poolName); previous = now; softEvictConnections(); fillPool(); return; } previous = now; logPoolState("Before cleanup\t"); if(idleTimeout > 0L) { final List<PoolBagEntry> bag = connectionBag.values(STATE_NOT_IN_USE); int removable = bag.size() - config.getMinimumIdle(); if (removable > 0) { for (PoolBagEntry bagEntry : bag) { if (clockSource.elapsedMillis(bagEntry.lastAccess, now) > idleTimeout) { if (connectionBag.reserve(bagEntry)) { closeConnection(bagEntry, "(connection passed idleTimeout)"); removable--; } } } } } logPoolState("After cleanup\t"); fillPool(); }

Target:
public void run() { connectionTimeout = config.getConnectionTimeout(); poolElf.setValidationTimeout(config.getValidationTimeout()); leakTask.updateLeakDetectionThreshold(config.getLeakDetectionThreshold()); final long now = clockSource.currentTime(); final long idleTimeout = config.getIdleTimeout(); if (now < previous || now > clockSource.plusMillis(previous, (2 * HOUSEKEEPING_PERIOD_MS))) { LOGGER.warn("{} - Unusual system clock change detected, soft-evicting connections from pool.", poolName); previous = now; softEvictConnections(); fillPool(); return; } previous = now; if (idleTimeout > 0L) { logPoolState("Before cleanup\t"); final List<PoolBagEntry> bag = connectionBag.values(STATE_NOT_IN_USE); int removable = bag.size() - config.getMinimumIdle(); for (PoolBagEntry bagEntry : bag) { if (removable <= 0) { break; } if (clockSource.elapsedMillis(bagEntry.lastAccess, now) > idleTimeout) { if (connectionBag.reserve(bagEntry)) { closeConnection(bagEntry, "(connection passed idleTimeout)"); removable--; } } } logPoolState("After cleanup\t"); } fillPool(); }
Source:
public void endOfAnalysis() { if(!classesNotFound.isEmpty()) { LOG.warn("Classes not found during the analysis : {}", classesNotFound.stream().collect(Collectors.joining(", "))); } }

Target:
public void endOfAnalysis() { if(!classesNotFound.isEmpty()) { String message = ""; if(classesNotFound.size() > 50) { message = ", ..."; } LOG.warn("Classes not found during the analysis : [{}{}]", classesNotFound.stream().limit(50).collect(Collectors.joining(", ")), message); } }
Source:
private void saveProcess(Process process) { try { serviceManager.getProcessService().save(process); } catch (DataException e) { Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Error while saving process: " + process.getTitle(), e); logger.error(KITODO_SCRIPT_FIELD + "Error while saving process: " + process.getTitle(), e); } }

Target:
private void saveProcess(Process process) { try { serviceManager.getProcessService().save(process); } catch (DataException e) { logger.error(KITODO_SCRIPT_FIELD + "Error while saving process: " + process.getTitle(), e); Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Error while saving process: " + process.getTitle(), e); } }
Source:
private static void checkModulusAndResidue(int residue, int modulus) { Preconditions.checkArgument(modulus > 0, "Modulus should be positive, but found %s.", modulus); Preconditions.checkArgument(Math.abs(residue) < modulus, "Absolute value of residue %s equals or exceeds modulus %s - no solutions", residue, modulus); }

Target:
private static void checkModulusAndResidue(int residue, int modulus) { Preconditions.checkArgument(modulus > 0, "Modulus should be positive, but found %s.", modulus); Preconditions.checkArgument(Math.abs((long) residue) < modulus, "Absolute value of residue %s equals or exceeds modulus %s - no solutions", residue, modulus); }
Source:
private boolean isRunningInAuthProcess() { try { String procName = ""; int pid = android.os.Process.myPid(); final ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); final List<RunningAppProcessInfo> processInfos = manager.getRunningAppProcesses(); if (processInfos != null) { for (final RunningAppProcessInfo procInfo : processInfos) { if (procInfo != null && procInfo.pid == pid) { procName = procInfo.processName; } } } if (procName.endsWith(":auth")) { return true; } } catch (Exception e) { Log.e("SalesforceSDKManager:isRunningInAuthProcess", "Exception occurred while getting process name.", e); } return false; }

Target:
private boolean isRunningInAuthProcess() { try { String procName = ""; int pid = android.os.Process.myPid(); final ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); final List<RunningAppProcessInfo> processInfos = manager.getRunningAppProcesses(); if (processInfos != null) { for (final RunningAppProcessInfo procInfo : processInfos) { if (procInfo != null && procInfo.pid == pid) { procName = procInfo.processName; break; } } } if (procName.endsWith(":auth")) { return true; } } catch (Exception e) { Log.e("SalesforceSDKManager:isRunningInAuthProcess", "Exception occurred while getting process name.", e); } return false; }
Source:
public int hashCode() { int result = _networkDomainUuid != null ? _networkDomainUuid.hashCode() : 0; result = 31 * result + (_networkUuid != null ? _networkUuid.hashCode() : 0); result = 31 * result + (_vpcOrSubnetUuid != null ? _vpcOrSubnetUuid.hashCode() : 0); result = 31 * result + (_isL3Network ? 1 : 0); result = 31 * result + (_isVpc ? 1 : 0); result = 31 * result + (_staticNatDetails != null ? _staticNatDetails.hashCode() : 0); return result; }

Target:
public int hashCode() { int result = super.hashCode(); result = 31 * result + (_networkDomainUuid != null ? _networkDomainUuid.hashCode() : 0); result = 31 * result + (_networkUuid != null ? _networkUuid.hashCode() : 0); result = 31 * result + (_vpcOrSubnetUuid != null ? _vpcOrSubnetUuid.hashCode() : 0); result = 31 * result + (_isL3Network ? 1 : 0); result = 31 * result + (_isVpc ? 1 : 0); result = 31 * result + (_staticNatDetails != null ? _staticNatDetails.hashCode() : 0); return result; }
Source:
protected Connection compute() { try { builder.connectionFactory.setBrokerURL("failover:("+builder.addresses+")?initialReconnectDelay=100"); connection = builder.connectionFactory.createConnection(); Session session=connection.createSession(false, Session.AUTO_ACKNOWLEDGE); connection.start(); Destination destination = session.createQueue(builder.queue); MessageConsumer messageConsumer = session.createConsumer(destination); Collector collector = builder.delegate.build(); CollectorMetrics metrics = builder.metrics; messageConsumer.setMessageListener(new ActiveMQSpanConsumerMessageListener(collector,metrics)); }catch (Exception e){ throw new IllegalStateException("Unable to establish connection to ActiveMQ server", e); } return connection; }

Target:
protected Connection compute() { try { builder.connectionFactory.setBrokerURL("failover:("+builder.addresses+")?initialReconnectDelay=100&maxReconnectAttempts=10"); connection = builder.connectionFactory.createConnection(); connection.start(); Session session=connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Destination destination = session.createQueue(builder.queue); MessageConsumer messageConsumer = session.createConsumer(destination); Collector collector = builder.delegate.build(); CollectorMetrics metrics = builder.metrics; messageConsumer.setMessageListener(new ActiveMQSpanConsumerMessageListener(collector,metrics)); }catch (JMSException e){ throw new IllegalStateException("Unable to establish connection to ActiveMQ server", e); } return connection; }
Source:
public TermFilter(final String term, final Integer minShouldMatch, final boolean fuzzy, final boolean exact, final boolean parsed) { this.term = term; this.minShouldMatch = minShouldMatch; this.fuzzy = fuzzy; this.exact = exact; this.parsed = parsed; }

Target:
public TermFilter(final String term, final Integer minShouldMatch, final boolean fuzzy, final boolean exact, final boolean parsed) { if (term == null) { throw new BadRequestException("'term' filter parameter was null."); } this.term = term.trim(); this.minShouldMatch = minShouldMatch; this.fuzzy = fuzzy; this.exact = exact; this.parsed = parsed; }
Source:
public CircleMenu(Block block) { super((StackPane) block, null); this.block = block; ImageView image = new ImageView(new Image(this.getClass().getResourceAsStream("/ui/cut32.png"))); image.getStyleClass().add("hoverMenu"); MenuItem delete = new MenuItem("cut", image); delete.setOnAction(t -> delete()); image = new ImageView(new Image(this.getClass().getResourceAsStream("/ui/copy32.png"))); image.getStyleClass().add("hoverMenu"); MenuItem copy = new MenuItem("copy", image); copy.setOnAction(t -> copy()); image = new ImageView(new Image(this.getClass().getResourceAsStream("/ui/paste32.png"))); image.getStyleClass().add("hoverMenu"); MenuItem paste = new MenuItem("paste", image); paste.setOnAction(t -> paste()); image = new ImageView(new Image(this.getClass().getResourceAsStream("/ui/save32.png"))); image.getStyleClass().add("hoverMenu"); MenuItem save = new MenuItem("save", image); save.setOnAction(t -> saveBlock()); this.getItems().addAll(copy, paste, delete, save); this.setAnimationInterpolation(CircularPane::animateOverTheArcWithFade); this.setAnimationDuration(Duration.ONE); }

Target:
public CircleMenu(Block block) { super((StackPane) block, null); this.block = block; ImageView image = makeImageView("/ui/cut32.png"); MenuItem delete = new MenuItem("cut", image); delete.setOnAction(t -> delete()); image = makeImageView("/ui/copy32.png"); MenuItem copy = new MenuItem("copy", image); copy.setOnAction(t -> copy()); image = makeImageView("/ui/paste32.png"); MenuItem paste = new MenuItem("paste", image); paste.setOnAction(t -> paste()); image = makeImageView("/ui/save32.png"); MenuItem save = new MenuItem("save", image); save.setOnAction(t -> saveBlock()); this.getItems().addAll(copy, paste, delete, save); this.setAnimationInterpolation(CircularPane::animateOverTheArcWithFade); this.setAnimationDuration(Duration.ONE); }
Source:
public void generateRequest(final Ds3Request ds3Request) throws IOException, TemplateException { Template requestTemplate = null; Request request = null; System.out.println("Generating Request[" + ds3Request.getName() + "]"); if (ds3Request.getClassification() == Classification.amazons3) { request = RequestConverter.toRequest(ds3Request); System.out.println("Loading template AmazonS3InitRequestHandler.tmplt"); requestTemplate = config.getTemplate("AmazonS3InitRequestHandler.tmplt"); System.out.println("Template loaded!"); } else if (ds3Request.getClassification() == Classification.spectrads3) { System.out.println("AmazonS3 request"); } else if (ds3Request.getClassification() == Classification.spectrainternal) { System.out.println("Spectra internal request"); } else { throw new TemplateException("Unknown dDs3Request Classification: " + ds3Request.getClassification().toString(), Environment.getCurrentEnvironment()); } final Path outputPath = getOutputPath(request); System.out.println("outputPath[" + outputPath.toString() + "]"); final OutputStream outStream = fileUtils.getOutputFile(outputPath); final Writer writer = new OutputStreamWriter(outStream); try { requestTemplate.process(request, writer); } catch ( NullPointerException e) { System.out.println("Encountered NullPointerException while processing template " + requestTemplate.getName()); e.printStackTrace(); } }

Target:
public void generateRequest(final Ds3Request ds3Request) throws IOException, TemplateException { Template requestTemplate = null; Request request = null; if (ds3Request.getClassification() == Classification.amazons3) { request = RequestConverter.toRequest(ds3Request); System.out.println("Loading template AmazonS3InitRequestHandler.tmplt"); requestTemplate = config.getTemplate("AmazonS3InitRequestHandler.tmplt"); System.out.println("Template loaded!"); } else if (ds3Request.getClassification() == Classification.spectrads3) { System.out.println("AmazonS3 request"); } else if (ds3Request.getClassification() == Classification.spectrainternal) { System.out.println("Spectra internal request"); } else { throw new TemplateException("Unknown dDs3Request Classification: " + ds3Request.getClassification().toString(), Environment.getCurrentEnvironment()); } final Path outputPath = getOutputPath(request); final OutputStream outStream = fileUtils.getOutputFile(outputPath); final Writer writer = new OutputStreamWriter(outStream); try { requestTemplate.process(request, writer); } catch (final NullPointerException e) { System.out.println("Encountered NullPointerException while processing template " + requestTemplate.getName()); e.printStackTrace(); } }
Source:
keyExtractor(Function<IStatistics<@NonNull ISegment>, E> segExtractor, Function<M, E> modelExtractor) { return new Function<TmfTreeViewerEntry, E>() { @Override public E apply(TmfTreeViewerEntry entry) { if (entry instanceof SegmentStoreStatisticsEntry) { return segExtractor.apply(((SegmentStoreStatisticsEntry) entry).getEntry()); } else if (entry instanceof TmfGenericTreeEntry) { return modelExtractor.apply(((TmfGenericTreeEntry<M>) entry).getModel()); } return (E) UNCOMPARABLE; } }; }

Target:
keyExtractor(Function<IStatistics<@NonNull ISegment>, E> segExtractor, Function<M, E> modelExtractor) { return new Function<TmfTreeViewerEntry, E>() { @Override public E apply(TmfTreeViewerEntry entry) { if (entry instanceof SegmentStoreStatisticsEntry) { return segExtractor.apply(((SegmentStoreStatisticsEntry) entry).getEntry()); } else if (entry instanceof TmfGenericTreeEntry) { return modelExtractor.apply(((TmfGenericTreeEntry<M>) entry).getModel()); } return (E) (Comparable<E>) o -> 0; } }; }
Source:
public boolean syncDiskCheck(final CacheKey key){ if(containsSync(key)){ return true; } EncodedImage result = mStagingArea.get(key); if (result != null) { result.close(); FLog.v(TAG, "Found image for %s in staging area", key.toString()); mImageCacheStatsTracker.onStagingAreaHit(); return true; } else { FLog.v(TAG, "Did not find image for %s in staging area", key.toString()); mImageCacheStatsTracker.onStagingAreaMiss(); try { return mFileCache.hasKey(key); } catch (Exception exception) { return false; } } }

Target:
public boolean syncDiskCheck(final CacheKey key) { if(containsSync(key)) { return true; } return checkInStagingAreaAndFileCache(key); }
Source:
public void setOldClusterVersionOfSnapshotWithMemory(VM vm) { if (!isVMWithMemoryCompatible(vm)) { Version originalClusterVersion = vm.getClusterCompatibilityVersionOrigin(); originalClusterVersion = (originalClusterVersion == null) ? Version.v4_2 : originalClusterVersion; oldClusterVersionOfSnapshotWithMemory = originalClusterVersion; } else { oldClusterVersionOfSnapshotWithMemory = null; } }

Target:
public void setOldClusterVersionOfSnapshotWithMemory(VM vm) { if (!isVMWithMemoryCompatible(vm)) { Version originalClusterVersion = vm.getClusterCompatibilityVersionOrigin(); originalClusterVersion = (originalClusterVersion == null) ? Version.getLowest() : originalClusterVersion; oldClusterVersionOfSnapshotWithMemory = originalClusterVersion; } else { oldClusterVersionOfSnapshotWithMemory = null; } }
Source:
private List<String> importOpenApiDefinition(final Scheme defaultScheme, final String defaultHost, final String defn, final String hostOverride, final boolean initViaUi) { final List<String> errors = new ArrayList<String>(); Thread t = new Thread(THREAD_PREFIX + threadId++) { @Override public void run() { try { Requestor requestor = new Requestor(HttpSender.MANUAL_REQUEST_INITIATOR); requestor.setSiteOverride(hostOverride); requestor.addListener(new HistoryPersister()); SwaggerConverter converter = new SwaggerConverter( defaultScheme, StringUtils.isNotEmpty(hostOverride) ? hostOverride : defaultHost, defn, getValueGenerator()); errors.addAll(requestor.run(converter.getRequestModels())); errors.addAll(converter.getErrorMessages()); if (errors.size() > 0) { logErrors(errors, initViaUi); if (initViaUi) { View.getSingleton().showWarningDialog(Constant.messages.getString("openapi.parse.warn")); } } else { if (initViaUi) { View.getSingleton().showMessageDialog(Constant.messages.getString("openapi.parse.ok")); } } } catch (Exception e) { if (initViaUi) { View.getSingleton().showWarningDialog(Constant.messages.getString("openapi.parse.error", e.getMessage())); } logErrors(errors, initViaUi); LOG.warn(e.getMessage(), e); } } }; t.start(); if (! initViaUi) { try { t.join(); } catch (InterruptedException e) { LOG.debug(e.getMessage(), e); } return errors; } return null; }

Target:
private List<String> importOpenApiDefinition(final Scheme defaultScheme, final String defaultHost, final String defn, final String hostOverride, final boolean initViaUi) { final List<String> errors = new ArrayList<String>(); Thread t = new Thread(THREAD_PREFIX + threadId++) { @Override public void run() { try { Requestor requestor = new Requestor(HttpSender.MANUAL_REQUEST_INITIATOR); requestor.setSiteOverride(hostOverride); requestor.addListener(new HistoryPersister()); SwaggerConverter converter = new SwaggerConverter( defaultScheme, StringUtils.isNotEmpty(hostOverride) ? hostOverride : defaultHost, defn, getValueGenerator()); errors.addAll(requestor.run(converter.getRequestModels())); errors.addAll(converter.getErrorMessages()); if (errors.size() > 0) { logErrors(errors, initViaUi); if (initViaUi) { View.getSingleton().showWarningDialog(Constant.messages.getString("openapi.parse.warn")); } } else { if (initViaUi) { View.getSingleton().showMessageDialog(Constant.messages.getString("openapi.parse.ok")); } } } catch (Exception e) { if (initViaUi) { String exMsg = e.getLocalizedMessage(); exMsg = exMsg.length() >= 125 ? exMsg.substring(0, 122) + "..." : exMsg; View.getSingleton().showWarningDialog(Constant.messages.getString("openapi.parse.error", exMsg) + "\n\n" + Constant.messages.getString("openapi.parse.trailer")); } logErrors(errors, initViaUi); LOG.warn(e.getMessage(), e); } } }; t.start(); if (! initViaUi) { try { t.join(); } catch (InterruptedException e) { LOG.debug(e.getMessage(), e); } return errors; } return null; }
Source:
private void populateViews(final View view, final AssignmentAward award) { final String titleString = getString(AssignmentStringMap.get(assignmentAward.getUniqueName())); TextView titleView = ((TextView) view.findViewById(R.id.title)); setTitle(titleView, titleString); populateOverviewBox(view, award); if (assignment.getPrerequisites().size() > 0) { populatePreRequisites(view); populateAwardRequirements(view); populateRewardBox(view); } else { final ViewGroup containerView = (ViewGroup) view.findViewById(R.id.assignment_prereq_container); containerView.removeAllViews(); final View tempView = layoutInflater.inflate(R.layout.list_item_assignment_prereq, containerView, false); containerView.addView(populatePreRequisite(tempView, fetchPrerequisiteForExpansion())); view.findViewById(R.id.wrap_assignment_tasks).setVisibility(View.GONE); view.findViewById(R.id.wrap_assignment_rewards).setVisibility(View.GONE); } }

Target:
private void populateViews(final View view, final AssignmentAward award) { final String titleString = getString(AssignmentStringMap.get(assignmentAward.getUniqueName())); TextView titleView = ((TextView) view.findViewById(R.id.title)); setTitle(titleView, titleString); populateOverviewBox(view, award); if (assignment.getPrerequisites().size() > 0) { populatePreRequisites(view); populateAwardRequirements(view); populateRewardBox(view); } else if(assignmentAward.getCode().startsWith("SP_")) { view.findViewById(R.id.wrap_assignment_prereq).setVisibility(View.GONE); populateAwardRequirements(view); populateRewardBox(view); } else { final ViewGroup containerView = (ViewGroup) view.findViewById(R.id.assignment_prereq_container); containerView.removeAllViews(); final View tempView = layoutInflater.inflate(R.layout.list_item_assignment_prereq, containerView, false); containerView.addView(populatePreRequisite(tempView, fetchPrerequisiteForExpansion())); view.findViewById(R.id.wrap_assignment_tasks).setVisibility(View.GONE); view.findViewById(R.id.wrap_assignment_rewards).setVisibility(View.GONE); } }
Source:
public void testQueryMaxSpillPerNodeLimit() throws Exception { Map<String, String> properties = ImmutableMap.<String, String>builder() .put("experimental.spiller-spill-path", spillPath.getAbsolutePath()) .put("experimental.spill-enabled", "true") .put("experimental.operator-memory-limit-before-spill", "1B") .put("experimental.query-max-spill-per-node", "10B") .put("experimental.spiller-max-used-space-threshold", "1.0") .build(); try (QueryRunner queryRunner = createLocalQueryRunner( new NodeSpillConfig().setQueryMaxSpillPerNode(DataSize.succinctBytes(10)))) { queryRunner.execute(queryRunner.getDefaultSession(), "SELECT COUNT(DISTINCT clerk) as count, orderdate FROM orders GROUP BY orderdate ORDER BY count, orderdate"); } }

Target:
public void testQueryMaxSpillPerNodeLimit() throws Exception { Map<String, String> properties = ImmutableMap.<String, String>builder() .put("experimental.spiller-spill-path", spillPath.getAbsolutePath()) .put("experimental.spill-enabled", "true") .put("experimental.aggregation-operator-unspill-memory-limit", "1B") .put("experimental.query-max-spill-per-node", "10B") .put("experimental.spiller-max-used-space-threshold", "1.0") .build(); try (QueryRunner queryRunner = createLocalQueryRunner(new NodeSpillConfig().setQueryMaxSpillPerNode(DataSize.succinctBytes(10)))) { queryRunner.execute(queryRunner.getDefaultSession(), "SELECT COUNT(DISTINCT clerk) as count, orderdate FROM orders GROUP BY orderdate ORDER BY count, orderdate"); } }
Source:
static void writeConfiguration(XMLExtendedStreamWriter writer, ModelNode config) throws XMLStreamException { for (AttributeDefinition def : ModClusterConfigResourceDefinition.ATTRIBUTES) { if (def instanceof StringListAttributeDefinition) { def.getAttributeMarshaller().marshallAsAttribute(def, config, false, writer); } else { def.getAttributeMarshaller().marshallAsAttribute(def, config, true, writer); } } }

Target:
static void writeConfiguration(XMLExtendedStreamWriter writer, ModelNode config) throws XMLStreamException { for (AttributeDefinition def : ModClusterConfigResourceDefinition.ATTRIBUTES) { def.getAttributeMarshaller().marshallAsAttribute(def, config, true, writer); } }
Source:
private void readInternal() throws IOException { while (next == 0) { byte[] header = new byte[8]; int todo = 8; while (todo > 0) { int i = multiplexed.read(header, 8-todo, todo); if (i < 0) return; todo -= i; } int size = ((header[4] & 0xff) << 24) + ((header[5] & 0xff) << 16) + ((header[6] & 0xff) << 8) + (header[7] & 0xff); switch (header[0]) { case 1: next = size; break; case 2: byte[] payload = new byte[size]; int received = 0; while (received < size) { int i = multiplexed.read(payload, received, size - received); if (i < 0) return; received += i; } System.err.println(new String(payload, StandardCharsets.UTF_8)); break; default: throw new IOException("Unexpected application/vnd.docker.raw-stream frame type " + header); } } }

Target:
private void readInternal() throws IOException { while (next == 0) { byte[] header = new byte[8]; int todo = 8; while (todo > 0) { int i = multiplexed.read(header, 8-todo, todo); if (i < 0) return; todo -= i; } int size = ((header[4] & 0xff) << 24) + ((header[5] & 0xff) << 16) + ((header[6] & 0xff) << 8) + (header[7] & 0xff); switch (header[0]) { case 1: next = size; break; case 2: byte[] payload = new byte[size]; int received = 0; while (received < size) { int i = multiplexed.read(payload, received, size - received); if (i < 0) break; received += i; } LOGGER.warn("Unexpected data on container stderr: {}", new String(payload, 0, received, StandardCharsets.UTF_8)); break; default: throw new IOException("Unexpected application/vnd.docker.raw-stream frame type " + header); } } }
Source:
private void updateGraphicsDevices() { final Set<Map.Entry<GraphicsType, GraphicsDevice>> graphicalDevicesSet = getParameters().getGraphicsDevices().entrySet(); final ArrayList<Map.Entry<GraphicsType, GraphicsDevice>> nullFirstGraphicalDevices = new ArrayList<>(graphicalDevicesSet); nullFirstGraphicalDevices.sort(getNullValueFirstComparator()); for (Map.Entry<GraphicsType, GraphicsDevice> entry : nullFirstGraphicalDevices) { updateGraphicsDevice(entry.getKey()); } }

Target:
private void updateGraphicsDevices() { final Set<Map.Entry<GraphicsType, GraphicsDevice>> graphicalDevicesSet = getParameters().getGraphicsDevices().entrySet(); for (Map.Entry<GraphicsType, GraphicsDevice> entry : graphicalDevicesSet) { if (entry.getValue() == null) { updateGraphicsDevice(entry.getKey()); } } for (Map.Entry<GraphicsType, GraphicsDevice> entry : graphicalDevicesSet) { if (entry.getValue() != null) { updateGraphicsDevice(entry.getKey()); } } }
Source:
public StudyParticipant getParticipant(Study study, Account account, boolean includeHistory) { if (account == null) { LOG.error("getParticipant() called with no account. Was the account deleted in the middle of the call?"); throw new EntityNotFoundException(Account.class); } if (BridgeUtils.filterForSubstudy(account) == null) { throw new EntityNotFoundException(Account.class); } StudyParticipant.Builder builder = new StudyParticipant.Builder(); SubstudyAssociations assoc = BridgeUtils.substudyAssociationsVisibleToCaller(account.getAccountSubstudies()); addAccount(builder, assoc, account); CriteriaContext.Builder contextBuilder = new CriteriaContext.Builder(); contextBuilder.withStudyIdentifier(study.getStudyIdentifier()); contextBuilder.withUserId(account.getId()); contextBuilder.withHealthCode(account.getHealthCode()); contextBuilder.withUserDataGroups(account.getDataGroups()); contextBuilder.withUserSubstudyIds(assoc.getSubstudyIdsVisibleToCaller()); RequestInfo requestInfo = cacheProvider.getRequestInfo(account.getId()); if (requestInfo != null) { contextBuilder.withClientInfo(requestInfo.getClientInfo()); contextBuilder.withLanguages(requestInfo.getLanguages()); } CriteriaContext context = contextBuilder.build(); if (includeHistory) { addHistory(builder, account, context); } if (requestInfo != null) { addConsentStatus(builder, account, context); } return builder.build(); }

Target:
public StudyParticipant getParticipant(Study study, Account account, boolean includeHistory) { if (account == null) { LOG.error("getParticipant() called with no account. Was the account deleted in the middle of the call?"); throw new EntityNotFoundException(Account.class); } if (BridgeUtils.filterForSubstudy(account) == null) { throw new EntityNotFoundException(Account.class); } StudyParticipant.Builder builder = new StudyParticipant.Builder(); SubstudyAssociations assoc = BridgeUtils.substudyAssociationsVisibleToCaller(account.getAccountSubstudies()); addAccount(builder, assoc, account); if (includeHistory) { addHistory(builder, account, study.getStudyIdentifier()); } RequestInfo requestInfo = cacheProvider.getRequestInfo(account.getId()); if (requestInfo != null) { CriteriaContext context = new CriteriaContext.Builder() .withStudyIdentifier(study.getStudyIdentifier()) .withUserId(account.getId()) .withHealthCode(account.getHealthCode()) .withUserDataGroups(account.getDataGroups()) .withUserSubstudyIds(assoc.getSubstudyIdsVisibleToCaller()) .withClientInfo(requestInfo.getClientInfo()) .withLanguages(requestInfo.getLanguages()).build(); addConsentStatus(builder, account, context); } return builder.build(); }
Source:
public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined()) { final String suffix = value.asString(); try { String suffixToCheck = suffix.replaceAll("'([^']*?)'", ""); if (denySeconds && (suffixToCheck.contains("s") || suffixToCheck.contains("S"))) { throw ElytronSubsystemMessages.ROOT_LOGGER.suffixContainsMillis(suffix); } DateTimeFormatter.ofPattern(suffix); } catch (IllegalArgumentException e) { throw ElytronSubsystemMessages.ROOT_LOGGER.invalidSuffix(suffix); } } }

Target:
public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined()) { final String suffix = value.asString(); try { DateTimeFormatter.ofPattern(suffix); if (denySeconds) { for (int i = 0; i < suffix.length(); i++) { char c = suffix.charAt(i); if (c == '\'') { c = suffix.charAt(++i); while (c != '\'') { c = suffix.charAt(++i); } } if (c == 's' || c == 'S') { throw ElytronSubsystemMessages.ROOT_LOGGER.suffixContainsMillis(suffix); } } } } catch (IllegalArgumentException e) { throw ElytronSubsystemMessages.ROOT_LOGGER.invalidSuffix(suffix); } } }
Source:
public TranslatedExpression<T> visitCall(CallExpression call, C context) { Optional<TranslatedExpression<T>> defaultTranslated = rowExpressionTranslator.translateCall(call, context, RowExpressionTreeTranslator.this); if (defaultTranslated.isPresent()) { return defaultTranslated.get(); } List<TranslatedExpression<T>> translatedArguments = call.getArguments().stream() .map(expression -> expression.accept(this, context)) .collect(Collectors.toList()); Optional<T> result = rowExpressionTranslator.translateCall(call.getFunctionHandle(), translatedArguments, context); return new TranslatedExpression<>(result, call, translatedArguments); }

Target:
public TranslatedExpression<T> visitCall(CallExpression call, C context) { return rowExpressionTranslator.translateCall(call, context, RowExpressionTreeTranslator.this); }
Source:
public int getPointAreaWidth() { IAxis[] xAxes = getSwtChart().getAxisSet().getXAxes(); ISeries[] series = fSwtChart.getSeriesSet().getSeries(); if ((xAxes.length > 0) && (series.length > 0) && (series[0].getXSeries() != null) && (series[0].getXSeries().length > 0)) { IAxis axis = xAxes[0]; double[] xSeries = series[0].getXSeries(); double maxx = Double.MIN_VALUE; for (double x : xSeries) { if (maxx < x) { maxx = x; } } int x1 = getPointAreaOffset(); int x2 = axis.getPixelCoordinate(maxx); x2 = getSwtChart().toControl(getSwtChart().getPlotArea().toDisplay(x2, 0)).x; int width = x2 - x1; return width; } return getSwtChart().getPlotArea().getSize().x; }

Target:
public int getPointAreaWidth() { IAxis[] xAxes = getSwtChart().getAxisSet().getXAxes(); ISeries[] series = fSwtChart.getSeriesSet().getSeries(); if ((xAxes.length > 0) && (series.length > 0) && (series[0].getXSeries() != null) && (series[0].getXSeries().length > 0)) { IAxis axis = xAxes[0]; double[] xSeries = series[0].getXSeries(); double maxX = Double.MIN_VALUE; for (double x : xSeries) { if (maxX < x) { maxX = x; } } int x1 = getPointAreaOffset(); int x2 = axis.getPixelCoordinate(maxX); x2 = getSwtChart().toControl(getSwtChart().getPlotArea().toDisplay(x2, 0)).x; int width = x2 - x1; return width; } return getSwtChart().getPlotArea().getSize().x; }
Source:
protected void configureServlets() { serve("/say-hello").with(HelloWorldServlet.class); serve("/say-hello/*").with(HelloWorldServlet.class); }

Target:
protected void configureServlets() { serve("/say-hello/*").with(HelloWorldServlet.class); }
Source:
public static Configuration get() { return conf; }

Target:
public static Configuration get() { return new Configuration(conf); }
Source:
private void setAuthMechanism(String mechanism, Authorization authorization) { switch (mechanism) { case "basic": authorization.setMechanism(Mechanism.BASIC); break; case "digest": authorization.setMechanism(Mechanism.DIGEST); break; default: break; } }

Target:
private void setAuthMechanism(String mechanism, Authorization authorization) { switch (mechanism.toLowerCase()) { case "basic": authorization.setMechanism(Mechanism.BASIC); break; case "digest": authorization.setMechanism(Mechanism.DIGEST); break; default: break; } }
Source:
protected void executeVmCommand() { AddCustomValue("InterfaceType", (VmInterfaceType.forValue(getParameters().getInterface().getType()).getDescription()).toString()); this.setVmName(getVmStaticDAO().get(getParameters().getVmId()).getvm_name()); if (StringUtils.isEmpty(getMacAddress())) { getParameters().getInterface().setMacAddress(MacPoolManager.getInstance().allocateNewMac()); } getParameters().getInterface().setSpeed( VmInterfaceType.forValue( getParameters().getInterface().getType()).getSpeed()); getParameters().getInterface().setId(Guid.NewGuid()); getParameters().getInterface().setVmId(getParameters().getVmId()); boolean succeeded = false; try { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { addInterfaceToDb(getParameters().getInterface()); addInterfaceDeviceToDb(); getCompensationContext().stateChanged(); return null; } }); if (getParameters().getInterface().isPlugged()) { succeeded = activateOrDeactivateNic(getParameters().getInterface().getId(), PlugAction.PLUG); } else { succeeded = true; } } finally { setSucceeded(succeeded); if (!succeeded) { MacPoolManager.getInstance().freeMac(getMacAddress()); } } }

Target:
protected void executeVmCommand() { AddCustomValue("InterfaceType", (VmInterfaceType.forValue(getParameters().getInterface().getType()).getDescription()).toString()); this.setVmName(getVmStaticDAO().get(getParameters().getVmId()).getVmName()); if (StringUtils.isEmpty(getMacAddress())) { getParameters().getInterface().setMacAddress(MacPoolManager.getInstance().allocateNewMac()); } boolean succeeded = false; try { getParameters().getInterface().setSpeed( VmInterfaceType.forValue( getParameters().getInterface().getType()).getSpeed()); getParameters().getInterface().setId(Guid.NewGuid()); getParameters().getInterface().setVmId(getParameters().getVmId()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { addInterfaceToDb(getParameters().getInterface()); addInterfaceDeviceToDb(); getCompensationContext().stateChanged(); return null; } }); if (getParameters().getInterface().isPlugged()) { succeeded = activateOrDeactivateNic(getParameters().getInterface().getId(), PlugAction.PLUG); } else { succeeded = true; } } finally { setSucceeded(succeeded); if (!succeeded) { MacPoolManager.getInstance().freeMac(getMacAddress()); } } }
Source:
protected void evictExpiredTokens() { try { for (final String token : getTokens()) { if (isExpired(token)) { log.evictToken(getTokenDisplayText(token)); removeToken(token); } } } catch(final Exception e) { log.failedExpiredTokenEviction(e); } }

Target:
protected void evictExpiredTokens() { for (final String token : getTokens()) { try { if (needsEviction(token)) { log.evictToken(getTokenDisplayText(token)); removeToken(token); } } catch (final Exception e) { log.failedExpiredTokenEviction(getTokenDisplayText(token), e); } } }
Source:
public Row buildRow() { Preconditions.checkState(committed, "Cannot build a Row object if we have not yet encountered a COMMIT_ROW chunk."); Row.Builder rowBuilder = Row.newBuilder().setKey(currentRowKey); if (!families.isEmpty()) { if (hasMultipleOfSameFamily()) { mergeFamilies(rowBuilder); } else { rowBuilder.addAllFamilies(families); } } return rowBuilder.build(); }

Target:
public Row buildRow() { Preconditions.checkState(committed, "Cannot build a Row object if we have not yet encountered a COMMIT_ROW chunk."); Row.Builder currentRowBuilder = Row.newBuilder(); currentRowBuilder.setKey(currentRowKey); for (Family.Builder builder : familyMap.values()) { currentRowBuilder.addFamilies(builder.build()); } return currentRowBuilder.build(); }