Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundles/org.eclipse.text.quicksearch/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.text.quicksearch;singleton:=true
Bundle-Version: 1.3.200.qualifier
Bundle-Version: 1.3.300.qualifier
Bundle-Activator: org.eclipse.text.quicksearch.internal.ui.QuickSearchActivator
Require-Bundle: org.eclipse.ui;bundle-version="[3.113.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.13.0,4.0.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,22 @@ public int hashCode() {

@Override
public boolean equals(Object obj) {
if (this == obj)
if (this == obj) {
return true;
if (obj == null)
}
if (obj == null) {
return false;
if (getClass() != obj.getClass())
}
if (getClass() != obj.getClass()) {
return false;
}
LineItem other = (LineItem) obj;
if (!Objects.equals(f, other.f)) {
return false;
}
if (lineNumber != other.lineNumber)
if (lineNumber != other.lineNumber) {
return false;
}
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public int getOffset() {
}
}

private boolean caseInsensitive;
private String orgPattern; //Original pattern case preserved even if search is case insensitive.
private final boolean caseInsensitive;
private final String orgPattern; //Original pattern case preserved even if search is case insensitive.
final Pattern pattern;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class QuickTextSearcher {
/**
* Scheduling rule used by Jobs that work on the matches collection.
*/
private ISchedulingRule matchesRule = new LightSchedulingRule("QuickSearchMatchesRule"); //$NON-NLS-1$
private final ISchedulingRule matchesRule = new LightSchedulingRule("QuickSearchMatchesRule"); //$NON-NLS-1$

private final SearchInFilesWalker walker;
private IncrementalUpdateJob incrementalUpdate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class QuickSearchPreferences {
public static final String MAX_RESULTS = "QuickTextSearcher.MAX_RESULTS"; //$NON-NLS-1$
private static boolean initializedDefaults;

private IPreferenceStore store;
private final IPreferenceStore store;

public QuickSearchPreferences(IPreferenceStore preferenceStore) {
this.store = preferenceStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private static void debug(String string) {
* <p>
* Level is used to easily check whether a node lookup returned an exact matching node or an ancestor.
*/
private int level;
private final int level;

/**
* Priority assigned to any path lookup that ends here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class QuickSearchContext {
*/
private static Collection<IFile> lastOpenFiles = Arrays.asList(); //Empty list to start with.

private IWorkbenchWindow window;
private final IWorkbenchWindow window;

public QuickSearchContext(IWorkbenchWindow window) {
this.window = window;
Expand Down Expand Up @@ -163,16 +163,14 @@ private Collection<IResource> getSelectedResources() {
}
ISelectionService selectionService = window.getSelectionService();
ISelection selection = selectionService.getSelection();
if (selection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
if (selection instanceof IStructuredSelection structuredSelection) {
if (!structuredSelection.isEmpty()) {
Object[] elements = structuredSelection.toArray();
List<IResource> resources = new ArrayList<>(elements.length);
for (Object e : elements) {
if (e instanceof IResource) {
resources.add((IResource) e);
} else if (e instanceof IAdaptable) {
IAdaptable ae = (IAdaptable) e;
} else if (e instanceof IAdaptable ae) {
IResource r = ae.getAdapter(IResource.class);
if (r!=null) {
resources.add(r);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {

public static final Styler HIGHLIGHT_STYLE = org.eclipse.search.internal.ui.text.DecoratingFileSearchLabelProvider.HIGHLIGHT_STYLE;

private UIJob refreshJob = UIJob.create(Messages.QuickSearchDialog_RefreshJob,
private final UIJob refreshJob = UIJob.create(Messages.QuickSearchDialog_RefreshJob,
(ICoreRunnable) m -> refreshWidgets());

protected void openSelection() {
Expand Down Expand Up @@ -358,15 +358,15 @@ public void update(ViewerCell cell) {

private MenuManager contextMenuManager;

private boolean multi;
private final boolean multi;

private ToolBar toolBar;

private ToolItem toolItem;

private Label progressLabel;

private ContentProvider contentProvider;
private final ContentProvider contentProvider;

private String initialPatternText;

Expand All @@ -393,14 +393,14 @@ public void update(ViewerCell cell) {
private ToggleKeepOpenAction toggleKeepOpenAction;


private QuickSearchContext context;
private final QuickSearchContext context;


private SashForm sashForm;

private Label headerLabel;

private IWorkbenchWindow window;
private final IWorkbenchWindow window;
private Combo searchIn;
private Label listLabel;

Expand Down Expand Up @@ -570,10 +570,12 @@ public boolean close() {
showViewHandler.getHandler().dispose();
showViewHandler = null;
}
if (menuManager != null)
if (menuManager != null) {
menuManager.dispose();
if (contextMenuManager != null)
}
if (contextMenuManager != null) {
contextMenuManager.dispose();
}
storeDialog(getDialogSettings());
if (searcher!=null) {
searcher.cancel();
Expand Down Expand Up @@ -956,7 +958,7 @@ public void keyPressed(KeyEvent e) {
});

createDetailsArea(sashForm);
sashForm.setWeights(new int[] {5,2});
sashForm.setWeights(5, 2);

applyDialogFont(content);

Expand Down Expand Up @@ -1512,7 +1514,7 @@ private void applyPathMatcher() {
*/
private class ContentProvider implements IStructuredContentProvider, ILazyContentProvider {

private List items;
private final List items;
private Comparator<LineItem> comparator;
/**
* Creates new instance of <code>ContentProvider</code>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class QuickSearchQuickAccessComputer extends QuickTextSearchRequestor imp

private static final int MAX_ENTRIES = 20;
private static final long TIMEOUT = 200;
private PriorityFunction priorities;
private final PriorityFunction priorities;

public QuickSearchQuickAccessComputer() {
priorities = new QuickSearchContext(PlatformUI.getWorkbench().getActiveWorkbenchWindow()).createPriorityFun();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public LineReader(Reader reader, int maxLineLength) {
}


private StringBuilder line = new StringBuilder(EXPECTED_LINE_LENGTH);
private final StringBuilder line = new StringBuilder(EXPECTED_LINE_LENGTH);

private final int maxLineLength;
private int lineOffset = -1; //Start pos of last line read.
Expand Down
Loading