]> source.dussan.org Git - aspectj.git/commitdiff
Remove redundant casts after generics update 155/head
authorAndrey Turbanov <turbanoff@gmail.com>
Tue, 12 Apr 2022 08:22:29 +0000 (11:22 +0300)
committerAndrey Turbanov <turbanoff@gmail.com>
Tue, 12 Apr 2022 08:22:29 +0000 (11:22 +0300)
50 files changed:
ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaCompilerWarningsOptionsPanel.java
ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaOtherOptionsPanel.java
ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/SwitchBuilder.java
build/src/main/java/org/aspectj/internal/tools/build/Modules.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/ReferenceType.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/WeakClassLoaderReference.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPatternList.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/BasicTokenSource.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/Bindings.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ConcreteCflowPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HasMemberTypePattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/IfPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/NameBindingPointcut.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternList.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternQuestions.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/reflect/ReflectionShadow.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/reflect/StandardShadow.java
runtime/src/main/java/org/aspectj/internal/lang/reflect/AjTypeImpl.java
runtime/src/main/java/org/aspectj/runtime/internal/CFlowStack.java
runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadCounterImpl11.java
runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackFactoryImpl.java
runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackImpl11.java
runtime/src/main/java/org/aspectj/runtime/reflect/Factory.java
runtime/src/main/java/org/aspectj/runtime/reflect/SignatureImpl.java
taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java
taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java
taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/compilers/Ajc.java
util/src/main/java/org/aspectj/util/Reflection.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java
weaver/src/main/java/org/aspectj/weaver/loadtime/definition/LightXMLParser.java
weaver/src/main/java/org/aspectj/weaver/ltw/LTWWorld.java

index 1163c21be7d6a9d91059880d70f86d81b60503ff..8100aa7e431c191edcda2234a5ee078fb5b3d045 100644 (file)
@@ -107,7 +107,7 @@ public class JavaCompilerWarningsOptionsPanel extends OptionsPanel {
                panel.add(label,BorderLayout.WEST);
 
                JComboBox warnings = new JComboBox(ignoreOrWarning);
-               String value = (String) javaBuildOptions.getJavaBuildOptionsMap().get(javaOptionToSet);
+               String value = javaBuildOptions.getJavaBuildOptionsMap().get(javaOptionToSet);
                if (value.equals(JavaOptions.IGNORE)) {
                        warnings.setSelectedIndex(0);
                } else {
index 25f84334b56db1e18b23ff2ff771a1414969e6a7..d56c573870b2ca9c8456b9bf2a4f8e2ebf841fe1 100644 (file)
@@ -89,7 +89,7 @@ public class JavaOtherOptionsPanel extends OptionsPanel {
                characterEncoding.setPreferredSize(new Dimension(150, 21));
                panel.add(characterEncoding,BorderLayout.EAST);
 
-               String option = (String) javaBuildOptions.getJavaBuildOptionsMap().get(
+               String option = javaBuildOptions.getJavaBuildOptionsMap().get(
                                JavaOptions.CHARACTER_ENCODING);
                if (option != null) {
                        characterEncoding.setText(option);
index a6490bd5225932128c80383067ceb3076b1d0946..770d3f52615fd76c18e762326f8e974b44cab9a3 100644 (file)
@@ -107,7 +107,7 @@ public class StructureUtil {
 
        public static String getPackageDeclarationFromFile(AsmManager model, File file) {
                IProgramElement fileNode = model.getHierarchy().findElementForSourceFile(file.getAbsolutePath());
-               String packageName = ((IProgramElement) fileNode.getChildren().get(0)).getPackageName();
+               String packageName = fileNode.getChildren().get(0).getPackageName();
                return packageName;
        }
 
@@ -143,7 +143,7 @@ public class StructureUtil {
                        for (int i = 0; i < node.getParameterTypes().size(); i++) {
                                sb.append(String.valueOf(node.getParameterTypes().get(i)));
                                sb.append(' ');
-                               sb.append((String) node.getParameterNames().get(i));
+                               sb.append(node.getParameterNames().get(i));
                                if (i < node.getParameterTypes().size() - 1) {
                                        sb.append(", ");
                                }
index aad791f4292f8e00e99ccac12146651e3c2d15bc..bd20f44fd477f1702209f326872d55001f5c1244 100644 (file)
@@ -84,8 +84,8 @@ public final class SwitchBuilder {
    * @param max_gap maximum gap that may between case branches
    */
   public SwitchBuilder(int[] match, InstructionHandle[] targets,InstructionHandle target, int max_gap) {
-    this.match   = (int[])match.clone();
-    this.targets = (InstructionHandle[])targets.clone();
+    this.match   = match.clone();
+    this.targets = targets.clone();
 
     if((match_length = match.length) < 2) // (almost) empty switch, or just default
       if (match.length==0) {
index 9f14db8998afbe4163569e88ac9ed1f7a4cbf76a..ec528c342ec907f2de5595e08b86d99c0600a11c 100644 (file)
@@ -47,7 +47,7 @@ public class Modules {
         if (null == name) {
             return null;
         }
-        Module result = (Module) modules.get(name);
+        Module result = modules.get(name);
         if (null == result) {
             File moduleDir = new File(baseDir, name);
             if (!Util.canReadDir(moduleDir)) {
index fe1097c9c12aa8ae08ed4956ca22ec4d91aa0217..202abcadd186e5437ff0a52faf9b58a244bf8845 100644 (file)
@@ -400,8 +400,7 @@ public class BuildArgParser extends Main {
                if (parser.classpath == null) {
                        addClasspath(System.getProperty("java.class.path", ""), ret);
                        List<String> fixedList = new ArrayList<>();
-                       for (Object o : ret) {
-                               String entry = (String) o;
+                       for (String entry : ret) {
                                if (!entry.endsWith("aspectjtools.jar")) {
                                        fixedList.add(entry);
                                }
index b56518dc9e6b022b7d2fb32831565425085fc32b..bfa98334df0b7602672280e400a9a6af2674bae4 100644 (file)
@@ -273,8 +273,7 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter {
        private List<InterimCompilationResult> getBinarySourcesFrom(Map<String, List<UnwovenClassFile>> binarySourceEntries) {
                // Map is fileName |-> List<UnwovenClassFile>
                List<InterimCompilationResult> ret = new ArrayList<>();
-               for (Object o : binarySourceEntries.keySet()) {
-                       String sourceFileName = (String) o;
+               for (String sourceFileName : binarySourceEntries.keySet()) {
                        List<UnwovenClassFile> unwovenClassFiles = binarySourceEntries.get(sourceFileName);
                        // XXX - see bugs 57432,58679 - final parameter on next call should be "compiler.options.maxProblemsPerUnit"
                        CompilationResult result = new CompilationResult(sourceFileName.toCharArray(), 0, 0, Integer.MAX_VALUE);
@@ -286,16 +285,14 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter {
        }
 
        private void notifyRequestor() {
-               for (Object o : resultsPendingWeave) {
-                       InterimCompilationResult iresult = (InterimCompilationResult) o;
+               for (InterimCompilationResult iresult : resultsPendingWeave) {
                        compiler.requestor.acceptResult(iresult.result().tagAsAccepted());
                }
        }
 
        private void weave() throws IOException {
                // ensure weaver state is set up correctly
-               for (Object o : resultsPendingWeave) {
-                       InterimCompilationResult iresult = (InterimCompilationResult) o;
+               for (InterimCompilationResult iresult : resultsPendingWeave) {
                        for (int i = 0; i < iresult.unwovenClassFiles().length; i++) {
                                weaver.addClassFile(iresult.unwovenClassFiles()[i], false);
                        }
index 8d72775242c5676fbdc96ba671f76754d91dda9f..629eb8edb8af17fc38c940269859b2eb631839c3 100644 (file)
@@ -93,13 +93,13 @@ public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Itera
                if (nowProcessing == null) {
                        if (!resultIterator.hasNext())
                                return false;
-                       nowProcessing = (InterimCompilationResult) resultIterator.next();
+                       nowProcessing = resultIterator.next();
                        classFileIndex = 0;
                }
                while (nowProcessing.unwovenClassFiles().length == 0) {
                        if (!resultIterator.hasNext())
                                return false;
-                       nowProcessing = (InterimCompilationResult) resultIterator.next();
+                       nowProcessing = resultIterator.next();
                }
                if (classFileIndex < nowProcessing.unwovenClassFiles().length) {
                        return true;
@@ -107,11 +107,11 @@ public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Itera
                        classFileIndex = 0;
                        if (!resultIterator.hasNext())
                                return false;
-                       nowProcessing = (InterimCompilationResult) resultIterator.next();
+                       nowProcessing = resultIterator.next();
                        while (nowProcessing.unwovenClassFiles().length == 0) {
                                if (!resultIterator.hasNext())
                                        return false;
-                               nowProcessing = (InterimCompilationResult) resultIterator.next();
+                               nowProcessing = resultIterator.next();
                        }
                }
                return true;
index 951e33caac51fdbf5b30fdab966760c174227fa0..fc6bb9042e29b54814ac304a6eda2b7dfea96b71 100644 (file)
@@ -211,8 +211,7 @@ public class WeaverMessageHandler implements IMessageHandler {
                        boolean usedBinarySourceFileName) {
                List<IProblem> ret = new ArrayList<>();
 
-               for (Object sourceLocation : sourceLocations) {
-                       ISourceLocation loc = (ISourceLocation) sourceLocation;
+               for (ISourceLocation loc : sourceLocations) {
                        if (loc != null) {
                                DefaultProblem dp = new DefaultProblem(loc.getSourceFile().getPath().toCharArray(), "see also", 0, new String[]{},
                                                ProblemSeverities.Ignore, getStartPos(loc, null), getEndPos(loc, null), loc.getLine(), loc.getColumn());
@@ -229,7 +228,7 @@ public class WeaverMessageHandler implements IMessageHandler {
                                        ProblemSeverities.Ignore, 0, 0, 0, 0);
                        ret.add(dp);
                }
-               IProblem[] retValue = (IProblem[]) ret.toArray(new IProblem[] {});
+               IProblem[] retValue = ret.toArray(new IProblem[] {});
                return retValue;
        }
 
index b71eddae9fad0b8f59d383456d70f3a10c932c19..8e06a586c72874f805b9ca062b08d8cb543b52ab 100644 (file)
@@ -237,7 +237,7 @@ public class AccessForInlineVisitor extends ASTVisitor {
                ResolvedMember m = world.makeResolvedMember(binding);
                ResolvedMember superAccessMember = AjcMemberMaker.superAccessMethod(inAspect.typeX, m);
                if (inAspect.superAccessForInline.containsKey(superAccessMember)) {
-                       return ((SuperAccessMethodPair) inAspect.superAccessForInline.get(superAccessMember)).accessMethod;
+                       return inAspect.superAccessForInline.get(superAccessMember).accessMethod;
                }
                MethodBinding ret = world.makeMethodBinding(superAccessMember);
                inAspect.superAccessForInline.put(superAccessMember, new SuperAccessMethodPair(m, ret));
index 709fc1597bd790a662c42e80178d2567a7ee8512..b085a0362ecd6949020895111663976cb2b480f8 100644 (file)
@@ -77,7 +77,7 @@ public class DeclareDeclaration extends AjMethodDeclaration {
                        Collection<UnresolvedType> parentPatterns = dp.getParents().getExactTypes();
                        StringBuilder parents = new StringBuilder();
                        for (Iterator<UnresolvedType> iter = parentPatterns.iterator(); iter.hasNext();) {
-                               UnresolvedType urt = ((UnresolvedType) iter.next());
+                               UnresolvedType urt = iter.next();
                                parents.append(urt.getName());
                                if (iter.hasNext()) {
                                        parents.append(", ");
index f96fb3579187de5da6e1146e7fc6ef2da779a903..8a63b153fe2698296bab1564894c1e6ddc199962 100644 (file)
@@ -214,7 +214,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor {
        private boolean insideAspect() {
                if (typeStack.empty())
                        return false;
-               TypeDeclaration typeDecl = (TypeDeclaration) typeStack.peek();
+               TypeDeclaration typeDecl = typeStack.peek();
                return isAspect(typeDecl);
        }
 
@@ -401,8 +401,8 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor {
                        UnresolvedType[] paramTypes = new UnresolvedType[bindings.length];
                        for (int i = 0; i < paramTypes.length; i++)
                                paramTypes[i] = bindings[i].getType();
-                       ResolvedPointcutDefinition resPcutDef = new ResolvedPointcutDefinition(factory.fromBinding(((TypeDeclaration) typeStack
-                                       .peek()).binding), methodDeclaration.modifiers, "anonymous", paramTypes, pc);
+                       ResolvedPointcutDefinition resPcutDef = new ResolvedPointcutDefinition(factory.fromBinding(typeStack.peek().binding),
+                                       methodDeclaration.modifiers, "anonymous", paramTypes, pc);
                        AjAttribute attr = new AjAttribute.PointcutDeclarationAttribute(resPcutDef);
                        ((AjMethodDeclaration) methodDeclaration).addAttribute(new EclipseAttributeAdapter(attr));
                } catch (ParserException pEx) {
@@ -500,7 +500,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor {
        }
 
        private void convertToPointcutDeclaration(MethodDeclaration methodDeclaration, ClassScope scope) {
-               TypeDeclaration typeDecl = (TypeDeclaration) typeStack.peek();
+               TypeDeclaration typeDecl = typeStack.peek();
                if (typeDecl.binding != null) {
                        if (!typeDecl.binding.isClass()) {
                                methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart, methodDeclaration.sourceEnd,
@@ -547,7 +547,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor {
                        }
                        pcDecl.pointcutDesignator = (pc == null) ? null : new PointcutDesignator(pc);
                        pcDecl.setGenerateSyntheticPointcutMethod();
-                       TypeDeclaration onType = (TypeDeclaration) typeStack.peek();
+                       TypeDeclaration onType = typeStack.peek();
                        pcDecl.postParse(onType);
                        // EclipseFactory factory =
                        // EclipseFactory.fromScopeLookupEnvironment
index e8d99b4f9f101908fc099e8c1f266c2e7bf81ffa..b9bd7db86d05ea6877f6950b7f96bd5b2a330a61 100644 (file)
@@ -699,9 +699,8 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
                        // Check if the type we are looking at is the topMostImplementor of a
                        // dangerous interface -
                        // report a problem if it is.
-                       for (Object o : dangerousInterfaces.entrySet()) {
-                               Map.Entry<ResolvedType, String> entry = (Map.Entry) o;
-                               ResolvedType interfaceType = (ResolvedType) entry.getKey();
+                       for (Map.Entry<ResolvedType, String> entry : dangerousInterfaces.entrySet()) {
+                               ResolvedType interfaceType = entry.getKey();
                                if (onType.isTopmostImplementor(interfaceType)) {
                                        factory.showMessage(IMessage.ERROR, onType + ": " + entry.getValue(), onType.getSourceLocation(), null);
                                }
@@ -1442,7 +1441,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
                        if (pendingTypesToFinish.size() > 0) {
                                processingTheQueue = true;
                                while (!pendingTypesToFinish.isEmpty()) {
-                                       BinaryTypeBinding nextVictim = (BinaryTypeBinding) pendingTypesToFinish.remove(0);
+                                       BinaryTypeBinding nextVictim = pendingTypesToFinish.remove(0);
                                        // During this call we may recurse into this method and add
                                        // more entries to the pendingTypesToFinish list.
                                        weaveInterTypeDeclarations(nextVictim);
index fd36f61fb35b5b33c16bd7f213f7707a1c0a6a19..ad9e8374b75ed8e6c1e13a8253d50602c3b88b2b 100644 (file)
@@ -143,8 +143,8 @@ public class PrivilegedHandler implements IPrivilegedHandler {
                int len = m.size();
                ResolvedMember[] ret = new ResolvedMember[len];
                int index = 0;
-               for (Object o : m) {
-                       ret[index++] = (ResolvedMember) o;
+               for (ResolvedMember o : m) {
+                       ret[index++] = o;
                }
                return ret;
        }
index b1ae347bac2db3d3e1f080441040d2b4f16a4197..e58810f913feae5657fb79789434c49a9a6f0e77 100644 (file)
@@ -564,8 +564,7 @@ public class AjProblemReporter extends ProblemReporter {
                                                        Collection<ResolvedMember> privvies = ((ReferenceType) theAspect).getPrivilegedAccesses();
                                                        // On an incremental compile the information is in the bcel delegate
                                                        if (privvies != null) {
-                                                               for (Object privvy : privvies) {
-                                                                       ResolvedMember priv = (ResolvedMember) privvy;
+                                                               for (ResolvedMember priv : privvies) {
                                                                        if (priv.getName().equals(fname)) {
                                                                                return;
                                                                        }
index 84569d4df10949f79a576d50c0fa94f763fd3256..941b30105a20059cd577de1e14253f1f85ab9d66 100644 (file)
@@ -734,7 +734,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
                     if (!outputDirsToAspects.containsKey(outputDir)) {
                         outputDirsToAspects.put(outputDir, new ArrayList<>());
                     }
-                    ((List) outputDirsToAspects.get(outputDir)).add(aspectName);
+                    outputDirsToAspects.get(outputDir).add(aspectName);
                 }
                        }
                }
index c36afd3ece4076992c780eff225756aa2b369d27..9410f1806bbf4b737751133e057182bddfb247a8 100644 (file)
@@ -172,7 +172,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
                        // -- remove duplicates before adding (XXX use them instead?)
                        if (addToNode != null && addToNode.getChildren() != null) {
                                for (ListIterator<IProgramElement> itt = addToNode.getChildren().listIterator(); itt.hasNext();) {
-                                       IProgramElement child = (IProgramElement) itt.next();
+                                       IProgramElement child = itt.next();
                                        ISourceLocation childLoc = child.getSourceLocation();
                                        if (null == childLoc) {
                                                // XXX ok, packages have null source locations
@@ -413,7 +413,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
                peNode.setFormalComment(generateJavadocComment(memberTypeDeclaration));
                peNode.setAnnotationStyleDeclaration(isAnnotationStyleAspect);
 
-               ((IProgramElement) stack.peek()).addChild(peNode);
+               stack.peek().addChild(peNode);
                stack.push(peNode);
                return true;
        }
@@ -482,11 +482,11 @@ public class AsmHierarchyBuilder extends ASTVisitor {
                        }
                }
 
-               IProgramElement ipe = (IProgramElement)stack.peek();
+               IProgramElement ipe = stack.peek();
                if (ipe!=null) {
                        // With AspectJ 1.8.9 the type structure must be slightly different as the guard
                        // is required (the null is due to a default constructor).
-                       ((IProgramElement) stack.peek()).addChild(peNode);
+                       stack.peek().addChild(peNode);
                }
                stack.push(peNode);
                return true;
@@ -597,7 +597,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
                                                        .equals("main(java.lang.String[])"))
                                        && peNode.getModifiers().contains(IProgramElement.Modifiers.STATIC)
                                        && peNode.getAccessibility().equals(IProgramElement.Accessibility.PUBLIC)) {
-                               ((IProgramElement) stack.peek()).setRunnable(true);
+                               stack.peek().setRunnable(true);
                        }
                }
 
@@ -763,7 +763,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
                                npe.printStackTrace();
                        }
                }
-               ((IProgramElement) stack.peek()).addChild(peNode);
+               stack.peek().addChild(peNode);
        }
 
        public void endVisit(MethodDeclaration methodDeclaration, ClassScope scope) {
@@ -791,7 +791,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
                        // create Source signature for import
                        peNode.setSourceSignature(genSourceSignature(importRef));
 
-                       IProgramElement containingTypeElement = (IProgramElement) stack.peek();
+                       IProgramElement containingTypeElement = stack.peek();
                        ProgramElement imports = getImportReferencesRoot();
                        imports.addChild(0, peNode);
                        stack.push(peNode);
@@ -800,7 +800,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
        }
 
        private ProgramElement getImportReferencesRoot() {
-               IProgramElement element = (IProgramElement) stack.peek();
+               IProgramElement element = stack.peek();
                boolean hasPackageDeclaration = (element.getChildren().get(0)).getKind().isPackageDeclaration();
                return (ProgramElement) element.getChildren().get(hasPackageDeclaration ? 1 : 0);
        }
@@ -870,7 +870,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
                peNode.setFormalComment(generateJavadocComment(fieldDeclaration));
                // peNode.setBytecodeSignature(new String(fieldDeclaration.binding.type.signature()));
 
-               ((IProgramElement) stack.peek()).addChild(peNode);
+               stack.peek().addChild(peNode);
                stack.push(peNode);
                return true;
        }
@@ -1022,7 +1022,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
                        peNode.setBytecodeSignature(memberBytecodeSignature);
                }
 
-               ((IProgramElement) stack.peek()).addChild(peNode);
+               stack.peek().addChild(peNode);
                stack.push(peNode);
                return true;
        }
@@ -1101,7 +1101,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
                                makeLocation(initializer), initializer.modifiers, null, null);
                // "",
                // new ArrayList());
-               ((IProgramElement) stack.peek()).addChild(peNode);
+               stack.peek().addChild(peNode);
                stack.push(peNode);
                initializer.block.traverse(this, scope);
                stack.pop();
index 1a4f3ffef742294e855b9cab282c70ba2769b77d..31ec56ab085f7dd85a0da366bf595cb6fcb9577a 100644 (file)
@@ -58,7 +58,7 @@ public class IncrementalStateManager {
                        System.out.println("Name " + entry.getKey());
                        File f = new File("n:/temp/foo.ajstate");
                        try {
-                               AjState state = (AjState) entry.getValue();
+                               AjState state = entry.getValue();
                                CompressingDataOutputStream dos = new CompressingDataOutputStream(new FileOutputStream(f));
                                state.write(dos);
                                dos.close();
@@ -87,7 +87,7 @@ public class IncrementalStateManager {
        }
 
        public static AjState retrieveStateFor(String configFile) {
-               return (AjState) incrementalStates.get(configFile);
+               return incrementalStates.get(configFile);
        }
 
        // now, managing changes to entries on a classpath
@@ -117,8 +117,7 @@ public class IncrementalStateManager {
                        CompilationResultDestinationManager outputManager = ajbc.getCompilationResultDestinationManager();
                        if (outputManager != null) {
                                List<File> outputDirs = outputManager.getAllOutputLocations();
-                               for (Object o : outputDirs) {
-                                       File dir = (File) o;
+                               for (File dir : outputDirs) {
                                        if (dir.equals(location)) {
                                                if (debugIncrementalStates) {
                                                        System.err.println("< findStateManagingOutputLocation(" + location + ") returning " + element);
index d2a5f0492dace358d9c823a9257e695915971217..2bdf102629b84bd0f6618ed364a661c3f009adbd 100644 (file)
@@ -231,10 +231,8 @@ public class Lint {
                setFromProperties(p);
        }
 
-       @SuppressWarnings("rawtypes")
        public void setFromProperties(Properties properties) {
-               for (Map.Entry<Object, Object> objectObjectEntry : properties.entrySet()) {
-                       Map.Entry entry = (Map.Entry) objectObjectEntry;
+               for (Map.Entry<Object, Object> entry : properties.entrySet()) {
                        Kind kind = kinds.get(entry.getKey());
                        if (kind == null) {
                                MessageUtil.error(world.getMessageHandler(), WeaverMessages.format(WeaverMessages.XLINT_KEY_ERROR, entry.getKey()));
index 022d8242f2e705d79ea18212ffa797ee43aed328..d52f96b2dd74066da6a3e1f2ab347796feeb3d60 100644 (file)
@@ -1034,7 +1034,7 @@ public class ReferenceType extends ResolvedType {
                // If we are raw, we have a generic type - we should ensure it uses the
                // same delegate
                if (isRawType() && getGenericType() != null) {
-                       ReferenceType genType = (ReferenceType) getGenericType();
+                       ReferenceType genType = getGenericType();
                        if (genType.getDelegate() != delegate) { // avoids circular updates
                                genType.setDelegate(delegate);
                        }
index 8bbfd3f4234cb2eea2225e07aa93458807f2fd42..9d81873a719498d946ab63a270c3b928a400accd 100644 (file)
@@ -50,7 +50,7 @@ public class WeakClassLoaderReference{
        }
 
        public ClassLoader getClassLoader() {
-               ClassLoader instance = (ClassLoader) loaderRef.get();
+               ClassLoader instance = loaderRef.get();
                // Assert instance!=null
                return instance;
        }
index ede14efcabf0171cf2ca1e379d5eaf636b4d836c..135fa8e0171ac2e5b8ac5e0157862b7d3ec7d779 100644 (file)
@@ -50,7 +50,7 @@ public class AnnotationPatternList extends PatternNode {
        }
 
        public AnnotationPatternList(List<AnnotationTypePattern> l) {
-               this((AnnotationTypePattern[]) l.toArray(AnnotationTypePattern.NONE));
+               this(l.toArray(AnnotationTypePattern.NONE));
        }
 
        protected AnnotationTypePattern[] getAnnotationPatterns() {
index 70b9c398c8ab3e1a3634503c0ccbaf42efbc13b9..9a1b3c803214844dcd8f7d8387b5fe150c99d786 100644 (file)
@@ -160,7 +160,7 @@ public class BasicTokenSource implements ITokenSource {
 
                //System.out.println(tokens);
 
-               return new BasicTokenSource((IToken[])tokens.toArray(new IToken[0]), context);
+               return new BasicTokenSource(tokens.toArray(new IToken[0]), context);
        }
 
        private static String makeString(char ch) {
index 72d438210006109adc9ac2cda7d14d9c9b78c109..0de1c1056b5406c6eb1f7c8826bd84415f2c2e28 100644 (file)
@@ -109,10 +109,7 @@ public class Bindings {
        }
 
        public Bindings copy() {
-               // int len = bindings.length;
-               // boolean[] a = new boolean[len];
-               // System.arraycopy(bindings, 0, a, 0, len);
-               return new Bindings((BindingPattern[]) bindings.clone());
+               return new Bindings(bindings.clone());
        }
 
        public void checkAllBound(IScope scope) {
index 79af11d7ee3e7e38640cf9cf9e184622c62c9c3b..9c349fac8c9fe9a305d7742b8ffef52686cb2e66 100644 (file)
@@ -83,7 +83,7 @@ public class ConcreteCflowPointcut extends Pointcut {
                }
                int[] indices = new int[slots.size()];
                for (int i = 0; i < indices.length; i++) {
-                       indices[i] = ((Slot) slots.get(i)).formalIndex;
+                       indices[i] = slots.get(i).formalIndex;
                }
                return indices;
        }
index 36adca253fdbabaf676d62922bad97ebe3e737ae..84730b900898a8c2eaa92d6bb47e27aeb0da6ee8 100644 (file)
@@ -62,7 +62,7 @@ public class HasMemberTypePattern extends TypePattern {
                // TODO what about ITDs
                World world = type.getWorld();
                for (Iterator<ResolvedMember> iter = type.getFields(); iter.hasNext();) {
-                       Member field = (Member) iter.next();
+                       Member field = iter.next();
                        if (field.getName().startsWith(declareAtPrefix)) {
                                continue;
                        }
@@ -82,7 +82,7 @@ public class HasMemberTypePattern extends TypePattern {
                // TODO what about ITDs
                World world = type.getWorld();
                for (Iterator<ResolvedMember> iter = type.getMethods(true, true); iter.hasNext();) {
-                       Member method = (Member) iter.next();
+                       Member method = iter.next();
                        if (method.getName().startsWith(declareAtPrefix)) {
                                continue;
                        }
index 3b4295996efee675a085d8b6d6a26c504635c303..e2a9b2192224aa2c0e643f2cda77dc934e43b850 100644 (file)
@@ -90,7 +90,7 @@ public class IfPointcut extends Pointcut {
                                if ((extraParameterFlags & Advice.ConstantValue) != 0) {
                                        return FuzzyBoolean.YES;
                                } else {
-                                       return FuzzyBoolean.NO;   
+                                       return FuzzyBoolean.NO;
                                }
                        }
                }
@@ -274,10 +274,10 @@ public class IfPointcut extends Pointcut {
                                                args.add(shadow.getThisEnclosingJoinPointStaticPartVar());
                                        } else {
 
-                                               if (state.size() == 0 || currentStateIndex > state.size()) { // if 'we have nothing else to bind from in the state object' 
+                                               if (state.size() == 0 || currentStateIndex > state.size()) { // if 'we have nothing else to bind from in the state object'
                                                        String[] paramNames = testMethod.getParameterNames();
                                                        StringBuilder errorParameter = new StringBuilder();
-                                                       
+
                                                        // Support a single special situation: where the if() pointcut takes a parameter bound elsewhere
                                                        // in the pointcut but the advice does not bind it. For example:
                                                        //
@@ -299,7 +299,7 @@ public class IfPointcut extends Pointcut {
                                                                        continue;
                                                                }
                                                        }
-                                                       
+
                                                        if (paramNames != null) {
                                                                errorParameter.append(testMethod.getParameterTypes()[i].getName()).append(" ");
                                                                errorParameter.append(paramNames[i]);
@@ -334,7 +334,7 @@ public class IfPointcut extends Pointcut {
                                }
                        }
 
-                       ret = Test.makeAnd(ret, Test.makeCall(testMethod, (Expr[]) args.toArray(Expr.NONE)));
+                       ret = Test.makeAnd(ret, Test.makeCall(testMethod, args.toArray(Expr.NONE)));
 
                        // Remember...
                        ifLastMatchedShadowId = shadow.shadowId;
@@ -381,7 +381,7 @@ public class IfPointcut extends Pointcut {
                        if (def != null) {
                                ResolvedType aspect = inAspect.getWorld().resolve(def.getDeclaringType());
                                for (Iterator<ResolvedMember> memberIter = aspect.getMethods(true, true); memberIter.hasNext();) {
-                                       ResolvedMember method = (ResolvedMember) memberIter.next();
+                                       ResolvedMember method = memberIter.next();
                                        if (def.getName().equals(method.getName())
                                                        && def.getParameterTypes().length == method.getParameterTypes().length) {
                                                boolean sameSig = true;
index 0254dfee2bfed34fefc0d4fb5aacac59f45771a4..11e2d1536fb0a7f77f2b6138bc6f9d49f68fe568 100644 (file)
@@ -40,7 +40,7 @@ public abstract class NameBindingPointcut extends Pointcut {
                ResolvedType myType = type.getExactType().resolve(world);
                if (myType.isParameterizedType()) {
                        // unchecked warning already issued...
-                       myType = (ResolvedType) myType.getRawType();
+                       myType = myType.getRawType();
                }
                return Test.makeInstanceof(var, myType.resolve(world));
        }
index 582c81f75e791177d4e018072feed427e61f7212..8deea5abfc9f7779cb6e472c336242dc59ab86df 100644 (file)
@@ -199,7 +199,7 @@ public abstract class TypePattern extends PatternNode {
                }
                // FuzzyBoolean ret = FuzzyBoolean.NO; // ??? -eh
                for (Iterator<ResolvedType> i = superType.getDirectSupertypes(); i.hasNext();) {
-                       ResolvedType superSuperType = (ResolvedType) i.next();
+                       ResolvedType superSuperType = i.next();
                        if (matchesSubtypes(superSuperType, annotatedType)) {
                                return true;
                        }
index 4d9a28e2d270e14d44f227e8f41fefbc2cec89df..2ac2583c6721c29f3e5868e3c82802d9b88c7ac7 100644 (file)
@@ -59,7 +59,7 @@ public class TypePatternList extends PatternNode {
        }
 
        public TypePatternList(List<TypePattern> l) {
-               this((TypePattern[]) l.toArray(new TypePattern[0]));
+               this(l.toArray(new TypePattern[0]));
        }
 
        public int size() {
index da227d6ec1ba744f952b11cc306b7eac28cc5f7f..24c3289996cf8de1ba41423eab0e28cbc321de12 100644 (file)
@@ -37,8 +37,8 @@ public class TypePatternQuestions {
 
        public Question anyChanges() {
                for (Map.Entry<Question, FuzzyBoolean> entry : questionsAndAnswers.entrySet()) {
-                       Question question = (Question) entry.getKey();
-                       FuzzyBoolean expectedAnswer = (FuzzyBoolean) entry.getValue();
+                       Question question = entry.getKey();
+                       FuzzyBoolean expectedAnswer = entry.getValue();
 
                        FuzzyBoolean currentAnswer = question.ask();
                        //System.out.println(question + ":" + currentAnswer);
@@ -54,8 +54,8 @@ public class TypePatternQuestions {
                StringBuilder buf = new StringBuilder();
                buf.append("TypePatternQuestions{");
                for (Map.Entry<Question,FuzzyBoolean> entry: questionsAndAnswers.entrySet()) {
-                       Question question = (Question)entry.getKey();
-                       FuzzyBoolean expectedAnswer = (FuzzyBoolean)entry.getValue();
+                       Question question = entry.getKey();
+                       FuzzyBoolean expectedAnswer = entry.getValue();
                        buf.append(question);
                        buf.append(":");
                        buf.append(expectedAnswer);
index 671989cd0518d804ef566296eb9d79594e2a7d28..32cc0c6c1cfde057ab0bf9c37b6630795725afa2 100644 (file)
@@ -110,7 +110,7 @@ public class WildTypePattern extends TypePattern {
        }
 
        public WildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim) {
-               this((NamePattern[]) names.toArray(new NamePattern[0]), includeSubtypes, dim, false, TypePatternList.EMPTY);
+               this(names.toArray(new NamePattern[0]), includeSubtypes, dim, false, TypePatternList.EMPTY);
 
        }
 
@@ -127,7 +127,7 @@ public class WildTypePattern extends TypePattern {
 
        public WildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg, TypePatternList typeParams,
                        TypePattern upperBound, TypePattern[] additionalInterfaceBounds, TypePattern lowerBound) {
-               this((NamePattern[]) names.toArray(new NamePattern[0]), includeSubtypes, dim, isVarArg, typeParams);
+               this(names.toArray(new NamePattern[0]), includeSubtypes, dim, isVarArg, typeParams);
                this.end = endPos;
                this.upperBound = upperBound;
                this.lowerBound = lowerBound;
@@ -135,7 +135,7 @@ public class WildTypePattern extends TypePattern {
        }
 
        public WildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg, TypePatternList typeParams) {
-               this((NamePattern[]) names.toArray(new NamePattern[0]), includeSubtypes, dim, isVarArg, typeParams);
+               this(names.toArray(new NamePattern[0]), includeSubtypes, dim, isVarArg, typeParams);
                this.end = endPos;
        }
 
index 55e8a957bbfb095aced2c851fd0c2996144a6f45..0e5dc34fdacf7d54417e6b9318e78f4998a1f0d1 100644 (file)
@@ -256,7 +256,7 @@ public class ReflectionShadow extends Shadow {
                        Var v = ReflectionVar.createAtAnnotationVar(annType, this.annotationFinder);
                        annotationVar.put(annType, v);
                }
-               return (Var) annotationVar.get(annType);
+               return annotationVar.get(annType);
        }
 
        /*
@@ -270,7 +270,7 @@ public class ReflectionShadow extends Shadow {
                        Var v = ReflectionVar.createWithinAnnotationVar(annType, this.annotationFinder);
                        withinAnnotationVar.put(annType, v);
                }
-               return (Var) withinAnnotationVar.get(annType);
+               return withinAnnotationVar.get(annType);
        }
 
        /*
@@ -284,7 +284,7 @@ public class ReflectionShadow extends Shadow {
                        Var v = ReflectionVar.createWithinCodeAnnotationVar(annType, this.annotationFinder);
                        withinCodeAnnotationVar.put(annType, v);
                }
-               return (Var) withinCodeAnnotationVar.get(annType);
+               return withinCodeAnnotationVar.get(annType);
        }
 
        /*
@@ -322,7 +322,7 @@ public class ReflectionShadow extends Shadow {
                        Var[] vars = new Var[getArgCount()];
                        atArgsVars.put(annType, vars);
                }
-               Var[] vars = (Var[]) atArgsVars.get(annType);
+               Var[] vars = atArgsVars.get(annType);
                if (i > (vars.length - 1))
                        return null;
                if (vars[i] == null) {
index 3bb113b08e536869b98b236646823aa6d20a54a9..d14f712cf4815635a60ef353d0835c24f1c25858 100644 (file)
@@ -291,7 +291,7 @@ public class StandardShadow extends Shadow {
                        Var v = ReflectionVar.createAtAnnotationVar(annType, this.annotationFinder);
                        annotationVar.put(annType, v);
                }
-               return (Var) annotationVar.get(annType);
+               return annotationVar.get(annType);
        }
 
        /*
@@ -305,7 +305,7 @@ public class StandardShadow extends Shadow {
                        Var v = ReflectionVar.createWithinAnnotationVar(annType, this.annotationFinder);
                        withinAnnotationVar.put(annType, v);
                }
-               return (Var) withinAnnotationVar.get(annType);
+               return withinAnnotationVar.get(annType);
        }
 
        /*
@@ -319,7 +319,7 @@ public class StandardShadow extends Shadow {
                        Var v = ReflectionVar.createWithinCodeAnnotationVar(annType, this.annotationFinder);
                        withinCodeAnnotationVar.put(annType, v);
                }
-               return (Var) withinCodeAnnotationVar.get(annType);
+               return withinCodeAnnotationVar.get(annType);
        }
 
        /*
@@ -357,7 +357,7 @@ public class StandardShadow extends Shadow {
                        Var[] vars = new Var[getArgCount()];
                        atArgsVars.put(annType, vars);
                }
-               Var[] vars = (Var[]) atArgsVars.get(annType);
+               Var[] vars = atArgsVars.get(annType);
                if (i > (vars.length - 1))
                        return null;
                if (vars[i] == null) {
index 49f3bb18c4a93b4e8ec3a2b25fc4b8770a278398..8e6550c7655b3306a4898c51b828d98ba17e1a85 100644 (file)
@@ -120,7 +120,7 @@ public class AjTypeImpl<T> implements AjType<T> {
         */
        public AjType<? super T> getSupertype() {
                Class<? super T> superclass = clazz.getSuperclass();
-               return superclass==null ? null : (AjType<? super T>) new AjTypeImpl<>(superclass);
+               return superclass==null ? null : new AjTypeImpl<>(superclass);
        }
 
        /* (non-Javadoc)
index a95b7d2c4aed201fbc1f0ef01c859730e8a12e24..d9f597b3ec9db88bd97200fe57042873cf2df60a 100644 (file)
@@ -91,7 +91,7 @@ public class CFlowStack {
     public Object peek() {
         Stack<?> stack = getThreadStack();
         if (stack.isEmpty()) throw new org.aspectj.lang.NoAspectBoundException();
-        return (Object)stack.peek();
+        return stack.peek();
     }
 
     public Object get(int index) {
index 6f6a51bd9e940483316f816bd8adaec81141d980..4b51816fd88a1f74e33451e953f0dc225febccb2 100644 (file)
@@ -34,7 +34,7 @@ public class ThreadCounterImpl11 implements ThreadCounter {
        private synchronized Counter getThreadCounter() {
                if (Thread.currentThread() != cached_thread) {
                        cached_thread = Thread.currentThread();
-                       cached_counter = (Counter)counters.get(cached_thread);
+                       cached_counter = counters.get(cached_thread);
                        if (cached_counter == null) {
                                cached_counter = new Counter();
                                counters.put(cached_thread, cached_counter);
@@ -45,7 +45,7 @@ public class ThreadCounterImpl11 implements ThreadCounter {
                        if (change_count > Math.max(MIN_COLLECT_AT, COLLECT_AT/size)) {
                                List<Thread> dead_stacks = new ArrayList<>();
                                for (Enumeration<Thread> e = counters.keys(); e.hasMoreElements(); ) {
-                                       Thread t = (Thread)e.nextElement();
+                                       Thread t = e.nextElement();
                                        if (!t.isAlive()) dead_stacks.add(t);
                                }
                                for (Thread t : dead_stacks) {
index db58be68334c4cbf669429cd0f30491feb6fc52d..02f5e4cdf5cc200d09a05aa5a02c16632077e213 100644 (file)
@@ -21,7 +21,7 @@ public class ThreadStackFactoryImpl implements ThreadStackFactory {
                  return new Stack();
                }
                public Stack getThreadStack() {
-                       return (Stack)get();
+                       return get();
                }
                public void removeThreadStack() {
                        this.remove();
@@ -38,7 +38,7 @@ public class ThreadStackFactoryImpl implements ThreadStackFactory {
                  return new Counter();
                }
                public Counter getThreadCounter() {
-                       return (Counter)get();
+                       return get();
                }
 
                public void removeThreadCounter() {
index 5f37fa73f3a6f2987cdfb1418122839dd5a5bb75..fc6b94ee29b28cef464800f2c3cd68dd70b5c46d 100644 (file)
@@ -39,11 +39,11 @@ public class ThreadStackImpl11 implements ThreadStack {
                        if (change_count > Math.max(MIN_COLLECT_AT, COLLECT_AT/size)) {
                                Stack<Thread> dead_stacks = new Stack<>();
                                for (Enumeration<Thread> e = stacks.keys(); e.hasMoreElements(); ) {
-                                       Thread t = (Thread)e.nextElement();
+                                       Thread t = e.nextElement();
                                        if (!t.isAlive()) dead_stacks.push(t);
                                }
                                for (Enumeration<Thread> e = dead_stacks.elements(); e.hasMoreElements(); ) {
-                                       Thread t = (Thread)e.nextElement();
+                                       Thread t = e.nextElement();
                                        stacks.remove(t);
                                }
                                change_count = 0;
index 58d01d1ea07e6ae6962caa48278f1f5983680c83..c012a6029b77832f3a88d1f040175f80e104bef6 100644 (file)
@@ -59,7 +59,7 @@ public final class Factory {
        static Class<?> makeClass(String s, ClassLoader loader) {
                if (s.equals("*"))
                        return null;
-               Class<?> ret = (Class)prims.get(s);
+               Class<?> ret = prims.get(s);
                if (ret != null)
                        return ret;
                try {
index 3e87369f39ed69fa1171b33956fcfa43d59f6086..28ebbd7591b6231bb8b9b6f5b080bd721b5ce3f0 100644 (file)
@@ -230,7 +230,7 @@ abstract class SignatureImpl implements Signature {
                }
 
                private String[] array() {
-                       return (String[]) toStringCacheRef.get();
+                       return toStringCacheRef.get();
                }
 
                private String[] makeCache() {
index 260d16d90e654bd2ed3a3a4709392c4e80df7d63..bf9d80a4c55962f0597a6da748e5573db874ff4c 100644 (file)
@@ -1190,7 +1190,7 @@ public class AjcTask extends MatchingTask {
                ArrayList<String> result = new ArrayList(cmd.extractArguments());
                addListArgs(result);
 
-               String[] command = (String[]) result.toArray(new String[0]);
+               String[] command = result.toArray(new String[0]);
                if (null != commandEditor) {
                        command = commandEditor.editCommand(command);
                } else if (null != COMMAND_EDITOR) {
index 1cb525d5fa1b732a469c101c0bce7c0fa4d7d754..ba75e9d87d4573143f7a12242c614014cd252f8d 100644 (file)
@@ -169,7 +169,7 @@ public class Ajdoc extends MatchingTask {
 
         Enumeration<FileSet> e = fileSets.elements();
         while (e.hasMoreElements()) {
-            FileSet fs = (FileSet) e.nextElement();
+            FileSet fs = e.nextElement();
             if (!fs.hasPatterns() && !fs.hasSelectors()) {
                 fs = (FileSet) fs.clone();
                 fs.createInclude().setName("**/*.java");
index 5af7b7f42f183127e1a2663c14e1b3251fddcb88..d06928712587339bad3a942b35fea684eca9ef05 100644 (file)
@@ -137,7 +137,7 @@ public class Ajc extends DefaultCompilerAdapter {
                 argsList.add(args[i]);
             }
         }
-        return (String[])argsList.toArray(new String[0]);
+        return argsList.toArray(new String[0]);
     }
 
     /**
index 4a69c9273292d1349f3e569923c949190331a464..8b4245636d9ad40a02874a478d77aeb486986217 100644 (file)
@@ -118,9 +118,9 @@ public class Reflection {
                                // not URL, zip, or dir - unsure what to do
                        }
                }
-        File[] dirRa = (File[]) dirs.toArray(new File[0]);
-        File[] libRa = (File[]) libs.toArray(new File[0]);
-        URL[] urlRa = (URL[]) urls.toArray(new URL[0]);
+        File[] dirRa = dirs.toArray(new File[0]);
+        File[] libRa = libs.toArray(new File[0]);
+        URL[] urlRa = urls.toArray(new URL[0]);
         runMainInSameVM(urlRa, libRa, dirRa, className, args);
     }
 
index 42679304b28c861a840a7dae699688b2341b2f9d..6a71640cacae30ec0cb78e9819b9c5a340d8ef73 100644 (file)
@@ -2380,7 +2380,7 @@ class BcelClassWeaver implements IClassWeaver {
                                        ShadowRange oldRange = (ShadowRange) old;
                                        if (oldRange.getStart() == src) {
                                                BcelShadow oldShadow = oldRange.getShadow();
-                                               BcelShadow freshEnclosing = oldShadow.getEnclosingShadow() == null ? null : (BcelShadow) shadowMap
+                                               BcelShadow freshEnclosing = oldShadow.getEnclosingShadow() == null ? null : shadowMap
                                                                .get(oldShadow.getEnclosingShadow());
                                                BcelShadow freshShadow = oldShadow.copyInto(recipient, freshEnclosing);
                                                ShadowRange freshRange = new ShadowRange(recipient.getBody());
index 7d471a6b6ecf15e8797ec4ee468db3625d4e8925..7a40ed542c1e1a5247bda1be4c22287f5aeb9f13 100644 (file)
@@ -822,7 +822,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                }
                if (isGeneric()) {
                        // update resolved typex to point at generic type not raw type.
-                       ReferenceType genericType = (ReferenceType) this.resolvedTypeX.getGenericType();
+                       ReferenceType genericType = this.resolvedTypeX.getGenericType();
                        // genericType.setSourceContext(this.resolvedTypeX.getSourceContext());
                        // Can be null if unpacking whilst building the bcel delegate (in call hierarchy from BcelWorld.addSourceObjectType()
                        // line 453) - see 317139
index ccea81f49f21e86a1c513d5c0f555675b4614051..d4f47cbe75dd35fe6bde44a6aea1eae2764252e3 100644 (file)
@@ -389,7 +389,7 @@ public class BcelWeaver {
                                        Enumeration<JarEntry> entries = inJar.entries();
 
                                        while (entries.hasMoreElements()) {
-                                               JarEntry entry = (JarEntry) entries.nextElement();
+                                               JarEntry entry = entries.nextElement();
                                                InputStream inStream = inJar.getInputStream(entry);
 
                                                byte[] bytes = FileUtil.readAsByteArray(inStream);
index c076c3a2f92d967eb9d89dac1a7d90e92641017b..2e3d5532c4c7a4fb68fd6eba677d5fc72aec2ba1 100644 (file)
@@ -432,7 +432,7 @@ public class LightXMLParser {
                        }
                        buf.append(c);
                } else {
-                       char[] value = (char[]) entities.get(key);
+                       char[] value = entities.get(key);
                        if (value == null) {
                                throw new Exception("Unknown entity: " + key);
                        }
index 4677a39397e9bdd02547fc23a805714342662a10..4631178d41385d548473a9cf13332f01ad07c41f 100644 (file)
@@ -230,7 +230,7 @@ public class LTWWorld extends BcelWorld implements IReflectionWorld {
                                        typeCompletionInProgress = false;
                                }
                                while (typesForCompletion.size() != 0) {
-                                       ResolvedType rt = (ResolvedType) typesForCompletion.get(0);
+                                       ResolvedType rt = typesForCompletion.get(0);
                                        completeHierarchyForType(rt);
                                        typesForCompletion.remove(0);
                                }