From 92fbb8fab983c4e181ca3f82ba9468a5449fc8a1 Mon Sep 17 00:00:00 2001 From: Brian Atkinson Date: Wed, 2 Feb 2011 18:56:27 -0600 Subject: [PATCH] Fix CLRF --- .../main/java/hudson/util/ComboBoxModel.java | 138 +++++++++--------- .../MetaTabulatedResult/body_de.properties | 16 +- .../columnHeader_zh_CN.properties | 2 +- test/src/test/java/lib/form/NameRefTest.java | 106 +++++++------- 4 files changed, 131 insertions(+), 131 deletions(-) diff --git a/core/src/main/java/hudson/util/ComboBoxModel.java b/core/src/main/java/hudson/util/ComboBoxModel.java index 6bcbc86d3f..cfbb351f6c 100644 --- a/core/src/main/java/hudson/util/ComboBoxModel.java +++ b/core/src/main/java/hudson/util/ComboBoxModel.java @@ -1,69 +1,69 @@ -/* - * The MIT License - * - * Copyright (c) 2004-2009, CollabNet - * - * 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. - * - * 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 hudson.util; - -import net.sf.json.JSONArray; -import org.kohsuke.stapler.HttpResponse; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; -import org.kohsuke.stapler.export.Flavor; - -import javax.servlet.ServletException; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; - -import static java.util.Arrays.asList; - -/** - * Model object for dynamically filed combo box, which is really just {@code ArrayList} - * - * @author Kohsuke Kawaguchi - */ -public class ComboBoxModel extends ArrayList implements HttpResponse { - public ComboBoxModel(int initialCapacity) { - super(initialCapacity); - } - - public ComboBoxModel() { - } - - public ComboBoxModel(Collection c) { - super(c); - } - - public ComboBoxModel(String... values) { - this(asList(values)); - } - - public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { - rsp.setContentType(Flavor.JSON.contentType); - PrintWriter w = rsp.getWriter(); - w.print('('); - JSONArray.fromObject(this).write(w); - w.print(')'); - } -} +/* + * The MIT License + * + * Copyright (c) 2004-2009, CollabNet + * + * 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. + * + * 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 hudson.util; + +import net.sf.json.JSONArray; +import org.kohsuke.stapler.HttpResponse; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.export.Flavor; + +import javax.servlet.ServletException; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; + +import static java.util.Arrays.asList; + +/** + * Model object for dynamically filed combo box, which is really just {@code ArrayList} + * + * @author Kohsuke Kawaguchi + */ +public class ComboBoxModel extends ArrayList implements HttpResponse { + public ComboBoxModel(int initialCapacity) { + super(initialCapacity); + } + + public ComboBoxModel() { + } + + public ComboBoxModel(Collection c) { + super(c); + } + + public ComboBoxModel(String... values) { + this(asList(values)); + } + + public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { + rsp.setContentType(Flavor.JSON.contentType); + PrintWriter w = rsp.getWriter(); + w.print('('); + JSONArray.fromObject(this).write(w); + w.print(')'); + } +} diff --git a/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body_de.properties b/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body_de.properties index f8f1ed06e1..ce77794f15 100644 --- a/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body_de.properties +++ b/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body_de.properties @@ -20,13 +20,13 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -All\ Failed\ Tests=Alle fehlgeschlagenen Tests -Test\ Name=Testname -Duration=Dauer -Age=Alter -All\ Tests=Alle Tests -Fail=Fehlgeschlagen -Skip=Übersprungen +All\ Failed\ Tests=Alle fehlgeschlagenen Tests +Test\ Name=Testname +Duration=Dauer +Age=Alter +All\ Tests=Alle Tests +Fail=Fehlgeschlagen +Skip=Übersprungen diff=Diff. Total=Summe -Loading...=Lade Daten... +Loading...=Lade Daten... diff --git a/core/src/main/resources/hudson/views/LastDurationColumn/columnHeader_zh_CN.properties b/core/src/main/resources/hudson/views/LastDurationColumn/columnHeader_zh_CN.properties index eacf5df075..ef6873d129 100644 --- a/core/src/main/resources/hudson/views/LastDurationColumn/columnHeader_zh_CN.properties +++ b/core/src/main/resources/hudson/views/LastDurationColumn/columnHeader_zh_CN.properties @@ -20,5 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Last\ Duration=\u4E0A\u6B21\u6301\u7EED\u65F6\u95F4 +Last\ Duration=\u4E0A\u6B21\u6301\u7EED\u65F6\u95F4 diff --git a/test/src/test/java/lib/form/NameRefTest.java b/test/src/test/java/lib/form/NameRefTest.java index ff2e0b9b1a..e20d04b036 100644 --- a/test/src/test/java/lib/form/NameRefTest.java +++ b/test/src/test/java/lib/form/NameRefTest.java @@ -1,53 +1,53 @@ -/* - * The MIT License - * - * Copyright (c) 2004-2010, CollabNet. - * - * 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. - * - * 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 lib.form; - -import com.gargoylesoftware.htmlunit.html.HtmlForm; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import hudson.util.FormValidation; -import net.sf.json.JSONObject; -import org.jvnet.hudson.test.HudsonTestCase; -import org.kohsuke.stapler.HttpResponse; -import org.kohsuke.stapler.HttpResponses; -import org.kohsuke.stapler.StaplerRequest; - -/** - * Tests the handling of @nameRef in the form tree. - * - * @author Kohsuke Kawaguchi - */ -public class NameRefTest extends HudsonTestCase { - public void test1() throws Exception { - hudson.setCrumbIssuer(null); - HtmlPage p = createWebClient().goTo("self/test1"); - submit(p.getFormByName("config")); - } - - public HttpResponse doSubmitTest1(StaplerRequest req) throws Exception { - JSONObject f = req.getSubmittedForm(); - System.out.println(f); - assertEquals("{\"foo\":{\"bar\":{\"zot\":\"zot\"}}}",f.toString()); - return HttpResponses.ok(); - } -} +/* + * The MIT License + * + * Copyright (c) 2004-2010, CollabNet. + * + * 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. + * + * 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 lib.form; + +import com.gargoylesoftware.htmlunit.html.HtmlForm; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import hudson.util.FormValidation; +import net.sf.json.JSONObject; +import org.jvnet.hudson.test.HudsonTestCase; +import org.kohsuke.stapler.HttpResponse; +import org.kohsuke.stapler.HttpResponses; +import org.kohsuke.stapler.StaplerRequest; + +/** + * Tests the handling of @nameRef in the form tree. + * + * @author Kohsuke Kawaguchi + */ +public class NameRefTest extends HudsonTestCase { + public void test1() throws Exception { + hudson.setCrumbIssuer(null); + HtmlPage p = createWebClient().goTo("self/test1"); + submit(p.getFormByName("config")); + } + + public HttpResponse doSubmitTest1(StaplerRequest req) throws Exception { + JSONObject f = req.getSubmittedForm(); + System.out.println(f); + assertEquals("{\"foo\":{\"bar\":{\"zot\":\"zot\"}}}",f.toString()); + return HttpResponses.ok(); + } +}