auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void loadFiles () { // BAD - holds on to a lot of memory if (sourcePath == null) return; files = new HashMap<> (); for (String START element : END sourcePath) { File file = new File(element); if (file.exists()) { if (!file.isDirectory()) { if (file.getAbsolutePath().endsWith(".java")) { files.put(file, loadFile(file)); } } else { loadDirectory(file); } } } } rename to path

Target:
void loadFiles () { // BAD - holds on to a lot of memory if (sourcePath == null) return; files = new HashMap<> (); for (String path : sourcePath) { File file = new File(path); if (file.exists()) { if (!file.isDirectory()) { if (file.getAbsolutePath().endsWith(".java")) { files.put(file, loadFile(file)); } } else { loadDirectory(file); } } } }
Source:
protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter, IProgressMonitor progressMonitor) throws CoreException { if(fTypes != null && fTypes.length > 0) { for (IType START fType : END fTypes) { if (itemsFilter.isConsistentItem(fType)) { contentProvider.add(fType, itemsFilter); } } } } rename to type

Target:
protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter, IProgressMonitor progressMonitor) throws CoreException { if(fTypes != null && fTypes.length > 0) { for (IType type : fTypes) { if (itemsFilter.isConsistentItem(type)) { contentProvider.add(type, itemsFilter); } } } }
Source:
private CompletableFuture<List<? extends ICodeMining>> provideCodeMinings(@NonNull IDocument document) { URI docURI = LSPEclipseUtils.toUri(document); if (docURI != null) { CodeLensParams param = new CodeLensParams(new TextDocumentIdentifier(docURI.toString())); return LanguageServiceAccessor .getLanguageServers(document, capabilities -> capabilities.getCodeLensProvider() != null) .thenComposeAsync(languageServers -> getCodeMiningsFromServers(languageServers, document, param)); START } else { END return null; } } This "else" can be removed.

Target:
private CompletableFuture<List<? extends ICodeMining>> provideCodeMinings(@NonNull IDocument document) { URI docURI = LSPEclipseUtils.toUri(document); if (docURI != null) { CodeLensParams param = new CodeLensParams(new TextDocumentIdentifier(docURI.toString())); return LanguageServiceAccessor .getLanguageServers(document, capabilities -> capabilities.getCodeLensProvider() != null) .thenComposeAsync(languageServers -> getCodeMiningsFromServers(languageServers, document, param)); } return null; }
Source:
public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); fEventFactor = nbEvents / DEFAULT_FACTOR; START fMonitor = SubMonitor.convert(monitor, DEFAULT_FACTOR + 2); END } Not sure I get it... For 10,000 events we would call worked(1) exactly 100 times?

Target:
public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); fEventFactor = Math.max(DEFAULT_FACTOR, nbEvents / DEFAULT_FACTOR); fMonitor = SubMonitor.convert(monitor, DEFAULT_FACTOR + 2); }
Source:
public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); START fEventFactor = Math.max(DEFAULT_FACTOR, nbEvents / DEFAULT_FACTOR); END fMonitor = SubMonitor.convert(monitor, DEFAULT_FACTOR + 2); } This is not correct. I would suggest to have a index i starting at 1, and report 1 unit of work when nbRead > nbEvents*i/factor, incrementing i at the same time. The value of 'factor' should be nbEvents clampled to [1,DEFAULT_FACTOR], in case nbEvents is < DEFAULT_FACTOR or 0. This factor should be the SubMonitor's number of ticks.

Target:
public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); fEventFactor = Math.max(1, nbEvents / DEFAULT_FACTOR); fMonitor = SubMonitor.convert(monitor, DEFAULT_FACTOR); }
Source:
START protected GridData newGridData(int span) { END GridData data = new GridData(GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); data.horizontalSpan = span; return data; } This could be private?

Target:
private static GridData newGridData(int span) { GridData data = new GridData(GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); data.horizontalSpan = span; return data; }
Source:
public Stream<Node> stream() { return START Arrays.stream(getComposite().getChildren()).map(control -> getElement(control)); END } use method reference here?

Target:
public Stream<Node> stream() { return Arrays.stream(getComposite().getChildren()).map(this::getElement); }
Source:
public START @Nullable Long END getTimeForPoint(int x) { return UIThreadRunnable.syncExec((Result<@Nullable Long>) () -> { Rectangle bounds = widget.getBounds(); Point p = new Point(x, bounds.y + bounds.height / 2); if (!bounds.contains(p)) { return null; } return widget.getTimeAtX(x); }); } @Nullable forces the test to do a null check, but in a unit test it would be acceptable to fail with a NullPointerException if something is not as expected.

Target:
public Long getTimeForPoint(int x) { return UIThreadRunnable.syncExec((Result<@Nullable Long>) () -> { Rectangle bounds = widget.getBounds(); Point p = new Point(x, bounds.y + bounds.height / 2); if (!bounds.contains(p)) { return null; } return widget.getTimeAtX(x); }); }
Source:
public RoughToRealVerificationOperation(OrcsApi orcsApi, BranchId branchId, XResultData results, ArtifactReadable destinationArtifact, RoughArtifactCollector rawData, IArtifactImportResolver artifactResolver, boolean deleteUnmatchedArtifacts, IArtifactExtractor extractor) { this.results = results; this.orcsApi = orcsApi; this.branchId = branchId; this.rawData = rawData; this.artifactResolver = artifactResolver; this.destinationArtifact = destinationArtifact; this.roughToRealArtifacts = new HashMap<>(); START roughToRealArtifacts.put(rawData.getParentRoughArtifact(), this.destinationArtifact); END } remove "this"

