Skip to content

Commit

Permalink
[NETBEANS-2864] - cleanup some of the variables using a raw Class type..
Browse files Browse the repository at this point in the history
I've tried to cleanup a few of the variables that use a raw Class types.
No methods have been harmed.
  • Loading branch information
BradWalker committed Jul 17, 2019
1 parent 00e25b4 commit 3eb2362
Show file tree
Hide file tree
Showing 96 changed files with 133 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ public void writeAttribute(String name, String attrName, Object v) throws IOExce
oos.close();
byte bArray[] = bos.toByteArray();
// Check to see if this is the same as a default instance.
Class clazz = v.getClass();
Class<?> clazz = v.getClass();
boolean usenewinstance = false;
try {
Object v2 = clazz.newInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ private Object loadBuildSettings() {
}

try {
Class clazz = urlLoader.loadClass("grails.util.BuildSettings"); // NOI18N
Class<?> clazz = urlLoader.loadClass("grails.util.BuildSettings"); // NOI18N
Constructor contructor = clazz.getConstructor(File.class, File.class);
Object instance = contructor.newInstance(platform.getGrailsHome(), projectRoot);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static void waitFinished(long timeout) {

private static boolean processInProgress(String name) {
try {
Class clazz = Class.forName("org.netbeans.progress.module.Controller");
Class<?> clazz = Class.forName("org.netbeans.progress.module.Controller");
Method getDefaultMethod = clazz.getDeclaredMethod("getDefault", (Class[])null);
getDefaultMethod.setAccessible(true);
Object controllerInstance = getDefaultMethod.invoke(null, (Object[])null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class WildflyManagementAPI {
static Object createClient(WildflyDeploymentFactory.WildFlyClassLoader cl, Version version, final String serverAddress, final int serverPort,
final CallbackHandler handler) throws ClassNotFoundException, NoSuchMethodException,
IllegalAccessException, InvocationTargetException, NoSuchAlgorithmException {
Class clazz = cl.loadClass("org.jboss.as.controller.client.ModelControllerClient$Factory"); // NOI18N
Class<?> clazz = cl.loadClass("org.jboss.as.controller.client.ModelControllerClient$Factory"); // NOI18N
if (version.compareTo(WildflyPluginUtils.WILDFLY_9_0_0) >= 0) {
Method method = clazz.getDeclaredMethod("create", String.class, int.class, CallbackHandler.class, SSLContext.class, int.class, Map.class);
return method.invoke(null, serverAddress, serverPort, handler, SSLContext.getDefault(), TIMEOUT, ENABLED_LOCAL_AUTH);
Expand Down Expand Up @@ -110,7 +110,7 @@ static Object createPathAddressAsModelNode(WildflyDeploymentFactory.WildFlyClass
// ModelNode
static Object createOperation(WildflyDeploymentFactory.WildFlyClassLoader cl, Object name, Object modelNode)
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class<?> clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N
Method method = clazz.getDeclaredMethod("createOperation", new Class[]{String.class, modelClazz});
return method.invoke(null, name, modelNode);
Expand All @@ -119,7 +119,7 @@ static Object createOperation(WildflyDeploymentFactory.WildFlyClassLoader cl, Ob
// ModelNode
static Object createReadResourceOperation(WildflyDeploymentFactory.WildFlyClassLoader cl, Object modelNode, boolean recursive)
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class<?> clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N
Method method = clazz.getDeclaredMethod("createReadResourceOperation", new Class[]{modelClazz, boolean.class});
return method.invoke(null, modelNode, recursive);
Expand All @@ -128,7 +128,7 @@ static Object createReadResourceOperation(WildflyDeploymentFactory.WildFlyClassL
// ModelNode
static Object createRemoveOperation(WildflyDeploymentFactory.WildFlyClassLoader cl, Object modelNode) throws ClassNotFoundException,
NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class<?> clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N
Method method = clazz.getDeclaredMethod("createRemoveOperation", new Class[]{modelClazz});
return method.invoke(null, modelNode);
Expand All @@ -137,7 +137,7 @@ static Object createRemoveOperation(WildflyDeploymentFactory.WildFlyClassLoader
// ModelNode
static Object createAddOperation(WildflyDeploymentFactory.WildFlyClassLoader cl, Object modelNode) throws ClassNotFoundException,
NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class<?> clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N
Method method = clazz.getDeclaredMethod("createAddOperation", new Class[]{modelClazz});
return method.invoke(null, modelNode);
Expand All @@ -146,7 +146,7 @@ static Object createAddOperation(WildflyDeploymentFactory.WildFlyClassLoader cl,
// ModelNode
static Object readResult(WildflyDeploymentFactory.WildFlyClassLoader cl, Object modelNode) throws ClassNotFoundException,
NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class<?> clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N
Method method = clazz.getDeclaredMethod("readResult", new Class[]{modelClazz});
return method.invoke(null, modelNode);
Expand Down Expand Up @@ -324,7 +324,7 @@ static int modelNodeAsInt(WildflyDeploymentFactory.WildFlyClassLoader cl, Object

static boolean isSuccessfulOutcome(WildflyDeploymentFactory.WildFlyClassLoader cl, Object modelNode) throws ClassNotFoundException,
NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class<?> clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N
Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N
Method method = clazz.getDeclaredMethod("isSuccessfulOutcome", modelClazz);
return (Boolean) method.invoke(null, modelNode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static void waitFinished(long timeout) {

private static boolean processInProgress(String name) {
try {
Class clazz = Class.forName("org.netbeans.progress.module.Controller");
Class<?> clazz = Class.forName("org.netbeans.progress.module.Controller");
Method getDefaultMethod = clazz.getDeclaredMethod("getDefault", (Class[])null);
getDefaultMethod.setAccessible(true);
Object controllerInstance = getDefaultMethod.invoke(null, (Object[])null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ private void invokeSetClosed(InputOutput io, boolean closed) {
private Method initSetClosedMethod(InputOutput io) {
Method method = null;
try {
Class clazz = io.getClass();
Class<?> clazz = io.getClass();
method = clazz.getDeclaredMethod("setClosed", boolean.class); // NOI18N
method.setAccessible(true);
} catch(Exception ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static void waitFinished(long timeout) {

private static boolean processInProgress(String name) {
try {
Class clazz = Class.forName("org.netbeans.progress.module.Controller");
Class<?> clazz = Class.forName("org.netbeans.progress.module.Controller");
Method getDefaultMethod = clazz.getDeclaredMethod("getDefault", (Class[])null);
getDefaultMethod.setAccessible(true);
Object controllerInstance = getDefaultMethod.invoke(null, (Object[])null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ private static boolean dontUseIp (String nonProxyHosts, String host) {
static boolean useSystemProxies () {
if (useSystemProxies == null) {
try {
Class clazz = Class.forName ("sun.net.NetProperties");
Class<?> clazz = Class.forName ("sun.net.NetProperties");
Method getBoolean = clazz.getMethod ("getBoolean", String.class);
useSystemProxies = getBoolean.invoke (null, "java.net.useSystemProxies");
} catch (Exception x) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ConnPoolBeanDataNode(SunResourceDataObject obj, ConnPoolBean key) {
resource = key;
key.addPropertyChangeListener(this);

Class clazz = key.getClass();
Class<?> clazz = key.getClass();
try{
createProperties(key, Utilities.getBeanInfo(clazz));
} catch (Exception e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public DataSourceBeanDataNode(SunResourceDataObject obj, DataSourceBean key) {

key.addPropertyChangeListener(this);

Class clazz = key.getClass ();
Class<?> clazz = key.getClass ();
try{
createProperties(key, Utilities.getBeanInfo(clazz));
} catch (Exception e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public JMSBeanDataNode(SunResourceDataObject obj, JMSBean key) {
setShortDescription (NbBundle.getMessage (JMSBeanDataNode.class, "DSC_JmsNode"));//NOI18N

key.addPropertyChangeListener(this);
Class clazz = key.getClass ();
Class<?> clazz = key.getClass ();
try{
createProperties(key, Utilities.getBeanInfo(clazz));
} catch (Exception e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public JavaMailSessionBeanDataNode(SunResourceDataObject obj, JavaMailSessionBea
setShortDescription (NbBundle.getMessage (JavaMailSessionBeanDataNode.class, "DSC_MailNode"));//NOI18N
key.addPropertyChangeListener(this);

Class clazz = key.getClass ();
Class<?> clazz = key.getClass ();
try{
createProperties(key, Utilities.getBeanInfo(clazz));
} catch (Exception e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public PersistenceManagerBeanDataNode(SunResourceDataObject obj, PersistenceMana
resource = key;

key.addPropertyChangeListener(this);
Class clazz = key.getClass ();
Class<?> clazz = key.getClass ();
try{
createProperties(key, Utilities.getBeanInfo(clazz));
} catch (Exception e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ private void invokeSetClosed(InputOutput io, boolean closed) {
private Method initSetClosedMethod(InputOutput io) {
Method method = null;
try {
Class clazz = io.getClass();
Class<?> clazz = io.getClass();
method = clazz.getDeclaredMethod("setClosed", boolean.class); // NOI18N
method.setAccessible(true);
} catch(Exception ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected Object createInstance(InstanceCookie[] cookies)
throws IOException, ClassNotFoundException {
List<Action> actions = new ArrayList<Action>();
for (int i = 0; i < cookies.length; i++) {
Class clazz = cookies[i].instanceClass();
Class<?> clazz = cookies[i].instanceClass();
if (JSeparator.class.isAssignableFrom(clazz)) {
// XXX <code>null</code> is interpreted as a separator.
actions.add(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ public static Object callMethodWithParams(
String inClassName, LinkedList inParamList, JavaMethod inMethod,
URLClassLoader urlClassLoader, WsdlData wsData, WSPort port) throws WebServiceReflectionException {

Class clazz = null;
Class<?> clazz = null;
Class serviceClass = null;
if (null == urlClassLoader) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private void load (InputStream is, String kind, ClassLoader cl) throws IOExcepti
}
String clazzname = entry.getValue();
try {
Class clazz = cl.loadClass (clazzname);
Class<?> clazz = cl.loadClass (clazzname);
register(name, clazz, kind, false);
} catch (ClassNotFoundException cnfe) {
// This is normal, e.g. Ant's taskdefs include optional tasks we don't have.
Expand Down Expand Up @@ -537,7 +537,7 @@ private boolean scanMap(Map<String,Class> m, String kind, Set<Class> skipReanaly
AntModule.err.log("Skipping pseudodef of <description>");
continue;
}
Class clazz = entry.getValue();
Class<?> clazz = entry.getValue();
if (clazz.getName().equals("org.apache.tools.ant.taskdefs.MacroInstance")) { // NOI18N
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public static Map<String,Map<String,Class>> getCustomDefsNoNamespace() {
Map<String,Class> m2 = new HashMap<String,Class>();
for (Map.Entry<String,Class> entry2 : defs.entrySet()) {
String fqn = entry2.getKey();
Class clazz = entry2.getValue();
Class<?> clazz = entry2.getValue();
String name;
int idx = fqn.lastIndexOf(':');
if (idx != -1) {
Expand Down Expand Up @@ -558,7 +558,7 @@ private static void loadDefs(Map<String,String> p, Map<String,Class> defs, Class
String name = entry.getKey();
String clazzname = entry.getValue();
try {
Class clazz = l.loadClass(clazzname);
Class<?> clazz = l.loadClass(clazzname);
defs.put(name, clazz);
} catch (ClassNotFoundException cnfe) {
// This is not normal. If the class is mentioned, it should be there.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public Map<MethodSignature, CompletionItem> getStaticMethods(CompletionContext c
@Override
public Map<FieldSignature, CompletionItem> getFields(CompletionContext context) {
final Map<FieldSignature, CompletionItem> result = new HashMap<FieldSignature, CompletionItem>();
final Class clazz = loadClass(context);
final Class<?> clazz = loadClass(context);

if (clazz != null) {
final MetaClass metaClass = GroovySystem.getMetaClassRegistry().getMetaClass(clazz);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ public Object map() {
Document document = documentForTab(getSource());
try {
if (getOutputDocumentClass().isInstance(document)) {
Class clazz = getOutputDocumentClass();
Class<?> clazz = getOutputDocumentClass();
Method getLineStartMethod = clazz.getDeclaredMethod("getLineStart", new Class[]{int.class});
getLineStartMethod.setAccessible(true);
Integer lineStart = (Integer) getLineStartMethod.invoke(document, new Object[]{Integer.valueOf(line)});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ private Component getRenderer() {
// in ButtonPanel (supplies custom editor button "...")
// or IconPanel(supplies property marking).
try {
Class clazz = Class.forName("org.openide.explorer.propertysheet.RendererPropertyDisplayer");
Class<?> clazz = Class.forName("org.openide.explorer.propertysheet.RendererPropertyDisplayer");
Method findInnermostRendererMethod = clazz.getDeclaredMethod("findInnermostRenderer", new Class[] {JComponent.class});
findInnermostRendererMethod.setAccessible(true);
comp = (Component)findInnermostRendererMethod.invoke(null, new Object[] {comp});
Expand Down Expand Up @@ -406,7 +406,7 @@ private PropertyEditor getPropertyEditor() {
@Override
public void run() {
try {
Class clazz = Class.forName("org.openide.explorer.propertysheet.PropUtils");
Class<?> clazz = Class.forName("org.openide.explorer.propertysheet.PropUtils");
Method getPropertyEditorMethod = clazz.getDeclaredMethod("getPropertyEditor", new Class[]{Node.Property.class});
getPropertyEditorMethod.setAccessible(true);
atomicReference.set((PropertyEditor) getPropertyEditorMethod.invoke(null, new Object[]{property}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private void loadActions(List<Action> actions, DataFolder df) throws IOException
LOG.log(Level.WARNING, "Not an action instance, or broken action: {0}", dob[i].getPrimaryFile());
continue;
}
Class clazz = ic.instanceClass();
Class<?> clazz = ic.instanceClass();

if (JSeparator.class.isAssignableFrom(clazz)) {
actions.add(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static synchronized void register(CslCorePackageAccessor accessor) {
public static synchronized CslCorePackageAccessor get() {
// Trying to wake up HighlightsLayer ...
try {
Class clazz = Class.forName(LanguageRegistry.class.getName());
Class<?> clazz = Class.forName(LanguageRegistry.class.getName());
} catch (ClassNotFoundException e) {
// ignore
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ protected void addTextElement(CharSequence text) {
private Class getModelClass(Element element) {
if (element instanceof ModelElement) {
ModelElement melement = (ModelElement) element;
Class clazz = melement.getModelClass();
Class<?> clazz = melement.getModelClass();
if (!clazz.isAssignableFrom(element.getClass())) {
throw new IllegalArgumentException(String.format("Element %s declares %s as its superinterface but it is not true!", element.getClass().getSimpleName(), clazz.getSimpleName()));
}
Expand All @@ -249,7 +249,7 @@ private Class getModelClass(Element element) {

@Override
public int addElement(Element e) {
Class clazz = getModelClass(e);
Class<?> clazz = getModelClass(e);
CLASSELEMENTS.add(new ClassElement(clazz, e));
fireElementAdded(e);
return getElementsCount() - 1; //last element index
Expand All @@ -268,7 +268,7 @@ public int getElementsCount() {

@Override
public Element setElementAt(int index, Element e) {
Class clazz = getModelClass(e);
Class<?> clazz = getModelClass(e);
ClassElement ce = new ClassElement(clazz, e);
ClassElement old = CLASSELEMENTS.set(index, ce);
if (old != null && old.getElement() != null) {
Expand Down Expand Up @@ -311,7 +311,7 @@ public boolean removeElement(Element element) {

@Override
public void insertElement(int index, Element element) {
Class clazz = getModelClass(element);
Class<?> clazz = getModelClass(element);
CLASSELEMENTS.add(index, new ClassElement(clazz, element));
fireElementAdded(element);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public interface ModelElementListener {
public static class Support {

private static void fireElementEvent(Element element, ModelElementListener listener, boolean add) {
Class clazz = element.getClass();
Class<?> clazz = element.getClass();
Class[] interfaces = clazz.getInterfaces();
for (Class in : interfaces) {
if (Element.class.isAssignableFrom(in)) {
Expand Down
Loading

0 comments on commit 3eb2362

Please sign in to comment.