
package org.apache.commons.weaver.privilizer.example;

import org.apache.commons.weaver.privilizer.Privileged;

public abstract class StaticNoArgs {
    private StaticNoArgs() {
    }

    @Privileged
    static void throwAwayFoo() {
        System.getProperty("foo");
    }

    @Privileged
    static String getFoo() {
        return System.getProperty("foo");
    }

    @Privileged
    static Boolean getTrue() {
        System.getProperty("foo");
        return Boolean.TRUE;
    }

    @Privileged
    static boolean getFalse() {
        System.getProperty("foo");
        return false;
    }

    public static class CheckedException1 extends Exception {
        private static final long serialVersionUID = 1L;
    }

    public static class CheckedException2 extends Exception {
        private static final long serialVersionUID = 1L;
    }

    @Privileged
    static void throwingCheckedException1() throws CheckedException1 {
        System.getProperty("foo");
        throw new CheckedException1();
    }

    @Privileged
    static Integer throwingCheckedException2() throws CheckedException1, CheckedException2 {
        System.getProperty("foo");
        throw new CheckedException2();
    }
}
