Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

  1. Subscribe to the dev list and say Hi
  2. Get the source code with svn or git
  3. Build the code (maven 2.2.1 or higher recommended)
    • mvn clean install

Play around with the examples under the examples/ directory. Some of the neater ones are (ordered simple to complex):

  • simple-stateless (see video)
  • simple-stateful
  • simple-singleton
  • simple-mdb
  • async-methods
  • schedule-methods
  • injection-of-env-entry
  • injection-of-ejbs
  • injection-of-datasource
  • injection-of-entitymanager
  • testcase-injection
  • testing-transactions
  • transaction-rollback
  • testing-security
  • testing-security-2
  • simple-webservice

What is the process?

Code Block
titleContributor.java
public void contributeToOpenSource() {

    boolean stillInterestedAndHavingFun = true;
    int taskSize = 1; // start small!
    
    contributing:
    while (stillInterestedAndHavingFun) {
    
        Task task = findSomethingInteresting(taskSize++);
    
        if (!task.hasJira()) {
            createJira(task);
        } else {
            requestToBeAssignedToJira(task.jiraId());
        }
    
        while (task.inProgress()) {
    
            chatOnListALittleGetCleverIdeas(task, new Ideas(task));
            hackALittle(task);
    
            if (task.tooHard() || task.notFun()) {
                // no big deal, try again with something else
                taskSize--;
                continue contributing;
            }
        }
    
        File patchFile = createSvnOrGitPatch(task);
        attachToJira(task.jiraId(), patchFile);
        askForReviewOnList(task.jiraId());
    
        while (!committed(patchFile)) {
    
            try {
                pokeAtSometingElse();
                helpOnUserList();
                dayDream();
            } catch (MoreThanAWeekException e) {
                // Assume it fell off the radar -- happens.
                // Evidence we need more committers.
                bumpThreadOnList(task);
            }
        }
    }

}

...

Things that always need doing

  • Final variables & fields are preferred where possible, but a lot of the code is old. Feel free to add them and hand the code back.
  • If you have any skills with code coverage tools, then you'll probably find way too much to do! Tests are always welcome.
  • There are over a 1,000 TODO comments in the code. Maybe some should be deleted. Maybe some could be completed. They probably all should have a JIRA id on them.
  • Pick a random class, see if you can figure out what it is doing and javadoc it.
  • Add @Override where applicable
  • Intellij has an 'Inspect Code' feature. Yikes does it produce a lot of output.
  • No doubt there is some exception handling that can be greatly improved.

Obviously, one could get quite bored doing just the above. But sometimes the above tasks can lead to more fun and exciting things. Anything that gets you in and looking at code and actually touching and changing it usually results in questions, discussions and ideas... then little passions and late nights and lack of sleep and caffeine abuse.

...

Try to never mix logic changes with code reformatting. It makes it nearly impossible for others to see what the actual change was.

  • If you are a committer and want to reformat something, do the reformat as a separate commit before or after the real change. As long as they are separate and clearly marked it should be easy for people to see what is going on.
  • If you are a contributor and want to reformat something, maybe suggest it on the list, but avoid submitting patches that are just reformatting.