blackducksoftware / ohcount4j

Line counting and language identification tool
Apache License 2.0
18 stars 8 forks source link

Infinite recursion in ExtnINResolver.resolve #37

Closed sig-daveka closed 6 years ago

sig-daveka commented 7 years ago

When processing files with a .IN extension (even empty files), ohcount4j 1.2.0 goes into infinite recursion.

Class: java.lang.StackOverflowError 
Message: nullAn unexpected error has occurred. 
Class: java.lang.StackOverflowError 
Message: null
    at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:579)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:318)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.BufferedReader.fill(BufferedReader.java:161)
    at java.io.BufferedReader.read1(BufferedReader.java:212)
    at java.io.BufferedReader.read(BufferedReader.java:286)
    at java.io.Reader.read(Reader.java:140)
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2369)
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2348)
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:2325)
    at org.apache.commons.io.IOUtils.toCharArray(IOUtils.java:999)
    at net.ohloh.ohcount4j.SourceFile.getContents(SourceFile.java:61)
    at net.ohloh.ohcount4j.SourceFile.head(SourceFile.java:74)
    at net.ohloh.ohcount4j.detect.Detector.detect(Detector.java:40)
    at net.ohloh.ohcount4j.detect.Detector.detect(Detector.java:67)
    at net.ohloh.ohcount4j.detect.ExtnINResolver.resolve(ExtnINResolver.java:15)
    at net.ohloh.ohcount4j.detect.Detector.detectByExtension(Detector.java:145)
    at net.ohloh.ohcount4j.detect.Detector.detect(Detector.java:47)
    at net.ohloh.ohcount4j.detect.Detector.detect(Detector.java:67)
    at net.ohloh.ohcount4j.detect.ExtnINResolver.resolve(ExtnINResolver.java:15)
    at net.ohloh.ohcount4j.detect.Detector.detectByExtension(Detector.java:145)
    at net.ohloh.ohcount4j.detect.Detector.detect(Detector.java:47)
    at net.ohloh.ohcount4j.detect.Detector.detect(Detector.java:67)
    at net.ohloh.ohcount4j.detect.ExtnINResolver.resolve(ExtnINResolver.java:15)
    ...
PDegenPortnoy commented 6 years ago

Moving the project to archive status. Therefore, closing all issues.