Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Implemented
    • Affects Version/s: Trunk
    • Fix Version/s: Upcoming Release
    • Component/s: base
    • Labels:
      None

      Description

      • ComponentContainer.java:140, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
        RCN: Redundant nullcheck of componentLoadFile, which is known to be non-null in org.apache.ofbiz.base.container.ComponentContainer.loadComponentDirectory(String)

      This method contains a redundant check of a known non-null value against the constant null.

      • ComponentContainer.java:165, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
        RCN: Redundant nullcheck of componentsToLoad, which is known to be non-null in org.apache.ofbiz.base.container.ComponentContainer.loadComponentsInDirectoryUsingLoadFile(File, File)

      This method contains a redundant check of a known non-null value against the constant null.

      • ComponentContainer.java:187, NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
        NP: Possible null pointer dereference in org.apache.ofbiz.base.container.ComponentContainer.loadComponentsInDirectory(File) due to return value of called method

      The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.

      • ContainerConfig.java:102, DLS_DEAD_LOCAL_STORE
        DLS: Dead store to num in org.apache.ofbiz.base.container.ContainerConfig.getPropertyValue(ContainerConfig$Configuration, String, int)

      This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used.

      Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

      • ContainerConfig.java:135, DLS_DEAD_LOCAL_STORE
        DLS: Dead store to num in org.apache.ofbiz.base.container.ContainerConfig.getPropertyValue(ContainerConfig$Configuration$Property, String, int)

      This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used.

      Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

        Activity

        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thanks Dennis,

        Your patch is in trunk at revision: 1804636

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thanks Dennis, Your patch is in trunk at revision: 1804636
        Hide
        Dennis Balkir Dennis Balkir added a comment -

        ComponentContainer.java

        • deleted multiple unnecessary nullchecks
        • added nullcheck, because sortedComponentNames could possibly be assigned as null through the method list()

        ContainerConfig.java

        • deleted multiple unnecessary else-blocks
        • deleted two initializations to shorten the code and return the value directly
        Show
        Dennis Balkir Dennis Balkir added a comment - ComponentContainer.java deleted multiple unnecessary nullchecks added nullcheck, because sortedComponentNames could possibly be assigned as null through the method list() ContainerConfig.java deleted multiple unnecessary else-blocks deleted two initializations to shorten the code and return the value directly

          People

          • Assignee:
            jacques.le.roux Jacques Le Roux
            Reporter:
            Dennis Balkir Dennis Balkir
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development