SlideShare a Scribd company logo
Teddy Chen
teddy@teddysoft.tw
http://teddy-chen-tw.blogspot.tw
Mar. 28 2013
Copyright@2013 Teddysoft
3
系統不穩定
4
5
6
7
8
Problem
9
Problem
Copyright@2013 Teddysoft
• Correctness
– Contract Specification(超出範圍)
• Robustness
– Exception Handling
Copyright@2013 Teddysoft
Copyright@2013 Teddysoft
Copyright@2013 Teddysoft
RuntimeException
Throwable
Exception Error
Unchecked
Exception
Checked
Exception
Copyright@2013 Teddysoft
handle
declare
Copyright@2013 Teddysoft
16
EH smell Refactoring
Ignored checked
exception
Replace Ignored Checked Exception with
Unchecked Exception
Unprotected main
program
Avoid Unexpected Termination with Big
Outer Try Block
Dummy handler Replace Dummy Handler with Rethrow
Nested try block Replace Nested Try Block with Method
Ignored checked
exception,
Dummy handler
Introduce Checkpoint Class
Spare handler Introduce Resourceful Try Clause
Copyright@2013 Teddysoft
public void writeFile(String fileName, String data) {
Writer writer = null;
try {
writer = new FileWriter(fileName); /* may throw an IOException */
writer.write(data); /* may throw an IOException */
}
catch (IOException e) {
/* ignoring the exception */
}
}
↓
public void writeFile(String fileName, String data) {
Writer writer = null;
try {
writer = new FileWriter(fileName); /* may throw an IOException */
writer.write(data); /* may throw an IOException */
}
catch (IOException e) {
throw new UnhandledException(e, “message”);
}
}
17
Copyright@2013 Teddysoft
18
static public void main(String[] args) {
/* some code */
}
↓
static public void main(String[] args) {
try {
/* some code */
}
catch (Throwable e) {
/* displaying and/or logging the exception */
}
}
Copyright@2013 Teddysoft
19
catch (AnException e) {
e.printStackTrace();
}
↓
catch (AnException e) {
throw new UnhandledException(e, “message”);
}
Copyright@2013 Teddysoft
20
FileInputStream in = null;
try {
in = new FileInputStream(…);
} finally {
try { if (in != null) in.close (); }
catch (IOException e) { /* log the exception */ }
}
↓
FileInputStream in = null;
try {
in = new FileInputStream(…);
} finally { closeIO (in); }
private void closeIO (Closeable c) {
try {
if (c != null) c.close ();
} catch (IOException e) { /* log the exception */ }
}
Copyright@2013 Teddysoft
21
public void foo () throws FailureException {
try {
/* code that may change the state of the object */
}
catch (AnException e) {
throw new FailureException(e);
} finally {/* code for cleanup */}
}
↓
public void foo () throws FailureException {
Checkpoint cp = new Checkpoint (/* parameters */);
try {
cp. establish (); /* establish a checkpoint */
/* code that may change the state of the object */ }
catch (AnException e) {
cp.restore (); /* restore the checkpoint */
throw new FailureException(e); }
finally { cp.drop(); }
} Copyright@2013 Teddysoft
22
try { /* primary */ }
catch (SomeException e) {
try {/* alternative */}
catch(AnotherException e) {
throw new FailureException(e);
}
}
↓
int attempt = 0; int maxAttempt = 2; boolean retry = false;
do {
try { retry = false;
if (attempt == 0) { /* primary */ }
else { /* alternative */ }
} catch (SomeException e) {
attempt++; retry = true;
if (attempt > maxAttempt) throw new FailureException (e);
}
} while (attempt<= maxAttempt && retry)
Copyright@2013 Teddysoft
Copyright@2013 Teddysoft
• CSS is a banking application for checking
customers’ credit history in processing their
loan applications
24
Credit Scoring
System (CSS)
Gateway
(IBM Message
Queue)
Joint Credit
Information
Center (JCIC)
Authentication
(Domino
Server)
Other
Applications
Copyright@2013 Teddysoft
• The use of exceptions and return code were
mixed in an arbitrary manner
• Many checked exceptions were caught and
ignored
• Unchecked exceptions were not caught which
lead to an unexpected termination of the JSP
program
• Failure atomicity of each component was not
investigated
25
Copyright@2013 Teddysoft
• Bug fixing is a strong force drawing the
developer’s attention to deal with
exceptions
• Cost-effectiveness measurements can be
provided to convince the management to
support the refactoring
– Improving quality, saving maintenance cost, and
increasing customer satisfaction
26
Copyright@2013 Teddysoft
Reported
failure
Failing operation/ possible
reason
Failure
count
Current
restoration
actions
Restoration
time per
failure
Cannot
make a
connection
to Domino
server
User login/
Connections of Domino Internet
Inter-ORB Protocol (DIIOP) were
exhausted. It was likely that DIIOP
connections were not correctly
disposed.
125
1. Rebooting
Domino
server
2. Rebooting
CSS
About 20
minutes
MQ server
connection
is broken
Sending request to JCJS/
MQ connections were exhausted.
Perhaps they were not properly
released.
66
1. Rebooting
MQ Server
2. Rebooting
CSS
About 10
minutes
Cannot send
messages to
MQ server
Sending request to JCJS/
There were two possible reasons:
Message queue was full.
Gateway was offline due to
maintenance or crash.
10
1. Rebooting
MQ Server
2. Rebooting
CSS
About 10
minutes 27
28
Credit Scoring
System (CSS)
Gateway
(IBM Message
Queue)
Joint Credit
Information
Center (JCIC)
Authentication
(Domino
Server 1)
Other
Applications
Authentication
(Domino
Server 2)
X
Copyright@2013 Teddysoft
29
Reported
failure
Failure count from Sep. 2005
to Dec. 2005
Failure count from Sep. 2006
to Dec. 2006
Sep. Oct. Nov. Dec. Sep. Oct. Nov. Dec.
Cannot make a
connection to
Domino server
13 5 9 14 10 5 0 0
MQ Server
connection
broken
6 1 4 8 3/0 0 1/0 0
Cannot send
messages to
MQ Server
0 0 0 2 3/0 1/0 0 0
Copyright@2013 Teddysoft
30
Code type
Total vs.
modified code
Modification
percentage
Non-commented
line of code
14150/371 2.63%
Catch clauses 855/21 2.46%
Copyright@2013 Teddysoft
31
Task Man-hours Sum
Collecting bugs reports in 2005 10 18 (43.9%)
Refactoring cost (Code review) 7 (30.4%)
Refactoring cost (Exception Handling
goal analysis)
4 (17.4%)
Refactoring cost (Coding) 3 (13%)
Refactoring cost (Testing) 9 (39.2%)
Total man-hours in applying
refactoring
23 (56.1%)
Total man-hours in improving
robustness
41 (100%)
Copyright@2013 Teddysoft
32
Cost element Cost calculation
Maintenance cost in 2005 201 (failure) * 2 (hours) * 100 (US$) =
40,200 (US$)
Refactoring cost 41 (man-hours) * 100 (US$) = 4,100 (US$)
Maintenance cost saving in
the following year (money)
40,200 (US$) – 4,100 (US$) = 36,100 (US$)
Maintenance cost saving in
the following year
(percentage)
36,100 (US$) / 40,200 (US$) * 100 = 89.8%
Copyright@2013 Teddysoft
33Copyright@2013 Teddysoft
EH smell Refactoring
Ignored checked
exception
Replace Ignored Checked Exception with
Unchecked Exception
Unprotected main
program
Avoid Unexpected Termination with Big
Outer Try Block
Dummy handler Replace Dummy Handler with Rethrow
Nested try block Replace Nested Try Block with Method
Ignored checked
exception,
Dummy handler
Introduce Checkpoint Class
Spare handler Introduce Resourceful Try Clause

