remove unused query attribute in SelectAnalysis

and also replaces deprecated Objects.firstNonNull with 
MoreObjects.firstNonNull