Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy in translation of similar @return conditions #129

Open
bjkeller opened this issue May 5, 2017 · 0 comments
Open

Discrepancy in translation of similar @return conditions #129

bjkeller opened this issue May 5, 2017 · 0 comments

Comments

@bjkeller
Copy link

bjkeller commented May 5, 2017

Running Randoop over specifications generated from OpenJDK, we ran into two specifications that apply to the same method that show a discrepancy in translation of conditions.

The method java.io.PrintWriter.append(char c) has the post-condition
true => result.equals(target)
that is the correct interpretation of the tag @return This writer.
However, this method also inherits a post-condition
true => result.equals(c)
from java.lang.Appendable.append(char) that is an incorrect translation of the tag @return A reference to this Appendable .

Specification for java.io.PrintWriter.append(char c):

{
    "operation": {
      "classname": "java.io.PrintWriter",
      "name": "append",
      "parameterTypes": [
        "char"
      ]
    },
    "identifiers": {
      "parameters": [
        "c"
      ],
      "receiverName": "target",
      "returnName": "result"
    },
    "throws": [],
    "post": [
      {
        "property": {
          "condition": "result.equals(target)",
          "description": "This writer"
        },
        "description": "return This writer",
        "guard": {
          "condition": "true",
          "description": ""
        }
      }
    ],
    "pre": []
  }

Specification for java.lang.Appendable.append(char)

{
    "operation": {
      "classname": "java.lang.Appendable",
      "name": "append",
      "parameterTypes": [
        "char"
      ]
    },
    "identifiers": {
      "parameters": [
        "c"
      ],
      "receiverName": "target",
      "returnName": "result"
    },
    "throws": [],
    "post": [
      {
        "property": {
          "condition": "result.equals(c)",
          "description": "A reference to this Appendable"
        },
        "description": "return A reference to this Appendable",
        "guard": {
          "condition": "true",
          "description": ""
        }
      }
    ],
    "pre": []
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant