com.dragome.compiler.invokedynamic.Flags Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dragome-bytecode-js-compiler Show documentation
Show all versions of dragome-bytecode-js-compiler Show documentation
Dragome SDK module: bytecode to javascript compiler
// Copyright © 2013 Esko Luontola
// This software is released under the Apache License 2.0.
// The license text is at http://www.apache.org/licenses/LICENSE-2.0
package com.dragome.compiler.invokedynamic;
import static org.objectweb.asm.Opcodes.ACC_PRIVATE;
public class Flags
{
public static int makeNonPrivate(int access)
{
if (hasFlag(access, ACC_PRIVATE))
{
return clearFlag(access, ACC_PRIVATE); // make package-private (i.e. no flag)
}
return access;
}
public static boolean hasFlag(int subject, int flag)
{
return (subject & flag) == flag;
}
public static int clearFlag(int subject, int flag)
{
return subject & ~flag;
}
}