JavaClassRef2.st
changeset 2353 fa7400d022a0
parent 2299 5422b4bc941d
child 2380 9195eccdcbd9
child 2396 fadc6d7a2f5b
--- a/JavaClassRef2.st	Sat Feb 02 01:23:18 2013 +0100
+++ b/JavaClassRef2.st	Sat Feb 16 19:08:45 2013 +0100
@@ -1,11 +1,11 @@
 "
  COPYRIGHT (c) 1996-2011 by Claus Gittinger
+
+ New code and modifications done at SWING Research Group [1]:
+
  COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
                             SWING Research Group, Czech Technical University in Prague
 
- Parts of the code written by Claus Gittinger are under following
- license:
-
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
  inclusion of the above copyright notice.   This software may not
@@ -13,31 +13,10 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 
- Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the 'Software'), to deal in the Software without
- restriction, including without limitation the rights to use,
- copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following
- conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- [1] Code written at SWING Research Group contain a signature
-     of one of the above copright owners.
+ [1] Code written at SWING Research Group contains a signature
+     of one of the above copright owners. For exact set of such code,
+     see the differences between this version and version stx:libjava
+     as of 1.9.2010
 "
 "{ Package: 'stx:libjava' }"
 
@@ -53,12 +32,12 @@
 copyright
 "
  COPYRIGHT (c) 1996-2011 by Claus Gittinger
+
+ New code and modifications done at SWING Research Group [1]:
+
  COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
                             SWING Research Group, Czech Technical University in Prague
 
- Parts of the code written by Claus Gittinger are under following
- license:
-
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
  inclusion of the above copyright notice.   This software may not
@@ -66,31 +45,10 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 
- Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the 'Software'), to deal in the Software without
- restriction, including without limitation the rights to use,
- copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following
- conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- [1] Code written at SWING Research Group contain a signature
-     of one of the above copright owners.
+ [1] Code written at SWING Research Group contains a signature
+     of one of the above copright owners. For exact set of such code,
+     see the differences between this version and version stx:libjava
+     as of 1.9.2010
 
 "
 ! !
@@ -98,11 +56,10 @@
 !JavaClassRef2 class methodsFor:'instance creation'!
 
 in: aJavaConstantPool withNameAt: nameIndex
-   
-    
     ^ self basicNew initializeIn: aJavaConstantPool withNameAt: nameIndex.
 
     "Created: / 10-05-2011 / 14:56:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified (format): / 28-09-2012 / 23:01:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaClassRef2 methodsFor:'accessing'!
@@ -114,9 +71,24 @@
     "Modified: / 12-05-2011 / 18:32:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 !
 
+displayString
+    ^self name.
+
+    "Created: / 01-11-2011 / 15:29:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
+fullName
+
+    ^self javaClassName
+
+    "Created: / 08-04-2011 / 13:48:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 13-05-2011 / 09:59:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Created: / 30-10-2011 / 22:00:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 javaClass
 
-    valueCache ifNil:[self resolve].
+    valueCache isNil ifTrue:[self resolve].
     ^valueCache
 
     "Created: / 22-05-2011 / 14:02:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -189,26 +161,17 @@
     "Modified: / 10-05-2011 / 14:57:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 ! !
 
-!JavaClassRef2 methodsFor:'printing'!
-
-displayString
+!JavaClassRef2 methodsFor:'printing & storing'!
 
-    ^self name
-
-    "Created: / 14-08-2011 / 21:18:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
+printOn:aStream
+    "append a printed representation if the receiver to the argument, aStream"
 
-fullName
-    ^ self name.
-
-    "Created: / 10-05-2011 / 14:19:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-!
+    super printOn:aStream.
+    aStream nextPut:$(.
+    self name printOn: aStream.
+    aStream nextPut:$).
 
-printString
-    ^ 'JavaClassRef for: ' , self name printString.
-
-    "Created: / 10-05-2011 / 14:16:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-    "Modified: / 13-05-2011 / 10:00:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 30-10-2011 / 21:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaClassRef2 methodsFor:'private - resolving'!
@@ -224,10 +187,10 @@
 findResolvedValue
     "Resolve reference and set valueCache."
     
-    valueCache := JavaResolver uniqueInstance 
-                resolveClassIndentifiedByRef: self.
+    self findResolvedValue: true
 
     "Modified: / 08-04-2011 / 17:39:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 21-10-2011 / 10:58:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 findResolvedValue: doInit
@@ -242,6 +205,12 @@
 
 !JavaClassRef2 methodsFor:'queries'!
 
+isJavaClassOrStringRef
+    ^ true.
+
+    "Created: / 11-04-2011 / 19:10:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
 isJavaClassRef
 ^true.
 
@@ -251,17 +220,19 @@
 !JavaClassRef2 methodsFor:'resolving'!
 
 invalidateForClass: internalJavaClassName 
-    "Invalidate (means call invalidate) reference if it has something to do with given class (e.g Class named internalJavaClassName was unloaded).
-     Return true, if reference was invalidated."
+    "Invalidates receiver iff it refers (even indirectly)
+     to a class ref that has been resolved to given class.
+     Returns true, if the receiver has been invalidated,
+     false otherwise"
     
-    self name = internalJavaClassName 
-        ifTrue: 
-            [ 
-            self invalidate.
-            ^ true ].
+    self name = internalJavaClassName ifTrue: [ 
+        self invalidate.
+        ^ true 
+    ].
     ^ false.
 
     "Modified: / 23-05-2011 / 15:21:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified (format): / 21-02-2012 / 10:21:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 resolve
@@ -270,31 +241,20 @@
 
     "Created: / 08-04-2011 / 11:30:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Created: / 12-08-2011 / 22:18:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-resolve: doInit
-    "
-    Resolves a class. If doInit is true, then the class is initialuzed,
-    otherwise not.
-    "
-    
-    self isResolved ifFalse: [ self findResolvedValue: doInit ].
-    ^ valueCache.
-
-    "Created: / 08-04-2011 / 11:30:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-    "Created: / 12-08-2011 / 22:18:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaClassRef2 class methodsFor:'documentation'!
 
-version
-    ^ '$Header: /cvs/stx/stx/libjava/JavaClassRef2.st,v 1.3 2011-11-24 11:54:43 cg Exp $'
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libjava/JavaClassRef2.st,v 1.4 2013-02-16 18:08:32 vrany Exp $'
 !
 
-version_CVS
-    ^ '$Header: /cvs/stx/stx/libjava/JavaClassRef2.st,v 1.3 2011-11-24 11:54:43 cg Exp $'
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 !
 
 version_SVN
-    ^ '§Id: JavaClassRef2.st,v 1.1 2011/08/18 19:06:53 vrany Exp §'
+    ^ '§Id§'
 ! !
+