首页 | 官方网站   微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 125 毫秒
1.
异常处理机制是Java程序设计中的一个重要方面,正确使用异常处理的策略和方法,能够确保Java程序结构的清晰性、易读性和健壮性。分析了Java异常的体系结构,阐述了异常分类与处理机制,提出了异常处理的一般原则和一种异常处理框架,并结合实际应用对该框架进行了详细描述。  相似文献   

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

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

4.
Java异常处理     
异常处理是Java程序设计中一个非常重要的机制,也是程序设计的一大难点,就异常和异常处理方式等方面进行介绍,并通过一个实例来验证异常。  相似文献   

5.
Java中可检查异常的使用策略   总被引:1,自引:0,他引:1  
强大的异常处理是Java的一大优势.可检查异常是程序设计中流程所能控制的部分,也是程序设计中异常处理的核心.有效的使用可检查异常能加强程序的健壮性.本文对于可检查异常的处理提出一些使用策略.  相似文献   

6.
Java异常处理   总被引:4,自引:0,他引:4  
强大的异常处理机制是Java的一大优势,正确地使用Java异常处理能够使程序更健壮,但在实际应用中对Java异常处理存在很多不合理的地方.对Java异常处理机制和异常类层次作了简单介绍,并对异常处理中应该注意的事项作了一个总结.  相似文献   

7.
Java语言的关键性技术之一就是异常处理,这一技术能够快速精准地完成对语言程序中的异常进行识别和处理,从而让Java程序语言保持足够的可靠性.提出了Java语言的异常化处理优势后,对于Java语言可能出现的异常进行分类,对于异常处理技术的原理进行解释,并简单分析了两种异常处理方式.  相似文献   

8.
Java程序设计课程教学中遇到的问题和对策   总被引:2,自引:1,他引:1  
李瑞生 《计算机教育》2010,(22):119-122
通过对Java程序设计课程教学中遇到的问题的分析,从完善教学内容、提高学生实践能力和创新能力等方面讨论了Java程序设计课程教学,提出了一种Java教学的新方法。  相似文献   

9.
在高校Java程序设计教学中,基于图形用户界面的应用程序和网络程序设计是教学的重点,这使得采用方便应用和业界流行的可视化开发环境成为必要。文章简单分析Eclipse在高校Java教学中的适用性,探讨基于Eclipse和Visual Editor的Java可视化程序设计教学,其中对Java可视化开发平台配置和应用示例的详细介绍,可为Java可视化程序设计教学提供参考。  相似文献   

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

11.
Techniques for Supporting Dynamic and Adaptive Workflow   总被引:30,自引:0,他引:30  
The unpredictability of business processes requires that workflowsystems support exception handling with the ability to dynamicallyadapt to the changing environment. Traditional approaches to handlingthis problem have fallen short, providing little support for change,particularly once the process has begun execution. Further,exceptions vary widely in their character and significance,challenging the application of any single approach to handling them.We briefly discuss the classification of exceptions, highlightingdiffering impacts on the workflow model. Based on this discussion, wesuggest principal goals to address in the development of adaptiveworkflow support, including strategies for avoiding exceptions,detecting them when they occur, and handling them at various levels ofimpact. We then identify a number of specific approaches to supportingthese goals within the design of a workflow system infrastructure.Finally, we describe the implementation of many of these approaches inthe Endeavors workflow support system.  相似文献   

12.
Exception handling enables programmers to specify the behavior of a program when an exceptional event occurs at runtime. Exception handling, thus, facilitates software fault tolerance and the production of reliable and robust software systems. With the recent emergence of multi-processor systems and parallel programming constructs, techniques are needed that provide exception handling support in these environments that are intuitive and easy to use. Unfortunately, extant semantics of exception handling for concurrent settings is significantly more complex to reason about than their serial counterparts.In this paper, we investigate a similarly intuitive semantics for exception handling for the future parallel programming construct in Java. Futures are used by programmers to identify potentially asynchronous computations and to introduce parallelism into sequential programs. The intent of futures is to provide some performance benefits through the use of method-level concurrency while maintaining as-if-serial semantics that novice programmers can easily understand — the semantics of a program with futures is the same as that for an equivalent serial version of the program. We extend this model to provide as-if-serial exception handling semantics. Using this model our runtime delivers exceptions to the same point it would deliver them if the program was executed sequentially. We present the design and implementation of our approach and evaluate its efficiency using an open source Java virtual machine.  相似文献   

13.
ContextIn software, there are the error cases that are anticipated at specification and design time, those encountered at development and testing time, and those that were never anticipated before happening in production. Is it possible to learn from the anticipated errors during design to analyze and improve the resilience against the unanticipated ones in production?ObjectiveIn this paper, we aim at analyzing and improving how software handles unanticipated exceptions. The first objective is to set up contracts about exception handling and a way to assess them automatically. The second one is to improve the resilience capabilities of software by transforming the source code.MethodWe devise an algorithm, called short-circuit testing, which injects exceptions during test suite execution so as to simulate unanticipated errors. It is a kind of fault-injection techniques dedicated to exception-handling. This algorithm collects data that is used for verifying two formal contracts that capture two resilience properties w.r.t. exceptions: the source-independence and pure-resilience contracts. Then we propose a code modification technique, called “catch-stretching” which allows error-recovery code (of the form of catch blocks) to be more resilient.ResultsOur evaluation is performed on 9 open-source software applications and consists in analyzing 241 catch blocks executed during test suite execution. Our results show that 101/214 of them (47%) expose resilience properties as defined by our exception contracts and that 84/214 of them (39%) can be transformed to be more resilient.ConclusionOur work shows that it is possible to reason on software resilience by injecting exceptions during test suite execution. The collected information allows us to apply one source code transformation that improves the resilience against unanticipated exceptions. This works best if the test suite exercises the exceptional programming language constructs in many different scenarios.  相似文献   

14.
As aspects extend or replace existing functionality at specific join points in the code, their behavior may raise new exceptions, which can flow through the program execution in unexpected ways. Assuring the reliability of exception handling code in aspect-oriented (AO) systems is a challenging task. Testing the exception handling code is inherently difficult, since it is tricky to provoke all exceptions during tests, and the large number of different exceptions that can happen in a system may lead to the test-case explosion problem. Moreover, we have observed that some properties of AO programming (e.g., quantification, obliviousness) may conflict with characteristics of exception handling mechanisms, exacerbating existing problems (e.g., uncaught exceptions). The lack of verification approaches for exception handling code in AO systems stimulated the present work. This work presents a verification approach based on a static analysis tool, called SAFE, to check the reliability of exception handling code in AspectJ programs. We evaluated the effectiveness and feasibility of our approach in two complementary ways (i) by investigating if the SAFE tool is precise enough to uncover exception flow information and (ii) by applying the approach to three medium-sized ApectJ systems from different application domains.  相似文献   

15.
It is more important to properly handle exceptions, than to prevent exceptions from occurring, because they arise from so many different causes. In embedded systems, a vast number of exceptions are caused by hardware devices. In such cases, numerous software components are involved in these hardware device-originated exceptions, ranging from the device itself to the device driver, the kernel, and applications. Therefore, it takes a lot of time to debug software that fails to handle exceptions. This paper proposes a lightweight device exception testing method, and a related automation tool, AMOS v3.0. The proposed method artificially triggers more realistic device exceptions in runtime, and monitors how software components handle exceptions in detail. AMOS v3.0 has been applied to the exception testing of car-infotainment systems in an automobile company. The results based on this industrial field study have revealed that 39.13% of the failures in exception handling were caused by applications, 36.23% of the failures were caused by device drivers, and 24.64% were derived from the kernel. We conclude that the proposed method is highly effective, in that it can allow developers to identify the root cause of failure for exception handling.  相似文献   

16.
This paper addresses a simple but critical question: how can we create robust multi-agent systems out of the often unreliable agents and infrastructures we can expect to find in open systems contexts? We propose an approach to this problem based on distinct exception handling (EH) services that enact coordination protocol-specific but domain-independent strategies to monitor agent systems for problems (‘exceptions’) and intervene when necessary to avoid or resolve them. The value of this approach is demonstrated for the ‘agent death’ exception in the Contract Net protocol; we show through simulation that the EH service approach provides substantially improved performance compared to existing approaches in a way that is appropriate for open multi-agent systems.  相似文献   

17.
Java语言的异常处理设计原则   总被引:4,自引:0,他引:4  
异常处理是Java语言的重要语言机制,正确地处理异常对程序的可靠性、健壮性是十分重要的。回顾了异常处理技术的概念和思想,对异常处理提出了一套实用的设计原则,并针对Java语言的具体环境,分类介绍了各种异常的常用处理方式。  相似文献   

18.
C++程序中异常处理的分析与测试技术研究   总被引:2,自引:1,他引:2  
异常处理机制是一种运行时错误通知机制,将程序的正常控制代码和错误处理代码分离.然而异常机制的引入使得程序控制信息变得更为复杂;且开发人员一般难以熟练使用它,导致程序中会潜伏许多异常错误.扩展已有的显式异常分析技术,对隐式异常也进行了全面的分析并提出了过程间(内)控制流图的构造方法,并以此为基础给出了一个C++程序健壮性改进模型.同时还提出了针对异常的两种动态测试策略:基于约束求解的异常测试策略和统计结构性异常测试策略.最后实现了一个初步的异常分析与测试原型工具并进行了初步实验分析,其结果表明本文提出的分析与测试方法对程序质量有较大程度的提高.  相似文献   

19.
Java异常处理机制的研究   总被引:7,自引:0,他引:7  
杨厚群  陈静 《计算机科学》2007,34(3):286-289
异常处理是Java语言的重要语言机制,正确、合理地处理异常对程序的可靠性、健壮性是十分重要的。在分析了异常处理技术的概念和思想后,对异常处理提出了指导原则,并针对检查型异常和非检查型异常的差异,探讨了对应的解决措施。  相似文献   

20.
《Information Systems》2001,26(2):93-120
Exception handling in workflow management systems (WFMSs) is a very important problem since it is not possible to specify all possible outcomes and alternatives. Effective reuse of existing exception handlers can greatly help in dealing with workflow exceptions. On the other hand, cooperative support for user-driven computer supported resolution of unexpected exceptions and workflow evolution at run-time is vital for an adaptive WFMS. We have been developing ADOME-WFMS as a comprehensive framework in which the problem of workflow exception handling can be adequately addressed. In this article, we present an adaptive exception manager and its web-based interface for ADOME-WFMS with procedures for supporting the following: reuse of exception handlers, thorough and automated resolution of expected exceptions, effective management of Problem Solving Agents, cooperative exception handling, user-driven computer supported resolution of unexpected exceptions, and workflow evolution.  相似文献   

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

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

京公网安备 11010802026262号