More Related Content

What's hot (11)

PDF
C# conventions & good practices
Tan Tran
 
PPTX
Stop wasting-time-by-applying-clean-code-principles
Edorian
 
PPTX
Back-2-Basics: Code Contracts
David McCarter
 
PPTX
Refactoring Applications using SOLID Principles
Steven Smith
 
PDF
JIOWA Code Generation Framework & Template Engine
Robert Mencl
 
PDF
The WHY behind TDD/BDD and the HOW with RSpec
Ben Mabey
 
PDF
Clean Code 2
Fredrik Wendt
 
PDF
Returning the right results - Jettro Coenradie
NLJUG
 
PDF
TDD with PhpSpec
CiaranMcNulty
 
PDF
從Bowling Game Kata看敏捷開發
teddysoft
 
PPTX
Refactoring
Mikalai Alimenkou
 
C# conventions & good practices
Tan Tran
 
Stop wasting-time-by-applying-clean-code-principles
Edorian
 
Back-2-Basics: Code Contracts
David McCarter
 
Refactoring Applications using SOLID Principles
Steven Smith
 
JIOWA Code Generation Framework & Template Engine
Robert Mencl
 
The WHY behind TDD/BDD and the HOW with RSpec
Ben Mabey
 
Clean Code 2
Fredrik Wendt
 
