butek       02/03/14 17:14:11

  Modified:    java/src/org/apache/axis Message.java
                        NoEndPointException.java Part.java SOAPPart.java
               java/src/org/apache/axis/attachments AttachmentUtils.java
                        AttachmentsImpl.java BoundaryDelimitedStream.java
                        ManagedMemoryDataSource.java MimeUtils.java
                        MultiPartRelatedInputStream.java
               java/src/org/apache/axis/client Call.java
               java/src/org/apache/axis/configuration FileProvider.java
               java/src/org/apache/axis/deployment/wsdd
                        WSDDTargetedChain.java
               java/src/org/apache/axis/encoding/ser
                        JAFDataHandlerDeserializer.java
                        JAFDataHandlerDeserializerFactory.java
               java/src/org/apache/axis/utils RB.java resources.properties
               java/src/org/apache/axis/utils/compiler CompilerFactory.java
                        Javac.java Jikes.java
               java/src/org/apache/axis/wsdl/toJava
                        JavaComplexTypeWriter.java JavaStubWriter.java
  Log:
  Moved a whole bunch of English-language strings into resources.properties.
  Changed some styles so that the code better complies with the Java coding
  standard (there's a LOT of code out there that DOES NOT comply!)
  
  Revision  Changes    Path
  1.65      +2 -2      xml-axis/java/src/org/apache/axis/Message.java
  
  Index: Message.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Message.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- Message.java      27 Feb 2002 13:06:11 -0000      1.64
  +++ Message.java      15 Mar 2002 01:14:09 -0000      1.65
  @@ -232,8 +232,8 @@
               }
           }
   
  -        log.debug("Attachment support is enabled" + 
  -                       attachmentSupportEnabled);
  +        log.debug(JavaUtils.getMessage("attachEnabled") + "  " +
  +                attachmentSupportEnabled);
           return attachmentSupportEnabled;
       }
   
  
  
  
  1.5       +3 -1      xml-axis/java/src/org/apache/axis/NoEndPointException.java
  
  Index: NoEndPointException.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/NoEndPointException.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NoEndPointException.java  3 Dec 2001 22:49:22 -0000       1.4
  +++ NoEndPointException.java  15 Mar 2002 01:14:09 -0000      1.5
  @@ -54,6 +54,8 @@
    */
   package org.apache.axis;
   
  +import org.apache.axis.utils.JavaUtils;
  +
   /**
    * @author Russell Butek ([EMAIL PROTECTED])
    */
  @@ -61,6 +63,6 @@
   {
       public NoEndPointException ()
       {
  -        super("Server.NoEndpoint", "No endpoint", null, null);
  +        super("Server.NoEndpoint", JavaUtils.getMessage("noEndpoint"), null, null);
       } // ctor
   } // class NoEndPointException
  
  
  
  1.7       +12 -8     xml-axis/java/src/org/apache/axis/Part.java
  
  Index: Part.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Part.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Part.java 27 Feb 2002 13:06:11 -0000      1.6
  +++ Part.java 15 Mar 2002 01:14:09 -0000      1.7
  @@ -104,17 +104,21 @@
        */
       public void addMimeHeader (String header, String value) {
   
  -        if(null == header) throw new IllegalArgumentException
  -            ("Header may not be null!");
  +        if(null == header) {
  +            throw new 
IllegalArgumentException(JavaUtils.getMessage("headerNotNull"));
  +        }
   
  -        header= header.trim();    
  +        header = header.trim();
   
  -        if(header.length() == 0)
  -            throw new IllegalArgumentException ("Header may not be empty!");
  -
  -        if(null == value) throw new IllegalArgumentException
  -            ("Header value may not be null!");
  +        if(header.length() == 0) {
  +            throw new IllegalArgumentException(
  +                    JavaUtils.getMessage("headerNotEmpty"));
  +        }
   
  +        if(null == value) {
  +            throw new IllegalArgumentException(
  +                    JavaUtils.getMessage("headerValueNotNull"));
  +        }
           headers.put(header.toLowerCase(), value);
       }
   
  
  
  
  1.16      +19 -19    xml-axis/java/src/org/apache/axis/SOAPPart.java
  
  Index: SOAPPart.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/SOAPPart.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SOAPPart.java     12 Mar 2002 19:04:21 -0000      1.15
  +++ SOAPPart.java     15 Mar 2002 01:14:09 -0000      1.16
  @@ -146,7 +146,7 @@
               form = FORM_FAULT;
           }
           if (log.isDebugEnabled()) {
  -            log.debug( "Enter SOAPPart ctor ("+formNames[form]+")" );
  +            log.debug(JavaUtils.getMessage("enter00", "SOAPPart ctor(" + 
formNames[form] + ")"));
           }
           setCurrentMessage(initialContents, form);
       }
  @@ -249,9 +249,8 @@
        */
       private void setCurrentMessage(Object currMsg, int form) {
           if (log.isDebugEnabled()) {
  -            log.debug( "Setting current message form to: " +
  -                        formNames[form] +" (currentMessage is now " +
  -                        currMsg + ")" );
  +            log.debug(JavaUtils.getMessage("setMsgForm", formNames[form],
  +                    "" + currMsg));
           }
           currentMessage = currMsg ;
           currentForm = form ;
  @@ -262,9 +261,9 @@
        * array.  This will force buffering of the message.
        */
       public byte[] getAsBytes() throws AxisFault {
  -    log.debug( "Enter: SOAPPart::getAsBytes" );
  +    log.debug(JavaUtils.getMessage("enter00", "SOAPPart::getAsBytes"));
           if ( currentForm == FORM_BYTES ) {
  -            log.debug( "Exit: SOAPPart::getAsBytes" );
  +            log.debug(JavaUtils.getMessage("exit00", "SOAPPart::getAsBytes"));
               return (byte[])currentMessage;
           }
   
  @@ -291,13 +290,13 @@
                   // byte[]  buf = new byte[ len ];
                   // inp.read( buf );
                   setCurrentMessage( buf, FORM_BYTES );
  -                log.debug( "Exit: SOAPPart::getAsByes" );
  +                log.debug(JavaUtils.getMessage("exit00", "SOAPPart::getAsBytes"));
                   return (byte[])currentMessage;
               }
               catch( Exception e ) {
                   log.error(JavaUtils.getMessage("exception00"), e);
               }
  -            log.debug( "Exit: SOAPPart::getAsByes" );
  +            log.debug(JavaUtils.getMessage("exit00", "SOAPPart::getAsBytes"));
               return null;
           }
   
  @@ -318,13 +317,13 @@
                  setCurrentMessage( ((String)currentMessage).getBytes(),
                                  FORM_BYTES );
               }
  -            log.debug( "Exit: SOAPPart::getAsBytes" );
  +            log.debug(JavaUtils.getMessage("exit00", "SOAPPart::getAsBytes"));
               return (byte[])currentMessage;
           }
   
           log.error(JavaUtils.getMessage("cantConvert00", ""+currentForm));
   
  -        log.debug( "Exit: SOAPPart::getAsBytes" );
  +        log.debug(JavaUtils.getMessage("exit00", "SOAPPart::getAsBytes"));
           return null;
   
       }
  @@ -334,10 +333,10 @@
        * This will force buffering of the message.
        */
       public String getAsString() throws AxisFault {
  -        log.debug( "Enter: SOAPPart::getAsString" );
  +        log.debug(JavaUtils.getMessage("enter00", "SOAPPart::getAsString"));
           if ( currentForm == FORM_STRING ) {
  -            log.debug( "Exit: SOAPPart::getAsString, currentMessage is "+
  -                            currentMessage );
  +            log.debug(JavaUtils.getMessage("exitCurrMsg",
  +                    "SOAPPart::getAsString", "" + currentMessage));
               return (String)currentMessage;
           }
   
  @@ -355,8 +354,8 @@
               setCurrentMessage( new String((byte[]) currentMessage),
                                  FORM_STRING );
                           }
  -            log.debug( "Exit: SOAPPart::getAsString, currentMessage is "+
  -                            currentMessage );
  +            log.debug(JavaUtils.getMessage("exitCurrMsg",
  +                    "SOAPPart::getAsString", "" + currentMessage));
               return (String)currentMessage;
           }
   
  @@ -387,7 +386,7 @@
   
           log.error( JavaUtils.getMessage("cantConvert01", ""+currentForm));
   
  -        log.debug( "Exit: SOAPPart::getAsString" );
  +        log.debug(JavaUtils.getMessage("exit00", "SOAPPart::getAsString"));
           return null;
       }
   
  @@ -399,8 +398,8 @@
       public SOAPEnvelope getAsSOAPEnvelope()
           throws AxisFault
       {
  -        log.debug( "Enter: SOAPPart::getAsSOAPEnvelope; currentForm is "+
  -                        formNames[currentForm] );
  +        log.debug(JavaUtils.getMessage("enter00", "SOAPPart::getAsSOAPEnvelope")
  +                + JavaUtils.getMessage("currForm", formNames[currentForm]));
   
           if ( currentForm == FORM_SOAPENVELOPE )
               return (SOAPEnvelope)currentMessage;
  @@ -435,7 +434,8 @@
           }
   
           setCurrentMessage(dser.getEnvelope(), FORM_SOAPENVELOPE);
  -        log.debug( "Exit: SOAPPart::getAsSOAPEnvelope" );
  +        log.debug(JavaUtils.getMessage(
  +                "exit00", "SOAPPart::getAsSOAPEnvelope"));
           return (SOAPEnvelope)currentMessage;
       }
   
  
  
  
  1.4       +4 -4      
xml-axis/java/src/org/apache/axis/attachments/AttachmentUtils.java
  
  Index: AttachmentUtils.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/attachments/AttachmentUtils.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AttachmentUtils.java      17 Nov 2001 00:06:50 -0000      1.3
  +++ AttachmentUtils.java      15 Mar 2002 01:14:10 -0000      1.4
  @@ -57,6 +57,7 @@
   import javax.activation.DataHandler;
   import org.apache.axis.Part;
   import org.apache.axis.AxisFault;
  +import org.apache.axis.utils.JavaUtils;
   
   
   /**
  @@ -76,13 +77,12 @@
   
       public static DataHandler getActiviationDataHandler(Part part) throws AxisFault{
          if( null == part) {
  -        throw new AxisFault("getActiviationDataHandler received a null parameter as 
a part.");
  +        throw new AxisFault(JavaUtils.getMessage("gotNullPart"));
          }
   
          if(!( part instanceof AttachmentPart)){
  -        throw new AxisFault( "Unsupported attachment type \"" +
  -          part.getClass().getName()
  -         + "\" only supporting \"" + AttachmentPart.class.getName() +"\".");
  +        throw new AxisFault(JavaUtils.getMessage("unsupportedAttach",
  +                part.getClass().getName(), AttachmentPart.class.getName()));
          }
          return ((AttachmentPart) part).getActiviationDataHandler();
       }
  
  
  
  1.13      +9 -10     
xml-axis/java/src/org/apache/axis/attachments/AttachmentsImpl.java
  
  Index: AttachmentsImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/attachments/AttachmentsImpl.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- AttachmentsImpl.java      27 Feb 2002 13:06:11 -0000      1.12
  +++ AttachmentsImpl.java      15 Mar 2002 01:14:10 -0000      1.13
  @@ -62,6 +62,7 @@
   import org.apache.axis.Message;
   import org.apache.axis.Part;
   import org.apache.axis.SOAPPart;
  +import org.apache.axis.utils.JavaUtils;
   import javax.activation.DataHandler;
   import javax.activation.DataSource;
   
  @@ -201,10 +202,9 @@
               throws org.apache.axis.AxisFault {
                   mergeinAttachments();
           if (!(datahandler instanceof javax.activation.DataHandler)) {
  -            throw new org.apache.axis.AxisFault("Unsupported attachment type \"" + 
  -                                                datahandler.getClass().getName() +
  -                                                "\" only supporting \"" + 
  -                                                
javax.activation.DataHandler.class.getName() + "\".");
  +            throw new org.apache.axis.AxisFault(JavaUtils.getMessage(
  +                    "unsupportedAttach", datahandler.getClass().getName(),
  +                    javax.activation.DataHandler.class.getName()));
           }
           Part ret = new AttachmentPart((javax.activation.DataHandler)datahandler);
           addAttachmentPart(ret);
  @@ -287,12 +287,11 @@
        * Sets the root part of this multipart block
        */
       public void setRootPart(Part newRoot){
  -                try{
  -                        this.soapPart=(SOAPPart)newRoot;
  -                }catch(ClassCastException e){
  -                        throw new ClassCastException("This attachment 
implementation "+
  -                                  "accepts only SOAPPart objects as root part.");
  -                }
  +        try {
  +            this.soapPart=(SOAPPart)newRoot;
  +        } catch(ClassCastException e) {
  +            throw new ClassCastException(JavaUtils.getMessage("onlySOAPParts"));
  +        }
       }
   
   
  
  
  
  1.8       +21 -15    
