[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-dev
Subject:    [jira] [Resolved] (BATIK-906) Should never use Error to report runtime errors
From:       "simon steiner (JIRA)" <jira () apache ! org>
Date:       2017-09-19 14:23:01
Message-ID: JIRA.12620263.1241798231000.147339.1505830981779 () Atlassian ! JIRA
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/BATIK-906?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

simon steiner resolved BATIK-906.
---------------------------------
    Resolution: Fixed
      Assignee: simon steiner  (was: Batik Developer's Mailing list)

> Should never use Error to report runtime errors
> -----------------------------------------------
> 
> Key: BATIK-906
> URL: https://issues.apache.org/jira/browse/BATIK-906
> Project: Batik
> Issue Type: Bug
> Components: GVT
> Affects Versions: 1.7
> Environment: Operating System: Windows XP
> Platform: PC
> Reporter: Sebb
> Assignee: simon steiner
> 
> 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 over 70 classes where Error is thrown - please \
> can these be changed to something more appropriate?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic