TWiki
>
CF Web
>
Software
>
WebCapabilities
>
OdysseyApplications
>
PackageDocumentationOdyssey2
>
OdysseyJavaCode
>
OdysseyJavaCodingStandards
(2007-03-19,
IsaacMorland
)
(raw view)
E
dit
A
ttach
---+ Odyssey Java Coding Standards For consistency, all Java code in the Odyssey system should follow the following standards. ---++ Version Control Subversion is used for version control. The repository root is at =svn+ssh://odyssey@core.cs/u/odyssey/svn/odyssey=. Within this everything in the =uw= package is in a directory called =uw=, while everything in the =zava= package is in a directory called =zava=. Each of these directories has a =trunk= subdirectory, which contains the code in actual use in the =odyssey-2= package, and a =branches= subdirectory, which can be used for editing the code. Update protocol is to copy from =trunk= to a directory in =branches=, update the branch, and test on a test server. Once the code has been tested and is considered ready to move to production, the changes can be merged back into the trunk. ---++ Whitespace and Layout Indentation is *one tab* per indent level. This allows each user to display indents at their preferred width. The first line of a Javadoc comment starts with =/**= (of course). The last line consists of =*/= by itself. Lines in between do not have any special markings, but are indented *one tab* relative to the first and last line. Parentheses stick to whatever is inside them, but tend to separate from whatever is outside them. The sticking is stronger than the separation, so multiple open or close parentheses in a row don't have spaces between them. Empty parentheses also have no space between them. Curly braces go on the same line as any non-curly-brace part of the syntax of the structure of which they are a part. A curly brace will be on a line by itself only if it isn't associated with additional syntax. Empty curly braces have no space between them. Here is an example that displays all of the above, except for the tab rule: <verbatim> /** This is a method. @return The return value. */ public int countStuff (int P) { if ((P < 0) || (P % 2 == 1)) { int q = count0 (P); return count1 (P + q); } else { int q = count0 (P * 2); return count2 (P); } } protected Constructor () {} </verbatim> -- Main.IsaacMorland - 19 Mar 2007
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r1 - 2007-03-19
-
IsaacMorland
CF
Information in this area is meant for use by CSCF staff and is not official documentation, but anybody who is interested is welcome to use it if they find it useful.
CF Web
CF Web Home
Changes
Index
Search
Administration
Communication
Email
Hardware
HelpDeskGuide
Infrastructure
InternalProjects
Linux
MachineNotes
Macintosh
Management
Networking
Printing
Research
Security
Software
Solaris
StaffStuff
TaskGroups
TermGoals
Teaching
UserSupport
Vendors
Windows
XHier
Other Webs
CSEveryBody
Main
Sandbox
TWiki
UW
My links
People
CERAS
WatForm
Tetherless lab
Ubuntu Main.HowTo
eDocs
RGG NE notes
RGG
CS infrastructure
Grad images
Edit
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback