import org.sonar.batch.phases.Phases;
import org.sonar.batch.phases.Phases.Phase;
-import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.LinkedHashMap;
private Map<String, ItemProfiling> profilingPerBatchStep = new LinkedHashMap<String, ItemProfiling>();
private final Project module;
- public ModuleProfiling(@CheckForNull Project module, System2 system) {
+ public ModuleProfiling(@Nullable Project module, System2 system) {
super(system);
this.module = module;
}
private final System2 system;
- public PhasesSumUpTimeProfiler() {
- this(System2.INSTANCE);
- }
-
static void println(String msg) {
LOG.info(msg);
}
println(sb.toString());
}
- @VisibleForTesting
- PhasesSumUpTimeProfiler(System2 system) {
+ public PhasesSumUpTimeProfiler(System2 system) {
this.totalProfiling = new ModuleProfiling(null, system);
this.system = system;
}
import org.sonar.api.config.Settings;
import org.sonar.api.platform.ComponentContainer;
import org.sonar.api.task.TaskExtension;
+import org.sonar.api.utils.System2;
import org.sonar.batch.bootstrap.ExtensionInstaller;
import org.sonar.batch.profiling.PhasesSumUpTimeProfiler;
import org.sonar.batch.scan.maven.MavenPluginExecutor;
settings = new Settings();
parentContainer = new ComponentContainer();
parentContainer.add(settings);
+ parentContainer.add(System2.INSTANCE);
container = new ProjectScanContainer(parentContainer);
}
private final MyBatis myBatis;
private final System2 system;
- PermissionTemplateDao(MyBatis myBatis, System2 system) {
+ public PermissionTemplateDao(MyBatis myBatis, System2 system) {
this.myBatis = myBatis;
this.system = system;
}
- public PermissionTemplateDao(MyBatis myBatis) {
- this(myBatis, System2.INSTANCE);
- }
-
/**
* @return a paginated list of users.
*/
return effortToFixDescription;
}
- public RuleDto setEffortToFixDescription(@Nullable String effortToFixDescription) {
- this.effortToFixDescription = effortToFixDescription;
+ public RuleDto setEffortToFixDescription(@Nullable String s) {
+ this.effortToFixDescription = s;
return this;
}
import org.junit.Before;
import org.junit.Test;
+import org.sonar.api.utils.System2;
import org.sonar.core.persistence.AbstractDaoTestCase;
import java.util.List;
@Before
public void setUp() {
- dao = new PermissionTemplateDao(getMyBatis());
+ dao = new PermissionTemplateDao(getMyBatis(), System2.INSTANCE);
}
@Test
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.Settings;
+import org.sonar.api.utils.System2;
import org.sonar.api.web.UserRole;
import org.sonar.core.persistence.AbstractDaoTestCase;
import org.sonar.core.persistence.MyBatis;
public void setUp() {
RoleDao roleDao = new RoleDao(getMyBatis());
UserDao userDao = new UserDao(getMyBatis());
- permissionTemplateDao = new PermissionTemplateDao(getMyBatis());
+ permissionTemplateDao = new PermissionTemplateDao(getMyBatis(), System2.INSTANCE);
Settings settings = new Settings();
permissionFacade = new PermissionFacade(getMyBatis(), roleDao, userDao, new ResourceDao(getMyBatis()), permissionTemplateDao, settings);
}
import org.junit.Before;
import org.junit.Test;
+import org.sonar.api.utils.System2;
import org.sonar.core.persistence.AbstractDaoTestCase;
import java.util.List;
@Before
public void setUp() {
- dao = new PermissionTemplateDao(getMyBatis());
+ dao = new PermissionTemplateDao(getMyBatis(), System2.INSTANCE);
}
@Test
import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
import org.sonar.api.security.DefaultGroups;
+import org.sonar.api.utils.System2;
import org.sonar.core.permission.PermissionFacade;
import org.sonar.core.permission.PermissionTemplateDao;
import org.sonar.core.persistence.AbstractDaoTestCase;
project = new Project("project").setId(123);
settings = new Settings();
PermissionFacade permissionFacade = new PermissionFacade(getMyBatis(),
- new RoleDao(getMyBatis()), new UserDao(getMyBatis()), new ResourceDao(getMyBatis()), new PermissionTemplateDao(getMyBatis()), settings);
+ new RoleDao(getMyBatis()), new UserDao(getMyBatis()), new ResourceDao(getMyBatis()), new PermissionTemplateDao(getMyBatis(), System2.INSTANCE), settings);
permissions = new DefaultResourcePermissions(getMyBatis(), permissionFacade);
}