scispace - formally typeset
Search or ask a question

Showing papers on "Java annotation published in 2003"


Book
01 Jan 2003
TL;DR: This is a practical guide to AOP and Aspect J, which enables AOP programming in Java by adding a few new language constructs and re-usable code examples will enable quick implementation of functionality.
Abstract: This is a practical guide to AOP and Aspect J. The re-usable code examples will enable quick implementation of functionality.*ApectJ enables AOP programming in Java by adding a few new language constructs.By using Java as the base language and creating a final system that is compatible with Java byte code specification, AspectJ passes on all the benefits of Java. *The use of Java as the base language also makes AspectJ a relatively easy language to learn. *Book is divided into three parts: Introduction, Examples and everyday situations in which to use. A software system is the realization of a set of concerns. One of the central premises of object-oriented programming is that each concern should be implemented as a separate module. However, there are certain system-wide concerns, such as logging, security, performance and so forth, that often need to be addressed in many, if not all of the modules. Consequently, the code to handle these system-wide concerns may be mixed in with the core logic of a huge number of modules, resulting in lower productivity, poor quality and systems that are hard to evolve.Aspect-oriented programming overcomes these problems by modularizing the system-wide concerns. AspectJ enables AOP programming in Java by adding a few new language constructs. By using Java as the base language and creating a final system that is compatible with Java byte code specification, AspectJ passes on all the benefits of Java. The use of Java as the base language also makesd AspectJ a relatively easy language to learn.

520 citations


Book ChapterDOI
07 Apr 2003
TL;DR: This paper focuses on the design choices in Polyglot that are important for making the framework usable and highly extensible.
Abstract: Polyglot is an extensible compiler framework that supports the easy creation of compilers for languages similar to Java, while avoiding code duplication. The Polyglot framework is useful for domain-specific languages, exploration of language design, and for simplified versions of Java for pedagogical use. We have used Polyglot to implement several major and minor modifications to Java; the cost of implementing language extensions scales well with the degree to which the language differs from Java. This paper focuses on the design choices in Polyglot that are important for making the framework usable and highly extensible. Polyglot source code is available.

418 citations


Journal ArticleDOI
TL;DR: An overview of the main ideas behind JML, the dierent groups collaborating to provide tools for J ML, and the existing applications of JML is given.

394 citations


Proceedings ArticleDOI
11 Jan 2003
TL;DR: Some existing programming tools are discussed, their drawbacks are explained, and why Expresso is different is described, and a detailed list of typical errors made by novice programmers is included, used in the construction of the Expresso tool.
Abstract: Programming in Java can be a daunting task for introductory students, one that is only compounded by the cryptic compiler error messages they see when they first start to write actual code. This article details a project conducted by faculty and advanced students in the creation of an educational tool for Java programming, called Expresso. This paper discusses some existing programming tools, explains their drawbacks, and describes why Expresso is different. We also include a detailed list of typical errors made by novice programmers, used in the construction of the Expresso tool.

220 citations


Proceedings ArticleDOI
10 May 2003
TL;DR: The Java analysis tool analyzes Java programs and detects design patterns in legacy code combining static and dynamic analyses, and discusses the approach for the observer, composite, mediator, chain of responsibility and visitor patterns.
Abstract: We detect design patterns in legacy code combining static and dynamic analyses. The analyses do not depend on coding or naming conventions. We classify potential pattern instances according to the evidence our analyses provide. We discuss our approach for the observer, composite, mediator, chain of responsibility and visitor patterns. Our Java analysis tool analyzes Java programs. We evaluate our approach by applying the tool on itself and on the Java SwingSetExample using the Swing library.

196 citations



Book ChapterDOI
08 Sep 2003
TL;DR: In this article, the authors present a tool that allows to formally prove Java classes annotated with JML, an annotation language for Java that provides a framework for specifying class invariants and methods behaviours.
Abstract: This paper presents experiments on formal validation of Java applets. It describes a tool that has been developed at the Gemplus Research Labs. This tool allows to formally prove Java classes annotated with JML, an annotation language for Java that provides a framework for specifying class invariants and methods behaviours. The foundations and the main features of the tool are presented. The most innovative part of the tool is that it is tailored to be used by Java programmers, without any particular background in formal methods. To reduce the difficulty of using formal techniques, it aims to provide a user-friendly interface which hides to developers most of the formal features and provides a "Java style view" of lemmas.

127 citations


01 Jan 2003
TL;DR: This paper proposes Middleweight Java, MJ, as a contender for a minimal imperative core calculus for Java, and defines the syntax, type system and operational semantics of MJ, and gives a proof of type safety.
Abstract: In order to study rigorously object-oriented languages such as Java or C, a common practice is to define lightweight fragments, or calculi, which are sufficiently small to facilitate formal proofs of key properties. However many of the current proposals for calculi lack important language features. In this paper we propose Middleweight Java, MJ, as a contender for a minimal imperative core calculus for Java. Whilst compact, MJ models features such as object identity, field assignment, constructor methods and block structure. We define the syntax, type system and operational semantics of MJ, and give a proof of type safety. In order to demonstrate the usefulness of MJ to reason about operational features, we consider a recent proposal of Greenhouse and Boyland to extend Java with an effects system. This effects system is intended to delimit the scope of computational effects within a Java program. We define an extension of MJ with a similar effects system and instrument the operational semantics. We then prove the correctness of the effects system; a question left open by Greenhouse and Boyland. We also consider the question of effect inference for our extended calculus, detail an algorithm for inferring effects information and give a proof of correctness.

127 citations


Journal ArticleDOI
TL;DR: Lithium is implemented as a Java package and represents both the first skeleton based programming environment in Java and the first complete skeleton based Java environment exploiting macro-data flow implementation techniques.

110 citations


Proceedings ArticleDOI
T. Yoshikawa1, K. Shimura1, T. Ozawa1
06 Nov 2003
TL;DR: A random test program generator and a Java JIT compiler test system that automatically generates Java class files which are random, executable and finite, and then evaluates quality of generated random test programs.
Abstract: Java has been used widely, from servers to cellular phones. In order to test those Java runtime systems, many test tools have been provided. However these tools are not enough for Java JIT compilers. They should be tested by various executable bytecode sequences. Most test tools don't cover such kinds of a combination test. Therefore we developed a random test program generator and a Java JIT compiler test system. This test system automatically: 1) generates Java class files which are random, executable and finite; 2) inserts codes that output execution-process-dependent results; 3) runs these on the target JIT compiler and other tested Java runtimes; 4) compares results. In this paper, we describe how to generate random test programs, and how to test a Java JIT compiler, and then we evaluate quality (coverage) of generated random test programs.

98 citations


Journal ArticleDOI
TL;DR: A designed system to be as "student friendly" as possible is presented, built around ImageJ, a freely available, full-featured, and user-friendly program for image analysis.
Abstract: Image processing (IP) can be taught very effectively by complementing the basic lectures with computer laboratories where the participants can actively manipulate and process images. This offering can be made even more attractive by allowing the students to develop their own IP code within a reasonable time frame. A designed system to be as "student friendly" as possible is presented. The software is built around ImageJ, a freely available, full-featured, and user-friendly program for image analysis. The students can walk away from the course with an IP system that is operational. Using the ImageAccess interface layer, they can easily program both ImageJ plug-ins and Internet applets. The system that we have described may also appeal to practitioners as it offers simple, full-proof way of developing professional level IP software.

Patent
26 Nov 2003
TL;DR: The Trusted Java Virtual Machine (TJVM) as mentioned in this paper is a trusted Java virtual machine that provides a method for supporting tamper resistant applications, ensuring the integrity of an application and its secrets such as keys.
Abstract: A trusted Java virtual machine provides a method for supporting tamper-resistant applications, ensuring the integrity of an application and its secrets such as keys. The trusted Java virtual machine verifies the integrity of the Java application, prevents debugging of the Java application, and allows the Java application to securely store and retrieve secrets. The trusted Java virtual machine environment comprises a TrustedDictionary, a TrustedBundle, an optional encryption method for encrypting and decrypting byte codes, and an underlying trusted Java virtual machine. The encrypted TrustedDictionary protects data while the TrustedBundle protects programming code, allowing applications to store secret data and secure counters. The application designer can restrict TrustedBundle access to only those interfaces that the application designer explicitly exports. The open source code may optionally be encrypted. Secrets required by the open source programming code of the application are encrypted in TrustedDictionary.

