Skip to content

Commit

Permalink
Merge branch 'master' into UseVarTest
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenartur authored Jul 26, 2024
2 parents 645d64e + a21fac9 commit 609db25
Show file tree
Hide file tree
Showing 53 changed files with 1,690 additions and 2,254 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020, 2023 Fabrice TIERCELIN and others.
* Copyright (c) 2020, 2024 Fabrice TIERCELIN and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -34,6 +34,7 @@
import org.eclipse.jdt.core.dom.ClassInstanceCreation;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.Expression;
import org.eclipse.jdt.core.dom.ExpressionMethodReference;
import org.eclipse.jdt.core.dom.FieldDeclaration;
import org.eclipse.jdt.core.dom.IMethodBinding;
import org.eclipse.jdt.core.dom.ITypeBinding;
Expand Down Expand Up @@ -148,6 +149,9 @@ public boolean visit(final SingleVariableDeclaration node) {
}

private boolean maybeUseVar(final Type type, final Expression initializer, final int extraDimensions) {
if (initializer instanceof ExpressionMethodReference) {
return false;
}
if (type.isVar()
|| initializer == null
|| initializer.resolveTypeBinding() == null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
*******************************************************************************/
package org.eclipse.jdt.text.tests;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

import org.eclipse.jdt.text.tests.codemining.CodeMiningTriggerTest;
import org.eclipse.jdt.text.tests.codemining.ParameterNamesCodeMiningTest;
import org.eclipse.jdt.text.tests.contentassist.ContentAssistTestSuite;
import org.eclipse.jdt.text.tests.spelling.SpellCheckEngineTestCase;
import org.eclipse.jdt.text.tests.templates.TemplatesTestSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;


/**
Expand All @@ -30,6 +31,7 @@
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
PluginsNotLoadedTest.class,
CompilationUnitDocumentProviderTest.class,
JavaHeuristicScannerTest.class,
JavaAutoIndentStrategyTest.class,
Expand All @@ -47,14 +49,6 @@
MarkOccurrenceTest.class,
MarkOccurrenceTest1d7.class,
MarkOccurrenceTest1d8.class,
PluginsNotLoadedTest.class,
// PluginsNotLoadedTest.addLoadedPlugIns(
// new String[] {
// "org.eclipse.core.filebuffers.tests",
// "org.eclipse.core.variables",
// "org.eclipse.team.cvs.core",
// "org.eclipse.test.performance"
// });
BracketInserterTest.class,
SpellCheckEngineTestCase.class,
SemanticHighlightingTest.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class PluginsNotLoadedTest {
"org.eclipse.help.ui",
"org.eclipse.help.webapp",
"org.eclipse.jdt",
"org.eclipse.jdt.apt.core",
// "org.eclipse.jdt.apt.core", loaded for Java 1.8+ projects
"org.eclipse.jdt.apt.ui",
"org.eclipse.jdt.compiler.apt",
"org.eclipse.jdt.compiler.tool",
Expand Down Expand Up @@ -163,7 +163,7 @@ public class PluginsNotLoadedTest {
"org.eclipse.equinox.launcher",
"org.eclipse.equinox.launcher.win32.win32.x86",
"org.eclipse.help.appserver",
"org.eclipse.jdt.apt.pluggable.core",
// "org.eclipse.jdt.apt.pluggable.core", loaded for Java 1.8+ projects
"org.eclipse.jdt.source",
"org.eclipse.jsch.ui",
"org.eclipse.osgi.util",
Expand Down Expand Up @@ -224,6 +224,7 @@ public static void addLoadedPlugIns(String... loadedPlugins) {

@Before
public void setUp() throws Exception {
EditorTestHelper.showView(EditorTestHelper.INTRO_VIEW_ID, false);
JavaPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.EDITOR_MARK_OCCURRENCES, true);
fEditor= openJavaEditor(new Path("/" + JUnitProjectTestSetup.getProject().getElementName() + "/src/junit/framework/TestCase.java"));
assertNotNull(fEditor);
Expand Down
Loading

0 comments on commit 609db25

Please sign in to comment.