auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ExecutorManager(Props props, ExecutorLoader loader, Map<String, Alerter> alters) throws ExecutorManagerException { alerters = alters; azkProps = props; this.executorLoader = loader; this.setupExecutors(); this.loadRunningFlows(); queuedFlows = new QueuedExecutions(props.getLong(AZKABAN_WEBSERVER_QUEUE_SIZE, 100000)); this.loadQueuedFlows(); cacheDir = new File(props.getString("cache.directory", "cache")); executingManager = new ExecutingManagerUpdaterThread(); executingManager.start(); if(isMultiExecutorMode()) { setupMultiExecutorMode(); } long executionLogsRetentionMs = props.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS); cleanerThread = new CleanerThread(executionLogsRetentionMs); cleanerThread.start(); }

Target:
public ExecutorManager(Props props, ExecutorLoader loader, Map<String, Alerter> alters) throws ExecutorManagerException { azkProps = props; this.executorLoader = loader; this.setupExecutors(); this.loadRunningFlows(); queuedFlows = new QueuedExecutions(props.getLong(AZKABAN_WEBSERVER_QUEUE_SIZE, 100000)); this.loadQueuedFlows(); alerters = alters; cacheDir = new File(props.getString("cache.directory", "cache")); executingManager = new ExecutingManagerUpdaterThread(); executingManager.start(); if(isMultiExecutorMode()) { setupMultiExecutorMode(); } long executionLogsRetentionMs = props.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS); cleanerThread = new CleanerThread(executionLogsRetentionMs); cleanerThread.start(); }
Source:
public boolean isTouchExplorationEnabled () { return false; }

Target:
public boolean isTouchExplorationEnabled () { return touchExplorationEnabled; }
Source:
public String getKeywordsAsString(){ if(keywords == null){ List<String> list = PaletteInsertManager.getInstance().getKeyWords(xobject.getPath()); keywords = ""; if(list != null){ for(String word : list){ keywords += word + " "; } }else{ keywords = getLabel(); } } return keywords; }

Target:
public String getKeywordsAsString(){ if(keywords == null){ List<String> list = PaletteInsertManager.getInstance().getKeyWords(xobject.getPath()); if(list != null){ StringBuilder buffer = new StringBuilder(); for(String word : list){ buffer.append(word + " "); } keywords = buffer.toString(); }else{ keywords = getLabel(); } } return keywords; }
Source:
public void uninstallFeature(String feature) { LOGGER.trace("Uninstalling feature {}", feature); try { syncInstaller.uninstallFeatures(feature); } catch (VirtualMachineError e) { throw e; } catch (Throwable e) { handleUninstallFeatureException(feature, e); } }

Target:
public void uninstallFeature(String feature) { LOGGER.trace("Uninstalling feature {}", feature); try { AccessController.doPrivileged( (PrivilegedExceptionAction<Void>) () -> { syncInstaller.uninstallFeatures( EnumSet.of(FeaturesService.Option.NoAutoRefreshBundles), feature); return null; }); } catch (VirtualMachineError e) { throw e; } catch (PrivilegedActionException e) { handleUninstallFeatureException(feature, e.getException()); } catch (Throwable e) { handleUninstallFeatureException(feature, e); } }
Source:
public FloatColumnSelector makeFloatColumnSelector(String columnName) { return floatColumnSelectorMap.computeIfAbsent(columnName, delegate::makeFloatColumnSelector); }

Target:
public FloatColumnSelector makeFloatColumnSelector(String columnName) { final FloatColumnSelector existing = floatColumnSelectorMap.get(columnName); if (existing != null) { return existing; } return floatColumnSelectorMap.computeIfAbsent(columnName, delegate::makeFloatColumnSelector); }
Source:
private boolean scopeUpdatePermitted(final AnalysisJobBuilder sourceAnalysisJobBuilder, final ComponentBuilder componentBuilder) { if (sourceAnalysisJobBuilder != componentBuilder.getAnalysisJobBuilder()) { if (componentBuilder.getInput().length > 0 || componentBuilder.getComponentRequirement() != null) { final String scopeText; if(sourceAnalysisJobBuilder.isRootJobBuilder()){ scopeText = " into the default scope"; } else { scopeText = " into the scope " + sourceAnalysisJobBuilder.getDatastore().getName(); } final int response = JOptionPane.showConfirmDialog(_graphContext.getVisualizationViewer(), "This will move " + componentBuilder.getDescriptor().getDisplayName() + scopeText + ", thereby losing its configured columns and/or requirements", "Change scope?", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(response == JOptionPane.CANCEL_OPTION){ _graphContext.getJobGraph().refresh(); return false; } } } return true; }

Target:
private boolean scopeUpdatePermitted(final AnalysisJobBuilder sourceAnalysisJobBuilder, final ComponentBuilder componentBuilder) { if (sourceAnalysisJobBuilder != componentBuilder.getAnalysisJobBuilder()) { if (componentBuilder.getInput().length > 0 || componentBuilder.getComponentRequirement() != null) { final String scopeText; scopeText = LabelUtils.getScopeLabel(sourceAnalysisJobBuilder); final int response = JOptionPane.showConfirmDialog(_graphContext.getVisualizationViewer(), "This will move " + LabelUtils.getLabel(componentBuilder) + " into the " + scopeText + ", thereby losing its configured columns and/or requirements", "Change scope?", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(response == JOptionPane.CANCEL_OPTION){ _graphContext.getJobGraph().refresh(); return false; } } } return true; }
Source:
private static int calculateCommentCount(List<Comment> comments, String currentUser, UpdatedKind updatedKind) { int result = 0; if (updatedKind == UpdatedKind.OTHER_UPDATED) { return (int) (comments.stream().filter(c -> !isCommentBySelf(currentUser, c)).count()); } else if (updatedKind == UpdatedKind.SELF_UPDATED){ return (int) (comments.stream().filter(c -> isCommentBySelf(currentUser, c)).count()); } return result; }

Target:
private static int calculateCommentCount(List<Comment> comments, String currentUser, UpdatedKind updatedKind) { int result = 0; if (updatedKind == UpdatedKind.UPDATED_BY_OTHER) { return Utility.safeLongToInt((comments.stream().filter(c -> !isCommentBySelf(currentUser, c)).count())); } else if (updatedKind == UpdatedKind.UPDATED_BY_SELF){ return Utility.safeLongToInt((comments.stream().filter(c -> isCommentBySelf(currentUser, c)).count())); } return result; }
Source:
protected IStatus run(IProgressMonitor monitor) { if (!doReschedule) { return Status.OK_STATUS; } RepositoryCache repositoryCache = org.eclipse.egit.core.Activator .getDefault().getRepositoryCache(); if (repositoryCache == null) { return Status.OK_STATUS; } if (getDefault().getPreferenceStore() .getBoolean(UIPreferences.REFESH_ONLY_WHEN_ACTIVE)) { if (!isActive()) { monitor.done(); return Status.OK_STATUS; } } Repository[] repos = repositoryCache.getAllRepositories(); if (repos.length == 0) { return Status.OK_STATUS; } monitor.beginTask(UIText.Activator_scanningRepositories, repos.length); try { for (Repository repo : repos) { if (monitor.isCanceled()) { break; } if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER .getLocation(), "Scanning " + repo + " for changes"); } repo.scanForRepoChanges(); monitor.worked(1); } } catch (IOException e) { if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER .getLocation(), "Stopped rescheduling " + getName() + "job"); } return createErrorStatus(UIText.Activator_scanError, e); } finally { monitor.done(); } if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER.getLocation(), "Rescheduling " + getName() + " job"); } if (doReschedule) { schedule(interval); } return Status.OK_STATUS; }

