java.util.Collections



Project Graylog2/graylog2-server in file ...org.graylog2.utilities.date.NaturalDateParser.java (2014-11-28)
@@ -24,6 +24,7 @@ import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 import org.joda.time.format.DateTimeFormat;
 
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -40,6 +41,7 @@ public class NaturalDateParser {
         final List<DateGroup> groups = parser.parse(string);
         if (!groups.isEmpty()) {
             final List<Date> dates = groups.get(0).getDates();
+            Collections.sort(dates);
 
             if (dates.size() >= 1) {
                 from = dates.get(0);
Project JetBrains/intellij-community in file ...e/LocalVcs.src.com.intellij.localvcs.LocalVcs.java (2006-11-30)
@@ -2,6 +2,7 @@ package com.intellij.localvcs;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Collections;
 
 public class LocalVcs {
   private Storage myStorage;
@@ -105,6 +106,7 @@ public class LocalVcs {
       result.add(new Label(e, cl, cs, myRoot));
     }
 
+    Collections.reverse(result);    
     return result;
   }
 }
Project JetBrains/intellij-community in file ...s.MavenArtifactCoordinatesArtifactIdConverter.java (2009-08-07)
@@ -6,6 +6,7 @@ import org.jetbrains.idea.maven.indices.MavenProjectIndicesManager;
 import org.jetbrains.idea.maven.project.MavenId;
 
 import java.util.Set;
+import java.util.Collections;
 
 public class MavenArtifactCoordinatesArtifactIdConverter extends MavenArtifactCoordinatesConverter {
   @Override
@@ -16,6 +17,7 @@ public class MavenArtifactCoordinatesArtifactIdConverter extends MavenArtifactCo
 
   @Override
   protected Set<String> doGetVariants(MavenId id, MavenProjectIndicesManager manager) {
+    if (StringUtil.isEmptyOrSpaces(id.getGroupId())) return Collections.emptySet();
     return manager.getArtifactIds(id.getGroupId());
   }
 }
Project JetBrains/intellij-community in file ...om.intellij.xml.index.IndexedRelevantResource.java (2012-09-26)
@@ -30,6 +30,7 @@ import org.jetbrains.annotations.Nullable;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -43,6 +44,7 @@ public class IndexedRelevantResource<K, V extends Comparable> implements Compara
                                                                                            @NotNull Project project,
                                                                                            @Nullable final GlobalSearchScope additionalScope) {
 
+    if (project.isDefault()) return Collections.emptyList();
     final ArrayList<IndexedRelevantResource<K, V>> resources = new ArrayList<IndexedRelevantResource<K, V>>();
     final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
     FileBasedIndex.getInstance().processValues(indexId, key, null, new FileBasedIndex.ValueProcessor<V>() {
Project JetBrains/intellij-community in file ...packageDependencies.ChangeListsScopesProvider.java (2011-08-23)
@@ -28,6 +28,7 @@ import org.jetbrains.annotations.NotNull;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -47,6 +48,8 @@ public class ChangeListsScopesProvider implements CustomScopesProvider {
   @NotNull
   @Override
   public List<NamedScope> getCustomScopes() {
+
+    if (myProject.isDefault()) return Collections.emptyList();
     final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
 
     final List<NamedScope> result = new ArrayList<NamedScope>();