test_class.declarator: lineDecoder = new LineDecoder(new LocationReferencePointDecoder())
test_class.original_string: LineDecoder lineDecoder = new LineDecoder(new LocationReferencePointDecoder());
test_class.type: LineDecoder
test_class.var_name: lineDecoder
test_class.file: proto/src/test/java/openlr/proto/decoder/LineDecoderTest.java
test_class.identifier: LineDecoderTest
test_case.body: @Test
      public void testInvalidLocationReference() {
          Coordinates firstCoordinates = Coordinates.newBuilder()
                  .setLongitude(1)
                  .setLatitude(2)
                  .build();
  
          LineAttributes firstLineAttributes = LineAttributes.newBuilder()
                  .setBearing(90)
                  .setFrc(FRC.FRC_0)
                  .setFow(FOW.FOW_MOTORWAY)
                  .build();
  
          PathAttributes firstPathAttributes = PathAttributes.newBuilder()
                  .setDistanceToNext(100)
                  .setLowestFrcAlongPath(FRC.FRC_1)
                  .build();
  
          LocationReferencePoint first = LocationReferencePoint.newBuilder()
                  .setCoordinates(firstCoordinates)
                  .setLineAttributes(firstLineAttributes)
                  .setPathAttributes(firstPathAttributes)
                  .build();
  
          LineLocationReference lineLocationReference = LineLocationReference.newBuilder()
                  .addLocationReferencePoints(first)
                  .setPositiveOffset(1)
                  .setNegativeOffset(2)
                  .build();
  
          LocationReferenceData locationReferenceData = LocationReferenceData.newBuilder()
                  .setLineLocationReference(lineLocationReference)
                  .build();
  
          try {
              lineDecoder.decode("1", locationReferenceData);
              fail();
          } catch (PhysicalFormatException e) {
              assertEquals(e.getErrorCode(), OpenLRProtoStatusCode.INVALID_LOCATION_REFERENCE);
          }
      }
test_case.class_method_signature: LineDecoderTest.testInvalidLocationReference()
test_case.full_signature: @Test public void testInvalidLocationReference()
test_case.identifier: testInvalidLocationReference
test_case.invocations: build setLatitude setLongitude newBuilder build setFow setFrc setBearing newBuilder build setLowestFrcAlongPath setDistanceToNext newBuilder build setPathAttributes setLineAttributes setCoordinates newBuilder build setNegativeOffset setPositiveOffset addLocationReferencePoints newBuilder build setLineLocationReference newBuilder decode fail assertEquals getErrorCode
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInvalidLocationReference()
focal_class.declarator: locationReferencePointDecoder
focal_class.modifier: private final
focal_class.original_string: private final LocationReferencePointDecoder locationReferencePointDecoder;
focal_class.type: LocationReferencePointDecoder
focal_class.var_name: locationReferencePointDecoder
focal_class.file: proto/src/main/java/openlr/proto/decoder/LineDecoder.java
focal_class.identifier: LineDecoder
focal_class.interfaces: implements LocationReferenceDecoder
focal_class.class_method_signature: LineDecoder.LineDecoder(LocationReferencePointDecoder locationReferencePointDecoder)
focal_class.full_signature:   LineDecoder(LocationReferencePointDecoder locationReferencePointDecoder)
focal_class.identifier: LineDecoder
focal_class.parameters: (LocationReferencePointDecoder locationReferencePointDecoder)
focal_class.signature:  LineDecoder(LocationReferencePointDecoder locationReferencePointDecoder)
focal_class.class_method_signature: LineDecoder.decode(String id, LocationReferenceData data)
focal_class.full_signature: @Override public RawLocationReference decode(String id, LocationReferenceData data)
focal_class.identifier: decode
focal_class.modifiers: @Override public
focal_class.parameters: (String id, LocationReferenceData data)
focal_class.return: RawLocationReference
focal_class.signature: RawLocationReference decode(String id, LocationReferenceData data)
focal_method.body: @Override
      public RawLocationReference decode(String id, LocationReferenceData data) throws OpenLRProtoException {
          if (!data.hasLineLocationReference()) {
              throw new OpenLRProtoException(OpenLRProtoStatusCode.MISSING_LOCATION_REFERENCE);
          }
  
          LineLocationReference lineLocationReference = data.getLineLocationReference();
  
          int lrpCount = lineLocationReference.getLocationReferencePointsCount();
  
          if (lrpCount < 2) {
              throw new OpenLRProtoException(OpenLRProtoStatusCode.INVALID_LOCATION_REFERENCE);
          }
  
          List<LocationReferencePoint> locationReferencePoints = new ArrayList<>();
  
          for (int sequenceNumber = 1; sequenceNumber <= lrpCount; sequenceNumber++) {
              LocationReferencePoint locationReferencePoint = locationReferencePointDecoder.decode(
                      lineLocationReference.getLocationReferencePoints(sequenceNumber - 1),
                      sequenceNumber,
                      sequenceNumber == lrpCount);
              locationReferencePoints.add(locationReferencePoint);
          }
  
          Offsets offsets = new OffsetsProtoImpl(
                  lineLocationReference.getPositiveOffset(),
                  lineLocationReference.getNegativeOffset());
  
          return new RawLineLocRef(id, locationReferencePoints, offsets);
      }
focal_method.class_method_signature: LineDecoder.decode(String id, LocationReferenceData data)
focal_method.full_signature: @Override public RawLocationReference decode(String id, LocationReferenceData data)
focal_method.identifier: decode
focal_method.invocations: hasLineLocationReference getLineLocationReference getLocationReferencePointsCount decode getLocationReferencePoints add getPositiveOffset getNegativeOffset
focal_method.modifiers: @Override public
focal_method.parameters: (String id, LocationReferenceData data)
focal_method.return: RawLocationReference
focal_method.signature: RawLocationReference decode(String id, LocationReferenceData data)