*/
package org.sonar.api.security;
-import com.google.common.base.Objects;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.sonar.api.database.BaseIdentifiable;
}
public boolean isAnyone() {
- return Objects.equal(groupId, ANYONE_GROUP_ID);
+ return groupId == ANYONE_GROUP_ID;
}
@Override
*/
package org.sonar.server.platform;
+import com.google.common.base.Supplier;
+import com.google.common.base.Suppliers;
import org.apache.commons.lang.StringUtils;
import org.sonar.core.config.ConfigurationUtils;
}
static final String PROPERTY = "SONAR_HOME";
- private static File home;
-
- static File getHome() {
- if (home == null) {
- home = locate();
+ static Supplier<File> homeSupplier = Suppliers.memoize(new Supplier<File>() {
+ public File get() {
+ File home = locate();
System.setProperty(PROPERTY, home.getAbsolutePath());
+ return home;
}
- return home;
+ });
+
+ static File getHome() {
+ return homeSupplier.get();
}
static File locate() {