Imports - which to remove in OH2 rules-file?


here is a list of my imports in the different rule-files i used in OH1:

import org.openhab.core.library.types.*   
import org.openhab.core.types.Command
import org.openhab.core.persistence.*
import org.joda.time.*

import org.openhab.model.script.actions.*
import java.lang.Math
import java.util.concurrent.locks.ReentrantLock
import java.util.Calendar
import java.util.Date
import java.util.TimeZone
import java.text.SimpleDateFormat
import java.util.Map

Which of them do i still need in OH2?

import org.openhab.core.*
import org.joda.time.*

This two imports aren´t needed anymore in OH2? So the first block of my imports in the list above can be removed.

Can i remove this also?

import org.openhab.model.*
import java.lang.*
import java.util.*
import java.text.*

The migration doc says:

All references to org.openhab.core.* in imports and class references should be removed. All of these classes are automatically included and have moved.


import org.joda.time.* statements should also be removed.

Yes, i have already read this.

But i think @rlkoshak said in another post, you can remove all org.openhab., not just org.openhab.core. - but i don´t know if he just wantet to say the same like it is written in the documentation.

What is a class-reference?

You can savly remove the first block. For the second I guess you have to keep it. That is what I did for my rule files.