auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void handleCommand(String command, String... arguments) { switch (command) { case "setFbo": if (arguments.length != 1) { throw new RuntimeException("Invalid number of arguments; expected 1, received " + arguments.length + "!"); } FBO fbo; switch (arguments[0]) { case "engine:fbo.gBuffer": case "engine:fbo.lastUpdatedGBuffer": fbo = lastUpdatedGBuffer; break; case "engine:fbo.staleGBuffer": fbo = staleGBuffer; break; default: fbo = displayResolutionDependentFBOs.get(new SimpleUri(arguments[0])); if (fbo == null) { <START> throw new RuntimeException("Invalid fbo uri: " + arguments[0] + "!"); <END> } break; } setFbo(fbo); break; default: throw new RuntimeException("Invalid command: " + command + "!"); } }</code><technical_language>a bit more specific here: ("No FBO is URI '" + arguments[0] + "'")</technical_language>

Target:
public void handleCommand(String command, String... arguments) { switch (command) { case "setFbo": if (arguments.length != 1) { throw new RuntimeException("Invalid number of arguments; expected 1, received " + arguments.length + "!"); } FBO fbo; switch (arguments[0]) { case "engine:fbo.gBuffer": case "engine:fbo.lastUpdatedGBuffer": fbo = lastUpdatedGBuffer; break; case "engine:fbo.staleGBuffer": fbo = staleGBuffer; break; default: fbo = displayResolutionDependentFBOs.get(new SimpleUri(arguments[0])); if (fbo == null) { throw new RuntimeException(("No FBO is associated with URI '" + arguments[0] + "'")); } break; } setFbo(fbo); break; default: throw new RuntimeException("Unrecognized command: '" + command + "'"); } }
Source:
<code>public void spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnError() throws Throwable { subscriberTestWithoutSetup(new TestStageTestRun() { @Override public void run(WhiteboxTestStage stage) throws Throwable { final Subscription subs = new Subscription() { @Override public void request(long n) { Throwable thr = new Throwable(); for (StackTraceElement stackElem : thr.getStackTrace()) { if (stackElem.getMethodName().equals("onError")) { env.flop(String.format("Subscription::request MUST NOT be called from Subscriber::onError! (Caller: %s::%s line %d)", stackElem.getClassName(), stackElem.getMethodName(), stackElem.getLineNumber())); } } } @Override public void cancel() { Throwable thr = new Throwable(); for (StackTraceElement stackElem : thr.getStackTrace()) { if (stackElem.getMethodName().equals("onError")) { env.flop(String.format("Subscription::cancel MUST NOT be called from Subscriber::onError! (Caller: %s::%s line %d)", stackElem.getClassName(), stackElem.getMethodName(), stackElem.getLineNumber())); } } } }; stage.probe = stage.createWhiteboxSubscriberProbe(env); final Subscriber<T> sub = createSubscriber(stage.probe); sub.onSubscribe(subs); <START> sub.onError(new Throwable("Test Exception: Boom!")); <END> env.verifyNoAsyncErrors(); } }); }</code><technical_language>@ktoso reason for this caught implementations</technical_language>

Target:
public void spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnError() throws Throwable { subscriberTestWithoutSetup(new TestStageTestRun() { @Override public void run(WhiteboxTestStage stage) throws Throwable { final Subscription subs = new Subscription() { @Override public void request(long n) { Throwable thr = new Throwable(); for (StackTraceElement stackElem : thr.getStackTrace()) { if (stackElem.getMethodName().equals("onError")) { env.flop(String.format("Subscription::request MUST NOT be called from Subscriber::onError (Rule 2.3)! (Caller: %s::%s line %d)", stackElem.getClassName(), stackElem.getMethodName(), stackElem.getLineNumber())); } } } @Override public void cancel() { Throwable thr = new Throwable(); for (StackTraceElement stackElem : thr.getStackTrace()) { if (stackElem.getMethodName().equals("onError")) { env.flop(String.format("Subscription::cancel MUST NOT be called from Subscriber::onError (Rule 2.3)! (Caller: %s::%s line %d)", stackElem.getClassName(), stackElem.getMethodName(), stackElem.getLineNumber())); } } } }; stage.probe = stage.createWhiteboxSubscriberProbe(env); final Subscriber<T> sub = createSubscriber(stage.probe); sub.onSubscribe(subs); sub.onError(new TestException()); env.verifyNoAsyncErrors(); } }); }
Source:
<code>public FileMode getIndexFileMode(final DirCacheIterator indexIter) { final FileMode wtMode = getEntryFileMode(); if (indexIter != null && !getOptions().isFileMode() && FileMode.REGULAR_FILE == wtMode <START> && FileMode.EXECUTABLE_FILE == indexIter.getEntryFileMode()) <END> return FileMode.EXECUTABLE_FILE; return wtMode; }</code><technical_language>I missed this previous turn, I think; filemode is false changes regular executable vice verse ignored</technical_language>

Target:
public FileMode getIndexFileMode(final DirCacheIterator indexIter) { final FileMode wtMode = getEntryFileMode(); if (indexIter == null) return wtMode; if (getOptions().isFileMode()) return wtMode; final FileMode iMode = indexIter.getEntryFileMode(); if (FileMode.REGULAR_FILE == wtMode && FileMode.EXECUTABLE_FILE == iMode) return iMode; if (FileMode.EXECUTABLE_FILE == wtMode && FileMode.REGULAR_FILE == iMode) return iMode; return wtMode; }
Source:
<code><START> private void resetPreferences() { <END> IPreferenceStore prefs = DiagramUIPlugin.getPlugin().getPreferenceStore(); for (String key : oldValueDiagramUIPreferences.keySet()) { prefs.setValue(key, (Boolean) oldValueDiagramUIPreferences.get(key)); } boolean currentUiPreference = prefs.getBoolean(SiriusDiagramUiPreferencesKeys.PREF_OLD_UI.name()); if (currentUiPreference) { System.out.println("This test has not reset the oldUiPreference : " + this.getClass().getName() + " (it is currently true)."); } IPreferenceStore platformPrefs = PlatformUI.getPreferenceStore(); for (String key : oldPlatformUIPreferences.keySet()) { platformPrefs.setValue(key, (Boolean) oldPlatformUIPreferences.get(key)); } IPreferenceStore viewpointUIPrefs = SiriusEditPlugin.getPlugin().getPreferenceStore(); for (String key : oldValueSiriusUIPreferences.keySet()) { viewpointUIPrefs.setValue(key, (Boolean) oldValueSiriusUIPreferences.get(key)); } IEclipsePreferences corePreferences = InstanceScope.INSTANCE.getNode(SiriusPlugin.ID); for (String key : oldValueSiriusPreferences.keySet()) { corePreferences.putBoolean(key, (Boolean) oldValueSiriusPreferences.get(key)); } }</code><technical_language>oldValueDiagramPreferences is reset !!! In patch set 1, "Done in next patch set.", is is case</technical_language>

