@@ -16,20 +16,21 @@ import net.fortuna.ical4j.transform.rfc5545.DatePropertyRule
1616import net.fortuna.ical4j.transform.rfc5545.Rfc5545PropertyRule
1717import java.io.BufferedReader
1818import java.io.Reader
19- import java.util.logging.Level
2019import java.util.logging.Logger
2120import javax.annotation.WillNotClose
2221
2322/* *
2423 * Applies some rules to increase compatibility of parsed (incoming) iCalendars:
2524 *
2625 * - [CreatedPropertyRule] to make sure CREATED is UTC
27- * - [DatePropertyRule], [DateListPropertyRule] to rename Outlook-specific TZID parameters
26+ * - [DatePropertyRule] and [DateListPropertyRule] to rename Outlook-specific TZID parameters
2827 * (like "W. Europe Standard Time" to an Android-friendly name like "Europe/Vienna")
29- *
3028 */
3129class ICalPreprocessor {
3230
31+ private val logger
32+ get() = Logger .getLogger(javaClass.name)
33+
3334 private val propertyRules = arrayOf(
3435 CreatedPropertyRule (), // make sure CREATED is UTC
3536
@@ -105,12 +106,12 @@ class ICalPreprocessor {
105106 private fun applyRules (property : Property ) {
106107 propertyRules
107108 .filter { rule -> rule.supportedType.isAssignableFrom(property::class .java) }
108- .forEach {
109+ .forEach { rule ->
109110 val beforeStr = property.toString()
110- (it as Rfc5545PropertyRule <Property >).applyTo(property)
111+ (rule as Rfc5545PropertyRule <Property >).applyTo(property)
111112 val afterStr = property.toString()
112113 if (beforeStr != afterStr)
113- Logger .getLogger( javaClass.name).log( Level . FINER , " $beforeStr -> $afterStr " )
114+ logger.info( " ${rule. javaClass.name} : $beforeStr -> $afterStr " )
114115 }
115116 }
116117
0 commit comments