Mantis - Quercus
Viewing Issue Advanced Details
4148 minor always 07-30-10 03:40 03-22-12 13:41
andrew_miah  
 
normal  
feedback 4.0.9  
open  
none    
none  
0004148: Java String variable argument lists.
Invoking a java method expecting a variable length list of Strings:

public void myMethod( String... params ) {
...
}

Causes the following to be reported from Quercus:

Fatal Error: Can't assign Some-Text with type class com.caucho.quercus.env.ConstStringValue to class java.lang.String
Changing the Java method to accept "Object..." resolves the problem.

Notes
(0005262)
domdorn   
05-19-11 08:56   
please post some demo code on how you're using this.
(0005270)
andrew_miah   
05-20-11 03:45   
Hello Dominic,

The code I'm having problems with is fairly well embedded in our source, though this is the simplest I can provide:

// Java:
public class Helper {
 // This works.
 public void test1( Object... args ) {}

 // This doesn't.
 public void test2( String... args ) {}
}

// PHP:
<?php
 import Helper;
 $helper = new Helper();

 // This works.
 $helper->test1();

 // This fails with Fatal Error: Can't assign a with type class com.caucho.quercus.env.ConstStringValue to class java.lang.String
 $helper->test2();
?>


BR,
Andrew.