Fix for JavaLookupTests>>testTypeOverloading development
authorvranyj1
Mon, 03 Dec 2012 19:28:28 +0000
branchdevelopment
changeset 1856 f2e8307a717f
parent 1855 71894fad1e4c
child 1857 3be42d7af017
Fix for JavaLookupTests>>testTypeOverloading
JavaLookupTests.st
Make.proto
ProxyMethodCompiler.st
ProxyMethodGuardNode.st
bc.mak
libjava.rc
stx_libjava.st
--- a/JavaLookupTests.st	Sun Dec 02 19:38:19 2012 +0000
+++ b/JavaLookupTests.st	Mon Dec 03 19:28:28 2012 +0000
@@ -92,6 +92,19 @@
     "Modified: / 29-10-2012 / 07:47:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!JavaLookupTests methodsFor:'running'!
+
+setUp
+    | md |
+
+    md := self javaTestClass methodDictionary.
+    md copy keysAndValuesDo:[:sel :m|
+        m isSynthetic ifTrue:[md removeKey: sel]
+    ].
+
+    "Created: / 03-12-2012 / 17:50:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !JavaLookupTests methodsFor:'support'!
 
 javaTestClass
@@ -245,22 +258,15 @@
 
 testTypeOverloading
     "test type overloading"
-    
-    self 
-        assert:(self javaTestClass new overloadedMethod: 1) = 4
+
+    self assert:(self javaTestClass new overloadedMethod: 1) = 4.
+    self assert:(self javaTestClass new overloadedMethod: 'Hi') = 3.
+    self assert:(self javaTestClass new overloadedMethod: 'Hi') = 3.
+    self assert:(self javaTestClass new overloadedMethod: 1) = 4.
 
     "Created: / 11-04-2011 / 20:02:54 / kursjan <kursjan@fit.cvut.cz>"
     "Modified: / 05-09-2011 / 21:37:53 / Jan Kurs <kursjan@fit.cvut.cz>"
-!
-
-testTypeOverloading2
-    "test type overloading"
-    
-    self 
-        assert:(self javaTestClass new overloadedMethod: 'Hi') = 3.
-
-    "Created: / 11-04-2011 / 20:02:54 / kursjan <kursjan@fit.cvut.cz>"
-    "Created: / 05-09-2011 / 21:37:57 / Jan Kurs <kursjan@fit.cvut.cz>"
+    "Modified (format): / 03-12-2012 / 17:45:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaLookupTests methodsFor:'tests - obsolete'!
--- a/Make.proto	Sun Dec 02 19:38:19 2012 +0000
+++ b/Make.proto	Mon Dec 03 19:28:28 2012 +0000
@@ -126,13 +126,13 @@
 
 prereq: $(REQUIRED_SUPPORT_DIRS)
 	cd ../libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
-	cd ../libdb/libodbc && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../libcomp && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../libdb && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../libboss && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../libdb/libodbc && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../libdb/libsqlite && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../libui && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
--- a/ProxyMethodCompiler.st	Sun Dec 02 19:38:19 2012 +0000
+++ b/ProxyMethodCompiler.st	Mon Dec 03 19:28:28 2012 +0000
@@ -173,7 +173,7 @@
 generate
     "Generate MethodNode for tree ProxyMethodNode tree"
 
-    | method body |
+    | method body stmts |
 
     method := MethodNode new.
     method arguments: args.
@@ -183,10 +183,23 @@
     ] ifTrue:[
         body := tree generate: self.
     ].
-    method statements: { body }.
+    body isStatementNode ifTrue:[
+        | stmt |
+
+        stmts := OrderedCollection new.
+        stmt := body.
+        [ stmt notNil ] whileTrue:[
+            stmts add: stmt.
+            stmt := stmt nextStatement.
+        ]
+    ] ifFalse:[
+        stmts := { body }
+    ].
+    method statements: stmts.
     ^method
 
     "Created: / 23-12-2011 / 13:40:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-12-2012 / 19:24:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ProxyMethodCompiler methodsFor:'node creation'!
--- a/ProxyMethodGuardNode.st	Sun Dec 02 19:38:19 2012 +0000
+++ b/ProxyMethodGuardNode.st	Mon Dec 03 19:28:28 2012 +0000
@@ -110,12 +110,23 @@
     "Generate a ParseNode that evaluate myself. Used for
      byte-compiling the proxies"
 
+    | first next  |
 
