int gcd = Math.min(8, Integer.lowestOneBit(bitsPerChar)); try { this.charsPerChunk = 8 / gcd;
/** * Get the canonical action string representation for the given action set, appending it to the given string builder. * * @param type the action {@code enum} type class * @param set the action set * @param b the string builder * @param <E> the action type */ public static <E extends Enum<E>> void getCanonicalActionString(Class<E> type, int set, StringBuilder b) { if (set == 0) return; @SuppressWarnings("unchecked") final E[] constants = (E[]) storedInfo.get(type).constants; int bit = Integer.lowestOneBit(set); E e = constants[Integer.numberOfTrailingZeros(bit)]; b.append(e.toString()); set &= ~bit; while (set != 0) { bit = Integer.lowestOneBit(set); e = constants[Integer.numberOfTrailingZeros(bit)]; b.append(',').append(e.toString()); set &= ~bit; } }
int gcd = Math.min(8, Integer.lowestOneBit(bitsPerChar)); try { this.charsPerChunk = 8 / gcd;
/** * Get the actions string. The actions string will be a canonical version of the one passed in at construction. * * @return the actions string (not {@code null}) */ public String getActions() { final String actionString = this.actionString; if (actionString != null) { return actionString; } int actionBits = this.actionBits; if (actionBits == ACTION_ALL) { return this.actionString = "*"; } int m = Integer.lowestOneBit(actionBits); if (m != 0) { StringBuilder b = new StringBuilder(); b.append(getAction(m)); actionBits &= ~m; while (actionBits != 0) { m = Integer.lowestOneBit(actionBits); b.append(',').append(getAction(m)); actionBits &= ~m; } return this.actionString = b.toString(); } else { return this.actionString = ""; } }
public Permission nextElement() { final int bits = this.bits; if (bits == 0) throw new NoSuchElementException(); if (Integer.bitCount(bits) == getNameEnumeration().size()) { this.bits = 0; return ((AbstractNamedPermission<?>) getSourcePermission()).withName("*"); } int bit = Integer.lowestOneBit(bits); this.bits = bits & ~bit; return permissionFor(Integer.numberOfTrailingZeros(bit)); }
int gcd = Math.min(8, Integer.lowestOneBit(bitsPerChar)); try { this.charsPerChunk = 8 / gcd;
int gcd = Math.min(8, Integer.lowestOneBit(bitsPerChar)); try { this.charsPerChunk = 8 / gcd;
Object readResolve() { final AbstractPermissionCollection collection = new WildFlySecurityManagerPermission("*").newPermissionCollection(); final StringMapping<WildFlySecurityManagerPermission> mapping = WildFlySecurityManagerPermission.mapping; int bits = p1; int test; while (bits != 0) { collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits)))); bits &= ~test; } if (isReadOnly()) { collection.setReadOnly(); } return collection; } }
Object readResolve() { final AbstractPermissionCollection collection = new ElytronPermission("*").newPermissionCollection(); final StringMapping<ElytronPermission> mapping = ElytronPermission.mapping; int bits = p1; int test; while (bits != 0) { collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits)))); bits &= ~test; } if (isReadOnly()) { collection.setReadOnly(); } return collection; } }
int allocFlag() { if (freeFlags == 0) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().flagsAlreadyCreated, Integer.valueOf(32 - RESERVED_FLAGS))); final int m = Integer.lowestOneBit(freeFlags); freeFlags &= ~m; return m; }
private void compress(byte[] block, int p) { initBlock(block, p); int ubcDvMask = detectCollision ? UbcCheck.check(w) : 0; compress(); while (ubcDvMask != 0) { int b = numberOfTrailingZeros(lowestOneBit(ubcDvMask)); UbcCheck.DvInfo dv = UbcCheck.DV[b]; for (int i = 0; i < 80; i++) { w2[i] = w[i] ^ dv.dm[i]; } recompress(dv.testt); if (eq(hTmp, h)) { foundCollision = true; break; } ubcDvMask &= ~(1 << b); } }
public static short lsbMask(short value, boolean bit) { final int mask = (1 << Short.SIZE) - 1; final int _value = value & mask; return (short) Integer.lowestOneBit(bit ? ~_value : _value); }
public static byte lsbMask(byte value, boolean bit) { final int mask = (1 << Byte.SIZE) - 1; final int _value = value & mask; return (byte) Integer.lowestOneBit(bit ? ~_value : _value); }
protected BitMaskTextProp(int sizeOfDataBlock, int maskInHeader, String overallName, String... subPropNames) { super(sizeOfDataBlock,maskInHeader,overallName); this.subPropNames = subPropNames; subPropMasks = new int[subPropNames.length]; subPropMatches = new boolean[subPropNames.length]; int LSB = Integer.lowestOneBit(maskInHeader); // Initialise the masks list for(int i=0; i<subPropMasks.length; i++) { subPropMasks[i] = (LSB << i); } }
public static int numberCoverBits(int v) { int l = Integer.lowestOneBit(v); int h = Integer.highestOneBit(v); return Integer.numberOfTrailingZeros(h / l) + 1; }
public Permission nextElement() { final int bit = Integer.lowestOneBit(bits); if (bit == 0) throw new NoSuchElementException(); bits &= ~bit; return WildFlySecurityManagerPermission.values[Integer.numberOfTrailingZeros(bit)].getPermission(); } };
int allocFlag() { if (freeFlags == 0) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().flagsAlreadyCreated, Integer.valueOf(32 - RESERVED_FLAGS))); final int m = Integer.lowestOneBit(freeFlags); freeFlags &= ~m; return m; }
public Permission nextElement() { final int bits = this.bits; if (bits == 0) throw new NoSuchElementException(); if (Integer.bitCount(bits) == getNameEnumeration().size()) { this.bits = 0; return ((AbstractNamedPermission<?>) getSourcePermission()).withName("*"); } int bit = Integer.lowestOneBit(bits); this.bits = bits & ~bit; return permissionFor(Integer.numberOfTrailingZeros(bit)); }
public Permission nextElement() { final int bits = this.bits; if (bits == 0) throw new NoSuchElementException(); if (Integer.bitCount(bits) == getNameEnumeration().size()) { this.bits = 0; return ((AbstractNamedPermission<?>) getSourcePermission()).withName("*"); } int bit = Integer.lowestOneBit(bits); this.bits = bits & ~bit; return permissionFor(Integer.numberOfTrailingZeros(bit)); }
private static boolean isLeafUnspecified( JUnitCoreParameters params ) { int maskOfParallel = params.isParallelSuites() ? 4 : 0; maskOfParallel |= params.isParallelClasses() ? 2 : 0; maskOfParallel |= params.isParallelMethods() ? 1 : 0; int maskOfConcurrency = params.getThreadCountSuites() > 0 ? 4 : 0; maskOfConcurrency |= params.getThreadCountClasses() > 0 ? 2 : 0; maskOfConcurrency |= params.getThreadCountMethods() > 0 ? 1 : 0; maskOfConcurrency &= maskOfParallel; int leaf = Integer.lowestOneBit( maskOfParallel ); return maskOfConcurrency == maskOfParallel - leaf; }