Small fix, so JavaFields have their javaClass always set.
--- a/src/JavaClass.st Wed May 18 11:19:08 2011 +0000
+++ b/src/JavaClass.st Wed May 18 11:58:51 2011 +0000
@@ -1928,13 +1928,18 @@
[:each |
(each name = aJavaNameAndType name
and: [ each signature = aJavaNameAndType descriptor ]) ].
- result ifNotNil: [ ^ result ].
+ self breakPoint: #mh.
+ result ifNotNil:
+ [
+ ^ result ].
self superclass ~= JavaObject
- ifTrue: [ ^ self superclass lookupFieldByNameAndType: aJavaNameAndType ]
- ifFalse: [ ^ nil ].
+ ifTrue:
+ [^self superclass lookupFieldByNameAndType: aJavaNameAndType.
+ ]
+ ifFalse: [ ^ nil ].
"Created: / 11-04-2011 / 21:27:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
- "Modified: / 28-04-2011 / 22:31:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+ "Modified: / 18-05-2011 / 13:59:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!
lookupMethodByNameAndType: aJavaNameAndType
--- a/src/JavaClassReader.st Wed May 18 11:19:08 2011 +0000
+++ b/src/JavaClassReader.st Wed May 18 11:58:51 2011 +0000
@@ -740,6 +740,7 @@
| magic access_flags this_class_index super_class super_class_index realSuperClass this_class_ref existingSuperClass fields interfaces staticFields nStatic jSuperClass loader superClassName thisClassName existing_class thisMetaClass |
+
"/
"/ read magic, determine byte order
"/
@@ -902,7 +903,10 @@
self readMethodsFor: classBeingLoaded.
self readAttributesFor: classBeingLoaded.
- classBeingLoaded constantPool do: [:each | self updateOwnerInCPItem: each ].
+ classBeingLoaded constantPool
+ do: [:each | self updateOwnerInCPItem: each ].
+ classBeingLoaded fields do: [:each | self updateOwnerInField: each ].
+classBeingLoaded staticFields do: [:each | self updateOwnerInField: each ].
^ classBeingLoaded.
"
@@ -919,7 +923,7 @@
"Modified: / 15-10-2010 / 17:37:38 / Jan Kurs <kurs.jan@post.cz>"
"Modified: / 19-10-2010 / 21:43:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 28-01-2011 / 15:09:48 / Marcel Hlopko <hlopik@gmail.com>"
- "Modified: / 12-05-2011 / 17:40:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+ "Modified: / 18-05-2011 / 13:57:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!
readStream:aStream ignoring:classesBeingLoaded
@@ -2134,7 +2138,7 @@
readFieldInfofield
| access_flags name_index signature_index attributes_count field |
-
+ self breakPoint:#mh.
access_flags := inStream nextUnsignedShortMSB: msb.
name_index := inStream nextUnsignedShortMSB: msb.
signature_index := inStream nextUnsignedShortMSB: msb.
@@ -2162,7 +2166,7 @@
"Created: / 15-04-1996 / 15:38:43 / cg"
"Modified: / 15-10-1998 / 10:38:01 / cg"
"Modified: / 17-12-2010 / 18:44:30 / Marcel Hlopko <hlopik@gmail.com>"
- "Modified: / 01-04-2011 / 11:38:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+ "Modified: / 18-05-2011 / 13:53:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!
readFieldInfofields
@@ -2587,6 +2591,13 @@
ifTrue: [ each owner: classBeingLoaded ].
"Created: / 12-05-2011 / 17:40:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
+updateOwnerInField: each
+
+ each setClass: classBeingLoaded.
+
+ "Created: / 18-05-2011 / 13:57:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
! !
!JavaClassReader class methodsFor:'documentation'!
--- a/src/JavaResolver.st Wed May 18 11:19:08 2011 +0000
+++ b/src/JavaResolver.st Wed May 18 11:58:51 2011 +0000
@@ -165,7 +165,7 @@
!JavaResolver methodsFor:'common helpers'!
-checkPermissionsForMethodOrField: aJavaMethod from: accessingJavaClass to: resolvedJavaClass
+checkPermissionsForMethodOrField: aJavaMethodOrField from: accessingJavaClass to: resolvedJavaClass
"A class or interface C is accessible to a class or interface D if
and only if either of the following conditions are true:
C is public.
@@ -186,22 +186,22 @@
(self checkPermissionsFrom: accessingJavaClass to: resolvedJavaClass)
ifFalse: [ ^ false ].
- aJavaMethod isPublic ifTrue: [ ^ true ].
- ((aJavaMethod isProtected
- and: [ aJavaMethod javaClass = resolvedJavaClass ]) and:
+ aJavaMethodOrField isPublic ifTrue: [ ^ true ].
+ ((aJavaMethodOrField isProtected
+ and: [ aJavaMethodOrField javaClass = resolvedJavaClass ]) and:
[ (accessingJavaClass isSubclassOf: resolvedJavaClass)
or: [ accessingJavaClass = resolvedJavaClass ] ])
ifTrue: [ ^ true ].
- ((aJavaMethod isPrivate not
+ ((aJavaMethodOrField isPrivate not
and: [ resolvedJavaClass javaPackage = accessingJavaClass javaPackage ])
and: [ resolvedJavaClass classLoader = accessingJavaClass classLoader ])
ifTrue: [ ^ true ].
- (aJavaMethod isPrivate and: [ aJavaMethod javaClass = accessingJavaClass ])
- ifTrue: [ ^ true ].
+ (aJavaMethodOrField isPrivate
+ and: [ aJavaMethodOrField javaClass = accessingJavaClass ]) ifTrue: [ ^ true ].
^ false.
"Created: / 14-04-2011 / 14:19:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
- "Modified: / 14-04-2011 / 15:42:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+ "Modified: / 18-05-2011 / 13:51:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
! !
!JavaResolver methodsFor:'exceptions'!
--- a/src/stx_libjava.st Wed May 18 11:19:08 2011 +0000
+++ b/src/stx_libjava.st Wed May 18 11:58:51 2011 +0000
@@ -366,7 +366,7 @@
"Return a SVN revision number of myself.
This number is updated after a commit"
- ^ "$SVN-Revision:"'1138'"$"
+ ^ "$SVN-Revision:"'1139'"$"
! !
!stx_libjava class methodsFor:'file generation'!