You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xmlgraphics.apache.org by bu...@apache.org on 2009/05/09 12:41:51 UTC

DO NOT REPLY [Bug 47174] New: Should never use Error to report runtime errors

https://issues.apache.org/bugzilla/show_bug.cgi?id=47174

           Summary: Should never use Error to report runtime errors
           Product: XMLGraphicsCommons
           Version: 1.3.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Image codecs
        AssignedTo: general@xmlgraphics.apache.org
        ReportedBy: sebb@apache.org


See Bug 47171:

TIFFImageEncoder uses Error to report unexpected conditions, e.g.

        switch(dataType) {
        case DataBuffer.TYPE_BYTE:
            if(sampleSize[0] != 1 && sampleSize[0] == 4 &&
               sampleSize[0] != 8) {
                throw new Error("TIFFImageEncoder2");
            }
            break;

Using Error makes it hard to safely catch the exception, as there are some
Errors that should not be caught (e.g. ThreadDeath)

The code should use a more specific Error, e.g. RuntimeException or
IllegalArgumentException or InvalidParameterException.


There are a few other classes that use Error():

TIFF*

Glyphs
AbstractGraphics2D
TransformType

Please can these be changed to use a RuntimeError of some kind?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 47174] Should never use Error to report runtime errors

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47174

Glenn Adams <ga...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Glenn Adams <ga...@apache.org> 2012-04-10 18:47:48 UTC ---
http://svn.apache.org/viewvc?rev=1311918&view=rev
http://svn.apache.org/viewvc?rev=1311522&view=rev

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org