If there is no display name specified in the job's configuration, use the job's name.
authorJan Lahoda <jlahoda@netbeans.org>
Thu, 16 Dec 2010 23:09:00 +0100
changeset 50069445b855fd2
parent 499 9452058454f2
child 501 ec9c7955778a
If there is no display name specified in the job's configuration, use the job's name.
server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java
     1.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java	Wed Dec 15 19:27:30 2010 +0100
     1.2 +++ b/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java	Thu Dec 16 23:09:00 2010 +0100
     1.3 @@ -130,8 +130,14 @@
     1.4          String jsonContent = readFully(info);
     1.5          JSONObject json = JSONObject.fromObject(jsonContent);
     1.6  
     1.7 -        if (!projectName.equals(json.get("displayName"))) {
     1.8 -            json.put("displayName", projectName);
     1.9 +        String prjName = projectName;
    1.10 +
    1.11 +        if (prjName == null || prjName.isEmpty()) {
    1.12 +            prjName = build.getParent().getDisplayName();
    1.13 +        }
    1.14 +
    1.15 +        if (!prjName.equals(json.get("displayName"))) {
    1.16 +            json.put("displayName", prjName);
    1.17              write(info, JSONSerializer.toJSON(json).toString());
    1.18          }
    1.19