Proceedings ArticleDOI
26 Sep 2003
TL;DR: This work presents a Java system dependence graph which draws on the strengths of a range of earlier works and adapts them, if necessary, to the Java language and provides guidance on the construction of the graph.
Abstract: The program dependence graph was introduced by Ottenstein and Ottenstein in 1984. It was suggested to be a suitable internal program representation for monolithic programs, for the purpose of carrying out certain software engineering operations such as slicing and the computation of program metrics. Since then, Horwitz et al. have introduced the multiprocedural equivalent system dependence graph. Several authors have proposed object-oriented dependence graph construction approaches. Every approach provides its own benefits, some of which are language specific. We present a Java system dependence graph which draws on the strengths of a range of earlier works and adapts them, if necessary, to the Java language. It also provides guidance on the construction of the graph, identifies potential research topics based on it and shows a completed graph with a slice highlighted for a small, but realistic example.

Proceedings ArticleDOI
26 Mar 2003
TL;DR: Xrefactory is presented, a refactoring browser for C and Java languages based on practical implementation and exemplified on renaming refactorings that can solve non-trivial complications introduced by the C pre-preprocessor.
Abstract: This paper presents Xrefactory a refactoring browser for C and Java languages. The paper discusses a way how refactoring browsers can thresh-passe non-trivial complications introduced by the C pre-preprocessor Resolving those problems is the next step toward so long expected refactoring browser for C++. Our solution is based on practical implementation and exemplified on renaming refactorings.

Journal ArticleDOI
TL;DR: Jam is an extension of the Java language supporting mixins, that is, parametric heir classes, and a Jam-to-Java translator is developed which makes Jam sources executable on every Java Virtual Machine.
Abstract: In this paper we present Jam, an extension of the Java language supporting mixins, that is, parametric heir classes. A mixin declaration in Jam is similar to a Java heir class declaration, except that it does not extend a fixed parent class, but simply specifies the set of fields and methods a generic parent should provide. In this way, the same mixin can be instantiated on many parent classes, producing different heirs, thus avoiding code duplication and largely improving modularity and reuse. Moreover, as happens for classes and interfaces, mixin names are reference types, and all the classes obtained by instantiating the same mixin are considered subtypes of the corresponding type, and hence can be handled in a uniform way through the common interface. This possibility allows a programming style where different ingredients are "mixed" together in defining a class; this paradigm is somewhat similar to that based on multiple inheritance, but avoids its complication.The language has been designed with the main objective in mind to obtain, rather than a new theoretical language, a working and smooth extension of Java. That means, on the design side, that we have faced the challenging problem of integrating the Java overall principles and complex type system with this new notion; on the implementation side, it means that we have developed a Jam-to-Java translator which makes Jam sources executable on every Java Virtual Machine.

Book ChapterDOI
TL;DR: This paper describes the architecture of JOP and proposes a simple real-time extension of Java for JOP, a hardware implementation of the Java Virtual Machine with focus on real- time applications.
Abstract: Java is still not a common language for embedded systems. It posses language features, like thread support, that can improve embedded system development, but common implementations as interpreter or just-in-time compiler are not practical. JOP is a hardware implementation of the Java Virtual Machine with focus on real-time applications. This paper describes the architecture of JOP and proposes a simple real-time extension of Java for JOP. First application in an industrial system showed that JOP is one way to use Java in the embedded world.

Patent
29 Apr 2003
TL;DR: In this paper, a Java application is debugged in a Java micro device by selectively loading from a host computer into the device, a subset of Java classes and/or Java resource files that is used during the debugging the Java application in the device.
Abstract: A Java application is debugged in a Java micro device by selectively loading from a host computer into the device, a subset of Java classes and/or Java resource files that is used during the debugging the Java application in the device, that is automatically selected from a set of Java classes and/or Java resource files in the host computer. Thus, the need to load a potentially huge Java ARchive (JAR) file that contains all classes and/or resources, at the start of debugging, can be reduced or eliminated. The invention also may be used to load modules that are used during debugging an application on a device from a host computer.

