// Path: pie-core/src/main/java/com/coverity/security/pie/core/EqualityStringMatcher.java
// public class EqualityStringMatcher implements StringMatcher {
//     
//     private static final EqualityStringMatcher instance = new EqualityStringMatcher();
//     
//     private EqualityStringMatcher() {
//     }
//     
//     public static EqualityStringMatcher getInstance() {
//         return instance;
//     }
// 
//     @Override
//     public boolean matches(String matcher, String matchee) {
//         return matcher.equals(matchee);
//     }
// 
// }
// 
// Path: pie-core/src/main/java/com/coverity/security/pie/core/FactMetaData.java
// public interface FactMetaData {
//     /**
//      * Returns a StringCollapser appropriate for this fact's semantics. The behavior of the StringCollapser may behave
//      * according to particulars of the policyConfig argument.
//      *
//      * @param policyConfig The policy's configuration, which may have directives relevant to this type of fact.
//      * @return The StringCollapser instance appropriate for this fact.
//      */
//     public StringCollapser getCollapser(PolicyConfig policyConfig);
// 
//     /**
//      * This decides if a concrete instance of a fact matches a fact definition from the security policy.
//      * @param matcher The security policy's fact.
//      * @param matchee The concrete instance of a fact.
//      * @return Whether or not the security policy's fact applies to the instance of a fact.
//      */
//     public boolean matches(String matcher, String matchee);
// 
//     /**
//      * Gets the metadata object associated with the child fact. The particular semantics of the child may depend on the
//      * concrete instance of the fact being handled. For instance, with the Java SecurityManager, the semantics of child
//      * facts of a java.io.FilePermission (which represent file paths) are distinct from the child facts of a
//      * java.net.SocketPermission (which represent hosts).
//      * @param fact The concrete value of the fact for which child metadata is desired.
//      * @return The child metadata.
//      */
//     public FactMetaData getChildFactMetaData(String fact);
// }
// 
// Path: pie-core/src/main/java/com/coverity/security/pie/core/NullStringCollapser.java
// public class NullStringCollapser implements StringCollapser {
// 
//     private static final NullStringCollapser instance = new NullStringCollapser();
//     
//     private NullStringCollapser() {
//     }
//     
//     public static NullStringCollapser getInstance() {
//         return instance;
//     }
//     
//     @Override
//     public <T> Map<String, Collection<T>> collapse(Map<String, Collection<T>> input) {
//         return input;
//     }
//     
// }
// 
// Path: pie-core/src/main/java/com/coverity/security/pie/core/PolicyConfig.java
// public class PolicyConfig {
//     private final String name;
//     private final PieConfig pieConfig;
//     
//     public PolicyConfig(String name, PieConfig pieConfig) {
//         this.name = name;
//         this.pieConfig = pieConfig;
//     }
//     
//     public boolean isEnabled() {
//         return getBoolean("isEnabled", true);
//     }
//     
//     public boolean isReportOnlyMode() {
//         return getBoolean("isReportOnlyMode", true);
//     }
// 
//     public boolean isCollapseEnabled() {
//         return getBoolean("isCollapseEnabled", true);
//     }
//     
//     public URL getPolicyFile() {
//         String policyFile = getProperty("policyFile");
//         if (policyFile != null) {
//             try {
//                 return new URL(policyFile);
//             } catch (MalformedURLException e) {
//                 throw new IllegalStateException("Invalid policy URL: " + policyFile);
//             }
//         }
//         URL resource = this.getClass().getClassLoader().getResource(name + ".policy");
//         if (resource != null) {
//             return resource;
//         }
//         String catalinaHome = System.getProperty("catalina.home");
//         if (catalinaHome != null) {
//             try {
//                 return new File(catalinaHome + File.separatorChar + "conf" + File.separatorChar + name + ".policy").toURI().toURL();
//             } catch (MalformedURLException e) {
//                 throw new IllegalStateException("Could not build default policy file path.");
//             }
//         }
//         
//         // Default to file in the CWD
//         try {
//             return new File(name + ".policy").toURI().toURL();
//         } catch (MalformedURLException e) {
//             throw new RuntimeException(e);
//         }
//     }
//     
//     public boolean getBoolean(String prop, boolean defaultValue) {
//         String v = getProperty(prop);
//         if (v == null) {
//             return defaultValue;
//         }
//         return Boolean.parseBoolean(v);
//     }
//     public int getInteger(String prop, int defaultValue) {
//         String v = getProperty(prop);
//         if (v == null) {
//             return defaultValue;
//         }
//         return Integer.parseInt(v);
//     }
//     
//     
//     public String getProperty(String name) {
//         return pieConfig.getProperties().getProperty(this.name + "." + name);
//     }
// }
// 
// Path: pie-core/src/main/java/com/coverity/security/pie/core/StringCollapser.java
// public interface StringCollapser {
//     /**
//      * Collapses a security policy according to the concrete implementation's rules. It takes a map from facts to their
//      * children, and returns a collapsed version of that map. For example, given the map:
//      * {
//      *   A => {'X', 'Y'},
//      *   B => {'Z'}
//      * }
//      *
//      * If the implementation determines that the facts A and B should be collapsed to fact C, then this would return
//      * {
//      *   C => {'X', 'Y', 'Z'}
//      * }
//      *
//      * @param input A map from facts to a collection of child facts.
//      * @param <T> The type of the child facts; irrelevant to the internal procedure of collapsing.
//      * @return The collapsed map of facts to their children.
//      */
//     public <T> Map<String, Collection<T>> collapse(Map<String, Collection<T>> input);
// }


