All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dragome.compiler.invokedynamic.Flags Maven / Gradle / Ivy

There is a newer version: 0.96-beta4
Show newest version
// 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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy