Share

Jalopy Java Source Code Formatter

Tracker: Bugs

1 Core: creating backup file fails in multi-threaded env - ID: 617942
Last Update: Settings changed ( marcohu )


Jalopy Java Source Code Formatter 1.0b8
Formatting 425 source files
D:\development\song\dev\song\src\com\schema\app\ada
ptors\AntennaProfileAdaptor.j
ava:0:0:java.lang.NullPointerException
java.lang.NullPointerException
at de.hunsicker.io.FileBackup.copy
(FileBackup.java:429)
at de.hunsicker.io.FileBackup.create
(FileBackup.java:238)
at de.hunsicker.io.FileBackup.create
(FileBackup.java:120)
at de.hunsicker.jalopy.Jalopy.createBackup
(Jalopy.java:1917)
at de.hunsicker.jalopy.Jalopy.print
(Jalopy.java:2026)
at de.hunsicker.jalopy.Jalopy.format
(Jalopy.java:1362)
at de.hunsicker.jalopy.Jalopy.format
(Jalopy.java:1015)
at
de.hunsicker.jalopy.plugin.ant.AntPlugin$FormatThread.r
un(AntPlugin.j
ava:1200)
Error formatting
D:\development\song\dev\song\src\com\schema\app\ada
ptors\Antenn
aProfileAdaptor.java
at
de.hunsicker.jalopy.plugin.ant.AntPlugin$FormatThread.r
un(AntPlugin.j
ava:1208)
104 source files formatted
Error formatting
D:\development\song\dev\song\src\com\schema\app\ada
ptors\Antenn
aProfileHeaderAdaptor.java
at
de.hunsicker.jalopy.plugin.ant.AntPlugin$FormatThread.r
un(AntPlugin.j
ava:1208)

BUILD FAILED
file:D:/development/song/dev/song/build.xml:1234: Run
failed, messages should ha
ve been provided.

Total time: 13 seconds

=======================

here is a ant definition:

=======================

<jalopy javadoc="false"
fileformat="DOS"
loglevel="error"
threads="2"
history="NONE"
style="resources/jalopy-ant/format.xml"
force="true">
<fileset
dir="${build.src}/com/schema/app/dbobj">
<include name="**/*.java"/>
</fileset>
<fileset
dir="${build.src}/com/schema/app/adaptors">
<include name="**/*.java"/>
</fileset>
</jalopy>







Mike Dubman ( dubman ) - 2002-10-03 07:02

1

Closed

Fixed

Marco Hunsicker

Core

v1.0 (example)

Public


Comments ( 5 )

Date: 2002-10-13 20:42
Sender: wsargent

Logged In: YES
user_id=47007

It looks the outputstream is throwing an exception.

finally {
if ( in != null ) in.close();
if ( out != null ) out.close();
}

fixes this for me.



Date: 2002-10-11 12:25
Sender: marcohuProject Admin

Logged In: YES
user_id=44430

Ok, I've sorted it out. The problem is the backup facility.
Jalopy creates for every file it formats a backup file in
the backup directory or a subdirectory thereof. After
formatting, the engine checked whether the directory of the
backup file is now empty and attempts to delete it if so.
This leads to the error you notice: the directory is deleted
by one one thread but another thread tries to write a file
in the now non-existing directory.

Either use single thread (as you mention) or set backup
level > 0 as a workaroung. Will be fixed with the next version.

Thanks.


Date: 2002-10-10 12:00
Sender: dubmanAccepting Donations

Logged In: YES
user_id=154547

changing threads to one - solves the problem, changing it
back to 2 - causes it.


Date: 2002-10-10 10:32
Sender: dubmanAccepting Donations

Logged In: YES
user_id=154547

looks lie a problem is a thred concurrency:
when i changed threads number to 1 (threads="1") - all
works fine.


Date: 2002-10-10 09:36
Sender: marcohuProject Admin

Logged In: YES
user_id=44430

Does it happen always? What happens if you only format
AntennaProfileAdaptor.java? Could you please attach your
preferences?

Thanks.


Attached File

No Files Currently Attached

Changes ( 7 )

Field Old Value Date By
status_id Open 2002-11-13 00:02 marcohu
close_date - 2002-11-13 00:02 marcohu
resolution_id None 2002-11-13 00:02 marcohu
summary fails on backup file 2002-10-13 10:32 marcohu
category_id Plug-in Ant 2002-10-11 12:25 marcohu
assigned_to nobody 2002-10-11 12:25 marcohu
priority 5 2002-10-11 12:25 marcohu