apply rule 2 (binLoad >= binAssignedLoad) when an item has been assign to the bin

@throws ContradictionException if a contradiction (rule 2) is raised
327014
protected void assignItem(int item, int bin) throws ContradictionException {
        for (int d = 0; d < nbDims; d++) {
            filterLoadInf(d, bin, assignedLoad[d][bin].add(iSizes[d][item]));
        }
        if (decoKPSimple != null) {
            decoKPSimple.postAssignItem(item, bin);
        }
    }
112687
private static boolean isChanged(final byte[] bytes, final int length, final String filepath) throws IOException {
        Preconditions.checkArgument(length >= 0, "invalid length value: %s", length);
        Preconditions.checkArgument(bytes.length >= length, "invalid length value: %s", length);

        File file = new File(filepath);
        if (!file.exists()) {
            return true;
        }
        if (file.length() != length) {
            return true;
        }
        final int BUFLEN = 1048576; // 1 megabyte
        byte[] buffer = new byte[BUFLEN];
        InputStream is = new FileInputStream(file);
        try {
            int len;
            for (int offset = 0; ; offset += len) {
                len = is.read(buffer);
                if (len < 0) break; // eof
                if (!arrayCompare(bytes, offset, buffer, 0, len)) return true;
            }
            return false;
        } finally {
            is.close();
        }
    }
1077841
protected void removeItem(int item, int bin) throws ContradictionException {
        updateLoads(item, bin);
        if (decoKPSimple != null) {
            decoKPSimple.postRemoveItem(item, bin);
        }
    }
315730
public void addNotBetween(Object attribute, Object value1, Object value2)
    {
        // PAW
		// addSelectionCriteria(ValueCriteria.buildNotBeweenCriteria(attribute, value1, value2, getAlias()));
		addSelectionCriteria(ValueCriteria.buildNotBeweenCriteria(attribute, value1, value2, getUserAlias(attribute)));
    }
1268453
public void swap(UnorderedCollection<E> other) {
        int sizeTmp = size;
        size = other.size;
        other.size = sizeTmp;
        storage.swap(other.storage);
    }
338240
static boolean load(Map<String, String> storage, boolean reverse, String... pathArray)
    {
        StringDictionary dictionary = new StringDictionary("=");
        for (String path : pathArray)
        {
            if (!dictionary.load(path)) return false;
        }
        if (reverse) dictionary = dictionary.reverse();
        Set<Map.Entry<String, String>> entrySet = dictionary.entrySet();
        for (Map.Entry<String, String> entry : entrySet)
        {
            storage.put(entry.getKey(), entry.getValue());
        }

        return true;
    }
814823
private void failAssignment(String streamSegmentName, Throwable reason) {
        finishPendingRequests(streamSegmentName, PendingRequest::completeExceptionally, reason);
    }
1215190
@Override
	public void propagate(int evtmask) throws ContradictionException {
		int min = 0;
		int max = 0;
		ISet nodes = g.getPotentialNodes();
		for (int i : nodes) {
			if (g.getMandSuccOrNeighOf(i).contains(i)) {
				min++;
				max++;
			} else if (g.getPotSuccOrNeighOf(i).contains(i)) {
				max++;
			}
		}
		k.updateLowerBound(min, this);
		k.updateUpperBound(max, this);
		if (min == max) {
			setPassive();
		} else if (k.isInstantiated()) {
			if (k.getValue() == max) {
				for (int i : nodes) {
					if (g.getPotSuccOrNeighOf(i).contains(i)) {
						g.enforceArc(i, i, this);
					}
				}
				setPassive();
			} else if (k.getValue() == min) {
				for (int i : nodes) {
					if (!g.getMandSuccOrNeighOf(i).contains(i)) {
						g.removeArc(i, i, this);
					}
				}
				setPassive();
			}
		}
	}
296587
public void andNot(final Roaring64NavigableMap x2) {
    boolean firstBucket = true;

    Iterator<Entry<Integer, BitmapDataProvider>> thisIterator = highToBitmap.entrySet().iterator();
    while (thisIterator.hasNext()) {
      Entry<Integer, BitmapDataProvider> e1 = thisIterator.next();

      // Keep object to prevent auto-boxing
      Integer high = e1.getKey();

      BitmapDataProvider lowBitmap2 = x2.highToBitmap.get(high);

      if (lowBitmap2 != null) {
        BitmapDataProvider lowBitmap1 = e1.getValue();

        if (lowBitmap2 instanceof RoaringBitmap && lowBitmap1 instanceof RoaringBitmap) {
          ((RoaringBitmap) lowBitmap1).andNot((RoaringBitmap) lowBitmap2);
        } else if (lowBitmap2 instanceof MutableRoaringBitmap
            && lowBitmap1 instanceof MutableRoaringBitmap) {
          ((MutableRoaringBitmap) lowBitmap1).andNot((MutableRoaringBitmap) lowBitmap2);
        } else {
          throw new UnsupportedOperationException(
              ".and is not between " + this.getClass() + " and " + lowBitmap1.getClass());
        }
      }

      if (firstBucket) {
        firstBucket = false;

        // Invalidate the lowest high as lowest not valid
        firstHighNotValid = Math.min(firstHighNotValid, high);
        allValid = false;
      }
    }
  }
