auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void scheduleRange(String thingUID, AstroThingHandler astroHandler, Range range, String channelId) { boolean thingNull = checkNull(thingUID, "Thing UID is null"); boolean astroHandlerNull = checkNull(astroHandler, "AstroThingHandler is null"); boolean rangeNull = checkNull(range, "Range is null"); boolean channelIdNull = checkNull(channelId, "Channel ID is null"); if (thingNull || astroHandlerNull || rangeNull || channelIdNull) { return; } int secondsPadding = 1; Calendar start = range.getStart(); Calendar end = range.getEnd(); if (isTimeEquals(start, end)) { end.add(SECOND, secondsPadding); } scheduleEvent(thingUID, astroHandler, start, EVENT_START, channelId); scheduleEvent(thingUID, astroHandler, end, EVENT_END, channelId); }

Target:
public static void scheduleRange(String thingUID, AstroThingHandler astroHandler, Range range, String channelId) { boolean thingNull = checkNull(thingUID, "Thing UID is null"); boolean astroHandlerNull = checkNull(astroHandler, "AstroThingHandler is null"); boolean rangeNull = checkNull(range, "Range is null"); boolean channelIdNull = checkNull(channelId, "Channel ID is null"); if (thingNull || astroHandlerNull || rangeNull || channelIdNull) { return; } Calendar start = range.getStart(); Calendar end = range.getEnd(); if (truncatedEquals(start, end, SECOND)) { scheduleEvent(thingUID, astroHandler, start, asList(EVENT_START, EVENT_END), channelId); } else { scheduleEvent(thingUID, astroHandler, start, EVENT_START, channelId); scheduleEvent(thingUID, astroHandler, end, EVENT_END, channelId); } }
Source:
public void setAbnormalStateResolverMap(Map<String, String> resolverMap) { if (resolverMap != null && resolverMap.values().stream() .anyMatch(className -> className == null)) { throw new IllegalArgumentException( "Invalid Abnormal State Resolver Map definition. Class name cannot be empty."); } if (resolverMap == null) { _record.getMapFields().remove(ClusterConfigProperty.ABNORMAL_STATES_RESOLVER_MAP.name()); } _record.setMapField(ClusterConfigProperty.ABNORMAL_STATES_RESOLVER_MAP.name(), resolverMap); }

Target:
public void setAbnormalStateResolverMap(Map<String, String> resolverMap) { if (resolverMap == null) { _record.getMapFields().remove(ClusterConfigProperty.ABNORMAL_STATES_RESOLVER_MAP.name()); } else { if (resolverMap.entrySet().stream().anyMatch(e -> { String stateModelDefName = e.getKey(); String className = e.getValue(); return stateModelDefName == null || stateModelDefName.isEmpty() || className == null || className.isEmpty(); })) { throw new IllegalArgumentException( "Invalid Abnormal State Resolver Map definition. StateModel definition name and the resolver class name cannot be null or empty."); } _record.setMapField(ClusterConfigProperty.ABNORMAL_STATES_RESOLVER_MAP.name(), resolverMap); } }
Source:
private RealmQuery(RealmResults<E> queryResults, Class<E> clazz) { this.realm = queryResults.realm; this.clazz = clazz; this.schema = realm.schema.getSchemaForClass(clazz); this.table = queryResults.getTableOrView(); this.linkView = null; this.query = queryResults.getTableOrView().where(); }

Target:
private RealmQuery(RealmResults<E> queryResults, Class<E> clazz) { this.realm = queryResults.realm; this.clazz = clazz; this.schema = realm.schema.getSchemaForClass(clazz); this.table = queryResults.getTableOrView(); this.linkView = null; this.query = this.table.where(); }
Source:
private void migrateUnitsToCodedValue(JdbcConnection connection, List<String> uniqueUnits) throws CustomChangeException, SQLException, DatabaseException { PreparedStatement updateDrugOrderStatement = null; Boolean autoCommit = null; try { autoCommit = connection.getAutoCommit(); connection.setAutoCommit(false); updateDrugOrderStatement = connection.prepareStatement("update drug_order set dose_units = ? where units = ?"); for (String unit : uniqueUnits) { Integer conceptIdForUnit = DatabaseUtil.getConceptIdForUnits(connection.getUnderlyingConnection(), unit); updateDrugOrderStatement.setInt(1, conceptIdForUnit); updateDrugOrderStatement.setString(2, unit); updateDrugOrderStatement.executeUpdate(); updateDrugOrderStatement.clearParameters(); } connection.commit(); } catch (DatabaseException e) { handleError(connection, e); } catch (SQLException e) { handleError(connection, e); } finally { if (autoCommit != null) { connection.setAutoCommit(autoCommit); } if(updateDrugOrderStatement != null) { updateDrugOrderStatement.close(); } } }

Target:
private void migrateUnitsToCodedValue(JdbcConnection connection, List<String> uniqueUnits) throws CustomChangeException, SQLException, DatabaseException { PreparedStatement updateDrugOrderStatement = null; Boolean autoCommit = null; try { autoCommit = connection.getAutoCommit(); connection.setAutoCommit(false); updateDrugOrderStatement = connection.prepareStatement("update drug_order set dose_units = ? where units = ?"); for (String unit : uniqueUnits) { Integer conceptIdForUnit = DatabaseUtil.getConceptIdForUnits(connection.getUnderlyingConnection(), unit); if(conceptIdForUnit == null) { throw new CustomChangeException("No concept mapping found for unit: " + unit); } updateDrugOrderStatement.setInt(1, conceptIdForUnit); updateDrugOrderStatement.setString(2, unit); updateDrugOrderStatement.executeUpdate(); updateDrugOrderStatement.clearParameters(); } connection.commit(); } catch (DatabaseException e) { handleError(connection, e); } catch (SQLException e) { handleError(connection, e); } finally { if (autoCommit != null) { connection.setAutoCommit(autoCommit); } if(updateDrugOrderStatement != null) { updateDrugOrderStatement.close(); } } }
Source:
private Long resizePV(String lunId) { try { return (Long) runVdsCommand( VDSCommandType.ResizeStorageDomainPV, new ResizeStorageDomainPVVDSCommandParameters(getStoragePoolId(), getStorageDomainId(), lunId)).getReturnValue(); } catch (VdcBLLException e) { log.error("Failed to resize PV " + lunId, e); throw e; } }

