Skip to content

Instantly share code, notes, and snippets.

@cvrebert
Created April 13, 2015 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cvrebert/5f4a2a943299720ac26c to your computer and use it in GitHub Desktop.
Save cvrebert/5f4a2a943299720ac26c to your computer and use it in GitHub Desktop.
jcabi MkGithub example code no longer compiles
[error] /Users/chris/code/no-carrier/src/main/java/qux/Main.java:16: method create in interface com.jcabi.github.Repos cannot be applied to given types;
[error] required: javax.json.JsonObject
[error] found: java.lang.String
[error] reason: argument mismatch; java.lang.String cannot be converted to javax.json.JsonObject
[error] github.repos().create
[error] /Users/chris/code/no-carrier/src/main/java/qux/Main.java:17: method get in interface com.jcabi.github.Repos cannot be applied to given types;
[error] required: com.jcabi.github.Coordinates
[error] found: java.lang.String
[error] reason: argument mismatch; java.lang.String cannot be converted to com.jcabi.github.Coordinates
[error] github.repos().get
[error] /Users/chris/code/no-carrier/src/main/java/qux/Main.java:19: cannot find symbol
[error] symbol: method post(java.lang.String,java.lang.String)
[error] location: variable issues of type com.jcabi.github.Issues
[error] issues.post
[error] (compile:compileIncremental) javac returned nonzero exit code
package qux;
import java.io.IOException;
import com.jcabi.github.*;
import com.jcabi.github.mock.*;
public class Main {
public static void main(String[] args) {
Github github = null;
try {
github = new MkGithub("jeff");
}
catch (IOException exc) {
return;
}
github.repos().create("jcabi/jcabi-github");
Repo repo = github.repos().get("jcabi/jcabi-github");
Issues issues = repo.issues();
Issue issue = issues.post("issue title", "issue body");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment