File tree Expand file tree Collapse file tree 6 files changed +39
-36
lines changed
grails-plugin-databinding/src/main/groovy/org/grails/plugins/databinding
grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib
grails-test-suite-web/src/test/groovy/org/grails/web/taglib
grails-web/src/main/groovy/grails Expand file tree Collapse file tree 6 files changed +39
-36
lines changed Original file line number Diff line number Diff line change 1515 */
1616package org.grails.plugins.databinding
1717
18- import grails.JavaVersion
18+ import grails.internal. JavaVersion
1919import grails.plugins.Plugin
2020import grails.util.GrailsUtil
2121import grails.web.databinding.DataBindingUtils
Original file line number Diff line number Diff line change 1515 */
1616package org.grails.plugins.web.taglib
1717
18- import grails.JavaVersion
18+ import grails.internal. JavaVersion
1919import grails.artefact.TagLibrary
2020import grails.gsp.TagLib
2121import 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
2623import java.text.DateFormat
2724import java.text.DateFormatSymbols
@@ -42,12 +39,7 @@ import org.springframework.http.HttpMethod
4239import org.springframework.web.servlet.support.RequestContextUtils as RCU
4340import 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.*
5143import java.time.temporal.TemporalAccessor
5244
5345/**
Original file line number Diff line number Diff line change 1515 */
1616package org.grails.plugins.web.taglib
1717
18- import grails.JavaVersion
18+ import grails.internal. JavaVersion
1919import grails.artefact.TagLibrary
2020import grails.gsp.TagLib
2121import groovy.transform.CompileStatic
@@ -35,7 +35,6 @@ import org.springframework.util.StringUtils
3535
3636import java.time.LocalDate
3737import java.time.LocalDateTime
38- import java.time.LocalTime
3938import java.time.format.DateTimeFormatter
4039import java.time.temporal.TemporalAccessor
4140
Original file line number Diff line number Diff line change @@ -7,13 +7,7 @@ import java.text.DecimalFormatSymbols
77
88import 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.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments