Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2010-05-18 18:03:07 -0400
committerStephan Herrmann2010-05-18 18:03:07 -0400
commitf5e39214a08f5ef77eb0970a3414ccdf09ed05ac (patch)
tree3bcb1065ecf62e4cf825d63f8f332f0d3de49569 /othersrc/OTRE
parent109893ea4b9a718bc03b6079b99c09a77066d579 (diff)
downloadorg.eclipse.objectteams-f5e39214a08f5ef77eb0970a3414ccdf09ed05ac.tar.gz
org.eclipse.objectteams-f5e39214a08f5ef77eb0970a3414ccdf09ed05ac.tar.xz
org.eclipse.objectteams-f5e39214a08f5ef77eb0970a3414ccdf09ed05ac.zip
clarifications re https://bugs.eclipse.org/311503 "hasRole(Object, class) getRole(Object, class) by (Sub-)type"
- updated source and OTJLD
Diffstat (limited to 'othersrc/OTRE')
-rw-r--r--othersrc/OTRE/src/org/objectteams/ITeam.java18
-rw-r--r--othersrc/OTRE/src/org/objectteams/Team.java8
2 files changed, 14 insertions, 12 deletions
diff --git a/othersrc/OTRE/src/org/objectteams/ITeam.java b/othersrc/OTRE/src/org/objectteams/ITeam.java
index 84b1cd0c2..b77c5f092 100644
--- a/othersrc/OTRE/src/org/objectteams/ITeam.java
+++ b/othersrc/OTRE/src/org/objectteams/ITeam.java
@@ -94,12 +94,12 @@ public interface ITeam {
*
* @param aBase any object, i.e., no checks are performed whether the base object's
* class is bound by any role class in this team.
- * @param roleClass Class instance specifying the required role type.
- * If this does not specify an existing role class an IllegalArgumentException will be thrown.
+ * @param roleType Class instance specifying the required role type.
* TODO (SH): is it legal to pass an unbound role class?
+ * @throws IllegalArgumentException if <code>roleType</code> does not represent a member type of this team.
* @return
*/
- public abstract boolean hasRole(Object aBase, Class<?> roleType);
+ public abstract boolean hasRole(Object aBase, Class<?> roleType) throws IllegalArgumentException;
/**
* Retrieve a role for a given base object.
@@ -116,11 +116,11 @@ public interface ITeam {
*
* @param aBase any object, i.e., no checks are performed whether the base object's
* class is bound by any role class in this team.
- * @param roleClass Class instance specifying the required role type.
- * If this does not specify an existing role class an IllegalArgumentException will be thrown.
+ * @param roleType Class instance specifying the required role type.
* @return
+ * @throws IllegalArgumentException if <code>roleType</code> does not represent a member type of this team.
*/
- public abstract <T> T getRole(Object aBase, Class<T> roleType);
+ public abstract <T> T getRole(Object aBase, Class<T> roleType) throws IllegalArgumentException;
/**
* Retrieve all bound roles registered in the current team.
@@ -147,8 +147,9 @@ public interface ITeam {
*
* @param roleType must be a top-most bound role of this team.
* @return a non-null array.
+ * @throws IllegalArgumentException if <code>roleType</code> does not represent a member type of this team.
*/
- public abstract <T> T[] getAllRoles(Class<T> roleType);
+ public abstract <T> T[] getAllRoles(Class<T> roleType) throws IllegalArgumentException;
/**
* Query whether any role instance of this team instance is currently executing a
@@ -171,8 +172,9 @@ public interface ITeam {
*
* @param aRole
* @param roleType
+ * @throws IllegalArgumentException if <code>roleType</code> does not represent a member type of this team.
*/
- public abstract void unregisterRole(Object aRole, Class<?> roleType);
+ public abstract void unregisterRole(Object aRole, Class<?> roleType) throws IllegalArgumentException;
/**
* Not API.
diff --git a/othersrc/OTRE/src/org/objectteams/Team.java b/othersrc/OTRE/src/org/objectteams/Team.java
index 1968c991a..fe0a5145a 100644
--- a/othersrc/OTRE/src/org/objectteams/Team.java
+++ b/othersrc/OTRE/src/org/objectteams/Team.java
@@ -414,7 +414,7 @@ public /* team */ class Team implements ITeam {
/**
* {@inheritDoc}
*/
- public boolean hasRole(Object aBase, Class<?> roleType) {
+ public boolean hasRole(Object aBase, Class<?> roleType) throws IllegalArgumentException {
// overriding method to be generated by the compiler for each team with bound roles.
throw new IllegalArgumentException("No such bound role type in this team: "+roleType.getName());
}
@@ -430,7 +430,7 @@ public /* team */ class Team implements ITeam {
/**
* {@inheritDoc}
*/
- public <T> T getRole(Object aBase, Class<T> roleType) {
+ public <T> T getRole(Object aBase, Class<T> roleType) throws IllegalArgumentException {
// overriding method to be generated by the compiler for each team with bound roles.
return null;
}
@@ -446,7 +446,7 @@ public /* team */ class Team implements ITeam {
/**
* {@inheritDoc}
*/
- public <T> T[] getAllRoles(Class<T> roleType) {
+ public <T> T[] getAllRoles(Class<T> roleType) throws IllegalArgumentException {
// overriding method to be generated by the compiler for each team with bound roles.
throw new IllegalArgumentException("Class org.objectteams.Team has no bound roles.");
}
@@ -480,7 +480,7 @@ public /* team */ class Team implements ITeam {
/**
* {@inheritDoc}
*/
- public void unregisterRole(Object aRole, Class<?> roleType) {
+ public void unregisterRole(Object aRole, Class<?> roleType) throws IllegalArgumentException {
// overriding method to be generated by the compiler for each team with bound roles.
}

Back to the top