-
Notifications
You must be signed in to change notification settings - Fork 535
Closed
Labels
Component: Code Infrastructureformerly "Feature: Code Infrastructure"formerly "Feature: Code Infrastructure"
Milestone
Description
Eclipse reports over 800 warnings in the current Dataverse code. That's a lot better than the 4500+ in recent 3.6.2 code, but too many.
These include
- references to raw types (though most are now half-raw), like
List<Long> listOfLongs = new ArrayList(); - dead code like checking whether
source == nullafter establishingsourceis of a certain class and unused variables and private fields. - (potential) resource leaks when streams are not closed (though I'm not sure how Java handles these), e.g. secondPassReader in CSVFileReader. There is a
secondPassReader.close()statement further down, but when an exception is thrown the JVM may not get there. Is Ingest: CSV ingest gets stuck in "ingest in progress" mode with non-comforming csv file #573 related to this, perhaps?
May I also recommend to add a bit of Javadoc to every method longer than, say, 10 lines? It makes understanding the code without looking at each and every line easier.
Bad habit found in v3.6: using a raw Map with 2 values of different classes instead of a new Class with two members, one of each type.
Map someMap = getMap();
TypeOne item1 = (TypeOne) someMap.get(0);
TypeTwo item2 = (TypeTwo) someMap.get(1);
With the proper use of generic types I'm sure you don't crazy stuff like that anymore, do you? ;)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Component: Code Infrastructureformerly "Feature: Code Infrastructure"formerly "Feature: Code Infrastructure"