Target:
private void resetPreferences() { IEclipsePreferences diagamCorePreferences = InstanceScope.INSTANCE.getNode(DiagramPlugin.ID); for (String key : oldValueDiagramPreferences.keySet()) { resetDiagramPreference(key, diagamCorePreferences); } IPreferenceStore diagramUIPreferences = DiagramUIPlugin.getPlugin().getPreferenceStore(); for (String key : oldValueDiagramUIPreferences.keySet()) { resetDiagramUIPreference(key, diagramUIPreferences); } boolean currentUiPreference = diagramUIPreferences.getBoolean(SiriusDiagramUiPreferencesKeys.PREF_OLD_UI.name()); if (currentUiPreference) { System.out.println("This test has not reset the oldUiPreference : " + this.getClass().getName() + " (it is currently true)."); } IPreferenceStore platformPrefs = PlatformUI.getPreferenceStore(); for (String key : oldPlatformUIPreferences.keySet()) { platformPrefs.setValue(key, (Boolean) oldPlatformUIPreferences.get(key)); } IPreferenceStore viewpointUIPrefs = SiriusEditPlugin.getPlugin().getPreferenceStore(); for (String key : oldValueSiriusUIPreferences.keySet()) { viewpointUIPrefs.setValue(key, (Boolean) oldValueSiriusUIPreferences.get(key)); } IEclipsePreferences corePreferences = InstanceScope.INSTANCE.getNode(SiriusPlugin.ID); for (String key : oldValueSiriusPreferences.keySet()) { corePreferences.putBoolean(key, (Boolean) oldValueSiriusPreferences.get(key)); } }
Source:
<code>public void initialize(URL location, ResourceBundle resources) { setData(); <START> ps.configProperty().addListener(pc -> cs.setSelectedDate(LocalDate.now())); <END> }</code><technical_language>moved constructor, depending UI stuff</technical_language>

Target:
public void initialize(URL location, ResourceBundle resources) { setData(); }
Source:
<code>private String getClientEngineUrl(BootstrapContext context) { final boolean productionMode = context.getSession() .getConfiguration().isProductionMode(); ResourceProvider resourceProvider = context.getSession() .getService().getContext().getAttribute(Lookup.class) <START> .lookup(ResourceProvider.class); <END> String clientEngine = getClientEngine(resourceProvider); boolean resolveNow = !productionMode || clientEngine == null; if (resolveNow && resourceProvider.getClientResource("/META-INF/resources/" + CLIENT_ENGINE_NOCACHE_FILE) != null) { return context.getUriResolver().resolveVaadinUri( "context://" + CLIENT_ENGINE_NOCACHE_FILE); } if (clientEngine == null) { throw new BootstrapException( "Client engine file name has not been resolved during initialization"); } return context.getUriResolver() .resolveVaadinUri("context://" + clientEngine); }</code><technical_language>this a shorthand in BootstrapContext getReourceProvider()</technical_language>

Target:
private String getClientEngineUrl(BootstrapContext context) { final boolean productionMode = context.getSession() .getConfiguration().isProductionMode(); ResourceProvider resourceProvider = getResourceProvider(context); String clientEngine = getClientEngine(resourceProvider); boolean resolveNow = !productionMode || clientEngine == null; if (resolveNow && resourceProvider.getClientResource("/META-INF/resources/" + CLIENT_ENGINE_NOCACHE_FILE) != null) { return context.getUriResolver().resolveVaadinUri( "context://" + CLIENT_ENGINE_NOCACHE_FILE); } if (clientEngine == null) { throw new BootstrapException( "Client engine file name has not been resolved during initialization"); } return context.getUriResolver() .resolveVaadinUri("context://" + clientEngine); }
Source:
<code>private static byte[] clearZeroBytesFromString(byte[] data, int maxLength) { if (data == null) return null; ByteArrayOutputStream dataOut = new ByteArrayOutputStream() ; int limit = (maxLength < data.length) ? maxLength - 4 : data.length; for (int i = 0; i < limit; i++) { if (data[i] != 0x00) dataOut.write(data[i]); } if (maxLength < data.length) { if (data[limit-1] < 0 && data[limit-1] >= (byte)0xC0) { dataOut.write(data[limit]); } <START> if (data[limit-1] < 0 && data[limit-1] >= (byte)0xE0) { <END> dataOut.write(data[limit+1]); } if (data[limit-1] < 0 && data[limit-1] >= (byte)0xF0) { dataOut.write(data[limit+2]); } } return dataOut.toByteArray(); }</code><technical_language>Please, remove of changes this PR. figured out solution this problem is more complicated I create a separate PR resolving this problem</technical_language>

Target:
private static byte[] clearZeroBytesFromString(byte[] data, int maxLength) { if (data == null) return null; ByteArrayOutputStream dataOut = new ByteArrayOutputStream() ; int limit = (maxLength < data.length) ? maxLength - 4 : data.length; for (int i = 0; i < limit; i++) { if (data[i] != 0x00) dataOut.write(data[i]); } if(maxLength < data.length) { if(data[limit-1] >= 0xC0 ) { dataOut.write(data[limit]); } if(data[limit-1] >= 0xE0 ) { dataOut.write(data[limit+1]); } if(data[limit-1] >= 0xF0 ) { dataOut.write(data[limit+2]); } } return dataOut.toByteArray(); }
Source:
<code>public void createObjectFromJson_streamNullClass() throws IOException { InputStream in = TestHelper.loadJsonFromAssets(context, "array.json"); realm.beginTransaction(); AnnotationTypes result = realm.createObjectFromJson(null, in); realm.cancelTransaction(); in.close(); <START> assertNull(result); <END> }</code><technical_language>assert cancel transaction</technical_language>