Journal ArticleDOI
TL;DR: A tool is described, called JavaMut, that implements 26 traditional and object-oriented mutation operators for supporting mutation analysis of Java programs, and provides a graphical user interface to make mutation analysis faster and less painful.
Abstract: Program mutation is a fault-based technique for measuring the effectiveness of test cases that, although powerful, is computationally expensive. The principal expense of mutation is that many faulty versions of the program under test, called mutants, must be created and repeatedly executed. This paper describes a tool, called JavaMut, that implements 26 traditional and object-oriented mutation operators for supporting mutation analysis of Java programs. The current version of that tool is based on syntactic analysis and reflection for implementing mutation operators. JavaMut is interactive; it provides a graphical user interface to make mutation analysis faster and less painful. Thanks to such automated tools, mutation analysis should be achieved within reasonable costs.

Proceedings ArticleDOI
26 Oct 2003
TL;DR: This work describes a complete system for gathering, computing and presenting dynamic metrics from Java programs that solves a number of practical and difficult problems related to metric gathering and analysis.
Abstract: We describe a complete system for gathering, computing and presenting dynamic metrics from Java programs. The system itself was motivated from our real goals in understanding program behaviour as compiler/runtime developers, and so solves a number of practical and difficult problems related to metric gathering and analysis.

Proceedings ArticleDOI
26 Oct 2003
TL;DR: ProfessorJ is a new programming environment that tailors the Java language and error messages to the students' needs and offers several language levels, from Beginner Java to Full Java.
Abstract: In the second-semester programming course at the University of Utah, we have observed that our students suffer unnecessarily from a mismatch between the course content and the programming environment. The course is typical, in that it exposes students to Java a little at a time. The programming environments are also typical, in that they report compilation and run-time errors in the jargon of professional programmers who use the full Java language. As a result, students rely heavily on teaching assistants to interpret error messages, and valuable classroom time is wasted on syntactic diversions.ProfessorJ is our new programming environment that remedies this problem. Like other pedagogical environments, such as BlueJ and DrJava, ProfessorJ presents the student with a simplified interface to the Java compiler and virtual machine. Unlike existing environments, ProfessorJ tailors the Java language and error messages to the students' needs. Since their needs evolve through the course, ProfessorJ offers several language levels, from Beginner Java to Full Java.

Proceedings ArticleDOI
26 Oct 2003
TL;DR: This paper describes how to add first-class generic types---including mixins---to strongly-typed OO languages with nominal subtyping such as Java and C# and discusses a practical implementation strategy that can be added to the existing Java language without any change to the underlying Java Virtual Machine.
Abstract: This paper describes how to add first-class generic types---including mixins---to strongly-typed OO languages with nominal subtyping such as Java and C#. A generic type system is "first-class" if generic types can appear in any context where conventional types can appear. In this context, a mixin is simply a generic class that extends one of its type parameters, e.g., a class C that extends T. Although mixins of this form are widely used in Cpp (via templates), they are clumsy and error-prone because Cpp treats mixins as macros, forcing each mixin instantiation to be separately compiled and type-checked. The abstraction embodied in a mixin is never separately analyzed.Our formulation of mixins using first-class genericity accommodates sound local (class-by-class) type checking. A mixin can be fully type-checked given symbol tables for each of the classes that it directly references---the same context in which Java performs incremental class compilation. To our knowledge, no previous formal analysis of first-class genericity in languages with nominal type systems has been conducted, which is surprising because nominal subtyping has become predominant in mainstream object-oriented programming languages.What makes our treatment of first-class genericity particularly interesting and important is the fact that it can be added to the existing Java language without any change to the underlying Java Virtual Machine. Moreover, the extension is backward compatible with legacy Java source and class files. Although our discussion of a practical implementation strategy focuses on Java, the same implementation techniques could be applied to other object-oriented languages such as C# or Eiffel that support incremental compilation, dynamic class loading, and nominal subtyping.

