GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove dead code in StopJob.cs (line 164) · Issue #1696 · PowerShell/PowerShell

Remove dead code in StopJob.cs (line 164) #1696

New issue
Copy link
New issue
Copy link
Closed
Closed
Remove dead code in StopJob.cs (line 164)#1696
Copy link
Labels
Issue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalitythe issue is for cleaning up the code with no impact on functionalityResolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

Description

@PaulHigin
Paul Higinbotham (PaulHigin)
opened on Aug 9, 2016
Issue body actions

Jason found this through code inspection. This code will never run because of the previous if statement and in fact the code is duplicated in the HandleStopJobCompleted() where it is correct. So we can simply remove the code at line 164.

var parentJob = job as ContainerParentJob;
if (parentJob != null && parentJob.ExecutionError.Count > 0)
{
    foreach (
        var e in
            parentJob.ExecutionError.Where(
                e => e.FullyQualifiedErrorId == "ContainerParentJobStopError"))
    {
        WriteError(e);
    }
}

Activity

  1. Paul Higinbotham (PaulHigin)
    self-assigned this
    on Aug 9, 2016
  2. Travis Plunk (TravisEz13)
    added
    WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
    on Aug 11, 2016
  3. Steve Lee (SteveL-MSFT)
    added this to the This milestone has been deleted milestone on Aug 11, 2016
  4. Paul Higinbotham (PaulHigin)
    removed their assignment
    on Feb 8, 2017
  5. Joey Aiello (joeyaiello)
    removed this from the This milestone has been deleted milestone on May 23, 2017
  6. joeyaiello commented on May 23, 2017

    @joeyaiello
    Joey Aiello (joeyaiello)
    on May 23, 2017
    Contributor
    More actions

    If we have a "code cleanup" label at some point, this would fall under it.

  7. Joey Aiello (joeyaiello)
    added
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on May 23, 2017
  8. Steve Lee (SteveL-MSFT)
    added
    Issue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalitythe issue is for cleaning up the code with no impact on functionality
    on Jun 1, 2017
  9. travisty- commented on Oct 12, 2017

    @travisty-
    Travis Kinney (travisty-)
    on Oct 12, 2017
    Contributor
    More actions

    Hi PowerShell Team (@PowerShell), I just submit a PR (#5091) for this issue.

  10. dantraMSFT commented on Oct 12, 2017

    @dantraMSFT
    Dan Travison (dantraMSFT)
    on Oct 12, 2017
    Contributor
    More actions

    Paul Higinbotham (@PaulHigin) I seem to be missing something with this issue and the associated PR. HandleStopJobCompleted appears to be only used for Job2 instances and not Job instances. While the code is duplicated, removing it for Job instances doesn't appear to be correct.

    Paul explained it to me off line. Job does not derive from ContainerParentJob so, other than the job.StopJob() statement, the rest of the else cause is dead code.

  11. Mike Richmond (mirichmo)
    closed this as completedin #5091on Oct 16, 2017
  12. Ilya (iSazonov)
    added
    Resolution-FixedThe issue is fixed.The issue is fixed.
    on Oct 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalitythe issue is for cleaning up the code with no impact on functionalityResolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.