Modify

Opened 6 years ago

Closed 6 years ago

#17247 closed defect (invalid)

Dead code in opendata plugin?

Reported by: GerdP Owned by: Don-vip
Priority: normal Milestone:
Component: Plugin opendata Version:
Keywords: utilsplugin2 Cc:

Description (last modified by Don-vip)

In [o34812] I removed

    public static Collection<OsmPrimitive> selectAllInside(Collection<OsmPrimitive> selected, DataSet dataset) {
        return selectAllInside(selected, dataset, true);
    }

because I found no reference to it. Now I've noticed that org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.ToulouseDataSetHandler uses it.
It seems this class is not compiled with ant but in Eclipse it is not excluded.
Should I partially revert the change in [o34812] or should I change the Eclipse project to ignore this source?

Attachments (1)

opendata.png (35.7 KB ) - added by Don-vip 6 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Don-vip, 6 years ago

Description: modified (diff)

comment:2 by Don-vip, 6 years ago

This is no dead code at all. Modules are compiled separately than the plugin because rarely updated. Can you please revert your change?

by Don-vip, 6 years ago

Attachment: opendata.png added

comment:3 by Don-vip, 6 years ago

My Eclipse project is as follows. See where are the build files:


comment:4 by Don-vip, 6 years ago

Cc: Don-vip removed
Component: Plugin opendataPlugin utilsplugin2
Owner: changed from Don-vip to GerdP

in reply to:  2 comment:5 by GerdP, 6 years ago

Replying to Don-vip:

This is no dead code at all. Modules are compiled separately than the plugin because rarely updated. Can you please revert your change?

done with [o34862-34864]

in reply to:  3 comment:6 by GerdP, 6 years ago

Replying to Don-vip:

My Eclipse project is as follows. See where are the build files:


Did you update opendata and utilsplugin2 before creating this screenshot?
I still don't understand why I did not see an error when using ant clean dist in opendata. Needs some more diggin..

comment:7 by GerdP, 6 years ago

OK, I think now I understand. The code is only compiled when you run ant in directory modules. On my machine this also doesn't work:

C:\josm\plugins\opendata\modules>ant clean dist
Buildfile: C:\josm\plugins\opendata\modules\build.xml

clean:

clean:
   [delete] Deleting directory C:\josm\plugins\opendata\modules\fr.datagouvfr\build
   [delete] Deleting: C:\josm\plugins\opendata\dist\fr.datagouvfr.jar

clean:
   [delete] Deleting directory C:\josm\plugins\opendata\modules\fr.paris\build
   [delete] Deleting: C:\josm\plugins\opendata\dist\fr.paris.jar

clean:
   [delete] Deleting directory C:\josm\plugins\opendata\modules\fr.toulouse\build

dist:

init:
    [mkdir] Created dir: C:\josm\plugins\opendata\modules\fr.datagouvfr\build
    [mkdir] Created dir: C:\josm\plugins\opendata\modules\fr.datagouvfr\build\META-INF

compile:
     [echo] compiling sources for ../../dist/fr.datagouvfr.jar ...
    [javac] Compiling 18 source files to C:\josm\plugins\opendata\modules\fr.datagouvfr\build

revision:
   [delete] Deleting: C:\josm\plugins\opendata\modules\fr.datagouvfr\REVISION

copy-resources:
     [copy] Copying 1 file to C:\josm\plugins\opendata\modules\fr.datagouvfr\build

copy-images:
     [copy] Copying 1 file to C:\josm\plugins\opendata\modules\fr.datagouvfr\build\images

dist:
     [echo] creating fr.datagouvfr.jar ...
     [copy] Copying 2 files to C:\josm\plugins\opendata\modules\fr.datagouvfr\build
      [jar] Building jar: C:\josm\plugins\opendata\dist\fr.datagouvfr.jar

init:
    [mkdir] Created dir: C:\josm\plugins\opendata\modules\fr.paris\build
    [mkdir] Created dir: C:\josm\plugins\opendata\modules\fr.paris\build\META-INF

compile:
     [echo] compiling sources for ../../dist/fr.paris.jar ...
    [javac] Compiling 12 source files to C:\josm\plugins\opendata\modules\fr.paris\build

revision:
   [delete] Deleting: C:\josm\plugins\opendata\modules\fr.paris\REVISION

copy-resources:

copy-images:
     [copy] Copying 1 file to C:\josm\plugins\opendata\modules\fr.paris\build\images

dist:
     [echo] creating fr.paris.jar ...
     [copy] Copying 2 files to C:\josm\plugins\opendata\modules\fr.paris\build
      [jar] Building jar: C:\josm\plugins\opendata\dist\fr.paris.jar

init:
    [mkdir] Created dir: C:\josm\plugins\opendata\modules\fr.toulouse\build
    [mkdir] Created dir: C:\josm\plugins\opendata\modules\fr.toulouse\build\META-INF

compile:
     [echo] compiling sources for ../../dist/fr.toulouse.jar ...
    [javac] Compiling 50 source files to C:\josm\plugins\opendata\modules\fr.toulouse\build
    [javac] C:\josm\plugins\opendata\modules\fr.toulouse\src\org\openstreetmap\josm\plugins\opendata\modules\fr\toulouse\datasets\services\MarchesPleinVentHandler.java:49: error: unclosed character literal
    [javac]                     hours += day[1]+" "+value.replace(" ", "").replace('ÔÇô','-').replace('h', ':').replace(":-", ":00-");
    [javac]                                                                        ^
    [javac] C:\josm\plugins\opendata\modules\fr.toulouse\src\org\openstreetmap\josm\plugins\opendata\modules\fr\toulouse\datasets\services\MarchesPleinVentHandler.java:49: error: ';' expected
    [javac]                     hours += day[1]+" "+value.replace(" ", "").replace('ÔÇô','-').replace('h', ':').replace(":-", ":00-");
    [javac]                                                                          ^
    [javac] C:\josm\plugins\opendata\modules\fr.toulouse\src\org\openstreetmap\josm\plugins\opendata\modules\fr\toulouse\datasets\services\MarchesPleinVentHandler.java:49: error: illegal character: '\u201c'
    [javac]                     hours += day[1]+" "+value.replace(" ", "").replace('ÔÇô','-').replace('h', ':').replace(":-", ":00-");
    [javac]                                                                           ^
    [javac] C:\josm\plugins\opendata\modules\fr.toulouse\src\org\openstreetmap\josm\plugins\opendata\modules\fr\toulouse\datasets\services\MarchesPleinVentHandler.java:49: error: ';' expected
    [javac]                     hours += day[1]+" "+value.replace(" ", "").replace('ÔÇô','-').replace('h', ':').replace(":-", ":00-");
    [javac]                                                                            ^
    [javac] C:\josm\plugins\opendata\modules\fr.toulouse\src\org\openstreetmap\josm\plugins\opendata\modules\fr\toulouse\datasets\services\MarchesPleinVentHandler.java:49: error: unclosed character literal
    [javac]                     hours += day[1]+" "+value.replace(" ", "").replace('ÔÇô','-').replace('h', ':').replace(":-", ":00-");
    [javac]                                                                                ^
    [javac] C:\josm\plugins\opendata\modules\fr.toulouse\src\org\openstreetmap\josm\plugins\opendata\modules\fr\toulouse\datasets\services\MarchesPleinVentHandler.java:49: error: not a statement
    [javac]                     hours += day[1]+" "+value.replace(" ", "").replace('ÔÇô','-').replace('h', ':').replace(":-", ":00-");
    [javac]                                                                               ^
    [javac] C:\josm\plugins\opendata\modules\fr.toulouse\src\org\openstreetmap\josm\plugins\opendata\modules\fr\toulouse\datasets\services\MarchesPleinVentHandler.java:49: error: illegal start of expression
    [javac]                     hours += day[1]+" "+value.replace(" ", "").replace('ÔÇô','-').replace('h', ':').replace(":-", ":00-");
    [javac]                                                                                  ^
    [javac] C:\josm\plugins\opendata\modules\fr.toulouse\src\org\openstreetmap\josm\plugins\opendata\modules\fr\toulouse\datasets\services\MarchesPleinVentHandler.java:49: error: ';' expected
    [javac]                     hours += day[1]+" "+value.replace(" ", "").replace('ÔÇô','-').replace('h', ':').replace(":-", ":00-");
    [javac]                                                                                          ^
    [javac] 8 errors

BUILD FAILED
C:\josm\plugins\opendata\modules\build.xml:13: The following error occurred while executing this line:
C:\josm\plugins\opendata\modules\build.xml:8: The following error occurred while executing this line:
C:\josm\plugins\opendata\modules\fr.toulouse\build.xml:41: Compile failed; see the compiler error output for details.

Total time: 1 second

C:\josm\plugins\opendata\modules>ant -version
Apache Ant(TM) version 1.9.7 compiled on April 9 2016

C:\josm\plugins\opendata\modules>javac -version
javac 1.8.0_201

C:\josm\plugins\opendata\modules>

This looks like an utf-8 problem. Maybe in one of my tools?

comment:8 by GerdP, 6 years ago

Component: Plugin utilsplugin2Plugin opendata
Owner: changed from GerdP to Don-vip

Fixed with [o34865]
Open question: Why are the modules not compiled with these commands?

cd plugins\opendata
ant clean dist

comment:9 by Don-vip, 6 years ago

Resolution: invalid
Status: newclosed

Because modules are not meant to be updated as often as plugin. Only when needed.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.