Returning the right results - Jettro Coenradie
NLJUG
 
TDD with PhpSpec
CiaranMcNulty
 
從Bowling Game Kata看敏捷開發
teddysoft
 
Refactoring
Mikalai Alimenkou
 

Viewers also liked (17)

PDF
搞懂Java例外處理的難題:Checked與Unchecked Exceptions不再是問題
teddysoft
 
PDF
模式入門第一堂課: 30分鐘寫出一個模式
teddysoft
 
PDF
Design Patterns這樣學就會了:入門班 Day1 教材
teddysoft
 
PDF
重構三兩事
teddysoft
 
PDF
好設計如何好 @ C.C. Agile #14
teddysoft
 
PDF
從五個小故事看敏捷開發精神
teddysoft
 
PDF
那一夜我們說Pattern design patterns 20周年-published
teddysoft
 
PPTX
了解模式讓你更敏捷 (C C Agile 活動分享)
teddysoft
 
PPTX
[演講] Scrum導入經驗分享
teddysoft
 
PDF
軟體開發成功的秘訣
teddysoft
 
PDF
Kanban in Oracle Applications
mgarg82
 
PDF
HowTo Design your kanban board
Jo Seibert
 
KEY
Specification by Example
Declan Whelan
 
DOCX
O2 c and p2p cycles
gsriramsunil
 
ODP
Kanban Board Examples
Shore Labs
 
PDF
Kanban boards step by step
Giulio Roggero
 
PDF
[DSC 2016] 系列活動:李宏毅 / 一天搞懂深度學習
台灣資料科學年會
 
搞懂Java例外處理的難題:Checked與Unchecked Exceptions不再是問題
teddysoft
 
模式入門第一堂課: 30分鐘寫出一個模式
teddysoft
 
Design Patterns這樣學就會了:入門班 Day1 教材
teddysoft
 
重構三兩事
teddysoft
 
好設計如何好 @ C.C. Agile #14
teddysoft
 
從五個小故事看敏捷開發精神
teddysoft
 
那一夜我們說Pattern design patterns 20周年-published
teddysoft
 
了解模式讓你更敏捷 (C C Agile 活動分享)
teddysoft
 
[演講] Scrum導入經驗分享
teddysoft
 
軟體開發成功的秘訣
teddysoft
 
Kanban in Oracle Applications
mgarg82
 
HowTo Design your kanban board
Jo Seibert
 
Specification by Example
Declan Whelan
 
O2 c and p2p cycles
gsriramsunil
 
Kanban Board Examples
Shore Labs
 
Kanban boards step by step
Giulio Roggero
 
[DSC 2016] 系列活動:李宏毅 / 一天搞懂深度學習
台灣資料科學年會
 
Ad

Similar to Java 例外處理壞味道與重構技術 (9)

PPT
9 cm604.42
myrajendra
 
PDF
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
David Gómez García
 
PDF
JRuby 6 Years in Production
Mark Menard
 
PDF
Agile Days Twin Cities 2011
Brian Repko
 
PDF
Hadoop Summit 2010 Challenges And Uniqueness Of Qe And Re Processes In Hadoop
Yahoo Developer Network
 
DOC
MX Server is my friend
Gabriel Daty
 
DOC
MX Server is my friend
Gabriel Daty
 
DOC
MX Server is my friend
Gabriel Daty
 
DOC
MX Server is my friend
Gabriel Daty
 
9 cm604.42
myrajendra
 
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
David Gómez García
 
JRuby 6 Years in Production
Mark Menard
 
Agile Days Twin Cities 2011
Brian Repko
 
Hadoop Summit 2010 Challenges And Uniqueness Of Qe And Re Processes In Hadoop
Yahoo Developer Network
 
MX Server is my friend
Gabriel Daty
 
