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

Separate SCIP/Semanticdb symbols on a typelevel in the converter #573

Open
keynmol opened this issue May 3, 2023 · 0 comments
Open

Separate SCIP/Semanticdb symbols on a typelevel in the converter #573

keynmol opened this issue May 3, 2023 · 0 comments

Comments

@keynmol
Copy link
Contributor

keynmol commented May 3, 2023

While https://github.com/sourcegraph/scip-java/pull/570/files fixes the issue after the fact, we should strive to make the codebase more robust by avoiding using String for everything.

Given that we target Java 8, I don't think we can do much better than a handrolled wrapper class for either, e.g.

public class SemanticdbSymbol {
  private final String raw;

  public SemanticdbSymbol(String raw) {
    this.raw = raw;
  }

  public String getRaw() {
    return raw;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    SemanticdbSymbol that = (SemanticdbSymbol) o;
    return Objects.equals(raw, that.raw);
  }

  @Override
  public int hashCode() {
    return Objects.hash(raw);
  }
}

The stuff added in #570 will actually serve as an excellent safety net for aiding with this refactoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants