fixed issue #2597
SQL: small fix for cases like "select"
Java 7 issue was extracted.
Issue #2605 was fixed.
Merge branch '1.7.7' into develop

Conflicts:
	commons/src/main/java/com/orientechnologies/common/io/OFileUtils.java
	core/src/main/java/com/orientechnologies/orient/core/index/OIndexAbstract.java
	tests/src/test/java/com/orientechnologies/orient/test/database/auto/IndexTest.java