You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by rp...@locus.apache.org on 2000/02/08 02:54:46 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/framework XMLDTDScanner.java XMLDocumentScanner.java XMLParser.java

rpfeiffe    00/02/07 17:54:45

  Modified:    java/src/org/apache/xerces/framework XMLDTDScanner.java
                        XMLDocumentScanner.java XMLParser.java
  Log:
  Updated to include localized ExceptionMessages.
  -rip
  
  Revision  Changes    Path
  1.3       +3 -3      xml-xerces/java/src/org/apache/xerces/framework/XMLDTDScanner.java
  
  Index: XMLDTDScanner.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/framework/XMLDTDScanner.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLDTDScanner.java	2000/01/05 01:36:33	1.2
  +++ XMLDTDScanner.java	2000/02/08 01:54:45	1.3
  @@ -789,7 +789,7 @@
           moreToFollow = fReaderId != fExternalSubsetReader;
           switch (fScannerState) {
           case SCANNER_STATE_INVALID:
  -            throw new RuntimeException("cannot happen 2");
  +            throw new RuntimeException("FWK004 XMLDTDScanner.endOfInput: cannot happen: 2"+"\n2");
           case SCANNER_STATE_END_OF_INPUT:
               break;
           case SCANNER_STATE_MARKUP_DECL:
  @@ -799,7 +799,7 @@
               }
               break;
           case SCANNER_STATE_DOCTYPEDECL:
  -            throw new RuntimeException("cannot happen 2.5");
  +            throw new RuntimeException("FWK004 XMLDTDScanner.endOfInput: cannot happen: 2.5"+"\n2.5");
   //            break;
           case SCANNER_STATE_TEXTDECL:
   // REVISIT            reportFatalXMLError(XMLMessages.MSG_ATTVAL0);
  @@ -864,7 +864,7 @@
               }
               break;
           default:
  -            throw new RuntimeException("cannot happen 3");
  +            throw new RuntimeException("FWK004 XMLDTDScanner.endOfInput: cannot happen: 3"+"\n3");
           }
           if (!moreToFollow) {
               setScannerState(SCANNER_STATE_END_OF_INPUT);
  
  
  
  1.2       +12 -12    xml-xerces/java/src/org/apache/xerces/framework/XMLDocumentScanner.java
  
  Index: XMLDocumentScanner.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/framework/XMLDocumentScanner.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XMLDocumentScanner.java	1999/11/09 01:12:56	1.1
  +++ XMLDocumentScanner.java	2000/02/08 01:54:45	1.2
  @@ -829,7 +829,7 @@
                   }
                   break;
               default:
  -                throw new RuntimeException("1]ScannerState " + fScannerState);
  +                throw new RuntimeException("FWK001 1] ScannerState="+fScannerState+"\n" + "1\t"+fScannerState);
               }
               if (!moreToFollow) {
                   reportFatalXMLError(XMLMessages.MSG_ROOT_ELEMENT_REQUIRED,
  @@ -931,7 +931,7 @@
                   }
                   break;
               default:
  -                throw new RuntimeException("2]ScannerState " + fScannerState);
  +                throw new RuntimeException("FWK001 2] ScannerState="+fScannerState+"\n" + "2\t"+fScannerState);
               }
               if (!moreToFollow) {
                   reportFatalXMLError(XMLMessages.MSG_ROOT_ELEMENT_REQUIRED,
  @@ -949,7 +949,7 @@
   
           void popElementType() {
               if (fElementDepth-- == 0) {
  -                throw new RuntimeException("popElementType");
  +                throw new RuntimeException("FWK002 popElementType: fElementDepth-- == 0.");
               }
               if (fElementDepth == 0) {
                   fCurrentElementType = - 1;
  @@ -1080,7 +1080,7 @@
                                       return true;
                                   }
                                   if (fElementDepth-- == 0) {
  -                                    throw new RuntimeException("popElementType");
  +                                    throw new RuntimeException("FWK002 popElementType: fElementDepth-- == 0.");
                                   }
                                   if (fElementDepth == 0) {
                                       fCurrentElementType = - 1;
  @@ -1192,7 +1192,7 @@
                                   return true;
                               }
                               if (fElementDepth-- == 0) {
  -                                throw new RuntimeException("popElementType");
  +                                throw new RuntimeException("FWK002 popElementType: fElementDepth-- == 0.");
                               }
                               if (fElementDepth == 0) {
                                   fCurrentElementType = - 1;
  @@ -1250,7 +1250,7 @@
                               return true;
                           }
                           if (fElementDepth-- == 0) {
  -                            throw new RuntimeException("popElementType");
  +                            throw new RuntimeException("FWK002 popElementType: fElementDepth-- == 0.");
                           }
                           if (fElementDepth == 0) {
                               fCurrentElementType = - 1;
  @@ -1367,11 +1367,11 @@
                           fScannerState = SCANNER_STATE_START_OF_MARKUP;
                           break;
                       default:
  -                        throw new RuntimeException("3]ScannerState " + fScannerState); // should not happen
  +                        throw new RuntimeException("FWK001 3] ScannerState="+fScannerState+"\n" + "3\t"+fScannerState); // should not happen
                       }
                       break;
                   default:
  -                    throw new RuntimeException("4]ScannerState " + fScannerState);
  +                    throw new RuntimeException("FWK001 4] ScannerState="+fScannerState+"\n" + "4\t"+fScannerState);
                   }
               } while (fScannerState != SCANNER_STATE_END_OF_INPUT && keepgoing);
               return true;
  @@ -1441,7 +1441,7 @@
                   }
                   break;
               default:
  -                throw new RuntimeException("5]ScannerState " + fScannerState);
  +                throw new RuntimeException("FWK001 5] ScannerState="+fScannerState+"\n" + "5\t"+fScannerState);
               }
               if (!moreToFollow) {
                   if (fElementDepth > 0)
  @@ -1510,7 +1510,7 @@
           }
           public void endOfInput(int entityName, boolean moreToFollow) throws Exception {
               if (moreToFollow)
  -                throw new RuntimeException("TrailingMiscDispatcher.endOfInput moreToFollow");
  +                throw new RuntimeException("FWK003 TrailingMiscDispatcher.endOfInput moreToFollow");
               switch (fScannerState) {
               case SCANNER_STATE_TRAILING_MISC:
               case SCANNER_STATE_START_OF_MARKUP:
  @@ -1524,7 +1524,7 @@
                                       XMLMessages.P16_UNTERMINATED);
                   break;
               default:
  -                throw new RuntimeException("6]ScannerState " + fScannerState);
  +                throw new RuntimeException("FWK001 6] ScannerState="+fScannerState+"\n" + "6\t"+fScannerState);
               }
               fDispatcher = new EndOfInputDispatcher();
               setScannerState(SCANNER_STATE_END_OF_INPUT);
  @@ -1538,7 +1538,7 @@
               return false;
           }
           public void endOfInput(int entityName, boolean moreToFollow) throws Exception {
  -            throw new RuntimeException("7]ScannerState " + fScannerState);
  +            throw new RuntimeException("FWK001 7] ScannerState="+fScannerState+"\n" + "7\t"+fScannerState);
           }
       }
       //
  
  
  
  1.7       +6 -10     xml-xerces/java/src/org/apache/xerces/framework/XMLParser.java
  
  Index: XMLParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/framework/XMLParser.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLParser.java	2000/02/07 21:40:09	1.6
  +++ XMLParser.java	2000/02/08 01:54:45	1.7
  @@ -1178,8 +1178,7 @@
           throws SAXException, IOException {
   
           if (fParseInProgress) {
  -            // REVISIT: Localize this message. -Ac
  -            throw new org.xml.sax.SAXException("parse may not be called while parsing"); // REVISIT - need to add new error message
  +            throw new org.xml.sax.SAXException("FWK005 parse may not be called while parsing."); // REVISIT - need to add new error message
           }
   
           try {
  @@ -1257,8 +1256,7 @@
       public void setLocale(Locale locale) throws SAXException {
   
           if (fParseInProgress) {
  -            // REVISIT: Localize this message. -Ac
  -            throw new org.xml.sax.SAXException("setLocale may not be called while parsing"); // REVISIT - need to add new error message
  +            throw new org.xml.sax.SAXException("FWK006 setLocale may not be called while parsing"); // REVISIT - need to add new error message
           }
   
           fLocale = locale;
  @@ -1307,8 +1305,7 @@
           } else if (errorDomain.equals(DatatypeMessageProvider.DATATYPE_DOMAIN)) {
               spe = new SAXParseException(fgDatatypeMessages.createMessage(fLocale, majorCode, minorCode, args), locator);
           } else {
  -            // REVISIT: Localize this message. -Ac
  -            throw new RuntimeException("Unknown error domain \"" + errorDomain + "\".");
  +            throw new RuntimeException("FWK007 Unknown error domain \"" + errorDomain + "\"."+"\n"+errorDomain);
           }
   
           // default error handling
  @@ -1922,8 +1919,7 @@
           endElement(elementType);
           fInElementContent = fValidator.endElement(elementType);
           if (fElementDepth-- == 0) {
  -            // REVISIT: Localize this message. -Ac
  -            throw new RuntimeException("Element stack underflow");
  +            throw new RuntimeException("FWK008 Element stack underflow");
           }
           if (fElementDepth == 0) {
               fCurrentElementType = - 1;
  @@ -2452,7 +2448,7 @@
        */
       public void stopReadingFromExternalSubset() throws Exception {
           if (!(fReader instanceof NullReader))
  -            throw new RuntimeException("cannot happen 18");
  +            throw new RuntimeException("FWK004 cannot happen 18"+"\n18");
           popReader();
           sendReaderChangeNotifications();
       }
  @@ -2732,7 +2728,7 @@
       }
       private void popReader() {
           if (fReaderStack.empty())
  -            throw new RuntimeException("cannot happen 19");
  +            throw new RuntimeException("FWK004 cannot happen 19"+"\n19");
           ReaderState rs = (ReaderState) fReaderStack.pop();
           fReader = rs.reader;
           fSource = rs.source;