Hotel-Management-Project-Java icon indicating copy to clipboard operation
Hotel-Management-Project-Java copied to clipboard

Exception is caught when Exception is not thrown in Main.main

Open marcoym2 opened this issue 2 years ago • 0 comments

Bug report: Exception is caught when Exception

Decription: Hotel-Management-Project-Java/Main.java:591 Exception is caught when Exception is not thrown in Main.main(String[]) [Of Concern(15), High confidence]

Tools usage: SpotBugs

To Repoduce: using eclispe for Java develomet: using the PMD to check the bugs line : 591-595 expeced Behavior catch(Exception e) { System.out.println("Not a valid input"); }

for catch the Exception e, we should throw the exception.

enviroment: Eclipse ;

possible solution catch(Exception e) { System.out.println("Not a valid input"+e.toString()); }

Severity: low

marcoym2 avatar Aug 15 '23 01:08 marcoym2