Java Code Examples for java.util.BitSet#isEmpty()

The following examples show how to use java.util.BitSet#isEmpty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OzoneAclUtil.java    From hadoop-ozone with Apache License 2.0 6 votes vote down vote up
/**
 * remove OzoneAcl from existing list of OzoneAcls.
 * @param existingAcls
 * @param acl
 * @return true if current OzoneAcls are changed, false otherwise.
 */
public static boolean removeAcl(List<OzoneAcl> existingAcls, OzoneAcl acl) {
  if (existingAcls == null || existingAcls.isEmpty() || acl == null) {
    return false;
  }

  for (OzoneAcl a: existingAcls) {
    if (a.getName().equals(acl.getName()) &&
        a.getType().equals(acl.getType()) &&
        a.getAclScope().equals(acl.getAclScope())) {
      BitSet current = a.getAclBitSet();
      BitSet original = (BitSet) current.clone();
      current.andNot(acl.getAclBitSet());

      if (current.equals(original)) {
        return false;
      }

      if (current.isEmpty()) {
        existingAcls.remove(a);
      }
      return true;
    }
  }
  return false;
}
 
Example 2
Source File: RegionVersionHolderJUnitTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * Return true if bs1 dominates bs2 - meaning that at least all of the bits
 * set in bs2 are set in bs1.
 * @param bs1
 * @param bs2
 * @return
 */
private boolean dominates(BitSet bs1, BitSet bs2) {
  //bs1 dominates bs2 if it has set at least all of the bits in bs1.
  BitSet copy = new BitSet();
  //Make copy a copy of bit set 2
  copy.or(bs2);
  
  //Clear all of the bits in copy that are set in bit set 1
  copy.andNot(bs1);
  
  //If all of the bits have been cleared in copy, that means
  //bit set 1 had at least all of the bits set that were set in
  //bs2
  return copy.isEmpty();
  
}
 
Example 3
Source File: ControlObjectCommand.java    From openhab1-addons with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public boolean handleResponse(final EventDispatcher eventDispatcher, SatelMessage response) {
    if (super.handleResponse(eventDispatcher, response)) {
        // force refresh states that might have changed
        final BitSet newStates = this.controlType.getControlledStates();
        if (newStates != null && !newStates.isEmpty()) {
            // add delay to give a chance to process sent command
            refreshTimer.schedule(new TimerTask() {
                @Override
                public void run() {
                    eventDispatcher.dispatchEvent(new NewStatesEvent(newStates));
                }
            }, REFRESH_DELAY);
        }
        return true;
    }

    return false;
}
 
Example 4
Source File: TableController.java    From olat with Apache License 2.0 6 votes vote down vote up
/**
 * Sorts the selected table row indexes according with the table Comparator, and then retrieves the rows from the input defaultTableDataModel. It is assumed that the
 * defaultTableDataModel IS THE MODEL for the table.
 * 
 * @param objectMarkers
 * @return the List with the sorted selected objects in this table.
 */
public List getSelectedSortedObjects(final BitSet objectMarkers, final DefaultTableDataModel defaultTableDataModel) {
    List results = new ArrayList();
    List<Integer> sortedIndexes = new ArrayList<Integer>();
    if (objectMarkers.isEmpty()) {
        sortedIndexes.clear();
    }
    for (int i = objectMarkers.nextSetBit(0); i >= 0; i = objectMarkers.nextSetBit(i + 1)) {
        sortedIndexes.add(i);
    }
    Collections.sort(sortedIndexes, table);
    Iterator<Integer> indexesIterator = sortedIndexes.iterator();
    while (indexesIterator.hasNext()) {
        results.add(defaultTableDataModel.getObject(indexesIterator.next()));
    }
    return results;
}
 
Example 5
Source File: DepartmentalInstructor.java    From unitime with Apache License 2.0 6 votes vote down vote up
public List<TimeLocation> listUnavailableTimes() {
	if (getUnavailableDays()==null || getUnavailableDays().isEmpty()) return null;
       List<TimeLocation> ret = new ArrayList<TimeLocation>();
       for (int i = 0; i < 7; i++) {
       	BitSet weekCode = getUnavailableBitSet(i);
       	if (!weekCode.isEmpty()) {
       		String name = "";
       		int idx = -1;
       		Calendar cal = Calendar.getInstance(Locale.US);
       		Date start = DateUtils.getDate(1, getSession().getPatternStartMonth(), getSession().getSessionStartYear());
       		Formats.Format<Date> df = Formats.getDateFormat(Formats.Pattern.DATE_SHORT);
               while ((idx = weekCode.nextSetBit(1 + idx)) >= 0) {
               	cal.setTime(start);
       			cal.add(Calendar.DAY_OF_YEAR, idx);
       			name += (name.isEmpty() ? "" : ", ") + df.format(cal.getTime());
               }
       		ret.add(new TimeLocation(Constants.DAY_CODES[i], 0, 288, 0, 0.0, null, name, weekCode, 0));
       	}
       }
       return ret;
}
 
Example 6
Source File: Percentile.java    From hipparchus with Apache License 2.0 5 votes vote down vote up
/**
 * Remove the occurrence of a given value in a copied slice of array
 * defined by the array part from [begin, begin+length).
 * @param values the input array
 * @param begin start index of the array to include
 * @param length number of elements to include from begin
 * @param removedValue the value to be removed from the sliced array
 * @return the copy of the sliced array after removing the removedValue
 */
private static double[] removeAndSlice(final double[] values,
                                       final int begin, final int length,
                                       final double removedValue) {
    MathArrays.verifyValues(values, begin, length);
    final double[] temp;
    //BitSet(length) to indicate where the removedValue is located
    final BitSet bits = new BitSet(length);
    for (int i = begin; i < begin+length; i++) {
        if (Precision.equalsIncludingNaN(removedValue, values[i])) {
            bits.set(i - begin);
        }
    }
    //Check if empty then create a new copy
    if (bits.isEmpty()) {
        temp = copyOf(values, begin, length); // Nothing removed, just copy
    } else if (bits.cardinality() == length) {
        temp = new double[0];                 // All removed, just empty
    } else {                                   // Some removable, so new
        temp = new double[length - bits.cardinality()];
        int start = begin;  //start index from source array (i.e values)
        int dest = 0;       //dest index in destination array(i.e temp)
        int bitSetPtr = 0;  //bitSetPtr is start index pointer of bitset
        for (int nextOne = bits.nextSetBit(bitSetPtr); nextOne != -1; nextOne = bits.nextSetBit(bitSetPtr)) {
            final int lengthToCopy = nextOne - bitSetPtr;
            System.arraycopy(values, start, temp, dest, lengthToCopy);
            dest += lengthToCopy;
            start = begin + (bitSetPtr = bits.nextClearBit(nextOne));
        }
        //Copy any residue past start index till begin+length
        if (start < begin + length) {
            System.arraycopy(values,start,temp,dest,begin + length - start);
        }
    }
    return temp;
}
 
Example 7
Source File: TransitiveSetTraverser.java    From hollow with Apache License 2.0 5 votes vote down vote up
private static void addTransitiveMatches(HollowReadStateEngine stateEngine, HollowCollectionTypeReadState typeState, Map<String, BitSet> matches) {
    HollowCollectionSchema schema = typeState.getSchema();
    BitSet matchingOrdinals = getOrCreateBitSet(matches, schema.getName(), typeState.maxOrdinal());

    HollowTypeReadState childTypeState = stateEngine.getTypeState(schema.getElementType());
    BitSet childOrdinals = getOrCreateBitSet(matches, schema.getElementType(), childTypeState.maxOrdinal());

    int ordinal = matchingOrdinals.nextSetBit(0);
    while(ordinal != -1) {
        try {
            HollowOrdinalIterator iter = typeState.ordinalIterator(ordinal);
            int elementOrdinal = iter.next();
            while(elementOrdinal != HollowOrdinalIterator.NO_MORE_ORDINALS) {
                childOrdinals.set(elementOrdinal);
                elementOrdinal = iter.next();
            }
        } catch(Exception e) {
            log.log(Level.SEVERE, "Add transitive matches failed", e);
        }

        ordinal = matchingOrdinals.nextSetBit(ordinal + 1);
    }

    if(!childOrdinals.isEmpty()) {
        matches.put(schema.getElementType(), childOrdinals);
    }
}
 
Example 8
Source File: CodeListSet.java    From sis with Apache License 2.0 5 votes vote down vote up
/**
 * Returns {@code true} if this set contains all the elements of the given collection.
 *
 * @param  c  the collection to be checked for containment in this set.
 * @return {@code true} if this set contains all elements of the given collection.
 */
@Override
public boolean containsAll(final Collection<?> c) {
    if (c instanceof CodeListSet) {
        final CodeListSet<?> o = (CodeListSet<?>) c;
        if (elementType == o.elementType) {
            if (values == (values | o.values)) {
                /*
                 * Code below this point checks for the rare cases
                 * where there is more than 64 code list elements.
                 */
                final BitSet s = supplementary;
                final BitSet os = o.supplementary;
                if (( s == null ||  s.isEmpty()) &&
                    (os == null || os.isEmpty()))
                {
                    return true;
                }
                if (s != null && os != null) {
                    final BitSet tmp = (BitSet) os.clone();
                    tmp.andNot(s);
                    return tmp.isEmpty();
                }
            }
        }
        return false;
    }
    return super.containsAll(c);
}
 
Example 9
Source File: ClassInfoConnector.java    From unitime with Apache License 2.0 5 votes vote down vote up
protected static Date firstDate(DatePattern dp, int dayCode) {
   	if (dp == null) return null;
   	BitSet weekCode = dp.getPatternBitSet();
   	if (weekCode.isEmpty()) return null;
   	Calendar cal = Calendar.getInstance(Locale.US); cal.setLenient(true);
   	Date dpFirstDate = DateUtils.getDate(1, dp.getSession().getPatternStartMonth(), dp.getSession().getSessionStartYear());
   	cal.setTime(dpFirstDate);
   	int idx = weekCode.nextSetBit(0);
   	cal.add(Calendar.DAY_OF_YEAR, idx);
   	while (idx < weekCode.size()) {
   		if (weekCode.get(idx)) {
       		int dow = cal.get(Calendar.DAY_OF_WEEK);
       		switch (dow) {
       		case Calendar.MONDAY:
       			if ((dayCode & DayCode.MON.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.TUESDAY:
       			if ((dayCode & DayCode.TUE.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.WEDNESDAY:
       			if ((dayCode & DayCode.WED.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.THURSDAY:
       			if ((dayCode & DayCode.THU.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.FRIDAY:
       			if ((dayCode & DayCode.FRI.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.SATURDAY:
       			if ((dayCode & DayCode.SAT.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.SUNDAY:
       			if ((dayCode & DayCode.SUN.getCode()) != 0) return cal.getTime();
       			break;
       		}
       	}
   		cal.add(Calendar.DAY_OF_YEAR, 1); idx++;
   	}
   	return null;
}
 
Example 10
Source File: TaskSpecificLaunchCmdOption.java    From tez with Apache License 2.0 5 votes vote down vote up
/**
 * Find if task specific launch command options have to be added.
 *
 * @param vertexName
 * @param taskId
 * @return boolean
 */
public boolean addTaskSpecificLaunchCmdOption(String vertexName, int taskId) {
  if (tasksMap == null || taskId < 0) {
    return false;
  }
  BitSet taskSet = tasksMap.get(vertexName);
  // profile all tasks in the vertex, if taskSet is empty
  return (taskSet == null) ? false : ((taskSet.isEmpty()) ? true : taskSet.get(taskId));
}
 
Example 11
Source File: Operations.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
/** Returns true if there are dead states that reach an accept state. */
public static boolean hasDeadStatesToAccept(Automaton a) {
  BitSet reachableFromInitial = getLiveStatesFromInitial(a);
  BitSet reachableFromAccept = getLiveStatesToAccept(a);
  reachableFromAccept.andNot(reachableFromInitial);
  return reachableFromAccept.isEmpty() == false;
}
 
Example 12
Source File: CallsiteHolderExplorable.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see #getFixedParams()
 */
@SuppressWarnings("unchecked")
private Set<ParameterNode> fixedParamsAt(BitSet freshlyInstantiatedArguments) {
    if (freshlyInstantiatedArguments == null || freshlyInstantiatedArguments.isEmpty()) {
        return Collections.EMPTY_SET;
    }
    Set<ParameterNode> result = Node.newSet();
    for (ParameterNode p : graph.getNodes(ParameterNode.TYPE)) {
        if (freshlyInstantiatedArguments.get(p.index())) {
            result.add(p);
        }
    }
    return result;
}
 
Example 13
Source File: RunningContainers.java    From twill with Apache License 2.0 5 votes vote down vote up
/**
 * Remove instance id for a given runnable.
 */
private void removeInstanceId(String runnableName, int instanceId) {
  BitSet instances = runnableInstances.get(runnableName);
  if (instances == null) {
    return;
  }
  instances.clear(instanceId);
  if (instances.isEmpty()) {
    runnableInstances.remove(runnableName);
  }
}
 
Example 14
Source File: FilterTreeCellRenderer.java    From swing_library with MIT License 5 votes vote down vote up
@Override
public Component getTreeCellRendererComponent(JTree tree, Object value,
		boolean sel,
		boolean expanded,
		boolean leaf, int row,
		boolean hasFocus) {
	super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
	setFont(tree.getFont().deriveFont(0));

	String text = getText();
	ComponentFilter filter = model.getFilter();
	String filterText = model.getFilterText();

	BitSet highlight = filter.highlight(filterText, text);
	String newText = "<html>";
	if (highlightAll)
		newText += (filter.accepts(filterText, text) && !highlight.isEmpty()) ? "<b>" + text + "</b>" : text;
	else {
		int pos = 0;
		boolean set = highlight.get(0);
		while (pos < text.length()) {
			int nextPos = set ? highlight.nextClearBit(pos) : highlight.nextSetBit(pos);
			if (nextPos == -1)
				nextPos = text.length();
			if (set)
				newText += "<b>" + text.substring(pos, nextPos) + "</b>";
			else
				newText += text.substring(pos, nextPos);
			pos = nextPos;
			set = highlight.get(pos);
		}
	}
	newText += "</html>";
	setText(newText);
	return this;
}
 
Example 15
Source File: CodeListSet.java    From sis with Apache License 2.0 5 votes vote down vote up
/**
 * Retains only the elements of the given collection in this set.
 *
 * @param  c  the collection containing elements to retain in this set.
 * @return {@code true} if this set changed as a result of this method call.
 */
@Override
public boolean retainAll(final Collection<?> c) {
    if (c instanceof CodeListSet) {
        boolean changed = (values != (values &= mask((CodeListSet<?>) c)));
        /*
         * Code below this point is for the rare cases
         * where there is more than 64 code list elements.
         */
        final BitSet s = supplementary;
        if (s != null) {
            final BitSet os = ((CodeListSet<?>) c).supplementary;
            if (os == null) {
                changed |= !s.isEmpty();
                s.clear();
            } else if (changed) {
                // Avoid the cost of computing cardinality.
                s.and(os);
            } else {
                final int cardinality = s.cardinality();
                s.and(os);
                changed = (cardinality != s.cardinality());
            }
        }
        return changed;
    }
    return super.retainAll(c);
}
 
Example 16
Source File: DefaultMXBeanMappingFactory.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private static boolean subset(BitSet sub, BitSet sup) {
    BitSet subcopy = (BitSet) sub.clone();
    subcopy.andNot(sup);
    return subcopy.isEmpty();
}
 
Example 17
Source File: InstructorScheduleConnector.java    From unitime with Apache License 2.0 4 votes vote down vote up
protected static Date lastDate(DatePattern dp, int dayCode) {
if (dp == null) return null;
BitSet weekCode = dp.getPatternBitSet();
  	if (weekCode.isEmpty()) return null;
Calendar cal = Calendar.getInstance(Locale.US); cal.setLenient(true);
Date dpFirstDate = DateUtils.getDate(1, dp.getSession().getPatternStartMonth(), dp.getSession().getSessionStartYear());
  	cal.setTime(dpFirstDate);
  	int idx = weekCode.length() - 1;
  	cal.add(Calendar.DAY_OF_YEAR, idx);
  	Date last = null;
  	while (idx >= 0 && last == null) {
  		if (weekCode.get(idx)) {
      		int dow = cal.get(Calendar.DAY_OF_WEEK);
      		switch (dow) {
      		case Calendar.MONDAY:
      			if ((dayCode & DayCode.MON.getCode()) != 0) return cal.getTime();
      			break;
      		case Calendar.TUESDAY:
      			if ((dayCode & DayCode.TUE.getCode()) != 0) return cal.getTime();
      			break;
      		case Calendar.WEDNESDAY:
      			if ((dayCode & DayCode.WED.getCode()) != 0) return cal.getTime();
      			break;
      		case Calendar.THURSDAY:
      			if ((dayCode & DayCode.THU.getCode()) != 0) return cal.getTime();
      			break;
      		case Calendar.FRIDAY:
      			if ((dayCode & DayCode.FRI.getCode()) != 0) return cal.getTime();
      			break;
      		case Calendar.SATURDAY:
      			if ((dayCode & DayCode.SAT.getCode()) != 0) return cal.getTime();
      			break;
      		case Calendar.SUNDAY:
      			if ((dayCode & DayCode.SUN.getCode()) != 0) return cal.getTime();
      			break;
      		}
      	}
  		cal.add(Calendar.DAY_OF_YEAR, -1); idx--;
  	}
  	return null;
  }
 
Example 18
Source File: DefaultMXBeanMappingFactory.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static boolean subset(BitSet sub, BitSet sup) {
    BitSet subcopy = (BitSet) sub.clone();
    subcopy.andNot(sup);
    return subcopy.isEmpty();
}
 
Example 19
Source File: PathScoringUtilities.java    From constellation with Apache License 2.0 4 votes vote down vote up
private static BitSet[] computeSubgraphPathsDirected(final GraphReadMethods graph, final BitSet subgraph,
        boolean includeConnectionsIn, boolean includeConnectionsOut, boolean treatUndirectedBidirectional) {
    final int vertexCount = graph.getVertexCount();
    final BitSet[] traversal = new BitSet[vertexCount];

    final BitSet update = new BitSet(vertexCount);
    final BitSet[] sendBuffer = new BitSet[vertexCount];
    final BitSet newUpdate = new BitSet(vertexCount);

    final BitSet turn = new BitSet(vertexCount);

    // initialising variables
    for (int vxPosition = 0; vxPosition < vertexCount; vxPosition++) {
        traversal[vxPosition] = new BitSet(vertexCount);
        sendBuffer[vxPosition] = new BitSet(vertexCount);
    }
    update.or(subgraph);

    while (!update.isEmpty()) {

        // update the information of each node with messages
        for (int vertexPosition = update.nextSetBit(0); vertexPosition >= 0; vertexPosition = update.nextSetBit(vertexPosition + 1)) {
            traversal[vertexPosition].or(sendBuffer[vertexPosition]);
            traversal[vertexPosition].set(vertexPosition);
            sendBuffer[vertexPosition].clear();
        }

        // for each neighbour, check if there is any new information it needs to receive
        for (int vertexPosition = update.nextSetBit(0); vertexPosition >= 0; vertexPosition = update.nextSetBit(vertexPosition + 1)) {
            int vertexId = graph.getVertex(vertexPosition);

            for (int vertexNeighbourPosition = 0; vertexNeighbourPosition < graph.getVertexNeighbourCount(vertexId); vertexNeighbourPosition++) {
                int neighbourId = graph.getVertexNeighbour(vertexId, vertexNeighbourPosition);
                int neighbourPosition = graph.getVertexPosition(neighbourId);
                if (!subgraph.get(neighbourPosition)) {
                    continue;
                }

                boolean isRequestedDirection = false;
                int linkId = graph.getLink(vertexId, neighbourId);
                for (int linkEdgePosition = 0; linkEdgePosition < graph.getLinkEdgeCount(linkId); linkEdgePosition++) {
                    final int edgeId = graph.getLinkEdge(linkId, linkEdgePosition);
                    final int edgeDirection = graph.getEdgeDirection(edgeId);
                    isRequestedDirection = (treatUndirectedBidirectional && edgeDirection == GraphConstants.UNDIRECTED)
                            || (includeConnectionsIn && graph.getEdgeSourceVertex(edgeId) == neighbourId)
                            || (includeConnectionsOut && graph.getEdgeDestinationVertex(edgeId) == neighbourId);
                    if (isRequestedDirection) {
                        break;
                    }
                }

                if (isRequestedDirection && !traversal[vertexPosition].equals(traversal[neighbourPosition])) {
                    turn.set(neighbourPosition, true);

                    final BitSet diff = (BitSet) traversal[vertexPosition].clone();
                    diff.andNot(traversal[neighbourPosition]);
                    sendBuffer[neighbourPosition].or(diff);
                    newUpdate.set(neighbourPosition);
                }
            }
        }

        turn.clear();

        update.clear();
        update.or(newUpdate);
        newUpdate.clear();
    }

    return traversal;
}
 
Example 20
Source File: LambdaProcessor.java    From bistoury with GNU General Public License v3.0 4 votes vote down vote up
public void processClass(ClassNode node) throws IOException {
    for (ClassNode child : node.nested) {
        processClass(child);
    }

    ClassesProcessor clProcessor = DecompilerContext.getClassProcessor();
    StructClass cl = node.classStruct;

    if (cl.getBytecodeVersion() < CodeConstants.BYTECODE_JAVA_8) { // lambda beginning with Java 8
        return;
    }

    StructBootstrapMethodsAttribute bootstrap =
            cl.getAttribute(StructGeneralAttribute.ATTRIBUTE_BOOTSTRAP_METHODS);
    if (bootstrap == null || bootstrap.getMethodsNumber() == 0) {
        return; // no bootstrap constants in pool
    }

    BitSet lambda_methods = new BitSet();

    // find lambda bootstrap constants
    for (int i = 0; i < bootstrap.getMethodsNumber(); ++i) {
        LinkConstant method_ref = bootstrap.getMethodReference(i); // method handle

        // FIXME: extend for Eclipse etc. at some point
        if (JAVAC_LAMBDA_CLASS.equals(method_ref.classname) &&
                (JAVAC_LAMBDA_METHOD.equals(method_ref.elementname) || JAVAC_LAMBDA_ALT_METHOD.equals(method_ref.elementname))) {
            lambda_methods.set(i);
        }
    }

    if (lambda_methods.isEmpty()) {
        return; // no lambda bootstrap constant found
    }

    Map<String, String> mapMethodsLambda = new HashMap<>();

    // iterate over code and find invocations of bootstrap methods. Replace them with anonymous classes.
    for (StructMethod mt : cl.getMethods()) {
        mt.expandData();

        InstructionSequence seq = mt.getInstructionSequence();
        if (seq != null && seq.length() > 0) {
            int len = seq.length();

            for (int i = 0; i < len; ++i) {
                Instruction instr = seq.getInstr(i);

                if (instr.opcode == CodeConstants.opc_invokedynamic) {
                    LinkConstant invoke_dynamic = cl.getPool().getLinkConstant(instr.operand(0));

                    if (lambda_methods.get(invoke_dynamic.index1)) { // lambda invocation found

                        List<PooledConstant> bootstrap_arguments = bootstrap.getMethodArguments(invoke_dynamic.index1);
                        MethodDescriptor md = MethodDescriptor.parseDescriptor(invoke_dynamic.descriptor);

                        String lambda_class_name = md.ret.value;
                        String lambda_method_name = invoke_dynamic.elementname;
                        String lambda_method_descriptor = ((PrimitiveConstant) bootstrap_arguments.get(2)).getString(); // method type

                        LinkConstant content_method_handle = (LinkConstant) bootstrap_arguments.get(1);

                        ClassNode node_lambda = new ClassNode(content_method_handle.classname, content_method_handle.elementname,
                                content_method_handle.descriptor, content_method_handle.index1,
                                lambda_class_name, lambda_method_name, lambda_method_descriptor, cl);
                        node_lambda.simpleName = cl.qualifiedName + "##Lambda_" + invoke_dynamic.index1 + "_" + invoke_dynamic.index2;
                        node_lambda.enclosingMethod = InterpreterUtil.makeUniqueKey(mt.getName(), mt.getDescriptor());

                        node.nested.add(node_lambda);
                        node_lambda.parent = node;

                        clProcessor.getMapRootClasses().put(node_lambda.simpleName, node_lambda);
                        if (!node_lambda.lambdaInformation.is_method_reference) {
                            mapMethodsLambda.put(node_lambda.lambdaInformation.content_method_key, node_lambda.simpleName);
                        }
                    }
                }
            }
        }

        mt.releaseResources();
    }

    // build class hierarchy on lambda
    for (ClassNode nd : node.nested) {
        if (nd.type == ClassNode.CLASS_LAMBDA) {
            String parent_class_name = mapMethodsLambda.get(nd.enclosingMethod);
            if (parent_class_name != null) {
                ClassNode parent_class = clProcessor.getMapRootClasses().get(parent_class_name);

                parent_class.nested.add(nd);
                nd.parent = parent_class;
            }
        }
    }

    // FIXME: mixed hierarchy?
}