Target:
protected IStatus run(IProgressMonitor monitor) { if (getDefault().getPreferenceStore() .getBoolean(UIPreferences.REFESH_ONLY_WHEN_ACTIVE)) { if (!isActive()) { monitor.done(); return Status.OK_STATUS; } } Repository[] repos = repositoryCache.getAllRepositories(); if (repos.length == 0) { return Status.OK_STATUS; } monitor.beginTask(UIText.Activator_scanningRepositories, repos.length); try { for (Repository repo : repos) { if (monitor.isCanceled()) { break; } if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER .getLocation(), "Scanning " + repo + " for changes"); } repo.scanForRepoChanges(); monitor.worked(1); } } catch (IOException e) { if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER .getLocation(), "Stopped rescheduling " + getName() + "job"); } return createErrorStatus(UIText.Activator_scanError, e); } finally { monitor.done(); } if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER.getLocation(), "Rescheduling " + getName() + " job"); } schedule(interval); return Status.OK_STATUS; }
Source:
private GlusterVolumeEntity insertTestVolume() { Guid volumeId = Guid.newGuid(); GlusterVolumeEntity volume = new GlusterVolumeEntity(); volume.setName(NEW_VOL_NAME); volume.setClusterId(CLUSTER_ID); volume.setId(volumeId); volume.setVolumeType(GlusterVolumeType.DISTRIBUTE); volume.addTransportType(TransportType.TCP); volume.setReplicaCount(0); volume.setStripeCount(0); volume.setStatus(GlusterStatus.UP); volume.setOption("auth.allow", "*"); volume.addAccessProtocol(AccessProtocol.GLUSTER); volume.addAccessProtocol(AccessProtocol.NFS); GlusterBrickEntity brick = new GlusterBrickEntity(); brick.setVolumeId(volumeId); brick.setServerId(server.getId()); brick.setServerName(server.getHostName()); brick.setBrickDirectory("/export/testVol1"); brick.setStatus(GlusterStatus.UP); brick.setBrickOrder(0); volume.addBrick(brick); volume.setSnapshotsCount(0); volume.setSnapMaxLimit(0); volume.setSnapshotScheduled(false); dao.save(volume); return volume; }

Target:
private GlusterVolumeEntity insertTestVolume() { Guid volumeId = Guid.newGuid(); GlusterVolumeEntity volume = new GlusterVolumeEntity(); volume.setName(NEW_VOL_NAME); volume.setClusterId(CLUSTER_ID); volume.setId(volumeId); volume.setVolumeType(GlusterVolumeType.DISTRIBUTE); volume.addTransportType(TransportType.TCP); volume.setReplicaCount(0); volume.setStripeCount(0); volume.setStatus(GlusterStatus.UP); volume.setOption("auth.allow", "*"); volume.addAccessProtocol(AccessProtocol.GLUSTER); volume.addAccessProtocol(AccessProtocol.NFS); GlusterBrickEntity brick = new GlusterBrickEntity(); brick.setVolumeId(volumeId); brick.setServerId(server.getId()); brick.setServerName(server.getHostName()); brick.setBrickDirectory("/export/testVol1"); brick.setStatus(GlusterStatus.UP); brick.setBrickOrder(0); volume.addBrick(brick); volume.setSnapshotsCount(0); volume.setSnapMaxLimit(0); dao.save(volume); return volume; }
Source:
public String toString() { return "YRange[lower=" + lower + ", upper=" + upper + "]"; }

Target:
public String toString() { return String.format("AxisRange[%d, %d]", lower, upper); }
Source:
public MetaParam<?> next() { try { return metas[i++]; } catch (ArrayIndexOutOfBoundsException e) { throw new NoSuchElementException(); } }

Target:
public MetaParam<?> next() { if (i >= metas.length) { throw new NoSuchElementException(); } MetaParam<?> meta = metas[i++]; skipNulls(); return meta; }
Source:
public void update() { if (world.isRemote) { builder.tick(); pattern.canInteract = !isLocked(); return; } sendNetworkUpdate(NET_RENDER_DATA); lockedTicks--; if (lockedTicks < 0) { lockedTicks = 0; } IFillerPattern p = pattern.get(); if (hasBox() && p != null && patternTemplate == null) { IStatementParameter[] params = new IStatementParameter[pattern.maxParams]; for (int i = 0; i < params.length; i++) { params[i] = pattern.get(i); } patternTemplate = p.createTemplate(this, params); if (patternTemplate == null) { blueprintTemplate = null; buildingInfo = null; } else { blueprintTemplate = new Template(); blueprintTemplate.size = patternTemplate.size; blueprintTemplate.offset = BlockPos.ORIGIN; int sx = patternTemplate.sizeX; int sy = patternTemplate.sizeY; int sz = patternTemplate.sizeZ; blueprintTemplate.data = new BitSet(); for (int x = 0; x < sx; x++) { for (int y = 0; y < sy; y++) { for (int z = 0; z < sz; z++) { blueprintTemplate.data.set(blueprintTemplate.posToIndex(x, y, z), patternTemplate.get(x, y, z) ^ invertPattern); } } } buildingInfo = blueprintTemplate.new BuildingInfo(box.min(), Rotation.NONE); builder.updateSnapshot(); } } if (mode == Mode.OFF || (mode == Mode.ON && finished)) { return; } if (buildingInfo != null) { finished = builder.tick(); } }

Target:
public void update() { if (world.isRemote) { builder.tick(); patternStatement.canInteract = !isLocked(); return; } sendNetworkUpdate(NET_RENDER_DATA); lockedTicks--; if (lockedTicks < 0) { lockedTicks = 0; } IFillerPattern p = patternStatement.get(); if (hasBox() && p != null && patternTemplate == null) { IStatementParameter[] params = new IStatementParameter[patternStatement.maxParams]; for (int i = 0; i < params.length; i++) { params[i] = patternStatement.get(i); } patternTemplate = p.createTemplate(this, params); if (patternTemplate == null) { blueprintTemplate = null; buildingInfo = null; } else { blueprintTemplate = new Template(); blueprintTemplate.size = patternTemplate.size; blueprintTemplate.offset = BlockPos.ORIGIN; blueprintTemplate.data = patternTemplate; if (invertPattern) { blueprintTemplate.data.invert(); } buildingInfo = blueprintTemplate.new BuildingInfo(patternTemplate.min, Rotation.NONE); builder.updateSnapshot(); } } if (mode == Mode.OFF || (mode == Mode.ON && finished)) { return; } if (buildingInfo != null) { finished = builder.tick(); } }
Source:
public void emptyLoginTest() { final HomePage homePage = new HomePage(driver); homePage.clickSubmitButton(); loggingAssert.assertTrue(homePage.getElementText(HomePageLocators.LOGIN_ERROR_MESSAGE.getBy()) .contains(errorMessage), "Error message display assert"); }

Target:
public void emptyLoginTest() { final HomePage homePage = new HomePage(driver); homePage.clickSubmitButton(); loggingAssert.assertTrue(homePage.isElementDisplayed(HomePageLocators.LOGIN_ERROR_MESSAGE), "Error message displayed"); }
Source:
public <K1, V1> KStream<K1, V1> flatTransform(final TransformerSupplier<? super K, ? super V, Iterable<KeyValue<K1, V1>>> transformerSupplier, final Named named, final String... stateStoreNames) { Objects.requireNonNull(transformerSupplier, "transformerSupplier can't be null"); Objects.requireNonNull(named, "named can't be null"); Objects.requireNonNull(stateStoreNames, "stateStoreNames can't be a null array"); for (final String stateStoreName : stateStoreNames) { Objects.requireNonNull(stateStoreName, "stateStoreNames can't be null"); } final String name = new NamedInternal(named).name(); final StatefulProcessorNode<? super K, ? super V> transformNode = new StatefulProcessorNode<>( name, new ProcessorParameters<>(new KStreamFlatTransform<>(transformerSupplier), name), stateStoreNames); transformNode.keyChangingOperation(true); builder.addGraphNode(streamsGraphNode, transformNode); return new KStreamImpl<>( name, null, null, sourceNodes, true, transformNode, builder); }

Target:
public <K1, V1> KStream<K1, V1> flatTransform(final TransformerSupplier<? super K, ? super V, Iterable<KeyValue<K1, V1>>> transformerSupplier, final Named named, final String... stateStoreNames) { Objects.requireNonNull(transformerSupplier, "transformerSupplier can't be null"); Objects.requireNonNull(named, "named can't be null"); Objects.requireNonNull(stateStoreNames, "stateStoreNames can't be a null array"); for (final String stateStoreName : stateStoreNames) { Objects.requireNonNull(stateStoreName, "stateStoreNames can't contain `null` as store name"); } final String name = new NamedInternal(named).name(); final StatefulProcessorNode<? super K, ? super V> transformNode = new StatefulProcessorNode<>( name, new ProcessorParameters<>(new KStreamFlatTransform<>(transformerSupplier), name), stateStoreNames); transformNode.keyChangingOperation(true); builder.addGraphNode(streamsGraphNode, transformNode); return new KStreamImpl<>( name, null, null, sourceNodes, true, transformNode, builder); }
Source:
public @NonNull String getPagingDescription() { if (mActivity == null) return ""; if (!getShouldPageComments()) { return mActivity.getString(R.string.none); } int count = getPagingCount(); if (count == 0) return mActivity.getString(R.string.none); return mActivity.getResources().getQuantityString(R.plurals.site_settings_paging_summary, count, count); }

Target:
public @NonNull String getPagingDescription() { if (mActivity == null) return ""; if (!getShouldPageComments()) { return mActivity.getString(R.string.disabled); } int count = getPagingCount(); if (count == 0) return mActivity.getString(R.string.disabled); return mActivity.getResources().getQuantityString(R.plurals.site_settings_paging_summary, count, count); }
Source:
public void shouldThrowExceptionIfMaxInFlightRequestsGreaterThanFiveIfEosEnabled() { props.put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, EXACTLY_ONCE); props.put(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, 3); final StreamsConfig streamsConfig = new StreamsConfig(props); try { streamsConfig.getProducerConfigs(clientId); fail("Should throw ConfigException when ESO is enabled and maxInFlight requests exceeds 5"); } catch (final ConfigException e) { assertEquals("Invalid value 7 for configuration max.in.flight.requests.per.connection: Can't exceed 5 when exactly-once processing is enabled", e.getMessage()); } }

Target:
public void shouldThrowExceptionIfMaxInFlightRequestsGreaterThanFiveIfEosEnabled() { props.put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, EXACTLY_ONCE); props.put(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, 7); final StreamsConfig streamsConfig = new StreamsConfig(props); try { streamsConfig.getProducerConfigs(clientId); fail("Should throw ConfigException when ESO is enabled and maxInFlight requests exceeds 5"); } catch (final ConfigException e) { assertEquals("Invalid value 7 for configuration max.in.flight.requests.per.connection: Can't exceed 5 when exactly-once processing is enabled", e.getMessage()); } }
Source:
public Collection<String> getImports() { return Collections.<String> unmodifiableCollection(this.imports); }

Target:
public Collection<String> getImports() { return ImmutableList.copyOf(this.imports); }
Source:
public MccMncRecord networkRecordForMccMnc(final String mcc, final String mnc) throws SQLException { Cursor cursor = null; if (android.os.Build.VERSION.SDK_INT == 19) { return null; } if (!isPresent()) { return null; } try { if (openDataBase()) { cursor = db.rawQuery(RECORD_FOR_MCC_MNC, new String[]{mcc, mnc}); if (cursor.getCount() > 0) { cursor.moveToFirst(); MccMncRecord operator = new MccMncRecord( cursor.getString(cursor.getColumnIndex("type")), cursor.getString(cursor.getColumnIndex("countryName")), cursor.getString(cursor.getColumnIndex("countryCode")), cursor.getString(cursor.getColumnIndex("mcc")), cursor.getString(cursor.getColumnIndex("mnc")), cursor.getString(cursor.getColumnIndex("brand")), cursor.getString(cursor.getColumnIndex("operator")), cursor.getString(cursor.getColumnIndex("status")), cursor.getString(cursor.getColumnIndex("bands")), cursor.getString(cursor.getColumnIndex("notes"))); return operator; } } else { MainActivity.error("unable to open mcc/mnc database for record."); } } catch (StackOverflowError soe) { MainActivity.error("Database corruption stack overflow: ", soe); throw new SQLiteDatabaseCorruptException("Samsung-specific stack overflow on integrity check."); }finally { if (null != cursor) { cursor.close(); } if ((null != db) && (db.isOpen())) { db.close(); } } return null; }

