GithubHelp home page GithubHelp logo

Comments (10)

wu-sheng avatar wu-sheng commented on August 20, 2024

Thanks for your report. I just pr the codes to fix this.

from opentracing-java.

yurishkuro avatar yurishkuro commented on August 20, 2024
  public static void main(String[] args) {
    long port = 33000;
    short shortPort = (short) port;
    System.out.println(shortPort);
  }

// Output: -32536

from opentracing-java.

wu-sheng avatar wu-sheng commented on August 20, 2024

@yurishkuro The output is -32536, it do not equal the expected value.

from opentracing-java.

wu-sheng avatar wu-sheng commented on August 20, 2024

-1 - this is API breaking change. A cast to short still preserves the full 16 bits of the port.

I understand your concern. But it really should not add this cast operation, when you set a port....

from opentracing-java.

yurishkuro avatar yurishkuro commented on August 20, 2024

Well, semantically it's the correct representation, e.g. InetSocketAddress defines the port as int, but in the comments limits the range "value is between 0 and 65535" (i.e. unsigned short). I agree that int would've been more convenient in practice, but it will be an API breaking change which will break existing instrumentations.

from opentracing-java.

wu-sheng avatar wu-sheng commented on August 20, 2024

Agee. Maybe I can change the pr, add some comments of PEER_PORT to describe this. In cases others have the same questions. Thoughts? @yurishkuro

from opentracing-java.

yurishkuro avatar yurishkuro commented on August 20, 2024

Yes, definitely makes sense to clarify the comments for that tag.

If others are ok to break backwards compatibility, I can be out-voted :-) After all, Java is still <1.0

from opentracing-java.

wu-sheng avatar wu-sheng commented on August 20, 2024

I hesitate about breaking backwards compatibility too. I will cc the pr to other contributors, see what happen next? OK?

from opentracing-java.

wu-sheng avatar wu-sheng commented on August 20, 2024

Just done. #114 (comment)

from opentracing-java.

wu-sheng avatar wu-sheng commented on August 20, 2024

Merged already.

from opentracing-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.