Skip to content

Commit

Permalink
suppress remaining warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenartur committed Sep 21, 2024
1 parent 94974ae commit 7adc4f4
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ public class AbstractEclipseJava implements AfterEachCallback, BeforeEachCallbac
private final String compliance;
private static final String TEST_SETUP_PROJECT= "TestSetupProject"; //$NON-NLS-1$
private IPackageFragmentRoot fSourceFolder;
@SuppressWarnings("restriction")
private CustomProfile fProfile;

public AbstractEclipseJava(String stubs, String compilerversion) {
this.testresources_stubs= stubs;
this.compliance= compilerversion;
}

@SuppressWarnings("restriction")
@Override
public void beforeEach(ExtensionContext context) throws CoreException {
IJavaProject javaProject= createJavaProject(TEST_SETUP_PROJECT, "bin"); //$NON-NLS-1$
Expand Down Expand Up @@ -118,6 +120,7 @@ public IClasspathEntry[] getDefaultClasspath() throws CoreException {
return new IClasspathEntry[] { JavaCore.newLibraryEntry(rtJarPath[0], rtJarPath[1], rtJarPath[2], true) };
}

@SuppressWarnings("restriction")
protected void disableAll() throws CoreException {
Map<String, String> settings= fProfile.getSettings();
JavaPlugin.getDefault().getCleanUpRegistry().getDefaultOptions(DEFAULT_CLEAN_UP_OPTIONS).getKeys()
Expand Down Expand Up @@ -206,6 +209,7 @@ public final Bundle getBundle() {
* @return Returns the Java project handle
* @throws CoreException Project creation failed
*/
@SuppressWarnings("restriction")
public static IJavaProject createJavaProject(String projectName, String binFolderName) throws CoreException {
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
IProject project= root.getProject(projectName);
Expand Down Expand Up @@ -260,6 +264,7 @@ private static void addNatureToProject(IProject proj, String natureId, IProgress
* @return The handle to the new source container
* @throws CoreException Creation failed
*/
@SuppressWarnings("restriction")
public static IPackageFragmentRoot addSourceContainer(IJavaProject jproject, String containerName,
IPath[] inclusionFilters, IPath[] exclusionFilters, String outputLocation, IClasspathAttribute[] attributes)
throws CoreException {
Expand Down Expand Up @@ -333,6 +338,7 @@ protected RefactoringStatus assertRefactoringHasNoChangeEventWithError(ICompilat
}

protected CompilationUnit assertNoCompilationError(ICompilationUnit cu) {
@SuppressWarnings("restriction")
ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL);
parser.setSource(cu);
parser.setResolveBindings(true);
Expand Down Expand Up @@ -392,6 +398,7 @@ public static void assertEqualStringsIgnoreOrder(String[] actuals, String[] expe
}
}

@SuppressWarnings("restriction")
protected final RefactoringStatus performRefactoring(ICompilationUnit[] cus,
Set<String> setOfExpectedGroupCategories) throws CoreException {
final CleanUpRefactoring ref= new CleanUpRefactoring();
Expand All @@ -400,6 +407,7 @@ protected final RefactoringStatus performRefactoring(ICompilationUnit[] cus,
setOfExpectedGroupCategories);
}

@SuppressWarnings("restriction")
protected RefactoringStatus performRefactoring(final CleanUpRefactoring ref, ICompilationUnit[] cus,
ICleanUp[] cleanUps, Set<String> setOfExpectedGroupCategories) throws CoreException {
for (ICompilationUnit cu : cus) {
Expand Down Expand Up @@ -450,11 +458,13 @@ private void collectGroupCategories(Set<GroupCategory> result, Change change) {
}
}

@SuppressWarnings("restriction")
public void enable(String key) throws CoreException {
fProfile.getSettings().put(key, CleanUpOptions.TRUE);
commitProfile();
}

@SuppressWarnings("restriction")
private void commitProfile() throws CoreException {
List<Profile> profiles= CleanUpPreferenceUtil.getBuiltInProfiles();
profiles.add(fProfile);
Expand Down

0 comments on commit 7adc4f4

Please sign in to comment.