Skip to content

faq 73334788

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

Eclipse won't recognize constructor

by Yousef Hindy on 2016-07-08 03:26:18


So I have a project configured with a pom.xml that includes the taxi extension.

When I try and write the following code: 

new TaxiModule(taxiData)

It tells me that "The constructor is undefined", even though TaxiModule has constructors:

public TaxiModule(TaxiData taxiData)
 {
     this(taxiData, VehicleUtils.getDefaultVehicleType());
 }


 public TaxiModule(TaxiData taxiData, VehicleType vehicleType)
 {
     this.taxiData = taxiData;
     this.vehicleType = vehicleType;
 }

It suggests that I 

Add argument to match constructor TaxiModule(TaxiData, TaxiConfigGroup).
 Add argument to match constructor TaxiModule(TaxiData, TaxiConfigGroup, VehicleType).

I am very confused by this... The compiler is also giving me grief about the get() method for the TaxiConfigGroup, saying it doesn't exist even though it is clearly in the documentation.

Any help would be great!


Thanks!


Comments: 1


Re: Eclipse won't recognize constructor

by Michal Maciejewski on 2016-07-08 08:01:43

Probably you are pointing to a different version of matsim/taxi in your pom. In version 0.8, there is a constructor TaxiModule(TaxiData, TaxiConfigGroup), which is what your eclipse sees. Somewhere 2 weeks ago, the second argument was removed (as it was unnecessary), and currently this constructor takes only TaxiData, and this is what you see.

Clone this wiki locally