Page tree
Skip to end of metadata
Go to start of metadata

I've started a crusade for less wrapping of code lines here: Linie length should be more than 80 characters.

The readability of the code in my IDE would be greatly increased, eg.

Line length = 80

Line length = 120

        assertEquals(
                "Should have created one job after starting job dispatching",
                1, dao.getCountJobs());
        ((JMSConnectionMockupMQ) JMSConnectionFactory.getInstance())
        .waitForConcurrentTasksToFinish();
        assertEquals("The job should still be marked as new", 1,
                IteratorUtils.toList(dao.getAll(JobStatus.NEW)).size());
        assertEquals("The job should not have been marked as submitted", 0,
                IteratorUtils.toList(dao.getAll(JobStatus.SUBMITTED)).size());
        TestMessageListener normalMessageListener = new TestMessageListener();
        JMSConnectionMockupMQ.getInstance().setListener(
                JobChannelUtil.getChannel(JobPriority.HIGHPRIORITY),
                normalMessageListener);
        assertEquals("Should have created one job after starting job dispatching", 1, dao.getCountJobs());
        ((JMSConnectionMockupMQ) JMSConnectionFactory.getInstance()).waitForConcurrentTasksToFinish();
        assertEquals("The job should still be marked as new", 1,
                IteratorUtils.toList(dao.getAll(JobStatus.NEW)).size());
        assertEquals("The job should not have been marked as submitted", 0,
                IteratorUtils.toList(dao.getAll(JobStatus.SUBMITTED)).size());

        TestMessageListener normalMessageListener = new TestMessageListener();
        JMSConnectionMockupMQ.getInstance().setListener(JobChannelUtil.getChannel(JobPriority.HIGHPRIORITY),
                normalMessageListener);

Note the indention cause by class + method blocks. Additional try/if/for/while block will eat further into the available line.

What looks pretty is of course a very individual thing, and will also vary by which interface is used, eg. do you view the code on paper, side-by-side in your editor, many windows, etc.

  • No labels