Target:
public void createObjectFromJson_streamNullClass() throws IOException { InputStream in = TestHelper.loadJsonFromAssets(context, "array.json"); realm.beginTransaction(); assertNull(realm.createObjectFromJson(null, in)); realm.commitTransaction(); in.close(); }
Source:
<code>private static void clickColumn(final SWTBotTree tree, SWTBotTreeColumn processColumn, SWTBotTestCondition condition) { processColumn.click(); <START> SWTBotUtils.delay(1000); <END> tree.pressShortcut(Keystrokes.HOME); SWTBotUtils.delay(2000); fBot.waitUntil(condition); }</code><technical_language>try remove this? delays tend flaky (and slow)</technical_language>

Target:
private static void clickColumn(final SWTBotTree tree, SWTBotTreeColumn processColumn, SWTBotTestCondition condition) { processColumn.click(); fBot.waitUntil(condition); }
Source:
<code>void doOnProcessorChange(List<String> processors) { List<String> currentProcessorIds = getActualProcessorIds(processors); Set<String> uniqueProcessorIds = new HashSet<String>(currentProcessorIds); if (currentProcessorIds.size() != uniqueProcessorIds.size()) { LOG.info("Processors: has duplicates. Not generating job model.", currentProcessorIds); return; } JobModel jobModel = generateNewJobModel(currentProcessorIds); if (!hasCreatedStreams) { CheckpointManagerUtil.createAndInit(jobModel, metrics.getMetricsRegistry()); <START> ChangelogPartitionManager.createChangeLogStreams(this.getClass().getSimpleName(), jobModel); <END> hasCreatedStreams = true; } String currentJMVersion = zkUtils.getJobModelVersion(); String nextJMVersion; if (currentJMVersion == null) { nextJMVersion = "1"; } else { nextJMVersion = Integer.toString(Integer.valueOf(currentJMVersion) + 1); } LOG.info("pid=" + processorId + "Generated new Job Model. Version = " + nextJMVersion); zkUtils.publishJobModel(nextJMVersion, jobModel); barrier.create(nextJMVersion, currentProcessorIds); zkUtils.publishJobModelVersion(currentJMVersion, nextJMVersion); LOG.info("pid=" + processorId + "Published new Job Model. Version = " + nextJMVersion); debounceTimer.scheduleAfterDebounceTime(ON_ZK_CLEANUP, 0, () -> zkUtils.cleanupZK(NUM_VERSIONS_TO_LEAVE)); }</code><technical_language>create multiple APIs createChangeLogStreams? This method is defined static, while in other places, instantiate instance of ChangelogPartitionManager (i.e. fromConfig() calling constructor). Why? nice a consistent pattern create changelog streams</technical_language>

Target:
void doOnProcessorChange(List<String> processors) { List<String> currentProcessorIds = getActualProcessorIds(processors); Set<String> uniqueProcessorIds = new HashSet<String>(currentProcessorIds); if (currentProcessorIds.size() != uniqueProcessorIds.size()) { LOG.info("Processors: has duplicates. Not generating job model.", currentProcessorIds); return; } JobModel jobModel = generateNewJobModel(currentProcessorIds); if (!hasCreatedStreams) { CheckpointManager checkpointManager = new TaskConfigJava(jobModel.getConfig()).getCheckpointManager(metrics.getMetricsRegistry()); if (checkpointManager != null) { checkpointManager.createResources(); } ChangelogStreamManager.createChangelogStreams(jobModel.getConfig(), jobModel.maxChangeLogStreamPartitions); hasCreatedStreams = true; } String currentJMVersion = zkUtils.getJobModelVersion(); String nextJMVersion = zkUtils.getNextJobModelVersion(currentJMVersion); LOG.info("pid=" + processorId + "Generated new Job Model. Version = " + nextJMVersion); zkUtils.publishJobModel(nextJMVersion, jobModel); barrier.create(nextJMVersion, currentProcessorIds); zkUtils.publishJobModelVersion(currentJMVersion, nextJMVersion); LOG.info("pid=" + processorId + "Published new Job Model. Version = " + nextJMVersion); debounceTimer.scheduleAfterDebounceTime(ON_ZK_CLEANUP, 0, () -> zkUtils.cleanupZK(NUM_VERSIONS_TO_LEAVE)); }
Source:
<code>public RecentWikiActivity goBackToRWA() { wait.forElementClickable(backArrow); backArrow.click(); loading.handleAsyncPageReload(); PageObjectLogging.logInfo("The arrow that redirect user back to RWA was clicked"); <START> Assertion.assertTrue(driver.getCurrentUrl().contains(URLsContent.RECENT_WIKI_ACTIVITY), <END> "You were not redirected to the recent wiki activity"); PageObjectLogging.logInfo("You were redirected to the recent wiki activity"); return this; }</code><technical_language>Moving assertion test test more readable - reading assertion idea _what is expected behaviour?_ Hiding assertion is a bad pattern, I a lot in legacy code, I in new tests ;)</technical_language>

Target:
public RecentWikiActivity goBackToRWA() { wait.forElementClickable(backArrow); backArrow.click(); loading.handleAsyncPageReload(); PageObjectLogging.logInfo("The arrow that redirect user back to RWA was clicked"); return this; }
Source:
<code>public static ParseNode getViewWhereWithViewTTL(StatementContext context, PTable table) throws SQLException { ParseNode viewWhere = null; Long nowTS = context.getConnection().getSCN() == null ? EnvironmentEdgeManager.currentTimeMillis() : context.getConnection().getSCN(); String viewStatement = null; String viewTTLFilterClause = String.format( <START> "((%d - TO_NUMBER(phoenix_row_timestamp())) < %d)", nowTS, table.getViewTTL()); <END> if (table.getViewStatement() != null) { viewStatement = table.getViewStatement(); } else if (table.getType() == PTableType.INDEX) { String schemaName = table.getParentSchemaName().getString(); String tableName = table.getParentTableName().getString(); PTable dataTable = PhoenixRuntime.getTable(context.getConnection(), SchemaUtil.getTableName(schemaName, tableName)); viewStatement = IndexUtil .rewriteViewStatement(context.getConnection(), table, dataTable, dataTable.getViewStatement()); } if (viewStatement != null) { ParseNodeFactory nodeFactory = new ParseNodeFactory(); ParseNode viewTTLFilter = SQLParser.parseCondition(viewTTLFilterClause); ParseNode viewStmtWhere = new SQLParser(viewStatement).parseQuery().getWhere(); List<ParseNode> children = Lists.newArrayList(viewStmtWhere, viewTTLFilter); viewWhere = nodeFactory.and(children); } return viewWhere; }</code><technical_language>here. If phoenix row ts is server-side ts, compare server-side ts instead of client-side</technical_language>

