1 / 9

Anirban De Jeffrey Harry Yves Lepouchard Peixin Li Pinchao Lu

Exception Mechanisms. Anirban De Jeffrey Harry Yves Lepouchard Peixin Li Pinchao Lu. Why we should care about exceptions. Ariane 5 Maiden Flight Computer automation is everywhere: in your daily life in critical systems Exception handling Our project deals with: Java

andrew
Download Presentation

Anirban De Jeffrey Harry Yves Lepouchard Peixin Li Pinchao Lu

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Exception Mechanisms Anirban De Jeffrey Harry Yves Lepouchard Peixin Li Pinchao Lu

  2. Why we should care about exceptions • Ariane 5 Maiden Flight • Computer automation is everywhere: • in your daily life • in critical systems • Exception handling • Our project deals with: Java = THE HOT programming language HOT CS655 Project Presentation

  3. Java Exception Handling • Exceptions are objects • Multilevel Model • Termination Model STOP! Server END Try { Workers Finally Cleaners } Catch { Handlers } Check Receive CS655 Project Presentation

  4. Exception Handling Enhancements RESCUE-RETRY CONSTRUCT /* Attempt to transmit a message 100 times and set “tx_successful” */ Public void transmit_message(String message) { if (tx_failures < 100) { attempt_transmission(message); tx_successful = true; } else tx_successful = false; /** rescue { tx_failures = tx_failures + 1; retry; } **/ CS655 Project Presentation

  5. Exception Handling Enhancements • Rescue-Retry added using JJTree and JavaCC • JJTree is a bottom-up Parse Tree Builder • JavaCC uses the output of JJTree to generate the Lexer/Parser • Generates a top-down, recursive descent parser • Partial EBNF Notation for Rescue-Retry: void MethodBodyBlock( ) : { [ RequireClause( ) ] ( BlockStatement( ) )* [EnsureClause( ) ] [RescueClause( )] } void RescueClause( ) : { <RESCUE> [ (RescueCatch( ) “;”)+ ] ] <ASSRN_END> } void RescueCatch( ) : { ( "catch" "(" FormalParameter() ")" )? "{" ( BlockStatement() | RetryStatement() )* “}” } CS655 Project Presentation

  6. Evaluation Things we sort of already knew... • Java is slow, more Java is slower. • Given a Java program, adding more Java is going to make it larger. We didn’t know how much slower/larger... CS655 Project Presentation

  7. Evaluation How much slower is Jass? How much larger? CS655 Project Presentation

  8. Conclusion It’s a hog, it’s slow, it’s big... Value inside (Safe, reusable error-free code.) BUT... CS655 Project Presentation

  9. Java Exception Handling CS655 Project Presentation

More Related