import com.coverity.security.pie.core.EqualityStringMatcher;
import com.coverity.security.pie.core.FactMetaData;
import com.coverity.security.pie.core.NullStringCollapser;
import com.coverity.security.pie.core.PolicyConfig;
import com.coverity.security.pie.core.StringCollapser;
package com.coverity.security.pie.policy.securitymanager.fact;


public class PermissionNameFactMetaData implements FactMetaData {

    private static final PermissionNameFactMetaData instance = new PermissionNameFactMetaData();
    
    private PermissionNameFactMetaData() {
    }
    
// Path: pie-core/src/main/java/com/coverity/security/pie/core/EqualityStringMatcher.java
// public class EqualityStringMatcher implements StringMatcher {
//     
//     private static final EqualityStringMatcher instance = new EqualityStringMatcher();
//     
//     private EqualityStringMatcher() {
//     }
//     
//     public static EqualityStringMatcher getInstance() {
//         return instance;
//     }
// 
//     @Override
//     public boolean matches(String matcher, String matchee) {
//         return matcher.equals(matchee);
//     }
// 
// }
// 
// Path: pie-core/src/main/java/com/coverity/security/pie/core/FactMetaData.java
// public interface FactMetaData {
//     /**
//      * Returns a StringCollapser appropriate for this fact's semantics. The behavior of the StringCollapser may behave
//      * according to particulars of the policyConfig argument.
//      *
//      * @param policyConfig The policy's configuration, which may have directives relevant to this type of fact.
//      * @return The StringCollapser instance appropriate for this fact.
//      */
//     public StringCollapser getCollapser(PolicyConfig policyConfig);
// 
//     /**
//      * This decides if a concrete instance of a fact matches a fact definition from the security policy.
//      * @param matcher The security policy's fact.
//      * @param matchee The concrete instance of a fact.
//      * @return Whether or not the security policy's fact applies to the instance of a fact.
//      */
//     public boolean matches(String matcher, String matchee);
// 
//     /**
//      * Gets the metadata object associated with the child fact. The particular semantics of the child may depend on the
//      * concrete instance of the fact being handled. For instance, with the Java SecurityManager, the semantics of child
//      * facts of a java.io.FilePermission (which represent file paths) are distinct from the child facts of a
//      * java.net.SocketPermission (which represent hosts).
//      * @param fact The concrete value of the fact for which child metadata is desired.
//      * @return The child metadata.
//      */
//     public FactMetaData getChildFactMetaData(String fact);
// }
// 
// Path: pie-core/src/main/java/com/coverity/security/pie/core/NullStringCollapser.java
// public class NullStringCollapser implements StringCollapser {
// 
//     private static final NullStringCollapser instance = new NullStringCollapser();
//     
//     private NullStringCollapser() {
//     }
//     
//     public static NullStringCollapser getInstance() {
//         return instance;
//     }
//     
//     @Override
//     public <T> Map<String, Collection<T>> collapse(Map<String, Collection<T>> input) {
//         return input;
//     }
//     
// }
// 
// Path: pie-core/src/main/java/com/coverity/security/pie/core/PolicyConfig.java
// public class PolicyConfig {
//     private final String name;
//     private final PieConfig pieConfig;
//     
//     public PolicyConfig(String name, PieConfig pieConfig) {
//         this.name = name;
//         this.pieConfig = pieConfig;
//     }
//     
//     public boolean isEnabled() {
//         return getBoolean("isEnabled", true);
//     }
//     
//     public boolean isReportOnlyMode() {
//         return getBoolean("isReportOnlyMode", true);
//     }
// 
//     public boolean isCollapseEnabled() {
//         return getBoolean("isCollapseEnabled", true);
//     }
//     
//     public URL getPolicyFile() {
//         String policyFile = getProperty("policyFile");
//         if (policyFile != null) {
//             try {
//                 return new URL(policyFile);
//             } catch (MalformedURLException e) {
//                 throw new IllegalStateException("Invalid policy URL: " + policyFile);
//             }
//         }
//         URL resource = this.getClass().getClassLoader().getResource(name + ".policy");
//         if (resource != null) {
//             return resource;
//         }
//         String catalinaHome = System.getProperty("catalina.home");
//         if (catalinaHome != null) {
//             try {
//                 return new File(catalinaHome + File.separatorChar + "conf" + File.separatorChar + name + ".policy").toURI().toURL();
//             } catch (MalformedURLException e) {
//                 throw new IllegalStateException("Could not build default policy file path.");
//             }
//         }
//         
//         // Default to file in the CWD
//         try {
//             return new File(name + ".policy").toURI().toURL();
//         } catch (MalformedURLException e) {
//             throw new RuntimeException(e);
//         }
//     }
//     
//     public boolean getBoolean(String prop, boolean defaultValue) {
//         String v = getProperty(prop);
//         if (v == null) {
//             return defaultValue;
//         }
//         return Boolean.parseBoolean(v);
//     }
//     public int getInteger(String prop, int defaultValue) {
//         String v = getProperty(prop);
//         if (v == null) {
//             return defaultValue;
//         }
//         return Integer.parseInt(v);
//     }
//     
//     
//     public String getProperty(String name) {
//         return pieConfig.getProperties().getProperty(this.name + "." + name);
//     }
// }
// 
// Path: pie-core/src/main/java/com/coverity/security/pie/core/StringCollapser.java
// public interface StringCollapser {
//     /**
//      * Collapses a security policy according to the concrete implementation's rules. It takes a map from facts to their
//      * children, and returns a collapsed version of that map. For example, given the map:
//      * {
//      *   A => {'X', 'Y'},
//      *   B => {'Z'}
//      * }
//      *
//      * If the implementation determines that the facts A and B should be collapsed to fact C, then this would return
//      * {
//      *   C => {'X', 'Y', 'Z'}
//      * }
//      *
//      * @param input A map from facts to a collection of child facts.
//      * @param <T> The type of the child facts; irrelevant to the internal procedure of collapsing.
//      * @return The collapsed map of facts to their children.
//      */
//     public <T> Map<String, Collection<T>> collapse(Map<String, Collection<T>> input);
// }


// Path: pie-sm/src/main/java/com/coverity/security/pie/policy/securitymanager/fact/PermissionNameFactMetaData.java
import com.coverity.security.pie.core.EqualityStringMatcher;
import com.coverity.security.pie.core.FactMetaData;
import com.coverity.security.pie.core.NullStringCollapser;
import com.coverity.security.pie.core.PolicyConfig;
import com.coverity.security.pie.core.StringCollapser;

package com.coverity.security.pie.policy.securitymanager.fact;


public class PermissionNameFactMetaData implements FactMetaData {

    private static final PermissionNameFactMetaData instance = new PermissionNameFactMetaData();
    
    private PermissionNameFactMetaData() {
    }
    
    public static PermissionNameFactMetaData getInstance() {