Program: 51466
Project: 51466
Buggy source:
public String getEnvironmentProperty(final String key){
  if (key == null) {
    throw new NullPointerException();
  }
  if ("String_Node_Str".equals(key)) {
    return clText;
  }
  if (cache == null) {
    cache=new HashMap<String,String>();
  }
  final String cached=cache.get(key);
  if (cached != null) {
    return cached;
  }
  final IPentahoSession session=PentahoSessionHolder.getSession();
  if (PentahoSystem.getApplicationContext() != null) {
    final String fullyQualifiedServerUrl=PentahoSystem.getApplicationContext().getFullyQualifiedServerURL();
    if ("String_Node_Str".equals(key)) {
      final String baseServerURL=getBaseServerURL(fullyQualifiedServerUrl);
      cache.put(key,baseServerURL);
      return baseServerURL;
    }
 else     if ("String_Node_Str".equals(key)) {
      cache.put(key,fullyQualifiedServerUrl);
      return fullyQualifiedServerUrl;
    }
 else     if ("String_Node_Str".equals(key)) {
      final String solutionRoot=PentahoSystem.getApplicationContext().getSolutionPath("String_Node_Str");
      cache.put(key,solutionRoot);
      return solutionRoot;
    }
 else     if ("String_Node_Str".equals(key)) {
      final String hostColonPort=getHostColonPort(fullyQualifiedServerUrl);
      cache.put(key,hostColonPort);
      return hostColonPort;
    }
 else     if ("String_Node_Str".equals(key)) {
      final String requestContextPath=PentahoRequestContextHolder.getRequestContext().getContextPath();
      cache.put(key,requestContextPath);
    }
  }
 else {
    if ("String_Node_Str".equals(key) || "String_Node_Str".equals(key) || "String_Node_Str".equals(key)|| "String_Node_Str".equals(key)|| "String_Node_Str".equals(key)) {
      logger.warn(Messages.getInstance().getString("String_Node_Str"));
      cache.put(key,null);
      return null;
    }
  }
  if (session != null) {
    if ("String_Node_Str".equals(key)) {
      final Authentication authentication=SecurityHelper.getAuthentication(session,true);
      final String userName=authentication.getName();
      cache.put(key,userName);
      return userName;
    }
 else     if ("String_Node_Str".equals(key)) {
      final Authentication authentication=SecurityHelper.getAuthentication(session,true);
      final StringBuilder property=new StringBuilder();
      final GrantedAuthority[] roles=authentication.getAuthorities();
      if (roles == null) {
        return null;
      }
      final int rolesSize=roles.length;
      final CSVQuoter quoter=new CSVQuoter(',','"');
      for (int i=0; i < rolesSize; i++) {
        if (i != 0) {
          property.append("String_Node_Str");
        }
        property.append(quoter.doQuoting(roles[i].getAuthority()));
      }
      return property.toString();
    }
    if (key.startsWith("String_Node_Str")) {
      final Object attribute=session.getAttribute(key.substring("String_Node_Str".length()));
      return String.valueOf(attribute);
    }
 else     if (key.startsWith("String_Node_Str")) {
      final Object attribute=PentahoSystem.getGlobalParameters().getParameter(key.substring("String_Node_Str".length()));
      return String.valueOf(attribute);
    }
  }
 else {
    if (key.startsWith("String_Node_Str") || key.equals("String_Node_Str") || key.startsWith("String_Node_Str")|| key.equals("String_Node_Str")) {
      logger.warn(Messages.getInstance().getString("String_Node_Str"));
      return null;
    }
  }
  final Object environmentProperty=super.getEnvironmentProperty(key);
  if (environmentProperty == null) {
    return null;
  }
  return String.valueOf(environmentProperty);
}

Fixed version (ground truth):
public String getEnvironmentProperty(final String key){
  if (key == null) {
    throw new NullPointerException();
  }
  if ("String_Node_Str".equals(key)) {
    return clText;
  }
  if (cache == null) {
    cache=new HashMap<String,String>();
  }
  final String cached=cache.get(key);
  if (cached != null) {
    return cached;
  }
  final IPentahoSession session=PentahoSessionHolder.getSession();
  if (PentahoSystem.getApplicationContext() != null) {
    final String fullyQualifiedServerUrl=PentahoSystem.getApplicationContext().getFullyQualifiedServerURL();
    if ("String_Node_Str".equals(key)) {
      final String baseServerURL=getBaseServerURL(fullyQualifiedServerUrl);
      cache.put(key,baseServerURL);
      return baseServerURL;
    }
 else     if ("String_Node_Str".equals(key)) {
      cache.put(key,fullyQualifiedServerUrl);
      return fullyQualifiedServerUrl;
    }
 else     if ("String_Node_Str".equals(key)) {
      final String solutionRoot=PentahoSystem.getApplicationContext().getSolutionPath("String_Node_Str");
      cache.put(key,solutionRoot);
      return solutionRoot;
    }
 else     if ("String_Node_Str".equals(key)) {
      final String hostColonPort=getHostColonPort(fullyQualifiedServerUrl);
      cache.put(key,hostColonPort);
      return hostColonPort;
    }
 else     if ("String_Node_Str".equals(key)) {
      final String requestContextPath=PentahoRequestContextHolder.getRequestContext().getContextPath();
      cache.put(key,requestContextPath);
    }
  }
 else {
    if ("String_Node_Str".equals(key) || "String_Node_Str".equals(key) || "String_Node_Str".equals(key)|| "String_Node_Str".equals(key)|| "String_Node_Str".equals(key)) {
      logger.warn(Messages.getInstance().getString("String_Node_Str"));
      cache.put(key,null);
      return null;
    }
  }
  if (session != null) {
    if ("String_Node_Str".equals(key)) {
      final Authentication authentication=SecurityHelper.getAuthentication();
      final String userName=authentication.getName();
      cache.put(key,userName);
      return userName;
    }
 else     if ("String_Node_Str".equals(key)) {
      final Authentication authentication=SecurityHelper.getAuthentication();
      final StringBuilder property=new StringBuilder();
      final GrantedAuthority[] roles=authentication.getAuthorities();
      if (roles == null) {
        return null;
      }
      final int rolesSize=roles.length;
      final CSVQuoter quoter=new CSVQuoter(',','"');
      for (int i=0; i < rolesSize; i++) {
        if (i != 0) {
          property.append("String_Node_Str");
        }
        property.append(quoter.doQuoting(roles[i].getAuthority()));
      }
      return property.toString();
    }
    if (key.startsWith("String_Node_Str")) {
      final Object attribute=session.getAttribute(key.substring("String_Node_Str".length()));
      return String.valueOf(attribute);
    }
 else     if (key.startsWith("String_Node_Str")) {
      final Object attribute=PentahoSystem.getGlobalParameters().getParameter(key.substring("String_Node_Str".length()));
      return String.valueOf(attribute);
    }
  }
 else {
    if (key.startsWith("String_Node_Str") || key.equals("String_Node_Str") || key.startsWith("String_Node_Str")|| key.equals("String_Node_Str")) {
      logger.warn(Messages.getInstance().getString("String_Node_Str"));
      return null;
    }
  }
  final Object environmentProperty=super.getEnvironmentProperty(key);
  if (environmentProperty == null) {
    return null;
  }
  return String.valueOf(environmentProperty);
}