首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到19条相似文献,搜索用时 93 毫秒
1.
Java语言的异常处理设计原则   总被引:4,自引:0,他引:4  
异常处理是Java语言的重要语言机制,正确地处理异常对程序的可靠性、健壮性是十分重要的。回顾了异常处理技术的概念和思想,对异常处理提出了一套实用的设计原则,并针对Java语言的具体环境,分类介绍了各种异常的常用处理方式。  相似文献   

2.
异常处理是程序设计中必须重点考虑的问题。在深入剖析Java语言的异常处理机制基础上,对Java异常处理提出了指导原则,从而可以提高程序的安全性和健壮性。  相似文献   

3.
Java异常处理策略研究   总被引:1,自引:0,他引:1  
异常处理机制是程序设计语言的重要标志之一,在程序设计过程中用来处理程序运行中的异常。传统的程序设计语言里异常处理较为繁杂。Java是一种面向对象的程序设计语言,且引入了异常处理机制。合理完备的异常处理可以增强程序运行的可靠性、提高软件的健壮性,可以较为快速地确定错误的位置。文章分析了Java异常处理的逻辑,阐述了异常类、异常处理机制以及异常处理方法,提出了异常处理的一些策略。综合运用这些策略可以使编程人员编写出更加简洁、高效的程序代码。  相似文献   

4.
异常处理是Java语言的重要机制,正确、合理地处理对电脑有着极为重要的作用,尤其是对于电脑的稳定性和安全性。异常主要有三类,包括异常处理语句的定义、捕捉异常和程序流程跳转等。  相似文献   

5.
异常处理机制是程序设计语言的重要标志之一,在程序设计过程中用来处理程序运行中的异常.传统的程序设计语言里异常处理较为繁杂. Java 是一种面向对象的程序设计语言,且引入了异常处理机制.合理完备的异常处理可以增强程序运行的可靠性、提高软件的健壮性,可以较为快速地确定错误的位置.文章分析了 Java 异常处理的逻辑,阐述了异常类、异常处理机制以及异常处理方法,提出了异常处理的一些策略.综合运用这些策略可以使编程人员编写出更加简洁、高效的程序代码.  相似文献   

6.
异常处理机制是Java语言的一大特色。从异常处理的机制、异常处理的方法、异常处理的原则等方面介绍Java语言的异常处理技术,分析了抛出异常和捕获异常的实际应用及注意事项,以便更好地利用异常处理机制解决实际问题。  相似文献   

7.
Java虚拟机异常处理机制的设计与实现   总被引:5,自引:1,他引:4  
异常处理机制是程序设计语言的重要特征之一,它为开发可靠性软件系统提供了强有力的支持,介绍了不同语言的异常处理机制,对Java语言的异常处理机制进行了详细论述,最后结合国产开放系统平台COSIX虚拟机异常处理的设计,深入探讨了在解释才及时编译执行两种不同的情况下,异常处理设计与实现的关键技术。  相似文献   

8.
异常处理机制是Java语言的一大特色。从异常处理的机制、异常处理的方法、异常处理的原则等方面介绍Java语言的异常处理技术,分析了抛出异常和捕获异常的实际应用及注意事项,以便更好地利用异常处理机制解决实际问题。  相似文献   

9.
Java虚拟机中异常机制实时性的研究及实现   总被引:1,自引:0,他引:1       下载免费PDF全文
异常处理机制是程序设计语言的重要特征之一。讨论了对Java异常处理进行实时性改造的可行性和具体方法,并且在Linux平台上,实现了对开源Java虚拟机SableVM中异常处理机制的实时性改造。实验结果表明改进后的虚拟机在异常捕获时间趋于线性的同时,异常表查询效率也得到了提高。  相似文献   

10.
随着系统规模的不断扩大,传统的异常处理技术已经成为创建大型可维护程序的障碍了。Jaya是一种面向对象的程序设计语言,Java的异常处理非常出色。Java把异常封装到类里,运用“try/catch/finally”异常处理机制,最终得到的是更为“健壮”的异常处理代码。结合开发实践,用实例说明了Java异常处理如何具体应用。  相似文献   

11.
Java的异常处理机制是其一大特色。该文在介绍Java语言的异常处理技术的基础上,提出了异常处理的设计原则,从而为Java的程序设计实现提供技术上的借鉴。  相似文献   