Target:
public static ParseNode getViewWhereWithViewTTL(StatementContext context, PTable table) throws SQLException { ParseNode viewWhere = null; String viewStatement = null; String viewTTLFilterClause = context.getConnection().getSCN() == null ? String.format( "((TO_NUMBER(CURRENT_TIME()) - TO_NUMBER(phoenix_row_timestamp())) < %d)", table.getViewTTL()) : String.format( "((%d - TO_NUMBER(phoenix_row_timestamp())) < %d)", context.getConnection().getSCN(), table.getViewTTL()); if (table.getViewStatement() != null) { viewStatement = table.getViewStatement(); } else if (table.getType() == PTableType.INDEX) { String schemaName = table.getParentSchemaName().getString(); String tableName = table.getParentTableName().getString(); PTable dataTable = PhoenixRuntime.getTable(context.getConnection(), SchemaUtil.getTableName(schemaName, tableName)); viewStatement = IndexUtil .rewriteViewStatement(context.getConnection(), table, dataTable, dataTable.getViewStatement()); } if (viewStatement != null) { ParseNodeFactory nodeFactory = new ParseNodeFactory(); ParseNode viewTTLFilter = SQLParser.parseCondition(viewTTLFilterClause); ParseNode viewStmtWhere = new SQLParser(viewStatement).parseQuery().getWhere(); List<ParseNode> children = Lists.newArrayList(viewStmtWhere, viewTTLFilter); viewWhere = nodeFactory.and(children); } return viewWhere; }
Source:
<code>private static Node buildKdbTreeNode(int maxItemsPerNode, int level, Rectangle extent, List<Rectangle> items, LeafIdAllocator leafIdAllocator) { checkArgument(maxItemsPerNode > 0, "maxItemsPerNode must be > 0"); checkArgument(level >= 0, "level must be >= 0"); checkArgument(level <= MAX_LEVELS, "level must be <= 10,000"); requireNonNull(extent, "extent is null"); requireNonNull(items, "items is null"); <START> if (items.size() <= 1 || items.size() <= maxItemsPerNode || level == MAX_LEVELS) { <END> return newLeaf(extent, leafIdAllocator.next()); } boolean splitVertically = extent.getWidth() >= extent.getHeight(); Optional<SplitResult<Node>> splitResult = trySplit(splitVertically ? BY_X : BY_Y, maxItemsPerNode, level, extent, items, leafIdAllocator); if (!splitResult.isPresent()) { splitResult = trySplit(splitVertically ? BY_Y : BY_X, maxItemsPerNode, level, extent, items, leafIdAllocator); } if (!splitResult.isPresent()) { return newLeaf(extent, leafIdAllocator.next()); } return newInternal(extent, splitResult.get().getLeft(), splitResult.get().getRight()); }</code><technical_language>if maxItemsPerNode > 0 (per check above), items.size() <= maxItemsPerNode => items.size() <= 1, is redundant</technical_language>

Target:
private static Node buildKdbTreeNode(int maxItemsPerNode, int level, Rectangle extent, List<Rectangle> items, LeafIdAllocator leafIdAllocator) { checkArgument(maxItemsPerNode > 0, "maxItemsPerNode must be > 0"); checkArgument(level >= 0, "level must be >= 0"); checkArgument(level <= MAX_LEVELS, "level must be <= 10,000"); requireNonNull(extent, "extent is null"); requireNonNull(items, "items is null"); if (items.size() <= maxItemsPerNode || level == MAX_LEVELS) { return newLeaf(extent, leafIdAllocator.next()); } boolean splitVertically = extent.getWidth() >= extent.getHeight(); Optional<SplitResult<Node>> splitResult = trySplit(splitVertically ? BY_X : BY_Y, maxItemsPerNode, level, extent, items, leafIdAllocator); if (!splitResult.isPresent()) { splitResult = trySplit(splitVertically ? BY_Y : BY_X, maxItemsPerNode, level, extent, items, leafIdAllocator); } if (!splitResult.isPresent()) { return newLeaf(extent, leafIdAllocator.next()); } return newInternal(extent, splitResult.get().getLeft(), splitResult.get().getRight()); }
Source:
<code>public boolean mayProceed(String studyOid) throws Exception { boolean accessPermission = false; StudyBean study = getStudy(studyOid); StudyBean pStudy = getParentStudy(studyOid); StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource); StudyParameterValueBean pStatus = spvdao.findByHandleAndStudy(pStudy.getId(), "participantPortal"); String participateStatus = pStatus.getValue().toString(); <START> if( participateStatus.equals("enabled") && study.getStatus().isAvailable()){ <END> accessPermission = true; } return accessPermission; }</code><technical_language>Instead of hardcoding "enabled", ModuleProcessor.ModuleStatus.ENABLED.getValue() well</technical_language>

Target:
public boolean mayProceed(String studyOid) throws Exception { boolean accessPermission = false; StudyBean study = getStudy(studyOid); StudyBean pStudy = getParentStudy(studyOid); StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource); StudyParameterValueBean pStatus = spvdao.findByHandleAndStudy(pStudy.getId(), "participantPortal"); String participateStatus = pStatus.getValue().toString(); if( participateStatus.equals(ModuleProcessor.ModuleStatus.ENABLED.getValue()) && study.getStatus().isAvailable()){ accessPermission = true; } return accessPermission; }
Source:
<code>public Iterator<Host> newQueryPlan(String loggedKeyspace, Statement statement) { final Iterator<Host> childQueryPlan = childPolicy.newQueryPlan(loggedKeyspace, statement); return new AbstractIterator<Host>() { private Queue<Host> skipped; @Override protected Host computeNext() { while (childQueryPlan.hasNext()) { Host host = childQueryPlan.next(); if (errorTracker.isHostValid(host)) { return host; } if (skipped == null) skipped = new ArrayDeque<Host>(); <START> skipped.offer(host); <END> } if (skipped != null && !skipped.isEmpty()) return skipped.poll(); return endOfData(); } }; }</code><technical_language>if return hosts all</technical_language>

