Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate for removal JavaPlugin.getJavaCorePluginPreferences #1946

Merged
merged 1 commit into from
Jan 16, 2025
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation 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 @@ -32,7 +32,7 @@
import org.eclipse.jdt.testplugin.JavaProjectHelper;
import org.eclipse.jdt.testplugin.TestOptions;

import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;

import org.eclipse.jface.preference.IPreferenceStore;

Expand Down Expand Up @@ -77,11 +77,11 @@ public void setUp() throws Exception {

StubUtility.setCodeTemplate(CodeTemplateContextType.METHODSTUB_ID, "//TODO\n${body_statement}", null);

Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");

fJProject1= projectSetup.getProject();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2020 IBM Corporation and others.
* Copyright (c) 2011, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -24,7 +24,7 @@
import org.eclipse.jdt.testplugin.JavaProjectHelper;
import org.eclipse.jdt.testplugin.TestOptions;

import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;

import org.eclipse.jface.preference.IPreferenceStore;

Expand Down Expand Up @@ -72,11 +72,11 @@ public void setUp() throws Exception {

StubUtility.setCodeTemplate(CodeTemplateContextType.METHODSTUB_ID, "//TODO\n${body_statement}", null);

Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");

fJProject1= projectSetup.getProject();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2024 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation 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 @@ -37,7 +37,7 @@
import org.eclipse.jdt.testplugin.TestOptions;
import org.eclipse.osgi.util.NLS;

import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;

import org.eclipse.jface.preference.IPreferenceStore;

Expand Down Expand Up @@ -97,11 +97,11 @@ public void setUp() throws Exception {

StubUtility.setCodeTemplate(CodeTemplateContextType.METHODSTUB_ID, "//TODO\n${body_statement}", null);

Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");

fJProject1= projectSetup.getProject();

Expand Down Expand Up @@ -233,9 +233,9 @@ public void testAssignToLocal3() throws Exception {

IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
store.setValue(PreferenceConstants.CODEGEN_KEYWORD_THIS, true);
Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "f");
corePrefs.setValue(JavaCore.CODEASSIST_LOCAL_PREFIXES, "_");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "f");
corePrefs.put(JavaCore.CODEASSIST_LOCAL_PREFIXES, "_");


IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
Expand Down Expand Up @@ -358,10 +358,10 @@ public void testAssignToLocal5() throws Exception {

IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
store.setValue(PreferenceConstants.CODEGEN_KEYWORD_THIS, true);
Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "f");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "fg");
corePrefs.setValue(JavaCore.CODEASSIST_LOCAL_PREFIXES, "_");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "f");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "fg");
corePrefs.put(JavaCore.CODEASSIST_LOCAL_PREFIXES, "_");


IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
Expand Down Expand Up @@ -1280,8 +1280,8 @@ public E(int count) {

@Test
public void testAssignParamToField2() throws Exception {
Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "f");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "f");


IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
Expand Down Expand Up @@ -1322,8 +1322,8 @@ public E(int count, Vector vec[]) {

@Test
public void testAssignParamToField3() throws Exception {
Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "fg");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "fg");

IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
store.setValue(PreferenceConstants.CODEGEN_KEYWORD_THIS, true);
Expand Down Expand Up @@ -1718,8 +1718,8 @@ public void foo(int count, long size, boolean state) {

@Test
public void testAssignParamToFieldInGeneric() throws Exception {
Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "f");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "f");


IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
Expand Down Expand Up @@ -7400,10 +7400,10 @@ public Object foo(final String name) {

@Test
public void testConvertAnonymousToNested2() throws Exception {
Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "f");
corePrefs.setValue(JavaCore.CODEASSIST_LOCAL_PREFIXES, "l");
corePrefs.setValue(JavaCore.CODEASSIST_ARGUMENT_PREFIXES, "p");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "f");
corePrefs.put(JavaCore.CODEASSIST_LOCAL_PREFIXES, "l");
corePrefs.put(JavaCore.CODEASSIST_ARGUMENT_PREFIXES, "p");

IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null);
String str= """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 IBM Corporation and others.
* Copyright (c) 2011, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -24,7 +24,7 @@
import org.eclipse.jdt.testplugin.JavaProjectHelper;
import org.eclipse.jdt.testplugin.TestOptions;

import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;

import org.eclipse.jface.preference.IPreferenceStore;

Expand Down Expand Up @@ -80,11 +80,11 @@ public void setUp() throws Exception {

StubUtility.setCodeTemplate(CodeTemplateContextType.METHODSTUB_ID, "//TODO\n${body_statement}", null);

Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");

fJProject1= projectSetup.getProject();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2020 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation 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 @@ -27,7 +27,7 @@
import org.eclipse.core.tests.harness.FussyProgressMonitor;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;

import org.eclipse.jface.preference.IPreferenceStore;

Expand Down Expand Up @@ -78,11 +78,11 @@ public void setUp() throws Exception {

StubUtility.setCodeTemplate(CodeTemplateContextType.METHODSTUB_ID, "//TODO\n${body_statement}", null);

Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");

fJProject1= projectSetup.getProject();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2020 IBM Corporation and others.
* Copyright (c) 2005, 2025 IBM Corporation 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 @@ -33,7 +33,7 @@

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;

import org.eclipse.core.resources.IWorkspace;
Expand Down Expand Up @@ -106,11 +106,11 @@ public void setUp() throws Exception {
StubUtility.setCodeTemplate(CodeTemplateContextType.OVERRIDECOMMENT_ID, "/* comment */", null);
StubUtility.setCodeTemplate(CodeTemplateContextType.FIELDCOMMENT_ID, FIELD_COMMENT, null);

Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");

fSourceFolder= JavaProjectHelper.addSourceContainer(getProject(), "src");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2020 IBM Corporation and others.
* Copyright (c) 2011, 2025 IBM Corporation 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 @@ -35,7 +35,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
Expand Down Expand Up @@ -95,13 +95,12 @@ public void setUp() throws Exception {
JavaProjectHelper.addLibrary(fJProject, JavaProjectHelper.findRtJar(osgiJar)[0]);
}

@Deprecated
private void setPreferences() {
Preferences corePrefs= JavaPlugin.getJavaCorePluginPreferences();
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");
IEclipsePreferences corePrefs= JavaPlugin.getJavaCorePluginPreferencesNew();
corePrefs.put(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
corePrefs.put(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");
}


Expand Down
Loading
Loading