J
javaprog
Gast
Hi Community,
kann mir mal jemand folgendes erklären wie ich die Warnungen herausbekomme?
1.The static field Calendar.YEAR should be accessed in a static way.
public static String diffTime(GregorianCalendar startDate, GregorianCalendar endDate)
{
int year, month, day, hour, minute, second, millis;
year = endDate.get(endDate.YEAR)-startDate.get(startDate.YEAR);
.....
2. Type safety: The method put(Object, Object) belongs to the raw type Hashtable. References to generic type Hashtable<K,V> should be parameterized
private class Entry {
SequenceEJBLocal sequence;
int last;
};
public int getNextSequenceNumber(String name)
{
try
{
Entry entry = (Entry) _entries.get(name);
//check if entry is in hashtable
if (entry == null)
{
// add an entry to the sequence table
entry = new Entry();
try
{
//check if there is a database entry for the sequence
entry.sequence = _sequenceHome.findByPrimaryKey(name);
}
catch (javax.ejb.FinderException e)
{
// if we couldn't find it, then create it...
entry.sequence = _sequenceHome.create(name);
}
//put the next entries in the hashtable
_entries.put(name, entry);
....
Vielen Dank im Vorraus.
Olaf
kann mir mal jemand folgendes erklären wie ich die Warnungen herausbekomme?
1.The static field Calendar.YEAR should be accessed in a static way.
public static String diffTime(GregorianCalendar startDate, GregorianCalendar endDate)
{
int year, month, day, hour, minute, second, millis;
year = endDate.get(endDate.YEAR)-startDate.get(startDate.YEAR);
.....
2. Type safety: The method put(Object, Object) belongs to the raw type Hashtable. References to generic type Hashtable<K,V> should be parameterized
private class Entry {
SequenceEJBLocal sequence;
int last;
};
public int getNextSequenceNumber(String name)
{
try
{
Entry entry = (Entry) _entries.get(name);
//check if entry is in hashtable
if (entry == null)
{
// add an entry to the sequence table
entry = new Entry();
try
{
//check if there is a database entry for the sequence
entry.sequence = _sequenceHome.findByPrimaryKey(name);
}
catch (javax.ejb.FinderException e)
{
// if we couldn't find it, then create it...
entry.sequence = _sequenceHome.create(name);
}
//put the next entries in the hashtable
_entries.put(name, entry);
....
Vielen Dank im Vorraus.
Olaf