Java Code Examples for java.util.Collections.EMPTY_LIST

The following are Jave code examples for showing how to use EMPTY_LIST of the java.util.Collections class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: rockscript   File: EventsQuery.java   View Source Code Vote up 6 votes
@Override
public List<ExecutionEvent> execute(Engine engine) {
  BadRequestException.throwIfNull(scriptExecutionId, "scriptExecutionId is a required parameter");

  List<ExecutionEvent> events = engine
    .getScriptExecutionStore()
    .findEventsByScriptExecutionId(scriptExecutionId);

  if (minIndex!=null && minIndex>0) {
    if (minIndex<events.size()) {
      events = events.subList(minIndex, events.size());
    } else {
      events = Collections.EMPTY_LIST;
    }
  }

  return events;
}
 
Example 2
Project: monarch   File: FilterProfile.java   View Source Code Vote up 5 votes
/**
 * Removes the filter profile messages from the queue that are received while the members cache
 * profile exchange was in progress.
 * 
 * @param member whose messages are returned.
 * @return filter profile messages that are queued for the member.
 */
public List removeQueuedFilterProfileMsgs(InternalDistributedMember member) {
  synchronized (this.filterProfileMsgQueue) {
    if (this.filterProfileMsgQueue.containsKey(member)) {
      return new LinkedList(this.filterProfileMsgQueue.remove(member));
    }
  }
  return Collections.EMPTY_LIST;
}
 
Example 3
Project: lams   File: ChainingMetadataProvider.java   View Source Code Vote up 5 votes
/** Constructor. */
public ChainingMetadataProvider() {
    super();
    observers = new CopyOnWriteArrayList<Observer>();
    providers = Collections.EMPTY_LIST;
    providerLock = new ReentrantReadWriteLock(true);
}
 
Example 4
Project: lemon   File: UserDetailsBuilder.java   View Source Code Vote up 5 votes
protected Collection<GrantedAuthority> loadUserAuthorities(List<String> list) {
    if ((list == null) || list.isEmpty()) {
        logger.debug("no authorities");

        return Collections.EMPTY_LIST;
    }

    Set<GrantedAuthority> authsSet = new HashSet<GrantedAuthority>();

    for (String str : list) {
        authsSet.add(new SimpleGrantedAuthority(str));
    }

    return authsSet;
}
 
Example 5
Project: incubator-netbeans   File: ClassesListController.java   View Source Code Vote up 5 votes
@NbBundle.Messages("ClassesListController_AnalyzingClassesMsg=Analyzing classes...")
private static Collection getContextSubclasses(Heap heap, String className, Lookup.Provider project) {
    ProgressHandle pHandle = null;

    try {
        pHandle = ProgressHandle.createHandle(Bundle.ClassesListController_AnalyzingClassesMsg());
        pHandle.setInitialDelay(0);
        pHandle.start();

        HashSet subclasses = new HashSet();

        SourceClassInfo sci = ProfilerTypeUtils.resolveClass(className, project);
        Collection<SourceClassInfo> impls = sci != null ? sci.getSubclasses() : Collections.EMPTY_LIST;

        for (SourceClassInfo ci : impls) {
            JavaClass jClass = heap.getJavaClassByName(ci.getQualifiedName());

            if ((jClass != null) && subclasses.add(jClass)) { // instanceof approach rather than subclassof
                subclasses.addAll(jClass.getSubClasses());
            }
        }

        return subclasses;
    } finally {
        if (pHandle != null) {
            pHandle.finish();
        }
    }
}
 
Example 6
Project: incubator-netbeans   File: SoapClientPojoCodeGenerator.java   View Source Code Vote up 5 votes
@Override
public Set<FileObject> generate() throws IOException {
    preGenerate();

    insertSaasServiceAccessCode(isInBlock(getTargetDocument()));
    //addImportsToTargetFile();

    finishProgressReporting();

    return new HashSet<FileObject>(Collections.EMPTY_LIST);
}
 
Example 7
Project: azure-maven-plugins   File: Utils.java   View Source Code Vote up 5 votes
/**
 * Copy resources to target directory using Maven resource filtering so that we don't have to handle
 * recursive directory listing and pattern matching.
 * In order to disable filtering, the "filtering" property is force set to False.
 *
 * @param project
 * @param session
 * @param filtering
 * @param resources
 * @param targetDirectory
 * @throws IOException
 */
public static void copyResources(final MavenProject project, final MavenSession session,
                                 final MavenResourcesFiltering filtering, final List<Resource> resources,
                                 final String targetDirectory) throws IOException {
    for (final Resource resource : resources) {
        resource.setTargetPath(Paths.get(targetDirectory, resource.getTargetPath()).toString());
        resource.setFiltering(false);
    }

    final MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution(
            resources,
            new File(targetDirectory),
            project,
            "UTF-8",
            null,
            Collections.EMPTY_LIST,
            session
    );

    // Configure executor
    mavenResourcesExecution.setEscapeWindowsPaths(true);
    mavenResourcesExecution.setInjectProjectBuildFilters(false);
    mavenResourcesExecution.setOverwrite(true);
    mavenResourcesExecution.setIncludeEmptyDirs(false);
    mavenResourcesExecution.setSupportMultiLineFiltering(false);

    // Filter resources
    try {
        filtering.filterResources(mavenResourcesExecution);
    } catch (MavenFilteringException ex) {
        throw new IOException("Failed to copy resources", ex);
    }
}
 
