You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tc...@apache.org on 2010/06/26 19:16:25 UTC
svn commit: r958247 [2/2] - in /commons/sandbox/javaflow/trunk: ./
src/main/java/org/apache/commons/javaflow/
src/main/java/org/apache/commons/javaflow/ant/
src/main/java/org/apache/commons/javaflow/bytecode/
src/main/java/org/apache/commons/javaflow/b...
Modified: commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/Subroutines.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/Subroutines.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/Subroutines.java (original)
+++ commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/Subroutines.java Sat Jun 26 17:16:23 2010
@@ -34,9 +34,10 @@ import org.apache.bcel.verifier.exc.Asse
import org.apache.bcel.verifier.exc.StructuralCodeConstraintException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.Set;
/**
@@ -56,8 +57,6 @@ import java.util.Set;
*
* WARNING! These classes are a fork of the bcel verifier.
*
- * @version $Id$
- * @author <A HREF="http://www.inf.fu-berlin.de/~ehaase"/>Enver Haase</A>
* @see #getTopLevel()
*/
public class Subroutines{
@@ -81,7 +80,7 @@ public class Subroutines{
private int localVariable = UNSET;
/** The instructions that belong to this subroutine. */
- private Set instructions;
+ private Set<InstructionHandle> instructions;
/*
* Refer to the Subroutine interface for documentation.
@@ -94,7 +93,7 @@ public class Subroutines{
* The JSR or JSR_W instructions that define this
* subroutine by targeting it.
*/
- private HashSet theJSRs = new HashSet();
+ private Set<InstructionHandle> theJSRs = new HashSet<InstructionHandle>();
/**
* The RET instruction that leaves this subroutine.
@@ -132,14 +131,12 @@ public class Subroutines{
* Sets the leaving RET instruction. Must be invoked after all instructions are added.
* Must not be invoked for top-level 'subroutine'.
*/
- void setLeavingRET(){
+ void setLeavingRET() {
if (localVariable == UNSET){
throw new AssertionViolatedException("setLeavingRET() called for top-level 'subroutine' or forgot to set local variable first.");
}
- Iterator iter = instructions.iterator();
InstructionHandle ret = null;
- while(iter.hasNext()){
- InstructionHandle actual = (InstructionHandle) iter.next();
+ for (final InstructionHandle actual : instructions) {
if (actual.getInstruction() instanceof RET){
if (ret != null){
throw new StructuralCodeConstraintException("Subroutine with more then one RET detected: '"+ret+"' and '"+actual+"'.");
@@ -166,7 +163,7 @@ public class Subroutines{
throw new AssertionViolatedException("getLeavingRET() called on top level pseudo-subroutine.");
}
InstructionHandle[] jsrs = new InstructionHandle[theJSRs.size()];
- return (InstructionHandle[]) (theJSRs.toArray(jsrs));
+ return theJSRs.toArray(jsrs);
}
/**
@@ -210,18 +207,17 @@ public class Subroutines{
/* Satisfies Subroutine.getRecursivelyAccessedLocalsIndices(). */
public int[] getRecursivelyAccessedLocalsIndices(){
- HashSet s = new HashSet();
+ final Set<Integer> s = new HashSet<Integer>();
int[] lvs = getAccessedLocalsIndices();
- for (int j=0; j<lvs.length; j++){
- s.add(new Integer(lvs[j]));
+ for (int j = 0; j < lvs.length; j++) {
+ s.add(lvs[j]);
}
_getRecursivelyAccessedLocalsIndicesHelper(s, this.subSubs());
+
int[] ret = new int[s.size()];
- Iterator i = s.iterator();
- int j=-1;
- while (i.hasNext()){
- j++;
- ret[j] = ((Integer) i.next()).intValue();
+ int j = 0;
+ for (final int v : s) {
+ ret[j++] = v;
}
return ret;
}
@@ -230,14 +226,14 @@ public class Subroutines{
* A recursive helper method for getRecursivelyAccessedLocalsIndices().
* @see #getRecursivelyAccessedLocalsIndices()
*/
- private void _getRecursivelyAccessedLocalsIndicesHelper(HashSet s, Subroutine[] subs){
- for (int i=0; i<subs.length; i++){
- int[] lvs = subs[i].getAccessedLocalsIndices();
- for (int j=0; j<lvs.length; j++){
- s.add(new Integer(lvs[j]));
+ private void _getRecursivelyAccessedLocalsIndicesHelper(Set<Integer> s, Subroutine[] subs){
+ for (final Subroutine sub : subs) {
+ for (final int lv : sub.getAccessedLocalsIndices()) {
+ s.add(lv);
}
- if(subs[i].subSubs().length != 0){
- _getRecursivelyAccessedLocalsIndicesHelper(s, subs[i].subSubs());
+
+ if(sub.subSubs().length != 0) {
+ _getRecursivelyAccessedLocalsIndicesHelper(s, sub.subSubs());
}
}
}
@@ -247,38 +243,33 @@ public class Subroutines{
*/
public int[] getAccessedLocalsIndices(){
//TODO: Implement caching.
- HashSet acc = new HashSet();
+ final Set<Integer> acc = new HashSet<Integer>();
if (theRET == null && this != TOPLEVEL){
throw new AssertionViolatedException("This subroutine object must be built up completely before calculating accessed locals.");
}
- Iterator i = instructions.iterator();
- while (i.hasNext()){
- InstructionHandle ih = (InstructionHandle) i.next();
+ for (final InstructionHandle ih : instructions) {
// RET is not a LocalVariableInstruction in the current version of BCEL.
if (ih.getInstruction() instanceof LocalVariableInstruction || ih.getInstruction() instanceof RET){
- int idx = ((IndexedInstruction) (ih.getInstruction())).getIndex();
- acc.add(new Integer(idx));
+ int idx = IndexedInstruction.class.cast(ih.getInstruction()).getIndex();
+ acc.add(idx);
// LONG? DOUBLE?.
- try{
+ try {
// LocalVariableInstruction instances are typed without the need to look into
// the constant pool.
- if (ih.getInstruction() instanceof LocalVariableInstruction){
- int s = ((LocalVariableInstruction) ih.getInstruction()).getType(null).getSize();
- if (s==2) acc.add(new Integer(idx+1));
+ if (ih.getInstruction() instanceof LocalVariableInstruction) {
+ int s = LocalVariableInstruction.class.cast(ih.getInstruction()).getType(null).getSize();
+ if (s == 2) acc.add(idx + 1);
}
- }
- catch(RuntimeException re){
+ } catch(final RuntimeException re) {
throw new AssertionViolatedException("Oops. BCEL did not like NULL as a ConstantPoolGen object.");
}
}
}
int[] ret = new int[acc.size()];
- i = acc.iterator();
- int j=-1;
- while (i.hasNext()){
- j++;
- ret[j] = ((Integer) i.next()).intValue();
+ int j = 0;
+ for (final int v : acc) {
+ ret[j++] = v;
}
return ret;
}
@@ -287,18 +278,16 @@ public class Subroutines{
* Satisfies Subroutine.subSubs().
*/
public Subroutine[] subSubs(){
- HashSet h = new HashSet();
-
- Iterator i = instructions.iterator();
- while (i.hasNext()){
- Instruction inst = ((InstructionHandle) i.next()).getInstruction();
+ final Set<Subroutine> h = new HashSet<Subroutine>();
+ for (final InstructionHandle ih : instructions){
+ final Instruction inst = ih.getInstruction();
if (inst instanceof JsrInstruction){
InstructionHandle targ = ((JsrInstruction) inst).getTarget();
h.add(getSubroutine(targ));
}
}
- Subroutine[] ret = new Subroutine[h.size()];
- return (Subroutine[]) h.toArray(ret);
+ final Subroutine[] ret = new Subroutine[h.size()];
+ return h.toArray(ret);
}
/*
@@ -307,7 +296,7 @@ public class Subroutines{
* This subroutine's RET operates on that same local variable
* slot, of course.
*/
- void setLocalVariable(int i){
+ void setLocalVariable(int i) {
if (localVariable != UNSET){
throw new AssertionViolatedException("localVariable set twice.");
}
@@ -319,10 +308,10 @@ public class Subroutines{
/**
* The default constructor.
*/
- public SubroutineImpl(){
+ public SubroutineImpl() {
}
- void setInstructions(Set _instructions) {
+ void setInstructions(final Set<InstructionHandle> _instructions) {
this.instructions = _instructions;
}
}// end Inner Class SubrouteImpl
@@ -332,7 +321,7 @@ public class Subroutines{
* Key: InstructionHandle of the leader of the subroutine.
* Elements: SubroutineImpl objects.
*/
- private Hashtable subroutines = new Hashtable();
+ private Map<InstructionHandle, Subroutine> subroutines = new HashMap<InstructionHandle, Subroutine>();
/**
* This is referring to a special subroutine, namely the
@@ -356,20 +345,18 @@ public class Subroutines{
TOPLEVEL = new SubroutineImpl();
// Calculate "real" subroutines.
- HashSet sub_leaders = new HashSet(); // Elements: InstructionHandle
- for (int i=0; i<all.length; i++){
- Instruction inst = all[i].getInstruction();
+ Set<InstructionHandle> sub_leaders = new HashSet<InstructionHandle>(); // Elements: InstructionHandle
+ for (final InstructionHandle ih : all) {
+ Instruction inst = ih.getInstruction();
if (inst instanceof JsrInstruction){
sub_leaders.add(((JsrInstruction) inst).getTarget());
}
}
// Build up the database.
- Iterator iter = sub_leaders.iterator();
- while (iter.hasNext()){
- SubroutineImpl sr = new SubroutineImpl();
- InstructionHandle astore = (InstructionHandle) (iter.next());
- sr.setLocalVariable( ((ASTORE) (astore.getInstruction())).getIndex() );
+ for (final InstructionHandle astore : sub_leaders){
+ final SubroutineImpl sr = new SubroutineImpl();
+ sr.setLocalVariable( ASTORE.class.cast(astore.getInstruction()).getIndex() );
subroutines.put(astore, sr);
}
@@ -382,35 +369,31 @@ public class Subroutines{
// since "Jsr 0" is disallowed in Pass 3a.
// Instructions shared by a subroutine and the toplevel are
// disallowed and checked below, after the BFS.
- for (int i=0; i<all.length; i++){
- Instruction inst = all[i].getInstruction();
+ for (final InstructionHandle ih : all){
+ Instruction inst = ih.getInstruction();
if (inst instanceof JsrInstruction){
InstructionHandle leader = ((JsrInstruction) inst).getTarget();
- ((SubroutineImpl) getSubroutine(leader)).addEnteringJsrInstruction(all[i]);
+ ((SubroutineImpl) getSubroutine(leader)).addEnteringJsrInstruction(ih);
}
}
// Now do a closure computation from every subroutine leader to find all the
// instructions that belong to a subroutine.
- HashSet instructions_assigned = new HashSet(); // we don't want to assign an instruction to two or more Subroutine objects.
-
- iter = sub_leaders.iterator();
- while (iter.hasNext()){
+ final Set<InstructionHandle> instructions_assigned = new HashSet<InstructionHandle>(); // we don't want to assign an instruction to two or more Subroutine objects.
+ for (final InstructionHandle leader : sub_leaders){
// set of InstructionHandles reachable from the top
- Set closure = new HashSet();
+ final Set<InstructionHandle> closure = new HashSet<InstructionHandle>();
// Init Queue. Start with the entry point of closure.
- InstructionHandle leader = (InstructionHandle) (iter.next());
- ArrayList Q = new ArrayList();
+ List<InstructionHandle> Q = new ArrayList<InstructionHandle>();
Q.add(leader);
- while (!Q.isEmpty()){
- while (!Q.isEmpty()){
- InstructionHandle u = (InstructionHandle) Q.remove(Q.size()-1);
- if(closure.add(u)) {
- InstructionHandle[] successors = getSuccessors(u);
- for (int i=0; i<successors.length; i++){
- Q.add(successors[i]);
+ while (!Q.isEmpty()) {
+ while (!Q.isEmpty()) {
+ InstructionHandle u = (InstructionHandle) Q.remove(Q.size() - 1);
+ if (closure.add(u)) {
+ for (final InstructionHandle successor : getSuccessors(u)) {
+ Q.add(successor);
}
}
}
@@ -424,22 +407,21 @@ public class Subroutines{
// "one instruction must be always in at-most one subroutine" JVM requirement
// guarantees that the entire protected region always belongs to the same closure,
// so just checking the start instruction is suffice.
- for( int i=0; i<handlers.length; i++ ) {
- if(closure.contains(handlers[i].getStartPC())) {
- InstructionHandle handlerPC = handlers[i].getHandlerPC();
- if(!closure.contains(handlerPC)) {
+ for(final CodeExceptionGen handler : handlers) {
+ if (closure.contains(handler.getStartPC())) {
+ InstructionHandle handlerPC = handler.getHandlerPC();
+ if (!closure.contains(handlerPC)) {
Q.add(handlerPC);
}
}
}
}
// DFS ended above.
- ((SubroutineImpl) (leader==all[0]?getTopLevel():getSubroutine(leader))).setInstructions(closure);
+ SubroutineImpl.class.cast(leader == all[0] ? getTopLevel() : getSubroutine(leader)).setInstructions(closure);
- for (Iterator itr = closure.iterator(); itr.hasNext();) {
- InstructionHandle h = (InstructionHandle) itr.next();
- if(!instructions_assigned.add(h)) {
- throw new StructuralCodeConstraintException("Instruction '"+h+"' is part of more than one subroutine (or of the top level and a subroutine).");
+ for (final InstructionHandle h : closure) {
+ if (!instructions_assigned.add(h)) {
+ throw new StructuralCodeConstraintException("Instruction '" + h + "' is part of more than one subroutine (or of the top level and a subroutine).");
}
}
@@ -454,7 +436,7 @@ public class Subroutines{
// This includes that subroutines may not call themselves
// recursively, even not through intermediate calls to other
// subroutines.
- noRecursiveCalls(getTopLevel(), new HashSet());
+ noRecursiveCalls(getTopLevel(), new HashSet<Integer>());
}
@@ -469,21 +451,18 @@ public class Subroutines{
*
* @throws StructuralCodeConstraintException if the above constraint is not satisfied.
*/
- private void noRecursiveCalls(Subroutine sub, HashSet set){
- Subroutine[] subs = sub.subSubs();
-
- for (int i=0; i<subs.length; i++){
- int index = ((RET) (subs[i].getLeavingRET().getInstruction())).getIndex();
-
- if (!set.add(new Integer(index))){
+ private void noRecursiveCalls(final Subroutine sub, final Set<Integer> set){
+ for (final Subroutine subSub : sub.subSubs()) {
+ int index = ((RET) (subSub.getLeavingRET().getInstruction())).getIndex();
+ if (!set.add(index)) {
// Don't use toString() here because of possibly infinite recursive subSubs() calls then.
- SubroutineImpl si = (SubroutineImpl) subs[i];
- throw new StructuralCodeConstraintException("Subroutine with local variable '"+si.localVariable+"', JSRs '"+si.theJSRs+"', RET '"+si.theRET+"' is called by a subroutine which uses the same local variable index as itself; maybe even a recursive call? JustIce's clean definition of a subroutine forbids both.");
+ final SubroutineImpl si = (SubroutineImpl)subSub;
+ throw new StructuralCodeConstraintException("Subroutine with local variable '" + si.localVariable + "', JSRs '" + si.theJSRs+"', RET '" + si.theRET + "' is called by a subroutine which uses the same local variable index as itself; maybe even a recursive call? JustIce's clean definition of a subroutine forbids both.");
}
- noRecursiveCalls(subs[i], set);
+ noRecursiveCalls(subSub, set);
- set.remove(new Integer(index));
+ set.remove(index);
}
}
@@ -521,12 +500,11 @@ public class Subroutines{
* @see #getTopLevel()
*/
public Subroutine subroutineOf(InstructionHandle any){
- Iterator i = subroutines.values().iterator();
- while (i.hasNext()){
- Subroutine s = (Subroutine) i.next();
- if (s.contains(any)) return s;
+ for (final Subroutine s : subroutines.values()) {
+ if (s.contains(any))
+ return s;
}
-System.err.println("DEBUG: Please verify '"+any+"' lies in dead code.");
+System.err.println("DEBUG: Please verify '" + any + "' lies in dead code.");
return null;
//throw new AssertionViolatedException("No subroutine for InstructionHandle found (DEAD CODE?).");
}
Modified: commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/UninitializedObjectType.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/UninitializedObjectType.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/UninitializedObjectType.java (original)
+++ commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/bytecode/transformation/bcel/analyser/UninitializedObjectType.java Sat Jun 26 17:16:23 2010
@@ -26,8 +26,6 @@ import org.apache.bcel.generic.*;
*
* WARNING! These classes are a fork of the bcel verifier.
*
- * @version $Id$
- * @author <A HREF="http://www.inf.fu-berlin.de/~ehaase"/>Enver Haase</A>
*/
public class UninitializedObjectType extends ReferenceType implements Constants {
Modified: commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/stores/JavaflowResourceStore.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/stores/JavaflowResourceStore.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/stores/JavaflowResourceStore.java (original)
+++ commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/stores/JavaflowResourceStore.java Sat Jun 26 17:16:23 2010
@@ -16,78 +16,19 @@
*/
package org.apache.commons.javaflow.stores;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import org.apache.bcel.Repository;
-import org.apache.bcel.util.ClassLoaderRepository;
import org.apache.commons.javaflow.bytecode.transformation.ResourceTransformer;
import org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer;
import org.apache.commons.jci.stores.MemoryResourceStore;
import org.apache.commons.jci.stores.ResourceStore;
-import org.apache.commons.jci.stores.TransactionalResourceStore;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-/**
- * Due to the BCEL dependency handling all
- * classes have to be store first and then
- * be rewritten. Otherwise we could just
- * delegate to the TransformingResourceStore
- *
- * @author tcurdt
- */
-public final class JavaflowResourceStore extends TransactionalResourceStore {
-
- private final static Log log = LogFactory.getLog(JavaflowResourceStore.class);
+public final class JavaflowResourceStore extends TransformingResourceStore {
- private final TransformingResourceStore tstore;
- private final Collection changes = new ArrayList();
-
public JavaflowResourceStore() {
this(new MemoryResourceStore());
}
public JavaflowResourceStore(final ResourceStore pStore) {
- super(pStore);
- tstore = new TransformingResourceStore(
- pStore,
- new ResourceTransformer[] { new AsmClassTransformer() }
- );
- Repository.setRepository(new ClassLoaderRepository(this.getClass().getClassLoader()));
- }
-
- public void write(final String pResourceName, final byte[] pResourceData) {
- super.write(pResourceName, pResourceData);
- changes.add(pResourceName);
- }
-
- public void onStart() {
- changes.clear();
+ super(pStore, new ResourceTransformer[] { new AsmClassTransformer() });
}
- public void onStop() {
- if (changes.size() > 0) {
- log.debug("rewriting" + changes);
-
- for (Iterator it = changes.iterator(); it.hasNext();) {
- final String clazzName = (String) it.next();
- try {
- final byte[] oldClazz = super.read(clazzName);
-
- if (oldClazz == null) {
- throw new ClassNotFoundException("could not find " + clazzName);
- }
-
- tstore.write(clazzName, oldClazz);
-
- log.debug("rewrote " + clazzName);
- } catch (ClassNotFoundException e) {
- log.error("", e);
- }
- }
-
- changes.clear();
- }
- }
}
Modified: commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/stores/TransformingResourceStore.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/stores/TransformingResourceStore.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/stores/TransformingResourceStore.java (original)
+++ commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/stores/TransformingResourceStore.java Sat Jun 26 17:16:23 2010
@@ -19,12 +19,7 @@ package org.apache.commons.javaflow.stor
import org.apache.commons.javaflow.bytecode.transformation.ResourceTransformer;
import org.apache.commons.jci.stores.ResourceStore;
-
-/**
- * @author tcurdt
- *
- */
-public final class TransformingResourceStore implements ResourceStore {
+public class TransformingResourceStore implements ResourceStore {
private final ResourceStore store;
private final ResourceTransformer[] transformers;
Modified: commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/CompositeTransformer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/CompositeTransformer.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/CompositeTransformer.java (original)
+++ commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/CompositeTransformer.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.utils;
import org.apache.commons.javaflow.bytecode.transformation.ResourceTransformer;
@@ -5,8 +21,6 @@ import org.apache.commons.javaflow.bytec
/**
* {@link ResourceTransformer} whose transformation
* is defined in terms of multiple {@link ResourceTransformer}s.
- *
- * @author Kohsuke Kawaguchi
*/
public class CompositeTransformer implements ResourceTransformer {
private final ResourceTransformer[] transformers;
Modified: commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/ReflectionUtils.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/ReflectionUtils.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/ReflectionUtils.java (original)
+++ commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/ReflectionUtils.java Sat Jun 26 17:16:23 2010
@@ -28,10 +28,6 @@ import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-/**
- * @author tcurdt
- *
- */
public final class ReflectionUtils {
private final static Log log = LogFactory.getLog(ReflectionUtils.class);
@@ -41,7 +37,7 @@ public final class ReflectionUtils {
}
public interface Indexer {
- void put(final Map pMap, final String pKey, final Object pObject);
+ void put(final Map<String, Object> pMap, final String pKey, final Object pObject);
}
private static Indexer defaultIndexer = new DefaultIndexer();
@@ -54,37 +50,37 @@ public final class ReflectionUtils {
}
public static class DefaultIndexer implements Indexer {
- public void put(final Map pMap, final String pKey, final Object pObject) {
+ public void put(final Map<String, Object> pMap, final String pKey, final Object pObject) {
pMap.put(pKey, pObject);
}
}
- public static Map discoverFields(
- final Class pClazz,
+ public static Map<String, Object> discoverFields(
+ final Class<?> pClazz,
final Matcher pMatcher
) {
return discoverFields(pClazz, pMatcher, defaultIndexer);
}
- public static Map discoverFields(
- final Class pClazz
+ public static Map<String, Object> discoverFields(
+ final Class<?> pClazz
) {
return discoverFields(pClazz, defaultMatcher, defaultIndexer);
}
- public static Map discoverFields(
- final Class pClazz,
+ public static Map<String, Object> discoverFields(
+ final Class<?> pClazz,
final Matcher pMatcher,
final Indexer pIndexer
) {
log.debug("discovering fields on " + pClazz.getName());
- final Map result = new HashMap();
+ final Map<String, Object> result = new HashMap<String, Object>();
- Class current = pClazz;
+ Class<?> current = pClazz;
do {
final Field[] fields = current.getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
@@ -102,32 +98,32 @@ public final class ReflectionUtils {
}
- public static Map discoverMethods(
- final Class pClazz,
+ public static Map<String, Object> discoverMethods(
+ final Class<?> pClazz,
final Matcher pMatcher
) {
return discoverMethods(pClazz, pMatcher, defaultIndexer);
}
- public static Map discoverMethods(
- final Class pClazz
+ public static Map<String, Object> discoverMethods(
+ final Class<?> pClazz
) {
return discoverMethods(pClazz, defaultMatcher, defaultIndexer);
}
- public static Map discoverMethods(
- final Class pClazz,
+ public static Map<String, Object> discoverMethods(
+ final Class<?> pClazz,
final Matcher pMatcher,
final Indexer pIndexer
) {
log.debug("discovering methods on " + pClazz.getName());
- final Map result = new HashMap();
+ final Map<String, Object> result = new HashMap<String, Object>();
- Class current = pClazz;
+ Class<?> current = pClazz;
do {
final Method[] methods = current.getDeclaredMethods();
for (int i = 0; i < methods.length; i++) {
Modified: commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/RewritingUtils.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/RewritingUtils.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/RewritingUtils.java (original)
+++ commons/sandbox/javaflow/trunk/src/main/java/org/apache/commons/javaflow/utils/RewritingUtils.java Sat Jun 26 17:16:23 2010
@@ -48,7 +48,7 @@ public final class RewritingUtils {
};
/*
- * @todo multiple transformers
+ * TODO multiple transformers
*/
public static void rewriteClassFile(
final File pInput,
@@ -176,7 +176,7 @@ public final class RewritingUtils {
ResourceTransformer transformer = new AsmClassTransformer();
for (int i=0; i<args.length; i+=2) {
- System.out.println("rewriting " + args[i]);
+ // System.out.println("rewriting " + args[i]);
RewritingUtils.rewriteJar(
new JarInputStream(new FileInputStream(args[i])),
@@ -185,7 +185,7 @@ public final class RewritingUtils {
);
}
- System.out.println("done");
+ // System.out.println("done");
}
}
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/AsmTestSuite.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/AsmTestSuite.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/AsmTestSuite.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/AsmTestSuite.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow;
import junit.framework.Test;
@@ -20,15 +36,13 @@ import org.apache.commons.javaflow.rewri
import org.apache.commons.javaflow.rewrite.Stack;
import org.apache.commons.javaflow.suite.SerializationTestCase;
import org.apache.commons.javaflow.suite.VerificationTestCase;
-import org.apache.commons.logging.LogFactory;
-import org.apache.commons.logging.impl.SimpleLog;
-public class AsmTestSuite extends TestSuite {
+public final class AsmTestSuite extends TestSuite {
public static Test suite() throws Exception {
- LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log", SimpleLog.class.getName());
- System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "debug");
+ // LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log", SimpleLog.class.getName());
+ // System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "debug");
final ClassTransformerClassLoader classloader =
new ClassTransformerClassLoader(
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/BcelTestSuite.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/BcelTestSuite.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/BcelTestSuite.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/BcelTestSuite.java Sat Jun 26 17:16:23 2010
@@ -1,58 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow;
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer;
-import org.apache.commons.javaflow.helper.ClassTransformerClassLoader;
-import org.apache.commons.javaflow.rewrite.BlackRed;
-import org.apache.commons.javaflow.rewrite.ClassAccess1;
-import org.apache.commons.javaflow.rewrite.ClassAccess2;
-import org.apache.commons.javaflow.rewrite.CounterFlow;
-import org.apache.commons.javaflow.rewrite.DefaultConstructor;
-import org.apache.commons.javaflow.rewrite.NewObject;
-import org.apache.commons.javaflow.rewrite.NoReference;
-import org.apache.commons.javaflow.rewrite.RewriteBugs;
-import org.apache.commons.javaflow.rewrite.Simple;
-import org.apache.commons.javaflow.rewrite.SimpleSerializable;
-import org.apache.commons.javaflow.rewrite.SimpleSynchronized;
-import org.apache.commons.javaflow.rewrite.SimpleTryCatch;
-import org.apache.commons.javaflow.rewrite.Stack;
-import org.apache.commons.javaflow.suite.SerializationTestCase;
-import org.apache.commons.javaflow.suite.VerificationTestCase;
-
-public class BcelTestSuite extends TestSuite {
+public final class BcelTestSuite extends TestSuite {
public static Test suite() throws Exception {
- final ClassTransformerClassLoader classloader =
- new ClassTransformerClassLoader(
- new BcelClassTransformer(),
- new Class[] { // instrument
- BlackRed.class,
- ClassAccess1.class,
- ClassAccess2.class,
- CounterFlow.class,
- DefaultConstructor.class,
- Simple.class,
- NewObject.class,
- NoReference.class,
- SimpleSerializable.class,
- RewriteBugs.class,
- SimpleTryCatch.class,
- SimpleSynchronized.class,
- Stack.class,
- },
- new Class[] { // load
- VerificationTestCase.class,
- SerializationTestCase.class
- }
- );
+// final ClassTransformerClassLoader classloader =
+// new ClassTransformerClassLoader(
+// new BcelClassTransformer(),
+// new Class[] { // instrument
+// BlackRed.class,
+// ClassAccess1.class,
+// ClassAccess2.class,
+// CounterFlow.class,
+// DefaultConstructor.class,
+// Simple.class,
+// NewObject.class,
+// NoReference.class,
+// SimpleSerializable.class,
+// RewriteBugs.class,
+// SimpleTryCatch.class,
+// SimpleSynchronized.class,
+// Stack.class,
+// },
+// new Class[] { // load
+// VerificationTestCase.class,
+// SerializationTestCase.class
+// }
+// );
final TestSuite suite = new TestSuite();
suite.setName("BCEL");
- suite.addTestSuite(classloader.loadClass(VerificationTestCase.class.getName()));
- suite.addTestSuite(classloader.loadClass(SerializationTestCase.class.getName()));
+ // BCEL is deprecated and the ASM implementation is moving on
+ // suite.addTestSuite(classloader.loadClass(VerificationTestCase.class.getName()));
+ // suite.addTestSuite(classloader.loadClass(SerializationTestCase.class.getName()));
return suite;
}
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/UsageTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/UsageTestCase.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/UsageTestCase.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/UsageTestCase.java Sat Jun 26 17:16:23 2010
@@ -1,11 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow;
import junit.framework.TestCase;
import org.apache.commons.javaflow.rewrite.Simple;
-
-
public final class UsageTestCase extends TestCase {
public void testIncorrectUsageWithNormalClassLoader() throws Exception {
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/helper/ClassTransformerClassLoader.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/helper/ClassTransformerClassLoader.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/helper/ClassTransformerClassLoader.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/helper/ClassTransformerClassLoader.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.helper;
import java.io.FileOutputStream;
@@ -13,20 +29,20 @@ import org.apache.commons.javaflow.bytec
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.util.ASMifierClassVisitor;
-public class ClassTransformerClassLoader extends BytecodeClassLoader {
+public final class ClassTransformerClassLoader extends BytecodeClassLoader {
private final ResourceTransformer transformer;
- private final Set instrument;
- private final Set load;
+ private final Set<String> instrument;
+ private final Set<String> load;
- public ClassTransformerClassLoader(final ResourceTransformer pTransformer, final Class[] pInstrument, final Class[] pLoad) {
+ public ClassTransformerClassLoader(final ResourceTransformer pTransformer, final Class<?>[] pInstrument, final Class<?>[] pLoad) {
- instrument = new HashSet(pInstrument.length);
+ instrument = new HashSet<String>(pInstrument.length);
for (int i = 0; i < pInstrument.length; i++) {
instrument.add(pInstrument[i].getName());
}
- load = new HashSet(pLoad.length);
+ load = new HashSet<String>(pLoad.length);
for (int i = 0; i < pLoad.length; i++) {
load.add(pLoad[i].getName());
}
@@ -38,7 +54,7 @@ public class ClassTransformerClassLoader
final byte[] oldClass = IOUtils.toByteArray(pClassStream);
final byte[] newClass = transformer.transform(oldClass);
-// CheckClassAdapter.verify(new ClassReader(newClass), true);
+ // CheckClassAdapter.verify(new ClassReader(newClass), true);
new ClassReader(oldClass).accept(
new ASMifierClassVisitor(
@@ -56,7 +72,7 @@ public class ClassTransformerClassLoader
}
- public Class loadClass( final String name ) throws ClassNotFoundException {
+ public Class<?> loadClass( final String name ) throws ClassNotFoundException {
final int i = name.indexOf('$');
final String key;
@@ -76,23 +92,23 @@ public class ClassTransformerClassLoader
final byte[] bytecode;
if (instrument.contains(key)) {
- System.err.println("Instrumenting: " + name);
+ // System.err.println("Instrumenting: " + name);
bytecode = transform(name, is);
} else {
- System.err.println("Loading: " + name);
+ // System.err.println("Loading: " + name);
bytecode = new ClassReader(is).b;
}
return super.defineClass(name, bytecode, 0, bytecode.length);
} catch (Throwable ex) {
- System.err.println("Load error: " + ex.toString());
+ // System.err.println("Load error: " + ex.toString());
ex.printStackTrace();
throw new ClassNotFoundException(name + " " + ex.getMessage(), ex);
}
}
- System.err.println("Delegating: " + name);
+ // System.err.println("Delegating: " + name);
return super.loadClass(name);
}
}
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/BlackRed.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/BlackRed.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/BlackRed.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/BlackRed.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import org.apache.commons.javaflow.Continuation;
@@ -8,9 +24,8 @@ import java.io.Serializable;
/**
* Test for making sure that rstack works correctly. For this test we need to
* have a stack frame that goes through multiple objects of different types.
- *
- * @author Kohsuke Kawaguchi
*/
+@SuppressWarnings("unused")
public final class BlackRed implements Runnable, Serializable {
private static final long serialVersionUID = 1L;
@@ -30,7 +45,7 @@ public final class BlackRed implements R
}
public void run() {
- String s = "foo"; // have some random variable
+ String s = "foo"; // have some random variable
r.run();
}
}
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess1.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess1.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess1.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess1.java Sat Jun 26 17:16:23 2010
@@ -1,7 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import org.apache.commons.javaflow.Continuation;
+@SuppressWarnings({ "unchecked", "unused" })
public final class ClassAccess1 implements Runnable {
public void run() {
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess2.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess2.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess2.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess2.java Sat Jun 26 17:16:23 2010
@@ -1,7 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import org.apache.commons.javaflow.Continuation;
+@SuppressWarnings("unused")
public final class ClassAccess2 implements Runnable {
public void run() {
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess3.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess3.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess3.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/ClassAccess3.java Sat Jun 26 17:16:23 2010
@@ -1,7 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import org.apache.commons.javaflow.Continuation;
+@SuppressWarnings("unchecked")
public final class ClassAccess3 implements Runnable {
/*
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/CounterFlow.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/CounterFlow.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/CounterFlow.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/CounterFlow.java Sat Jun 26 17:16:23 2010
@@ -1,11 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import org.apache.commons.javaflow.Continuation;
-
-/**
- * @author Kohsuke Kawaguchi
- */
public final class CounterFlow implements Runnable {
final int up;
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/DefaultConstructor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/DefaultConstructor.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/DefaultConstructor.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/DefaultConstructor.java Sat Jun 26 17:16:23 2010
@@ -1,6 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
-
public final class DefaultConstructor implements Runnable {
public DefaultConstructor() {
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Invoker.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Invoker.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Invoker.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Invoker.java Sat Jun 26 17:16:23 2010
@@ -1,6 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
-
public final class Invoker implements Runnable {
private Runnable runnable;
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NestedSynchronized.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NestedSynchronized.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NestedSynchronized.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NestedSynchronized.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import org.apache.commons.javaflow.Continuation;
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NewObject.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NewObject.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NewObject.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NewObject.java Sat Jun 26 17:16:23 2010
@@ -1,14 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import junit.framework.Assert;
-
/**
* Test that allocates a lot of new objects. Javaflow performs some tricky
* instrumentation on new object allocations, especially when it has arguments.
* Nesting object allocations makes it even more interesting.
- *
- * @author Kohsuke Kawaguchi
*/
public final class NewObject implements Runnable {
static char[] ch = { 'a', 'b', 'c'};
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NoReference.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NoReference.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NoReference.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NoReference.java Sat Jun 26 17:16:23 2010
@@ -1,8 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import org.apache.commons.javaflow.Continuation;
-
public final class NoReference implements Runnable {
public void run() {
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NullVariableMethodFlow.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NullVariableMethodFlow.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NullVariableMethodFlow.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/NullVariableMethodFlow.java Sat Jun 26 17:16:23 2010
@@ -1,11 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import java.util.Properties;
/**
* A regression test case for handling null in the local variables.
- *
- * @author Kohsuke Kawaguchi
*/
public class NullVariableMethodFlow implements Runnable {
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/RewriteBugs.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/RewriteBugs.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/RewriteBugs.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/RewriteBugs.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import java.lang.reflect.Array;
@@ -10,6 +26,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+@SuppressWarnings("unchecked")
public final class RewriteBugs implements Runnable {
public void run() {
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Simple.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Simple.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Simple.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Simple.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import org.apache.commons.javaflow.Continuation;
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleSerializable.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleSerializable.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleSerializable.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleSerializable.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import java.io.Serializable;
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleSynchronized.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleSynchronized.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleSynchronized.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleSynchronized.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import org.apache.commons.javaflow.Continuation;
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleTryCatch.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleTryCatch.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleTryCatch.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/SimpleTryCatch.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
import org.apache.commons.javaflow.Continuation;
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Stack.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Stack.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Stack.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/rewrite/Stack.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.rewrite;
/**
@@ -8,10 +24,8 @@ package org.apache.commons.javaflow.rewr
* there was a bug where we failed to expand the stack size appropriately.
*
* This is a regression test for that case.
- *
- *
- * @author Kohsuke Kawaguchi
*/
+@SuppressWarnings("unused")
public final class Stack implements Runnable {
public void run() {
final Object o = foo("abc","def");
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/SerializationTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/SerializationTestCase.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/SerializationTestCase.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/SerializationTestCase.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.suite;
import java.io.File;
@@ -19,7 +35,8 @@ import org.apache.commons.javaflow.rewri
import org.apache.commons.javaflow.rewrite.Simple;
import org.apache.commons.javaflow.rewrite.SimpleSerializable;
-public class SerializationTestCase extends TestCase {
+@SuppressWarnings("unchecked")
+public final class SerializationTestCase extends TestCase {
private File output;
Modified: commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/VerificationTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/VerificationTestCase.java?rev=958247&r1=958246&r2=958247&view=diff
==============================================================================
--- commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/VerificationTestCase.java (original)
+++ commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/VerificationTestCase.java Sat Jun 26 17:16:23 2010
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.javaflow.suite;
import junit.framework.TestCase;
@@ -17,7 +33,7 @@ import org.apache.commons.javaflow.rewri
import org.apache.commons.javaflow.rewrite.SimpleTryCatch;
import org.apache.commons.javaflow.rewrite.Stack;
-public class VerificationTestCase extends TestCase {
+public final class VerificationTestCase extends TestCase {
private boolean fromSuite() {
final String cl = this.getClass().getClassLoader().getClass().getName();