Target:
public Iterator<Host> newQueryPlan(String loggedKeyspace, Statement statement) { final Iterator<Host> childQueryPlan = childPolicy.newQueryPlan(loggedKeyspace, statement); return new AbstractIterator<Host>() { @Override protected Host computeNext() { while (childQueryPlan.hasNext()) { Host host = childQueryPlan.next(); if (!errorTracker.isExcluded(host)) { return host; } } return endOfData(); } }; }
Source:
<code>public boolean isValid(String value, ConstraintValidatorContext context) { if (value == null) { return false; } <START> return pattern.matcher(value).matches() ? true : false; <END> }</code><technical_language>return pattern.matcher(value).matches();</technical_language>

Target:
public boolean isValid(String value, ConstraintValidatorContext context) { if (value == null) { return false; } return pattern.matcher(value).matches(); }
Source:
<code>private ToolBar createToolbar(final MUIElement element, Composite parent) { int orientation = getOrientation(element); int style = orientation | SWT.WRAP | SWT.FLAT | SWT.RIGHT; ToolBarManager manager = getManager((MToolBar) element); if (manager == null) { manager = new ToolBarManager(style); IContributionManagerOverrides overrides = null; MApplicationElement parentElement = element.getParent(); if (parentElement == null) { parentElement = (MApplicationElement) ((EObject) element) .eContainer(); } if (parentElement != null) { overrides = (IContributionManagerOverrides) parentElement .getTransientData().get( IContributionManagerOverrides.class.getName()); } manager.setOverrides(overrides); linkModelToManager((MToolBar) element, manager); } else { ToolBar toolBar = manager.getControl(); if (toolBar != null && !toolBar.isDisposed() && (toolBar.getStyle() & orientation) == 0) { <START> manager.dispose(); <END> } manager.setStyle(style); } ToolBar bar = manager.createControl(parent); bar.setData(manager); bar.setData(AbstractPartRenderer.OWNING_ME, element); bar.getShell().layout(new Control[] { bar }, SWT.DEFER); bar.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { cleanUp((MToolBar) element); } }); return bar; }</code><technical_language>I expect dispose toolBar here. Is reason dispose manager</technical_language>

Target:
private ToolBar createToolbar(final MUIElement element, Composite parent) { int orientation = getOrientation(element); int style = orientation | SWT.WRAP | SWT.FLAT | SWT.RIGHT; ToolBarManager manager = getManager((MToolBar) element); if (manager == null) { manager = new ToolBarManager(style); IContributionManagerOverrides overrides = null; MApplicationElement parentElement = element.getParent(); if (parentElement == null) { parentElement = (MApplicationElement) ((EObject) element) .eContainer(); } if (parentElement != null) { overrides = (IContributionManagerOverrides) parentElement .getTransientData().get( IContributionManagerOverrides.class.getName()); } manager.setOverrides(overrides); linkModelToManager((MToolBar) element, manager); } else { ToolBar toolBar = manager.getControl(); if (toolBar != null && !toolBar.isDisposed() && (toolBar.getStyle() & orientation) == 0) { toolBar.dispose(); } manager.setStyle(style); } ToolBar bar = manager.createControl(parent); bar.setData(manager); bar.setData(AbstractPartRenderer.OWNING_ME, element); bar.getShell().layout(new Control[] { bar }, SWT.DEFER); bar.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { cleanUp((MToolBar) element); } }); return bar; }
Source:
<code>private void handleNotification(MentionNotificationParameters mentionNotificationParameters, EntityReference entityReference, XWikiDocument doc, MentionNotificationParameter mentionNotificationParameter) { String extractedQuote = getQuoteFromXDOM(mentionNotificationParameters, entityReference, doc, mentionNotificationParameter); MentionEventParams params = new MentionEventParams() .setUserReference(mentionNotificationParameters.getAuthorReference()) .setDocumentReference( this.entityReferenceSerializer.serialize(entityReference.extractReference(EntityType.DOCUMENT))) .setLocation(mentionNotificationParameters.getLocation()) .setAnchor(mentionNotificationParameter.getAnchorId()) .setQuote(extractedQuote); String mentionedIdentity = mentionNotificationParameter.getReference(); DocumentReference documentUserReference = this.documentReferenceResolver.resolve(mentionedIdentity, entityReference.extractReference(EntityType.WIKI)); <START> String identity = this.entityReferenceSerializer.serialize(documentUserReference); <END> MentionEvent event = new MentionEvent(singleton(identity), params); this.observationManager.notify(event, "org.xwiki.contrib:mentions-notifications", MentionEvent.EVENT_TYPE); }</code><technical_language>a UserReferenceResolver a UserReferenceSerializer here? a priori handling user mentions there</technical_language>

Target:
private void handleNotification(MentionNotificationParameters mentionNotificationParameters, EntityReference entityReference, XWikiDocument doc, MentionNotificationParameter mentionNotificationParameter) { if (canView(mentionNotificationParameter.getReference(), entityReference)) { String extractedQuote = getQuoteFromXDOM(mentionNotificationParameters, entityReference, doc, mentionNotificationParameter); MentionEventParams params = new MentionEventParams() .setUserReference(mentionNotificationParameters.getAuthorReference()) .setDocumentReference( this.entityReferenceSerializer.serialize(entityReference.extractReference(EntityType.DOCUMENT))) .setLocation(mentionNotificationParameters.getLocation()) .setAnchor(mentionNotificationParameter.getAnchorId()) .setQuote(extractedQuote); String mentionedIdentity = mentionNotificationParameter.getReference(); UserReference userReference = this.userReferenceResolver.resolve(mentionedIdentity, entityReference.extractReference(EntityType.WIKI)); String identity = this.userReferenceSerializer.serialize(userReference); MentionEvent event = new MentionEvent(singleton(identity), params); this.observationManager.notify(event, "org.xwiki.contrib:mentions-notifications", MentionEvent.EVENT_TYPE); } }
Source:
<code>public Enumeration<URL> getResources(String name) throws IOException { <START> List<URL> resources = Lists.newLinkedList(); <END> for (ClassLoader classLoader : classLoaders) { resources.addAll(Collections.list(classLoader.getResources(name))); } return Collections.enumeration(resources); }</code><technical_language>linked hash set in case classloader multiple times</technical_language>

