Skip to content

Commit

Permalink
fix: diff Launch Configs build to the same folder (#943)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaaa committed May 7, 2024
1 parent c270b54 commit 2f6a4dc
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,10 @@ public class IDFBuildConfiguration extends CBuildConfiguration
private String customBuildDir;
private IProgressMonitor monitor;
public boolean isProgressSet;
private ILaunchConfiguration configuration;

public IDFBuildConfiguration(IBuildConfiguration config, String name) throws CoreException
{
super(config, name);
this.configuration = LAUNCH_CONFIG_PROVIDER.getActiveLaunchConfiguration();
}

public IDFBuildConfiguration(IBuildConfiguration config, String name, IToolChain toolChain)
Expand All @@ -135,14 +133,6 @@ public IDFBuildConfiguration(IBuildConfiguration config, String name, IToolChain
{
super(config, name, toolChain, launchMode);
this.toolChainFile = toolChainFile;

Check warning on line 135 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

View workflow job for this annotation

GitHub Actions / spotbugs

EI_EXPOSE_REP2

new com.espressif.idf.core.build.IDFBuildConfiguration(IBuildConfiguration, String, IToolChain, ICMakeToolChainFile, String) may expose internal representation by storing an externally mutable object into IDFBuildConfiguration.toolChainFile
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
try
{
this.configuration = LAUNCH_CONFIG_PROVIDER.getActiveLaunchConfiguration();
}
catch (CoreException e)
{
Logger.log(e);
}
}

@Override
Expand Down Expand Up @@ -233,6 +223,7 @@ public String getProperty(String name)
{
try
{
ILaunchConfiguration configuration = LAUNCH_CONFIG_PROVIDER.getActiveLaunchConfiguration();
if (configuration != null
&& configuration.getType().getIdentifier().equals(IDFLaunchConstants.DEBUG_LAUNCH_CONFIG_TYPE))
{
Expand Down

0 comments on commit 2f6a4dc

Please sign in to comment.