MX Server is my friend
Gabriel Daty
 
MX Server is my friend
Gabriel Daty
 
MX Server is my friend
Gabriel Daty
 
Ad

More from teddysoft (12)

PDF
Dci vs aggregate_dddtw_2021-0.3-16-9
teddysoft
 
PDF
Dci vs aggregate_dddtw_2021-0.3-preview
teddysoft
 
PDF
DDD + Clean Architecture: 從需求到實作
teddysoft
 
PDF
漫談重構
teddysoft
 
PDF
Pattern based problem solving-published
teddysoft
 
PDF
Agile the timeless way of software development-2019-05-17-v1.2-published
teddysoft
 
PDF
當Scrum遇到Pattern
teddysoft
 
PDF
說出一嘴好設計 1.1
teddysoft
 
PDF
跟著Teddy讀Pattern
teddysoft
 
PDF
洗白你的軟體架構
teddysoft
 
PDF
如何學好設計模式
teddysoft
 
PDF
Bdd atdd sbe_tdd_ddd_published
teddysoft
 
Dci vs aggregate_dddtw_2021-0.3-16-9
teddysoft
 
Dci vs aggregate_dddtw_2021-0.3-preview
teddysoft
 
DDD + Clean Architecture: 從需求到實作
teddysoft
 
漫談重構
teddysoft
 
Pattern based problem solving-published
teddysoft
 
Agile the timeless way of software development-2019-05-17-v1.2-published
teddysoft
 
當Scrum遇到Pattern
teddysoft
 
說出一嘴好設計 1.1
teddysoft
 
跟著Teddy讀Pattern
teddysoft
 
洗白你的軟體架構
teddysoft
 
如何學好設計模式
teddysoft
 
Bdd atdd sbe_tdd_ddd_published
teddysoft
 

Recently uploaded (20)

PPTX
Town planning is a concept used in architectural design. It plays a very impo...
IshikaPanchal11
 
PDF
cs603 ppts .pdf 222222222222222222222222
RabiaNazneen1
 
PPTX
CompanyReviewTypeOfPowerpointThatIsColor
plukleomarigpuara
 
PPTX
sistem teknologi yang di desain untuk mahasiswa dan dosen agar memudahkan mer...
gamesonlya2rj
 
PDF
The Role of Logos as Identity Shapers (IFIC Logo)
Md. Mehedi Hasan Asif
 
PPTX
Exploring Types of Rocks Educational Presentation rock forming james harold r...
jamescarllfelomino6
 
PPT
Teaching Learning-1- (New) 2020.pptuuuo
omarekaabed
 
DOCX
Redefining Master Plans for creating sustainable cities-Jharkhand Conference...
JIT KUMAR GUPTA
 
PPTX
feminist gnsudnshxujenduxhsixisjxuu.pptx
rowvinafujimoto
 
PDF
Black and Blue Modern Technology Presentation.pdf
hjaders1104
 
PPTX
DEVELOPING-PARAGRAPHS.pptx-developing...
rania680036
 
PDF
Empowering Artisans Through Technology Karmakar App Concept
yellowslice2
 
PPTX
Great_Discoverers_Nohzyxyxyzyzyzyzzyz_Imagptx
kevadiyahem07
 
PPTX
sCREW cONVEYOR AUGER DAF SLUDGE SYSTEM TO
viksurs
 
PDF
AI Intervention in Design & Content Creation
YellowSlice1
 
PPTX
Adjective..pptxujjjjjjjjjjjjjjjjjjjjjjjj
seemanodiyal
 
PPTX
Adobe Creative Cloud Cleaner Tool Crack Free Download Latest Version 2025
Slideshare
 
DOCX
Ai vehicle traffic signal detector research proposal.docx
DavidNameza
 
PDF
WEEK3-Literary-Gennnnnnnnnnnnnnnnnres.pdf
MaybelynVergara
 
PPTX
Visit Biogas Refresher Slide_Jun 2025.pptx
isyraffemir
 
Town planning is a concept used in architectural design. It plays a very impo...
IshikaPanchal11
 
cs603 ppts .pdf 222222222222222222222222
RabiaNazneen1
 
CompanyReviewTypeOfPowerpointThatIsColor
plukleomarigpuara
 
sistem teknologi yang di desain untuk mahasiswa dan dosen agar memudahkan mer...
gamesonlya2rj
 
The Role of Logos as Identity Shapers (IFIC Logo)
Md. Mehedi Hasan Asif
 
Exploring Types of Rocks Educational Presentation rock forming james harold r...
jamescarllfelomino6
 
Teaching Learning-1- (New) 2020.pptuuuo
omarekaabed
 
Redefining Master Plans for creating sustainable cities-Jharkhand Conference...
JIT KUMAR GUPTA
 
feminist gnsudnshxujenduxhsixisjxuu.pptx
rowvinafujimoto
 
Black and Blue Modern Technology Presentation.pdf
hjaders1104
 
DEVELOPING-PARAGRAPHS.pptx-developing...
rania680036
 
Empowering Artisans Through Technology Karmakar App Concept
yellowslice2
 
Great_Discoverers_Nohzyxyxyzyzyzyzzyz_Imagptx
kevadiyahem07
 
sCREW cONVEYOR AUGER DAF SLUDGE SYSTEM TO
viksurs
 
AI Intervention in Design & Content Creation
YellowSlice1
 
Adjective..pptxujjjjjjjjjjjjjjjjjjjjjjjj
seemanodiyal
 
Adobe Creative Cloud Cleaner Tool Crack Free Download Latest Version 2025
Slideshare
 
Ai vehicle traffic signal detector research proposal.docx
DavidNameza
 
WEEK3-Literary-Gennnnnnnnnnnnnnnnnres.pdf
MaybelynVergara
 
Visit Biogas Refresher Slide_Jun 2025.pptx
isyraffemir
 

