Hello
I have a Java Agent which I need to maintain (dev was done by someone else), with the following code samples extracted:
String type = (String) types.nextElement();
DemByDate dd = (DemByDate) client.typeDemande.get(type);
Vector v = (Vector) dd.demandes;
Calendar calendar = Calendar.getInstance();
calendar.set(dd.d2.getYear(), dd.d2.getMonth(), dd.d2.getDate());
int maxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
dd.d2 = new Date(dd.d2.getYear(), dd.d2.getMonth(), maxDay);
dd.d1 = new Date(dd.d1.getYear(), dd.d1.getMonth(), 1);
XML("<ligne>");
XML("<typeBesoin>" + type + "</typeBesoin>");
XML("<nbre>" + v.size() + "</nbre>");
XML("<periodeDebut>" + format.format(dd.d1) + "</periodeDebut>");
XML("<periodeFin>"+ format.format(dd.d2) + "</periodeFin>");
XML("</ligne>");
class DemByDate {
Vector demandes;
Date d1;
Date d2;
}
I need to replace the .getYear() and .getMonth() accordingly, but so far, trying something like (ignore quotes) "calendar.set(dd.d2.calendar.year, dd.d2.month, dd.d2.date;"
results in a red underlined line of code, despite having for e.g. for year, int year = calendar.get(Calendar.YEAR);
In my editor I am having the getYear etc crossed out with a horizontal line across it, same goes for the line
dd.d2 = new Date(dd.d2.getYear(), dd.d2.getMonth(), maxDay);
whereby the Date, getYear and getMonth are crossed out.
Anyone can help me with this pls?