Proceedings ArticleDOI
26 Oct 2003
TL;DR: To experimentally validate the ability of MJ to properly handle the complex module inter-relationships found in large Java server systems, the classloader mechanisms of Apache Tomcat 4.1.18 were replaced with 30 MJ modules.
Abstract: While Java provides many software engineering benefits, it lacks a coherent module system and instead provides only packages (which are primarily a name space mechanism) and classloaders (which are very low-level). As a result, large Java applications suffer from unexpected interactions between independent components, require complex CLASSPATH definitions, and are often extremely complex to install and maintain. We have implemented a module system for Java called MJ that is implemented with class loaders, but provides a much higher-level interface. High-level properties can be specified in a module definition and are enforced by the module system as new modules are loaded. To experimentally validate the ability of MJ to properly handle the complex module inter-relationships found in large Java server systems, we replaced the classloader mechanisms of Apache Tomcat 4.1.18 [27] with 30 MJ modules. The modified Tomcat is functionally identical to the original, but requires no CLASSPATH definitions, and will operate correctly even if user code loads a different version of a module used by Tomcat, such as the Xerces XML parser [31]. Furthermore, by making a small change to the Java core libraries enabled by MJ, we obtained a 30% performance improvement in a servlet microbenchmark.

01 Jan 2003
TL;DR: The overall performance measurements show that, using the techniques introduced, a portable interpreter can deliver competitive interpretation performance, and even surpass that of a less-portable state-of-the-art interpreter on some benchmarks.
Abstract: Compilation to bytecode paired with interpretation is often used as a technique to easily build prototypes for new programming languages. Some languages, including Java, push this further and use the bytecode layer to isolate programs from the underlying platform. Current state-of-the-art commercial and research Java virtual machines implement advanced just-in-time and adaptive compilation techniques to deliver high-performance execution of Java bytecode. Yet, experimenting with new features such as adding new bytecodes or redesigning the type system can be a daunting task within these complex systems, when new features invalidate assumptions on which the internal dynamic optimizing compiler depends. On the other hand, simpler existing Java bytecode interpreters, written purely in high-level languages, deliver poor performance. The main motivation behind this thesis was to answer the question: How fast can a portable, easily modifiable Java bytecode interpreter be? In order to address this question, we have designed and developed the Sable VM research framework, a portable interpreter-based Java virtual machine written in portable C. In this thesis we introduce innovative techniques for implementing an efficient, yet portable Java bytecode interpreter. These techniques address three areas: instruction dispatch, memory management, and synchronization. Specifically, we show how to implement an inline-threaded engine in the presence of lazy code preparation, without incurring a high synchronization penalty. We then introduce a logical partitioning of runtime system memory that simplifies memory management, and a related sparse interface virtual table design for fast interface-method invocation. We show how to efficiently compute space-efficient garbage collection maps for verifiable bytecode. We also present a bidirectional object layout that simplifies garbage collection. Finally, we introduce an improvement to thin locks, eliminating busy-wait in case of contention. Our experiments within the Sable VM framework show that inline-threading [PR98] Java delivers significant performance improvement over switch and direct-threading, that sparse interface tables cause no memory loss, and that our map computation algorithm delivers a very small number of distinct garbage collection maps. Our overall performance measurements show that, using our techniques, a portable interpreter can deliver competitive interpretation performance, and even surpass that of a less-portable state-of-the-art interpreter on some benchmarks.

Book ChapterDOI
07 Apr 2003
TL;DR: Preparation sequences is introduced, a new technique that solves the particular challenge of effectively inline-threading Java and achieves a speedup ranging from 1.20 to 2.41 over switch-based interpretation, and a speed up ranging from 2.15 to2.14 over direct-threaded interpretation.
Abstract: Inline-threaded interpretation is a recent technique that improves performance by eliminating dispatch overhead within basic blocks for interpreters written in C [11]. The dynamic class loading, lazy class initialization, and multi-threading features of Java reduce the effectiveness of a straight-forward implementation of this technique within Java interpreters. In this paper, we introduce preparation sequences, a new technique that solves the particular challenge of effectively inline-threading Java. We have implemented our technique in the SableVM Java virtual machine, and our experimental results show that using our technique, inline-threaded interpretation of Java, on a set of benchmarks, achieves a speedup ranging from 1.20 to 2.41 over switch-based interpretation, and a speedup ranging from 1.15 to 2.14 over direct-threaded interpretation.

