JavaNativeMethod.st
branchopenjdk7-support
changeset 2046 3309a3bc8615
parent 2029 cdc3a79c8a58
child 2061 ea0e2d020aea
--- a/JavaNativeMethod.st	Fri Feb 08 05:19:39 2013 +0100
+++ b/JavaNativeMethod.st	Fri Feb 08 10:00:19 2013 +0100
@@ -382,14 +382,28 @@
     newStyleSel := ('_' , ((javaClass name copyReplaceAll:$/ with:$_) replaceAll:$$ with:$_), '_' , nm , ':' , args) asSymbol.    
     (JavaVM natives class canUnderstand: newStyleSel) ifTrue:[
         "Good, a JavaVM understands new style native selectors"
-        ^newStyleSel
+        "No checke whether the descriptor is the same."
+        | m a |
+
+        m := JavaVM natives class lookupMethodFor: newStyleSel.
+        a := m annotationsAt: #javanative:name:.
+        a do:[:each|
+            each arguments second = selector ifTrue:[
+                ^newStyleSel
+            ].
+        ].
+        m mclass == JavaVM natives class ifTrue:[
+            self breakPoint: #jv. "/no descriptor annotation!!!!!!"
+            ^newStyleSel.
+        ].
+
     ].
 
     self compileNativeImplementationStub: newStyleSel.
     ^newStyleSel
 
     "Created: / 19-01-2013 / 22:11:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 19-01-2013 / 23:39:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 08-02-2013 / 09:34:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaNativeMethod methodsFor:'private-compiler interface'!