/*
 * Copyright (c) 2014 Noveo Group
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * Except as contained in this notice, the name(s) of the above copyright holders
 * shall not be used in advertising or otherwise to promote the sale, use or
 * other dealings in this Software without prior written authorization.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.noveogroup.clap.api;

public class BuildConfigHelper {

    public static final String FIELD_CLAP_PROJECT_ID = "CLAP_PROJECT_ID";
    public static final String FIELD_CLAP_SERVER_URL = "CLAP_SERVER_URL";
    public static final String FIELD_CLAP_USERNAME = "CLAP_USERNAME";
    public static final String FIELD_CLAP_PASSWORD = "CLAP_PASSWORD";

}

@@ -1378,16 +1378,97 @@
 p.api;%0A%0A
+import java.lang.reflect.Field;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A
 public c
@@ -1782,10 +1782,916 @@
 WORD%22;%0A%0A
+    private static final Map%3CString, String%3E FIELD_CACHE = new HashMap%3C%3E();%0A%0A    private static String getValue(String packageName, String fieldName) %7B%0A        String buildConfigClassName = packageName + %22.BuildConfig%22;%0A        try %7B%0A            Class%3C?%3E buildConfigClass = Class.forName(buildConfigClassName);%0A            Field field = buildConfigClass.getField(fieldName);%0A            return (String) field.get(null);%0A        %7D catch (Exception e) %7B%0A            throw new RuntimeException(%22wrong %22 + buildConfigClassName, e);%0A        %7D%0A    %7D%0A%0A    public static synchronized String get(String packageName, String fieldName) %7B%0A        String key = String.format(%22%25s$%25s%22, packageName, fieldName);%0A%0A        String value = FIELD_CACHE.get(key);%0A        if (value == null) %7B%0A            value = getValue(packageName, fieldName);%0A            FIELD_CACHE.put(key, value);%0A        %7D%0A%0A        return value;%0A    %7D%0A%0A
 %7D%0A

improve BuildConfigHelper