282868
private void fullKnapsack() throws ContradictionException {
        for (int bin = 0; bin < prop.nbBins; bin++) {
            for (int d = 0; d < prop.nbDims; d++) {
                knapsack(bin, d);
            }
        }
    }
1237642
private void checkForPotentialFilenameConflict() throws JournalException {
        File[] journalFiles =
                MultiFileJournalHelper
                        .getSortedArrayOfJournalFiles(journalDirectory,
                                                      filenamePrefix);
        if (journalFiles.length == 0) {
            return;
        }

        String newestFilename = journalFiles[journalFiles.length - 1].getName();
        String potentialFilename =
                JournalHelper.createTimestampedFilename(filenamePrefix,
                                                        new Date());
        if (newestFilename.compareTo(potentialFilename) > 0) {
            throw new JournalException("The name of one or more existing files in the journal "
                    + "directory (e.g. '"
                    + newestFilename
                    + "') may conflict with new Journal "
                    + "files. Has the system clock changed?");
        }
    }
1172403
public void postInitialize() throws ContradictionException {
        final int[] biggest = new int[prop.nbDims];
        for (int i = 0; i < prop.bins.length; i++) {
            for (int d = 0; d < prop.nbDims; d++) {
                biggest[d] = Math.max(biggest[d], prop.iSizes[d][i]);
            }
            if (!prop.bins[i].isInstantiated()) {
                final DisposableValueIterator it = prop.bins[i].getValueIterator(true);
                try {
                    while (it.hasNext()) {
                        candidate.get(it.next()).set(i);
                    }
                } finally {
                    it.dispose();
                }
            }
        }

        for (int b = 0; b < prop.nbBins; b++) {
            for (int d = 0; d < prop.nbDims; d++) {
                dynBiggest[d][b] =
                        prop.getVars()[0].getEnvironment().makeInt(biggest[d]);
            }
        }

        fullKnapsack();
    }
435562
public function set_assign(\assign $assign) {
        if ($this->is_triggered()) {
            throw new \coding_exception('set_assign() must be done before triggerring of event');
        }
        if ($assign->get_context()->id != $this->get_context()->id) {
            throw new \coding_exception('Invalid assign isntance supplied!');
        }
        if ($assign->is_blind_marking()) {
            $this->data['anonymous'] = 1;
        }
        $this->assign = $assign;
    }
395892
public void mergeWith(OptionalBoolean other) {
		if (state == other.state) {
			// no change in state
		} else if (state == State.UNSET) {
			state = other.state;
		} else if (other.state == State.UNSET) {
			// no change in state
		} else {
			state = State.CONFLICTING;
		}
	}
1344633
@Override
  public void addChange(DiffEntry change) {
    if (checkConfigFilePath(change.getNewPath())) {
      Path configFilePath = new Path(this.repositoryDir, change.getNewPath());

      try {
        Config flowConfig = loadConfigFileWithFlowNameOverrides(configFilePath);

        this.flowCatalog.put(FlowSpec.builder()
            .withConfig(flowConfig)
            .withVersion(SPEC_VERSION)
            .withDescription(SPEC_DESCRIPTION)
            .build());
      } catch (IOException e) {
        log.warn("Could not load config file: " + configFilePath);
      }
    }
  }
895966
@Override
    public T move(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException {
        Validate.notNull(source, "The source path was not specified");
        Validate.notNull(target, "The target path was not specified");

        final Node nodeToMove = get(source);
        if (null == nodeToMove) {
           throw new IllegalArchivePathException(source.get() + " doesn't specify any node in the archive to move");
        }
        final Asset asset = nodeToMove.getAsset();
        // Directory?
        if (asset == null) {
            this.addAsDirectory(target);
        } else {
            add(asset, target);
        }

        // move children
        final Set<Node> nodeToMoveChildren = nodeToMove.getChildren();
        for (final Node child : nodeToMoveChildren) {
            final String childName = child.getPath().get().replaceFirst(child.getPath().getParent().get(), "");
            final ArchivePath childTargetPath = ArchivePaths.create(target, childName);
            move(child.getPath(), childTargetPath);
        }

        delete(source);

        return covariantReturn();
    }
652674
public void doValidRecord(boolean bDisplayOption) // Init this field override for other value
    {
    	Record record = this.getOwner();
    	BaseDatabase database = record.getTable().getDatabase();
    	m_bEnableOnValid = true;

    	int counter = (int)record.getCounterField().getValue();
    	String startingID = database.getProperty(BaseDatabase.STARTING_ID);
    	String endingID = database.getProperty(BaseDatabase.ENDING_ID);
    	if (startingID != null)
    		if (counter < Integer.parseInt(Converter.stripNonNumber(startingID)))
    			m_bEnableOnValid = false;
    	if (endingID != null)
    		if (counter > Integer.parseInt(Converter.stripNonNumber(endingID)))
    			m_bEnableOnValid = false;
//    	System.out.println("start, end: " + startingID + "  " + endingID);
        super.doValidRecord(bDisplayOption);
    }