package com.example.plugintest.manymethods.i.a;

public class A4 {

    public static void a0(String msg) {
        System.out.println("msg=" + msg + 0);
    }

    public static void a1(String msg) {
        System.out.println("msg=" + msg + 1);
    }

    public static void a2(String msg) {
        System.out.println("msg=" + msg + 2);
    }

    public static void a3(String msg) {
        System.out.println("msg=" + msg + 3);
    }

    public static void a4(String msg) {
        System.out.println("msg=" + msg + 4);
    }

    public static void a5(String msg) {
        System.out.println("msg=" + msg + 5);
    }

    public static void a6(String msg) {
        System.out.println("msg=" + msg + 6);
    }

    public static void a7(String msg) {
        System.out.println("msg=" + msg + 7);
    }

    public static void a8(String msg) {
        System.out.println("msg=" + msg + 8);
    }

    public static void a9(String msg) {
        System.out.println("msg=" + msg + 9);
    }

    public static void a10(String msg) {
        System.out.println("msg=" + msg + 10);
    }

    public static void a11(String msg) {
        System.out.println("msg=" + msg + 11);
    }

    public static void a12(String msg) {
        System.out.println("msg=" + msg + 12);
    }

    public static void a13(String msg) {
        System.out.println("msg=" + msg + 13);
    }

    public static void a14(String msg) {
        System.out.println("msg=" + msg + 14);
    }

    public static void a15(String msg) {
        System.out.println("msg=" + msg + 15);
    }

    public static void a16(String msg) {
        System.out.println("msg=" + msg + 16);
    }

    public static void a17(String msg) {
        System.out.println("msg=" + msg + 17);
    }

    public static void a18(String msg) {
        System.out.println("msg=" + msg + 18);
    }

    public static void a19(String msg) {
        System.out.println("msg=" + msg + 19);
    }

    public static void a20(String msg) {
        System.out.println("msg=" + msg + 20);
    }

    public static void a21(String msg) {
        System.out.println("msg=" + msg + 21);
    }

    public static void a22(String msg) {
        System.out.println("msg=" + msg + 22);
    }

    public static void a23(String msg) {
        System.out.println("msg=" + msg + 23);
    }

    public static void a24(String msg) {
        System.out.println("msg=" + msg + 24);
    }

    public static void a25(String msg) {
        System.out.println("msg=" + msg + 25);
    }

    public static void a26(String msg) {
        System.out.println("msg=" + msg + 26);
    }

    public static void a27(String msg) {
        System.out.println("msg=" + msg + 27);
    }

    public static void a28(String msg) {
        System.out.println("msg=" + msg + 28);
    }

    public static void a29(String msg) {
        System.out.println("msg=" + msg + 29);
    }

    public static void a30(String msg) {
        System.out.println("msg=" + msg + 30);
    }

    public static void a31(String msg) {
        System.out.println("msg=" + msg + 31);
    }

    pub

lic static void a32(String msg) {
        System.out.println("msg=" + msg + 32);
    }

    public static void a33(String msg) {
        System.out.println("msg=" + msg + 33);
    }

    public static void a34(String msg) {
        System.out.println("msg=" + msg + 34);
    }

    public static void a35(String msg) {
        System.out.println("msg=" + msg + 35);
    }

    public static void a36(String msg) {
        System.out.println("msg=" + msg + 36);
    }

    public static void a37(String msg) {
        System.out.println("msg=" + msg + 37);
    }

    public static void a38(String msg) {
        System.out.println("msg=" + msg + 38);
    }

    public static void a39(String msg) {
        System.out.println("msg=" + msg + 39);
    }

    public static void a40(String msg) {
        System.out.println("msg=" + msg + 40);
    }

    public static void a41(String msg) {
        System.out.println("msg=" + msg + 41);
    }

    public static void a42(String msg) {
        System.out.println("msg=" + msg + 42);
    }

    public static void a43(String msg) {
        System.out.println("msg=" + msg + 43);
    }

    public static void a44(String msg) {
        System.out.println("msg=" + msg + 44);
    }

    public static void a45(String msg) {
        System.out.println("msg=" + msg + 45);
    }

    public static void a46(String msg) {
        System.out.println("msg=" + msg + 46);
    }

    public static void a47(String msg) {
        System.out.println("msg=" + msg + 47);
    }

    public static void a48(String msg) {
        System.out.println("msg=" + msg + 48);
    }

    public static void a49(String msg) {
        System.out.println("msg=" + msg + 49);
    }

    public static void a50(String msg) {
        System.out.println("msg=" + msg + 50);
    }

    public static void a51(String msg) {
        System.out.println("msg=" + msg + 51);
    }

    public static void a52(String msg) {
        System.out.println("msg=" + msg + 52);
    }

    public static void a53(String msg) {
        System.out.println("msg=" + msg + 53);
    }

    public static void a54(String msg) {
        System.out.println("msg=" + msg + 54);
    }

    public static void a55(String msg) {
        System.out.println("msg=" + msg + 55);
    }

    public static void a56(String msg) {
        System.out.println("msg=" + msg + 56);
    }

    public static void a57(String msg) {
        System.out.println("msg=" + msg + 57);
    }

    public static void a58(String msg) {
        System.out.println("msg=" + msg + 58);
    }

    public static void a59(String msg) {
        System.out.println("msg=" + msg + 59);
    }

    public static void a60(String msg) {
        System.out.println("msg=" + msg + 60);
    }

    public static void a61(String msg) {
        System.out.println("msg=" + msg + 61);
    }

    public static void a62(String msg) {
        System.out.println("msg=" + msg + 62);
    }

    public static void a63(String msg) {
        System.out.println("msg=" + msg + 63);
    }

    public static void a64(String msg) {
        System.out.println("msg=" + msg + 64);
    }

    public static void a65(String msg) {
        System.out.println("msg=" + msg + 65);
    }

    public static void a66(String msg) {
        System.out.println("msg=" + msg + 66);
    }

    public static void a67(String msg) {
        System.out.println("msg=" + msg + 67);
    }

    public static void a68(String msg) {
        System.out.println("msg=" + msg + 68);
    }

    public static void a69(String msg) {
        System.out.println("msg=" + msg + 69);
    }

    public static void a70(String msg) {
        System.out.println("msg=" + msg + 70);
    }

    public static void a71(String msg) {
        System.out.println("msg=" + msg + 71);
    }

    public static void a72(String msg) {
        System.out.println("msg=" + msg + 72);
    }

    public static void a73(String msg) {
        System.out.println("msg=" + msg + 73);
    }

    public static void a74(String msg) {
        System.out.println("msg=" + msg + 74);
    }

    public static void a75(String msg) {
        System.out.println("msg=" + msg + 75);
    }

    public static void a76(String msg) {
        System.out.println("msg=" + msg + 76);
    }

    public static void a77(String msg) {
        System.out.println("msg=" + msg + 77);
    }

    public static void a78(String msg) {
        System.out.println("msg=" + msg + 78);
    }

    public static void a79(String msg) {
        System.out.println("msg=" + msg + 79);
    }

    public static void a80(String msg) {
        System.out.println("msg=" + msg + 80);
    }

    public static void a81(String msg) {
        System.out.println("msg=" + msg + 81);
    }

    public static void a82(String msg) {
        System.out.println("msg=" + msg + 82);
    }

    public static void a83(String msg) {
        System.out.println("msg=" + msg + 83);
    }

    public static void a84(String msg) {
        System.out.println("msg=" + msg + 84);
    }

    public static void a85(String msg) {
        System.out.println("msg=" + msg + 85);
    }

    public static void a86(String msg) {
        System.out.println("msg=" + msg + 86);
    }

    public static void a87(String msg) {
        System.out.println("msg=" + msg + 87);
    }

    public static void a88(String msg) {
        System.out.println("msg=" + msg + 88);
    }

    public static void a89(String msg) {
        System.out.println("msg=" + msg + 89);
    }

    public static void a90(String msg) {
        System.out.println("msg=" + msg + 90);
    }

    public static void a91(String msg) {
        System.out.println("msg=" + msg + 91);
    }

    public static void a92(String msg) {
        System.out.println("msg=" + msg + 92);
    }

    public static void a93(String msg) {
        System.out.println("msg=" + msg + 93);
    }

    public static void a94(String msg) {
        System.out.println("msg=" + msg + 94);
    }

    public static void a95(String msg) {
        System.out.println("msg=" + msg + 95);
    }

    public static void a96(String msg) {
        System.out.println("msg=" + msg + 96);
    }

    public static void a97(String msg) {
        System.out.println("msg=" + msg + 97);
    }

    public static void a98(String msg) {
        System.out.println("msg=" + msg + 98);
    }

