NetCal / DNC

The NetworkCalculus.org Deterministic Network Calculator
http://dnc.networkcalculus.org
GNU Lesser General Public License v2.1
25 stars 23 forks source link

Fixed the only Spotbugs complaint in v2.5 core #41

Closed sbondorf closed 6 years ago

sbondorf commented 6 years ago

plus submodule updates along the way

sbondorf commented 6 years ago

You are correct, this should be possible and benefit a lot more code parts.

For illustration, the NumBackend is a good example. There, we provide Num create{Zero,PositiveInfinity,NegativeInfinity} as well as Num get{Zero,PositiveInfinity,NegativeInfinity}. Moreover, there we have the boolean is{Zero,PositiveInfinity,NegativeInfinity}.

The last alternative is probably the best option for this piece of code as well. However, getting this done properly involves tackling issue #7. I feel this is a bit too much effort to simply patch this bug.

Another aspect to favor this solution is the dependance of the curve on the current NumBackend. If we use a static constant, we need to make sure to not mix NumBackend of curves. This is prevented by newly creating a the curve in this location. This relates to the yet untackled issue #20.

matyesz commented 6 years ago

Sometimes nice solutions take time:). Anyway we can do the quick patch for v2.5 and collect tasks for next version for refactoring.

matyesz commented 6 years ago

Created task #42 to collect the refactoring tasks for v2.6. Also added the milestone to be able to separate tasks between versions.