Target:
public MccMncRecord networkRecordForMccMnc(final String mcc, final String mnc) throws SQLException { Cursor cursor = null; if (android.os.Build.VERSION.SDK_INT <= 19) { return null; } if (!isPresent()) { return null; } try { if (openDataBase()) { cursor = db.rawQuery(RECORD_FOR_MCC_MNC, new String[]{mcc, mnc}); if (cursor.getCount() > 0) { cursor.moveToFirst(); MccMncRecord operator = new MccMncRecord( cursor.getString(cursor.getColumnIndex("type")), cursor.getString(cursor.getColumnIndex("countryName")), cursor.getString(cursor.getColumnIndex("countryCode")), cursor.getString(cursor.getColumnIndex("mcc")), cursor.getString(cursor.getColumnIndex("mnc")), cursor.getString(cursor.getColumnIndex("brand")), cursor.getString(cursor.getColumnIndex("operator")), cursor.getString(cursor.getColumnIndex("status")), cursor.getString(cursor.getColumnIndex("bands")), cursor.getString(cursor.getColumnIndex("notes"))); return operator; } } else { MainActivity.error("unable to open mcc/mnc database for record."); } } catch (StackOverflowError soe) { MainActivity.error("Database corruption stack overflow: ", soe); throw new SQLiteDatabaseCorruptException("Samsung-specific stack overflow on integrity check."); }finally { if (null != cursor) { cursor.close(); } if ((null != db) && (db.isOpen())) { db.close(); } } return null; }
Source:
protected static String getMessageOrNull(AuditLogType logType) { final String key = logType.name(); try { return resourceBundle.getString(key); } catch (Exception e) { log.error("Key '" + key + "' is not translated in '"+getResourceBundleName()+"'"); return null; } }

Target:
protected static String getMessageOrNull(AuditLogType logType) { final String key = logType.name(); try { return resourceBundle.getString(key); } catch (Exception e) { log.error(String.format("Key '%1$s' is not translated in '%2$s'", key, getResourceBundleName())); log.debug("", e); return null; } }
Source:
public ListenableFuture<Optional<LabelMeta>> getMeta(final LabelId id, final LabelType type) { final ListenableFuture<Optional<Row>> metas = getOptionalMeta(id, type); return transform(metas, new Function<Optional<Row>, Optional<LabelMeta>>() { @Nullable @Override public Optional<LabelMeta> apply(final Optional<Row> result) { if (!result.isPresent()) { return Optional.absent(); } final Row row = result.get(); return Optional.of( LabelMeta.create(id, type, row.getString("name"), row.getString("meta"), 0)); } }); }

Target:
public ListenableFuture<Optional<LabelMeta>> getMeta(final LabelId id, final LabelType type) { final ListenableFuture<Optional<Row>> metas = getOptionalMeta(id, type); return transform(metas, new Function<Optional<Row>, Optional<LabelMeta>>() { @Nullable @Override public Optional<LabelMeta> apply(final Optional<Row> result) { if (!result.isPresent()) { return Optional.absent(); } final Row row = result.get(); return Optional.of( LabelMeta.create(CassandraLabelId.fromLong(row.getLong("label_id")), LabelType.fromValue(row.getString("type")), row.getString("name"), row.getString("meta_description"), row.getDate("creation_time").getTime())); } }); }
Source:
public void onClick(View v) { if (mListener.getMultiSelectHandler() != null && mListener.getMultiSelectHandler().isEnabled()) { mListener.getMultiSelectHandler().toggle(mItem); onBindBoxItemViewHolder(this, null); return; } if (mItem == null) { return; } if (mListener != null) { mListener.getOnItemClickListener().onItemClick(mItem); } }

Target:
public void onClick(View v) { if (mListener.getMultiSelectHandler() != null && mListener.getMultiSelectHandler().isEnabled()) { mListener.getMultiSelectHandler().toggle(mItem); onBindBoxItemViewHolder(this, mItem); return; } if (mItem == null) { return; } if (mListener != null) { mListener.getOnItemClickListener().onItemClick(mItem); } }
Source:
private void deleteDraftIdentifier(DvObject dvObject) throws IOException { String baseUrl = System.getProperty("doi.baseurlstringnext"); String username = System.getProperty("doi.username"); String password = System.getProperty("doi.password"); GlobalId doi = dvObject.getGlobalId(); URL url = new URL(baseUrl + "/dois/" + doi.getAuthority() + "/" + doi.getIdentifier()); HttpURLConnection connection = null; connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("DELETE"); String userpass = username + ":" + password; String basicAuth = "Basic " + new String(Base64.getEncoder().encode(userpass.getBytes())); connection.setRequestProperty("Authorization", basicAuth); int status = connection.getResponseCode(); if(status!=HttpStatus.SC_NO_CONTENT) { throw new IOException(BundleUtil.getStringFromBundle("pids.deletePid.failureExpected", Arrays.asList(doi.asString(), Integer.toString(status)))); } logger.fine("deleteDoi status for " + doi.asString() + ": " + status); }

Target:
private void deleteDraftIdentifier(DvObject dvObject) throws IOException { String baseUrl = System.getProperty("doi.baseurlstringnext"); String username = System.getProperty("doi.username"); String password = System.getProperty("doi.password"); GlobalId doi = dvObject.getGlobalId(); URL url = new URL(baseUrl + "/dois/" + doi.getAuthority() + "/" + doi.getIdentifier()); HttpURLConnection connection = null; connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("DELETE"); String userpass = username + ":" + password; String basicAuth = "Basic " + new String(Base64.getEncoder().encode(userpass.getBytes())); connection.setRequestProperty("Authorization", basicAuth); int status = connection.getResponseCode(); if(status!=HttpStatus.SC_NO_CONTENT) { logger.warning("Incorrect Response Status from DataCite: " + status + " : " + connection.getResponseMessage()); throw new HttpException("Status: " + status); } logger.fine("deleteDoi status for " + doi.asString() + ": " + status); }
Source:
public CompletableFuture<Boolean> replaceIssueLabels(TurboIssue issue, List<String> newLabels) { List<String> originalLabels = issue.getLabels(); logger.info("Changing labels for " + issue + " on UI"); CompletableFuture<Optional<TurboIssue>> localReplaceResult = repoOpControl.replaceIssueLabelsLocally(issue, newLabels); if (localReplaceResult.isCompletedExceptionally() || localReplaceResult.isCancelled()) { return CompletableFuture.completedFuture(false); } Optional<TurboIssue> locallyModifiedIssue = localReplaceResult.join(); if (!locallyModifiedIssue.isPresent()) { return CompletableFuture.completedFuture(false); } localReplaceResult.thenRun(this::refreshUI); return updateIssueLabelsOnServer(issue, newLabels) .thenApply((isUpdateSuccessful) -> handleIssueLabelsUpdateOnServerResult( isUpdateSuccessful, locallyModifiedIssue.get(), originalLabels)); }

Target:
public CompletableFuture<Boolean> replaceIssueLabels(TurboIssue issue, List<String> newLabels) { List<String> originalLabels = issue.getLabels(); logger.info("Changing labels for " + issue + " on UI"); CompletableFuture<Optional<TurboIssue>> localLabelsReplaceFuture = repoOpControl.replaceIssueLabelsLocally(issue, newLabels); localLabelsReplaceFuture.thenRun(this::refreshUI); return updateIssueLabelsOnServer(issue, newLabels) .thenCombine(localLabelsReplaceFuture, (isUpdateSuccessful, locallyModifiedIssue) -> handleIssueLabelsUpdateResult( isUpdateSuccessful, locallyModifiedIssue, originalLabels)); }
Source:
private static void setUpMocks() throws IOException { RouterRpcServer spyRpcServer = Mockito.spy(routerContext.getRouter().createRpcServer()); Whitebox .setInternalState(routerContext.getRouter(), "rpcServer", spyRpcServer); Mockito.doReturn(null).when(spyRpcServer).getFileInfo(Mockito.anyString()); mockRpcClient = Mockito.spy(spyRpcServer.getRPCClient()); Whitebox .setInternalState(spyRpcServer, "rpcClient", mockRpcClient); RemoteLocation remoteLocation0 = new RemoteLocation("ns0", "/testdir", null); RemoteLocation remoteLocation1 = new RemoteLocation("ns1", "/", null); mockResponse0.put(remoteLocation0, new HdfsFileStatus.Builder().build()); Mockito.doReturn(mockResponse0).when(mockRpcClient).invokeConcurrent( Mockito.eq(Lists.newArrayList(remoteLocation0)), Mockito.any(RemoteMethod.class), Mockito.eq(false), Mockito.eq(false), Mockito.eq(HdfsFileStatus.class) ); mockResponse1.put(remoteLocation1, new HdfsFileStatus.Builder().build()); Mockito.doReturn(mockResponse1).when(mockRpcClient).invokeConcurrent( Mockito.eq(Lists.newArrayList(remoteLocation1)), Mockito.any(RemoteMethod.class), Mockito.eq(false), Mockito.eq(false), Mockito.eq(HdfsFileStatus.class) ); }

Target:
private static void setUpMocks() throws IOException, NoSuchFieldException { RouterRpcServer spyRpcServer = Mockito.spy(routerContext.getRouter().createRpcServer()); FieldSetter.setField(routerContext.getRouter(), Router.class.getDeclaredField("rpcServer"), spyRpcServer); Mockito.doReturn(null).when(spyRpcServer).getFileInfo(Mockito.anyString()); mockRpcClient = Mockito.spy(spyRpcServer.getRPCClient()); FieldSetter.setField(spyRpcServer, RouterRpcServer.class.getDeclaredField("rpcClient"), mockRpcClient); RemoteLocation remoteLocation0 = new RemoteLocation("ns0", "/testdir", null); RemoteLocation remoteLocation1 = new RemoteLocation("ns1", "/", null); final Map<RemoteLocation, HdfsFileStatus> mockResponse0 = new HashMap<>(); final Map<RemoteLocation, HdfsFileStatus> mockResponse1 = new HashMap<>(); mockResponse0.put(remoteLocation0, new HdfsFileStatus.Builder().build()); Mockito.doReturn(mockResponse0).when(mockRpcClient).invokeConcurrent( Mockito.eq(Lists.newArrayList(remoteLocation0)), Mockito.any(RemoteMethod.class), Mockito.eq(false), Mockito.eq(false), Mockito.eq(HdfsFileStatus.class) ); mockResponse1.put(remoteLocation1, new HdfsFileStatus.Builder().build()); Mockito.doReturn(mockResponse1).when(mockRpcClient).invokeConcurrent( Mockito.eq(Lists.newArrayList(remoteLocation1)), Mockito.any(RemoteMethod.class), Mockito.eq(false), Mockito.eq(false), Mockito.eq(HdfsFileStatus.class) ); }
Source:
private List<String> fetchAlternativeNames(List<String> originalNames) { for (List<String> alternativeNames : alternativeNamesDictionary) { if (containsSameOrganizationName(originalNames, alternativeNames)) { return filterAlreadyPresentAlternativeNames(alternativeNames, originalNames); } } return Lists.newArrayList(); }

Target:
private List<String> fetchAlternativeNames(List<String> originalNames) { for (Set<String> alternativeNames : alternativeNamesDictionary) { if (containsSameOrganizationName(originalNames, alternativeNames)) { return filterAlreadyPresentAlternativeNames(alternativeNames, originalNames); } } return Lists.newArrayList(); }
Source:
public DocumentRevision removeAttachments(DocumentRevision rev, String[] attachmentNames) throws ConflictException { int nDeleted = 0; for (String attachmentName : attachmentNames) { SavedAttachment a = (SavedAttachment) this.getAttachment(rev, attachmentName); if (a == null) { continue; } File f = this.fileFromKey(a.key); datastore.getSQLDatabase().delete("attachments", " filename = ? and sequence = ? ", new String[]{attachmentName, String.valueOf(rev.getSequence())}); f.delete(); nDeleted++; } if (nDeleted > 0) { return datastore.updateDocument(rev.getId(), rev.getRevision(), rev.getBody()); } return rev; }

Target:
protected DocumentRevision removeAttachments(DocumentRevision rev, String[] attachmentNames) throws ConflictException { boolean rowsDeleted = false; String[] args = new String[attachmentNames.length+1]; System.arraycopy(attachmentNames, 0, args, 0, attachmentNames.length); args[args.length-1] = String.valueOf(rev.getSequence()); rowsDeleted = datastore.getSQLDatabase().delete("attachments", String.format("filename in (%s) and sequence = ?", SQLDatabaseUtils.makePlaceholders(attachmentNames.length)), args) > 0; if (!rowsDeleted) { Log.w(LOG_TAG, "No attachments were deleted for rev "+rev+" with attachmentNames "+ Arrays.toString(attachmentNames)); } if (rowsDeleted) { return datastore.updateDocument(rev.getId(), rev.getRevision(), rev.getBody()); } else { return rev; } }
Source:
public Datastream initializeDatastream(Datastream datastream) throws DatastreamValidationException { String connectorType = datastream.getConnectorType(); List<Datastream> allDatastreams = _adapter.getAllDatastreams(); ConnectorWrapper connector = _connectors.get(connectorType); if (connector == null) { throw new DatastreamValidationException("Invalid connector type: " + connectorType); } Datastream initializedDatastream = connector.initializeDatastream(datastream, allDatastreams); if (connector.hasError()) { _eventQueue.put(CoordinatorEvent.createHandleInstanceErrorEvent(connector.getLastError())); } return initializedDatastream; }

Target:
public Datastream initializeDatastream(Datastream datastream) throws DatastreamValidationException { String connectorType = datastream.getConnectorType(); List<Datastream> allDatastreams = _adapter.getAllDatastreams().stream() .filter(d -> d.getConnectorType().equals(connectorType)) .collect(Collectors.toList()); ConnectorWrapper connector = _connectors.get(connectorType); if (connector == null) { throw new DatastreamValidationException("Invalid connector type: " + connectorType); } Datastream initializedDatastream = connector.initializeDatastream(datastream, allDatastreams); if (connector.hasError()) { _eventQueue.put(CoordinatorEvent.createHandleInstanceErrorEvent(connector.getLastError())); } return initializedDatastream; }
Source:
protected void executeCommand() { final int oldMemoryMb = getVm().getMemSizeMb(); final int oldMinAllocatedMemoryMb = getVm().getMinAllocatedMem(); final int unpluggedSizeMB = VmDeviceCommonUtils.getSizeOfMemoryDeviceMb(getDeviceToHotUnplug()).get(); final int decrementedMemoryMb = oldMemoryMb - unpluggedSizeMB; final int minMemoryAfterHotUnplugMb = decrementedMemoryMb > oldMinAllocatedMemoryMb ? oldMinAllocatedMemoryMb : Math.max(0, decrementedMemoryMb); final int memoryAfterHotUnplugMb = decrementedMemoryMb >= minMemoryAfterHotUnplugMb && decrementedMemoryMb > 0 ? decrementedMemoryMb : oldMemoryMb; addCustomValue(AUDIT_LOG_VAR_NEW_MEMORY_MB, String.valueOf(memoryAfterHotUnplugMb)); addCustomValue(AUDIT_LOG_VAR_OLD_MEMORY_MB, String.valueOf(oldMemoryMb)); final VDSReturnValue vdsReturnValue = executeHotUnplug(minMemoryAfterHotUnplugMb); final boolean memoryChanged = memoryAfterHotUnplugMb != oldMemoryMb || minMemoryAfterHotUnplugMb != oldMinAllocatedMemoryMb; if (vdsReturnValue.getSucceeded() && memoryChanged) { updateVm(memoryAfterHotUnplugMb, minMemoryAfterHotUnplugMb); } setSucceeded(true); }

Target:
protected void executeCommand() { final int oldMemoryMb = getVm().getMemSizeMb(); final int oldMinAllocatedMemoryMb = getVm().getMinAllocatedMem(); final int decrementedMemoryMb = oldMemoryMb - getUnpluggedDeviceSize(); final int minMemoryAfterHotUnplugMb = decrementedMemoryMb > oldMinAllocatedMemoryMb ? oldMinAllocatedMemoryMb : Math.max(0, decrementedMemoryMb); final int memoryAfterHotUnplugMb = decrementedMemoryMb >= minMemoryAfterHotUnplugMb && decrementedMemoryMb > 0 ? decrementedMemoryMb : oldMemoryMb; addCustomValue(AUDIT_LOG_VAR_NEW_MEMORY_MB, String.valueOf(memoryAfterHotUnplugMb)); addCustomValue(AUDIT_LOG_VAR_OLD_MEMORY_MB, String.valueOf(oldMemoryMb)); final VDSReturnValue vdsReturnValue = executeHotUnplug(minMemoryAfterHotUnplugMb); final boolean memoryChanged = memoryAfterHotUnplugMb != oldMemoryMb || minMemoryAfterHotUnplugMb != oldMinAllocatedMemoryMb; if (vdsReturnValue.getSucceeded() && memoryChanged) { updateVm(memoryAfterHotUnplugMb, minMemoryAfterHotUnplugMb); } setSucceeded(true); }
Source:
protected void fireChange() { if (!listeners.isEmpty()) { Object[] allListeners = listeners.getListeners(); for (Object allListener : allListeners) { final ICompareInputChangeListener listener = (ICompareInputChangeListener) allListener; SafeRunner.run(new ISafeRunnable() { @Override public void run() throws Exception { listener.compareInputChanged(AbstractCompareInput.this); } @Override public void handleException(Throwable exception) { } }); } } }

Target:
protected void fireChange() { if (!listeners.isEmpty()) { Object[] allListeners = listeners.getListeners(); for (Object l : allListeners) { final ICompareInputChangeListener listener = (ICompareInputChangeListener) l; SafeRunner.run(new ISafeRunnable() { @Override public void run() throws Exception { listener.compareInputChanged(AbstractCompareInput.this); } @Override public void handleException(Throwable exception) { } }); } } }
Source:
public RegistrationScreenInteractor navigateToRegistrationScreen() { onSignUpView().perform(ViewActions.click()); return new RegistrationScreenInteractor(); }

Target:
public RegistrationScreenInteractor navigateToRegistrationScreen() { onRegistrationView().perform(ViewActions.click()); return new RegistrationScreenInteractor(); }
Source:
public String getName() { String id = getId(); IPath xmlFile = fXmlFile; if (xmlFile == null) { return id; } Element doc = XmlUtils.getElementInFile(xmlFile.makeAbsolute().toString(), TmfXmlStrings.STATE_PROVIDER, getId()); List<Element> head = XmlUtils.getChildElements(doc, TmfXmlStrings.HEAD); String name = id; if (head.size() == 1) { List<Element> labels = XmlUtils.getChildElements(head.get(0), TmfXmlStrings.LABEL); if (!labels.isEmpty()) { name = labels.get(0).getAttribute(TmfXmlStrings.VALUE); } } if (name == null) { return id; } return name; }