Target:
public Enumeration<URL> getResources(String name) throws IOException { Set<URL> resources = Sets.newLinkedHashSet(); for (ClassLoader classLoader : classLoaders) { resources.addAll(Collections.list(classLoader.getResources(name))); } return Collections.enumeration(resources); }
Source:
<code>public void handleChildCommands() { if (getCallback() != null) { List<Guid> childCommands = CommandCoordinatorUtil.getChildCommandIds(getCommandId()); List<VdcActionParametersBase> parameters = new LinkedList<>(); for (Guid id : childCommands) { CommandBase<?> command = CommandCoordinatorUtil.retrieveCommand(id); if (command.getParameters().getCocoEndActionMode() == EndActionMode.UPDATE_COMMAND_STATUS_ONLY) { <START> command.getParameters().setCocoEndActionMode(EndActionMode.RUN_END_ACTION_METHOD); <END> command.getParameters().setCommandType(command.getActionType()); parameters.add(command.getParameters()); } } getParameters().setImagesParameters(parameters); } }</code><technical_language>I fail understand is here. end action mode of command is UPDATE_COMMAND_S TATUS_ONLY. updating command status changing end action mode RUN_END_ACTION_METHOD. if parent command endAction is execute child command completed execution responsibility of parent command invoke endAction if necessary child commands</technical_language>

Target:
public void handleChildCommands() { if (getCallback() != null) { List<Guid> childCommands = CommandCoordinatorUtil.getChildCommandIds(getCommandId()); List<VdcActionParametersBase> parameters = new LinkedList<>(); for (Guid id : childCommands) { CommandBase<?> command = CommandCoordinatorUtil.retrieveCommand(id); if (command.getParameters().getShouldBeEndedByParent()) { command.getParameters().setShouldBeEndedByParent(false); command.getParameters().setCommandType(command.getActionType()); parameters.add(command.getParameters()); } } getParameters().setImagesParameters(parameters); } }
Source:
<code>public void testJsonSerialisation() throws JSONException { JSONObject deviceDataJson = mapToJson(deviceData); assertEquals("android", deviceDataJson.getString("osName")); assertNotNull(deviceDataJson.getString("osVersion")); assertNotNull(deviceDataJson.getString("manufacturer")); assertNotNull(deviceDataJson.getString("model")); assertNotNull(deviceDataJson.get("cpuAbi")); assertTrue(deviceDataJson.has("jailbroken")); JSONObject versions = deviceDataJson.getJSONObject("runtimeVersions"); <START> assertNotNull(versions.get("androidApiLevel")); <END> }</code><technical_language>is "not null" assertion make? Is this tests run version of Android? this int greater n, n is minimum supported api level</technical_language>

Target:
public void testJsonSerialisation() throws JSONException { JSONObject deviceDataJson = mapToJson(deviceData); assertEquals("android", deviceDataJson.getString("osName")); assertNotNull(deviceDataJson.getString("osVersion")); assertNotNull(deviceDataJson.getString("manufacturer")); assertNotNull(deviceDataJson.getString("model")); assertNotNull(deviceDataJson.get("cpuAbi")); assertTrue(deviceDataJson.has("jailbroken")); JSONObject versions = deviceDataJson.getJSONObject("runtimeVersions"); assertTrue((Integer) versions.get("androidApiLevel") >= 14); }
Source:
<code>public Builder withKey(byte[] columnKey) { <START> if (null == columnKey) { <END> throw new IllegalArgumentException("Setting null key on column: " + columnPath); } if (null != this.keyBytes) { throw new IllegalArgumentException("Key already set on column: " + columnPath); } this.keyBytes = new byte[columnKey.length]; System.arraycopy(columnKey, 0, this.keyBytes, 0, columnKey.length); return this; }</code><technical_language>This null check is duplicated in constructor, I is necessary validate twice. is enough validate parameters in constructor</technical_language>

Target:
public Builder withKey(byte[] columnKey) { if (null != this.keyBytes) { throw new IllegalStateException("Key already set on column: " + columnPath); } this.keyBytes = new byte[columnKey.length]; System.arraycopy(columnKey, 0, this.keyBytes, 0, columnKey.length); return this; }
Source:
<code><START> private void updateStoragePoolFormatType() { <END> storage_pool storagePool = getStoragePool(); Guid spId = storagePool.getId(); VDSBrokerFrontend resourceManager = Backend.getInstance() .getResourceManager(); Version spVersion = storagePool.getcompatibility_version(); Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (Version.OpEquality(spVersion, oldSpVersion)) { return; } StorageType spType = storagePool.getstorage_pool_type(); if (spType != StorageType.ISCSI && spType != StorageType.FCP) { return; } StorageFormatType targetFormat = StorageFormatType.V1; Version v2FormatChangeBar = new Version("3.0"); Version v3FormatChangeBar = new Version("3.1"); if (spVersion.compareTo(v3FormatChangeBar) >= 0) { targetFormat = StorageFormatType.V3; } else if (spVersion.compareTo(v2FormatChangeBar) >= 0) { targetFormat = StorageFormatType.V2; } storagePool.setStoragePoolFormatType(targetFormat); getStoragePoolDAO().update(storagePool); updateMemberDomainsFormat(targetFormat); if (storagePool.getstatus() != StoragePoolStatus.Up) { return; } UpgradeStoragePoolVDSCommandParameters parameters = new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat); resourceManager.RunVdsCommand( VDSCommandType.UpgradeStoragePool, parameters); }</code><technical_language>Consider "final" for local variables</technical_language>

