AtomMaterialUI/color-highlighter

java.lang.NumberFormatException while working in Scala sources

Closed this issue · 2 comments

Describe the bug

While working in Scala I got exception:

java.lang.NumberFormatException: For input string: "drk(c.getRed"
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
at java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
at java.base/java.lang.Float.parseFloat(Float.java:476)
at com.mallowigi.colors.ColorData.parseComponent(ColorData.kt:57)
at com.mallowigi.search.parsers.ColorCtorParser.parseConstructor(ColorCtorParser.kt:51)
at com.mallowigi.search.parsers.ColorCtorParser.parseColor(ColorCtorParser.kt:35)
at com.mallowigi.visitors.ScalaVisitor.parseCtor(ScalaVisitor.kt:57)
at com.mallowigi.visitors.ScalaVisitor.access$parseCtor(ScalaVisitor.kt:45)
at com.mallowigi.visitors.ScalaVisitor$parsedTypes$3.invoke(ScalaVisitor.kt:50)
at com.mallowigi.visitors.ScalaVisitor$parsedTypes$3.invoke(ScalaVisitor.kt:50)
at com.mallowigi.visitors.ScalaVisitor.accept(ScalaVisitor.kt:82)
at com.mallowigi.visitors.ColorVisitor.visit(ColorVisitor.kt:88)

I will prepare a PR for this once I find time.

Closing this. I don't have enough resources to investigate such an issue. If you want to investigate yourself, be my guest.

I think PR for this was merged long ago. I do not experience the issue any more.