| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| <html> |
| <head> |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
| <meta charset="utf-8" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| <meta name="author" content="dev@bval.apache.org" /> |
| |
| <META http-equiv="Content-Type" content="text/html;charset=UTF-8" /> |
| <META name="Description" content="Apache BVal -- Coding Standards" /> |
| <META name="Keywords" content="Apache BVal Bean Validation JSR-303 JavaEE6" /> |
| <META name="Owner" content="dev@bval.apache.org" /> |
| <META name="Robots" content="index, follow" /> |
| <META name="Security" content="Public" /> |
| <META name="Source" content="wiki template" /> |
| <META name="DC.Rights" content="Copyright � 2010-2012, The Apache Software Foundation" /> |
| |
| <!-- Le styles --> |
| <link href="/resources/css/bootstrap.css" rel="stylesheet"> |
| <style type="text/css"> |
| body { |
| padding-top: 60px; |
| padding-bottom: 40px; |
| } |
| .headerlink { |
| visibility: hidden; |
| } |
| dt:hover > .headerlink, p:hover > .headerlink, td:hover > .headerlink, h1:hover > .headerlink, h2:hover > .headerlink, h3:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, h6:hover > .headerlink { |
| visibility: visible |
| } </style> |
| <link href="/resources/css/bootstrap-responsive.css" rel="stylesheet"> |
| <link href="/resources/css/bval.css" rel="stylesheet"> |
| |
| <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> |
| <!--[if lt IE 9]> |
| <script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script> |
| <![endif]--> |
| |
| <!-- Fav and touch icons --> |
| <link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-144-precomposed.png"> |
| <link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-114-precomposed.png"> |
| <link rel="apple-touch-icon-precomposed" sizes="72x72" href="https://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-72-precomposed.png"> |
| <link rel="apple-touch-icon-precomposed" href="https://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-57-precomposed.png"> |
| <link rel="shortcut icon" href="/resources/images/feather-small.png"> |
| |
| <title>Apache BVal</title> |
| </head> |
| |
| <body> |
| <div class="navbar navbar-inverse navbar-fixed-top"> |
| <div class="navbar-inner"> |
| <div class="container"> |
| <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </a> |
| <a class="brand" href="/index.html"><img src="/resources/images/bval-bean-small.png" alt="Apache BVal" title="Apache BVal" /></a> |
| <div class="nav-collapse collapse"> |
| <ul class="nav"> |
| <li><a href="/downloads.html">Downloads</a></li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a> |
| <ul class="dropdown-menu pull-right"> |
| <li><a href="/samples.html">Samples</a></li> |
| <li><a href="/mvnsite/index.html">Generated Docs</a></li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Development <b class="caret"></b></a> |
| <ul class="dropdown-menu pull-right"> |
| <li><a href="https://git-wip-us.apache.org/repos/asf/bval">Source Code</a></li> |
| <li><a href="/coding-standards.html">Coding Standards</a></li> |
| <li><a href="/building.html">Building</a></li> |
| <li><a href="https://issues.apache.org/jira/browse/BVAL">Issue Tracker</a></li> |
| <li><a href="/beanvalidation-tck.html">Bean Validation TCK</a></li> |
| <li><a href="/automated-builds.html">Automated Builds</a></li> |
| <li><a href="/release-management.html">Release Management</a></li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Community <b class="caret"></b></a> |
| <ul class="dropdown-menu pull-right"> |
| <li><a href="/board-reports/index.html">Status</a></li> |
| <li><a href="/getting-involved.html">Getting Involved</a></li> |
| <li><a href="/people.html">People</a></li> |
| <li><a href="/mailing-lists.html">Mailing Lists</a></li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
| <img src="/resources/images/feather-small.png" alt="Apache" title="Apache" /> <b class="caret"></b></a> |
| <ul class="dropdown-menu pull-right"> |
| <li><a href="https://www.apache.org">Home</a></li> |
| <li><a href="https://www.apache.org/foundation/thanks.html">Thanks</a></li> |
| <li><a href="https://www.apache.org/foundation/sponsorship.html">Support</a></li> |
| </ul> |
| </li> |
| </ul> |
| <form id="search-form" class="navbar-search pull-right" action="https://www.google.com/cse" method="get"> |
| <input value="bval.apache.org" name="sitesearch" type="hidden" /> |
| <input class="search-query" name="q" id="query" type="text" /> |
| </form> |
| <script type="text/javascript" src="https://www.google.com/coop/cse/brand?form=search-form"></script> |
| </div><!--/.nav-collapse --> |
| </div> |
| </div> |
| </div> |
| |
| <div class="container" id="BValContent_Coding Standards"> |
| |
| <p><a name="CodingStandards-ASFRequirements"></a></p> |
| <h2 id="asf-requirements">ASF Requirements<a class="headerlink" href="#asf-requirements" title="Permalink">¶</a></h2> |
| <p><a name="CodingStandards-Copyrightnoticesforsubmittedpatches"></a></p> |
| <h3 id="copyright-notices-for-submitted-patches">Copyright notices for submitted patches<a class="headerlink" href="#copyright-notices-for-submitted-patches" title="Permalink">¶</a></h3> |
| <p>Please see <a href="http://www.apache.org/legal/src-headers.html">http://www.apache.org/legal/src-headers.html</a> |
| for details of the following summary.</p> |
| <p>Apache does not require you to assign ownership or copyright for any |
| patches that you submit via the above process. You retain ownership for all |
| such patches. But Apache does require you to grant Apache a license to use |
| the patch. To do this for new files, do not include a copyright statement |
| in the file but include this license as comments in the header of your |
| source contribution - <a href="http://www.apache.org/legal/src-headers.html#headers">http://www.apache.org/legal/src-headers.html#headers</a> |
| If you require that distributions of the project include your copyright |
| notice, you should include with your patch an update to the NOTICE file at |
| <code>trunk/NOTICE.txt</code> documenting for which files you are notifying your copyright.</p> |
| <p><a name="CodingStandards-LicenseandNoticefiles"></a></p> |
| <h3 id="license-and-notice-files">License and Notice files<a class="headerlink" href="#license-and-notice-files" title="Permalink">¶</a></h3> |
| <p>Please see <a href="http://www.apache.org/licenses/">http://www.apache.org/licenses/</a> |
| for details of the following summary.</p> |
| <p>All release artifacts published by an Apache project (JAR/WAR/EAR, zip, |
| tar, ...) must include License and Notice files. A Disclaimer file must be |
| included for any artifacts included form the incubator.</p> |
| <p><a name="CodingStandards-GeneralFormattingConventions"></a></p> |
| <h2 id="general-formatting-conventions">General Formatting Conventions<a class="headerlink" href="#general-formatting-conventions" title="Permalink">¶</a></h2> |
| <p>We try to adhere to Sun's <em>Code Conventions for the Java Programming |
| Language</em>, which is available at <a href="http://java.sun.com/docs/codeconv/">http://java.sun.com/docs/codeconv/</a></p> |
| <ol> |
| <li>Maximum line length is 120 characters (this is a deviation from the Java |
| standards of 80 chars).</li> |
| <li>Use spaces instead of tabs.</li> |
| <li>Indendation size is 4 spaces.</li> |
| <li>Do not insert a new line before opening brace. Insert a new line before |
| closing brace.</li> |
| <li>Use fully qualified import statements, i.e. do not use asterisks.</li> |
| </ol> |
| <p><a name="CodingStandards-EclipseUsers"></a></p> |
| <h2 id="eclipse-users">Eclipse Users<a class="headerlink" href="#eclipse-users" title="Permalink">¶</a></h2> |
| <p><a name="CodingStandards-FormatterProfile"></a></p> |
| <h3 id="formatter-profile">Formatter Profile<a class="headerlink" href="#formatter-profile" title="Permalink">¶</a></h3> |
| <p>Download the code formatter profile: |
| <a href="/coding/bval-formatting-preferences.xml">bval-formatting-preferences.xml</a></p> |
| <p>Updated profile for Eclipse Galileo: <a href="/coding/bval-eclipse-galileo-formatting.xml">bval-eclipse-galileo-formatting.xml</a></p> |
| <p>To import:</p> |
| <ol> |
| <li><strong>Window -> Preferences</strong></li> |
| <li><strong>Java -> Code Style -> Formatter</strong></li> |
| <li>Click on import and select the file downloaded above.</li> |
| <li>Press <strong>OK</strong> after importing</li> |
| </ol> |
| <p><a name="CodingStandards-CodeTemplate"></a></p> |
| <h3 id="code-template">Code Template<a class="headerlink" href="#code-template" title="Permalink">¶</a></h3> |
| <p>Download the code template profile: |
| <a href="/coding/bval-code-style-template.xml">bval-code-style-template.xml</a></p> |
| <p>To import:</p> |
| <ol> |
| <li><strong>Window -> Preferences</strong></li> |
| <li><strong>Java -> Code Style -> Code Templates</strong></li> |
| <li>Click on import and select the file downloaded above.</li> |
| <li>Press <strong>OK</strong> after importing</li> |
| </ol> |
| <p><a name="CodingStandards-SubmittingaPatch"></a></p> |
| <h2 id="submitting-a-patch">Submitting a Patch<a class="headerlink" href="#submitting-a-patch" title="Permalink">¶</a></h2> |
| <p>If you make changes to BVal, and would like to contribute them to the |
| project, you should create a patch via svn and post it to the <a href="http://issues.apache.org/jira/browse/BVAL">BVal JIRA issue tracker</a>. |
| To create a patch, simply execute the following command:</p> |
| <pre><code>svn diff > your-changes.patch |
| </code></pre> |
| <p><em>Note:</em> You may also use Eclipse to create a patch (<strong>Team -> Create |
| Patch...</strong>), but this may require committers to modify the patch to match |
| their project layout (workspace per branch or all branches in one |
| workspace) and some committers may not be using Eclipse/Subclipse.</p> |
| <p><a name="CodingStandards-TestCases"></a></p> |
| <h2 id="testcases">TestCases<a class="headerlink" href="#testcases" title="Permalink">¶</a></h2> |
| <p>When we make a change or introduce a new feature, it's generally good |
| practice to include a <a href="http://junit.org">JUnit</a> testcase which demonstrates the desired |
| behavior.</p> |
| <p>The testcase should be self validating via JUnit assertions. Writing messages |
| to <code>System.err</code> or <code>System.out</code> or extraneous logging is discouraged; they |
| lead to the impression that some manual interpretation of the results must |
| be done. Messages like these are useful when developing the tests or when |
| diagnosing problems but should either be included as <code>TRACE</code> level logging or |
| not be committed.</p> |
| |
| |
| </div> |
| |
| <hr> |
| |
| <div class="container"> |
| <footer> |
| <p>Copyright © 2010-2021 The Apache Software Foundation. Licensed under <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>. |
| View our <a href="/privacy-policy.html">privacy policy</a>. |
| </p> |
| <p>Apache and the Apache feather logo are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners. |
| </p> |
| </footer> |
| |
| </div> <!-- /container --> |
| |
| <!-- Le javascript |
| ================================================== --> |
| <!-- Placed at the end of the document so the pages load faster --> |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"; type="text/javascript"></script> |
| <script src="/resources/js/bootstrap.min.js"></script> |
| <link rel="stylesheet" href="/resources/css/docco.css"> |
| <script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.0.1/build/highlight.min.js"></script> |
| <script>hljs.highlightAll();</script> |
| |
| </body> |
| </html> |