Skip to content

Commit

Permalink
Fixed option renaming issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudenw committed May 29, 2024
1 parent 8c0f498 commit 7b10d0b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ public void setAddLicenseHeaders(String addLicenseHeaders) {
// do nothing;
break;
case "TRUE":
setAddlicense(true);
setAddLicense(true);
break;
case "FORCED":
setAddlicense(true);
setAddLicense(true);
setForce(true);
default:
throw new IllegalArgumentException("Unknown addlicense header: " + addLicenseHeaders);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ public void setCopyrightMessage(String copyrightMessage) {
public void setAddLicenseHeaders(AddLicenseHeaders setting) {
switch (setting.getNative()) {
case TRUE:
setAddlicense(true);
setAddLicense(true);
break;
case FALSE:
setAddlicense(false);
setAddLicense(false);
break;
case FORCED:
setAddlicense(true);
setAddLicense(true);
setForce(true);
break;
}
Expand Down
18 changes: 18 additions & 0 deletions apache-rat-tools/src/main/java/org/apache/rat/tools/AntOption.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.rat.tools;

import org.apache.commons.cli.Option;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.rat.tools;

import org.apache.commons.cli.Option;
Expand Down Expand Up @@ -79,7 +97,7 @@ public String getMethodSignature(String indent) {
if (isDeprecated()) {
sb.append(format("%s@Deprecated%n", indent));
}
return sb.append(format("%1$s@Parameter(property = \"rat.%2$s\")%n%1$spublic void set%3$s(%3$s %2$s)",
return sb.append(format("%1$s@Parameter(property = \"rat.%2$s\")%n%1$spublic void set%3$s(%4$s %2$s)",
indent, name, WordUtils.capitalize(name), option.hasArg() ? "String" : "boolean"))
.toString();
}
Expand Down

0 comments on commit 7b10d0b

Please sign in to comment.