Proceedings ArticleDOI
08 Jun 2003
TL;DR: This paper presents the most complete JVM model from this series, namely, M6, which is derived from a careful study of the J2ME KVM implementation and argues that the approach of building an executable model of the system with an axiomatically described functional language can bring benefits from both the testing and the formal reasoning worlds.
Abstract: To study the properties of the Java Virtual Machine(JVM) and Java programs, our research group has produced a series of JVM models written in a functional subset of Common Lisp. In this paper, we present our most complete JVM model from this series, namely, M6, which is derived from a careful study of the J2ME KVM [16] implementation.On the one hand, our JVM model is a conventional machine emulator. M6 models accurately almost all aspects of the KVM implementation, including the dynamic class loading, class initialization and synchronization via monitors. It executes most J2ME Java programs that do not use any I/O or floating point operations. Engineers may consider M6 an implementation of the JVM. It is implemented with around 10K lines in 20+ modules.On the other hand, M6 is a novel model that allows for analytical reasoning besides conventional testing. M6 is written in an applicative (side-effect free) subset of Common Lisp, for which we have given precise meaning in terms of axioms and inference rules. A property of M6 can be expressed as a formula. Rules of interference can be used analytically to derive properties of M6 and the Java programs that run on the model, using a mechanical theorem prover.We argue that our approach of building an executable model of the system with an axiomatically described functional language can bring benefits from both the testing and the formal reasoning worlds.

Proceedings Article
01 Jan 2003
TL;DR: JSpy, a system for high-level instrumentation of Java bytecode and its use with JPaX, the OUT system for runtime analysis of Java programs, is described.
Abstract: This paper describes JSpy, a system for high-level instrumentation of Java bytecode and its use with JPaX, OUT system for runtime analysis of Java programs. JPaX monitors the execution of temporal logic formulas and performs predicative analysis of deadlocks and data races. JSpy s input is an instrumentation specification, which consists of a collection of rules, where a rule is a predicate/action pair The predicate is a conjunction of syntactic constraints on a Java statement, and the action is a description of logging information to be inserted in the bytecode corresponding to the statement. JSpy is built using JTrek an instrumentation package at a lower level of abstraction.


01 Jan 2003
TL;DR: In this article, a conceptual framework for the utilization of interfaces in JAVA programs is presented, and tool support for lessening the coding effort induced by the introduction and maintenance of additional interfaces.
Abstract: JAVA's interface construct is widely perceived as a weak surrogate for multiple inheritance. Consequently, it should come as no surprise that despite their potential for writing highly decoupled code, interfaces are used rather sparingly. We have devised a conceptual framework for the utilization of interfaces in JAVA programs, and suggest tool support lessening the coding effort induced by the introduction and maintenance of additional interfaces, as well as a metrics suit measuring how and to which extent interfaces are actually used.

Book ChapterDOI
07 Apr 2003
TL;DR: A program logic for verifying JAVA CARD applications is extended by introducing a "throughout" operator that allows us to prove "strong" invariants, which can be used to ensure "rip out" properties of JAVa CARD programs.
Abstract: In this paper we extend a program logic for verifying JAVA CARD applications by introducing a "throughout" operator that allows us to prove "strong" invariants. Strong invariants can be used to ensure "rip out" properties of JAVA CARD programs (properties that are to be maintained in case of unexpected termination of the program). Along with introducing the "throughout" operator, we show how to handle the JAVA CARD transaction mechanism (and, thus, conditional assignments) in our logic. We present sequent calculus rules for the extended logic.

Proceedings ArticleDOI
TL;DR: The results indicated that method comments do increase low-level program understanding, while class comments did not increase high-level understanding, which raises questions about the role of class comments in object-oriented programs, as well as the kind of commenting guidelines that should be used in teaching CS1 classes.
Abstract: This paper describes an experiment that investigates the effects of class and method comments on Java program understanding among beginning programmers. Each of the 103 students from CS1 class at Oregon Slate University was given one of four versions (no comments, only method comments, only class comments, and both method and class comments) of a Java database program and answered questions about the program. The results indicated that method comments do increase low-level program understanding, while class comments did not increase high-level understanding. This raises questions about the role of class comments in object-oriented programs, as well as the kind of commenting guidelines that should be used in teaching CS1 classes.