You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by "Tejas Patil (JIRA)" <ji...@apache.org> on 2013/05/07 06:33:16 UTC

[jira] [Updated] (NUTCH-1277) Fix [fallthrough] javac warnings

     [ https://issues.apache.org/jira/browse/NUTCH-1277?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tejas Patil updated NUTCH-1277:
-------------------------------

    Attachment: NUTCH-1277.2.x.patch
                NUTCH-1277.trunk.patch

The options that we have are:
1. to suppress the warning
2. duplicate the logic in switch cases and prevent fallthrough

I prefer #1 over #2 (PFA the patches for trunk and 2.x).
The bad thing about #2 is that it will increase the duplication and make the code more difficult to understand and maintain.
eg. In the snippet below, its clear that we will have to duplicate the same code 4 times and everytime we do some change, we need to modify at all the 4 places.

{noformat}case ProtocolStatusCodes.GONE:
case ProtocolStatusCodes.NOTFOUND:
case ProtocolStatusCodes.ACCESS_DENIED:
case ProtocolStatusCodes.ROBOTS_DENIED:
   output(fit, null, status, CrawlStatus.STATUS_GONE);{noformat}
                
> Fix [fallthrough] javac warnings
> --------------------------------
>
>                 Key: NUTCH-1277
>                 URL: https://issues.apache.org/jira/browse/NUTCH-1277
>             Project: Nutch
>          Issue Type: Sub-task
>          Components: build
>    Affects Versions: nutchgora, 1.5
>            Reporter: Lewis John McGibbney
>             Fix For: 1.7
>
>         Attachments: NUTCH-1277.2.x.patch, NUTCH-1277.trunk.patch
>
>
> This usually occurs when we have an instance where a switch statement(s) fall through (that is, one or more break statements are missing).
> We need to determine where a simple
> {code}
> @SuppressWarnings("fallthrough")
> {code}
> is required or whether we need to include the break statements in switch blocks

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira