import javax.annotation.Nullable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
public abstract class AbstractTimeProfiling {
List<G> result = new ArrayList<G>(maxSize);
int i = 0;
for (G item : sortedList) {
- if (i++ >= maxSize || item.totalTime() == 0) {
+ if (i >= maxSize || item.totalTime() == 0) {
return result;
}
+ i++;
result.add(item);
}
return result;
import org.sonar.api.utils.text.XmlWriter;
import javax.annotation.CheckForNull;
+
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
return params.get(key);
}
- public Result execute() throws Exception {
+ public Result execute() {
TestResponse response = new TestResponse();
action.handler().handle(this, response);
return new Result(response);
--- /dev/null
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2013 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+@javax.annotation.ParametersAreNonnullByDefault
+package org.sonar.api.server.ws;