Author: dgeraskov
Date: 2009-05-22 06:53:12 -0400 (Fri, 22 May 2009)
New Revision: 15400
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorInput.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/AdaptableWrapper.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/GenericPropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/AbstractGraphViewPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/DirectedGraphLayoutVisitor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/GraphAnimation.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLColors.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/SwingImageMap.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/DiagramContentOutlinePage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/autolayout/impl/Items.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/SwtUtils.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4357
More raw types used with generic parameter.
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -133,11 +133,11 @@
overrides.put( "hibernate.archive.autodetection", "none" );
//$NON-NLS-1$//$NON-NLS-2$
}
- Class clazz =
ReflectHelper.classForName("org.hibernate.ejb.Ejb3Configuration",
ConsoleConfiguration.class); //$NON-NLS-1$
+ Class<?> clazz =
ReflectHelper.classForName("org.hibernate.ejb.Ejb3Configuration",
ConsoleConfiguration.class); //$NON-NLS-1$
Object ejb3cfg = clazz.newInstance();
if(StringHelper.isNotEmpty(entityResolver)) {
- Class resolver = ReflectHelper.classForName(entityResolver, this.getClass());
+ Class<?> resolver = ReflectHelper.classForName(entityResolver,
this.getClass());
Object object = resolver.newInstance();
Method method = clazz.getMethod("setEntityResolver", new Class[] {
EntityResolver.class });//$NON-NLS-1$
method.invoke(ejb3cfg, new Object[] { object } );
@@ -163,10 +163,11 @@
}
}
+ @SuppressWarnings("unchecked")
private Configuration buildAnnotationConfiguration() throws ClassNotFoundException,
InstantiationException, IllegalAccessException {
- Class clazz = ReflectHelper
+ Class<Configuration> clazz = ReflectHelper
.classForName( "org.hibernate.cfg.AnnotationConfiguration" );
//$NON-NLS-1$
- Configuration newInstance = (Configuration) clazz.newInstance();
+ Configuration newInstance = clazz.newInstance();
return newInstance;
}
@@ -241,7 +242,7 @@
public Configuration buildWith(final Configuration cfg, final boolean includeMappings)
{
URL[] customClassPathURLs = getCustomClassPathURLs();
executionContext = new DefaultExecutionContext( getName(), new URLClassLoader(
customClassPathURLs, getParentClassLoader() ) {
- protected Class findClass(String name) throws ClassNotFoundException {
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
try {
return super.findClass( name );
} catch(ClassNotFoundException cnfe) {
@@ -249,7 +250,7 @@
}
}
- protected synchronized Class loadClass(String name, boolean resolve) throws
ClassNotFoundException {
+ protected synchronized Class<?> loadClass(String name, boolean resolve) throws
ClassNotFoundException {
try {
return super.loadClass( name, resolve );
} catch(ClassNotFoundException cnfe) {
@@ -257,7 +258,7 @@
}
}
- public Class loadClass(String name) throws ClassNotFoundException {
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
try {
return super.loadClass( name );
} catch(ClassNotFoundException cnfe) {
@@ -346,6 +347,7 @@
return result;
}
+ @SuppressWarnings("unchecked")
private Configuration loadConfigurationXML(Configuration localCfg, boolean
includeMappings, EntityResolver entityResolver) {
File configXMLFile = prefs.getConfigXMLFile();
if(!includeMappings) {
@@ -448,6 +450,7 @@
*
* @param driverClassName
*/
+ @SuppressWarnings("unchecked")
private void registerFakeDriver(String driverClassName) {
if(driverClassName!=null) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -78,7 +78,7 @@
criteria.setMaxResults( model.getMaxResults().intValue() );
}
} else if (o instanceof List) {
- list = (List) o;
+ list = (List<Object>) o;
if(model.getMaxResults()!=null) {
list = list.subList( 0, Math.min( list.size(),
model.getMaxResults().intValue() ) );
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -55,7 +55,6 @@
import org.hibernate.console.node.ConfigurationListNode;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
/**
* This class keeps track of the Hibernate Configurations that are known to
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -37,12 +37,12 @@
*/
public abstract long getQueryTime();
- public abstract List getList();
+ public abstract List<Object> getList();
/**
* @param i
*/
public abstract void setId(int i);
- public abstract List getPathNames();
+ public abstract List<String> getPathNames();
public abstract void release();
/**
* @return
@@ -55,7 +55,7 @@
/**
* @return
*/
- public abstract List getExceptions();
+ public abstract List<Throwable> getExceptions();
/**
* @return
*/
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/SwingImageMap.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/SwingImageMap.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/SwingImageMap.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -38,14 +38,14 @@
declareImages();
}
- Map imageRegistry = new HashMap();
+ Map<String, ImageIcon> imageRegistry = new HashMap<String, ImageIcon>();
protected void declareRegistryImage(String key, String path) {
imageRegistry.put(key, new ImageIcon(SwingImages.class.getResource(path) ) );
}
public Icon getIcon(String iconName) {
- return (Icon) imageRegistry.get(iconName);
+ return imageRegistry.get(iconName);
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -24,7 +24,6 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
-import java.util.Iterator;
import java.util.List;
import javax.swing.tree.TreeNode;
@@ -42,7 +41,7 @@
protected BaseNode parent;
protected NodeFactory factory;
- protected List<TreeNode> children = new ArrayList<TreeNode>();
+ protected List<BaseNode> children = new ArrayList<BaseNode>();
protected String name = "!"; //$NON-NLS-1$
String iconName = ImageConstants.UNKNOWNPROPERTY;
@@ -93,7 +92,7 @@
return getChildCount()==0;
}
- public Enumeration children() {
+ public Enumeration<BaseNode> children() {
checkChildren();
return Collections.enumeration(children);
}
@@ -122,8 +121,7 @@
/** clear/reset this node. Mainly get rid of children. **/
public void clear() {
- for (Iterator iter = children.iterator(); iter.hasNext();) {
- BaseNode element = (BaseNode) iter.next();
+ for (BaseNode element : children) {
element.clear();
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -69,16 +69,10 @@
protected void checkChildren() {
if(!childrenCreated) {
ConsoleConfiguration[] configurations = kc.getConfigurations();
- Arrays.sort(configurations, new Comparator() {
- public boolean equals(Object obj) {
- return this==obj;
+ Arrays.sort(configurations, new Comparator<ConsoleConfiguration>() {
+ public int compare(ConsoleConfiguration o1, ConsoleConfiguration o2) {
+ return o1.getName().compareTo(o2.getName());
}
-
- public int compare(Object o1, Object o2) {
- return ( (ConsoleConfiguration)o1).getName()
- .compareTo(
- ( (ConsoleConfiguration)o2).getName() );
- }
});
for (int i = 0; i < configurations.length; i++) {
children.add(new ConfigurationNode(this, configurations[i]) );
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -125,7 +125,7 @@
initCollectionObject();
int idx = 0;
if(!type.isArrayType() ) {
- Iterator i = ( (Collection)collectionObject).iterator();
+ Iterator<?> i = ( (Collection<?>)collectionObject).iterator();
while (i.hasNext() ) {
Object element = i.next();
@@ -146,7 +146,7 @@
}
- private TreeNode createNode(int idx, Object element, Type type) { // TODO: use a common
way to create these darn nodes!
+ private BaseNode createNode(int idx, Object element, Type type) { // TODO: use a common
way to create these darn nodes!
return new ClassNode(factory, this,type.getReturnedClass().getName(),
factory.getMetaData(type.getReturnedClass() ),element,objectGraph);
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -53,7 +53,7 @@
private static final CallbackFilter baseNodeFilter = new CallbackFilter() {
public int accept(Method method) {
- Class declaringClass = method.getDeclaringClass();
+ Class<?> declaringClass = method.getDeclaringClass();
if(ExecutionContextHolder.class.isAssignableFrom(declaringClass ) ) {
if(GET_EXECUTION_CONTEXT.equals(method.getName() ) ) {
return 1;
@@ -64,13 +64,9 @@
return 1;
}
}
-
- public boolean equals(Object o) {
- return o==this;
- }
};
- public static Enhancer createEnhancer(Class clazz) {
+ public static Enhancer createEnhancer(Class<?> clazz) {
Enhancer e = new Enhancer();
e.setSuperclass(clazz);
e.setCallbacks(new Callback[] {
ProxyFactory.EXECUTIONCONTEXTHOLDER_METHOD_INTERCEPTOR, NoOp.INSTANCE });
@@ -98,7 +94,7 @@
}
- public static Object createEnhancedObject(Class clazz, Object realObject,
ExecutionContextHolder ech) {
+ public static Object createEnhancedObject(Class<?> clazz, Object realObject,
ExecutionContextHolder ech) {
Enhancer e = new Enhancer();
e.setSuperclass(clazz);
e.setInterfaces(new Class[] { ExecutionContextHolder.class } );
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -52,7 +52,7 @@
// TODO: we should move this to some classhandler
static public class ConfigurationMode implements Serializable {
- private static final Map INSTANCES = new HashMap();
+ private static final Map<String, ConfigurationMode> INSTANCES = new
HashMap<String, ConfigurationMode>();
public static final ConfigurationMode CORE = new ConfigurationMode( "CORE" );
//$NON-NLS-1$
public static final ConfigurationMode ANNOTATIONS = new ConfigurationMode(
"ANNOTATIONS" ); //$NON-NLS-1$
@@ -79,7 +79,7 @@
}
public static ConfigurationMode parse(String name) {
- ConfigurationMode rtn = ( ConfigurationMode ) INSTANCES.get( name );
+ ConfigurationMode rtn = INSTANCES.get( name );
if ( rtn == null ) {
// default is POJO
rtn = CORE;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -11,13 +11,13 @@
public class CurrentContext {
- static Hashtable map = new Hashtable();
+ static Hashtable<Thread, Stack<Object>> map = new Hashtable<Thread,
Stack<Object>>();
private CurrentContext() {
}
public static int getDepth() {
- Stack stack = (Stack) map.get( Thread.currentThread() );
+ Stack<Object> stack = map.get( Thread.currentThread() );
if ( stack == null )
return 0;
else
@@ -26,7 +26,7 @@
public static Object pop() {
Thread key = Thread.currentThread();
- Stack stack = (Stack) map.get( key );
+ Stack<Object> stack = map.get( key );
if ( stack != null && !stack.isEmpty() )
return (stack.pop() );
else
@@ -35,7 +35,7 @@
public static Object peek() {
Thread key = Thread.currentThread();
- Stack stack = (Stack) map.get( key );
+ Stack<Object> stack = map.get( key );
if ( stack != null && !stack.isEmpty() )
return stack.peek();
else
@@ -44,10 +44,10 @@
public static void push(Object message) {
Thread key = Thread.currentThread();
- Stack stack = (Stack) map.get( key );
+ Stack<Object> stack = map.get( key );
if ( stack == null ) {
- stack = new Stack();
+ stack = new Stack<Object>();
map.put( key, stack );
stack.push( message );
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -44,7 +44,6 @@
public class PluginLogAppender extends AppenderSkeleton {
private ILog pluginLog;
- private Map streams = new HashMap();
/**
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -39,6 +39,7 @@
import org.apache.log4j.spi.RepositorySelector;
import org.apache.log4j.spi.RootLogger;
import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.ILogListener;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Plugin;
@@ -52,7 +53,7 @@
private ILog log;
private IPath stateLocation;
private Hierarchy hierarchy;
- private HashMap hookedPlugins = new HashMap();
+ private HashMap<String, ILogListener> hookedPlugins = new HashMap<String,
ILogListener>();
private LoggingHelper helper;
private class PluginEventListener implements HierarchyEventListener {
@@ -230,9 +231,9 @@
*/
void internalShutdown() {
synchronized(this.hookedPlugins) {
- Iterator it = this.hookedPlugins.keySet().iterator();
+ Iterator<String> it = this.hookedPlugins.keySet().iterator();
while (it.hasNext()) {
- String id = (String) it.next();
+ String id = it.next();
PluginLogListener listener = (PluginLogListener) this.hookedPlugins.get(id);
listener.dispose();
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorInput.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorInput.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorInput.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -38,7 +38,8 @@
return false;
}
- public Object getAdapter( Class adapter ) {
+ @SuppressWarnings("unchecked")
+ public Object getAdapter( Class adapter ) {
return null;
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -32,7 +32,8 @@
setContents(source);
}
- public Object getAdapter( Class key ) {
+ @SuppressWarnings("unchecked")
+ public Object getAdapter( Class key ) {
return null;
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -44,7 +44,7 @@
}
protected void doRun() {
- for (Iterator i = getSelectedNonResources().iterator(); i.hasNext();) {
+ for (Iterator<?> i = getSelectedNonResources().iterator(); i.hasNext();) {
try {
Object node = i.next();
if(node instanceof ConsoleConfiguration) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -33,7 +33,7 @@
@Override
public void run() {
- List pages = KnownConfigurations.getInstance().getQueryPageModel().getPagesAsList();
+ List<QueryPage> pages =
KnownConfigurations.getInstance().getQueryPageModel().getPagesAsList();
for (int i = 0; i < pages.size(); i++ ) {
KnownConfigurations.getInstance().getQueryPageModel().remove( (QueryPage) pages.get(i)
);
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -54,7 +54,7 @@
}
/** A table of all the <code>ImageDescriptor</code>s. */
- Map imageDescriptors = new HashMap();
+ Map<String, ImageDescriptor> imageDescriptors = new HashMap<String,
ImageDescriptor>();
/** The image registry containing <code>Image</code>s. */
ImageRegistry imageRegistry = new ImageRegistry();
@@ -85,7 +85,7 @@
public ImageDescriptor getImageDescriptor(String key) {
- return (ImageDescriptor) imageDescriptors.get(key);
+ return imageDescriptors.get(key);
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -41,7 +41,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.ActionContext;
@@ -59,7 +58,6 @@
import org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
-import org.hibernate.util.StringHelper;
/**
@@ -165,8 +163,7 @@
if(consoleConfiguration.isSessionFactoryCreated() ) {
String hql = node.getHQL();
// open HQL Editor
- HibernateConsolePlugin.getDefault().openScratchHQLEditor(
- consoleConfiguration == null ? null : consoleConfiguration.getName(), hql);
+ HibernateConsolePlugin.getDefault().openScratchHQLEditor(consoleConfiguration.getName(),
hql);
/** /
// execute query and show results in
// Hibernate Query result view - commented cause old version
@@ -188,9 +185,8 @@
Object last = path.getLastSegment();
ConsoleConfiguration consoleConfiguration =
(ConsoleConfiguration)(path.getSegment(0));
if (last instanceof PersistentClass || last.getClass() == Property.class){
- IEditorPart res = null;
try {
- res = OpenMappingAction.run(path, consoleConfiguration);
+ OpenMappingAction.run(path, consoleConfiguration);
} catch (PartInitException e) {
HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping
file.", e); //$NON-NLS-1$
} catch (JavaModelException e) {
@@ -224,6 +220,7 @@
viewer.getTree().setFocus();
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
if (adapter.equals(IPropertySheetPage.class) )
{
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -209,7 +209,7 @@
cqp.setName( (String) value );
}
if ( TYPE_PROPERTY.equals( property ) ) {
- Iterator iterator = possibleTypes.iterator();
+ Iterator<Type> iterator = possibleTypes.iterator();
int i = 0;
while(iterator.hasNext()) {
NullableType type = (NullableType) iterator.next();
@@ -242,11 +242,11 @@
return cqp.getName();
}
if ( TYPE_PROPERTY.equals( property ) ) {
- Iterator iterator = possibleTypes.iterator();
+ Iterator<Type> iterator = possibleTypes.iterator();
NullableType type = cqp.getType();
int i = 0;
while(iterator.hasNext()) {
- if (type == ((Type) iterator.next())) {
+ if (type == iterator.next()) {
return Integer.valueOf(i);
}
i++;
@@ -285,10 +285,10 @@
String[] valueTypes = new String[possibleTypes.size()];
- Iterator iterator = possibleTypes.iterator();
+ Iterator<Type> iterator = possibleTypes.iterator();
int i=0;
while ( iterator.hasNext() ) {
- Type element = (Type) iterator.next();
+ Type element = iterator.next();
valueTypes[i++] = element.getName();
}
CellEditor[] editors = new CellEditor[columnProperties.length];
@@ -364,7 +364,7 @@
public void run() {
ConsoleQueryParameter[] queryParameters = model.getQueryParameters();
- Map qp = new HashMap();
+ Map<String, ConsoleQueryParameter> qp = new HashMap<String,
ConsoleQueryParameter>();
for (int i = 0; i < queryParameters.length; i++) {
ConsoleQueryParameter parameter = queryParameters[i];
qp.put(parameter.getName(), parameter);
@@ -377,7 +377,7 @@
ConsoleQueryParameter cqp = null;
int[] positions = StringHelper.locateUnquoted( queryString, '?' );
for (int i = 0; i < positions.length; i++) {
- cqp = (ConsoleQueryParameter) qp.get(""+i); //$NON-NLS-1$
+ cqp = qp.get(""+i); //$NON-NLS-1$
if(cqp==null) {
cqp = model.createUniqueParameter(""+i); //$NON-NLS-1$
}
@@ -385,7 +385,7 @@
}
StringTokenizer st = new StringTokenizer(queryString, ParserHelper.HQL_SEPARATORS);
- Set result = new HashSet();
+ Set<String> result = new HashSet<String>();
while ( st.hasMoreTokens() ) {
String string = st.nextToken();
@@ -394,10 +394,10 @@
}
}
- Iterator iterator = result.iterator();
+ Iterator<String> iterator = result.iterator();
while ( iterator.hasNext() ) {
- String paramName = (String) iterator.next();
- cqp = (ConsoleQueryParameter) qp.get(paramName);
+ String paramName = iterator.next();
+ cqp = qp.get(paramName);
if(cqp==null) {
cqp = model.createUniqueParameter(paramName);
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/AdaptableWrapper.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/AdaptableWrapper.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/AdaptableWrapper.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -31,6 +31,7 @@
this.element = element;
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
if(adapter.isInstance(element)) {
return element;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -35,7 +35,7 @@
public class CollectionPropertySource implements IPropertySource {
- private Collection collection;
+ private Collection<?> collection;
IPropertyDescriptor[] descriptors = null;
@@ -45,9 +45,9 @@
private final ExecutionContextHolder currentConfiguration;
- Map values = new WeakHashMap();
+ Map<Object, Object> values = new WeakHashMap<Object, Object>();
- public CollectionPropertySource(Collection propertyValue, Session currentSession,
ExecutionContextHolder currentConfiguration, CollectionMetadata collectionMetadata) {
+ public CollectionPropertySource(Collection<?> propertyValue, Session
currentSession, ExecutionContextHolder currentConfiguration, CollectionMetadata
collectionMetadata) {
collection = propertyValue;
this.currentSession = currentSession;
this.currentConfiguration = currentConfiguration;
@@ -73,7 +73,7 @@
Object value = values.get(id);
if(value==null) {
Integer i = (Integer) id;
- Iterator iterator = collection.iterator();
+ Iterator<?> iterator = collection.iterator();
int base = 0;
while(iterator.hasNext()) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -118,10 +118,10 @@
propertyValue = classMetadata.getPropertyValue(reflectedObject, (String)id,
EntityMode.POJO);
}
- if (propertyValue instanceof Collection) {
+ if (propertyValue instanceof Collection<?>) {
CollectionMetadata collectionMetadata =
currentSession.getSessionFactory().getCollectionMetadata(classMetadata.getEntityName() +
"." + id); //$NON-NLS-1$
if(collectionMetadata!=null) {
- propertyValue = new CollectionPropertySource((Collection)
propertyValue,currentSession,currentConfiguration, collectionMetadata);
+ propertyValue = new CollectionPropertySource((Collection<?>)
propertyValue,currentSession,currentConfiguration, collectionMetadata);
}
}
return propertyValue;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -69,7 +69,7 @@
@SuppressWarnings("unchecked")
- protected <T> T[] toArray(Iterator<T> iterator, Class<T> clazz,
Comparator<? super T> comparator) {
+ protected <T> T[] toArray(Iterator<? extends T> iterator, Class<T>
clazz, Comparator<? super T> comparator) {
List<T> obj = toList( iterator );
T[] array = obj.toArray((T[])Array.newInstance(clazz, obj.size()) );
@@ -79,7 +79,7 @@
return array;
}
- private <T> List<T> toList(Iterator<T> iterator) {
+ private <T> List<T> toList(Iterator<? extends T> iterator) {
List<T> obj = new ArrayList<T>();
while ( iterator.hasNext() ) {
obj.add(iterator.next());
@@ -87,7 +87,7 @@
return obj;
}
- protected Object[] toArray(Enumeration<Object> enumeration, Class<?> clazz)
{
+ protected Object[] toArray(Enumeration<?> enumeration, Class<?> clazz) {
List<Object> obj = new ArrayList<Object>();
while ( enumeration.hasMoreElements() ) {
obj.add(enumeration.nextElement());
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -22,7 +22,6 @@
package org.hibernate.eclipse.console.workbench;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.eclipse.core.runtime.IAdapterFactory;
@@ -44,12 +43,12 @@
public class ConfigurationAdapterFactory implements IAdapterFactory {
- private Class[] classes;
+ private Class<?>[] classes;
private IDeferredWorkbenchAdapter[] adapters;
public ConfigurationAdapterFactory() {
- Map map = new HashMap();
+ Map<Class<?>, IDeferredWorkbenchAdapter> map = new
HashMap<Class<?>, IDeferredWorkbenchAdapter>();
map.put(ConsoleConfiguration.class, new ConsoleConfigurationWorkbenchAdapter());
map.put(Configuration.class, new ConfigurationWorkbenchAdapter());
@@ -68,16 +67,15 @@
classes = new Class[map.size()];
adapters = new IDeferredWorkbenchAdapter[map.size()];
- Iterator iter = map.entrySet().iterator();
int cnt = 0;
- while ( iter.hasNext() ) {
- Map.Entry entry = (Map.Entry) iter.next();
- classes[cnt] = (Class) entry.getKey();
- adapters[cnt] = (IDeferredWorkbenchAdapter) entry.getValue();
- cnt++;
+ for (Map.Entry<Class<?>, IDeferredWorkbenchAdapter> entry : map.entrySet())
{
+ classes[cnt] = entry.getKey();
+ adapters[cnt] = entry.getValue();
+ cnt++;
}
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Object adaptableObject, Class adapterType) {
if((adapterType==IDeferredWorkbenchAdapter.class ||
adapterType==IWorkbenchAdapter.class)) {
return getAdapter( adaptableObject );
@@ -95,7 +93,7 @@
private Object getAdapter(Object adaptableObject) {
for (int i = 0; i < classes.length; i++) {
- Class clazz = classes[i];
+ Class<?> clazz = classes[i];
if (clazz.isInstance(adaptableObject)) {
return adapters[i];
}
@@ -103,13 +101,13 @@
return null;
}
- public Class[] getAdapterList() {
- return new Class[] { IDeferredWorkbenchAdapter.class, IWorkbenchAdapter.class,
IPropertySource.class, IPropertySource2.class };
+ public Class<?>[] getAdapterList() {
+ return new Class<?>[] { IDeferredWorkbenchAdapter.class, IWorkbenchAdapter.class,
IPropertySource.class, IPropertySource2.class };
}
public void registerAdapters(IAdapterManager adapterManager) {
for (int i = 0; i < classes.length; i++) {
- Class clazz = classes[i];
+ Class<?> clazz = classes[i];
adapterManager.registerAdapters(this, clazz);
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -25,7 +25,6 @@
import java.util.Iterator;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osgi.util.NLS;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.KnownConfigurations;
@@ -35,14 +34,13 @@
public class ConfigurationWorkbenchAdapter extends BasicWorkbenchAdapter {
+ @SuppressWarnings("unchecked")
public Object[] getChildren(Object o) {
Configuration cfg = (Configuration) o;
- Iterator classMappings = cfg.getClassMappings();
- return toArray(classMappings, PersistentClass.class, new Comparator() {
+ Iterator<? extends PersistentClass> classMappings = cfg.getClassMappings();
+ return toArray(classMappings, PersistentClass.class, new
Comparator<PersistentClass>() {
- public int compare(Object arg0, Object arg1) {
- PersistentClass p0 = (PersistentClass) arg0;
- PersistentClass p1 = (PersistentClass) arg1;
+ public int compare(PersistentClass p0, PersistentClass p1) {
String label0 = HibernateWorkbenchHelper.getLabelForClassName(p0.getEntityName());
String label1 = HibernateWorkbenchHelper.getLabelForClassName(p1.getEntityName());
return label0.compareTo(label1);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/GenericPropertySource.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/GenericPropertySource.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/GenericPropertySource.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -34,12 +34,12 @@
private final Object real;
private IPropertyDescriptor[] descriptors;
- private HashMap map;
+ private HashMap<Object, IPropertyDescriptor> map;
public GenericPropertySource(Object real) {
this.real = real;
this.descriptors = buildPropertyDescriptors();
- this.map = new HashMap();
+ this.map = new HashMap<Object, IPropertyDescriptor>();
for (int i = 0; i < descriptors.length; i++) {
IPropertyDescriptor desc = descriptors[i];
map.put(desc.getId(), desc);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -37,7 +37,6 @@
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextListener;
-import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.TextEvent;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.swt.layout.GridData;
@@ -143,6 +142,7 @@
return evalCtx ;
}
+ @SuppressWarnings("unchecked")
private String[] getImports() {
ConsoleConfiguration consoleConfiguration = getConsoleConfiguration();
@@ -151,12 +151,12 @@
consoleConfiguration.build();
}
- Set imports = new HashSet();
+ Set<String> imports = new HashSet<String>();
Configuration configuration = consoleConfiguration.getConfiguration();
if(configuration!=null) {
- Iterator classMappings = configuration.getClassMappings();
+ Iterator<PersistentClass> classMappings = configuration.getClassMappings();
while ( classMappings.hasNext() ) {
- PersistentClass clazz = (PersistentClass) classMappings.next();
+ PersistentClass clazz = classMappings.next();
String className = clazz.getClassName();
if(className!=null) {
imports.add( className );
@@ -167,11 +167,10 @@
imports.add("org.hibernate.*"); //$NON-NLS-1$
imports.add("org.hibernate.criterion.*"); //$NON-NLS-1$
- return (String[]) imports.toArray( new String[imports.size()] );
+ return imports.toArray( new String[imports.size()] );
}
public void codeComplete(String prefix, CompletionProposalCollector collector, int
position, IJavaProject project) throws JavaModelException {
- ITextSelection selection= (ITextSelection)getSelectionProvider().getSelection();
String code= getSourceViewer().getDocument().get();
code= prefix + code;
IEvaluationContext e= getEvaluationContext(project);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/AbstractGraphViewPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/AbstractGraphViewPart.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/AbstractGraphViewPart.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -125,6 +125,7 @@
}
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
if(adapter.equals(GraphicalViewer.class)) {
return viewer;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/DirectedGraphLayoutVisitor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/DirectedGraphLayoutVisitor.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/DirectedGraphLayoutVisitor.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -40,6 +40,7 @@
import org.eclipse.draw2d.graph.Edge;
import org.eclipse.draw2d.graph.Node;
import org.eclipse.draw2d.graph.NodeList;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
import org.hibernate.eclipse.graph.parts.AssociationEditPart;
import org.hibernate.eclipse.graph.parts.ConfigurationEditPart;
import org.hibernate.eclipse.graph.parts.PersistentClassEditPart;
@@ -47,8 +48,8 @@
public class DirectedGraphLayoutVisitor
{
- Map partToNodesMap;
- Set addedAssociations;
+ Map<AbstractGraphicalEditPart, Object> partToNodesMap;
+ Set<AssociationEditPart> addedAssociations;
DirectedGraph graph;
private ConfigurationEditPart diagram;
@@ -59,8 +60,8 @@
public void layoutDiagram(ConfigurationEditPart diagram)
{
- partToNodesMap = new HashMap();
- addedAssociations = new HashSet();
+ partToNodesMap = new HashMap<AbstractGraphicalEditPart, Object>();
+ addedAssociations = new HashSet<AssociationEditPart>();
this.diagram = diagram;
graph = new DirectedGraph();
addNodes(diagram);
@@ -110,12 +111,11 @@
//******************* PersistentClassEditPart contribution methods **********/
+ @SuppressWarnings("unchecked")
protected void addEdges(PersistentClassEditPart classPart)
{
- List outgoing = classPart.getSourceConnections();
- for (int i = 0; i < outgoing.size(); i++)
- {
- AssociationEditPart relationshipPart = (AssociationEditPart)
classPart.getSourceConnections().get(i);
+ List<AssociationEditPart> outgoing = classPart.getSourceConnections();
+ for (AssociationEditPart relationshipPart : outgoing) {
addEdges(relationshipPart);
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/GraphAnimation.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/GraphAnimation.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/GraphAnimation.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -32,6 +32,7 @@
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.draw2d.geometry.Translatable;
/**
@@ -51,15 +52,15 @@
static boolean PLAYBACK;
static boolean RECORDING;
- static Map initialStates;
- static Map finalStates;
+ static Map<IFigure, Translatable> initialStates;
+ static Map<IFigure, Translatable> finalStates;
public static void end()
{
- Iterator iter = initialStates.keySet().iterator();
+ Iterator<IFigure> iter = initialStates.keySet().iterator();
while (iter.hasNext())
{
- IFigure f = ((IFigure) iter.next());
+ IFigure f = iter.next();
f.revalidate();
f.setVisible(true);
}
@@ -84,12 +85,12 @@
while (root.getParent() != null)
root = root.getParent();
- initialStates = new HashMap();
- finalStates = new HashMap();
+ initialStates = new HashMap<IFigure, Translatable>();
+ finalStates = new HashMap<IFigure, Translatable>();
//This part records all layout results.
root.validate();
- Iterator iter = initialStates.keySet().iterator();
+ Iterator<IFigure> iter = initialStates.keySet().iterator();
if (!iter.hasNext())
{
//Nothing layed out, so abort the animation
@@ -97,7 +98,7 @@
return false;
}
while (iter.hasNext())
- recordFinalState((IFigure) iter.next());
+ recordFinalState(iter.next());
start = System.currentTimeMillis();
finish = start + DURATION;
@@ -138,16 +139,17 @@
return true;
}
+ @SuppressWarnings("unchecked")
public static boolean playbackState(IFigure container)
{
if (!PLAYBACK)
return false;
- List children = container.getChildren();
+ List<IFigure> children = container.getChildren();
Rectangle rect1, rect2;
for (int i = 0; i < children.size(); i++)
{
- IFigure child = (IFigure) children.get(i);
+ IFigure child = children.get(i);
rect1 = (Rectangle) initialStates.get(child);
rect2 = (Rectangle) finalStates.get(child);
if (rect2 == null)
@@ -272,23 +274,24 @@
initialStates.put(connection, points);
}
+ @SuppressWarnings("unchecked")
public static void recordInitialState(IFigure container)
{
if (!RECORDING)
return;
- List children = container.getChildren();
+ List<IFigure> children = container.getChildren();
IFigure child;
for (int i = 0; i < children.size(); i++)
{
- child = (IFigure) children.get(i);
+ child = children.get(i);
initialStates.put(child, child.getBounds().getCopy());
}
}
public static void swap()
{
- Map temp = finalStates;
+ Map<IFigure, Translatable> temp = finalStates;
finalStates = initialStates;
initialStates = temp;
}
@@ -298,10 +301,10 @@
current = System.currentTimeMillis() + 30;
progress = (double) (current - start) / (finish - start);
progress = Math.min(progress, 0.999);
- Iterator iter = initialStates.keySet().iterator();
+ Iterator<IFigure> iter = initialStates.keySet().iterator();
while (iter.hasNext())
- ((IFigure) iter.next()).revalidate();
+ iter.next().revalidate();
viewport.validate();
// Point loc = viewport.getViewLocation();
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -36,6 +36,7 @@
import org.hibernate.eclipse.graph.anchor.LeftOrRightParentAnchor;
import org.hibernate.eclipse.graph.figures.EditableLabel;
import org.hibernate.eclipse.graph.model.PersistentClassViewAdapter;
+import org.hibernate.eclipse.graph.model.PropertyAssociationViewAdapter;
import org.hibernate.eclipse.graph.model.PropertyViewAdapter;
import org.hibernate.mapping.Property;
@@ -72,13 +73,13 @@
// TODO Auto-generated method stub
return super.getCommand( request );
}
- public List getModelSourceConnections() {
- List sc = ((PropertyViewAdapter) getModel()).getSourceConnections();
+ public List<PropertyAssociationViewAdapter> getModelSourceConnections() {
+ List<PropertyAssociationViewAdapter> sc = ((PropertyViewAdapter)
getModel()).getSourceConnections();
return sc;
}
- public List getModelTargetConnections() {
- List tc = ((PropertyViewAdapter) getModel()).getTargetConnections();
+ public List<PropertyViewAdapter> getModelTargetConnections() {
+ List<PropertyViewAdapter> tc = ((PropertyViewAdapter)
getModel()).getTargetConnections();
return tc;
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLColors.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLColors.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLColors.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -33,12 +33,12 @@
public class HQLColors {
- protected Map fColorTable = new HashMap(10);
+ protected Map<RGB, Color> fColorTable = new HashMap<RGB, Color>(10);
public void dispose() {
- Iterator e = fColorTable.values().iterator();
+ Iterator<Color> e = fColorTable.values().iterator();
while (e.hasNext())
- ((Color) e.next()).dispose();
+ e.next().dispose();
fColorTable.clear();
}
@@ -51,7 +51,7 @@
protected Color getColor(RGB rgb) {
if(rgb==null) rgb = new RGB(0,0,0);
- Color color = (Color) fColorTable.get(rgb);
+ Color color = fColorTable.get(rgb);
if (color == null) {
color = new Color(Display.getCurrent(), rgb);
fColorTable.put(rgb, color);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -279,6 +279,7 @@
* @see
org.eclipse.jface.text.source.projection.ProjectionSupport#getAdapter(org.eclipse.jface.text.source.ISourceViewer,
* java.lang.Class)
*/
+ @SuppressWarnings("unchecked")
public Object getAdapter( Class classForWhichAdapterNeeded ) {
Object adapter = null;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -157,12 +157,12 @@
}
public Object[] getElements(Object inputElement) {
- Iterator set = localEf.getDefaultExporterProperties().entrySet().iterator();
+ Iterator<Map.Entry<String, ExporterProperty>> set =
localEf.getDefaultExporterProperties().entrySet().iterator();
List<ExporterProperty> values = new ArrayList<ExporterProperty>(4);
while ( set.hasNext() ) {
- Map.Entry element = (Map.Entry) set.next();
+ Map.Entry<String, ExporterProperty> element = set.next();
//if(!localEf.hasLocalValueFor((String) element.getKey())) {
- ExporterProperty exporterProperty = localEf.getExporterProperty( (String)
element.getKey() );
+ ExporterProperty exporterProperty = localEf.getExporterProperty( element.getKey()
);
if(exporterProperty!=null) {
values.add(exporterProperty);
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -21,7 +21,6 @@
*/
package org.hibernate.eclipse.launch;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.lang.reflect.Constructor;
import java.util.HashSet;
@@ -39,6 +38,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -56,7 +56,6 @@
import org.eclipse.jdt.core.formatter.CodeFormatter;
import org.eclipse.jface.text.DocumentRewriteSessionType;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.util.Assert;
import org.eclipse.osgi.util.NLS;
import org.eclipse.text.edits.TextEdit;
import org.hibernate.HibernateException;
@@ -66,7 +65,6 @@
import org.hibernate.cfg.reveng.OverrideRepository;
import org.hibernate.cfg.reveng.ReverseEngineeringSettings;
import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
-import org.hibernate.cfg.reveng.TableFilter;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.console.KnownConfigurations;
@@ -96,7 +94,7 @@
throws CoreException, OperationCanceledException {
IResource bufferRes =
ResourcesPlugin.getWorkspace().getRoot().findMember(textFileBuffer.getLocation());
- Map options = null;
+ Map<?, ?> options = null;
if(bufferRes!=null) {
IJavaProject project = JavaCore.create(bufferRes.getProject());
options = project.getOptions(true);
@@ -125,22 +123,20 @@
try {
ExporterAttributes attributes = new ExporterAttributes(configuration);
- List exporterFactories = attributes.getExporterFactories();
- for (Iterator iter = exporterFactories.iterator(); iter.hasNext();) {
- ExporterFactory exFactory = (ExporterFactory) iter.next();
+ List<ExporterFactory> exporterFactories = attributes.getExporterFactories();
+ for (Iterator<ExporterFactory> iter = exporterFactories.iterator();
iter.hasNext();) {
+ ExporterFactory exFactory = iter.next();
if(!exFactory.isEnabled(configuration)) {
iter.remove();
}
}
- Set outputDirectories = new HashSet();
- ExporterFactory[] exporters = (ExporterFactory[]) exporterFactories.toArray( new
ExporterFactory[exporterFactories.size()] );
+ Set<String> outputDirectories = new HashSet<String>();
+ ExporterFactory[] exporters = exporterFactories.toArray( new
ExporterFactory[exporterFactories.size()] );
ArtifactCollector collector = runExporters(attributes, exporters,
outputDirectories, monitor);
- Iterator iterator = outputDirectories.iterator();
- while (iterator.hasNext()) {
- String path = (String) iterator.next();
- refreshOutputDir( path );
+ for (String path : outputDirectories) {
+ refreshOutputDir( path );
}
RefreshTab.refreshResources(configuration, monitor);
@@ -202,7 +198,7 @@
}
}
- private ArtifactCollector runExporters (final ExporterAttributes attributes, final
ExporterFactory[] exporterFactories, final Set outputDirectories, final IProgressMonitor
monitor)
+ private ArtifactCollector runExporters (final ExporterAttributes attributes, final
ExporterFactory[] exporterFactories, final Set<String> outputDirectories, final
IProgressMonitor monitor)
throws CoreException
{
@@ -337,11 +333,12 @@
}
// TODO: merge with revstrategy load in JDBCConfigurationTask
+ @SuppressWarnings("unchecked")
private ReverseEngineeringStrategy loadreverseEngineeringStrategy(final String
className, ReverseEngineeringStrategy delegate) {
try {
Class clazz = ReflectHelper.classForName(className);
- Constructor constructor = clazz.getConstructor(new Class[] {
ReverseEngineeringStrategy.class });
- return (ReverseEngineeringStrategy) constructor.newInstance(new Object[] {
delegate });
+ Constructor<ReverseEngineeringStrategy> constructor = clazz.getConstructor(new
Class[] { ReverseEngineeringStrategy.class });
+ return constructor.newInstance(new Object[] { delegate });
}
catch (NoSuchMethodException e) {
try {
@@ -382,6 +379,6 @@
protected void abort(String message, Throwable exception, int code)
throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR,
HibernateConsolePlugin.getDefault().ID, code, message, exception));
+ throw new CoreException(new Status(IStatus.ERROR, HibernateConsolePlugin.ID, code,
message, exception));
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -42,11 +42,9 @@
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.StringTokenizer;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
@@ -59,7 +57,6 @@
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.model.impl.ExporterDefinition;
import org.hibernate.eclipse.console.model.impl.ExporterFactory;
-import org.hibernate.mapping.Table;
// This class was created to centralize launch configuration attribute loading/saving
// (and also to clean up CodeGenerationLaunchDelegate considerably)
@@ -120,7 +117,8 @@
return HibernateLaunchConstants.ATTR_EXPORTERS + "." + exporterId;
//$NON-NLS-1$
}
- private List<ExporterFactory> readExporterFactories(ILaunchConfiguration
configuration) throws CoreException {
+ @SuppressWarnings("unchecked")
+private List<ExporterFactory> readExporterFactories(ILaunchConfiguration
configuration) throws CoreException {
List<String> exporterNames =
configuration.getAttribute(HibernateLaunchConstants.ATTR_EXPORTERS,
(List<String>)null);
@@ -139,8 +137,8 @@
ExporterFactory exporterFactory = new ExporterFactory( expDef, exporterId );
exporterFactory.isEnabled( configuration );
factories.add( exporterFactory );
- Map props = configuration.getAttribute(
getLaunchAttributePrefix(exporterFactory.getId())
- + ".properties", new HashMap() ); //$NON-NLS-1$
+ Map<String, String> props = configuration.getAttribute(
getLaunchAttributePrefix(exporterFactory.getId())
+ + ".properties", new HashMap<String, String>() ); //$NON-NLS-1$
exporterFactory.setProperties( props );
}
}
@@ -156,8 +154,8 @@
ExporterFactory exporterFactory = new ExporterFactory( expDef, expDef.getId() );
exporterFactory.isEnabled( configuration );
factories.add( exporterFactory );
- Map props = configuration.getAttribute(
getLaunchAttributePrefix(exporterFactory.getId())
- + ".properties", new HashMap() ); //$NON-NLS-1$
+ Map<String, String> props = configuration.getAttribute(
getLaunchAttributePrefix(exporterFactory.getId())
+ + ".properties", new HashMap<String, String>() ); //$NON-NLS-1$
exporterFactory.setProperties( props );
}
@@ -167,22 +165,21 @@
public static void saveExporterFactories(
ILaunchConfigurationWorkingCopy configuration,
- List exporterFactories, Set enabledExporters, Set deletedExporterIds) {
+ List<ExporterFactory> exporterFactories, Set<ExporterFactory>
enabledExporters, Set<String> deletedExporterIds) {
List<String> names = new ArrayList<String>();
- for (Iterator iter = exporterFactories.iterator(); iter.hasNext();) {
- ExporterFactory ef = (ExporterFactory) iter.next();
+ for (ExporterFactory ef : exporterFactories) {
configuration.setAttribute(getLaunchAttributePrefix(ef.getId()) +
".extension_id", ef.getExporterDefinition().getId()); //$NON-NLS-1$
boolean enabled = enabledExporters.contains( ef );
String propertiesId = getLaunchAttributePrefix(ef.getId()) + ".properties";
//$NON-NLS-1$
names.add(ef.getId());
ef.setEnabled( configuration, enabled, false );
- HashMap map = new HashMap(ef.getProperties());
+ HashMap<String, String> map = new HashMap<String,
String>(ef.getProperties());
if(map.isEmpty()) {
- configuration.setAttribute( propertiesId, (Map)null );
+ configuration.setAttribute( propertiesId, (Map<String, String>)null );
} else {
configuration.setAttribute( propertiesId, map );
}
@@ -190,9 +187,7 @@
deletedExporterIds.removeAll(names);
- for (Iterator iterator = deletedExporterIds.iterator(); iterator.hasNext();) {
- String deleted = (String) iterator.next();
-
+ for (String deleted : deletedExporterIds) {
configuration.setAttribute( getLaunchAttributePrefix( deleted ), (String)null);
configuration.setAttribute(getLaunchAttributePrefix(deleted ) +
".extension_id", (String)null); //$NON-NLS-1$
configuration.setAttribute(getLaunchAttributePrefix(deleted), (String)null);
@@ -203,20 +198,18 @@
public static void oldSaveExporterFactories(
ILaunchConfigurationWorkingCopy configuration,
- List exporterFactories, List enabledExporters) {
+ List<ExporterFactory> exporterFactories, List<ExporterFactory>
enabledExporters) {
-
- for (Iterator iter = exporterFactories.iterator(); iter.hasNext();) {
- ExporterFactory ef = (ExporterFactory) iter.next();
+ for (ExporterFactory ef : exporterFactories) {
boolean enabled = enabledExporters.contains( ef );
String propertiesId = ef.getId() + ".properties"; //$NON-NLS-1$
ef.setEnabled( configuration, enabled, true );
- HashMap map = new HashMap(ef.getProperties());
+ HashMap<String, String> map = new HashMap<String,
String>(ef.getProperties());
if(map.isEmpty()) {
- configuration.setAttribute( propertiesId, (Map)null );
+ configuration.setAttribute( propertiesId, (Map<String, String>)null );
} else {
configuration.setAttribute( propertiesId, map );
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -201,6 +201,7 @@
/**
* update compilation unit of currently opened editor
*/
+ @SuppressWarnings("restriction")
public void updateOpen() {
IWorkbenchWindow activeWorkbenchWindow = getActiveWorkbenchWindow();
if (activeWorkbenchWindow == null) {
@@ -250,7 +251,7 @@
else if (selection instanceof TreeSelection) {
TreeSelection treeSelection = (TreeSelection)selection;
res = treeSelection.size();
- Iterator it = treeSelection.iterator();
+ Iterator<?> it = treeSelection.iterator();
while (it.hasNext()) {
Object obj = it.next();
if (excludeElement(obj)) {
@@ -264,6 +265,7 @@
/**
* @param sel - current selected workspace element for processing
*/
+ @SuppressWarnings("restriction")
synchronized private void updateSelectedItems(ISelection sel) {
//System.out.println("Blah! " + selection); //$NON-NLS-1$
if (sel instanceof TextSelection) {
@@ -271,7 +273,7 @@
IDocument fDocument = null;
SynchronizableDocument sDocument = null;
org.eclipse.jdt.core.dom.CompilationUnit resultCU = null;
- Class clazz = sel.getClass();
+ Class<?> clazz = sel.getClass();
Field fd = null;
try {
fd = clazz.getDeclaredField("fDocument"); //$NON-NLS-1$
@@ -324,7 +326,7 @@
else if (sel instanceof TreeSelection) {
clearSelectionCU();
TreeSelection treeSelection = (TreeSelection)sel;
- Iterator it = treeSelection.iterator();
+ Iterator<?> it = treeSelection.iterator();
while (it.hasNext()) {
Object obj = it.next();
processJavaElements(obj);
@@ -341,6 +343,7 @@
* @param obj
* @return exclusion result
*/
+ @SuppressWarnings("restriction")
protected boolean excludeElement(Object obj) {
boolean res = false;
if (obj instanceof JarPackageFragmentRoot) {
@@ -369,6 +372,7 @@
* Process object - java element to collect all it's children CompilationUnits
* @param obj
*/
+ @SuppressWarnings("restriction")
protected void processJavaElements(Object obj) {
if (obj instanceof ICompilationUnit) {
ICompilationUnit cu = (ICompilationUnit)obj;
@@ -376,7 +380,7 @@
}
else if (obj instanceof File) {
File file = (File)obj;
- if (file != null && file.getProject() != null) {
+ if (file.getProject() != null) {
IJavaProject javaProject = JavaCore.create(file.getProject());
ICompilationUnit[] cus = Utils.findCompilationUnits(javaProject,
file.getFullPath());
@@ -418,7 +422,6 @@
}
}
else if (obj instanceof PackageFragmentRoot) {
- PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot)obj;
JavaElement javaElement = (JavaElement)obj;
JavaElementInfo javaElementInfo = null;
try {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -53,6 +53,7 @@
*
* @author Vitali
*/
+@SuppressWarnings({ "unchecked", "restriction" })
public class CollectEntityInfo extends ASTVisitor {
/**
@@ -80,7 +81,7 @@
public boolean visit(NormalAnnotation node) {
// try to extract mapping prompts
String mappedBy = null;
- Iterator it = node.values().iterator();
+ Iterator<?> it = node.values().iterator();
while (it.hasNext()) {
MemberValuePair mvp = (MemberValuePair)it.next();
if ("mappedBy".equals(mvp.getName().toString())) { //$NON-NLS-1$
@@ -201,7 +202,7 @@
ASTNode astNode = node.getParent();
if (astNode instanceof FieldDeclaration) {
FieldDeclaration fd = (FieldDeclaration)astNode;
- Iterator itVarNames = fd.fragments().iterator();
+ Iterator<?> itVarNames = fd.fragments().iterator();
while (itVarNames.hasNext()) {
VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
String name = var.getName().getIdentifier();
@@ -236,7 +237,7 @@
ASTNode astNode = node.getParent();
if (astNode instanceof FieldDeclaration) {
FieldDeclaration fd = (FieldDeclaration)astNode;
- Iterator itVarNames = fd.fragments().iterator();
+ Iterator<?> itVarNames = fd.fragments().iterator();
while (itVarNames.hasNext()) {
VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
String name = var.getName().getIdentifier();
@@ -285,6 +286,7 @@
return true;
}
+
public boolean visit(TypeDeclaration node) {
boolean isAbstruct = entityInfo.isAbstractFlag() ||
Modifier.isAbstract(node.getModifiers()) || node.isInterface();
@@ -312,8 +314,8 @@
entityInfo.setFullyQualifiedParentName(entityFullyQualifiedName);
}
}
- List superInterfaces = node.superInterfaceTypes();
- Iterator it = superInterfaces.iterator();
+ List<?> superInterfaces = node.superInterfaceTypes();
+ Iterator<?> it = superInterfaces.iterator();
while (it.hasNext()) {
Object obj = it.next();
if (obj instanceof SimpleType) {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/DiagramContentOutlinePage.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/DiagramContentOutlinePage.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/DiagramContentOutlinePage.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -11,24 +11,31 @@
package org.jboss.tools.hibernate.ui.veditor.editors;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.*;
-import org.eclipse.draw2d.parts.*;
-import org.eclipse.gef.*;
+import org.eclipse.draw2d.LightweightSystem;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Viewport;
+import org.eclipse.draw2d.parts.ScrollableThumbnail;
+import org.eclipse.draw2d.parts.Thumbnail;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.RootEditPart;
import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gef.ui.parts.*;
+import org.eclipse.gef.ui.parts.ContentOutlinePage;
+import org.eclipse.gef.ui.parts.SelectionSynchronizer;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.part.PageBook;
import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmDiagram;
@@ -186,6 +193,7 @@
/**
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class type) {
if (type == ZoomManager.class) {
return ((ScalableFreeformRootEditPart) getGraphicalViewer()
@@ -216,9 +224,6 @@
setContents(getOrmDiagram());
}
-
- private DisposeListener disposeListener;
-
/**
*
*/
@@ -271,7 +276,7 @@
getSelectionSynchronizer().removeViewer(getViewer());
}
- Set listeners = new HashSet();
+ Set<ISelectionChangedListener> listeners = new
HashSet<ISelectionChangedListener>();
public void addSelectionChangedListener(ISelectionChangedListener listener) {
super.addSelectionChangedListener(listener);
@@ -283,9 +288,7 @@
}
void replaceSelectionChangedListeners(GraphicalViewer graphicalViewer) {
- Iterator it = listeners.iterator();
- while(it.hasNext()) {
- ISelectionChangedListener l = (ISelectionChangedListener)it.next();
+ for (ISelectionChangedListener l : listeners) {
getViewer().removeSelectionChangedListener(l);
graphicalViewer.addSelectionChangedListener(l);
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -117,7 +117,7 @@
private TransferDropTargetListener createTransferDropTargetListener() {
return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
protected CreationFactory getFactory(Object template) {
- return new SimpleFactory((Class) template);
+ return new SimpleFactory((Class<?>) template);
}
};
}
@@ -159,6 +159,7 @@
}
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class type) {
if (type == IContentOutlinePage.class) {
DiagramContentOutlinePage outline = new DiagramContentOutlinePage(
@@ -173,10 +174,10 @@
return super.getAdapter(type);
}
- public Set getSelectedElements_old() {
- Set ret = new HashSet();
- List selectedEditParts = getGraphicalViewer().getSelectedEditParts();
- Iterator iterator = selectedEditParts.iterator();
+ public Set<Object> getSelectedElements_old() {
+ Set<Object> ret = new HashSet<Object>();
+ List<?> selectedEditParts = getGraphicalViewer().getSelectedEditParts();
+ Iterator<?> iterator = selectedEditParts.iterator();
while (iterator.hasNext()) {
Object elem = iterator.next();
if (elem instanceof OrmEditPart) {
@@ -191,10 +192,10 @@
return ret;
}
- public Set getSelectedElements() {
- Set ret = new HashSet();
- List selectedEditParts = getGraphicalViewer().getSelectedEditParts();
- Iterator iterator = selectedEditParts.iterator();
+ public Set<Object> getSelectedElements() {
+ Set<Object> ret = new HashSet<Object>();
+ List<?> selectedEditParts = getGraphicalViewer().getSelectedEditParts();
+ Iterator<?> iterator = selectedEditParts.iterator();
while (iterator.hasNext()) {
Object elem = iterator.next();
if (elem instanceof OrmEditPart) {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/autolayout/impl/Items.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/autolayout/impl/Items.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/autolayout/impl/Items.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -22,7 +22,7 @@
protected LayuotConstants constants;
protected IDiagramInfo process;
protected Item[] items;
- protected Map paths = new HashMap();
+ protected Map<String, Item> paths = new HashMap<String, Item>();
protected Groups groups = new Groups();
protected boolean override = false;
@@ -97,7 +97,7 @@
for (int j = 0; j < ts.length; j++) {
String target = ts[j].getTargetID();
if(target == null || target.length() == 0) continue;
- Item item2 = (Item)paths.get(target);
+ Item item2 = paths.get(target);
if(item2 == null) {
continue;
} if(items[i].isComment()) {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -88,7 +88,7 @@
public void restore() {
boolean dirty = getCastedModel().isDirty();
- HashMap hashMap = getCastedModel().getCloneElements();
+ HashMap<String, OrmShape> hashMap = getCastedModel().getCloneElements();
String childrenLocations[] = getCastedModel().getChildrenLocations();
int tempPoint = 1;
OrmShape ormShape;
@@ -100,7 +100,7 @@
&& childrenLocations[i].indexOf(';') != -1) {
string = childrenLocations[i].substring(0, childrenLocations[i]
.indexOf('@'));
- ormShape = (OrmShape) hashMap.remove(string);
+ ormShape = hashMap.remove(string);
if (ormShape != null) {
string = childrenLocations[i]
.substring(childrenLocations[i].indexOf('@') + 1);
@@ -125,14 +125,13 @@
RootClass[] ormElements = getCastedModel().getOrmElements();
for (int i = 0; i < childrenLocations.length; i++) {
RootClass persistentClass = ormElements[i];
- ormShape = (OrmShape) hashMap.remove(persistentClass
- .getEntityName());
+ ormShape = hashMap.remove(persistentClass.getEntityName());
if (ormShape != null) {
ormShape.setLocation(new Point(20, 20));
tempPoint = 40 + getChildrenFigurePreferredHeight(ormShape);
}
Table table = persistentClass.getTable();
- ormShape = (OrmShape) hashMap.remove(HibernateUtils.getTableName(table));
+ ormShape = hashMap.remove(HibernateUtils.getTableName(table));
if (ormShape != null) {
ormShape.setLocation(new Point(pointX, 20));
point = 40 + getChildrenFigurePreferredHeight(ormShape);
@@ -143,7 +142,7 @@
}
Object objects[] = hashMap.keySet().toArray();
for (int i = 0; i < objects.length; i++) {
- ormShape = (OrmShape) hashMap.get(objects[i]);
+ ormShape = hashMap.get(objects[i]);
if (ormShape != null
&& (ormShape.getOrmElement() instanceof RootClass || ormShape
.getOrmElement() instanceof SpecialOrmShape)) {
@@ -155,7 +154,7 @@
.getOrmElement())).getProperty().getValue())
.getElement();
Table ownerTable = component.getOwner().getTable();
- ormShape = (OrmShape) hashMap.remove(HibernateUtils.getTableName(ownerTable));
+ ormShape = hashMap.remove(HibernateUtils.getTableName(ownerTable));
// }
// if (ormShape != null ) {
// ormShape.setLocation(new Point(pointX,point));
@@ -166,12 +165,10 @@
point = tempPoint;
}
}
- Iterator iterator = hashMap.values().iterator();
- while (iterator.hasNext()) {
- ormShape = (OrmShape) iterator.next();
- if (ormShape.getOrmElement() instanceof Table) {
- ormShape.setLocation(new Point(pointX, point));
- point = point + getChildrenFigurePreferredHeight(ormShape) + 20;
+ for (OrmShape shape : hashMap.values()) {
+ if (shape.getOrmElement() instanceof Table) {
+ shape.setLocation(new Point(pointX, point));
+ point = point + getChildrenFigurePreferredHeight(shape) + 20;
}
}
getCastedModel().setDirty(dirty);
@@ -202,7 +199,7 @@
return j + 120;
}
- protected List getModelChildren() {
+ protected List<Shape> getModelChildren() {
return getCastedModel().getChildren();
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -63,6 +63,7 @@
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
return null;
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -30,30 +30,31 @@
import org.hibernate.mapping.RootClass;
import org.jboss.tools.hibernate.ui.view.ViewPlugin;
+@SuppressWarnings("restriction")
public class OpenDiagramActionDelegate extends OpenActionDelegate {
- private HashMap hashMap = new HashMap();
+ private HashMap<Object, ObjectEditorInput> hashMap = new HashMap<Object,
ObjectEditorInput>();
public void run(IAction action) {
ObjectPluginAction objectPluginAction = (ObjectPluginAction)action;
- Map mapCC_PCs = new HashMap();
+ Map<ConsoleConfiguration, Set<PersistentClass>> mapCC_PCs = new
HashMap<ConsoleConfiguration, Set<PersistentClass>>();
TreePath[] paths = ((TreeSelection)objectPluginAction.getSelection()).getPaths();
for (int i = 0; i < paths.length; i++) {
Object last_el = paths[i].getLastSegment();
if (last_el instanceof PersistentClass) {
PersistentClass persClass = (PersistentClass) last_el;
ConsoleConfiguration consoleConfiguration =
(ConsoleConfiguration)(paths[i].getFirstSegment());
- Set setPC = (Set)mapCC_PCs.get(consoleConfiguration);
+ Set<PersistentClass> setPC = mapCC_PCs.get(consoleConfiguration);
if (null == setPC) {
- setPC = new HashSet();
+ setPC = new HashSet<PersistentClass>();
mapCC_PCs.put(consoleConfiguration, setPC);
}
setPC.add(persClass);
}
}
- for (Iterator it = mapCC_PCs.keySet().iterator(); it.hasNext(); ) {
- ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)it.next();
- Set setPC = (Set)mapCC_PCs.get(consoleConfiguration);
+ for (Iterator<ConsoleConfiguration> it = mapCC_PCs.keySet().iterator();
it.hasNext(); ) {
+ ConsoleConfiguration consoleConfiguration = it.next();
+ Set<PersistentClass> setPC = mapCC_PCs.get(consoleConfiguration);
try {
openEditor(setPC, consoleConfiguration);
} catch (PartInitException e) {
@@ -64,7 +65,7 @@
public IEditorPart openEditor(PersistentClass persClass,
ConsoleConfiguration consoleConfiguration) throws PartInitException {
- ObjectEditorInput input = (ObjectEditorInput)hashMap.get(persClass.getRootClass());
+ ObjectEditorInput input = hashMap.get(persClass.getRootClass());
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
@@ -77,7 +78,7 @@
return IDE.openEditor(ViewPlugin.getPage(),input
,"org.jboss.tools.hibernate.ui.veditor.editors.visualeditor"); //$NON-NLS-1$
}
- public IEditorPart openEditor(Set setPC, ConsoleConfiguration consoleConfiguration)
throws PartInitException {
+ public IEditorPart openEditor(Set<PersistentClass> setPC, ConsoleConfiguration
consoleConfiguration) throws PartInitException {
if (0 >= setPC.size()) {
return null;
@@ -87,13 +88,13 @@
String id = ""; //$NON-NLS-1$
PersistentClass persClass = null;
int i = 0;
- for (Iterator it = setPC.iterator(); it.hasNext(); ) {
- persClass = (PersistentClass)it.next();
+ for (Iterator<PersistentClass> it = setPC.iterator(); it.hasNext(); ) {
+ persClass = it.next();
id += "@" + persClass.toString(); //$NON-NLS-1$
rcArr[i++] = persClass.getRootClass();
}
- ObjectEditorInput input = (ObjectEditorInput)hashMap.get(id);
+ ObjectEditorInput input = hashMap.get(id);
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
if (null == input) {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -42,7 +42,7 @@
public class OrmLabelProvider extends LabelProvider implements IColorProvider,
IFontProvider {
- private Map imageCache = new HashMap(25);
+ private Map<ImageDescriptor, Image> imageCache = new HashMap<ImageDescriptor,
Image>(25);
private OrmModelImageVisitor ormModelImageVisitor;
private OrmModelNameVisitor ormModelNameVisitor;
@@ -87,7 +87,7 @@
return null;
}
- Image image = (Image) imageCache.get(descriptor);
+ Image image = imageCache.get(descriptor);
if (image == null) {
image = descriptor.createImage();
imageCache.put(descriptor, image);
@@ -173,8 +173,8 @@
}
public void dispose() {
- for (Iterator i = imageCache.values().iterator(); i.hasNext();) {
- ((Image) i.next()).dispose();
+ for (Iterator<Image> i = imageCache.values().iterator(); i.hasNext();) {
+ i.next().dispose();
}
imageCache.clear();
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -40,8 +40,8 @@
super();
}
- private Map mappings = new HashMap();
- private Map dialects = new HashMap();
+ private Map<ConsoleConfiguration, Mapping> mappings = new
HashMap<ConsoleConfiguration, Mapping>();
+ private Map<String, Dialect> dialects = new HashMap<String, Dialect>();
public Object visitDatabaseColumn(Column column, Object argument) {
@@ -78,7 +78,7 @@
cfg = (ConsoleConfiguration) argument;
if (mappings.containsKey(cfg.getConfiguration())) {
- mapping = (Mapping) mappings.get(cfg);
+ mapping = mappings.get(cfg);
} else {
mapping = cfg.getConfiguration().buildMapping();
mappings.put(cfg, mapping);
@@ -88,7 +88,7 @@
String dialectName = cfg.getConfiguration().getProperty(Environment.DIALECT);
if (dialectName != null) {
if (dialects.containsKey(dialectName)) {
- dialect = (Dialect) dialects.get(dialectName);
+ dialect = dialects.get(dialectName);
} else {
dialect = (Dialect) Class.forName(dialectName).newInstance();
dialects.put(dialectName, dialect);
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -13,7 +13,7 @@
public class ExporterTest extends TestCase {
- private HashMap map;
+ private HashMap<String, ExporterProperty> map;
private ExporterFactory factory;
private ExporterDefinition definition;
@@ -21,7 +21,7 @@
protected void setUp() throws Exception {
super.setUp();
- map = new HashMap();
+ map = new HashMap<String, ExporterProperty>();
map.put("ejb3", new ExporterProperty("ejb3", "Use ejb3
syntax", "true", true)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
definition = new ExporterDefinition("exporterClass", //$NON-NLS-1$
"exporterDescription", //$NON-NLS-1$
@@ -35,12 +35,12 @@
}
public void testExporters() {
- Map properties = definition.getExporterProperties();
+ Map<String, ExporterProperty> properties = definition.getExporterProperties();
assertEquals(properties, map);
- Map defaultProperties = factory.getDefaultExporterProperties();
+ Map<String, ExporterProperty> defaultProperties =
factory.getDefaultExporterProperties();
assertEquals(defaultProperties, map);
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -43,6 +43,7 @@
* @author Dmitry Geraskov
*
*/
+@SuppressWarnings("restriction")
public class RefactoringTest extends TestCase {
private final String[] oldPathElements = new
String[]{"oldPrj","oldSrc", "oldPack",
"oldHibernate.cfg.xml"}; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
@@ -229,10 +230,11 @@
assertTrue(count_new == count_old);
}
+ @SuppressWarnings("unchecked")
private void checkPaths(Path truePath) throws CoreException{
String newPath = (String)
testStrConfig.getNewAttribute(IConsoleConfigurationLaunchConstants.CFG_XML_FILE);
assertEquals(truePath.makeAbsolute(), new Path(newPath).makeAbsolute());
- newPath = (String) ((List)
testStrListConfig.getNewAttribute(IConsoleConfigurationLaunchConstants.FILE_MAPPINGS)).get(0);
+ newPath = ((List<String>)
testStrListConfig.getNewAttribute(IConsoleConfigurationLaunchConstants.FILE_MAPPINGS)).get(0);
assertEquals(truePath.makeAbsolute(), new Path(newPath).makeAbsolute());
}
@@ -268,6 +270,7 @@
}
//====================================================================================
+ @SuppressWarnings("unchecked")
static class TestWorkingCopy implements ILaunchConfigurationWorkingCopy{
private TestLaunchConfig parent;
@@ -307,6 +310,7 @@
return true;
}
+
public void removeModes(Set modes) {}
public void rename(String name) {}
@@ -473,6 +477,7 @@
}
+ @SuppressWarnings("unchecked")
static class TestLaunchConfig implements ILaunchConfiguration{
private Map<String, Object> attributes = new HashMap<String, Object>();
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -44,6 +44,7 @@
* @author Dmitry Geraskov
*
*/
+@SuppressWarnings("restriction")
public class ProjectUtil {
private static final StringBuilder XML_HEADER = new StringBuilder("<?xml
version=\"1.0\" encoding=\"UTF-8\"?>\n") //$NON-NLS-1$
@@ -127,7 +128,7 @@
ConsoleConfigurationWizardPage page =
((ConsoleConfigurationWizardPage)getPages()[0]);
ILaunchConfigurationTab[] tabs = page.getTabs();
ConsoleConfigurationMainTab main = (ConsoleConfigurationMainTab) tabs[0];
- Class clazz = main.getClass();
+ Class<? extends ConsoleConfigurationMainTab> clazz = main.getClass();
Field projectName = clazz.getDeclaredField("projectNameText");
//$NON-NLS-1$
projectName.setAccessible(true);
Text text = (Text) projectName.get(main);
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -24,8 +24,6 @@
import java.util.Map;
import java.util.zip.ZipFile;
-import junit.framework.Assert;
-
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
@@ -56,12 +54,12 @@
import org.eclipse.ui.dialogs.IOverwriteQuery;
import org.eclipse.ui.wizards.datatransfer.ImportOperation;
import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
-import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin;
/**
* Helper methods to set up a IJavaProject.
*/
+@SuppressWarnings("restriction")
public class JavaProjectHelper {
@@ -114,8 +112,9 @@
* Sets the compiler options to 1.5 for the given project.
* @param project the java project
*/
+ @SuppressWarnings("unchecked")
public static void set15CompilerOptions(IJavaProject project) {
- Map options= project.getOptions(false);
+ Map<String,String> options= project.getOptions(false);
JavaProjectHelper.set15CompilerOptions(options);
project.setOptions(options);
}
@@ -124,8 +123,9 @@
* Sets the compiler options to 1.4 for the given project.
* @param project the java project
*/
+ @SuppressWarnings("unchecked")
public static void set14CompilerOptions(IJavaProject project) {
- Map options= project.getOptions(false);
+ Map<String,String> options= project.getOptions(false);
JavaProjectHelper.set14CompilerOptions(options);
project.setOptions(options);
}
@@ -134,7 +134,7 @@
* Sets the compiler options to 1.5
* @param options The compiler options to configure
*/
- public static void set15CompilerOptions(Map options) {
+ public static void set15CompilerOptions(Map<String,String> options) {
options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
options.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR);
options.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR);
@@ -146,7 +146,7 @@
* Sets the compiler options to 1.4
* @param options The compiler options to configure
*/
- public static void set14CompilerOptions(Map options) {
+ public static void set14CompilerOptions(Map<String,String> options) {
options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
options.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR);
options.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.WARNING);
@@ -158,7 +158,7 @@
* Sets the compiler options to 1.3
* @param options The compiler options to configure
*/
- public static void set13CompilerOptions(Map options) {
+ public static void set13CompilerOptions(Map<String,String> options) {
options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_3);
options.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.WARNING);
options.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.WARNING);
@@ -578,10 +578,11 @@
* @throws CoreException import failed
* @throws IOException import failed
*/
+ @SuppressWarnings("unchecked")
public static void importResources(IContainer importTarget, String bundleSourcePath)
throws CoreException, IOException {
- Enumeration entryPaths=
HibernateConsoleTestPlugin.getDefault().getBundle().getEntryPaths(bundleSourcePath);
+ Enumeration<String> entryPaths=
HibernateConsoleTestPlugin.getDefault().getBundle().getEntryPaths(bundleSourcePath);
while (entryPaths.hasMoreElements()) {
- String path= (String) entryPaths.nextElement();
+ String path= entryPaths.nextElement();
IPath name= new Path(path.substring(bundleSourcePath.length()));
if (path.endsWith("/")) { //$NON-NLS-1$
IFolder folder= importTarget.getFolder(name);
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/SwtUtils.java
===================================================================
---
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/SwtUtils.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/SwtUtils.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -18,7 +18,7 @@
*
*/
public class SwtUtils {
- public static Control findControlByClass(Composite comp, Class claz) {
+ public static Control findControlByClass(Composite comp, Class<? extends Control>
claz) {
for (Control child : comp.getChildren()) {
if(child.getClass()==claz) {
return child;
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java
===================================================================
---
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java 2009-05-22
10:14:44 UTC (rev 15399)
+++
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java 2009-05-22
10:53:12 UTC (rev 15400)
@@ -20,7 +20,7 @@
Properties parameters = new Properties();
- public TestSuiteWithParams(Class theClass, Properties params) {
+ public TestSuiteWithParams(Class<?> theClass, Properties params) {
super(theClass);
this.parameters.putAll(params);
}