Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Write to static field from instance method org.usfirst.frc.team2729.robot.Robot.robotInit() #9

@rjbohinski

Description

@rjbohinski

Static fields that this bug applies to:

public static DriveTrain driveTrain;
public static IntakeSystem intake;
public static ShootingSystem shoot;
public static HangingSystem hang;
public static VisionSystem vision;
public static OI oi;

...

public void robotInit() {
...
    driveTrain = new DriveTrain();
    intake = new IntakeSystem();
    shoot = new ShootingSystem();
    hang = new HangingSystem();
    oi = new OI();
    vision = new VisionSystem();

This instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions