Skip to content
This repository has been 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

Open
rjbohinski opened this issue Mar 19, 2016 · 0 comments

Comments

@rjbohinski
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant