summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java8
-rw-r--r--sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/MockedResource.java2
-rw-r--r--sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/Resource.java2
-rw-r--r--sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/ResourceWrapper.java4
-rw-r--r--sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGeneratorTestCase.java2
5 files changed, 12 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java b/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java
index c9fc8aafe3..4209ee92f6 100644
--- a/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java
+++ b/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java
@@ -101,9 +101,15 @@ public class RootResourceClassGenerator implements Opcodes {
mv.visitCode();
mv.visitFieldInsn(GETSTATIC, className, DELEGATE_FIELD, getSignature(interfaceName));
Class<?>[] paramTypes = method.getParameterTypes();
+ int index = 1;
for (int i = 0; i < paramTypes.length; i++) {
String signature = Type.getDescriptor(paramTypes[i]);
- mv.visitVarInsn(CodeGenerationHelper.getLoadOPCode(signature), i + 1);
+ mv.visitVarInsn(CodeGenerationHelper.getLoadOPCode(signature), index);
+ if(paramTypes[i] == long.class || paramTypes[i] == double.class) {
+ index+=2; // Increase the index by 2 for the 64bit numbers
+ } else {
+ index++;
+ }
}
mv.visitMethodInsn(INVOKEINTERFACE, interfaceName, method.getName(), methodDescriptor);
diff --git a/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/MockedResource.java b/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/MockedResource.java
index 7940a9e145..54516f951d 100644
--- a/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/MockedResource.java
+++ b/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/MockedResource.java
@@ -32,7 +32,7 @@ public class MockedResource implements Resource {
return value;
}
- public void create(String value) {
+ public void create(long id, String value) {
this.value = value;
}
diff --git a/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/Resource.java b/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/Resource.java
index 00d0fe9264..8054abf540 100644
--- a/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/Resource.java
+++ b/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/Resource.java
@@ -42,7 +42,7 @@ public interface Resource {
void update(String value);
@POST
- void create(String value);
+ void create(long id, String value);
@DELETE
void delete();
diff --git a/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/ResourceWrapper.java b/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/ResourceWrapper.java
index 40e0bf7d2a..55e725f8b9 100644
--- a/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/ResourceWrapper.java
+++ b/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/ResourceWrapper.java
@@ -39,8 +39,8 @@ public class ResourceWrapper implements Resource {
return delegate.get();
}
- public void create(String value) {
- delegate.create(value);
+ public void create(long id, String value) {
+ delegate.create(id, value);
}
public void delete() {
diff --git a/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGeneratorTestCase.java b/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGeneratorTestCase.java
index 0a761df6b8..40c70b8d6a 100644
--- a/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGeneratorTestCase.java
+++ b/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGeneratorTestCase.java
@@ -74,7 +74,7 @@ public class RootResourceClassGeneratorTestCase {
Resource resourceProxy = (Resource)cls.newInstance();
Assert.assertNull(resourceProxy.get());
- resourceProxy.create("123");
+ resourceProxy.create(1l, "123");
Assert.assertEquals("123", resourceProxy.get());
resourceProxy.update("ABC");
Assert.assertEquals("ABC", resourceProxy.get());