You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by gb...@apache.org on 2012/05/09 22:30:42 UTC

svn commit: r1336380 - /pdfbox/trunk/preflight/src/main/javacc/pdf_full_grammar.jj

Author: gbailleul
Date: Wed May  9 20:30:42 2012
New Revision: 1336380

URL: http://svn.apache.org/viewvc?rev=1336380&view=rev
Log:
PDFBOX-1279 : rolled back getBytes modification due to java 5 charset class definition

Modified:
    pdfbox/trunk/preflight/src/main/javacc/pdf_full_grammar.jj

Modified: pdfbox/trunk/preflight/src/main/javacc/pdf_full_grammar.jj
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/javacc/pdf_full_grammar.jj?rev=1336380&r1=1336379&r2=1336380&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/javacc/pdf_full_grammar.jj (original)
+++ pdfbox/trunk/preflight/src/main/javacc/pdf_full_grammar.jj Wed May  9 20:30:42 2012
@@ -308,19 +308,19 @@ void literal() {
             if (currentToken.kind == 0 ){
                throw new ParseException("EOF reach before the end of the literal string.");
             }
-            literalLength += currentToken.image.getBytes(AbstractValidator.encoding).length;
+            literalLength += currentToken.image.getBytes().length;
             if ( currentToken.kind == OBJ_STRING_LIT ) {
                jj_consume_token(OBJ_STRING_LIT);
-               if (previous != null && previous.image.getBytes(AbstractValidator.encoding)[previous.image.getBytes(AbstractValidator.encoding).length-1]!='\\') {
+               if (previous != null && previous.image.getBytes()[previous.image.getBytes().length-1]!='\\') {
                   ++nesting;
                }
             } else if ( currentToken.kind == INNER_START_LIT ) {
                jj_consume_token(INNER_START_LIT);
-               if (previous != null && previous.image.getBytes(AbstractValidator.encoding)[previous.image.getBytes(AbstractValidator.encoding).length-1]!='\\') {
+               if (previous != null && previous.image.getBytes()[previous.image.getBytes().length-1]!='\\') {
                   ++nesting;
                }
             } else if ( currentToken.kind == END_LITERAL ) {
-               if (previous != null && previous.image.getBytes(AbstractValidator.encoding)[previous.image.getBytes(AbstractValidator.encoding).length-1]!='\\') {
+               if (previous != null && previous.image.getBytes()[previous.image.getBytes().length-1]!='\\') {
                   --nesting;
                }
                jj_consume_token(END_LITERAL);
@@ -339,8 +339,8 @@ void literal() {
 
 JAVACODE
 void checkNameLength() throws ParseException {
-	if (token != null && token.image.getBytes(AbstractValidator.encoding).length > MAX_NAME_SIZE) {
-		throw new PdfParseException("Object Name is toot long : " + token.image.getBytes(AbstractValidator.encoding).length, ERROR_SYNTAX_NAME_TOO_LONG);
+	if (token != null && token.image.getBytes().length > MAX_NAME_SIZE) {
+		throw new PdfParseException("Object Name is too long : " + token.image.getBytes().length, ERROR_SYNTAX_NAME_TOO_LONG);
 	} else {
 		// Nothing to do
 	}	
@@ -348,7 +348,7 @@ void checkNameLength() throws ParseExcep
 
 JAVACODE
 void checkMagicNumberLength() throws ParseException {
-   if (token != null && token.image.getBytes(AbstractValidator.encoding).length < 4) {
+   if (token != null && token.image.getBytes().length < 4) {
       throw new PdfParseException("Not enough bytes after the Header (at least 4 bytes should be present with a value bigger than 127) : " + token.image, ERROR_SYNTAX_HEADER);
    } else {
       // Nothing to do