Target:
private void updateStoragePoolFormatType() { final storage_pool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final VDSBrokerFrontend resourceManager = Backend.getInstance().getResourceManager(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (Version.OpEquality(spVersion, oldSpVersion)) { return; } StorageType spType = storagePool.getstorage_pool_type(); if (spType != StorageType.ISCSI && spType != StorageType.FCP) { return; } StorageFormatType targetFormat = StorageFormatType.V1; if (spVersion.compareTo(Version.v3_0) == 0) { targetFormat = StorageFormatType.V2; } else if (spVersion.compareTo(Version.v3_1) == 0) { targetFormat = StorageFormatType.V3; } storagePool.setStoragePoolFormatType(targetFormat); getStoragePoolDAO().update(storagePool); updateMemberDomainsFormat(targetFormat); if (storagePool.getstatus() != StoragePoolStatus.Up) { return; } UpgradeStoragePoolVDSCommandParameters parameters = new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat); resourceManager.RunVdsCommand( VDSCommandType.UpgradeStoragePool, parameters); }
Source:
<code>private void applyLightBufferPass() { int texId = 0; GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId); sceneOpaque.bindTexture(); lightBufferPass.setInt("texSceneOpaque", texId++, true); GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId); sceneOpaque.bindDepthTexture(); lightBufferPass.setInt("texSceneOpaqueDepth", texId++, true); GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId); sceneOpaque.bindNormalsTexture(); lightBufferPass.setInt("texSceneOpaqueNormals", texId++, true); GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId); sceneOpaque.bindLightBufferTexture(); lightBufferPass.setInt("texSceneOpaqueLightBuffer", texId, true); sceneOpaquePingPong = dynamicFBM.getFBO(DefaultDynamicFBOs.WriteOnlyGBuffer.getResourceUrn()); sceneReflectiveRefractive = dynamicFBM.getFBO(REFRACTIVE_REFLECTIVE_URN); sceneOpaquePingPong.bind(); setRenderBufferMask(sceneOpaquePingPong, true, true, true); setViewportToSizeOf(sceneOpaquePingPong); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderFullscreenQuad(); bindDisplay(); setViewportToSizeOf(sceneOpaque); <START> dynamicFBM.swap(DefaultDynamicFBOs.WriteOnlyGBuffer.getResourceUrn(), DefaultDynamicFBOs.ReadOnlyGBuffer.getResourceUrn()); <END> sceneOpaque.attachDepthBufferTo(sceneReflectiveRefractive); }</code><technical_language>Hmm... I concerns. 1. FBOs meant swapped, others not. So, potentially a node maliciously mistake swap FBOs swapped. This call for "paired" FBOs. Non-paired FBOs swapped. 2. I notice in swap method notification is out. some nodes need refresh sceneOpaque potentially sceneOpaquePingPong variables. want move sceneOpaque/sceneOpaquePingPong FBO names instead, is write/readOnlyGBuffer</technical_language>

Target:
private void applyLightBufferPass() { int texId = 0; GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId); READ_ONLY_GBUFFER.bindTexture(); lightBufferPass.setInt("texSceneOpaque", texId++, true); GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId); READ_ONLY_GBUFFER.bindDepthTexture(); lightBufferPass.setInt("texSceneOpaqueDepth", texId++, true); GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId); READ_ONLY_GBUFFER.bindNormalsTexture(); lightBufferPass.setInt("texSceneOpaqueNormals", texId++, true); GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId); READ_ONLY_GBUFFER.bindLightBufferTexture(); lightBufferPass.setInt("texSceneOpaqueLightBuffer", texId, true); sceneReflectiveRefractive = displayResolutionDependentFBOs.get(REFRACTIVE_REFLECTIVE); WRITE_ONLY_GBUFFER.bind(); WRITE_ONLY_GBUFFER.setRenderBufferMask(true, true, true); setViewportToSizeOf(WRITE_ONLY_GBUFFER); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderFullscreenQuad(); bindDisplay(); setViewportToSizeOf(READ_ONLY_GBUFFER); displayResolutionDependentFBOs.swapReadWriteBuffers(); READ_ONLY_GBUFFER.attachDepthBufferTo(sceneReflectiveRefractive); }
Source:
<code>public ObjectReader newReader() { ObjectReader r = db.newReader(); <START> r.setAvoidUnreachableObjects(avoidUnreachable); <END> return r; }</code><technical_language>IIRC this is carried new clone reader other implementation</technical_language>

Target:
public ObjectReader newReader() { return db.newReader(); }
Source:
<code>public static final String convertArrayToBase64(double[] array) { <START> final int capacity = 8 * array.length; <END> final ByteBuffer bb = ByteBuffer.allocate(capacity); for (int i = 0; i < array.length; i++) { bb.putDouble(array[i]); } bb.rewind(); final ByteBuffer encodedBB = Base64.getEncoder().encode(bb); return new String(encodedBB.array()); }</code><technical_language>8</technical_language>

Target:
public static final String convertArrayToBase64(double[] array) { final int capacity = DOUBLE_SIZE_IN_BYTES * array.length; final ByteBuffer bb = ByteBuffer.allocate(capacity); for (int i = 0; i < array.length; i++) { bb.putDouble(array[i]); } bb.rewind(); final ByteBuffer encodedBB = Base64.getEncoder().encode(bb); return new String(encodedBB.array()); }
Source:
<code>protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException, MaxMoneyException { Trade items = getTrade(sign, 1, 2, player, ess); Trade charge = getTrade(sign, 3, ess); if (ess.getSettings().isAllowBulkBuySell() && player.getBase().isSneaking()) { ItemStack heldItem = player.getItemInHand(); if (items.getItemStack().isSimilar(heldItem)) { int initialItemAmount = items.getItemStack().getAmount(); int newItemAmount = heldItem.getAmount(); ItemStack item = items.getItemStack(); item.setAmount(newItemAmount); items = new Trade(item, ess); BigDecimal chargeAmount = charge.getMoney(); <START> BigDecimal pricePerSingleItem = chargeAmount.divide(new BigDecimal(initialItemAmount), RoundingMode.HALF_EVEN); <END> pricePerSingleItem = pricePerSingleItem.multiply(new BigDecimal(newItemAmount)); charge = new Trade(pricePerSingleItem, ess); } } charge.isAffordableFor(player); if (!items.pay(player)) { throw new ChargeException("Inventory full"); } charge.charge(player); Trade.log("Sign", "Buy", "Interact", username, charge, username, items, sign.getBlock().getLocation(), ess); return true; }</code><technical_language>SignSell - this change amount charged</technical_language>

