Supercharge Your Innovation With Domain-Expert AI Agents!

Java exception handling method

An exception handling and exception technology, applied in the field of Java exception handling, can solve the problems of program stability and reliability, low software reliability, easy to expose vulnerabilities, etc., and achieve the effect of improving program stability, program usability and user experience.

Inactive Publication Date: 2021-02-05
SICHUAN CHANGHONG ELECTRIC CO LTD
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0008] In order to solve the problems existing in the prior art, the purpose of the present invention is to provide a Java exception handling method. The present invention adopts the program in different operating environments and uses different exception handling mechanisms to solve the problem that the program is easy to expose loopholes and users in the development environment. The problem that the use environment program is stable and reliable cannot be taken into account; the fault tolerance of the software code is too good, and it is difficult for programmers and testers to find loopholes; the fault tolerance of the software is too poor, and the software reliability is low; through this method, the software is easy to expose loopholes in the development stage , safe and reliable during user use

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Java exception handling method
  • Java exception handling method
  • Java exception handling method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0020]A Java exception handling method, including:

[0021]1. Set the operating mode for the program, divided into development mode and user mode, the program is in user mode by default;

[0022]2. Switch operation mode, switch operation mode through user input and system attribute;

[0023]3. Runtime exception handling: In the development mode, the program will crash by not handling the runtime exception or catching the exception before throwing it; in the user mode, the program will actively catch and handle the runtime exception so that the program will not crash. , The code is as follows:

[0024]

[0025]4. Checked exception handling: In development mode, for checked exceptions, after the program catches the exception, manually throw exceptions to make the program crash; in user mode, for checked exceptions, the program no longer throws exceptions, the code As follows:

[0026]

[0027]5. Parameter exception handling: In the development mode, the parameter is not checked or throws an exception afte...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a Java exception handling method which comprises the following steps: setting running modes for a program, the running modes comprising a development mode and a user mode; andswitching the operation modes, and adopting different exception handling mechanisms for different operation modes. According to the method, different exception handling mechanisms are used for programs in different running environments, so that the problems that bugs are easily exposed in a development environment and the programs in a user use environment are stable and reliable and cannot be considered at the same time are solved; the problems that software code fault tolerance is too good, and programmers and testers are difficult to discover vulnerabilities, and the software fault tolerance is poor, and the software reliability is low are solved. Through the method, software is easy to expose vulnerabilities in a development stage and is safe and reliable in a user use stage.

Description

Technical field[0001]The invention relates to the technical field of software development, in particular to a Java exception processing method.Background technique[0002]Exceptions are some errors in the program. There are many reasons for exceptions, such as: the user has entered illegal data, the file to be opened does not exist, the connection is interrupted during network communication, or the JVM memory overflows.[0003]Some of these exceptions are caused by user errors, some are caused by program errors, and others are caused by physical errors.[0004]In program design, exception handling is a very critical and important part. The quality of the exception handling framework of a program directly affects the code quality of the entire project and the cost and difficulty of subsequent maintenance.[0005]The current Java exception handling technology has been very mature after years of development. There are also many exception information processing methods. How to handle exceptions...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F11/36
CPCG06F11/3688
Inventor 田伟张孝友
Owner SICHUAN CHANGHONG ELECTRIC CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More