/*
 * Copyright (C) 2004-2006  exedio GmbH (www.exedio.com)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package com.exedio.cope.instrument;

import java.util.ArrayList;
import java.util.Collections;
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
 * 
 * @author Ralf Wiebicke
 */
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();
	
	JavaBehaviour(
						final JavaClass parent,
						final int modifiers,
						final String type,
						final String name)
	throws InjectorParseException
	{
		// parent must not be null
		super(parent.file, parent, modifiers, type, name);
	}
	
	void addParameter(String paramtype, String paramname)
	{
		parameters.add(paramtype);
		parameters.add(paramname);
	}
	
	final List getParameters()
	{
		return unmodifiableParameters;
	}
	
	final void addThrowable(String throwable)
	{
		throwables.add(throwable);
	}
	
}

@@ -1229,16 +1229,24 @@
 rrayList
+%3CString%3E
  paramet
@@ -1258,24 +1258,32 @@
 ew ArrayList
+%3CString%3E
 ();%0A%09%0A%09prote
@@ -1297,16 +1297,24 @@
 nal List
+%3CString%3E
  unmodif
@@ -1470,16 +1470,24 @@
 rrayList
+%3CString%3E
  throwab
@@ -1489,17 +1489,19 @@
 rowables
-=
+ = 
 new Arra
@@ -1505,16 +1505,24 @@
 rrayList
+%3CString%3E
 ();%0A%09%0A%09J
@@ -1895,16 +1895,24 @@
 nal List
+%3CString%3E
  getPara

fix warnings