Target:
public RoughToRealVerificationOperation(OrcsApi orcsApi, BranchId branchId, XResultData results, ArtifactReadable destinationArtifact, RoughArtifactCollector rawData, IArtifactImportResolver artifactResolver, boolean deleteUnmatchedArtifacts, IArtifactExtractor extractor) { this.results = results; this.orcsApi = orcsApi; this.branchId = branchId; this.rawData = rawData; this.artifactResolver = artifactResolver; this.destinationArtifact = destinationArtifact; this.roughToRealArtifacts = new HashMap<>(); roughToRealArtifacts.put(rawData.getParentRoughArtifact(), destinationArtifact); }
Source:
int memSize() { // treat Operator as free START return BASE_NODE_SIZE + 2 * 4; END } One more - this will be 3

Target:
int memSize() { // treat Operator as free return BASE_NODE_SIZE + 3 * 4; }
Source:
protected void addCNature(IProject project, IProgressMonitor monitor, boolean addMakeBuilder) throws CoreException { if (getWizard() instanceof ConversionWizard) { ConversionWizard cw = (ConversionWizard) getWizard(); START if (cw.getBuildSystemId() != null) { END CCorePlugin.getDefault().convertProjectToNewC(project, cw.getBuildSystemId(), monitor); } else { CCorePlugin.getDefault().convertProjectToC(project, monitor, cw.getProjectID()); } } } Sort of the same thing here - this is an unrelated change.

Target:
protected void addCNature(IProject project, IProgressMonitor monitor, boolean addMakeBuilder) throws CoreException { if (getWizard() instanceof ConversionWizard) { ConversionWizard cw = (ConversionWizard) getWizard(); if (cw.getBuildSystemId() != null) CCorePlugin.getDefault().convertProjectToNewC(project, cw.getBuildSystemId(), monitor); else CCorePlugin.getDefault().convertProjectToC(project, monitor, cw.getProjectID()); } }
Source:
public void doRun(IProgressMonitor monitor, String projectID) throws CoreException { Object[] selection = getCheckedElements(); int totalSelected = selection.length; if (totalSelected > 0) { if (monitor == null) { monitor = new NullProgressMonitor(); } SubMonitor submonitor = SubMonitor.convert(monitor, 1); START submonitor.subTask(CUIPlugin.getResourceString(KEY_TITLE)); END convertProjects(selection, submonitor.split(1), projectID); } } subtask != task therefore these two lines should be: SubMonitor.convert(monitor, /title/, 1); (other cases of same marked with ditto2)

Target:
public void doRun(IProgressMonitor monitor, String projectID) throws CoreException { Object[] selection = getCheckedElements(); int totalSelected = selection.length; if (totalSelected > 0) { SubMonitor submonitor = SubMonitor.convert(monitor, CUIPlugin.getResourceString(KEY_TITLE), 1); convertProjects(selection, submonitor.split(1), projectID); } }
Source:
public ObjectId getItem(int index) { checkWidget(); if START (0 > index || END index >= commits.size()) { SWT.error(SWT.ERROR_INVALID_RANGE); } return commits.get(index).objectId; } Personally I find index < 0 simpler to parse.

Target:
public ObjectId getItem(int index) { checkWidget(); if (index < 0 || commits.size() <= index) { SWT.error(SWT.ERROR_INVALID_RANGE); } return commits.get(index).objectId; }
Source:
public static <T> T run(ISafeRunnableWithResult<T> code) { Assert.isNotNull(code); try { return code.runWithResult(); } catch (Exception | LinkageError | AssertionError e) { handleException(code, e); } START return null; END } maybe even move the return null; inside the catch-block. Makes things a bit clearer IMHO.

Target:
public static <T> T run(ISafeRunnableWithResult<T> code) { Assert.isNotNull(code); try { return code.runWithResult(); } catch (Exception | LinkageError | AssertionError e) { handleException(code, e); return null; } }
Source:
START protected StringBuilder customizeAfterNewLineForDeclaration(IDocument doc, IASTDeclaration dec, END ITypedRegion region) { return customizeAfterNewLineForDeclaration(doc, dec, region, null); } deprecate this

Target:
protected StringBuilder customizeAfterNewLineForDeclaration(IDocument doc, IASTDeclaration dec, ITypedRegion region) { return new StringBuilder(); }
Source:
public DoxygenSingleAutoEditStrategy() { START super(); END } personal style on my part - have only one constructor do super() - so have this one do this(true or false).

Target:
public DoxygenSingleAutoEditStrategy() { super(true); }
Source:
public Optional<String> getCommitTemplatePath() { START return Optional.ofNullable(commitTemplatePath); END } What's the benefit of using Optional instead of returning null? In what way would it make a caller's life easier? I suspect instead of simply checking for null a caller will end up doing Optional.isPresent checks (maybe hidden in an ifPresent with a lambda thrown in for additional complexity).

Target:
public String getCommitTemplatePath() { return commitTemplatePath; }
Source:
private void copyJarInJarLoader(File targetFile) throws IOException { try (InputStream is= JavaPlugin.getDefault().getBundle().getEntry(FatJarRsrcUrlBuilder.JAR_RSRC_LOADER_ZIP).openStream()) { START OutputStream os= new FileOutputStream(targetFile); END byte[] buf= new byte[1024]; while (true) { int cnt= is.read(buf); if (cnt <= 0) break; os.write(buf, 0, cnt); } os.close(); } } The OutputStream should also go into the try-with clause

Target:
private void copyJarInJarLoader(File targetFile) throws IOException { try (InputStream is= JavaPlugin.getDefault().getBundle().getEntry(FatJarRsrcUrlBuilder.JAR_RSRC_LOADER_ZIP).openStream(); OutputStream os= new FileOutputStream(targetFile);) { byte[] buf= new byte[1024]; while (true) { int cnt= is.read(buf); if (cnt <= 0) break; os.write(buf, 0, cnt); } } }
Source:
private void initialize() { initializeFields(); initializeDefaultColors(); for (String[] element : fAppearanceColorListModel) { fAppearanceColorList.add(element[0]); } fAppearanceColorList.getDisplay().asyncExec(() -> { fAppearanceColorList.select(0); handleAppearanceColorListSelection(); }); START fDocCommentOwnerComposite.loadValues(null); END } Invoking with null argument is an evil, please provide another method without arguments if it makes sense

Target:
private void initialize() { initializeFields(); initializeDefaultColors(); for (String[] element : fAppearanceColorListModel) { fAppearanceColorList.add(element[0]); } fAppearanceColorList.getDisplay().asyncExec(() -> { fAppearanceColorList.select(0); handleAppearanceColorListSelection(); }); fDocCommentOwnerComposite.loadValues(); }
Source:
public boolean performOk() { DocCommentOwnerManager.getInstance() .setWorkspaceCommentOwner(fDocCommentOwnerComposite.getSelectedDocCommentOwner()); START fDocCommentOwnerComposite.performOk(null); END return super.performOk(); } Invoking with null argument is an evil, please provide another method without arguments if it makes sense.

Target:
public boolean performOk() { DocCommentOwnerManager.getInstance() .setWorkspaceCommentOwner(fDocCommentOwnerComposite.getSelectedDocCommentOwner()); fDocCommentOwnerComposite.performOk(); return super.performOk(); }
Source:
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { if (property==null) START return false; END switch (property) { case "simple": //$NON-NLS-1$ return "simple".equals(expectedValue); //$NON-NLS-1$ case "overridden": //$NON-NLS-1$ return "A".equals(expectedValue); //$NON-NLS-1$ case "ordering": //$NON-NLS-1$ return "A".equals(expectedValue); //$NON-NLS-1$ case "chainOrdering": //$NON-NLS-1$ return "A".equals(expectedValue); //$NON-NLS-1$ default: break; } Assert.isTrue(false); return false; } Brackets

Target:
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { if (property == null) { return false; } switch (property) { case "simple": //$NON-NLS-1$ return "simple".equals(expectedValue); //$NON-NLS-1$ case "overridden": //$NON-NLS-1$ return "A".equals(expectedValue); //$NON-NLS-1$ case "ordering": //$NON-NLS-1$ return "A".equals(expectedValue); //$NON-NLS-1$ case "chainOrdering": //$NON-NLS-1$ return "A".equals(expectedValue); //$NON-NLS-1$ default: break; } Assert.isTrue(false); return false; }
Source:
private String getPushErrors() { StringBuilder messages = new StringBuilder(); for (URIish uri : result.getURIs()) { String errorMessage = result.getErrorMessage(uri); if (errorMessage != null && errorMessage.length() > 0) { START if (messages.length() > 0) END messages.append(System.lineSeparator()); messages.append(errorMessage); } } return messages.toString(); } nit: add braces around the modified one line block to follow formatting rules

Target:
private String getPushErrors() { StringBuilder messages = new StringBuilder(); for (URIish uri : result.getURIs()) { String errorMessage = result.getErrorMessage(uri); if (errorMessage != null && errorMessage.length() > 0) { if (messages.length() > 0) { messages.append(System.lineSeparator()); } messages.append(errorMessage); } } return messages.toString(); }
Source:
public CreateAlgorithmCommand(final BasicFBType fbType) { START this.fbType = fbType; this.index = fbType.getAlgorithm().size() - 1; this.name = DEFAULT_ALGORITHM_NAME; END } wouldn't a this call to the new constructor with name = null be nicer here? this(fbType, fType.getAlgorithm().size() - 1, null);

Target:
public CreateAlgorithmCommand(final BasicFBType fbType) { this(fbType, fbType.getAlgorithm().size() - 1, null); }
Source:
public CreateInternalVariableCommand(final BasicFBType fbType) { START this.dataType = DataTypeLibrary.getInstance().getType("BOOL"); //$NON-NLS-1$ this.fbType = fbType; this.name = DEFAULT_VAR_NAME; this.index = fbType.getInternalVars().size() - 1; END } as with the algorithm command I think calling the new constructor with appropriate values would be nice here. This would value all the cool new logic of the new constructor.

Target:
public CreateInternalVariableCommand(final BasicFBType fbType) { this(fbType, fbType.getInternalVars().size() - 1, null, null); }
Source:
protected void consumeRecordHeaderNameWithTypeParameters() { // RecordHeaderName ::= RecordHeaderName1 TypeParameters consumeTypeHeaderNameWithTypeParameters(); TypeDeclaration typeDecl = (TypeDeclaration)this.astStack[this.astPtr]; START typeDecl.modifiers |= ExtraCompilerModifiers.AccRecord; END } These two changes in the two consumeRec...() methods are in fact a property of RecordDecl - public RecordDeclaration(TypeDeclaration t) { this.modifiers =.. -> add here this.modifier |=

Target:
protected void consumeRecordHeaderNameWithTypeParameters() { // RecordHeaderName ::= RecordHeaderName1 TypeParameters consumeTypeHeaderNameWithTypeParameters(); }
Source:
public boolean canBeInstantiated() { START return (this.modifiers & (ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface | ClassFileConstants.AccEnum | ClassFileConstants.AccAnnotation | ExtraCompilerModifiers.AccRecord)) == 0; END } This looks incorrect - Record can be instantiated.

Target:
public boolean canBeInstantiated() { return (this.modifiers & (ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface | ClassFileConstants.AccEnum | ClassFileConstants.AccAnnotation)) == 0; }
Source:
public TmfTimeViewAlignmentInfo getTimeViewAlignmentInfo() { START if (fLanes.size() == 0) { END return null; } return new TmfTimeViewAlignmentInfo(fLanes.get(0).getChartViewer().getControl().getShell(), fSashForm.toDisplay(0, 0), getTimeAxisOffset()); } fLanes.isEmpty()

Target:
public TmfTimeViewAlignmentInfo getTimeViewAlignmentInfo() { if (fLanes.size() == 0) { return null; } return fLanes.get(0).getTimeViewAlignmentInfo(); }
Source:
public static ProxyData[] getProxyData(String provider) { ProxyManager manager = (ProxyManager) ProxyManager.getProxyManager(); switch (provider) { case DIRECT_PROVIDER: return new ProxyData[0]; case ECLIPSE_PROVIDER: return castArray(manager.getProxyData()); case NATIVE_PROVIDER: return castArray(manager.getNativeProxyData()); default: break; } START throw new IllegalArgumentException("Provider not supported"); //$NON-NLS-1$ END } Can we decide on one or the other? I'd just move the throw into the default case.

Target:
public static ProxyData[] getProxyData(String provider) { ProxyManager manager = (ProxyManager) ProxyManager.getProxyManager(); switch (provider) { case DIRECT_PROVIDER: return new ProxyData[0]; case ECLIPSE_PROVIDER: return castArray(manager.getProxyData()); case NATIVE_PROVIDER: return castArray(manager.getNativeProxyData()); default: throw new IllegalArgumentException("Provider not supported"); //$NON-NLS-1$ } }
Source:
private int getFlag(String propertyName) { if (propertyName==null) return 0; START END switch (propertyName) { case BUSY_PROPERTY: return BUSY_FLAG; case PROPAGATED_CONFLICT_PROPERTY: return PROPAGATED_CONFLICT_FLAG; case PROPAGATED_ERROR_MARKER_PROPERTY: return PROPAGATED_ERROR_FLAG; case PROPAGATED_WARNING_MARKER_PROPERTY: return PROPAGATED_WARNING_FLAG; default: break; } return 0; } Missing whitespace around ==, missing {}, trailing whitespace.

Target:
private int getFlag(String propertyName) { if (propertyName == null) { return 0; } switch (propertyName) { case BUSY_PROPERTY: return BUSY_FLAG; case PROPAGATED_CONFLICT_PROPERTY: return PROPAGATED_CONFLICT_FLAG; case PROPAGATED_ERROR_MARKER_PROPERTY: return PROPAGATED_ERROR_FLAG; case PROPAGATED_WARNING_MARKER_PROPERTY: return PROPAGATED_WARNING_FLAG; default: break; } return 0; }
Source:
public List<ArtifactId> getBranchViewsForApplicability(BranchId branch, ApplicabilityId applId) { List<ArtifactId> arts = new ArrayList<>(); START END for (Iterator<Long> iterator = queryFactory.tupleQuery().getTuple2E1ListRaw(CoreTupleTypes.ViewApplicability, branch, applId.getId()).iterator(); iterator.hasNext();) { Long long1 = iterator.next(); arts.add(ArtifactId.valueOf(long1)); } return arts; } Don't need to access iterator, just: for (Long long1: queryFactory.tupleQuery().getTuple2E1ListRaw(CoreTupleTypes.ViewApplicability, branch, applId.getId()) { ... }

Target:
public List<ArtifactId> getBranchViewsForApplicability(BranchId branch, ApplicabilityId applId) { List<ArtifactId> arts = new ArrayList<>(); for (Long long1 : queryFactory.tupleQuery().getTuple2E1ListRaw(CoreTupleTypes.ViewApplicability, branch, applId.getId())) { arts.add(ArtifactId.valueOf(long1)); } return arts; }
Source:
public synchronized void cancel() { super.cancel(); while START (fEventsQueue.size() >= 1) { END fEventIterator.next(); } fEventsQueue.put(END_EVENT); fEventsQueue.flushInputBuffer(); } !fEventsQueue.isEmpty() would be clearer

Target:
public synchronized void cancel() { super.cancel(); while (!fEventsQueue.isEmpty()) { fEventIterator.next(); } fEventsQueue.put(END_EVENT); fEventsQueue.flushInputBuffer(); }
Source:
public void saveWidgetValues() { IDialogSettings settings = getDialogSettings(); if START (settings != null) { END settings.put(STORE_OPEN_TYPE_ID, openType); settings.put(STORE_REPLACE_SOURCE_ID, replaceSource); } } null != settings

Target:
public void saveWidgetValues() { IDialogSettings settings = getDialogSettings(); if (null != settings) { settings.put(STORE_OPEN_TYPE_ID, openType); settings.put(STORE_REPLACE_SOURCE_ID, replaceSource); } }
Source:
private void restoreWidgetValues() { IDialogSettings settings = getDialogSettings(); if START (settings != null) { END openType = settings.getBoolean(STORE_OPEN_TYPE_ID); replaceSource = settings.getBoolean(STORE_REPLACE_SOURCE_ID); } } null != settings

Target:
private void restoreWidgetValues() { IDialogSettings settings = getDialogSettings(); if (null != settings) { openType = settings.getBoolean(STORE_OPEN_TYPE_ID); replaceSource = settings.getBoolean(STORE_REPLACE_SOURCE_ID); } }
Source:
public static void error (int code, Throwable throwable) { START error (code, throwable, " [Application is out of heap memory]"); END } We can't change the message here. It'll apply to all calls to error(int, Throwable). Instead, use error() with the String arg.

Target:
public static void error (int code, Throwable throwable) { error (code, throwable, null); }
Source:
private void createTextMenu() { final MenuManager popupManager = new MenuManager(); // FIXME missing commands for EDIT_COPY and EDIT_SELECT_ALL // as context menu textWidget.setMenu(popupManager.createContextMenu(textWidget)); START textWidget.addDisposeListener(e -> { END popupManager.dispose(); }); } `{}` may be ommited for single statement

Target:
private void createTextMenu() { final MenuManager popupManager = new MenuManager(); // FIXME missing commands for EDIT_COPY and EDIT_SELECT_ALL // as context menu textWidget.setMenu(popupManager.createContextMenu(textWidget)); textWidget.addDisposeListener(e -> popupManager.dispose()); }
Source:
public AboutItem(String text, List<HyperlinkRange> linkRanges, List<String> links) { this.text = text; START this.linkRanges = linkRanges; END this.hrefs = links; } it is safer to use linkRanges.addAll, otherwise the class content can be externally modified

Target:
public AboutItem(String text, List<HyperlinkRange> linkRanges, List<String> links) { this.text = text; this.linkRanges.addAll(linkRanges); this.hrefs = links; }
Source:
public IId<?> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, START JsonProcessingException { END return m_idExternalFormatter.get().fromExternalForm(p.readValueAs(String.class)); } JsonProcessingExceptio is sublass of IOException -> remove

Target:
public IId<?> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { return m_idExternalFormatter.get().fromExternalForm(p.readValueAs(String.class)); }
Source:
private void dispose() { fContextService.removeDebugContextListener(this); START fgServices.remove(fWindow); END fCommandUpdates.clear(); fWindow = null; } this one misses synchronized block. Not your problem, but seeing your change we should fix that too.

Target:
private void dispose() { fContextService.removeDebugContextListener(this); synchronized (fgServices) { fgServices.remove(fWindow); } fCommandUpdates.clear(); fWindow = null; }
Source:
private static boolean hasMultipleWindowServices() { synchronized (fgServices) { return fgServices.size() START >= 2; END } } "> 1" is more natural

Target:
private static boolean hasMultipleWindowServices() { synchronized (fgServices) { return fgServices.size() > 1; } }
Source:
protected void configureParameters(InterfaceList interfaceList, String parentNodeName) throws TypeImportException, XMLStreamException { processChildren(parentNodeName, name -> { if START (name.equals(LibraryElementTags.PARAMETER_ELEMENT)) END { VarDeclaration paramter = parseParameter(); VarDeclaration vInput = getVarNamed(interfaceList, paramter.getName(), true); if (null != vInput) { vInput.setValue(paramter.getValue()); } return true; } return false; }); } call equals on constant not on name

Target:
protected void configureParameters(InterfaceList interfaceList, String parentNodeName) throws TypeImportException, XMLStreamException { processChildren(parentNodeName, name -> { if (LibraryElementTags.PARAMETER_ELEMENT.equals(name)) { VarDeclaration paramter = parseParameter(); VarDeclaration vInput = getVarNamed(interfaceList, paramter.getName(), true); if (null != vInput) { vInput.setValue(paramter.getValue()); } return true; } return false; }); }
Source:
protected <T extends Connection> void parseConnectionList(EClass conType, EList<T> connectionlist, String parentNodeName) throws XMLStreamException, TypeImportException { processChildren(parentNodeName, name -> { if START (name.equals(LibraryElementTags.CONNECTION_ELEMENT)) { END T connection = parseConnection(conType); if (null != connection) { connectionlist.add(connection); } proceedToEndElementNamed(LibraryElementTags.CONNECTION_ELEMENT); return true; } return false; }); } call on constant

Target:
protected <T extends Connection> void parseConnectionList(EClass conType, EList<T> connectionlist, String parentNodeName) throws XMLStreamException, TypeImportException { processChildren(parentNodeName, name -> { if (LibraryElementTags.CONNECTION_ELEMENT.equals(LibraryElementTags.CONNECTION_ELEMENT)) { T connection = parseConnection(conType); if (null != connection) { connectionlist.add(connection); } proceedToEndElementNamed(LibraryElementTags.CONNECTION_ELEMENT); return true; } return false; }); }
Source:
private void parseServiceSequence(final FBType type) throws TypeImportException, XMLStreamException { ServiceSequence serviceSequence = LibraryElementFactory.eINSTANCE.createServiceSequence(); readNameCommentAttributes(serviceSequence); processChildren(LibraryElementTags.SERVICE_SEQUENCE_ELEMENT, name -> { if START (name.equals(LibraryElementTags.SERVICE_TRANSACTION_ELEMENT)) { END parseServiceTransaction(serviceSequence, type); return true; } return false; }); type.getService().getServiceSequence().add(serviceSequence); } call equals on constant

Target:
private void parseServiceSequence(final FBType type) throws TypeImportException, XMLStreamException { ServiceSequence serviceSequence = LibraryElementFactory.eINSTANCE.createServiceSequence(); readNameCommentAttributes(serviceSequence); processChildren(LibraryElementTags.SERVICE_SEQUENCE_ELEMENT, name -> { if (LibraryElementTags.SERVICE_TRANSACTION_ELEMENT.equals(name)) { parseServiceTransaction(serviceSequence, type); return true; } return false; }); type.getService().getServiceSequence().add(serviceSequence); }
Source:
private void parseST(final STAlgorithm st) throws TypeImportException, XMLStreamException { String text = getAttributeValue(LibraryElementTags.TEXT_ATTRIBUTE); if START (text != null) { END st.setText(text); } else { throw new TypeImportException(Messages.FBTImporter_ST_TEXTNOTSET_EXCEPTION); } proceedToEndElementNamed(LibraryElementTags.ST_ELEMENT); } order of operands

Target:
private void parseST(final STAlgorithm st) throws TypeImportException, XMLStreamException { String text = getAttributeValue(LibraryElementTags.TEXT_ATTRIBUTE); if (null != text) { st.setText(text); } else { throw new TypeImportException(Messages.FBTImporter_ST_TEXTNOTSET_EXCEPTION); } proceedToEndElementNamed(LibraryElementTags.ST_ELEMENT); }
Source:
private void parseInternalVars(final BaseFBType type) throws TypeImportException, XMLStreamException { processChildren(LibraryElementTags.INTERNAL_VARS_ELEMENT, name -> { if START (name.equals(LibraryElementTags.VAR_DECLARATION_ELEMENT)) END { VarDeclaration v = parseVarDeclaration(); type.getInternalVars().add(v); return true; } return false; }); } call equals on constant

Target:
private void parseInternalVars(final BaseFBType type) throws TypeImportException, XMLStreamException { processChildren(LibraryElementTags.INTERNAL_VARS_ELEMENT, name -> { if (LibraryElementTags.VAR_DECLARATION_ELEMENT.equals(name)) { VarDeclaration v = parseVarDeclaration(); type.getInternalVars().add(v); return true; } return false; }); }
Source:
private void parseSegmentNodeChildren(Segment segment) throws XMLStreamException, TypeImportException { processChildren(LibraryElementTags.SEGMENT_ELEMENT, name -> { if START (name.equals(LibraryElementTags.ATTRIBUTE_ELEMENT)) END { if (isColorAttributeNode()) { parseColor(segment); } else { parseGenericAttributeNode(segment); } proceedToEndElementNamed(LibraryElementTags.ATTRIBUTE_ELEMENT); return true; } return false; }); } call equals on constant

Target:
private void parseSegmentNodeChildren(Segment segment) throws XMLStreamException, TypeImportException { processChildren(LibraryElementTags.SEGMENT_ELEMENT, name -> { if (LibraryElementTags.ATTRIBUTE_ELEMENT.equals(name)) { if (isColorAttributeNode()) { parseColor(segment); } else { parseGenericAttributeNode(segment); } proceedToEndElementNamed(LibraryElementTags.ATTRIBUTE_ELEMENT); return true; } return false; }); }
Source:
public DeferredItem(Rectangle bounds, RGBAColor backgroundColor, RGBAColor foregroundColor, int alpha, int lineWidth) { fBounds = bounds; fLineWidth = lineWidth; if (backgroundColor == null) { fBgColor = OPAQUE; START } else if (backgroundColor.getAlpha() != alpha) { END fBgColor = new RGBAColor(backgroundColor.getRed(), backgroundColor.getGreen(), backgroundColor.getBlue(), alpha); } else { fBgColor = backgroundColor; } fFgColor = foregroundColor; } When filtering is applied, the received RGBAColor has a lower alpha.

Target:
public DeferredItem(Rectangle bounds, RGBAColor backgroundColor, RGBAColor foregroundColor, int alpha, int lineWidth) { fBounds = bounds; fLineWidth = lineWidth; if (backgroundColor.getAlpha() != alpha) { fBgColor = new RGBAColor(backgroundColor.getRed(), backgroundColor.getGreen(), backgroundColor.getBlue(), alpha); } else { fBgColor = backgroundColor; } fFgColor = foregroundColor; }
Source:
protected void drawBorder(GC gc) { Rectangle bounds = getBounds(); START gc.drawRoundRectangle(bounds.x-1, bounds.y-1, bounds.width+2, bounds.height+2, fArc, END fArc); } Original code does not have these increased bounds? also, spaces

Target:
protected void drawBorder(GC gc) { Rectangle bounds = getBounds(); gc.drawRoundRectangle(bounds.x, bounds.y, bounds.width, bounds.height, fArc, fArc); }
Source:
public void skipTree() { if (currVisit != START null) END currVisit.ptr = currVisit.buf.length; } Please add

Target:
public void skipTree() { if (currVisit != null) { currVisit.ptr = currVisit.buf.length; } }
Source:
public START XYAxis(org.eclipse.swtchart.IAxis END axis) { fAxis = axis; } not needed. Is there a way to decouple even more so that we don't need to pass the o.e.swtchart class? Adapter, resolver, consumer, not sure exactly how.

Target:
private XYAxis(org.eclipse.swtchart.IAxis axis) { fAxis = axis; }
Source:
public FBNetworkContextMenuProvider(final DiagramEditorWithFlyoutPalette editor, final ActionRegistry registry, final ZoomManager zoomManager, Palette palette) { super(editor.getViewer(), zoomManager, registry); this.palette = palette; this.editor = editor; START editor.getViewer().getControl().addMenuDetectListener(new MenuDetectListener() { @Override public void menuDetected(MenuDetectEvent e) { pt = getViewer().getControl().toControl(e.x, e.y); } }); END } why did you remove the lambda

Target:
public FBNetworkContextMenuProvider(final DiagramEditorWithFlyoutPalette editor, final ActionRegistry registry, final ZoomManager zoomManager, Palette palette) { super(editor.getViewer(), zoomManager, registry); this.palette = palette; this.editor = editor; editor.getViewer().getControl().addMenuDetectListener(e -> pt = getViewer().getControl().toControl(e.x, e.y)); }
Source:
public void setActiveEditor(IEditorPart editor) { ActionRegistry registry = editor.getAdapter(ActionRegistry.class); START IActionBars bars = getActionBars(); for (String id : globalActionKeys) { END setGlobalActionHandler(registry, bars, id); } super.setActiveEditor(editor); } these two should also go into the setGlobalActionHandler method.

Target:
public void setActiveEditor(IEditorPart editor) { setGlobalActionHandler(editor.getAdapter(ActionRegistry.class)); super.setActiveEditor(editor); }
Source:
protected void getDataRightsOverride() { overrideClassification = DataRightsClassification.noOverride; for (DataRightsClassification classification : DataRightsClassification.values()) { START if (classification.getDataRightsClassification().equals(publishingOptions.overrideDataRights)) { END overrideClassification = classification; } } } can you "break;" out of this for loop?

Target:
protected void getDataRightsOverride() { overrideClassification = DataRightsClassification.noOverride; for (DataRightsClassification classification : DataRightsClassification.values()) { if (classification.getDataRightsClassification().equals(publishingOptions.overrideDataRights)) { overrideClassification = classification; break; } } }
Source:
private IWorkingSetUpdater2 getUpdater() { START WorkingSetDescriptor descriptor = getDescriptor(); END WorkingSetManager manager = getWorkingSetManager(); if (manager != null && descriptor != null) { IWorkingSetUpdater updater = manager.getUpdater(descriptor); if (updater instanceof IWorkingSetUpdater2) { return (IWorkingSetUpdater2) updater; } } return null; } in adaptElements this is only done if manager != null, so maybe this should be also moved inside if(manger != null) here

Target:
private IWorkingSetUpdater2 getUpdater() { WorkingSetManager manager = getWorkingSetManager(); if (manager != null) { WorkingSetDescriptor descriptor = getDescriptor(); if (descriptor != null) { IWorkingSetUpdater updater = manager.getUpdater(descriptor); if (updater instanceof IWorkingSetUpdater2) { return (IWorkingSetUpdater2) updater; } } } return null; }
Source:
public void commitOutput() throws IOException { START try (OutputStream os = response.getOutputStream()) { END try (InputStream is = getInputStream()) { if (is != null) { Utils.transferContent(is, os); } os.flush(); } } } In the original version, both "in" and "out" were not closed at the end. Why do we close them now?

Target:
public void commitOutput() throws IOException { OutputStream os = response.getOutputStream(); InputStream is = getInputStream(); if (is != null) { Utils.transferContent(is, os); } os.flush(); }
Source:
switch (platform) { case "win32": //$NON-NLS-1$ COLUMN_TRIM= 4; break; case "carbon": //$NON-NLS-1$ COLUMN_TRIM= 24; break; START case "cocoa": //$NON-NLS-1$ END default: COLUMN_TRIM= 3; break; } either handle cocoa like carbon or remove carbon on the fly maybe change "carbon" to "cocoa" by separate change before? carbon is unsupported.

Target:
switch (platform) { case "win32": //$NON-NLS-1$ COLUMN_TRIM= 4; break; case "cocoa": //$NON-NLS-1$ COLUMN_TRIM= 24; break; default: COLUMN_TRIM= 3; break; }
Source:
public boolean isConstexpr() { ICPPASTDeclSpecifier declSpec = getDeclSpecifier(); START if (declSpec == null) { END ICPPASTFunctionDeclarator dtor = getPreferredDtor(); return dtor != null ? dtor.isConstexpr() : false; } return declSpec.isConstexpr(); } Is this ever actually reached? It seems to me we only have a lambda declarator associated with CPPImplicitFunctions, and CPPImplicitFunction overrides isConstexpr().

Target:
public boolean isConstexpr() { ICPPASTDeclSpecifier declSpec = getDeclSpecifier(); if (declSpec == null) { return false; } return declSpec.isConstexpr(); }
Source:
int getLineHeight(int lineIndex) { LineSizeInfo line = getLineSize(lineIndex); if (line.needsRecalculateHeight()) { // here we are in "variable line height", the call of calculate which uses TextLayout is very slow // so use the average line height of all calculated lines. This should be good enough for scrolling. if (isVariableHeight(lineIndex)) { START return Math.round(averageLineHeight); END } else { line.height = getLineHeight() + getLineSpacing(lineIndex); } } return line.height; } If we do that, then this method doesn't return the actual line height any more, but an estimation. That's IMO not something we want to do as this method is expected to return correct value in multiple places. If you want to deal with average height, please introduce a new method and make it used when it's suitable.

Target:
int getLineHeight(int lineIndex) { return getLineHeight(lineIndex, true); }
Source:
public FileDiff(final Repository repo, final RevCommit c, final DiffEntry entry) { repository = repo; diffEntry = entry; commit = c; base = null; START } END Delegate to the new Constructor?

Target:
public FileDiff(final Repository repo, final RevCommit c, final DiffEntry entry) { this(repo, c, null, entry); }
Source:
public static void migrateOsgiLaunchConfiguration(ILaunchConfigurationWorkingCopy configuration) throws CoreException { START ILaunchConfigurationWorkingCopy wc = getWorkingCopy(configuration); END convertToSet(wc, IPDELauncherConstants.WORKSPACE_BUNDLES, IPDELauncherConstants.SELECTED_WORKSPACE_BUNDLES); convertToSet(wc, IPDELauncherConstants.TARGET_BUNDLES, IPDELauncherConstants.SELECTED_TARGET_BUNDLES); convertToSet(wc, IPDELauncherConstants.DESELECTED_WORKSPACE_PLUGINS, IPDELauncherConstants.DESELECTED_WORKSPACE_BUNDLES); } seems unnecessary

Target:
public static void migrateOsgiLaunchConfiguration(ILaunchConfigurationWorkingCopy configuration) throws CoreException { convertToSet(configuration, IPDELauncherConstants.WORKSPACE_BUNDLES, IPDELauncherConstants.SELECTED_WORKSPACE_BUNDLES); convertToSet(configuration, IPDELauncherConstants.TARGET_BUNDLES, IPDELauncherConstants.SELECTED_TARGET_BUNDLES); convertToSet(configuration, IPDELauncherConstants.DESELECTED_WORKSPACE_PLUGINS, IPDELauncherConstants.DESELECTED_WORKSPACE_BUNDLES); }
Source:
protected void activateDefaultView(String deepLinkPath) { START boolean isStartup = m_attachedCount <= 1; END if (safeHandleDeepLink(deepLinkPath)) { // NOP } else if (isStartup) { interceptDefaultView(); } } Would rearranging this method make it more readable? if (safeHandleDeepLink(deepLinkPath)) { return; } if (m_attachedCount <= 1) { // startup interceptDefaultView(); }

Target:
protected void activateDefaultView(String deepLinkPath) { if (safeHandleDeepLink(deepLinkPath)) { return; } if (m_attachedCount <= 1) { // is startup? interceptDefaultView(); } }
Source:
public Object getParent(Object element) { START if (element instanceof FileDiffRegion || element instanceof Folder) { END return parents.get(element); } return null; } Is this still needed? We don't add any other elements, so parent.get(anythingElse) should return null anyway.

Target:
public Object getParent(Object element) { return parents.get(element); }
Source:
private Folder computeRootFolder(String path) { return rootFolders.computeIfAbsent(path, START key -> { Folder newFolder = new Folder(key); return newFolder; }); END } This could be replaced by Folder::new.

Target:
private Folder computeRootFolder(String path) { return rootFolders.computeIfAbsent(path, Folder::new); }
Source:
public static synchronized void logWarning(String message,Throwable ex) { START if (IntroPlugin.getDefault().isDebugging() && LOG_WARN) { END getDefault().getLog().warn(message, ex); } } LOG_WARN should be the first argument

Target:
public static synchronized void logWarning(String message,Throwable ex) { if (LOG_WARN && IntroPlugin.getDefault().isDebugging()) { getDefault().getLog().warn(message, ex); } }
Source:
public static synchronized void logDebug(String message) { START if (IntroPlugin.getDefault().isDebugging() && LOG_INFO) { END getDefault().getLog().info(message); } } LOG_INFO should be the first argument

Target:
public static synchronized void logDebug(String message) { if (LOG_INFO && IntroPlugin.getDefault().isDebugging()) { getDefault().getLog().info(message); } }
Source:
public FilteredCheckboxTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook) { START super(parent, treeStyle, filter, useNewLook); END } In this case, I think we should deprecate this constructor and add the fastLookup boolean

Target:
public FilteredCheckboxTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook) { this(parent, treeStyle, filter, useNewLook, false); }
Source:
private FilterCache() { // Load in the background. Use a daemon thread since this instantiation // may occur very early; the JobManager may perhaps even be still // suspended. loader = new Thread(this::loadFromPreferences); loader.setDaemon(true); loader.start(); START } END Is the background loading the only reason, why the loading is done in the constructor (and via a separate thread)? I would have thought that compared to loading the content for the view, getting these few entries should not be too expensive. Did you measure how much time would be lost for this one-time initialization?

Target:
private FilterCache() { // Singleton }
Source:
public void set(FilterableNode node, String filter) { try { START loader.join(); END } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } cache.computeIfAbsent(node.getRepository().getDirectory(), k -> new ConcurrentHashMap<>()).put(node.getType(), filter); node.setFilter(filter); } If not done in the background, these four join-calls could be replaced by simple ensureCacheInitialized() calls.

Target:
public void set(FilterableNode node, String filter) { cache.computeIfAbsent(node.getRepository().getDirectory(), k -> new ConcurrentHashMap<>()).put(node.getType(), filter); node.setFilter(filter); }
Source:
private ISeries createSeries() { IBarSeries series = (IBarSeries) fChart.getSeriesSet().createSeries(SeriesType.BAR, Messages.AbstractSegmentStoreDensityViewer_SeriesLabel); series.setVisible(true); series.setBarPadding(0); START Color color = getColorForRGB(BAR_COLOR); series.setBarColor(color); END return series; } inline the call?

Target:
private ISeries createSeries() { IBarSeries series = (IBarSeries) fChart.getSeriesSet().createSeries(SeriesType.BAR, Messages.AbstractSegmentStoreDensityViewer_SeriesLabel); series.setVisible(true); series.setBarPadding(0); series.setBarColor(getColorForRGB(BAR_COLOR)); return series; }
Source:
public boolean visit(MethodDeclaration node) { Block body= node.getBody(); if (body == null) return false; Selection selection= getSelection(); int nodeStart= body.getStartPosition(); int nodeExclusiveEnd= nodeStart + body.getLength(); // if selection node inside of the method body ignore method if START (((nodeStart >= selection.getOffset()) || (selection.getExclusiveEnd() >= nodeExclusiveEnd))) END return false; return super.visit(node); } In this case readability is improved imho - in many other case it it not so clear.

Target:
public boolean visit(MethodDeclaration node) { Block body= node.getBody(); if (body == null) return false; Selection selection= getSelection(); int nodeStart= body.getStartPosition(); int nodeExclusiveEnd= nodeStart + body.getLength(); // if selection node inside of the method body ignore method if ((nodeStart >= selection.getOffset()) || (selection.getExclusiveEnd() >= nodeExclusiveEnd)) return false; return super.visit(node); }
Source:
private void updateLabels() { if START ((null != transition) && END (null != transition.getComment()) && !transition.getComment().isEmpty()) { tooltipContent.setText(transition.getComment()); } tooltipContent.setText("[not set]"); revalidate(); repaint(); } according to the model of GEF transition should not get null. Because the Editpart is created for a non null transition and that editpart creates the figure -> tooltip figure

Target:
private void updateLabels() { if ((null != transition.getComment()) && !transition.getComment().isEmpty()) { tooltipContent.setText(transition.getComment()); } else { tooltipContent.setText("[not set]"); } revalidate(); repaint(); }
Source:
protected Command getDeleteCommand(final GroupRequest request) { if START (getHost() instanceof END Link) { return new DeleteLinkCommand((Link) getHost().getModel()); } return null; } why is this not a getHost().getModel() unlike the other edits?

Target:
protected Command getDeleteCommand(final GroupRequest request) { if (getHost().getModel() instanceof Link) { return new DeleteLinkCommand((Link) getHost().getModel()); } return null; }
Source:
private static AdvancedInformation executeAut(AutLaunch launch) { AdvancedInformation info = null; try { // try to obtain advanced error information from AUT final GetAdvancedInfo advInfoCmd = TeslaFactory.eINSTANCE .createGetAdvancedInfo(); final Object obj = launch.execute(advInfoCmd); if (obj instanceof AdvancedInformation) info = (AdvancedInformation) obj; } catch (Exception e) { START return (AdvancedInformation) RcpttPlugin.createStatus(e); END } return info; } ClassCastException

Target:
private static AdvancedInformation executeAut(AutLaunch launch) { AdvancedInformation info = null; try { // try to obtain advanced error information from AUT final GetAdvancedInfo advInfoCmd = TeslaFactory.eINSTANCE .createGetAdvancedInfo(); final Object obj = launch.execute(advInfoCmd); if (obj instanceof AdvancedInformation) info = (AdvancedInformation) obj; } catch (Exception e) { RcpttPlugin.log(e); } return info; }
Source:
private static void write(String content, File file, Charset charset) throws IOException { START Writer writer = new OutputStreamWriter(new FileOutputStream(file), charset); END writer.write(content); writer.close(); } You can use a try resource here try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), charset);) { writer.write(content); }

Target:
private static void write(String content, File file, Charset charset) throws IOException { try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), charset)) { writer.write(content); } }
Source:
private Change getChange(RenameResourceWizard refactoringWizard) { refactoringWizard.setChangeCreationCancelable(true); START refactoringWizard.setInitialComputationContext(new IRunnableContext() { END @Override public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { runnable.run(new NullProgressMonitor()); } }); return refactoringWizard.internalCreateChange(InternalAPI.INSTANCE, new CreateChangeOperation(new CheckConditionsOperation(refactoringWizard.getRefactoring(), CheckConditionsOperation.FINAL_CONDITIONS), RefactoringStatus.FATAL), true); } haven't tried, but should be possible to write this as lambda from very beginning, before someone starts another "inner class to lambda" mass change?

Target:
private Change getChange(RenameResourceWizard refactoringWizard) { refactoringWizard.setChangeCreationCancelable(true); refactoringWizard.setInitialComputationContext((boolean fork, boolean cancelable, IRunnableWithProgress runnable) -> runnable.run(new NullProgressMonitor())); return refactoringWizard.internalCreateChange(InternalAPI.INSTANCE, new CreateChangeOperation(new CheckConditionsOperation(refactoringWizard.getRefactoring(), CheckConditionsOperation.FINAL_CONDITIONS), RefactoringStatus.FATAL), true); }
Source:
public CaseNameRewriter() { START this.upperCase = true; END } The one-argument constructor can just be called here instead: `this(true)`

Target:
public CaseNameRewriter() { this(true); }