Defective Encoder? Or other Issue?

I’m having trouble getting the Encoder to increment any counts on the AM-0180 using the 2015 Java API Encoder Class. getDistance() always returns 0 when stopped or -0.5 when the motor is running, getRate() always returns 0, getStopped() always returns true.
I verified the wiring is correct (orange power, brown ground, blue DIO0 signal, yellow DIO1 signal). Opening the cover, the LED transmitter is illuminated and the encoder does spin with the shaft.
Code is below. Any ideas? Could this encoder be defective? Or are others having trouble with the new API?

import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

public class TestEncoder {
Encoder encoder;

public TestEncoder(int source1, int source2) {
	encoder = new Encoder(source1, source2);
	encoder.setDistancePerPulse(2);
	encoder.reset();
	
}



public void printStatus() {
	double rotations;
	rotations=encoder.getDistance();
	SmartDashboard.putNumber("Rotations", rotations);
	SmartDashboard.putNumber("Rate", encoder.getRate());
	SmartDashboard.putBoolean("Stopped", encoder.getStopped());
	
}

}

Is it possible that the distance is toggling between 0 and -0.5 on every tick? This would indicate that one of the encoder outputs is not working / being read. Do you have a scope? Another option is to read the two values as digital inputs to eliminate the encoder class.

Resolved! Good call – turns out the digital output wire itself on the cable (AM-0175) was bad, all the way to the connector. Made a custom temporary connector and it works fine. Will have to order another.