Javassist CtMethod.make() gives "syntax error" on array initialization using empty brackets -


i using javassist build runtime class. creating ctmethod:

ctmethod m = ctmethod.make(constructmethodsource, bclass); 

inside "constructmethodsource" line legitimate line of java code:

java.lang.object[] args = new java.lang.object[] {}; 

with that, make() throws syntax error:

[source error] syntax error near "bject[] {};" 

i played , instead initialized empty array different way:

java.lang.object[] args = new java.lang.object[0]; 

that made javassist happy i'm wondering why javassist choke on first line? known limitation or bug or doing foolish?

having looked this, best answer can come bug of omission. according documentation "should work", doesn't. luckily workaround trivial, initialize arrays "new object[0];".


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -