stleary / JSON-java

A reference implementation of a JSON package in Java.
http://stleary.github.io/JSON-java/index.html
Other
4.54k stars 2.56k forks source link

Build failure #290

Closed erosb closed 8 years ago

erosb commented 8 years ago

I tried to update a previously set up environment and run the gradle build. First I ran the following commands to get the latest version of both the tests and the library code:

git pull upstream master
cd src/main/java/org/
git pull upstream master
cd - 

Then I ran the tests using gradle test and I got a build failure with the following output:

Starting a new Gradle Daemon for this build (subsequent builds will be faster).
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:compileTestJava
/mnt/data/Java/json-java-unit-test/src/test/java/org/json/junit/XMLTest.java:736: error: method toJSONObject in class XML cannot be applied to given types;
        final JSONObject actualJsonOutput = XML.toJSONObject(originalXml, false);
                                               ^
  required: String
  found: String,boolean
  reason: actual and formal argument lists differ in length
/mnt/data/Java/json-java-unit-test/src/test/java/org/json/junit/XMLTest.java:747: error: method toJSONObject in class XML cannot be applied to given types;
        final String revertedXml = XML.toString(XML.toJSONObject(originalXml, false));
                                                   ^
  required: String
  found: String,boolean
  reason: actual and formal argument lists differ in length
/mnt/data/Java/json-java-unit-test/src/test/java/org/json/junit/XMLTest.java:760: error: method toJSONObject in class XML cannot be applied to given types;
        final JSONObject json = XML.toJSONObject(originalXml,true);
                                   ^
  required: String
  found: String,boolean
  reason: actual and formal argument lists differ in length
/mnt/data/Java/json-java-unit-test/src/test/java/org/json/junit/JSONMLTest.java:709: error: no suitable method found for toJSONArray(String,boolean)
        final JSONArray actualJsonOutput = JSONML.toJSONArray(originalXml, false);
                                                 ^
    method JSONML.toJSONArray(String) is not applicable
      (actual and formal argument lists differ in length)
    method JSONML.toJSONArray(XMLTokener) is not applicable
      (actual and formal argument lists differ in length)
/mnt/data/Java/json-java-unit-test/src/test/java/org/json/junit/JSONMLTest.java:720: error: no suitable method found for toJSONArray(String,boolean)
        final String revertedXml = JSONML.toString(JSONML.toJSONArray(originalXml, false));
                                                         ^
    method JSONML.toJSONArray(String) is not applicable
      (actual and formal argument lists differ in length)
    method JSONML.toJSONArray(XMLTokener) is not applicable
      (actual and formal argument lists differ in length)
/mnt/data/Java/json-java-unit-test/src/test/java/org/json/junit/JSONMLTest.java:731: error: no suitable method found for toJSONArray(String,boolean)
        final JSONArray json = JSONML.toJSONArray(originalXml,true);
                                     ^
    method JSONML.toJSONArray(String) is not applicable
      (actual and formal argument lists differ in length)
    method JSONML.toJSONArray(XMLTokener) is not applicable
      (actual and formal argument lists differ in length)
6 errors
:compileTestJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileTestJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Did I do something wrong or is it failing for everybody?

johnjaylward commented 8 years ago

have you tried doing a git reset --hard upstream/master -- to both repos to make sure you didn't have any conflicts?

-- edit I fixed the git command

erosb commented 8 years ago

Ehh, sorry, the git root for the library code was not src/main/java/org/ but src/main/java/org/json . I seriously couldn't resolve this problem since weeks -.- Now I git pullęd properly and the tests pass.