Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Commit 7fdcb84

Browse files
committed
Release 1.1.1 (released 27.02.2015)
1 parent 760792b commit 7fdcb84

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

regex4ls.ls

+23-4
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ UseLSX "*javacon"
1212
See the documentation of the individual classes for code examples.
1313
%END REM
1414

15-
REM Version: v1.1.0
15+
REM Version: v1.1.1
1616

1717
REM Author: Harald Albers, HS - Hamburger Software GmbH & Co. KG
1818

1919
%REM Copyright
20-
Copyright (C) 2010 HS - Hamburger Software GmbH & Co. KG. All rights reserved.
20+
Copyright (C) 2015 HS - Hamburger Software GmbH & Co. KG. All rights reserved.
2121

2222
This library is released under the Apache Licence Version 2.0, see
2323
http://www.apache.org/licenses/LICENSE-2.0.txt
@@ -158,7 +158,7 @@ Class AbstractRegexMatcher
158158
Dim jSession As New JavaSession
159159
Dim jPatternClass As JavaClass
160160
Set jPatternClass = jSession.GetClass("java/util/regex/Pattern")
161-
Set jPatternFactoryMethod = jPatternClass.GetMethod("compile",_
161+
Set jPatternFactoryMethod = getJavaMethod(jPatternClass, "compile",_
162162
"(Ljava/lang/String;I)Ljava/util/regex/Pattern;")
163163
End Sub
164164
@@ -373,4 +373,23 @@ Class RegexMatcher As AbstractRegexMatcher
373373
replaceFirst = jMatcher.replaceFirst(Replacement)
374374
End Function
375375

376-
End Class
376+
End Class
377+
378+
379+
%REM
380+
Gets the JavaMethod with the specified name and signature from the given JavaClass.
381+
This is needed to avoid "LS2J Error: Threw java.lang.InternalError" errors on recent
382+
Domino versions when accessing Pattern.compile(String, int).
383+
%END REM
384+
Private Function getJavaMethod(jClass As JavaClass, methodName As String, signature As String) As JavaMethod
385+
Dim jMCollection As JavaMethodCollection
386+
Set jMCollection = jClass.getClassMethods()
387+
388+
ForAll m In jMCollection
389+
If m.Methodname = methodName And m.Signature = signature Then
390+
Set getJavaMethod = m
391+
Exit Function
392+
End If
393+
End ForAll
394+
Error 1, "Method not found"
395+
End Function

0 commit comments

Comments
 (0)