Anomaly while build

I am getting these error :

  1. It is somewhat confusing to have a field name matching the declaring class name" in line 7 of AnnualizedReturn.java.

  2. Found ‘UR’-anomaly for variable ‘stackTraceElement’ (lines ‘15’-‘22’). in UncaughtExceptionHandler.java
    I had not touched these files. Do the milestone wants us to do required changes in these files. Or should I supress Warnings.

Found ‘DD’-anomaly for variable ‘urls’](https://pmd.github.io/pmd-6.10.0/pmd_rules_java_errorprone.html#dataflowanomalyanalysis) . I am just initializing a string like this String urls = new String(“xyz”); Unable to solve this. I googled they said to supress this. Please help me with error.

Hey, these are anomalies relating to pmd, we do have a potential FAQ for this -

I have opened the html link in browser and then only got to know about the issues. I have googled the errors and wrote the results I have found. If possible kindly help me with this.

Check for the files which are causing the anomaly, there would be variable anomalies. It means that there are some variables which are not being being used or variable names are not valid according checkstyle

It has been more that 12 hours since we have got any reply on this query. If the issue still persists feel free to raise a new query. I’m closing this one.

The issue was resolved. I made the changes in AnnualizedReturns and UncaughtExceptionHandler.java .

Cool. Good Luck for your future modules. :slight_smile:

1 Like

I get a way through to not get DD anomaly in that module. But got stuck with same problem in Module 3. I am declaring Double closingPrice = 0.0 and getting DD anomaly for this. Please suggest how to resolve this. I googled much but didnt get the solution instead of supressing warning.