Skip to content

Commit fd436cf

Browse files
committed
Fixes for build failures
1 parent 7e05ce3 commit fd436cf

3 files changed

Lines changed: 8 additions & 27 deletions

File tree

src/main/java/org/kohsuke/github/GitHub.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,11 @@
2626
import com.fasterxml.jackson.databind.DeserializationFeature;
2727
import com.fasterxml.jackson.databind.MapperFeature;
2828
import com.fasterxml.jackson.databind.ObjectMapper;
29-
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
3029
import com.fasterxml.jackson.databind.introspect.VisibilityChecker.Std;
3130
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
3231
import org.apache.commons.codec.Charsets;
3332
import org.apache.commons.codec.binary.Base64;
3433
import org.apache.commons.io.IOUtils;
35-
import org.apache.commons.lang3.StringUtils;
36-
import org.kohsuke.github.example.dataobject.GHMetaExamples;
3734

3835
import javax.annotation.CheckForNull;
3936
import javax.annotation.Nonnull;
@@ -817,23 +814,6 @@ public GHMeta getMeta() throws IOException {
817814
return retrieve().to("/meta", GHMeta.class);
818815
}
819816

820-
/**
821-
* TEST-ONLY
822-
* <p>
823-
* Provides a list of GitHub's IP addresses. For testing and example purposes only.
824-
*
825-
* @see <a href="https://developer.github.com/v3/meta/#meta">Get Meta</a>
826-
*
827-
* @return an instance of {@link GHMeta}
828-
* @throws IOException
829-
* if the credentials supplied are invalid or if you're trying to access it as a GitHub App via the JWT
830-
* authentication
831-
*/
832-
<T extends GHMetaExamples.GHMetaExample> GHMetaExamples.GHMetaExample getMetaExample(Class<T> clazz)
833-
throws IOException {
834-
return retrieve().to("/meta", clazz);
835-
}
836-
837817
GHUser intern(GHUser user) throws IOException {
838818
if (user == null)
839819
return user;

src/main/java/org/kohsuke/github/example/dataobject/GHMetaExamples.java renamed to src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.fasterxml.jackson.annotation.JsonCreator;
44
import com.fasterxml.jackson.annotation.JsonProperty;
55
import com.fasterxml.jackson.annotation.JsonSetter;
6-
import org.kohsuke.github.GitHub;
76

87
import javax.annotation.Nonnull;
98
import java.util.ArrayList;
@@ -21,14 +20,15 @@
2120
* <li>Better: {@link GHMetaGettersUnmodifiable} is a good balance of clarity and brevity</li>
2221
* <li>Worse: {@link GHMetaPublic} exposes setters that are not needed, making it unclear that fields are actually
2322
* read-only</li>
23+
* </ul>
2424
*
2525
* @author Liam Newman
2626
*
2727
* @see org.kohsuke.github.GHMeta
2828
* @see <a href="https://developer.github.com/v3/meta/#meta">Get Meta</a>
2929
*/
3030

31-
public final class GHMetaExamples {
31+
public final class ReadOnlyObjects {
3232

3333
/**
3434
* All GHMeta data objects should expose these values.

src/test/java/org/kohsuke/github/GitHubTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import com.google.common.collect.Iterables;
77
import org.junit.Test;
8-
import org.kohsuke.github.example.dataobject.GHMetaExamples;
8+
import org.kohsuke.github.example.dataobject.ReadOnlyObjects;
99

1010
import static org.hamcrest.CoreMatchers.*;
1111

@@ -87,12 +87,13 @@ public void getMeta() throws IOException {
8787
assertEquals(19, meta.getWeb().size());
8888

8989
// Also test examples here
90-
Class[] examples = new Class[] { GHMetaExamples.GHMetaPublic.class, GHMetaExamples.GHMetaPackage.class,
91-
GHMetaExamples.GHMetaGettersUnmodifiable.class, GHMetaExamples.GHMetaGettersFinal.class,
92-
GHMetaExamples.GHMetaGettersFinalCreator.class, };
90+
Class[] examples = new Class[] { ReadOnlyObjects.GHMetaPublic.class, ReadOnlyObjects.GHMetaPackage.class,
91+
ReadOnlyObjects.GHMetaGettersUnmodifiable.class, ReadOnlyObjects.GHMetaGettersFinal.class,
92+
ReadOnlyObjects.GHMetaGettersFinalCreator.class, };
9393

9494
for (Class metaClass : examples) {
95-
GHMetaExamples.GHMetaExample metaExample = gitHub.getMetaExample(metaClass);
95+
ReadOnlyObjects.GHMetaExample metaExample = gitHub.retrieve().to("/meta",
96+
(Class<ReadOnlyObjects.GHMetaExample>) metaClass);
9697
assertTrue(metaExample.isVerifiablePasswordAuthentication());
9798
assertEquals(19, metaExample.getApi().size());
9899
assertEquals(19, metaExample.getGit().size());

0 commit comments

Comments
 (0)