Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
[JENKINS-29900] Fixed regression in trend detail URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jun 4, 2016
1 parent b0f1a2c commit 06afb67
Showing 1 changed file with 10 additions and 7 deletions.
Expand Up @@ -34,7 +34,10 @@ public class GraphConfiguration {
private static final int DEFAULT_HEIGHT = 200;
private static final String DEFAULT_NAME = StringUtils.EMPTY;
private static final String DEFAULT_VALUE = StringUtils.EMPTY;
private static final BuildResultGraph DEFAULT_GRAPH = new PriorityGraph();

private static PriorityGraph createDefaultGraph() {
return new PriorityGraph();
}

/** Separator of cookie values. */
protected static final String SEPARATOR = "!";
Expand Down Expand Up @@ -75,7 +78,7 @@ public static GraphConfiguration createDeactivated() {
* @return a default configuration
*/
public static GraphConfiguration createDefault() {
return new GraphConfiguration(DEFAULT_GRAPH);
return new GraphConfiguration(createDefaultGraph());
}

/**
Expand Down Expand Up @@ -367,8 +370,8 @@ private boolean initializeFromJsonObject(final JSONObject value) {
if (StringUtils.isNotBlank(dayCountString)) {
dayCount = value.getInt("dayCountString");
}
String grapyTypeString = value.getString("graphType");
graphType = graphId2Graph.get(grapyTypeString);
String graphTypeString = value.getString("graphType");
graphType = graphId2Graph.get(graphTypeString);

useBuildDate = value.getBoolean("useBuildDateAsDomain");

Expand Down Expand Up @@ -498,7 +501,7 @@ private void reset() {
width = DEFAULT_WIDTH;
buildCount = DEFAULT_BUILD_COUNT;
dayCount = DEFAULT_DAY_COUNT;
graphType = DEFAULT_GRAPH;
graphType = createDefaultGraph();
useBuildDate = DEFAULT_USE_BUILD_DATE;
parameterName = DEFAULT_NAME;
parameterValue = DEFAULT_VALUE;
Expand Down Expand Up @@ -706,7 +709,7 @@ public String getParameterValue() {
public boolean isDefault() {
return width == DEFAULT_WIDTH
&& height == DEFAULT_HEIGHT
&& graphType == DEFAULT_GRAPH // NOPMD
&& graphType.getId() == createDefaultGraph().getId() // NOPMD
&& buildCount == DEFAULT_BUILD_COUNT
&& dayCount == DEFAULT_DAY_COUNT
&& useBuildDate == DEFAULT_USE_BUILD_DATE
Expand Down Expand Up @@ -753,7 +756,7 @@ public BuildResultGraph getGraph(final String graphId) {
return graphId2Graph.get(graphId);
}
else {
return DEFAULT_GRAPH;
return createDefaultGraph();
}
}

Expand Down

0 comments on commit 06afb67

Please sign in to comment.