Target:
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException, MaxMoneyException { Trade items = getTrade(sign, 1, 2, player, ess); Trade charge = getTrade(sign, 3, ess); if (ess.getSettings().isAllowBulkBuySell() && player.getBase().isSneaking()) { ItemStack heldItem = player.getItemInHand(); if (items.getItemStack().isSimilar(heldItem)) { int initialItemAmount = items.getItemStack().getAmount(); int newItemAmount = heldItem.getAmount(); ItemStack item = items.getItemStack(); item.setAmount(newItemAmount); items = new Trade(item, ess); BigDecimal chargeAmount = charge.getMoney(); BigDecimal pricePerSingleItem = chargeAmount.divide(new BigDecimal(initialItemAmount)); pricePerSingleItem = pricePerSingleItem.multiply(new BigDecimal(newItemAmount)); charge = new Trade(pricePerSingleItem, ess); } } charge.isAffordableFor(player); if (!items.pay(player)) { throw new ChargeException("Inventory full"); } charge.charge(player); Trade.log("Sign", "Buy", "Interact", username, charge, username, items, sign.getBlock().getLocation(), ess); return true; }
Source:
<code>public void login() { <START> LoginManager.getInstance().logInWithReadPermissions(activity, Arrays.asList("email")); <END> }</code><technical_language>Arrays.asList("email") replaced Collections.singletonList("email"), avoid warning is mentioning</technical_language>

Target:
public void login() { LoginManager.getInstance().logInWithReadPermissions(activity, Collections.singletonList("email")); }
Source:
<code>private String doMessage(String msg) { Socket echoSocket; String resp = ""; try { echoSocket = new Socket(this.host, this.port); PrintWriter out = new PrintWriter(echoSocket.getOutputStream(), true); BufferedReader in = new BufferedReader(new InputStreamReader(echoSocket.getInputStream())); out.println(msg); resp = in.readLine(); echoSocket.close(); } catch (IOException e) { e.printStackTrace(); <START> LOG.error("Error: " + e.getMessage()); <END> } return resp; }</code><technical_language>Skip exception again</technical_language>

Target:
private String doMessage(String msg) throws Exception { Socket echoSocket; String resp = ""; try { echoSocket = new Socket(this.host, this.port); PrintWriter out = new PrintWriter(echoSocket.getOutputStream(), true); BufferedReader in = new BufferedReader(new InputStreamReader(echoSocket.getInputStream())); out.println(msg); resp = in.readLine(); echoSocket.close(); } catch (IOException e) { e.printStackTrace(); throw new Exception("Unable to send message to ChatScript Server. Reason:" + e.getMessage()); } return resp; }
Source:
<code>public static String castToString(Object object) { if (object==null) return null; <START> if (object instanceof boolean[]) return Arrays.toString((boolean[])object); <END> if (object instanceof byte[]) return Arrays.toString((byte[])object); if (object instanceof char[]) return new String((char[])object); if (object instanceof double[]) return Arrays.toString((double[])object); if (object instanceof float[]) return Arrays.toString((float[])object); if (object instanceof int[]) return Arrays.toString((int[])object); if (object instanceof long[]) return Arrays.toString((long[])object); if (object instanceof short[]) return Arrays.toString((short[])object); if (object instanceof Object[]) return Arrays.toString((Object[])object); return object.toString(); }</code><technical_language>more efficient put this if(object.getClass().isArray) block</technical_language>

Target:
public static String castToString(Object object) { if (object==null) return null; if (object.getClass().isArray()) { if (object instanceof boolean[]) return Arrays.toString((boolean[])object); if (object instanceof byte[]) return Arrays.toString((byte[])object); if (object instanceof char[]) return new String((char[])object); if (object instanceof double[]) return Arrays.toString((double[])object); if (object instanceof float[]) return Arrays.toString((float[])object); if (object instanceof int[]) return Arrays.toString((int[])object); if (object instanceof long[]) return Arrays.toString((long[])object); if (object instanceof short[]) return Arrays.toString((short[])object); return Arrays.toString((Object[])object); } return object.toString(); }
Source:
<code>private void tryToStartWeb() { SQProcess process = processesById.get(ProcessId.WEB_SERVER); if (process == null || !isEsClientStartable()) { return; } if (appState.isOperational(ProcessId.WEB_SERVER, false)) { tryToStartProcess(process, () -> javaCommandFactory.createWebCommand(false)); } else if (appState.tryToLockWebLeader()) { tryToStartProcess(process, () -> javaCommandFactory.createWebCommand(true)); } else { <START> LOG.info("Waiting for back-end initialization from " + appState.getLeaderHostName()); <END> } }</code><technical_language>I term "back-end" removed</technical_language>

Target:
private void tryToStartWeb() { SQProcess process = processesById.get(ProcessId.WEB_SERVER); if (process == null || !isEsClientStartable()) { return; } if (appState.isOperational(ProcessId.WEB_SERVER, false)) { tryToStartProcess(process, () -> javaCommandFactory.createWebCommand(false)); } else if (appState.tryToLockWebLeader()) { tryToStartProcess(process, () -> javaCommandFactory.createWebCommand(true)); } else { LOG.info("Waiting for initialization from " + appState.getLeaderHostName()); } }
Source:
<code>public SchemaImpl postProcess(SchemaImpl schema, SchemaFactory factory) { <START> <END> if(schema.getId().equals("projectMember")) { FieldImpl field = getField(schema, "externalIdType"); if(field != null){ field.getOptions().addAll(EXTERNAL_ID_TYPES); } } return schema; }</code><technical_language>put newlines beginning of functions</technical_language>

Target:
public SchemaImpl postProcess(SchemaImpl schema, SchemaFactory factory) { if(schema.getId().equals("projectMember")) { FieldImpl field = getField(schema, "externalIdType"); if(field != null){ field.getOptions().addAll(AUTH_SERVICE_EXTERNAL_ID_TYPES.get()); } } return schema; }
Source:
<code>protected synchronized <T extends RemoteJsonService> T getService(Class<T> clazz) { <START> return getService(clazz, Version.emptyVersion); <END> }</code><technical_language>I expect this obtain version assume emptyVersion. I consider adding IProgressMonitor force version if cached</technical_language>

Target:
protected synchronized <T extends RemoteJsonService> T getService(Class<T> clazz) { return getService(clazz, new NullProgressMonitor()); }