some possibly useful methods :) development
authorhlopkmar
Wed, 12 Dec 2012 23:20:03 +0000
branchdevelopment
changeset 1868 6f55db58b3af
parent 1867 cd4ec4fbe798
child 1869 0ae14ac1c9af
some possibly useful methods :)
Java.st
JavaAntProjectResource.st
JavaByteCodeProcessorTests.st
JavaClass.st
JavaRefsAndConstantPoolTestCase.st
JavaTestCaseProxy.st
Make.proto
bc.mak
bmake.bat
extensions.st
libjava.rc
mingwmake.bat
stx_libjava.st
vcmake.bat
--- a/Java.st	Tue Dec 11 23:15:40 2012 +0000
+++ b/Java.st	Wed Dec 12 23:20:03 2012 +0000
@@ -780,6 +780,12 @@
     "Modified: / 02-08-2012 / 21:59:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+classPathAsString
+    ^ (self classPath collect: [ :each | each pathName ]) asStringWith: $:.
+
+    "Created: / 12-12-2012 / 23:55:00 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
+!
+
 effectiveClassPath
     ^self effectiveClassPathForRelease: Release
 
@@ -1732,16 +1738,11 @@
 !Java class methodsFor:'documentation'!
 
 version
-    ^ '$Header$'
-!
-
-version_HG
-
-    ^ '$Changeset: <not expanded> $'
+    ^ '$Id$'
 !
 
 version_SVN
-    ^ '§Id§'
+    ^ '$Id$'
 
 ! !
 
--- a/JavaAntProjectResource.st	Tue Dec 11 23:15:40 2012 +0000
+++ b/JavaAntProjectResource.st	Wed Dec 12 23:20:03 2012 +0000
@@ -184,5 +184,5 @@
 !JavaAntProjectResource class methodsFor:'documentation'!
 
 version_SVN
-    ^ '§Id§'
+    ^ '$Id$'
 ! !
--- a/JavaByteCodeProcessorTests.st	Tue Dec 11 23:15:40 2012 +0000
+++ b/JavaByteCodeProcessorTests.st	Wed Dec 12 23:20:03 2012 +0000
@@ -114,5 +114,5 @@
 !JavaByteCodeProcessorTests class methodsFor:'documentation'!
 
 version_SVN
-    ^ '§Id§'
+    ^ '$Id$'
 ! !
--- a/JavaClass.st	Tue Dec 11 23:15:40 2012 +0000
+++ b/JavaClass.st	Wed Dec 12 23:20:03 2012 +0000
@@ -1320,6 +1320,19 @@
     "Created: 22.3.1997 / 14:35:43 / cg"
 !
 
+fileOutInto: directory 
+    "writes itself into the given directory including package hierarchy"
+    
+    | packageDir |
+    packageDir := directory / self javaPackageAsDirname.
+    packageDir recursiveMakeDirectory.
+    packageDir / (self lastName , '.java') 
+        writingFileDo: [:out | self fileOutOn: out ].
+
+    "Created: / 08-12-2012 / 22:32:19 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
+    "Modified: / 09-12-2012 / 09:07:58 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
+!
+
 fileOutMethod:aMethod on:aStream
     "file out aMethod onto aStream. Used for example to write individual changeChunks"
 
@@ -1362,6 +1375,12 @@
 
     "Created: / 05-09-2012 / 00:01:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 07-11-2012 / 23:43:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+fileOutOn: aWriteStream
+aWriteStream nextPutAll: self theNonMetaclass source.
+
+    "Created: / 08-12-2012 / 22:25:28 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
 ! !
 
 !JavaClass methodsFor:'interop support'!
@@ -2672,16 +2691,11 @@
 !JavaClass class methodsFor:'documentation'!
 
 version
-    ^ '$Header$'
-!
-
-version_HG
-
-    ^ '$Changeset: <not expanded> $'
+    ^ '$Id$'
 !
 
 version_SVN
-    ^ '§Id§'
+    ^ '$Id$'
 ! !
 
 JavaClass initialize!
--- a/JavaRefsAndConstantPoolTestCase.st	Tue Dec 11 23:15:40 2012 +0000
+++ b/JavaRefsAndConstantPoolTestCase.st	Wed Dec 12 23:20:03 2012 +0000
@@ -347,7 +347,7 @@
 !
 
 version_SVN
-    ^ '§Id§'
+    ^ '$Id$'
 ! !
 
 !JavaRefsAndConstantPoolTestCase::JavaExceptionThrowerMock methodsFor:'exceptions'!
@@ -396,5 +396,5 @@
 !JavaRefsAndConstantPoolTestCase class methodsFor:'documentation'!
 
 version_SVN
-    ^ '§Id§'
+    ^ '$Id$'
 ! !
--- a/JavaTestCaseProxy.st	Tue Dec 11 23:15:40 2012 +0000
+++ b/JavaTestCaseProxy.st	Wed Dec 12 23:20:03 2012 +0000
@@ -201,7 +201,7 @@
 !JavaTestCaseProxy class methodsFor:'documentation'!
 
 version_SVN
-    ^ '§Id§'
+    ^ '$Id$'
 ! !
 
 JavaTestCaseProxy initialize!
--- a/Make.proto	Tue Dec 11 23:15:40 2012 +0000
+++ b/Make.proto	Wed Dec 12 23:20:03 2012 +0000
@@ -88,7 +88,7 @@
 		echo -n exported > .svnversion; \
 	fi
 
-stx_libjava.o: stx_libjava.st .svnversion
+stx_libjava.o: stx_libjava.st .svnversion 
 	@if [ -d .svn ]; then \
 		rev2="$(shell printf "%-16s" $$(cat .svnversion))"; \
 		echo "  [SV]  Expanding svnRevisionNo in $1.st"; \
@@ -97,18 +97,11 @@
 	$(MAKE) CC="$(CLASSLIB_CC)" OPT="$(OPT)" SEPINITCODE="$(SEPINITCODE)" STC="$(STC)" STFILE=.stx_libjava.svn $(C_RULE);
 	sed -i -e "s/\".stx_libjava.svn.st\");/\"\stx_libjava.st\");/g" .stx_libjava.svn.c
 	$(MAKE) .stx_libjava.svn.$(O)
-	@mv .stx_libjava.svn.$(O) stx_libjava.$(O)
+	@mv .stx_libjava.svn.$(O) stx_libjava.$(O) 
 endif
 
 
 
-# Enforce recompilation of package definition class if Mercurial working
-# copy state changes. Together with --guessVersion it ensures that package
-# definition class always contains correct binary revision string.
-ifneq (**NOHG**, $(shell hg root 2> /dev/null || echo -n '**NOHG**'))
-stx_libjava.$(O): $(shell hg root)/.hg/dirstate
-endif
-
 
 
 
--- a/bc.mak	Tue Dec 11 23:15:40 2012 +0000
+++ b/bc.mak	Wed Dec 12 23:20:03 2012 +0000
@@ -92,9 +92,11 @@
 
 
 
+
+
 test: $(TOP)\goodies\builder\reports\NUL
 	pushd $(TOP)\goodies\builder\reports & $(MAKE_BAT)
-	$(TOP)\goodies\builder\reports\report-runner.bat -D . -r Builder::TestReport -p $(PACKAGE)
+	$(TOP)\goodies\builder\reports\report-runner.bat -D . -r Builder::TestReport -p $(PACKAGE)        
 
 # BEGINMAKEDEPEND --- do not remove this line; make depend needs it
 $(OUTDIR)GroovyCompiler.$(O) GroovyCompiler.$(H): GroovyCompiler.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -217,12 +219,3 @@
 $(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\libbasic\Behavior.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic2\BooleanArray.$(H) $(INCLUDE_TOP)\stx\libbasic2\BitArray.$(H) $(INCLUDE_TOP)\stx\libbasic\ArrayedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\CharacterArray.$(H) $(INCLUDE_TOP)\stx\libbasic\ByteArray.$(H) $(INCLUDE_TOP)\stx\libbasic\UninterpretedBytes.$(H) $(INCLUDE_TOP)\stx\libbasic\Delay.$(H) $(INCLUDE_TOP)\stx\libbasic\Process.$(H) $(INCLUDE_TOP)\stx\libbasic\Link.$(H) $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\SmallInteger.$(H) $(INCLUDE_TOP)\stx\libbasic\Integer.$(H) $(INCLUDE_TOP)\stx\libbasic\Number.$(H) $(INCLUDE_TOP)\stx\libbasic\ArithmeticValue.$(H) $(INCLUDE_TOP)\stx\libbasic\Magnitude.$(H) $(INCLUDE_TOP)\stx\libbasic\String.$(H) $(INCLUDE_TOP)\stx\libbasic\UserPreferences.$(H) $(INCLUDE_TOP)\stx\libbasic\IdentityDictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Dictionary.$(H) $(INCLUDE_TOP)\stx\libbasic3\WrappedMethod.$(H) $(INCLUDE_TOP)\stx\libbasic\Method.$(H) $(INCLUDE_TOP)\stx\libbasic\CompiledCode.$(H) $(INCLUDE_TOP)\stx\libbasic\ExecutableFunction.$(H) $(INCLUDE_TOP)\stx\libbasic2\ZipArchive.$(H) $(INCLUDE_TOP)\stx\libbasic\Boolean.$(H) $(INCLUDE_TOP)\stx\libbasic\Character.$(H) $(INCLUDE_TOP)\stx\libbasic\ConfigurableFeatures.$(H) $(INCLUDE_TOP)\stx\libbasic\DoubleArray.$(H) $(INCLUDE_TOP)\stx\libbasic\AbstractNumberVector.$(H) $(INCLUDE_TOP)\stx\libbasic\Float.$(H) $(INCLUDE_TOP)\stx\libbasic\LimitedPrecisionReal.$(H) $(INCLUDE_TOP)\stx\libbasic\FloatArray.$(H) $(INCLUDE_TOP)\stx\libbasic\LargeInteger.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\ShortFloat.$(H) $(INCLUDE_TOP)\stx\libbasic2\SignedIntegerArray.$(H) $(INCLUDE_TOP)\stx\libbasic2\UnboxedIntegerArray.$(H) $(INCLUDE_TOP)\stx\libbasic2\SignedLongIntegerArray.$(H) $(INCLUDE_TOP)\stx\libbasic2\SignedWordArray.$(H) $(INCLUDE_TOP)\stx\libbasic\UndefinedObject.$(H) $(INCLUDE_TOP)\stx\libbasic2\WordArray.$(H) $(INCLUDE_TOP)\stx\libbasic\ProgrammingLanguage.$(H) $(INCLUDE_TOP)\stx\libbasic\Class.$(H) $(INCLUDE_TOP)\stx\libbasic\ClassDescription.$(H) $(INCLUDE_TOP)\stx\libbasic\Semaphore.$(H) $(INCLUDE_TOP)\stx\libbasic2\Socket.$(H) $(INCLUDE_TOP)\stx\libbasic\NonPositionableExternalStream.$(H) $(INCLUDE_TOP)\stx\libbasic\ExternalStream.$(H) $(INCLUDE_TOP)\stx\libbasic\ReadWriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\PositionableStream.$(H) $(INCLUDE_TOP)\stx\libbasic\PeekableStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Stream.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
-
-# **Must be at end**
-
-# Enforce recompilation of package definition class if Mercurial working
-# copy state changes. Together with --guessVersion it ensures that package
-# definition class always contains correct binary revision string.
-!IFDEF HGROOT
-$(OUTDIR)stx_libjava.$(O): $(HGROOT)\.hg\dirstate
-!ENDIF
--- a/bmake.bat	Tue Dec 11 23:15:40 2012 +0000
+++ b/bmake.bat	Wed Dec 12 23:20:03 2012 +0000
@@ -3,10 +3,6 @@
 @REM type bmake, and wait...
 @REM do not edit - automatically generated from ProjectDefinition
 @REM -------
-@SET DEFINES=
-@REM Kludge got Mercurial, cannot be implemented in Borland make
-@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
-@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
-make.exe -N -f bc.mak  %DEFINES% %*
+make.exe -N -f bc.mak %*
 
 
--- a/extensions.st	Tue Dec 11 23:15:40 2012 +0000
+++ b/extensions.st	Wed Dec 12 23:20:03 2012 +0000
@@ -410,6 +410,24 @@
     ^ (self size = 1 and: [ JavaDescriptor baseTypes includesKey: self first ]).
 ! !
 
+!CharacterArray methodsFor:'special string converting'!
+
+withoutSuffix: aString 
+    "if the receiver endsWith aString, return a copy without it.
+     Otherwise return the receiver"
+    
+    (self endsWith: aString) ifTrue: [
+        ^ self copyFrom: 1 to: self size - aString size
+    ].
+    ^ self
+
+    "
+     'helloworld' withoutSuffix:'world'
+     'helloworld' withoutSuffix:'foo'"
+
+    "Created: / 08-12-2012 / 20:26:27 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
+! !
+
 !CharacterArray class methodsFor:'encoding & decoding'!
 
 decodeFromJavaUTF8: bytes
@@ -2001,16 +2019,14 @@
 
 nextBytes: bytesToRead of: zmember startingAt: pos into: b startingAt: off
 
-    file position0Based: (self dataStartOf: zmember) + startOfArchive + pos.
+    file position0Based: zmember fileStart + startOfArchive + pos.
     ^ file nextBytes: bytesToRead into: b startingAt: off.
 
     "Created: / 01-05-2011 / 16:21:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 10-12-2012 / 05:41:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !stx_libjava class methodsFor:'documentation'!
 
-extensionsVersion_HG
-
-    ^ '$Changeset: <not expanded> $'
+extensionsVersion_SVN
+    ^ '$Id::                                                                                                                        $'
 ! !
\ No newline at end of file
--- a/libjava.rc	Tue Dec 11 23:15:40 2012 +0000
+++ b/libjava.rc	Wed Dec 12 23:20:03 2012 +0000
@@ -3,7 +3,7 @@
 // automagically generated from the projectDefinition: stx_libjava.
 //
 VS_VERSION_INFO VERSIONINFO
-  FILEVERSION     6,2,32767,32767
+  FILEVERSION     6,2,2235,2235
   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.32767.32767\0"
+      VALUE "FileVersion", "6.2.2235.2235\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", "Mon, 10 Dec 2012 09:55:56 GMT\0"
+      VALUE "ProductDate", "Wed, 12 Dec 2012 23:19:44 GMT\0"
     END
 
   END
--- a/mingwmake.bat	Tue Dec 11 23:15:40 2012 +0000
+++ b/mingwmake.bat	Wed Dec 12 23:20:03 2012 +0000
@@ -3,10 +3,6 @@
 @REM type mingwmake, and wait...
 @REM do not edit - automatically generated from ProjectDefinition
 @REM -------
-@SET DEFINES=
-@REM Kludge got Mercurial, cannot be implemented in Borland make
-@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
-@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
-make.exe -N -f bc.mak -DUSEMINGW=1 %DEFINES% %*
+make.exe -N -f bc.mak -DUSEMINGW=1 %*
 
 
--- a/stx_libjava.st	Tue Dec 11 23:15:40 2012 +0000
+++ b/stx_libjava.st	Wed Dec 12 23:20:03 2012 +0000
@@ -51,10 +51,6 @@
      as of 1.9.2010
 
 "
-!
-
-extensionsVersion_SVN
-    ^ '$Id::                                                                                                                        $'
 ! !
 
 !stx_libjava class methodsFor:'accessing'!
@@ -159,17 +155,17 @@
      exclude individual packages in the #excludedFromPrerequisites method."
 
     ^ #(
-        #'stx:goodies/sunit'    "TestAsserter - superclass of JavaAntProjectResource "
+        #'stx:goodies/sunit'    "TestAsserter - superclass of JavaTestCaseProxy "
         #'stx:libbasic'    "CharacterArray - superclass of extended String "
-        #'stx:libbasic2'    "Socket - superclass of JavaSocket "
-        #'stx:libbasic3'    "WrappedMethod - extended "
-        #'stx:libcomp'    "SelfNode - referenced by ProxyMethodMethodInvocationNode>>generate: "
+        #'stx:libbasic2'    "BitArray - superclass of extended BooleanArray "
+        #'stx:libbasic3'    "MessageTracer - referenced by JavaMethod>>setBreakPoint "
+        #'stx:libcomp'    "ByteCodeCompiler - referenced by ProxyMethodCompiler>>compile "
         #'stx:libhtml'    "URL - referenced by JavaEmbeddedFrameView>>setupAppletFrameIn:initializeJava: "
-        #'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: "
+        #'stx:libtool'    "WorkspaceApplication - referenced by GroovyEvaluator>>evaluate:in:receiver:notifying:logged:ifFail: "
+        #'stx:libview'    "PopUpView - superclass of JavaPopUpView "
+        #'stx:libview2'    "Plug - referenced by JavaSourceCodeCache>>findMethodLine:inMethods: "
+        #'stx:libwidg'    "Label - referenced by JavaVM class>>_WLabelPeer_create: "
+        #'stx:libwidg2'    "ComboListView - referenced by JavaVM class>>_WChoicePeer_create: "
     )
 ! !
 
@@ -581,6 +577,7 @@
         Object getJavaMonitor
         Object javaWrapRequired
         'Boolean class' javaWrapRequired
+        CharacterArray withoutSuffix:
     )
 ! !
 
@@ -687,11 +684,6 @@
 
 !stx_libjava class methodsFor:'documentation'!
 
-version_HG
-
-    ^ '$Changeset: <not expanded> $'
-!
-
 version_SVN
-    ^ '§Id§'
+    ^ '$Id$'
 ! !
--- a/vcmake.bat	Tue Dec 11 23:15:40 2012 +0000
+++ b/vcmake.bat	Wed Dec 12 23:20:03 2012 +0000
@@ -7,12 +7,6 @@
 @if not defined VSINSTALLDIR (
     call ..\rules\vcsetup.bat
 )
-@SET DEFINES=
-@REM Kludge got Mercurial, cannot be implemented in Borland make
-@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
-@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
-make.exe -N -f bc.mak -DUSEVC=1 %DEFINES% %*
+make.exe -N -f bc.mak -DUSEVC %*
 
 
-
-