cansik / librealsense-java

Intel® RealSense™ SDK 2 wrapper for Java.
19 stars 1 forks source link

Fix wrong overloading is called #5

Closed GGBBB2000 closed 3 years ago

GGBBB2000 commented 3 years ago

In pixelPtr.put(pixel.getI(), pixel.getJ()), the overloaded method FloatPointer.put(long, float) is unintentionally called, whereas we want to call FloatPointer.put(float...). This is because overloading resolution prioritize variable arity methods less. To fix this, the code is fixed to call FloatPointer.put(long, float) explicitly for each index.

pixelPtr.put(pixel.getI(), pixel.getJ());
↓
pixelPtr.put(0, pixel.getI());
pixelPtr.put(1, pixel.getJ());
GGBBB2000 commented 3 years ago

If you don't mind, I'm glad you to add hacktoberfest topic onto the repo or add hacktoberfest-accepted label to this PR.

cansik commented 3 years ago

Thank you very much, I have added the topic to the repository.