📄 hacking.texinfo
字号:
\input texinfo @c -*-texinfo-*-@c %**start of header@setfilename hacking.info@settitle GNU Classpath Hacker's Guide@c %**end of header@setchapternewpage off@ifinfoThis file contains important information you will need to know if youare going to hack on the GNU Classpath project code.Copyright (C) 1998,1999,2000,2001,2002,2003,2004, 2005 Free Software Foundation, Inc.@ifnotplaintext@dircategory GNU Libraries@direntry* Classpath Hacking: (hacking). GNU Classpath Hacker's Guide@end direntry@end ifnotplaintext@end ifinfo@titlepage@title GNU Classpath Hacker's Guide@author Aaron M. Renn@author Paul N. Fisher@author John Keiser@author C. Brian Jones@author Mark J. Wielaard@page@vskip 0pt plus 1filllCopyright @copyright{} 1998,1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.@sp 2Permission is granted to make and distribute verbatim copies ofthis document provided the copyright notice and this permission noticeare preserved on all copies.Permission is granted to copy and distribute modified versions of thisdocument under the conditions for verbatim copying, provided that theentire resulting derived work is distributed under the terms of apermission notice identical to this one.Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions,except that this permission notice may be stated in a translationapproved by the Free Software Foundation.@end titlepage@ifinfo@node Top, Introduction, (dir), (dir)@top GNU Classpath Hacker's GuideThis document contains important information you'll want to know ifyou want to hack on GNU Classpath, Essential Libraries for Java, tohelp create free core class libraries for use with virtual machinesand compilers for the java programming language.@end ifinfo@menu* Introduction:: An introduction to the GNU Classpath project* Requirements:: Very important rules that must be followed* Volunteering:: So you want to help out* Project Goals:: Goals of the GNU Classpath project* Needed Tools and Libraries:: A list of programs and libraries you will need* Programming Standards:: Standards to use when writing code* Hacking Code:: Working on code, Working with others* Programming Goals:: What to consider when writing code* API Compatibility:: How to handle serialization and deprecated methods* Specification Sources:: Where to find class library specs* Naming Conventions:: How files and directories are named* Character Conversions:: Working on Character conversions* Localization:: How to handle localization/internationalization@detailmenu --- The Detailed Node Listing ---Programming Standards* Source Code Style Guide:: Working on the code, Working with others* Branches:: * Writing ChangeLogs:: Working with branches* Writing ChangeLogs:: Programming Goals* Portability:: Writing Portable Software * Utility Classes:: Reusing Software* Robustness:: Writing Robust Software * Java Efficiency:: Writing Efficient Java * Native Efficiency:: Writing Efficient JNI * Security:: Writing Secure SoftwareAPI Compatibility* Serialization:: Serialization* Deprecated Methods:: Deprecated methodsLocalization* String Collation:: Sorting strings in different locales* Break Iteration:: Breaking up text into words, sentences, and lines* Date Formatting and Parsing:: Locale specific date handling* Decimal/Currency Formatting and Parsing:: Local specific number handling@end detailmenu@end menu@node Introduction, Requirements, Top, Top@comment node-name, next, previous, up@chapter IntroductionThe GNU Classpath Project is a dedicated to providing a 100% free,clean room implementation of the standard core class libraries forcompilers and runtime environments for the java programming language.It offers free software developers an alternative core libraryimplementation upon which larger java-like programming environmentscan be build. The GNU Classpath Project was started in the Spring of1998 as an official Free Software Foundation project. Most of thevolunteers working on GNU Classpath do so in their spare time, but acouple of projects based on GNU Classpath have paid programmers toimprove the core libraries. We appreciate everyone's efforts in thepast to improve and help the project and look forward to futurecontributions by old and new members alike.@node Requirements, Volunteering, Introduction, Top@comment node-name, next, previous, up@chapter RequirementsAlthough GNU Classpath is following an open development model where inputfrom developers is welcome, there are certain base requirements thatneed to be met by anyone who wants to contribute code to this project.They are mostly dictated by legal requirements and are not arbitraryrestrictions chosen by the GNU Classpath team.You will need to adhere to the following things if you want to donatecode to the GNU Classpath project:@itemize @bullet@item@strong{Never under any circumstances refer to proprietary code whileworking on GNU Classpath.} It is best if you have never looked atalternative proprietary core library code at all. To reducetemptation, it would be best if you deleted the @file{src.zip} filefrom your proprietary JDK distribution (note that recent versions ofGNU Classpath and the compilers and environments build on it aremature enough to not need any proprietary implementation at all whenworking on GNU Classpath, except in exceptional cases where you needto test compatibility issues pointed out by users). If you havesigned Sun's non-disclosure statement, then you unfortunately cannotwork on Classpath code at all. If you have any reason to believe thatyour code might be ``tainted'', please say something on the mailinglist before writing anything. If it turns out that your code was notdeveloped in a clean room environment, we could be very embarrassedsomeday in court. Please don't let that happen.@item@strong{Never decompile proprietary class library implementations.} Whilethe wording of the license in Sun's Java 2 releases has changed, it isnot acceptable, under any circumstances, for a person working onGNU Classpath to decompile Sun's class libraries. Allowing the use ofdecompilation in the GNU Classpath project would open up a giant can oflegal worms, which we wish to avoid.@itemClasspath is licensed under the terms of the@uref{http://www.fsf.org/copyleft/gpl.html,GNU General PublicLicense}, with a special exception included to allow linking withnon-GPL licensed works as long as no other license would restrict suchlinking. To preserve freedom for all users and to maintain uniformlicensing of Classpath, we will not accept code into the maindistribution that is not licensed under these terms. The exactwording of the license of the current version of GNU Classpath can befound online from the@uref{http://www.gnu.org/software/classpath/license.html, GNUClasspath license page} and is of course distributed with currentsnapshot release from @uref{ftp://ftp.gnu.org/gnu/classpath/} or byobtaining a copy of the current CVS tree.@itemGNU Classpath is GNU software and this project is being officially sponsoredby the @uref{http://www.fsf.org/,Free Software Foundation}. Because ofthis, the FSF will hold copyright to all code developed as part ofGNU Classpath. This will allow them to pursue copyright violators in court,something an individual developer may neither have the time norresources to do. Everyone contributing code to GNU Classpath will need tosign a copyright assignment statement. Additionally, if you areemployed as a programmer, your employer may need to sign a copyrightwaiver disclaiming all interest in the software. This may sound harsh,but unfortunately, it is the only way to ensure that the code you writeis legally yours to distribute.@end itemize@node Volunteering, Project Goals, Requirements, Top@comment node-name, next, previous, up@chapter Volunteering to HelpThe GNU Classpath project needs volunteers to help us out. People areneeded to write unimplemented core packages, to test GNU Classpath onfree software programs written in the java programming language, totest it on various platforms, and to port it to platforms that arecurrently unsupported.While pretty much all contributions are welcome (but see @pxref{Requirements}) it is always preferable that volunteers do thewhole job when volunteering for a task. So when you volunteer to writea Java package, please be willing to do the following:@itemize @bullet@itemImplement a complete drop-in replacement for the particular package.That means implementing any ``internal'' classes. For example, in thejava.net package, there are non-public classes for implementing sockets.Without those classes, the public socket interface is useless. But donot feel obligated to completely implement all of the functionality atonce. For example, in the java.net package, there are different typesof protocol handlers for different types of URL's. Not all of theseneed to be written at once.@itemPlease write complete and thorough API documentation comments forevery public and protected method and variable. These should besuperior to Sun's and cover everything about the item beingdocumented.@itemPlease write a regression test package that can be used to run testsof your package's functionality. GNU Classpath uses the@uref{http://sources.redhat.com/mauve/,Mauve project} for testing thefunctionality of the core class libraries. The Classpath Project isfast approaching the point in time where all modifications to thesource code repository will require appropriate test cases in Mauve toensure correctness and prevent regressions. @end itemizeWriting good documentation, tests and fixing bugs should be everydeveloper's top priority in order to reach the elusive release ofversion 1.0.@node Project Goals, Needed Tools and Libraries, Volunteering, Top@comment node-name, next, previous, up@chapter Project GoalsThe goal of the Classpath project is to produce a@uref{http://www.fsf.org/philosophy/free-sw.html,free} implementation ofthe standard class library for Java. However, there are other morespecific goals as to which platforms should be supported.Classpath is targeted to support the following operating systems:@enumerate@itemFree operating systems. This includes GNU/Linux, GNU/Hurd, and the freeBSDs.@itemOther Unix-like operating systems.@itemPlatforms which currently have no Java support at all.@item Other platforms such as MS-Windows.@end enumerateWhile free operating systems are the top priority, the other prioritiescan shift depending on whether or not there is a volunteer to portClasspath to those platforms and to test releases.Eventually we hope the Classpath will support all JVM's that provideJNI or CNI support. However, the top priority is free JVM's. A smalllist of Compiler/VM environments that are currently activelyincorporating GNU Classpath is below. A more complete overview ofprojects based on GNU classpath can be found online at@uref{http://www.gnu.org/software/classpath/stories.html,the GNUClasspath stories page}.@enumerate@item@uref{http://gcc.gnu.org/java/,GCJ}@item @uref{http://jamvm.sourceforge.net/,jamvm}@item @uref{http://kissme.sourceforge.net/,Kissme}@item@uref{http://www.ibm.com/developerworks/oss/jikesrvm/,Jikes RVM}@item@uref{http://www.sablevm.org/,SableVM}@item@uref{http://www.kaffe.org/,Kaffe}@end enumerateAs with OS platform support, this priority list could change if avolunteer comes forward to port, maintain, and test releases for aparticular JVM. Since gcj is part of the GNU Compiler Collective itis one of the most important targets. But since it doesn't currentlywork out of the box with GNU Classpath it is currently not the easiesttarget. When hacking on GNU Classpath the easiest is to usecompilers and runtime environments that that work out of the box withit, such as the jikes compiler and the runtime environments jamvm andkissme. But you can also work directly with targets like gcj andkaffe that have their own copy of GNU Classpath currently. In thatcase changes have to be merged back into GNU Classpath proper though,which is sometimes more work. SableVM is starting to migrate from anintegrated GNU Classpath version to being usable with GNU Classpathout of the box.The initial target version for Classpath is the 1.1 spec. Higherversions can be implemented (and have been implemented, including lotsof 1.4 functionality) if desired, but please do not create classesthat depend on features in those packages unless GNU Classpath already
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -