RealTimeWeb / datasets

The primary repository for all of the CORGIS Datasets
GNU General Public License v2.0
21 stars 17 forks source link

Java Example Fails (NullPointerException) #136

Open acbart opened 7 years ago

acbart commented 7 years ago

Example dataset: Airlines (https://think.cs.vt.edu/corgis/java/airlines/airlines.html)

When you compile and run this ExampleClass.java program described on that page (attached here), it compiles fine, but I get blown away with runtime exceptions of the form:

Could not convert the response to a Airport; a field was missing.
java.lang.NullPointerException
    at corgis.airlines.domain.Airport.<init>(Unknown Source)
    at corgis.airlines.domain.Airline.<init>(Unknown Source)
    at corgis.airlines.AirlinesLibrary.getReports(Unknown Source)
    at ExampleClass.main(ExampleClass.java:10)

ExampleClass:

import corgis.airlines.AirlinesLibrary;
import corgis.airlines.domain.*;
import java.util.ArrayList;

public class ExampleClass {
    public static void main(String[] args) {
        // Get access to the library
        AirlinesLibrary airlinesLibrary = new AirlinesLibrary();
        // Access data inside the library
        ArrayList<Airline> list_of_airline = airlinesLibrary.getReports(false);
    }
}
acbart commented 7 years ago

Latest commits fixes this, but revealed that a few other libraries might be having issues (most of which are data errors in the library). Those should be fixed in the spring when we do our next sprint (tracked in #67).