/******************************************************************************
 * * This data and information is proprietary to, and a valuable trade secret
 * * of, Basis Technology Corp.  It is given in confidence by Basis Technology
 * * and may only be used as permitted under the license agreement under which
 * * it has been distributed, and in no other way.
 * *
 * * Copyright (c) 2015 Basis Technology Corporation All rights reserved.
 * *
 * * The technical data and information provided herein are provided with
 * * `limited rights', and the computer software provided herein is provided
 * * with `restricted rights' as those terms are defined in DAR and ASPR
 * * 7-104.9(a).
 ******************************************************************************/

package org.ops4j.pax.exam;

import org.osgi.framework.FrameworkEvent;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.Map;

/**
 * Utility methods related to {@link FrameworkEvent}.
 */
public class FrameworkEventUtils {
    private static final Map<Integer, String> EVENT_STRINGS;

    static {
        EVENT_STRINGS = new HashMap<>();
        for (Field field : FrameworkEvent.class.getDeclaredFields()) {
            if (Modifier.isPublic(field.getModifiers())) {
                Integer value;
                try {
                    value = (Integer)field.get(null);
                } catch (IllegalAccessException e) {
                    throw new RuntimeException("Failed to obtain value of FrameworkEvent." + field.getName());
                }
                EVENT_STRINGS.put(value, field.getName());
            }
        }
    }

    /**
     * Return a readable representation of the type of a {@link FrameworkEvent}.
     * @param frameworkEventType a value from {@link FrameworkEvent#getType()}.
     * @return the name of the field that corresponds to this type.
     */
    public static String getFrameworkEventString(int frameworkEventType) {
        return EVENT_STRINGS.get(frameworkEventType);
    }

    private FrameworkEventUtils() {
        //
    }
}

@@ -1,774 +1,604 @@
 /*
-*****************************************************************************%0A * * This data and information is proprietary to, and a valuable trade secret%0A * * of, Basis Technology Corp.  It is given in confidence by Basis Technology%0A * * and may only be used as permitted under the license agreement under which%0A * * it has been distributed, and in no other way.
+%0A * Copyright 2015 Benson Margulies.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at
 %0A *
- *
 %0A * 
-* Copyright (c) 2015 Basis Technology Corporation All rights reserved.%0A * *%0A * * The technical data and information provided herein
+http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or
  a
+g
 re
- provided with%0A * * %60limited rights', and the computer software provided herein is provided%0A * * with %60restricted rights' as those terms are defined in DAR and ASPR%0A * * 7-104.9(a).%0A *****************************************************************************
+ed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or%0A * implied.%0A *%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A 
 */%0A%0A

Fix IP notice.