jMonkeyEngine / jMonkeyEngine/sdk

Canoncializing the Code

Open
#155 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Contribution welcome
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.

  1. 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.
 */
  1. 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 of return isTrue() rather if (isTrue()) { return true; } else { return false; }.
  1. Canoncialization:
  • Use ExceptionUtils.caughtException(ex) where applicable(!). This means that InterruptedExceptions should be handled by Thread.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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.