Java Code Examples for java.util.List.removeAll()

The following are Jave code examples for showing how to use removeAll() of the java.util.List class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: pgcodekeeper   File: PgDumper.java   Source Code and License Vote up 6 votes
public PgDumper(String exePgdump, String customParams,
        String host, int port, String user, String pass,
        String dbname, String encoding, String timezone, String dumpFile) {
    this.exePgdump = exePgdump;
    this.host = host;
    this.port = port;
    this.user = user;
    this.pass = pass;
    this.dbname = dbname;
    this.encoding = encoding;
    this.timezone = timezone;
    this.dumpFile = dumpFile;

    List<String> listCustom = new ArrayList<>(Arrays.asList(customParams.split(" "))); //$NON-NLS-1$
    listCustom.removeAll(Arrays.asList("")); //$NON-NLS-1$
    this.customParams = Collections.unmodifiableList(listCustom);
}
 
Example 2
Project: lemcloud   File: AuthorityServiceImpl.java   Source Code and License Vote up 6 votes
@Override
public List<Operation> findOperationsByRoleId(int roleId){
	recRole = new ArrayList<Role>() ;
	roleOperation = new ArrayList<Operation>();
	roleOperation = roleService.findOperationByRoleId(roleId);
	for(Operation o :roleOperation){
		o.setState(true);
	}
	Role r = roleService.find(roleId);
	if(r.getRoleExtendPId()>=0){
		findRolesByRoleId(r.getRoleExtendPId());
	}
	for(Role r1 :recRole){
		List<Operation> opera = roleService.findOperationByRoleId(r1.getId());
		opera.removeAll(roleOperation); // 移除所有和operations中一致的操作
		roleOperation.addAll(opera); //将剩余操作加入集合中
	}
	return roleOperation;
}
 
Example 3
Project: nc-android-webrtcpeer   File: PeerConnectionClient.java   Source Code and License Vote up 6 votes
private static String movePayloadTypesToFront(List<String> preferredPayloadTypes, String mLine) {
    // The format of the media description line should be: m=<media> <port> <proto> <fmt> ...
    final List<String> origLineParts = Arrays.asList(mLine.split(" "));
    if (origLineParts.size() <= 3) {
        Log.e(TAG, "Wrong SDP media description format: " + mLine);
        return null;
    }
    final List<String> header = origLineParts.subList(0, 3);
    final List<String> unpreferredPayloadTypes =
            new ArrayList<String>(origLineParts.subList(3, origLineParts.size()));
    unpreferredPayloadTypes.removeAll(preferredPayloadTypes);
    // Reconstruct the line with |preferredPayloadTypes| moved to the beginning of the payload
    // types.
    final List<String> newLineParts = new ArrayList<String>();
    newLineParts.addAll(header);
    newLineParts.addAll(preferredPayloadTypes);
    newLineParts.addAll(unpreferredPayloadTypes);
    return joinString(newLineParts, " ", false /* delimiterAtEnd */);
}
 
Example 4
Project: jdk8u-jdk   File: CheckZombieLockTest.java   Source Code and License Vote up 6 votes
private static void testFileHandlerClose(File writableDir) throws IOException {
    File fakeLock = new File(writableDir, "log.log.lck");
    if (!createFile(fakeLock, false)) {
        throw new IOException("Can't create fake lock file: " + fakeLock);
    }
    try {
        List<File> before = listLocks(writableDir, true);
        System.out.println("before: " + before.size() + " locks found");
        FileHandler handler = createFileHandler(writableDir);
        System.out.println("handler created: " + handler);
        List<File> after = listLocks(writableDir, true);
        System.out.println("after creating handler: " + after.size() + " locks found");
        handler.close();
        System.out.println("handler closed: " + handler);
        List<File> afterClose = listLocks(writableDir, true);
        System.out.println("after closing handler: " + afterClose.size() + " locks found");
        afterClose.removeAll(before);
        if (!afterClose.isEmpty()) {
            throw new RuntimeException("Zombie lock file detected: " + afterClose);
        }
    } finally {
        if (fakeLock.canRead()) delete(fakeLock);
    }
    List<File> finalLocks = listLocks(writableDir, false);
    System.out.println("After cleanup: " + finalLocks.size() + " locks found");
}
 
Example 5
Project: JLink   File: PRF1Extended.java   Source Code and License Vote up 6 votes
public static double objectiveFunction(Map<String, Set<String>> goldData, Map<String, Set<String>> resultData) {

		for (String abstarctID : goldData.keySet()) {
			resultData.putIfAbsent(abstarctID, new HashSet<String>());
		}

		double macroF1 = 0;
		for (String pubmedID : goldData.keySet()) {
			macroF1 += PRF1Extended.macroF1(goldData.get(pubmedID), resultData.get(pubmedID)) / goldData.size();
			JLink.log.info("DocumentID		= " + pubmedID);
			JLink.log.info("Findings		= " + resultData.get(pubmedID));
			JLink.log.info("Gold			= " + goldData.get(pubmedID));
			JLink.log.info("Precision: " + macroPrecision(goldData.get(pubmedID), resultData.get(pubmedID)));
			JLink.log.info("Recall: " + macroRecall(goldData.get(pubmedID), resultData.get(pubmedID)));
			JLink.log.info("F1: " + macroF1(goldData.get(pubmedID), resultData.get(pubmedID)));
			List<String> x = new ArrayList<>(goldData.get(pubmedID));
			x.removeAll(resultData.get(pubmedID));
			List<String> y = new ArrayList<>(resultData.get(pubmedID));
			y.removeAll(goldData.get(pubmedID));
			JLink.log.info("Missing: " + x);
			JLink.log.info("To much: " + y);
			JLink.log.info("");
		}

		return macroF1;
	}
 
Example 6
Project: loom   File: BaseModelTest.java   Source Code and License Vote up 5 votes
@Test
public void testFoo() {
    List<MyFibre> fibres = new ArrayList<>();
    List<MyFibre> fibres2 = new ArrayList<>();
    MyFibreType myFibreType = new MyFibreType();


    for (int i = 0; i < 4000000; i++) {
        MyFibre fib = new MyFibre("LogicalId", myFibreType);
        fibres.add(fib);
        fibres2.add(fib);
    }
    fibres.removeAll(fibres2);
}
 
Example 7
Project: BaseClient   File: GuiScreenResourcePacks.java   Source Code and License Vote up 5 votes
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0])));
    this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));

    if (!this.changed)
    {
        this.availableResourcePacks = Lists.<ResourcePackListEntry>newArrayList();
        this.selectedResourcePacks = Lists.<ResourcePackListEntry>newArrayList();
        ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository();
        resourcepackrepository.updateRepositoryEntriesAll();
        List<ResourcePackRepository.Entry> list = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll());
        list.removeAll(resourcepackrepository.getRepositoryEntries());

        for (ResourcePackRepository.Entry resourcepackrepository$entry : list)
        {
            this.availableResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry));
        }

        for (ResourcePackRepository.Entry resourcepackrepository$entry1 : Lists.reverse(resourcepackrepository.getRepositoryEntries()))
        {
            this.selectedResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry1));
        }

        this.selectedResourcePacks.add(new ResourcePackListEntryDefault(this));
    }

    this.availableResourcePacksList = new GuiResourcePackAvailable(this.mc, 200, this.height, this.availableResourcePacks);
    this.availableResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 - 4 - 200);
    this.availableResourcePacksList.registerScrollButtons(7, 8);
    this.selectedResourcePacksList = new GuiResourcePackSelected(this.mc, 200, this.height, this.selectedResourcePacks);
    this.selectedResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 + 4);
    this.selectedResourcePacksList.registerScrollButtons(7, 8);
}
 
Example 8
Project: gamesboard   File: UserService.java   Source Code and License Vote up 5 votes
@Override
public void doRetrieveRooster(MessageContext context) {
	User user = getContextUser(context);
	Set<User> contacts = new HashSet<User>(user.getContacts());
	Set<User> invited = new HashSet<User>(contacts);
	List<User> inverseRooster = getWhoAdded(user);

	invited.removeAll(inverseRooster);
	contacts.retainAll(inverseRooster);
	inverseRooster.removeAll(contacts);
	
	HubMessage msg = new HubMessage(HubMessage.TYPE_ACK, HubMessage.TYPE_REQUEST_ROOSTER);
	JSONSerializer serializer = createSerializer();
	StringBuilder builder = new StringBuilder();
	
	builder.append("[");
	builder.append(serializer.deepSerialize(invited)); // Users that I invited but have not added me.
	builder.append(",");
	builder.append(serializer.deepSerialize(contacts)); // Users present for game. Added and added back
	builder.append(",");
	builder.append(serializer.deepSerialize(inverseRooster)); // Users that have added me but I have not added back.
	builder.append("]");
	
	msg.setPayload(builder.toString());
	msg.addTo(user.getEmail());
	messageService.sendMessage(context, msg);
}
 