xml-axis/java/src/org/apache/axis/attachments/BoundaryDelimitedStream.java
  
  Index: BoundaryDelimitedStream.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/attachments/BoundaryDelimitedStream.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BoundaryDelimitedStream.java      22 Feb 2002 23:39:43 -0000      1.7
  +++ BoundaryDelimitedStream.java      15 Mar 2002 01:14:10 -0000      1.8
  @@ -55,6 +55,8 @@
   
   package org.apache.axis.attachments;
   
  +import org.apache.axis.utils.JavaUtils;
  +
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -88,8 +90,7 @@
   
       static int streamCount= 0; //number of streams produced.
       protected synchronized static int newStreamNo(){
  -
  -     log.debug("New boundary stream no:" + (streamCount +1));
  +     log.debug(JavaUtils.getMessage("streamNo", "" + (streamCount + 1)));
           return ++streamCount;
       }
       protected int streamNo=-1; //Keeps track of stream
  @@ -173,13 +174,20 @@
   
       public synchronized int read(byte[] b, final int off, final int len)
                                                   throws java.io.IOException {
  -        if (closed) throw new java.io.IOException("Stream closed.");
  -        if (eos) return -1;
  +        if (closed) {
  +            throw new java.io.IOException(JavaUtils.getMessage("streamClosed"));
  +        }
  +        if (eos) {
  +            return -1;
  +        }
   
           if (readbuf == null) { //Allocate the buffer.
               readbuf = new byte[Math.max(len, readbufsz ) ];
               readBufEnd = is.read(readbuf);
  -            if( readBufEnd < 0) throw new java.io.IOException( "End of stream 
encountered before final boundary marker."); 
  +            if( readBufEnd < 0) {
  +                throw new java.io.IOException(
  +                        JavaUtils.getMessage("eosBeforeMarker"));
  +            }
               readBufPos = 0;
                                                          //Finds the boundary pos.
               boundaryPos = boundaryPosition( readbuf, 0, readBufEnd);
  @@ -200,7 +208,7 @@
               }
               if (readBufPos == boundaryPos) {
                   eos = true; //hit the boundary so it the end of the stream.
  -                log.debug("Boundary stream no:" + streamNo + " is at end of 
stream");
  +                log.debug(JavaUtils.getMessage("atEOS", "" + streamNo));
               }
               else if ( bwritten < len) { //need to get more data.
                   byte[]dstbuf = readbuf;
  @@ -213,7 +221,10 @@
                   //Read in the new data.
                   int readcnt = is.read(dstbuf, movecnt, dstbuf.length - movecnt);
                   
  -                if( readcnt < 0) throw new java.io.IOException( "End of stream 
encountered before final boundary marker."); 
  +                if( readcnt < 0) {
  +                    throw new java.io.IOException(
  +                            JavaUtils.getMessage("eosBeforeMarker"));
  +                }
   
                   readBufEnd = readcnt + movecnt;
                   readbuf = dstbuf;
  @@ -233,13 +244,8 @@
                   byte tb[] = new byte[bwritten];
   
                   System.arraycopy(b, off, tb, 0, bwritten);
  -                log.debug("Read " + bwritten +
  -                " from BoundaryDelimitedStream:"+ streamNo+"\"" + 
  -                new String(tb) + "\"");
  -                
  -//    log.debug("Read " + bwritten +
  -//              " from BoundaryDelimitedStream:"+ streamNo+"\"" + 
  -//              new String(tb) + "\"");
  +                log.debug(JavaUtils.getMessage("readBStream", new String[]
  +                        {"" + bwritten, "" + streamNo, new String(tb)}));
               }
           }
   
  @@ -274,7 +280,7 @@
        */
       public synchronized void close() throws java.io.IOException {
           if (closed) return;
  -        log.debug("Boundary stream no:" + streamNo + " is closed");
  +        log.debug(JavaUtils.getMessage("bStreamClosed", "" + streamNo));
           closed = true; //mark it closed.
           if (!eos) { //We need get this off the stream.
                                   //Easy way to flush through the stream;
  
  
  
  1.12      +122 -56   
xml-axis/java/src/org/apache/axis/attachments/ManagedMemoryDataSource.java
  
  Index: ManagedMemoryDataSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/attachments/ManagedMemoryDataSource.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ManagedMemoryDataSource.java      25 Feb 2002 17:38:14 -0000      1.11
  +++ ManagedMemoryDataSource.java      15 Mar 2002 01:14:10 -0000      1.12
  @@ -126,13 +126,12 @@
           this.ss = ss;
           this.maxCached = maxCached;
           if (null != contentType && contentType.length() != 0 ) this.contentType = 
contentType;
  -        if ( maxCached < MAX_MEMORY_DISK_CACHED)
  -            throw  new IllegalArgumentException(" maxcached value is bad: " +
  -                                                                   maxCached);
  -
  -                                                                   
  -        if ( log.isDebugEnabled()){
  -          debugEnabled= true; //Logging should be initialized by time;
  +        if ( maxCached < MAX_MEMORY_DISK_CACHED) {
  +            throw new IllegalArgumentException(
  +                    JavaUtils.getMessage("badMaxCached", "" + maxCached));
  +        }
  +        if (log.isDebugEnabled()) {
  +            debugEnabled= true; //Logging should be initialized by time;
           }
   
           //for now read all in to disk.
  @@ -225,7 +224,9 @@
   
       protected synchronized  void  write( byte[] data, int length)
         throws java.io.IOException {
  -        if (closed) throw new java.io.IOException("Stream closed stream.");
  +        if (closed) {
  +            throw new java.io.IOException(JavaUtils.getMessage("streamClosed"));
  +        }
           int writesz = length;
           int byteswritten = 0;
   
  @@ -310,7 +311,8 @@
          java.util.LinkedList ml=memorybuflist;
          memorybuflist =null;
   
  -       log.debug("flushToDisk maximum cached " + maxCached +", total memory " +  
totalsz + "." );
  +       log.debug(JavaUtils.getMessage(
  +               "maxCached", "" + maxCached, "" +  totalsz));
   
          if( ml != null){
              if (null == cachediskstream) { //Need to create a disk cache
  @@ -319,7 +321,8 @@
                       String attdir= mc == null ? null :  
mc.getStrProp(MessageContext.ATTACHMENTS_DIR );
                       diskCacheFile = java.io.File.createTempFile("Axis", "axis",
                          attdir== null ? null : new File( attdir)); 
  -                    log.debug("Disk cache file name \"" + diskCacheFile 
.getAbsolutePath()+ "\".");
  +                    log.debug(JavaUtils.getMessage(
  +                            "diskCache", diskCacheFile.getAbsolutePath()));
                       cachediskstream = new java.io.BufferedOutputStream(
                            new java.io.FileOutputStream(diskCacheFile));
                       int listsz = ml.size();
  @@ -404,18 +407,28 @@
   
   
           protected Instream() throws java.io.IOException{
  -             if(deleted) throw new java.io.IOException("Resource has been 
deleted.");
  +            if (deleted) {
  +                throw new java.io.IOException(
  +                        JavaUtils.getMessage("resourceDeleted"));
  +            }
               readers.put( this, null);
           }
   
           public int available() throws java.io.IOException {
   
  -            if(deleted) throw new java.io.IOException("Resource has been deleted.");
  -            if(readClosed) throw new java.io.IOException("Stream is closed.");
  -
  +            if (deleted) {
  +                throw new java.io.IOException(
  +                        JavaUtils.getMessage("resourceDeleted"));
  +            }
  +            if (readClosed) {
  +                throw new java.io.IOException(
  +                        JavaUtils.getMessage("streamClosed"));
  +            }
               int ret= totalsz - bread;
   
  -            if(debugEnabled) is_log.debug("available()= "+ ret + ".");
  +            if (debugEnabled) {
  +                is_log.debug("available() = " + ret + ".");
  +            }
   
               return ret;
           }
  @@ -437,7 +450,9 @@
            * Not supported.
            */
           public boolean markSupported() {
  -            if(debugEnabled) is_log.debug("markSupported()= "+ false + ".");
  +            if (debugEnabled) {
  +                is_log.debug("markSupported() = " + false + ".");
  +            }
               return false;
           }
   
  @@ -445,15 +460,19 @@
            * Not supported.
            */
           public void mark(int readlimit){
  -            if(debugEnabled) is_log.debug("mark()");
  +            if (debugEnabled) {
  +                is_log.debug("mark()");
  +            }
           }
   
           /**
            * Not supported.
            */
           public void reset() throws java.io.IOException {
  -            if(debugEnabled) is_log.debug("reset()");
  -            throw new java.io.IOException("Reset and mark not supported!");
  +            if (debugEnabled) {
  +                is_log.debug("reset()");
  +            }
  +            throw new java.io.IOException(JavaUtils.getMessage("noResetMark"));
           }
   
           /**
  @@ -463,11 +482,18 @@
   
           public long skip(long skipped) throws java.io.IOException {
   
  -            if(debugEnabled) is_log.debug("skip(" +skipped+ ").");
  -
  -            if(deleted) throw new java.io.IOException("Resource has been deleted.");
  -            if(readClosed) throw new java.io.IOException("Stream is closed.");
  +            if (debugEnabled) {
  +                is_log.debug("skip(" + skipped + ").");
  +            }
   
  +            if (deleted) {
  +                throw new java.io.IOException(
  +                        JavaUtils.getMessage("resourceDeleted"));
  +            }
  +            if (readClosed) {
  +                throw new java.io.IOException(
  +                        JavaUtils.getMessage("streamClosed"));
  +            }
               if ( skipped < 1) return 0; //nothing to skip.
   
   
  @@ -500,7 +526,9 @@
                   bread += skipped;
               }
   
  -            if(debugEnabled) is_log.debug("skipped " +skipped+ ".");
  +            if (debugEnabled) {
  +                is_log.debug("skipped " + skipped + ".");
  +            }
               return skipped;
           }
   
  @@ -512,27 +540,47 @@
            */
   
           public int read(byte[] b, int off, int len) throws java.io.IOException {
  -            if(debugEnabled) is_log.debug(hashCode() + "read(" + off + ", " + len 
+")");
  -            if(deleted) throw new java.io.IOException("Resource has been deleted.");
  -            if(readClosed) throw new java.io.IOException("Stream is closed.");
  -            if (b == null) throw new InternalException(
  -                 "input buffer is null");
  -            if (off < 0)  throw new IndexOutOfBoundsException
  -                ("Offset is negative: " + off);
  -            if (len < 0)  throw new IndexOutOfBoundsException("Length: " + len);
  -            if (len + off > b.length) throw new IndexOutOfBoundsException(
  -                     "Write beyond buffer");
  -            if (len == 0) return 0;
  +            if (debugEnabled) {
  +                is_log.debug(this.hashCode() + " read(" + off + ", " + len +")");
  +            }
  +            if (deleted) {
  +                throw new java.io.IOException(
  +                        JavaUtils.getMessage("resourceDeleted"));
  +            }
  +            if (readClosed) {
  +                throw new java.io.IOException(
  +                        JavaUtils.getMessage("streamClosed"));
  +            }
  +            if (b == null) {
  +                throw new InternalException(JavaUtils.getMessage("nullInput"));
  +            }
  +            if (off < 0)  {
  +                throw new IndexOutOfBoundsException(
  +                        JavaUtils.getMessage("negOffset", "" + off));
  +            }
  +            if (len < 0) {
  +                throw new IndexOutOfBoundsException(
  +                        JavaUtils.getMessage("length", "" + len));
  +            }
  +            if (len + off > b.length) {
  +                throw new IndexOutOfBoundsException(
  +                        JavaUtils.getMessage("writeBeyond"));
  +            }
  +            if (len == 0) {
  +                return 0;
  +            }
   
               int bwritten = 0;
   
               synchronized(ManagedMemoryDataSource.this){
  -                if ( bread == totalsz) return -1;
  +                if (bread == totalsz) {
  +                    return -1;
  +                }
                   java.util.List ml = memorybuflist;
  -                 len = Math.min(len, totalsz - bread); //Only return the number of 
bytes in the data store that is left.
  -                 if(debugEnabled) is_log.debug("len= " + len);                 
  -
  -
  +                len = Math.min(len, totalsz - bread); //Only return the number of 
bytes in the data store that is left.
  +                if (debugEnabled) {
  +                    is_log.debug("len = " + len);
  +                }
                   if ( ml != null) {
                       if ( null == currentBuf ) { //Get the buffer we need to read 
from.
                           currentBuf = (byte[]) ml.get(currentIndex);
  @@ -556,31 +604,49 @@
                       while ( bwritten < len);
                   }
   
  -                    if (bwritten == 0 && null != diskCacheFile) {
  -                    if(debugEnabled) is_log.debug("reading from disk" + len);       
          
  -                    if (null == fin ) { //we are now reading from disk.
  -                    if(debugEnabled) is_log.debug("open bread=" + 
diskCacheFile.getCanonicalPath());                 
  -                    if(debugEnabled) is_log.debug("open bread=" + bread);           
      
  +                if (bwritten == 0 && null != diskCacheFile) {
  +                    if (debugEnabled) {
  +                        is_log.debug(JavaUtils.getMessage("reading", "" + len));
  +                    }
  +                    if (null == fin) { //we are now reading from disk.
  +                        if (debugEnabled) {
  +                            is_log.debug(JavaUtils.getMessage("openBread",
  +                                    diskCacheFile.getCanonicalPath()));
  +                        }
  +                        if (debugEnabled) {
  +                            is_log.debug(JavaUtils.getMessage("openBread",
  +                                    "" + bread));
  +                        }                 
                           fin = new java.io.FileInputStream( diskCacheFile);
  -                        if(bread >0) fin.skip(bread); //Skip what we've read so far.
  +                        if (bread >0) {
  +                            fin.skip(bread); //Skip what we've read so far.
  +                        }
                       }
   
  -                    if(cachediskstream  != null){
  -                        if(debugEnabled) is_log.debug("flushing");                 
  +                    if (cachediskstream != null) {
  +                        if (debugEnabled) {
  +                            is_log.debug(JavaUtils.getMessage("flushing"));
  +                        }                 
                           cachediskstream.flush();  
                       }
   
  -                   if(debugEnabled){ is_log.debug("flushing");                 
  -                       is_log.debug("len=" + len);                 
  -                       is_log.debug("off=" + off);                 
  -                       is_log.debug("b.length=" + b.length);                 
  -                    }
  -                    bwritten = fin.read(b, off, len);
  +                   if (debugEnabled) {
  +                       is_log.debug(JavaUtils.getMessage("flushing"));
  +                       is_log.debug("len=" + len);
  +                       is_log.debug("off=" + off);
  +                       is_log.debug("b.length=" + b.length);
  +                   }
  +                   bwritten = fin.read(b, off, len);
  +                }
  +                if (bwritten > 0) {
  +                    bread += bwritten;
                   }
  -                if ( bwritten > 0) bread += bwritten;
               }
   
  -            if(debugEnabled) is_log.debug( hashCode() +"read " + bwritten);
  +            if (debugEnabled) {
  +                is_log.debug(this.hashCode()
  +                        + JavaUtils.getMessage("read", "" + bwritten));
  +            }
               return bwritten;
           }
   
  
  
  
  1.12      +4 -2      xml-axis/java/src/org/apache/axis/attachments/MimeUtils.java
  
  Index: MimeUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/attachments/MimeUtils.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MimeUtils.java    27 Feb 2002 13:06:11 -0000      1.11
  +++ MimeUtils.java    15 Mar 2002 01:14:10 -0000      1.12
  @@ -131,8 +131,10 @@
                   javax.activation.FileDataSource fdh = 
(javax.activation.FileDataSource) ds;
                   java.io.File df = fdh.getFile();
   
  -                if (!df.exists())
  -                    throw new RuntimeException( "File for dataHandler does not 
exist" + df.getAbsolutePath());
  +                if (!df.exists()) {
  +                    throw new RuntimeException(
  +                            JavaUtils.getMessage("noFile", df.getAbsolutePath()));
  +                }
                   dataSize = df.length();
               }
               else {
  
  
  
  1.11      +33 -14    
xml-axis/java/src/org/apache/axis/attachments/MultiPartRelatedInputStream.java
  
  Index: MultiPartRelatedInputStream.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/attachments/MultiPartRelatedInputStream.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MultiPartRelatedInputStream.java  22 Feb 2002 23:39:43 -0000      1.10
  +++ MultiPartRelatedInputStream.java  15 Mar 2002 01:14:10 -0000      1.11
  @@ -58,6 +58,7 @@
   import org.apache.axis.attachments.ManagedMemoryDataSource;
   import javax.activation.DataHandler;
   import org.apache.axis.Part;
  +import org.apache.axis.utils.JavaUtils;
   import javax.mail.internet.MimeUtility;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -132,8 +133,9 @@
                   if (!(found = java.util.Arrays.equals(boundaryMarker[current & 
0x1], boundary))) {
                       System.arraycopy(boundaryMarker[current & 0x1], 1, 
boundaryMarker[(current + 1) & 0x1], 0, boundaryMarker[0].length - 1);
                       if ( is.read(boundaryMarker[(current + 1) & 0x1], 
boundaryMarker[0].length - 1, 1) < 1) {
  -                        throw new org.apache.axis.AxisFault( "Error in MIME data 
stream start boundary not found expected:\"" +
  -                                new String(boundary) );
  +                        throw new org.apache.axis.AxisFault(
  +                                JavaUtils.getMessage("mimeErrorNoBoundary",
  +                                new String(boundary)));
                       }
                   }
               }
  @@ -216,7 +218,8 @@
               while ( null != boundaryDelimitedStream &&  rootPartContentId != null 
&& !rootPartContentId.equals( contentId) );
   
               if (boundaryDelimitedStream  == null ) {
  -                throw new org.apache.axis.AxisFault( "Root part containing SOAP 
envelope not found.  contentId=" + rootPartContentId);
  +                throw new org.apache.axis.AxisFault(
  +                        JavaUtils.getMessage("noRoot", rootPartContentId));
               }
   
               soapStreamBDS= boundaryDelimitedStream;
  @@ -227,13 +230,16 @@
           //Read from the input stream all attachments prior to the root part.
           }
           catch (javax.mail.internet.ParseException e) {
  -            throw new org.apache.axis.AxisFault( "Error in parsing mime data stream 
" + e.getMessage());
  +            throw new org.apache.axis.AxisFault(
  +                    JavaUtils.getMessage("mimeErrorParsing", e.getMessage()));
           }
           catch ( java.io.IOException e) {
  -            throw new org.apache.axis.AxisFault( "Error in reading data stream " + 
e.getMessage());
  +            throw new org.apache.axis.AxisFault(
  +                    JavaUtils.getMessage("readError", e.getMessage()));
           }
           catch ( javax.mail.MessagingException e) {
  -            throw new org.apache.axis.AxisFault( "Error in reading data stream " + 
e.getMessage());
  +            throw new org.apache.axis.AxisFault(
  +                    JavaUtils.getMessage("readError", e.getMessage()));
           }
       }
   
  @@ -247,7 +253,9 @@
           if ( null == ret) {
               ret = readTillFound(id);
           }
  -        log.debug("getAttachmentByReference(\"" + id + "\") returns" + (ret == 
null? "null" : ret.toString()));
  +        log.debug(JavaUtils.getMessage("return02",
  +                "getAttachmentByReference(\"" + id + "\"",
  +                (ret == null ? "null" : ret.toString())));
           return ret;
       }
   
  @@ -395,11 +403,17 @@
        */
   
       public int read(byte[] b, int off, int len) throws java.io.IOException {
  -        if (closed) throw new java.io.IOException("Stream closed.");
  -        if (eos) return -1;
  +        if (closed) {
  +            throw new java.io.IOException(JavaUtils.getMessage("streamClosed"));
  +        }
  +        if (eos) {
  +            return -1;
  +        }
           int read = soapStream.read(b, off, len);
   
  -        if (read < 0) eos = true;
  +        if (read < 0) {
  +            eos = true;
  +        }
           return read;
       }
   
  @@ -408,11 +422,16 @@
       }
   
       public int read() throws java.io.IOException {
  -        if (closed) throw new java.io.IOException("Stream closed.");
  -        if (eos) return -1;
  +        if (closed) {
  +            throw new java.io.IOException(JavaUtils.getMessage("streamClosed"));
  +        }
  +        if (eos) {
  +            return -1;
  +        }
           int ret = soapStream.read();
  -
  -        if ( ret < 0) eos = true;
  +        if (ret < 0) {
  +            eos = true;
  +        }
           return ret;
       }
   
  
  
  
  1.95      +7 -4      xml-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
  retrieving revision 1.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- Call.java 14 Mar 2002 04:20:52 -0000      1.94
  +++ Call.java 15 Mar 2002 01:14:10 -0000      1.95
  @@ -1337,8 +1337,10 @@
           if(null != attachmentParts && !attachmentParts.isEmpty()){ 
               try{
               org.apache.axis.attachments.Attachments attachments= 
msg.getAttachments();
  -            if(null == attachments)
  -              throw new RuntimeException("No support for attachments");
  +            if(null == attachments) {
  +              throw new RuntimeException(
  +                      JavaUtils.getMessage("noAttachments"));
  +            }
   
               attachments.setAttachmentParts(attachmentParts);
               }catch(org.apache.axis.AxisFault ex){
  @@ -1737,7 +1739,8 @@
           }
   
           if (log.isDebugEnabled()) {
  -            log.debug("TargetService:" + msgContext.getTargetService());
  +            log.debug(JavaUtils.getMessage("targetService",
  +                    msgContext.getTargetService()));
           }
   
           // set up transport if there is one
  @@ -1756,7 +1759,7 @@
                   reqEnv.output(ctx);
                   writer.close();
               } catch (Exception e) {
  -                log.debug("Exception caught while printing request message", e);
  +                log.debug(JavaUtils.getMessage("exceptionPrinting"), e);
               } finally {
                   log.debug(writer.getBuffer().toString());
               }
  
  
  
  1.25      +2 -2      
xml-axis/java/src/org/apache/axis/configuration/FileProvider.java
  
  Index: FileProvider.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/configuration/FileProvider.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- FileProvider.java 27 Feb 2002 17:13:32 -0000      1.24
  +++ FileProvider.java 15 Mar 2002 01:14:10 -0000      1.25
  @@ -198,8 +198,8 @@
               }
   
               if (myInputStream == null) {
  -                throw new ConfigurationException("No engine configuration " +
  -                                                 "file - aborting!");
  +                throw new ConfigurationException(
  +                        JavaUtils.getMessage("noConfigFile"));
               }
   
               WSDDDocument doc = new WSDDDocument(XMLUtils.
  
  
  
  1.8       +3 -2      
xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDTargetedChain.java
  
  Index: WSDDTargetedChain.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDTargetedChain.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WSDDTargetedChain.java    12 Feb 2002 17:18:28 -0000      1.7
  +++ WSDDTargetedChain.java    15 Mar 2002 01:14:10 -0000      1.8
  @@ -59,6 +59,7 @@
   import org.apache.axis.EngineConfiguration;
   import org.apache.axis.ConfigurationException;
   import org.apache.axis.encoding.SerializationContext;
  +import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.XMLUtils;
   import org.apache.axis.transport.http.HTTPSender;
   import org.apache.axis.deployment.DeploymentRegistry;
  @@ -164,8 +165,8 @@
        */
       public void setType(String type) throws WSDDException
       {
  -        throw new WSDDException(getElementName().getLocalPart() +
  -                                " disallows setting of Type");
  +        throw new WSDDException(JavaUtils.getMessage(
  +                "noTypeSetting", getElementName().getLocalPart()));
       }
       
       public QName getPivotQName()
  
  
  
  1.4       +2 -2      
xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java
  
  Index: JAFDataHandlerDeserializer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JAFDataHandlerDeserializer.java   22 Feb 2002 23:39:44 -0000      1.3
  +++ JAFDataHandlerDeserializer.java   15 Mar 2002 01:14:10 -0000      1.4
  @@ -123,8 +123,8 @@
                                       Attributes attributes,
                                       DeserializationContext context)
           throws SAXException {
  -        throw new SAXException( "The element \"" + namespace + ":" + localName + 
"\" is an attachment"+
  -          " with sub elements which is not supported." );
  +        throw new SAXException(JavaUtils.getMessage(
  +                "noSubElements", namespace + ":" + localName));
   
   
       }
  
  
  
  1.3       +5 -2      
xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerDeserializerFactory.java
  
  Index: JAFDataHandlerDeserializerFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerDeserializerFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JAFDataHandlerDeserializerFactory.java    14 Mar 2002 04:20:52 -0000      1.2
  +++ JAFDataHandlerDeserializerFactory.java    15 Mar 2002 01:14:10 -0000      1.3
  @@ -91,10 +91,13 @@
   
       public JAFDataHandlerDeserializerFactory(Class javaType, QName xmlType) {
           super(JAFDataHandlerDeserializer.class, false, xmlType, javaType); 
  -        log.debug("Enter JAFDataHandlerDeserializerFactory ("+javaType+", 
"+xmlType+")");
  +        log.debug(JavaUtils.getMessage("enter00",
  +                "JAFDataHandlerDeserializerFactory(" + javaType + ", "
  +                + xmlType + ")"));
       }
       public JAFDataHandlerDeserializerFactory() {
           super(JAFDataHandlerDeserializer.class, false); 
  -        log.debug("Enter JAFDataHandlerDeserializerFactory ()" );
  +        log.debug(JavaUtils.getMessage("enter00",
  +                "JAFDataHandlerDeserializerFactory()"));
       }
   }
  
  
  
  1.3       +2 -2      xml-axis/java/src/org/apache/axis/utils/RB.java
  
  Index: RB.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/RB.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RB.java   4 Jan 2002 23:21:16 -0000       1.2
  +++ RB.java   15 Mar 2002 01:14:10 -0000      1.3
  @@ -284,7 +284,7 @@
           }
   
           if (msg == null) {
  -            throw new MissingResourceException("Can't find resource key \"" + key +
  +            throw new MissingResourceException("Cannot find resource key \"" + key +
                                                  "\" in base name " + 
basePropertyFileName,
                                                  basePropertyFileName, key);
           }
  @@ -322,7 +322,7 @@
               p = merge(p, loadProperties(basePropertyFileName, loader));
   
               if (p == null) {
  -                throw new MissingResourceException("Can't find resource for base 
name " +
  +                throw new MissingResourceException("Cannot find resource for base 
name " +
                                                      basePropertyFileName, 
basePropertyFileName, "");
               }
   
  
  
  
  1.71      +71 -2     xml-axis/java/src/org/apache/axis/utils/resources.properties
  
  Index: resources.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/resources.properties,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- resources.properties      14 Mar 2002 17:26:26 -0000      1.70
  +++ resources.properties      15 Mar 2002 01:14:10 -0000      1.71
  @@ -694,7 +694,76 @@
   onlyOneMapping=Only a single <elementMapping> is allowed per-operation at present.
   
   timedOut=WSDL2Java emitter timed out (this often means the WSDL at the specified 
URL is inaccessible)!
  -
   valuePresent=MessageElement.addChild called when an object value is present
  -
   xmlPresent=MessageElement.setObjectValue called on an instance which was 
constructed using XML
  +attachEnabled=Attachment support is enabled?
  +noEndpoint=No endpoint
  +headerNotNull=Header may not be null!
  +headerNotEmpty=Header may not be empty!
  +headerValueNotNull=Header value may not be null!
  +setMsgForm=Setting current message form to: {0} (currentMessage is now {1})
  +exitCurrMsg=Exit:  {0}, current message is {1}
  +currForm=current form is {0}
  +unsupportedAttach=Unsupported attachment type "{0}" only supporting "{1}".
  +
  +# NOTE:  in onlySOAPParts, do not translate "SOAPPart".
  +onlySOAPParts=This attachment implementation accepts only SOAPPart objects as the 
root part.
  +
  +gotNullPart=AttachmentUtils.getActiviationDataHandler received a null parameter as 
a part.
  +streamNo=New boundary stream number:  {0}
  +streamClosed=Stream closed.
  +eosBeforeMarker=End of stream encountered before final boundary marker.
  +atEOS=Boundary stream number {0} is at end of stream
  +readBStream="Read {0} from BoundaryDelimitedStream:  {1} "{2}"
  +bStreamClosed=Boundary stream number {0} is closed
  +
  +# NOTE:  in badMaxCache, do not translate "maxCached".
  +badMaxCached=maxCached value is bad:  {0}
  +                                                                   
  +maxCached=ManagedMemoryDataSource.flushToDisk maximum cached {0}, total memory {1}.
  +diskCache=Disk cache file name "{0}".
  +resourceDeleted=Resource has been deleted.
  +noResetMark=Reset and mark not supported!
  +nullInput=input buffer is null
  +negOffset=Offset is negative:  {0}
  +length=Length:  {0}
  +writeBeyond=Write beyond buffer
  +reading=reading {0} bytes from disk
  +openBread=open bread = {0}
  +flushing=flushing
  +read=read {0} bytes
  +readError=Error reading data stream:  {0}
  +noFile=File for data handler does not exist:  {0}
  +mimeErrorNoBoundary=Error in MIME data stream, start boundary not found, expected:  
{0}
  +mimeErrorParsing=Error in parsing mime data stream:  {0}
  +noRoot=Root part containing SOAP envelope not found.  contentId = {0}
  +noAttachments=No support for attachments
  +targetService=Target service:  {0}
  +exceptionPrinting=Exception caught while printing request message
  +noConfigFile=No engine configuration file - aborting!
  +noTypeSetting={0} disallows setting of Type
  +noSubElements=The element "{0}" is an attachment with sub elements which is not 
supported.
  +
  +# NOTE:  in defaultCompiler, do not translate "javac"
  +defaultCompiler=Using default javac compiler
  +noModernCompiler=Javac connector could not find modern compiler -- falling back to 
classic.
  +compilerClass=Javac compiler class:  {0}
  +noMoreTokens=no more tokens - could not parse error message:  {0}
  +cantParse=could not parse error message:  {0}
  +
  +# NOTE:  in sunJavac, do not translate "Sun Javac"
  +sunJavac=Sun Javac Compiler
  +
  +# NOTE:  in ibmJikes, do not translate "IBM Jikes"
  +ibmJikes=IBM Jikes Compiler
  +
  +typeMeta=Type metadata
  +returnTypeMeta=Return type metadata object
  +needStringCtor=Simple Types must have a String constructor
  +needToString=Simple Types must have a toString for serializing the value
  +typeMap00=All the type mapping information is registered
  +typeMap01=when the first call is made.
  +typeMap02=The type mapping information is actually registered in
  +typeMap03=the TypeMappingRegistry of the service, which
  +typeMap04=is the reason why registration is only needed for the first call.
  +mustSetStyle=must set encoding style before registering serializers
  
  
  
  1.6       +2 -2      
xml-axis/java/src/org/apache/axis/utils/compiler/CompilerFactory.java
  
  Index: CompilerFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/utils/compiler/CompilerFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CompilerFactory.java      25 Feb 2002 17:38:17 -0000      1.5
  +++ CompilerFactory.java      15 Mar 2002 01:14:11 -0000      1.6
  @@ -64,7 +64,7 @@
    * This class implements a factory to instantiate a Compiler.
    * @author <a href="mailto:[EMAIL PROTECTED]";>Davanum Srinivas</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stefano Mazzocchi</a>
  - * @version $Revision: 1.5 $ $Date: 2002/02/25 17:38:17 $
  + * @version $Revision: 1.6 $ $Date: 2002/03/15 01:14:11 $
    * @since 2.0
    */
   public class CompilerFactory {
  @@ -86,7 +86,7 @@
                       log.error(JavaUtils.getMessage("exception00"), e);
                   }
               }
  -            log.debug("Using default compiler Javac");
  +            log.debug(JavaUtils.getMessage("defaultCompiler"));
               Compiler compiler = new Javac();
               return compiler;
           }
  
  
  
  1.7       +199 -195  xml-axis/java/src/org/apache/axis/utils/compiler/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/compiler/Javac.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Javac.java        25 Feb 2002 17:38:17 -0000      1.6
  +++ Javac.java        15 Mar 2002 01:14:11 -0000      1.7
  @@ -75,207 +75,211 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Davanum Srinivas</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stefano Mazzocchi</a>
  - * @version $Revision: 1.6 $ $Date: 2002/02/25 17:38:17 $
  + * @version $Revision: 1.7 $ $Date: 2002/03/15 01:14:11 $
    * @since 2.0
    */
   
   public class Javac extends AbstractCompiler
   {
  -  protected static Log log =
  -      LogFactory.getLog(Javac.class.getName());
  -    
  -  public final static String CLASSIC_CLASS = "sun.tools.javac.Main";
  -  public final static String MODERN_CLASS = "com.sun.tools.javac.Main";
  -
  -  private boolean modern = false;
  -
  -  public Javac() {
  -
  -    // Use reflection to be able to build on all JDKs
  -    ClassLoader   cl     = Thread.currentThread().getContextClassLoader();
  -    try {
  -        cl.loadClass(MODERN_CLASS);
  -        modern = true;
  -    } catch (ClassNotFoundException e) {
  -        log.debug("Javac connector could not find modern compiler -- falling back 
to classic.");
  +    protected static Log log = LogFactory.getLog(Javac.class.getName());
  +
  +    public final static String CLASSIC_CLASS = "sun.tools.javac.Main";
  +    public final static String MODERN_CLASS = "com.sun.tools.javac.Main";
  +
  +    private boolean modern = false;
  +
  +    public Javac() {
  +
  +        // Use reflection to be able to build on all JDKs
  +        ClassLoader cl = Thread.currentThread().getContextClassLoader();
           try {
  -            cl.loadClass(CLASSIC_CLASS);
  -            modern = false;
  -        } catch (Exception ex) {
  -            log.error(JavaUtils.getMessage("noCompiler00"), ex);
  -            throw new RuntimeException(JavaUtils.getMessage("noCompiler00"));
  -        }
  -    }
  -    log.debug("Javac compiler class: " + (modern?MODERN_CLASS:CLASSIC_CLASS));
  -  }
  -
  -  /**
  -   * Compile a source file yielding a loadable class file.
  -   *
  -   * @param filename The object program base file name
  -   * @param baseDirectory The directory containing the object program file
  -   * @param encoding The encoding expected in the source file or
  -   * <code>null</code> if it is the platform's default encoding
  -   * @exception LanguageException If an error occurs during compilation
  -   */
  -  public boolean compile() throws IOException {
  -    ByteArrayOutputStream err = new ByteArrayOutputStream();
  -    sun.tools.javac.Main compiler = new sun.tools.javac.Main(err, "javac");
  -    boolean result = compiler.compile(toStringArray(fillArguments(new 
ArrayList())));
  -    this.errors = new ByteArrayInputStream(err.toByteArray());
  -    return result;
  -  }
  -
  -  /**
  -   * Parse the compiler error stream to produce a list of
  -   * <code>CompilerError</code>s
  -   *
  -   * @param errors The error stream
  -   * @return The list of compiler error messages
  -   * @exception IOException If an error occurs during message collection
  -   */
  -  protected List parseStream(BufferedReader input) throws IOException {
  -    if (modern) {
  -        return parseModernStream(input);
  -    } else {
  -        return parseClassicStream(input);
  -    }
  -  }
  -
  -  /**
  -   * Parse the compiler error stream to produce a list of
  -   * <code>CompilerError</code>s
  -   *
  -   * @param errors The error stream
  -   * @return The list of compiler error messages
  -   * @exception IOException If an error occurs during message collection
  -   */
  -  protected List parseModernStream(BufferedReader input) throws IOException {
  -    List errors = new ArrayList();
  -    String line = null;
  -    StringBuffer buffer = null;
  -
  -    while (true) {
  -      // cleanup the buffer
  -      buffer = new StringBuffer(); // this is quicker than clearing it
  -
  -      // most errors terminate with the '^' char
  -      do {
  -        if ((line = input.readLine()) == null)
  -        {
  -            if (buffer.length() > 0) {
  -                // There's an error which doesn't end with a '^'
  -                errors.add(new CompilerError("\n" + buffer.toString()));
  +            cl.loadClass(MODERN_CLASS);
  +            modern = true;
  +        } catch (ClassNotFoundException e) {
  +            log.debug(JavaUtils.getMessage("noModernCompiler"));
  +            try {
  +                cl.loadClass(CLASSIC_CLASS);
  +                modern = false;
  +            } catch (Exception ex) {
  +                log.error(JavaUtils.getMessage("noCompiler00"), ex);
  +                throw new RuntimeException(JavaUtils.getMessage("noCompiler00"));
               }
  -            return errors;
           }
  -        log.debug(line);
  -        buffer.append(line);
  -        buffer.append('\n');
  -      } while (!line.endsWith("^"));
  -
  -      // add the error bean
  -      errors.add(parseModernError(buffer.toString()));
  -    }
  -  }
  -
  -  /**
  -   * Parse an individual compiler error message with modern style.
  -   *
  -   * @param error The error text
  -   * @return A messaged <code>CompilerError</code>
  -   */
  -  private CompilerError parseModernError(String error) {
  -    StringTokenizer tokens = new StringTokenizer(error, ":");
  -    try {
  -      String file = tokens.nextToken();
  -      if (file.length() == 1) file = new 
StringBuffer(file).append(":").append(tokens.nextToken()).toString();
  -      int line = Integer.parseInt(tokens.nextToken());
  -
  -      String message = tokens.nextToken("\n").substring(1);
  -      String context = tokens.nextToken("\n");
  -      String pointer = tokens.nextToken("\n");
  -      int startcolumn = pointer.indexOf("^");
  -      int endcolumn = context.indexOf(" ", startcolumn);
  -      if (endcolumn == -1) endcolumn = context.length();
  -      return new CompilerError(file, false, line, startcolumn, line, endcolumn, 
message);
  -    } catch(NoSuchElementException nse) {
  -      return new CompilerError("no more tokens - could not parse error message: " + 
error);
  -    } catch(Exception nse) {
  -      return new CompilerError("could not parse error message: " + error);
  -    }
  -  }
  -
  -  /**
  -   * Parse the compiler error stream to produce a list of
  -   * <code>CompilerError</code>s
  -   *
  -   * @param errors The error stream
  -   * @return The list of compiler error messages
  -   * @exception IOException If an error occurs during message collection
  -   */
  -  protected List parseClassicStream(BufferedReader input) throws IOException {
  -
  -    List errors = null;
  -    String line = null;
  -    StringBuffer buffer = null;
  -
  -    while (true) {
  -      // cleanup the buffer
  -      buffer = new StringBuffer(); // this is faster than clearing it
  -
  -      // each error has 3 lines
  -      for (int i = 0; i < 3 ; i++) {
  -        if ((line = input.readLine()) == null) return errors;
  -        log.debug(line);
  -        buffer.append(line);
  -        buffer.append('\n');
  -      }
  -
  -      // if error is found create the vector
  -      if (errors == null) errors = new ArrayList();
  -
  -      // add the error bean
  -      errors.add(parseClassicError(buffer.toString()));
  -    }
  -  }
  -
  -  /**
  -   * Parse an individual compiler error message with classic style.
  -   *
  -   * @param error The error text
  -   * @return A messaged <code>CompilerError</code>
  -   */
  -  private CompilerError parseClassicError(String error) {
  -
  -    StringTokenizer tokens = new StringTokenizer(error, ":");
  -    try {
  -      String file = tokens.nextToken();
  -      if (file.length() == 1) file = new 
StringBuffer(file).append(":").append(tokens.nextToken()).toString();
  -      int line = Integer.parseInt(tokens.nextToken());
  -
  -      String last = tokens.nextToken();
  -      // In case the message contains ':', it should be reassembled
  -      while (tokens.hasMoreElements()) {
  -        last += tokens.nextToken();
  -      }
  -      tokens = new StringTokenizer(last.trim(), "\n");
  -      String message = tokens.nextToken();
  -      String context = tokens.nextToken();
  -      String pointer = tokens.nextToken();
  -      int startcolumn = pointer.indexOf("^");
  -      int endcolumn = context.indexOf(" ", startcolumn);
  -      if (endcolumn == -1) endcolumn = context.length();
  -
  -      return new CompilerError(srcDir + File.separator + file, true, line, 
startcolumn, line, endcolumn, message);
  -    } catch(NoSuchElementException nse) {
  -      return new CompilerError("no more tokens - could not parse error message: " + 
error);
  -    } catch(Exception nse) {
  -      return new CompilerError("could not parse error message: " + error);
  -    }
  -  }
  -
  -  public String toString() {
  -    return "Sun Javac Compiler";
  -  }
  +        log.debug(JavaUtils.getMessage("compilerClass",
  +                (modern ? MODERN_CLASS : CLASSIC_CLASS)));
  +    }
  +
  +    /**
  +     * Compile a source file yielding a loadable class file.
  +     *
  +     * @param filename The object program base file name
  +     * @param baseDirectory The directory containing the object program file
  +     * @param encoding The encoding expected in the source file or
  +     * <code>null</code> if it is the platform's default encoding
  +     * @exception LanguageException If an error occurs during compilation
  +     */
  +    public boolean compile() throws IOException {
  +        ByteArrayOutputStream err = new ByteArrayOutputStream();
  +        sun.tools.javac.Main compiler = new sun.tools.javac.Main(err, "javac");
  +        boolean result =
  +                compiler.compile(toStringArray(fillArguments(new ArrayList())));
  +        this.errors = new ByteArrayInputStream(err.toByteArray());
  +        return result;
  +    }
  +
  +    /**
  +     * Parse the compiler error stream to produce a list of
  +     * <code>CompilerError</code>s
  +     *
  +     * @param errors The error stream
  +     * @return The list of compiler error messages
  +     * @exception IOException If an error occurs during message collection
  +     */
  +    protected List parseStream(BufferedReader input) throws IOException {
  +        if (modern) {
  +            return parseModernStream(input);
  +        } else {
  +            return parseClassicStream(input);
  +        }
  +    }
  +
  +    /**
  +     * Parse the compiler error stream to produce a list of
  +     * <code>CompilerError</code>s
  +     *
  +     * @param errors The error stream
  +     * @return The list of compiler error messages
  +     * @exception IOException If an error occurs during message collection
  +     */
  +    protected List parseModernStream(BufferedReader input) throws IOException {
  +        List errors = new ArrayList();
  +        String line = null;
  +        StringBuffer buffer = null;
  +
  +        while (true) {
  +            // cleanup the buffer
  +            buffer = new StringBuffer(); // this is quicker than clearing it
  +
  +            // most errors terminate with the '^' char
  +            do {
  +                if ((line = input.readLine()) == null)
  +                {
  +                    if (buffer.length() > 0) {
  +                        // There's an error which doesn't end with a '^'
  +                        errors.add(new CompilerError("\n" + buffer.toString()));
  +                    }
  +                    return errors;
  +                }
  +                log.debug(line);
  +                buffer.append(line);
  +                buffer.append('\n');
  +            } while (!line.endsWith("^"));
  +
  +            // add the error bean
  +            errors.add(parseModernError(buffer.toString()));
  +        }
  +    }
  +
  +    /**
  +     * Parse an individual compiler error message with modern style.
  +     *
  +     * @param error The error text
  +     * @return A messaged <code>CompilerError</code>
  +     */
  +    private CompilerError parseModernError(String error) {
  +        StringTokenizer tokens = new StringTokenizer(error, ":");
  +        try {
  +            String file = tokens.nextToken();
  +            if (file.length() == 1) file = new 
StringBuffer(file).append(":").append(tokens.nextToken()).toString();
  +            int line = Integer.parseInt(tokens.nextToken());
  +
  +            String message = tokens.nextToken("\n").substring(1);
  +            String context = tokens.nextToken("\n");
  +            String pointer = tokens.nextToken("\n");
  +            int startcolumn = pointer.indexOf("^");
  +            int endcolumn = context.indexOf(" ", startcolumn);
  +            if (endcolumn == -1) endcolumn = context.length();
  +            return new CompilerError(file, false, line, startcolumn, line, 
endcolumn, message);
  +        } catch(NoSuchElementException nse) {
  +            return new CompilerError(JavaUtils.getMessage("noMoreTokens", error));
  +        } catch(Exception nse) {
  +            return new CompilerError(JavaUtils.getMessage("cantParse", error));
  +        }
  +    }
  +
  +    /**
  +     * Parse the compiler error stream to produce a list of
  +     * <code>CompilerError</code>s
  +     *
  +     * @param errors The error stream
  +     * @return The list of compiler error messages
  +     * @exception IOException If an error occurs during message collection
  +     */
  +    protected List parseClassicStream(BufferedReader input) throws IOException {
  +        List errors = null;
  +        String line = null;
  +        StringBuffer buffer = null;
  +
  +        while (true) {
  +            // cleanup the buffer
  +            buffer = new StringBuffer(); // this is faster than clearing it
  +
  +            // each error has 3 lines
  +            for (int i = 0; i < 3 ; i++) {
  +                if ((line = input.readLine()) == null) return errors;
  +                log.debug(line);
  +                buffer.append(line);
  +                buffer.append('\n');
  +            }
  +
  +            // if error is found create the vector
  +            if (errors == null) errors = new ArrayList();
  +
  +            // add the error bean
  +            errors.add(parseClassicError(buffer.toString()));
  +        }
  +    }
  +
  +    /**
  +     * Parse an individual compiler error message with classic style.
  +     *
  +     * @param error The error text
  +     * @return A messaged <code>CompilerError</code>
  +     */
  +    private CompilerError parseClassicError(String error) {
  +        StringTokenizer tokens = new StringTokenizer(error, ":");
  +        try {
  +            String file = tokens.nextToken();
  +            if (file.length() == 1) {
  +                file = new StringBuffer(file).append(":").
  +                        append(tokens.nextToken()).toString();
  +            }
  +            int line = Integer.parseInt(tokens.nextToken());
  +
  +            String last = tokens.nextToken();
  +            // In case the message contains ':', it should be reassembled
  +            while (tokens.hasMoreElements()) {
  +                last += tokens.nextToken();
  +            }
  +            tokens = new StringTokenizer(last.trim(), "\n");
  +            String message = tokens.nextToken();
  +            String context = tokens.nextToken();
  +            String pointer = tokens.nextToken();
  +            int startcolumn = pointer.indexOf("^");
  +            int endcolumn = context.indexOf(" ", startcolumn);
  +            if (endcolumn == -1) endcolumn = context.length();
  +
  +            return new CompilerError(srcDir + File.separator + file, true,
  +                    line, startcolumn, line, endcolumn, message);
  +        } catch(NoSuchElementException nse) {
  +            return new CompilerError(JavaUtils.getMessage("noMoreTokens",
  +                    error));
  +        } catch(Exception nse) {
  +            return new CompilerError(JavaUtils.getMessage("cantParse", error));
  +        }
  +    }
  +
  +    public String toString() {
  +        return JavaUtils.getMessage("sunJavac");
  +    }
   }
  
  
  
  1.6       +19 -19    xml-axis/java/src/org/apache/axis/utils/compiler/Jikes.java
  
  Index: Jikes.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/compiler/Jikes.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Jikes.java        25 Feb 2002 17:38:17 -0000      1.5
  +++ Jikes.java        15 Mar 2002 01:14:11 -0000      1.6
  @@ -75,7 +75,7 @@
    * NOTE: inspired by the Apache Jasper implementation.
    * @author <a href="mailto:[EMAIL PROTECTED]";>Davanum Srinivas</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stefano Mazzocchi</a>
  - * @version $Revision: 1.5 $ $Date: 2002/02/25 17:38:17 $
  + * @version $Revision: 1.6 $ $Date: 2002/03/15 01:14:11 $
    * @since 2.0
    */
   
  @@ -132,26 +132,26 @@
        * @return A string array containing compilation arguments
        */
       protected String[] toStringArray(List arguments) {
  -      int i;
  +        int i;
   
  -      for (i = 0; i < arguments.size(); i++) {
  -        String arg = (String) arguments.get(i);
  -        if (arg.equals("-sourcepath")) {
  -          // Remove -sourcepath option. Jikes does not understand that.
  -          arguments.remove(i);
  -          arguments.remove(i);
  -          break;
  -        }
  -      }
  -
  -      String[] args = new String[arguments.size() + 1];
  -      for (i = 0; i < arguments.size(); i++) {
  -        args[i] = (String) arguments.get(i);
  -      }
  +        for (i = 0; i < arguments.size(); i++) {
  +            String arg = (String) arguments.get(i);
  +            if (arg.equals("-sourcepath")) {
  +                // Remove -sourcepath option. Jikes does not understand that.
  +                arguments.remove(i);
  +                arguments.remove(i);
  +                break;
  +            }
  +        }
  +
  +        String[] args = new String[arguments.size() + 1];
  +        for (i = 0; i < arguments.size(); i++) {
  +            args[i] = (String) arguments.get(i);
  +        }
   
  -      args[i] = file;
  +        args[i] = file;
   
  -      return args;
  +        return args;
       }
   
       /**
  @@ -290,6 +290,6 @@
       }
   
       public String toString() {
  -        return "IBM Jikes Compiler";
  +        return JavaUtils.getMessage("ibmJikes");
       }
   }
  
  
  
  1.22      +4 -4      
xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaComplexTypeWriter.java
  
  Index: JavaComplexTypeWriter.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaComplexTypeWriter.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JavaComplexTypeWriter.java        14 Mar 2002 16:21:33 -0000      1.21
  +++ JavaComplexTypeWriter.java        15 Mar 2002 01:14:11 -0000      1.22
  @@ -248,7 +248,7 @@
   
           if (attributes != null || elementMappings != null) {
               boolean wroteFieldType = false;
  -            pw.println("    // Type metadata");
  +            pw.println("    // " + JavaUtils.getMessage("typeMeta"));
               pw.println("    private static org.apache.axis.description.TypeDesc 
typeDesc =");
               pw.println("        new org.apache.axis.description.TypeDesc();");
               pw.println();
  @@ -299,7 +299,7 @@
               pw.println();
   
               pw.println("    /**");
  -            pw.println("     * Return type metadata object");
  +            pw.println("     * " + JavaUtils.getMessage("returnTypeMeta"));
               pw.println("     */");
               pw.println("    public static org.apache.axis.description.TypeDesc 
getTypeDesc() {");
               pw.println("        return typeDesc;");
  @@ -311,12 +311,12 @@
           // constructor
           if (type.isSimpleType() && valueType != null) {
               // emit contructors and toString().
  -            pw.println("    // Simple Types must have a string constructor");
  +            pw.println("    // " + JavaUtils.getMessage("needStringCtor"));
               pw.println("    public " + className + "(java.lang.String value) {");
               pw.println("        this.value = new " + valueType + "(value);");
               pw.println("    }");
               pw.println();            
  -            pw.println("    // Simple Types must have a toString for serializing 
the value");
  +            pw.println("    // " + JavaUtils.getMessage("needToString"));
               pw.println("    public String toString() {");
               pw.println("        return value.toString();");
               pw.println("    }");
  
  
  
  1.44      +7 -6      
xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
  
  Index: JavaStubWriter.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- JavaStubWriter.java       13 Mar 2002 19:50:58 -0000      1.43
  +++ JavaStubWriter.java       15 Mar 2002 01:14:11 -0000      1.44
  @@ -193,16 +193,17 @@
           pw.println("                call.setProperty(key, 
super.cachedProperties.get(key));");
           pw.println("            }");
           if (types.size() > 0) {
  -            pw.println("            // All the type mapping information is 
registered");
  -            pw.println("            // when the first call is made.");
  -            pw.println("            // The type mapping information is actually 
registered in");
  -            pw.println("            // the TypeMappingRegistry of the service, 
which");
  -            pw.println("            // is the reason why registration is only 
needed for the first call.");
  +            pw.println("            // " + JavaUtils.getMessage("typeMap00"));
  +            pw.println("            // " + JavaUtils.getMessage("typeMap01"));
  +            pw.println("            // " + JavaUtils.getMessage("typeMap02"));
  +            pw.println("            // " + JavaUtils.getMessage("typeMap03"));
  +            pw.println("            // " + JavaUtils.getMessage("typeMap04"));
               pw.println("            if (firstCall()) {");
               
               // Hack alert - we need to establish the encoding style before we 
register type mappings due
               // to the fact that TypeMappings key off of encoding style
  -            pw.println("                // must set encoding style before 
registering serializers");
  +            pw.println("                // "
  +                    + JavaUtils.getMessage("mustSetStyle"));
               if (bEntry.hasLiteral()) {
                   pw.println("                call.setEncodingStyle(null);");
               } else {
  
  
  


Reply via email to