Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>tags/java16-add-opens
@@ -1173,8 +1173,8 @@ public class AsmManager implements IStructureModel { | |||
private ModelInfo(IHierarchy hierarchy, IRelationshipMap relationshipMap) { | |||
IProgramElement ipe = hierarchy.getRoot(); | |||
walkModel(ipe); | |||
recordStat("FileMapSize", new Integer(hierarchy.getFileMapEntrySet().size()).toString()); | |||
recordStat("RelationshipMapSize", new Integer(relationshipMap.getEntries().size()).toString()); | |||
recordStat("FileMapSize", Integer.toString(hierarchy.getFileMapEntrySet().size())); | |||
recordStat("RelationshipMapSize", Integer.toString(relationshipMap.getEntries().size())); | |||
} | |||
private void walkModel(IProgramElement ipe) { |
@@ -171,7 +171,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { | |||
String existingHandle = object.getHandleIdentifier(); | |||
int suffixPosition = existingHandle.indexOf('!'); | |||
if (suffixPosition != -1) { | |||
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; | |||
count = Integer.parseInt(existingHandle.substring(suffixPosition + 1)) + 1; | |||
} else { | |||
if (count == 1) { | |||
count = 2; | |||
@@ -181,13 +181,13 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { | |||
} | |||
} | |||
if (count > 1) { | |||
return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray()); | |||
return CharOperation.concat(countDelim, Integer.toString(count).toCharArray()); | |||
} | |||
} else if (ipe.getKind().isDeclare()) { | |||
// // look at peer declares | |||
int count = computeCountBasedOnPeers(ipe); | |||
if (count > 1) { | |||
return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray()); | |||
return CharOperation.concat(countDelim, Integer.toString(count).toCharArray()); | |||
} | |||
} else if (ipe.getKind().equals(IProgramElement.Kind.ADVICE)) { | |||
// Look at any peer advice | |||
@@ -227,7 +227,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { | |||
String existingHandle = object.getHandleIdentifier(); | |||
int suffixPosition = existingHandle.indexOf('!'); | |||
if (suffixPosition != -1) { | |||
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; | |||
count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1; | |||
} else { | |||
if (count == 1) { | |||
count = 2; | |||
@@ -238,7 +238,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { | |||
} | |||
} | |||
if (count > 1) { | |||
return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray()); | |||
return CharOperation.concat(countDelim, Integer.toString(count).toCharArray()); | |||
} | |||
} else if (ipe.getKind().equals(IProgramElement.Kind.INITIALIZER)) { | |||
// return String.valueOf(++initializerCounter).toCharArray(); | |||
@@ -279,7 +279,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { | |||
String existingHandle = object.getHandleIdentifier(); | |||
int suffixPosition = existingHandle.indexOf('!'); | |||
if (suffixPosition != -1) { | |||
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; | |||
count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1; | |||
} else { | |||
if (count == 1) { | |||
count = 2; | |||
@@ -290,7 +290,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { | |||
} | |||
} | |||
// if (count > 1) { | |||
return new Integer(count).toString().toCharArray(); | |||
return Integer.toString(count).toCharArray(); | |||
// return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray()); | |||
// } | |||
} else if (ipe.getKind().equals(IProgramElement.Kind.CODE)) { | |||
@@ -314,7 +314,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { | |||
int suffixPosition = existingHandle.lastIndexOf('!'); | |||
int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter | |||
if (suffixPosition != -1 && lastSquareBracket < suffixPosition) { // pr260384 | |||
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; | |||
count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1; | |||
} else { | |||
if (count == 1) { | |||
count = 2; | |||
@@ -334,7 +334,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { | |||
int suffixPosition = existingHandle.lastIndexOf('!'); | |||
int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter | |||
if (suffixPosition != -1 && lastSquareBracket < suffixPosition) { // pr260384 | |||
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; | |||
count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1; | |||
} else { | |||
if (count == 1) { | |||
count = 2; | |||
@@ -345,7 +345,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { | |||
} | |||
} | |||
if (count > 1) { | |||
return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray()); | |||
return CharOperation.concat(countDelim, Integer.toString(count).toCharArray()); | |||
} | |||
} | |||
return empty; | |||
@@ -383,7 +383,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { | |||
String existingHandle = object.getHandleIdentifier(); | |||
int suffixPosition = existingHandle.indexOf('!'); | |||
if (suffixPosition != -1) { | |||
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; | |||
count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1; | |||
} else { | |||
if (count == 1) { | |||
count = 2; |
@@ -239,7 +239,7 @@ public class SimpleElementValue extends ElementValue { | |||
return Integer.toString(b.getValue()); | |||
case PRIMITIVE_CHAR: | |||
ConstantInteger ch = (ConstantInteger) cpool.getConstant(idx); | |||
return new Character((char) ch.getIntValue()).toString(); | |||
return Character.toString((char) ch.getIntValue()); | |||
case PRIMITIVE_BOOLEAN: | |||
ConstantInteger bo = (ConstantInteger) cpool.getConstant(idx); | |||
if (bo.getValue() == 0) { | |||
@@ -262,11 +262,11 @@ public class SimpleElementValue extends ElementValue { | |||
switch (type) { | |||
case PRIMITIVE_INT: | |||
ConstantInteger c = (ConstantInteger) cpool.getConstant(idx); | |||
s.append("(int)").append(Integer.toString(c.getValue())); | |||
s.append("(int)").append(c.getValue()); | |||
break; | |||
case PRIMITIVE_LONG: | |||
ConstantLong j = (ConstantLong) cpool.getConstant(idx); | |||
s.append("(long)").append(Long.toString(j.getValue())); | |||
s.append("(long)").append(j.getValue()); | |||
break; | |||
case PRIMITIVE_DOUBLE: | |||
ConstantDouble d = (ConstantDouble) cpool.getConstant(idx); | |||
@@ -274,19 +274,19 @@ public class SimpleElementValue extends ElementValue { | |||
break; | |||
case PRIMITIVE_FLOAT: | |||
ConstantFloat f = (ConstantFloat) cpool.getConstant(idx); | |||
s.append("(float)").append(Float.toString(f.getValue())); | |||
s.append("(float)").append(f.getValue()); | |||
break; | |||
case PRIMITIVE_SHORT: | |||
ConstantInteger ci = (ConstantInteger) cpool.getConstant(idx); | |||
s.append("(short)").append(Integer.toString(ci.getValue())); | |||
s.append("(short)").append(ci.getValue()); | |||
break; | |||
case PRIMITIVE_BYTE: | |||
ConstantInteger b = (ConstantInteger) cpool.getConstant(idx); | |||
s.append("(byte)").append(Integer.toString(b.getValue())); | |||
s.append("(byte)").append(b.getValue()); | |||
break; | |||
case PRIMITIVE_CHAR: | |||
ConstantInteger ch = (ConstantInteger) cpool.getConstant(idx); | |||
s.append("(char)").append(new Character((char) ch.getIntValue()).toString()); | |||
s.append("(char)").append((char) ch.getIntValue()); | |||
break; | |||
case PRIMITIVE_BOOLEAN: | |||
ConstantInteger bo = (ConstantInteger) cpool.getConstant(idx); |
@@ -201,7 +201,7 @@ public class RuntimeVisibleAnnotationAttributeTest extends BcelTestCase { | |||
checkValue(ann,"dval","33.4"); | |||
checkValue(ann,"sval","99"); | |||
checkValue(ann,"bval","2"); | |||
checkValue(ann,"cval",new Character('5').toString()); | |||
checkValue(ann,"cval", Character.toString('5')); | |||
checkValue(ann,"zval","false"); | |||
} |
@@ -47,7 +47,7 @@ public class ReflectionFactory { // XXX lease, pool | |||
final Class<?> cfn = Class.forName(cname); | |||
String error = null; | |||
if (args == NONE) { | |||
result = cfn.newInstance(); | |||
result = cfn.getDeclaredConstructor().newInstance(); | |||
} else { | |||
Class<?>[] types = getTypes(args); | |||
Constructor<?> constructor = cfn.getConstructor(types); |
@@ -145,7 +145,7 @@ public class Main { | |||
try { | |||
String className = (String) properties.get("installer.main.class"); | |||
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); | |||
Installer installer = (Installer) Class.forName(className).newInstance(); | |||
Installer installer = (Installer) Class.forName(className).getDeclaredConstructor().newInstance(); | |||
InstallContext installerContext = new InstallContext(properties); | |||
installerContext.setHasGui(hasGui); | |||
installer.setContext(installerContext); |
@@ -599,7 +599,7 @@ public class AntBuilder extends Builder { | |||
ClassLoader parent = Task.class.getClassLoader(); | |||
ClassLoader loader = new URLClassLoader(cp, parent); | |||
Class c = loader.loadClass(AJCTASK); | |||
task = c.newInstance(); | |||
task = c.getDeclaredConstructor().newInstance(); | |||
// Westodo Project project = javac.getProject(); | |||
Method m = c.getMethod("setupAjc", new Class[] { Javac.class }); | |||
m.invoke(task, new Object[] { javac }); | |||
@@ -825,4 +825,4 @@ class ProjectMessager extends Messager { | |||
return true; | |||
} | |||
} | |||
} |
@@ -65,7 +65,7 @@ public class Options { | |||
String handlerClass = arg.substring(OPTIONVALUED_messageHandler.length()).trim(); | |||
try { | |||
Class<?> handler = Class.forName(handlerClass, false, laoder); | |||
weaverOption.messageHandler = ((IMessageHandler) handler.newInstance()); | |||
weaverOption.messageHandler = ((IMessageHandler) handler.getDeclaredConstructor().newInstance()); | |||
} catch (Throwable t) { | |||
weaverOption.messageHandler.handleMessage(new Message("Cannot instantiate message handler " + handlerClass, | |||
IMessage.ERROR, t, null)); |
@@ -98,13 +98,10 @@ public class WeavingURLClassLoader extends ExtensibleURLClassLoader implements W | |||
File f = new File(t.nextToken().trim()); | |||
try { | |||
if (f.exists()) { | |||
URL url = f.toURL(); | |||
if (url != null) { | |||
URL url = f.toURI().toURL(); | |||
urlList.add(url); | |||
} | |||
} | |||
} catch (MalformedURLException e) { | |||
} | |||
} catch (MalformedURLException ignored) {} | |||
} | |||
URL[] urls = new URL[urlList.size()]; |
@@ -112,7 +112,7 @@ public class JRockitAgentTest extends TestCase { | |||
} | |||
Class agentClazz = Class.forName("org.aspectj.weaver.loadtime.JRockitAgent", false, this); | |||
Object obj = agentClazz.newInstance(); | |||
Object obj = agentClazz.getDeclaredConstructor().newInstance(); | |||
if (debug) | |||
System.out.println("JRockitClassLoader.JRockitClassLoader() obj=" + obj); | |||
this.agent = obj; | |||
@@ -130,7 +130,7 @@ public class JRockitAgentTest extends TestCase { | |||
String escaped = s.substring(i + 1, i + 3); | |||
s = s.substring(i + 3); | |||
Integer value = Integer.valueOf(escaped, 16); | |||
result.append(new Character((char) value.intValue())); | |||
result.append(Character.valueOf((char) value.intValue())); | |||
i = s.indexOf("%"); | |||
} | |||
result.append(s); |
@@ -84,7 +84,7 @@ public class WeavingContextTest extends TestCase { | |||
public void testGetFile() throws IOException { | |||
File file = new File("../loadtime/testdata"); | |||
URL fileURL = file.getCanonicalFile().toURL(); | |||
URL fileURL = file.getCanonicalFile().toURI().toURL(); | |||
URLClassLoader loader = new URLClassLoader(new URL[] { fileURL },null); | |||
IWeavingContext context = new TestWeavingContext(loader) { | |||
@@ -102,7 +102,7 @@ public class WeavingContextTest extends TestCase { | |||
public void testGetId() throws IOException { | |||
File file = new File("../loadtime/testdata"); | |||
URL fileURL = file.getCanonicalFile().toURL(); | |||
URL fileURL = file.getCanonicalFile().toURI().toURL(); | |||
URLClassLoader loader = new URLClassLoader(new URL[] { fileURL },null); | |||
IWeavingContext context = new TestWeavingContext(loader) { | |||
@@ -120,7 +120,7 @@ public class WeavingContextTest extends TestCase { | |||
public void testGetDefinitions () throws Exception { | |||
File file = new File("../loadtime/testdata"); | |||
URL fileURL = file.getCanonicalFile().toURL(); | |||
URL fileURL = file.getCanonicalFile().toURI().toURL(); | |||
URLClassLoader loader = new URLClassLoader(new URL[] { fileURL },null); | |||
IWeavingContext context = new TestWeavingContext(loader) { | |||
@@ -229,7 +229,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { | |||
if (pipelineOutput == null) { | |||
pipelineOutput = new Hashtable(); | |||
} | |||
pipelineOutput.put("filesContainingAspects", new Integer(toWaitFor).toString()); | |||
pipelineOutput.put("filesContainingAspects", Integer.toString(toWaitFor)); | |||
StringBuffer order = new StringBuffer(); | |||
order.append("["); | |||
for (int i = 0; i < units.length; i++) { |
@@ -898,7 +898,7 @@ public abstract class AjcTestCase extends TestCase { | |||
URL[] urls = new URL[strTok.countTokens()]; | |||
try { | |||
for (int i = 0; i < urls.length; i++) { | |||
urls[i] = new File(strTok.nextToken()).getCanonicalFile().toURL(); | |||
urls[i] = new File(strTok.nextToken()).getCanonicalFile().toURI().toURL(); | |||
} | |||
} catch (Exception malEx) { | |||
fail("Bad classpath specification: " + classpath); |
@@ -84,7 +84,7 @@ public class SimpleAnnotationValue extends AnnotationValue { | |||
case 'B': // byte | |||
return Byte.toString(theByte); | |||
case 'C': // char | |||
return new Character(theChar).toString(); | |||
return Character.toString(theChar); | |||
case 'D': // double | |||
return Double.toString(theDouble); | |||
case 'F': // float |
@@ -69,7 +69,7 @@ public class ReflectionBasedReferenceTypeDelegateFactory { | |||
ClassLoader usingClassLoader, World inWorld) { | |||
try { | |||
Class delegateClass = Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate"); | |||
ReflectionBasedReferenceTypeDelegate ret = (ReflectionBasedReferenceTypeDelegate) delegateClass.newInstance(); | |||
ReflectionBasedReferenceTypeDelegate ret = (ReflectionBasedReferenceTypeDelegate) delegateClass.getDeclaredConstructor().newInstance(); | |||
ret.initialize(forReferenceType, forClass, usingClassLoader, inWorld); | |||
return ret; | |||
} catch (ClassNotFoundException cnfEx) { | |||
@@ -81,6 +81,12 @@ public class ReflectionBasedReferenceTypeDelegateFactory { | |||
} catch (IllegalAccessException illAccEx) { | |||
throw new IllegalStateException("Attempted to create Java 1.5 reflection based delegate but IllegalAccessException: " | |||
+ illAccEx + " occured"); | |||
} catch (NoSuchMethodException nsMethEx) { | |||
throw new IllegalStateException("Attempted to create Java 1.5 reflection based delegate but NoSuchMethodException: " | |||
+ nsMethEx + " occured"); | |||
} catch (InvocationTargetException invTargEx) { | |||
throw new IllegalStateException("Attempted to create Java 1.5 reflection based delegate but InvocationTargetException: " | |||
+ invTargEx + " occured"); | |||
} | |||
} | |||
@@ -8,6 +8,7 @@ | |||
* ******************************************************************/ | |||
package org.aspectj.weaver.reflect; | |||
import java.lang.reflect.InvocationTargetException; | |||
import java.util.Collections; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
@@ -116,16 +117,17 @@ public class ReflectionWorld extends World implements IReflectionWorld { | |||
AnnotationFinder annotationFinder = null; | |||
try { | |||
Class<?> java15AnnotationFinder = Class.forName("org.aspectj.weaver.reflect.Java15AnnotationFinder"); | |||
annotationFinder = (AnnotationFinder) java15AnnotationFinder.newInstance(); | |||
annotationFinder = (AnnotationFinder) java15AnnotationFinder.getDeclaredConstructor().newInstance(); | |||
annotationFinder.setClassLoader(loader); | |||
annotationFinder.setWorld(world); | |||
} catch (ClassNotFoundException ex) { | |||
// must be on 1.4 or earlier | |||
} catch (IllegalAccessException ex) { | |||
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException ex) { | |||
// not so good | |||
throw new BCException("AspectJ internal error", ex); | |||
} catch (InstantiationException ex) { | |||
throw new BCException("AspectJ internal error", ex); | |||
} | |||
catch (InvocationTargetException e) { | |||
e.printStackTrace(); | |||
} | |||
return annotationFinder; | |||
} |
@@ -68,7 +68,7 @@ public abstract class AbstractTrace implements Trace { | |||
@Override | |||
public void exit (String methodName, int i) { | |||
exit(methodName,new Integer(i)); | |||
exit(methodName, Integer.valueOf(i)); | |||
} | |||
@Override | |||
@@ -210,4 +210,4 @@ public abstract class AbstractTrace implements Trace { | |||
return args; | |||
} | |||
} | |||
} |
@@ -45,7 +45,7 @@ public abstract class TraceFactory { | |||
} | |||
else { | |||
Class factoryClass = Class.forName(factoryName); | |||
instance = (TraceFactory)factoryClass.newInstance(); | |||
instance = (TraceFactory)factoryClass.getDeclaredConstructor().newInstance(); | |||
} | |||
} | |||
catch (Throwable th) { | |||
@@ -58,7 +58,7 @@ public abstract class TraceFactory { | |||
if (instance == null) try { | |||
{ | |||
Class factoryClass = Class.forName("org.aspectj.weaver.tools.Jdk14TraceFactory"); | |||
instance = (TraceFactory)factoryClass.newInstance(); | |||
instance = (TraceFactory)factoryClass.getDeclaredConstructor().newInstance(); | |||
} | |||
} | |||
catch (Throwable th) { |
@@ -24,7 +24,7 @@ public abstract class PatternsTestCase extends TestCase { | |||
public URLClassLoader getClassLoaderForFile(File f) { | |||
try { | |||
URLClassLoader ucl = new URLClassLoader(new URL[] { f.toURL() }, this.getClass().getClassLoader()); | |||
URLClassLoader ucl = new URLClassLoader(new URL[] { f.toURI().toURL() }, this.getClass().getClassLoader()); | |||
return ucl; | |||
} catch (MalformedURLException mue) { | |||
throw new RuntimeException(mue); |
@@ -287,7 +287,7 @@ public class AjcTask extends MatchingTask { | |||
if (null != editorClassName) { | |||
ClassLoader cl = AjcTask.class.getClassLoader(); | |||
Class editorClass = cl.loadClass(editorClassName); | |||
editor = (ICommandEditor) editorClass.newInstance(); | |||
editor = (ICommandEditor) editorClass.getDeclaredConstructor().newInstance(); | |||
} | |||
} catch (Throwable t) { | |||
System.err.println("Warning: unable to load command editor"); | |||
@@ -865,7 +865,7 @@ public class AjcTask extends MatchingTask { | |||
public void setMessageHolderClass(String className) { | |||
try { | |||
Class mclass = Class.forName(className); | |||
IMessageHolder holder = (IMessageHolder) mclass.newInstance(); | |||
IMessageHolder holder = (IMessageHolder) mclass.getDeclaredConstructor().newInstance(); | |||
setMessageHolder(holder); | |||
} catch (Throwable t) { | |||
String m = "unable to instantiate message holder: " + className; | |||
@@ -889,7 +889,7 @@ public class AjcTask extends MatchingTask { | |||
public void setCommandEditorClass(String className) { // skip Ant interface? | |||
try { | |||
Class mclass = Class.forName(className); | |||
setCommandEditor((ICommandEditor) mclass.newInstance()); | |||
setCommandEditor((ICommandEditor) mclass.getDeclaredConstructor().newInstance()); | |||
} catch (Throwable t) { | |||
String m = "unable to instantiate command editor: " + className; | |||
throw new BuildException(m, t); |
@@ -92,7 +92,7 @@ public class Ajc extends DefaultCompilerAdapter { | |||
System.setErr(logstr); | |||
return (Integer) main.getMethod | |||
("compile", new Class[]{String[].class}).invoke | |||
(main.newInstance(), new Object[]{ | |||
(main.getDeclaredConstructor().newInstance(), new Object[]{ | |||
removeUnsupported(cline, logstr) | |||
}) == AJC_COMPILER_SUCCESS; | |||
} catch (Exception e) { |
@@ -40,13 +40,12 @@ import org.aspectj.util.Reflection; | |||
import jdiff.text.FileLine; | |||
import jdiff.util.Diff; | |||
import jdiff.util.DiffNormalOutput; | |||
import junit.framework.Assert; | |||
import org.junit.Assert; | |||
import junit.framework.AssertionFailedError; | |||
import junit.framework.Test; | |||
import junit.framework.TestCase; | |||
import junit.framework.TestResult; | |||
import junit.framework.TestSuite; | |||
import sun.net.www.ParseUtil; | |||
/** | |||
* Things that junit should perhaps have, but doesn't. Note the file-comparison methods require JDiff to run, but JDiff types are | |||
@@ -163,7 +162,7 @@ public final class TestUtil { | |||
public static URL fileToURL(File file) { | |||
try { | |||
return file.toURL(); | |||
return file.toURI().toURL(); | |||
} catch (MalformedURLException e) { | |||
return null; | |||
} | |||
@@ -303,7 +302,7 @@ public final class TestUtil { | |||
public static URL libURL(String rpath) { | |||
File file = libFile(rpath); | |||
try { | |||
return file.toURL(); | |||
return file.toURI().toURL(); | |||
} catch (MalformedURLException e) { | |||
throw new IllegalArgumentException("bad URL from: " + file); | |||
} |
@@ -53,7 +53,7 @@ public abstract class AutowiredXMLBasedAjcTestCase extends XMLBasedAjcTestCase { | |||
// wire the spec file | |||
try { | |||
final AutowiredXMLBasedAjcTestCase wired = (AutowiredXMLBasedAjcTestCase) testCaseClass.newInstance(); | |||
final AutowiredXMLBasedAjcTestCase wired = (AutowiredXMLBasedAjcTestCase) testCaseClass.getDeclaredConstructor().newInstance(); | |||
System.out.println("LOADING SUITE: " + wired.getSpecFile().getPath()); | |||
Digester d = wired.getDigester(); | |||
try { |
@@ -13,7 +13,6 @@ | |||
package org.aspectj.testing.harness.bridge; | |||
import java.util.ArrayList; | |||
import java.util.Arrays; | |||
import java.util.Iterator; | |||
import java.util.List; |
@@ -16,7 +16,7 @@ import java.util.Arrays; | |||
import org.aspectj.testing.util.LangUtil; | |||
import junit.framework.Assert; | |||
import org.junit.Assert; | |||
/** | |||
* Drivers to test a given set of Options. |
@@ -14,7 +14,7 @@ package org.aspectj.testing.util.options; | |||
import org.aspectj.testing.util.options.Option.InvalidInputException; | |||
import junit.framework.Assert; | |||
import org.junit.Assert; | |||
import junit.framework.TestCase; | |||
/** |
@@ -882,7 +882,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { | |||
Set<String> methodsFound = new HashSet<>(); | |||
StringBuffer debugString = new StringBuffer(); | |||
try { | |||
ClassLoader cl = new URLClassLoader(new URL[]{ajc.getSandboxDirectory().toURL()}); | |||
ClassLoader cl = new URLClassLoader(new URL[]{ajc.getSandboxDirectory().toURI().toURL()}); | |||
Class<?> clz = Class.forName(classname,false,cl); | |||
java.lang.reflect.Method[] ms = clz.getDeclaredMethods(); | |||
if (ms!=null) { |
@@ -105,7 +105,7 @@ public class Ajc186Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | |||
URLClassLoader ucl = new URLClassLoader(new URL[] {ajc.getSandboxDirectory().toURI().toURL()},this.getClass().getClassLoader()); | |||
Class<?> applicationClass = Class.forName("Application",false,ucl); | |||
assertNotNull(applicationClass); | |||
Object instance = applicationClass.newInstance(); | |||
Object instance = applicationClass.getDeclaredConstructor().newInstance(); | |||
Method works = applicationClass.getDeclaredMethod("fromInnerClass"); | |||
works.setAccessible(true); | |||
Runnable r = (Runnable) works.invoke(instance); |
@@ -11,7 +11,7 @@ import org.aspectj.apache.bcel.classfile.JavaClass; | |||
import org.aspectj.apache.bcel.classfile.Method; | |||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||
import junit.framework.Assert; | |||
import org.junit.Assert; | |||
import junit.framework.Test; | |||
/** |
@@ -280,7 +280,7 @@ public final class LazyClassGen { | |||
} | |||
public String getNewGeneratedNameTag() { | |||
return new Integer(childCounter++).toString(); | |||
return Integer.toString(childCounter++); | |||
} | |||
// ---- |
@@ -11,6 +11,7 @@ | |||
* ******************************************************************/ | |||
package org.aspectj.weaver.ltw; | |||
import java.lang.reflect.InvocationTargetException; | |||
import java.util.ArrayList; | |||
import java.util.Collections; | |||
import java.util.HashMap; | |||
@@ -179,10 +180,8 @@ public class LTWWorld extends BcelWorld implements IReflectionWorld { | |||
private static Map makeConcurrentMap() { | |||
if (concurrentMapClass != null) { | |||
try { | |||
return (Map) concurrentMapClass.newInstance(); | |||
} catch (InstantiationException ie) { | |||
} catch (IllegalAccessException iae) { | |||
} | |||
return (Map) concurrentMapClass.getDeclaredConstructor().newInstance(); | |||
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException ignored) {} | |||
// fall through if exceptions | |||
} | |||
return Collections.synchronizedMap(new HashMap()); |
@@ -49,7 +49,7 @@ public class ClassLoaderRepositoryTest extends TestCase { | |||
private ClassLoaderRepository setupRepository() throws Exception { | |||
ClassLoader cl = Thread.currentThread().getContextClassLoader(); | |||
ClassLoader res = new URLClassLoader(new URL[]{f.toURL()},cl); | |||
ClassLoader res = new URLClassLoader(new URL[]{f.toURI().toURL()},cl); | |||
ClassLoaderRepository rep = new ClassLoaderRepository(res); | |||
return rep; | |||
} |
@@ -21,7 +21,7 @@ import org.aspectj.weaver.patterns.PatternParser; | |||
import org.aspectj.weaver.patterns.Pointcut; | |||
import org.aspectj.weaver.patterns.PointcutRewriter; | |||
import junit.framework.Assert; | |||
import org.junit.Assert; | |||
import junit.framework.TestCase; | |||
/** |