Skip to content

Commit

Permalink
Fix up merge related compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rvesse committed Nov 28, 2023
1 parent a5ef2d5 commit 1c5bbdb
Show file tree
Hide file tree
Showing 27 changed files with 92 additions and 104 deletions.
10 changes: 5 additions & 5 deletions airline-core/src/main/java/com/github/rvesse/airline/Cli.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @deprecated Renamed to {@link CommandLineInterface} to avoid ambiguity with
* {@link com.github.rvesse.airline.annotations.Cli} annotation
*/
@Deprecated
@Deprecated(forRemoval = true)
public class Cli<C> extends CommandLineInterface<C> {

/**
Expand All @@ -45,7 +45,7 @@ public class Cli<C> extends CommandLineInterface<C> {
* with {@link com.github.rvesse.airline.annotations.Cli}
* annotation
*/
@Deprecated
@Deprecated(forRemoval = true)
public static <T> CliBuilder<T> builder(String name) {
if (name == null)
throw new NullPointerException("name cannot be null");
Expand All @@ -62,7 +62,7 @@ public static <T> CliBuilder<T> builder(String name) {
* with {@link com.github.rvesse.airline.annotations.Cli}
* annotation
*/
@Deprecated
@Deprecated(forRemoval = true)
public Cli(Class<?> cliClass) {
this(MetadataLoader.<C> loadGlobal(cliClass));
}
Expand All @@ -82,7 +82,7 @@ public Cli(Class<?> cliClass) {
* with {@link com.github.rvesse.airline.annotations.Cli}
* annotation
*/
@Deprecated
@Deprecated(forRemoval = true)
public Cli(Class<?> cliClass, ParserMetadata<C> parserConfig) {
this(MetadataLoader.<C> loadGlobal(cliClass, parserConfig));
}
Expand All @@ -96,7 +96,7 @@ public Cli(Class<?> cliClass, ParserMetadata<C> parserConfig) {
* with {@link com.github.rvesse.airline.annotations.Cli}
* annotation
*/
@Deprecated
@Deprecated(forRemoval = true)
public Cli(GlobalMetadata<C> metadata) {
super(metadata);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.List;

import com.github.rvesse.airline.CommandLineInterface;
import com.github.rvesse.airline.annotations.Arguments;
import com.github.rvesse.airline.annotations.Command;
import com.github.rvesse.airline.annotations.Option;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.github.rvesse.airline.tests;

import com.github.rvesse.airline.CommandLineInterface;
import com.github.rvesse.airline.tests.Git.Add;
import com.github.rvesse.airline.tests.Git.RemoteAdd;
import com.github.rvesse.airline.tests.Git.RemoteShow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.github.rvesse.airline.tests;

import com.github.rvesse.airline.CommandLineInterface;
import com.github.rvesse.airline.tests.Git.Add;
import com.github.rvesse.airline.tests.Git.RemoteAdd;
import com.github.rvesse.airline.tests.Git.RemoteShow;
Expand Down Expand Up @@ -47,7 +48,7 @@
public class GitWithCliAnnotation2 extends Git {

public static void run(String[] args) {
CommandLineInterface<Runnable> gitParser = new CommandLineInterface<Runnable>(
CommandLineInterface<Runnable> gitParser = new CommandLineInterface<>(
GitWithCliAnnotation2.class);

gitParser.parse(args).run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.github.rvesse.airline.tests;

import com.github.rvesse.airline.Cli;
import com.github.rvesse.airline.CommandLineInterface;
import org.testng.Assert;
import org.testng.annotations.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.List;

import com.github.rvesse.airline.Cli;
import com.github.rvesse.airline.CommandLineInterface;
import org.testng.Assert;
import org.testng.annotations.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.github.rvesse.airline.tests;

import com.github.rvesse.airline.Cli;
import com.github.rvesse.airline.CommandLineInterface;
import org.testng.annotations.Test;

import com.github.rvesse.airline.tests.TestGalaxyCommandLineParser.AgentAddCommand;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.github.rvesse.airline.tests;

import com.github.rvesse.airline.CommandLineInterface;
import org.apache.commons.lang3.StringUtils;
import org.testng.Assert;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -69,7 +70,7 @@ public void testParserConfigOverride2() {
gitOverridden(parserConfig, "remote", "sh");

// This returns help because the alias definition from the base config is overridden by the provided parser config
CommandLineInterface<Runnable> gitParser = new CommandLineInterface<Runnable>(
CommandLineInterface<Runnable> gitParser = new CommandLineInterface<>(
GitWithCliAnnotation2.class, parserConfig);
Runnable cmd = gitParser.parse("foo");
Assert.assertEquals(cmd.getClass(), Help.class);
Expand All @@ -83,7 +84,7 @@ private void git(String... args) {

private void git(ParserMetadata<Runnable> parserConfig, String... args) {
System.out.println("$ git " + StringUtils.join(args, ' '));
CommandLineInterface<Runnable> gitParser = new CommandLineInterface<Runnable>(
CommandLineInterface<Runnable> gitParser = new CommandLineInterface<>(
GitWithCliAnnotation.class, parserConfig);

gitParser.parse(args).run();
Expand All @@ -92,7 +93,7 @@ private void git(ParserMetadata<Runnable> parserConfig, String... args) {

private void gitOverridden(ParserMetadata<Runnable> parserConfig, String... args) {
System.out.println("$ git " + StringUtils.join(args, ' '));
CommandLineInterface<Runnable> gitParser = new CommandLineInterface<Runnable>(
CommandLineInterface<Runnable> gitParser = new CommandLineInterface<>(
GitWithCliAnnotation2.class, parserConfig);

gitParser.parse(args).run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.github.rvesse.airline.tests;

import com.github.rvesse.airline.Cli;
import com.github.rvesse.airline.CommandLineInterface;
import org.testng.Assert;
import org.testng.annotations.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.github.rvesse.airline.tests;

import com.github.rvesse.airline.Cli;
import com.github.rvesse.airline.CommandLineInterface;
import com.github.rvesse.airline.SingleCommand;
import com.github.rvesse.airline.annotations.*;
import com.github.rvesse.airline.builder.ParserBuilder;
Expand Down Expand Up @@ -64,10 +65,10 @@ public static class EmptyDelegate {

@Test
public void delegatingEmptyClassHasNoEffect() {
DelegatingEmptyClassHasNoEffect p = Cli.<DelegatingEmptyClassHasNoEffect>builder("foo")
.withCommand(DelegatingEmptyClassHasNoEffect.class)
.build()
.parse("command", "-a", "-b", "someValue");
DelegatingEmptyClassHasNoEffect p = CommandLineInterface.<DelegatingEmptyClassHasNoEffect>builder("foo")
.withCommand(DelegatingEmptyClassHasNoEffect.class)
.build()
.parse("command", "-a", "-b", "someValue");

assertTrue(p.isA);
assertEquals(p.bValue, "someValue");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void sub_groups_help_02() throws IOException {
public void sub_groups_help_02_without_help_command() throws IOException {
//@formatter:off
CliBuilder<Object> builder
= Cli.<Object>builder("test");
= CommandLineInterface.builder("test");
builder.withGroup("foo")
.withSubGroup("bar")
.withDefaultCommand(Help.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-22 the original author or authors.
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-22 the original author or authors.
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-22 the original author or authors.
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-22 the original author or authors.
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-22 the original author or authors.
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-22 the original author or authors.
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.github.rvesse.airline.tests.args.positional;

import com.github.rvesse.airline.annotations.Command;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-22 the original author or authors.
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.github.rvesse.airline.tests.args.positional;

import com.github.rvesse.airline.annotations.Command;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-22 the original author or authors.
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-22 the original author or authors.
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-22 the original author or authors.
/**
* Copyright (C) 2010-16 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,15 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.github.rvesse.airline.tests.args.positional;

import com.github.rvesse.airline.SingleCommand;
import com.github.rvesse.airline.help.cli.CliCommandUsageGenerator;
import com.github.rvesse.airline.model.PositionalArgumentMetadata;
import com.github.rvesse.airline.parser.errors.ParseArgumentsUnexpectedException;

import static com.github.rvesse.airline.TestingUtil.singleCommandParser;
import static com.github.rvesse.airline.tests.TestingUtil.singleCommandParser;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
Expand Down Expand Up @@ -56,7 +55,7 @@ public void positional_args_01() {

ArgsPositional cmd = parser.parse("example.txt", "600", "extra");
assertEquals(cmd.file, "example.txt");
assertEquals(cmd.mode, new Integer(600));
assertEquals(cmd.mode, Integer.valueOf(600));
assertEquals(cmd.parameters.size(), 1);
assertEquals(cmd.parameters.get(0), "extra");
}
Expand All @@ -67,7 +66,7 @@ public void positional_args_02() {
ArgsPositional cmd = parser.parse("example.txt", "600", "extra", "other", "another");

assertEquals(cmd.file, "example.txt");
assertEquals(cmd.mode, new Integer(600));
assertEquals(cmd.mode, Integer.valueOf(600));
assertEquals(cmd.parameters.size(), 3);
assertEquals(cmd.parameters.get(0), "extra");
assertEquals(cmd.parameters.get(1), "other");
Expand All @@ -84,7 +83,7 @@ public void positional_args_03() {
assertEquals(cmd.file, "example.txt");
assertEquals(cmd.otherFile, "example.txt");
assertEquals(cmd.file, cmd.otherFile);
assertEquals(cmd.mode, new Integer(600));
assertEquals(cmd.mode, Integer.valueOf(600));
assertEquals(cmd.parameters.size(), 1);
assertEquals(cmd.parameters.get(0), "extra");
}
Expand All @@ -110,7 +109,7 @@ public void positional_args_04() {

ArgsPositional cmd = parser.parse("example.txt", "600", "extra");
assertEquals(cmd.file, "example.txt");
assertEquals(cmd.mode, new Integer(600));
assertEquals(cmd.mode, Integer.valueOf(600));
assertEquals(cmd.parameters.size(), 1);
assertEquals(cmd.parameters.get(0), "extra");
}
Expand All @@ -123,7 +122,7 @@ public void positional_args_05() {

ArgsPositionalNoExtras cmd = parser.parse("example.txt", "600");
assertEquals(cmd.file, "example.txt");
assertEquals(cmd.mode, new Integer(600));
assertEquals(cmd.mode, Integer.valueOf(600));
}

@Test(expectedExceptions = ParseArgumentsUnexpectedException.class)
Expand All @@ -134,7 +133,7 @@ public void positional_args_06() {

ArgsPositionalNoExtras cmd = parser.parse("example.txt", "600", "extra");
assertEquals(cmd.file, "example.txt");
assertEquals(cmd.mode, new Integer(600));
assertEquals(cmd.mode, Integer.valueOf(600));
}

@Test(expectedExceptions = IllegalStateException.class)
Expand Down
Loading

0 comments on commit 1c5bbdb

Please sign in to comment.