jMonkeyEngine / jMonkeyEngine/sdk
Canoncializing the Code
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 348
- Forks
- 104
- Avg merge
- 4d 13h
- Merged PRs (30d)
- 3
Description
Hey Guys,
Since I've just lost many lines of exhausting work thanks to my Git UI, I thought why not splitting this easy task up on many people, so everyone is only a bit exhausted.
It's also a great chance to learn how to fork projects and creating pull requests without having to solve complex coding problems.
The fix consists of three stages, but I might do the third stage on my own.
For the git commit message, a layout of 1./2./3. Canoncialization of jme3-modulename (#<Issue>) is preferred, make sure to not include "fix(es)" in your commit message though.
Ex: 2. Canoncialization of jme3-scenecomposer (#155).
If you follow that, everyone can see below which modules have passed which stage of canoncialization.
- Canoncialization:
- Removing "junk" (that's things like: "license.txt not found", "To change this, see Tools -> Templates", which might even be in some of the xml files)
- Updating/adding the LICENSE (if you find that this comment is present, just update it so it includes 2018 (e.g.
2003-2018).
/*
* Copyright (c) 2018 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
- Canoncialization:
- Select all code in Netbeans (can also be the SDK) and select Source -> Format. Keep an eye on Annotations though, sometimes it creates mess which we don't want.
- Follow the Warnings which Netbeans shows and let it auto-fix it (clicking the lamp). These specifically include: Missing
@Override, use of Iterator instead of for-each loop or redundant if statements (instead ofreturn isTrue()ratherif (isTrue()) { return true; } else { return false; }.
- Canoncialization:
- Use
ExceptionUtils.caughtException(ex)where applicable(!). This means thatInterruptedExceptions should be handled byThread.currentThread().interrupt()and sometimes the control flow is used to Exceptions (i.e. the caller can't handle a returning null or something, see welcome screen's rss handler). - Also make use of the message parameter in
ExceptionUtils.caughtException(ex, message)(e.g. in ModelImporter: Notify the user that this might be a faulty model and he/she/it should ask for troubleshooting on the hub first.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by selecting a specific SDK module and reviewing its Java and XML files for the listed cleanup, license, formatting, and warning tasks. For stage 3, inspect ExceptionUtils.caughtException usages, including ModelImporter and the welcome screen RSS handler. Done means the chosen module's applicable stages are complete; no test is named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, java
- Domain
- developer-experience, devtools
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100