Not able to understand spotbugs report

For UC : I have initialised that object also using it later in the code. Then why it says “USELESS OBJECT”

For Dm : I can’t understand how to resolve this even after reading description. It is performing byte to string conversion. What’s wrong in it ?

Also please note that I have implemented the code as guided in office hours.


From the error, it probably looks like you have initialized an object of the class but you have not used it somewhere, can you check again?

I checked and made some changes in the code but browser preview is not loading now. It goes blank after I enter url of the html spotbugs file ?
Also please tell hoe to resolve Dm ?

I think I am using that object. Also if I remove it then also I am getting spotbugs.

Dm is present because you’re not specifying charset when you’re reading file as a string of a byte.

import java.nio.charset.StandardCharsets;


@akashchhetri, It worked. Thank you very much.
But still struggling to resolve UC.

Click on that UC error it will show you in which line you’re having UC bug.

Yes, I have checked line number. But I think I am using that object late in the code. How could I remove that ?

If you’re using that object then It is fine! and If you made an object an only modifying It and not using it later in your code then this will cause an spot bug error.

Yes i am modifying it. Is there any other alternative to do so ?

Hey @Vaishnavi_Singh as i can see your problem is resolved now as you are in module 3 so closing this query.