Allow inheriting the transport hint from the containing class.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5100 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -210,6 +210,10 @@ public class GenDObjectTask extends Task
|
|||||||
|
|
||||||
// determine the type of transport
|
// determine the type of transport
|
||||||
TransportHint hint = f.getAnnotation(TransportHint.class);
|
TransportHint hint = f.getAnnotation(TransportHint.class);
|
||||||
|
if (hint == null) {
|
||||||
|
// inherit hint from class annotation
|
||||||
|
hint = f.getDeclaringClass().getAnnotation(TransportHint.class);
|
||||||
|
}
|
||||||
String transport;
|
String transport;
|
||||||
if (hint == null) {
|
if (hint == null) {
|
||||||
transport = "DEFAULT";
|
transport = "DEFAULT";
|
||||||
|
|||||||
@@ -256,6 +256,10 @@ public abstract class InvocationTask extends Task
|
|||||||
public String getTransport ()
|
public String getTransport ()
|
||||||
{
|
{
|
||||||
TransportHint hint = method.getAnnotation(TransportHint.class);
|
TransportHint hint = method.getAnnotation(TransportHint.class);
|
||||||
|
if (hint == null) {
|
||||||
|
// inherit hint from interface annotation
|
||||||
|
hint = method.getDeclaringClass().getAnnotation(TransportHint.class);
|
||||||
|
}
|
||||||
if (hint == null) {
|
if (hint == null) {
|
||||||
return "Transport.DEFAULT";
|
return "Transport.DEFAULT";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user