Target:
private Long resizePV(String lunId) { return (Long) runVdsCommand( VDSCommandType.ResizeStorageDomainPV, new ResizeStorageDomainPVVDSCommandParameters(getStoragePoolId(), getStorageDomainId(), lunId)).getReturnValue(); }
Source:
private boolean equalsProperties(Map<String, String> oldProperties, Map<String, String> newProperties) { for (Entry<String, String> entry : oldProperties.entrySet()) { String oldValue = entry.getValue(); String newValue = newProperties.get(entry.getKey()); if (newValue == null) { return false; } else { if (!newValue.equals(oldValue)) { return false; } } } return true; }

Target:
private boolean equalsProperties(Map<String, String> oldProperties, Map<String, String> newProperties) { MapDifference<String, String> div = Maps.difference(oldProperties, newProperties); return div.entriesDiffering().size() != 0 && div.entriesOnlyOnLeft().size() != 0 && div.entriesOnlyOnRight().size() != 0; }
Source:
public List<Ref> getChildRefsRecursive() throws IOException { List<Ref> childRefs = new ArrayList<>(); for (IPath myPath : getPathList()) { if (getObject().isPrefixOf(myPath)) { Ref ref = getRepository().exactRef(myPath.toPortableString()); if (ref != null) { childRefs.add(ref); } } } return childRefs; }

Target:
public List<Ref> getChildRefsRecursive() throws IOException { return getRepository().getRefDatabase() .getRefsByPrefix(getObject().toPortableString()).stream() .filter(ref -> !ref.isSymbolic()).collect(Collectors.toList()); }
Source:
public JavadocJarDefaultMavenProjectStub() { readModel( new File( getBasedir(), "javadocjar-default-plugin-config.xml" ) ); setGroupId( getModel().getGroupId() ); setArtifactId( getModel().getArtifactId() ); setVersion( getModel().getVersion() ); setName( getModel().getName() ); setUrl( getModel().getUrl() ); setPackaging( getModel().getPackaging() ); Scm scm = new Scm(); scm.setConnection( "scm:svn:<LINK_0>" ); setScm( scm ); JavadocPluginArtifactStub artifact = new JavadocPluginArtifactStub( getGroupId(), getArtifactId(), getVersion(), getPackaging() ); artifact.setArtifactHandler( new DefaultArtifactHandlerStub() ); artifact.setType( "jar" ); artifact.setBaseVersion( "1.0-SNAPSHOT" ); setArtifact( artifact ); Build build = new Build(); build.setFinalName( "javadocjar-archive-config" ); build.setDirectory( super.getBasedir() + "/target/test/unit/javadocjar-default/target" ); setBuild( build ); List<String> compileSourceRoots = new ArrayList<String>(); compileSourceRoots.add( getBasedir() + "/javadocjar/def" ); setCompileSourceRoots( compileSourceRoots ); }

Target:
public JavadocJarDefaultMavenProjectStub() { readModel( new File( getBasedir(), "javadocjar-default-plugin-config.xml" ) ); setGroupId( getModel().getGroupId() ); setArtifactId( getModel().getArtifactId() ); setVersion( getModel().getVersion() ); setName( getModel().getName() ); setUrl( getModel().getUrl() ); setPackaging( getModel().getPackaging() ); Scm scm = new Scm(); scm.setConnection( "scm:svn:<LINK_0>" ); setScm( scm ); JavadocPluginArtifactStub artifact = new JavadocPluginArtifactStub( getGroupId(), getArtifactId(), getVersion(), getPackaging() ); artifact.setArtifactHandler( new DefaultArtifactHandlerStub() ); artifact.setType( "jar" ); artifact.setBaseVersion( "1.0-SNAPSHOT" ); setArtifact( artifact ); Build build = new Build(); build.setFinalName( "javadocjar-default-config" ); build.setDirectory( super.getBasedir() + "/target/test/unit/javadocjar-default/target" ); setBuild( build ); List<String> compileSourceRoots = new ArrayList<String>(); compileSourceRoots.add( getBasedir() + "/javadocjar/def" ); setCompileSourceRoots( compileSourceRoots ); }
Source:
public abstract void doExecute() throws MojoExecutionException, MojoFailureException; public void initMojo() { if (projectBuildDirectory != null) { new ProjectDirectoryUpdater(project).updateBuildDirectory(projectBuildDirectory); } if (!lightweightPackage && useLocalRepository) { getLog().info("'useLocalRepository' would be ignored, it could only be used when 'lightweightPackage' is enabled"); useLocalRepository = false; } }

Target:
public abstract void doExecute() throws MojoExecutionException, MojoFailureException; public void initMojo() { if (projectBuildDirectory != null) { new ProjectDirectoryUpdater(project).updateBuildDirectory(projectBuildDirectory); } if (!lightweightPackage && useLocalRepository) { getLog().info("'useLocalRepository' would be ignored, it can only be used when 'lightweightPackage' is enabled"); useLocalRepository = false; } }
Source:
protected ParameterizedCommand<Path> onSuccess() { return (path) -> { final T content = getContentSupplier().get(); final int originalHash = content.hashCode(); setOriginalHash(originalHash); }; }

Target:
protected ParameterizedCommand<Path> onSuccess() { return (path) -> { final T content = getContentSupplier().get(); final M metadata = getMetadataSupplier().get(); setOriginalHash(content.hashCode()); setMetadataOriginalHash(metadata.hashCode()); }; }
Source:
private void addWithAdjustedWeight(double sample, double adjustedWeight) { if (count < samples.length) { samples[count] = sample; count++; bubbleUp(); return; } if (adjustedWeight <= weights[0]) { return; } samples[0] = sample; weights[0] = adjustedWeight; bubbleDown(); }

Target:
private void addWithAdjustedWeight(double sample, double adjustedWeight) { if (count < samples.length) { samples[count] = sample; weights[count] = adjustedWeight; count++; bubbleUp(); return; } if (adjustedWeight <= weights[0]) { return; } samples[0] = sample; weights[0] = adjustedWeight; bubbleDown(); }
Source:
public void run() { IJobManager manager = Job.getJobManager(); try { manager.beginRule(rule, getEventLoopMonitor()); context.run(false, false, runnable); } catch (InvocationTargetException | InterruptedException e) { status = new Status(IStatus.ERROR, IProgressConstants.PLUGIN_ID, e .getMessage(), e); } catch (OperationCanceledException e) { status = new Status(IStatus.ERROR, IProgressConstants.PLUGIN_ID, e .getMessage(), e); } finally { manager.endRule(rule); } }

Target:
public void run() { IJobManager manager = Job.getJobManager(); try { manager.beginRule(rule, getEventLoopMonitor()); context.run(false, false, runnable); } catch (InvocationTargetException | InterruptedException | OperationCanceledException e) { status = new Status(IStatus.ERROR, IProgressConstants.PLUGIN_ID, e .getMessage(), e); } finally { manager.endRule(rule); } }
Source:
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); api = new OpenFoodAPIClient(getActivity()); mView = view; mSettings = getActivity().getSharedPreferences("prefs", 0); boolean firstRunAlert = mSettings.getBoolean("firstRunAlert", true); if (firstRunAlert) { new MaterialDialog.Builder(getContext()) .title(R.string.alert_dialog_warning_title) .content(R.string.warning_alert_data) .positiveText(R.string.ok_button) .show(); SharedPreferences.Editor editor = mSettings.edit(); editor.putBoolean("firstRunAlert", false); editor.apply(); } mRvAllergens = (RecyclerView) view.findViewById(R.id.alergens_recycle); mAllergens = Utils.getAppDaoSession(this.getActivity()).getAllergenDao().queryBuilder().where(AllergenDao.Properties.Enable.eq("true")).list(); mAdapter = new AllergensAdapter(mAllergens, getActivity()); mRvAllergens.setAdapter(mAdapter); mRvAllergens.setLayoutManager(new LinearLayoutManager(view.getContext())); mRvAllergens.setHasFixedSize(true); }

Target:
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mAllergensFromDao = Utils.getAppDaoSession(this.getActivity()).getAllergenDao().loadAll(); api = new OpenFoodAPIClient(getActivity()); mView = view; mSettings = getActivity().getSharedPreferences("prefs", 0); boolean firstRunAlert = mSettings.getBoolean("firstRunAlert", true); if (firstRunAlert) { new MaterialDialog.Builder(getContext()) .title(R.string.alert_dialog_warning_title) .content(R.string.warning_alert_data) .positiveText(R.string.ok_button) .show(); SharedPreferences.Editor editor = mSettings.edit(); editor.putBoolean("firstRunAlert", false); editor.apply(); } mRvAllergens = (RecyclerView) view.findViewById(R.id.alergens_recycle); mAllergensEnabled = Utils.getAppDaoSession(this.getActivity()).getAllergenDao().queryBuilder().where(AllergenDao.Properties.Enable.eq("true")).list(); mAdapter = new AllergensAdapter(mAllergensEnabled, getActivity()); mRvAllergens.setAdapter(mAdapter); mRvAllergens.setLayoutManager(new LinearLayoutManager(view.getContext())); mRvAllergens.setHasFixedSize(true); }
Source:
public BrowsePivotTableWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); noCacheRnd = Math.random(); customSQL = ""; add(new PivotPanel("pivot", new PropertyModel<String>(this, "url"), new PropertyModel<DisplayMode>(this, "displayMode"), new PropertyModel<String>(this, "config"))); add(UpdateOnDashboardDisplayModeChangeBehavior.INSTANCE); }

Target:
public BrowsePivotTableWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); noCacheRnd = Math.random(); add(new PivotPanel("pivot", new PropertyModel<String>(this, "url"), new PropertyModel<DisplayMode>(this, "displayMode"), new PropertyModel<String>(this, "config"))); add(UpdateOnDashboardDisplayModeChangeBehavior.INSTANCE); }
Source:
private void recover() { for (RuntimeInfrastructure infra : infraByRecipe.values()) { try { for (RuntimeIdentity id : infra.getIdentities()) { if (runtimes.putIfAbsent(id.getWorkspaceId(), new RuntimeState(validate(infra.getRuntime(id)), RUNNING)) != null) { LOG.error("More than 1 runtime of workspace with id '' found. Skipping all duplicates."); } } } catch (UnsupportedOperationException x) { LOG.warn("Not recoverable infrastructure: '{}'", infra.getName()); } catch (InfrastructureException x) { LOG.error("An error occurred while attempted to recover runtimes using infrastructure '{}'. Reason: '{}'", infra.getName(), x.getMessage()); } } }

Target:
private void recover() { for (RuntimeInfrastructure infra : infraByRecipe.values()) { try { for (RuntimeIdentity id : infra.getIdentities()) { if (runtimes.putIfAbsent(id.getWorkspaceId(), new RuntimeState(validate(infra.getRuntime(id)), RUNNING)) != null) { LOG.error("More than 1 runtime of workspace found. " + "Runtime identity of duplicate is '{}'. Skipping duplicate.", id); } } } catch (UnsupportedOperationException x) { LOG.warn("Not recoverable infrastructure: '{}'", infra.getName()); } catch (InfrastructureException x) { LOG.error("An error occurred while attempted to recover runtimes using infrastructure '{}'. Reason: '{}'", infra.getName(), x.getMessage()); } } }
Source:
private void executeAssignement(AssignmentExpressionTree tree) { ProgramState.Pop unstack; SymbolicValue value; boolean isSimpleAssignment = ExpressionUtils.isSimpleAssignment(tree); if (isSimpleAssignment) { unstack = programState.unstackValue(1); value = unstack.values.get(0); } else { unstack = programState.unstackValue(2); value = constraintManager.createSymbolicValue(tree); } programState = unstack.state; programState = programState.stackValue(value); if (isSimpleAssignment || tree.variable().is(Tree.Kind.IDENTIFIER)) { programState = programState.put(ExpressionUtils.extractIdentifier(tree).symbol(), value); } }

Target:
private void executeAssignement(AssignmentExpressionTree tree) { ProgramState.Pop unstack; SymbolicValue value; boolean isSimpleAssignment = ExpressionUtils.isSimpleAssignment(tree) || ExpressionUtils.isSelectOnThisOrSuper(tree); if (isSimpleAssignment) { unstack = programState.unstackValue(1); value = unstack.values.get(0); } else { unstack = programState.unstackValue(2); value = constraintManager.createSymbolicValue(tree); } programState = unstack.state; programState = programState.stackValue(value); if (isSimpleAssignment || tree.variable().is(Tree.Kind.IDENTIFIER)) { programState = programState.put(ExpressionUtils.extractIdentifier(tree).symbol(), value); } }
Source:
public void handleEvent(MotechEvent event) { LOGGER.info("Daily password reset reminder triggered"); if (settingService.isPasswordResetReminderEnabled()) { int daysTillPasswordChange = settingService.getNumberOfDaysToChangePassword(); int daysTillReminder = daysTillPasswordChange - settingService.getNumberOfDaysForReminder(); for (MotechUser user : allUsers.retrieveAll()) { int daysWithoutPasswordChange = daysWithoutPasswordChange(user); LOGGER.debug("User hasn't changed password in days. Notification should be sent at day {}", user.getUserName(), daysWithoutPasswordChange, daysTillReminder); if (daysWithoutPasswordChange == daysTillReminder) { sendPasswordReminderEvent(user, daysTillPasswordChange); } } } }

Target:
public void handleEvent(MotechEvent event) { if (settingService.isPasswordResetReminderEnabled()) { LOGGER.info("Daily password reset reminder triggered"); int numberOfDaysForReminder = settingService.getNumberOfDaysForReminder(); int daysTillPasswordChange = settingService.getNumberOfDaysToChangePassword(); int daysTillReminder = daysTillPasswordChange - numberOfDaysForReminder; for (MotechUser user : allUsers.retrieveAll()) { int daysWithoutPasswordChange = daysWithoutPasswordChange(user); LOGGER.debug("User hasn't changed password in days. Notification is being sent days before" + "expiration", user.getUserName(), daysWithoutPasswordChange, daysTillReminder); if (daysWithoutPasswordChange == daysTillReminder) { sendPasswordReminderEvent(user, daysTillPasswordChange, numberOfDaysForReminder); } } } else { LOGGER.info("Daily password reset reminder is disabled, skipping processing of users"); } }
Source:
protected boolean isMariaDbCapableTlsv12() { if (!isMariaDbServer()) { return false; } if (!versionGreaterOrEqual(10, 0, 15)) { return true; } if (majorVersion != 10 && versionGreaterOrEqual(5, 5, 41)) { return true; } return false; }

Target:
protected boolean isMariaDbCapableTlsv12() { if (!isMariaDbServer()) { return false; } if (versionGreaterOrEqual(10, 0, 15)) { return true; } if (majorVersion != 10 && versionGreaterOrEqual(5, 5, 41)) { return true; } return false; }
Source:
public ListenableFuture<SegmentsAndMetadata> publishAndRegisterHandoff( final TransactionalSegmentPublisher publisher, final Committer committer, final Collection<String> sequenceNames ) { final SettableFuture<SegmentsAndMetadata> publishDoneFuture = SettableFuture.create(); final ListenableFuture<SegmentsAndMetadata> publishFuture = publish(publisher, committer, sequenceNames); Futures.addCallback(publishFuture, new FutureCallback<SegmentsAndMetadata>() { @Override public void onSuccess(@Nullable SegmentsAndMetadata result) { publishDoneFuture.set(result); } @Override public void onFailure(Throwable t) { publishDoneFuture.setException(t); } }); return publishDoneFuture; }

Target:
public ListenableFuture<SegmentsAndMetadata> publishAndRegisterHandoff( final TransactionalSegmentPublisher publisher, final Committer committer, final Collection<String> sequenceNames ) { return ListenableFutures.transformAsync( publish(publisher, committer, sequenceNames), this::registerHandoff ); }
Source:
public void viewInstanceStateSaveTest() { Context context = Robolectric.buildActivity(EmptyActivityWithoutLayout_.class).create().get(); ViewWithInstanceState_ savingView = (ViewWithInstanceState_) ViewWithInstanceState_.build(context); assertThat(savingView.stateTest).isEqualTo("does it work?"); savingView.stateTest = "it works!"; Parcelable savedInstanceState = savingView.onSaveInstanceState(); ViewWithInstanceState_ resotringView = (ViewWithInstanceState_) ViewWithInstanceState_.build(context); assertThat(resotringView.stateTest).isEqualTo("does it work?"); resotringView.onRestoreInstanceState(savedInstanceState); assertThat(resotringView.stateTest).isEqualTo("it works!"); }

Target:
public void viewInstanceStateSaveTest() { Context context = Robolectric.buildActivity(EmptyActivityWithoutLayout_.class).create().get(); ViewWithInstanceState_ savingView = (ViewWithInstanceState_) ViewWithInstanceState_.build(context); assertThat(savingView.stateTest).isEqualTo("does it work?"); assertThat(savingView.stringState).isEqualTo("does it work?"); assertThat(savingView.beanState.getX()).isEqualTo(0); savingView.stateTest = "it works!"; savingView.stringState = "it works!"; savingView.beanState = new MyParcelableBean(1); Parcelable savedInstanceState = savingView.onSaveInstanceState(); ViewWithInstanceState_ restoringView = (ViewWithInstanceState_) ViewWithInstanceState_.build(context); assertThat(restoringView.stateTest).isEqualTo("does it work?"); assertThat(restoringView.stringState).isEqualTo("does it work?"); assertThat(restoringView.beanState.getX()).isEqualTo(0); restoringView.onRestoreInstanceState(savedInstanceState); assertThat(restoringView.stateTest).isEqualTo("it works!"); assertThat(restoringView.stringState).isEqualTo("it works!"); assertThat(restoringView.beanState.getX()).isEqualTo(1); }
Source:
public CompletableFuture<Boolean> splitSegment(int segmentId) { if (!this.activeSegments.containsKey(segmentId)) { return CompletableFuture.completedFuture(false); } CompletableFuture<Boolean> result = new CompletableFuture<>(); if (!tokenStore.requiresExplicitInitialization()) { result.completeExceptionally(new UnsupportedOperationException("TokenStore must use explicit initialization to be able to safely split tokens")); } this.instructions.computeIfAbsent(segmentId, i -> new CopyOnWriteArrayList<>()) .add(new SplitSegmentInstruction(result, segmentId)); return result; }

Target:
public CompletableFuture<Boolean> splitSegment(int segmentId) { CompletableFuture<Boolean> result = new CompletableFuture<>(); if (!tokenStore.requiresExplicitSegmentInitialization()) { result.completeExceptionally(new UnsupportedOperationException("TokenStore must require explicit initialization to safely split tokens")); return result; } if (!this.activeSegments.containsKey(segmentId)) { return CompletableFuture.completedFuture(false); } this.instructions.computeIfAbsent(segmentId, i -> new CopyOnWriteArrayList<>()) .add(new SplitSegmentInstruction(result, segmentId)); return result; }
Source:
private ConsumerCoordinator buildCoordinator(final GroupRebalanceConfig rebalanceConfig, final Metrics metrics, final List<ConsumerPartitionAssignor> assignors, final boolean autoCommitEnabled) { return new ConsumerCoordinator( rebalanceConfig, new LogContext(), consumerClient, assignors, metadata, subscriptions, metrics, "consumer" + groupId, time, autoCommitEnabled, autoCommitIntervalMs, false, null); }

Target:
private ConsumerCoordinator buildCoordinator(final GroupRebalanceConfig rebalanceConfig, final Metrics metrics, final List<ConsumerPartitionAssignor> assignors, final boolean autoCommitEnabled) { return new ConsumerCoordinator( rebalanceConfig, new LogContext(), consumerClient, assignors, metadata, subscriptions, metrics, "consumer" + groupId, time, autoCommitEnabled, autoCommitIntervalMs, null); }
Source:
private boolean containtsOnlyValidXMLChars(String stringToValidate) { char current; for (int i = 0; i < stringToValidate.length(); i++) { current = stringToValidate.charAt(i); if (!((current == 0x9) || (current == 0xA) || (current == 0xD) || ((current >= 0x20) && (current <= 0xD7FF)) || ((current >= 0xE000) && (current <= 0xFFFD)) || ((current >= 0x10000) && (current <= 0x10FFFF)))) return false; } return true; }

Target:
private boolean containtsOnlyValidXMLChars(String stringToValidate) { String pattern = "[^" + "\u0009\r\n" + "\u0020-\uD7FF" + "\uE000-\uFFFD" + "\ud800\udc00-\udbff\udfff" + "]"; String resultString = stringToValidate.replaceAll(pattern, ""); return resultString.equals(stringToValidate); }
Source:
private ReadCountCollection(final List<Target> targets, final List<String> columnNames, final RealMatrix counts, final boolean verifyInput) { if (verifyInput) { Utils.nonNull(targets,"the input targets cannot be null"); Utils.nonNull(columnNames,"the column names cannot be null"); Utils.nonNull(counts,"the counts cannot be null"); Utils.containsNoNull(columnNames, "column names contain nulls"); Utils.containsNoNull(targets, "there are some null targets"); Utils.validateArg(counts.getRowDimension() == targets.size(), "number of count rows does not match the number of targets"); Utils.validateArg(counts.getColumnDimension() == columnNames.size(), "number of count columns does not match the number of column names"); Utils.validateArg(new HashSet<>(targets).size() == targets.size(), "targets contain duplicates"); Utils.validateArg(columnNames.size() == columnNames.size(), "column names contain duplicates"); this.targets = Collections.unmodifiableList(new ArrayList<>(targets)); this.columnNames = Collections.unmodifiableList(new ArrayList<>(columnNames)); this.counts = counts.copy(); } else { this.targets = targets; this.columnNames = columnNames; this.counts = counts; } this.targetIndexMap = createTargetIndexMap(this.targets); }

Target:
private ReadCountCollection(final List<Target> targets, final List<String> columnNames, final RealMatrix counts, final boolean verifyInput) { if (verifyInput) { Utils.nonNull(targets,"the input targets cannot be null"); Utils.nonNull(columnNames,"the column names cannot be null"); Utils.nonNull(counts,"the counts cannot be null"); Utils.containsNoNull(columnNames, "column names contain nulls"); Utils.containsNoNull(targets, "there are some null targets"); Utils.validateArg(counts.getRowDimension() == targets.size(), "number of count rows does not match the number of targets"); Utils.validateArg(counts.getColumnDimension() == columnNames.size(), "number of count columns does not match the number of column names"); Utils.validateArg(new HashSet<>(targets).size() == targets.size(), "targets contain duplicates"); Utils.validateArg(new HashSet<>(columnNames).size() == columnNames.size(), "column names contain duplicates"); this.targets = Collections.unmodifiableList(new ArrayList<>(targets)); this.columnNames = Collections.unmodifiableList(new ArrayList<>(columnNames)); this.counts = counts.copy(); } else { this.targets = targets; this.columnNames = columnNames; this.counts = counts; } this.targetIndexMap = createTargetIndexMap(this.targets); }
Source:
protected boolean isMetadata(Path path) { try { return Boolean.TRUE.equals(RepositoryFiles.isLsm((RepositoryPath) path)); } catch (IOException e) { logger.error(String.format("Failed to read Path attributes for [%s]", path), e); return false; } }

Target:
protected boolean isMetadata(Path path) { try { return Boolean.TRUE.equals(RepositoryFiles.isMetadata((RepositoryPath) path)); } catch (IOException e) { logger.error(String.format("Failed to read Path attributes for [%s]", path), e); return false; } }
Source:
public void enforceRestoreActive() { if (state != ChangelogReaderState.ACTIVE_RESTORING) { log.debug("Transiting to restore active tasks: {}", changelogs); pauseChangelogsFromRestoreConsumer(standbyRestoringChangelogs()); } state = ChangelogReaderState.ACTIVE_RESTORING; }

Target:
public void enforceRestoreActive() { if (state != ChangelogReaderState.ACTIVE_RESTORING) { log.debug("Transiting to restore active tasks: {}", changelogs); pauseChangelogsFromRestoreConsumer(standbyRestoringChangelogs()); state = ChangelogReaderState.ACTIVE_RESTORING; } }
Source:
public boolean hasNext() { boolean hasNext = delegate.hasNext() || !cursor.isDone(); if(!hasNext) for(BufferAggregator agg : aggregators) agg.close(); return hasNext; }

Target:
public boolean hasNext() { return delegate.hasNext() || !cursor.isDone(); }
Source:
private GitResourceVariantTreeProvider createTreeProvider() throws Exception { File file1 = testRepo.createFile(iProject, "file1"); File file2 = testRepo.createFile(iProject, "file2"); testRepo.appendContentAndCommit(iProject, file1, INITIAL_CONTENT_1, "first file - initial commit"); RevCommit baseCommit = testRepo.appendContentAndCommit(iProject, file2, INITIAL_CONTENT_2, "second file - initial commit"); testRepo.createAndCheckoutBranch(MASTER, BRANCH); setContentsAndCommit(testRepo, iFile2, BRANCH_CHANGES + INITIAL_CONTENT_2, "branch commit"); testRepo.checkoutBranch(MASTER); setContentsAndCommit(testRepo, iFile1, INITIAL_CONTENT_1 + MASTER_CHANGES, "master commit"); iProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); RevWalk walk = new RevWalk(repo); RevTree baseTree = walk.parseTree(baseCommit.getId()); RevTree sourceTree = walk.parseTree(repo.resolve(MASTER)); RevTree remoteTree = walk.parseTree(repo.resolve(BRANCH)); TreeWalk tw = new NameConflictTreeWalk(repo); tw.addTree(baseTree); tw.addTree(sourceTree); tw.addTree(remoteTree); return new TreeWalkResourceVariantTreeProvider( repo, tw, 0, 1, 2); }

Target:
private GitResourceVariantTreeProvider createTreeProvider() throws Exception { testRepo.appendContentAndCommit(iProject, file1, INITIAL_CONTENT_1, "first file - initial commit"); testRepo.appendContentAndCommit(iProject, file2, INITIAL_CONTENT_2, "second file - initial commit"); testRepo.createBranch(MASTER, BASE); testRepo.createAndCheckoutBranch(MASTER, BRANCH); setContentsAndCommit(testRepo, iFile2, BRANCH_CHANGES + INITIAL_CONTENT_2, "branch commit"); testRepo.checkoutBranch(MASTER); setContentsAndCommit(testRepo, iFile1, INITIAL_CONTENT_1 + MASTER_CHANGES, "master commit"); iProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); try (RevWalk walk = new RevWalk(repo)) { RevTree baseTree = walk.parseTree(repo.resolve(BASE)); RevTree sourceTree = walk.parseTree(repo.resolve(MASTER)); RevTree remoteTree = walk.parseTree(repo.resolve(BRANCH)); TreeWalk tw = new NameConflictTreeWalk(repo); tw.addTree(baseTree); tw.addTree(sourceTree); tw.addTree(remoteTree); return new TreeWalkResourceVariantTreeProvider(repo, tw, 0, 1, 2); } }
Source:
public static byte[] allFeatures() { final BitSet set = new BitSet(); List<IgniteFeatures> features = new LinkedList<>(Arrays.asList(IgniteFeatures.values())); if (getBoolean(IGNITE_PME_FREE_SWITCH_DISABLED)) features.remove(PME_FREE_SWITCH); for (IgniteFeatures value : features ) { final int featureId = value.getFeatureId(); assert !set.get(featureId) : "Duplicate feature ID found for [" + value + "] having same ID [" + featureId + "]"; set.set(featureId); } return set.toByteArray(); }

Target:
public static byte[] allFeatures() { final BitSet set = new BitSet(IgniteFeatures.values().length); for (IgniteFeatures value : IgniteFeatures.values()) { if (value == PME_FREE_SWITCH && getBoolean(IGNITE_PME_FREE_SWITCH_DISABLED)) continue; final int featureId = value.getFeatureId(); assert !set.get(featureId) : "Duplicate feature ID found for [" + value + "] having same ID [" + featureId + "]"; set.set(featureId); } return set.toByteArray(); }
Source:
private ConditionalSchema.Builder buildConditionalSchema() { ConditionalSchema.Builder builder = ConditionalSchema.builder(); if (ls.schemaJson().containsKey("if")) { builder.ifSchema(loadChild(ls.schemaJson().require("if").requireObject()).build()); } if (ls.schemaJson().containsKey("then")) { builder.thenSchema(loadChild(ls.schemaJson().require("then").requireObject()).build()); } if (ls.schemaJson().containsKey("else")) { builder.elseSchema(loadChild(ls.schemaJson().require("else").requireObject()).build()); } return builder; }

Target:
private ConditionalSchema.Builder buildConditionalSchema() { ConditionalSchema.Builder builder = ConditionalSchema.builder(); ls.schemaJson().maybe("if").map(this::loadChild).map(Schema.Builder::build).ifPresent(builder::ifSchema); ls.schemaJson().maybe("then").map(this::loadChild).map(Schema.Builder::build).ifPresent(builder::thenSchema); ls.schemaJson().maybe("else").map(this::loadChild).map(Schema.Builder::build).ifPresent(builder::elseSchema); return builder; }
Source:
private static List<QueryHintValue> findQueryHints(Method method, Predicate<QueryHints> annotationFilter) { List<QueryHintValue> queryHints = new ArrayList<>(); QueryHints queryHintsAnnotation = AnnotatedElementUtils.findMergedAnnotation(method, QueryHints.class); if (queryHintsAnnotation != null && annotationFilter.test(queryHintsAnnotation)) { for (QueryHint hint : queryHintsAnnotation.value()) { queryHints.add(new QueryHintValue(hint.name(), hint.value())); } } QueryHint queryHintAnnotation = AnnotationUtils.findAnnotation(method, QueryHint.class); if (queryHintAnnotation != null) { queryHints.add(new QueryHintValue(queryHintAnnotation.name(), queryHintAnnotation.value())); } return Collections.unmodifiableList(queryHints); }

Target:
private static SimpleQueryHints findQueryHints(Method method, Predicate<QueryHints> annotationFilter) { SimpleQueryHints queryHints = new SimpleQueryHints(); QueryHints queryHintsAnnotation = AnnotatedElementUtils.findMergedAnnotation(method, QueryHints.class); if (queryHintsAnnotation != null && annotationFilter.test(queryHintsAnnotation)) { for (QueryHint hint : queryHintsAnnotation.value()) { queryHints.add(hint.name(), hint.value()); } } QueryHint queryHintAnnotation = AnnotationUtils.findAnnotation(method, QueryHint.class); if (queryHintAnnotation != null) { queryHints.add(queryHintAnnotation.name(), queryHintAnnotation.value()); } return queryHints; }
Source:
public final void recordLabelCreated(final LabelCreatedEvent event) { addCallback(store.getMeta(event.getId(), event.getType()), new FutureCallback<Optional<LabelMeta>>() { @Override public void onSuccess(final Optional<LabelMeta> meta) { if (meta.isPresent()) { LOG.info("Indexing {}", meta.get()); addCallback(searchPlugin.indexLabelMeta(meta.get()), pluginError); } LOG.error("Unable to fetch LabelMeta object for {}[{}]", event.getId(), event.getType()); } @Override public void onFailure(final Throwable throwable) { LOG.error("Unable to fetch LabelMeta object for {}[{}]", event.getId(), event.getType(), throwable); } }); }