12.
The frequent occurrence of implicitly thrown exceptions poses one of the challenges present in a Java compiler. Not only do these implicitly thrown exceptions directly affect the performance by requiring explicit checks, they also indirectly impact the performance by restricting code movement in order to satisfy the precise exception model in Java. In particular, instruction scheduling is one transformation that is restricted by implicitly thrown exceptions due to the heavy reliance on reordering instructions to exploit maximum hardware performance. The goal of this study is two-fold: first, investigate the degree to which implicitly thrown exceptions in Java hinder instruction scheduling, and second, find new techniques for allowing more efficient execution of Java programs containing implicitly thrown exceptions. Experimental results show that with aggressive scheduling techniques, such as superblock scheduling, the negative performance impact can be greatly reduced.  相似文献   

13.
异常处理机制是Java程序设计中的一个重要方面,正确使用异常处理的策略和方法,能够确保Java程序结构的清晰性、易读性和健壮性。分析了Java异常的体系结构,阐述了异常分类与处理机制,提出了异常处理的一般原则和一种异常处理框架,并结合实际应用对该框架进行了详细描述。  相似文献   

14.
对Java程序设计中出现的异常处理技术进行了研究,对Java异常处理知识进行了必要的介绍和简单的分析,并总结了几种在Java程序设计中如何定义和使用异常类。  相似文献   

15.
提出了一种新的并行Java程序异常处理的监护模型。该模型针对并行Java程序异步信息传递方式进行异常处理。当并行Java程序的某个线程出现异常时,该线程的监护模块把检测到的异常情况的信息传递到其它线程的监护模块,每个线程根据当前事项与异常事项的向量时钟关系,对当前事项进行回滚或停止操作,以达到对并行Java程序的保护。过去一些并行程序的监护方案是在信息交换的基础上把并行程序结构化为许多原子行为,把多个并行异常当作单个异常进行处理,具有较大的局限性。提出的监护模型是从全局上对并行Java程序的异常情况进行处理,并指导每个线程根据自身情况作出相应反映。实验证明提出的新的并行Java程序监护模型具有较强的实际操作性,并能有效地保护并行Java程序。  相似文献   

16.
刘振安  张强 《测控技术》2006,25(11):61-63
提出一种基于类文件的Java运行时异常分析技术.它可在没有Java源代码文件的情况下,直接对类文件进行处理,分析可能抛出的异常信息,并根据分析结果在类文件中添加适当的异常追踪代码.这种处理后的类文件可无缝替换原类文件运行,并在运行中抛出异常时,能够给出详尽的异常分析报告,从而提高技术人员调试和开发的效率.  相似文献   

17.
Java uses exceptions to provide elegant error handling capabilities during program execution. However, the presence of exception handlers complicates the job of the just‐in‐time (JIT) compiler, while exceptions are rarely used in most programs. This paper describes two techniques for reducing such complications. First, we delay the translation of an exception handler until the exception really occurs. This on‐demand translation of exception handlers allows more optimizations when translating the main flow, without being hindered by constraints caused by the exception flows. Secondly, for those exceptions that are actually thrown during program execution we insert exception‐type check code and a direct branch to the translated exception handlers. This exception handler prediction is motivated by an observation that frequently thrown exceptions are likely to be handled by the same exception handlers, so this will eliminate the exception processing overhead of the Java virtual machine. Our experiments indicate that the code quality of the main flow is no longer affected by the presence of exception handlers. Also, frequently thrown exceptions can be efficiently handled by the exception handler prediction. Copyright © 2004 John Wiley & Sons, Ltd.  相似文献   

18.
Recent researches have reported that Android programs are vulnerable to unexpected exceptions. One reason is that the current design of Android platform solely depends on Java exception mechanism, which is unaware of the component-based structure of Android programs. This paper proposes a component-level exception mechanism for programmers to build robust Android programs with. With the mechanism, they can define an intra-component handler for each component to recover from exceptions, and they can propagate uncaught exceptions to caller component along the reverse of component activation flow. Theoretically, we have formalized an Android semantics with exceptions to prove the robustness property of the mechanism. In practice, we have implemented the mechanism with a domain-specific library that extends existing Android components. This lightweight approach does not demand the change of the Android platform. In our experiment with Android benchmark programs, the library is found to catch a number of runtime exceptions that would otherwise get the programs terminated abnormally. We also measure the overhead of using the library to show that it is very small. Our proposal is a new mechanism for defending Android programs from unexpected exceptions.  相似文献   

19.
Java异常处理机制研究   总被引:2,自引:0,他引:2  
异常处理机制是程序设计语言的主要特征,它为开发稳定的软件系统提供了有力的支持.文章对Java语言的异常处理机制以及异常类的层次进行了详细介绍,提出了Java异常处理策略.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号