Skip to content

Commit 6a392ee

Browse files
committed
Cleanup
1 parent 901f85f commit 6a392ee

File tree

6 files changed

+39
-36
lines changed

6 files changed

+39
-36
lines changed

grails-plugin-databinding/src/main/groovy/org/grails/plugins/databinding/DataBindingGrailsPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.grails.plugins.databinding
1717

18-
import grails.JavaVersion
18+
import grails.internal.JavaVersion
1919
import grails.plugins.Plugin
2020
import grails.util.GrailsUtil
2121
import grails.web.databinding.DataBindingUtils

grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib/FormTagLib.groovy

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@
1515
*/
1616
package org.grails.plugins.web.taglib
1717

18-
import grails.JavaVersion
18+
import grails.internal.JavaVersion
1919
import grails.artefact.TagLibrary
2020
import grails.gsp.TagLib
2121
import groovy.transform.CompileStatic
22-
import org.springframework.beans.factory.annotation.Autowired
23-
import org.springframework.core.convert.support.DefaultConversionService
24-
import org.springframework.core.convert.support.GenericConversionService
2522

2623
import java.text.DateFormat
2724
import java.text.DateFormatSymbols
@@ -42,12 +39,7 @@ import org.springframework.http.HttpMethod
4239
import org.springframework.web.servlet.support.RequestContextUtils as RCU
4340
import org.springframework.web.servlet.support.RequestDataValueProcessor
4441

45-
import java.time.LocalDate
46-
import java.time.LocalDateTime
47-
import java.time.LocalTime
48-
import java.time.ZoneId
49-
import java.time.ZonedDateTime
50-
import java.time.temporal.Temporal
42+
import java.time.*
5143
import java.time.temporal.TemporalAccessor
5244

5345
/**

grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib/FormatTagLib.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.grails.plugins.web.taglib
1717

18-
import grails.JavaVersion
18+
import grails.internal.JavaVersion
1919
import grails.artefact.TagLibrary
2020
import grails.gsp.TagLib
2121
import groovy.transform.CompileStatic
@@ -35,7 +35,6 @@ import org.springframework.util.StringUtils
3535

3636
import java.time.LocalDate
3737
import java.time.LocalDateTime
38-
import java.time.LocalTime
3938
import java.time.format.DateTimeFormatter
4039
import java.time.temporal.TemporalAccessor
4140

grails-test-suite-web/src/test/groovy/org/grails/web/taglib/FormatTagLibTests.groovy

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@ import java.text.DecimalFormatSymbols
77

88
import org.grails.taglib.GrailsTagException
99

10-
import java.time.LocalDate
11-
import java.time.LocalDateTime
12-
import java.time.LocalTime
13-
import java.time.OffsetDateTime
14-
import java.time.OffsetTime
15-
import java.time.ZoneOffset
16-
import java.time.ZonedDateTime
10+
import java.time.*
1711

1812
/**
1913
* Tests for the FormatTagLib.

grails-web/src/main/groovy/grails/JavaVersion.groovy

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright 2014 original authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package grails.internal
17+
18+
/**
19+
* A class to determine the runtime Java version
20+
*
21+
* @author James Kleeh
22+
* @since 3.2.1
23+
*/
24+
class JavaVersion {
25+
26+
static Boolean isAtLeast(int major, int minor) {
27+
String version = System.getProperty("java.version");
28+
int firstPos = version.indexOf('.');
29+
int currMajor = Integer.parseInt(version.substring(0, firstPos));
30+
int secondPos = version.indexOf('.', firstPos+1);
31+
int currMinor = Integer.parseInt(version.substring(firstPos+1, secondPos));
32+
currMajor >= major && currMinor >= minor
33+
}
34+
}

0 commit comments

Comments
 (0)