Example 9
Project: RDF2PT   File: BoaPatternSelector.java   Source Code and License Vote up 5 votes
private static boolean isSuitable(Pattern pattern) {

        List<String> wordTokensList = new ArrayList<>(Arrays.asList(pattern.naturalLanguageRepresentation.split(" ")));
        List<String> posTagTokens = new ArrayList<>(Arrays.asList(pattern.posTags.split(" ")));

        String[] wordTokens = pattern.naturalLanguageRepresentation.split(" ");
        String[] tagTokens = pattern.posTags.split(" ");

        // we want to remove the be forms and the corresponding pos tags
        for (int i = 0; i < tagTokens.length; i++) {

            if (wordTokens[i + 1].matches("(^\\p{Upper}.*|and)") || tagTokens[i].matches("(''|``|,|-RRB-|-LRB-|WP)")) {
                wordTokensList.set(i + 1, null);
                posTagTokens.set(i, null);
            }
        }
        if (wordTokens[wordTokens.length - 2].equals("the"))
            wordTokens[wordTokens.length - 2] = null;

        wordTokensList.removeAll(Arrays.asList("", null));
        posTagTokens.removeAll(Arrays.asList("", null));

        pattern.naturalLanguageRepresentation = Joiner.on(" ").join(wordTokensList);
        pattern.posTags = Joiner.on(" ").join(posTagTokens);

        wordTokensList.removeAll(BE_TOKENS);
        wordTokensList.remove("a");
        wordTokensList.remove("?D?");
        wordTokensList.remove("?R?");

        // check if the patterns contains a verb other than be verbs
        return posTagTokens.contains("VB") && wordTokensList.size() > 0;

    }
 
Example 10
Project: Shadbot   File: BlacklistSettingCmd.java   Source Code and License Vote up 5 votes
@Override
public void execute(Context context, String arg) throws MissingArgumentException, IllegalCmdArgumentException {
	if(arg == null) {
		throw new MissingArgumentException();
	}

	List<String> splitArgs = StringUtils.split(arg, 2);
	if(splitArgs.size() != 2) {
		throw new MissingArgumentException();
	}

	Action action = Utils.getValueOrNull(Action.class, splitArgs.get(0));
	if(action == null) {
		throw new IllegalCmdArgumentException(String.format("`%s` is not a valid action. %s",
				splitArgs.get(0), FormatUtils.formatOptions(Action.class)));
	}

	List<String> commands = StringUtils.split(splitArgs.get(1).toLowerCase());

	List<String> unknownCmds = commands.stream().filter(cmd -> CommandManager.getCommand(cmd) == null).collect(Collectors.toList());
	if(!unknownCmds.isEmpty()) {
		throw new IllegalCmdArgumentException(String.format("Command %s doesn't exist.",
				FormatUtils.format(unknownCmds, cmd -> String.format("`%s`", cmd), ", ")));
	}

	DBGuild dbGuild = Database.getDBGuild(context.getGuild());
	List<String> blacklist = dbGuild.getBlacklistedCmd();
	if(Action.ADD.equals(action)) {
		blacklist.addAll(commands);
		BotUtils.sendMessage(String.format(Emoji.CHECK_MARK + " Command(s) `%s` added to the blacklist.",
				FormatUtils.format(commands, cmd -> String.format("`%s`", cmd), ", ")), context.getChannel());
	} else if(Action.REMOVE.equals(action)) {
		blacklist.removeAll(commands);
		BotUtils.sendMessage(String.format(Emoji.CHECK_MARK + " Command(s) `%s` removed from the blacklist.",
				FormatUtils.format(commands, cmd -> String.format("`%s`", cmd), ", ")), context.getChannel());
	}

	dbGuild.setSetting(this.getSetting(), new JSONArray(blacklist));
}
 
Example 11
Project: ibench   File: AbstractScenarioGenerator.java   Source Code and License Vote up 5 votes
protected RelationType getRandomRelWithNumAttr (boolean source, int numAttr, 
		Collection<RelationType> notThese) {
	List<RelationType> cand = new ArrayList<RelationType> ();
	
	for(RelationType r: model.getSchema(source).getRelationArray()) {
		if (r.sizeOfAttrArray() == numAttr)
			cand.add(r);
	}
	// remove the ones not allowed
	cand.removeAll(notThese);
	
	return pickRel(cand);
}
 
