/* *******************************************************************
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
* 2005 Contributors
- * All rights reserved.
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
* PARC initial implementation
- * Adrian Colyer, Andy Clement, overhaul for generics, Abraham Nevado
+ * Adrian Colyer, Andy Clement, overhaul for generics, Abraham Nevado
* ******************************************************************/
package org.aspectj.weaver;
* A World is a collection of known types and crosscutting members.
*/
public abstract class World implements Dump.INode {
-
+
/** handler for any messages produced during resolution etc. */
private IMessageHandler messageHandler = IMessageHandler.SYSTEM_ERR;
/** The level of the aspectjrt.jar the code we generate needs to run on */
public static final RuntimeVersion RUNTIME_LEVEL_DEFAULT = RuntimeVersion.V1_5;
private RuntimeVersion targetAspectjRuntimeLevel = RUNTIME_LEVEL_DEFAULT;
-
+
/** Flags for the new joinpoints that are 'optional': -Xjoinpoints:arrayconstruction -Xjoinpoints:synchronization */
- private boolean optionalJoinpoint_ArrayConstruction = false;
- private boolean optionalJoinpoint_Synchronization = false;
+ private boolean optionalJoinpoint_ArrayConstruction = false;
+ private boolean optionalJoinpoint_Synchronization = false;
private boolean addSerialVerUID = false;
/**
* When the world is operating in 1.5 mode, the TypeMap should only contain RAW types and never directly generic types. The RAW
* type will contain a reference to the generic type.
- *
+ *
* @param type a possibly generic type for which the raw needs creating as it is not currently in the world
* @return a type suitable for putting into the world
*/
/**
* Set the error and warning threashold which can be taken from CompilerOptions (see bug 129282)
- *
+ *
* @param errorThreshold
* @param warningThreshold
*/
public final static String xsetITD_VERSION_DEFAULT = xsetITD_VERSION_2NDGEN;
public final static String xsetMINIMAL_MODEL = "minimalModel";
public final static String xsetTARGETING_RUNTIME_1610 = "targetRuntime1_6_10";
-
+
// This option allows you to prevent AspectJ adding local variable tables - some tools (e.g. dex) may
// not like what gets created because even though it is valid, the bytecode they are processing has
// unexpected quirks that mean the table entries are violated in the code. See issue:
addedSinceLastDemote = new ArrayList<String>();
writtenClasses = new ArrayList<String>();
this.w = w;
- memoryProfiling = false;// !w.getMessageHandler().isIgnoring(Message.
- // INFO);
+ memoryProfiling = false;// !w.getMessageHandler().isIgnoring(Message.INFO);
}
// For testing
* expendable map where GC can claim them at some point later. Demotion means: the type is not an aspect, the type is not
* java.lang.Object, the type is not primitive and the type is not affected by type mungers in any way. Further refinements
* of these conditions may allow for more demotions.
- *
+ *
* @return number of types demoted
*/
public int demote(boolean atEndOfCompile) {
* cannot guarantee you are using the type variable in the same way as someone previously working with a similarly named
* type variable. So, these do not go into the map: - TypeVariableReferenceType. - ParameterizedType where a member type
* variable is involved. - BoundedReferenceType when one of the bounds is a type variable.
- *
+ *
* definition: "member type variables" - a tvar declared on a generic method/ctor as opposed to those you see declared on a
* generic type.
*/
}
return type;
}
- // this test should be improved - only avoid putting them in if one
- // of the
+ // this test should be improved - only avoid putting them in if one of the
// bounds is a member type variable
if (type instanceof BoundedReferenceType) {
if (debug) {
}
// TODO should this be in as a permanent assertion?
-
if ((type instanceof ReferenceType) && type.getWorld().isInJava5Mode()
&& (((ReferenceType) type).getDelegate() != null) && type.isGenericType()) {
throw new BCException("Attempt to add generic type to typemap " + type.toString() + " (should be raw)");
}
-
+
if (w.isExpendable(type)) {
if (useExpendableMap) {
/**
* Lookup a type by its signature, always look in the real map before the expendable map
- */
+ */
public ResolvedType get(String key) {
checkq();
ResolvedType ret = tMap.get(key);
s = p.getProperty(xsetDEBUG_STRUCTURAL_CHANGES_CODE, "false");
forDEBUG_structuralChangesCode = s.equalsIgnoreCase("true");
-
+
s = p.getProperty(xsetTRANSIENT_TJP_FIELDS,"false");
transientTjpFields = s.equalsIgnoreCase("true");
s = p.getProperty(xsetGENERATE_NEW_LVTS,"true");
generateNewLvts = s.equalsIgnoreCase("true");
if (!generateNewLvts) {
- getMessageHandler().handleMessage(MessageUtil.info("[generateNewLvts=false] for methods without an incoming local variable table, do not generate one"));
+ getMessageHandler().handleMessage(MessageUtil.info("[generateNewLvts=false] for methods without an incoming local variable table, do not generate one"));
}
-
+
s = p.getProperty(xsetOPTIMIZED_MATCHING, "true");
optimizedMatching = s.equalsIgnoreCase("true");
if (!optimizedMatching) {
ensureAdvancedConfigurationProcessed();
return runMinimalMemory;
}
-
+
public boolean isTransientTjpFields() {
ensureAdvancedConfigurationProcessed();
return transientTjpFields;
/**
* Register a new pointcut designator handler with the world - this can be used by any pointcut parsers attached to the world.
- *
+ *
* @param designatorHandler handler for the new pointcut
*/
public void registerPointcutHandler(PointcutDesignatorHandler designatorHandler) {
/**
* Determine if the named aspect requires a particular type around in order to be useful. The type is named in the aop.xml file
* against the aspect.
- *
+ *
* @return true if there is a type missing that this aspect really needed around
*/
public boolean hasUnsatisfiedDependency(ResolvedType aspectType) {
/**
* Returns the version of ITD that this world wants to create. The default is the new style (2) but in some cases where there
* might be a clash, the old style can be used. It is set through the option -Xset:itdVersion=1
- *
+ *
* @return the ITD version this world wants to create - 1=oldstyle 2=new, transparent style
*/
public int getItdVersion() {
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2019 Contributors
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.aspectj.systemtest.ajc193;
-
-import org.aspectj.apache.bcel.Constants;
-import org.aspectj.testing.XMLBasedAjcTestCase;
-import org.aspectj.testing.XMLBasedAjcTestCaseForJava12OrLater;
-
-import junit.framework.Test;
-
-/**
- * @author Andy Clement
- */
-public class Java12Tests extends XMLBasedAjcTestCaseForJava12OrLater {
-
- public void testSwitch1() {
- runTest("switch 1");
- checkVersion("Switch1", Constants.MAJOR_13, Constants.PREVIEW_MINOR_VERSION);
- }
-
- public void testSwitch2() {
- runTest("switch 2");
- checkVersion("Switch2", Constants.MAJOR_13, Constants.PREVIEW_MINOR_VERSION);
- }
-
- public void testSwitch3() {
- runTest("switch 3");
- checkVersion("Switch3", Constants.MAJOR_13, Constants.PREVIEW_MINOR_VERSION);
- }
- // ---
-
- public static Test suite() {
- return XMLBasedAjcTestCase.loadSuite(Java12Tests.class);
- }
-
- @Override
- protected java.net.URL getSpecFile() {
- return getClassResource("ajc193.xml");
- }
-
-}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2019 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc193;
+
+import org.aspectj.apache.bcel.Constants;
+import org.aspectj.testing.XMLBasedAjcTestCase;
+import org.aspectj.testing.XMLBasedAjcTestCaseForJava13OrLater;
+
+import junit.framework.Test;
+
+/**
+ * @author Andy Clement
+ */
+public class Java13Tests extends XMLBasedAjcTestCaseForJava13OrLater {
+
+ public void testSwitch1() {
+ runTest("switch 1");
+ checkVersion("Switch1", Constants.MAJOR_13, Constants.PREVIEW_MINOR_VERSION);
+ }
+
+ public void testSwitch2() {
+ runTest("switch 2");
+ checkVersion("Switch2", Constants.MAJOR_13, Constants.PREVIEW_MINOR_VERSION);
+ }
+
+ public void testSwitch3() {
+ runTest("switch 3");
+ checkVersion("Switch3", Constants.MAJOR_13, Constants.PREVIEW_MINOR_VERSION);
+ }
+ // ---
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(Java13Tests.class);
+ }
+
+ @Override
+ protected java.net.URL getSpecFile() {
+ return getClassResource("ajc193.xml");
+ }
+
+}