8000 Use jimport naming convention for Java types · scijava/scyjava@c8867a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit c8867a3

Browse files
committed
Use jimport naming convention for Java types
1 parent 22adb73 commit c8867a3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/scyjava/_introspect.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line ch 8000 ange
@@ -85,20 +85,20 @@ def jsource(data):
8585
The object or class or fully qualified class name to check for source code.
8686
:return: The URL of the java class
8787
"""
88-
types = jimport("org.scijava.util.Types")
89-
sf = jimport("org.scijava.search.SourceFinder")
90-
jstring = jimport("java.lang.String")
88+
Types = jimport("org.scijava.util.Types")
89+
SourceFinder = jimport("org.scijava.search.SourceFinder")
90+
String = jimport("java.lang.String")
9191
try:
9292
if not isjava(data) and isinstance(data, str):
9393
try:
9494
data = jimport(data) # check if data can be imported
9595
except Exception as err:
9696
raise ValueError(f"Not a Java object {err}")
9797
jcls = data if jinstance(data, "java.lang.Class") else jclass(data)
98-
if types.location(jcls).toString().startsWith(jstring("jrt")):
98+
if Types.location(jcls).toString().startsWith(String("jrt")):
9999
# Handles Java RunTime (jrt) exceptions.
100100
raise ValueError("Java Builtin: GitHub source code not available")
101-
url = sf.sourceLocation(jcls, None)
101+
url = SourceFinder.sourceLocation(jcls, None)
102102
urlstring = url.toString()
103103
return urlstring
104104
except jimport("java.lang.IllegalArgumentException") as err:

0 commit comments

Comments
 (0)
0