Example 12
Project: XinFramework   File: MemoryCookieStore.java   Source Code and License Vote up 5 votes
@Override
public synchronized void saveCookie(HttpUrl url, Cookie cookie) {
    List<Cookie> cookies = memoryCookies.get(url.host());
    List<Cookie> needRemove = new ArrayList<>();
    for (Cookie item : cookies) {
        if (cookie.name().equals(item.name())) {
            needRemove.add(item);
        }
    }
    cookies.removeAll(needRemove);
    cookies.add(cookie);
}
 
Example 13
Project: sumo   File: MaskVectorLayer.java   Source Code and License Vote up 5 votes
/**
   * create the new buffered layer
   */
  public void buffer(double bufferingDistance) {
      List<Geometry> bufferedGeom=glayer.getGeometries();

      try {
	bufferedGeom=parallelBuffer(bufferedGeom, bufferingDistance);
} catch (InterruptedException | ExecutionException e) {
	e.printStackTrace();
}

      // then merge them
      List<Geometry> newgeoms = new ArrayList<Geometry>();
      List<Geometry> remove = new ArrayList<Geometry>();
     // if(bufferingDistance>0){
       //ciclo sulle nuove geometrie
       for (Geometry buffGeom : bufferedGeom) {
           boolean isnew = true;
           remove.clear();
           for (Geometry newg : newgeoms) {
               if (newg.contains(buffGeom)) { //se newg contiene g -> g deve essere rimossa
                   isnew = false;
                   break;
               } else if (buffGeom.contains(newg)) { //se g contiene newg -> newg deve essere rimossa
                   remove.add(newg);
               }
           }
           if (isnew) {
               newgeoms.add(buffGeom);
           }
           newgeoms.removeAll(remove);
       }
       glayer.clear();
       // assign new value
       for (Geometry geom :newgeoms) {
           glayer.put(geom);
       }
    //  }
  }
 
Example 14
Project: dubbox-hystrix   File: Dump.java   Source Code and License Vote up 5 votes
private List<String> getNoProviders() {
    List<String> providerServices = providerDAO.findServices();
    List<String> consumerServices = consumerDAO.findServices();
    List<String> noProviderServices = new ArrayList<String>();
    if (consumerServices != null) {
        noProviderServices.addAll(consumerServices);
        noProviderServices.removeAll(providerServices);
    }
    return noProviderServices;
}
 
Example 15
Project: DeBrug   File: Interpreter.java   Source Code and License Vote up 5 votes
public static List<SNode> BeperklijstMetInstantiesLigtVoor(List<SNode> instantiesVanObject, SNode ligtVoor) {

    List<SNode> result = instantiesVanObject;
    List<SNode> teverwijderenInstanties = new ArrayList<SNode>();

    SNode kenmerk = SConceptOperations.createNewNode(MetaAdapterFactory.getConcept(0x8dc4b25f4c49400eL, 0xac370fd230db702cL, 0x4916e0625cef8883L, "ObjectiefRecht.structure.Kenmerk"));
    {
      final SNode variabele = SLinkOperations.getTarget(ligtVoor, MetaAdapterFactory.getContainmentLink(0x8dc4b25f4c49400eL, 0xac370fd230db702cL, 0x46db58718361b134L, 0x46db58718361b135L, "expressie1"));
      if (SNodeOperations.isInstanceOf(variabele, MetaAdapterFactory.getConcept(0x8dc4b25f4c49400eL, 0xac370fd230db702cL, 0x76ccb41bf386dd7eL, "ObjectiefRecht.structure.Variabele"))) {
        kenmerk = SLinkOperations.getTarget(SLinkOperations.getTarget(variabele, MetaAdapterFactory.getContainmentLink(0x8dc4b25f4c49400eL, 0xac370fd230db702cL, 0x76ccb41bf386dd7eL, 0x1fabc0b15d875006L, "kenmerk")), MetaAdapterFactory.getReferenceLink(0x8dc4b25f4c49400eL, 0xac370fd230db702cL, 0x6e43a734f86e13f2L, 0x6e43a734f86e13f3L, "kenmerk"));
      }
    }
    {
      final SNode huidigeDatum = SLinkOperations.getTarget(ligtVoor, MetaAdapterFactory.getContainmentLink(0x8dc4b25f4c49400eL, 0xac370fd230db702cL, 0x46db58718361b134L, 0x46db58718361b137L, "expressie2"));
      if (SNodeOperations.isInstanceOf(huidigeDatum, MetaAdapterFactory.getConcept(0x8dc4b25f4c49400eL, 0xac370fd230db702cL, 0x7dbb3ebc6b57f9e0L, "ObjectiefRecht.structure.HuidigeDatum"))) {
        for (SNode instantieVanObject : ListSequence.fromList(result)) {
          SNode datumWaarde = (SNode) InstantieVanObject__BehaviorDescriptor.GeefWaardeVanKenmerk_idFR9FxGLp3H.invoke(instantieVanObject, kenmerk);
          LocalDate Datum = Datum__BehaviorDescriptor.geefdatum_id5riiL_BUg0c.invoke(SLinkOperations.getTarget(datumWaarde, MetaAdapterFactory.getContainmentLink(0x30ef095ad48945ffL, 0xa80f456a798ac125L, 0x1fabc0b15d9b6273L, 0x1fabc0b15d9b6274L, "waarde")));
          Interpreter.voegBerichtToe("Ligt " + Datum + " voor " + LocalDate.now() + "?");
          if (!(Datum.isBefore(LocalDate.now()))) {
            Interpreter.voegBerichtToe(Datum + " ligt niet voor " + LocalDate.now());
            teverwijderenInstanties.add(instantieVanObject);
          }
        }
      }
    }
    result.removeAll(teverwijderenInstanties);
    return result;
  }
 
