SyntaxChecker#checkSyntaxFair locks included files

0 votes
asked Feb 2, 2021 in Bug by krasa (820 points)
v1.2021.00 + the current beta

As long as the file is included, I cannot rename or move it. It fails on IOException in IntelliJ. Maybe unclosed stream somewhere?

Actually the rendering locks it too. (new SourceStringReader + AbstractPSystem#exportDiagram)
commented Feb 2, 2021 by krasa (820 points)

http://file-leak-detector.kohsuke.org/ is great for finding it:

at java.io.FileInputStream.<init>(FileInputStream.java:139)

at net.sourceforge.plantuml.security.SFile.openFile(SFile.java:325)

at net.sourceforge.plantuml.AFileRegular.openFile(AFileRegular.java:57)

at net.sourceforge.plantuml.preproc.FileWithSuffix.getReader(FileWithSuffix.java:75)

at net.sourceforge.plantuml.tim.TContext.executeInclude(TContext.java:585)

at net.sourceforge.plantuml.tim.TContext.executeOneLineNotSafe(TContext.java:284)

at net.sourceforge.plantuml.tim.TContext.executeOneLineSafe(TContext.java:265)

at net.sourceforge.plantuml.tim.TContext.executeLines(TContext.java:236)

at net.sourceforge.plantuml.tim.TimLoader.load(TimLoader.java:66)

at net.sourceforge.plantuml.BlockUml.<init>(BlockUml.java:124)

at net.sourceforge.plantuml.BlockUmlBuilder.init(BlockUmlBuilder.java:123)

at net.sourceforge.plantuml.BlockUmlBuilder.<init>(BlockUmlBuilder.java:74)

at net.sourceforge.plantuml.SourceStringReader.<init>(SourceStringReader.java:91)

at net.sourceforge.plantuml.SourceStringReader.<init>(SourceStringReader.java:83)

at net.sourceforge.plantuml.SourceStringReader.<init>(SourceStringReader.java:71)

at net.sourceforge.plantuml.syntax.SyntaxChecker.checkSyntaxFair(SyntaxChecker.java:112)

1 Answer

0 votes
answered Feb 2, 2021 by plantuml (295,000 points)
selected Feb 2, 2021 by krasa
 
Best answer

http://file-leak-detector.kohsuke.org/ is great for finding it:

This is very nice! Thank you so much.

We fix some stuff in last newly beta http://beta.plantuml.net/plantuml.jar

Tell us if you find other issues!

Thanks again

...