Target:
public final void recordLabelCreated(final LabelCreatedEvent event) { addCallback(store.getMeta(event.getId(), event.getType()), new FutureCallback<Optional<LabelMeta>>() { @Override public void onSuccess(final Optional<LabelMeta> meta) { if (meta.isPresent()) { LOG.info("Indexing {}", meta.get()); addCallback(searchPlugin.indexLabelMeta(meta.get()), pluginError); } LOG.warn( "Unable to fetch LabelMeta object for {}[{}]. " + "Consider setting the meta description for better indexing.", event.getId(), event.getType()); } @Override public void onFailure(final Throwable throwable) { LOG.error("Unable to fetch LabelMeta object for {}[{}]", event.getId(), event.getType(), throwable); } }); }
Source:
public void registerStore(final StateStore store, final StateRestoreCallback stateRestoreCallback) { final String storeName = store.name(); if (CHECKPOINT_FILE_NAME.equals(storeName)) { throw new IllegalArgumentException(format("%sIllegal store name: %s, which collides with the pre-defined " + "checkpoint file name", logPrefix, storeName)); } if (stores.containsKey(storeName)) { log.warn("State Store has already been registered, which could be due to a half-way registration" + "in the previous round", storeName); } final String topic = storeToChangelogTopic.get(storeName); if (topic != null) { final TopicPartition storePartition = new TopicPartition(topic, taskId.partition); final StateStoreMetadata storeMetadata = new StateStoreMetadata( store, storePartition, stateRestoreCallback, converterForStore(store)); stores.put(storeName, storeMetadata); changelogReader.register(storePartition, this); } else { stores.put(storeName, new StateStoreMetadata(store)); } log.debug("Registered state store to its state manager", storeName); }

Target:
public void registerStore(final StateStore store, final StateRestoreCallback stateRestoreCallback) { final String storeName = store.name(); if (CHECKPOINT_FILE_NAME.equals(storeName)) { throw new IllegalArgumentException(format("%sIllegal store name: %s, which collides with the pre-defined " + "checkpoint file name", logPrefix, storeName)); } if (stores.containsKey(storeName)) { throw new IllegalArgumentException(format("%sStore %s has already been registered.", logPrefix, storeName)); } final String topic = storeToChangelogTopic.get(storeName); if (topic != null) { final TopicPartition storePartition = new TopicPartition(topic, taskId.partition); final StateStoreMetadata storeMetadata = new StateStoreMetadata( store, storePartition, stateRestoreCallback, converterForStore(store)); stores.put(storeName, storeMetadata); changelogReader.register(storePartition, this); } else { stores.put(storeName, new StateStoreMetadata(store)); } log.debug("Registered state store to its state manager", storeName); }
Source:
public void test_Han_Latin() throws Exception { Transliterator t = Transliterator.getInstance("Han-Latin"); assertEquals("hàn zì/hàn zì", t.transliterate("汉字/漢字")); assertEquals("chén", t.transliterate("\u6c88")); assertEquals("shěn", t.transliterate("\u700b")); assertEquals("gǔ", t.transliterate("\u8d3e")); t = Transliterator.getInstance("Han-Latin/Names"); assertEquals("shěn", t.transliterate("\u6c88")); assertEquals("shěn", t.transliterate("\u700b")); assertEquals("gǔ", t.transliterate("\u8d3e")); t = Transliterator.getInstance("Han-Latin/Names; Latin-Ascii; Any-Upper"); assertEquals("SHEN", t.transliterate("\u6c88")); assertEquals("SHEN", t.transliterate("\u700b")); assertEquals("GU", t.transliterate("\u8d3e")); }

Target:
public void test_Han_Latin() throws Exception { Transliterator t = Transliterator.getInstance("Han-Latin"); assertEquals("hàn zì/hàn zì", t.transliterate("汉字/漢字")); assertEquals("chén", t.transliterate("\u6c88")); assertEquals("shěn", t.transliterate("\u700b")); assertEquals("jiǎ", t.transliterate("\u8d3e")); t = Transliterator.getInstance("Han-Latin/Names"); assertEquals("shěn", t.transliterate("\u6c88")); assertEquals("shěn", t.transliterate("\u700b")); assertEquals("jiǎ", t.transliterate("\u8d3e")); t = Transliterator.getInstance("Han-Latin/Names; Latin-Ascii; Any-Upper"); assertEquals("SHEN", t.transliterate("\u6c88")); assertEquals("SHEN", t.transliterate("\u700b")); assertEquals("JIA", t.transliterate("\u8d3e")); }
Source:
public byte[] serialize(Object object) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(bos); oos.writeObject(object); oos.flush(); } catch (IOException e) { throw new RuntimeException("NotSerializable object is: " + object.toString(), e); } return bos.toByteArray(); }

Target:
public byte[] serialize(Object object) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(bos); oos.writeObject(object); oos.flush(); } catch (IOException e) { throw new RuntimeException("Failed to serialize object: " + object.toString(), e); } return bos.toByteArray(); }
Source:
public DataObjectDeletedEvent( Project currentProject, DataObject currentDataObject ) { super( null, currentProject, currentDataObject ); }

Target:
public DataObjectDeletedEvent( Project currentProject, DataObject currentDataObject ) { super( currentProject, currentDataObject ); }
Source:
public void testCloneWhenSourceIsInputData() { final InputData source = buildInputData(); setLinks(source, FIRST_URL, SECOND_URL); final InputData cloned = dmnDeepCloneProcess.clone(source, new InputData()); assertThat(cloned).isNotNull(); assertThat(cloned.getId().getValue()).isNotEqualTo(SOURCE_ID); assertThat(cloned.getName().getValue()).isEqualTo(INPUT_DATA_NAME); assertThat(cloned.getVariable().getTypeRef()).isEqualTo(BuiltInType.STRING.asQName()); assertThat(cloned.getLinksHolder().getValue().getLinks()).hasSize(2); assertThat(cloned.getLinksHolder().getValue().getLinks()).first().extracting("url").isEqualTo(FIRST_URL); }

Target:
public void testCloneWhenSourceIsInputData() { final InputData source = buildInputData(); setLinks(source, FIRST_URL, SECOND_URL); final InputData cloned = dmnDeepCloneProcess.clone(source, new InputData()); assertThat(cloned).isNotNull(); assertThat(cloned.getId().getValue()).isNotEqualTo(SOURCE_ID); assertThat(cloned.getName().getValue()).isEqualTo(INPUT_DATA_NAME); assertThat(cloned.getVariable().getTypeRef()).isEqualTo(BuiltInType.STRING.asQName()); assertThat(cloned.getLinksHolder().getValue().getLinks()) .hasSize(2) .extracting(DMNExternalLink::getUrl).contains(FIRST_URL, SECOND_URL); }
Source:
public XYTimeQueryFilter(long start, long end, int n, Collection<Long> entryIds) { super(start, end, n); fEntryIds = entryIds; }

Target:
public XYTimeQueryFilter(long start, long end, int n, Collection<Long> entryIds) { super(start, end, n); fEntryIds = Collections.unmodifiableCollection(entryIds); }
Source:
protected Config createConfig() { Config config = new Config(); config.setProperty(GroupProperty.MEMCACHE_ENABLED.getName(), "true"); JoinConfig join = config.getNetworkConfig().getJoin(); join.getMulticastConfig().setEnabled(false); join.getTcpIpConfig().setEnabled(false); return config; }

Target:
protected Config createConfig() { Config config = smallInstanceConfig(); config.setProperty(GroupProperty.MEMCACHE_ENABLED.getName(), "true"); JoinConfig join = config.getNetworkConfig().getJoin(); join.getMulticastConfig().setEnabled(false); join.getTcpIpConfig().setEnabled(false); return config; }
Source:
protected TestInstanceFactory resolveTestInstanceFactory(ExtensionRegistry registry, ExtensionRegistry parentRegistry) { List<TestInstanceFactory> factories = registry.getExtensions(TestInstanceFactory.class); if (factories.isEmpty()) { return null; } if (parentRegistry != null) { List<TestInstanceFactory> parentFactories = parentRegistry.getExtensions(TestInstanceFactory.class); factories.removeAll(parentFactories); } if (factories.size() > 1) { String factoryNames = factories.stream().map(factory -> factory.getClass().getSimpleName()).collect( Collectors.joining(",")); String errorMessage = String.format( "Too many TestInstanceFactory extensions [%s] registered on test class: %s", factoryNames, testClass.getSimpleName()); throw new JUnitException(errorMessage); } return factories.get(0); }

Target:
protected TestInstanceFactory resolveTestInstanceFactory(ExtensionRegistry registry, ExtensionRegistry parentRegistry) { List<TestInstanceFactory> factories = registry.getExtensions(TestInstanceFactory.class); if (factories.isEmpty()) { return null; } if (parentRegistry != null) { List<TestInstanceFactory> parentFactories = parentRegistry.getExtensions(TestInstanceFactory.class); factories.removeAll(parentFactories); } if (factories.size() > 1) { String factoryNames = factories.stream().map(factory -> factory.getClass().getSimpleName()).collect( Collectors.joining(",")); String errorMessage = String.format( "Too many TestInstanceFactory extensions [%s] registered on test class: %s (allowed is at most 1)", factoryNames, testClass.getSimpleName()); throw new ExtensionContextException(errorMessage); } return factories.get(0); }
Source:
public void testPrepareObjectMapperWithNullObjectMapper() { try { DataFlowTemplate.prepareObjectMapper(null); } catch (IllegalArgumentException e) { assertEquals("The objectMapper must not be null.", e.getMessage()); return; } fail("Expected an IllegalArgumentException to be thrown."); }

Target:
public void testPrepareObjectMapperWithNullObjectMapper() { try { DataFlowTemplate.prepareObjectMapper(null); fail("Expected an IllegalArgumentException to be thrown."); } catch (IllegalArgumentException e) { assertEquals("The objectMapper must not be null.", e.getMessage()); return; } }
Source:
public RestartRequirement onApply(UserPrefs prefs) { RestartRequirement restartRequirement = super.onApply(prefs); prefs_.ansiConsoleMode().setGlobalValue(consoleColorMode_.getValue()); if (prefs_.highlightConsoleErrors().getValue() != initialHighlightConsoleErrors_) { initialHighlightConsoleErrors_ = prefs_.highlightConsoleErrors().getValue(); restartRequirement.setRestartRequired(); } if (!restartRequirement.getDesktopRestartRequired() && !restartRequirement.getUiReloadRequired()) { if (prefs_.limitVisibleConsole().getValue() != initialLimitVisibleConsole_) { initialLimitVisibleConsole_ = prefs_.limitVisibleConsole().getValue(); if (Desktop.isDesktop()) restartRequirement.setDesktopRestartRequired(true); else restartRequirement.setUiReloadRequired(true); } } return restartRequirement; }

Target:
public RestartRequirement onApply(UserPrefs prefs) { RestartRequirement restartRequirement = super.onApply(prefs); prefs_.ansiConsoleMode().setGlobalValue(consoleColorMode_.getValue()); if (prefs_.highlightConsoleErrors().getValue() != initialHighlightConsoleErrors_) { initialHighlightConsoleErrors_ = prefs_.highlightConsoleErrors().getValue(); restartRequirement.setRestartRequired(); } if (!restartRequirement.getDesktopRestartRequired() && !restartRequirement.getUiReloadRequired()) { if (prefs_.limitVisibleConsole().getValue() != initialLimitVisibleConsole_) { initialLimitVisibleConsole_ = prefs_.limitVisibleConsole().getValue(); restartRequirement.setRestartRequired(); } } return restartRequirement; }
Source:
public Optional<Iterable<String>> getFlags(String field) { Optional<String> value = delegate.getValue(SECTION_NAME, field); return value.map(input -> Splitter.on(" ").split(input.trim())); }

Target:
private Optional<Iterable<String>> getFlags(String field) { Optional<String> value = delegate.getValue(SECTION_NAME, field); return value.map(input -> Splitter.on(" ").split(input.trim())); }
Source:
public static String toArrayTypeString(ArrayType type, Context context) { TypeMirror componentMirror = type.getComponentType(); if ( !componentMirror.getAnnotationMirrors().isEmpty() ) { TypeMirror component = type.getComponentType().accept( new SimpleTypeVisitor6<TypeMirror, Void>() { @Override protected TypeMirror defaultAction(TypeMirror e, Void aVoid) { return e; } }, null ); return extractClosestRealTypeAsString( component, context ) + "[]"; } return toTypeString( type ); }

Target:
public static String toArrayTypeString(ArrayType type, Context context) { TypeMirror component = type.getComponentType().accept( new SimpleTypeVisitor6<TypeMirror, Void>() { @Override protected TypeMirror defaultAction(TypeMirror e, Void aVoid) { return e; } }, null ); return extractClosestRealTypeAsString( component, context ) + "[]"; }