S3626 FP for Redundant Jump on return in try/finally

  • Operating system: Windows 10
  • SonarLint plugin version: 9.3.0.81553
  • Programming language you’re coding in: Java
  • Is connected mode used: No

False Positive of Redundant Jump on the ‘return’ statement.
Does NOT generate a FP if try/finally is removed.

	String x = "";
        if (x.equals("fred"))
        {
            	try
            	{
	           	if (x.equals("fred"))
	            	{
	            		return;
	            	}	                
            	}
            	finally 
            	{
            		System.out.println("Always print");
		}
            	System.out.println("Sometimes print");
    	    }

Hi Kevin,

Thanks for your report! I can confirm that the problem exists. I have created a ticket for this here:[SONARJAVA-4870] - Jira

Cheers!
Marco