Expand wildcard imports to specfic classes

JGit style is to import exactly the classes required, and never
to use "import foo.*" as the foo package could add new classes
in the future which are conflicting/confusing with the imports
already used by a source file.

Change-Id: I5693408c777e5843ec65fff1163d5d717849fa34
This commit is contained in:
Shawn Pearce 2014-11-10 15:35:20 -08:00
parent 9597c41ea9
commit 0cf902e473
10 changed files with 56 additions and 42 deletions

View File

@ -45,6 +45,14 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.junit.RepositoryTestCase;
import org.eclipse.jgit.lib.FileMode;
@ -54,10 +62,6 @@
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
public class ArchiveCommandTest extends RepositoryTestCase {
private static final String UNEXPECTED_ARCHIVE_SIZE = "Unexpected archive size";

View File

@ -42,9 +42,11 @@
*/
package org.eclipse.jgit.ignore;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import org.eclipse.jgit.ignore.FastIgnoreRule;
import org.junit.Test;
public class BasicRuleTest {

View File

@ -43,16 +43,18 @@
package org.eclipse.jgit.ignore;
import static org.eclipse.jgit.ignore.internal.Strings.split;
import static org.junit.Assert.*;
import static org.junit.Assume.*;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
import java.util.Arrays;
import org.eclipse.jgit.ignore.FastIgnoreRule;
import org.eclipse.jgit.ignore.IgnoreRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.*;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;

View File

@ -42,15 +42,14 @@
*/
package org.eclipse.jgit.ignore;
import static org.junit.Assert.*;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import org.eclipse.jgit.ignore.FastIgnoreRule;
import org.eclipse.jgit.ignore.IgnoreRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.*;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;

View File

@ -43,16 +43,14 @@
*/
package org.eclipse.jgit.ignore;
import static org.junit.Assert.*;
import static org.junit.Assume.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeTrue;
import java.util.Arrays;
import org.eclipse.jgit.ignore.FastIgnoreRule;
import org.eclipse.jgit.ignore.IgnoreRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.*;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;

View File

@ -43,14 +43,14 @@
package org.eclipse.jgit.internal.storage.file;
import static org.junit.Assert.*;
import com.googlecode.javaewah.EWAHCompressedBitmap;
import static org.junit.Assert.assertEquals;
import org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.StoredBitmap;
import org.eclipse.jgit.lib.ObjectId;
import org.junit.Test;
import com.googlecode.javaewah.EWAHCompressedBitmap;
public class StoredBitmapTest {
@Test

View File

@ -43,14 +43,14 @@
package org.eclipse.jgit.revwalk;
import static org.junit.Assert.assertNull;
import java.io.File;
import java.io.IOException;
import org.eclipse.jgit.junit.JGitTestUtil;
import org.eclipse.jgit.lib.*;
import org.junit.*;
import static org.junit.Assert.*;
import org.eclipse.jgit.lib.ObjectId;
import org.junit.Test;
public class RevWalkShallowTest extends RevWalkTestCase {

View File

@ -42,17 +42,7 @@
*/
package org.eclipse.jgit.api;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.api.errors.RefNotFoundException;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.*;
import static org.eclipse.jgit.lib.Constants.R_TAGS;
import java.io.IOException;
import java.text.MessageFormat;
@ -63,7 +53,20 @@
import java.util.List;
import java.util.Map;
import static org.eclipse.jgit.lib.Constants.R_TAGS;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.api.errors.RefNotFoundException;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevFlag;
import org.eclipse.jgit.revwalk.RevFlagSet;
import org.eclipse.jgit.revwalk.RevWalk;
/**
* Given a commit, show the most recent tag that is reachable from a commit.

View File

@ -42,9 +42,13 @@
*/
package org.eclipse.jgit.ignore.internal;
import static org.eclipse.jgit.ignore.internal.Strings.*;
import static org.eclipse.jgit.ignore.internal.Strings.count;
import static org.eclipse.jgit.ignore.internal.Strings.getPathSeparator;
import static org.eclipse.jgit.ignore.internal.Strings.isWildCard;
import static org.eclipse.jgit.ignore.internal.Strings.split;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jgit.errors.InvalidPatternException;
import org.eclipse.jgit.ignore.FastIgnoreRule;

View File

@ -44,7 +44,9 @@
import static java.lang.Character.isLetter;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import org.eclipse.jgit.errors.InvalidPatternException;