-    ^MessageNode
-        receiver: (condition generate: compiler)
-        selector: #ifTrue:ifFalse:
-        arg1: (BlockNode withExpression: (ReturnNode expression:(action generate: compiler)) in: nil)
-        arg2: (BlockNode withExpression: ("ReturnNode expression:"(fallback generate: compiler)) in: nil)
+    first := StatementNode new.
+    first expression:
+        (MessageNode
+            receiver: (condition generate: compiler)
+            selector: #ifTrue:
+            arg: (BlockNode withExpression: (ReturnNode expression:(action generate: compiler)) in: nil)).
+    next := fallback generate: compiler.
+    fallback isProxyMethodGuardNode ifFalse:[
+        next := ReturnNode expression: next.
+    ].
+    next isStatementNode ifFalse:[
+        next := StatementNode new expression: next.
+    ].
+    first nextStatement: next.
+    ^first.
 
     "
     ^(condition evaluateWithReceiver: receiver arguments: arguments) ifTrue:[
@@ -127,6 +138,7 @@
     "
 
     "Created: / 22-12-2011 / 09:26:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-12-2012 / 19:12:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ProxyMethodGuardNode methodsFor:'testing'!
--- a/bc.mak	Sun Dec 02 19:38:19 2012 +0000
+++ b/bc.mak	Mon Dec 03 19:28:28 2012 +0000
@@ -51,13 +51,13 @@
 # build all prerequisite packages for this package
 prereq:
 	pushd ..\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
-	pushd ..\libdb\libodbc & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\libcomp & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\libdb & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\libboss & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\libdb\libodbc & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\libdb\libsqlite & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\libui & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
--- a/libjava.rc	Sun Dec 02 19:38:19 2012 +0000
+++ b/libjava.rc	Mon Dec 03 19:28:28 2012 +0000
@@ -3,7 +3,7 @@
 // automagically generated from the projectDefinition: stx_libjava.
 //
 VS_VERSION_INFO VERSIONINFO
-  FILEVERSION     6,2,2229,2229
+  FILEVERSION     6,2,2232,2232
   PRODUCTVERSION  6,2,3,0
 #if (__BORLANDC__)
   FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
@@ -20,12 +20,12 @@
     BEGIN
       VALUE "CompanyName", "eXept Software AG & SWING Research Group\0"
       VALUE "FileDescription", "Java support for Smalltalk/X (LIB)\0"
-      VALUE "FileVersion", "6.2.2229.2229\0"
+      VALUE "FileVersion", "6.2.2232.2232\0"
       VALUE "InternalName", "stx:libjava\0"
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\nCopyright Jan Vrany, Jan Kurs and Marcel Hlopko\n          SWING Research Group, Czech Technical University In Prague\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Sun, 02 Dec 2012 13:39:52 GMT\0"
+      VALUE "ProductDate", "Mon, 03 Dec 2012 19:27:30 GMT\0"
     END
 
   END
--- a/stx_libjava.st	Sun Dec 02 19:38:19 2012 +0000
+++ b/stx_libjava.st	Mon Dec 03 19:28:28 2012 +0000
@@ -155,17 +155,17 @@
      exclude individual packages in the #excludedFromPrerequisites method."
 
     ^ #(
-        #'stx:goodies/sunit'    "TestResource - superclass of JavaInitializedResource "
-        #'stx:libbasic'    "Error - superclass of JavaInvalidRefError "
+        #'stx:goodies/sunit'    "TestAsserter - superclass of JavaAntProjectResource "
+        #'stx:libbasic'    "CharacterArray - superclass of extended String "
         #'stx:libbasic2'    "Socket - superclass of JavaSocket "
-        #'stx:libbasic3'    "MessageTracer - referenced by JavaMethod>>setBreakPoint "
-        #'stx:libcomp'    "VariableNode - referenced by ProxyMethodCompiler>>compile:arguments:selector: "
+        #'stx:libbasic3'    "WrappedMethod - extended "
+        #'stx:libcomp'    "SelfNode - referenced by ProxyMethodMethodInvocationNode>>generate: "
         #'stx:libhtml'    "URL - referenced by JavaEmbeddedFrameView>>setupAppletFrameIn:initializeJava: "
-        #'stx:libtool'    "WorkspaceApplication - referenced by GroovyEvaluator>>evaluate:in:receiver:notifying:logged:ifFail: "
-        #'stx:libview'    "DeviceGraphicsContext - superclass of JavaView "
-        #'stx:libview2'    "Plug - referenced by JavaSourceCodeCache>>findMethodLine:inMethods: "
-        #'stx:libwidg'    "Button - referenced by JavaVM class>>_WButtonPeer_create: "
-        #'stx:libwidg2'    "MenuPanel - referenced by JavaVM class>>processEvent: "
+        #'stx:libtool'    "DebugView - referenced by Java class>>flushClasses "
+        #'stx:libview'    "DisplaySurface - superclass of JavaPopUpView "
+        #'stx:libview2'    "GIFReader - referenced by JavaVM class>>_GifImageDecoder_parseImage: "
+        #'stx:libwidg'    "Scroller - referenced by JavaVM class>>processEvent: "
+        #'stx:libwidg2'    "ComboBoxView - referenced by JavaVM class>>processEvent: "
     )
 ! !