Skip to content

Commit

Permalink
Bug 532309 - Fix warnings in official build
Browse files Browse the repository at this point in the history
Change-Id: I08cc4bb79ef748007324b19f7913629051a09d8f
Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com>
  • Loading branch information
jarthana committed Mar 12, 2018
1 parent efc9b65 commit 58ac926
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ public static void removeFromProjectClasspath( IJavaProject jp, IFolder folder,
/**
* returns true if we updated the classpath, false otherwise
* @param specificOutputLocation
* @param
*/
public static boolean updateProjectClasspath( IJavaProject jp, IFolder folder, IProgressMonitor progressMonitor, boolean isTestCode, IPath specificOutputLocation )
throws JavaModelException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public VoidType getVoidType()
return _env.getVoidType();
}

@Override
@Override @Deprecated
public WildcardType getWildcardType(Collection<ReferenceType> upperBounds, Collection<ReferenceType> lowerBounds)
{
final String boundKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -33,7 +33,6 @@
/**
* Tests the Java search engine accross multiple projects.
*/
@SuppressWarnings("rawtypes")
public class JavaSearchScopeTests extends ModifyingResourceTests implements IJavaSearchConstants {
public JavaSearchScopeTests(String name) {
super(name);
Expand All @@ -52,8 +51,8 @@ public static Test suite() {
protected void tearDown() throws Exception {
// Cleanup caches
JavaModelManager manager = JavaModelManager.getJavaModelManager();
manager.containers = new HashMap(5);
manager.variables = new HashMap(5);
manager.containers = new HashMap<>(5);
manager.variables = new HashMap<>(5);

super.tearDown();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -24,7 +24,6 @@
/**
* DO NOT RELEASE AS PART OF REGRESSION TEST - if failing, can cause testing hang
*/
@SuppressWarnings("rawtypes")
public class ThreadSafetyTests extends ModifyingResourceTests {

public ThreadSafetyTests(String name) {
Expand All @@ -51,8 +50,8 @@ public void testDeadlock01() throws CoreException {
waitUntilIndexesReady();
project.getJavaModel().close();
JavaModelManager manager = JavaModelManager.getJavaModelManager();
manager.previousSessionContainers = new HashMap(5);
manager.containers = new HashMap(5);
manager.previousSessionContainers = new HashMap<>(5);
manager.containers = new HashMap<>(5);
manager.removePerProjectInfo((JavaProject)project, true /* remove external jar files indexes and timestamps*/);

// use a thread to hold the lock, so as to recreate potential deadlock situation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public abstract class AbstractAnnotationProcessorManager {
/**
* Configure the receiver using the given batch compiler and the given options.
* The parameter batchCompiler is expected to be an instance of the batch compiler. This method is
* only used for the batch mode. For the IDE mode, please see {@link #configureFromPlatform(Compiler, Object, Object)}.
* only used for the batch mode. For the IDE mode, please see {@link #configureFromPlatform(Compiler, Object, Object, boolean)}.
*
* @param batchCompiler the given batch compiler object
* @param options the given options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3799,7 +3799,7 @@ public static String getClasspathVariableDeprecationMessage(String variableName)
JavaModelManager manager = JavaModelManager.getJavaModelManager();

// Returns the stored deprecation message
String message = (String) manager.deprecatedVariables.get(variableName);
String message = manager.deprecatedVariables.get(variableName);
if (message != null) {
return message;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2017 IBM Corporation and others.
* Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -1031,7 +1031,7 @@ private boolean createExternalArchiveDelta(HashSet refreshedElements, IProgressM
File externalFile = (File)targetLibrary;

// check timestamp to figure if JAR has changed in some way
Long oldTimestamp =(Long) this.state.getExternalLibTimeStamps().get(entryPath);
Long oldTimestamp =this.state.getExternalLibTimeStamps().get(entryPath);
long newTimeStamp = getTimeStamp(externalFile);
if (oldTimestamp != null){

Expand Down Expand Up @@ -2566,6 +2566,7 @@ private boolean validateClasspaths(IResourceDelta delta) {
* Returns whether the children of the given delta must be processed.
* @throws a JavaModelException if the delta doesn't correspond to a java element of the given type.
*/
@SuppressWarnings("unlikely-arg-type")
public boolean updateCurrentDeltaAndIndex(IResourceDelta delta, int elementType, RootInfo rootInfo) {
Openable element;
switch (delta.getKind()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2062,7 +2062,7 @@ public Map<String, String> getOptions(boolean inheritJavaCoreOptions) {
projectOptions.put(propertyName, value);
if (!optionNames.contains(propertyName)) {
// try to migrate deprecated options
String[] compatibleOptions = (String[]) javaModelManager.deprecatedOptions.get(propertyName);
String[] compatibleOptions = javaModelManager.deprecatedOptions.get(propertyName);
if (compatibleOptions != null) {
for (int co=0, length=compatibleOptions.length; co < length; co++) {
String compatibleOption = compatibleOptions[co];
Expand Down

0 comments on commit 58ac926

Please sign in to comment.