    public static void a99(String msg) {
        System.out.println("msg=" + msg + 99);
    }
}


/*
 	@author Matthew Lohbihler
 */
package com.serotonin.json.util;

/**
 * @author Matthew Lohbihler
 */
public class ParsePositionTracker {

    private int line = 1;

    private int column = 1;

    private int elementLine;

    private int elementColumn;

    private int characterCount;

    private int markedLine;

    private int markedColumn;

    private int markedCharacterCount;

    public void mark() {
        markedLine = line;
        markedColumn = column;
        markedCharacterCount = characterCount;
    }

    public void reset() {
        line = markedLine;
        column = markedColumn;
        characterCount = markedCharacterCount;
    }

    public void setElementStart() {
        elementLine = line;
        elementColumn = column;
    }

{
        if (c == 0xA) {
            // Line feed
            line++;
            column = 1;
        } else
            column++;
        characterCount++;
    }

    public int getLine() {
        return line;
    }

    public int getColumn() {
        return column;
    }

    public int getElementLine() {
        return elementLine;
    }

    public int getElementColumn() {
        return elementColumn;
    }

    public int getCharacterCount() {
        return characterCount;
    }
}


/*
 	@author Matthew Lohbihler
 */
package com.serotonin.json.util;

/**
 * @author Matthew Lohbihler
 */
public class ParsePositionTracker {

    private int line = 1;

    private int column = 1;

    private int elementLine;

    private int elementColumn;

    private int characterCount;

    private int markedLine;

    private int markedColumn;

    private int markedCharacterCount;

    public void mark() {
        markedLine = line;
        markedColumn = column;
        markedCharacterCount = characterCount;
    }

    public void reset() {
        line = markedLine;
        column = markedColumn;
        characterCount = markedCharacterCount;
    }

    public void setElementStart() {
        elementLine = line;
        elementColumn = column;
    }

    public void update(char c) {
        if (c == 0xA) {
            // Line feed
            line++;
            column = 1;
        } else
            column++;
        characterCount++;
    }

    public int getLine() {
        return line;
    }

    public int getColumn() {
        return column;
    }

    public int getElementLine()

    public int getElementColumn() {
        return elementColumn;
    }

    public int getCharacterCount() {
        return characterCount;
    }
}


        if (c == 0xA) {
            // Line feed
            line++;
            column = 1;
        } else
            column++;

/*
 	@author Matthew Lohbihler
 */
package com.serotonin.json.util;

/**
 * @author Matthew Lohbihler
 */
public class ParsePositionTracker {

    private int line = 1;

    private int column = 1;

    private int elementLine;

    private int elementColumn;

    private int characterCount;

    private int markedLine;

    private int markedColumn;

    private int markedCharacterCount;

    public void mark() {
        markedLine = line;
        markedColumn = column;
        markedCharacterCount = characterCount;
    }

    public void reset() {
        line = markedLine;
        column = markedColumn;
        characterCount = markedCharacterCount;
    }

    public void setElementStart() {
        elementLine = line;
        elementColumn = column;
    }

    public void update(char c) {

        characterCount++;
    }

    public int getLine() {
        return line;
    }

    public int getColumn() {
        return column;
    }

    public int getElementLine() {
        return elementLine;
    }

    public int getElementColumn() {
        return elementColumn;
    }

    public int getCharacterCount() {
        return characterCount;
    }
}


/*
 	@author Matthew Lohbihler
 */
package com.serotonin.json.util;

/**
 * @author Matthew Lohbihler
 */
public class ParsePositionTracker {

    private int line = 1;

    private int column = 1;

    private int elementLine;

    private int elementColumn;

    private int characterCount;

    private int markedLine;

    private int markedColumn;

    private int markedCharacterCount;

    public void mark() {
        markedLine = line;
        markedColumn = column;
        markedCharacterCount = characterCount;
    }

    public void reset() {
        line = markedLine;
        column = markedColumn;
        characterCount = markedCharacterCount;
    }

    public void setElementStart() {
        elementLine = line;
        elementColumn = column;
    }

    public void update(char c) {
        if (c == 0xA) {
            // Line feed
            line++;
            column = 1;
        } else
            column++;

    }

    public int getLine() {
        return line;
    }

    public int getColumn() {
        return column;
    }

    public int getElementLine() {
        return elementLine;
    }

    public int getElementColumn() {
        return elementColumn;
    }

    public int getCharacterCount() {
        return characterCount;
    }
}


/*
 	@author Matthew Lohbihler
 */
package com.serotonin.json.util;

/**
 * @author Matthew Lohbihler
 */
public class ParsePositionTracker {

    private int line = 1;

    private int column = 1;

    private int elementLine;

    private int elementColumn;

    private int characterCount;

    private int markedLine;

    private int markedColumn;

    private int markedCharacterCount;

    public void mark() {
        markedLine = line;
        markedColumn = column;
        markedCharacterCount = characterCount;
    }

    public void reset() {
        line = markedLine;
        column = markedColumn;
        characterCount = markedCharacterCount;
    }

    public void setElementStart() {
        elementLine = line;
        elementColumn = column;
    }

    public void update(char c) {
        if (c == 0xA) {
            // Line feed
            line++;
            column = 1;
        } else
            column++;
        characterCount++;

    public int getLine() {
        return line;
    }

    public int getColumn() {
        return column;
    }

    public int getElementLine() {
        return elementLine;
    }

    public int getElementColumn() {
        return elementColumn;
    }

    public int getCharacterCount() {
        return characterCount;
    }
}


/*
 	@author Matthew Lohbihler
 */
package com.serotonin.json.util;

/**
 * @author Matthew Lohbihler
 */
public class ParsePositionTracker {

    private int line = 1;

    private int column = 1;

    private int elementLine;

    private int elementColumn;

    private int characterCount;

    private int markedLine;

    private int markedColumn;

    private int markedCharacterCount;

    public void mark() {
        markedLine = line;
        mar

        markedCharacterCount = characterCount;
    }

    public void reset() {
        line = markedLine;
        column = markedColumn;
        characterCount = markedCharacterCount;
    }

    public void setElementStart() {
        elementLine = line;
        elementColumn = column;
    }

    public void update(char c) {
        if (c == 0xA) {
            // Line feed
            line++;
            column = 1;
        } else
            column++;
        characterCount++;
    }

    public int getLine() {
        return line;
    }

    public int getColumn() {
        return column;
    }

    public int getElementLine() {
        return elementLine;
    }

    public int getElementColumn() {
        return elementColumn;
    }

    public int getCharacterCount() {
        return characterCount;
    }
}


if (c == 0xA) {
            // Line feed
            line++;
            column = 1;
        } else
            column++;


/*
 	@author Matthew Lohbihler
 */
package com.serotonin.json.util;

/**
 * @author Matthew Lohbihler
 */
public class ParsePositionTracker {

    private int line = 1;

    private int column = 1;

    private int elementLine;

    private int elementColumn;

    private int characterCount;

    private int markedLine;

    private int markedColumn;

    private int markedCharacterCount;

    public void mark() {
        markedLine = line;
        markedColumn = column;
        markedCharacterCount = characterCount;
    }

    public void reset() {
        line = markedLine;
        column = markedColumn;
        characterCount = markedCharacterCount;
    }

    public void setElementStart() {
        elementLine = line;
        elementColumn = column;
    }

    public void update(char c) {
        if (c == 0xA) {

            // Line feed
            line++;
            column = 1;
        } else
            column++;
        characterCount++;
    }

    public int getLine() {
        return line;
    }

    public int getColumn() {
        return column;
    }

    public int getElementLine() {
        return elementLine;
    }

    public int getElementColumn() {
        return elementColumn;
    }

    public int getCharacterCount() {
        return characterCount;
    }
}


public static String getString(final String key, final String defaultValue)

/*
 * Sonatype Nexus (TM) Open Source Version
 * All rights reserved. Includes the third-party code listed at http://example.com.
 *
 *
 * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
 * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
 * Eclipse Foundation. All other trademarks are the property of their respective owners.
 */
package org.sonatype.nexus.common.property;

import org.sonatype.goodies.common.Time;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Helper to retrieve a system property typed value.
 */
public class SystemPropertiesHelper {

    private static final Logger log = LoggerFactory.getLogger(SystemPropertiesHelper.class);

    private SystemPropertiesHelper() {
        // empty
    }

    public static int getInteger(final String key, final int defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Integer.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid integer '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static long getLong(final String key, final long defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Long.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid long '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static boolean getBoolean(final String key, final boolean defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        return Boolean.valueOf(value);
    }

{
        return System.getProperty(key, defaultValue);
    }

    public static Time getTime(final String key, final Time defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Time.parse(value);
        } catch (RuntimeException e) {
            // NOSONAR
            log.warn("Invalid time '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }
}


{
        return System.getProperty(key, defaultValue);
    }

/*
 * Sonatype Nexus (TM) Open Source Version
 * All rights reserved. Includes the third-party code listed at http://example.com.
 *
 *
 * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
 * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
 * Eclipse Foundation. All other trademarks are the property of their respective owners.
 */
package org.sonatype.nexus.common.property;

import org.sonatype.goodies.common.Time;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Helper to retrieve a system property typed value.
 */
public class SystemPropertiesHelper {

    private static final Logger log = LoggerFactory.getLogger(SystemPropertiesHelper.class);

    private SystemPropertiesHelper() {
        // empty
    }

    public static int getInteger(final String key, final int defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Integer.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid integer '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static long getLong(final String key, final long defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Long.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid long '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static boolean getBoolean(final String key, final boolean defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        return Boolean.valueOf(value);
    }

    public static String getString(final String key, final String defaultValue)

    public static Time getTime(final String key, final Time defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Time.parse(value);
        } catch (RuntimeException e) {
            // NOSONAR
            log.warn("Invalid time '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }
}


/*
 * Sonatype Nexus (TM) Open Source Version
 * All rights reserved. Includes the third-party code listed at http://example.com.
 *
 *
 * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
 * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
 * Eclipse Foundation. All other trademarks are the property of their respective owners.
 */
package org.sonatype.nexus.common.property;

import org.sonatype.goodies.common.Time;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Helper to retrieve a system property typed value.
 */
public class SystemPropertiesHelper {

    private static final Logger log = LoggerFactory.getLogger(SystemPropertiesHelper.class);

    private SystemPropertiesHelper() {
        // empty
    }

    public static int getInteger(final String key, final int defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Integer.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid integer '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static long getLong(final String key, final long defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Long.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid long '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static boolean getBoolean(final String key, final boolean defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        return Boolean.valueOf(value);
    }

    public static String getString(final String key, final String defaultValue) {
        return System.getProperty(key, defaultValue);
    }

    public static Time getTime(final String key, final Time defaultValue) {

        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Time.parse(value);
        } catch (RuntimeException e) {
            // NOSONAR
            log.warn("Invalid time '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }
}


/*
 * Sonatype Nexus (TM) Open Source Version
 * All rights reserved. Includes the third-party code listed at http://example.com.
 *
 *
 * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
 * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
 * Eclipse Foundation. All other trademarks are the property of their respective owners.
 */
package org.sonatype.nexus.common.property;

import org.sonatype.goodies.common.Time;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Helper to retrieve a system property typed value.
 */
public class SystemPropertiesHelper {

    private static final Logger log = LoggerFactory.getLogger(SystemPropertiesHelper.class);

    private SystemPropertiesHelper() {
        // empty
    }

    public static int getInteger(final String key, final int defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Integer.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid integer '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static long getLong(final String key, final long defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Long.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid long '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static boolean getBoolean(final String key, final boolean defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        return Boolean.valueOf(value);
    }

    public static String getString(final String key, final String defaultValue) {
        return System.getProperty(key, defaultValue);
    }

    public static Time getTime(final String key, final Time defaultValue) {
        final String value = System.getProperty(key);

        try {
            return Time.parse(value);
        } catch (RuntimeException e) {
            // NOSONAR
            log.warn("Invalid time '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }
}


try {
            return Time.parse(value);
        } catch (RuntimeException e) {
            // NOSONAR
            log.warn("Invalid time '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

/*
 * Sonatype Nexus (TM) Open Source Version
 * All rights reserved. Includes the third-party code listed at http://example.com.
 *
 *
 * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
 * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
 * Eclipse Foundation. All other trademarks are the property of their respective owners.
 */
package org.sonatype.nexus.common.property;

import org.sonatype.goodies.common.Time;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Helper to retrieve a system property typed value.
 */
public class SystemPropertiesHelper {

    private static final Logger log = LoggerFactory.getLogger(SystemPropertiesHelper.class);

    private SystemPropertiesHelper() {
        // empty
    }

    public static int getInteger(final String key, final int defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Integer.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid integer '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static long getLong(final String key, final long defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Long.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid long '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static boolean getBoolean(final String key, final boolean defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        return Boolean.valueOf(value);
    }

    public static String getString(final String key, final String defaultValue) {
        return System.getProperty(key, defaultValue);
    }

    public static Time getTime(final String key, final Time defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }


/*
 * Sonatype Nexus (TM) Open Source Version
 * All rights reserved. Includes the third-party code listed at http://example.com.
 *
 *
 * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
 * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
 * Eclipse Foundation. All other trademarks are the property of their respective owners.
 */
package org.sonatype.nexus.common.property;

import org.sonatype.goodies.common.Time;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Helper to retrieve a system property typed value.
 */
public class SystemPropertiesHelper {

    private static final Logger log = LoggerFactory.getLogger(SystemPropertiesHelper.class);

    private SystemPropertiesHelper() {
        // empty
    }

    public static int getInteger(final String key, final int defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Integer.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid integer '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static long getLong(final String key, final long defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Long.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid long '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static boolean getBoolean(final String key, final boolean defaultValue) {
        f

        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        return Boolean.valueOf(value);
    }

    public static String getString(final String key, final String defaultValue) {
        return System.getProperty(key, defaultValue);
    }

    public static Time getTime(final String key, final Time defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Time.parse(value);
        } catch (RuntimeException e) {
            // NOSONAR
            log.warn("Invalid time '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }
}


/*
 * Sonatype Nexus (TM) Open Source Version
 * All rights reserved. Includes the third-party code listed at http://example.com.
 *
 *
 * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
 * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
 * Eclipse Foundation. All other trademarks are the property of their respective owners.
 */
package org.sonatype.nexus.common.property;

import org.sonatype.goodies.common.Time;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Helper to retrieve a system property typed value.
 */
public class SystemPropertiesHelper {

    private static final Logger log = LoggerFactory.getLogger(SystemPropertiesHelper.class);

    private SystemPropertiesHelper() {
        // empty
    }

    public static int getInteger(final String key, final int defaultValue) {
        final String value = System.getProperty(key);

        try {
            return Integer.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid integer '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static long getLong(final String key, final long defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Long.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid long '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static boolean getBoolean(final String key, final boolean defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        return Boolean.valueOf(value);
    }

    public static String getString(final String key, final String defaultValue) {
        return System.getProperty(key, defaultValue);
    }

    public static Time getTime(final String key, final Time defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Time.parse(value);
        } catch (RuntimeException e) {
            // NOSONAR
            log.warn("Invalid time '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }
}


try {
            return Time.parse(value);
        } catch (RuntimeException e) {
            // NOSONAR
            log.warn("Invalid time '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }


/*
 * Sonatype Nexus (TM) Open Source Version
 * All rights reserved. Includes the third-party code listed at http://example.com.
 *
 *
 * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
 * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
 * Eclipse Foundation. All other trademarks are the property of their respective owners.
 */
package org.sonatype.nexus.common.property;

import org.sonatype.goodies.common.Time;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Helper to retrieve a system property typed value.
 */
public class SystemPropertiesHelper {

    private static final Logger log = LoggerFactory.getLogger(SystemPropertiesHelper.class);

    private SystemPropertiesHelper() {
        // empty
    }

    public static int getInteger(final String key, final int defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Integer.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid integer '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static long getLong(final String key, final long defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Long.valueOf(value);
        } catch (NumberFormatException e) {
            // NOSONAR
            log.warn("Invalid long '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;
        }
    }

    public static boolean getBoolean(final String key, final boolean defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        return Boolean.valueOf(value);
    }

    public static String getString(final String key, final String defaultValue) {
        return System.getProperty(key, defaultValue);
    }

    public static Time getTime(final String key, final Time defaultValue) {
        final String value = System.getProperty(key);
        if (value == null || value.trim().length() == 0) {
            return defaultValue;
        }
        try {
            return Time.parse(value);
        } catch (RuntimeException e) {
            // NOSONAR
            log.warn("Invalid time '{}' for property '{}'. Defaulting to '{}'", value, key, defaultValue);
            return defaultValue;


package com.raytheon.uf.viz.npp.nucaps.xml;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * NUCAPS Configuration: QC color model: 0: pass, 1,17: partially passed, 9,25:
 * totally failed, others.
 *
 * <pre>
 *
 * SOFTWARE HISTORY
 *
 * Date         Ticket#    Engineer    Description
 * ------------ ---------- ----------- --------------------------
 * Jul 25, 2017 19924       wkwock     Initial creation
 *
 * </pre>
 *
 * @author wkwock
 */
@XmlRootElement(name = "nucapsConfig")
@XmlAccessorType(XmlAccessType.NONE)
public class NucapsConfig {

    @XmlElement(name = "passed")
    private String passedColorName;

    @XmlElement(name = "partiallyPassed")
    private String partiallyPassedColorName;

    @XmlElement(name = "totallyFailed")
    private String totallyFailedColorName;

    @XmlElement(name = "default")
    private String defaultColorName;

{
        return passedColorName;
    }

    public void setPassedColorName(String passedColorName) {
        this.passedColorName = passedColorName;
    }

    public String getPartiallyPassedColorName() {
        return partiallyPassedColorName;
    }

    public void setPartiallyPassedColorName(String partiallyPassedColorName) {
        this.partiallyPassedColorName = partiallyPassedColorName;
    }

    public String getTotallyFailedColorName() {
        return totallyFailedColorName;
    }

    public void setTotallyFailedColorName(String totallyFailedColorName) {
        this.totallyFailedColorName = totallyFailedColorName;
    }

    public String getDefaultColorName() {
        return defaultColorName;
    }

    public void setDefaultColorName(String defaultColorName) {
        this.defaultColorName = defaultColorName;
    }
}


{
        this.defaultColorName = defaultColorName;
    }

package com.raytheon.uf.viz.npp.nucaps.xml;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * NUCAPS Configuration: QC color model: 0: pass, 1,17: partially passed, 9,25:
 * totally failed, others.
 *
 * <pre>
 *
 * SOFTWARE HISTORY
 *
 * Date         Ticket#    Engineer    Description
 * ------------ ---------- ----------- --------------------------
 * Jul 25, 2017 19924       wkwock     Initial creation
 *
 * </pre>
 *
 * @author wkwock
 */
@XmlRootElement(name = "nucapsConfig")
@XmlAccessorType(XmlAccessType.NONE)
public class NucapsConfig {

    @XmlElement(name = "passed")
    private String passedColorName;

    @XmlElement(name = "partiallyPassed")
    private String partiallyPassedColorName;

    @XmlElement(name = "totallyFailed")
    private String totallyFailedColorName;

    @XmlElement(name = "default")
    private String defaultColorName;

    public String getPassedColorName() {
        return passedColorName;
    }

    public void setPassedColorName(String passedColorName) {
        this.passedColorName = passedColorName;
    }

    public String getPartiallyPassedColorName() {
        return partiallyPassedColorName;
    }

    public void setPartiallyPassedColorName(String partiallyPassedColorName) {
        this.partiallyPassedColorName = partiallyPassedColorName;
    }

    public String getTotallyFailedColorName() {
        return totallyFailedColorName;
    }

    public void setTotallyFailedColorName(String totallyFailedColorName) {
        this.totallyFailedColorName = totallyFailedColorName;
    }

    public String getDefaultColorName() {
        return defaultColorName;
    }

    public void setDefaultColorName(String defaultColorName)


package com.raytheon.uf.viz.npp.nucaps.xml;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * NUCAPS Configuration: QC color model: 0: pass, 1,17: partially passed, 9,25:
 * totally failed, others.
 *
 * <pre>
 *
 * SOFTWARE HISTORY
 *
 * Date         Ticket#    Engineer    Description
 * ------------ ---------- ----------- --------------------------
 * Jul 25, 2017 19924       wkwock     Initial creation
 *
 * </pre>
 *
 * @author wkwock
 */
@XmlRootElement(name = "nucapsConfig")
@XmlAccessorType(XmlAccessType.NONE)
public class NucapsConfig {

    @XmlElement(name = "passed")
    private String passedColorName;

    @XmlElement(name = "partiallyPassed")
    private String partiallyPassedColorName;

    @XmlElement(name = "totallyFailed")
    private String totallyFailedColorName;

    @XmlElement(name = "default")
    private String defaultColorName;

    public String getPassedColorName() {
        return passedColorName;
    }

    public void setPassedColorName(String passedColorName) {
        this.passedColorName = passedColorName;
    }

    public String getPartiallyPassedColorName() {
        return partiallyPassedColorName;
    }

    public void setPartiallyPassedColorName(String partiallyPassedColorName) {
        this.partiallyPassedColorName = partiallyPassedColorName;
    }

    public String getTotallyFailedColorName() {
        return

    }

    public void setTotallyFailedColorName(String totallyFailedColorName) {
        this.totallyFailedColorName = totallyFailedColorName;
    }

    public String getDefaultColorName() {
        return defaultColorName;
    }

    public void setDefaultColorName(String defaultColorName) {
        this.defaultColorName = defaultColorName;
    }
}


package com.raytheon.uf.viz.npp.nucaps.xml;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * NUCAPS Configuration: QC color model: 0: pass, 1,17: partially passed, 9,25:
 * totally failed, others.
 *
 * <pre>
 *
 * SOFTWARE HISTORY
 *
 * Date         Ticket#    Engineer    Description
 * ------------ ---------- ----------- --------------------------
 * Jul 25, 2017 19924       wkwock     Initial creation
 *
 * </pre>
 *
 * @author wkwock
 */
@XmlRootElement(name = "nucapsConfig")
@XmlAccessorType(XmlAccessType.NONE)
public class NucapsConfig {

    @XmlElement(name = "passed")
    private String passedColorName;

    @XmlElement(name = "partiallyPassed")
    private String partiallyPassedColorName;

    @XmlElement(name = "totallyFailed")
    private String totallyFailedColorName;

    @XmlElement(name = "default")
    private String defaultColorName;

    public String getPassedColorName() {
        return passedColorName;
    }

    public void setPassedColorName(String passedColorName) {
        this.passedColorName = passedColorName;
    }

    public String getPartiallyPassedColorName() {
        return partiallyPassedColorName;
    }

    public void setPartiallyPassedColorName(String partiallyPassedColorName) {
        this.partiallyPassedColorName = partiallyPassedColorName;
    }

    public String getTotallyFailedColorName() {
        return totallyFailedColorName;
    }

    public void setTotallyFailedColorName(String totallyFailedColorNam

e) {
        this.totallyFailedColorName = totallyFailedColorName;
    }

    public String getDefaultColorName() {
        return defaultColorName;
    }

    public void setDefaultColorName(String defaultColorName) {
        this.defaultColorName = defaultColorName;
    }
}


package org.tessell.gwt.user.client.ui;

import org.tessell.gwt.dom.client.IsElement;
import com.google.gwt.event.logical.shared.HasCloseHandlers;
import com.google.gwt.user.client.ui.HasAnimation;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.PopupPanel.PositionCallback;

public interface IsPopupPanel extends IsSimplePanel, HasAnimation, HasCloseHandlers<PopupPanel> {

    void setPopupPosition(int left, int top);

    void setPopupPositionAndShow(PositionCallback callback);

    void center();

    void show();

    void hide();

    void setGlassEnabled(boolean enabled);

    void setGlass

StyleName(String styleName);

    boolean isShowing();

    void addAutoHidePartner(IsElement element);

    boolean isAutoHideEnabled();

    void setAutoHideEnabled(boolean autoHide);

    boolean isAutoHideOnHistoryEventsEnabled();

    void setAutoHideOnHistoryEventsEnabled(boolean enabled);

    boolean isModal();

    void setModal(boolean modal);
}


@FFDCIgnore(PrivilegedActionException.class)
    private static Class<?> loadClass(final ClassLoader cl, final String className) throws ClassNotFoundException

/**
 * ****************************************************************************
 *
 *  Contributors:
 *      IBM Corporation - initial API and implementation
 * *****************************************************************************
 */
package com.ibm.ws.jpa;

import static com.ibm.ws.jpa.management.JPAConstants.JPA_RESOURCE_BUNDLE_NAME;
import static com.ibm.ws.jpa.management.JPAConstants.JPA_TRACE_GROUP;
import java.lang.reflect.Proxy;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;
import java.util.concurrent.ConcurrentSkipListSet;
import javax.persistence.spi.PersistenceUnitInfo;
import com.ibm.websphere.ras.Tr;
import com.ibm.websphere.ras.TraceComponent;
import com.ibm.ws.container.service.app.deploy.ModuleInfo;
import com.ibm.ws.ffdc.annotation.FFDCIgnore;
import com.ibm.ws.jpa.hibernate.LibertyJtaPlatform;

/**
 * Common JPAProviderIntegration implementation that provides general integration required for known
 * JPA providers.
 */
public abstract class AbstractJPAProviderIntegration implements JPAProviderIntegration {

    private static final TraceComponent tc = Tr.register(AbstractJPAProviderIntegration.class, JPA_TRACE_GROUP, JPA_RESOURCE_BUNDLE_NAME);

    // Known JPA provider implementation classes
    protected static final String PROVIDER_ECLIPSELINK = "org.eclipse.persistence.jpa.PersistenceProvider";

    protected static final String PROVIDER_HIBERNATE = "org.hibernate.jpa.HibernatePersistenceProvider";

    protected static final String PROVIDER_OPENJPA = "org.apache.openjpa.persistence.PersistenceProviderImpl";

    /**
     * As persistence providers are first used, they are added to this list so that version information is only logged once for them.
     */
    protected final ConcurrentSkipListSet<String> providersUsed = new ConcurrentSkipListSet<String>();

    /**
     * @see com.ibm.ws.jpa.JPAProviderIntegration#disablePersistenceUnitLogging(java.util.Map)
     */
    @Override
    public void disablePersistenceUnitLogging(Map<String, Object> integrationProperties) {
        integrationProperties.put("eclipselink.logging.level", "OFF");
        // Since we're disabling logging, we don't want this to conflict with other normally configured PUs. Give it a random
        // session-name such that when/if another EMF is created for this PU the EclipseLink JPAInitializer cache
        // value of PersistenceUnitProperties.SESSION_NAME
        integrationProperties.// value of PersistenceUnitProperties.SESSION_NAME
        put(// value of PersistenceUnitProperties.SESSION_NAME
        "eclipselink.session-name", "disabled-logging-pu" + UUID.randomUUID().toString());
    }

    /**
     * Log version information about the specified persistence provider, if it can be determined.
     *
     * @param providerName fully qualified class name of JPA persistence provider
     * @param loader       class loader with access to the JPA provider classes
     */
    @FFDCIgnore(Exception.class)
    private void logProviderInfo(String providerName, ClassLoader loader) {
        try {
            if (PROVIDER_ECLIPSELINK.equals(providerName)) {
                Class<?> Version = loadClass(loader, "org.eclipse.persistence.Version");
                String version = (String) Version.getMethod("getVersionString").invoke(Version.newInstance());
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "EclipseLink", version);
            } else if (PROVIDER_HIBERNATE.equals(providerName)) {
                Class<?> Version = loadClass(loader, "org.hibernate.Version");
                String version = (String) Version.getMethod("getVersionString").invoke(null);
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "Hibernate", version);
            } else if (PROVIDER_OPENJPA.equals(providerName)) {
                // OpenJPAVersion.appendOpenJPABanner(sb): OpenJPA #.#.#\n version id: openjpa-#.#.#-r# \n Apache svn revision: #
                StringBuilder version = new StringBuilder();
                Class<?> OpenJPAVersion = loadClass(loader, "org.apache.openjpa.conf.OpenJPAVersion");
                OpenJPAVersion.getMethod("appendOpenJPABanner", StringBuilder.class).invoke(OpenJPAVersion.newInstance(), version);
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "OpenJPA", version);
            } else {
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);
            }
        } catch (Exception x) {
            Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(this, tc, "unable to determine provider info", x);
        }
    }

{
        if (System.getSecurityManager() == null)
            return cl.loadClass(className);
        else
            try {
                return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {

                    @Override
                    public Class<?> run() throws ClassNotFoundException {
                        return cl.loadClass(className);
                    }
                });
            } catch (PrivilegedActionException e) {
                if (e.getCause() instanceof ClassNotFoundException)
                    throw (ClassNotFoundException) e.getCause();
                else
                    throw new RuntimeException(e);
            }
    }

    @Override
    public void moduleStarting(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStarted(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStopping(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStopped(ModuleInfo moduleInfo) {
    }

    /**
     * @see com.ibm.ws.jpa.JPAProviderIntegration#supportsEntityManagerPooling()
     */
    @Override
    public boolean supportsEntityManagerPooling() {
        return false;
    }

    /**
     * @see com.ibm.ws.jpa.JPAProvider#addIntegrationProperties(java.util.Properties)
     */
    @FFDCIgnore(ClassNotFoundException.class)
    @Override
    public void updatePersistenceProviderIntegrationProperties(PersistenceUnitInfo puInfo, java.util.Map<String, Object> props) {
        String providerName = puInfo.getPersistenceProviderClassName();
        if (PROVIDER_ECLIPSELINK.equals(providerName)) {
            props.put("eclipselink.target-server", "WebSphere_Liberty");
            if (puInfo instanceof com.ibm.ws.jpa.management.JPAPUnitInfo) {
                props.put("eclipselink.application-id", ((com.ibm.ws.jpa.management.JPAPUnitInfo) puInfo).getApplName());
            }
            Properties properties = puInfo.getProperties();
            /*
             * Section 4.8.5 of the JPA Specification:
             * If SUM, AVG, MAX, or MIN is used, and there are no values
             * to which the aggregate function can be applied, the result of
             * the aggregate function is NULL.
             *
             * Set this property to so that EclipseLink does not return null by default
             *
             * JPA 3.0: Do not force this override with JPA 3.0 and later.
             */
            if (!properties.containsKey("eclipselink.allow-null-max-min") && JPAAccessor.getJPAComponent().getJPAVersion().lesserThan(JPAVersion.JPA30)) {
                props.put("eclipselink.allow-null-max-min", "false");
            }
            /*
             * EclipseLink Bug 567891: Case expressions that should return boolean instead
             * return integer values. The JPA spec is too vague to change this, so we set this
             * property to be safe for customers.
             *
             * Set this property to `false` so that EclipseLink will return the same integer
             * value it has always returned for CASE expressions and not change behavior
             *
             * NOTE: This property is applicable for JPA 21 & JPA 22. JPAVersion > JPA22 has changed
             * behavior by default
             */
            if (!properties.containsKey("eclipselink.sql.allow-convert-result-to-boolean") && JPAAccessor.getJPAComponent().getJPAVersion().equals(JPAVersion.JPA22)) {
                props.put("eclipselink.sql.allow-convert-result-to-boolean", "false");
            }
            // The property is named differently for EclipseLink 2.6
            if (!properties.containsKey("eclipselink.allow-result-type-conversion") && JPAAccessor.getJPAComponent().getJPAVersion().equals(JPAVersion.JPA21)) {
                props.put("eclipselink.allow-result-type-conversion", "false");
            }
        } else if (PROVIDER_HIBERNATE.equals(providerName)) {
            // Hibernate had vastly outdated built-in knowledge of WebSphere API, until version 5.2.13+ and 5.3+.
            // If the version of Hibernate has the Liberty JtaPlatform, use it
            // otherwise, tell Hibernate to use a proxy implementation of JtaPlatform that we will provide based on the WAS transaction manager
            ClassLoader loader = puInfo.getClassLoader();
            if (isWebSphereLibertyJtaPlatformAvailable(loader)) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(this, tc, "Detected WebSphereLibertyJtaPlatform, not applying dynamic proxy JtaPlatform.");
            } else {
                try {
                    Class<?> JtaPlatform = loadClass(loader, "org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform");
                    Object libertyJtaPlatform = Proxy.newProxyInstance(loader, new Class[] { JtaPlatform }, new LibertyJtaPlatform());
                    props.put("hibernate.transaction.jta.platform", libertyJtaPlatform);
                } catch (ClassNotFoundException x) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        Tr.debug(this, tc, "Unable to provide JtaPlatform for Liberty TransactionManager to Hibernate", x);
                }
            }
        }
        // Log third party provider name and version info once per provider
        if (providersUsed.add(providerName))
            logProviderInfo(providerName, puInfo.getClassLoader());
    }

    /**
     * @see com.ibm.ws.jpa.JPAProvider#modifyPersistenceUnitProperties(java.lang.String, java.util.Properties)
     */
    @Override
    public void updatePersistenceUnitProperties(String providerClassName, Properties props) {
    }

    /**
     * As of Hibernate 5.2.13+ and 5.3+ built-in knowledge of Liberty's transaction integration was delivered as:
     * org.hibernate.engine.transaction.jta.platform.internal.WebSphereLibertyJtaPlatform
     * If this class is available, we do not need to set our dynamic proxy instance.
     */
    @FFDCIgnore(ClassNotFoundException.class)
    private boolean isWebSphereLibertyJtaPlatformAvailable(ClassLoader loader) {
        try {
            loadClass(loader, "org.hibernate.engine.transaction.jta.platform.internal.WebSphereLibertyJtaPlatform");
            return true;
        } catch (ClassNotFoundException notFound) {
            return false;
        }
    }
}


/**
 * ****************************************************************************
 *
 *  Contributors:
 *      IBM Corporation - initial API and implementation
 * *****************************************************************************
 */
package com.ibm.ws.jpa;

import static com.ibm.ws.jpa.management.JPAConstants.JPA_RESOURCE_BUNDLE_NAME;
import static com.ibm.ws.jpa.management.JPAConstants.JPA_TRACE_GROUP;
import java.lang.reflect.Proxy;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;
import java.util.concurrent.ConcurrentSkipListSet;
import javax.persistence.spi.PersistenceUnitInfo;
import com.ibm.websphere.ras.Tr;
import com.ibm.websphere.ras.TraceComponent;
import com.ibm.ws.container.service.app.deploy.ModuleInfo;
import com.ibm.ws.ffdc.annotation.FFDCIgnore;
import com.ibm.ws.jpa.hibernate.LibertyJtaPlatform;

/**
 * Common JPAProviderIntegration implementation that provides general integration required for known
 * JPA providers.
 */
public abstract class AbstractJPAProviderIntegration implements JPAProviderIntegration {

    private static final TraceComponent tc = Tr.register(AbstractJPAProviderIntegration.class, JPA_TRACE_GROUP, JPA_RESOURCE_BUNDLE_NAME);

    // Known JPA provider implementation classes
    protected static final String PROVIDER_ECLIPSELINK = "org.eclipse.persistence.jpa.PersistenceProvider";

    protected static final String PROVIDER_HIBERNATE = "org.hibernate.jpa.HibernatePersistenceProvider";

    protected static final String PROVIDER_OPENJPA = "org.apache.openjpa.persistence.PersistenceProviderImpl";

    /**
     * As persistence providers are first used, they are added to this list so that version information is only logged once for them.
     */
    protected final ConcurrentSkipListSet<String> providersUsed = new ConcurrentSkipListSet<String>();

    /**
     * @see com.ibm.ws.jpa.JPAProviderIntegration#disablePersistenceUnitLogging(java.util.Map)
     */
    @Override
    public void disablePersistenceUnitLogging(Map<String, Object> integrationProperties) {
        integrationProperties.put("eclipselink.logging.level", "OFF");
        // Since we're disabling logging, we don't want this to conflict with other normally configured PUs. Give it a random
        // session-name such that when/if another EMF is created for this PU the EclipseLink JPAInitializer cache
        // value of PersistenceUnitProperties.SESSION_NAME
        integrationProperties.// value of PersistenceUnitProperties.SESSION_NAME
        put(// value of PersistenceUnitProperties.SESSION_NAME
        "eclipselink.session-name", "disabled-logging-pu" + UUID.randomUUID().toString());
    }

    /**
     * Log version information about the specified persistence provider, if it can be determined.
     *
     * @param providerName fully qualified class name of JPA persistence provider
     * @param loader       class loader with access to the JPA provider classes
     */
    @FFDCIgnore(Exception.class)
    private void logProviderInfo(String providerName, ClassLoader loader) {
        try {
            if (PROVIDER_ECLIPSELINK.equals(providerName)) {
                Class<?> Version = loadClass(loader, "org.eclipse.persistence.Version");
                String version = (String) Version.getMethod("getVersionString").invoke(Version.newInstance());
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "EclipseLink", version);
            } else if (PROVIDER_HIBERNATE.equals(providerName)) {
                Class<?> Version = loadClass(loader, "org.hibernate.Version");
                String version = (String) Version.getMethod("getVersionString").invoke(null);
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "Hibernate", version);
            } else if (PROVIDER_OPENJPA.equals(providerName)) {
                // OpenJPAVersion.appendOpenJPABanner(sb): OpenJPA #.#.#\n version id: openjpa-#.#.#-r# \n Apache svn revision: #
                StringBuilder version = new StringBuilder();
                Class<?> OpenJPAVersion = loadClass(loader, "org.apache.openjpa.conf.OpenJPAVersion");
                OpenJPAVersion.getMethod("appendOpenJPABanner", StringBuilder.class).invoke(OpenJPAVersion.newInstance(), version);
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "OpenJPA", version);
            } else {
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);
            }
        } catch (Exception x) {
            Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(this, tc, "unable to determine provider info", x);
        }
    }

    @FFDCIgnore(PrivilegedActionException.class)
    private static Class<?> loadClass(final ClassLoader cl, final String className) throws ClassNotFoundException {
        if (System.getSecurityManager() == null)
            return cl.loadClass(className);
        else
            try {
                return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {

                    @Override
                    public Class<?> run() throws ClassNotFoundException {
                        return cl.loadClass(className);
                    }
                });
            } catch (PrivilegedActionException e) {
                if (e.getCause() instanceof ClassNotFoundException)
                    throw (ClassNotFoundException) e.getCause();
                else
                    throw new RuntimeException(e);
            }
    }

    @Override
    public void moduleStarting(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStarted(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStopping(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStopped(ModuleInfo moduleInfo) {
    }

    /**
     * @see com.ibm.ws.jpa.JPAProviderIntegration#supportsEntityManagerPooling()
     */
    @Override
    public boolean supportsEntityManagerPooling() {
        return false;
    }

    /**
     * @see com.ibm.ws.jpa.JPAProvider#addIntegrationProperties(java.util.Properties)
     */
    @FFDCIgnore(ClassNotFoundException.class)
    @Override
    public void updatePersistenceProviderIntegrationProperties(PersistenceUnitInfo puInfo, java.util.Map<String, Object> props) {
        String providerName = puInfo.getPersistenceProviderClassName();
        if (PROVIDER_ECLIPSELINK.equals(providerName)) {
            props.put("eclipselink.target-server", "WebSphere_Liberty");
            if (puInfo instanceof com.ibm.ws.jpa.management.JPAPUnitInfo) {
                props.put("eclipselink.application-id", ((com.ibm.ws.jpa.management.JPAPUnitInfo) puInfo).getApplName());
            }
            Properties properties = puInfo.getProperties();
            /*
             * Section 4.8.5 of the JPA Specification:
             * If SUM, AVG, MAX, or MIN is used, and there are no values
             * to which the aggregate function can be applied, the result of
             * the aggregate function is NULL.
             *
             * Set this property to so that EclipseLink does not return null by default
             *
             * JPA 3.0: Do not force this override with JPA 3.0 and later.
             */
            if (!properties.containsKey("eclipselink.allow-null-max-min") && JPAAccessor.getJPAComponent().getJPAVersion().lesserThan(JPAVersion.JPA30)) {
                props.put("eclipselink.allow-null-max-min", "false");
            }
            /*
             * EclipseLink Bug 567891: Case expressions that should return boolean instead
             * return integer values. The JPA spec is too vague to change this, so we set this
             * property to be safe for customers.
             *
             * Set this property to `false` so that EclipseLink will return the same integer
             * value it has always returned for CASE expressions and not change behavior
             *
             * NOTE: This property is applicable for JPA 21 & JPA 22. JPAVersion > JPA22 has changed
             * behavior by default
             */
            if (!properties.containsKey("eclipselink.sql.allow-convert-result-to-boolean") && JPAAccessor.getJPAComponent().getJPAVersion().equals(JPAVersion.JPA22)) {
                props.put("eclipselink.sql.allow-convert-result-to-boolean", "false");
            }
            // The property is named differently for EclipseLink 2.6
            if (!properties.containsKey("eclipselink.allow-result-type-conversion") && JPAAccessor.getJPAComponent().getJPAVersion().equals(JPAVersion.JPA21)) {
                props.put("eclipselink.allow-result-type-conversion", "false");
            }
        } else if (PROVIDER_HIBERNATE.equals(providerName)) {
            // Hibernate had vastly outdated built-in knowledge of WebSphere API, until version 5.2.13+ and 5.3+.
            // If the version of Hibernate has the Liberty JtaPlatform, use it
            // otherwise, tell Hibernate to use a proxy implementation of JtaPlatform that we will provide based on the WAS transaction manager
            ClassLoader loader = puInfo.getClassLoader();
            if (isWebSphereLibertyJtaPlatformAvailable(loader)) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(this, tc, "Detected WebSphereLibertyJtaPlatform, not applying dynamic proxy JtaPlatform.");
            } else {
                try {
                    Class<?> JtaPlatform = loadClass(loader, "org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform");
                    Object libertyJtaPlatform = Proxy.newProxyInstance(loader, new Class[] { JtaPlatform }, new LibertyJtaPlatform());
                    props.put("hibernate.transaction.jta.platform", libertyJtaPlatform);
                } catch (ClassNotFoundException x) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        Tr.debug(this, tc, "Unable to provide JtaPlatform for Liberty TransactionManager to Hibernate", x);
                }
            }
        }
        // Log third party provider name and version info once per provider
        if (providersUsed.add(providerName))
            logProviderInfo(providerName, puInfo.getClassLoader());
    }

    /**
     * @see com.ibm.ws.jpa.JPAProvider#modifyPersistenceUnitProperties(java.lang.String, java.util.Properties)
     */
    @Override
    public void updatePersistenceUnitProperties(String providerClassName, Properties props)

    /**
     * As of Hibernate 5.2.13+ and 5.3+ built-in knowledge of Liberty's transaction integration was delivered as:
     * org.hibernate.engine.transaction.jta.platform.internal.WebSphereLibertyJtaPlatform
     * If this class is available, we do not need to set our dynamic proxy instance.
     */
    @FFDCIgnore(ClassNotFoundException.class)
    private boolean isWebSphereLibertyJtaPlatformAvailable(ClassLoader loader) {
        try {
            loadClass(loader, "org.hibernate.engine.transaction.jta.platform.internal.WebSphereLibertyJtaPlatform");
            return true;
        } catch (ClassNotFoundException notFound) {
            return false;
        }
    }
}


/**
 * ****************************************************************************
 *
 *  Contributors:
 *      IBM Corporation - initial API and implementation
 * *****************************************************************************
 */
package com.ibm.ws.jpa;

import static com.ibm.ws.jpa.management.JPAConstants.JPA_RESOURCE_BUNDLE_NAME;
import static com.ibm.ws.jpa.management.JPAConstants.JPA_TRACE_GROUP;
import java.lang.reflect.Proxy;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;
import java.util.concurrent.ConcurrentSkipListSet;
import javax.persistence.spi.PersistenceUnitInfo;
import com.ibm.websphere.ras.Tr;
import com.ibm.websphere.ras.TraceComponent;
import com.ibm.ws.container.service.app.deploy.ModuleInfo;
import com.ibm.ws.ffdc.annotation.FFDCIgnore;
import com.ibm.ws.jpa.hibernate.LibertyJtaPlatform;

/**
 * Common JPAProviderIntegration implementation that provides general integration required for known
 * JPA providers.
 */
public abstract class AbstractJPAProviderIntegration implements JPAProviderIntegration {

    private static final TraceComponent tc = Tr.register(AbstractJPAProviderIntegration.class, JPA_TRACE_GROUP, JPA_RESOURCE_BUNDLE_NAME);

    // Known JPA provider implementation classes
    protected static final String PROVIDER_ECLIPSELINK = "org.eclipse.persistence.jpa.PersistenceProvider";

    protected static final String PROVIDER_HIBERNATE = "org.hibernate.jpa.HibernatePersistenceProvider";

    protected static final String PROVIDER_OPENJPA = "org.apache.openjpa.persistence.PersistenceProviderImpl";

    /**
     * As persistence providers are first used, they are added to this list so that version information is only logged once for them.
     */
    protected final ConcurrentSkipListSet<String> providersUsed = new ConcurrentSkipListSet<String>();

    /**
     * @see com.ibm.ws.jpa.JPAProviderIntegration#disablePersistenceUnitLogging(java.util.Map)
     */
    @Override
    public void disablePersistenceUnitLogging(Map<String, Object> integrationProperties) {
        integrationProperties.put("eclipselink.logging.level", "OFF");
        // Since we're disabling logging, we don't want this to conflict with other normally configured PUs. Give it a random
        // session-name such that when/if another EMF is created for this PU the EclipseLink JPAInitializer cache
        // value of PersistenceUnitProperties.SESSION_NAME
        integrationProperties.// value of PersistenceUnitProperties.SESSION_NAME
        put(// value of PersistenceUnitProperties.SESSION_NAME
        "eclipselink.session-name", "disabled-logging-pu" + UUID.randomUUID().toString());
    }

    /**
     * Log version information about the specified persistence provider, if it can be determined.
     *
     * @param providerName fully qualified class name of JPA persistence provider
     * @param loader       class loader with access to the JPA provider classes
     */
    @FFDCIgnore(Exception.class)
    private void logProviderInfo(String providerName, ClassLoader loader) {

        try {
            if (PROVIDER_ECLIPSELINK.equals(providerName)) {
                Class<?> Version = loadClass(loader, "org.eclipse.persistence.Version");
                String version = (String) Version.getMethod("getVersionString").invoke(Version.newInstance());
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "EclipseLink", version);
            } else if (PROVIDER_HIBERNATE.equals(providerName)) {
                Class<?> Version = loadClass(loader, "org.hibernate.Version");
                String version = (String) Version.getMethod("getVersionString").invoke(null);
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "Hibernate", version);
            } else if (PROVIDER_OPENJPA.equals(providerName)) {
                // OpenJPAVersion.appendOpenJPABanner(sb): OpenJPA #.#.#\n version id: openjpa-#.#.#-r# \n Apache svn revision: #
                StringBuilder version = new StringBuilder();
                Class<?> OpenJPAVersion = loadClass(loader, "org.apache.openjpa.conf.OpenJPAVersion");
                OpenJPAVersion.getMethod("appendOpenJPABanner", StringBuilder.class).invoke(OpenJPAVersion.newInstance(), version);
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "OpenJPA", version);
            } else {
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);
            }
        } catch (Exception x) {
            Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(this, tc, "unable to determine provider info", x);
        }
    }

    @FFDCIgnore(PrivilegedActionException.class)
    private static Class<?> loadClass(final ClassLoader cl, final String className) throws ClassNotFoundException {
        if (System.getSecurityManager() == null)
            return cl.loadClass(className);
        else
            try {
                return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {

                    @Override
                    public Class<?> run() throws ClassNotFoundException {
                        return cl.loadClass(className);
                    }
                });
            } catch (PrivilegedActionException e) {
                if (e.getCause() instanceof ClassNotFoundException)
                    throw (ClassNotFoundException) e.getCause();
                else
                    throw new RuntimeException(e);
            }
    }

    @Override
    public void moduleStarting(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStarted(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStopping(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStopped(ModuleInfo moduleInfo) {
    }

    /**
     * @see com.ibm.ws.jpa.JPAProviderIntegration#supportsEntityManagerPooling()
     */
    @Override
    public boolean supportsEntityManagerPooling() {
        return false;
    }

    /**
     * @see com.ibm.ws.jpa.JPAProvider#addIntegrationProperties(java.util.Properties)
     */
    @FFDCIgnore(ClassNotFoundException.class)
    @Override
    public void updatePersistenceProviderIntegrationProperties(PersistenceUnitInfo puInfo, java.util.Map<String, Object> props) {
        String providerName = puInfo.getPersistenceProviderClassName();
        if (PROVIDER_ECLIPSELINK.equals(providerName)) {
            props.put("eclipselink.target-server", "WebSphere_Liberty");
            if (puInfo instanceof com.ibm.ws.jpa.management.JPAPUnitInfo) {
                props.put("eclipselink.application-id", ((com.ibm.ws.jpa.management.JPAPUnitInfo) puInfo).getApplName());
            }
            Properties properties = puInfo.getProperties();
            /*
             * Section 4.8.5 of the JPA Specification:
             * If SUM, AVG, MAX, or MIN is used, and there are no values
             * to which the aggregate function can be applied, the result of
             * the aggregate function is NULL.
             *
             * Set this property to so that EclipseLink does not return null by default
             *
             * JPA 3.0: Do not force this override with JPA 3.0 and later.
             */
            if (!properties.containsKey("eclipselink.allow-null-max-min") && JPAAccessor.getJPAComponent().getJPAVersion().lesserThan(JPAVersion.JPA30)) {
                props.put("eclipselink.allow-null-max-min", "false");
            }
            /*
             * EclipseLink Bug 567891: Case expressions that should return boolean instead
             * return integer values. The JPA spec is too vague to change this, so we set this
             * property to be safe for customers.
             *
             * Set this property to `false` so that EclipseLink will return the same integer
             * value it has always returned for CASE expressions and not change behavior
             *
             * NOTE: This property is applicable for JPA 21 & JPA 22. JPAVersion > JPA22 has changed
             * behavior by default
             */
            if (!properties.containsKey("eclipselink.sql.allow-convert-result-to-boolean") && JPAAccessor.getJPAComponent().getJPAVersion().equals(JPAVersion.JPA22)) {
                props.put("eclipselink.sql.allow-convert-result-to-boolean", "false");
            }
            // The property is named differently for EclipseLink 2.6
            if (!properties.containsKey("eclipselink.allow-result-type-conversion") && JPAAccessor.getJPAComponent().getJPAVersion().equals(JPAVersion.JPA21)) {
                props.put("eclipselink.allow-result-type-conversion", "false");
            }
        } else if (PROVIDER_HIBERNATE.equals(providerName)) {
            // Hibernate had vastly outdated built-in knowledge of WebSphere API, until version 5.2.13+ and 5.3+.
            // If the version of Hibernate has the Liberty JtaPlatform, use it
            // otherwise, tell Hibernate to use a proxy implementation of JtaPlatform that we will provide based on the WAS transaction manager
            ClassLoader loader = puInfo.getClassLoader();
            if (isWebSphereLibertyJtaPlatformAvailable(loader)) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(this, tc, "Detected WebSphereLibertyJtaPlatform, not applying dynamic proxy JtaPlatform.");
            } else {
                try {
                    Class<?> JtaPlatform = loadClass(loader, "org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform");
                    Object libertyJtaPlatform = Proxy.newProxyInstance(loader, new Class[] { JtaPlatform }, new LibertyJtaPlatform());
                    props.put("hibernate.transaction.jta.platform", libertyJtaPlatform);
                } catch (ClassNotFoundException x) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        Tr.debug(this, tc, "Unable to provide JtaPlatform for Liberty TransactionManager to Hibernate", x);
                }
            }
        }
        // Log third party provider name and version info once per provider
        if (providersUsed.add(providerName))
            logProviderInfo(providerName, puInfo.getClassLoader());
    }

    /**
     * @see com.ibm.ws.jpa.JPAProvider#modifyPersistenceUnitProperties(java.lang.String, java.util.Properties)
     */
    @Override
    public void updatePersistenceUnitProperties(String providerClassName, Properties props) {
    }

    /**
     * As of Hibernate 5.2.13+ and 5.3+ built-in knowledge of Liberty's transaction integration was delivered as:
     * org.hibernate.engine.transaction.jta.platform.internal.WebSphereLibertyJtaPlatform
     * If this class is available, we do not need to set our dynamic proxy instance.
     */
    @FFDCIgnore(ClassNotFoundException.class)
    private boolean isWebSphereLibertyJtaPlatformAvailable(ClassLoader loader) {
        try {
            loadClass(loader, "org.hibernate.engine.transaction.jta.platform.internal.WebSphereLibertyJtaPlatform");
            return true;
        } catch (ClassNotFoundException notFound) {
            return false;
        }
    }
}


try {
            if (PROVIDER_ECLIPSELINK.equals(providerName)) {
                Class<?> Version = loadClass(loader, "org.eclipse.persistence.Version");
                String version = (String) Version.getMethod("getVersionString").invoke(Version.newInstance());
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "EclipseLink", version);
            } else if (PROVIDER_HIBERNATE.equals(providerName)) {
                Class<?> Version = loadClass(loader, "org.hibernate.Version");
                String version = (String) Version.getMethod("getVersionString").invoke(null);
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "Hibernate", version);
            } else if (PROVIDER_OPENJPA.equals(providerName)) {
                // OpenJPAVersion.appendOpenJPABanner(sb): OpenJPA #.#.#\n version id: openjpa-#.#.#-r# \n Apache svn revision: #
                StringBuilder version = new StringBuilder();
                Class<?> OpenJPAVersion = loadClass(loader, "org.apache.openjpa.conf.OpenJPAVersion");
                OpenJPAVersion.getMethod("appendOpenJPABanner", StringBuilder.class).invoke(OpenJPAVersion.newInstance(), version);
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "OpenJPA", version);
            } else {
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);
            }
        } catch (Exception x) {
            Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(this, tc, "unable to determine provider info", x);
        }

    }

    @FFDCIgnore(PrivilegedActionException.class)
    private static Class<?> loadClass(final ClassLoader cl, final String className) throws ClassNotFoundException {
        if (System.getSecurityManager() == null)
            return cl.loadClass(className);
        else
            try {
                return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {

                    @Override
                    public Class<?> run() throws ClassNotFoundException {
                        return cl.loadClass(className);
                    }
                });
            } catch (PrivilegedActionException e) {
                if (e.getCause() instanceof ClassNotFoundException)
                    throw (ClassNotFoundException) e.getCause();
                else
                    throw new RuntimeException(e);
            }
    }

    @Override
    public void moduleStarting(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStarted(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStopping(ModuleInfo moduleInfo) {
    }

    @Override
    public void moduleStopped(ModuleInfo moduleInfo) {
    }

    /**
     * @see com.ibm.ws.jpa.JPAProviderIntegration#supportsEntityManagerPooling()
     */
    @Override
    public boolean supportsEntityManagerPooling() {
        return false;
    }

    /**
     * @see com.ibm.ws.jpa.JPAProvider#addIntegrationProperties(java.util.Properties)
     */
    @FFDCIgnore(ClassNotFoundException.class)
    @Override
    public void updatePersistenceProviderIntegrationProperties(PersistenceUnitInfo puInfo, java.util.Map<String, Object> props) {
        String providerName = puInfo.getPersistenceProviderClassName();
        if (PROVIDER_ECLIPSELINK.equals(providerName)) {
            props.put("eclipselink.target-server", "WebSphere_Liberty");
            if (puInfo instanceof com.ibm.ws.jpa.management.JPAPUnitInfo) {
                props.put("eclipselink.application-id", ((com.ibm.ws.jpa.management.JPAPUnitInfo) puInfo).getApplName());
            }
            Properties properties = puInfo.getProperties();
            /*
             * Section 4.8.5 of the JPA Specification:
             * If SUM, AVG, MAX, or MIN is used, and there are no values
             * to which the aggregate function can be applied, the result of
             * the aggregate function is NULL.
             *
             * Set this property to so that EclipseLink does not return null by default
             *
             * JPA 3.0: Do not force this override with JPA 3.0 and later.
             */
            if (!properties.containsKey("eclipselink.allow-null-max-min") && JPAAccessor.getJPAComponent().getJPAVersion().lesserThan(JPAVersion.JPA30)) {
                props.put("eclipselink.allow-null-max-min", "false");
            }
            /*
             * EclipseLink Bug 567891: Case expressions that should return boolean instead
             * return integer values. The JPA spec is too vague to change this, so we set this
             * property to be safe for customers.
             *
             * Set this property to `false` so that EclipseLink will return the same integer
             * value it has always returned for CASE expressions and not change behavior
             *
             * NOTE: This property is applicable for JPA 21 & JPA 22. JPAVersion > JPA22 has changed
             * behavior by default
             */
            if (!properties.containsKey("eclipselink.sql.allow-convert-result-to-boolean") && JPAAccessor.getJPAComponent().getJPAVersion().equals(JPAVersion.JPA22)) {
                props.put("eclipselink.sql.allow-convert-result-to-boolean", "false");
            }
            // The property is named differently for EclipseLink 2.6
            if (!properties.containsKey("eclipselink.allow-result-type-conversion") && JPAAccessor.getJPAComponent().getJPAVersion().equals(JPAVersion.JPA21)) {
                props.put("eclipselink.allow-result-type-conversion", "false");
            }
        } else if (PROVIDER_HIBERNATE.equals(providerName)) {
            // Hibernate had vastly outdated built-in knowledge of WebSphere API, until version 5.2.13+ and 5.3+.
            // If the version of Hibernate has the Liberty JtaPlatform, use it
            // otherwise, tell Hibernate to use a proxy implementation of JtaPlatform that we will provide based on the WAS transaction manager
            ClassLoader loader = puInfo.getClassLoader();
            if (isWebSphereLibertyJtaPlatformAvailable(loader)) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(this, tc, "Detected WebSphereLibertyJtaPlatform, not applying dynamic proxy JtaPlatform.");
            } else {
                try {
                    Class<?> JtaPlatform = loadClass(loader, "org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform");
                    Object libertyJtaPlatform = Proxy.newProxyInstance(loader, new Class[] { JtaPlatform }, new LibertyJtaPlatform());
                    props.put("hibernate.transaction.jta.platform", libertyJtaPlatform);
                } catch (ClassNotFoundException x) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        Tr.debug(this, tc, "Unable to provide JtaPlatform for Liberty TransactionManager to Hibernate", x);
                }
            }
        }
        // Log third party provider name and version info once per provider
        if (providersUsed.add(providerName))
            logProviderInfo(providerName, puInfo.getClassLoader());
    }

    /**
     * @see com.ibm.ws.jpa.JPAProvider#modifyPersistenceUnitProperties(java.lang.String, java.util.Properties)
     */
    @Override
    public void updatePersistenceUnitProperties(String providerClassName, Properties props) {
    }

    /**
     * As of Hibernate 5.2.13+ and 5.3+ built-in knowledge of Liberty's transaction integration was delivered as:
     * org.hibernate.engine.transaction.jta.platform.internal.WebSphereLibertyJtaPlatform
     * If this class is available, we do not need to set our dynamic proxy instance.
     */
    @FFDCIgnore(ClassNotFoundException.class)
    private boolean isWebSphereLibertyJtaPlatformAvailable(ClassLoader loader) {
        try {
            loadClass(loader, "org.hibernate.engine.transaction.jta.platform.internal.WebSphereLibertyJtaPlatform");
            return true;
        } catch (ClassNotFoundException notFound) {
            return false;
        }
    }
}