Example 8
Project: lams   File: StaticPKIXValidationInformationResolver.java   View Source Code Vote up 5 votes
/**
 * Constructor.
 * 
 * @param info list of PKIX validation information to return
 * @param names set of trusted names to return
 */
public StaticPKIXValidationInformationResolver(List<PKIXValidationInformation> info, Set<String> names) {
    if (info != null) {
        pkixInfo = new ArrayList<PKIXValidationInformation>(info);
    } else {
        pkixInfo = Collections.EMPTY_LIST;
    }

    if (names != null) {
        trustedNames = new HashSet<String>(names);
    } else {
        trustedNames = Collections.EMPTY_SET;
    }
}
 
Example 9
Project: incubator-netbeans   File: SyntaxUpdateTokens.java   View Source Code Vote up 5 votes
/**
 * Create list of tokens of interest for the whole document.
 * <br>
 * Document is readlocked during this operation.
 *
 * @param doc document for which the list of tokens is being retrieved.
 * @return list of {@link TokenInfo}s describing the tokens of interest
 *  throughout the whole document.
 */
public static List getTokenInfoList(Document doc) {
    SyntaxUpdateTokens suTokens = (SyntaxUpdateTokens)doc.getProperty(SyntaxUpdateTokens.class);
    
    if (suTokens == null || !(doc instanceof BaseDocument)) {
        return Collections.EMPTY_LIST;
    }
    
    List tokenList;
    BaseDocument bdoc = (BaseDocument)doc;
    bdoc.readLock();
    try {
        suTokens.syntaxUpdateStart();
        try {
            bdoc.getSyntaxSupport().tokenizeText(
                new AllTokensProcessor(suTokens), 0, bdoc.getLength(), true);
        } catch (BadLocationException e) {
            ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
        } finally {
            tokenList = suTokens.syntaxUpdateEnd();
        }
        
    } finally {
        bdoc.readUnlock();
    }
    return tokenList;
}
 
Example 10
Project: oscm   File: CustomerDataTest.java   View Source Code Vote up 5 votes
/**
 * No error must occur one empty list
 */
@Test
public void getSubscriptionKeys_empty() {
    @SuppressWarnings("unchecked")
    CustomerData data = new CustomerData(Collections.EMPTY_LIST);
    assertTrue(data.getSubscriptionKeys().isEmpty());
}
 
Example 11
Project: AndroidMuseumBleManager   File: ConnectRequestQueue.java   View Source Code Vote up 5 votes
public List<String> getAllDevice(){
    if (macMap.size() <= 0) return Collections.EMPTY_LIST;
    List<String> list = new ArrayList<>();
    for (String key:macMap.keySet()){
        list.add(key);
    }
    return list;
}
 
Example 12
Project: dremio-oss   File: SubSchemaWrapper.java   View Source Code Vote up 5 votes
@Override
public Iterable<String> getSubPartitions(String table,
                                         List<String> partitionColumns,
                                         List<String> partitionValues
) throws PartitionNotFoundException {
  Schema defaultSchema = getDefaultSchema();
  if (defaultSchema instanceof AbstractSchema) {
    return ((AbstractSchema) defaultSchema).getSubPartitions(table, partitionColumns, partitionValues);
  } else {
    return Collections.EMPTY_LIST;
  }

}
 
Example 13
Project: easyfilemanager   File: MultiMap.java   View Source Code Vote up 4 votes
/**
 * Gets the list of values associated with each key.
 */
public List<V> get(K key) {
    List<V> list = mInternalMap.get(key);
    return list == null ? Collections.EMPTY_LIST : list;
}
 
Example 14
Project: dhus-core   File: AbstractEntitySet.java   View Source Code Vote up 4 votes
/**
 * @return a list of association sets (defaults to empty list).
 */
public List<AssociationSet> getAssociationSets()
{
   return Collections.EMPTY_LIST;
}
 
Example 15
Project: monarch   File: MissingCqService.java   View Source Code Vote up 4 votes
@Override
public List<String> getAllDurableClientCqs(ClientProxyMembershipID clientProxyId)
    throws CqException {
  return Collections.EMPTY_LIST;
}
 
Example 16
Project: boohee_v5.6   File: ClassImpl.java   View Source Code Vote up 4 votes
public List<IClass> getSubclasses() {
    return this.subClasses != null ? this.subClasses : Collections.EMPTY_LIST;
}
 
Example 17
Project: incubator-netbeans   File: EvaluatorVisitor.java   View Source Code Vote up 4 votes
@Override
public List<ObjectReference> instances(long l) {
    return Collections.EMPTY_LIST;
}
 
Example 18
Project: Android_watch_magpie   File: User.java   View Source Code Vote up 4 votes
@SuppressWarnings("unchecked")
private User(String username, String password) {
	this(username, password, Collections.EMPTY_LIST);
}
 
Example 19
Project: incubator-netbeans   File: ArrayDump.java   View Source Code Vote up 4 votes
public List getFieldValues() {
    return Collections.EMPTY_LIST;
}
 
Example 20
Project: OpenJSharp   File: SchemaSetImpl.java   View Source Code Vote up 0 votes
public List<XSFacet> getDeclaredFacets(String name) { return Collections.EMPTY_LIST; }