Skip to content

Commit df3cc3f

Browse files
committed
Workaround to support pre-1.6 JSEs
1 parent 953307e commit df3cc3f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/main/groovy/com/admc/gradle/JavaPropFile.groovy

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,12 @@ Failed to resolve DomainExtensionObject ref though succeeded earlier:
891891
sb.append(it).append('\n')
892892
pText = sb + '\u0003=\n'
893893
workPs.clear()
894-
workPs.load(new StringReader(pText))
894+
try {
895+
workPs.load(new StringReader(pText))
896+
} catch (MissingMethodException mme) {
897+
// Hack is workaround for pre-1.6 Java
898+
workPs.load(new StringBufferInputStream(pText))
899+
}
895900
tmpList = workPs.propertyNames().toList()
896901
if (tmpList.size() < 2) return
897902
assert tmpList.size() == 2:
@@ -909,8 +914,14 @@ Failed to resolve DomainExtensionObject ref though succeeded earlier:
909914
firstDelim = '\0'
910915
for (i in (firstNonWs + 1) .. sb.length()) {
911916
workPs.clear()
912-
workPs.load(new StringReader(sb.substring(firstNonWs, i)
913-
+ '\u0003\n'))
917+
try {
918+
workPs.load(new StringReader(sb.substring(firstNonWs, i)
919+
+ '\u0003\n'))
920+
} catch (MissingMethodException mme) {
921+
// Hack is workaround for pre-1.6 Java
922+
workPs.load(new StringBufferInputStream(sb.substring(firstNonWs, i)
923+
+ '\u0003\n'))
924+
}
914925
if (workPs.size() == 1
915926
&& workPs.getProperty(workPs.propertyNames()
916927
.toList().first()) == '\u0003') {

0 commit comments

Comments
 (0)