I am writing some complex login in a java function and my calling function has gone up to 150 lines of java code. Even after refactoring some common logic into other functions I am not able to make my calling function shorter than this. Just was wondering in a java method how many lines of code is considered to be good as per basic java coding standards. Thanks in advance
I would consider the maximum acceptable length of a method so that the whole method fits on your screen at once in your IDE, so you shouldn't have to scroll pages and pages. Ofcourse that isn't a strict and exact rule. A method should ideally do only one thing, and not many different things. If you find that you have a method that does many different things, then it's a good idea to split it up into methods that each do one thing.
There are tools such as Checkstyle that can help you with this. Checkstyle can warn, for example, if it decides that your method becomes too complex.