skip to main content
research-article
Free Access

JavaCOP: Declarative pluggable types for java

Authors Info & Claims
Published:08 February 2010Publication History
Skip Abstract Section

Abstract

Pluggable types enable users to enforce multiple type systems in one programming language. We have developed a suite of tools, called the JavaCOP framework, that allows developers to create pluggable type systems for Java. JavaCOP provides a simple declarative language in which program constraints are defined over a program's abstract syntax tree. The JavaCOP compiler automatically enforces these constraints on programs during compilation. The JavaCOP framework also includes a dataflow analysis API in order to support type systems which depend on flow-sensitive information. Finally, JavaCOP includes a novel test framework which helps users gain confidence in the correctness of their pluggable type systems. We demonstrate the framework by discussing a number of pluggable type systems which have been implemented in JavaCOP in order to detect errors and enforce strong invariants in programs. These type systems range from general-purpose checkers, such as a type system for nonnull references, to domain-specific ones, such as a checker for conformance to a library's usage rules.

References

  1. Aldrich, J., Kostadinov, V., and Chambers, C. 2002. Alias annotations for program understanding. In Proceedings of the 17th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'02). M. Ibrahim and S. Matsuoka, Eds. ACM Press, New York, 311--330. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Andreae, C., Coady, Y., Gibba, C., Noble, J., Vitek, J., and Zhao, T. 2006a. Scoped types and aspects for real-time systems. In Proceedings of the 20th European Conference on Object-Oriented Programming (ECOOP'06). Lecture Notes in Computer Science, vol. 4067. Springer,124--147. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Andreae, C., Noble, J., Markstrum, S., and Millstein, T. 2006b. A framework for implementing pluggable type systems. In Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'06). ACM Press, New York, 57--74. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Arnold, K., Gosling, J., and Holmes, D. 2000. The Java Programming Language, 3rd ed. Addison-Wesley, Reading, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Bloch, J. 2002. A metadata facility for the Java programming language. Tech. rep. JSR 175. http://www.jcp.org.Google ScholarGoogle Scholar
  6. Boyapati, C., Khurshid, S., and Marinov, D. 2002. Korat: Automated testing based on Java predicates. In Proceedings of the ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA'02). P. G. Frankl, Ed. ACM Press, New York, 123--133. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Boyland, J. 2001. Alias burying: Unique variables without destructive reads. Softw. Pract. Exper. 31, 6, 533--553. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Boyland, J., Noble, J., and Retert, W. 2001. Capabilities for sharing: A generalisation of uniqueness and read-only. In Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP'01). J. L. Knudsen, Ed. Lecture Notes in Computer Science, vol. 2072. Springer, 2--27. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Bracha, G. 2004. Pluggable type systems. OOPSLA Workshop on Revival of Dynamic Languages. http://pico.vub.ac.be/~wdmeuter/RDL04/papers/Bracha.pdf.Google ScholarGoogle Scholar
  10. Bruneton, E., Lenglet, R., and Coupaye, T. 2002. ASM: A Java bytecode manipulation and analysis framework. In Proceedings of the Adaptable and Extensible Component Systems Conference. http://asm.objectweb.org.Google ScholarGoogle Scholar
  11. Chalin, P. and James, P. R. 2007. Non-Null references by default in Java: Alleviating the nullity annotation burden. In Proceedings of the 21st European Conference on Object-Oriented Programming (ECOOP'07). E. Ernst, Ed. Lecture Notes in Computer Science, vol. 4609. Springer, 227--247. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Charles, P., Grothoff, C., Saraswat, V., Donawa, C., Kielstra, A., Ebcioglu, K., von Praun, C., and Sarkar, V. 2005. X10: An object-oriented approach to non-uniform cluster computing. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'05). R. E. Johnson and R. P. Gabriel, Eds. ACM Press, New York, 519--538. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Chin, B., Markstrum, S., and Millstein, T. 2005. Semantic type qualifiers. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'05). V. Sarkar and M. W. Hall, Eds. ACM Press, New York, 85--95. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Chin, B., Markstrum, S., Millstein, T., and Palsberg, J. 2006. Inference of user-defined type qualifiers and qualifier rules. In Proceedings of the 15th European Symposium on Programming Languages and Systems (ESOP'06), P. Sestoft, Ed. Lecture Notes in Computer Science, vol. 3924, Springer, 264--278. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Cohen, T., Gil, J. Y., and Maman, I. 2006. JTL — The Java tools language. In Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'06). ACM Press, New York, 89--108. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Crew, R. F. 1997. ASTLOG: A language for examining abstract syntax trees. In Proceedings of the Conference on Domain-Specific Languages. C. Ramming, Ed. USENIX Association, 229--243. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Daniel, B., Dig, D., Garcia, K., and Marinov, D. 2007. Automated testing of refactoring engines. In Proceedings of the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT International Symposium on Foundations of Software Engineering (ESEC/SIGSOFT FSE'07). I. Crnkovic and A. Bertolino, Eds. ACM Press, New York, 185--194. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Duby, C. K., Meyers, S., and Reiss, S. P. 1992. CCEL: A metalanguage for C++. In Proceedings of the USENIX C++ Conference. USENIX Association, 99--116.Google ScholarGoogle Scholar
  19. Eichberg, M., Schäfer, T., and Mezini, M. 2005. Using annotations to check structural properties of classes. In Proceedings of the 8th International Conference on Fundamental Approaches to Software Engineering (FASE'05). M. Cerioli, Ed. Lecture Notes in Computer Science, vol. 3442, Springer, 237--252. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Ekman, T. and Hedin, G. 2004. Rewritable reference attributed grammars. In Proceedings of the 18th European Conference on Object-Oriented Programming (ECOOP'04). M. Odersky, Ed. Lecture Notes in Computer Science, vol. 3086, Springer, 144--169.Google ScholarGoogle Scholar
  21. Ernst, M. 2007. Java annotations on types. Tech. rep. JSR 308. http://www.jcp.org.Google ScholarGoogle Scholar
  22. Fähndrich, M. and Leino, K. R. M. 2003. Declaring and checking non-null types in an object-oriented language. In Proceedings of the 18th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA'03), R. Crocker and G. L. Steele, Jr., Eds. ACM Press, New York, 302--312. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Fischer, J., Marino, D., Majumdar, R., and Millstein, T. 2009. Fine-Grained access control with object-sensitive roles. In Proceedings of the 23rd European Conference on Object-Oriented Programming (ECOOP'09). S. Drossopoulou, Ed. Lecture Notes in Computer Science, vol. 5653. Springer, 173--194. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Flanagan, C. and Freund, S. N. 2000. Type-Based race detection for Java. In Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (PLDI'00). J. Larus and M. Lam, Eds. ACM Press, New York, 219--232. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Foster, J. S., Fähndrich, M., and Aiken, A. 1999. A theory of type qualifiers. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'99). B. G. Ryder and B. Zorn, Eds. ACM Press, New York, 192--203. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Foster, J. S. and Ma, K. 2007. Inferring aliasing and encapsulation properties for Java. In Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA'07). ACM Press, New York, 423--440. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Gabriel, R. P., Bacon, D. F., Lopes, C. V., and Steele Jr., G. L., Eds. 2007. Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'07). ACM Press, New York. Google ScholarGoogle ScholarCross RefCross Ref
  28. Gamma, E., Helm, R., Johnson, R. E., and Vlissides, J. 1995. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Boston, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Gosling, J., Joy, B., Steele, G., and Bracha, G. 2000. The Java Language Specification, 2nd ed. The Java Series. Addison-Wesley, Boston, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Greenffieldboyce, D. and Foster, J. S. 2007. Type qualifier inference for Java. In Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA'07). 321--336. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Hajiyev, E., Verbaere, M., and de Moor, O. 2006. CodeQuest: Scalable source code queries with data-log. In Proceedings of the 20th European Conference on Object-Oriented Programming (ECOOP'06). Lecture Notes in Computer Science, vol. 4067, Springer, 2--27. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Hou, D. and Hoover, H. J. 2006. Using SCL to specify and check design intent in source code. IEEE Trans. Softw. Engin. 32, 6, 404--423. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Hovemeyer, D. and Pugh, W. 2004. Finding bugs is easy. OOPSLA Companion 2004: Companion to the 19th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications. J. M. Vlissides and D. C. Schmidt, Eds. ACM Press, New York, 132--136. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Igarashi, A., Pierce, B. C., and Wadler, P. 2001. Featherweight Java: A minimal core calculus for Java and GJ. ACM Trans. Program. Lang. Syst. 23, 3, 396--450. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Janzen, D. and Volder, K. D. 2003. Navigating and querying code without getting lost. In Proceedings of the 2nd International Conference on Aspect-Oriented Software Development (AOSD'03). W. G. Griswold and M. Aksit, Eds. ACM Press, New York, 178--187. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. JSR 302. 2006. JSR 302: Safety critical java technology. http://jcp.org/en/jsr/detail?id=302.Google ScholarGoogle Scholar
  37. JUnit. 2000. JUnit homepage. http://junit.org.Google ScholarGoogle Scholar
  38. Markstrum, S. 2009. Enforcing and validating user-defined programming disciplines. Ph.D. thesis, University of California, Los Angeles, CA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Milicevic, A., Misailovic, S., Marinov, D., and Khurshid, S. 2007. Korat: A tool for generating structurally complex test inputs. In Proceedings of the 29th International Conference on Software Engineering (ICSE'07). J. Knight and M. Cohen, Eds. IEEE Computer Society, 771--774. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Millstein, T. D., Frost, C., Ryder, J., and Warth, A. 2009. Expressive and modular predicate dispatch for java. ACM Trans. Program. Lang. Syst. 31, 2. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Myers, A. C. 1999. JFlow: Practical mostly-static information flow control. In Proceedings of the 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (PoPL'99). A. W. Appel and A. Aiken, Eds. ACM Press, New York, 228--241. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Nystrom, N., Clarkson, M. R., and Myers, A. C. 2003. Polyglot: An extensible compiler framework for Java. In Proceedings of the 12th International Conference on Compiler Construction (CC'03). G. Hedin, Ed. Lecture Notes in Computer Science, vol. 2622. Springer, 138--152. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Nystrom, N., Qi, X., and Myers, A. C. 2006. J&: Software composition with nested intersection. In Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA'06). G. E. Harris, Ed. ACM Press, New York, 21--36. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Papi, M. M., Ali, M., Correa Jr., T. L., Perkins, J. H., and Ernst, M. D. 2008. Practical pluggable types for Java. In Proceedings of the ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA'08). B. G. Ryder and A. Zeller, Eds. ACM Press, New York, 201--212. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Pierce, B. C. 2002. Types and Programming Languages. MIT Press, Cambridge, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Polyglot. 2004. Polyglot extensible compiler framework. http://www.cs.cornell.edu/Projects/polyglot.Google ScholarGoogle Scholar
  47. Polyglot5. 2007. Polyglot for Java 5. http://www.cs.ucla.edu/~milanst/projects/polyglot5.Google ScholarGoogle Scholar
  48. Roberson, M., Harries, M., Darga, P. T., and Boyapati, C. 2008. Efficient software model checking of soundness of type systems. In Proceedings of the 23rd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'08). G. E. Harris, Ed. ACM Press, New York, 493--504. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Tarr, P. L. and Cook, W. R., Eds. 2006. Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'06). ACM Press, New York. Google ScholarGoogle Scholar
  50. Thomas, D., Ed. 2006. Proceedings of the 20th European Conference on Object-Oriented Programming (ECOOP'06). Lecture Notes in Computer Science, vol. 4067. Springer.Google ScholarGoogle Scholar
  51. Vallèe-Rai, R., Hendren, L., Sundaresan, V., Lam, P., Gagnon, E., and Co, P. 1999. Soot - A Java optimization framework. In Proceedings of the Conference of the Centre for Advanced Studies on Collaborative Research (CASCON'99). S. A. MacKay and J. H. Johnson, Eds. IBM, 125--135. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Vitek, J. and Bokowski, B. 1999. Confined types. In Proceedings of the 14th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'99). B. Hailpern, L. Northrop, and A. M. Berman, Eds. ACM Press, New York, 82--96. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Warth, A., Stanojevic, M., and Millstein, T. 2006. Statically scoped object adaptation with expanders. In Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA'06). P. L. Tarr and W. R. Cook, Eds. ACM Press, New York, 37--56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. WAL, A. 2007. T.J. Watson libraries for analysis (WALA). http://wala.sf.net.Google ScholarGoogle Scholar

Index Terms

  1. JavaCOP: Declarative pluggable types for java

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM Transactions on Programming Languages and Systems
        ACM Transactions on Programming Languages and Systems  Volume 32, Issue 2
        January 2010
        123 pages
        ISSN:0164-0925
        EISSN:1558-4593
        DOI:10.1145/1667048
        Issue’s Table of Contents

        Copyright © 2010 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 8 February 2010
        • Accepted: 1 April 2009
        • Received: 1 November 2008
        Published in toplas Volume 32, Issue 2

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!