[jbosstools-issues] [JBoss JIRA] (JBIDE-23867) OCBinary: is mixing platform independent with dependent code
Rob Stryker (JIRA)
issues at jboss.org
Mon Feb 6 17:00:00 EST 2017
[ https://issues.jboss.org/browse/JBIDE-23867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13359341#comment-13359341 ]
Rob Stryker commented on JBIDE-23867:
-------------------------------------
{code|
commit a340f929df783e55d199755c034768184b24fad4
Author: Rob Stryker <rob at oxbeef.net>
Date: Mon Feb 6 16:32:55 2017 -0500
{code}
It's mostly a bunch of cleanup to make things more clear for andre.
> OCBinary: is mixing platform independent with dependent code
> ------------------------------------------------------------
>
> Key: JBIDE-23867
> URL: https://issues.jboss.org/browse/JBIDE-23867
> Project: Tools (JBoss Tools)
> Issue Type: Enhancement
> Components: openshift
> Affects Versions: 4.4.3.AM2
> Reporter: Andre Dietisheim
> Assignee: Rob Stryker
> Fix For: 4.4.3.Final
>
>
> OCBinary is suing enums for the different platform. The platform instance is chosen right when you get the instance that you want to work with:
> {code}
> OCBinary#getInstance
> {code}
> {code}
> public static OCBinary getInstance() {
> if (SystemUtils.IS_OS_WINDOWS) {
> return WINDOWS;
> } else {
> return OTHER;
> }
> }
> {code}
> But then, latter code (that was introduced later in #getSystemPathLocation ignoring it and start being platform independent again, even setting the default to be linux:
> {code}
> public String getSystemPathLocation() {
> if (locationBinary == null) {
> this.locationBinary = new CommandLocationBinary("oc");
> locationBinary.addPlatformLocation(Platform.OS_LINUX, OC_DEFAULTLOCATION_LINUX);
> locationBinary.setDefaultPlatform(Platform.OS_LINUX);
> }
> return locationBinary.findLocation();
> }
> {code}
> Even worse is that the above code hard-codes the oc binary to be "oc" while the enum for windows is defining it as "oc.exe"
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jbosstools-issues
mailing list