Validation of rules in OH2.1

My rules file after upgrade is workign but I do get a warning that I want to understand and get rid of.
I get “The use of wildcard imports is deprecated.”

And I only have this single import

import org.joda.time.*

I added it for the single rule that follows. Do I need it. how to modify the import line in order eliminate that warning.
And here is the rule.

	rule "Basement motion detected new"
    when
        Item office_motion changed or
		Item corridor_motion changed
    then
		if (office_motion.state == OPEN || corridor_motion.state == OPEN)
		{
			logDebug("OTHER","------motion triggered")
			var DateTime time_morning = new DateTime(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), 8, 30, 0)
			var DateTime time_evening = new DateTime(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), 21, 0, 0)
			var Boolean time_morning_status = now.isBefore(time_morning)
			var Boolean time_evening_status = now.isAfter(time_evening)
			
			if(now.isBefore(time_morning) || now.isAfter(time_evening))
				{
				sendCommand(B_office_rel2_shower3, ON)
				logDebug("OTHER","------motion triggered night")
				}
			else
				{
				sendCommand(B_bedroom_outa3_corridor, ON)
				logDebug("OTHER","------motion triggered day")
				}
		}
		else
		{	
			
				sendCommand(B_office_rel2_shower3, OFF)	
				sendCommand(B_bedroom_outa3_corridor, OFF)
				logDebug("OTHER","------motion off")
							
		}
    end

No, in 2.x you can eliminate the import for Joda. You will also see a lot of 1.x examples around that include stuff from org.openhab… Do not include those either.

If you did need it, you would eliminate the warning by importing each class you want from that package individually. In this case

import org.joda.time.DateTime
1 Like