Target:
public String getName() { String id = getId(); IPath xmlFile = fXmlFile; if (xmlFile == null) { return id; } Element doc = XmlUtils.getElementInFile(xmlFile.makeAbsolute().toString(), TmfXmlStrings.STATE_PROVIDER, id); List<Element> head = XmlUtils.getChildElements(doc, TmfXmlStrings.HEAD); String name = null; if (head.size() == 1) { List<Element> labels = XmlUtils.getChildElements(head.get(0), TmfXmlStrings.LABEL); if (!labels.isEmpty()) { name = labels.get(0).getAttribute(TmfXmlStrings.VALUE); } } return (name == null) ? id : name; }
Source:
public void destroy() { String logoutrequest = ""; logoutrequest = "<BaseRequest xmlns:xsi=\"<LINK_0>\" xsi:type=\"LogoutRequest\" Version=\"" + FIRMWARE_VERSION + "\" RequestId=\"" + requestId + "\" SessionId=\"" + getSessionId() + "\" />"; try { executeRequest(logoutrequest, "/cmd"); } catch (RWESmarthomeSessionExpiredException e) { } sessionId = ""; }

Target:
public void destroy() { final String LOGOUT_REQUEST = String.format( "<BaseRequest xmlns:xsi=\"<LINK_0>\" xsi:type=\"LogoutRequest\" Version=\"%s\" RequestId=\"%s\" SessionId=\"%s\" />", FIRMWARE_VERSION, requestId, getSessionId() ); try { logger.debug("Destroying session..."); executeRequest(LOGOUT_REQUEST, "/cmd"); logger.debug("Session destroyed."); } catch (RWESmarthomeSessionExpiredException e) { } sessionId = ""; }
Source:
public synchronized void handleEvaluationResponse(OtpErlangObject response) { if (myEvalCallback != null) { String error = null; if (response instanceof OtpErlangAtom && ((OtpErlangAtom) response).atomValue().equals("Parse error")) { error = "Parse error"; } else if (response instanceof OtpErlangTuple) { OtpErlangObject[] elements = ((OtpErlangTuple) response).elements(); if (elements.length == 2 && elements[0] instanceof OtpErlangAtom && ((OtpErlangAtom) elements[0]).atomValue().equals("EXIT")) { error = "Uncaught exception: " + elements[1]; } } if (error == null) { myEvalCallback.evaluated(ErlangXValueFactory.create(response)); } else { myEvalCallback.errorOccurred(error); } } }

Target:
public synchronized void handleEvaluationResponse(OtpErlangObject response) { if (myEvalCallback != null) { String error = maybeExtractErrorFromEvaluationResponse(response); if (error == null) { myEvalCallback.evaluated(ErlangXValueFactory.create(response)); } else { myEvalCallback.errorOccurred(error); } } }
Source:
protected void scatterBytes(byte[] bytes) { if (bytes.length != this.numStreams) { throw new ParquetEncodingException("Number of bytes doesn't match the number of streams."); } for (int i = 0; i < bytes.length; ++i) { this.byteStreams[i].write(bytes[i]); } }

Target:
protected void scatterBytes(byte[] bytes) { if (bytes.length != this.numStreams) { throw new ParquetEncodingException( String.format("Number of bytes doesn't match the number of streams. Num butes: %d, Num streams: %d", bytes.length, this.numStreams)); } for (int i = 0; i < bytes.length; ++i) { this.byteStreams[i].write(bytes[i]); } }
Source:
ImmutableDomainWildcardMapping(V defaultValue, Map<String, V> map) { this.defaultValue = defaultValue; this.map = Collections.unmodifiableMap(map); }

Target:
ImmutableDomainWildcardMapping(V defaultValue, Map<String, V> map) { this.defaultValue = defaultValue; this.map = new LinkedHashMap<String, V>(map); }
Source:
public List<ConfigurationFlag> getConfigurationFlag() { return configurationFlag; }

Target:
public List<ConfigurationFlag> getConfigurationFlag() { return Collections.unmodifiableList(this.configurationFlag); }
Source:
private Guid getSnapshotId(Snapshots snapshots) { return (snapshots.getSnapshots() != null && !snapshots.getSnapshots().isEmpty()) ? asGuid(snapshots.getSnapshots().get(0).getId()) : Guid.Empty; }

Target:
private Guid getSnapshotId(Snapshots snapshots) { return asGuid(snapshots.getSnapshots().get(0).getId()); }
Source:
public Graphics2D prepareImageRenderer(MapTransform mt, BufferedImage img, ProgressMonitor pm) { Graphics2D g2 = img.createGraphics(); if (backgroundColor != null) { g2.setBackground(backgroundColor); g2.clearRect(0, 0, width, height); } ImageRenderer renderer = new ImageRenderer(); renderer.draw(mt, g2, width, height, rootLayer, pm); return g2; }

Target:
private Graphics2D prepareImageRenderer(MapTransform mt, BufferedImage img, ProgressMonitor pm) { Graphics2D g2 = img.createGraphics(); if (backgroundColor != null) { g2.setBackground(backgroundColor); g2.clearRect(0, 0, width, height); } ImageRenderer renderer = new ImageRenderer(); renderer.draw(mt, g2, width, height, rootLayer, pm); return g2; }
Source:
public void testObisCodeValues2() { final AdhocMapper mapper = new AdhocMapper(); final com.alliander.osgp.domain.core.valueobjects.smartmetering.ObisCodeValues obisCodeValues1 = new com.alliander.osgp.domain.core.valueobjects.smartmetering.ObisCodeValues((byte)1, (byte)2, (byte)3, (byte)-22, (byte)5, (byte)-1); final ObisCodeValues obisCodeValues2 = mapper.map( obisCodeValues1, ObisCodeValues.class); Assert.assertEquals((short) 1, obisCodeValues2.getA()); Assert.assertEquals((short) 2, obisCodeValues2.getB()); Assert.assertEquals((short) 3, obisCodeValues2.getC()); Assert.assertEquals((short) -22, obisCodeValues2.getD()); Assert.assertEquals((short) 5, obisCodeValues2.getE()); Assert.assertEquals((short) -1, obisCodeValues2.getF()); }

Target:
public void testObisCodeValues2() { final AdhocMapper mapper = new AdhocMapper(); final com.alliander.osgp.domain.core.valueobjects.smartmetering.ObisCodeValues obisCodeValues1 = new com.alliander.osgp.domain.core.valueobjects.smartmetering.ObisCodeValues((byte)1, (byte)2, (byte)3, (byte)-22, (byte)5, (byte)-1); final ObisCodeValues obisCodeValues2 = mapper.map( obisCodeValues1, ObisCodeValues.class); Assert.assertEquals((short) 1, obisCodeValues2.getA()); Assert.assertEquals((short) 2, obisCodeValues2.getB()); Assert.assertEquals((short) 3, obisCodeValues2.getC()); Assert.assertEquals((short) 234, obisCodeValues2.getD()); Assert.assertEquals((short) 5, obisCodeValues2.getE()); Assert.assertEquals((short) 255, obisCodeValues2.getF()); }
Source:
private int calculateLifeTime() { int lifeTime = ThreadLocalRandom.current().nextInt(5, 46); int level = getEnchantmentLevel(Enchantment.LURE); lifeTime -= level * 5; lifeTime = Math.max(lifeTime, 0); lifeTime *= 20; return lifeTime; }

Target:
private int calculateLifeTime() { int lifeTime = ThreadLocalRandom.current().nextInt(MINIMUM_BASE_WAIT, MAXIMUM_WAIT + 1); int level = getEnchantmentLevel(Enchantment.LURE); lifeTime -= level * SECONDS_SAVED_PER_LURE_LEVEL; lifeTime = Math.max(lifeTime, 0); lifeTime *= 20; return lifeTime; }
Source:
static <C extends ProtocolConfiguration, B extends AbstractProtocolConfigurationBuilder<C>> B addProtocolProperties(OperationContext context, ModelNode protocol, B builder) throws OperationFailedException { if (protocol.hasDefined(ProtocolResourceDefinition.PROPERTIES.getName())) { for (Property property : protocol.get(ProtocolResourceDefinition.PROPERTIES.getName()).asPropertyList()) { builder.addProperty(property.getName(), property.getValue().asString()); } } return builder; }

Target:
static <C extends ProtocolConfiguration, B extends AbstractProtocolConfigurationBuilder<C>> B addProtocolProperties(OperationContext context, ModelNode protocol, B builder) throws OperationFailedException { if (protocol.hasDefined(ProtocolResourceDefinition.PROPERTIES.getName())) { for (Property property : ProtocolResourceDefinition.PROPERTIES.resolveModelAttribute(context, protocol).asPropertyList()) { builder.addProperty(property.getName(), property.getValue().asString()); } } return builder; }
Source:
private void readFile(Path file, int nRows, boolean verifyChecksums, Blackhole blackhole) throws IOException { ParquetReader<Group> reader = ParquetReader.builder(new GroupReadSupport(), file) .withConf(configuration) .usePageChecksumVerification(verifyChecksums) .build(); for (int i = 0; i < nRows; i++) { Group group = reader.read(); blackhole.consume(group.getLong("long_field", 0)); blackhole.consume(group.getBinary("binary_field", 0)); Group subgroup = group.getGroup("group", 0); blackhole.consume(subgroup.getInteger("int_field", 0)); blackhole.consume(subgroup.getInteger("int_field", 1)); blackhole.consume(subgroup.getInteger("int_field", 2)); blackhole.consume(subgroup.getInteger("int_field", 3)); } reader.close(); }

Target:
private void readFile(Path file, int nRows, boolean verifyChecksums, Blackhole blackhole) throws IOException { try (ParquetReader<Group> reader = ParquetReader.builder(new GroupReadSupport(), file) .withConf(configuration) .usePageChecksumVerification(verifyChecksums) .build()) { for (int i = 0; i < nRows; i++) { Group group = reader.read(); blackhole.consume(group.getLong("long_field", 0)); blackhole.consume(group.getBinary("binary_field", 0)); Group subgroup = group.getGroup("group", 0); blackhole.consume(subgroup.getInteger("int_field", 0)); blackhole.consume(subgroup.getInteger("int_field", 1)); blackhole.consume(subgroup.getInteger("int_field", 2)); blackhole.consume(subgroup.getInteger("int_field", 3)); } } }
Source:
public DoubleSumAggregatorFactory( @JsonProperty("name") String name, @JsonProperty("fieldName") final String fieldName ) { Preconditions.checkNotNull(name, "Must have a valid, nonl null aggregator name"); Preconditions.checkNotNull(fieldName, "Must have a valid, non null fieldName"); this.name = name; this.fieldName = fieldName; }

Target:
public DoubleSumAggregatorFactory( @JsonProperty("name") String name, @JsonProperty("fieldName") final String fieldName ) { Preconditions.checkNotNull(name, "Must have a valid, non-null aggregator name"); Preconditions.checkNotNull(fieldName, "Must have a valid, non-null fieldName"); this.name = name; this.fieldName = fieldName; }
Source:
public void cipherCanEncode() { String plainText = "aaaaaaaaaa"; String cipherText = cipherWithDefaultKey.getKey().substring(0, 10); assertEquals(cipherText, cipherWithDefaultKey.encode("aaaaaaaaaa")); assertEquals(cipherText, cipherWithDefaultKey.encode(plainText)); }

Target:
public void cipherCanEncode() { String plainText = "aaaaaaaaaa"; String cipherText = cipherWithDefaultKey.getKey().substring(0, 10); assertEquals(cipherText, cipherWithDefaultKey.encode(plainText)); }
Source:
public boolean isPartVisible(MPart part) { if (isInActivePerspective(part)) { MUIElement element = part; MElementContainer<?> parent = part.getParent(); if (parent == null) { element = part.getCurSharedRef(); if (element == null) { return false; } parent = element.getParent(); if (parent == null) { return false; } } if (parent instanceof MPartStack) { boolean isSelected = parent.getSelectedElement() == element; if (!isSelected) { return false; } if (isMinimized(parent) || isMinimized(part)) { return false; } return true; } if (!element.isVisible()) { return false; } if (isMinimized(parent) || isMinimized(part)) { return false; } return true; } return false; }

Target:
public boolean isPartVisible(MPart part) { if (isInActivePerspective(part)) { MUIElement element = part; MElementContainer<?> parent = part.getParent(); if (parent == null) { element = part.getCurSharedRef(); if (element == null) { return false; } parent = element.getParent(); if (parent == null) { return false; } } if (parent instanceof MPartStack && parent.getSelectedElement() != element) { return false; } if (!element.isVisible()) { return false; } if (isMinimized(parent) || isMinimized(element)) { return false; } return true; } return false; }