Is this the correct way of indenting java code?

2018-06-05 08:32:05

I have a function, which underwards performs SQL Queries. Therefore, it receives long string as a parameter. Automatically my IDE tabs the code this way:

List listOfObjects = dbConnector.getListOfBeans(MyFirstObject.class, dbConnector.getMapList(

"SELECT gam.* FROM whatever gam INNER JOIN any g ON g.anyid = gam.anyid " + // 8 spaces / 2 tabs

"WHERE g.anyfield = " + anyVar)); // 12 spaces / 3 tabs

Where I would normally write it like:

List listOfObjects = dbConnector.getListOfBeans(MyFirstObject.class, dbConnector.getMapList(

"SELECT gam.* FROM whatever gam INNER JOIN any g ON g.anyid = gam.anyid " + // 4 spaces / 1 tab

"WHERE g.anyfield = " + anyVar)); // 4 spaces / 1 tab

Is there any reason why it is indented this way?