Comments (6)
Possible, or as an option deprecate remove Source.getPath()
what it is good for anyway?
from graal.
@jtulach Just like it can be useful to get the URL
a Source
was loaded from, it can be useful to get the file path it was loaded from, as long as getPath()
only returns non-null if loaded from a file (or explicitly set). Because I couldn't get earlier versions of Source
to behave consistently in this regard, I had to retain this information by associating each Source
with an object of my own that tells how the Source
was constructed. However, this breaks down in certain cases, e.g. when the Source
has not been constructed by my own code (think polyglot).
from graal.
The same information should be available from the getURI() method:
if (source.getURI().getScheme().equals("file")) {
File f = new File(source.getURI());
}
We want to use getURI()
as a persistent identification of source. Thus I recommend to rely on that one rather than using getPath()
which doesn't have any real meaning (as far as I can tell) and I'd like to get rid of it, if possible.
from graal.
@jtulach That's pretty much what I ended up with. Do you also plan to get rid of getURL()
?
from graal.
Right. That method seems really obsolete now when there is getURI()
.
from graal.
For my language, it makes a difference whether a Source
has been loaded from a file or (possibly a file://) URL. However, I'm keeping track of this on my own, and have given up on the idea that I can deduce this from Source
. Hence, having getPath()
and getURL()
is no longer essential to me. Closing.
from graal.
Related Issues (20)
- Native-image of CLI application is failing with less than 32 GB of virtual memory HOT 3
- reflect-config-schema-v1.0.0.json doesn't mention certain attributes that can actually be supplied
- Problem java.lang.NoClassDefFoundError: sun/misc/Unsafe
- [GR-52454] Native Image shutdown hooks don't run upon SIGINT HOT 2
- [GR-52453] [jfr] jdk.ContainerConfiguration doesn't set hostTotalMemory correctly
- [GR-52484] [jfr] jdk.PhysicalMemory event doesn't set 'usedSize' HOT 3
- Is there any problem with graalvm checking illegal strings? HOT 2
- [GR-52483] Native Image call graph imprecision HOT 7
- [GR-52515] META-INF/native-image/... files are ignored in some JARs (large, zip64, self-extracting) HOT 6
- Main entry point class 'HelloWorld.java' neither found on... on M2 HOT 5
- [GR-52475] Error with native image for ktfmt - Resource not found: /org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment$Companion.class HOT 1
- Is there anything missing when graalvm-11uses JVM parameters to run java code? HOT 3
- GraalVM crashes with "fatal error: Initial size of CodeCache is too small" HOT 2
- [GR-52473] Serialization of arrays is not supported in Native Image HOT 4
- Classes not getting initialized HOT 1
- Build a spring boot3 project with hibernate-search and lucene backend, throw a 'undefined reference' error HOT 1
- [GR-52560] Size regression from GraalVM CE 23.0 to GraalVM for JDK 21 (CE) for `byte[] for code metadata` HOT 2
- JSON Metadata Versioning, Backwards Compatibility, and Evolution
- [GR-52553] Defining new classes at runtime is not supported HOT 2
- [GR-52591] Warning: Error processing trace entry map(size=5, {(tracer,reflect),(function,getSystemResource),(caller_class,org.apache.logging.log4j.core.util.Loader),(result,true),(args,[null])}): java.lang.NullPointerException HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graal.