Java 例外處理壞味道與重構技術

  • 4. 4
  • 5. 5
  • 6. 6
  • 7. 7
  • 11. • Correctness – Contract Specification(超出範圍) • Robustness – Exception Handling Copyright@2013 Teddysoft
  • 16. 16 EH smell Refactoring Ignored checked exception Replace Ignored Checked Exception with Unchecked Exception Unprotected main program Avoid Unexpected Termination with Big Outer Try Block Dummy handler Replace Dummy Handler with Rethrow Nested try block Replace Nested Try Block with Method Ignored checked exception, Dummy handler Introduce Checkpoint Class Spare handler Introduce Resourceful Try Clause Copyright@2013 Teddysoft
  • 17. public void writeFile(String fileName, String data) { Writer writer = null; try { writer = new FileWriter(fileName); /* may throw an IOException */ writer.write(data); /* may throw an IOException */ } catch (IOException e) { /* ignoring the exception */ } } ↓ public void writeFile(String fileName, String data) { Writer writer = null; try { writer = new FileWriter(fileName); /* may throw an IOException */ writer.write(data); /* may throw an IOException */ } catch (IOException e) { throw new UnhandledException(e, “message”); } } 17 Copyright@2013 Teddysoft
  • 18. 18 static public void main(String[] args) { /* some code */ } ↓ static public void main(String[] args) { try { /* some code */ } catch (Throwable e) { /* displaying and/or logging the exception */ } } Copyright@2013 Teddysoft
  • 19. 19 catch (AnException e) { e.printStackTrace(); } ↓ catch (AnException e) { throw new UnhandledException(e, “message”); } Copyright@2013 Teddysoft
  • 20. 20 FileInputStream in = null; try { in = new FileInputStream(…); } finally { try { if (in != null) in.close (); } catch (IOException e) { /* log the exception */ } } ↓ FileInputStream in = null; try { in = new FileInputStream(…); } finally { closeIO (in); } private void closeIO (Closeable c) { try { if (c != null) c.close (); } catch (IOException e) { /* log the exception */ } } Copyright@2013 Teddysoft
  • 21. 21 public void foo () throws FailureException { try { /* code that may change the state of the object */ } catch (AnException e) { throw new FailureException(e); } finally {/* code for cleanup */} } ↓ public void foo () throws FailureException { Checkpoint cp = new Checkpoint (/* parameters */); try { cp. establish (); /* establish a checkpoint */ /* code that may change the state of the object */ } catch (AnException e) { cp.restore (); /* restore the checkpoint */ throw new FailureException(e); } finally { cp.drop(); } } Copyright@2013 Teddysoft
  • 22. 22 try { /* primary */ } catch (SomeException e) { try {/* alternative */} catch(AnotherException e) { throw new FailureException(e); } } ↓ int attempt = 0; int maxAttempt = 2; boolean retry = false; do { try { retry = false; if (attempt == 0) { /* primary */ } else { /* alternative */ } } catch (SomeException e) { attempt++; retry = true; if (attempt > maxAttempt) throw new FailureException (e); } } while (attempt<= maxAttempt && retry) Copyright@2013 Teddysoft
  • 24. • CSS is a banking application for checking customers’ credit history in processing their loan applications 24 Credit Scoring System (CSS) Gateway (IBM Message Queue) Joint Credit Information Center (JCIC) Authentication (Domino Server) Other Applications Copyright@2013 Teddysoft
  • 25. • The use of exceptions and return code were mixed in an arbitrary manner • Many checked exceptions were caught and ignored • Unchecked exceptions were not caught which lead to an unexpected termination of the JSP program • Failure atomicity of each component was not investigated 25 Copyright@2013 Teddysoft
  • 26. • Bug fixing is a strong force drawing the developer’s attention to deal with exceptions • Cost-effectiveness measurements can be provided to convince the management to support the refactoring – Improving quality, saving maintenance cost, and increasing customer satisfaction 26 Copyright@2013 Teddysoft
  • 27. Reported failure Failing operation/ possible reason Failure count Current restoration actions Restoration time per failure Cannot make a connection to Domino server User login/ Connections of Domino Internet Inter-ORB Protocol (DIIOP) were exhausted. It was likely that DIIOP connections were not correctly disposed. 125 1. Rebooting Domino server 2. Rebooting CSS About 20 minutes MQ server connection is broken Sending request to JCJS/ MQ connections were exhausted. Perhaps they were not properly released. 66 1. Rebooting MQ Server 2. Rebooting CSS About 10 minutes Cannot send messages to MQ server Sending request to JCJS/ There were two possible reasons: Message queue was full. Gateway was offline due to maintenance or crash. 10 1. Rebooting MQ Server 2. Rebooting CSS About 10 minutes 27
  • 28. 28 Credit Scoring System (CSS) Gateway (IBM Message Queue) Joint Credit Information Center (JCIC) Authentication (Domino Server 1) Other Applications Authentication (Domino Server 2) X Copyright@2013 Teddysoft
  • 29. 29 Reported failure Failure count from Sep. 2005 to Dec. 2005 Failure count from Sep. 2006 to Dec. 2006 Sep. Oct. Nov. Dec. Sep. Oct. Nov. Dec. Cannot make a connection to Domino server 13 5 9 14 10 5 0 0 MQ Server connection broken 6 1 4 8 3/0 0 1/0 0 Cannot send messages to MQ Server 0 0 0 2 3/0 1/0 0 0 Copyright@2013 Teddysoft
  • 30. 30 Code type Total vs. modified code Modification percentage Non-commented line of code 14150/371 2.63% Catch clauses 855/21 2.46% Copyright@2013 Teddysoft
  • 31. 31 Task Man-hours Sum Collecting bugs reports in 2005 10 18 (43.9%) Refactoring cost (Code review) 7 (30.4%) Refactoring cost (Exception Handling goal analysis) 4 (17.4%) Refactoring cost (Coding) 3 (13%) Refactoring cost (Testing) 9 (39.2%) Total man-hours in applying refactoring 23 (56.1%) Total man-hours in improving robustness 41 (100%) Copyright@2013 Teddysoft
  • 32. 32 Cost element Cost calculation Maintenance cost in 2005 201 (failure) * 2 (hours) * 100 (US$) = 40,200 (US$) Refactoring cost 41 (man-hours) * 100 (US$) = 4,100 (US$) Maintenance cost saving in the following year (money) 40,200 (US$) – 4,100 (US$) = 36,100 (US$) Maintenance cost saving in the following year (percentage) 36,100 (US$) / 40,200 (US$) * 100 = 89.8% Copyright@2013 Teddysoft
  • 33. 33Copyright@2013 Teddysoft EH smell Refactoring Ignored checked exception Replace Ignored Checked Exception with Unchecked Exception Unprotected main program Avoid Unexpected Termination with Big Outer Try Block Dummy handler Replace Dummy Handler with Rethrow Nested try block Replace Nested Try Block with Method Ignored checked exception, Dummy handler Introduce Checkpoint Class Spare handler Introduce Resourceful Try Clause