[e-cvs] cvs commit: e/src/jsrc/org/quasiliteral/term Functor.java

markm@eros.cs.jhu.edu markm@eros.cs.jhu.edu
Sat, 10 Nov 2001 14:40:54 -0500


markm       01/11/10 14:40:53

  Modified:    src/esrc/com/skyhunter/e/lang
                        runConfinedSourceFuncAuthor.emaker
                        sourceRunnerAuthor.emaker
               src/esrc/com/skyhunter/e/net vowToolsMaker.emaker
               src/esrc/com/skyhunter/e/security
                        oldPowerboxControllerMakerAuthor.emaker
                        powerBoxControllerMakerAuthorTester.e
                        powerboxControllerMakerAuthor.emaker
               src/esrc/com/skyhunter/e/util domFromTextFunc.emaker
                        domTreeKit.emaker extractChildNodesFunc.emaker
                        mapDomText.emaker mapDomTextFunc.emaker
                        testDomTreeKit.e timer.e
               src/esrc/com/skyhunter/eDesk capLauncherAuthor.emaker
                        installedAppsManagerMaker.emaker
                        navPanelControllerMakerAuthor.emaker
                        progressWindowMakerAuthor.emaker
                        serverDescVowAuthor.emaker
               src/esrc/com/skyhunter/eDesk/icons folder.gif
               src/esrc/com/skyhunter/ex/swing capFrameMakerAuthor.emaker
                        dialogVowMakerAuthor.emaker
                        standardWindowMakerAuthor.emaker
               src/esrc/com/skyhunter/installer
                        agreedCapsPetsVowMakerAuthor.emaker
                        persistentInstallerAuthor.emaker
                        stringDataKit.emaker testAgreedCapsVow.e
               src/esrc/org/erights/e/tools/text abbrev.emaker
               src/esrc/scripts eBrowser.e
               src/jsrc/net/ertp Assay.java
                        InsufficientERightsException.java Issuer.java
               src/jsrc/net/vattp/data AuthSecrets.java
                        ConnectionAttemptFailed.java
                        ConnectionShutDownException.java DES.java
                        DataCommThunk.java DataPath.java Decrypt3DES.java
                        EARL.java Encrypt3DES.java ListenThread.java
                        Msg.java MsgTransformer.java NetAddr.java
                        NetConfig.java RecvThread.java SendThread.java
                        StartUpProtocol.java StreamMessage.java
                        Suspend.java TripleDESKeyConstructor.java
                        UserThread.java VatIdentity.java
                        VatTPConnection.java
               src/jsrc/org/erights/build EYaccFixer.java
               src/jsrc/org/erights/e/develop/assertion Assertion.java
                        AssertionFailed.java
               src/jsrc/org/erights/e/develop/exception ExceptionMgr.java
                        ExceptionNoticer.java NestedError.java
                        NestedException.java NestedIOException.java
                        PrintStreamWriter.java ThrowableSugar.java
               src/jsrc/org/erights/e/develop/format ETimeFormat.java
                        StringHelper.java
               src/jsrc/org/erights/e/develop/trace Trace.java
                        TraceBuffer.java TraceCaller.java
                        TraceConstants.java TraceController.java
                        TraceDateToString.java TraceLevelTranslator.java
                        TraceLog.java TraceLogDescriptor.java
                        TraceMessage.java TraceMessageAcceptor.java
                        TraceMessageStringifier.java
                        TraceSubsystemMediator.java
                        TraceTxtVersionNamer.java TraceVersionNamer.java
               src/jsrc/org/erights/e/elang/evm AssignExpr.java
                        CallExpr.java CatchExpr.java CdrPattern.java
                        DefineExpr.java EExpr.java EImpl.java
                        EImplByProxy.java EMeta.java EMethod.java
                        EMethodNode.java ENode.java EScript.java
                        EscapeExpr.java FinalPattern.java FinallyExpr.java
                        FrameFinalNounExpr.java FrameSlotNounExpr.java
                        HideExpr.java IfExpr.java IgnorePattern.java
                        ListPattern.java LiteralExpr.java
                        LiteralNounExpr.java LiteralSlotNounExpr.java
                        LocalFinalNounExpr.java LocalSlotNounExpr.java
                        MatchBindExpr.java Matcher.java MetaExpr.java
                        NounExpr.java NounPattern.java ObjectExpr.java
                        OuterNounExpr.java Pattern.java
                        QuasiLiteralExpr.java QuasiLiteralPatt.java
                        QuasiPatternExpr.java QuasiPatternPatt.java
                        ScopeExpr.java SendExpr.java SeqExpr.java
                        SlotExpr.java StaticScope.java SuchThatPattern.java
                        VarPattern.java
               src/jsrc/org/erights/e/elang/interp Help.java
                        InteractiveInterp.java Interp.java
                        LazyEvalSlot.java Loader.java LoaderScope.java
                        Loop.java PackageScope.java ProtocolDesc.java
                        ResourceUriGetter.java ScopeSetup.java
                        URLGetter.java UnsafeLoaderScope.java
               src/jsrc/org/erights/e/elang/scope EvalContext.java
                        InnerScope.java OuterScope.java Scope.java
                        ScopeMap.java UndefinedVariableException.java
               src/jsrc/org/erights/e/elang/syntax Assoc.java EBuilder.java
                        ELexer.java EParser.java FileFeeder.java
                        HilbertHotel.java Indenter.java LineFeeder.java
                        MsgPatt.java NeedMoreException.java
                        PrettyFeeder.java QuasiFeeder.java
                        SyntaxException.java TwineFeeder.java URI.java
               src/jsrc/org/erights/e/elang/visitors
                        AlphaRenameVisitor.java BindFramesVisitor.java
                        CopyVisitor.java ETreeVisitor.java
                        RenameVisitor.java
               src/jsrc/org/erights/e/elib/base ClassDesc.java
                        Ejection.java Ejector.java MessageDesc.java
                        MethodNode.java ParamDesc.java ParseNode.java
                        SourceSpan.java TypeDesc.java
               src/jsrc/org/erights/e/elib/deflect Deflector.java
               src/jsrc/org/erights/e/elib/eio NonBlockingInputStream.java
                        TextReader.java TextWriter.java
               src/jsrc/org/erights/e/elib/prim BERunner.java
                        CallThunk.java ConstructorNode.java E.java
                        FEProblemHandler.java FERunner.java
                        FERunnerEvent.java InstanceMethodNode.java
                        JavaMemberNode.java Message.java
                        MirandaMethods.java NowRunnable.java
                        OverloaderNode.java PendingEvent.java Queue.java
                        Runner.java RunnerThread.java
                        SacrificialComponent.java ScriptMaker.java
                        ShutDownVatException.java StaticMaker.java
                        StaticMethodNode.java SugarMethodNode.java
                        SynchQueue.java Thrower.java VTable.java
                        VarGetterNode.java VarSetterNode.java WeakPtr.java
                        WeakPtrThread.java
               src/jsrc/org/erights/e/elib/prim/tests A.java ERunDemo.java
               src/jsrc/org/erights/e/elib/quasi Identifiers.java
                        IncompleteQuasiException.java MatchMaker.java
                        SimpleQuasiParser.java Substituter.java
               src/jsrc/org/erights/e/elib/ref BufferingRef.java
                        DisconnectedRef.java ExternalRef.java FarRef.java
                        LocalResolver.java NearRef.java
                        OneArgFuncAdapter.java Proxy.java
                        ProxyResolver.java Ref.java RemotePromise.java
                        ResultResolver.java SlotRef.java StemCell.java
                        SwitchableRef.java UnconnectedRef.java
                        ViciousCycleException.java WhenBrokenReactor.java
                        WhenResolvedReactor.java
               src/jsrc/org/erights/e/elib/sealing Unsealer.java
                        UnsealingException.java
               src/jsrc/org/erights/e/elib/serial PassByConstruction.java
                        PassByConstructionGuard.java PassByProxy.java
                        PassByProxyGuard.java PersistenceReplacer.java
                        PersistenceResolver.java Persistent.java
                        RemoteCall.java RemoteDelivery.java Serializer.java
                        Unserializer.java
               src/jsrc/org/erights/e/elib/slot FinalSlotMaker.java
                        NullOkMaker.java RuinedSlot.java SettableSlot.java
                        SettableSlotMaker.java SimpleSlot.java
                        SimpleSlotMaker.java SlotDefiner.java
                        VoidMaker.java
               src/jsrc/org/erights/e/elib/tables ArrayedList.java
                        AtomicTwine.java Column.java CompositeTwine.java
                        ConstList.java ConstListImpl.java ConstMap.java
                        ConstMapImpl.java CycleBreaker.java EList.java
                        EMap.java EmptyTwine.java EqualityKeyColumn.java
                        Equalizer.java FlexList.java FlexListImpl.java
                        FlexMap.java FlexMapImpl.java
                        IdentityCacheTable.java IdentityKeyColumn.java
                        IdentityMap.java IndirectCompFunc.java
                        IntColumn.java IntTable.java KeyColumn.java
                        LocatedTwine.java NotSettledException.java
                        ROList.java ROMap.java RefColumn.java
                        SamenessKeyColumn.java ScalarColumn.java
                        Selfless.java ShareCount.java SimpleCompFunc.java
                        SimpleTwine.java Twine.java VoidColumn.java
                        WeakKey.java WeakKeyMap.java WeakValue.java
                        WeakValueMap.java
               src/jsrc/org/erights/e/elib/tests TestELib.java
                        TestMultiQ.java TestMultiQMain.java
               src/jsrc/org/erights/e/elib/util
                        AlreadyDefinedException.java
                        ArityMismatchException.java ClassCache.java
                        ConditionLock.java DynamicCollection.java
                        DynamicCollectionEnumeration.java
                        HexStringUtils.java IdentityFunc.java
                        TwineException.java
               src/jsrc/org/erights/e/extern/file ConsoleMaker.java
                        ConsoleThread.java
               src/jsrc/org/erights/e/extern/timer Clock.java Timeout.java
                        Timer.java TimerQEntry.java TimerThread.java
                        TimerWatcher.java
               src/jsrc/org/erights/e/meta/java/awt ComponentSugar.java
                        ContainerSugar.java
               src/jsrc/org/erights/e/meta/java/awt/event
                        WindowEventSugar.java
               src/jsrc/org/erights/e/meta/java/io BufferedReaderSugar.java
                        FileGetter.java FileSugar.java
                        InputStreamSugar.java ReadOnlyFile.java
                        ReaderSugar.java
               src/jsrc/org/erights/e/meta/java/lang BooleanSugar.java
                        Bufferer.java ByteGuardSugar.java
                        CharacterSugar.java DoubleGuardSugar.java
                        DoubleSugar.java FloatGuardSugar.java
                        IntegerGuardSugar.java LongGuardSugar.java
                        ProcessSugar.java ShortGuardSugar.java
                        StringBufferSugar.java ThrowableGuardSugar.java
                        VoidGuardSugar.java
               src/jsrc/org/erights/e/meta/java/math
                        BigIntegerGuardSugar.java BigIntegerMakerSugar.java
                        BigIntegerSugar.java
               src/jsrc/org/erights/e/meta/java/net URLSugar.java
               src/jsrc/org/erights/e/meta/java/util DictionarySugar.java
                        EnumerationSugar.java VectorSugar.java
               src/jsrc/org/erights/e/ui/elmer EInterpAdapter.java
                        ElmerMain.java
               src/jsrc/org/erights/e/ui/jed BrickLayer.java EAction.java
                        EActionListener.java EDismissListener.java
                        EItemListener.java EMenuBar.java
                        ETextChangedListener.java EditGroup.java
                        JedMain.java
               src/jsrc/org/quasiliteral/astro Astro.java
                        AstroLexerSharedInputState.java AstroToken.java
               src/jsrc/org/quasiliteral/term Functor.java
  Added:       src/esrc/com/skyhunter/e/icons backArrow.gif fileOpen.gif
                        folder.gif forwardArrow.gif help.gif
                        lightning16x16.gif magnify.gif print2.gif stop.gif
                        text16x16.gif upArrow.gif webpage16x16.gif
               src/esrc/com/skyhunter/eDesk/icons folderOld.gif
  Removed:     src/esrc/com/skyhunter/e/security capWTMakerAuthorOld.emaker
               src/esrc/com/skyhunter/eBrowser analyzeOutlineFunc.emaker
                        outlineAnalyzer.emaker
               src/esrc/com/skyhunter/eBrowser/ebScripts countLines.emaker
                        indentSpaces.emaker indentTabs.emaker
               src/esrc/com/skyhunter/eDesk quickEditMakerAuthor.emaker
               src/esrc/com/skyhunter/eDeskPlus capLauncherAuthor.emaker
                        progressWindowMakerAuthor.emaker
                        quickEditMakerAuthor.emaker
               src/esrc/com/skyhunter/eDeskPlus/icons goto.gif home.gif
                        refresh.gif up.gif
               src/esrc/com/skyhunter/eDeskPlus/strings about.txt help.txt
               src/esrc/com/skyhunter/ex/swing dialogPromiserAuthor.emaker
                        dialogPromiserAuthorOld.emaker
               src/esrc/com/skyhunter/installer
                        agreedCapPromiserAuthorTester.e
                        agreedCapVowMakerAuthorTest.e
                        agreedCapsXMLPromiserAuthor.emaker
               src/esrc/com/skyhunter/testCaplet
                        helloWorldCapletAuthor.caplet
                        helloWorldCapletAuthor.emaker
                        helloWorldCapletPlusAuthor.emaker
                        helloWorldPlusTester.e helloWorldTester.e
                        testCapletAuthor.emaker testLauncher.e
                        testLauncherOld.e
  Log:
  tabs, reformatting, little things

Revision  Changes    Path
1.1                  e/src/esrc/com/skyhunter/e/icons/backArrow.gif

Index: backArrow.gif
===================================================================
GIF89a
(P 



1.1                  e/src/esrc/com/skyhunter/e/icons/fileOpen.gif

Index: fileOpen.gif
===================================================================
GIF89a


1.1                  e/src/esrc/com/skyhunter/e/icons/folder.gif

Index: folder.gif
===================================================================
GIF89a
(P
(p
8P
(p
(p


1.1                  e/src/esrc/com/skyhunter/e/icons/forwardArrow.gif

Index: forwardArrow.gif
===================================================================
GIF89a
(P@
(


1.1                  e/src/esrc/com/skyhunter/e/icons/help.gif

Index: help.gif
===================================================================
GIF89a


1.1                  e/src/esrc/com/skyhunter/e/icons/lightning16x16.gif

Index: lightning16x16.gif
===================================================================
GIF89a
P
$( 
$H
	
$


1.1                  e/src/esrc/com/skyhunter/e/icons/magnify.gif

Index: magnify.gif
===================================================================
GIF89a


1.1                  e/src/esrc/com/skyhunter/e/icons/print2.gif

Index: print2.gif
===================================================================
GIF89a


1.1                  e/src/esrc/com/skyhunter/e/icons/stop.gif

Index: stop.gif
===================================================================
GIF89a
8p
( 
(P @


1.1                  e/src/esrc/com/skyhunter/e/icons/text16x16.gif

Index: text16x16.gif
===================================================================
GIF89a


1.1                  e/src/esrc/com/skyhunter/e/icons/upArrow.gif

Index: upArrow.gif
===================================================================
GIF89a



1.1                  e/src/esrc/com/skyhunter/e/icons/webpage16x16.gif

Index: webpage16x16.gif
===================================================================
GIF89a
(P@



1.2       +29 -29    e/src/esrc/com/skyhunter/e/lang/runConfinedSourceFuncAuthor.emaker

Index: runConfinedSourceFuncAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/lang/runConfinedSourceFuncAuthor.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- runConfinedSourceFuncAuthor.emaker	2001/09/12 00:01:50	1.1
+++ runConfinedSourceFuncAuthor.emaker	2001/11/10 19:40:35	1.2
@@ -1,33 +1,33 @@
 
 //Copyright (C) 2001 Combex. All Rights Reserved.
 def sourceRunnerAuthor(unsafe__uriGetter, interp, traceln, stdout) :near {
-	def runSource(sourceText) :near {
-		def interpret() :any {
-			traceln("starting run prep")
-			def ScopeSetupMaker := <unsafe:org.erights.e.elang.interp.ScopeSetup>
-			var scope := ScopeSetupMaker universal()
-			def subInterp {
-				to blockAtTop() {
-					# ignored
-				}
-				to continueAtTop() {
-					# ignored
-				}
-				delegate { interp }
-			}
-			scope := scope sprout() bindFinal("interp", subInterp)
-			traceln("made scope 2")
-			try {
-				def tree := e__quasiParser(sourceText)
-				def result := tree eval(scope newPov())
-				traceln("\n# value: " + result)
-				traceln("shown")
-				result
-			} catch problem {
-				traceln("\n# problem: " + problem)
-				traceln("problem shown")
-			}
-		}
-		interpret()
-	}
+    def runSource(sourceText) :near {
+        def interpret() :any {
+            traceln("starting run prep")
+            def ScopeSetupMaker := <unsafe:org.erights.e.elang.interp.ScopeSetup>
+            var scope := ScopeSetupMaker universal()
+            def subInterp {
+                to blockAtTop() {
+                    # ignored
+                }
+                to continueAtTop() {
+                    # ignored
+                }
+                delegate { interp }
+            }
+            scope := scope sprout() bindFinal("interp", subInterp)
+            traceln("made scope 2")
+            try {
+                def tree := e__quasiParser(sourceText)
+                def result := tree eval(scope newPov())
+                traceln("\n# value: " + result)
+                traceln("shown")
+                result
+            } catch problem {
+                traceln("\n# problem: " + problem)
+                traceln("problem shown")
+            }
+        }
+        interpret()
+    }
 }



1.3       +29 -29    e/src/esrc/com/skyhunter/e/lang/sourceRunnerAuthor.emaker

Index: sourceRunnerAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/lang/sourceRunnerAuthor.emaker,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sourceRunnerAuthor.emaker	2001/09/12 00:01:50	1.2
+++ sourceRunnerAuthor.emaker	2001/11/10 19:40:35	1.3
@@ -1,33 +1,33 @@
 
 //Copyright (C) 2001 Combex. All Rights Reserved.
 def sourceRunnerAuthor(unsafe__uriGetter, interp, traceln, stdout) :near {
-	def runSource(sourceText) :near {
-		def interpret() :any {
-			traceln("starting run prep")
-			def ScopeSetupMaker := <unsafe:org.erights.e.elang.interp.ScopeSetup>
-			var scope := ScopeSetupMaker privileged(false, stdout, stdout, interp)
-			def subInterp {
-				to blockAtTop() {
-					# ignored
-				}
-				to continueAtTop() {
-					# ignored
-				}
-				delegate { interp }
-			}
-			scope := scope sprout() bindFinal("interp", subInterp)
-			traceln("made scope 2")
-			try {
-				def tree := e__quasiParser(sourceText)
-				def result := tree eval(scope newPov())
-				traceln("\n# value: " + result)
-				traceln("shown")
-				result
-			} catch problem {
-				traceln("\n# problem: " + problem)
-				traceln("problem shown")
-			}
-		}
-		interpret()
-	}
+    def runSource(sourceText) :near {
+        def interpret() :any {
+            traceln("starting run prep")
+            def ScopeSetupMaker := <unsafe:org.erights.e.elang.interp.ScopeSetup>
+            var scope := ScopeSetupMaker privileged(false, stdout, stdout, interp)
+            def subInterp {
+                to blockAtTop() {
+                    # ignored
+                }
+                to continueAtTop() {
+                    # ignored
+                }
+                delegate { interp }
+            }
+            scope := scope sprout() bindFinal("interp", subInterp)
+            traceln("made scope 2")
+            try {
+                def tree := e__quasiParser(sourceText)
+                def result := tree eval(scope newPov())
+                traceln("\n# value: " + result)
+                traceln("shown")
+                result
+            } catch problem {
+                traceln("\n# problem: " + problem)
+                traceln("problem shown")
+            }
+        }
+        interpret()
+    }
 }



1.7       +94 -94    e/src/esrc/com/skyhunter/e/net/vowToolsMaker.emaker

Index: vowToolsMaker.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/net/vowToolsMaker.emaker,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- vowToolsMaker.emaker	2001/09/12 00:01:50	1.6
+++ vowToolsMaker.emaker	2001/11/10 19:40:35	1.7
@@ -1,97 +1,97 @@
 class vowToolsMaker() :any {
-	def vowTools {
-		# Send a list of promises, this will return a
-		# promise that will be fulfilled when all
-		# the promises in the list have resolved one
-		# way or the other. If any break, the allDone
-		# promise is smashed, with a list of the error
-		# messages, else it returns true.
-		# Some day, this should return a list of all the
-		# resolutions, with a smash if any of the promises
-		# were broken on delivery.
-		to promiseAllDone(thePromiseList) :any {
-			# resolves after all in list resolved, returns true if all promises fulfilled
-			def  [resolutionPromise,resolver] := PromiseMaker()
-			def promiseCount := thePromiseList size
-			define breakMessages := ""
-			if (promiseCount == 0) {resolver resolve(true)}
-			for each in thePromiseList {
-				each <- whenResolved(def obs(result) {
-					if (E isBroken(result)) {breakMessages += " :" +result}
-					promiseCount -= 1
-					if (promiseCount == 0) {
-						if (breakMessages size == 0) {
-							resolver resolve(true)
-						} else {
-							resolver smash(breakMessages)
-						}
-					}
-				})
-			}
-			resolutionPromise
-		}
-		# A vowsMonitor is an upscale promiseAllDone, collecting the
-		# promise list, the promise of completion, and the finishing
-		# process in a single object, making it convenient to pass
-		# around to various objects that must add a promise to the
-		# list and be informed when the list is finished.
-		# Add the promises one at a time to the vowsMonitor,
-		# get the promise of the finish when you want it
-		# and initiate the monitoring for completion by requesting
-		# a finishAll. Adding promises after the finishAll has been
-		# requested is currently an undetected error.
-		to makeVowsMonitor :any {
-			def [bundlePromise,resolver] := PromiseMaker()
-			def bundle := [] diverge
-			def vowsMonitor {
-				to add (thePromise) {bundle push(thePromise)}
-				to finishAll {resolver resolve(netTools promiseAllDone(bundle))}
-				to promiseFinish :any {bundlePromise}
-			}
-		}
-		# Only More Recent Manager:
-		# If you send out multiple requests over time, 
-		# resulting in receiving multiple promises also strewn over time,
-		# and if you are only interested
-		# in the answer if the answer is more recent 
-		# than the most recent of the already-fulfilled promises 
-		# (i.e., only if
-		# the answer is newer than what you currently have),
-		# and if you are not absolutely sure that all the 
-		# requests will move through a
-		# guaranteed sequence on a single vat,
-		# use an onlyMoreRecent object: add the promise
-		# to the onlyMoreRecent when you receive it, and use the promise returned from that operation in
-		# your when clause. If
-		# a newer promise gets fulfilled before an older promise, the older promise is smashed with an "Obsolete Data"
-		# error when it finally resolves.
-		# If a newest promise returns smashed, the promise from onlyMostRecent also is returned smashed,
-		# but with the error object it got from the
-		# original promise.
-		to makeOnlyMoreRecentAcceptor :any  {
-			def obsoleteError := "Obsolete Data"
-			def mostRecentlyFulfilledIndex := 0
-			def nextPromiseIndex := 1
-			def onlyMoreRecent {
-				to promiseMoreRecent(nextPromise) :any {
-					def [onlyMoreRecentPromise,resolver] := PromiseMaker()
-					def thisPromiseIndex := nextPromiseIndex
-					nextPromiseIndex += 1
-					when (nextPromise) -> done(resolution) {
-						if (thisPromiseIndex > mostRecentlyFulfilledIndex) {
-							resolver resolve(resolution)
-							mostRecentlyFulfilledIndex := thisPromiseIndex
-						} else { resolver smash(obsoleteError) }
-					} catch e {
-						if (thisPromiseIndex > mostRecentlyFulfilledIndex) {
-							resolver smash(e)
-							mostRecentlyFulfilledIndex := thisPromiseIndex
-						} else { resolver smash(obsoleteError) }
-					}
-					onlyMoreRecentPromise
-				}
-			}
-		}
-	}
+    def vowTools {
+        # Send a list of promises, this will return a
+        # promise that will be fulfilled when all
+        # the promises in the list have resolved one
+        # way or the other. If any break, the allDone
+        # promise is smashed, with a list of the error
+        # messages, else it returns true.
+        # Some day, this should return a list of all the
+        # resolutions, with a smash if any of the promises
+        # were broken on delivery.
+        to promiseAllDone(thePromiseList) :any {
+            # resolves after all in list resolved, returns true if all promises fulfilled
+            def  [resolutionPromise,resolver] := PromiseMaker()
+            def promiseCount := thePromiseList size
+            define breakMessages := ""
+            if (promiseCount == 0) {resolver resolve(true)}
+            for each in thePromiseList {
+                each <- whenResolved(def obs(result) {
+                    if (E isBroken(result)) {breakMessages += " :" +result}
+                    promiseCount -= 1
+                    if (promiseCount == 0) {
+                        if (breakMessages size == 0) {
+                            resolver resolve(true)
+                        } else {
+                            resolver smash(breakMessages)
+                        }
+                    }
+                })
+            }
+            resolutionPromise
+        }
+        # A vowsMonitor is an upscale promiseAllDone, collecting the
+        # promise list, the promise of completion, and the finishing
+        # process in a single object, making it convenient to pass
+        # around to various objects that must add a promise to the
+        # list and be informed when the list is finished.
+        # Add the promises one at a time to the vowsMonitor,
+        # get the promise of the finish when you want it
+        # and initiate the monitoring for completion by requesting
+        # a finishAll. Adding promises after the finishAll has been
+        # requested is currently an undetected error.
+        to makeVowsMonitor :any {
+            def [bundlePromise,resolver] := PromiseMaker()
+            def bundle := [] diverge
+            def vowsMonitor {
+                to add (thePromise) {bundle push(thePromise)}
+                to finishAll {resolver resolve(netTools promiseAllDone(bundle))}
+                to promiseFinish :any {bundlePromise}
+            }
+        }
+        # Only More Recent Manager:
+        # If you send out multiple requests over time,
+        # resulting in receiving multiple promises also strewn over time,
+        # and if you are only interested
+        # in the answer if the answer is more recent
+        # than the most recent of the already-fulfilled promises
+        # (i.e., only if
+        # the answer is newer than what you currently have),
+        # and if you are not absolutely sure that all the
+        # requests will move through a
+        # guaranteed sequence on a single vat,
+        # use an onlyMoreRecent object: add the promise
+        # to the onlyMoreRecent when you receive it, and use the promise returned from that operation in
+        # your when clause. If
+        # a newer promise gets fulfilled before an older promise, the older promise is smashed with an "Obsolete Data"
+        # error when it finally resolves.
+        # If a newest promise returns smashed, the promise from onlyMostRecent also is returned smashed,
+        # but with the error object it got from the
+        # original promise.
+        to makeOnlyMoreRecentAcceptor :any  {
+            def obsoleteError := "Obsolete Data"
+            def mostRecentlyFulfilledIndex := 0
+            def nextPromiseIndex := 1
+            def onlyMoreRecent {
+                to promiseMoreRecent(nextPromise) :any {
+                    def [onlyMoreRecentPromise,resolver] := PromiseMaker()
+                    def thisPromiseIndex := nextPromiseIndex
+                    nextPromiseIndex += 1
+                    when (nextPromise) -> done(resolution) {
+                        if (thisPromiseIndex > mostRecentlyFulfilledIndex) {
+                            resolver resolve(resolution)
+                            mostRecentlyFulfilledIndex := thisPromiseIndex
+                        } else { resolver smash(obsoleteError) }
+                    } catch e {
+                        if (thisPromiseIndex > mostRecentlyFulfilledIndex) {
+                            resolver smash(e)
+                            mostRecentlyFulfilledIndex := thisPromiseIndex
+                        } else { resolver smash(obsoleteError) }
+                    }
+                    onlyMoreRecentPromise
+                }
+            }
+        }
+    }
 }
 



1.3       +22 -22    e/src/esrc/com/skyhunter/e/security/oldPowerboxControllerMakerAuthor.emaker

Index: oldPowerboxControllerMakerAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/security/oldPowerboxControllerMakerAuthor.emaker,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- oldPowerboxControllerMakerAuthor.emaker	2001/09/12 00:01:50	1.2
+++ oldPowerboxControllerMakerAuthor.emaker	2001/11/10 19:40:36	1.3
@@ -2,9 +2,9 @@
 def powerboxControllerMakerAuthor(unsafe__uriGetter, file__uriGetter, resource__uriGetter, JPanel__quasiParser) :near {
     def uiKit := <import:com.skyhunter.ex.swing.uiToolsAuthor>(
         <unsafe:java.awt.*>, <unsafe:javax.swing.*>)
-	var stdErr := ""
+    var stdErr := ""
     def confinedRunner(sourceTwine) :any {
-		stdErr := ""
+        stdErr := ""
         def traceln(text) {stdErr := `$stdErr $text ${"<br>\n"}`}
         traceln("in confined runner, about to interpret")
         def interpret() :any {
@@ -24,7 +24,7 @@
             } catch problem {
                 traceln(`Error: ${"\n"}$problem`)
                 result := stdErr
-				throw 
+                throw
             }
             result
         }
@@ -46,11 +46,11 @@
             to requestBaseCapabilityVow(capName,justification) :any {}
             //general capability pops drag/drop dialog
             to requestCapabilityVow(capName, justification) :any {}
-			to getCapWT() :near {
-				def makerAuthor := <import:com.skyhunter.e.security.capWTMakerAuthor>
-				def maker := makerAuthor(<unsafe:java.awt.*>, <unsafe:javax.swing.*>, JPanel__quasiParser)
-				maker new(appImage, appTitle, powerbox)
-			}
+            to getCapWT() :near {
+                def makerAuthor := <import:com.skyhunter.e.security.capWTMakerAuthor>
+                def maker := makerAuthor(<unsafe:java.awt.*>, <unsafe:javax.swing.*>, JPanel__quasiParser)
+                maker new(appImage, appTitle, powerbox)
+            }
         }
         def powerboxController {
             to getPowerbox() :near {powerbox}
@@ -75,20 +75,20 @@
             }
         }
         def launchCaplet(source) :near {
-			try {
-			def maker := confinedRunner(source)
-			maker new(powerbox)
-			} catch err {
-				powerbox getCapWT() getDialogPromiser() new(
-					"Caplet failed",
-					`<html>Program runner trace: <br>
-					$stdErr <br>
-					Caplet execution output: <br>
-					$err`, 
-					null,
-					["OK"])
-			}
-				
+            try {
+            def maker := confinedRunner(source)
+            maker new(powerbox)
+            } catch err {
+                powerbox getCapWT() getDialogPromiser() new(
+                    "Caplet failed",
+                    `<html>Program runner trace: <br>
+                    $stdErr <br>
+                    Caplet execution output: <br>
+                    $err`,
+                    null,
+                    ["OK"])
+            }
+
         }
         def bind caplet := launchCaplet(capletSource)
         powerboxController



1.3       +20 -20    e/src/esrc/com/skyhunter/e/security/powerBoxControllerMakerAuthorTester.e

Index: powerBoxControllerMakerAuthorTester.e
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/security/powerBoxControllerMakerAuthorTester.e,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- powerBoxControllerMakerAuthorTester.e	2001/09/12 00:01:50	1.2
+++ powerBoxControllerMakerAuthorTester.e	2001/11/10 19:40:36	1.3
@@ -3,20 +3,20 @@
 
 def traceln := println
 def controllerMaker := <import:com.skyhunter.e.security.powerboxControllerMakerAuthor> run(
-	unsafe__uriGetter, file__uriGetter, interp, traceln, stdout)
+    unsafe__uriGetter, file__uriGetter, interp, traceln, stdout)
 
 traceln("created controller")
 def testCapletAuthor := <import:com.skyhunter.testCaplet.testCapletAuthor>
 traceln("created testcaplet author")
 def testAuthor(powerbox,b,c) :any {
-	def test {
-		to start() {
-			def traceln := powerbox optCap(powerbox TRACELN())
-			traceln("traced external caplet worked")
-		}
-	}
-	test start()
-	test
+    def test {
+        to start() {
+            def traceln := powerbox optCap(powerbox TRACELN())
+            traceln("traced external caplet worked")
+        }
+    }
+    test start()
+    test
 }
 
 traceln("created testAuthor")
@@ -24,7 +24,7 @@
 #test when caplet external
 def extController := controllerMaker new(null, "Test External Caplet",null, "<caps></caps>")
 println("starting external caplet")
-extController startExternalCaplet(testAuthor(extController getPowerbox(), null, null)) 
+extController startExternalCaplet(testAuthor(extController getPowerbox(), null, null))
 println("external caplet started")
 
 #test with caplet in emaker
@@ -35,17 +35,17 @@
 
 # test when powerbox launches
 def controller := controllerMaker new(
-	`def testAuthor(powerbox,b,c) :any {
-	def test {
-		to start() {
-			def traceln := powerbox optCap(powerbox TRACELN())
-			traceln("traced internal caplet with powerbox interpreting source, it worked")
-		}
-	}
-	test start()
-	test
+    `def testAuthor(powerbox,b,c) :any {
+    def test {
+        to start() {
+            def traceln := powerbox optCap(powerbox TRACELN())
+            traceln("traced internal caplet with powerbox interpreting source, it worked")
+        }
+    }
+    test start()
+    test
 }`,
-	"Test Caplet", null, "")
+    "Test Caplet", null, "")
 println("internal caplet started")
 def powerbox := controller getPowerbox()
 #def files := powerbox requestFilesPromise(true, "test dialog", "Just Because!", "", null)



1.5       +35 -10    e/src/esrc/com/skyhunter/e/security/powerboxControllerMakerAuthor.emaker

Index: powerboxControllerMakerAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/security/powerboxControllerMakerAuthor.emaker,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- powerboxControllerMakerAuthor.emaker	2001/10/27 17:27:42	1.4
+++ powerboxControllerMakerAuthor.emaker	2001/11/10 19:40:36	1.5
@@ -8,7 +8,7 @@
         awt__uriGetter, swing__uriGetter)
     def uiKit := <import:com.skyhunter.ex.swing.uiKitAuthor> (awt__uriGetter,swing__uriGetter)
     def runSource := <import:com.skyhunter.e.lang.runConfinedSourceFuncAuthor> run(unsafe__uriGetter, interp, traceln, stdout)
-    
+
     class localURIGetterMaker(directoryCanonicalPath) :near {
         def uriGetter {
             to get(relativePath) :near {
@@ -38,18 +38,34 @@
         //XXX document, when a caplet returns a copy or cut value, that
         //XXX value must implement both transferable and ClipboardOwner
         //XXX as does StringSelection
-        
-        def spinoffCapletSource(source) { 
-            def caplet := runSource(source)
-            traceln("ran source made caplet: " + caplet)
-            def capsPetsVow := <import:com.skyhunter.installer.agreedCapsPetsVowMakerAuthor>(unsafe__uriGetter, file__uriGetter) new(caplet getRequestedCaps(), "")
+
+        def spinoffCapletStream(stream) {
+            def io__uriGetter := <unsafe:java.io.*>
+            traceln("in powerbox spinoff caplet stream")
+            def readableStream := <io:BufferedReader> new(<io:InputStreamReader> new(stream))
+            def sourceBuffer := <unsafe:java.lang.StringBuffer> new()
+            while (true ) {
+                def next := readableStream readLine()
+                if (next == null) {
+                    break()
+                } else {E call(sourceBuffer,  "append(String)", [next + "\n"])}
+            }
+            traceln("finished looping stream")
+            def capletAuthor := runSource(sourceBuffer toString())
+
+            traceln("ran source made caplet: " + capletAuthor)
+            def requests := capletAuthor getRequestedCaps()
+            traceln("requests: " + requests)
+            def capsPetsVow := <import:com.skyhunter.installer.agreedCapsPetsVowMakerAuthor>(unsafe__uriGetter, file__uriGetter) new(requests, "")
             when (capsPetsVow) -> done(capsPets) {
                 traceln("got capsxml for spinoff")
                 def pets := capsPets getPetMap()
-                powerboxControllerMaker new(pets get("Name", "Caplet"), pets get("Icon", null), capsPets getCapsXML())
+                def spunPowerController := powerboxControllerMaker new(pets get("Name", "Caplet"), pets get("Icon", null), capsPets getCapsXML())
+                traceln("got spun power: " + spunPowerController)
+                spunPowerController startExternalCaplet(capletAuthor(spunPowerController getPowerbox(),awt__uriGetter, swing__uriGetter))
             } catch prob {traceln("incomplete installation of spinoff caplet" + prob)}
         }
-        
+
         class powerbarControllerMaker(eFrame) :near {
             def cutFunc() {
                 traceln("about to do cut reaction")
@@ -103,6 +119,12 @@
                         url
                     } else {null}
                 }
+                to relative(url, urlString) :near {
+                    if (agreedUrlsMap maps (url getProtocol())) {
+                        traceln("about to get relative url in powerbox")
+                        <unsafe:java.net.URL> new(url, urlString)
+                    } else {null}
+                }
                 to get(urlString) :near {urlMaker new(urlString)}
                 to getAgreedProtocols() :near {agreedUrlsMap snapshot()}
             }
@@ -135,7 +157,7 @@
                 def powerbarController := powerbarControllerMaker new(frame)
                 def outerContentPane :=
                   JPanel`$contentPane.X.Y
-		         ${powerbarController getPowerPanel()}`
+                         ${powerbarController getPowerPanel()}`
                 myJFrame setContentPane(outerContentPane)
                 frame
             }
@@ -183,6 +205,9 @@
             to subsetPowers(restrictedMap) :near {
                 throw("XXX not yet implemented")
             }
+            to requestFileRcvrsVow(editable, title, justification, startPathText, optFilter) :any {
+                powerbox requestFilesPromise(editable, title, justification, startPathText, optFilter)
+            }
             to requestFilesPromise(editable, title, justification, startPathText, filter) :any {
                 def answer := [] diverge()
                 def chooser := <swing:JFileChooser> new()
@@ -221,7 +246,7 @@
             }
             #XXX remove runSource sometime, when capability-free runconfined source emaker available
             to runSource(sourceText) :any {runSource(sourceText)}
-            to spinoffCapletSource(sourceText) {spinoffCapletSource(sourceText)}
+            to spinoffCapletStream(stream) {spinoffCapletStream(stream)}
             to getGifImage(gifFile) :near {<swing:ImageIcon> new(gifFile) getImage()}
             to CAP_TIMER() :any {"capTimer"}
             to FRAME_MAKER() :any {"frameMaker"}



1.2       +1 -1      e/src/esrc/com/skyhunter/e/util/domFromTextFunc.emaker

Index: domFromTextFunc.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/util/domFromTextFunc.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- domFromTextFunc.emaker	2001/09/12 00:01:51	1.1
+++ domFromTextFunc.emaker	2001/11/10 19:40:36	1.2
@@ -1,4 +1,4 @@
 //Copyright (C) 2001 Combex. All Rights Reserved.
 def domFromText(text) :near {
-	 (sml__quasiParser valueMaker(text) substitute(ListMaker run()))
+     (sml__quasiParser valueMaker(text) substitute(ListMaker run()))
 }



1.2       +44 -44    e/src/esrc/com/skyhunter/e/util/domTreeKit.emaker

Index: domTreeKit.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/util/domTreeKit.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- domTreeKit.emaker	2001/09/12 00:01:51	1.1
+++ domTreeKit.emaker	2001/11/10 19:40:36	1.2
@@ -1,50 +1,50 @@
 //Copyright (C) 2001 Combex. All Rights Reserved.
 def domTreeKit {
-	to domFromText(text) :near {
-		(sml__quasiParser valueMaker(text) substitute(ListMaker run()))
-	}
-	to extractChildNodes(tag, node) :near {
-		def nodes := [] diverge()
-		for each in node {
-			if (each getNodeType() == 1 && 
-				each getTagName() == tag) {
-				nodes push(each)			
-			} 
-		}
-		nodes snapshot()
-	}
+    to domFromText(text) :near {
+        (sml__quasiParser valueMaker(text) substitute(ListMaker run()))
+    }
+    to extractChildNodes(tag, node) :near {
+        def nodes := [] diverge()
+        for each in node {
+            if (each getNodeType() == 1 &&
+                each getTagName() == tag) {
+                nodes push(each)
+            }
+        }
+        nodes snapshot()
+    }
 
-	#returns a map with key=tag and value=textOfTheTag,
-	# where the first character of the key is always capitalized 
-	# (so a tag "foo" would yield a key "Foo")
-	to mapDomText(domTextNodes) :any {
-		def table := [] asKeys() diverge()
-		def nodeText(list) :String {
-			if (list size() == 1) {
-				list[0] getData()
-			} else if (list size() ==0 ) {
-				""
-			} else {
-				//badData, no way to inform
-			}
-		}
-		def visitor {
-			match [verb, args] {
-				if (verb =~ `visit@{theKey}`) {
-					table[theKey] := nodeText(args[0])
-				}
-			}
-		}
-		for each in domTextNodes {each welcome(visitor)}
-		table snapshot()
-	}
-	to xmlFromMap(map) :String {
-		var xml := ""
-		for key => value in map {
-			xml := `$xml<$key>$value</$key>${"\n"}`
-		}
-		xml
-	}
+    #returns a map with key=tag and value=textOfTheTag,
+    # where the first character of the key is always capitalized
+    # (so a tag "foo" would yield a key "Foo")
+    to mapDomText(domTextNodes) :any {
+        def table := [] asKeys() diverge()
+        def nodeText(list) :String {
+            if (list size() == 1) {
+                list[0] getData()
+            } else if (list size() ==0 ) {
+                ""
+            } else {
+                //badData, no way to inform
+            }
+        }
+        def visitor {
+            match [verb, args] {
+                if (verb =~ `visit@{theKey}`) {
+                    table[theKey] := nodeText(args[0])
+                }
+            }
+        }
+        for each in domTextNodes {each welcome(visitor)}
+        table snapshot()
+    }
+    to xmlFromMap(map) :String {
+        var xml := ""
+        for key => value in map {
+            xml := `$xml<$key>$value</$key>${"\n"}`
+        }
+        xml
+    }
 }
 
 



1.2       +8 -8      e/src/esrc/com/skyhunter/e/util/extractChildNodesFunc.emaker

Index: extractChildNodesFunc.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/util/extractChildNodesFunc.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- extractChildNodesFunc.emaker	2001/09/12 00:01:51	1.1
+++ extractChildNodesFunc.emaker	2001/11/10 19:40:36	1.2
@@ -1,12 +1,12 @@
 def extractChildNodes(tag, node) :near {
-	def nodes := [] diverge()
-	for each in node {
-		if (each getNodeType() == 1 && 
-			each getTagName() == tag) {
-			nodes push(each)			
-		} 
-	}
-	nodes snapshot()
+    def nodes := [] diverge()
+    for each in node {
+        if (each getNodeType() == 1 &&
+            each getTagName() == tag) {
+            nodes push(each)
+        }
+    }
+    nodes snapshot()
 }
 
  #def tree := sml`<a> <b> <c>blah</c></b></a>`



1.3       +20 -20    e/src/esrc/com/skyhunter/e/util/mapDomText.emaker

Index: mapDomText.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/util/mapDomText.emaker,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mapDomText.emaker	2001/09/12 00:01:51	1.2
+++ mapDomText.emaker	2001/11/10 19:40:36	1.3
@@ -1,26 +1,26 @@
 //Copyright (C) 2001 Combex. All Rights Reserved.
 #returns a map with key=tag and value=textOfTheTag,
-# where the first character of the key is always capitalized 
+# where the first character of the key is always capitalized
 # (so a tag "foo" would yield a key "Foo")
 
 def mapDomText(domTextNodes) :any {
-	def table := [] asKeys() diverge()
-	def nodeText(list) :String {
-		if (list size() == 1) {
-			list[0] getData()
-		} else if (list size() ==0 ) {
-			""
-		} else {
-			//badData, no way to inform
-		}
-	}
-	def visitor {
-		match [verb, args] {
-			if (verb =~ `visit@{theKey}`) {
-				table[theKey] := nodeText(args[0])
-			}
-		}
-	}
-	for each in domTextNodes {each welcome(visitor)}
-	table snapshot()
+    def table := [] asKeys() diverge()
+    def nodeText(list) :String {
+        if (list size() == 1) {
+            list[0] getData()
+        } else if (list size() ==0 ) {
+            ""
+        } else {
+            //badData, no way to inform
+        }
+    }
+    def visitor {
+        match [verb, args] {
+            if (verb =~ `visit@{theKey}`) {
+                table[theKey] := nodeText(args[0])
+            }
+        }
+    }
+    for each in domTextNodes {each welcome(visitor)}
+    table snapshot()
 }



1.2       +19 -19    e/src/esrc/com/skyhunter/e/util/mapDomTextFunc.emaker

Index: mapDomTextFunc.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/util/mapDomTextFunc.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mapDomTextFunc.emaker	2001/09/12 00:01:51	1.1
+++ mapDomTextFunc.emaker	2001/11/10 19:40:36	1.2
@@ -1,22 +1,22 @@
 //Copyright (C) 2001 Combex. All Rights Reserved.
 def mapDomText(domTextNodes) :any {
-	def table := [] asKeys() diverge()
-	def nodeText(list) :String {
-		if (list size() == 1) {
-			list[0] getData()
-		} else if (list size() ==0 ) {
-			""
-		} else {
-			//badData, no way to inform
-		}
-	}
-	def visitor {
-		match [verb, args] {
-			if (verb =~ `visit@{theKey}`) {
-				table[theKey] := nodeText(args[0])
-			}
-		}
-	}
-	for each in domTextNodes {each welcome(visitor)}
-	table snapshot()
+    def table := [] asKeys() diverge()
+    def nodeText(list) :String {
+        if (list size() == 1) {
+            list[0] getData()
+        } else if (list size() ==0 ) {
+            ""
+        } else {
+            //badData, no way to inform
+        }
+    }
+    def visitor {
+        match [verb, args] {
+            if (verb =~ `visit@{theKey}`) {
+                table[theKey] := nodeText(args[0])
+            }
+        }
+    }
+    for each in domTextNodes {each welcome(visitor)}
+    table snapshot()
 }



1.2       +3 -3      e/src/esrc/com/skyhunter/e/util/testDomTreeKit.e

Index: testDomTreeKit.e
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/util/testDomTreeKit.e,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- testDomTreeKit.e	2001/09/12 00:01:51	1.1
+++ testDomTreeKit.e	2001/11/10 19:40:36	1.2
@@ -1,9 +1,9 @@
 println("started test")
 def domTreeKit := <import:com.skyhunter.e.util.domTreeKit>
 def kitTest() {
-	def tree := sml`<a> <b> <c>blah</c></b></a>`
-	println("b of Tree: " + domTreeKit extractChildNodes("b", tree))
-	println("xmlFromMap: " + domTreeKit xmlFromMap(["A" => "1", "b" => "2"]))
+    def tree := sml`<a> <b> <c>blah</c></b></a>`
+    println("b of Tree: " + domTreeKit extractChildNodes("b", tree))
+    println("xmlFromMap: " + domTreeKit xmlFromMap(["A" => "1", "b" => "2"]))
 }
 kitTest()
 



1.7       +9 -9      e/src/esrc/com/skyhunter/e/util/timer.e

Index: timer.e
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/e/util/timer.e,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- timer.e	2001/09/12 00:01:51	1.6
+++ timer.e	2001/11/10 19:40:36	1.7
@@ -2,14 +2,14 @@
 
 //The actionTrio must be a list [target,"verb",[args]]
 def doAfter(seconds,actionTrio) :any {
-	def actionWrapper {
-		to run() {
-			#traceln("stopwatch: performing action" + actionTrio)
-			E call(actionTrio[0], actionTrio[1], actionTrio[2])
-			#traceln("stopwatch: action performed")
-		}
-	}
-	def timer := <import:org.erights.e.extern.timer.Timer> theTimer
-	timer after(seconds * 1000, actionWrapper)
+    def actionWrapper {
+        to run() {
+            #traceln("stopwatch: performing action" + actionTrio)
+            E call(actionTrio[0], actionTrio[1], actionTrio[2])
+            #traceln("stopwatch: action performed")
+        }
+    }
+    def timer := <import:org.erights.e.extern.timer.Timer> theTimer
+    timer after(seconds * 1000, actionWrapper)
 }
 



1.2       +21 -21    e/src/esrc/com/skyhunter/eDesk/capLauncherAuthor.emaker

Index: capLauncherAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/eDesk/capLauncherAuthor.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- capLauncherAuthor.emaker	2001/09/12 00:01:51	1.1
+++ capLauncherAuthor.emaker	2001/11/10 19:40:36	1.2
@@ -2,26 +2,26 @@
 //Copyright (C) 2001 Combex. All Rights Reserved.
 
 def capletLauncherAuthor(unsafe__uriGetter, file__uriGetter, interp, stdout) :any {
-	def swing__uriGetter := <unsafe:javax.swing.*>
-	def awt__uriGetter := <unsafe:java.awt.*>
-	def uiKit := <import:com.skyhunter.ex.swing.uiToolsAuthor> run(awt__uriGetter, swing__uriGetter)
-	def traceOut := <unsafe:java.lang.System> out()
-	def trace(text) {E call(traceOut, "print(Object)", [text])}
-	def traceln(text) {trace(text + "\n")}
+    def swing__uriGetter := <unsafe:javax.swing.*>
+    def awt__uriGetter := <unsafe:java.awt.*>
+    def uiKit := <import:com.skyhunter.ex.swing.uiToolsAuthor> run(awt__uriGetter, swing__uriGetter)
+    def traceOut := <unsafe:java.lang.System> out()
+    def trace(text) {E call(traceOut, "print(Object)", [text])}
+    def traceln(text) {trace(text + "\n")}
 
-	def launchCaplet(capletSourceFile) :any {
-		#def sourcePath := capletSourceFile getCanonicalPath()
-		#def capletNameRoot := capletSourceFile nameRoot???
-		#def sourceDir := capletSourceFile getDir()
-		#if (!(<file:installedApps> exists())) {<unsafe:java.io.File> mkdir("installedApps")}
-		#def outFile := <file: (capletNameRoot + year + month + day + hour + min + ".run")>
-		#def capletAuthor := <import:com.skyhunter.RUNSOURCE> run(capletSourceFile getText())
-		#def agreedCapsPromiser := <import:com.skyhunter.installer.agreedCapsXMLPromiserAuthor> run(
-		#	unsafe__uriGetter, file__uriGetter)
-		#def capsXMLVow := agreedCapsPromiser(capletAuthor getRequestedCaps())
-		#when (capsXMLVow) -> done(capsXML) {
-		#	outFile setText(capsXML)
-		#	mapInstalledRunFile(outFile)
-		#} catch prob {traceln("capsXML lost: " + prob)}
-	}
+    def launchCaplet(capletSourceFile) :any {
+        #def sourcePath := capletSourceFile getCanonicalPath()
+        #def capletNameRoot := capletSourceFile nameRoot???
+        #def sourceDir := capletSourceFile getDir()
+        #if (!(<file:installedApps> exists())) {<unsafe:java.io.File> mkdir("installedApps")}
+        #def outFile := <file: (capletNameRoot + year + month + day + hour + min + ".run")>
+        #def capletAuthor := <import:com.skyhunter.RUNSOURCE> run(capletSourceFile getText())
+        #def agreedCapsPromiser := <import:com.skyhunter.installer.agreedCapsXMLPromiserAuthor> run(
+        #    unsafe__uriGetter, file__uriGetter)
+        #def capsXMLVow := agreedCapsPromiser(capletAuthor getRequestedCaps())
+        #when (capsXMLVow) -> done(capsXML) {
+        #    outFile setText(capsXML)
+        #    mapInstalledRunFile(outFile)
+        #} catch prob {traceln("capsXML lost: " + prob)}
+    }
 }



1.2       +65 -62    e/src/esrc/com/skyhunter/eDesk/installedAppsManagerMaker.emaker

Index: installedAppsManagerMaker.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/eDesk/installedAppsManagerMaker.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- installedAppsManagerMaker.emaker	2001/09/12 00:01:51	1.1
+++ installedAppsManagerMaker.emaker	2001/11/10 19:40:36	1.2
@@ -1,64 +1,67 @@
 class installedAppsManagerMaker (appsXMLFile, traceln) :near {
-	def domTreeKit := <import:com.skyhunter.e.util.domTreeKit>
-	var appMapsBySourcePath := [] asKeys() diverge()
-	var appMapsByPetExtension := [] asKeys() diverge()
-	var appMapsByPetName := [] asKeys() diverge()
-	def addAppMap(map) {
-		appMapsBySourcePath[map["SourcePath"]] := map
-		if (map maps ("Suffix")) {appMapsByPetExtension[map["Suffix"]] := map}
-		if (map maps ("Name")) {appMapsByPetName[map["Name"]] := map}
-	}
-	def loadApps() {
-		appMapsBySourcePath := [] asKeys() diverge()
-		appMapsByPetExtension := [] asKeys() diverge()
-		appMapsByPetName := [] asKeys() diverge()
-		#traceln("about to get domm tree in appsManager loadapps: " + appsXMLFile getText())
-		def appsTree := domTreeKit domFromText(appsXMLFile getText())
-		#traceln("got dom tree in appsManager loadapps: " + appsTree)
-		#traceln("apps from tree: " + domTreeKit extractChildNodes("app", appsTree[0]))
-		for each in domTreeKit extractChildNodes("app", appsTree[0]) {
-			def nextAppMap := domTreeKit mapDomText(each)
-			addAppMap(nextAppMap)		
-		}
-		traceln("got app map in apps manager: " + appMapsBySourcePath)	
-	}
-	def saveApps() {
-		traceln("into saveApps in appsManager, appMaps: " + appMapsBySourcePath)
-		var xml := "<installed>\n"
-		for each in appMapsBySourcePath {
-			xml+= `<app>${"\n"}${domTreeKit xmlFromMap(each)}</app>` 
-		}
-		xml += "</installed>"
-		appsXMLFile setText(xml)
-		traceln("just set appsxmlfile text: " + xml)
-		traceln("the appsxmlfile is: " + appsXMLFile getCanonicalPath())
-	}
-	loadApps()
-	def installedAppsManager {
-		to getAppBySourcePath(path) :near {
-			traceln("getAppBySource: " + path)
-			#traceln("from appMaps: " + appMapsBySourcePath)
-			#appMapsBySourcePath[path]
-			appMapsBySourcePath[path]
-		}
-		to optAppBySourcePath(path) :near {appMapsBySourcePath get(path, null)}
-		to getAppPetNames() :pbc {
-			def names := [] diverge()
-			for each => value in appMapsByPetName {
-				names push(each)
-			}
-			names snapshot()
-		}
-		to optAppByPetName(name) :near {
-			traceln("optAppByPetname name: " + name)
-			appMapsByPetName get(name, null)
-		} 
-		to reload() {loadApps()}
-		to save() {saveApps()}
-		to addApp(appMap) {
-			addAppMap(appMap) 
-			saveApps()
-		}
-		to removeAppBySourcePath(sourcePath) {}
-	}
+    def domTreeKit := <import:com.skyhunter.e.util.domTreeKit>
+    var appMapsBySourcePath := [] asKeys() diverge()
+    var appMapsByPetExtension := [] asKeys() diverge()
+    var appMapsByPetName := [] asKeys() diverge()
+    def addAppMap(map) {
+        appMapsBySourcePath[map["SourcePath"]] := map
+        if (map maps ("Suffix")) {appMapsByPetExtension[map["Suffix"]] := map}
+        if (map maps ("Name")) {appMapsByPetName[map["Name"]] := map}
+    }
+    def loadApps() {
+        appMapsBySourcePath := [] asKeys() diverge()
+        appMapsByPetExtension := [] asKeys() diverge()
+        appMapsByPetName := [] asKeys() diverge()
+        #traceln("about to get domm tree in appsManager loadapps: " + appsXMLFile getText())
+        def appsTree := domTreeKit domFromText(appsXMLFile getText())
+        #traceln("got dom tree in appsManager loadapps: " + appsTree)
+        #traceln("apps from tree: " + domTreeKit extractChildNodes("app", appsTree[0]))
+        for each in domTreeKit extractChildNodes("app", appsTree[0]) {
+            def nextAppMap := domTreeKit mapDomText(each)
+            addAppMap(nextAppMap)
+        }
+        traceln("got app map in apps manager: " + appMapsBySourcePath)
+    }
+    def saveApps() {
+        traceln("into saveApps in appsManager, appMaps: " + appMapsBySourcePath)
+        var xml := "<installed>\n"
+        for each in appMapsBySourcePath {
+            xml+= `<app>${"\n"}${domTreeKit xmlFromMap(each)}</app>`
+        }
+        xml += "</installed>"
+        appsXMLFile setText(xml)
+        traceln("just set appsxmlfile text: " + xml)
+        traceln("the appsxmlfile is: " + appsXMLFile getCanonicalPath())
+    }
+    loadApps()
+    def installedAppsManager {
+        to getAppBySourcePath(path) :near {
+            traceln("getAppBySource: " + path)
+            #traceln("from appMaps: " + appMapsBySourcePath)
+            #appMapsBySourcePath[path]
+            appMapsBySourcePath[path]
+        }
+        to optAppBySourcePath(path) :near {appMapsBySourcePath get(path, null)}
+        to getAppPetNames() :pbc {
+            def names := [] diverge()
+            for each => value in appMapsByPetName {
+                names push(each)
+            }
+            names snapshot()
+        }
+        to optAppByPetName(name) :near {
+            traceln("optAppByPetname name: " + name)
+            appMapsByPetName get(name, null)
+        }
+        to optAppByPetSuffix(suffix) :near {
+            appMapsByPetExtension get(suffix, null)
+        }
+        to reload() {loadApps()}
+        to save() {saveApps()}
+        to addApp(appMap) {
+            addAppMap(appMap)
+            saveApps()
+        }
+        to removeAppBySourcePath(sourcePath) {}
+    }
 }



1.2       +15 -6     e/src/esrc/com/skyhunter/eDesk/navPanelControllerMakerAuthor.emaker

Index: navPanelControllerMakerAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/eDesk/navPanelControllerMakerAuthor.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- navPanelControllerMakerAuthor.emaker	2001/10/27 17:34:08	1.1
+++ navPanelControllerMakerAuthor.emaker	2001/11/10 19:40:36	1.2
@@ -65,7 +65,7 @@
         }
     }
     
-    class cellMaker(var name, isDir) :near {
+    class cellMaker(var name, isDir, suffixMapper) :near {
         var component := null
         var label := null
         var icon := null
@@ -75,7 +75,16 @@
                 if (component != null) {
                     component
                 } else {
-                    icon := if (isDir) {dirIcon} else {unAssociatedIcon}
+                    var icon := unAssociatedIcon
+                    if (isDir) {
+                        icon := dirIcon
+                    } else { 
+                        def optApp := suffixMapper optAppByPetSuffix(computeSuffix(name)) 
+                        if (optApp != null) {
+                            traceln ("found suffix app: " + optApp)
+                            icon := <swing:ImageIcon> new(optApp["Icon"])
+                        } 
+                    }
                     iconPane := <swing:JLabel> new(icon)
                     iconPane setIcon(icon)
                     label := <swing:JTextField> new(name)
@@ -94,13 +103,13 @@
         }
     }
     
-    def composeCellArray(dirsFiles) :pbc {
+    def composeCellArray(dirsFiles, suffixMapper) :pbc {
         def list := [] diverge()
         for each in dirsFiles[0] {
-            list push(cellMaker new(each, true))
+            list push(cellMaker new(each, true, suffixMapper))
         }
         for each in dirsFiles[1] {
-            list push(cellMaker new(each, false))
+            list push(cellMaker new(each, false, suffixMapper))
         }
         list snapshot()
     }
@@ -158,7 +167,7 @@
                 def dirsVow := recentFilesListVow (diskNavRcvr <- listCurrentSubdirectoriesAndFiles())
                 when (dirsVow, currentPathVow) -> done(dirsFilesTuple, currentPath) {
                     locationLabel setText(dirNameFromPath(currentPath))
-                    listPanel setListData(composeCellArray(dirsFilesTuple))
+                    listPanel setListData(composeCellArray(dirsFilesTuple, suffixMapper))
                     windowController setStatus("Refresh done.")
                 } catch err {
                     #connectionWarning("Screen Refresh Failed\n" + err)



1.2       +23 -23    e/src/esrc/com/skyhunter/eDesk/progressWindowMakerAuthor.emaker

Index: progressWindowMakerAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/eDesk/progressWindowMakerAuthor.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- progressWindowMakerAuthor.emaker	2001/09/12 00:01:51	1.1
+++ progressWindowMakerAuthor.emaker	2001/11/10 19:40:36	1.2
@@ -1,25 +1,25 @@
 def progressWindowMakerAuthor(swing__uriGetter, standardWindow) :near {
-	class progressWindowMaker(title) :near {
-		var fileSize := 1000000000
-		def progressWindow
-		def myFrame := standardWindow(title,progressWindow)
-		def myProgressPane := <swing:JProgressBar> new()
-		myProgressPane setStringPainted(true)
-		myFrame getContentPane() add(myProgressPane)
-		myFrame pack()
-		myFrame setSize(150,50)
-		myFrame show()
-		def bind progressWindow {
-			to setProgress(amountCopied) {
-				def percent := (amountCopied *100) _/ fileSize
-				myProgressPane setValue(percent)
-				myProgressPane setString(`$percent%`)
-			}
-			to setFileSize(size) {
-				fileSize := size
-			}
-			to windowClosing() {}
-			to closeWindow() {myFrame dispose()}
-		}
-	}
+    class progressWindowMaker(title) :near {
+        var fileSize := 1000000000
+        def progressWindow
+        def myFrame := standardWindow(title,progressWindow)
+        def myProgressPane := <swing:JProgressBar> new()
+        myProgressPane setStringPainted(true)
+        myFrame getContentPane() add(myProgressPane)
+        myFrame pack()
+        myFrame setSize(150,50)
+        myFrame show()
+        def bind progressWindow {
+            to setProgress(amountCopied) {
+                def percent := (amountCopied *100) _/ fileSize
+                myProgressPane setValue(percent)
+                myProgressPane setString(`$percent%`)
+            }
+            to setFileSize(size) {
+                fileSize := size
+            }
+            to windowClosing() {}
+            to closeWindow() {myFrame dispose()}
+        }
+    }
 }



1.2       +17 -17    e/src/esrc/com/skyhunter/eDesk/serverDescVowAuthor.emaker

Index: serverDescVowAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/eDesk/serverDescVowAuthor.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- serverDescVowAuthor.emaker	2001/10/27 17:34:08	1.1
+++ serverDescVowAuthor.emaker	2001/11/10 19:40:36	1.2
@@ -12,7 +12,7 @@
 //**********
 
 def serverDescVowAuthor(unsafe__uriGetter, awt__uriGetter, swing__uriGetter, frameMaker, traceln) :any {
-    
+
     def JPanel__quasiParser := <import:org.erights.ex.swing.JPanelQParserMaker> new(awt__uriGetter, swing__uriGetter)
     def promiseAllResolved := <import:com.skyhunter.e.net.promiseAllResolved>
     #def uriTools := <import:com.skyhunter.e.net.uriToolsAuthor>(introducer,
@@ -24,14 +24,14 @@
         swing__uriGetter,
         JPanel__quasiParser,
         frameMaker)
-    
+
     #integer string converter
     def toInt(numString) :near {(<unsafe:java.lang.Integer> new(numString)) intValue()}
-    
+
     #****** Configurator Specific Code ***********
-    
+
     def mainFrame := frameMaker new()
-    def [configVow, configSolver] := PromiseMaker() 
+    def [configVow, configSolver] := PromiseMaker()
     def configReady
     def windowTitleField := <swing:JTextField> new("My eDesk Server")
     def rootPathField := <swing:JTextField> new()
@@ -46,16 +46,16 @@
     def okButton := uiSet newButton("OK",configReady)
     def l(text) :near {<swing:JLabel> new(text)}
     def formPane :=
-      JPanel`${l("Browser-Window Title")}          $windowTitleField.X
-		${l("Home Path")}                   $homePathField.X
-		$serverOnlyBox                      >
-		${l("   Write Capability To")}      $capFileField.X 
-		${l(" ")}                           >
-		${l("    Security Configuration")}  >      
-		$isReadOnlyBox                      >      
-		${l("Top Accessible Directory")}    $rootPathField.X 
-		$okButton                           > `
-    
+      JPanel`${l("Browser-Window Title")}        $windowTitleField.X
+             ${l("Home Path")}                   $homePathField.X
+             $serverOnlyBox                      >
+             ${l("   Write Capability To")}      $capFileField.X
+             ${l(" ")}                           >
+             ${l("    Security Configuration")}  >
+             $isReadOnlyBox                      >
+             ${l("Top Accessible Directory")}    $rootPathField.X
+             $okButton                           > `
+
     traceln("config form about to make window")
     #create form window
     def mainPane := mainFrame getContentPane()
@@ -65,7 +65,7 @@
     mainFrame pack()
     #mainFrame setSize(400,200)
     mainFrame show()
-    
+
     def bind configReady() {
         #traceln("made it")
         configSolver resolve (`
@@ -80,6 +80,6 @@
             `)
         mainFrame dispose()
     }
-    
+
     configVow
 }



1.2       +6 -2      e/src/esrc/com/skyhunter/eDesk/icons/folder.gif

Index: folder.gif
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/eDesk/icons/folder.gif,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
Binary files /tmp/cvsrcomX2 and /tmp/cvserUsSV differ



1.1                  e/src/esrc/com/skyhunter/eDesk/icons/folderOld.gif

Index: folderOld.gif
===================================================================
GIF89a
0j1S	HJ*ëX


1.3       +2 -2      e/src/esrc/com/skyhunter/ex/swing/capFrameMakerAuthor.emaker

Index: capFrameMakerAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/ex/swing/capFrameMakerAuthor.emaker,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- capFrameMakerAuthor.emaker	2001/09/12 00:01:51	1.2
+++ capFrameMakerAuthor.emaker	2001/11/10 19:40:36	1.3
@@ -46,7 +46,7 @@
 
     class capFrameMaker() :near {
         def innerFrame := <swing:JFrame> new()
-		if (appImage != null) {innerFrame setIconImage(appImage)}
+        if (appImage != null) {innerFrame setIconImage(appImage)}
         innerFrame setTitle(appTitle)
         def contentPane := <swing:JPanel> new()
         def powerPane := <swing:JPanel> new()
@@ -71,6 +71,6 @@
 }
 
 #def powerbox {match [verb,arg] {}}
-#def maker := capFrameMakerAuthor(powerbox, <swing:JFrame>, null, "test") 
+#def maker := capFrameMakerAuthor(powerbox, <swing:JFrame>, null, "test")
 #def win := maker new()
 #win show()



1.2       +6 -6      e/src/esrc/com/skyhunter/ex/swing/dialogVowMakerAuthor.emaker

Index: dialogVowMakerAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/ex/swing/dialogVowMakerAuthor.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dialogVowMakerAuthor.emaker	2001/09/12 00:01:51	1.1
+++ dialogVowMakerAuthor.emaker	2001/11/10 19:40:36	1.2
@@ -11,11 +11,11 @@
 //**********
 
 //XXX fix this author to require only jframe when capwt is working
-def dialogVowMakerAuthor (awt__uriGetter, swing__uriGetter, dummyJPanel, frameMaker) :near  {   
+def dialogVowMakerAuthor (awt__uriGetter, swing__uriGetter, dummyJPanel, frameMaker) :near  {
     def JPanel__quasiParser := <import:org.erights.ex.swing.JPanelQParserMaker> new(
         awt__uriGetter, swing__uriGetter)
     def uiTools := <import:com.skyhunter.ex.swing.uiToolsAuthor> (awt__uriGetter, swing__uriGetter)
-    
+
     class dialogPromiser (title, label, textFieldDefaultValue, buttonNames) :any {
         var myClickedButton := null
         def [finishedDialogPromise, resolver] := PromiseMaker()
@@ -28,9 +28,9 @@
                 }
                 to windowClosed(event) {
                     if (undisposed) {
-		myWin dispose()
-		undisposed := false
-	     }
+        myWin dispose()
+        undisposed := false
+         }
                 }
                 match _ {}
             }
@@ -68,7 +68,7 @@
             $buttonPane `
             #traceln("made buttons")
             def border := <awt:BorderLayout> new()
-            mainPane setLayout(border)            
+            mainPane setLayout(border)
             mainPane add(dialogPane, "Center")
             myWin pack()
             myWin show()



1.4       +25 -25    e/src/esrc/com/skyhunter/ex/swing/standardWindowMakerAuthor.emaker

Index: standardWindowMakerAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/ex/swing/standardWindowMakerAuthor.emaker,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- standardWindowMakerAuthor.emaker	2001/09/12 00:01:51	1.3
+++ standardWindowMakerAuthor.emaker	2001/11/10 19:40:36	1.4
@@ -1,29 +1,29 @@
 def standardWindowMakerAuthor(interp, frameMaker) :near {
-	//close whole app when windowset returns to zero size
-	def windowSet := [] asKeys() diverge()
-	def standardWindowMaker (title, windowClosingHandler) :near {
-		var undisposed := true
-		def mainFrame := frameMaker new(title)
-		windowSet[mainFrame] := mainFrame
-		def windowListener {
-			to windowClosing(event) {
-				windowClosingHandler windowClosing()
-			}
-			to windowClosed(event) {
-				windowSet removeKey(mainFrame)
-				if (undisposed) {
-					mainFrame dispose()
-					undisposed := false
-				}
-				if (windowSet size() == 0) {
-					interp continueAtTop()
-				}
-			}
-			match _ {}
-		}
-		mainFrame addWindowListener(windowListener)
-		mainFrame
-	}
+    //close whole app when windowset returns to zero size
+    def windowSet := [] asKeys() diverge()
+    def standardWindowMaker (title, windowClosingHandler) :near {
+        var undisposed := true
+        def mainFrame := frameMaker new(title)
+        windowSet[mainFrame] := mainFrame
+        def windowListener {
+            to windowClosing(event) {
+                windowClosingHandler windowClosing()
+            }
+            to windowClosed(event) {
+                windowSet removeKey(mainFrame)
+                if (undisposed) {
+                    mainFrame dispose()
+                    undisposed := false
+                }
+                if (windowSet size() == 0) {
+                    interp continueAtTop()
+                }
+            }
+            match _ {}
+        }
+        mainFrame addWindowListener(windowListener)
+        mainFrame
+    }
 }
 
 



1.3       +70 -65    e/src/esrc/com/skyhunter/installer/agreedCapsPetsVowMakerAuthor.emaker

Index: agreedCapsPetsVowMakerAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/installer/agreedCapsPetsVowMakerAuthor.emaker,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- agreedCapsPetsVowMakerAuthor.emaker	2001/10/27 17:27:42	1.2
+++ agreedCapsPetsVowMakerAuthor.emaker	2001/11/10 19:40:37	1.3
@@ -13,9 +13,9 @@
     def winImage := <swing:ImageIcon> new(
         <resource:com/skyhunter/eDesk/icons/super.gif>) getImage()
     def lbl(contents) :near { <swing:JLabel> new(contents)}
-    
+
     def mapDomText := <import:com.skyhunter.e.util.mapDomText>
-    
+
     class capsPetsMaker(capsXML,petMap) :near {
         def capsPets {
             to getCapsXML() :String {capsXML}
@@ -39,7 +39,7 @@
         var petIconField := lbl(" ")
         #petListPanel setLayout(<awt:GridLayout> new(3,2))
         def capTabsPane := <swing:JTabbedPane> new()
-        
+
         def buildPetIconSelectionPane(defaultsTable) :near {
             def tempPath := baseDirPath + defaultsTable["Icon"]
             var iconPath := <file: tempPath> getCanonicalPath()
@@ -47,10 +47,10 @@
             def pathLabel := <swing:JLabel> new(iconPath)
             petFieldsMap["Icon"] := pathLabel
             def icon := <swing:ImageIcon> new(
-                <unsafe:java.net.URL> new("file:" + iconPath)) 
+                <unsafe:java.net.URL> new("file:" + iconPath))
             def iconLabel := <swing:JLabel> new(icon)
             def changeIconFunc() {
-                def dialog := <awt:FileDialog> new(<swing:JFrame> new(), 
+                def dialog := <awt:FileDialog> new(<swing:JFrame> new(),
                                                    "Select Icon For This Caplet",
                                                    0)
                 dialog show()
@@ -62,45 +62,45 @@
                         <unsafe:java.net.URL> new("file:" + iconPath))
                     iconLabel setIcon(newIcon)
                 }
-            
+
             }
             def newIconB := uiKit newButton("Change Icons",changeIconFunc)
             traceln("about to build JPanel")
             JPanel`$iconLabel $pathLabel    >
                    V          $newIconB     ${lbl(" ")}.X  `
         }
-        
+
         def protocolsVisitor {
             to visitProtocol(subnodes) {
                 def table := mapDomText(subnodes)
                 traceln("table: " + table)
                 #if (validUrlProtocols maps(table["Name"])) {
-                    def protocolCheck := <swing:JCheckBox> new(table["Name"])
-                    def whyLabel := <swing:JLabel> new(table["Why"])
-                    def protocolPane := JPanel`$protocolCheck $whyLabel.X`
-                    def clickedRunner() {
-                        traceln("into clickedRunner")
-                        if (protocolCheck isEnabled()) {
-                            agreedUrlProtocols[table["Name"]] := null
-                        } else {
-                            agreedUrlProtocols removeKey(table["Name"])
-                        }
-                        traceln("did clickedRunner: " + agreedUrlProtocols)
+                def protocolCheck := <swing:JCheckBox> new(table["Name"])
+                def whyLabel := <swing:JLabel> new(table["Why"])
+                def protocolPane := JPanel`$protocolCheck $whyLabel.X`
+                def clickedRunner() {
+                    traceln("into clickedRunner")
+                    if (protocolCheck isEnabled()) {
+                        agreedUrlProtocols[table["Name"]] := null
+                    } else {
+                        agreedUrlProtocols removeKey(table["Name"])
                     }
-                    uiKit attachAction(protocolCheck, clickedRunner)
-                    urlProtocolsListPanel add(protocolPane)
+                    traceln("did clickedRunner: " + agreedUrlProtocols)
+                }
+                uiKit attachAction(protocolCheck, clickedRunner)
+                urlProtocolsListPanel add(protocolPane)
                 #} else {traceln("invalid protocol: " + table["Name"])}
             }
             to viewText(text) {}
         }
-        
+
         def requestsVisitor {
             to visitUrlProtocols(subnodes) {
                 for each in subnodes {each welcome(protocolsVisitor)}
                 def helpLabel := <swing:JLabel> new(stringDataKit  getUrlProtocolHelp())
                 def urlProtocolsMainPanel :=
                   JPanel`$urlProtocolsListPanel
-				$helpLabel.Y`
+                $helpLabel.Y`
                 urlProtocolsMainPanel setName("Web")
                 capTabsPane add(urlProtocolsMainPanel)
             }
@@ -119,28 +119,28 @@
                     #insertLabelFieldPair("Pet Name:", "Name")
                     petNameLabel := lbl("Pet Name: ")
                     petNameField := <swing:JTextField> new(table["Name"])
-                    petFieldsMap["Name"] := petNameField  
+                    petFieldsMap["Name"] := petNameField
                     petTabNeeded := true
                 }
                 if (table maps("Suffix")) {
                     #insertLabelFieldPair("Default File Extension: ", "Suffix")
                     petSuffixLabel  := lbl("Default File Extension: ")
                     petSuffixField  := <swing:JTextField> new(table["Suffix"])
-                    petFieldsMap["Suffix"] := petSuffixField 
+                    petFieldsMap["Suffix"] := petSuffixField
                     petTabNeeded := true
                 }
                 if (table maps("Icon")) {
                     #insertLabelFieldPair("Icon Path:", "Icon")
                     #def iconLabel :=
                     petIconLabel  := <swing:JLabel> new("Pet Icon")
-                    petIconField  := buildPetIconSelectionPane(table) 
-                    traceln("addedIconpanel to pet list panel") 
+                    petIconField  := buildPetIconSelectionPane(table)
+                    traceln("addedIconpanel to pet list panel")
                     petTabNeeded := true
                 }
                 if (petTabNeeded) {
                     def helpLabel := <swing:JLabel> new(stringDataKit getPetHelp())
-                    def petListPanel := 
-                        JPanel`$petNameLabel    $petNameField.X
+                    def petListPanel :=
+                      JPanel`$petNameLabel    $petNameField.X
                                ${lbl(" ")}      ${lbl(" ")}
                                $petSuffixLabel  $petSuffixField
                                ${lbl(" ")}      ${lbl(" ")}
@@ -163,44 +163,49 @@
             to viewText(blah) {}
         }
         for each in requestsTree {each welcome(topVisitor)}
-        def frame := <swing:JFrame> new()
-        frame setIconImage(winImage) 
-        def windowListener {
-            to windowClosing(event) {
-                capsSolver smash("Grants not made")
+        if (capTabsPane getComponentCount() > 0) {
+            def frame := <swing:JFrame> new()
+            frame setIconImage(winImage)
+            def windowListener {
+                to windowClosing(event) {
+                    capsSolver smash("Grants not made")
+                    frame dispose()
+                }
+                match [verb, args] {}
+            }
+            frame addWindowListener(windowListener)
+            def grantFunc() {
+                traceln("into grantfunc: " )
                 frame dispose()
-            }
-            match [verb, args] {}
-        }
-        frame addWindowListener(windowListener)
-        def grantFunc() {
-            traceln("into grantfunc: " )
-            frame dispose()
-            var xmlOut := "<caps>"
-            if (agreedUrlProtocols size() > 0) {
-                xmlOut += "<urlProtocols>"
-                for each => dummy in agreedUrlProtocols {
-                    xmlOut += `<protocol>$each</protocol>`
-                }
-                xmlOut += "</urlProtocols>"
-            }
-            xmlOut += "</caps>"
-            def petData := [] asKeys() diverge()
-            for key => value in petFieldsMap {
-                petData[key] := value getText()
-            }
-            capsSolver resolve(capsPetsMaker new(xmlOut,petData snapshot() ) )
-        }
-        def grantButton := uiKit newButton("Finish Installation", grantFunc)
-        def spacer := <swing:JLabel> new(" ")
-        def realPane :=
-          JPanel`$capTabsPane.Y
+                var xmlOut := "<caps>"
+                if (agreedUrlProtocols size() > 0) {
+                    xmlOut += "<urlProtocols>"
+                    for each => dummy in agreedUrlProtocols {
+                        xmlOut += `<protocol>$each</protocol>`
+                    }
+                    xmlOut += "</urlProtocols>"
+                }
+                xmlOut += "</caps>"
+                def petData := [] asKeys() diverge()
+                for key => value in petFieldsMap {
+                    petData[key] := value getText()
+                }
+                capsSolver resolve(capsPetsMaker new(xmlOut,petData snapshot() ) )
+            }
+            def grantButton := uiKit newButton("Finish Installation", grantFunc)
+            def spacer := <swing:JLabel> new(" ")
+            def realPane :=
+              JPanel`$capTabsPane.Y
                 $spacer
-		$grantButton `
-        frame getContentPane() add(realPane)
-        frame pack()
-        frame setSize(600,600)
-        frame show()
+        $grantButton `
+            frame getContentPane() add(realPane)
+            frame pack()
+            frame setSize(600,600)
+            frame show()
+        } else {
+            capsSolver resolve(capsPetsMaker new("<caps></caps>", [] asMap()))
+        }
         capsPromise
+
     }
-} 
+}



1.4       +6 -1      e/src/esrc/com/skyhunter/installer/persistentInstallerAuthor.emaker

Index: persistentInstallerAuthor.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/installer/persistentInstallerAuthor.emaker,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- persistentInstallerAuthor.emaker	2001/10/27 17:27:42	1.3
+++ persistentInstallerAuthor.emaker	2001/11/10 19:40:37	1.4
@@ -56,8 +56,13 @@
                     outFile setText(capsPets getCapsXML() )
                     def appMap := capsPets getPetMap() diverge()
                     traceln("new appMap in persistentInstaller: " + appMap)
-                    appMap["SourcePath"] := capletSourceFile getCanonicalPath()
+                    traceln("sourcepath: " + sourcePath)
+                    #appMap["SourcePath"] := capletSourceFile getCanonicalPath()
+                    appMap["SourcePath"] := sourcePath
+                    
+                    traceln("set source path")
                     appMap["RunPath"] := outFile getCanonicalPath()
+                    traceln("set source and run paths")
                     appsManager addApp(appMap )
                     dialogVowMaker new("Installation Complete",
                                        `<html><center>Installation of <p>$capletNameRoot <p> succeeded</center>`, null, ["OK"])



1.3       +14 -14    e/src/esrc/com/skyhunter/installer/stringDataKit.emaker

Index: stringDataKit.emaker
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/installer/stringDataKit.emaker,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- stringDataKit.emaker	2001/10/27 17:27:42	1.2
+++ stringDataKit.emaker	2001/11/10 19:40:37	1.3
@@ -2,31 +2,31 @@
 //Copyright (C) 2001 Combex. All Rights Reserved.
 
 def stringDataKit {
-	to getUrlProtocolHelp() :String {
-"<html><b><i>Warning! </i></b>The <b>file</b> protocol is very powerful, 
-it can read every file on your disk. It cannot enable a cracker to take control 
+    to getUrlProtocolHelp() :String {
+"<html><b><i>Warning! </i></b>The <b>file</b> protocol is very powerful,
+it can read every file on your disk. It cannot enable a cracker to take control
 of your computer, but it does put all your confidential data at risk if combined with
-any of the other protocols in this tab. 
+any of the other protocols in this tab.
 <p><b>General Rating: </b>Medium-high power <br>
 <b>Legitimate applications: </b> Web browsers, FTP servers, some chat programs
  <br><b>Risks: </b>
-A program granted URL protocols can transmit any data you supply the program to 
-anyone on the network. So be careful about granting both read authority on your 
+A program granted URL protocols can transmit any data you supply the program to
+anyone on the network. So be careful about granting both read authority on your
 confidential files and URL protocols to the same program.<br>
 The program can also receive orders from other people through these protocols.
-<br>These protocols can be used in denial of service attacks on other people by 
+<br>These protocols can be used in denial of service attacks on other people by
 the program.
-<br> URL protocols cannot be directly used to gain control of your computer. However, 
-any attempt to gain control of your system is likely to include a request for these 
+<br> URL protocols cannot be directly used to gain control of your computer. However,
+any attempt to gain control of your system is likely to include a request for these
 protocols so that the attacker can communicate with the suborned system.
 </html>"
-	}
-	to getPetHelp() :String {
+    }
+    to getPetHelp() :String {
 "<html>The Pet Name is your personal name for this program.
-<p> The File Extension is the last part of the names of documents 
+<p> The File Extension is the last part of the names of documents
 which will be opened with this caplet by default
-<p> The Pet Icon is the image that will be placed in the top left 
+<p> The Pet Icon is the image that will be placed in the top left
 corner of all windows opened by this caplet
 </html>"
-	}
+    }
 }



1.2       +2 -2      e/src/esrc/com/skyhunter/installer/testAgreedCapsVow.e

Index: testAgreedCapsVow.e
===================================================================
RCS file: /cvs/e/src/esrc/com/skyhunter/installer/testAgreedCapsVow.e,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- testAgreedCapsVow.e	2001/11/01 06:56:49	1.1
+++ testAgreedCapsVow.e	2001/11/10 19:40:37	1.2
@@ -31,8 +31,8 @@
 
 println(`capPet promise: $capPetvow`)
 when (capPetvow) -> done(capPet) {
-	println("got answer, xml: " + capPet getCapsXML())
-	println("appMap: " + capPet getPetMap())
+    println("got answer, xml: " + capPet getCapsXML())
+    println("appMap: " + capPet getPetMap())
 } catch prob {println("prob: " + prob)}
 
 interp blockAtTop()



1.2       +1 -1      e/src/esrc/org/erights/e/tools/text/abbrev.emaker

Index: abbrev.emaker
===================================================================
RCS file: /cvs/e/src/esrc/org/erights/e/tools/text/abbrev.emaker,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- abbrev.emaker	2001/09/04 10:45:03	1.1
+++ abbrev.emaker	2001/11/10 19:40:37	1.2
@@ -9,7 +9,7 @@
         str
     } else {
         def segLen := budget _/ 2 - 1
-		def restLen := budget - segLen - 3
+        def restLen := budget - segLen - 3
         str(0,segLen) + "..." + str(len - restLen, len)
     }
 }



1.45      +43 -43    e/src/esrc/scripts/eBrowser.e

Index: eBrowser.e
===================================================================
RCS file: /cvs/e/src/esrc/scripts/eBrowser.e,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- eBrowser.e	2001/10/27 17:27:42	1.44
+++ eBrowser.e	2001/11/10 19:40:37	1.45
@@ -44,7 +44,7 @@
     JFrameMaker)
 def setupDrop := <import:com.skyhunter.e.awt.dnd.setupDropFuncAuthor> (
     <awt:dnd.DropTarget>, println)
-    
+
 def StringReaderMaker := <unsafe:java.io.StringReader>
 def textSelectorMaker := <import:org.erights.ex.swing.textSelectorMaker>
 def abbrev := <import:org.erights.e.tools.text.abbrev>
@@ -92,17 +92,17 @@
 def popAboutBox() {
     def props := interp getProps()
     def text := `<html>For Help with eBrowser, see<br>
-	http://www.skyhunter.com/marcs/eBrowserIndex.html<p><p>
+    http://www.skyhunter.com/marcs/eBrowserIndex.html<p><p>
 
-	Copyright 1999 Marc Stiegler. All rights reserved.<br>
-	This software covered by the Mozilla license. For details see<p><p>
+    Copyright 1999 Marc Stiegler. All rights reserved.<br>
+    This software covered by the Mozilla license. For details see<p><p>
 
-	http://www.skyhunter.com/marcs/eBrowser-license.html<p><p>
+    http://www.skyhunter.com/marcs/eBrowser-license.html<p><p>
 
-	OS version: ${props["os.name"]} ${props["os.version"]} on ${props["os.arch"]}<br>
-	Java version: ${props["java.version"]} at ${props["java.home"] replaceAll("\\", "/")}<br>
-	E version: ${props["e.version"]} at ${props["e.home"]}<br>
-	for ${props["user.name"]} in ${props["user.region"]}</html>`
+    OS version: ${props["os.name"]} ${props["os.version"]} on ${props["os.arch"]}<br>
+    Java version: ${props["java.version"]} at ${props["java.home"] replaceAll("\\", "/")}<br>
+    E version: ${props["e.version"]} at ${props["e.home"]}<br>
+    for ${props["user.name"]} in ${props["user.region"]}</html>`
     dialogVowMaker new("About eBrowser", text, null, ["OK"])
 }
 
@@ -350,11 +350,11 @@
             resultPane setText("Execution ended:\n# value: " + result)
             statusPane setText("Execution ended")
             traceln("shown")
-            
+
         } catch problem {
             problemReporter(problem)
         }
-        
+
     }
     interpret <- run()
 }
@@ -487,7 +487,7 @@
             <resource: `com/skyhunter/e/icons/$name`>
         }
     }
-    
+
     def eBrowser
     textModel addFuncsChangedAlertRecipient(eBrowser)
     var closingInProcess := false
@@ -532,7 +532,7 @@
     def runButton :=  newToolButton(
         <icons:run.gif>,
         "Run","executeProgram",eBrowser)
-    
+
     # build text pane
     def textPane := <swing:JTextArea> new()
     textPane setMargin(<awt:Insets> new(0,5,0,10))
@@ -556,7 +556,7 @@
             textModel replaceStubFile(file)
             openFiles [path] := eBrowser
             setTitle()
-            textPane setText(textModel reload()) 
+            textPane setText(textModel reload())
         } else {
             def browser := eBrowserMaker new(textModelMaker new(file))
             openFiles[path] := browser
@@ -567,9 +567,9 @@
             openFile(files[i])
         }
     }
-    setupDrop(textPane, [<awt:datatransfer.DataFlavor> javaFileListFlavor() 
+    setupDrop(textPane, [<awt:datatransfer.DataFlavor> javaFileListFlavor()
         => reactToFilesDrop])
-    
+
     # build variable list pane
     def varListPopup := <swing:JPopupMenu> new("Var Ops")
     addMenuItem(varListPopup,"Insert","insertVar", eBrowser)
@@ -607,7 +607,7 @@
     }
     varListPane addMouseListener(varListPaneListener)
     scrollingVarPane setMinimumSize(<awt:Dimension> new(50, 100))
-    
+
     # build function list pane
     def funcListPane := <swing:JList> new(<unsafe:java.util.Vector> new())
     funcListPane setFont(<awt:Font> new("Monospaced",<awt:Font> PLAIN(),12))
@@ -646,7 +646,7 @@
     #funcListPane setPreferredSize(<awt:Dimension> new(200, 100)) # why no effect?
     #scrollingFuncPane setMinimumSize(<awt:Dimension> new(100, 100))
     #scrollingFuncPane setPreferredSize(<awt:Dimension> new(200, 100)) # why no effect?
-    
+
     # build output viewpane
     def outputPane := <swing:JTextArea> new()
     outputPane setMinimumSize(<awt:Dimension> new(20, 20))
@@ -655,7 +655,7 @@
         <swing:ScrollPaneConstants> VERTICAL_SCROLLBAR_AS_NEEDED(),
         <swing:ScrollPaneConstants> HORIZONTAL_SCROLLBAR_AS_NEEDED())
     scrollingOutputPane getViewport() add(outputPane)
-    
+
     # build splitter panes
     def varLineSplitter := <swing:JSplitPane> new()
     varLineSplitter setLeftComponent(scrollingTextPane)
@@ -666,23 +666,23 @@
     def outLineSplitter := <swing:JSplitPane> new()
     outLineSplitter setLeftComponent(scrollingFuncPane)
     outLineSplitter setRightComponent(outputSplitter)
-    
+
     # build status pane
     def statusPane := E call(<swing:JLabel>, "new(String)",["   "])
     statusPane setFont(<awt:Font> new("Monospaced",<awt:Font> PLAIN(),11))
-    
+
     def s1 := uiTools labelIcon(<icons:separator.gif>)
     def s2 := uiTools labelIcon(<icons:separator.gif>)
     def s3 := uiTools labelIcon(<icons:separator.gif>)
-    
+
     # real pane
     def buttonPane :=
       JPanel`$saveButton $reformatButton $s1 $pasteUpdocButton $elmerButton $s2 $runHiLiteButton $runButton $s3 $gotoButton $findButton  $searchField.X`
     def realPane :=
       JPanel`$buttonPane
-	$outLineSplitter.X.Y
-	$statusPane   `
-    
+    $outLineSplitter.X.Y
+    $statusPane   `
+
     # def text replacer function
     def replaceSelectionHilite(replacement) {
         def location := textPane getSelectionStart()
@@ -691,7 +691,7 @@
         textPane moveCaretPosition(location + replacement size())
         textPane requestFocus()
     }
-    
+
     # menubar
     def newFileFunc() {
         eBrowserMaker new(textModelMaker new(null))
@@ -729,7 +729,7 @@
             }
         }
     }
-    
+
     def makeFontLarger() {
         def oldFont := textPane getFont()
         def newFont := oldFont deriveFont(0.0 + oldFont getSize() + 2.0)
@@ -737,7 +737,7 @@
         funcListPane setFont(newFont)
         varListPane setFont(newFont)
     }
-    
+
     def makeFontSmaller() {
         def oldFont := textPane getFont()
         def newFont := oldFont deriveFont(0.0 + oldFont getSize() - 2.0)
@@ -745,7 +745,7 @@
         funcListPane setFont(newFont)
         varListPane setFont(newFont)
     }
-    
+
     # Option menu
     var capScriptsMaySubstitute := false
     #def substitutionAllowedMenuItem :=
@@ -755,8 +755,8 @@
     #capScriptsMaySubstitute := substitutionAllowedMenuItem getState()
     #}
     #uiTools attachAction(substitutionAllowedMenuItem,toggleSubstitution)
-    
-    
+
+
     # capScript menu
     # scriptEvaluator must be a single-argument receiver, receiving a
     # source text
@@ -800,10 +800,10 @@
     #scriptFolder,
     #def confiner(source) :any {confinedRunner(source, outputPane)})
     #E call(menubar, "add(JMenu)", [capScriptMenu])
-    
+
     #def indentGroup := <swing:ButtonGroup> new()
     #var defaultIndentItem := null
-    
+
     def menuReactor {
         to doNew(){newFileFunc()}
         to doOpen() {openFunc()}
@@ -816,7 +816,7 @@
         to doAbout() {eBrowser about()}
         match [verb,args] {traceln("menu hit for " + verb)}
     }
-    
+
     #make the menus
     def mm := <import:com.skyhunter.ex.swing.menuMakerAuthor> (
         swing__uriGetter,
@@ -843,7 +843,7 @@
     ])
     #defaultIndentItem setSelected(true)
     mainFrame setJMenuBar(menuBar)
-    
+
     # configure and show window
     mainPane add(realPane)
     setTitle()
@@ -857,7 +857,7 @@
     # def width := varLineSplitter getBounds() width()
     E call(varLineSplitter, "setDividerLocation(int)",[600])
     mainFrame show()
-    
+
     def windowActiveListener {
         to windowActivated(e) {
             if (textModel storedVersionIsNewer()) {
@@ -873,24 +873,24 @@
                 if (shouldUpdate == <swing:JOptionPane> YES_OPTION()) {
                     textPane setText(textModel reload())
                 } else {textModel resetSaveTimeNoReload()}
-                
+
             }
         }
         match _ {}
     }
     mainFrame addWindowListener(windowActiveListener)
-    
+
     startOutlineSyncer(farBrowseServerMaker <- new(), textModel, textPane)
-    
+
     def path := textModel getFilePath()
     def textSelector := textSelectorMaker new(textPane, `file:$path`)
     def problemReporter := problemReporterMaker new(textSelector, outputPane, statusPane)
-    
+
     def getTwine() :Twine {
         def reader := StringReaderMaker new(textPane getText())
         reader getTwine(`file:$path`)
     }
-    
+
     var undisposed := true
     def closeCleanly() {
         textModel close()
@@ -899,7 +899,7 @@
             undisposed := false
         }
     }
-    
+
     def bind eBrowser {
         to save() {
             if (textModel saveFileIsSet()) {
@@ -926,7 +926,7 @@
                     startFoundIndex + searchField getText() size())
                 eBrowser setStatus("Found")
                 textPane requestFocus()
-                
+
             } else {eBrowser setStatus("Not Found")}
         }
         to goto() {



1.5       +1 -1      e/src/jsrc/net/ertp/Assay.java

Index: Assay.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/ertp/Assay.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Assay.java	2001/09/06 09:55:39	1.4
+++ Assay.java	2001/11/10 19:40:37	1.5
@@ -105,7 +105,7 @@
      * contain adequate erights to fund the transfer.
      */
     void transfer(Purse src, Purse dest)
-         throws UnsealingException, InsufficientERightsException;
+      throws UnsealingException, InsufficientERightsException;
 
     /**
      * Return -1.0, 0.0, 1.0, or NaN as the erights represented by this Assay



1.5       +7 -2      e/src/jsrc/net/ertp/InsufficientERightsException.java

Index: InsufficientERightsException.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/ertp/InsufficientERightsException.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- InsufficientERightsException.java	2001/09/06 09:55:39	1.4
+++ InsufficientERightsException.java	2001/11/10 19:40:37	1.5
@@ -29,7 +29,12 @@
  * @author <a href="mailto:markm@erights.org">Mark S. Miller</a>
  */
 public class InsufficientERightsException extends Exception {
-    public InsufficientERightsException() {}
-    public InsufficientERightsException(String msg) { super(msg); }
+
+    public InsufficientERightsException() {
+    }
+
+    public InsufficientERightsException(String msg) {
+        super(msg);
+    }
 }
 



1.6       +1 -1      e/src/jsrc/net/ertp/Issuer.java

Index: Issuer.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/ertp/Issuer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Issuer.java	2001/09/06 09:55:39	1.5
+++ Issuer.java	2001/11/10 19:40:37	1.6
@@ -63,7 +63,7 @@
      * @return If so, it returns the candidate.
      * @exception UnsealingException If not, it throws
      UnsealingException.
-    */
+     */
     Object vouch(Object candidate) throws UnsealingException;
 
     /**



1.3       +11 -2     e/src/jsrc/net/vattp/data/AuthSecrets.java

Index: AuthSecrets.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/AuthSecrets.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AuthSecrets.java	2001/10/02 01:29:18	1.2
+++ AuthSecrets.java	2001/11/10 19:40:37	1.3
@@ -27,15 +27,24 @@
  * @author Bill Frantz
  */
 
-/*package*/ class AuthSecrets {
+/*package*/
+class AuthSecrets {
+
     String myEProtocolVersion;
+
     String myProtocolSuite;
+
     byte[] myMacKey;
+
     byte[] myDHSecret;
+
     byte[] myOutgoingSequence;
+
     byte[] myIncomingSequence;
+
+    AuthSecrets() {
+    }
 
-    AuthSecrets() {}
     public String toString() {
         return "EProtocol=" + myEProtocolVersion + " AuthProtocol=" + myProtocolSuite;
     }



1.3       +3 -1      e/src/jsrc/net/vattp/data/ConnectionAttemptFailed.java

Index: ConnectionAttemptFailed.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/ConnectionAttemptFailed.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ConnectionAttemptFailed.java	2001/09/06 09:55:39	1.2
+++ ConnectionAttemptFailed.java	2001/11/10 19:40:37	1.3
@@ -27,7 +27,9 @@
  *
  * @author Bill Frantz
  */
-/*package*/ class ConnectionAttemptFailed extends IOException {
+/*package*/
+class ConnectionAttemptFailed extends IOException {
+
     /*package*/ ConnectionAttemptFailed(String s) {
         super(s);
     }



1.2       +3 -2      e/src/jsrc/net/vattp/data/ConnectionShutDownException.java

Index: ConnectionShutDownException.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/ConnectionShutDownException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ConnectionShutDownException.java	2000/12/21 22:15:18	1.1
+++ ConnectionShutDownException.java	2001/11/10 19:40:37	1.2
@@ -18,11 +18,12 @@
 
 Contributor(s): ______________________________________.
 */
+
 import java.io.IOException;
 
 /**
-   An Exception to report that the connection was shut down normally.
-   @author Bill Frantz
+ An Exception to report that the connection was shut down normally.
+ @author Bill Frantz
  */
 public class ConnectionShutDownException extends IOException {
 



1.6       +149 -132  e/src/jsrc/net/vattp/data/DES.java

Index: DES.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/DES.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DES.java	2001/09/06 09:55:39	1.5
+++ DES.java	2001/11/10 19:40:37	1.6
@@ -1,7 +1,11 @@
 package net.vattp.data;
-// $Id: DES.java,v 1.5 2001/09/06 09:55:39 markm Exp $
+
+// $Id: DES.java,v 1.6 2001/11/10 19:40:37 markm Exp $
 //
 // $Log: DES.java,v $
+// Revision 1.6  2001/11/10 19:40:37  markm
+// tabs, reformatting, little things
+//
 // Revision 1.5  2001/09/06 09:55:39  markm
 // just formatting and import cleanups
 //
@@ -132,7 +136,7 @@
  * <a href="http://www.systemics.com/docs/cryptix/">Cryptix Development Team</a>.
  * <br>All rights reserved.
  *
- * <p><b>$Revision: 1.5 $</b>
+ * <p><b>$Revision: 1.6 $</b>
  * @author  Systemics Ltd
  * @author  Geoffrey Keating (this Java implementation)
  * @author  Eric Young
@@ -148,6 +152,7 @@
 //...........................................................................
 
     static private final boolean DEBUG = true;
+
     static private final int debuglevel = DEBUG ? 1 : 0;
 
 
@@ -159,17 +164,20 @@
 //...........................................................................
 
     static private final int
-        ROUNDS = 16,                        // number of encryption/decryption rounds
-        BLOCK_SIZE = 8,                     // DES block size in bytes
-        KEY_LENGTH = 8,                     // DES key length in bytes
-        INTERNAL_KEY_LENGTH = ROUNDS * 2;   // number of elements in key schedule
+      ROUNDS = 16,                        // number of encryption/decryption rounds
+    BLOCK_SIZE = 8,                     // DES block size in bytes
+    KEY_LENGTH = 8,                     // DES key length in bytes
+    INTERNAL_KEY_LENGTH = ROUNDS * 2;   // number of elements in key schedule
 
     /**
      * State for encrypt/decrypt/uninitialized.
      */
     private int encryptDecryptState = UNINITIALIZED;
+
     static private final int UNINITIALIZED = 0;
+
     static private final int ENCRYPT = 1;
+
     static private final int DECRYPT = 2;
 
     /**
@@ -199,7 +207,7 @@
         // represent the bit number that each permutated bit is derived from
         // according to FIPS-46
         String cd =
-            "D]PKESYM`UBJ\\@RXA`I[T`HC`LZQ"+"\\PB]TL`[C`JQ@Y`HSXDUIZRAM`EK";
+          "D]PKESYM`UBJ\\@RXA`I[T`HC`LZQ" + "\\PB]TL`[C`JQ@Y`HSXDUIZRAM`EK";
         int j, s, bit;
         int count = 0;
         int offset = 0;
@@ -224,24 +232,26 @@
         // that would be terribly inefficient (code size + time).
         // Instead we use a compressed representation --GK
         String spt =
-            "g3H821:80:H03BA0@N1290BAA88::3112aIH8:8282@0@AH0:1W3A8P810@22;22"+
-            "A18^@9H9@129:<8@822`?:@0@8PH2H81A19:G1@03403A0B1;:0@1g192:@919AA"+
-            "0A109:W21492H@0051919811:215011139883942N8::3112A2:31981jM118::A"+
-            "101@I88:1aN0<@030128:X;811`920:;H0310D1033@W980:8A4@804A3803o1A2"+
-            "021B2:@1AH023GA:8:@81@@12092B:098042P@:0:A0HA9>1;289:@1804:40Ph="+
-            "1:H0I0HP0408024bC9P8@I808A;@0@0PnH0::8:19J@818:@iF0398:8A9H0<13@"+
-            "001@11<8;@82B01P0a2989B:0AY0912889bD0A1@B1A0A0AB033O91182440A9P8"+
-            "@I80n@1I03@1J828212A`A8:12B1@19A9@9@8^B:0@H00<82AB030bB840821Q:8"+
-            "310A302102::A1::20A1;8"; // OK, try to type _that_!
-            // [526 chars, 3156 bits]
+          "g3H821:80:H03BA0@N1290BAA88::3112aIH8:8282@0@AH0:1W3A8P810@22;22" +
+          "A18^@9H9@129:<8@822`?:@0@8PH2H81A19:G1@03403A0B1;:0@1g192:@919AA" +
+          "0A109:W21492H@0051919811:215011139883942N8::3112A2:31981jM118::A" +
+          "101@I88:1aN0<@030128:X;811`920:;H0310D1033@W980:8A4@804A3803o1A2" +
+          "021B2:@1AH023GA:8:@81@@12092B:098042P@:0:A0HA9>1;289:@1804:40Ph=" +
+          "1:H0I0HP0408024bC9P8@I808A;@0@0PnH0::8:19J@818:@iF0398:8A9H0<13@" +
+          "001@11<8;@82B01P0a2989B:0AY0912889bD0A1@B1A0A0AB033O91182440A9P8" +
+          "@I80n@1I03@1J828212A`A8:12B1@19A9@9@8^B:0@H00<82AB030bB840821Q:8" +
+          "310A302102::A1::20A1;8"; // OK, try to type _that_!
+        // [526 chars, 3156 bits]
         // The theory is that each bit position in each int of SP_TRANS is
         // set in exactly 32 entries. We keep track of set bits.
         offset = 0;
         int k, c, param;
-        for (int i = 0; i < 32; i++) { // each bit position
+        for (int i = 0; i < 32; i++) {
+            // each bit position
             k = -1; // pretend the -1th bit was set
             bit = 1 << i;
-            for (j = 0; j < 32; j++) { // each set bit
+            for (j = 0; j < 32; j++) {
+                // each set bit
                 // Each character consists of two three-bit values:
                 c = spt.charAt(offset >> 1) - '0' >> (offset & 1) * 3 & 7;
                 offset++;
@@ -304,7 +314,9 @@
      *
      * @return the length in bytes of an input block for this cipher.
      */
-    public int blockSize() { return BLOCK_SIZE; }
+    public int blockSize() {
+        return BLOCK_SIZE;
+    }
 
     /**
      * <b>SPI</b>: Initializes this cipher for encryption, using the
@@ -316,8 +328,8 @@
      *                <li> The length of the user key array is not KEY_LENGTH.
      *              </ul>
      */
-    public void initEncrypt (byte[] key)
-    throws InvalidKeyException {
+    public void initEncrypt(byte[] key)
+      throws InvalidKeyException {
         makeKey(key);
         encryptDecryptState = ENCRYPT;
     }
@@ -332,8 +344,8 @@
      *                <li> The length of the user key array is not KEY_LENGTH.
      *              </ul>
      */
-    public void initDecrypt (byte[] key)
-    throws InvalidKeyException {
+    public void initDecrypt(byte[] key)
+      throws InvalidKeyException {
         makeKey(key);
         encryptDecryptState = DECRYPT;
     }
@@ -341,10 +353,10 @@
     public byte[] crypt(byte[] data) {
         if (data.length != BLOCK_SIZE) {
             throw new IllegalArgumentException("data.length != BLOCK_SIZE");
-	}
-	byte [] ans = new byte[BLOCK_SIZE];
-	update(data, 0, BLOCK_SIZE, ans, 0);
-	return ans;
+        }
+        byte[] ans = new byte[BLOCK_SIZE];
+        update(data, 0, BLOCK_SIZE, ans, 0);
+        return ans;
     }
 
     /**
@@ -369,8 +381,8 @@
         boolean doEncrypt = (encryptDecryptState == ENCRYPT);
 
         // Avoid overlapping input and output regions.
-        if (in == out && (outOffset >= inOffset && outOffset < (long)inOffset+inLen ||
-                          inOffset >= outOffset && inOffset < (long)outOffset+inLen)) {
+        if (in == out && (outOffset >= inOffset && outOffset < (long)inOffset + inLen ||
+          inOffset >= outOffset && inOffset < (long)outOffset + inLen)) {
             byte[] newin = new byte[inLen];
             System.arraycopy(in, inOffset, newin, 0, inLen);
             in = newin;
@@ -398,8 +410,8 @@
      *                <li> The length of the user key array is not KEY_LENGTH.
      *              </ul>
      */
-    private void makeKey (byte[] userkey)
-    throws InvalidKeyException {
+    private void makeKey(byte[] userkey)
+      throws InvalidKeyException {
 
         if (userkey == null)
             throw new InvalidKeyException(getAlgorithm() + ": Null user key");
@@ -408,14 +420,14 @@
             throw new InvalidKeyException(getAlgorithm() + ": Invalid user key length");
 
         int i = 0;
-        int c = (userkey[i++] & 0xFF)       |
-                (userkey[i++] & 0xFF) <<  8 |
-                (userkey[i++] & 0xFF) << 16 |
-                (userkey[i++] & 0xFF) << 24;
-        int d = (userkey[i++] & 0xFF)       |
-                (userkey[i++] & 0xFF) <<  8 |
-                (userkey[i++] & 0xFF) << 16 |
-                (userkey[i++] & 0xFF) << 24;
+        int c = (userkey[i++] & 0xFF) |
+          (userkey[i++] & 0xFF) << 8 |
+          (userkey[i++] & 0xFF) << 16 |
+          (userkey[i++] & 0xFF) << 24;
+        int d = (userkey[i++] & 0xFF) |
+          (userkey[i++] & 0xFF) << 8 |
+          (userkey[i++] & 0xFF) << 16 |
+          (userkey[i++] & 0xFF) << 24;
 
         int t = ((d >>> 4) ^ c) & 0x0F0F0F0F;
         c ^= t;
@@ -434,10 +446,10 @@
         c ^= t;
         d ^= t << 1;
 
-        d = (d & 0x000000FF) <<  16 |
-            (d & 0x0000FF00)        |
-            (d & 0x00FF0000) >>> 16 |
-            (c & 0xF0000000) >>>  4;
+        d = (d & 0x000000FF) << 16 |
+          (d & 0x0000FF00) |
+          (d & 0x00FF0000) >>> 16 |
+          (c & 0xF0000000) >>> 4;
         c &= 0x0FFFFFFF;
 
         int s;
@@ -451,19 +463,19 @@
                 c = (c >>> 1 | c << 27) & 0x0FFFFFFF;
                 d = (d >>> 1 | d << 27) & 0x0FFFFFFF;
             }
-            s = SKB[           c         & 0x3F                        ] |
-                SKB[0x040 | (((c >>>  6) & 0x03) | ((c >>>  7) & 0x3C))] |
-                SKB[0x080 | (((c >>> 13) & 0x0F) | ((c >>> 14) & 0x30))] |
-                SKB[0x0C0 | (((c >>> 20) & 0x01) | ((c >>> 21) & 0x06)
-                                                 | ((c >>> 22) & 0x38))];
-            t = SKB[0x100 | ( d         & 0x3F                      )] |
-                SKB[0x140 | (((d >>>  7) & 0x03) | ((d >>>  8) & 0x3c))] |
-                SKB[0x180 | ((d >>> 15) & 0x3F                      )] |
-                SKB[0x1C0 | (((d >>> 21) & 0x0F) | ((d >>> 22) & 0x30))];
-
-            sKey[j++] = t <<  16 | (s & 0x0000FFFF);
-            s         = s >>> 16 | (t & 0xFFFF0000);
-            sKey[j++] = s <<   4 |  s >>> 28;
+            s = SKB[c & 0x3F] |
+              SKB[0x040 | (((c >>> 6) & 0x03) | ((c >>> 7) & 0x3C))] |
+              SKB[0x080 | (((c >>> 13) & 0x0F) | ((c >>> 14) & 0x30))] |
+              SKB[0x0C0 | (((c >>> 20) & 0x01) | ((c >>> 21) & 0x06)
+              | ((c >>> 22) & 0x38))];
+            t = SKB[0x100 | (d & 0x3F)] |
+              SKB[0x140 | (((d >>> 7) & 0x03) | ((d >>> 8) & 0x3c))] |
+              SKB[0x180 | ((d >>> 15) & 0x3F)] |
+              SKB[0x1C0 | (((d >>> 21) & 0x0F) | ((d >>> 22) & 0x30))];
+
+            sKey[j++] = t << 16 | (s & 0x0000FFFF);
+            s = s >>> 16 | (t & 0xFFFF0000);
+            sKey[j++] = s << 4 | s >>> 28;
         }
     }
 
@@ -477,16 +489,16 @@
      * @param  encrypt  true to encrypt, false to decrypt
      */
     private void
-    des (byte[] in, int inOffset, byte[] out, int outOffset, boolean encrypt) {
+      des(byte[] in, int inOffset, byte[] out, int outOffset, boolean encrypt) {
         int[] lr = {
-            (in[inOffset++] & 0xFF)       |
-            (in[inOffset++] & 0xFF) <<  8 |
-            (in[inOffset++] & 0xFF) << 16 |
-            (in[inOffset++] & 0xFF) << 24,
-            (in[inOffset++] & 0xFF)       |
-            (in[inOffset++] & 0xFF) <<  8 |
-            (in[inOffset++] & 0xFF) << 16 |
-            (in[inOffset  ] & 0xFF) << 24};
+            (in[inOffset++] & 0xFF) |
+          (in[inOffset++] & 0xFF) << 8 |
+          (in[inOffset++] & 0xFF) << 16 |
+          (in[inOffset++] & 0xFF) << 24,
+            (in[inOffset++] & 0xFF) |
+          (in[inOffset++] & 0xFF) << 8 |
+          (in[inOffset++] & 0xFF) << 16 |
+          (in[inOffset] & 0xFF) << 24};
 
         initialPermutation(lr);
 
@@ -501,18 +513,18 @@
         int R = lr[0];
         int L = lr[1];
 
-        out[outOffset++] = (byte) L;
-        out[outOffset++] = (byte)(L >>  8);
+        out[outOffset++] = (byte)L;
+        out[outOffset++] = (byte)(L >> 8);
         out[outOffset++] = (byte)(L >> 16);
         out[outOffset++] = (byte)(L >> 24);
-        out[outOffset++] = (byte) R;
-        out[outOffset++] = (byte)(R >>  8);
+        out[outOffset++] = (byte)R;
+        out[outOffset++] = (byte)(R >> 8);
         out[outOffset++] = (byte)(R >> 16);
-        out[outOffset  ] = (byte)(R >> 24);
+        out[outOffset] = (byte)(R >> 24);
     }
 
     /** Implements DES encryption without IP and FP. */
-    private void encrypt_base (int[] io) {
+    private void encrypt_base(int[] io) {
         int L = io[0];
         int R = io[1];
 
@@ -527,33 +539,33 @@
             u = R ^ sKey[i++];
             t = R ^ sKey[i++];
             t = t >>> 4 | t << 28;
-            L ^= (SP_TRANS[0x040 | (t         & 0x3F)] |
-                  SP_TRANS[0x0C0 | ((t >>>  8) & 0x3F)] |
-                  SP_TRANS[0x140 | ((t >>> 16) & 0x3F)] |
-                  SP_TRANS[0x1C0 | ((t >>> 24) & 0x3F)] |
-                  SP_TRANS[          u         & 0x3F ] |
-                  SP_TRANS[0x080 | ((u >>>  8) & 0x3F)] |
-                  SP_TRANS[0x100 | ((u >>> 16) & 0x3F)] |
-                  SP_TRANS[0x180 | ((u >>> 24) & 0x3F)]);
+            L ^= (SP_TRANS[0x040 | (t & 0x3F)] |
+              SP_TRANS[0x0C0 | ((t >>> 8) & 0x3F)] |
+              SP_TRANS[0x140 | ((t >>> 16) & 0x3F)] |
+              SP_TRANS[0x1C0 | ((t >>> 24) & 0x3F)] |
+              SP_TRANS[u & 0x3F] |
+              SP_TRANS[0x080 | ((u >>> 8) & 0x3F)] |
+              SP_TRANS[0x100 | ((u >>> 16) & 0x3F)] |
+              SP_TRANS[0x180 | ((u >>> 24) & 0x3F)]);
 
             u = L ^ sKey[i++];
             t = L ^ sKey[i++];
             t = t >>> 4 | t << 28;
-            R ^= (SP_TRANS[0x040 | (t         & 0x3F)] |
-                  SP_TRANS[0x0C0 | ((t >>>  8) & 0x3F)] |
-                  SP_TRANS[0x140 | ((t >>> 16) & 0x3F)] |
-                  SP_TRANS[0x1C0 | ((t >>> 24) & 0x3F)] |
-                  SP_TRANS[          u         & 0x3F ] |
-                  SP_TRANS[0x080 | ((u >>>  8) & 0x3F)] |
-                  SP_TRANS[0x100 | ((u >>> 16) & 0x3F)] |
-                  SP_TRANS[0x180 | ((u >>> 24) & 0x3F)]);
+            R ^= (SP_TRANS[0x040 | (t & 0x3F)] |
+              SP_TRANS[0x0C0 | ((t >>> 8) & 0x3F)] |
+              SP_TRANS[0x140 | ((t >>> 16) & 0x3F)] |
+              SP_TRANS[0x1C0 | ((t >>> 24) & 0x3F)] |
+              SP_TRANS[u & 0x3F] |
+              SP_TRANS[0x080 | ((u >>> 8) & 0x3F)] |
+              SP_TRANS[0x100 | ((u >>> 16) & 0x3F)] |
+              SP_TRANS[0x180 | ((u >>> 24) & 0x3F)]);
         }
         io[0] = R >>> 1 | R << 31;
         io[1] = L >>> 1 | L << 31;
     }
 
     /** Implements DES decryption without IP and FP. */
-    private void decrypt_base (int[] io) {
+    private void decrypt_base(int[] io) {
         int L = io[0];
         int R = io[1];
 
@@ -568,32 +580,32 @@
             t = R ^ sKey[i--];
             u = R ^ sKey[i--];
             t = t >>> 4 | t << 28;
-            L ^= (SP_TRANS[0x040 | (t         & 0x3F)] |
-                  SP_TRANS[0x0C0 | ((t >>>  8) & 0x3F)] |
-                  SP_TRANS[0x140 | ((t >>> 16) & 0x3F)] |
-                  SP_TRANS[0x1C0 | ((t >>> 24) & 0x3F)] |
-                  SP_TRANS[          u         & 0x3F ] |
-                  SP_TRANS[0x080 | ((u >>>  8) & 0x3F)] |
-                  SP_TRANS[0x100 | ((u >>> 16) & 0x3F)] |
-                  SP_TRANS[0x180 | ((u >>> 24) & 0x3F)]);
+            L ^= (SP_TRANS[0x040 | (t & 0x3F)] |
+              SP_TRANS[0x0C0 | ((t >>> 8) & 0x3F)] |
+              SP_TRANS[0x140 | ((t >>> 16) & 0x3F)] |
+              SP_TRANS[0x1C0 | ((t >>> 24) & 0x3F)] |
+              SP_TRANS[u & 0x3F] |
+              SP_TRANS[0x080 | ((u >>> 8) & 0x3F)] |
+              SP_TRANS[0x100 | ((u >>> 16) & 0x3F)] |
+              SP_TRANS[0x180 | ((u >>> 24) & 0x3F)]);
 
             t = L ^ sKey[i--];
             u = L ^ sKey[i--];
             t = t >>> 4 | t << 28;
-            R ^= (SP_TRANS[0x040 | (t         & 0x3F)] |
-                  SP_TRANS[0x0C0 | ((t >>>  8) & 0x3F)] |
-                  SP_TRANS[0x140 | ((t >>> 16) & 0x3F)] |
-                  SP_TRANS[0x1C0 | ((t >>> 24) & 0x3F)] |
-                  SP_TRANS[          u         & 0x3F ] |
-                  SP_TRANS[0x080 | ((u >>>  8) & 0x3F)] |
-                  SP_TRANS[0x100 | ((u >>> 16) & 0x3F)] |
-                  SP_TRANS[0x180 | ((u >>> 24) & 0x3F)]);
+            R ^= (SP_TRANS[0x040 | (t & 0x3F)] |
+              SP_TRANS[0x0C0 | ((t >>> 8) & 0x3F)] |
+              SP_TRANS[0x140 | ((t >>> 16) & 0x3F)] |
+              SP_TRANS[0x1C0 | ((t >>> 24) & 0x3F)] |
+              SP_TRANS[u & 0x3F] |
+              SP_TRANS[0x080 | ((u >>> 8) & 0x3F)] |
+              SP_TRANS[0x100 | ((u >>> 16) & 0x3F)] |
+              SP_TRANS[0x180 | ((u >>> 24) & 0x3F)]);
         }
         io[0] = R >>> 1 | R << 31;
         io[1] = L >>> 1 | L << 31;
     }
 
-    static private void initialPermutation (int[] io) {
+    static private void initialPermutation(int[] io) {
         int L = io[0];
         int R = io[1];
         int t = ((R >>> 4) ^ L) & 0x0F0F0F0F;
@@ -613,7 +625,7 @@
         io[1] = R ^ (t << 1);
     }
 
-    static private void finalPermutation (int[] io) {
+    static private void finalPermutation(int[] io) {
         int L = io[1];
         int R = io[0];
         int t = (R >>> 1 ^ L) & 0x55555555;
@@ -633,7 +645,9 @@
         io[0] = R ^ (t << 4);
     }
 
-  static private String getAlgorithm() { return "DES"; }
+    static private String getAlgorithm() {
+        return "DES";
+    }
 
 // Test methods
 //...........................................................................
@@ -643,14 +657,16 @@
         try {
             self_test();
             // time_test(System.out, "1c587f1c13924fef", "305532286d6f295a", "63fac0d034d9f793");
-        } catch (Exception e) { e.printStackTrace(); }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
     }
 
     static private final String[][] tests =
-    {//   KEY                 PLAINTEXT           CIPHERTEXT
-        {"0101010101010101", "95f8a5e5dd31d900", "8000000000000000"},
-        {"0101010101010101", "dd7f121ca5015619", "4000000000000000"},
-        {"0101010101010101", "2e8653104f3834ea", "2000000000000000"},
+      {//   KEY                 PLAINTEXT           CIPHERTEXT
+          {"0101010101010101", "95f8a5e5dd31d900", "8000000000000000"},
+          {"0101010101010101", "dd7f121ca5015619", "4000000000000000"},
+          {"0101010101010101", "2e8653104f3834ea", "2000000000000000"},
 /*
         {"0101010101010101", "4bd388ff6cd81d4f", "1000000000000000"},
         {"0101010101010101", "20b9e767b2fb1456", "0800000000000000"},
@@ -821,10 +837,10 @@
         {"018310dc409b26d6", "1d9d5c5018f728c2", "5f4c038ed12b2e41"},
         {"1c587f1c13924fef", "305532286d6f295a", "63fac0d034d9f793"}
 */
-    };
+      };
 
     static private void self_test()
-    throws Exception {
+      throws Exception {
         DES cryptor = new DES();
         byte[] userKey;
         byte[] tmp, pt, ct;
@@ -837,36 +853,37 @@
             cryptor.initEncrypt(userKey);
             tmp = cryptor.crypt(pt);
             if (!areEqual(ct, tmp))
-                   throw new RuntimeException("encrypt #"+ i +" failed");
+                throw new RuntimeException("encrypt #" + i + " failed");
 
             cryptor.initDecrypt(userKey);
             tmp = cryptor.crypt(ct);
-               if (!areEqual(pt, tmp))
-                throw new RuntimeException("decrypt #"+ i +" failed");
+            if (!areEqual(pt, tmp))
+                throw new RuntimeException("decrypt #" + i + " failed");
         }
-if (DEBUG && debuglevel > 0) System.out.println("Self-test OK");
+        if (DEBUG && debuglevel > 0) System.out.println("Self-test OK");
     }
 
     static private boolean areEqual(byte[] a, byte[] b) {
-      if (a.length != b.length) return false;
-      for (int i=0; i<a.length; i++) {
-	if (a[i] != b[i]) return false;
-      }
-      return true;
+        if (a.length != b.length) return false;
+        for (int i = 0; i < a.length; i++) {
+            if (a[i] != b[i]) return false;
+        }
+        return true;
     }
 
     static private final String HEXSTR = "0123456789abcdef";
+
     static private byte[] hexFromString(String s) {
         s = s.toLowerCase();
-        byte[] ans = new byte[s.length()/2];
-        for (int i=0; i<s.length(); i++) {
-	    if (0 == (i&1)) {
-                ans[i/2] = (byte)(HEXSTR.indexOf(s.charAt(i)) * 16);
+        byte[] ans = new byte[s.length() / 2];
+        for (int i = 0; i < s.length(); i++) {
+            if (0 == (i & 1)) {
+                ans[i / 2] = (byte)(HEXSTR.indexOf(s.charAt(i)) * 16);
             } else {
-                ans[i/2] += HEXSTR.indexOf(s.charAt(i));
-	    }
-	}
-	return ans;
+                ans[i / 2] += HEXSTR.indexOf(s.charAt(i));
+            }
+        }
+        return ans;
     }
 /*
     static private void



1.6       +51 -32    e/src/jsrc/net/vattp/data/DataCommThunk.java

Index: DataCommThunk.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/DataCommThunk.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DataCommThunk.java	2001/10/03 18:05:28	1.5
+++ DataCommThunk.java	2001/11/10 19:40:37	1.6
@@ -20,7 +20,6 @@
 */
 
 import org.erights.e.develop.trace.Trace;
-import org.erights.e.elib.base.Thunk;
 
 import java.net.Socket;
 
@@ -34,38 +33,58 @@
  *
  * @author Bill Frantz
  */
-/*package*/ class DataCommThunk implements Runnable {
-    static private final int NOTICE_PROBLEM     = 1;
+/*package*/
+class DataCommThunk implements Runnable {
+
+    static private final int NOTICE_PROBLEM = 1;
+
     static private final int SHUT_DOWN_FINISHED = 2;
-    static private final int SEND_FINISHED      = 3;
-    static private final int NEW_INCOMING_MSG   = 4;
-    static private final int ACCEPT_RECEIVER    = 5;
-    static private final int NOTICE_PROBLEM_CM  = 6;
-    static private final int INCOMING_SOCKET    = 7;
-    static private final int SEND_PROGRESS      = 8;
+
+    static private final int SEND_FINISHED = 3;
+
+    static private final int NEW_INCOMING_MSG = 4;
+
+    static private final int ACCEPT_RECEIVER = 5;
+
+    static private final int NOTICE_PROBLEM_CM = 6;
+
+    static private final int INCOMING_SOCKET = 7;
+
+    static private final int SEND_PROGRESS = 8;
 
     int type = 0;
 
     private DataPath myDataPath;    // For Send/RecvThread calls
+
     private VatTPMgr myConnMgr; // For ListenThread calls
+
     private Throwable myException;
+
     private int myWrittenLength;
+
     private int myWrittenCount;
+
     private StreamMessage myContinuation;
+
     private byte[] myMessage;
+
     private RecvThread myRecvThread;
+
     private Socket mySocket;
+
     private NetAddr myRemoteNetAddr;
+
     private NetAddr myLocalNetAddr;
+
     private String myAddress;
 
     /**
-         * Construct a DataCommThunk to call noticeProblem() in a
-         * VatTPMgr object.
-         *
-         * @param connMgr the VatTPMgr object to invoke.
-         * @param e the Exception object describing the problem.
-         */
+     * Construct a DataCommThunk to call noticeProblem() in a
+     * VatTPMgr object.
+     *
+     * @param connMgr the VatTPMgr object to invoke.
+     * @param e the Exception object describing the problem.
+     */
     /*package*/ DataCommThunk(VatTPMgr connMgr, Throwable e) {
         myConnMgr = connMgr;
         myException = e;
@@ -73,12 +92,12 @@
     }
 
     /**
-         * Construct a DataCommThunk to call newInboundSocket in a
-         * VatTPMgr object.
-         *
-         * @param connMgr the DataPath object to invoke.
-         * @param The byte array which is the message.
-         */
+     * Construct a DataCommThunk to call newInboundSocket in a
+     * VatTPMgr object.
+     *
+     * @param connMgr the DataPath object to invoke.
+     * @param The byte array which is the message.
+     */
     /*package*/ DataCommThunk(VatTPMgr connMgr, Socket socket) {
         myConnMgr = connMgr;
         mySocket = socket;
@@ -120,8 +139,7 @@
      */
     /*package*/ DataCommThunk(DataPath conn,
                               byte[] sendIV,
-                              Exception reason)
-    {
+                              Exception reason) {
         myDataPath = conn;
         myMessage = sendIV;
         myException = reason;
@@ -137,7 +155,7 @@
      * @param continuation is the streaming continuation or null.
      */
     /*package*/ DataCommThunk(DataPath conn, int count,
-                int length, /*NullOK*/StreamMessage continuation) {
+                              int length, /*NullOK*/StreamMessage continuation) {
         myDataPath = conn;
         myWrittenCount = count;
         myWrittenLength = length;
@@ -159,12 +177,12 @@
     }
 
     /**
-         * Construct a DataCommThunk to call newInboundSocket in a
-         * VatTPMgr object.
-         *
-         * @param conn the DataPath object to invoke.
-         * @param The byte array which is the message.
-         */
+     * Construct a DataCommThunk to call newInboundSocket in a
+     * VatTPMgr object.
+     *
+     * @param conn the DataPath object to invoke.
+     * @param The byte array which is the message.
+     */
     /*package*/ DataCommThunk(DataPath conn, RecvThread recv,
                               NetAddr remoteNetAddr,
                               NetAddr localNetAddr) {
@@ -190,14 +208,14 @@
                 return;
             case SEND_FINISHED:
                 myDataPath.sendFinished(myWrittenCount,
-                        myWrittenLength, myContinuation);
+                                        myWrittenLength, myContinuation);
                 return;
             case NEW_INCOMING_MSG:
                 myDataPath.newIncomingMsg(myMessage);
                 return;
             case ACCEPT_RECEIVER:
                 myDataPath.acceptReceiver(myRecvThread,
-                        myRemoteNetAddr, myLocalNetAddr);
+                                          myRemoteNetAddr, myLocalNetAddr);
                 return;
             case NOTICE_PROBLEM_CM:
                 myConnMgr.noticeProblem(myException);
@@ -213,6 +231,7 @@
                 throw new Error("Invalid type value=" + type);
         }
     }
+
     public String toString() {
         return super.toString() + " Type=" + type;
     }



1.8       +181 -185  e/src/jsrc/net/vattp/data/DataPath.java

Index: DataPath.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/DataPath.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DataPath.java	2001/10/02 01:49:35	1.7
+++ DataPath.java	2001/11/10 19:40:37	1.8
@@ -51,7 +51,8 @@
  * and when to panic because no messages have been received.
  * @author Bill Frantz
  */
-/*package*/ class DataPath implements MsgHandler, TickReactor {
+/*package*/
+class DataPath implements MsgHandler, TickReactor {
 
     /** enqueued to effectively close the SynchQueue */
     static /*package*/ final Object theShutDownToken = new Integer(0);
@@ -74,7 +75,7 @@
     private VatTPMgr /*nullOK*/ myConnMgr;
 
     /** Array of MsgHandlers indexed by message type */
-    private MsgHandler[] myMsgHandlers = new MsgHandler[Msg.HIGH_MSG_TYPE+1];
+    private MsgHandler[] myMsgHandlers = new MsgHandler[Msg.HIGH_MSG_TYPE + 1];
 
     /** SynchQueue for queueing outbound messages.  This is initialized
      * during construction, and set to null in shutDownPath. */
@@ -102,15 +103,15 @@
     private Clock myClock;
 
     /** The location the current Send/Recv Threads are (to) (have been) speaking
-        to. */
+     to. */
     private String myRemoteAddr;
 
     /** The InetAddress of the remote end, or null if no connection has been
-        made */
+     made */
     private NetAddr myRemoteNetAddr = null;
 
     /** The InetAddress of the local end, or null if no connection has been
-        made */
+     made */
     private NetAddr myLocalNetAddr = null;
 
     /** The port number we are trying to connect to, or 0 for an inbound
@@ -160,62 +161,61 @@
     // The following fields contain performance counters
 
     /** The total bytes of messages received over this DataPath */
-    /*package*/ long bytesReceived          = 0;
+    /*package*/ long bytesReceived = 0;
 
     /** The total number of messages received over this DataPath */
-    /*package*/ long messagesReceived       = 0;
+    /*package*/ long messagesReceived = 0;
 
     /** The size of the largest message received over this DataPath */
-    /*package*/ int maxReceivedMessageSize  = 0;
+    /*package*/ int maxReceivedMessageSize = 0;
 
     /** The total bytes of messages sent over this DataPath */
-    /*package*/ long bytesSent              = 0;
+    /*package*/ long bytesSent = 0;
 
     /** The total number of messages sent over this DataPath */
-    /*package*/ long messagesSent           = 0;
+    /*package*/ long messagesSent = 0;
 
     /** The size of the largest message sent over this DataPath */
-    /*package*/ int maxSentMessageSize      = 0;
+    /*package*/ int maxSentMessageSize = 0;
 
 
     /** for debugging purposes */
     private ConditionLock myEmbargoLock = new ConditionLock();
 
     /**
-         * Make a new DataPath for an incoming connection
-         *
-         * @param connection The VatTPConnection to notify of status
-         * changes.
-         *
-         * @param socket The Socket to the TCP connection.
-         *
-         * @param identityKeys is the KeyPair which defines the identity of this
-         * vat.
-         *
-         * @param runner is the Runner whose thread we use to synchronize calls
-         * into the DataPath object from the SendThread and ReceiveThread
-         *
-         * @param localFlattenedSearchPath Is the search path we publish for
-         * references to us, flattened into a string.
-         *
-         * @param localSearchPath Is the search path we publish for references
-         * to us, with each element a separate String in an array.
-         */
+     * Make a new DataPath for an incoming connection
+     *
+     * @param connection The VatTPConnection to notify of status
+     * changes.
+     *
+     * @param socket The Socket to the TCP connection.
+     *
+     * @param identityKeys is the KeyPair which defines the identity of this
+     * vat.
+     *
+     * @param runner is the Runner whose thread we use to synchronize calls
+     * into the DataPath object from the SendThread and ReceiveThread
+     *
+     * @param localFlattenedSearchPath Is the search path we publish for
+     * references to us, flattened into a string.
+     *
+     * @param localSearchPath Is the search path we publish for references
+     * to us, with each element a separate String in an array.
+     */
     /*package*/ DataPath(VatTPMgr connMgr,
                          Socket tcpConnection,
                          KeyPair identityKeys,
                          String localVatID,
                          Runner runner,
                          String localFlattenedSearchPath,
-                         VatLocationLookup vls)
-    {
+                         VatLocationLookup vls) {
 
         myConnMgr = connMgr;
         myIsIncoming = true;
         SynchQueue reader =
-            commonConstructionSetup(identityKeys,
-                                    localVatID, null, //no suspendID, incoming
-                                    runner, localFlattenedSearchPath, vls);
+          commonConstructionSetup(identityKeys,
+                                  localVatID, null, //no suspendID, incoming
+                                  runner, localFlattenedSearchPath, vls);
 
         myRemoteAddr = tcpConnection.getInetAddress().getHostAddress();
 
@@ -228,46 +228,46 @@
     }
 
     /**
-             * Make a new DataPath
-             *
-             * @param connMgr is the VatTPMgr if this DataPath is supporting
-             * a "connectToVatAt" operation.  Otherwise it is null.
-             *
-             * @param connection The VatTPConnection to notify of status
-             * changes.
-             *
-             * @param remoteVatID the vatID of the remote vat
-             *
-             * @param remoteAddr is the dotted IP address or DNS name and port number
-             * of the place to try for the remote vat.
-             *
-             * @param addressesTried is a Hashtable of the InetAddresses already
-             *              tried to locate the vat which failed due to host,
-             *              rather than port related problems, and are not to be
-             *              tried again.
-             *
-             * @param identityKeys is the KeyPair which defines the identity of this
-             * vat.
-             *
-             * @param runner is the Runner whose thread we use to synchronize calls
-             * into the DataPath object from the SendThread and ReceiveThread
-             *
-             * @param outgoingSuspendID Is the Suspend ID we are to send to the
-             * remote vat for resuming a connection, or null for a new connection.
-             *
-             * @param macKey is the key used for message authentication for resume,
-             * or null for a new connection.
-             *
-             * @param protocolParms is the AuthSecrets object which has the resume
-             * state for protocol versions an protocol parameters for resuming a
-             * connection, or null for a new connection.
-             *
-             * @param localFlattenedSearchPath Is the search path we publish for
-             * references to us, flattened into a string.
-             *
-             * @param localSearchPath Is the search path we publish for references
-             * to us, with each element a separate String in an array.
-             */
+     * Make a new DataPath
+     *
+     * @param connMgr is the VatTPMgr if this DataPath is supporting
+     * a "connectToVatAt" operation.  Otherwise it is null.
+     *
+     * @param connection The VatTPConnection to notify of status
+     * changes.
+     *
+     * @param remoteVatID the vatID of the remote vat
+     *
+     * @param remoteAddr is the dotted IP address or DNS name and port number
+     * of the place to try for the remote vat.
+     *
+     * @param addressesTried is a Hashtable of the InetAddresses already
+     *              tried to locate the vat which failed due to host,
+     *              rather than port related problems, and are not to be
+     *              tried again.
+     *
+     * @param identityKeys is the KeyPair which defines the identity of this
+     * vat.
+     *
+     * @param runner is the Runner whose thread we use to synchronize calls
+     * into the DataPath object from the SendThread and ReceiveThread
+     *
+     * @param outgoingSuspendID Is the Suspend ID we are to send to the
+     * remote vat for resuming a connection, or null for a new connection.
+     *
+     * @param macKey is the key used for message authentication for resume,
+     * or null for a new connection.
+     *
+     * @param protocolParms is the AuthSecrets object which has the resume
+     * state for protocol versions an protocol parameters for resuming a
+     * connection, or null for a new connection.
+     *
+     * @param localFlattenedSearchPath Is the search path we publish for
+     * references to us, flattened into a string.
+     *
+     * @param localSearchPath Is the search path we publish for references
+     * to us, with each element a separate String in an array.
+     */
     /*package*/ DataPath(VatTPMgr /*nullOK*/ connMgr,
                          VatTPConnection /*nullOK*/ connection,
                          String remoteVatID,
@@ -278,8 +278,7 @@
                          Runner runner,
                          byte[] /*nullOK*/ outgoingSuspendID,
                          AuthSecrets /*nullOK*/ protocolParms,
-                         String localFlattenedSearchPath)
-    {
+                         String localFlattenedSearchPath) {
         myConnMgr = connMgr;
         myDataConnection = connection;
         myRemoteVatID = remoteVatID;
@@ -290,20 +289,20 @@
             myProtocolParms = protocolParms;
         }
         SynchQueue reader =
-            commonConstructionSetup(identityKeys,
-                                    localVatID,
-                                    outgoingSuspendID,
-                                    runner,
-                                    localFlattenedSearchPath,
-                                    //no VLS for outgoing connections
-                                    null);
+          commonConstructionSetup(identityKeys,
+                                  localVatID,
+                                  outgoingSuspendID,
+                                  runner,
+                                  localFlattenedSearchPath,
+                                  //no VLS for outgoing connections
+                                  null);
 
         myRemoteAddr = remoteAddr;
         // Get the port number from the address
         int colon = remoteAddr.indexOf(':');
         if (colon >= 0) {
             myRemotePortNumber
-                    = Integer.parseInt(remoteAddr.substring(colon + 1));
+              = Integer.parseInt(remoteAddr.substring(colon + 1));
         }
 
         //Build the SendThread and RecvThread for this address
@@ -333,17 +332,17 @@
      */
     /*package*/ void acceptReceiver(RecvThread receiver,
                                     NetAddr remoteNetAddr,
-                                    NetAddr localNetAddr)
-    {
+                                    NetAddr localNetAddr) {
         myRecvThread = receiver;
         myRemoteNetAddr = remoteNetAddr;
         myLocalNetAddr = localNetAddr;
         //it's safe to not check optInetAddress() for null, since
         //remoteNetAddr must explicitly have one
         myRemoteAddr = remoteNetAddr.optInetAddress().getHostAddress() + ":"
-                        + remoteNetAddr.getPort();
+          + remoteNetAddr.getPort();
         myRecvThread.start();
-        if (null == myWriter) { // If we are dying, shutdown the recv thread
+        if (null == myWriter) {
+            // If we are dying, shutdown the recv thread
             myRecvThread.shutdown();
         }
     }
@@ -354,7 +353,7 @@
      * @param reason The reason for abandoning the attempt.
      */
     /*package*/ void cantResume(String reason)
-                throws IOException {
+      throws IOException {
         shutDownPath();
         String msg = myRemoteAddr + ": " + reason;
         myDataConnection.identifiedPathDied(msg, this);
@@ -381,8 +380,7 @@
                                                byte[] suspendID,
                                                Runner runner,
                                                String localFlattenedSearchPath,
-                                               VatLocationLookup vls)
-    {
+                                               VatLocationLookup vls) {
         myIdentityKeys = identityKeys;
         myLocalVatID = localVatID;
         myRunner = runner;
@@ -397,7 +395,7 @@
         try {
             registerMsgHandler(Msg.PING, this);
             registerMsgHandler(Msg.PONG, this);
-        } catch(IOException e) {
+        } catch (IOException e) {
             Trace.comm.errorm("Fatal error registering pingpong", e);
             Trace.comm.notifyFatal();
         }
@@ -418,18 +416,17 @@
     }
 
     /**
-         * Connect this DataPath to a VatTPConnection.  Used for incoming sockets
-         * and anonymous outgoing sockets to connect the DataPath after the
-         * remote end has been identified.
-         *
-         * @param connection is the VatTPConnection object to connect to.
-         * @param protocolParms is the protocol versions and parameters
-         * to use for resuming a connection, or null for none.
-         * @return is the flattened search path to use to find the remote end.
-         */
+     * Connect this DataPath to a VatTPConnection.  Used for incoming sockets
+     * and anonymous outgoing sockets to connect the DataPath after the
+     * remote end has been identified.
+     *
+     * @param connection is the VatTPConnection object to connect to.
+     * @param protocolParms is the protocol versions and parameters
+     * to use for resuming a connection, or null for none.
+     * @return is the flattened search path to use to find the remote end.
+     */
     /*package*/ String connectConnection(VatTPConnection connection,
-                                         AuthSecrets protocolParms)
-    {
+                                         AuthSecrets protocolParms) {
         myDataConnection = connection;
         if (null == protocolParms) {
             myProtocolParms = new AuthSecrets();
@@ -464,7 +461,7 @@
      */
     /*package*/void connectToSelf() {
         Assertion.test(null == myDataConnection,
-                "Remote end should not be identitifed");
+                       "Remote end should not be identitifed");
         shutDownPath();
         myConnMgr.connectToSelf(this);
     }
@@ -475,7 +472,7 @@
      * @param reason The reason for abandoning the attempt.
      */
     /*package*/ void duplicatePath(String reason, boolean isIdentified)
-                throws IOException {
+      throws IOException {
         shutDownPath();
         String msg = myRemoteAddr + ": " + reason;
         if (!isIdentified) {
@@ -507,7 +504,7 @@
         if (null == myWriter) return;
         myWriter.enqueue(message);
         if (message instanceof byte[]) {
-            byte[] d = (byte[]) message;
+            byte[] d = (byte[])message;
             ESecureRandom.provideEntropy(d, 1);
         }
     }
@@ -544,19 +541,18 @@
     }
 
     /**
-         * Identify the remote vat's vatID for an incoming connection.
-         *
-         * @param remoteVatID the VatID of the remote vat.
-         * @param remoteSearchPath the search path to use to find the remote vat
-         *        in array form.
-         * @return the code received from
-                VatTPMgr.newIncomingConnectionIdentified
-         */
+     * Identify the remote vat's vatID for an incoming connection.
+     *
+     * @param remoteVatID the VatID of the remote vat.
+     * @param remoteSearchPath the search path to use to find the remote vat
+     *        in array form.
+     * @return the code received from
+     VatTPMgr.newIncomingConnectionIdentified
+     */
     /*package*/ int identifyIncoming(String localVatID,
                                      String remoteVatID,
                                      String remoteSearchPath)
-         throws IOException
-    {
+      throws IOException {
         myRemoteVatID = remoteVatID;
 
         //Save the search path to give to the VatTPConnection when startup
@@ -587,8 +583,7 @@
     /*package*/ Object identifyOutgoing(String localVatID,
                                         String remoteVatID,
                                         String remoteFlattenedSearchPath)
-         throws IOException
-    {
+      throws IOException {
         myRemoteVatID = remoteVatID;
 
         //Save the search path to give to the VatTPConnection when startup
@@ -647,15 +642,15 @@
             if (null != handler) {
                 if (Trace.comm.debug && Trace.ON) {
                     Trace.comm.debugm(this + " calls processMessage in "
-                            + handler + "\n"
-                            + HexStringUtils.byteArrayToReadableHexString(message));
+                                      + handler + "\n"
+                                      + HexStringUtils.byteArrayToReadableHexString(message));
                 }
                 handler.processMessage(message, myDataConnection);
                 return;
             }
         }
         Trace.comm.errorm("No handler for incoming message type\n  " + this
-                    + HexStringUtils.byteArrayToReadableHexString(message));
+                          + HexStringUtils.byteArrayToReadableHexString(message));
     }
 
     /**
@@ -681,7 +676,7 @@
      */
     public void run(int tick) {
         long now = System.currentTimeMillis();
-        if ( (now - lastNetActivity) > Msg.PING_SENDTIME) {
+        if ((now - lastNetActivity) > Msg.PING_SENDTIME) {
             if (0 == timePingSent && null != myWriter) {
                 enqueue(thePingMsg);    //Send a ping
                 if (Trace.comm.event && Trace.ON) {
@@ -689,17 +684,17 @@
                 }
                 timePingSent = System.currentTimeMillis();
             } else {
-                if ( (now - timePingSent) > Msg.PING_TIMEOUT) {
+                if ((now - timePingSent) > Msg.PING_TIMEOUT) {
                     if (null != myWriter) {
                         shutDownPath();
                         if (Trace.comm.usage && Trace.ON) {
                             Trace.comm.usagem("Connection timeout " + this);
                         }
-                    } else if ( (now - timePingSent) > (2*Msg.PING_TIMEOUT) ) {
+                    } else if ((now - timePingSent) > (2 * Msg.PING_TIMEOUT)) {
                         if (null != myClock) {
                             Trace.comm.errorm("Shutdown timeout " + this);
                             Exception reason
-                                    = new IOException("Shutdown Timeout");
+                              = new IOException("Shutdown Timeout");
                             //XXX Thread.stop() has been deprecated
                             mySendThread.stop(reason);
                             myProtocolParms = null;
@@ -729,7 +724,8 @@
      * @see VatTPConnection
      */
     public void processMessage(byte[] message, VatTPConnection connection) {
-        if (Msg.PING == message[0]) {   // got a ping, send pong
+        if (Msg.PING == message[0]) {
+            // got a ping, send pong
             enqueue(thePongMsg);
         }
         //Do nothing with a PONG message.  The time received will have already
@@ -744,43 +740,43 @@
     }
 
     /**
-         * Register a MsgHandler for a particular message type.  It will be called
-         * whenever a new message of the specified type arrives.  It will also
-         * be called when the connection dies.
-         *
-         * @param msgType is the message type. It must be chosen from the types
-         * defined in the definition class Msg.  It is an error to register more
-         * than one handler for a message type.
-         * It is a fatal error if the msgType is out of range.
-         * It is a fatal error to register a handler after the
-         * reactToNewConnection method of the object registered with the
-         * VatTPMgr has returned.
-         *
-         * @param handler is an object which implements the MsgHandler interface.
-         * It will be called with processMessage when a message
-         * of msgType is received from the remote vat.  It will be called with
-         * connectionDead when this connection dies.
-         *
-         * @exception IOException is thrown if
-         * there is already a handler registered for this message type.
-         *
-         * @see Msg
-         * @see MsgHandler
-         * @see VatTPMgr
-         */
+     * Register a MsgHandler for a particular message type.  It will be called
+     * whenever a new message of the specified type arrives.  It will also
+     * be called when the connection dies.
+     *
+     * @param msgType is the message type. It must be chosen from the types
+     * defined in the definition class Msg.  It is an error to register more
+     * than one handler for a message type.
+     * It is a fatal error if the msgType is out of range.
+     * It is a fatal error to register a handler after the
+     * reactToNewConnection method of the object registered with the
+     * VatTPMgr has returned.
+     *
+     * @param handler is an object which implements the MsgHandler interface.
+     * It will be called with processMessage when a message
+     * of msgType is received from the remote vat.  It will be called with
+     * connectionDead when this connection dies.
+     *
+     * @exception IOException is thrown if
+     * there is already a handler registered for this message type.
+     *
+     * @see Msg
+     * @see MsgHandler
+     * @see VatTPMgr
+     */
 
-    /*package*/ void registerMsgHandler (int msgType, MsgHandler handler)
-                        throws IOException {
+    /*package*/ void registerMsgHandler(int msgType, MsgHandler handler)
+      throws IOException {
         if (Trace.comm.debug && Trace.ON) {
-            Trace.comm.debugm("registerMsgHandler="+ msgType +"("
-                    + handler +") on " + this);
+            Trace.comm.debugm("registerMsgHandler=" + msgType + "("
+                              + handler + ") on " + this);
         }
         Assertion.test(msgType > 0 || msgType <= Msg.HIGH_MSG_TYPE,
-            "msgType=" + msgType + " out of range (1 .. " + Msg.HIGH_MSG_TYPE
-            + ")");
+                       "msgType=" + msgType + " out of range (1 .. " + Msg.HIGH_MSG_TYPE
+                       + ")");
         if (null != myMsgHandlers[msgType]) {
             throw new IOException(myMsgHandlers[msgType]
-                    + " already registered for msgType=" + msgType);
+                                  + " already registered for msgType=" + msgType);
         }
         myMsgHandlers[msgType] = handler;
     }
@@ -804,7 +800,7 @@
      * @param continuation The notification passed to sendMessage.
      */
     /*package*/ void sendFinished(int count, int length,
-                StreamMessage /*NullOK*/ msg) {
+                                  StreamMessage /*NullOK*/ msg) {
         bytesSent += length;
         messagesSent += count;
         if (maxSentMessageSize < length) maxSentMessageSize = length;
@@ -824,7 +820,7 @@
      *          receive data from the remote vat.
      */
     /*package*/ void setAuthorizationSecrets(byte[] dhSecret,
-                                      byte[] sendSequence, byte[] recvSequence) {
+                                             byte[] sendSequence, byte[] recvSequence) {
         myProtocolParms.myDHSecret = dhSecret;
         myProtocolParms.myOutgoingSequence = sendSequence;
         myProtocolParms.myIncomingSequence = recvSequence;
@@ -845,15 +841,15 @@
         if (null == myMsgHandlers) {
             if (null != myProtocolParms) {
                 myProtocolParms.myOutgoingSequence = sendSequence;
-           }
+            }
             try {
                 myDataConnection.unRegisterMsgHandler(Msg.PING, this);
                 myDataConnection.unRegisterMsgHandler(Msg.PONG, this);
-            } catch(IOException e) {
+            } catch (IOException e) {
                 Trace.comm.errorm("Exception unregistering ping/pong", e);
             }
         } else {
-            for (int i=0; i<myMsgHandlers.length; i++) {
+            for (int i = 0; i < myMsgHandlers.length; i++) {
                 MsgHandler h = myMsgHandlers[i];
                 if (null != h) {
                     if (Trace.comm.debug && Trace.ON) {
@@ -876,7 +872,7 @@
     /*package*/ void shutDownPath() {
         if (Trace.comm.debug && Trace.ON) {
             Trace.comm.debugm("shutDownPath " + this + "\nfor "
-                                + myDataConnection);
+                              + myDataConnection);
         }
         // Enqueue a shutdown to have the SendThread send the queued messages
         // and then shutdown.  SendThread will call shutdownFinished when the
@@ -905,9 +901,9 @@
      * @param protocolSuite the type of authentication selected.
      */
     /*package*/ void startupSuccessful(
-                String eMsgProtocolVersion,
-                String protocolSuite)
-    throws IOException {
+      String eMsgProtocolVersion,
+      String protocolSuite)
+      throws IOException {
 
         if (null != protocolSuite) {
             myProtocolParms.myEProtocolVersion = eMsgProtocolVersion;
@@ -927,23 +923,23 @@
 
         if (Trace.comm.usage && Trace.ON) {
             Trace.comm.usagem("Link to " + myRemoteVatID
-                    + " uses CommProtocol " + myProtocolParms.myProtocolSuite
-                    + ", Emsg protocol="
-                    + myProtocolParms.myEProtocolVersion);
+                              + " uses CommProtocol " + myProtocolParms.myProtocolSuite
+                              + ", Emsg protocol="
+                              + myProtocolParms.myEProtocolVersion);
         }
 
         myDataConnection.startupSuccessful(this, myRemoteVatID,
-                        myRemoteNetAddr, myLocalNetAddr,
-                        myRemotePortNumber, myProtocolParms);
+                                           myRemoteNetAddr, myLocalNetAddr,
+                                           myRemotePortNumber, myProtocolParms);
         myMsgHandlers = null;   // Done handling messages
     }
 
     /**
-         * Stop the start up protocol on this DataPath.  This method is
-         * called by the VatTPMgr when it determines that there are
-         * two connections being built between this vat and another vat, and
-         * that this connection is the one that should be abandonded.
-         */
+     * Stop the start up protocol on this DataPath.  This method is
+     * called by the VatTPMgr when it determines that there are
+     * two connections being built between this vat and another vat, and
+     * that this connection is the one that should be abandonded.
+     */
     /*package*/ void stopStartUpProtocol() {
         myStartUpProtocol.stopStartUpProtocol();
         myDataConnection = null;    // We've been disowned
@@ -955,7 +951,7 @@
      */
     public String toString() {
         return super.toString() + "|" + myRemoteAddr + "|"
-                    + myRemoteVatID + ", startupState=" + getStartupState();
+          + myRemoteVatID + ", startupState=" + getStartupState();
     }
 
     /**
@@ -994,20 +990,20 @@
      * @see MsgHandler
      */
 
-    /*package*/ void unRegisterMsgHandler (int msgType, MsgHandler handler)
-                        throws IOException {
+    /*package*/ void unRegisterMsgHandler(int msgType, MsgHandler handler)
+      throws IOException {
         if (Trace.comm.debug && Trace.ON) {
-            Trace.comm.debugm("unRegisterMsgHandler="+ msgType +"("
-                    + handler +") on " + this);
+            Trace.comm.debugm("unRegisterMsgHandler=" + msgType + "("
+                              + handler + ") on " + this);
         }
         if (msgType <= 0 || msgType > Msg.HIGH_MSG_TYPE) {
-            Trace.comm.errorm("msgType=" + msgType +" out of range (1 .. "
-                                  + Msg.HIGH_MSG_TYPE);
+            Trace.comm.errorm("msgType=" + msgType + " out of range (1 .. "
+                              + Msg.HIGH_MSG_TYPE);
             Trace.comm.notifyFatal();
         }
         if (handler != myMsgHandlers[msgType]) {
             throw new IOException("Registered=" + myMsgHandlers[msgType]
-                    + " is not the same as " + handler + " for msgType=" + msgType);
+                                  + " is not the same as " + handler + " for msgType=" + msgType);
         }
         myMsgHandlers[msgType] = null;
     }



1.5       +18 -15    e/src/jsrc/net/vattp/data/Decrypt3DES.java

Index: Decrypt3DES.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/Decrypt3DES.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Decrypt3DES.java	2001/09/06 09:55:39	1.4
+++ Decrypt3DES.java	2001/11/10 19:40:37	1.5
@@ -20,6 +20,7 @@
 package net.vattp.data;
 
 //import cryptix.provider.cipher.DES;
+
 import net.vattp.security.MicroTime;
 import org.erights.e.develop.assertion.Assertion;
 import org.erights.e.develop.exception.NestedException;
@@ -30,12 +31,15 @@
  * @author Bill Frantz
  */
 
-/*package*/ class Decrypt3DES extends MsgTransformer {
+/*package*/
+class Decrypt3DES extends MsgTransformer {
 
     private byte[] myIV;
+
     private byte[] myDESKeys;
 
     private byte[] myPreviousBlock = new byte[8];
+
     private byte[] myCurrentBlock = null;
 
     private DES myDes1, myDes2, myDes3;
@@ -45,7 +49,7 @@
     /*package*/ Decrypt3DES(byte[] desKeys, byte[] iv) {
         myDESKeys = desKeys;
         myIV = iv;
-        System.arraycopy(myIV,0, myPreviousBlock,0, 8);
+        System.arraycopy(myIV, 0, myPreviousBlock, 0, 8);
         try {
             byte[] key = new byte[8];
             System.arraycopy(myDESKeys, 0, key, 0, 8);
@@ -57,8 +61,7 @@
             System.arraycopy(myDESKeys, 16, key, 0, 8);
             myDes3 = new DES();
             myDes3.initDecrypt(key);
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             Trace.comm.errorm("Problem initializing DES keys", e);
             throw new NestedException("Problem initializing DES keys", e);
         }
@@ -66,7 +69,7 @@
 
     /*package*/ byte[] getSuspendInfo() {
         byte[] val = new byte[8];
-        System.arraycopy(myIV,0, val,0, 8);
+        System.arraycopy(myIV, 0, val, 0, 8);
         increment(val);
         return val;
     }
@@ -77,17 +80,17 @@
         } else {
             myCurrentBlock = new byte[8];
         }
-        System.arraycopy(myIV,0, myPreviousBlock,0, 8);
+        System.arraycopy(myIV, 0, myPreviousBlock, 0, 8);
     }
 
     /*package*/ void transform(byte[] buffer, int off, int len) {
 
         long startTime = Trace.comm.timing ? MicroTime.queryTimer() : 0;
-        Assertion.test(0==(len&0x7),
+        Assertion.test(0 == (len & 0x7),
                        "Buffer length not a multiple of 8, len = "
                        + len);
 
-        for (int cursor=off; cursor<off+len; cursor+=8) {
+        for (int cursor = off; cursor < off + len; cursor += 8) {
             //Save current block's cyphertext for CBC mode
             System.arraycopy(buffer, cursor, myCurrentBlock, 0, 8);
             //Decrypt a block - 3DES Decrypt(Encrypt(Decrypt()))
@@ -95,20 +98,20 @@
             myDes2.update(buffer, cursor, 8, buffer, cursor);
             myDes1.update(buffer, cursor, 8, buffer, cursor);
             xor8(buffer, cursor, myPreviousBlock);  // Do CBC mode
-            System.arraycopy(myCurrentBlock,0, myPreviousBlock,0, 8);
+            System.arraycopy(myCurrentBlock, 0, myPreviousBlock, 0, 8);
         }
         if (Trace.comm.timing && Trace.ON) {
             Trace.comm.timingm("Pkt3DESDecrypt(" + buffer.length + "), time "
-                + (MicroTime.queryTimer() - startTime) + " microseconds");
+                               + (MicroTime.queryTimer() - startTime) + " microseconds");
         }
     }
 
     private void xor8(byte[] inOut, int off, byte[] in) {
-        for (int i=0; i<8; i++) inOut[off+i] ^= in[i];
+        for (int i = 0; i < 8; i++) inOut[off + i] ^= in[i];
     }
 
     private void increment(byte[] value) {
-        for (int i=value.length-1; i>=0; i--) {
+        for (int i = value.length - 1; i >= 0; i--) {
             byte v = (value[i] += 1);
             if (0 != v) break;
         }
@@ -116,9 +119,9 @@
 
     static private String eightToHex(byte[] b, int offset) {
         String ret = "";
-        for (int i=offset; i<offset+8; i++) {
-            ret += "0123456789abcdef".charAt((b[i]>>4)&0xf);
-            ret += "0123456789abcdef".charAt(b[i]&0xf);
+        for (int i = offset; i < offset + 8; i++) {
+            ret += "0123456789abcdef".charAt((b[i] >> 4) & 0xf);
+            ret += "0123456789abcdef".charAt(b[i] & 0xf);
         }
         return ret;
     }



1.5       +28 -25    e/src/jsrc/net/vattp/data/EARL.java

Index: EARL.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/EARL.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- EARL.java	2001/09/07 05:49:20	1.4
+++ EARL.java	2001/11/10 19:40:37	1.5
@@ -72,9 +72,13 @@
 public class EARL {
 
     private String myURI;
+
     private ConstList mySearchPath;
+
     private String myVatID;
+
     private String mySwissStr;
+
     private long myExpiration;
 
     /**
@@ -93,8 +97,7 @@
     public EARL(ConstList searchPath,
                 String vatID,
                 BigInteger swissNum,
-                long expiration)
-    {
+                long expiration) {
         mySearchPath = searchPath;
         myVatID = vatID;
         mySwissStr = BigIntegerSugar.toString64(swissNum);
@@ -131,14 +134,14 @@
      *
      */
     static public String flattenSearchPath(ConstList path) {
-        String ret = "" ;
+        String ret = "";
         if (path == null || path.size() == 0) {
             return ret; // could be reasonable to throw an exception here...
         }
 
         int i = 0;
         while (i < path.size() - 1) {
-            ret += path.get(i++) + ";" ;
+            ret += path.get(i++) + ";";
         }
         ret += path.get(i);
         return ret;
@@ -177,52 +180,52 @@
         while (rest.toLowerCase().startsWith("cap:")) {
             rest = rest.substring("cap:".length());
         }
-        if (! rest.startsWith("//")) {
+        if (!rest.startsWith("//")) {
             throw new MalformedURLException(
-                    "URI "+uri+" does not start with cap://");
+              "URI " + uri + " does not start with cap://");
         }
         rest = rest.substring("//".length());
         int i = rest.indexOf('/');
-        if (i<1) {
+        if (i < 1) {
             throw new MalformedURLException(
-                    "URI "+uri+" does not have a search path");
+              "URI " + uri + " does not have a search path");
         }
         String path = rest.substring(0, i);
-        rest = rest.substring(i+1);
+        rest = rest.substring(i + 1);
         mySearchPath = parseSearchPath(path);
 
         i = rest.indexOf('/');
-        if (i<1) {
+        if (i < 1) {
             throw new MalformedURLException(
-                    "URI "+uri+" does not have a vatID");
+              "URI " + uri + " does not have a vatID");
         }
         myVatID = rest.substring(0, i);
-        rest = rest.substring(i+1);
+        rest = rest.substring(i + 1);
 
         i = rest.indexOf('/');
-        if (i<0) i = rest.length();
-        if (i<1) {
+        if (i < 0) i = rest.length();
+        if (i < 1) {
             throw new MalformedURLException(
-                    "URI "+uri+" does not have an swissStr");
+              "URI " + uri + " does not have an swissStr");
         }
         mySwissStr = rest.substring(0, i);
         if (rest.length() > i) {
-            rest = rest.substring(i+1);
+            rest = rest.substring(i + 1);
             try {
-                myExpiration  = ETimeFormat.parseTime(rest);
+                myExpiration = ETimeFormat.parseTime(rest);
             } catch (ParseException e) {
                 throw new MalformedURLException("Parsing expiration date \""
-                                + rest + "\" "+ e.toString());
+                                                + rest + "\" " + e.toString());
             }
         } else {
             myExpiration = Long.MAX_VALUE;
         }
 
         if (Trace.comm.debug && Trace.ON) {
-            for (i=0; i < mySearchPath.size(); i++) {
-                Trace.comm.debugm("mySearchPath["+ i +"]="+ mySearchPath.get(i));
+            for (i = 0; i < mySearchPath.size(); i++) {
+                Trace.comm.debugm("mySearchPath[" + i + "]=" + mySearchPath.get(i));
             }
-            Trace.comm.debugm("myVatID="+ myVatID +" mySwissStr="+ mySwissStr);
+            Trace.comm.debugm("myVatID=" + myVatID + " mySwissStr=" + mySwissStr);
         }
     }
 
@@ -244,12 +247,12 @@
         }
         count = 1;
         start = -1;
-        while ((start = path.indexOf(';', start+1)) >= 0) {
+        while ((start = path.indexOf(';', start + 1)) >= 0) {
             count++;
         }
         parts = new String[count];
         start = 0;
-        for (int i=0; i<count-1; i++) {
+        for (int i = 0; i < count - 1; i++) {
             end = path.indexOf(';', start);
             parts[i] = path.substring(start, end);
             if (Trace.comm.debug && Trace.ON) {
@@ -257,9 +260,9 @@
             }
             start = end + 1;
         }
-        parts[count-1] = path.substring(start);
+        parts[count - 1] = path.substring(start);
         if (Trace.comm.debug && Trace.ON) {
-            Trace.comm.debugm("found " + parts[count-1]);
+            Trace.comm.debugm("found " + parts[count - 1]);
         }
         return ConstList.fromArray(parts);
     }



1.5       +26 -19    e/src/jsrc/net/vattp/data/Encrypt3DES.java

Index: Encrypt3DES.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/Encrypt3DES.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Encrypt3DES.java	2001/09/06 09:55:39	1.4
+++ Encrypt3DES.java	2001/11/10 19:40:37	1.5
@@ -19,6 +19,7 @@
 package net.vattp.data;
 
 //import cryptix.provider.cipher.DES;
+
 import net.vattp.security.MicroTime;
 import org.erights.e.develop.assertion.Assertion;
 import org.erights.e.develop.exception.NestedException;
@@ -29,15 +30,19 @@
  * @author Bill Frantz
  */
 
-/*package*/ class Encrypt3DES extends MsgTransformer {
+/*package*/
+class Encrypt3DES extends MsgTransformer {
 
     private byte[] myIV;
+
     private byte[] myDESKeys;
+
     private boolean myIsStandardCBC;
 
     private final byte[] myPreviousBlock = new byte[8];
 
     private final byte[] myPad = new byte[8];
+
     private DES myDes1, myDes2, myDes3;
 
     /*package*/ Encrypt3DES(byte[] desKeys, byte[] iv, boolean isStandardCBC) {
@@ -55,34 +60,36 @@
             System.arraycopy(myDESKeys, 16, key, 0, 8);
             myDes3 = new DES();
             myDes3.initEncrypt(key);
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             Trace.comm.errorm("Problem initializing DES keys", e);
             throw new NestedException("Problem initializing DES keys", e);
         }
-        System.arraycopy(myIV,0, myPreviousBlock,0, 8);
+        System.arraycopy(myIV, 0, myPreviousBlock, 0, 8);
     }
 
-    /*package*/ void init() {}  // NOP
+    /*package*/ void init() {
+    }  // NOP
 
     /*package*/ byte[] getSuspendInfo() {
         if (Trace.comm.debug & Trace.ON) {
-            Trace.comm.debugm("Returning IV=" + eightToHex(myIV,0));
+            Trace.comm.debugm("Returning IV=" + eightToHex(myIV, 0));
         }
-        if (myIsStandardCBC) return myPreviousBlock;
-        else return myIV;
+        if (myIsStandardCBC)
+            return myPreviousBlock;
+        else
+            return myIV;
     }
 
     /*package*/ void transform(byte[] buffer, int off, int len) {
         long startTime = Trace.comm.timing ? MicroTime.queryTimer() : 0;
-        if (0 != (len&7)) {
-            Assertion.test(false, "Length must be a multiple of 8, len="+len);
+        if (0 != (len & 7)) {
+            Assertion.test(false, "Length must be a multiple of 8, len=" + len);
         }
         if (!myIsStandardCBC) {
-            System.arraycopy(myIV,0, myPreviousBlock,0, 8);
+            System.arraycopy(myIV, 0, myPreviousBlock, 0, 8);
             increment(myIV);
         }
-        for (int cursor=off; cursor<off+len; cursor+=8) {
+        for (int cursor = off; cursor < off + len; cursor += 8) {
             if (Trace.comm.verbose && Trace.ON) {
                 Trace.comm.verbosem("Plaintext=" + eightToHex(buffer, cursor));
             }
@@ -91,21 +98,21 @@
             myDes1.update(buffer, cursor, 8, buffer, cursor);
             myDes2.update(buffer, cursor, 8, buffer, cursor);
             myDes3.update(buffer, cursor, 8, buffer, cursor);
-            System.arraycopy(buffer, cursor, myPreviousBlock,0, 8);
+            System.arraycopy(buffer, cursor, myPreviousBlock, 0, 8);
         }
         if (Trace.comm.timing && Trace.ON) {
             Trace.comm.timingm("Pkt3DESEncrypt(" + buffer.length + "), time "
-                + (MicroTime.queryTimer() - startTime) + " microseconds");
+                               + (MicroTime.queryTimer() - startTime) + " microseconds");
         }
     }
 
 
     private void xor(byte[] inOut, int offset, byte[] in) {
-        for (int i=0; i<8; i++) inOut[offset+i] ^= in[i];
+        for (int i = 0; i < 8; i++) inOut[offset + i] ^= in[i];
     }
 
     private void increment(byte[] value) {
-        for (int i=value.length-1; i>=0; i--) {
+        for (int i = value.length - 1; i >= 0; i--) {
             byte v = (value[i] += 1);
             if (0 != v) break;
         }
@@ -113,9 +120,9 @@
 
     static private String eightToHex(byte[] b, int offset) {
         String ret = "";
-        for (int i=offset; i<offset+8; i++) {
-            ret += "0123456789abcdef".charAt((b[i]>>4)&0xf);
-            ret += "0123456789abcdef".charAt(b[i]&0xf);
+        for (int i = offset; i < offset + 8; i++) {
+            ret += "0123456789abcdef".charAt((b[i] >> 4) & 0xf);
+            ret += "0123456789abcdef".charAt(b[i] & 0xf);
         }
         return ret;
     }



1.5       +16 -10    e/src/jsrc/net/vattp/data/ListenThread.java

Index: ListenThread.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/ListenThread.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ListenThread.java	2001/10/02 01:29:18	1.4
+++ ListenThread.java	2001/11/10 19:40:37	1.5
@@ -41,11 +41,15 @@
  *          ConnectionMgr's searchPath.
  */
 
-/*package*/ class ListenThread extends Thread {
+/*package*/
+class ListenThread extends Thread {
 
     private boolean myTerminateFlag = false;
+
     private UserThread myUserThread;
+
     private InetAddress myOptIP = null;
+
     private ServerSocket myListenServerSocket;
 
     /** The VatTPMgr to report new Sockets to */
@@ -56,21 +60,22 @@
 
     /** An object to synchronize communication with the user thread */
     private Object myUserThreadLock = new Object();
+
     private boolean mySuspended = false;
 
     /**
-         * Construct a new object to run in its own thread and listen on a
-         * ServerSocket for new incoming connections.
-         *
-         * @param optLocalAddress The local address we will listen on.
-         * @param connMgr the VatTPMgr to be notified about
-         *  interesting events (new connections and errors) that happen while
-         *  listening.
-         */
+     * Construct a new object to run in its own thread and listen on a
+     * ServerSocket for new incoming connections.
+     *
+     * @param optLocalAddress The local address we will listen on.
+     * @param connMgr the VatTPMgr to be notified about
+     *  interesting events (new connections and errors) that happen while
+     *  listening.
+     */
     /*package*/ ListenThread(String optLocalAddress,
                              VatTPMgr connMgr,
                              Runner runner)
-    throws UnknownHostException, IOException {
+      throws UnknownHostException, IOException {
         setDaemon(true);
         myUserThread = new UserThread(myUserThreadLock);
         myConnMgr = connMgr;
@@ -110,6 +115,7 @@
             }
         }
     }
+
     private void noticeProblem(Throwable t) {
         callMgr(new DataCommThunk(myConnMgr, t));
     }



1.7       +16 -15    e/src/jsrc/net/vattp/data/Msg.java

Index: Msg.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/Msg.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Msg.java	2001/10/03 00:27:24	1.6
+++ Msg.java	2001/11/10 19:40:37	1.7
@@ -40,10 +40,10 @@
     // actually assign something to the first byte of the message.
 
     /** Supported versions of the E protocol.  */
-    static /*package*/ final byte PROTOCOL_VERSION  = 1;
+    static /*package*/ final byte PROTOCOL_VERSION = 1;
 
     /** Initial connection setup message */
-    static /*package*/ final byte STARTUP           = 2;
+    static /*package*/ final byte STARTUP = 2;
 
     /** STARTUP response showing which protocol version to use */
     static /*package*/ final byte PROTOCOL_ACCEPTED = 3;
@@ -51,38 +51,37 @@
     /** Suspend or shutdown this connection.  A shutdown message has only
      * the message type.  A suspend messages also has the suspendID as
      * an encoded string parameter. */
-    static /*package*/ final byte SUSPEND           = 4;
+    static /*package*/ final byte SUSPEND = 4;
 
     /** Ping other end to ensure connection still intact */
-    static /*package*/ final byte PING              = 5;
+    static /*package*/ final byte PING = 5;
 
     /** Response to a PING message */
-    static /*package*/ final byte PONG              = 6;
+    static /*package*/ final byte PONG = 6;
 
     /** E level message to an object at the remote end */
-    static      public final byte E_MSG             = 7;
+    static public final byte E_MSG = 7;
 
     /** RMI Comm message to a stream at the other end */
-    static      public final byte TUNNEL_MSG        = 8;
+    static public final byte TUNNEL_MSG = 8;
 
     // We want to fill in here with other message codes to keep the allocation
     // compact.
 
 
     /** Highest message type allocated (used to allocate arrays) */
-    static /*package*/ final byte HIGH_MSG_TYPE     = 8;
+    static /*package*/ final byte HIGH_MSG_TYPE = 8;
 
 
-
     /** Maximum length message permitted on a connection.  This limit is
      * enforced by the VatTPConnection object.*/
-    static public final int MAX_OUTBOUND_MSG_LENGTH = 1024*1024;
+    static public final int MAX_OUTBOUND_MSG_LENGTH = 1024 * 1024;
 
     /** Maximum length message we will receive.  This length is set longer
      * than MAX_OUTBOUND_MSG_LENGTH to allow for MAC overhead etc.  This
      * limit is enforced by the RecvThread. */
     static /*package*/ final int MAX_INBOUND_MSG_LENGTH
-                                    =  MAX_OUTBOUND_MSG_LENGTH + 256;
+      = MAX_OUTBOUND_MSG_LENGTH + 256;
 
 
     /**
@@ -95,15 +94,17 @@
     /** The tick rate for the connection keep alive clock.  Used in
      * conjunction with PING_SENDTIME and PING_TIMEOUT to ensure that the
      * connection is still in good working order. In milliseconds.*/
-    static /*package*/ final long TICK_RATE = 15*1000*TIME_FUDGE;
+    static /*package*/ final long TICK_RATE = 15 * 1000 * TIME_FUDGE;
 
     /** The timeout for no messages received.  When this timeout is exceeded,
      * we send a ping message.  In milliseconds.*/
-    static /*package*/ final long PING_SENDTIME = 20*1000*TIME_FUDGE;
+    static /*package*/ final long PING_SENDTIME = 20 * 1000 * TIME_FUDGE;
 
     /** The timeout for a ping.  If we don't receive a message within this
      * time after we have sent a ping, we declare the connection down.
      * In milliseconds.*/
-    static /*package*/ final long PING_TIMEOUT = 20*1000*TIME_FUDGE;
-    private Msg() {}    // This class is only static final values.
+    static /*package*/ final long PING_TIMEOUT = 20 * 1000 * TIME_FUDGE;
+
+    private Msg() {
+    }    // This class is only static final values.
 }



1.2       +3 -1      e/src/jsrc/net/vattp/data/MsgTransformer.java

Index: MsgTransformer.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/MsgTransformer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MsgTransformer.java	2000/12/21 22:15:18	1.1
+++ MsgTransformer.java	2001/11/10 19:40:37	1.2
@@ -28,7 +28,9 @@
  * @author Bill Frantz
  */
 
-/*package*/ abstract class MsgTransformer {
+/*package*/
+abstract class MsgTransformer {
+
     /**
      * Get any information which will be required to resume a suspended
      * connection.



1.4       +3 -1      e/src/jsrc/net/vattp/data/NetAddr.java

Index: NetAddr.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/NetAddr.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- NetAddr.java	2001/09/06 09:55:39	1.3
+++ NetAddr.java	2001/11/10 19:40:37	1.4
@@ -32,8 +32,10 @@
  * @author Bill Frantz (Based on work by Eric Messick and Chip Morningstar)
  */
 public class NetAddr {
+
     /** null means a port associated with all local IP addresses */
     private InetAddress myOptIP;
+
     private int myPortNumber;
 
     /**
@@ -68,7 +70,7 @@
         if (colon < 0) {
             myPortNumber = 0;
         } else {
-            myPortNumber = Integer.parseInt(optAddr.substring(colon + 1)) ;
+            myPortNumber = Integer.parseInt(optAddr.substring(colon + 1));
             optAddr = optAddr.substring(0, colon);
         }
         int slash = optAddr.indexOf('/');



1.8       +17 -9     e/src/jsrc/net/vattp/data/NetConfig.java

Index: NetConfig.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/NetConfig.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- NetConfig.java	2001/10/02 01:29:18	1.7
+++ NetConfig.java	2001/11/10 19:40:37	1.8
@@ -45,7 +45,7 @@
      *
      */
     static public final StaticMaker NetConfigMaker
-        = StaticMaker.make(NetConfig.class);
+      = StaticMaker.make(NetConfig.class);
 
     /**
      * @serial Where I register so others can find me. <p>
@@ -107,8 +107,7 @@
      */
     public NetConfig(ConstList vlsPath,
                      ConstList searchPath,
-                     String optListenAddr)
-    {
+                     String optListenAddr) {
         myVLSPath = vlsPath;
         mySearchPath = searchPath;
         myOptListenAddr = optListenAddr;
@@ -128,7 +127,9 @@
     /**
      * Where I register so others can find me.
      */
-    public ConstList getVLSPath() { return myVLSPath; }
+    public ConstList getVLSPath() {
+        return myVLSPath;
+    }
 
     /**
      * Where others should look for me.  This path is used in
@@ -140,7 +141,9 @@
      * common bad firewall technique).  Configuration
      * parameter read as a JavaBeans property.
      */
-    public ConstList getSearchPath() { return mySearchPath; }
+    public ConstList getSearchPath() {
+        return mySearchPath;
+    }
 
     /**
      * If we're on the air, this must be the TCP/IP address of
@@ -150,7 +153,9 @@
      * socket address is preferred -- nothing more.  Configuration
      * parameter read as a JavaBeans property.
      */
-    public String getOptListenAddr() { return myOptListenAddr; }
+    public String getOptListenAddr() {
+        return myOptListenAddr;
+    }
 
     /**
      * Used to make a post-onTheAir NetConfig from a pre-onTheAir one. <p>
@@ -170,8 +175,11 @@
     public void printOn(TextWriter out) throws IOException {
         out.print("<NetConfig:");
         TextWriter nest = out.indent();
-        nest.lnPrint("      vlsPath: "); nest.print(myVLSPath);
-        nest.lnPrint("   searchPath: "); nest.print(mySearchPath);
-        nest.lnPrint("optListenAddr: "); nest.print(myOptListenAddr, ">");
+        nest.lnPrint("      vlsPath: ");
+        nest.print(myVLSPath);
+        nest.lnPrint("   searchPath: ");
+        nest.print(mySearchPath);
+        nest.lnPrint("optListenAddr: ");
+        nest.print(myOptListenAddr, ">");
     }
 }



1.7       +126 -95   e/src/jsrc/net/vattp/data/RecvThread.java

Index: RecvThread.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/RecvThread.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- RecvThread.java	2001/10/02 01:29:18	1.6
+++ RecvThread.java	2001/11/10 19:40:37	1.7
@@ -48,12 +48,17 @@
  * incoming connection has been detected in ListenThread.<p>
  * @author Bill Frantz
  */
-/*package*/ class RecvThread extends Thread {
+/*package*/
+class RecvThread extends Thread {
+
     // Index: 2=transforming, 1=isDoingMac
-    static private final int HEADER_INVALID    = -1;
+    static private final int HEADER_INVALID = -1;
+
     static private final int HEADER_INT_LENGTH = 0;
-    static private final int HEADER_VLEN_SHA1  = 1;
-    static private final int HEADER_VLEN_HMAC  = 2;
+
+    static private final int HEADER_VLEN_SHA1 = 1;
+
+    static private final int HEADER_VLEN_HMAC = 2;
     // Note that the header lengths must be a multiple of the blocksize
     // of the encryption used (8 for 3DES).  AES implementation take warning.
     //                                             0   1   2
@@ -63,34 +68,46 @@
     static private final int NOTIFY_EVERY = 10000;
 
     private InputStream myInputStream;
+
     private DataPath myDataPath;
+
     private boolean myTerminateFlag;
+
     private int myBufferLength;
 
     /** The runner we will synchronize with when calling the DataPath*/
     private Runner myRunner;
 
     private byte[] myHeader = new byte[4];  // Protocol negotation header
+
     private boolean myChangeProtocolIsOk = false;
 
     // The following fields are for aggragating messages
     private boolean myIsAggragating = false;
+
     private Vector myMessagesToPass = new Vector();
 
     // The following field is for message transformation.  It is skeleton
     // support for future HTTP tunnelling.   It could also be used to
     // implement a dynamic table dependent compressiong scheme.
     private MsgTransformer myTransform = null;
+
     private boolean myIsStandardCBC = false;
 
     // The following fields are for MAC calculation
     // HASH_BLOCK_SIZE is true for MD5 and SHA1, check others
     static private final int HASH_BLOCK_SIZE = 64;
+
     private boolean myIsDoingMac = false;
+
     private boolean myIsDoingHMAC = false;
+
     private byte[] myMACKey;
+
     private MessageDigest mySHA1;
+
     private byte[] myMAC;
+
     private byte[] mySequence;  // Sequence check
 
     // The following fields are for compression
@@ -101,25 +118,26 @@
     private long myTotalTime = 0;
 
     /**
-       Construct a new RecvThread.
+     Construct a new RecvThread.
 
-       @param inputStream stream to read data from.
-       @param receiver a FragileRootHolder to an OutputStream to write data to.
-       @param connection a RawConnection to send problem reports to.
-       @param bufferLength number of bytes to read at one time.  A new
-        buffer of this length is allocated for each read, so it
-        shouldn't be too big.
-      */
+     @param inputStream stream to read data from.
+     @param receiver a FragileRootHolder to an OutputStream to write data to.
+     @param connection a RawConnection to send problem reports to.
+     @param bufferLength number of bytes to read at one time.  A new
+     buffer of this length is allocated for each read, so it
+     shouldn't be too big.
+     */
     public RecvThread(InputStream inputStream,
                       DataPath connection,
                       String remoteAddr,
                       Runner runner) {
         super("RecvThread-" + remoteAddr);
-        myInputStream = inputStream ;
+        myInputStream = inputStream;
         myDataPath = connection;
         myTerminateFlag = false;
         myRunner = runner;
     }
+
     /**
      * Call a method in our VatTPMgr
      *
@@ -129,7 +147,7 @@
     private void callDataPath(DataCommThunk thunk) {
         try {
             myRunner.now(thunk);
-        } catch(Throwable t) {
+        } catch (Throwable t) {
             Trace.comm.errorm("Error while calling " + thunk, t);
             if (t instanceof VirtualMachineError) throw (VirtualMachineError)t;
             if (t instanceof ThreadDeath) throw (ThreadDeath)t;
@@ -154,10 +172,10 @@
 
     /*package*/ void changeProtocol(AuthSecrets protocolParms) {
         if (Trace.comm.verbose && Trace.ON) {
-            Trace.comm.verbosem("ProtocolChange, pp="+protocolParms);
+            Trace.comm.verbosem("ProtocolChange, pp=" + protocolParms);
         }
         Assertion.test(myChangeProtocolIsOk,
-            "Must only be called while caller is processing an input message");
+                       "Must only be called while caller is processing an input message");
         // For calculating the header length
         int headerLengthIndex = HEADER_INVALID;
 
@@ -166,9 +184,9 @@
             myIsDoingMac = false;
             mySequence = null;
             headerLengthIndex = HEADER_INT_LENGTH;
-        // begin daffE -> E
+            // begin daffE -> E
         } else if (StartUpProtocol.PROTO_3DES_SDH_M.equals(
-                   protocolParms.myProtocolSuite)) {
+          protocolParms.myProtocolSuite)) {
             myIsAggragating = true;
             MessageDigest md5 = setSHA1(protocolParms);
             headerLengthIndex = HEADER_VLEN_SHA1;
@@ -177,10 +195,10 @@
               TripleDESKeyConstructor.make(protocolParms.myDHSecret);
             myTransform =
               new Decrypt3DES(raw_3des_key, protocolParms.myIncomingSequence);
-        // end daffE -> E
-        // begin improved E protocol
+            // end daffE -> E
+            // begin improved E protocol
         } else if (StartUpProtocol.PROTO_3DES_SDH_M2.equals(
-                   protocolParms.myProtocolSuite)) {
+          protocolParms.myProtocolSuite)) {
             myIsAggragating = true;
             MessageDigest md5 = setSHA1(protocolParms);
             headerLengthIndex = HEADER_VLEN_HMAC;
@@ -192,9 +210,9 @@
             myTransform.init();
             myIsStandardCBC = true;
             myIsDoingHMAC = true;
-        // end improved E protocol
+            // end improved E protocol
         } else {
-            Assertion.test(false, "Invalid protocol type "+protocolParms);
+            Assertion.test(false, "Invalid protocol type " + protocolParms);
         }
         myIsCompressingMsgLengths = myIsAggragating;
 
@@ -247,7 +265,7 @@
     private void fillArray(byte[] b, int off, int len) throws IOException {
         int offset = off;
         while (offset < off + len) {
-            int thisLen = off+len-offset;
+            int thisLen = off + len - offset;
             thisLen = (thisLen > NOTIFY_EVERY) ? NOTIFY_EVERY : thisLen;
             int l = myInputStream.read(b, offset, thisLen);
             if (l < 0) {
@@ -270,7 +288,7 @@
     }
 
     private void increment(byte[] value) {
-        for (int i=value.length-1; i>=0; i--) {
+        for (int i = value.length - 1; i >= 0; i--) {
             byte v = (value[i] += 1);
             if (0 != v) break;
         }
@@ -288,7 +306,7 @@
     static private boolean isEqual(byte[] a, byte[] b) {
         int len = a.length;
         if (len != b.length) return false;
-        for (int i=0; i<len; i++) {
+        for (int i = 0; i < len; i++) {
             if (a[i] != b[i]) return false;
         }
         return true;
@@ -303,7 +321,7 @@
      */
     static private void xor(byte[] a, byte[] b) {
         int len = Math.min(a.length, b.length);
-        for (int i=0; i<len; i++) {
+        for (int i = 0; i < len; i++) {
             a[i] ^= b[i];
         }
     }
@@ -316,7 +334,7 @@
      * @param v is the byte to be replicated.
      */
     static private void replicate(byte[] a, byte v) {
-        for (int i=0; i<a.length; i++) {
+        for (int i = 0; i < a.length; i++) {
             a[i] = v;
         }
     }
@@ -338,13 +356,14 @@
      */
     private byte[] md5Hash(int pad, byte[] data, MessageDigest md5) {
         byte[] mdConst = new byte[16];
-        for (int i=0; i<mdConst.length; i++) mdConst[i] = (byte)pad;
+        for (int i = 0; i < mdConst.length; i++) mdConst[i] = (byte)pad;
         md5.reset();                    //Initialize a new hash
         md5.update(mdConst);
         return md5.digest(data);
     }
+
     /**
-       Process input data.
+     Process input data.
      */
     private void readAndProcessMessage() throws IOException {
         long authTime = 0;
@@ -368,31 +387,35 @@
         }
         if (Trace.comm.verbose && Trace.ON) {
             Trace.comm.verbosem("Header: "
-                + HexStringUtils.byteArrayToReadableHexString(myHeader));
+                                + HexStringUtils.byteArrayToReadableHexString(myHeader));
         }
 
         int length;
         int nextItemOffset;    // Offset to the next item in the header
         if (myIsCompressingMsgLengths) {
             int l1 = myHeader[0];    // First byte of the length
-            if (0 == (l1 & 0x80)) {           // len < 128
+            if (0 == (l1 & 0x80)) {
+                // len < 128
                 length = l1;
                 nextItemOffset = 1;
             } else {
-                if (0x80 == (l1 & 0xc0)) { // len < 16,384
+                if (0x80 == (l1 & 0xc0)) {
+                    // len < 16,384
                     length = ((l1 & 0x3f) << 8) |
-                             ((myHeader[1] & 0xff));
+                      ((myHeader[1] & 0xff));
                     nextItemOffset = 2;
-                } else if (0xc0 == (l1 & 0xe0)) { // len < 2,097,152
-                    length = ((l1 & 0x1f)          << 16) |
-                             ((myHeader[1] & 0xff) <<  8) |
-                             ((myHeader[2] & 0xff))       ;
+                } else if (0xc0 == (l1 & 0xe0)) {
+                    // len < 2,097,152
+                    length = ((l1 & 0x1f) << 16) |
+                      ((myHeader[1] & 0xff) << 8) |
+                      ((myHeader[2] & 0xff));
                     nextItemOffset = 3;
-                } else if (0xe0 == (l1 & 0xf0)) { // len < 2**28
-                    length = ((l1 & 0x0f)          << 24) |
-                             ((myHeader[1] & 0xff) << 16) |
-                             ((myHeader[2] & 0xff) <<  8) |
-                             ((myHeader[3] & 0xff))       ;
+                } else if (0xe0 == (l1 & 0xf0)) {
+                    // len < 2**28
+                    length = ((l1 & 0x0f) << 24) |
+                      ((myHeader[1] & 0xff) << 16) |
+                      ((myHeader[2] & 0xff) << 8) |
+                      ((myHeader[3] & 0xff));
                     nextItemOffset = 4;
                 } else {
                     throw new IOException
@@ -400,11 +423,12 @@
                        HexStringUtils.byteArrayToReadableHexString(myHeader));
                 }
             }
-        } else {            // Not compressing
+        } else {
+            // Not compressing
             length = ((myHeader[0] & 0xff) << 24) |
-                     ((myHeader[1] & 0xff) << 16) |
-                     ((myHeader[2] & 0xff) <<  8) |
-                      (myHeader[3] & 0xff)        ;
+              ((myHeader[1] & 0xff) << 16) |
+              ((myHeader[2] & 0xff) << 8) |
+              (myHeader[3] & 0xff);
             nextItemOffset = 4;
         }
         if (Trace.comm.verbose && Trace.ON) {
@@ -416,7 +440,7 @@
         }
         if (myIsDoingMac) {
             System.arraycopy(myHeader, nextItemOffset,
-                         myMAC, 0, 20); // Save MAC
+                             myMAC, 0, 20); // Save MAC
             nextItemOffset += 20;
         }
         if (null != mySequence) {
@@ -428,11 +452,11 @@
             if (!isEqual(mySequence, theirSequence)) {
                 if (Trace.comm.error) {
                     traceErrorMessage(theirSequence,
-                            0, theirSequence.length,
-                            "sequence error, [remote sequence number]:");
+                                      0, theirSequence.length,
+                                      "sequence error, [remote sequence number]:");
                     traceErrorMessage(mySequence,
-                            0, mySequence.length,
-                            "sequence error, [local sequence number]:");
+                                      0, mySequence.length,
+                                      "sequence error, [local sequence number]:");
                 }
                 throw new IOException("incoming packet sequence error");
             }
@@ -463,7 +487,7 @@
         }
         if (Trace.comm.verbose && Trace.ON) {
             Trace.comm.verbosem("Initial message: "
-                + HexStringUtils.byteArrayToReadableHexString(message));
+                                + HexStringUtils.byteArrayToReadableHexString(message));
         }
 
         // Read rest of message into the buffer allocated for it
@@ -475,8 +499,8 @@
             if (Trace.comm.timing && Trace.ON) {
                 startTime = MicroTime.queryTimer();
             }
-            myTransform.transform(message, (myHeader.length-nextItemOffset),
-                            message.length - (myHeader.length-nextItemOffset));
+            myTransform.transform(message, (myHeader.length - nextItemOffset),
+                                  message.length - (myHeader.length - nextItemOffset));
             if (Trace.comm.timing && Trace.ON) {
                 authTime += MicroTime.queryTimer() - startTime;
             }
@@ -484,7 +508,7 @@
 
         if (Trace.comm.verbose && Trace.ON) {
             Trace.comm.verbosem("Full message: "
-                + HexStringUtils.byteArrayToReadableHexString(message));
+                                + HexStringUtils.byteArrayToReadableHexString(message));
         }
 
         myMessagesToPass.removeAllElements();
@@ -494,31 +518,34 @@
             while (true) {
                 length = 0;
                 int input = bais.read();
-            if (input <= 0) break;  // -1 for eof on bais, 0 if only msg shorter than 3
+                if (input <= 0) break;  // -1 for eof on bais, 0 if only msg shorter than 3
                 int count;
                 if (myIsCompressingMsgLengths) {
                     if (0 == (input & 0x80)) {
                         length = input;
                         count = 0;
-                    } else if (0x80 == (input & 0xc0)) { // len < 16,384
+                    } else if (0x80 == (input & 0xc0)) {
+                        // len < 16,384
                         length = input & 0x3f;
                         count = 1;
-                    } else if (0xc0 == (input & 0xe0)) { // len < 2,097,152
+                    } else if (0xc0 == (input & 0xe0)) {
+                        // len < 2,097,152
                         length = input & 0x1f;
                         count = 2;
-                    } else if (0xe0 == (input & 0xf0)) { // len < 2**28
+                    } else if (0xe0 == (input & 0xf0)) {
+                        // len < 2**28
                         length = input & 0x0f;
                         count = 3;
                     } else {
                         throw new IOException(
-                                "Invalid compressed length code"
-                                + HexStringUtils.byteArrayToReadableHexString(message));
+                          "Invalid compressed length code"
+                          + HexStringUtils.byteArrayToReadableHexString(message));
                     }
                 } else {
                     count = 3;
                 }
-                for (int i=0; i<count; i++) {
-                    length <<=8;
+                for (int i = 0; i < count; i++) {
+                    length <<= 8;
                     input = bais.read();
                     length |= input & 0xff;
                 }
@@ -531,16 +558,16 @@
                 int offset = 0;
                 while (offset < emsg.length) {
                     int read = bais.read(emsg, offset,
-                                               emsg.length-offset);
+                                         emsg.length - offset);
                     if (-1 == read) break;
                     offset += read;
                 }
                 if (offset != length) {
                     throw new IOException(
-                        "incoming packet not aggragated properly,"
-                         +" expectedLength="+length+" foundLength="+offset
-                         + HexStringUtils.byteArrayToReadableHexString(
-                            message));
+                      "incoming packet not aggragated properly,"
+                      + " expectedLength=" + length + " foundLength=" + offset
+                      + HexStringUtils.byteArrayToReadableHexString(
+                        message));
                 }
                 myMessagesToPass.addElement(emsg);
             }
@@ -558,27 +585,27 @@
             if (!MessageDigest.isEqual(digest, myMAC)) {
                 if (Trace.comm.error) {
                     traceErrorMessage(myMAC,
-                            0, myMAC.length,
-                            "checksum mismatch, [remote checksum]:");
+                                      0, myMAC.length,
+                                      "checksum mismatch, [remote checksum]:");
                     traceErrorMessage(digest,
-                            0, digest.length,
-                            "checksum mismatch, [local checksum]:");
+                                      0, digest.length,
+                                      "checksum mismatch, [local checksum]:");
                     Enumeration itr = myMessagesToPass.elements();
                     while (itr.hasMoreElements()) {
                         byte[] msg = (byte[])(itr.nextElement());
                         int len = msg.length;
-                        byte[] m = new byte[len+4];
+                        byte[] m = new byte[len + 4];
                         m[0] = (byte)((len >> 24) & 0xff);  // The message length
                         m[1] = (byte)((len >> 16) & 0xff);
-                        m[2] = (byte)((len >>  8) & 0xff);
-                        m[3] = (byte)((len      ) & 0xff);
-                        System.arraycopy(msg,0, m,4, len);
+                        m[2] = (byte)((len >> 8) & 0xff);
+                        m[3] = (byte)((len) & 0xff);
+                        System.arraycopy(msg, 0, m, 4, len);
                         traceErrorMessage(m, 0, m.length,
-                                "checksum mismatch, [data         ]:");
+                                          "checksum mismatch, [data         ]:");
                     }
                 }
                 throw new IOException(
-                            "incoming packet checksum mismatch");
+                  "incoming packet checksum mismatch");
             }
             if (Trace.comm.timing && Trace.ON) macTime += MicroTime.queryTimer() - startTime;
         }
@@ -586,17 +613,18 @@
         //myDataPath.updateReceivedCounts(msgLengths, compressedLength);
 
         Enumeration itr;
-        if (Trace.comm.timing && Trace.ON) {     // Generate event record message
+        if (Trace.comm.timing && Trace.ON) {
+            // Generate event record message
             itr = myMessagesToPass.elements();
             String logMsg = "Processed message length(s)";
             while (itr.hasMoreElements()) {
                 byte[] msg = (byte[])(itr.nextElement());
-                logMsg += " "+msg.length;
+                logMsg += " " + msg.length;
             }
-            if (0 != authTime) logMsg+= " AuthTime="+authTime;
-            if (0 != macTime) logMsg+= " MACTime="+macTime;
+            if (0 != authTime) logMsg += " AuthTime=" + authTime;
+            if (0 != macTime) logMsg += " MACTime=" + macTime;
             myTotalTime += authTime + macTime;
-            if (0 != myTotalTime) logMsg += " TotalTime="+myTotalTime;
+            if (0 != myTotalTime) logMsg += " TotalTime=" + myTotalTime;
             Trace.comm.timingm(logMsg);
         }
 
@@ -605,7 +633,7 @@
             byte[] msg = (byte[])(itr.nextElement());
             if (Trace.comm.debug && Trace.ON) {
                 traceDebugMessage(msg, 0, msg.length,
-                             "incoming packet data");
+                                  "incoming packet data");
             }
             myChangeProtocolIsOk = true;
 
@@ -619,6 +647,7 @@
         }
         myMessagesToPass.removeAllElements(); // Clean up for garbage collecter
     }
+
     /**
      * The actual connection receive thread -- the asynchronous part.
      */
@@ -658,34 +687,34 @@
             if (t instanceof VirtualMachineError) throw (VirtualMachineError)t;
             if (t instanceof ThreadDeath) throw (ThreadDeath)t;
             if (t instanceof LinkageError) throw (LinkageError)t;
-        }
-        finally {
+        } finally {
             if (Trace.comm.debug) {
                 Trace.comm.debugm("terminated");
             }
             myDataPath = null;
         }
     }
+
     private MessageDigest setSHA1(AuthSecrets macParms) {
         try {
             mySHA1 = MessageDigest.getInstance("SHA");
-        } catch(NoSuchAlgorithmException e) {
+        } catch (NoSuchAlgorithmException e) {
             Trace.comm.errorm(" Unable to build SHA", e);
             Trace.comm.notifyFatal();
         }
         MessageDigest md5 = null;
         try {
             md5 = MessageDigest.getInstance("MD5");
-        } catch(NoSuchAlgorithmException e) {
+        } catch (NoSuchAlgorithmException e) {
             Trace.comm.errorm("Unable to build MD5", e);
             Trace.comm.notifyFatal();
         }
         // Calculate the MAC key
         byte[] macKey = new byte[64];
-        System.arraycopy(md5Hash(0x11,macParms.myDHSecret,md5), 0, macKey, 0, 16);
-        System.arraycopy(md5Hash(0x22,macParms.myDHSecret,md5), 0, macKey, 16, 16);
-        System.arraycopy(md5Hash(0x33,macParms.myDHSecret,md5), 0, macKey, 32, 16);
-        System.arraycopy(md5Hash(0x44,macParms.myDHSecret,md5), 0, macKey, 48, 16);
+        System.arraycopy(md5Hash(0x11, macParms.myDHSecret, md5), 0, macKey, 0, 16);
+        System.arraycopy(md5Hash(0x22, macParms.myDHSecret, md5), 0, macKey, 16, 16);
+        System.arraycopy(md5Hash(0x33, macParms.myDHSecret, md5), 0, macKey, 32, 16);
+        System.arraycopy(md5Hash(0x44, macParms.myDHSecret, md5), 0, macKey, 48, 16);
         myMACKey = macParms.myMacKey = macKey;
 
         //Set up to do the MAC calculation
@@ -700,11 +729,13 @@
     /*package*/ void shutdown() {
         myTerminateFlag = true;
     }
-    private void traceDebugMessage (byte msg[], int off, int len, String note) {
+
+    private void traceDebugMessage(byte msg[], int off, int len, String note) {
         String msgString = HexStringUtils.byteArrayToReadableHexString(msg, off, len);
         Trace.comm.debugm(note + " (length " + len + ") " + msgString);
     }
-    private void traceErrorMessage (byte msg[], int off, int len, String note) {
+
+    private void traceErrorMessage(byte msg[], int off, int len, String note) {
         String msgString = HexStringUtils.byteArrayToReadableHexString(msg, off, len);
         Trace.comm.errorm(note + " (length " + len + ") " + msgString);
     }



1.6       +182 -150  e/src/jsrc/net/vattp/data/SendThread.java

Index: SendThread.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/SendThread.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SendThread.java	2001/09/06 09:55:39	1.5
+++ SendThread.java	2001/11/10 19:40:37	1.6
@@ -22,6 +22,7 @@
 
 Contributor(s): ______________________________________.
 */
+
 import net.vattp.security.MicroTime;
 import org.erights.e.develop.assertion.Assertion;
 import org.erights.e.develop.exception.NestedIOException;
@@ -81,17 +82,24 @@
  *  mode specified when authentication is turned on.
  * @author Bill Frantz
  */
-/*package*/ class SendThread extends Thread {
+/*package*/
+class SendThread extends Thread {
 
     /** Notify DataPath every NOTIFY_EVERY bytes of send progress */
     static private final int NOTIFY_EVERY = 10000;
 
     private OutputStream myOutputStream;
+
     private Socket mySocket;
+
     private NetAddr myLocalAddr;
+
     private String myRemoteAddr;
+
     private DataPath myDataPath;
+
     private SynchQueue myReader;
+
     private Runner myRunner;    // For synchronizing into-vat calls
 
     /** A Hashtable of the InetAddresses tried which failed due to host
@@ -102,26 +110,38 @@
 
     // The following fields are for aggragating messages
     static private final int MAX_AGGRAGATION = 1024;
+
     private boolean myIsAggragating = false;
+
     private int myAggragateLength;
+
     private byte[] myAggragation = new byte[MAX_AGGRAGATION];
+
     private int myAggragationCount = 0; // For event messages
+
     private Object myNotifications = null; // null, StreamMessage, or Vector
 
     // The following field is for message transformation.  It is skeleton
     // support for future HTTP tunnelling.   It could also be used to
     // implement a dynamic table dependent compressiong scheme.
     private MsgTransformer myTransform = null;
+
     private boolean myIsStandardCBC = false;
 
     // The following fields are for MAC calculation
     // HASH_BLOCK_SIZE is true for MD5 and SHA1, check others
     static private final int HASH_BLOCK_SIZE = 64;
+
     private boolean myIsDoingMac = false;
+
     private boolean myIsDoingHMAC = false;
+
     private byte[] myMACKey;
+
     private MessageDigest mySHA1;
+
     private int myMacLen = 0;
+
     private byte[] mySequence;  // Sequence check
 
     private boolean myIsCompressingMsgLengths = false;
@@ -188,37 +208,37 @@
      */
     private void addElement(Object elem) throws IOException {
         if (elem instanceof byte[]) {
-            byte[] b = (byte[]) elem;
+            byte[] b = (byte[])elem;
             if (Trace.comm.verbose && Trace.ON) {
                 Trace.comm.verbosem("to=" + myRemoteAddr
-                            + " addElement="+b.length);
+                                    + " addElement=" + b.length);
             }
             if (!myIsAggragating
-                    || myAggragateLength + b.length+4 > myAggragation.length) {
+              || myAggragateLength + b.length + 4 > myAggragation.length) {
                 flushElements();
-                if (b.length+4 > myAggragation.length) {
+                if (b.length + 4 > myAggragation.length) {
                     sendBytesWithLength(b);
                     return;
                 }
             }
             int len = b.length;
             myAggragateLength = msgLength(len, myAggragation,
-                                    myAggragateLength, myIsCompressingMsgLengths);
+                                          myAggragateLength, myIsCompressingMsgLengths);
             System.arraycopy(b, 0, myAggragation,
                              myAggragateLength, len);
             myAggragateLength += len;
             myAggragationCount++;
         } else if (elem instanceof StreamMessage) {
-            StreamMessage sm = (StreamMessage) elem;
+            StreamMessage sm = (StreamMessage)elem;
             byte[] b = sm.myMessage;
             if (Trace.comm.verbose && Trace.ON) {
                 Trace.comm.verbosem("to=" + myRemoteAddr
-                            + " addElement="+b.length);
+                                    + " addElement=" + b.length);
             }
             if (!myIsAggragating
-                    || myAggragateLength + b.length+4 > myAggragation.length) {
+              || myAggragateLength + b.length + 4 > myAggragation.length) {
                 flushElements();
-                if (b.length+4 > myAggragation.length) {
+                if (b.length + 4 > myAggragation.length) {
                     sendBytesWithLength(b);
                     sm.myPlaceToRun.enqueue(sm.myNotification);
                     return;
@@ -226,7 +246,7 @@
             }
             int len = b.length;
             myAggragateLength = msgLength(len, myAggragation,
-                                    myAggragateLength, myIsCompressingMsgLengths);
+                                          myAggragateLength, myIsCompressingMsgLengths);
             System.arraycopy(b, 0, myAggragation,
                              myAggragateLength, len);
             myAggragateLength += len;
@@ -244,31 +264,31 @@
             }
         } else {
             flushElements();    // Write previous stuff under old rules
-            AuthSecrets c = (AuthSecrets) elem;
+            AuthSecrets c = (AuthSecrets)elem;
             if (Trace.comm.debug && Trace.ON) {
                 Trace.comm.debugm("to=" + myRemoteAddr
-                                + " doing ProtocolChange, protocolSuite="
-                                + c.myProtocolSuite);
+                                  + " doing ProtocolChange, protocolSuite="
+                                  + c.myProtocolSuite);
             }
             if (StartUpProtocol.PROTO_NONE.equals(c.myProtocolSuite)) {
                 myIsAggragating = false;
                 myIsDoingMac = false;
-            // begin daffE -> E
+                // begin daffE -> E
             } else if (StartUpProtocol.PROTO_3DES_SDH_M
-                       .equals(c.myProtocolSuite)) {
+              .equals(c.myProtocolSuite)) {
                 myIsAggragating = true;
                 myIsDoingMac = true;
                 myMACKey = c.myMacKey;
                 myMacLen = 20;
                 byte[] raw_3des_key = TripleDESKeyConstructor.make(c.myDHSecret);
                 myTransform =
-                    new Encrypt3DES(raw_3des_key, c.myOutgoingSequence, false);
+                  new Encrypt3DES(raw_3des_key, c.myOutgoingSequence, false);
                 mySequence = null;
                 setSHA1();
-            // end daffE -> E
-            // Begin improved E protocol
+                // end daffE -> E
+                // Begin improved E protocol
             } else if (StartUpProtocol.PROTO_3DES_SDH_M2
-                       .equals(c.myProtocolSuite)) {
+              .equals(c.myProtocolSuite)) {
                 myIsAggragating = true;
                 myIsDoingMac = true;
                 myMACKey = c.myMacKey;
@@ -280,14 +300,15 @@
                 myIsStandardCBC = true;
                 mySequence = new byte[4]; // Assume initialized to zero
                 setSHA1();
-            // end improved E protocol
-            }  else {
+                // end improved E protocol
+            } else {
                 throw new IOException(
-                        "Invalid protocol suite type "+c.myProtocolSuite);
+                  "Invalid protocol suite type " + c.myProtocolSuite);
             }
             myIsCompressingMsgLengths = myIsAggragating;
         }
     }
+
     /**
      * Call a method in our DataPath
      *
@@ -297,20 +318,21 @@
     private void callDataPath(DataCommThunk thunk) {
         try {
             myRunner.now(thunk);
-        } catch(Throwable t) {
+        } catch (Throwable t) {
             Trace.comm.errorm("to=" + myRemoteAddr + " Error while calling "
-                        + thunk, t);
+                              + thunk, t);
             if (t instanceof VirtualMachineError) throw (VirtualMachineError)t;
             if (t instanceof ThreadDeath) throw (ThreadDeath)t;
             if (t instanceof LinkageError) throw (LinkageError)t;
         }
     }
+
     private byte[] computeMAC(byte[] b, int off, int len,
                               /*NilOK*/byte[] lenField) {
         if (Trace.comm.verbose && Trace.ON) {
             Trace.comm.verbosem("to=" + myRemoteAddr
-                    + " Calculating MAC on (length "+len+"):"
-                    + HexStringUtils.byteArrayToReadableHexString(b, off, len));
+                                + " Calculating MAC on (length " + len + "):"
+                                + HexStringUtils.byteArrayToReadableHexString(b, off, len));
         }
         mySHA1.reset();                 //Initialize a new hash
         if (myIsDoingHMAC) {
@@ -345,14 +367,15 @@
             return mySHA1.digest(myMACKey);     // The MAC key again
         }
     }
+
     private void flushElements() throws IOException {
         if (Trace.comm.verbose && Trace.ON) {
             Trace.comm.verbosem("to=" + myRemoteAddr + " flushElements="
-                        + myAggragateLength);
+                                + myAggragateLength);
         }
         if (0 != myAggragateLength) {
             sendBytes(myAggragation, 0, myAggragateLength, null,
-                    myAggragateLength-(4*myAggragationCount));
+                      myAggragateLength - (4 * myAggragationCount));
             myAggragateLength = 0;
             myAggragationCount = 0;
         }
@@ -362,13 +385,14 @@
             sm.myPlaceToRun.enqueue(sm.myNotification);
         } else {
             Vector notifies = (Vector)myNotifications;
-            for (int i=0; i<notifies.size(); i++) {
+            for (int i = 0; i < notifies.size(); i++) {
                 StreamMessage sm = (StreamMessage)notifies.elementAt(i);
                 sm.myPlaceToRun.enqueue(sm.myNotification);
             }
         }
         myNotifications = null;
     }
+
     /**
      * Get the current Sequence for authentication
      */
@@ -379,93 +403,94 @@
             return mySequence;
         }
     }
+
     private void increment(byte[] value) {
-        for (int i=value.length-1; i>=0; i--) {
+        for (int i = value.length - 1; i >= 0; i--) {
             byte v = (value[i] += 1);
             if (0 != v) break;
         }
     }
 
-  /**
-   * xor - Exclusive OR two byte arrays.
-   *
-   * @param a is the input and output array.
-   * @param b is the array which is XORed with a.
-   */
-  static private void xor(byte[] a, byte[] b) {
-    int len = Math.min(a.length, b.length);
-    for (int i=0; i<len; i++) {
-      a[i] ^= b[i];
-    }
-  }
-
-
-  /**
-   * replicate - Copy a single byte to all elements of a byte array.
-   *
-   * @param a is the byte array.
-   * @param v is the byte to be replicated.
-   */
-  static private void replicate(byte[] a, byte v) {
-    for (int i=0; i<a.length; i++) {
-      a[i] = v;
-    }
-  }
-
-  /**
-   * Calculate the MD5 hash of some data with a specific padding.
-   * <p>
-   * The padding allows different values to be obtained from the same data
-   * by varing the padding value.  We use it to get the different
-   * authentication values from the same Diffie Hellman shared secret.
-   *
-   * @param pad The int (treated as a byte) to be used to pad the MD5 calculation.
-   * @param data The data to be hashed.
-   * @param md5 The message digest object to be used.
-   *
-   * @return A byte array representing the hash.
-   */
+    /**
+     * xor - Exclusive OR two byte arrays.
+     *
+     * @param a is the input and output array.
+     * @param b is the array which is XORed with a.
+     */
+    static private void xor(byte[] a, byte[] b) {
+        int len = Math.min(a.length, b.length);
+        for (int i = 0; i < len; i++) {
+            a[i] ^= b[i];
+        }
+    }
+
+
+    /**
+     * replicate - Copy a single byte to all elements of a byte array.
+     *
+     * @param a is the byte array.
+     * @param v is the byte to be replicated.
+     */
+    static private void replicate(byte[] a, byte v) {
+        for (int i = 0; i < a.length; i++) {
+            a[i] = v;
+        }
+    }
 
+    /**
+     * Calculate the MD5 hash of some data with a specific padding.
+     * <p>
+     * The padding allows different values to be obtained from the same data
+     * by varing the padding value.  We use it to get the different
+     * authentication values from the same Diffie Hellman shared secret.
+     *
+     * @param pad The int (treated as a byte) to be used to pad the MD5 calculation.
+     * @param data The data to be hashed.
+     * @param md5 The message digest object to be used.
+     *
+     * @return A byte array representing the hash.
+     */
+
     private byte[] md5Hash(int pad, byte[] data, MessageDigest md5) {
         byte[] mdConst = new byte[16];
-        for (int i=0; i<mdConst.length; i++) mdConst[i] = (byte)pad;
+        for (int i = 0; i < mdConst.length; i++) mdConst[i] = (byte)pad;
         md5.reset();                    //Initialize a new hash
         md5.update(mdConst);
         return md5.digest(data);
     }
 
-  /**
-   * Calculate the message length field for a message.
-   *
-   * @param len is the length of the message to have it's length encoded.
-   * @param buf is the output buffer for the encoded length.
-   * @param off is the offset in the buffer for where to place the encoded length.
-   * @param comprssed is true if compressed lengths are to be used.
-   *
-   * @return is the offset of the byte after the end of the length.
-   */
+    /**
+     * Calculate the message length field for a message.
+     *
+     * @param len is the length of the message to have it's length encoded.
+     * @param buf is the output buffer for the encoded length.
+     * @param off is the offset in the buffer for where to place the encoded length.
+     * @param comprssed is true if compressed lengths are to be used.
+     *
+     * @return is the offset of the byte after the end of the length.
+     */
     static /*package*/ int msgLength(int len, byte[] buf,
                                      int off, boolean compressed)
-            throws IOException {
+      throws IOException {
         if (compressed) {
             if (len < 128) {
-                buf[off++] = (byte) (len & 0x7f);
+                buf[off++] = (byte)(len & 0x7f);
             } else if (len < 16384) {
                 buf[off++] = (byte)(((len >> 8) & 0x3f) | 0x80);
-                buf[off++] = (byte) (len & 0xff);
+                buf[off++] = (byte)(len & 0xff);
             } else if (len < 2097152) {
                 buf[off++] = (byte)(((len >> 16) & 0x1f) | 0xc0);
-                buf[off++] = (byte) ((len >>  8) & 0xff);
-                buf[off++] = (byte) (len         & 0xff);
+                buf[off++] = (byte)((len >> 8) & 0xff);
+                buf[off++] = (byte)(len & 0xff);
             } else {
                 throw new IOException("Packet too large: " + len
-                        + " >= 2,097,152");
+                                      + " >= 2,097,152");
             }
         } else {
-            buf[off++] = (byte)( (len>>24) & 0xff);
-            buf[off++] = (byte)( (len>>16) & 0xff);
-            buf[off++] = (byte)( (len>> 8) & 0xff);
-            buf[off++] = (byte)( (len    ) & 0xff);
+            buf[off++] = (byte)((len >> 24) & 0xff);
+            buf[off++] = (byte)((len >> 16) & 0xff);
+            buf[off++] = (byte)((len >> 8) & 0xff);
+            buf[off++] = (byte)((len) & 0xff);
         }
         return off;
     }
@@ -476,6 +501,7 @@
     private void noticeProblem(Exception e) {
         callDataPath(new DataCommThunk(myDataPath, e));
     }
+
     /**
      * Body of the thread.  Responsible for dequeueing messages and
      * writing them.  Also for dequeueing parameter change orders (e.g.
@@ -483,14 +509,15 @@
      * Calls DataPath.shutdown() before exiting.
      * Will exit if a null is dequeued.
      */
-     public void run() { // First build the connection.
+    public void run() {
+        // First build the connection.
 
         try {
             NetAddr remoteNetAddr;
             if (null == mySocket) {
                 if (Trace.comm.debug && Trace.ON) {
                     Trace.comm.debugm("Attempting outgoing connection to "
-                                                + myRemoteAddr);
+                                      + myRemoteAddr);
                 }
                 long startTime = 0;
                 if (Trace.comm.timing && Trace.ON) {
@@ -500,7 +527,7 @@
                 //it's safe to not check optInetAddress() for null, since
                 //remoteNetAddr must explicitly have one
                 InetAddress remoteInetAddress
-                        = remoteNetAddr.optInetAddress();
+                  = remoteNetAddr.optInetAddress();
                 if (null != myAddressesTried.get(remoteInetAddress)) {
                     throw new NoRouteToHostException("Already failed once");
                 }
@@ -509,15 +536,15 @@
                                           remoteNetAddr.getPort());
                     if (Trace.comm.timing && Trace.ON) {
                         Trace.comm.timingm("Socket build time="
-                            + (MicroTime.queryTimer() - startTime)
-                            + " microseconds");
+                                           + (MicroTime.queryTimer() - startTime)
+                                           + " microseconds");
                     }
-                } catch(NoRouteToHostException he) {
+                } catch (NoRouteToHostException he) {
                     myAddressesTried.put(remoteInetAddress, remoteInetAddress);
                     throw he;
-                } catch(BindException be) {
+                } catch (BindException be) {
                     throw new NestedIOException("BindException binding to "
-                            + remoteNetAddr, be);
+                                                + remoteNetAddr, be);
                 }
             } else {
                 remoteNetAddr = new NetAddr(mySocket.getInetAddress(),
@@ -528,11 +555,11 @@
 
             if (Trace.comm.debug && Trace.ON) {
                 Trace.comm.debugm("Acquired outgoing connection to "
-                            + myRemoteAddr + " from " + myLocalAddr);
+                                  + myRemoteAddr + " from " + myLocalAddr);
             }
             try {
                 mySocket.setTcpNoDelay(true);   // Set for send immediately
-            } catch(SocketException e) {
+            } catch (SocketException e) {
                 if (Trace.comm.event && Trace.ON) {
                     Trace.comm.eventm("Unable to setTcpNoDelay", e);
                 }
@@ -544,10 +571,10 @@
                                                  myRemoteAddr,
                                                  myRunner);
             callDataPath(
-                    new DataCommThunk(myDataPath,
-                                      receiver,
-                                      remoteNetAddr,
-                                      myLocalAddr));
+              new DataCommThunk(myDataPath,
+                                receiver,
+                                remoteNetAddr,
+                                myLocalAddr));
 
         } catch (Exception e) {
             if (e instanceof IOException) {
@@ -572,7 +599,7 @@
                     Trace.comm.verbosem("to=" + myRemoteAddr + " getting chunk");
                 }
                 chunk = myReader.dequeue(); // Block here
-                if ( !(chunk instanceof Integer) ) {
+                if (!(chunk instanceof Integer)) {
                     addElement(chunk);
                     while (myReader.hasMoreElements()) {
                         chunk = myReader.nextElement(); // Shouldn't block
@@ -592,7 +619,7 @@
 
             if (Trace.comm.debug && Trace.ON) {
                 Trace.comm.debugm("to=" + myRemoteAddr
-                            + " I've been asked to shutdown");
+                                  + " I've been asked to shutdown");
             }
         } catch (Exception e) {
             if (Trace.comm.debug && Trace.ON) {
@@ -603,7 +630,7 @@
         }
         try {
             mySocket.close();   // Close the socket
-        } catch(IOException e) {
+        } catch (IOException e) {
             Trace.comm.errorm("to=" + myRemoteAddr + " Exception closing socket", e);
             if (null == shutDownReason) shutDownReason = e;
         }
@@ -611,14 +638,16 @@
             Trace.comm.debugm("to=" + myRemoteAddr + " terminated");
         }
         //Notify the DataPath that the connection has shut down
-        if (null == shutDownReason) shutDownReason
-                = new ConnectionShutDownException("Normal Shutdown");
+        if (null == shutDownReason)
+            shutDownReason
+              = new ConnectionShutDownException("Normal Shutdown");
         callDataPath(new DataCommThunk(myDataPath, getSequence(), shutDownReason));
         myDataPath = null;  // Help GC keep our secrets
         myTransform = null;
         myMACKey = null;
         mySHA1 = null;
     }
+
     /**
      * Perform compression, authentication, mac calculation, and send the message
      *
@@ -632,7 +661,7 @@
                            /*NilOK*/byte[] lenField, int rawLength) throws IOException {
 
         if (Trace.comm.verbose && Trace.ON) {
-            Trace.comm.verbosem("to=" + myRemoteAddr + " sendBytes="+len);
+            Trace.comm.verbosem("to=" + myRemoteAddr + " sendBytes=" + len);
         }
         if (!myIsCompressingMsgLengths) {
             int lineLen = 0;
@@ -644,7 +673,7 @@
             }
             if (Trace.comm.event && Trace.ON) {
                 Trace.comm.eventm("to=" + myRemoteAddr
-                            + " Sending message len=" + len);
+                                  + " Sending message len=" + len);
             }
             writeAndRecordProgress(b, off, len);
             callDataPath(new DataCommThunk(myDataPath,
@@ -659,9 +688,9 @@
 
         if (Trace.comm.timing && Trace.ON) startTime = MicroTime.queryTimer();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        baos.write(new byte[myMacLen+4]); // Write space for length + MAC
+        baos.write(new byte[myMacLen + 4]); // Write space for length + MAC
         if (null != mySequence) {
-        	baos.write(mySequence);   // Write separate message sequence number
+            baos.write(mySequence);   // Write separate message sequence number
         }
         if (null != lenField) {
             baos.write(lenField);
@@ -680,12 +709,12 @@
             offset = 1;
         } else {
             throw new IOException("Packet too large: " + commLength
-                    + " >= 2,097,152");
+                                  + " >= 2,097,152");
         }
         // If not a multiple of 64 bits (8 bytes), pad to 8 bytes
-        if ( (myIsCompressingMsgLengths || null != myTransform)
-                && 0 != ((baos.size()-offset) & 7)) {
-            byte[] fill = new byte[8 - ((baos.size()-offset)&7)];
+        if ((myIsCompressingMsgLengths || null != myTransform)
+          && 0 != ((baos.size() - offset) & 7)) {
+            byte[] fill = new byte[8 - ((baos.size() - offset) & 7)];
             baos.write(fill);     // Pad to multiple of 8 bytes
         }
         byte[] data = baos.toByteArray();
@@ -695,7 +724,7 @@
             byte[] mac = computeMAC(b, off, len, lenField);
             if (Trace.comm.verbose && Trace.ON) {
                 Trace.comm.verbosem("to=" + myRemoteAddr + " MAC is "
-                    + HexStringUtils.byteArrayToReadableHexString(mac));
+                                    + HexStringUtils.byteArrayToReadableHexString(mac));
             }
             System.arraycopy(mac, 0, data, 4, myMacLen);
             Assertion.test(mac.length == myMacLen, "MAC length error");
@@ -705,56 +734,58 @@
         }
 
         switch (offset) {
-         case 1:
-            data[1] = (byte)(((commLength >> 16) & 0x1f) | 0xc0);
-            data[2] = (byte) ((commLength >>  8) & 0xff);
-            data[3] = (byte) (commLength         & 0xff);
-            break;
-         case 2:
-            data[2] = (byte)(((commLength >> 8) & 0x3f) | 0x80);
-            data[3] = (byte) (commLength & 0xff);
-            break;
-         case 3:
-            data[3] = (byte) (commLength & 0x7f);
-            break;
-         default: Assertion.fail("Case out of range, offset="+offset);
+            case 1:
+                data[1] = (byte)(((commLength >> 16) & 0x1f) | 0xc0);
+                data[2] = (byte)((commLength >> 8) & 0xff);
+                data[3] = (byte)(commLength & 0xff);
+                break;
+            case 2:
+                data[2] = (byte)(((commLength >> 8) & 0x3f) | 0x80);
+                data[3] = (byte)(commLength & 0xff);
+                break;
+            case 3:
+                data[3] = (byte)(commLength & 0x7f);
+                break;
+            default:
+                Assertion.fail("Case out of range, offset=" + offset);
         }
 
         if (null != myTransform) {
             if (Trace.comm.timing && Trace.ON) startTime = MicroTime.queryTimer();
             if (Trace.comm.verbose && Trace.ON) {
                 Trace.comm.verbosem("to=" + myRemoteAddr + " authenticating "
-                        + (data.length-offset) + " bytes: "
-                        + HexStringUtils.byteArrayToReadableHexString(data,
-                                        offset, data.length-offset));
+                                    + (data.length - offset) + " bytes: "
+                                    + HexStringUtils.byteArrayToReadableHexString(data,
+                                                                                  offset, data.length - offset));
             }
             if (!myIsStandardCBC) {
                 myTransform.init();
             }
-            myTransform.transform(data, offset, data.length-offset);
+            myTransform.transform(data, offset, data.length - offset);
             if (Trace.comm.timing && Trace.ON) {
                 authenticationTime += MicroTime.queryTimer() - startTime;
             }
         }
 
-        if (Trace.comm.timing && Trace.ON) {    // Generate timing message
+        if (Trace.comm.timing && Trace.ON) {
+            // Generate timing message
             int slen = data.length - offset;
             String msg = "to=" + myRemoteAddr + " ";
             msg += 0 != myAggragationCount ?
-                    "Sending aggragation of " + myAggragationCount :
-                    "Sending";
-            msg += " len="+slen;
-            if (0 != authenticationTime) msg+= " AuthTime="+authenticationTime;
-            if (0 != macTime) msg+= " MACTime="+macTime;
+              "Sending aggragation of " + myAggragationCount :
+              "Sending";
+            msg += " len=" + slen;
+            if (0 != authenticationTime) msg += " AuthTime=" + authenticationTime;
+            if (0 != macTime) msg += " MACTime=" + macTime;
             myTotalTime += authenticationTime + macTime;
-            if (0 != myTotalTime) msg += " TotalTime="+myTotalTime;
+            if (0 != myTotalTime) msg += " TotalTime=" + myTotalTime;
             Trace.comm.timingm(msg);
         }
 
-        writeAndRecordProgress(data, offset, data.length-offset);
+        writeAndRecordProgress(data, offset, data.length - offset);
         callDataPath(new DataCommThunk(myDataPath,
                                        myAggragationCount,
-                                       data.length-offset,
+                                       data.length - offset,
                                        null));
         return;
     }
@@ -768,11 +799,11 @@
 
         if (Trace.comm.verbose && Trace.ON) {
             Trace.comm.verbosem("to=" + myRemoteAddr + " sendBytesWithLength="
-                        + b.length);
+                                + b.length);
         }
         byte[] len = new byte[4];
         int lenlen = msgLength(b.length, len,
-                                0, myIsCompressingMsgLengths);
+                               0, myIsCompressingMsgLengths);
         byte[] clen = new byte[lenlen];
         System.arraycopy(len, 0, clen, 0, lenlen);
 
@@ -785,19 +816,20 @@
     private void setSHA1() {
         try {
             mySHA1 = MessageDigest.getInstance("SHA");
-        } catch(NoSuchAlgorithmException e) {
+        } catch (NoSuchAlgorithmException e) {
             Trace.comm.errorm("to=" + myRemoteAddr
-                        + " Unable to build SHA", e);
+                              + " Unable to build SHA", e);
             Trace.comm.notifyFatal();
         }
     }
+
     /**
      * Write a message in chunks and inform the datapath of progress in the
      * write.
      */
 
     private void writeAndRecordProgress(byte[] b, int off, int len)
-            throws IOException {
+      throws IOException {
         int offset = off;
         while (0 != len) {
             int thisLen = (len > NOTIFY_EVERY) ? NOTIFY_EVERY : len;



1.8       +359 -291  e/src/jsrc/net/vattp/data/StartUpProtocol.java

Index: StartUpProtocol.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/StartUpProtocol.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- StartUpProtocol.java	2001/10/02 23:38:31	1.7
+++ StartUpProtocol.java	2001/11/10 19:40:37	1.8
@@ -51,7 +51,6 @@
 import java.util.Vector;
 
 
-
 /**
  * This class is used by VatTPConnection to perform the startup
  * protocol.
@@ -59,57 +58,82 @@
  */
 
 public class StartUpProtocol implements MsgHandler {
+
     /*
      * Constants for the connection startup protocol.
      */
 
+
+    /*
+    * States for the connection startup state machine.  Current state
+    * is in myState below.
+    */
+    static /*package*/ final int ST_UNSTARTED = 0;
+
+    static /*package*/ final int ST_INCOMING_EXPECT_IWANT = 1;
+
+    static /*package*/ final int ST_OUTGOING_EXPECT_IAM = 2;
+
+    static /*package*/ final int ST_INCOMING_EXPECT_GIVEINFO = 3;
 
-     /*
-     * States for the connection startup state machine.  Current state
-     * is in myState below.
-     */
-    static /*package*/ final int ST_UNSTARTED                 = 0;
-    static /*package*/ final int ST_INCOMING_EXPECT_IWANT     = 1;
-    static /*package*/ final int ST_OUTGOING_EXPECT_IAM       = 2;
-    static /*package*/ final int ST_INCOMING_EXPECT_GIVEINFO  = 3;
     static /*package*/ final int ST_OUTGOING_EXPECT_REPLYINFO = 4;
-    static /*package*/ final int ST_INCOMING_EXPECT_GO        = 5;
-    static /*package*/ final int ST_OUTGOING_EXPECT_GOTOO     = 6;
-    static /*package*/ final int ST_EXPECT_MESSAGE            = 7;
-    static /*package*/ final int ST_DEAD                      = 8;
-    static /*package*/ final int ST_TRY_NEXT                  = 9;
 
+    static /*package*/ final int ST_INCOMING_EXPECT_GO = 5;
 
+    static /*package*/ final int ST_OUTGOING_EXPECT_GOTOO = 6;
+
+    static /*package*/ final int ST_EXPECT_MESSAGE = 7;
+
+    static /*package*/ final int ST_DEAD = 8;
+
+    static /*package*/ final int ST_TRY_NEXT = 9;
+
+
     /*
      * Tokens used for submessage types of the Msg.STARTUP message
      */
-    static private final byte TOK_BYE                =  1;
-    static private final byte TOK_DUP                =  2;
-    static private final byte TOK_GIVEINFO           =  3;
-    static private final byte TOK_GO                 =  4;
-    static private final byte TOK_GOTOO              =  5;
-    static private final byte TOK_IAM                =  6;
-    static private final byte TOK_IWANT              =  7;
-    static private final byte TOK_NOT_ME             =  8;
-    static private final byte TOK_REPLYINFO          =  9;
-    static private final byte TOK_TRY                = 10;
-    static private final byte TOK_RESUME             = 11;
-    static private final byte TOK_YOUCHOSE           = 12;
+    static private final byte TOK_BYE = 1;
+
+    static private final byte TOK_DUP = 2;
+
+    static private final byte TOK_GIVEINFO = 3;
 
+    static private final byte TOK_GO = 4;
+
+    static private final byte TOK_GOTOO = 5;
+
+    static private final byte TOK_IAM = 6;
+
+    static private final byte TOK_IWANT = 7;
+
+    static private final byte TOK_NOT_ME = 8;
+
+    static private final byte TOK_REPLYINFO = 9;
+
+    static private final byte TOK_TRY = 10;
+
+    static private final byte TOK_RESUME = 11;
+
+    static private final byte TOK_YOUCHOSE = 12;
+
     /* Tokens used to report errors to the remote end.
      * All are negative numbers.
      */
-    static private final byte TOK_ERR_PROTOCOL       = -2;
-    static private final byte TOK_ERR_WRONG_ID       = -3;
-    static private final byte TOK_ERR_INTERNAL       = -4;
-
-     /*
-     * Values for supported protocol suites:
-     */
-    static /*package*/ final String PROTO_NONE             = "None";
-    static /*package*/ final String PROTO_3DES_SDH_M       = "3DES_SDH_M";
-    static /*package*/ final String PROTO_3DES_SDH_M2      = "3DES_SDH_M2";
+    static private final byte TOK_ERR_PROTOCOL = -2;
+
+    static private final byte TOK_ERR_WRONG_ID = -3;
+
+    static private final byte TOK_ERR_INTERNAL = -4;
+
+    /*
+    * Values for supported protocol suites:
+    */
+    static /*package*/ final String PROTO_NONE = "None";
 
+    static /*package*/ final String PROTO_3DES_SDH_M = "3DES_SDH_M";
+
+    static /*package*/ final String PROTO_3DES_SDH_M2 = "3DES_SDH_M2";
+
     /** The protocol negotiation string we send, least desired last */
     static private String TheAuthProtocols;
 
@@ -134,16 +158,16 @@
 
         count = 1;
         start = -1;
-        while ((start = TheAuthProtocols.indexOf(',', start+1)) >= 0)
+        while ((start = TheAuthProtocols.indexOf(',', start + 1)) >= 0)
             count++;
         result = new String[count];
         start = 0;
-        for (int i=0; i<count-1; i++) {
+        for (int i = 0; i < count - 1; i++) {
             end = TheAuthProtocols.indexOf(',', start);
             result[i] = TheAuthProtocols.substring(start, end);
             start = end + 1;
         }
-        result[count-1] = TheAuthProtocols.substring(start);
+        result[count - 1] = TheAuthProtocols.substring(start);
 
         TheAuthProtocolTable = result;
     }
@@ -187,8 +211,8 @@
     private String myRemoteVatID;
 
     /** The suspend ID to present to the other end for a reconnect.
-        If it is null, reconnection will not be attempted.
-        (Outbound connections only)*/
+     If it is null, reconnection will not be attempted.
+     (Outbound connections only)*/
     private /*nullOK*/ byte[] myOutgoingSuspendID;
 
     /** The public key of the remote end */
@@ -209,7 +233,7 @@
     private int myState = ST_UNSTARTED;
 
     /** Set true if we should stop attempting to make a connection
-        before outgoingSetup has been called.*/
+     before outgoingSetup has been called.*/
     private boolean myStop = false;
 
     /** The agreed E message protocol version */
@@ -241,15 +265,17 @@
 
     // Data for the Diffie Hellman protocol
     BigInteger x = null;
+
     static private final BigInteger g = new BigInteger("2");
+
     static private final BigInteger modulus =
-        new BigInteger("11973791477546250983817043765044391637751157152328012"
-                        + "72278994477192940843207042535379780702841268263028"
-                        + "59486033998465467188646855777933154987304015680716"
-                        + "74391647223805124273032053960564348124852668624831"
-                        + "01273341734490560148744399254916528366159159380290"
-                        + "29782321539388697349613396698017627677439533107752"
-                        + "978203");
+      new BigInteger("11973791477546250983817043765044391637751157152328012"
+                     + "72278994477192940843207042535379780702841268263028"
+                     + "59486033998465467188646855777933154987304015680716"
+                     + "74391647223805124273032053960564348124852668624831"
+                     + "01273341734490560148744399254916528366159159380290"
+                     + "29782321539388697349613396698017627677439533107752"
+                     + "978203");
 
 
 // Constructors
@@ -277,8 +303,7 @@
                                 String localVatID,
                                 byte[] /*nullOK*/ outgoingSuspendID,
                                 String localFlattenedSearchPath,
-                                VatLocationLookup vls)
-    {
+                                VatLocationLookup vls) {
         myDataPath = path;
         myIsIncoming = isIncoming;
         myIdentityKeys = identityKeys;
@@ -300,7 +325,7 @@
                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
                 DataOutputStream os = new DataOutputStream(baos);
                 os.writeByte(Msg.PROTOCOL_VERSION);
-                for (int i=0; i<Msg.Version.length; i++) {
+                for (int i = 0; i < Msg.Version.length; i++) {
                     os.writeUTF(Msg.Version[i]);
                 }
                 sendMessageForSignature(baos.toByteArray());
@@ -309,7 +334,7 @@
             } else {
                 myState = ST_INCOMING_EXPECT_IWANT;
             }
-        } catch(IOException e) {
+        } catch (IOException e) {
             Trace.comm.errorm("IOException starting up", e);
             myDataPath.shutDownPath();
         }
@@ -338,7 +363,7 @@
      */
 
     void checkProtocolVersion(DataInputStream packetIn, byte[] packet)
-            throws IOException {
+      throws IOException {
         hisMessagesToSign.addElement(packet);
         Vector versions = new Vector(10);   // To save their supported versions in case of error
         String protocol = "";
@@ -347,35 +372,37 @@
                 String theirVersion = packetIn.readUTF();
                 if (!"".equals(theirVersion)) {
                     versions.addElement(theirVersion);
-                    for (int i=0; i<Msg.Version.length; i++) {
+                    for (int i = 0; i < Msg.Version.length; i++) {
                         if (theirVersion.equals(Msg.Version[i])) {
                             protocol = theirVersion;
                         }
                     }
                 }
             }
-        } catch (EOFException e) {   // Handle end of input string
+        } catch (EOFException e) {
+            // Handle end of input string
             if (Trace.comm.debug && Trace.ON) {
                 String err = "Incoming protocol versions ";
                 int size = versions.size();
-                for (int i=0; i <size-1; i++) {
+                for (int i = 0; i < size - 1; i++) {
                     err += (versions.elementAt(i) + ", ");
                 }
-                if (size>0) err += versions.lastElement();
-                Trace.comm.debugm(err+" picked "+protocol);
+                if (size > 0) err += versions.lastElement();
+                Trace.comm.debugm(err + " picked " + protocol);
             }
-            if ("" == protocol) {       // Can't agree on a protocol (java interns strings)
+            if ("" == protocol) {
+                // Can't agree on a protocol (java interns strings)
                 String err = "incoming protocol versions ";
                 int size = versions.size();
-                for (int i=0; i <size-1; i++) {
+                for (int i = 0; i < size - 1; i++) {
                     err += (versions.elementAt(i) + ", ");
                 }
-                if (size>0) err += versions.lastElement();
+                if (size > 0) err += versions.lastElement();
                 err += " are not supported, use versions ";
-                for (int i=0; i<Msg.Version.length-1; i++) {
+                for (int i = 0; i < Msg.Version.length - 1; i++) {
                     err += (Msg.Version[i] + ", ");
                 }
-                err += Msg.Version[Msg.Version.length-1];
+                err += Msg.Version[Msg.Version.length - 1];
                 sendErrProtocol(err);
                 throw new IOException(err);
             }
@@ -396,26 +423,28 @@
     public void connectionDead(VatTPConnection /*nullOK*/willBeNull, Throwable reason) {
         // Everything should be handled by the DataPath
     }
-  /**
-   * Perform the first calculation in Diffie Hellman key exchange.
-   * <p>
-   * This method gets a random x and calculate g**x mod p.  Return the value
-   * as a String base 10.
-   *
-   * @return A byte array representing the result of the first Diffie
-   *         Hellman calculation.
-   */
+
+    /**
+     * Perform the first calculation in Diffie Hellman key exchange.
+     * <p>
+     * This method gets a random x and calculate g**x mod p.  Return the value
+     * as a String base 10.
+     *
+     * @return A byte array representing the result of the first Diffie
+     *         Hellman calculation.
+     */
 
     private byte[] firstDH() {
         long startTime = Trace.comm.timing ? MicroTime.queryTimer() : 0;
         x = new BigInteger(256, ESecureRandom.getESecureRandom());
-        byte[] ans = g.modPow(x,modulus).toByteArray();
+        byte[] ans = g.modPow(x, modulus).toByteArray();
         if (Trace.comm.timing && Trace.ON) {
             Trace.comm.timingm("FirstDiffieHellman time "
-                + (MicroTime.queryTimer() - startTime) + " microseconds");
+                               + (MicroTime.queryTimer() - startTime) + " microseconds");
         }
         return ans;
     }
+
     /**
      * Format a Msg.STARTUP packet for error messages.
      *
@@ -431,13 +460,13 @@
             ret = "0x" + Integer.toHexString(msgType) + " ";
             int token = packetIn.readByte();
             ret += tokName(token) + " ";
-            if (token <= 0 || TOK_BYE == token|| TOK_DUP == token
-                    || TOK_NOT_ME == token || TOK_IAM == token) {
+            if (token <= 0 || TOK_BYE == token || TOK_DUP == token
+              || TOK_NOT_ME == token || TOK_IAM == token) {
                 ret += packetIn.readUTF();
             }
             packetIn.close();
             return ret;
-        } catch(IOException e) {
+        } catch (IOException e) {
             Trace.comm.errorm("IOException on byte array??", e);
         }
         return ret + "\n" + HexStringUtils.byteArrayToReadableHexString(packet);
@@ -452,6 +481,7 @@
     /*package*/ int getState() {
         return myState;
     }
+
     /**
      * Process expecting an GIVEINFO <remoteVatID> <remotePath> <hisPublicKey>
      *   -or-
@@ -470,8 +500,7 @@
     private void handleStateIncomingExpectGIVEINFO(byte token,
                                                    DataInputStream packetIn,
                                                    byte[] packet)
-         throws IOException
-    {
+      throws IOException {
         hisMessagesToSign.addElement(packet);
         if (myStop) {
             startupError(TOK_DUP, "Stopped connection");
@@ -481,44 +510,50 @@
             String remoteSearchPath = packetIn.readUTF();
             byte[] hisKey = new byte[packetIn.readUnsignedShort()];
             packetIn.readFully(hisKey);
-            if (!isHisPublicKeyOK(myRemoteVatID, hisKey, token)) return;;
+            if (!isHisPublicKeyOK(myRemoteVatID, hisKey, token)) return;
+            ;
 
             int i = myDataPath.identifyIncoming(myLocalVatID,
                                                 myRemoteVatID,
                                                 remoteSearchPath);
             switch (i) {
-                case VatTPMgr.LIVES_CONTINUE: {
-                    myState = ST_INCOMING_EXPECT_GO;
-                    sendReplyInfo();
-                    break;
-                }
-                case VatTPMgr.LIVES_DUP: {
-                    myDataPath.stopStartUpProtocol();
-                    startupError(TOK_DUP, "Crossed connections");
-                    break;
-                }
-                case VatTPMgr.LIVES_NOTIFY: {
-                    myState = ST_INCOMING_EXPECT_GO;
-                    sendYouChose();
-                    break;
-                }
-                default: {
-                    Trace.comm.errorm("Invalid return code=" + i);
-                    startupError(TOK_ERR_INTERNAL, "Internal error at my end");
-                    break;
-                }
+                case VatTPMgr.LIVES_CONTINUE:
+                    {
+                        myState = ST_INCOMING_EXPECT_GO;
+                        sendReplyInfo();
+                        break;
+                    }
+                case VatTPMgr.LIVES_DUP:
+                    {
+                        myDataPath.stopStartUpProtocol();
+                        startupError(TOK_DUP, "Crossed connections");
+                        break;
+                    }
+                case VatTPMgr.LIVES_NOTIFY:
+                    {
+                        myState = ST_INCOMING_EXPECT_GO;
+                        sendYouChose();
+                        break;
+                    }
+                default:
+                    {
+                        Trace.comm.errorm("Invalid return code=" + i);
+                        startupError(TOK_ERR_INTERNAL, "Internal error at my end");
+                        break;
+                    }
             }
         } else if (token == TOK_DUP) {
             myDataPath.duplicatePath(
-                        "Incoming crossed connections"
-                        + formatStartupPacket(packet), false);
+              "Incoming crossed connections"
+              + formatStartupPacket(packet), false);
         } else if (token == TOK_NOT_ME) {
             startupLocalError("Other end tried to connect to self");
         } else {
             startupError(TOK_ERR_PROTOCOL, "Expected " + tokName(TOK_GIVEINFO)
-                            + " got " + formatStartupPacket(packet));
+                         + " got " + formatStartupPacket(packet));
         }
     }
+
     /**
      * Process expecting a GO <auth suite> <DH parameter>
      *   -or-
@@ -537,8 +572,8 @@
      *            notifing the other end.
      */
     private void handleStateIncomingExpectGO(byte token,
-                DataInputStream packetIn, byte[] packet)
-            throws IOException {
+                                             DataInputStream packetIn, byte[] packet)
+      throws IOException {
         if (token == TOK_GO) {
             String protocol = packetIn.readUTF();
             if (myDataPath.resumeConnection(null)) {
@@ -581,13 +616,14 @@
             }
         } else if (token == TOK_DUP) {
             myDataPath.duplicatePath(
-                        "Incoming crossed connections "
-                        + formatStartupPacket(packet), true);
+              "Incoming crossed connections "
+              + formatStartupPacket(packet), true);
         } else {
             startupError(TOK_ERR_PROTOCOL, "Expected " + tokName(TOK_GO)
-                    + " got " + formatStartupPacket(packet));
+                         + " got " + formatStartupPacket(packet));
         }
     }
+
     /**
      * Process expecting a IWANT <localVatID> message.
      *
@@ -599,22 +635,22 @@
      *            should terminate.
      */
     private void handleStateIncomingExpectIWANT(byte token,
-                DataInputStream packetIn, byte[] packet)
-            throws IOException {
+                                                DataInputStream packetIn, byte[] packet)
+      throws IOException {
         hisMessagesToSign.addElement(packet);
         if (myStop) {
             startupError(TOK_DUP, "Stopped connection");
             return;
         }
-        if (token != TOK_IWANT) { /* IWANT <id> */
+        if (token != TOK_IWANT) {
+            /* IWANT <id> */
             startupError(TOK_ERR_PROTOCOL, "Expected " + tokName(TOK_IWANT)
                          + " got " + formatStartupPacket(packet));
             return;
         }
         String wantedVatID = packetIn.readUTF();
         if (wantedVatID.equals(myLocalVatID) ||
-            wantedVatID.equals(VatIdentity.WHOEVER))
-        {
+          wantedVatID.equals(VatIdentity.WHOEVER)) {
             sendIAm();
             myState = ST_INCOMING_EXPECT_GIVEINFO;
             return;
@@ -630,7 +666,7 @@
         }
         if (Trace.comm.debug && Trace.ON) {
             Trace.comm.debugm("got request for " + wantedVatID
-                    + " when I am " + myLocalVatID);
+                              + " when I am " + myLocalVatID);
         }
         startupError(TOK_NOT_ME, "I don't know " + wantedVatID);
     }
@@ -655,8 +691,8 @@
      *            notifing the other end.
      */
     private void handleStateOutgoingExpectGOTOO(byte token,
-                DataInputStream packetIn, byte[] packet)
-            throws IOException {
+                                                DataInputStream packetIn, byte[] packet)
+      throws IOException {
         if (token == TOK_GOTOO) {
             if (null != myOutgoingSuspendID) {
                 myProtocolSuite = null;
@@ -680,9 +716,10 @@
             myDataPath.cantResume(formatStartupPacket(packet));
         } else {
             startupError(TOK_ERR_PROTOCOL, "Expected " + tokName(TOK_GOTOO)
-                    + " got " + formatStartupPacket(packet));
+                         + " got " + formatStartupPacket(packet));
         }
     }
+
     /**
      * Process expecting an IAM <remoteVatID> <myPublicKey>
      *   -or-
@@ -703,8 +740,8 @@
      *            notifing the other end.
      */
     private void handleStateOutgoingExpectIAM(byte token,
-                DataInputStream packetIn, byte[] packet)
-    throws IOException {
+                                              DataInputStream packetIn, byte[] packet)
+      throws IOException {
         hisMessagesToSign.addElement(packet);
         if (myStop) {
             startupError(TOK_DUP, "Stopped connection");
@@ -721,7 +758,7 @@
                 myDataPath.enqueue(outbuf.toByteArray());
                 myDataPath.connectToSelf();
             } else if (remoteVatID.equals(myRemoteVatID)
-                    || myRemoteVatID.equals(VatIdentity.WHOEVER)) {
+              || myRemoteVatID.equals(VatIdentity.WHOEVER)) {
                 byte[] hisKey = new byte[packetIn.readUnsignedShort()];
                 packetIn.readFully(hisKey);
                 if (!isHisPublicKeyOK(remoteVatID, hisKey, token)) return;
@@ -729,9 +766,9 @@
                 if (myRemoteVatID.equals(VatIdentity.WHOEVER)) {
                     myRemoteVatID = remoteVatID;
                     Object orders = myDataPath.identifyOutgoing(
-                                                    myLocalVatID,
-                                                    myRemoteVatID,
-                                                    remoteFlattenedSearchPath);
+                      myLocalVatID,
+                      myRemoteVatID,
+                      remoteFlattenedSearchPath);
                     if (null == orders) {
                         myOutgoingSuspendID = null;
                     } else if (orders instanceof byte[]) {
@@ -757,13 +794,14 @@
             startupLocalError("got " + formatStartupPacket(packet));
         } else if (token == TOK_DUP) {
             myDataPath.duplicatePath(
-                        "outgoing crossed connections"
-                        + formatStartupPacket(packet), true);
+              "outgoing crossed connections"
+              + formatStartupPacket(packet), true);
         } else {
             startupError(TOK_ERR_PROTOCOL, "Expected " + tokName(TOK_IAM)
-                    + " got " + formatStartupPacket(packet));
+                         + " got " + formatStartupPacket(packet));
         }
     }
+
     /**
      * Process expecting a REPLYINFO <remotePath>
      *   -or-
@@ -782,8 +820,8 @@
      *            notifing the other end.
      */
     private void handleStateOutgoingExpectREPLYINFO(byte token,
-                DataInputStream packetIn, byte[] packet)
-            throws IOException {
+                                                    DataInputStream packetIn, byte[] packet)
+      throws IOException {
         hisMessagesToSign.addElement(packet);
         if (myStop) {
             startupError(TOK_DUP, "Stopped connection");
@@ -792,9 +830,9 @@
             //String remoteSearchPath = packetIn.readUTF();
             String protocols = packetIn.readUTF();
             if (TOK_YOUCHOSE == token && myDataPath.isChoiceIncoming()) {
-                    myDataPath.stopStartUpProtocol();
-                    startupError(TOK_DUP, "Crossed connections");
-                    return;
+                myDataPath.stopStartUpProtocol();
+                startupError(TOK_DUP, "Crossed connections");
+                return;
             }
             //String[] path = EARL.parseSearchPath(remoteSearchPath);
             //myDataPath.extendSearchPath(path);
@@ -803,20 +841,20 @@
                 sendResume();
                 return;
             }
-            for (;;) {
+            for (; ;) {
                 int i = protocols.indexOf(',');
                 String protocol;
                 if (i < 0) {
                     protocol = protocols;
                     protocols = "";
                 } else {
-                    protocol = protocols.substring(0,i);
-                    protocols = protocols.substring(i+1);
+                    protocol = protocols.substring(0, i);
+                    protocols = protocols.substring(i + 1);
                 }
                 if (protocol.equals("")) {
                     //No agreement
                     startupError(TOK_ERR_PROTOCOL,
-                                        "Can't agree on an authorization protocol");
+                                 "Can't agree on an authorization protocol");
                     return;
                 }
                 if (null != matchProtocols(protocol)) {
@@ -832,8 +870,8 @@
             }
         } else if (token == TOK_DUP) {
             myDataPath.duplicatePath(
-                        "Outgoing crossed connections "
-                        + formatStartupPacket(packet), true);
+              "Outgoing crossed connections "
+              + formatStartupPacket(packet), true);
             return;
         } else {
             startupError(TOK_ERR_PROTOCOL, "Expected "
@@ -842,114 +880,119 @@
             return;
         }
     }
-  /**
-   * Decode the line form of his public key and check that it is for his
-   * vatID.
-   *
-   * @param vatID His vatID.
-   * @param hisKey His DSA public key expressed as a byte array.
-   *
-   * @exception ConnectionStartupException If hisKey has a bad format, or is
-   *          invalid.
-   * @return is true if his public key matches is vatID, false otherwise.
-   */
 
+    /**
+     * Decode the line form of his public key and check that it is for his
+     * vatID.
+     *
+     * @param vatID His vatID.
+     * @param hisKey His DSA public key expressed as a byte array.
+     *
+     * @exception ConnectionStartupException If hisKey has a bad format, or is
+     *          invalid.
+     * @return is true if his public key matches is vatID, false otherwise.
+     */
+
     private boolean isHisPublicKeyOK(String vatID, byte[] hisKey, int token)
-            throws IOException {
+      throws IOException {
         try {
             myHisPublicKey = new DSAPublicKey(hisKey);
             if (!vatID.equals(
-                    VatIdentity.calculateVatID(myHisPublicKey))) {
+              VatIdentity.calculateVatID(myHisPublicKey))) {
                 startupError(TOK_ERR_WRONG_ID, "Your key is not for your vat ID");
                 return false;
             }
-        } catch(InvalidKeyException e) {
+        } catch (InvalidKeyException e) {
             Trace.comm.debugm("InvalidKeyException", e);
             startupError(TOK_ERR_WRONG_ID, "You provided an invalid public key");
             return false;
-        } catch(NumberFormatException e) {
+        } catch (NumberFormatException e) {
             Trace.comm.debugm("NumberFormatException", e);
             startupError(TOK_ERR_WRONG_ID, "You did not provide valid public key data ", e);
             return false;
         }
         return true;
     }
-  /**
-   * Perform the second calculation in Diffie Hellman key exchange.
-   * <p>
-   * This method takes the remote end's g**y mod p, and the sitnature on it.
-   * It checks ths signature and performs the second Diffie Hellman calculation
-   * as (g**y mod p) ** x mod p.
-   * <p>
-   * It then takes the resulting dh secret and calculates values for the
-   * initial sequence numbers (both send path and receive path).
-   *
-   * @param publiddh is a byte array containing the far end's first Diffie
-   *         Hellman calculation.
-   * @param sig is a byte array containing the far end's DSS signature on
-   *         the startup protocol.
-   * @param token The startup protocol token being processed.  (For determining
-   *         whether we are the initator or receipent and error reporting.)
-   *
-   * @return is true if the connection attempt should continue,
-   *         false otherwise.
-   */
 
+    /**
+     * Perform the second calculation in Diffie Hellman key exchange.
+     * <p>
+     * This method takes the remote end's g**y mod p, and the sitnature on it.
+     * It checks ths signature and performs the second Diffie Hellman calculation
+     * as (g**y mod p) ** x mod p.
+     * <p>
+     * It then takes the resulting dh secret and calculates values for the
+     * initial sequence numbers (both send path and receive path).
+     *
+     * @param publiddh is a byte array containing the far end's first Diffie
+     *         Hellman calculation.
+     * @param sig is a byte array containing the far end's DSS signature on
+     *         the startup protocol.
+     * @param token The startup protocol token being processed.  (For determining
+     *         whether we are the initator or receipent and error reporting.)
+     *
+     * @return is true if the connection attempt should continue,
+     *         false otherwise.
+     */
+
     private boolean isSecondDHOK(byte[] publicdh, byte[] sig, byte token)
-            throws IOException {
+      throws IOException {
         long startTime = Trace.comm.timing ? MicroTime.queryTimer() : 0;
         if (!isSigGood(publicdh, sig, token)) {
             return false;     // Bow out, messages already issued
         }
         BigInteger dh = new BigInteger(publicdh);
         //byte[] dhSecret = dh.modPow(x,modulus).toByteArray();
-            BigInteger test = dh.modPow(x,modulus);
-            byte[] dhSecret = test.toByteArray();
+        BigInteger test = dh.modPow(x, modulus);
+        byte[] dhSecret = test.toByteArray();
         // Now calculate the various keys from dhSecret
         MessageDigest md5 = null;
         try {
             md5 = MessageDigest.getInstance("MD5");
-        } catch(NoSuchAlgorithmException e) {
+        } catch (NoSuchAlgorithmException e) {
             startupError(TOK_ERR_INTERNAL, "Unable to build MD5", e);
             return false;
         }
         byte[] ivs = md5Hash(0x99, dhSecret, md5);
         byte[] sendIV;
         byte[] recvIV;
-        if (TOK_GO == token) { // We are receipent
+        if (TOK_GO == token) {
+            // We are receipent
             sendIV = subbytearray(ivs, 8, 8);
             recvIV = subbytearray(ivs, 0, 8);
-        } else {                                  // We are initiator
+        } else {
+            // We are initiator
             sendIV = subbytearray(ivs, 0, 8);
             recvIV = subbytearray(ivs, 8, 8);
         }
         if (Trace.comm.timing && Trace.ON) {
             Trace.comm.timingm("SecondDiffieHellman time "
-                + (MicroTime.queryTimer() - startTime) + " microseconds");
+                               + (MicroTime.queryTimer() - startTime) + " microseconds");
         }
         myDataPath.setAuthorizationSecrets(dhSecret, sendIV, recvIV);
         return true;
     }
-  /**
-   * Check the signature on the data received.
-   *
-   * @param data is the data to check.
-   * @param sig is the signature.
-   * @param token is the startup protocol token being processed for error
-   * reporting.
-   *
-   * @return is true if the signature is good.  False for a bunch of "can't
-   * occur" situations,
-   * and things like invalid or no public key from the other end, or invalid
-   * signature.
-   */
 
+    /**
+     * Check the signature on the data received.
+     *
+     * @param data is the data to check.
+     * @param sig is the signature.
+     * @param token is the startup protocol token being processed for error
+     * reporting.
+     *
+     * @return is true if the signature is good.  False for a bunch of "can't
+     * occur" situations,
+     * and things like invalid or no public key from the other end, or invalid
+     * signature.
+     */
+
     private boolean isSigGood(byte[] data, byte[] sig, byte token)
-            throws IOException {
+      throws IOException {
         if (null == mySignature) {
             try {
                 mySignature = Signature.getInstance("DSA");
-            } catch(NoSuchAlgorithmException e) {
+            } catch (NoSuchAlgorithmException e) {
                 Trace.comm.errorm("Unable to build DSA", e);
                 startupError(TOK_ERR_INTERNAL, "Unable to build DSA", e);
                 return false;
@@ -961,12 +1004,12 @@
         }
         try {
             mySignature.initVerify(myHisPublicKey);
-        } catch(InvalidKeyException e) {
+        } catch (InvalidKeyException e) {
             startupError(TOK_ERR_PROTOCOL, "Invalid His Public Key", e);
             return false;
         }
         try {
-            for (int i=0; i<hisMessagesToSign.size(); i++) {
+            for (int i = 0; i < hisMessagesToSign.size(); i++) {
                 mySignature.update((byte[])hisMessagesToSign.elementAt(i));
             }
             mySignature.update(data);
@@ -974,16 +1017,17 @@
                 startupError(TOK_ERR_PROTOCOL, "Invalid signature");
                 return false;
             }
-        } catch(SignatureException e) {
+        } catch (SignatureException e) {
             startupError(TOK_ERR_PROTOCOL, "Invalid signature", e);
             return false;
-        } catch(NumberFormatException e) {
+        } catch (NumberFormatException e) {
             startupError(TOK_ERR_PROTOCOL, "Invalid signature", e);
             return false;
         }
         Trace.comm.eventm("Signature checked as valid");
         return true;
     }
+
     /**
      * Match a suggested authorization protocol with the ones we support.
      * The comparison ignores the case of the letters.
@@ -992,30 +1036,31 @@
      * @return the standard cased version of the matched name or null if no match.
      */
     private String matchProtocols(String protocol) {
-        for (int i=0; i<TheAuthProtocolTable.length; i++) {
+        for (int i = 0; i < TheAuthProtocolTable.length; i++) {
             if (protocol.equalsIgnoreCase(TheAuthProtocolTable[i])) {
                 return TheAuthProtocolTable[i];
             }
         }
         return null;
     }
-  /**
-   * Calculate the MD5 hash of some data with a specific padding.
-   * <p>
-   * The padding allows different values to be obtained from the same data
-   * by varing the padding value.  We use it to get the different
-   * authentication values from the same Diffie Hellman shared secret.
-   *
-   * @param pad The int (treated as a byte) to be used to pad the MD5 calculation.
-   * @param data The data to be hashed.
-   * @param md5 The message digest object to be used.
-   *
-   * @return A byte array representing the hash.
-   */
+
+    /**
+     * Calculate the MD5 hash of some data with a specific padding.
+     * <p>
+     * The padding allows different values to be obtained from the same data
+     * by varing the padding value.  We use it to get the different
+     * authentication values from the same Diffie Hellman shared secret.
+     *
+     * @param pad The int (treated as a byte) to be used to pad the MD5 calculation.
+     * @param data The data to be hashed.
+     * @param md5 The message digest object to be used.
+     *
+     * @return A byte array representing the hash.
+     */
 
     private byte[] md5Hash(int pad, byte[] data, MessageDigest md5) {
         byte[] mdConst = new byte[16];
-        for (int i=0; i<mdConst.length; i++) mdConst[i] = (byte)pad;
+        for (int i = 0; i < mdConst.length; i++) mdConst[i] = (byte)pad;
         md5.reset();                    //Initialize a new hash
         md5.update(mdConst);
         return md5.digest(data);
@@ -1034,7 +1079,7 @@
 
         if (Trace.comm.verbose && Trace.ON) {
             Trace.comm.verbosem(
-                    HexStringUtils.byteArrayToReadableHexString(packetArray));
+              HexStringUtils.byteArrayToReadableHexString(packetArray));
         }
 
         try {
@@ -1052,43 +1097,44 @@
 
                     if (Trace.comm.verbose && Trace.ON)
                         Trace.comm.verbosem("received startup packet "
-                                + formatStartupPacket(packetArray));
+                                            + formatStartupPacket(packetArray));
 
                     if (token < 0) {
                         startupLocalError("Error " + tokName(token)
-                                + " from other side: " + packetIn.readUTF());
+                                          + " from other side: " + packetIn.readUTF());
                         return;
                     }
 
                     switch (myState) {
                         case ST_INCOMING_EXPECT_IWANT:
                             handleStateIncomingExpectIWANT(
-                                    token, packetIn, packetArray);
+                              token, packetIn, packetArray);
                             break;
                         case ST_OUTGOING_EXPECT_IAM:
                             handleStateOutgoingExpectIAM(
-                                    token, packetIn, packetArray);
+                              token, packetIn, packetArray);
                             break;
                         case ST_INCOMING_EXPECT_GIVEINFO:
                             handleStateIncomingExpectGIVEINFO(
-                                    token, packetIn, packetArray);
+                              token, packetIn, packetArray);
                             break;
                         case ST_OUTGOING_EXPECT_REPLYINFO:
                             handleStateOutgoingExpectREPLYINFO(
-                                    token, packetIn, packetArray);
+                              token, packetIn, packetArray);
                             break;
                         case ST_INCOMING_EXPECT_GO:
                             handleStateIncomingExpectGO(
-                                    token, packetIn, packetArray);
+                              token, packetIn, packetArray);
                             break;
                         case ST_OUTGOING_EXPECT_GOTOO:
                             handleStateOutgoingExpectGOTOO(
-                                    token, packetIn, packetArray);
+                              token, packetIn, packetArray);
                             break;
                         case ST_DEAD:
-                            if (Trace.comm.debug && Trace.ON) Trace.comm.debugm(
-                                "dead MsgConnection ignoring startup packet "
-                                        + formatStartupPacket(packetArray));
+                            if (Trace.comm.debug && Trace.ON)
+                                Trace.comm.debugm(
+                                  "dead MsgConnection ignoring startup packet "
+                                  + formatStartupPacket(packetArray));
                             break;
                         default:
                             startupLocalError("state machine confused, in state " +
@@ -1100,14 +1146,14 @@
             } catch (IOException e) {
                 try {
                     startupError(TOK_ERR_PROTOCOL,
-                             "Exception handling packet: ", e);
+                                 "Exception handling packet: ", e);
                 } catch (IOException e2) {
                     Trace.comm.errorm("IOException " + e2 + " handling exception", e);
                 }
             }
         } catch (Exception e) {
             Trace.comm.errorm(
-                    "Exception during startup for\n  " + myDataPath, e);
+              "Exception during startup for\n  " + myDataPath, e);
             if (!myStop) {
                 myDataPath.tryNext(e.toString() + "\n" + ThrowableSugar.javaStack(e));
             } else {
@@ -1115,6 +1161,7 @@
             }
         }
     }
+
     /**
      * Handle the Msg.PROTOCOL_ACCEPTED message.
      * Determine which version of the protocol was accepted and configure this
@@ -1123,11 +1170,11 @@
      * @param packetBytes the packet received.
      */
     private void processProtocolAccepted(DataInputStream packetIn,
-                byte[] packet)
-            throws IOException {
+                                         byte[] packet)
+      throws IOException {
         hisMessagesToSign.addElement(packet);
         String theirVersion = packetIn.readUTF();
-        for (int i=0; i<Msg.Version.length; i++) {
+        for (int i = 0; i < Msg.Version.length; i++) {
             if (theirVersion.equals(Msg.Version[i])) {
                 myEMsgProtocolVersion = Msg.Version[i];
                 return;
@@ -1135,13 +1182,14 @@
         }
         String err = "incoming protocol version " + theirVersion;
         err += " are not supported, use versions ";
-        for (int i=0; i<Msg.Version.length-1; i++) {
+        for (int i = 0; i < Msg.Version.length - 1; i++) {
             err += (Msg.Version[i] + ", ");
         }
-        err += Msg.Version[Msg.Version.length-1];
+        err += Msg.Version[Msg.Version.length - 1];
         sendErrProtocol(err);
         throw new IOException(err);
     }
+
     /**
      * Send a TOK_ERR_PROTOCOL packet
      *
@@ -1157,6 +1205,7 @@
         msgOut.writeUTF(msg);
         myDataPath.enqueue(outbuf.toByteArray());
     }
+
     /**
      * Send a TOK_GIVEINFO packet
      *
@@ -1174,6 +1223,7 @@
         msgOut.write(key);
         sendMessageForSignature(outbuf.toByteArray());
     }
+
     /**
      * Send a TOK_GO packet
      *
@@ -1190,6 +1240,7 @@
         // No need to sign, no signature
         myDataPath.enqueue(outbuf.toByteArray());
     }
+
     /**
      * Send a TOK_GO packet
      *
@@ -1213,6 +1264,7 @@
         // No need to sign, this one contains the signature.
         myDataPath.enqueue(outbuf.toByteArray());
     }
+
     /**
      * Send a TOK_GOTOO packet.
 
@@ -1232,6 +1284,7 @@
         // No need to sign, there is no checking
         myDataPath.enqueue(outbuf.toByteArray());
     }
+
     /**
      * Send a TOK_GOTOO packet
      *
@@ -1242,7 +1295,7 @@
      * @exception IOException is thrown if there is a problem on the send.
      */
     private void sendGoToo(String protocol, byte[] dhparm,
-                        byte[] sig) throws IOException {
+                           byte[] sig) throws IOException {
         ByteArrayOutputStream outbuf = new ByteArrayOutputStream();
         DataOutputStream msgOut = new DataOutputStream(outbuf);
         msgOut.writeByte(Msg.STARTUP);
@@ -1255,6 +1308,7 @@
         // No need to sign, this message contains the signature
         myDataPath.enqueue(outbuf.toByteArray());
     }
+
     /**
      * Send a TOK_IAM packet
      *
@@ -1272,6 +1326,7 @@
         msgOut.write(key);
         sendMessageForSignature(outbuf.toByteArray());
     }
+
     /**
      * Send a TOK_IWANT packet
      *
@@ -1285,6 +1340,7 @@
         msgOut.writeUTF(myRemoteVatID);
         sendMessageForSignature(outbuf.toByteArray());
     }
+
     /** Send a message to the other end and save the message for signature
      * calculation.
      *
@@ -1294,6 +1350,7 @@
         myMessagesToSign.addElement(message);
         myDataPath.enqueue(message);
     }
+
     /**
      * Send a TOK_REPLYINFO packet
      *
@@ -1307,6 +1364,7 @@
         msgOut.writeUTF(TheAuthProtocols);
         sendMessageForSignature(outbuf.toByteArray());
     }
+
     /**
      * Send a TOK_RESUME packet
      *
@@ -1322,6 +1380,7 @@
         // We don't need to sign for resume.
         myDataPath.enqueue(outbuf.toByteArray());
     }
+
     /**
      * Send a TOK_TRY packet
      *
@@ -1336,6 +1395,7 @@
         // Don't need signature.  This ends the protocol
         myDataPath.enqueue(outbuf.toByteArray());
     }
+
     /**
      * Send a TOK_YOUCHOSE packet
      *
@@ -1349,35 +1409,36 @@
         msgOut.writeUTF(TheAuthProtocols);
         sendMessageForSignature(outbuf.toByteArray());
     }
-  /**
-   * Return a our signature on the data sent.
-   *
-   * @param data The additional data to sign.
-   * @param token The startup protocol token being processed for error reporting.
-   *
-   * @return The DSS signature on the data as a byte array.
-   * @exception ConnectionStartupException For a bunch of "can't occur" situations.
-   */
+
+    /**
+     * Return a our signature on the data sent.
+     *
+     * @param data The additional data to sign.
+     * @param token The startup protocol token being processed for error reporting.
+     *
+     * @return The DSS signature on the data as a byte array.
+     * @exception ConnectionStartupException For a bunch of "can't occur" situations.
+     */
 
     private byte[] signSent(byte[] data, byte token)
-            throws IOException {
+      throws IOException {
         long startTime = Trace.comm.timing ? MicroTime.queryTimer() : 0;
         if (null == mySignature) {
             try {
                 mySignature = Signature.getInstance("DSA");
-            } catch(NoSuchAlgorithmException e) {
+            } catch (NoSuchAlgorithmException e) {
                 startupError(TOK_ERR_INTERNAL, "Unable to build DSA", e);
                 return null;
             }
         }
         try {
- //WARNING - WARNING - WARNING
- // In order to use ESecureRandom to calculate each signature in mySignature
- // we directly set the random signature seed.  If we ever calculate two
- // signatures with the same seed, we have blown the security of the secret
- // key.
- // I (WSF) think it will be easier to avoid this problem if mySignature
- // remains private, and signatures are only calculated one place in the code.
+            //WARNING - WARNING - WARNING
+            // In order to use ESecureRandom to calculate each signature in mySignature
+            // we directly set the random signature seed.  If we ever calculate two
+            // signatures with the same seed, we have blown the security of the secret
+            // key.
+            // I (WSF) think it will be easier to avoid this problem if mySignature
+            // remains private, and signatures are only calculated one place in the code.
             PrivateKey pk = myIdentityKeys.getPrivate();
             BigInteger q = ((DSAPrivateKey)pk).getParams().getQ();
             while (true) {
@@ -1388,25 +1449,27 @@
                 }
             }
             mySignature.initSign(pk);
-        } catch(InvalidKeyException e) {
+        } catch (InvalidKeyException e) {
             startupError(TOK_ERR_INTERNAL, "Invalid private key???", e);
             return null;
         }
         byte[] signature = null;
         try {
-            for (int i=0; i<myMessagesToSign.size(); i++) {
+            for (int i = 0; i < myMessagesToSign.size(); i++) {
                 mySignature.update((byte[])myMessagesToSign.elementAt(i));
             }
             mySignature.update(data);
             signature = mySignature.sign();
-        } catch(SignatureException e) {
+        } catch (SignatureException e) {
             startupError(TOK_ERR_INTERNAL, "Unable to sign???", e);
             return null;
         }
-        if (Trace.comm.timing && Trace.ON) Trace.comm.timingm("Signing time "
-                + (MicroTime.queryTimer() - startTime) + " microseconds");
+        if (Trace.comm.timing && Trace.ON)
+            Trace.comm.timingm("Signing time "
+                               + (MicroTime.queryTimer() - startTime) + " microseconds");
         return signature;
     }
+
     /**
      * Terminate the connection setup protocol with an error that will get
      * passed to the remote end too.
@@ -1428,6 +1491,7 @@
             myDataPath.shutDownPath();
         }
     }
+
     /**
      * Terminate the connection setup protocol with an error that will get
      * passed to the remote end too.
@@ -1437,7 +1501,7 @@
      * @param t A throwable associated with the error.
      */
     private void startupError(byte errorToken, String msg, Throwable t)
-            throws IOException {
+      throws IOException {
         ByteArrayOutputStream outbuf = new ByteArrayOutputStream();
         DataOutputStream msgOut = new DataOutputStream(outbuf);
         msgOut.writeByte(Msg.STARTUP);
@@ -1452,6 +1516,7 @@
             myDataPath.shutDownPath();
         }
     }
+
     /**
      * Terminate the connection setup protocol with an error.
      */
@@ -1462,6 +1527,7 @@
             myDataPath.shutDownPath();
         }
     }
+
     /**
      * Startup protocol has succeeded, let the messages flow.
      */
@@ -1472,62 +1538,64 @@
         myDataPath.unRegisterMsgHandler(Msg.PROTOCOL_ACCEPTED, this);
 
         myDataPath.startupSuccessful(
-                            myEMsgProtocolVersion,
-                            myProtocolSuite);
+          myEMsgProtocolVersion,
+          myProtocolSuite);
     }
 // Method for use by DataPath
     /**
-         * Stop the start up protocol.  This method is called by the DataPath
-         * relaying a call from the VatTPMgr when it determines that
-         * there are two connections being built between this vat and another vat,
-         * andthat this connection is the one that should be abandonded.
-         */
+     * Stop the start up protocol.  This method is called by the DataPath
+     * relaying a call from the VatTPMgr when it determines that
+     * there are two connections being built between this vat and another vat,
+     * andthat this connection is the one that should be abandonded.
+     */
 
     /*package*/ void stopStartUpProtocol() {
         myStop = true;
     }
-  /**
-   * Return a subarray of a given array.
-   * <p>
-   * The subarray must be within the given array or an exception will be
-thrown.
-   *
-   * @param bytes The array.
-   * @param offset The offset in bytes to the start of the subarray.
-   * @param len The length of the subarray.
-   *
-   * @return A new byte array which is the subarray.
-   */
+
+    /**
+     * Return a subarray of a given array.
+     * <p>
+     * The subarray must be within the given array or an exception will be
+  thrown.
+     *
+     * @param bytes The array.
+     * @param offset The offset in bytes to the start of the subarray.
+     * @param len The length of the subarray.
+     *
+     * @return A new byte array which is the subarray.
+     */
 
     private byte[] subbytearray(byte[] bytes, int offset, int len) {
         byte[] ans = new byte[len];
         System.arraycopy(bytes, offset, ans, 0, len);
         return ans;
     }
-   /**
-    * Translate a startup protocol message token to a printable string for
-    * error messages and the like.
-    *
-    * @param tok The integer startup token to represent as a string.
-    * @return A string value for the token or TOK_ERR_??? if tok is negative,
-    *         or TOK_??? if tok is positive.
-    */
+
+    /**
+     * Translate a startup protocol message token to a printable string for
+     * error messages and the like.
+     *
+     * @param tok The integer startup token to represent as a string.
+     * @return A string value for the token or TOK_ERR_??? if tok is negative,
+     *         or TOK_??? if tok is positive.
+     */
 
     static String tokName(int tok) {
         if (tok < 0) {
-            tok = -tok ;
+            tok = -tok;
             if (tok > errTokNames.length) {
-                return "TOK_ERR_???[-" + tok + "]" ;
+                return "TOK_ERR_???[-" + tok + "]";
             }
-            return errTokNames[tok-1] + "[-" + tok + "]" ;
+            return errTokNames[tok - 1] + "[-" + tok + "]";
         }
         if (tok == 0) {
-            return "TOK_???[0]" ;
+            return "TOK_???[0]";
         }
         if (tok > tokNames.length) {
-            return "TOK_???[" + tok + "]" ;
+            return "TOK_???[" + tok + "]";
         }
-        return tokNames[tok-1] + "[" + tok + "]" ;
+        return tokNames[tok - 1] + "[" + tok + "]";
     }
 }
 



1.3       +3 -1      e/src/jsrc/net/vattp/data/StreamMessage.java

Index: StreamMessage.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/StreamMessage.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StreamMessage.java	2001/09/06 09:55:39	1.2
+++ StreamMessage.java	2001/11/10 19:40:37	1.3
@@ -26,7 +26,9 @@
  * Structure to pass notification type message to the SendThread
  * @author Bill Frantz
  */
-/*package*/ class StreamMessage {
+/*package*/
+class StreamMessage {
+
     /*package*/byte[] myMessage;
     /*package*/Runnable myNotification;
     /*package*/Runner myPlaceToRun;



1.4       +16 -13    e/src/jsrc/net/vattp/data/Suspend.java

Index: Suspend.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/Suspend.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Suspend.java	2001/10/02 01:29:18	1.3
+++ Suspend.java	2001/11/10 19:40:37	1.4
@@ -33,17 +33,19 @@
  * @author Bill Frantz
  */
 
-/*package*/ class Suspend implements MsgHandler {
+/*package*/
+class Suspend implements MsgHandler {
+
     /**
-         * Constuct an object to handle the SUSPEND message (which also acts as
-         * the shutdown message).
-         *
-         * @param connection is the VatTPConnection to work with.
-         */
+     * Constuct an object to handle the SUSPEND message (which also acts as
+     * the shutdown message).
+     *
+     * @param connection is the VatTPConnection to work with.
+     */
     /*package*/ Suspend(VatTPConnection connection) {
         try {
             connection.registerMsgHandler(Msg.SUSPEND, this);
-        } catch(IOException e) {
+        } catch (IOException e) {
             Trace.comm.errorm("Already registered??");
         }
     }
@@ -66,17 +68,18 @@
      */
     public void processMessage(byte[] message, VatTPConnection connection) {
         Assertion.test(Msg.SUSPEND == message[0], "Message not a SUSPEND message\n",
-                        HexStringUtils.byteArrayToReadableHexString(message));
-        if (1 == message.length) {  // Message is a shutdown message
+                       HexStringUtils.byteArrayToReadableHexString(message));
+        if (1 == message.length) {
+            // Message is a shutdown message
             if (Trace.comm.debug && Trace.ON) {
                 Trace.comm.debugm("Shutting down connection " + connection);
             }
             try {
                 // shutdownConnection will send shutdown message.
                 connection.shutDownConnection(new ConnectionShutDownException(
-                        "Other End Requested Shutdown"));
+                  "Other End Requested Shutdown"));
                 connection.close();                 // Close TCP
-            } catch(IOException e) {
+            } catch (IOException e) {
                 Trace.comm.errorm("Error shutting down connection", e);
             }
             return;
@@ -88,12 +91,12 @@
             byte[] suspendID = new byte[is.readUnsignedShort()];
             is.read(suspendID);
             connection.handleSuspend(suspendID);
-        } catch(IOException e) {
+        } catch (IOException e) {
             Trace.comm.errorm("IOException reading suspendID", e);
             try {
                 connection.shutDownConnection();    // Will send shutdown message.
                 connection.close();                 // Close TCP
-            } catch(IOException e2) {
+            } catch (IOException e2) {
                 Trace.comm.errorm("Error shutting down connection", e2);
             }
         }



1.4       +9 -12     e/src/jsrc/net/vattp/data/TripleDESKeyConstructor.java

Index: TripleDESKeyConstructor.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/TripleDESKeyConstructor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TripleDESKeyConstructor.java	2001/09/06 09:55:39	1.3
+++ TripleDESKeyConstructor.java	2001/11/10 19:40:37	1.4
@@ -1,4 +1,5 @@
 package net.vattp.data;
+
 /*
 This file contains only code created by Tyler Close, not a citizen or
 resident of the US.
@@ -23,11 +24,12 @@
  * Utility method for constructing a 3DES key from a Diffie-Hellman secret.
  */
 final
-class TripleDESKeyConstructor
-{
+  class TripleDESKeyConstructor {
+
     static private final String DIGEST_ALGORITHM_NAME = "MD5";
 
     static private final int DES_KEY_LENGTH = 8;
+
     static private final int TRIPLE_DES_KEY_LENGTH = 3 * DES_KEY_LENGTH;
 
     static private final int KEY_PAD_LENGTH = 16;
@@ -49,10 +51,8 @@
      * @see http://www.erights.org/doc/to-be-sorted/DataComm_startup.html
      */
     static
-    byte[] make(final byte[] dhSecret)
-    {
-        try
-        {
+      byte[] make(final byte[] dhSecret) {
+        try {
             final byte[] raw_key = new byte[TRIPLE_DES_KEY_LENGTH];
             final byte[] buffer = new byte[KEY_PAD_LENGTH];
             final MessageDigest md = MessageDigest.getInstance(DIGEST_ALGORITHM_NAME);
@@ -64,9 +64,7 @@
             md.update(buffer);
             System.arraycopy(md.digest(dhSecret), 0, raw_key, 2 * DES_KEY_LENGTH, DES_KEY_LENGTH);
             return raw_key;
-        }
-        catch(NoSuchAlgorithmException e)
-        {
+        } catch (NoSuchAlgorithmException e) {
             Trace.comm.errorm("Unable to build " + DIGEST_ALGORITHM_NAME, e);
             Trace.comm.notifyFatal();
         }
@@ -74,9 +72,8 @@
     }
 
     static private
-    void fill(final byte[] buffer, final byte value)
-    {
-        for(int i = buffer.length; i-- != 0;)
+      void fill(final byte[] buffer, final byte value) {
+        for (int i = buffer.length; i-- != 0;)
             buffer[i] = value;
     }
 }



1.3       +5 -1      e/src/jsrc/net/vattp/data/UserThread.java

Index: UserThread.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/UserThread.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- UserThread.java	2001/09/06 09:55:39	1.2
+++ UserThread.java	2001/11/10 19:40:37	1.3
@@ -27,12 +27,15 @@
  *  @see ListenThread.startup()
  *  @see ListenThread.shutdown()
  */
-/*package*/class UserThread extends Thread {
+/*package*/
+class UserThread extends Thread {
+
     private Object myLock;
 
     UserThread(Object lock) {
         myLock = lock;
     }
+
     public void run() {
         synchronized (myLock) {
             try {
@@ -42,6 +45,7 @@
             }
         }
     }
+
     void setThreadName(String listenAddr) {
         setName("UserThread-" + listenAddr);
     }



1.7       +3 -2      e/src/jsrc/net/vattp/data/VatIdentity.java

Index: VatIdentity.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/VatIdentity.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- VatIdentity.java	2001/10/02 23:38:31	1.6
+++ VatIdentity.java	2001/11/10 19:40:37	1.7
@@ -45,7 +45,8 @@
     static /*package*/ final String WHOEVER = "0";
 
     /** prevent instantiation */
-    private VatIdentity() {}
+    private VatIdentity() {
+    }
 
     /**
      * Make a new VatIdentity object.  Constructing this object will
@@ -87,7 +88,7 @@
 
         if (Trace.comm.debug && Trace.ON) {
             Trace.comm.debugm("calculated vat Id " + vid
-                        + " from PublicKey " + key);
+                              + " from PublicKey " + key);
         }
         return vid;
     }



1.2       +217 -203  e/src/jsrc/net/vattp/data/VatTPConnection.java

Index: VatTPConnection.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/VatTPConnection.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- VatTPConnection.java	2001/10/02 01:29:18	1.1
+++ VatTPConnection.java	2001/11/10 19:40:37	1.2
@@ -64,7 +64,7 @@
     private /*nullOK*/ DataPath myIncomingDataPath;
 
     /** Array of MsgHandlers indexed by message type */
-    private MsgHandler[] myMsgHandlers = new MsgHandler[Msg.HIGH_MSG_TYPE+1];
+    private MsgHandler[] myMsgHandlers = new MsgHandler[Msg.HIGH_MSG_TYPE + 1];
 
     /** An enumeration of the places to search for the remote vat */
     private DynamicCollectionEnumeration mySiteSearch;
@@ -86,15 +86,15 @@
     private String myFlattenedRemoteSearchPath;
 
     /** The location the current DataPath are (to) (have been) speaking
-        to. */
+     to. */
     private String myRemoteAddr;
 
     /** The InetAddress of the remote end, or null if no connection has been
-        made */
+     made */
     private NetAddr myRemoteNetAddr = null;
 
     /** The InetAddress of the local end, or null if no connection has been
-        made */
+     made */
     private NetAddr myLocalNetAddr = null;
 
     /** The VatID of the other end of the connectiion. May be null. */
@@ -116,20 +116,27 @@
     /** The reason shutDownConnection has been called */
     private Throwable myShutdownReason = null;
 
-    static /*package*/ final byte STARTING   = 1;
-    static /*package*/ final byte RUNNING    = 2;
+    static /*package*/ final byte STARTING = 1;
+
+    static /*package*/ final byte RUNNING = 2;
+
     static /*package*/ final byte SUSPENDING = 3;
-    static /*package*/ final byte SUSPENDED  = 4;
-    static /*package*/ final byte RESUMING   = 5;
-    static /*package*/ final byte DIEING     = 6;
-    static /*package*/ final byte DEAD       = 7;
+
+    static /*package*/ final byte SUSPENDED = 4;
+
+    static /*package*/ final byte RESUMING = 5;
+
+    static /*package*/ final byte DIEING = 6;
+
+    static /*package*/ final byte DEAD = 7;
+
     /** The current state of this VatTPConnection */
     private byte myState;
 
     /** Place to queue outgoing messages while myState != RUNNING */
     private Vector myPendingOutput = null;
 
-        /** Place to accumulate the results of our search attempts */
+    /** Place to accumulate the results of our search attempts */
     private Vector myProblemAccumulator;
 
 
@@ -159,59 +166,58 @@
     // The following fields contain performance counters
 
     /** The total bytes of messages received over this VatTPConnection */
-    /*package*/ long bytesReceived          = 0;
+    /*package*/ long bytesReceived = 0;
 
     /** The total number of messages received over this VatTPConnection */
-    /*package*/ long messagesReceived       = 0;
+    /*package*/ long messagesReceived = 0;
 
     /** The size of the largest message received over this VatTPConnection */
-    /*package*/ int maxReceivedMessageSize  = 0;
+    /*package*/ int maxReceivedMessageSize = 0;
 
     /** The total bytes of messages sent over this VatTPConnection */
-    /*package*/ long bytesSent              = 0;
+    /*package*/ long bytesSent = 0;
 
     /** The total number of messages sent over this VatTPConnection */
-    /*package*/ long messagesSent           = 0;
+    /*package*/ long messagesSent = 0;
 
     /** The size of the largest message sent over this VatTPConnection */
-    /*package*/ int maxSentMessageSize      = 0;
+    /*package*/ int maxSentMessageSize = 0;
 
 
 
     /**
-             * Make a new VatTPConnection
-             *
-             * @param connMgr The VatTPMgr to notify of status
-             * changes.
-             *
-             * @param remoteVatID the vatID of the remote vat
-             *
-             * @param searchPath an array of Strings each of which is the IP address
-             * and port number of a place to look for the remote vat.  The IP address
-             * can be a DNS name or a dot repsentation of the 32 bit IP number.  Most
-             * commonly, the Strings will be the location of the Vat Location
-             * Servers (VLSs) with which the remote vat is believed to register.
-             *
-             * @param identityKeys is the KeyPair which defines the identity of this
-             * vat.
-             *
-             * @param runner is the Runner whose thread we use to synchronize calls
-             * into the VatTPConnection object from the SendThread and ReceiveThread
-             *
-             * @param localFlattenedSearchPath Is the search path we publish for
-             * references to us, flattened into a string.
-             *
-             * @param localSearchPath Is the search path we publish for references
-             * to us, with each element a separate String in an array.
-             */
+     * Make a new VatTPConnection
+     *
+     * @param connMgr The VatTPMgr to notify of status
+     * changes.
+     *
+     * @param remoteVatID the vatID of the remote vat
+     *
+     * @param searchPath an array of Strings each of which is the IP address
+     * and port number of a place to look for the remote vat.  The IP address
+     * can be a DNS name or a dot repsentation of the 32 bit IP number.  Most
+     * commonly, the Strings will be the location of the Vat Location
+     * Servers (VLSs) with which the remote vat is believed to register.
+     *
+     * @param identityKeys is the KeyPair which defines the identity of this
+     * vat.
+     *
+     * @param runner is the Runner whose thread we use to synchronize calls
+     * into the VatTPConnection object from the SendThread and ReceiveThread
+     *
+     * @param localFlattenedSearchPath Is the search path we publish for
+     * references to us, flattened into a string.
+     *
+     * @param localSearchPath Is the search path we publish for references
+     * to us, with each element a separate String in an array.
+     */
     /*package*/ VatTPConnection(VatTPMgr connMgr,
-                               String remoteVatID,
-                               String flattenedRemoteSearchPath,
-                               KeyPair identityKeys,
-                               String localVatID,
-                               Runner runner,
-                               String localFlattenedSearchPath)
-    {
+                                String remoteVatID,
+                                String flattenedRemoteSearchPath,
+                                KeyPair identityKeys,
+                                String localVatID,
+                                Runner runner,
+                                String localFlattenedSearchPath) {
         myConnMgr = connMgr;
         myRemoteVatID = remoteVatID;
         myIsIncoming = false;
@@ -224,15 +230,15 @@
         //Save to resume the connection
         myFlattenedRemoteSearchPath = flattenedRemoteSearchPath;
         //Make a list of locations to try for the new connection
-            // myFirstAddressToTry will always be "" here.
+        // myFirstAddressToTry will always be "" here.
         DynamicCollection searchCollection
-                    = new DynamicCollection(
-                        EARL.parseSearchPath(myFlattenedRemoteSearchPath));
+          = new DynamicCollection(
+            EARL.parseSearchPath(myFlattenedRemoteSearchPath));
         mySiteSearch = searchCollection.elems();
         myAddressesTried = new Hashtable(1);
 
         // Make a place to keep the search results
-        myProblemAccumulator  = new Vector(1,1);
+        myProblemAccumulator = new Vector(1, 1);
         // Start the search for the remote ID.
         tryNextAddress();
         if (Trace.comm.usage && Trace.ON) {
@@ -241,41 +247,41 @@
     }
 
     /**
-             * Make a new VatTPConnection for an incoming connection
-             *
-             * @param connMgr The VatTPMgr to notify of status
-             * changes.
-             *
-             * @param identityKeys is the KeyPair which defines the identity of this
-             * vat.
-             *
-             * @param localVatID is the vatID of the local vat.
-             *
-             * @param runner is the Runner whose thread we use to synchronize calls
-             * into the VatTPConnection object from the SendThread and ReceiveThread
-             *
-             * @param remoteVatID is the vatID of the remote vat.
-             *
-             * @param path The DataPath object controlling the TCP connection.
-             *
-             * @param localFlattenedSearchPath Is the search path we publish for
-             * references to us, flattened into a string.
-             *
-             * @param localSearchPath Is the search path we publish for references
-             * to us, with each element a separate String in an array.
-             *
-             * @param isIncoming is true if this connection is an incoming connection,
-             *        otherwise false.
-             */
+     * Make a new VatTPConnection for an incoming connection
+     *
+     * @param connMgr The VatTPMgr to notify of status
+     * changes.
+     *
+     * @param identityKeys is the KeyPair which defines the identity of this
+     * vat.
+     *
+     * @param localVatID is the vatID of the local vat.
+     *
+     * @param runner is the Runner whose thread we use to synchronize calls
+     * into the VatTPConnection object from the SendThread and ReceiveThread
+     *
+     * @param remoteVatID is the vatID of the remote vat.
+     *
+     * @param path The DataPath object controlling the TCP connection.
+     *
+     * @param localFlattenedSearchPath Is the search path we publish for
+     * references to us, flattened into a string.
+     *
+     * @param localSearchPath Is the search path we publish for references
+     * to us, with each element a separate String in an array.
+     *
+     * @param isIncoming is true if this connection is an incoming connection,
+     *        otherwise false.
+     */
     /*package*/ VatTPConnection(VatTPMgr connMgr,
-                               KeyPair identityKeys,
-                               String localVatID,
-                               Runner runner,
-                               String remoteVatID,
-                               DataPath path,
-                               String localFlattenedSearchPath,
-                               boolean isIncoming)
-    throws IOException {
+                                KeyPair identityKeys,
+                                String localVatID,
+                                Runner runner,
+                                String remoteVatID,
+                                DataPath path,
+                                String localFlattenedSearchPath,
+                                boolean isIncoming)
+      throws IOException {
         myConnMgr = connMgr;
         myIsIncoming = isIncoming;
         myIdentityKeys = identityKeys;
@@ -285,7 +291,7 @@
         myLocalFlattenedSearchPath = localFlattenedSearchPath;
         myState = STARTING;
         // Make a place to keep the search results
-        myProblemAccumulator  = new Vector(1,1);
+        myProblemAccumulator = new Vector(1, 1);
         connectPath(path, remoteVatID, isIncoming);
         if (Trace.comm.event && Trace.ON) {
             Trace.comm.eventm("VatTPConnection constructor done " + this);
@@ -307,30 +313,30 @@
     }
 
     /**
-         * Connect a DataPath object for an incoming connection to an existing
-         * VatTPConnection object.  This call is where we first know that there
-         * is a crossed connection problem.
-         *
-         * @param incomingPath is the DataPath object for the incoming connection.
-         * @param remoteVatID is the vatID of the remote vat.
-         * @param isIncoming is true if the DataPath represents an incoming TCP
-         *        connection, is false if it is an outgoing TCP connection.
-         * @return  LIVES_CONTINUE - Continue setting up this connection
-         * <br>     LIVES_DUP - This connection is a duplicate, discard it.
-         * <br>     LIVES_NOTIFY - Notify the other end of a duplicate connection.
-         *                         The other end must decide which connection to keep.
-         */
+     * Connect a DataPath object for an incoming connection to an existing
+     * VatTPConnection object.  This call is where we first know that there
+     * is a crossed connection problem.
+     *
+     * @param incomingPath is the DataPath object for the incoming connection.
+     * @param remoteVatID is the vatID of the remote vat.
+     * @param isIncoming is true if the DataPath represents an incoming TCP
+     *        connection, is false if it is an outgoing TCP connection.
+     * @return  LIVES_CONTINUE - Continue setting up this connection
+     * <br>     LIVES_DUP - This connection is a duplicate, discard it.
+     * <br>     LIVES_NOTIFY - Notify the other end of a duplicate connection.
+     *                         The other end must decide which connection to keep.
+     */
     /*package*/ int connectPath(DataPath incomingPath,
-                    String remoteVatID, boolean isIncoming)
-                throws IOException {
+                                String remoteVatID, boolean isIncoming)
+      throws IOException {
         int ret;    // Our return value
 
         Assertion.test(remoteVatID.equals(myRemoteVatID), "Wrong VatTPConnection\n  "
-                + this + "\n  " + incomingPath + "\n  " + remoteVatID);
+                       + this + "\n  " + incomingPath + "\n  " + remoteVatID);
         if (null == myDataPath) {
             myDataPath = incomingPath;
             myFlattenedRemoteSearchPath
-                    = myDataPath.connectConnection(this, myProtocolParms);
+              = myDataPath.connectConnection(this, myProtocolParms);
             if (SUSPENDED == myState) myState = RESUMING;
             return VatTPMgr.LIVES_CONTINUE;  //New path is only one
         }
@@ -344,30 +350,30 @@
         } else if (StartUpProtocol.ST_EXPECT_MESSAGE == outState) {
             if (Trace.comm.debug && Trace.ON) {
                 Trace.comm.debugm("Killing incoming\n  " + incomingPath
-                                + "\n  in favor of\n  " + myDataPath);
+                                  + "\n  in favor of\n  " + myDataPath);
             }
             ret = VatTPMgr.LIVES_DUP;    //Outgoing is too far along.
-        } else if (0 < myRemoteVatID.compareTo(myLocalVatID) ) {
+        } else if (0 < myRemoteVatID.compareTo(myLocalVatID)) {
             // The far end is in charge
             ret = VatTPMgr.LIVES_NOTIFY;
             myIncomingDataPath = incomingPath;
             myFlattenedRemoteSearchPath
-                    = myIncomingDataPath.connectConnection(this, myProtocolParms);
-       } else {
+              = myIncomingDataPath.connectConnection(this, myProtocolParms);
+        } else {
             // We must decide.  Outbound not EXPECT_GOTO or EXPECT_MESSAGE,
             // That means we keep the incoming and stop the outgoing.
             if (Trace.comm.debug && Trace.ON) {
                 Trace.comm.debugm("Killing outgoing\n  " + myDataPath
-                                + "\n  in favor of\n  " + incomingPath);
+                                  + "\n  in favor of\n  " + incomingPath);
             }
             myDataPath.stopStartUpProtocol();
             myDataPath = incomingPath;
             myFlattenedRemoteSearchPath
-                    = myDataPath.connectConnection(this, myProtocolParms);
+              = myDataPath.connectConnection(this, myProtocolParms);
             ret = VatTPMgr.LIVES_CONTINUE;
         }
         if (Trace.comm.debug && Trace.ON) {
-            Trace.comm.debugm("Returning "+ ret + " for " + incomingPath);
+            Trace.comm.debugm("Returning " + ret + " for " + incomingPath);
         }
         return ret;
     }
@@ -478,10 +484,10 @@
         return myRemoteVatID;
     }
     /** Get the state of this VatTPConnection.
-         *
-         * @return is the current state (STARTING, RUNNING, DIEING etc.) of this
-         *          VatTPConnection object.
-         */
+     *
+     * @return is the current state (STARTING, RUNNING, DIEING etc.) of this
+     *          VatTPConnection object.
+     */
     /*package*/ int getState() {
         return myState;
     }
@@ -492,7 +498,7 @@
     private void handleConnectionDeath(Throwable reason) {
         myState = DEAD;         // Tell referencers to allow garbage collection
         myConnMgr.deathNotification(this);
-        for (int i=0; i<myMsgHandlers.length; i++) {
+        for (int i = 0; i < myMsgHandlers.length; i++) {
             MsgHandler h = myMsgHandlers[i];
             if (null != h) {
                 if (Trace.comm.event && Trace.ON) {
@@ -560,7 +566,7 @@
                 return true;        //Incoming is too far along.
             } else if (StartUpProtocol.ST_EXPECT_MESSAGE == inState) {
                 Trace.comm.errorm("Incoming running, why are we chosing?"
-                        + " IncomingState=" + inState);
+                                  + " IncomingState=" + inState);
                 myDataPath.stopStartUpProtocol();
                 myDataPath = myIncomingDataPath;
                 myIncomingDataPath = null;
@@ -594,19 +600,23 @@
             }
         }
         StringBuffer connectStatusReport = new StringBuffer(300);
-        for (int i=0; i<myProblemAccumulator.size(); i++) {
+        for (int i = 0; i < myProblemAccumulator.size(); i++) {
             Object problem = myProblemAccumulator.elementAt(i);
             if (problem instanceof String) {
                 connectStatusReport.append(problem).append('\n');
             } else {
-                Throwable evt = (Throwable) problem;
+                Throwable evt = (Throwable)problem;
                 String subMsg = evt.getMessage();
-                if (evt instanceof NoRouteToHostException) ;
-                else if (evt instanceof UnknownHostException) ;
+                if (evt instanceof NoRouteToHostException)
+                    ;
+                else if (evt instanceof UnknownHostException)
+                    ;
                 else if (evt instanceof ConnectException
-                    && (subMsg.startsWith("Connection refused"))) ;
+                  && (subMsg.startsWith("Connection refused")))
+                    ;
                 else if (evt instanceof SocketException
-                    && (subMsg.startsWith("Connection reset by peer"))) ;
+                  && (subMsg.startsWith("Connection reset by peer")))
+                    ;
                 else {
                     Trace.comm.errorm("Error during connection attempt", evt);
                 }
@@ -639,8 +649,8 @@
             if (null != handler) {
                 if (Trace.comm.event && Trace.ON) {
                     Trace.comm.eventm(this + " calls processMessage in "
-                            + handler + "\n"
-                            + HexStringUtils.byteArrayToReadableHexString(message));
+                                      + handler + "\n"
+                                      + HexStringUtils.byteArrayToReadableHexString(message));
                 }
                 handler.processMessage(message, this);
                 return;
@@ -649,7 +659,7 @@
             if (DIEING == myState || DEAD == myState) return;
         }
         Trace.comm.errorm("No handler for incoming message type\n"
-                    + HexStringUtils.byteArrayToReadableHexString(message));
+                          + HexStringUtils.byteArrayToReadableHexString(message));
     }
 
     /**
@@ -669,7 +679,7 @@
             case STARTING:
                 if (Trace.comm.debug && Trace.ON) {
                     Trace.comm.debugm("accumulating problem report: "
-                                + this + ": ", problem);
+                                      + this + ": ", problem);
                 }
                 recordConnectionFailure(problem);
                 break;
@@ -695,7 +705,7 @@
         if (null != suspendID) {
             if (null == myLocalSuspendID) return false;
             if (myLocalSuspendID.length != suspendID.length) return false;
-            for (int i=0; i<suspendID.length; i++) {
+            for (int i = 0; i < suspendID.length; i++) {
                 if (myLocalSuspendID[i] != suspendID[i]) return false;
             }
             return true;
@@ -747,24 +757,24 @@
      */
 
     public void registerMsgHandler(byte msgType, MsgHandler handler)
-    throws IOException {
+      throws IOException {
         if (!myRunner.isCurrentThreadInVat()) {
             Trace.comm.errorm("Caller doesn't hold vat lock", new Throwable());
         }
         if (Trace.comm.event && Trace.ON) {
-            Trace.comm.eventm("registerMsgHandler="+ msgType +"("
-                    + handler +") on " + this);
+            Trace.comm.eventm("registerMsgHandler=" + msgType + "("
+                              + handler + ") on " + this);
         }
         Assertion.test(msgType > 0 || msgType <= Msg.HIGH_MSG_TYPE,
-            "msgType=" + msgType + " out of range (1 .. " + Msg.HIGH_MSG_TYPE
-            + ")");
-        Assertion.test( STARTING == myState || RESUMING == myState,
-            "Called after the NewConnectionReactor returns\n  handler="
-                    + handler + "\n  myState=" + myState);
+                       "msgType=" + msgType + " out of range (1 .. " + Msg.HIGH_MSG_TYPE
+                       + ")");
+        Assertion.test(STARTING == myState || RESUMING == myState,
+                       "Called after the NewConnectionReactor returns\n  handler="
+                       + handler + "\n  myState=" + myState);
         if (null != myMsgHandlers[msgType]
-                    && myMsgHandlers[msgType] != handler) {
+          && myMsgHandlers[msgType] != handler) {
             throw new IOException(myMsgHandlers[msgType]
-                    + " already registered for msgType=" + msgType);
+                                  + " already registered for msgType=" + msgType);
         }
         myMsgHandlers[msgType] = handler;
     }
@@ -776,7 +786,7 @@
      * @param continuation The notification passed to sendMessage.
      */
     /*package*/ void sendFinished(int count, int length,
-                StreamMessage /*NullOK*/ msg) {
+                                  StreamMessage /*NullOK*/ msg) {
         bytesSent += length;
         messagesSent += count;
         if (maxSentMessageSize < length) maxSentMessageSize = length;
@@ -808,20 +818,21 @@
         }
         if (Trace.comm.event && Trace.ON) {
             Trace.comm.eventm("sendMsg on " + this + "\n"
-                    + HexStringUtils.byteArrayToReadableHexString(message));
+                              + HexStringUtils.byteArrayToReadableHexString(message));
         }
         if (message.length > Msg.MAX_OUTBOUND_MSG_LENGTH) {
             throw new IOException("Outbound message length=" + message.length
                                   + " greater than limit="
                                   + Msg.MAX_OUTBOUND_MSG_LENGTH);
         }
-        if (Trace.comm.debug && Trace.ON) Trace.comm.debugm("enqueueing to "
-                + myRemoteAddr
-                + "\n" + HexStringUtils.byteArrayToReadableHexString(message));
+        if (Trace.comm.debug && Trace.ON)
+            Trace.comm.debugm("enqueueing to "
+                              + myRemoteAddr
+                              + "\n" + HexStringUtils.byteArrayToReadableHexString(message));
         int msgType = message[0] & 0xff;
         if (msgType > Msg.HIGH_MSG_TYPE || null == myMsgHandlers[msgType]) {
             throw new IOException("No MsgHandler registered for message type="
-                        + msgType);
+                                  + msgType);
         }
         enqueue(message);
     }
@@ -860,21 +871,22 @@
         }
         if (Trace.comm.event && Trace.ON) {
             Trace.comm.eventm("sendMsg, Notify=" + notification + " Runner="
-                    + placeToRun + " on " + this + "\n"
-                    + HexStringUtils.byteArrayToReadableHexString(message));
+                              + placeToRun + " on " + this + "\n"
+                              + HexStringUtils.byteArrayToReadableHexString(message));
         }
         if (message.length > Msg.MAX_OUTBOUND_MSG_LENGTH) {
             throw new IOException("Outbound message length=" + message.length
                                   + " greater than limit="
                                   + Msg.MAX_OUTBOUND_MSG_LENGTH);
         }
-        if (Trace.comm.debug && Trace.ON) Trace.comm.debugm("enqueueing to "
-                + myRemoteAddr
-                + "\n" + HexStringUtils.byteArrayToReadableHexString(message));
+        if (Trace.comm.debug && Trace.ON)
+            Trace.comm.debugm("enqueueing to "
+                              + myRemoteAddr
+                              + "\n" + HexStringUtils.byteArrayToReadableHexString(message));
         int msgType = message[0] & 0xff;
         if (msgType > Msg.HIGH_MSG_TYPE || null == myMsgHandlers[msgType]) {
             throw new IOException("No MsgHandler registered for message type="
-                        + msgType);
+                                  + msgType);
         }
         enqueue(new StreamMessage(message, notification, placeToRun));
     }
@@ -914,7 +926,7 @@
         }
         Assertion.test(null != reason, "Must provide a reason for shutdown");
         if (RUNNING == myState) {
-            myDataPath.enqueue(new byte[] {Msg.SUSPEND});
+            myDataPath.enqueue(new byte[]{Msg.SUSPEND});
             myState = DIEING;
             myConnMgr.enterHospice(this, myRemoteVatID);
             myShutdownReason = reason;
@@ -939,24 +951,25 @@
             if (Trace.comm.usage && Trace.ON) {
                 Trace.comm.usagem("connection suspended " + this);
             }
-            if (null != myPendingOutput) {  // If we have pending output
+            if (null != myPendingOutput) {
+                // If we have pending output
                 startResume();      // try to resume
             }
         } else {
             Throwable rr = (reason instanceof ConnectionShutDownException
-                            && null != myShutdownReason)
-                    ? myShutdownReason
-                    : reason;
+              && null != myShutdownReason)
+              ? myShutdownReason
+              : reason;
             if (Trace.comm.usage && Trace.ON) {
                 if (Trace.comm.event) {
                     Trace.comm.eventm(
-                        "Connection died " + this
-                        + "\n" + myConnMgr.toString()
-                        + "\n" + rr);
+                      "Connection died " + this
+                      + "\n" + myConnMgr.toString()
+                      + "\n" + rr);
                 } else {
                     Trace.comm.usagem(
-                        "Connection died " + myRemoteAddr + "|"
-                        + myRemoteVatID + "\n" + rr);
+                      "Connection died " + myRemoteAddr + "|"
+                      + myRemoteVatID + "\n" + rr);
                 }
             }
             handleConnectionDeath(rr);
@@ -974,15 +987,15 @@
         myState = RESUMING;
         //Make a list of locations to try for the new connection
         String path = (myFirstAddressToTry.equals("")
-                    ? myFlattenedRemoteSearchPath
-                    : myFirstAddressToTry + ";" + myFlattenedRemoteSearchPath);
+          ? myFlattenedRemoteSearchPath
+          : myFirstAddressToTry + ";" + myFlattenedRemoteSearchPath);
         DynamicCollection searchCollection
-            = new DynamicCollection(EARL.parseSearchPath(path));
+          = new DynamicCollection(EARL.parseSearchPath(path));
         mySiteSearch = searchCollection.elems();
         myAddressesTried = new Hashtable(1);
 
         // Make a place to keep the search results
-        myProblemAccumulator  = new Vector(1,1);
+        myProblemAccumulator = new Vector(1, 1);
         // Start the search for the remote ID.
         tryNextAddress();
     }
@@ -1004,21 +1017,20 @@
      *          protocol versions and authorization parameters for the connection.
      */
     /*package*/ void startupSuccessful(
-                DataPath path,
-                String remoteVatID,
-                NetAddr remoteNetAddr,
-                NetAddr localNetAddr,
-                int remotePort,
-                AuthSecrets authParms)
-     {
+      DataPath path,
+      String remoteVatID,
+      NetAddr remoteNetAddr,
+      NetAddr localNetAddr,
+      int remotePort,
+      AuthSecrets authParms) {
         Assertion.test(myRemoteVatID.equals(remoteVatID),
-                      "DataPath's remote vatID=", remoteVatID,
-                      " not equal my remote vatID=", myRemoteVatID);
+                       "DataPath's remote vatID=", remoteVatID,
+                       " not equal my remote vatID=", myRemoteVatID);
         myProtocolParms = authParms;
         //it's safe to not check optInetAddress() for null, since
         //remoteNetAddr must explicitly have one
         myRemoteAddr = remoteNetAddr.optInetAddress().getHostAddress() + ":"
-                        + remoteNetAddr.getPort();
+          + remoteNetAddr.getPort();
         myRemoteNetAddr = remoteNetAddr;
         myLocalNetAddr = localNetAddr;
         if (null != myIncomingDataPath) {
@@ -1028,17 +1040,18 @@
                 myDataPath = myIncomingDataPath;
             } else {
                 Assertion.test(path == myDataPath, path.toString(), "\n",
-                                myDataPath.toString());
+                               myDataPath.toString());
                 myIncomingDataPath.stopStartUpProtocol();
             }
             myIncomingDataPath = null;
         }
-        if (remotePort > 0) {   // We know where to retry to resume later
+        if (remotePort > 0) {
+            // We know where to retry to resume later
             //it's safe to not check optInetAddress() for null, since
             //remoteNetAddr must explicitly have one
             myFirstAddressToTry
-                    = remoteNetAddr.optInetAddress().getHostAddress()
-                        + ":" + remotePort;
+              = remoteNetAddr.optInetAddress().getHostAddress()
+              + ":" + remotePort;
         }
         if (RESUMING == myState) {
             if (Trace.comm.debug && Trace.ON) {
@@ -1053,15 +1066,16 @@
             }
         }
         myConnMgr.startupSuccessful(this,
-                    myRemoteVatID, RESUMING == myState);
+                                    myRemoteVatID, RESUMING == myState);
         myState = RUNNING;
-        if (null != myShutdownReason) { // Someone has asked to shut down
+        if (null != myShutdownReason) {
+            // Someone has asked to shut down
             shutDownConnection(myShutdownReason);
             return;
         }
         myProblemAccumulator = null;
         if (null != myPendingOutput) {
-            for (int i=0; i<myPendingOutput.size(); i++) {
+            for (int i = 0; i < myPendingOutput.size(); i++) {
                 myDataPath.enqueue(myPendingOutput.elementAt(i));
             }
             myPendingOutput = null;
@@ -1085,8 +1099,8 @@
         }
         if (RUNNING != myState) {
             throw new IOException(
-                    "Attempt to suspend a non-running connection, state="
-                    + myState);
+              "Attempt to suspend a non-running connection, state="
+              + myState);
         }
         myLocalSuspendID = new byte[20];
 
@@ -1096,8 +1110,8 @@
         entropy.nextBytes(myLocalSuspendID);
         if (Trace.comm.debug && Trace.ON) {
             Trace.comm.debugm("Suspend Connection " + this
-                    + HexStringUtils.byteArrayToReadableHexString(
-                            myLocalSuspendID));
+                              + HexStringUtils.byteArrayToReadableHexString(
+                                myLocalSuspendID));
         }
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         DataOutputStream os = new DataOutputStream(baos);
@@ -1114,23 +1128,23 @@
      * Describe this connection object.
      *
      */
-     public String toString() {
+    public String toString() {
         return super.toString() + "\n  to " + myRemoteAddr + "|"
-                    + myRemoteVatID
-                    + "\n  searchpath=" + myFlattenedRemoteSearchPath
-                    + " state=" + myState;
-     }
+          + myRemoteVatID
+          + "\n  searchpath=" + myFlattenedRemoteSearchPath
+          + " state=" + myState;
+    }
 
     /**
      * Start an attempt to connect to the next (first) address in the list
      * of addresses to try.
      */
-    private void tryNextAddress () {
+    private void tryNextAddress() {
         if (null != mySiteSearch && mySiteSearch.hasMoreElements()) {
-            myRemoteAddr = (String) mySiteSearch.nextElement();
+            myRemoteAddr = (String)mySiteSearch.nextElement();
 
             //Build a DataPath to try the connection.
-            myDataPath = new DataPath(null,  // No VatTPMgr.
+            myDataPath = new DataPath(null, // No VatTPMgr.
                                       this,
                                       myRemoteVatID,
                                       myRemoteAddr,
@@ -1145,8 +1159,8 @@
             String report = makeConnectionStatusReport();
             if (Trace.comm.usage && Trace.ON) {
                 Trace.comm.usagem(toString()
-                        + "\nConnection attempt failed, search path exhausted\n"
-                        + report);
+                                  + "\nConnection attempt failed, search path exhausted\n"
+                                  + report);
             }
             handleConnectionDeath(new IOException(report));
         }
@@ -1168,23 +1182,23 @@
      * @see MsgHandler
      */
 
-    /*package*/ void unRegisterMsgHandler (byte msgType, MsgHandler handler)
-                        throws IOException {
+    /*package*/ void unRegisterMsgHandler(byte msgType, MsgHandler handler)
+      throws IOException {
         if (!myRunner.isCurrentThreadInVat()) {
             Trace.comm.errorm("Caller doesn't hold vat lock", new Throwable());
         }
         if (Trace.comm.event && Trace.ON) {
-            Trace.comm.eventm("unRegisterMsgHandler="+ msgType +"("
-                    + handler +") on " + this);
+            Trace.comm.eventm("unRegisterMsgHandler=" + msgType + "("
+                              + handler + ") on " + this);
         }
         if (msgType <= 0 || msgType > Msg.HIGH_MSG_TYPE) {
-            Trace.comm.errorm("msgType=" + msgType +" out of range (1 .. "
-                                  + Msg.HIGH_MSG_TYPE);
+            Trace.comm.errorm("msgType=" + msgType + " out of range (1 .. "
+                              + Msg.HIGH_MSG_TYPE);
             Trace.comm.notifyFatal();
         }
         if (handler != myMsgHandlers[msgType]) {
             throw new IOException("Registered=" + myMsgHandlers[msgType]
-                    + " is not the same as " + handler + " for msgType=" + msgType);
+                                  + " is not the same as " + handler + " for msgType=" + msgType);
         }
         myMsgHandlers[msgType] = null;
     }



1.25      +10 -10    e/src/jsrc/org/erights/build/EYaccFixer.java

Index: EYaccFixer.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/build/EYaccFixer.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- EYaccFixer.java	2001/09/06 09:55:43	1.24
+++ EYaccFixer.java	2001/11/10 19:40:38	1.25
@@ -34,21 +34,21 @@
 public class EYaccFixer {
 
     static /*package*/ final SimpleQuasiParser QParser =
-        SimpleQuasiParser.THE_ONE;
+      SimpleQuasiParser.THE_ONE;
 
     static private final MatchMaker ParseQPatt =
-    QParser.matchMaker(Twine.fromString(
+      QParser.matchMaker(Twine.fromString(
         "@{0}\n" +
         "final static short yytable[] = {@{1}};\n" +
         "final static short yycheck[] = {@{2}};\n" +
         "@{3}int yyparse()@{4}"
-    ));
+      ));
 
     static private final String rName
-        = "org/erights/e/elang/syntax/ParserTables.data";
+      = "org/erights/e/elang/syntax/ParserTables.data";
 
     static private final ValueMaker ParseQExpr =
-    QParser.valueMaker(Twine.fromString(
+      QParser.valueMaker(Twine.fromString(
         "// Fixed by EYaccFixer to meet jvm size limits\n" +
         "${0}\n\n" +
         "//These two tables are not statically initialized, but rather\n" +
@@ -62,7 +62,7 @@
         "        return;\n" +
         "    }\n" +
         "    try {\n" +
-        "        String rName = \""+ rName + "\";\n" +
+        "        String rName = \"" + rName + "\";\n" +
         "        InputStream inp = ClassLoader.getSystemResourceAsStream(rName);\n" +
         "        if (null == inp) {\n" +
         "            throw new RuntimeException(rName + \" not found\");\n" +
@@ -80,7 +80,7 @@
         "    }\n" +
         "}\n\n" +
         "${3}int yyparse() ${4}"
-    ));
+      ));
 
     /**
      * Used to make sure that the tables read in to the transformed parser
@@ -105,7 +105,7 @@
         FlexList result = FlexList.fromType(Short.TYPE, 1000);
         int len = numbers.length();
         int i = 0;
-        while (i < len && ! Character.isDigit(numbers.charAt(i))) {
+        while (i < len && !Character.isDigit(numbers.charAt(i))) {
             i++;
         }
         while (i < len) {
@@ -118,7 +118,7 @@
                 throw new ArithmeticException("Must be a positive short");
             }
             result.push(new Short((short)num));
-            while (i < len && ! Character.isDigit(numbers.charAt(i))) {
+            while (i < len && !Character.isDigit(numbers.charAt(i))) {
                 i++;
             }
         }
@@ -135,7 +135,7 @@
         }
 
         File parseFile = new File(args[0], "EParser.java");
-        File dataFile  = new File(args[1], rName);
+        File dataFile = new File(args[1], rName);
         File dataDir = new File(dataFile.getParent());
         dataDir.mkdirs();
 



1.10      +196 -196  e/src/jsrc/org/erights/e/develop/assertion/Assertion.java

Index: Assertion.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/assertion/Assertion.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Assertion.java	2001/09/06 09:55:43	1.9
+++ Assertion.java	2001/11/10 19:40:38	1.10
@@ -59,201 +59,201 @@
  * assertions.
  * @see AssertionFailed
  */
-public class Assertion
-{
-  static private final String prefix = "Internal program error: ";
-
-  /*
-   * This variable is used to discourage a java compiler from inlining
-   * an assertion.  An inlined assertion would prevent the unasserter
-   * from working.
-   * I can't offhand think of a way to *prevent* inlining.
-   */
-  static private boolean preventInlining = false;
-
-  /**
-   * If this method is executed, it throws an AssertionFailed with the
-   * message "Internal program error:  'Unreachable' code was reached."  Plant
-   * such assertions in places the program should never reach (such as
-   * the default case in a switch).
-   */
-  static public void fail() throws AssertionFailed {
-    if (preventInlining) fail();
-    throw new AssertionFailed(prefix + "'Unreachable' code was reached.");
-  }
-
-  /**
-   * If this method is executed, it throws an AssertionFailed with the
-   * given explanation, prefixed by "Internal program error: ".
-   */
-  static public void fail(String explanation) throws AssertionFailed {
-    if (preventInlining) fail(explanation);
-    throw new AssertionFailed(prefix + explanation);
-  }
-
-  /**
-   * If the argument is false, throws an AssertionFailed with the message
-   * "Internal program error: Assertion failed."
-   */
-  static public void test(boolean mustBeTrue) throws AssertionFailed {
-    if (mustBeTrue == false) {
-      throw new AssertionFailed(prefix + "Assertion failed.");
-    }
-    if (preventInlining) test(!mustBeTrue);
-  }
-
-  /**
-   * If the argument is false, throws an AssertionFailed with the
-   * given explanation arguments, concatenated as strings and prefixed
-   * by "Internal program error: ".
-   * <p> Use this routine when you need to avoid paying the overhead of
-   * string concatenation ("+") on every test.  It does the concatenation
-   * only if the test fails.
-   */
-  static public void test(boolean mustBeTrue, Object explanation0,
-                          Object explanation1)
-       throws AssertionFailed {
-    if (mustBeTrue == false) {
-      throw new AssertionFailed(prefix + explanation0 + explanation1);
-    }
-    if (preventInlining) test(!mustBeTrue);
-  }
-
-  /**
-   * If the argument is false, throws an AssertionFailed with the
-   * given explanation arguments, concatenated as strings and prefixed
-   * by "Internal program error: ".
-   * <p> Use this routine when you need to avoid paying the overhead of
-   * string concatenation ("+") on every test.  It does the concatenation
-   * only if the test fails.
-   */
-  static public void test(boolean mustBeTrue, Object explanation0,
-                          Object explanation1, Object explanation2)
-       throws AssertionFailed {
-    if (mustBeTrue == false) {
-      throw new AssertionFailed(prefix + explanation0 +
-                                explanation1 + explanation2);
-    }
-    if (preventInlining) test(!mustBeTrue);
-  }
-
-  /**
-   * If the argument is false, throws an AssertionFailed with the
-   * given explanation arguments, concatenated as strings and prefixed
-   * by "Internal program error: ".
-   * <p> Use this routine when you need to avoid paying the overhead of
-   * string concatenation ("+") on every test.  It does the concatenation
-   * only if the test fails.
-   */
-  static public void test(boolean mustBeTrue, Object explanation0,
-                          Object explanation1, Object explanation2,
-                          Object explanation3)
-       throws AssertionFailed {
-    if (mustBeTrue == false) {
-      throw new AssertionFailed(prefix + explanation0 +
-                                explanation1 + explanation2 +
-                                explanation3);
-    }
-    if (preventInlining) test(!mustBeTrue);
-  }
-
-  /**
-   * If the argument is false, throws an AssertionFailed with the
-   * given explanation arguments, concatenated as strings and prefixed
-   * by "Internal program error: ".
-   * <p> Use this routine when you need to avoid paying the overhead of
-   * string concatenation ("+") on every test.  It does the concatenation
-   * only if the test fails.
-   */
-  static public void test(boolean mustBeTrue, Object explanation0,
-                          Object explanation1, Object explanation2,
-                          Object explanation3, Object explanation4)
-       throws AssertionFailed {
-    if (mustBeTrue == false) {
-      throw new AssertionFailed(prefix + explanation0 +
-                                explanation1 + explanation2 +
-                                explanation3 + explanation4);
-    }
-    if (preventInlining) test(!mustBeTrue);
-  }
-
-  /**
-   * If the argument is false, throws an AssertionFailed with the
-   * given explanation arguments, concatenated as strings and prefixed
-   * by "Internal program error: ".
-   * <p> Use this routine when you need to avoid paying the overhead of
-   * string concatenation ("+") on every test.  It does the concatenation
-   * only if the test fails.
-   */
-  static public void test(boolean mustBeTrue, Object explanation0,
-                          Object explanation1, Object explanation2,
-                          Object explanation3, Object explanation4,
-                          Object explanation5)
-       throws AssertionFailed {
-    if (mustBeTrue == false) {
-      throw new AssertionFailed(prefix + explanation0 +
-                                explanation1 + explanation2 +
-                                explanation3 + explanation4 +
-                                explanation5);
-    }
-    if (preventInlining) test(!mustBeTrue);
-  }
-
-  /**
-   * If the argument is false, throws an AssertionFailed with the
-   * given explanation arguments, concatenated as strings and prefixed
-   * by "Internal program error: ".
-   * <p> Use this routine when you need to avoid paying the overhead of
-   * string concatenation ("+") on every test.  It does the concatenation
-   * only if the test fails.
-   */
-  static public void test(boolean mustBeTrue, Object explanation0,
-                          Object explanation1, Object explanation2,
-                          Object explanation3, Object explanation4,
-                          Object explanation5, Object explanation6)
-       throws AssertionFailed {
-    if (mustBeTrue == false) {
-      throw new AssertionFailed(prefix + explanation0 +
-                                explanation1 + explanation2 +
-                                explanation3 + explanation4 +
-                                explanation5 + explanation6);
-    }
-    if (preventInlining) test(!mustBeTrue);
-  }
-
-  /**
-   * If the argument is false, throws an AssertionFailed with the
-   * given explanation arguments, concatenated as strings and prefixed
-   * by "Internal program error: ".
-   * <p> Use this routine when you need to avoid paying the overhead of
-   * string concatenation ("+") on every test.  It does the concatenation
-   * only if the test fails.
-   */
-  static public void test(boolean mustBeTrue, Object explanation0,
-                          Object explanation1, Object explanation2,
-                          Object explanation3, Object explanation4,
-                          Object explanation5, Object explanation6,
-                          Object explanation7)
-       throws AssertionFailed {
-    if (mustBeTrue == false) {
-      throw new AssertionFailed(prefix + explanation0 +
-                                explanation1 + explanation2 +
-                                explanation3 + explanation4 +
-                                explanation5 + explanation6 +
-                                explanation7);
-    }
-    if (preventInlining) test(!mustBeTrue);
-  }
-
-  /**
-   * If the argument is false, throws an AssertionFailed with the
-   * given explanation, prefixed by "Internal program error: ".
-   */
-  static public void test(boolean mustBeTrue, String explanation)
-       throws AssertionFailed {
-    if (mustBeTrue == false) {
-      throw new AssertionFailed(prefix + explanation);
+public class Assertion {
+
+    static private final String prefix = "Internal program error: ";
+
+    /*
+     * This variable is used to discourage a java compiler from inlining
+     * an assertion.  An inlined assertion would prevent the unasserter
+     * from working.
+     * I can't offhand think of a way to *prevent* inlining.
+     */
+    static private boolean preventInlining = false;
+
+    /**
+     * If this method is executed, it throws an AssertionFailed with the
+     * message "Internal program error:  'Unreachable' code was reached."  Plant
+     * such assertions in places the program should never reach (such as
+     * the default case in a switch).
+     */
+    static public void fail() throws AssertionFailed {
+        if (preventInlining) fail();
+        throw new AssertionFailed(prefix + "'Unreachable' code was reached.");
+    }
+
+    /**
+     * If this method is executed, it throws an AssertionFailed with the
+     * given explanation, prefixed by "Internal program error: ".
+     */
+    static public void fail(String explanation) throws AssertionFailed {
+        if (preventInlining) fail(explanation);
+        throw new AssertionFailed(prefix + explanation);
+    }
+
+    /**
+     * If the argument is false, throws an AssertionFailed with the message
+     * "Internal program error: Assertion failed."
+     */
+    static public void test(boolean mustBeTrue) throws AssertionFailed {
+        if (mustBeTrue == false) {
+            throw new AssertionFailed(prefix + "Assertion failed.");
+        }
+        if (preventInlining) test(!mustBeTrue);
+    }
+
+    /**
+     * If the argument is false, throws an AssertionFailed with the
+     * given explanation arguments, concatenated as strings and prefixed
+     * by "Internal program error: ".
+     * <p> Use this routine when you need to avoid paying the overhead of
+     * string concatenation ("+") on every test.  It does the concatenation
+     * only if the test fails.
+     */
+    static public void test(boolean mustBeTrue, Object explanation0,
+                            Object explanation1)
+      throws AssertionFailed {
+        if (mustBeTrue == false) {
+            throw new AssertionFailed(prefix + explanation0 + explanation1);
+        }
+        if (preventInlining) test(!mustBeTrue);
+    }
+
+    /**
+     * If the argument is false, throws an AssertionFailed with the
+     * given explanation arguments, concatenated as strings and prefixed
+     * by "Internal program error: ".
+     * <p> Use this routine when you need to avoid paying the overhead of
+     * string concatenation ("+") on every test.  It does the concatenation
+     * only if the test fails.
+     */
+    static public void test(boolean mustBeTrue, Object explanation0,
+                            Object explanation1, Object explanation2)
+      throws AssertionFailed {
+        if (mustBeTrue == false) {
+            throw new AssertionFailed(prefix + explanation0 +
+                                      explanation1 + explanation2);
+        }
+        if (preventInlining) test(!mustBeTrue);
+    }
+
+    /**
+     * If the argument is false, throws an AssertionFailed with the
+     * given explanation arguments, concatenated as strings and prefixed
+     * by "Internal program error: ".
+     * <p> Use this routine when you need to avoid paying the overhead of
+     * string concatenation ("+") on every test.  It does the concatenation
+     * only if the test fails.
+     */
+    static public void test(boolean mustBeTrue, Object explanation0,
+                            Object explanation1, Object explanation2,
+                            Object explanation3)
+      throws AssertionFailed {
+        if (mustBeTrue == false) {
+            throw new AssertionFailed(prefix + explanation0 +
+                                      explanation1 + explanation2 +
+                                      explanation3);
+        }
+        if (preventInlining) test(!mustBeTrue);
+    }
+
+    /**
+     * If the argument is false, throws an AssertionFailed with the
+     * given explanation arguments, concatenated as strings and prefixed
+     * by "Internal program error: ".
+     * <p> Use this routine when you need to avoid paying the overhead of
+     * string concatenation ("+") on every test.  It does the concatenation
+     * only if the test fails.
+     */
+    static public void test(boolean mustBeTrue, Object explanation0,
+                            Object explanation1, Object explanation2,
+                            Object explanation3, Object explanation4)
+      throws AssertionFailed {
+        if (mustBeTrue == false) {
+            throw new AssertionFailed(prefix + explanation0 +
+                                      explanation1 + explanation2 +
+                                      explanation3 + explanation4);
+        }
+        if (preventInlining) test(!mustBeTrue);
+    }
+
+    /**
+     * If the argument is false, throws an AssertionFailed with the
+     * given explanation arguments, concatenated as strings and prefixed
+     * by "Internal program error: ".
+     * <p> Use this routine when you need to avoid paying the overhead of
+     * string concatenation ("+") on every test.  It does the concatenation
+     * only if the test fails.
+     */
+    static public void test(boolean mustBeTrue, Object explanation0,
+                            Object explanation1, Object explanation2,
+                            Object explanation3, Object explanation4,
+                            Object explanation5)
+      throws AssertionFailed {
+        if (mustBeTrue == false) {
+            throw new AssertionFailed(prefix + explanation0 +
+                                      explanation1 + explanation2 +
+                                      explanation3 + explanation4 +
+                                      explanation5);
+        }
+        if (preventInlining) test(!mustBeTrue);
+    }
+
+    /**
+     * If the argument is false, throws an AssertionFailed with the
+     * given explanation arguments, concatenated as strings and prefixed
+     * by "Internal program error: ".
+     * <p> Use this routine when you need to avoid paying the overhead of
+     * string concatenation ("+") on every test.  It does the concatenation
+     * only if the test fails.
+     */
+    static public void test(boolean mustBeTrue, Object explanation0,
+                            Object explanation1, Object explanation2,
+                            Object explanation3, Object explanation4,
+                            Object explanation5, Object explanation6)
+      throws AssertionFailed {
+        if (mustBeTrue == false) {
+            throw new AssertionFailed(prefix + explanation0 +
+                                      explanation1 + explanation2 +
+                                      explanation3 + explanation4 +
+                                      explanation5 + explanation6);
+        }
+        if (preventInlining) test(!mustBeTrue);
+    }
+
+    /**
+     * If the argument is false, throws an AssertionFailed with the
+     * given explanation arguments, concatenated as strings and prefixed
+     * by "Internal program error: ".
+     * <p> Use this routine when you need to avoid paying the overhead of
+     * string concatenation ("+") on every test.  It does the concatenation
+     * only if the test fails.
+     */
+    static public void test(boolean mustBeTrue, Object explanation0,
+                            Object explanation1, Object explanation2,
+                            Object explanation3, Object explanation4,
+                            Object explanation5, Object explanation6,
+                            Object explanation7)
+      throws AssertionFailed {
+        if (mustBeTrue == false) {
+            throw new AssertionFailed(prefix + explanation0 +
+                                      explanation1 + explanation2 +
+                                      explanation3 + explanation4 +
+                                      explanation5 + explanation6 +
+                                      explanation7);
+        }
+        if (preventInlining) test(!mustBeTrue);
+    }
+
+    /**
+     * If the argument is false, throws an AssertionFailed with the
+     * given explanation, prefixed by "Internal program error: ".
+     */
+    static public void test(boolean mustBeTrue, String explanation)
+      throws AssertionFailed {
+        if (mustBeTrue == false) {
+            throw new AssertionFailed(prefix + explanation);
+        }
+        if (preventInlining) test(!mustBeTrue, explanation);
     }
-    if (preventInlining) test(!mustBeTrue, explanation);
-  }
 }



1.5       +8 -6      e/src/jsrc/org/erights/e/develop/assertion/AssertionFailed.java

Index: AssertionFailed.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/assertion/AssertionFailed.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AssertionFailed.java	2001/09/06 09:55:43	1.4
+++ AssertionFailed.java	2001/11/10 19:40:38	1.5
@@ -28,10 +28,12 @@
  * @see Assertion
  */
 public class AssertionFailed extends Error {
-  public AssertionFailed() {
-    super();
-  }
-  public AssertionFailed (String msg) {
-    super(msg);
-  }
+
+    public AssertionFailed() {
+        super();
+    }
+
+    public AssertionFailed(String msg) {
+        super(msg);
+    }
 }



1.8       +2 -1      e/src/jsrc/org/erights/e/develop/exception/ExceptionMgr.java

Index: ExceptionMgr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/exception/ExceptionMgr.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ExceptionMgr.java	2001/11/04 03:12:28	1.7
+++ ExceptionMgr.java	2001/11/10 19:40:38	1.8
@@ -18,6 +18,7 @@
 
 Contributor(s): ______________________________________.
 */
+
 import java.io.PrintWriter;
 
 /**
@@ -88,7 +89,7 @@
     static public void setExceptionNoticer(ExceptionNoticer noticer) {
         if (OurNoticer != null) {
             throw new SecurityException(
-                "cannot reset ExceptionMgr exception noticer");
+              "cannot reset ExceptionMgr exception noticer");
         }
         OurNoticer = noticer;
     }



1.7       +2 -2      e/src/jsrc/org/erights/e/develop/exception/ExceptionNoticer.java

Index: ExceptionNoticer.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/exception/ExceptionNoticer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ExceptionNoticer.java	2001/09/06 09:55:43	1.6
+++ ExceptionNoticer.java	2001/11/10 19:40:38	1.7
@@ -24,8 +24,8 @@
  *
  * @see org.erights.e.develop.exception.ExceptionMgr
  */
-public interface ExceptionNoticer
-{
+public interface ExceptionNoticer {
+
     /**
      * Notification of a reported exception.
      *



1.6       +2 -2      e/src/jsrc/org/erights/e/develop/exception/NestedError.java

Index: NestedError.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/exception/NestedError.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- NestedError.java	2001/09/06 09:55:43	1.5
+++ NestedError.java	2001/11/10 19:40:38	1.6
@@ -22,8 +22,8 @@
 /**
  * Nested version of the Java Error class
  */
-public class NestedError extends Error implements NestedThrowable
-{
+public class NestedError extends Error implements NestedThrowable {
+
     private Throwable myContainedThrowable;
 
     /**



1.7       +1 -1      e/src/jsrc/org/erights/e/develop/exception/NestedException.java

Index: NestedException.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/exception/NestedException.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- NestedException.java	2001/09/06 09:55:43	1.6
+++ NestedException.java	2001/11/10 19:40:38	1.7
@@ -23,7 +23,7 @@
  * Nested version of the Java RuntimeException class.
  */
 public class NestedException
-extends RuntimeException implements NestedThrowable {
+  extends RuntimeException implements NestedThrowable {
 
     private Throwable myContainedThrowable;
 



1.6       +2 -0      e/src/jsrc/org/erights/e/develop/exception/NestedIOException.java

Index: NestedIOException.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/exception/NestedIOException.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- NestedIOException.java	2001/09/06 09:55:43	1.5
+++ NestedIOException.java	2001/11/10 19:40:38	1.6
@@ -18,12 +18,14 @@
 
 Contributor(s): ______________________________________.
 */
+
 import java.io.IOException;
 
 /**
  * Nested version of the Java IOException class.
  */
 public class NestedIOException extends IOException implements NestedThrowable {
+
     private Throwable myContainedThrowable;
 
     /**



1.7       +4 -1      e/src/jsrc/org/erights/e/develop/exception/PrintStreamWriter.java

Index: PrintStreamWriter.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/exception/PrintStreamWriter.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PrintStreamWriter.java	2001/09/06 09:55:43	1.6
+++ PrintStreamWriter.java	2001/11/10 19:40:38	1.7
@@ -44,12 +44,15 @@
 public final class PrintStreamWriter extends Writer {
 
     static private PrintStream lastOutStream = null;
+
     static private PrintWriter lastOutWriter = null;
 
     static private PrintStream lastErrStream = null;
+
     static private PrintWriter lastErrWriter = null;
 
     static private InputStream lastInStream = null;
+
     static private BufferedReader lastInReader = null;
 
     /**
@@ -90,7 +93,7 @@
         if (System.in != lastInStream) {
             lastInStream = System.in;
             lastInReader
-                = new BufferedReader(new InputStreamReader(lastInStream), 1);
+              = new BufferedReader(new InputStreamReader(lastInStream), 1);
         }
         return lastInReader;
     }



1.11      +7 -6      e/src/jsrc/org/erights/e/develop/exception/ThrowableSugar.java

Index: ThrowableSugar.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/exception/ThrowableSugar.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ThrowableSugar.java	2001/09/06 09:55:43	1.10
+++ ThrowableSugar.java	2001/11/10 19:40:38	1.11
@@ -40,10 +40,11 @@
 
     /** Same number of spaces as in the ProblemPrefix */
     static public final String ProblemIndent =
-        StringHelper.multiply(" ", ProblemPrefix.length());
+      StringHelper.multiply(" ", ProblemPrefix.length());
 
     /** prevents instantiation */
-    private ThrowableSugar() {}
+    private ThrowableSugar() {
+    }
 
     /**
      * In general, a Throwable prints as 'problem: <type: msg>'.
@@ -62,7 +63,7 @@
      * rename it and make a special case in the MirandaMethods.printOn().
      */
     static public void printThrowableOn(Throwable self, Writer out)
-    throws IOException {
+      throws IOException {
         PrintWriter pw = new PrintWriter(out);
         pw.print(ProblemPrefix);
 
@@ -78,7 +79,7 @@
             pw.print(optMsg);
         } else {
             String name = type.getName();
-            pw.print("<" + name.substring(name.lastIndexOf('.') +1));
+            pw.print("<" + name.substring(name.lastIndexOf('.') + 1));
             if (null != optMsg) {
                 pw.print(": " + optMsg);
             }
@@ -99,7 +100,7 @@
             return ((InvocationTargetException)self).getTargetException();
         } else if (self instanceof UndeclaredThrowableException) {
             return ((UndeclaredThrowableException)self).
-                       getUndeclaredThrowable();
+              getUndeclaredThrowable();
         } else {
             return null;
         }
@@ -159,7 +160,7 @@
      *
      */
     static private final String LINE_SEP
-        = System.getProperty("line.separator");
+      = System.getProperty("line.separator");
 
     /**
      * Returns the java backtrace stack of the leaf throwable with all



1.4       +5 -5      e/src/jsrc/org/erights/e/develop/format/ETimeFormat.java

Index: ETimeFormat.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/format/ETimeFormat.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ETimeFormat.java	2001/09/06 09:55:43	1.3
+++ ETimeFormat.java	2001/11/10 19:40:39	1.4
@@ -40,7 +40,7 @@
 public class ETimeFormat {
 
     static private final DateFormat SortableFormat =
-        new SimpleDateFormat("yyyy-MM-dd!HH:mm:ss.SSS%");
+      new SimpleDateFormat("yyyy-MM-dd!HH:mm:ss.SSS%");
 
     static {
         TimeZone utc = TimeZone.getTimeZone("UTC");
@@ -68,7 +68,7 @@
      */
     static public String formatTime(long millis) {
         String formatted = SortableFormat.format(new Date(millis));
-        return formatted.replace('!','T').replace('%','Z');
+        return formatted.replace('!', 'T').replace('%', 'Z');
     }
 
     /**
@@ -76,9 +76,9 @@
      * return the corresponding number of seconds since the epoch.
      */
     static public long parseTime(String sortableTime) throws ParseException {
-        sortableTime = sortableTime.replace('T','!')
-                                   .replace('Z','%')
-                                   .replace('_',':');
+        sortableTime = sortableTime.replace('T', '!')
+          .replace('Z', '%')
+          .replace('_', ':');
         return SortableFormat.parse(sortableTime).getTime();
     }
 }



1.3       +55 -23    e/src/jsrc/org/erights/e/develop/format/StringHelper.java

Index: StringHelper.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/format/StringHelper.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StringHelper.java	2001/09/06 09:55:43	1.2
+++ StringHelper.java	2001/11/10 19:40:39	1.3
@@ -30,7 +30,8 @@
 public final class StringHelper {
 
     /** prevent instantiation */
-    private StringHelper() {}
+    private StringHelper() {
+    }
 
     /**
      * reps repitions of self
@@ -50,15 +51,13 @@
      */
     static public String replaceAll(String self,
                                     String oldStr,
-                                    String newStr)
-    {
+                                    String newStr) {
         StringBuffer buf = new StringBuffer(self.length() * 2);
         int oldLen = oldStr.length();
         int p1 = 0;
         for (int p2 = self.indexOf(oldStr);
              p2 != -1;
-             p2 = self.indexOf(oldStr,p1))
-        {
+             p2 = self.indexOf(oldStr, p1)) {
             buf.append(self.substring(p1, p2));
             buf.append(newStr);
             p1 = p2 + oldLen;
@@ -89,25 +88,58 @@
         buf.append('\"');
         for (int i = 0; i < len; i++) {
             char c = self.charAt(i);
-            switch(c) {
-                case '\b': { buf.append("\\b");        break; }
-                case '\t': { buf.append("\\t");        break; }
-                case '\n': { buf.append("\\n\\\n");    break; }
-                case '\f': { buf.append("\\f");        break; }
-                case '\r': { buf.append("\\r");        break; }
-                case '\"': { buf.append("\\\"");       break; }
-                case '\'': { buf.append("\\\'");       break; }
-                case '\\': { buf.append("\\\\");       break; }
-                default: {
-                    if (c < 32 && c > 255) {
-                        String num = "0000" + Integer.toHexString(c);
-                        int numlen = num.length();
-                        num = num.substring(numlen - 4, numlen);
-                        buf.append("\\u").append(num);
-                    } else {
-                        buf.append(c);
+            switch (c) {
+                case '\b':
+                    {
+                        buf.append("\\b");
+                        break;
+                    }
+                case '\t':
+                    {
+                        buf.append("\\t");
+                        break;
+                    }
+                case '\n':
+                    {
+                        buf.append("\\n\\\n");
+                        break;
+                    }
+                case '\f':
+                    {
+                        buf.append("\\f");
+                        break;
+                    }
+                case '\r':
+                    {
+                        buf.append("\\r");
+                        break;
+                    }
+                case '\"':
+                    {
+                        buf.append("\\\"");
+                        break;
+                    }
+                case '\'':
+                    {
+                        buf.append("\\\'");
+                        break;
+                    }
+                case '\\':
+                    {
+                        buf.append("\\\\");
+                        break;
+                    }
+                default:
+                    {
+                        if (c < 32 && c > 255) {
+                            String num = "0000" + Integer.toHexString(c);
+                            int numlen = num.length();
+                            num = num.substring(numlen - 4, numlen);
+                            buf.append("\\u").append(num);
+                        } else {
+                            buf.append(c);
+                        }
                     }
-                }
             }
         }
         buf.append('\"');



1.16      +59 -33    e/src/jsrc/org/erights/e/develop/trace/Trace.java

Index: Trace.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/Trace.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Trace.java	2001/10/02 23:38:31	1.15
+++ Trace.java	2001/11/10 19:40:39	1.16
@@ -41,6 +41,7 @@
  */
 
 final public class Trace implements TraceConstants {
+
     /**
      * Set this to false to compile out all tracing. This also has
      * to be set in TraceDummies.java
@@ -115,19 +116,30 @@
      */
     /** comm systems */
     static public final Trace comm = new Trace("comm");
+
     static public final Trace captp = new Trace("captp");
+
     static public final Trace wire = new Trace("wire");
+
     static public final Trace tunnel = new Trace("tunnel");
+
     /** Distributed garbage collector. */
     static public final Trace dgc = new Trace("dgc");
+
     static public final Trace pumpkin = new Trace("pumpkin");
+
     /** The E runtime */
     static public final Trace eruntime = new Trace("eruntime");
+
     static public final Trace causality = new Trace("causality");
+
     /** Classes involved in starting up the world. */
     static public final Trace startup = new Trace("startup");
+
     static public final Trace entropy = new Trace("entropy");
+
     static public final Trace timers = new Trace("timers");
+
     static public final Trace trace = new Trace("trace");
     //misc
     static public final Trace console = new Trace("console");
@@ -155,7 +167,7 @@
 // DEPRECATED FUNCTIONS
 
     public void $(String message) {
-      recordTraceMessageXyzzY(message, DEBUG, null, false);
+        recordTraceMessageXyzzY(message, DEBUG, null, false);
     }
 // Constructors
 
@@ -179,24 +191,26 @@
      * @param post string to append to an element.
      */
     static public String arrayToString(Object a[], String name, String
-                               pre, String sep, String post) {
+      pre, String sep, String post) {
         int i = 0;
         String s = name + "[";
         while (i < a.length) {
             if (a[i] == null) {
-                s += "null" ;
+                s += "null";
             } else {
                 s += pre + a[i].toString() + post;
             }
             if (i++ < a.length - 1)
                 s += sep;
         }
-        s += "]" ;
+        s += "]";
         return s;
     }
+
     public void debugm(String message) {
         if (debug) recordTraceMessageXyzzY(message, DEBUG, null, false);
     }
+
     public void debugm(String message, Object o) {
         if (debug) recordTraceMessageXyzzY(message, DEBUG, o, false);
     }
@@ -209,6 +223,7 @@
     public void debugReportException(Throwable t, String msg) {
         if (debug) recordTraceMessageXyzzY(msg, DEBUG, t, false);
     }
+
     public void errorm(String message) {
         if (error) recordTraceMessageXyzzY(message, ERROR, null, false);
     }
@@ -220,6 +235,7 @@
     public void errorm(String message, int bugNumber) {
         if (error) recordTraceMessageXyzzY(message, ERROR, null, true);
     }
+
     public void errorm(String message, Object o) {
         if (error) recordTraceMessageXyzzY(message, ERROR, o, false);
     }
@@ -255,9 +271,11 @@
     public void errorReportException(Throwable t, String msg, int bugNumber) {
         if (error) recordTraceMessageXyzzY(msg, ERROR, t, true);
     }
+
     public void eventm(String message) {
         if (event) recordTraceMessageXyzzY(message, EVENT, null, false);
     }
+
     public void eventm(String message, Object o) {
         if (event) recordTraceMessageXyzzY(message, EVENT, o, false);
     }
@@ -283,7 +301,7 @@
         System.exit(1);
     }
     // deprecated
-    public void fileMode (boolean b) {
+    public void fileMode(boolean b) {
         // warningm("Deprecated function fileMode called.  It is now a no-op.");
     }
 
@@ -291,7 +309,7 @@
      * Return the current stack trace as a string.
      * @ Deprecated in favor of StackFrameData.getStackTrace().
      */
-    static public String getStackTrace () {
+    static public String getStackTrace() {
         // Retain this code so we don't have to futz around
         // with removing this frame's entry from the string
         // getStackTrace returns.
@@ -307,15 +325,15 @@
         }
     }
     // deprecated
-    public void lineMode (boolean b) {
+    public void lineMode(boolean b) {
         // warningm("Deprecated function lineMode called.  It is now a no-op.");
     }
     // deprecated
-    public void methodMode (boolean b) {
+    public void methodMode(boolean b) {
         // warningm("Deprecated function methodMode called.  It is now a no-op.");
     }
     // deprecated
-    public void nl () {
+    public void nl() {
         $("");
     }
     // Not all errors are ones that should be thrust into a user's face.
@@ -348,7 +366,7 @@
      * number a trace call was made from searches for this method. So
      * it should have a name unlikely to be accidentally duplicated. */
     private void recordTraceMessageXyzzY(String message,
-                                    int level, Object o, boolean noNotify) {
+                                         int level, Object o, boolean noNotify) {
         TraceMessage traceMessage = new TraceMessage();
         traceMessage.message = message;
         traceMessage.object = o;
@@ -373,26 +391,26 @@
     }
 
     /**
-      * To ensure that exceptional conditions are only being ignored
-      * for good reason, we adopt the discipline that a caught
-      * exception should <p>
-      *
-      * 1) be rethrown <p>
-      * 2) cause another exception to be thrown instead <p>
-      * 3) be ignored, in a traceable way, for some stated reason <p>
-      *
-      * Only by making #3 explicit can we distinguish it from
-      * accidentally ignoring the exception.  An exception should,
-      * therefore, only be ignored by asking a Trace object to
-      * shred it.  This request carries a string that justifies
-      * allowing the program to continue normally following this
-      * event.  As shredded exceptions will likely be symptoms of
-      * bugs, one will be able to have them traced.
-      * <p>
-      * The reason for the shredding is logged at verbose level.
-      * <p>
-      * This now appears to be deprecated.
-      */
+     * To ensure that exceptional conditions are only being ignored
+     * for good reason, we adopt the discipline that a caught
+     * exception should <p>
+     *
+     * 1) be rethrown <p>
+     * 2) cause another exception to be thrown instead <p>
+     * 3) be ignored, in a traceable way, for some stated reason <p>
+     *
+     * Only by making #3 explicit can we distinguish it from
+     * accidentally ignoring the exception.  An exception should,
+     * therefore, only be ignored by asking a Trace object to
+     * shred it.  This request carries a string that justifies
+     * allowing the program to continue normally following this
+     * event.  As shredded exceptions will likely be symptoms of
+     * bugs, one will be able to have them traced.
+     * <p>
+     * The reason for the shredding is logged at verbose level.
+     * <p>
+     * This now appears to be deprecated.
+     */
     public void shred(Throwable ex, String reason) {
         verboseReportException(ex, reason);
     }
@@ -421,22 +439,24 @@
     public void timingm(String message, Object o) {
         if (timing) recordTraceMessageXyzzY(message, TIMING, o, false);
     }
+
     /**
      * Invoking this method causes this class to be loaded, which
      * causes all the static trace objects to be defined.  In
      * particular, Trace.trace becomes defined.  That's convenient, in that
      * it allows more tracing of the tracing startup itself.
      */
-    static /*package*/ void touch()
-    {
+    static /*package*/ void touch() {
     }
     // deprecated
-    public void traceMode (boolean b) {
+    public void traceMode(boolean b) {
         // warningm("Deprecated function traceMode called.  It is now a no-op.");
     }
+
     public void usagem(String message) {
         if (usage) recordTraceMessageXyzzY(message, USAGE, null, false);
     }
+
     public void usagem(String message, Object o) {
         if (usage) recordTraceMessageXyzzY(message, USAGE, o, false);
     }
@@ -449,9 +469,11 @@
     public void usageReportException(Throwable t, String msg) {
         if (usage) recordTraceMessageXyzzY(msg, USAGE, t, false);
     }
+
     public void verbosem(String message) {
         if (verbose) recordTraceMessageXyzzY(message, VERBOSE, null, false);
     }
+
     public void verbosem(String message, Object o) {
         if (verbose) recordTraceMessageXyzzY(message, VERBOSE, o, false);
     }
@@ -464,9 +486,11 @@
     public void verboseReportException(Throwable t, String msg) {
         if (verbose) recordTraceMessageXyzzY(msg, VERBOSE, t, false);
     }
+
     public void warningm(String message) {
         if (warning) recordTraceMessageXyzzY(message, WARNING, null, false);
     }
+
     public void warningm(String message, Object o) {
         if (warning) recordTraceMessageXyzzY(message, WARNING, o, false);
     }
@@ -479,9 +503,11 @@
     public void warningReportException(Throwable t, String msg) {
         if (warning) recordTraceMessageXyzzY(msg, WARNING, t, false);
     }
+
     public void worldm(String message) {
         if (world) recordTraceMessageXyzzY(message, WORLD, null, false);
     }
+
     public void worldm(String message, Object o) {
         if (world) recordTraceMessageXyzzY(message, WORLD, o, false);
     }



1.12      +57 -54    e/src/jsrc/org/erights/e/develop/trace/TraceBuffer.java

Index: TraceBuffer.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceBuffer.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- TraceBuffer.java	2001/09/06 09:55:43	1.11
+++ TraceBuffer.java	2001/11/10 19:40:39	1.12
@@ -45,6 +45,7 @@
  */
 
 class TraceBuffer implements TraceMessageAcceptor, TraceConstants {
+
     /** The first message in the buffer. */
     TraceMessage start;
 
@@ -74,6 +75,7 @@
         end = message;
         currentSize = 1;
     }
+
     public synchronized void accept(TraceMessage message) {
         Assertion.test(start != null);
         Assertion.test(end != null);
@@ -97,19 +99,20 @@
             newSize = STARTING_TRACE_BUFFER_SIZE;
         } else if (value.equalsIgnoreCase(UNLIMITED_NAME)) {
             newSize = Integer.MAX_VALUE;
-        } else try {
-            newSize = Integer.parseInt(value);
-        } catch (NumberFormatException e) {
-            Trace.trace.errorm(
-                "Buffer size cannot be changed to illegal value '" +
-                value + "'.");
-            newSize = maxSize;  // leave unchanged.
-        }
+        } else
+            try {
+                newSize = Integer.parseInt(value);
+            } catch (NumberFormatException e) {
+                Trace.trace.errorm(
+                  "Buffer size cannot be changed to illegal value '" +
+                  value + "'.");
+                newSize = maxSize;  // leave unchanged.
+            }
 
         if (newSize < 1) {
             Trace.trace.errorm(
-                value + " is too small a threshold size for the log. "
-                + "Ignoring.");
+              value + " is too small a threshold size for the log. "
+              + "Ignoring.");
             newSize = maxSize;
         }
 
@@ -147,68 +150,68 @@
                 stream = new PrintWriter(fos, true);
             } catch (SecurityException e) {
                 Trace.trace.errorm(
-                    "Security exception when opening dump file '" +
-                    outputDestination + "'.");
+                  "Security exception when opening dump file '" +
+                  outputDestination + "'.");
                 return;
             } catch (FileNotFoundException e) {
                 Trace.trace.errorm(
-                    "Could not open dump file '" +
-                    outputDestination + "'.");
+                  "Could not open dump file '" +
+                  outputDestination + "'.");
                 return;
             } catch (IOException e) {
                 Trace.trace.errorm(
-                    "Unknown error when opening dump file '" +
-                    outputDestination + "'.");
+                  "Unknown error when opening dump file '" +
+                  outputDestination + "'.");
                 return;
             }
         }
 
-       Trace.trace.usagem("Dumping internal trace buffer to " +
-                             outputDestination);
+        Trace.trace.usagem("Dumping internal trace buffer to " +
+                           outputDestination);
 
-       TraceMessageStringifier stringifier = new TraceMessageStringifier();
+        TraceMessageStringifier stringifier = new TraceMessageStringifier();
 
-       TraceMessage current = start;
-       // The begin/end lines make the dump easier to see when it and the log are
-       // going to the same place (typically stdout).
-       stream.println("======================= BEGIN TRACE BUFFER DUMP =======================");
-       while (current != null) {
-           String output = stringifier.toString(current);
-           stream.println(output);
-           current = current.next;
-       }
-       if (stream.checkError()) {
-           Trace.trace.errorm("Could not dump trace buffer to " +
-                                outputDestination);
-       }
-       stream.println("======================= END TRACE BUFFER DUMP =======================");
-       if (stream != PrintStreamWriter.out()) {
-           stream.close();
-       }
+        TraceMessage current = start;
+        // The begin/end lines make the dump easier to see when it and the log are
+        // going to the same place (typically stdout).
+        stream.println("======================= BEGIN TRACE BUFFER DUMP =======================");
+        while (current != null) {
+            String output = stringifier.toString(current);
+            stream.println(output);
+            current = current.next;
+        }
+        if (stream.checkError()) {
+            Trace.trace.errorm("Could not dump trace buffer to " +
+                               outputDestination);
+        }
+        stream.println("======================= END TRACE BUFFER DUMP =======================");
+        if (stream != PrintStreamWriter.out()) {
+            stream.close();
+        }
     }
 
     /**
      * Dump the buffer to a TraceMessageAcceptor.
      */
     /*package*/ synchronized void dump(TraceMessageAcceptor acceptor) {
-       Trace.trace.usagem("Dumping internal trace buffer.");
+        Trace.trace.usagem("Dumping internal trace buffer.");
 
-       // We want to demarcate the dumped trace in the new log, but
-       // not have the message end up in this log, which could be
-       // confusing.
-
-       TraceMessage traceMessage = unpostedTraceMessage("======================= BEGIN INTERNAL TRACE BUFFER DUMP =======================",
-                                                        ERROR);
-       acceptor.accept(traceMessage);
-
-       TraceMessage current = start;
-       while (current != null) {
-           acceptor.accept(current);
-           current = current.next;
-       }
-       traceMessage = unpostedTraceMessage("======================= END INTERNAL TRACE BUFFER DUMP =======================",
-                                           ERROR);
-       acceptor.accept(traceMessage);
+        // We want to demarcate the dumped trace in the new log, but
+        // not have the message end up in this log, which could be
+        // confusing.
+
+        TraceMessage traceMessage = unpostedTraceMessage("======================= BEGIN INTERNAL TRACE BUFFER DUMP =======================",
+                                                         ERROR);
+        acceptor.accept(traceMessage);
+
+        TraceMessage current = start;
+        while (current != null) {
+            acceptor.accept(current);
+            current = current.next;
+        }
+        traceMessage = unpostedTraceMessage("======================= END INTERNAL TRACE BUFFER DUMP =======================",
+                                            ERROR);
+        acceptor.accept(traceMessage);
     }
     // Note:  because messages are never thrown away,
     // except by GC, it is safe for this not to be synchronized.
@@ -239,7 +242,7 @@
      * something to be skipped on the way to the true caller.
      */
 
-    private TraceMessage recordTraceMessageXyzzY (String message, int level) {
+    private TraceMessage recordTraceMessageXyzzY(String message, int level) {
         TraceMessage tm = new TraceMessage();
         tm.message = message;
         tm.date = new Date();



1.5       +14 -15    e/src/jsrc/org/erights/e/develop/trace/TraceCaller.java

Index: TraceCaller.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceCaller.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TraceCaller.java	2001/09/06 09:55:43	1.4
+++ TraceCaller.java	2001/11/10 19:40:39	1.5
@@ -58,14 +58,14 @@
  * If the implementation runs into an odd format, it should leave
  * accessors it's not sure of with their initial values.
  */
-public class TraceCaller
-{
+public class TraceCaller {
+
     /**
      * The name of the method running in the targeted frame.
      * It is partly qualified, consisting of the last element of the
      * classname plus the method name (for example, "String.indexOf").
      */
-     public String methodName = "method?";
+    public String methodName = "method?";
 
     /** The file that method is in.  The full pathname is not available. */
     public String fileName = "file?";
@@ -115,7 +115,9 @@
 
     /** Delimit the beginning and end of a line in a larger string. */
     private class Line {
+
         int start = -1;
+
         int pastEnd = -1;
     }
 
@@ -159,8 +161,7 @@
     private String targetMethod = "recordTraceMessageXyzzY";
 
     private Line findTargetLineBounds(String stackDump)
-        throws Exception
-    {
+      throws Exception {
         int middle = stackDump.indexOf(targetMethod);
         quitIf(middle == -1);
 
@@ -174,7 +175,7 @@
         // frame is totally bogus and should be skipped.
 
         int possibleDuplicate =
-            stackDump.indexOf("TraceMessage.<init>", middle);
+          stackDump.indexOf("TraceMessage.<init>", middle);
         if (possibleDuplicate != -1) {
             middle = stackDump.indexOf(targetMethod, possibleDuplicate);
             quitIf(middle == -1);
@@ -185,9 +186,9 @@
         // 1.2.2 Classic VM, the frame for the TraceMessage
         // constructor is mislabelled as another instance of the
         // targetMethod.
-        possibleDuplicate = stackDump.indexOf(targetMethod, line.pastEnd+1);
-        if (   possibleDuplicate != -1 &&
-               stackDump.lastIndexOf('\n', possibleDuplicate) ==line.pastEnd) {
+        possibleDuplicate = stackDump.indexOf(targetMethod, line.pastEnd + 1);
+        if (possibleDuplicate != -1 &&
+          stackDump.lastIndexOf('\n', possibleDuplicate) == line.pastEnd) {
             line = lineFromPoint(stackDump, possibleDuplicate);
         }
 
@@ -202,8 +203,7 @@
      * the delimiters.
      */
     private Line lineFromPoint(String stackDump, int middle)
-        throws Exception
-    {
+      throws Exception {
         Line retval = new Line();
 
         retval.start = stackDump.lastIndexOf('\n', middle);
@@ -236,8 +236,7 @@
      * sophisticated. I expect installers to check their own stack
      * frame format and fix this up as needed.
      */
-    private void parseLine(String stackDump, Line line) throws Exception
-    {
+    private void parseLine(String stackDump, Line line) throws Exception {
         /* We're looking at:
            at Trace.Test.main(Test.java:21)
         */
@@ -302,9 +301,9 @@
 
             // A jit might leave the linenumber as "Compiled Code".
             String maybeLineNumber =
-                stackDump.substring(colon + 1, closeParen);
+              stackDump.substring(colon + 1, closeParen);
             if (maybeLineNumber.charAt(0) > '0' &&
-                   maybeLineNumber.charAt(0) <= '9')
+              maybeLineNumber.charAt(0) <= '9')
                 lineNumber = maybeLineNumber;
         }
         // else jit-compiled:  leave fileName and lineNumber



1.9       +21 -2     e/src/jsrc/org/erights/e/develop/trace/TraceConstants.java

Index: TraceConstants.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceConstants.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TraceConstants.java	2001/09/06 18:01:31	1.8
+++ TraceConstants.java	2001/11/10 19:40:39	1.9
@@ -27,10 +27,12 @@
 import java.io.File;
 
 interface TraceConstants {
+
     String version = "Trace version 1.2 of September 02000";
 
     /** This identifies the TraceMessageAcceptor used for the on-disk log. */
     int LOG = 0;
+
     /**
      * This identifies the TraceMessageAcceptor used for the in-core trace and
      * its associated window.
@@ -51,14 +53,20 @@
      */
 
     int ERROR = 10000;  // always set.
+
     int WARNING = 120;
+
     int WORLD = 100;
+
     int USAGE = 80;
+
     int EVENT = 60;
+
     int DEBUG = 40;
+
     int VERBOSE = 20;
 
-    int MAX_THRESHOLD=ERROR;
+    int MAX_THRESHOLD = ERROR;
 
     /**
      * As a late addition, there's a "timing" boolean that can be
@@ -78,18 +86,23 @@
      * right in 1.0.4.  That is, two "default" strings weren't eq.
      */
     int FROM_DEFAULT = 0;
+
     int FOR_SUBSYSTEM = 1;
 
     String reasonNames[] = {"default", "subsystem" };
 
     /* Trace buffer defaults */
     int STARTING_TRACE_BUFFER_SIZE = 500;
+
     int STARTING_TRACE_THRESHOLD = USAGE;
 
     /* Trace log defaults. */
     long STARTING_LOG_SIZE_THRESHOLD = 500000;
+
     long SMALLEST_LOG_SIZE_THRESHOLD = 1000;
+
     int STARTING_LOG_THRESHOLD = WORLD;
+
     boolean STARTING_LOG_WRITE = false;
 
     // Behavior when opening files that already exist.
@@ -97,19 +110,25 @@
     // interning doesn't seem to work right in 1.0.2, at least across
     // class boundaries.
     int IRRELEVANT = -1; // When opening stdout.
+
     int ADD = 1111;  // Add a new backup file.
+
     int OVERWRITE = 0;    // Overwrite any existing backup file.
+
     int STARTING_LOG_BACKUP_ACTION = ADD;
 
     // XXX At some point, this might be initialized to some default
     // directory.  In Windows, the "current working directory" has
     // a bad habit of hopping around at runtime.
     File STARTING_LOG_DIR = new File(".");
+
     String STARTING_LOG_TAG = "etrace";
+
     String LOG_EXTENSION = ".txt";  // DON'T change this to upper case.
-                                    // It causes duplicate filenames.
+    // It causes duplicate filenames.
 
     // Internationalization, ho ho.
     String DEFAULT_NAME = "default";
+
     String UNLIMITED_NAME = "unlimited";
 }



1.10      +20 -24    e/src/jsrc/org/erights/e/develop/trace/TraceController.java

Index: TraceController.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceController.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TraceController.java	2001/10/02 23:38:31	1.9
+++ TraceController.java	2001/11/10 19:40:39	1.10
@@ -175,13 +175,13 @@
         myDefaultThresholds[acceptorIndex] = newThreshold;
 
         Trace.trace.eventm("The new default threshold for " +
-                          acceptorNames[acceptorIndex] + " is " +
-                          TraceLevelTranslator.terse(newThreshold));
+                           acceptorNames[acceptorIndex] + " is " +
+                           TraceLevelTranslator.terse(newThreshold));
 
         Enumeration e = myTraceMediators.elements();
         while (e.hasMoreElements()) {
             TraceSubsystemMediator mediator =
-                (TraceSubsystemMediator) e.nextElement();
+              (TraceSubsystemMediator)e.nextElement();
             if (mediator.deferToDefaultThreshold[acceptorIndex]) {
                 mediator.setOneThreshold(acceptorIndex, newThreshold,
                                          FROM_DEFAULT);
@@ -196,20 +196,19 @@
      */
     static private void changeOneSubsystem(int acceptorIndex,
                                            String subsystem,
-                                           String value)
-    {
+                                           String value) {
         if (value.equalsIgnoreCase(DEFAULT_NAME)) {
             // set back to default threshold, whatever that is.
             findOrCreateMediator(subsystem).setOneThreshold(
-                acceptorIndex,
-                myDefaultThresholds[acceptorIndex],
-                FROM_DEFAULT);
+              acceptorIndex,
+              myDefaultThresholds[acceptorIndex],
+              FROM_DEFAULT);
         } else {
             // set to specific threshold.
             findOrCreateMediator(subsystem).setOneThreshold(
-                acceptorIndex,
-                TraceLevelTranslator.toInt(value),
-                FOR_SUBSYSTEM);
+              acceptorIndex,
+              TraceLevelTranslator.toInt(value),
+              FOR_SUBSYSTEM);
         }
     }
 
@@ -241,8 +240,7 @@
      * to remove without first adding, but it does provoke a warning.
      */
     static public void errorWatcher(TraceErrorWatcher aTraceErrorWatcher,
-                                    boolean add)
-    {
+                                    boolean add) {
         if (add) {
             Trace.trace.usagem("Adding an object that watches for errors.");
             if (myTraceErrorWatcher != null) {
@@ -270,7 +268,7 @@
         String key = name.toLowerCase();
 
         TraceSubsystemMediator mediator =
-            (TraceSubsystemMediator) myTraceMediators.get(key);
+          (TraceSubsystemMediator)myTraceMediators.get(key);
         if (mediator == null) {
             if (Trace.trace != null) {
                 Trace.trace.debugm("Creating mediator for " + name);
@@ -383,8 +381,7 @@
      */
     // Note: synchronization is the responsibility of the objects
     // whose properties are being changed.
-    static public void setProperty(String key, String value)
-    {
+    static public void setProperty(String key, String value) {
         Assertion.test(value != null, "Trace property value cannot be null.");
         key = key.trim();
         value = value.trim();
@@ -464,16 +461,15 @@
      */
     static private void setTiming(int acceptorIndex,
                                   String afterFirstUnderbar,
-                                  String value)
-    {
+                                  String value) {
         int underbar = afterFirstUnderbar.lastIndexOf('_');
         Assertion.test(underbar != -1);
         String subsystem = afterFirstUnderbar.substring(0, underbar);
         if (value.equalsIgnoreCase("on") ||
-            value.equalsIgnoreCase("true")) {
+          value.equalsIgnoreCase("true")) {
             findOrCreateMediator(subsystem).setTiming(acceptorIndex, true);
         } else if (value.equalsIgnoreCase("off") ||
-                   value.equalsIgnoreCase("false")) {
+          value.equalsIgnoreCase("false")) {
             findOrCreateMediator(subsystem).setTiming(acceptorIndex, false);
         } else {
             Trace.trace.warningm("Unknown timing value given: " + value);
@@ -496,7 +492,7 @@
      */
     static public void start(Properties p) {
         if (myStarted) {
-            Trace.trace.errorm("The tracing system is being started for the second time.\n"+
+            Trace.trace.errorm("The tracing system is being started for the second time.\n" +
                                "Ignoring the second start.", -1);
             return;
         }
@@ -510,8 +506,8 @@
         }
 
         if (!p.containsKey("TraceLog_name") &&
-            !p.containsKey("TraceLog_dir") &&
-            !p.containsKey("TraceLog_tag")) {
+          !p.containsKey("TraceLog_dir") &&
+          !p.containsKey("TraceLog_tag")) {
             //Trace.trace.usagem("TEMPORARY: TraceLog set to standard " +
             //                   "output for backwards compatibility.");
             p.put("TraceLog_name", "-");
@@ -538,7 +534,7 @@
         if (underbar == -1) {
             return false;
         }
-        String tail = afterFirstUnderbar.substring(underbar+1);
+        String tail = afterFirstUnderbar.substring(underbar + 1);
         return tail.equalsIgnoreCase("timing");
     }
 }



1.5       +2 -2      e/src/jsrc/org/erights/e/develop/trace/TraceDateToString.java

Index: TraceDateToString.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceDateToString.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TraceDateToString.java	2001/09/06 09:55:43	1.4
+++ TraceDateToString.java	2001/11/10 19:40:39	1.5
@@ -53,7 +53,7 @@
      * XXX should fix the tracing package to use 'long millis' instead of
      * 'Date date'
      */
-    /*package*/ final static String dateTimeString (Date date) {
+    /*package*/ final static String dateTimeString(Date date) {
         return ETimeFormat.formatTime(date.getTime());
     }
 
@@ -62,6 +62,6 @@
      * convert ":"s to "_"s.
      */
     /*package*/ final static String terseCompleteDateString(Date date) {
-        return ETimeFormat.formatTime(date.getTime()).replace(':','_');
+        return ETimeFormat.formatTime(date.getTime()).replace(':', '_');
     }
 }



1.7       +2 -1      e/src/jsrc/org/erights/e/develop/trace/TraceLevelTranslator.java

Index: TraceLevelTranslator.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceLevelTranslator.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TraceLevelTranslator.java	2001/09/06 09:55:43	1.6
+++ TraceLevelTranslator.java	2001/11/10 19:40:39	1.7
@@ -29,7 +29,7 @@
 /**
  * Translate numerical trace levels into strings and vice versa.
  */
-class TraceLevelTranslator implements TraceConstants{
+class TraceLevelTranslator implements TraceConstants {
 
     /**
      * Convert tracing thresholds into three-character synonyms.
@@ -70,6 +70,7 @@
         }
         return retval;
     }
+
     /**
      * Convert a string into one of the numeric trace levels.  Because
      * this method is used only to identify priority thresholds, it



1.11      +26 -22    e/src/jsrc/org/erights/e/develop/trace/TraceLog.java

Index: TraceLog.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceLog.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- TraceLog.java	2001/10/02 23:38:31	1.10
+++ TraceLog.java	2001/11/10 19:40:39	1.11
@@ -35,6 +35,7 @@
  * on-disk log.
  */
 class TraceLog implements TraceMessageAcceptor, TraceConstants {
+
     /**
      * Determine whether to rename full log files and open new
      * ones, or to empty a full log file.
@@ -53,7 +54,7 @@
     private long myMaxSize = STARTING_LOG_SIZE_THRESHOLD;
 
     /** Number of characters in the current log file. */
-    private long  myCurrentSize;
+    private long myCurrentSize;
 
     /**
      * The log to which messages are currently flowing.  Initially
@@ -82,10 +83,10 @@
     private TraceMessageStringifier myStringifier = new TraceMessageStringifier();
 
     /** This variable is used to count accurately the size of the log.
-        Note that I don't try to catch a SecurityException if one occurs.
-        We'll have other, bigger, problems if that happens. */
+     Note that I don't try to catch a SecurityException if one occurs.
+     We'll have other, bigger, problems if that happens. */
     static private final int lineSeparatorLength =
-        System.getProperty("line.separator").length();
+      System.getProperty("line.separator").length();
 
 // QUEUE MANAGEMENT
 
@@ -113,7 +114,7 @@
      * and the queue are turned off.
      */
     public synchronized void accept(TraceMessage message) {
-        if (! isAcceptingMessages()) {
+        if (!isAcceptingMessages()) {
             return;
         }
 
@@ -174,7 +175,7 @@
         myCurrent = myPending;
         Trace.trace.usagem("Logging begins on " +
                            myCurrent.printName() + ".");
-        myPending = (TraceLogDescriptor) myCurrent.diverge();
+        myPending = (TraceLogDescriptor)myCurrent.diverge();
         myCurrentSize = 0;
         drainQueue();
     }
@@ -196,7 +197,7 @@
             myBackupAction = ADD;
         } else {
             Trace.trace.errorm("TraceLog_backups property was given unknown value '" +
-                newBehavior + "'.");
+                               newBehavior + "'.");
         }
     }
 
@@ -230,19 +231,20 @@
             newSize = STARTING_LOG_SIZE_THRESHOLD;
         } else if (value.equalsIgnoreCase(UNLIMITED_NAME)) {
             newSize = Long.MAX_VALUE;
-        } else try {
-            newSize = Long.parseLong(value);
-        } catch (NumberFormatException e) {
-            Trace.trace.errorm(
-                "Log size cannot be changed to illegal value '" +
-                value + "'.");
-            newSize = myMaxSize;  // leave unchanged.
-        }
+        } else
+            try {
+                newSize = Long.parseLong(value);
+            } catch (NumberFormatException e) {
+                Trace.trace.errorm(
+                  "Log size cannot be changed to illegal value '" +
+                  value + "'.");
+                newSize = myMaxSize;  // leave unchanged.
+            }
 
         if (newSize < SMALLEST_LOG_SIZE_THRESHOLD) {
             Trace.trace.errorm(
-                value + " is too small a threshold size for the log. "
-                + "Try " + SMALLEST_LOG_SIZE_THRESHOLD + ".");
+              value + " is too small a threshold size for the log. "
+              + "Try " + SMALLEST_LOG_SIZE_THRESHOLD + ".");
             newSize = myMaxSize;
         }
 
@@ -297,7 +299,7 @@
                     beginLogging();
                 }
                 // else
-                    // do nothing - setupIsComplete() will handle this case.
+                // do nothing - setupIsComplete() will handle this case.
             }
         } else if (value.equalsIgnoreCase("false")) {
             if (!myWrite) {
@@ -316,7 +318,7 @@
             }
         } else {
             Trace.trace.errorm("TraceLog_write property was given value '" +
-                value + "'.");
+                               value + "'.");
         }
     }
 
@@ -458,7 +460,7 @@
         Trace.trace.worldm("Previous log was " + lastLog + ".");
 
         myCurrentSize = 0;
-        myPending = (TraceLogDescriptor) myCurrent.diverge();
+        myPending = (TraceLogDescriptor)myCurrent.diverge();
         drainQueue();
     }
 
@@ -474,6 +476,7 @@
     private final boolean isAcceptingMessages() {
         return myWrite || isQueuing();
     }
+
     private final boolean isQueuing() {
         return queuedMessages != null;
     }
@@ -582,9 +585,10 @@
         Trace.trace.usagem("Logging continues on " +
                            myCurrent.printName() + ".");
         Trace.trace.worldm("This is a continuation of a previous log.");
-        myPending = (TraceLogDescriptor) myCurrent.diverge();
+        myPending = (TraceLogDescriptor)myCurrent.diverge();
         drainQueue();
     }
+
     /**
      * Redirect trace messages to a queue.  Used while switching to a
      * new log file, or before setup is complete.
@@ -594,7 +598,7 @@
     private final void startQueuing() {
         // Note:  there can be no trace messages in this routine,
         // because it's called from the constructor.
-        if (! isQueuing()) {
+        if (!isQueuing()) {
             queuedMessages = new Vector();
         }
     }



1.13      +16 -15    e/src/jsrc/org/erights/e/develop/trace/TraceLogDescriptor.java

Index: TraceLogDescriptor.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceLogDescriptor.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- TraceLogDescriptor.java	2001/10/02 23:38:31	1.12
+++ TraceLogDescriptor.java	2001/11/10 19:40:39	1.13
@@ -239,14 +239,15 @@
         }
 
         Trace.trace.usagem("Renaming previous version of " +
-                          file + " to " + backupFile + ".");
+                           file + " to " + backupFile + ".");
         try {
-            if (backupFile.exists()) {  // clashAction == OVERWRITE
+            if (backupFile.exists()) {
+                // clashAction == OVERWRITE
                 if (!backupFile.delete()) {
                     Trace.trace.warningm("The previous version of " +
-                                     file + " could not be put in backup " +
-                                     "file " + backupFile + " because the " +
-                                     " existing file could not be deleted.");
+                                         file + " could not be put in backup " +
+                                         "file " + backupFile + " because the " +
+                                         " existing file could not be deleted.");
                     return false;
                 }
                 Trace.trace.eventm("The previous version of " +
@@ -289,10 +290,10 @@
         // is independent of the filename format.
         dir = new File(value);
         Trace.trace.eventm("Log directory will be changed to '" +
-                            value + "'.");
+                           value + "'.");
         if (!dir.isDirectory()) {
             Trace.trace.warningm("The log directory was set to '"
-                + value + "', which is not currently a directory.");
+                                 + value + "', which is not currently a directory.");
         }
     }
 
@@ -314,7 +315,7 @@
             usePersonalFormat = true;
             personalFile = value;
             Trace.trace.eventm("Log destination will be changed to " +
-                "file '" + personalFile + "'.");
+                               "file '" + personalFile + "'.");
         }
     }
 
@@ -359,7 +360,7 @@
 
         File nextFile = desiredLogFile();
         Trace.trace.eventm("Logging has been directed to '" +
-                          nextFile + "'.");
+                           nextFile + "'.");
 
         if (nextFile.exists()) {
             if (nextFile.isDirectory()) {
@@ -378,18 +379,18 @@
             stream = new PrintWriter(new FileOutputStream(nextFile), true);
         } catch (SecurityException e) {
             Trace.trace.errorm(
-                "Security exception when opening new trace file '" +
-                nextFile + "'.");
+              "Security exception when opening new trace file '" +
+              nextFile + "'.");
             throw e;
         } catch (FileNotFoundException e) {
             Trace.trace.errorm(
-                "Could not open new trace file '" +
-                nextFile + "'.");
+              "Could not open new trace file '" +
+              nextFile + "'.");
             throw e;
         } catch (IOException e) {
             Trace.trace.errorm(
-                "Unknown error when opening new trace file '" +
-                nextFile + "'.");
+              "Unknown error when opening new trace file '" +
+              nextFile + "'.");
             throw e;
         }
     }



1.7       +1 -0      e/src/jsrc/org/erights/e/develop/trace/TraceMessage.java

Index: TraceMessage.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceMessage.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TraceMessage.java	2001/09/06 09:55:43	1.6
+++ TraceMessage.java	2001/11/10 19:40:39	1.7
@@ -25,6 +25,7 @@
  */
 
 //import org.erights.e.develop.assertion.*;
+
 import java.util.Date;
 
 /**



1.8       +2 -2      e/src/jsrc/org/erights/e/develop/trace/TraceMessageAcceptor.java

Index: TraceMessageAcceptor.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceMessageAcceptor.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TraceMessageAcceptor.java	2001/09/06 18:01:31	1.7
+++ TraceMessageAcceptor.java	2001/11/10 19:40:39	1.8
@@ -34,8 +34,8 @@
  * may not make them available to a user.
  */
 
-interface TraceMessageAcceptor
-{
+interface TraceMessageAcceptor {
+
     /**
      * Accept a message and do whatever is appropriate to make it
      * visible to a user, either now or later.



1.14      +6 -0      e/src/jsrc/org/erights/e/develop/trace/TraceMessageStringifier.java

Index: TraceMessageStringifier.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceMessageStringifier.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- TraceMessageStringifier.java	2001/09/06 18:01:31	1.13
+++ TraceMessageStringifier.java	2001/11/10 19:40:39	1.14
@@ -41,12 +41,18 @@
  * By default, everything is shown.
  */
 class TraceMessageStringifier {
+
     // See the setter methods for the meanings of these booleans.
     private boolean myShowDate = true;
+
     private boolean myShowTime = true;
+
     private boolean myShowLocation = true;
+
     private boolean myShowSubsystem = true;
+
     private boolean myShowLevel = true;
+
     private String lineSeparator = System.getProperty("line.separator");
 
     // A minor concession to efficiency, as this is critical path.



1.9       +18 -16    e/src/jsrc/org/erights/e/develop/trace/TraceSubsystemMediator.java

Index: TraceSubsystemMediator.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceSubsystemMediator.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TraceSubsystemMediator.java	2001/09/06 09:55:43	1.8
+++ TraceSubsystemMediator.java	2001/11/10 19:40:39	1.9
@@ -40,8 +40,8 @@
  * Setting the thresholds used to answer the above question.
  */
 
-class TraceSubsystemMediator implements TraceConstants
-{
+class TraceSubsystemMediator implements TraceConstants {
+
     /** The subsystem that uses this mediator. */
     private String mySubsystem;
 
@@ -101,7 +101,7 @@
                            TraceMessageAcceptor[][] someAcceptors) {
         mySubsystem = aSubsystem;
         try {
-            myThresholds = (int[]) someThresholds.clone();
+            myThresholds = (int[])someThresholds.clone();
         } catch (Exception e) {
             Assertion.fail("CloneNotSupported should be impossible.");
         }
@@ -116,7 +116,7 @@
         for (int acceptorIndex = 0;
              acceptorIndex < deferToDefaultThreshold.length;
              acceptorIndex++) {
-           deferToDefaultThreshold[acceptorIndex] = true;
+            deferToDefaultThreshold[acceptorIndex] = true;
         }
         myCaches = new Vector();
     }
@@ -138,9 +138,9 @@
         message.date = new Date();
 
         for (int acceptorIndex = 0; acceptorIndex < myThresholds.length; acceptorIndex++) {
-            if (   myThresholds[acceptorIndex] <= message.level
-                || (   message.level == TIMING
-                    && myTimingBooleans[acceptorIndex])) {
+            if (myThresholds[acceptorIndex] <= message.level
+              || (message.level == TIMING
+              && myTimingBooleans[acceptorIndex])) {
                 for (int variant = 0;
                      variant < myAcceptors[acceptorIndex].length;
                      variant++) {
@@ -149,6 +149,7 @@
             }
         }
     }
+
     /** The common threshold is the most detailed (lowest). */
     private int commonThreshold() {
         int result = MAX_THRESHOLD;
@@ -160,6 +161,7 @@
         }
         return result;
     }
+
     /** The common timing is true if any acceptor times. */
     private boolean commonTiming() {
         for (int i = 0; i < myThresholds.length; i++) {
@@ -182,7 +184,7 @@
         newCache.myMediator = this;
         if (Trace.trace != null) {
             Trace.trace.debugm("The common Threshold is " +
-                TraceLevelTranslator.terse(commonThreshold()));
+                               TraceLevelTranslator.terse(commonThreshold()));
         }
         updateOneThresholdCache(newCache, commonThreshold());
         updateOneTimingCache(newCache, commonTiming());
@@ -199,11 +201,11 @@
      * value.
      */
     /*package*/ void setOneThreshold(int acceptorIndex, int newValue,
-                                int reason) {
+                                     int reason) {
         Trace.trace.eventm("Subsystem " + mySubsystem + "'s " +
-            acceptorNames[acceptorIndex] + " threshold is being set to " +
-            TraceLevelTranslator.terse(newValue) + " because of " +
-            reasonNames[reason] + " change.");
+                           acceptorNames[acceptorIndex] + " threshold is being set to " +
+                           TraceLevelTranslator.terse(newValue) + " because of " +
+                           reasonNames[reason] + " change.");
         deferToDefaultThreshold[acceptorIndex] = (reason == FROM_DEFAULT);
 
         // We don't need to go through the following rigamarole
@@ -242,8 +244,8 @@
      */
     /*package*/ void setTiming(int acceptorIndex, boolean newValue) {
         Trace.trace.eventm("Subsystem " + mySubsystem + "'s " +
-            acceptorNames[acceptorIndex] + " timing value is being set to " +
-            newValue + ".");
+                           acceptorNames[acceptorIndex] + " timing value is being set to " +
+                           newValue + ".");
 
         boolean previousCommonTiming = commonTiming();
         myTimingBooleans[acceptorIndex] = newValue;
@@ -279,10 +281,10 @@
     private void updateOneThresholdCache(Trace tr, int commonThreshold) {
         if (Trace.trace != null) {
             Trace.trace.debugm("Updating " + tr + " to " +
-                              TraceLevelTranslator.terse(commonThreshold));
+                               TraceLevelTranslator.terse(commonThreshold));
         }
         tr.verbose = tr.debug = tr.event = tr.usage = tr.warning =
-            tr.error = false;
+          tr.error = false;
         switch (commonThreshold) {
             case VERBOSE:
                 tr.verbose = true;  // fallthrough intentional



1.7       +8 -8      e/src/jsrc/org/erights/e/develop/trace/TraceTxtVersionNamer.java

Index: TraceTxtVersionNamer.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceTxtVersionNamer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TraceTxtVersionNamer.java	2001/09/06 18:01:31	1.6
+++ TraceTxtVersionNamer.java	2001/11/10 19:40:39	1.7
@@ -32,7 +32,7 @@
  */
 
 class TraceTxtVersionNamer extends TraceVersionNamer
-        implements TraceConstants {
+  implements TraceConstants {
 
     /** The length of the ".txt" extension, for convenience. */
     static private final int extlen = LOG_EXTENSION.length();
@@ -41,16 +41,16 @@
         super(aFile);
     }
     /*package*/ File constructVersion(int sequence) {
-            return new File(myDir, myBasename + sequence + LOG_EXTENSION);
+        return new File(myDir, myBasename + sequence + LOG_EXTENSION);
     }
     /*package*/ String fetchBasename() {
         // Showing that the trailing "." is part of the basename, for clarity.
         return myName.substring(0, myName.length() - extlen) + ".";
     }
     /*package*/ int getSeq(String filename) {
-            String possibleSeqString =
-                filename.substring(0, filename.length() - extlen).
-                         substring(myBasename.length());
+        String possibleSeqString =
+          filename.substring(0, filename.length() - extlen).
+          substring(myBasename.length());
 
         try {
             return Integer.parseInt(possibleSeqString);
@@ -61,8 +61,8 @@
     }
     /*package*/ boolean mightHaveSeq(String filename) {
         int minlen = myBasename.length() + 1 + extlen;
-            return filename.length() >= minlen &&
-                   filename.toLowerCase().startsWith(myBasename.toLowerCase()) &&
-                   filename.toLowerCase().endsWith(LOG_EXTENSION);
+        return filename.length() >= minlen &&
+          filename.toLowerCase().startsWith(myBasename.toLowerCase()) &&
+          filename.toLowerCase().endsWith(LOG_EXTENSION);
     }
 }



1.9       +7 -5      e/src/jsrc/org/erights/e/develop/trace/TraceVersionNamer.java

Index: TraceVersionNamer.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/develop/trace/TraceVersionNamer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TraceVersionNamer.java	2001/09/06 09:55:43	1.8
+++ TraceVersionNamer.java	2001/11/10 19:40:39	1.9
@@ -38,6 +38,7 @@
  * the original name.
  */
 class TraceVersionNamer implements TraceConstants {
+
     /** The file for which a version number is being created. */
     /*package*/ File myFile;
 
@@ -68,9 +69,9 @@
 
         myBasename = fetchBasename();
         Trace.trace.debugm("Finding next version of " +
-                          myFile + "(" +
-                          myDir + " " + myName +
-                          " " + myBasename + ")");
+                           myFile + "(" +
+                           myDir + " " + myName +
+                           " " + myBasename + ")");
     }
     /** Create a backup file name, given a sequence number. */
     /*package*/ File constructVersion(int sequence) {
@@ -120,6 +121,7 @@
             return -1;
         }
     }
+
     static public void main(String[] args) {
         TraceController.setProperty("TraceLog_trace", "debug");
         TraceVersionNamer v;
@@ -149,7 +151,7 @@
     /*package*/ boolean mightHaveSeq(String filename) {
         int minlen = myBasename.length() + 1;
         return filename.length() >= minlen
-               && filename.toLowerCase().startsWith(myBasename.toLowerCase());
+          && filename.toLowerCase().startsWith(myBasename.toLowerCase());
     }
 
     /**
@@ -181,7 +183,7 @@
                 Trace.trace.verbosem(files[i] + " is not in version file format.");
             }
         }
-        File retval = constructVersion(highestSeq+1);
+        File retval = constructVersion(highestSeq + 1);
         Trace.trace.eventm("Backup version for " + myFile + " is " + retval);
         return retval;
     }



1.29      +11 -6     e/src/jsrc/org/erights/e/elang/evm/AssignExpr.java

Index: AssignExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/AssignExpr.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- AssignExpr.java	2001/11/09 01:17:20	1.28
+++ AssignExpr.java	2001/11/10 19:40:39	1.29
@@ -18,13 +18,14 @@
 
 Contributor(s): ______________________________________.
 */
+
+import org.erights.e.develop.exception.NestedException;
 import org.erights.e.elang.scope.EvalContext;
 import org.erights.e.elang.visitors.ETreeVisitor;
 import org.erights.e.elib.eio.TextWriter;
 import org.erights.e.elib.ref.Ref;
 import org.erights.e.elib.tables.FlexList;
 import org.erights.e.elib.tables.FlexMap;
-import org.erights.e.develop.exception.NestedException;
 
 import java.io.IOException;
 
@@ -46,6 +47,7 @@
 public class AssignExpr extends EExpr {
 
     private NounExpr myNoun;
+
     private EExpr myRValue;
 
     /**
@@ -78,7 +80,7 @@
      */
     /*package*/ Object subEval(EvalContext ctx, boolean forValue) {
         Object result = myRValue.subEval(ctx, true);
-		try {
+        try {
             myNoun.assign(ctx, result);
         } catch (Exception ex) {
             throw new NestedException("assigning " + myNoun.name(), ex);
@@ -91,8 +93,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         AssignExpr other;
         try {
             other = (AssignExpr)Ref.resolution(specimen);
@@ -108,12 +109,16 @@
     /**
      *
      */
-    public EExpr noun() { return myNoun; }
+    public EExpr noun() {
+        return myNoun;
+    }
 
     /**
      *
      */
-    public EExpr rValue() { return myRValue; }
+    public EExpr rValue() {
+        return myRValue;
+    }
 
     /**
      *



1.31      +12 -7     e/src/jsrc/org/erights/e/elang/evm/CallExpr.java

Index: CallExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/CallExpr.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- CallExpr.java	2001/11/09 01:17:20	1.30
+++ CallExpr.java	2001/11/10 19:40:39	1.31
@@ -109,8 +109,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         CallExpr other;
         try {
             other = (CallExpr)Ref.resolution(specimen);
@@ -120,8 +119,8 @@
             return false;
         }
         return (myRecipient.matchBind(args, other.myRecipient, bindings)
-                && myVerb.equals(other.myVerb)
-                && matchBind(myArgs, args, other.myArgs, bindings));
+          && myVerb.equals(other.myVerb)
+          && matchBind(myArgs, args, other.myArgs, bindings));
     }
 
     /**
@@ -142,15 +141,21 @@
     /**
      *
      */
-    public EExpr recipient() { return myRecipient; }
+    public EExpr recipient() {
+        return myRecipient;
+    }
 
     /**
      *
      */
-    public String verb() { return myVerb; }
+    public String verb() {
+        return myVerb;
+    }
 
     /**
      *
      */
-    public EExpr[] args() { return myArgs; }
+    public EExpr[] args() {
+        return myArgs;
+    }
 }



1.17      +14 -7     e/src/jsrc/org/erights/e/elang/evm/CatchExpr.java

Index: CatchExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/CatchExpr.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- CatchExpr.java	2001/11/09 01:17:20	1.16
+++ CatchExpr.java	2001/11/10 19:40:39	1.17
@@ -45,7 +45,9 @@
 public class CatchExpr extends EExpr {
 
     private EExpr myAttempt;
+
     private Pattern myPattern;
+
     private EExpr myCatcher;
 
     /**
@@ -105,8 +107,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         CatchExpr other;
         try {
             other = (CatchExpr)Ref.resolution(specimen);
@@ -116,24 +117,30 @@
             return false;
         }
         return (myAttempt.matchBind(args, other.myAttempt, bindings)
-                && myPattern.matchBind(args, other.myPattern, bindings)
-                && myCatcher.matchBind(args, other.myCatcher, bindings));
+          && myPattern.matchBind(args, other.myPattern, bindings)
+          && myCatcher.matchBind(args, other.myCatcher, bindings));
     }
 
     /**
      *
      */
-    public EExpr attempt()   { return myAttempt; }
+    public EExpr attempt() {
+        return myAttempt;
+    }
 
     /**
      *
      */
-    public Pattern pattern() { return myPattern; }
+    public Pattern pattern() {
+        return myPattern;
+    }
 
     /**
      *
      */
-    public EExpr katch()     { return myCatcher; }
+    public EExpr katch() {
+        return myCatcher;
+    }
 
     /**
      *



1.16      +8 -7      e/src/jsrc/org/erights/e/elang/evm/CdrPattern.java

Index: CdrPattern.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/CdrPattern.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- CdrPattern.java	2001/11/09 01:17:20	1.15
+++ CdrPattern.java	2001/11/10 19:40:39	1.16
@@ -44,6 +44,7 @@
 public class CdrPattern extends Pattern {
 
     private ListPattern myStart;
+
     private Pattern myRest;
 
     /**
@@ -73,8 +74,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         CdrPattern other;
         try {
             other = (CdrPattern)Ref.resolution(specimen);
@@ -84,7 +84,7 @@
             return false;
         }
         return (myStart.matchBind(args, other.myStart, bindings)
-                && myRest.matchBind(args, other.myRest, bindings));
+          && myRest.matchBind(args, other.myRest, bindings));
     }
 
     /**
@@ -100,9 +100,8 @@
      *
      */
     /*package*/ void testMatch(EvalContext ctx,
-                                Object specimen,
-                                OneArgFunc optEjector)
-    {
+                               Object specimen,
+                               OneArgFunc optEjector) {
         //XXX should really coerce to a list here
         specimen = Ref.resolution(specimen);
         if (specimen == null) {
@@ -140,5 +139,7 @@
     /**
      *
      */
-    public String optName() { return null; }
+    public String optName() {
+        return null;
+    }
 }



1.30      +10 -6     e/src/jsrc/org/erights/e/elang/evm/DefineExpr.java

Index: DefineExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/DefineExpr.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- DefineExpr.java	2001/11/09 01:17:20	1.29
+++ DefineExpr.java	2001/11/10 19:40:39	1.30
@@ -50,6 +50,7 @@
 public class DefineExpr extends EExpr {
 
     private Pattern myPattern;
+
     private EExpr myRValue;
 
     /**
@@ -105,9 +106,8 @@
      *
      */
     public boolean matchBind(Object[] args,
-                              Object specimen,
-                             FlexList bindings)
-    {
+                             Object specimen,
+                             FlexList bindings) {
         DefineExpr other;
         try {
             other = (DefineExpr)Ref.resolution(specimen);
@@ -117,13 +117,15 @@
             return false;
         }
         return (myPattern.matchBind(args, other.myPattern, bindings)
-                && myRValue.matchBind(args, other.myRValue, bindings));
+          && myRValue.matchBind(args, other.myRValue, bindings));
     }
 
     /**
      *
      */
-    public Pattern pattern() { return myPattern; }
+    public Pattern pattern() {
+        return myPattern;
+    }
 
     /**
      *
@@ -144,5 +146,7 @@
     /**
      *
      */
-    public EExpr rValue() { return myRValue; }
+    public EExpr rValue() {
+        return myRValue;
+    }
 }



1.29      +8 -7      e/src/jsrc/org/erights/e/elang/evm/EExpr.java

Index: EExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/EExpr.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- EExpr.java	2001/11/09 01:17:20	1.28
+++ EExpr.java	2001/11/10 19:40:39	1.29
@@ -18,15 +18,14 @@
 
 Contributor(s): ______________________________________.
 */
+
 import org.erights.e.elang.scope.EvalContext;
 import org.erights.e.elang.scope.Scope;
 import org.erights.e.elang.scope.ScopeMap;
 import org.erights.e.elang.visitors.BindFramesVisitor;
 import org.erights.e.elang.visitors.SubstVisitor;
-
 import org.erights.e.elib.eio.TextWriter;
 import org.erights.e.elib.prim.E;
-import org.erights.e.elib.tables.ConstMap;
 
 import java.io.IOException;
 import java.util.List;
@@ -41,10 +40,12 @@
 public abstract class EExpr extends ENode {
 
     static public EExpr TheLastTransformed = new NounExpr("none");
+
     /**
      *
      */
-    protected EExpr() {}
+    protected EExpr() {
+    }
 
     /**
      * @see #subPrintOn
@@ -79,8 +80,8 @@
         EExpr realExpr = vis.xformEExpr(this);
         EvalContext ctx = scope.newContext(vis.maxLocals());
         Object result = realExpr.subEval(ctx, true);
-	// HACK expose the internal transformed expression
-	TheLastTransformed = realExpr;
+        // HACK expose the internal transformed expression
+        TheLastTransformed = realExpr;
         return result;
     }
 
@@ -122,9 +123,9 @@
      * @param all the EExprs to accumulate.
      */
     static protected void appendAllTo(List accum, EExpr[] all) {
-     	for (int i = 0, max = all.length; i < max; i++) {
+        for (int i = 0, max = all.length; i < max; i++) {
             all[i].appendTo(accum);
-    	}
+        }
     }
 
 }



1.25      +3 -1      e/src/jsrc/org/erights/e/elang/evm/EImpl.java

Index: EImpl.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/EImpl.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- EImpl.java	2001/11/09 01:17:20	1.24
+++ EImpl.java	2001/11/10 19:40:39	1.25
@@ -102,7 +102,9 @@
     /**
      * XXX controversial whether this should be made public
      */
-    /*package*/ Script script() { return myScript; }
+    /*package*/ Script script() {
+        return myScript;
+    }
 
     /**
      * The miranda printOn will call this.  Also, it may be called by normal



1.10      +1 -1      e/src/jsrc/org/erights/e/elang/evm/EImplByProxy.java

Index: EImplByProxy.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/EImplByProxy.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- EImplByProxy.java	2001/11/09 01:17:20	1.9
+++ EImplByProxy.java	2001/11/10 19:40:39	1.10
@@ -18,7 +18,7 @@
 
 Contributor(s): ______________________________________.
 */
-import org.erights.e.elang.scope.Scope;
+
 import org.erights.e.elang.scope.OuterScope;
 import org.erights.e.elib.base.Script;
 import org.erights.e.elib.serial.PassByProxy;



1.7       +0 -2      e/src/jsrc/org/erights/e/elang/evm/EMeta.java

Index: EMeta.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/EMeta.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- EMeta.java	2001/11/09 01:17:20	1.6
+++ EMeta.java	2001/11/10 19:40:39	1.7
@@ -6,8 +6,6 @@
 
 import java.io.IOException;
 
-import java.io.IOException;
-
 
 /**
  * Gives meta-level access to the object it wraps (its subject).



1.15      +35 -25    e/src/jsrc/org/erights/e/elang/evm/EMethod.java

Index: EMethod.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/EMethod.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- EMethod.java	2001/11/09 01:17:20	1.14
+++ EMethod.java	2001/11/10 19:40:39	1.15
@@ -29,9 +29,7 @@
 
 import java.io.IOException;
 
-import java.io.IOException;
 
-
 /**
  * BNF: <docComment> "to" verb "(" patterns ")" "{" expr "}" <p>
  *
@@ -43,12 +41,17 @@
 public class EMethod extends ENode {
 
     private String myDocComment;
+
     private String myVerb;
+
     private Pattern[] myPatterns;
+
     private EExpr myReturnGuard;
+
     private EExpr myBody;
-    private int myLocalCount= -1;
-    
+
+    private int myLocalCount = -1;
+
     /**
      * The constructor interns the verb
      */
@@ -56,8 +59,7 @@
                    String verb,
                    Pattern[] patterns,
                    EExpr returnGuard,
-                   EExpr body)
-    {
+                   EExpr body) {
         if (docComment == null) {
             docComment = "Oops, sysopsis was null";
         }
@@ -73,12 +75,11 @@
      * This method assumes the verb is interned.
      */
     public EMethod(String docComment,
-                   String verb, 
-                   Pattern[] patterns, 
+                   String verb,
+                   Pattern[] patterns,
                    EExpr returnGuard,
                    EExpr body,
-                   int localCount)
-    {
+                   int localCount) {
         if (docComment == null) {
             docComment = "Oops, sysopsis was null";
         }
@@ -119,15 +120,15 @@
      *
      */
     public Object execute(Object self, Object[] args) {
-        EvalContext ctx = ((EImpl) self).newContext(myLocalCount);
+        EvalContext ctx = ((EImpl)self).newContext(myLocalCount);
         for (int i = 0, max = args.length; i < max; i++) {
             myPatterns[i].testMatch(ctx, args[i], null);
         }
         Object vg = myReturnGuard.subEval(ctx, true);
-        ValueGuard valueGuard = (ValueGuard) E.as(vg, ValueGuard.class);
-        
+        ValueGuard valueGuard = (ValueGuard)E.as(vg, ValueGuard.class);
+
         //XXX forValue should be false if myReturnGuard == e`void`
-        Object result = myBody.subEval(ctx, true); 
+        Object result = myBody.subEval(ctx, true);
         return valueGuard.coerce(result, null);
     }
 
@@ -136,8 +137,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         EMethod other;
         try {
             other = (EMethod)Ref.resolution(specimen);
@@ -147,35 +147,45 @@
             return false;
         }
         return (myVerb.equals(other.myVerb)
-                && matchBind(myPatterns, args, other.myPatterns, bindings)
-                && myReturnGuard.matchBind(args, other.myReturnGuard, bindings)
-                && myBody.matchBind(args, other.myBody, bindings));
+          && matchBind(myPatterns, args, other.myPatterns, bindings)
+          && myReturnGuard.matchBind(args, other.myReturnGuard, bindings)
+          && myBody.matchBind(args, other.myBody, bindings));
     }
 
     /**
      *
      */
-    public String docComment() { return myDocComment; }
+    public String docComment() {
+        return myDocComment;
+    }
 
     /**
      *
      */
-    public String verb() { return myVerb; }
+    public String verb() {
+        return myVerb;
+    }
 
-   /**
+    /**
      *
      */
-    public Pattern[] patterns() { return myPatterns; }
+    public Pattern[] patterns() {
+        return myPatterns;
+    }
 
     /**
      *
      */
-    public EExpr returnGuard() { return myReturnGuard; }
+    public EExpr returnGuard() {
+        return myReturnGuard;
+    }
 
     /**
      *
      */
-    public EExpr body() { return myBody; }
+    public EExpr body() {
+        return myBody;
+    }
 
     /**
      *



1.24      +22 -13    e/src/jsrc/org/erights/e/elang/evm/EMethodNode.java

Index: EMethodNode.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/EMethodNode.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- EMethodNode.java	2001/11/09 04:47:34	1.23
+++ EMethodNode.java	2001/11/10 19:40:39	1.24
@@ -35,7 +35,9 @@
 public class EMethodNode extends MethodNode {
 
     private EMethod myMethod;
+
     private String myVerb;
+
     private int myArity;
 
     /**
@@ -43,8 +45,7 @@
      */
     public EMethodNode(String verb,
                        int arity,
-                       EMethod method)
-    {
+                       EMethod method) {
         myVerb = verb.intern();
         myArity = arity;
         myMethod = method;
@@ -61,7 +62,7 @@
      */
     public Object execute(Object self, String aVerb, Object[] args) {
         if (myArity != args.length
-                || (myVerb != aVerb && ! myVerb.equals(aVerb)) ) {
+          || (myVerb != aVerb && !myVerb.equals(aVerb))) {
             throw ExceptionMgr.asSafe(new NoSuchMethodException(aVerb + "/"
                                                                 + args.length));
         }
@@ -71,46 +72,54 @@
     /**
      *
      */
-    public String verb() { return myVerb; }
+    public String verb() {
+        return myVerb;
+    }
 
     /**
      *
      */
-    public String optTypedVerb() { return null; }
+    public String optTypedVerb() {
+        return null;
+    }
 
     /**
      *
      */
-    public int arity() { return myArity; }
+    public int arity() {
+        return myArity;
+    }
 
     /**
      *
      */
-    public EMethod method() { return myMethod; }
+    public EMethod method() {
+        return myMethod;
+    }
 
     /**
      * Do nothing
      */
-    public void addJavaMemberNodesToMap(FlexMap map) {}
+    public void addJavaMemberNodesToMap(FlexMap map) {
+    }
 
     /**
      * Ignores docComment
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         EMethodNode other;
         try {
-            other = (EMethodNode) Ref.resolution(specimen);
+            other = (EMethodNode)Ref.resolution(specimen);
         } catch (ClassCastException cce) {
             //using a try/catch since success is typical and we have
             //to pay for the test in the cast anyway
             return false;
         }
         return (myArity == other.myArity
-                && myVerb.equals(other.myVerb)
-                && myMethod.matchBind(args, other.myMethod, bindings));
+          && myVerb.equals(other.myVerb)
+          && myMethod.matchBind(args, other.myMethod, bindings));
     }
 
 }



1.7       +3 -3      e/src/jsrc/org/erights/e/elang/evm/ENode.java

Index: ENode.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/ENode.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ENode.java	2001/11/09 01:17:20	1.6
+++ ENode.java	2001/11/10 19:40:39	1.7
@@ -69,11 +69,11 @@
     /*package*/ abstract StaticScope computeStaticScope();
 
     /**
-      * Make a copy.
-      */
+     * Make a copy.
+     */
     public ENode copy() {
         try {
-            ENode node = (ENode) clone();
+            ENode node = (ENode)clone();
             node.cleanCopy();
             return node;
         } catch (CloneNotSupportedException ex) {



1.12      +11 -8     e/src/jsrc/org/erights/e/elang/evm/EScript.java

Index: EScript.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/EScript.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- EScript.java	2001/11/09 01:17:20	1.11
+++ EScript.java	2001/11/10 19:40:39	1.12
@@ -18,6 +18,7 @@
 
 Contributor(s): ______________________________________.
 */
+
 import org.erights.e.elang.visitors.ETreeVisitor;
 import org.erights.e.elib.eio.TextWriter;
 import org.erights.e.elib.ref.Ref;
@@ -26,8 +27,6 @@
 
 import java.io.IOException;
 
-import java.io.IOException;
-
 /**
  * <pre>
  * BNF: script ::= "{" method* matcher? "}" ("meta" script)?
@@ -43,6 +42,7 @@
 public class EScript extends ENode {
 
     /*package*/ EMethodNode[] myOptMethods;
+
     private Matcher myOptMatcher;
 
     /**
@@ -51,7 +51,7 @@
     public EScript(EMethodNode[] optMethods, Matcher optMatcher) {
         if (optMethods == null && optMatcher == null) {
             throw new RuntimeException(
-            "At least one of optMethods or optMatcher must not be null");
+              "At least one of optMethods or optMatcher must not be null");
         }
         myOptMethods = optMethods;
         myOptMatcher = optMatcher;
@@ -60,12 +60,16 @@
     /**
      *
      */
-    public ConstList optMethods() { return ConstList.fromArray(myOptMethods); }
+    public ConstList optMethods() {
+        return ConstList.fromArray(myOptMethods);
+    }
 
     /**
      *
      */
-    public Matcher optMatcher() { return myOptMatcher; }
+    public Matcher optMatcher() {
+        return myOptMatcher;
+    }
 
     /**
      *
@@ -96,8 +100,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         EScript other;
         try {
             other = (EScript)Ref.resolution(specimen);
@@ -113,7 +116,7 @@
             for (int i = 0, max = myOptMethods.length; i < max; i++) {
                 EMethod me = myOptMethods[i].method();
                 EMethod him = other.myOptMethods[i].method();
-                if (! matchBind(me, args, him, bindings)) {
+                if (!matchBind(me, args, him, bindings)) {
                     return false;
                 }
             }



1.26      +9 -5      e/src/jsrc/org/erights/e/elang/evm/EscapeExpr.java

Index: EscapeExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/EscapeExpr.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- EscapeExpr.java	2001/11/09 01:17:20	1.25
+++ EscapeExpr.java	2001/11/10 19:40:39	1.26
@@ -46,6 +46,7 @@
 public class EscapeExpr extends EExpr {
 
     private Pattern myExitPatt;
+
     private EExpr myRValue;
 
     /**
@@ -90,15 +91,16 @@
     /**
      *
      */
-    public Pattern exitPattern() { return myExitPatt; }
+    public Pattern exitPattern() {
+        return myExitPatt;
+    }
 
     /**
      *
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         EscapeExpr other;
         try {
             other = (EscapeExpr)Ref.resolution(specimen);
@@ -108,7 +110,7 @@
             return false;
         }
         return (myExitPatt.matchBind(args, other.myExitPatt, bindings)
-                && myRValue.matchBind(args, other.myRValue, bindings));
+          && myRValue.matchBind(args, other.myRValue, bindings));
     }
 
     /**
@@ -124,5 +126,7 @@
     /**
      *
      */
-    public EExpr rValue() { return myRValue; }
+    public EExpr rValue() {
+        return myRValue;
+    }
 }



1.11      +7 -12     e/src/jsrc/org/erights/e/elang/evm/FinalPattern.java

Index: FinalPattern.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/FinalPattern.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FinalPattern.java	2001/11/09 01:17:20	1.10
+++ FinalPattern.java	2001/11/10 19:40:39	1.11
@@ -21,18 +21,11 @@
 
 import org.erights.e.elang.scope.EvalContext;
 import org.erights.e.elang.visitors.ETreeVisitor;
-import org.erights.e.elib.eio.TextWriter;
 import org.erights.e.elib.prim.E;
-import org.erights.e.elib.ref.Ref;
 import org.erights.e.elib.slot.ValueGuard;
-import org.erights.e.elib.tables.ConstMap;
-import org.erights.e.elib.tables.FlexList;
-import org.erights.e.elib.tables.FlexMap;
 import org.erights.e.elib.util.OneArgFunc;
 
-import java.io.IOException;
 
-
 /**
  * BNF: Identifier ':' expr <p>
  *
@@ -61,6 +54,7 @@
 public class FinalPattern extends NounPattern {
 
     private NounExpr myNoun;
+
     private EExpr myValueGuard;
 
     /**
@@ -95,19 +89,20 @@
     /**
      *
      */
-    protected EExpr guardExpr() { return myValueGuard; }
+    protected EExpr guardExpr() {
+        return myValueGuard;
+    }
 
     /**
      *
      */
     /*package*/ void testMatch(EvalContext ctx,
-                                Object specimen,
-                                OneArgFunc optEjector)
-    {
+                               Object specimen,
+                               OneArgFunc optEjector) {
         //Because of the well-formedness criterea, we may safely evaluate
         //this in the wrong order
         Object sg = myValueGuard.subEval(ctx, true);
-        ValueGuard valueGuard = (ValueGuard) E.as(sg, ValueGuard.class);
+        ValueGuard valueGuard = (ValueGuard)E.as(sg, ValueGuard.class);
         Object value = valueGuard.coerce(specimen, optEjector);
         myNoun.initFinal(ctx, value);
     }



1.15      +9 -5      e/src/jsrc/org/erights/e/elang/evm/FinallyExpr.java

Index: FinallyExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/FinallyExpr.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- FinallyExpr.java	2001/11/09 01:17:20	1.14
+++ FinallyExpr.java	2001/11/10 19:40:39	1.15
@@ -48,6 +48,7 @@
 public class FinallyExpr extends EExpr {
 
     private EExpr myAttempt;
+
     private EExpr myUnwinder;
 
     /**
@@ -91,8 +92,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         FinallyExpr other;
         try {
             other = (FinallyExpr)Ref.resolution(specimen);
@@ -102,18 +102,22 @@
             return false;
         }
         return (myAttempt.matchBind(args, other.myAttempt, bindings)
-                && myUnwinder.matchBind(args, other.myUnwinder, bindings));
+          && myUnwinder.matchBind(args, other.myUnwinder, bindings));
     }
 
     /**
      *
      */
-    public EExpr attempt()      { return myAttempt; }
+    public EExpr attempt() {
+        return myAttempt;
+    }
 
     /**
      *
      */
-    public EExpr unwinder()     { return myUnwinder; }
+    public EExpr unwinder() {
+        return myUnwinder;
+    }
 
     /**
      *



1.2       +1 -1      e/src/jsrc/org/erights/e/elang/evm/FrameFinalNounExpr.java

Index: FrameFinalNounExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/FrameFinalNounExpr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FrameFinalNounExpr.java	2001/11/09 04:47:34	1.1
+++ FrameFinalNounExpr.java	2001/11/10 19:40:39	1.2
@@ -68,7 +68,7 @@
      * unless overridden by a printOn method written in E.
      */
     public String toString() {
-        return ""+myIndex;
+        return "" + myIndex;
     }
 
     /**



1.2       +2 -2      e/src/jsrc/org/erights/e/elang/evm/FrameSlotNounExpr.java

Index: FrameSlotNounExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/FrameSlotNounExpr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FrameSlotNounExpr.java	2001/11/09 04:47:34	1.1
+++ FrameSlotNounExpr.java	2001/11/10 19:40:39	1.2
@@ -50,7 +50,7 @@
      *
      */
     public Slot getSlot(EvalContext ctx) {
-        return (Slot) ctx.field(myIndex);
+        return (Slot)ctx.field(myIndex);
     }
 
     /**
@@ -74,7 +74,7 @@
      * unless overridden by a printOn method written in E.
      */
     public String toString() {
-        return ""+myIndex;
+        return "" + myIndex;
     }
 
     /**



1.23      +4 -3      e/src/jsrc/org/erights/e/elang/evm/HideExpr.java

Index: HideExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/HideExpr.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- HideExpr.java	2001/11/09 01:17:20	1.22
+++ HideExpr.java	2001/11/10 19:40:39	1.23
@@ -56,7 +56,9 @@
     /**
      *
      */
-    public EExpr block() { return myBlock; }
+    public EExpr block() {
+        return myBlock;
+    }
 
     /**
      *
@@ -77,8 +79,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         HideExpr other;
         try {
             other = (HideExpr)Ref.resolution(specimen);



1.24      +14 -8     e/src/jsrc/org/erights/e/elang/evm/IfExpr.java

Index: IfExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/IfExpr.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- IfExpr.java	2001/11/09 01:17:20	1.23
+++ IfExpr.java	2001/11/10 19:40:39	1.24
@@ -28,7 +28,6 @@
 import java.io.IOException;
 
 
-
 /**
  * BNF: "if" "(" cond-expr ")" "{" then-expr "}" "else" "{" else-expr "}" <p>
  *
@@ -42,7 +41,9 @@
 public class IfExpr extends EExpr {
 
     private EExpr myTest;
+
     private EExpr myThen;
+
     private EExpr myElse;
 
     /**
@@ -74,7 +75,9 @@
     /**
      *
      */
-    public EExpr els()  { return myElse; }
+    public EExpr els() {
+        return myElse;
+    }
 
     /**
      *
@@ -96,8 +99,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         IfExpr other;
         try {
             other = (IfExpr)Ref.resolution(specimen);
@@ -107,8 +109,8 @@
             return false;
         }
         return (myTest.matchBind(args, other.myTest, bindings)
-                && myThen.matchBind(args, other.myThen, bindings)
-                && myElse.matchBind(args, other.myElse, bindings));
+          && myThen.matchBind(args, other.myThen, bindings)
+          && myElse.matchBind(args, other.myElse, bindings));
     }
 
     /**
@@ -126,10 +128,14 @@
     /**
      *
      */
-    public EExpr test() { return myTest; }
+    public EExpr test() {
+        return myTest;
+    }
 
     /**
      *
      */
-    public EExpr then() { return myThen; }
+    public EExpr then() {
+        return myThen;
+    }
 }



1.12      +5 -6      e/src/jsrc/org/erights/e/elang/evm/IgnorePattern.java

Index: IgnorePattern.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/IgnorePattern.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- IgnorePattern.java	2001/11/09 01:17:20	1.11
+++ IgnorePattern.java	2001/11/10 19:40:39	1.12
@@ -40,7 +40,8 @@
     /**
      *
      */
-    public IgnorePattern() {}
+    public IgnorePattern() {
+    }
 
     /**
      *
@@ -61,8 +62,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         IgnorePattern other;
         try {
             other = (IgnorePattern)Ref.resolution(specimen);
@@ -92,9 +92,8 @@
      *
      */
     /*package*/ void testMatch(EvalContext ctx,
-                                Object specimen,
-                                OneArgFunc optEjector)
-    {
+                               Object specimen,
+                               OneArgFunc optEjector) {
         return;
     }
 



1.14      +9 -7      e/src/jsrc/org/erights/e/elang/evm/ListPattern.java

Index: ListPattern.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/ListPattern.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ListPattern.java	2001/11/09 01:17:20	1.13
+++ ListPattern.java	2001/11/10 19:40:39	1.14
@@ -73,8 +73,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         ListPattern other;
         try {
             other = (ListPattern)Ref.resolution(specimen);
@@ -97,9 +96,8 @@
      *
      */
     /*package*/ void testMatch(EvalContext ctx,
-                                Object specimen,
-                                OneArgFunc optEjector)
-    {
+                               Object specimen,
+                               OneArgFunc optEjector) {
         // TODO this looks a lot like the method in CdrPattern
         //XXX should really coerce to a list here
         specimen = Ref.resolution(specimen);
@@ -133,10 +131,14 @@
     /**
      *
      */
-    /*package*/ Pattern[] subPatterns() { return mySubs; }
+    /*package*/ Pattern[] subPatterns() {
+        return mySubs;
+    }
 
     /**
      *
      */
-    public String optName() { return null; }
+    public String optName() {
+        return null;
+    }
 }



1.23      +6 -4      e/src/jsrc/org/erights/e/elang/evm/LiteralExpr.java

Index: LiteralExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/LiteralExpr.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- LiteralExpr.java	2001/11/09 01:17:20	1.22
+++ LiteralExpr.java	2001/11/10 19:40:39	1.23
@@ -18,6 +18,7 @@
 
 Contributor(s): ______________________________________.
 */
+
 import org.erights.e.develop.format.StringHelper;
 import org.erights.e.elang.scope.EvalContext;
 import org.erights.e.elang.visitors.ETreeVisitor;
@@ -73,8 +74,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         LiteralExpr other;
         try {
             other = (LiteralExpr)Ref.resolution(specimen);
@@ -99,7 +99,7 @@
     public String printRep() {
         if (myValue instanceof Character) {
             String str = StringHelper.quote(myValue.toString());
-            return "\'" + str.substring(1, str.length()-1) + "\'";
+            return "\'" + str.substring(1, str.length() - 1) + "\'";
 
         } else if (myValue instanceof String) {
             return StringHelper.quote((String)myValue);
@@ -118,5 +118,7 @@
     /**
      *
      */
-    public Object value() { return myValue; }
+    public Object value() {
+        return myValue;
+    }
 }



1.2       +1 -1      e/src/jsrc/org/erights/e/elang/evm/LiteralNounExpr.java

Index: LiteralNounExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/LiteralNounExpr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LiteralNounExpr.java	2001/11/09 04:47:34	1.1
+++ LiteralNounExpr.java	2001/11/10 19:40:39	1.2
@@ -62,7 +62,7 @@
      * unless overridden by a printOn method written in E.
      */
     public String toString() {
-        return ""+myValue;
+        return "" + myValue;
     }
 
     /**



1.2       +1 -1      e/src/jsrc/org/erights/e/elang/evm/LiteralSlotNounExpr.java

Index: LiteralSlotNounExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/LiteralSlotNounExpr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LiteralSlotNounExpr.java	2001/11/09 04:47:34	1.1
+++ LiteralSlotNounExpr.java	2001/11/10 19:40:39	1.2
@@ -61,7 +61,7 @@
      * unless overridden by a printOn method written in E.
      */
     public String toString() {
-        return ""+mySlot;
+        return "" + mySlot;
     }
 
     /**



1.2       +1 -1      e/src/jsrc/org/erights/e/elang/evm/LocalFinalNounExpr.java

Index: LocalFinalNounExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/LocalFinalNounExpr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LocalFinalNounExpr.java	2001/11/09 04:47:34	1.1
+++ LocalFinalNounExpr.java	2001/11/10 19:40:39	1.2
@@ -83,7 +83,7 @@
      * unless overridden by a printOn method written in E.
      */
     public String toString() {
-        return ""+myIndex;
+        return "" + myIndex;
     }
 
     /**



1.2       +2 -2      e/src/jsrc/org/erights/e/elang/evm/LocalSlotNounExpr.java

Index: LocalSlotNounExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/LocalSlotNounExpr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LocalSlotNounExpr.java	2001/11/09 04:47:34	1.1
+++ LocalSlotNounExpr.java	2001/11/10 19:40:39	1.2
@@ -50,7 +50,7 @@
      *
      */
     public Slot getSlot(EvalContext ctx) {
-        return (Slot) ctx.local(myIndex);
+        return (Slot)ctx.local(myIndex);
     }
 
     /**
@@ -82,6 +82,6 @@
      * unless overridden by a printOn method written in E.
      */
     public String toString() {
-        return ""+myIndex;
+        return "" + myIndex;
     }
 }



1.28      +11 -7     e/src/jsrc/org/erights/e/elang/evm/MatchBindExpr.java

Index: MatchBindExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/MatchBindExpr.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- MatchBindExpr.java	2001/11/09 01:17:20	1.27
+++ MatchBindExpr.java	2001/11/10 19:40:39	1.28
@@ -29,7 +29,6 @@
 import java.io.IOException;
 
 
-
 /**
  * BNF: eExpr "=~" pattern <p>
  *
@@ -40,7 +39,9 @@
 public class MatchBindExpr extends EExpr {
 
     private EExpr mySpecimen;
+
     private Pattern myPattern;
+
     private NounExpr[] myOptBound;
 
     /**
@@ -81,7 +82,7 @@
             myPattern.testMatch(ctx, left, ej);
             return Boolean.TRUE;
         } catch (Throwable t) {
-            breakAll(ctx, (Throwable) ej.result(t));
+            breakAll(ctx, (Throwable)ej.result(t));
             return Boolean.FALSE;
         } finally {
             ej.disable();
@@ -109,8 +110,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         MatchBindExpr other;
         try {
             other = (MatchBindExpr)Ref.resolution(specimen);
@@ -120,13 +120,15 @@
             return false;
         }
         return (mySpecimen.matchBind(args, other.mySpecimen, bindings)
-                && myPattern.matchBind(args, other.myPattern, bindings));
+          && myPattern.matchBind(args, other.myPattern, bindings));
     }
 
     /**
      *
      */
-    public Pattern pattern() { return myPattern; }
+    public Pattern pattern() {
+        return myPattern;
+    }
 
     /**
      *
@@ -146,5 +148,7 @@
     /**
      *
      */
-    public EExpr specimen() { return mySpecimen; }
+    public EExpr specimen() {
+        return mySpecimen;
+    }
 }



1.11      +13 -7     e/src/jsrc/org/erights/e/elang/evm/Matcher.java

Index: Matcher.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/Matcher.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Matcher.java	2001/11/09 01:17:20	1.10
+++ Matcher.java	2001/11/10 19:40:39	1.11
@@ -18,11 +18,12 @@
 
 Contributor(s): ______________________________________.
 */
+
 import org.erights.e.elang.scope.EvalContext;
 import org.erights.e.elang.visitors.ETreeVisitor;
 import org.erights.e.elib.base.Script;
-import org.erights.e.elib.eio.TextWriter;
 import org.erights.e.elib.base.TypeDesc;
+import org.erights.e.elib.eio.TextWriter;
 import org.erights.e.elib.ref.Ref;
 import org.erights.e.elib.tables.ConstList;
 import org.erights.e.elib.tables.FlexList;
@@ -46,7 +47,9 @@
     static private final Object[] NO_ARGS = {};
 
     private Pattern myPattern;
+
     private EExpr myBody;
+
     private int myLocalCount = -1;
 
     /**
@@ -76,12 +79,16 @@
     /**
      *
      */
-    public Pattern pattern() { return myPattern; }
+    public Pattern pattern() {
+        return myPattern;
+    }
 
     /**
      *
      */
-    public EExpr   body() { return myBody; }
+    public EExpr body() {
+        return myBody;
+    }
 
     /**
      * When staticScope() is first requested on a given node, it calls
@@ -99,7 +106,7 @@
      */
     public Object execute(Object self, String verb, Object[] args) {
         Object[] message = { verb, ConstList.fromArray(args) };
-        EvalContext ctx = ((EImpl) self).newContext(myLocalCount);
+        EvalContext ctx = ((EImpl)self).newContext(myLocalCount);
         //it *must* bind when it's directly executed, as opposed to when
         //it's in a switch
         myPattern.testMatch(ctx,
@@ -113,8 +120,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         Matcher other;
         try {
             other = (Matcher)Ref.resolution(specimen);
@@ -124,7 +130,7 @@
             return false;
         }
         return (myPattern.matchBind(args, other.myPattern, bindings)
-                && myBody.matchBind(args, other.myBody, bindings));
+          && myBody.matchBind(args, other.myBody, bindings));
     }
 
     /**



1.11      +6 -5      e/src/jsrc/org/erights/e/elang/evm/MetaExpr.java

Index: MetaExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/MetaExpr.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- MetaExpr.java	2001/11/09 01:17:20	1.10
+++ MetaExpr.java	2001/11/10 19:40:39	1.11
@@ -45,8 +45,8 @@
     /**
      *
      */
-    /*package*/ Object subEval(EvalContext ctx, boolean forValue)  {
-        return forValue ? new EMeta(myNoun.subEval(ctx, true)) : null ;
+    /*package*/ Object subEval(EvalContext ctx, boolean forValue) {
+        return forValue ? new EMeta(myNoun.subEval(ctx, true)) : null;
     }
 
     /**
@@ -54,8 +54,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         MetaExpr other;
         try {
             other = (MetaExpr)Ref.resolution(specimen);
@@ -70,7 +69,9 @@
     /**
      *
      */
-    public NounExpr noun() { return myNoun; }
+    public NounExpr noun() {
+        return myNoun;
+    }
 
     /**
      *



1.26      +7 -8      e/src/jsrc/org/erights/e/elang/evm/NounExpr.java

Index: NounExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/NounExpr.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- NounExpr.java	2001/11/09 01:17:20	1.25
+++ NounExpr.java	2001/11/10 19:40:39	1.26
@@ -30,8 +30,6 @@
 
 import java.io.IOException;
 
-import java.io.IOException;
-
 /**
  * BNF: varName <p>
  *
@@ -67,14 +65,14 @@
         return false;
     }
 
-     /**
+    /**
      *
      */
     public Object welcome(ETreeVisitor visitor) {
         return visitor.visitNounExpr(myName);
     }
 
-   /**
+    /**
      *
      */
     /*package*/ StaticScope computeStaticScope() {
@@ -103,11 +101,10 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         NounExpr other;
         try {
-            other = (NounExpr) Ref.resolution(specimen);
+            other = (NounExpr)Ref.resolution(specimen);
         } catch (ClassCastException cce) {
             //using a try/catch since success is typical and we have
             //to pay for the test in the cast anyway
@@ -119,7 +116,9 @@
     /**
      *
      */
-    public String name() { return myName; }
+    public String name() {
+        return myName;
+    }
 
     /**
      *



1.2       +10 -9     e/src/jsrc/org/erights/e/elang/evm/NounPattern.java

Index: NounPattern.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/NounPattern.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NounPattern.java	2001/11/09 04:47:34	1.1
+++ NounPattern.java	2001/11/10 19:40:39	1.2
@@ -87,11 +87,11 @@
         StaticScope smScope = guardExpr.staticScope();
         if (smScope.namesUsed().maps(myVarName)) {
             throw new RuntimeException
-                ("kernel definer cycle not allowed: " + myVarName);
+              ("kernel definer cycle not allowed: " + myVarName);
         }
         if (smScope.namesOut().maps(myVarName)) {
             throw new RuntimeException
-                ("kernel definer shadow not allowed: " + myVarName);
+              ("kernel definer shadow not allowed: " + myVarName);
         }
     }
 
@@ -106,7 +106,9 @@
      * A Definer will never return null for this.  It is named
      * 'optName' because it is polymorphic with IgnorePattern
      */
-    public String optName()     { return myVarName; }
+    public String optName() {
+        return myVarName;
+    }
 
     /**
      *
@@ -129,8 +131,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         NounPattern other;
         try {
             other = (NounPattern)Ref.resolution(specimen);
@@ -146,10 +147,10 @@
                          args,
                          other.getNoun(),
                          bindings)
-                && matchBind(guardExpr(),
-                             args,
-                             other.guardExpr(),
-                             bindings);
+          && matchBind(guardExpr(),
+                       args,
+                       other.guardExpr(),
+                       bindings);
     }
 
     /**



1.37      +20 -13    e/src/jsrc/org/erights/e/elang/evm/ObjectExpr.java

Index: ObjectExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/ObjectExpr.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- ObjectExpr.java	2001/11/09 01:17:20	1.36
+++ ObjectExpr.java	2001/11/10 19:40:39	1.37
@@ -47,9 +47,13 @@
 public class ObjectExpr extends EExpr {
 
     private String myDocComment;
+
     private String myOptFQN;
+
     private NounExpr[] myAuditors;
+
     private EScript myEScript;
+
     private NounExpr[] myOptFieldInits;
 
     private VTable myOptVtableCache = null;
@@ -60,8 +64,7 @@
     public ObjectExpr(String docComment,
                       String optFQN,
                       NounExpr[] auditors,
-                      EScript eScript)
-    {
+                      EScript eScript) {
         if (docComment == null) {
             docComment = "Oops, docComment was null";
         }
@@ -78,8 +81,7 @@
                       String optFQN,
                       NounExpr[] auditors,
                       EScript eScript,
-                      NounExpr[] fieldNouns)
-    {
+                      NounExpr[] fieldNouns) {
         if (docComment == null) {
             docComment = "Oops, docComment was null";
         }
@@ -122,7 +124,7 @@
      *
      */
     /*package*/ Object subEval(EvalContext ctx, boolean forValue) {
-        if (! forValue) {
+        if (!forValue) {
             return null;
         }
         int max = myOptFieldInits.length;
@@ -139,8 +141,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         ObjectExpr other;
         try {
             other = (ObjectExpr)Ref.resolution(specimen);
@@ -150,8 +151,8 @@
             return false;
         }
         return (Ref.same(myOptFQN, other.myOptFQN)
-                && matchBind(myAuditors, args, other.myAuditors, bindings)
-                && myEScript.matchBind(args, other.myEScript, bindings));
+          && matchBind(myAuditors, args, other.myAuditors, bindings)
+          && myEScript.matchBind(args, other.myEScript, bindings));
     }
 
     /**
@@ -176,7 +177,9 @@
     /**
      *
      */
-    public String optFQN() { return myOptFQN; }
+    public String optFQN() {
+        return myOptFQN;
+    }
 
     /**
      *
@@ -188,7 +191,7 @@
         String result = myOptFQN;
         int i = result.lastIndexOf('$');
         if (-1 != i) {
-            result = result.substring(i+1);
+            result = result.substring(i + 1);
         }
         if (result.endsWith("__Class")) {
             int len = result.length() - "__Class".length();
@@ -200,12 +203,16 @@
     /**
      *
      */
-    public ConstList auditors() { return ConstList.fromArray(myAuditors); }
+    public ConstList auditors() {
+        return ConstList.fromArray(myAuditors);
+    }
 
     /**
      *
      */
-    public EScript eScript() { return myEScript; }
+    public EScript eScript() {
+        return myEScript;
+    }
 
     /**
      *



1.2       +2 -1      e/src/jsrc/org/erights/e/elang/evm/OuterNounExpr.java

Index: OuterNounExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/OuterNounExpr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- OuterNounExpr.java	2001/11/09 04:47:34	1.1
+++ OuterNounExpr.java	2001/11/10 19:40:39	1.2
@@ -85,8 +85,9 @@
      * unless overridden by a printOn method written in E.
      */
     public String toString() {
-        return ""+myIndex;
+        return "" + myIndex;
     }
+
     /**
      *
      */



1.29      +4 -3      e/src/jsrc/org/erights/e/elang/evm/Pattern.java

Index: Pattern.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/Pattern.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- Pattern.java	2001/11/09 01:17:20	1.28
+++ Pattern.java	2001/11/10 19:40:39	1.29
@@ -40,7 +40,8 @@
     /**
      *
      */
-    /*package*/ Pattern() {}
+    /*package*/ Pattern() {
+    }
 
     /**
      * @see #subPrintOn
@@ -64,8 +65,8 @@
      * Otherwise report the reason why not according to optEjector.
      */
     /*package*/ abstract void testMatch(EvalContext ctx,
-                                         Object specimen,
-                                         OneArgFunc optEjector);
+                                        Object specimen,
+                                        OneArgFunc optEjector);
 
     /**
      * If this pattern is the binding occurence of a name, and it would bind



1.22      +5 -4      e/src/jsrc/org/erights/e/elang/evm/QuasiLiteralExpr.java

Index: QuasiLiteralExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/QuasiLiteralExpr.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- QuasiLiteralExpr.java	2001/11/09 01:17:20	1.21
+++ QuasiLiteralExpr.java	2001/11/10 19:40:39	1.22
@@ -18,6 +18,7 @@
 
 Contributor(s): ______________________________________.
 */
+
 import org.erights.e.elang.scope.EvalContext;
 import org.erights.e.elang.visitors.ETreeVisitor;
 import org.erights.e.elib.eio.TextWriter;
@@ -27,7 +28,6 @@
 import java.io.IOException;
 
 
-
 /**
  * BNF: '$' '{' <number> '}' <p>
  *
@@ -75,7 +75,9 @@
     /**
      *
      */
-    public int index() { return myIndex; }
+    public int index() {
+        return myIndex;
+    }
 
     static private final Object[] NO_ARGS = {};
 
@@ -84,8 +86,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         //XXX Need to do the same() rather than doing another
         //matchBind(), but can't right now since we'd need value-based
         //equality on all the Exprs.



1.12      +6 -6      e/src/jsrc/org/erights/e/elang/evm/QuasiLiteralPatt.java

Index: QuasiLiteralPatt.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/QuasiLiteralPatt.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- QuasiLiteralPatt.java	2001/11/09 01:17:20	1.11
+++ QuasiLiteralPatt.java	2001/11/10 19:40:39	1.12
@@ -69,9 +69,8 @@
      * according to optEjector
      */
     /*package*/ void testMatch(EvalContext ctx,
-                                Object specimen,
-                                OneArgFunc optEjector)
-    {
+                               Object specimen,
+                               OneArgFunc optEjector) {
         throw new IncompleteQuasiException
           ("Can't evaluate programs that still contain bare \"$\"s");
     }
@@ -87,7 +86,9 @@
     /**
      *
      */
-    public int index() { return myIndex; }
+    public int index() {
+        return myIndex;
+    }
 
     static private final Object[] NO_ARGS = {};
 
@@ -96,8 +97,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         //XXX Need to do the areEquals() rather than doing another
         //matchBind(), but can't right now since we'd need value-based
         //equals methods on all the Patterns.



1.23      +6 -4      e/src/jsrc/org/erights/e/elang/evm/QuasiPatternExpr.java

Index: QuasiPatternExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/QuasiPatternExpr.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- QuasiPatternExpr.java	2001/11/09 01:17:20	1.22
+++ QuasiPatternExpr.java	2001/11/10 19:40:39	1.23
@@ -18,6 +18,7 @@
 
 Contributor(s): ______________________________________.
 */
+
 import org.erights.e.elang.scope.EvalContext;
 import org.erights.e.elang.visitors.ETreeVisitor;
 import org.erights.e.elib.eio.TextWriter;
@@ -74,16 +75,17 @@
     /**
      *
      */
-    public int index() { return myIndex; }
+    public int index() {
+        return myIndex;
+    }
 
     /**
      *
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
-        bindings.ensureSize(myIndex+1);
+                             FlexList bindings) {
+        bindings.ensureSize(myIndex + 1);
         if (bindings.get(myIndex) != null) {
             throw new AlreadyDefinedException("conflict defining @{"
                                               + myIndex + "}");



1.12      +8 -7      e/src/jsrc/org/erights/e/elang/evm/QuasiPatternPatt.java

Index: QuasiPatternPatt.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/QuasiPatternPatt.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- QuasiPatternPatt.java	2001/11/09 01:17:20	1.11
+++ QuasiPatternPatt.java	2001/11/10 19:40:39	1.12
@@ -18,6 +18,7 @@
 
 Contributor(s): ______________________________________.
 */
+
 import org.erights.e.elang.scope.EvalContext;
 import org.erights.e.elang.visitors.ETreeVisitor;
 import org.erights.e.elib.eio.TextWriter;
@@ -69,9 +70,8 @@
      * Throws an IncompleteQuasiException rather than indicating match failure
      */
     /*package*/ void testMatch(EvalContext ctx,
-                                Object specimen,
-                                OneArgFunc optEjector)
-    {
+                               Object specimen,
+                               OneArgFunc optEjector) {
         throw new IncompleteQuasiException
           ("Can't evaluate programs that still contain bare \"@\"s");
     }
@@ -87,16 +87,17 @@
     /**
      *
      */
-    public int index() { return myIndex; }
+    public int index() {
+        return myIndex;
+    }
 
     /**
      *
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
-        bindings.ensureSize(myIndex+1);
+                             FlexList bindings) {
+        bindings.ensureSize(myIndex + 1);
         if (bindings.get(myIndex) != null) {
             throw new AlreadyDefinedException("conflict defining @{"
                                               + myIndex + "}");



1.22      +4 -5      e/src/jsrc/org/erights/e/elang/evm/ScopeExpr.java

Index: ScopeExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/ScopeExpr.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ScopeExpr.java	2001/11/09 01:17:20	1.21
+++ ScopeExpr.java	2001/11/10 19:40:39	1.22
@@ -29,7 +29,6 @@
 import java.io.IOException;
 
 
-
 /**
  * BNF: "meta scope" <p>
  *
@@ -41,7 +40,8 @@
     /**
      *
      */
-    public ScopeExpr() {}
+    public ScopeExpr() {
+    }
 
     /**
      *
@@ -60,7 +60,7 @@
     /**
      *
      */
-    /*package*/ Object subEval(EvalContext ctx, boolean forValue)  {
+    /*package*/ Object subEval(EvalContext ctx, boolean forValue) {
         // NOTE this needs to strip the now-unreferenced content from
         // the scope, possibly combining the scope with the current staticScope.
         // TODO build a scope
@@ -72,8 +72,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         ScopeExpr other;
         try {
             other = (ScopeExpr)Ref.resolution(specimen);



1.23      +12 -7     e/src/jsrc/org/erights/e/elang/evm/SendExpr.java

Index: SendExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/SendExpr.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- SendExpr.java	2001/11/09 01:17:20	1.22
+++ SendExpr.java	2001/11/10 19:40:39	1.23
@@ -103,8 +103,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         SendExpr other;
         try {
             other = (SendExpr)Ref.resolution(specimen);
@@ -114,8 +113,8 @@
             return false;
         }
         return (myRecipient.matchBind(args, other.myRecipient, bindings)
-                && myVerb.equals(other.myVerb)
-                && matchBind(myArgs, args, other.myArgs, bindings));
+          && myVerb.equals(other.myVerb)
+          && matchBind(myArgs, args, other.myArgs, bindings));
     }
 
     /**
@@ -136,15 +135,21 @@
     /**
      *
      */
-    public EExpr recipient() { return myRecipient; }
+    public EExpr recipient() {
+        return myRecipient;
+    }
 
     /**
      *
      */
-    public String verb() { return myVerb; }
+    public String verb() {
+        return myVerb;
+    }
 
     /**
      *
      */
-    public EExpr[] args() { return myArgs; }
+    public EExpr[] args() {
+        return myArgs;
+    }
 }



1.10      +28 -27    e/src/jsrc/org/erights/e/elang/evm/SeqExpr.java

Index: SeqExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/SeqExpr.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- SeqExpr.java	2001/11/09 01:17:20	1.9
+++ SeqExpr.java	2001/11/10 19:40:39	1.10
@@ -48,7 +48,7 @@
     public SeqExpr(EExpr[] subs) {
         List accum = new ArrayList(subs.length);
         appendAllTo(accum, subs);
-        mySubs = (EExpr[]) accum.toArray(EEXPR_PROTOTYPE);
+        mySubs = (EExpr[])accum.toArray(EEXPR_PROTOTYPE);
     }
 
     /**
@@ -64,22 +64,22 @@
     /*package*/ StaticScope computeStaticScope() {
         StaticScope result = mySubs[0].staticScope();
         // NOTE the loop begins at 1, not 0
-    	for (int i = 1, max = mySubs.length; i < max; i++) {
+        for (int i = 1, max = mySubs.length; i < max; i++) {
             result = result.add(mySubs[i].staticScope());
-    	}
-    	return result;
+        }
+        return result;
     }
 
     /**
      *
      */
     /*package*/ Object subEval(EvalContext ctx, boolean forValue) {
-    	// only compute a value for the last sub
-    	int last = mySubs.length - 1;
-    	for (int i = 0; i < last; i++) {
+        // only compute a value for the last sub
+        int last = mySubs.length - 1;
+        for (int i = 0; i < last; i++) {
             mySubs[i].subEval(ctx, false);
-    	}
-    	return mySubs[last].subEval(ctx, forValue);
+        }
+        return mySubs[last].subEval(ctx, forValue);
     }
 
     /**
@@ -87,8 +87,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         SeqExpr other;
         try {
             other = (SeqExpr)Ref.resolution(specimen);
@@ -98,16 +97,16 @@
             return false;
         }
 
-		EExpr[] subs = other.mySubs;
-		if (subs.length != mySubs.length) {
-			return false;
-		}
-    	for (int i = 0, max = mySubs.length; i < max; i++) {
-            if (! mySubs[i].matchBind(args, subs[i], bindings)) {
-            	return false;
+        EExpr[] subs = other.mySubs;
+        if (subs.length != mySubs.length) {
+            return false;
+        }
+        for (int i = 0, max = mySubs.length; i < max; i++) {
+            if (!mySubs[i].matchBind(args, subs[i], bindings)) {
+                return false;
             }
-    	}
-    	return true;
+        }
+        return true;
     }
 
     /**
@@ -118,13 +117,13 @@
             out.print("(");
         }
         boolean first = true;
-    	for (int i = 0, max = mySubs.length; i < max; i++) {
-            if (! first) {
-		        out.println();
+        for (int i = 0, max = mySubs.length; i < max; i++) {
+            if (!first) {
+                out.println();
             }
             first = false;
-	        mySubs[i].subPrintOn(out, PR_EEXPR);
-    	}
+            mySubs[i].subPrintOn(out, PR_EEXPR);
+        }
         if (priority > PR_EEXPR) {
             out.print(")");
         }
@@ -133,12 +132,14 @@
     /**
      *
      */
-    public EExpr[] subs() { return mySubs; }
+    public EExpr[] subs() {
+        return mySubs;
+    }
 
     /**
      * Append subs in place of the receiver.
      */
     protected void appendTo(List accum) {
-     	appendAllTo(accum, mySubs);
+        appendAllTo(accum, mySubs);
     }
 }



1.25      +4 -3      e/src/jsrc/org/erights/e/elang/evm/SlotExpr.java

Index: SlotExpr.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/SlotExpr.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- SlotExpr.java	2001/11/09 01:17:20	1.24
+++ SlotExpr.java	2001/11/10 19:40:39	1.25
@@ -75,8 +75,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         SlotExpr other;
         try {
             other = (SlotExpr)Ref.resolution(specimen);
@@ -91,7 +90,9 @@
     /**
      *
      */
-    public NounExpr noun() { return myNoun; }
+    public NounExpr noun() {
+        return myNoun;
+    }
 
     /**
      *



1.17      +17 -13    e/src/jsrc/org/erights/e/elang/evm/StaticScope.java

Index: StaticScope.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/StaticScope.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- StaticScope.java	2001/11/09 01:17:20	1.16
+++ StaticScope.java	2001/11/10 19:40:39	1.17
@@ -18,6 +18,7 @@
 
 Contributor(s): ______________________________________.
 */
+
 import org.erights.e.elib.eio.TextWriter;
 import org.erights.e.elib.tables.ConstMap;
 import org.erights.e.elib.tables.FlexMap;
@@ -32,44 +33,47 @@
     //XXX should really use an identity map, and nouns (variable
     //names) should be interned.
     static public final ConstMap
-        EmptyMap = FlexMap.fromTypes(String.class, Void.class).snapshot();
+      EmptyMap = FlexMap.fromTypes(String.class, Void.class).snapshot();
 
-    static public final StaticScope 
-        EmptyScope = new StaticScope(EmptyMap, EmptyMap, false, EmptyMap),
-        META_SCOPE = new StaticScope(EmptyMap, EmptyMap, true, EmptyMap);
+    static public final StaticScope
+      EmptyScope = new StaticScope(EmptyMap, EmptyMap, false, EmptyMap),
+    META_SCOPE = new StaticScope(EmptyMap, EmptyMap, true, EmptyMap);
 
     private ConstMap myNamesRead;
+
     private ConstMap myNamesSet;
+
     private boolean myScopeExprFlag;
+
     private ConstMap myNamesOut;
 
     private StaticScope(ConstMap namesRead,
-                       ConstMap namesSet,
-                       boolean hasScopeExpr,
-                       ConstMap namesOut) {
+                        ConstMap namesSet,
+                        boolean hasScopeExpr,
+                        ConstMap namesOut) {
         myNamesRead = namesRead;
         myNamesSet = namesSet;
         myScopeExprFlag = hasScopeExpr;
         myNamesOut = namesOut;
     }
-    
+
     static public StaticScope
-    scopeAssign(ConstMap namesSet) {
+      scopeAssign(ConstMap namesSet) {
         return new StaticScope(EmptyMap, namesSet, false, EmptyMap);
     }
 
     static public StaticScope
-    scopeRead(ConstMap namesRead) {
+      scopeRead(ConstMap namesRead) {
         return new StaticScope(namesRead, EmptyMap, false, EmptyMap);
     }
 
     static public StaticScope
-    scopeDefine(ConstMap namesOut) {
+      scopeDefine(ConstMap namesOut) {
         return new StaticScope(EmptyMap, EmptyMap, false, namesOut);
     }
 
     static public StaticScope
-    scopeMeta() {
+      scopeMeta() {
         return META_SCOPE;
     }
 
@@ -143,6 +147,6 @@
      */
     public void printOn(TextWriter out) throws IOException {
         out.print("<", myNamesSet, " := ",
-                 myNamesRead, " =~ ", myNamesOut, ">");
+                  myNamesRead, " =~ ", myNamesOut, ">");
     }
 }



1.14      +6 -7      e/src/jsrc/org/erights/e/elang/evm/SuchThatPattern.java

Index: SuchThatPattern.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/SuchThatPattern.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- SuchThatPattern.java	2001/11/09 01:17:20	1.13
+++ SuchThatPattern.java	2001/11/10 19:40:39	1.14
@@ -40,6 +40,7 @@
 public class SuchThatPattern extends Pattern {
 
     private Pattern mySubPattern;
+
     private EExpr myTest;
 
     /**
@@ -69,8 +70,7 @@
      */
     public boolean matchBind(Object[] args,
                              Object specimen,
-                             FlexList bindings)
-    {
+                             FlexList bindings) {
         SuchThatPattern other;
         try {
             other = (SuchThatPattern)Ref.resolution(specimen);
@@ -80,7 +80,7 @@
             return false;
         }
         return (mySubPattern.matchBind(args, other.mySubPattern, bindings)
-                && myTest.matchBind(args, other.myTest, bindings));
+          && myTest.matchBind(args, other.myTest, bindings));
     }
 
     /**
@@ -96,11 +96,10 @@
      *
      */
     /*package*/ void testMatch(EvalContext ctx,
-                                Object specimen,
-                                OneArgFunc optEjector)
-    {
+                               Object specimen,
+                               OneArgFunc optEjector) {
         mySubPattern.testMatch(ctx, specimen, optEjector);
-        if (! myTest.evalBool(ctx)) {
+        if (!myTest.evalBool(ctx)) {
             throw Thrower.toEject(optEjector,
                                   "such-that expression was false");
         }



1.11      +11 -8     e/src/jsrc/org/erights/e/elang/evm/VarPattern.java

Index: VarPattern.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/evm/VarPattern.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- VarPattern.java	2001/11/09 01:17:20	1.10
+++ VarPattern.java	2001/11/10 19:40:39	1.11
@@ -57,8 +57,9 @@
 public class VarPattern extends NounPattern {
 
     private NounExpr myNoun;
+
     private EExpr mySlotGuard;
-   
+
     /**
      * If 'varName' would shadow a non-shadowable, throw a (XXX to be
      * defined) exception instead.  <p>
@@ -72,9 +73,10 @@
         mySlotGuard = guardExpr;
         ensureWellFormed(mySlotGuard);
     }
+
     public VarPattern(String varName, EExpr guardExpr) {
         this(varName, new NounExpr(varName), guardExpr);
-    }    
+    }
 
     /**
      *
@@ -90,7 +92,9 @@
     /**
      *
      */
-    protected EExpr guardExpr() { return mySlotGuard; }
+    protected EExpr guardExpr() {
+        return mySlotGuard;
+    }
 
     /**
      *
@@ -104,13 +108,12 @@
      *
      */
     /*package*/ void testMatch(EvalContext ctx,
-                                Object specimen,
-                                OneArgFunc optEjector)
-    {
-        //Because of the well-formedness criterea, we may safely evaluate 
+                               Object specimen,
+                               OneArgFunc optEjector) {
+        //Because of the well-formedness criterea, we may safely evaluate
         //this in the wrong order
         Object sg = mySlotGuard.subEval(ctx, true);
-        SlotGuard slotGuard = (SlotGuard) E.as(sg, SlotGuard.class);
+        SlotGuard slotGuard = (SlotGuard)E.as(sg, SlotGuard.class);
         Slot slot = slotGuard.makeSlot(specimen, optEjector);
         myNoun.initSlot(ctx, slot);
     }



1.19      +6 -4      e/src/jsrc/org/erights/e/elang/interp/Help.java

Index: Help.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/interp/Help.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Help.java	2001/11/09 01:17:21	1.18
+++ Help.java	2001/11/10 19:40:41	1.19
@@ -18,10 +18,11 @@
 
 Contributor(s): ______________________________________.
 */
+
 import org.erights.e.develop.format.StringHelper;
 import org.erights.e.elib.base.MessageDesc;
-import org.erights.e.elib.eio.TextWriter;
 import org.erights.e.elib.base.TypeDesc;
+import org.erights.e.elib.eio.TextWriter;
 import org.erights.e.elib.eio.UnQuote;
 import org.erights.e.elib.prim.E;
 import org.erights.e.elib.ref.Ref;
@@ -31,7 +32,6 @@
 import java.io.StringWriter;
 
 
-
 /**
  * Implements the E help command
  *
@@ -42,7 +42,8 @@
     /**
      *
      */
-    public Help() {}
+    public Help() {
+    }
 
     /**
      * Return name prefixed by "a " or "an " according to a simple (and
@@ -86,7 +87,8 @@
               = (MessageDesc[])mTypeMap.getValues();
             for (int i = 0; i < mTypes.length; i++) {
                 MessageDesc mType = mTypes[i];
-                if (mType.getVerb().indexOf('(') == -1) { //XXX hack
+                if (mType.getVerb().indexOf('(') == -1) {
+                    //XXX hack
                     mType.printHelpOn(out.indent());
                 }
             }



1.13      +28 -21    e/src/jsrc/org/erights/e/elang/interp/InteractiveInterp.java

Index: InteractiveInterp.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/interp/InteractiveInterp.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- InteractiveInterp.java	2001/11/09 01:17:21	1.12
+++ InteractiveInterp.java	2001/11/10 19:40:41	1.13
@@ -31,12 +31,12 @@
 import org.erights.e.elang.syntax.LineFeeder;
 import org.erights.e.elang.syntax.NeedMoreException;
 import org.erights.e.elib.eio.TextWriter;
-import org.erights.e.elib.prim.Runner;
-import org.erights.e.elib.prim.FERunner;
 import org.erights.e.elib.prim.E;
+import org.erights.e.elib.prim.FERunner;
+import org.erights.e.elib.prim.Runner;
+import org.erights.e.elib.ref.ExternalRef;
 import org.erights.e.elib.ref.Ref;
 import org.erights.e.elib.ref.Resolver;
-import org.erights.e.elib.ref.ExternalRef;
 import org.erights.e.elib.tables.ConstList;
 import org.erights.e.elib.tables.ConstMap;
 import org.erights.e.elib.tables.Twine;
@@ -77,20 +77,29 @@
     }
 
     private ConstList myArgs;
+
     private ConstMap myProps;
+
     private TextWriter myOuts;
+
     private TextWriter myErrs;
 
     private ExternalRef myFarSelf;
+
     private EParser myParser;
+
     private Scope myTopScope;
 
     private boolean myExpandFlag = false;
+
     private boolean myVerboseFlag = false;
 
     private Object myTopLock = new Object();
+
     private boolean myShouldBlock = false;
+
     private boolean myShouldExit = false;
+
     private Throwable myOptProblem = null;
 
     private Object[] myResults = new Object[10];
@@ -115,8 +124,7 @@
                               Scope topScope,
 
                               boolean expandFlag,
-                              boolean verboseFlag)
-    {
+                              boolean verboseFlag) {
         myArgs = args;
         myProps = props;
         myOuts = outs;
@@ -243,7 +251,7 @@
                                          LineFeeder optLineFeeder,
                                          Scope optTopScope,
                                          boolean partialFlag)
-    throws IOException, AlreadyDefinedException {
+      throws IOException, AlreadyDefinedException {
         if (optLineFeeder == null) {
             BufferedReader ins = PrintStreamWriter.in();
             optLineFeeder = new FileFeeder("", ins, outs);
@@ -291,7 +299,7 @@
      *
      */
     public void blockAtTop() {
-        synchronized(myTopLock) {
+        synchronized (myTopLock) {
             myShouldBlock = true;
         }
     }
@@ -300,7 +308,7 @@
      *
      */
     public void continueAtTop() {
-        synchronized(myTopLock) {
+        synchronized (myTopLock) {
             myShouldBlock = false;
             myTopLock.notifyAll();
         }
@@ -311,7 +319,7 @@
      * with interpreter exiting.
      */
     public void exitAtTop(Throwable optProblem) {
-        synchronized(myTopLock) {
+        synchronized (myTopLock) {
             myShouldBlock = false;
             myShouldExit = true;
             myOptProblem = optProblem;
@@ -409,7 +417,7 @@
                 ExceptionMgr.reportException(iox);
                 throw ExceptionMgr.asSafe(iox);
             }
-            synchronized(myTopLock) {
+            synchronized (myTopLock) {
                 while (myShouldBlock) {
                     try {
                         myTopLock.wait();
@@ -454,10 +462,9 @@
      *
      */
     static public void main(String[] argArray)
-    throws IOException, AlreadyDefinedException,
-           UnsupportedLookAndFeelException, ClassNotFoundException,
-           InstantiationException, IllegalAccessException
-    {
+      throws IOException, AlreadyDefinedException,
+      UnsupportedLookAndFeelException, ClassNotFoundException,
+      InstantiationException, IllegalAccessException {
         ConstList args = ConstList.fromArray(argArray);
         Properties sysProps = System.getProperties();
         TextWriter outs = new TextWriter(PrintStreamWriter.out(), true);
@@ -480,10 +487,10 @@
                 int equals = option.indexOf('=');
                 if (equals == -1) {
                     throw new IllegalArgumentException(
-                        "Property spec missing '=': " + option);
+                      "Property spec missing '=': " + option);
                 }
-                String name = option.substring(2,equals);
-                String value = option.substring(equals+1);
+                String name = option.substring(2, equals);
+                String value = option.substring(equals + 1);
                 sysProps.setProperty(name, value);
 
             } else if ("--interact".equals(option)) {
@@ -491,7 +498,7 @@
 
             } else {
                 throw new IllegalArgumentException(
-                    "Unrecognized option: " + option);
+                  "Unrecognized option: " + option);
             }
         }
 
@@ -512,7 +519,7 @@
             Enumeration iter = eprops.propertyNames();
             while (iter.hasMoreElements()) {
                 String key = (String)iter.nextElement();
-                if (! sysProps.containsKey(key)) {
+                if (!sysProps.containsKey(key)) {
                     sysProps.setProperty(key, eprops.getProperty(key));
                 }
             }
@@ -536,8 +543,8 @@
                                             errs,
 
                                             FERunner.THE_ONE,
-                                            null,   //optLineFeeder
-                                            null,   //optTopScope
+                                            null, //optLineFeeder
+                                            null, //optTopScope
                                             false); //partialFlag
         } catch (Throwable th) {
             Interp.reportProblem(th, errs, true);



1.76      +58 -54    e/src/jsrc/org/erights/e/elang/interp/Interp.java

Index: Interp.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/interp/Interp.java,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- Interp.java	2001/11/09 01:17:21	1.75
+++ Interp.java	2001/11/10 19:40:41	1.76
@@ -31,13 +31,13 @@
 import org.erights.e.elang.syntax.FileFeeder;
 import org.erights.e.elang.syntax.LineFeeder;
 import org.erights.e.elib.eio.TextWriter;
-import org.erights.e.elib.prim.Runner;
-import org.erights.e.elib.prim.FERunner;
 import org.erights.e.elib.prim.BERunner;
 import org.erights.e.elib.prim.E;
+import org.erights.e.elib.prim.FERunner;
+import org.erights.e.elib.prim.Runner;
+import org.erights.e.elib.ref.ExternalRef;
 import org.erights.e.elib.ref.Ref;
 import org.erights.e.elib.ref.Resolver;
-import org.erights.e.elib.ref.ExternalRef;
 import org.erights.e.elib.tables.ConstList;
 import org.erights.e.elib.tables.ConstMap;
 import org.erights.e.elib.tables.Twine;
@@ -66,47 +66,56 @@
 public class Interp implements Interpreter, InterpLoop, Runnable {
 
     static private final String USAGE =
-"usage: either\n" +
-"  java [java-options] interp [interp-options] script [args...]\n" +
-"    (where 'interp' is 'org.erights.e.elang.interp.Interp')\n" +
-"  java -jar [java-options] ehome/e.jar [interp-options] script [args...]\n" +
-"    (where 'ehome' is the directory where E is installed)\n" +
-"  e [e-options] script [args...]\n" +
-"\n" +
-"For java-options, consult 'java -help'\n" +
-"For e-options, consult 'e --help'\n" +
-"interp-options are:\n" +
-"  -D<name>=<value>     Defines property.  Redundant with java-option,\n" +
-"                       but provided for environments (like Cafe) in\n" +
-"                       which it's difficult to provide java-options.\n" +
-"  --help               Prints this text.\n" +
-"script is one of\n" +
-"  filename.e           The E script file to execute\n" +
-"  -                    Use stdin as script file\n" +
-"  --interact           An interactive command line\n";
+      "usage: either\n" +
+      "  java [java-options] interp [interp-options] script [args...]\n" +
+      "    (where 'interp' is 'org.erights.e.elang.interp.Interp')\n" +
+      "  java -jar [java-options] ehome/e.jar [interp-options] script [args...]\n" +
+      "    (where 'ehome' is the directory where E is installed)\n" +
+      "  e [e-options] script [args...]\n" +
+      "\n" +
+      "For java-options, consult 'java -help'\n" +
+      "For e-options, consult 'e --help'\n" +
+      "interp-options are:\n" +
+      "  -D<name>=<value>     Defines property.  Redundant with java-option,\n" +
+      "                       but provided f