Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jdk17u
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
openjdk
jdk17u
Commits
3dc86bb8
Commit
3dc86bb8
authored
10 years ago
by
Attila Szegedi
Browse files
Options
Downloads
Patches
Plain Diff
8054411: Add nashorn.args.prepend system property
Reviewed-by: hannesw, jlaskey
parent
5d2615f1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
nashorn/src/jdk/nashorn/internal/runtime/options/Options.java
+16
-9
16 additions, 9 deletions
...orn/src/jdk/nashorn/internal/runtime/options/Options.java
with
16 additions
and
9 deletions
nashorn/src/jdk/nashorn/internal/runtime/options/Options.java
+
16
−
9
View file @
3dc86bb8
...
@@ -78,7 +78,10 @@ public final class Options {
...
@@ -78,7 +78,10 @@ public final class Options {
/** The options map of enabled options */
/** The options map of enabled options */
private
final
TreeMap
<
String
,
Option
<?>>
options
;
private
final
TreeMap
<
String
,
Option
<?>>
options
;
/** System property that can be used for command line option propagation */
/** System property that can be used to prepend options to the explicitly specified command line. */
private
static
final
String
NASHORN_ARGS_PREPEND_PROPERTY
=
"nashorn.args.prepend"
;
/** System property that can be used to append options to the explicitly specified command line. */
private
static
final
String
NASHORN_ARGS_PROPERTY
=
"nashorn.args"
;
private
static
final
String
NASHORN_ARGS_PROPERTY
=
"nashorn.args"
;
/**
/**
...
@@ -419,15 +422,9 @@ public final class Options {
...
@@ -419,15 +422,9 @@ public final class Options {
*/
*/
public
void
process
(
final
String
[]
args
)
{
public
void
process
(
final
String
[]
args
)
{
final
LinkedList
<
String
>
argList
=
new
LinkedList
<>();
final
LinkedList
<
String
>
argList
=
new
LinkedList
<>();
addSystemProperties
(
NASHORN_ARGS_PREPEND_PROPERTY
,
argList
);
Collections
.
addAll
(
argList
,
args
);
Collections
.
addAll
(
argList
,
args
);
addSystemProperties
(
NASHORN_ARGS_PROPERTY
,
argList
);
final
String
extra
=
getStringProperty
(
NASHORN_ARGS_PROPERTY
,
null
);
if
(
extra
!=
null
)
{
final
StringTokenizer
st
=
new
StringTokenizer
(
extra
);
while
(
st
.
hasMoreTokens
())
{
argList
.
add
(
st
.
nextToken
());
}
}
while
(!
argList
.
isEmpty
())
{
while
(!
argList
.
isEmpty
())
{
final
String
arg
=
argList
.
remove
(
0
);
final
String
arg
=
argList
.
remove
(
0
);
...
@@ -509,6 +506,16 @@ public final class Options {
...
@@ -509,6 +506,16 @@ public final class Options {
}
}
}
}
private
static
void
addSystemProperties
(
final
String
sysPropName
,
final
List
<
String
>
argList
)
{
final
String
sysArgs
=
getStringProperty
(
sysPropName
,
null
);
if
(
sysArgs
!=
null
)
{
final
StringTokenizer
st
=
new
StringTokenizer
(
sysArgs
);
while
(
st
.
hasMoreTokens
())
{
argList
.
add
(
st
.
nextToken
());
}
}
}
private
static
OptionTemplate
getOptionTemplate
(
final
String
key
)
{
private
static
OptionTemplate
getOptionTemplate
(
final
String
key
)
{
for
(
final
OptionTemplate
t
:
Options
.
validOptions
)
{
for
(
final
OptionTemplate
t
:
Options
.
validOptions
)
{
if
(
t
.
matches
(
key
))
{
if
(
t
.
matches
(
key
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment