Skip to content

Commit

Permalink
remove -server/-client logic in powershell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePrez committed Feb 3, 2023
1 parent f1d083b commit 433fc5b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 47 deletions.
37 changes: 0 additions & 37 deletions core-feature-pack/common/src/main/resources/content/bin/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -389,43 +389,6 @@ Function Get-Java-Version ($javaOpts) {
return $result
}

# Check if can set option to use HotSpot VM
Function Is-Java-Server-Option ($javaOpts) {
if ( -Not ($javaOpts -match '-server') ) {
# Check user requested JDK 'data model'
$version = Get-Java-Version ($javaOpts)

# Check if data model is supported by JDK
# Check for SUN(tm) JVM w/ HotSpot support
# Check for OpenJDK JVM w/server support
if ($LASTEXITCODE -eq 1) {
Write-Host $version
} elseif ($version -match 'HotSpot' -or $version -match 'OpenJDK' -or $version -match 'IBM J9') {
return $true
}
}

return $false
}

# For stanalone mode, check if client option could be set, if not try to set server option
Function Set-Java-Client-Option ($javaOpts) {
if ( -Not($javaOpts -match '-server') -and -Not($javaOpts -match '-client') ) {
# Check user requested JDK 'data model'
$version = Get-Java-Version ($javaOpts)

if ($LASTEXITCODE -eq 1) {
Write-Host $version
} elseif ($version -match 'Client VM') {
$javaOpts = ,"-client" + $javaOpts
} elseif ($version -match 'hotspot' -or $version -match 'openJDK' -or $version -match 'IBM J9') {
$javaOpts = ,"-server" + $javaOpts
}
}

return $javaOpts
}

Function Set-Global-Variables {
PARAM(
[Parameter(Mandatory=$true)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ if ($SECMGR) {
$MODULE_OPTS +="-secmgr";
}

if (Is-Java-Server-Option $JAVA_OPTS) {
$JAVA_OPTS = ,"-server" + $JAVA_OPTS
$HOST_CONTROLLER_JAVA_OPTS = ,"-server" + $HOST_CONTROLLER_JAVA_OPTS
$PROCESS_CONTROLLER_JAVA_OPTS = ,"-server" + $PROCESS_CONTROLLER_JAVA_OPTS
}

Set-Global-Variables-Domain

# consolidate the host-controller and command line opts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ if ($SECMGR) {
$MODULE_OPTS +="-secmgr";
}

if($PRESERVE_JAVA_OPTS -ne 'true') {
$JAVA_OPTS = Set-Java-Client-Option $JAVA_OPTS
}

# Set debug settings if not already set
if ($global:DEBUG_MODE){
if ($JAVA_OPTS -notcontains ('-agentlib:jdwp')){
Expand Down

0 comments on commit 433fc5b

Please sign in to comment.