Example 16
Project: incubator-netbeans   File: CLIHandler.java   Source Code and License Vote up 5 votes
/**
 * Restore the arguments list to a clean state.
 * If not consuming arguments, it is just set to the original list.
 * If consuming arguments, any nulled-out arguments are removed from the list.
 */
void reset(boolean consume) {
    if (consume) {
        String[] a = args;
        if (a == null) {
            a = argsBackup;
        }
        List<String> l = new ArrayList<String>(Arrays.asList(a));
        l.removeAll(Collections.singleton(null));
        args = l.toArray(new String[l.size()]);
    } else {
        args = argsBackup.clone();
    }
}
 
Example 17
Project: Backmemed   File: ConnectedParser.java   Source Code and License Vote up 4 votes
public Biome[] parseBiomes(String p_parseBiomes_1_)
{
    if (p_parseBiomes_1_ == null)
    {
        return null;
    }
    else
    {
        boolean flag = false;

        if (p_parseBiomes_1_.startsWith("!"))
        {
            flag = true;
            p_parseBiomes_1_ = p_parseBiomes_1_.substring(1);
        }

        String[] astring = Config.tokenize(p_parseBiomes_1_, " ");
        List list = new ArrayList();

        for (int i = 0; i < astring.length; ++i)
        {
            String s = astring[i];
            Biome biome = this.findBiome(s);

            if (biome == null)
            {
                this.warn("Biome not found: " + s);
            }
            else
            {
                list.add(biome);
            }
        }

        if (flag)
        {
            List<Biome> list1 = Lists.newArrayList(Biome.REGISTRY.iterator());
            list1.removeAll(list);
            list = list1;
        }

        Biome[] abiome = (Biome[])((Biome[])list.toArray(new Biome[list.size()]));
        return abiome;
    }
}
 
Example 18
Project: lams   File: RandomBalanceStrategy.java   Source Code and License Vote up 4 votes
public ConnectionImpl pickConnection(LoadBalancedConnectionProxy proxy, List<String> configuredHosts, Map<String, ConnectionImpl> liveConnections,
        long[] responseTimes, int numRetries) throws SQLException {
    int numHosts = configuredHosts.size();

    SQLException ex = null;

    List<String> whiteList = new ArrayList<String>(numHosts);
    whiteList.addAll(configuredHosts);

    Map<String, Long> blackList = proxy.getGlobalBlacklist();

    whiteList.removeAll(blackList.keySet());

    Map<String, Integer> whiteListMap = this.getArrayIndexMap(whiteList);

    for (int attempts = 0; attempts < numRetries;) {
        int random = (int) Math.floor((Math.random() * whiteList.size()));
        if (whiteList.size() == 0) {
            throw SQLError.createSQLException("No hosts configured", null);
        }

        String hostPortSpec = whiteList.get(random);

        ConnectionImpl conn = liveConnections.get(hostPortSpec);

        if (conn == null) {
            try {
                conn = proxy.createConnectionForHost(hostPortSpec);
            } catch (SQLException sqlEx) {
                ex = sqlEx;

                if (proxy.shouldExceptionTriggerConnectionSwitch(sqlEx)) {

                    Integer whiteListIndex = whiteListMap.get(hostPortSpec);

                    // exclude this host from being picked again
                    if (whiteListIndex != null) {
                        whiteList.remove(whiteListIndex.intValue());
                        whiteListMap = this.getArrayIndexMap(whiteList);
                    }
                    proxy.addToGlobalBlacklist(hostPortSpec);

                    if (whiteList.size() == 0) {
                        attempts++;
                        try {
                            Thread.sleep(250);
                        } catch (InterruptedException e) {
                        }

                        // start fresh
                        whiteListMap = new HashMap<String, Integer>(numHosts);
                        whiteList.addAll(configuredHosts);
                        blackList = proxy.getGlobalBlacklist();

                        whiteList.removeAll(blackList.keySet());
                        whiteListMap = this.getArrayIndexMap(whiteList);
                    }

                    continue;
                }

                throw sqlEx;
            }
        }

        return conn;
    }

    if (ex != null) {
        throw ex;
    }

    return null; // we won't get here, compiler can't tell
}
 
Example 19
Project: incubator-netbeans   File: IssuePanel.java   Source Code and License Vote up 4 votes
private void initStatusCombo(String currentStatus) {
    // Init statusCombo - allowed transitions (heuristics):
    // Open -> Open-Unconfirmed-Reopened+Resolved
    // Resolved -> Reopened+Close
    // Close-Resolved -> Reopened+Resolved+(Close with higher index)
    BugzillaRepository repository = issue.getRepository();
    BugzillaConfiguration bc = repository.getConfiguration();
    if(bc == null || !bc.isValid()) {
        // XXX nice error msg?
        return;
    }
    List<String> allStatuses = bc.getStatusValues();
    List<String> openStatuses = bc.getOpenStatusValues();
    List<String> statuses = new LinkedList<>();
    boolean oldRepository = (issue.getRepository().getConfiguration().getInstalledVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_2) < 0);
    String nev = "NEW"; // NOI18N
    String unconfirmed = "UNCONFIRMED"; // NOI18N
    String reopened = "REOPENED"; // NOI18N
    String resolved = "RESOLVED"; // NOI18N
    if (currentStatus != null) {
        currentStatus = currentStatus.trim();
    }
    String status = issue.getLastSeenFieldValue(IssueField.STATUS);
    if (status.isEmpty()) {
        status = currentStatus;
    }
    if (openStatuses.contains(status)) {
        statuses.addAll(openStatuses);
        if (!unconfirmed.equals(status)) {
            statuses.remove(unconfirmed);
        }
        if (!reopened.equals(status)) {
            statuses.remove(reopened);
        }
        if (oldRepository && !nev.equals(status)) {
            statuses.remove(nev);
        }
        statuses.add(resolved);
    } else {
        if (allStatuses.contains(reopened)) {
            statuses.add(reopened);
        } else {
            // Pure guess
            statuses.addAll(openStatuses);
            statuses.remove(unconfirmed);
            if (oldRepository) {
                statuses.remove(nev);
            }
        }
        if (resolved.equals(status)) {
            List<String> closedStatuses = new LinkedList<>(allStatuses);
            closedStatuses.removeAll(openStatuses);
            statuses.addAll(closedStatuses);
        } else {
            if (!oldRepository) {
                statuses.add(resolved);
            }
            if (allStatuses.contains(status)) {
                if (!"".equals(status)) {
                    for (int i = allStatuses.indexOf(status); i < allStatuses.size(); i++) {
                        String s = allStatuses.get(i);
                        if (!openStatuses.contains(s)) {
                            statuses.add(s);
                        }
                    }
                }
            } else {
                Bugzilla.LOG.log(Level.WARNING, "status value {0} not between all statuses: {1}", new Object[]{status, allStatuses}); // NOI18N
            }
        }
    }
    resolvedIndex = statuses.indexOf(resolved);
    statusCombo.setModel(toComboModel(statuses));
    statusCombo.setSelectedItem(currentStatus);
}
 
Example 20
Project: jdk8u-jdk   File: TCKOffsetDateTime.java   Source Code and License Vote up 4 votes
@Override
protected List<TemporalField> invalidFields() {
    List<TemporalField> list = new ArrayList<>(Arrays.<TemporalField>asList(ChronoField.values()));
    list.removeAll(validFields());
    return list;
}