
package com.exedio.cope.instrument;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

/**
 * Represents a behavioral feature of a class parsed by the java parser.
 * May be either a method or a constructor.
 * @see Injector
 */
public abstract class JavaBehaviour extends JavaFeature
{
	
	/**
	 * Contains subsequently parameter types and names.
	 */
	protected final ArrayList parameters=new ArrayList();
	
	protected final List unmodifiableParameters=Collections.unmodifiableList(parameters);
	
	/**
	 * Contains all names given in the &quot;throws&quot; clause.
	 */
	private final ArrayList throwables=new ArrayList();
	
	public JavaBehaviour(JavaClass parent,
	int modifiers,
	String type,
	String name)
	throws InjectorParseException
	{
		// parent must not be null
		super(parent.file, parent, modifiers, type, name);
	}
	
	public void addParameter(String paramtype, String paramname)
	{
		parameters.add(paramtype);
		parameters.add(paramname);
	}
	
	public final List getParameters()
	{
		return unmodifiableParameters;
	}
	
	public final void addThrowable(String throwable)
	{
		throwables.add(throwable);
	}
	
	public final Iterator getThrowables()
	{
		return throwables.iterator();
	}
	
}

@@ -93,35 +93,8 @@
 ns;%0A
-import java.util.Iterator;%0A
 impo
@@ -112,16 +112,16 @@
 l.List;%0A
+
 %0A/**%0A * 
@@ -674,16 +674,29 @@
 haviour(
+%0A%09%09%09%09%09%09final 
 JavaClas
@@ -706,16 +706,27 @@
 arent,%0A%09
+%09%09%09%09%09final 
 int modi
@@ -733,16 +733,27 @@
 fiers,%0A%09
+%09%09%09%09%09final 
 String t
@@ -758,16 +758,27 @@
  type,%0A%09
+%09%09%09%09%09final 
 String n
@@ -1160,16 +1160,16 @@
 ble)%0A%09%7B%0A
+
 %09%09throwa
@@ -1198,85 +1198,6 @@
 %7D%0A%09%0A
-%09public final Iterator getThrowables()%0A%09%7B%0A%09%09return throwables.iterator();%0A%09%7D%0A%09%0A
 %7D%0A

remove getThrowables