Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345975

Summary: Invalid syntax in service causing uncaught UnsupportedOperationException instead of syntax error
Product: z_Archived Reporter: Justin Spadea <jspadea>
Component: EDTAssignee: Project Inbox <edt.mofmodel-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mheitz, pharmon, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Justin Spadea CLA 2011-05-16 12:02:38 EDT
This comes from an old automated JUnit testcase that uses invalid syntax. Import the following code, get a build error instead of an error marker. The "serviceReferences" part in the code is the invalid syntax.

java.lang.UnsupportedOperationException
at org.eclipse.edt.compiler.binding.NotFoundBinding.getType(NotFoundBinding.java:60)
at org.eclipse.edt.mof.egl.egl2mof.Egl2MofBase.isEMetadataObject(Egl2MofBase.java:1689)
at org.eclipse.edt.mof.egl.egl2mof.Egl2MofMember.processSettings(Egl2MofMember.java:428)
at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.processSettings(Egl2Mof.java:1)
at org.eclipse.edt.mof.egl.egl2mof.Egl2MofMember.addInitializers(Egl2MofMember.java:647)
at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.addInitializers(Egl2Mof.java:1)
at org.eclipse.edt.mof.egl.egl2mof.Egl2MofMember.addInitializers(Egl2MofMember.java:629)
at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.addInitializers(Egl2Mof.java:1)
at org.eclipse.edt.mof.egl.egl2mof.Egl2MofMember.visit(Egl2MofMember.java:120)
at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
at org.eclipse.edt.compiler.core.ast.ClassDataDeclaration.accept(ClassDataDeclaration.java:88)
at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.handleContents(Egl2MofPart.java:572)
at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.defaultHandleVisitPart(Egl2MofPart.java:331)
at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.visit(Egl2MofPart.java:264)
at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
at org.eclipse.edt.compiler.core.ast.Service.accept(Service.java:44)
at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.convert(Egl2Mof.java:41)




Service CustomerService
  function createCustomer(customer CustomerRec in) 
  end
  function findCustomer(customerID smallint in, customer CustomerRec out)
  end
  function listCustomers(customers CustomerRec[] out)
  end
end

Service RoomSelectionService
  function findAvailableRooms(criteria Criteria in, checkin Date in, checkout Date in, rooms Room[] out)
  end
end

Interface IEmailService{@XML {name="IEmailService", namespace="http:/dave.com"}, alias = "foo"}
  function SendMail(ToAddress string in, FromAddress string in, ASubject string in, MsgBody string in) returns(int);
end

Service ReservationService 
 serviceReferences (CustomerService CustomerService, 
           		  roomSelect RoomSelectionService, 
           		  email IEMailService)

  sDiscount int {@serviceProperty {name="standard"}};
  cDiscount int {@serviceProperty {name="corporate", required=yes}}; 
  localTax  float {@serviceProperty {required=yes}};

  function makeReservation(reservation reservationRec inout)
    CustomerService.createCustomer(reservation.customer);

	rooms Room[];
    roomSelect.findAvailableRooms(reservation.criteria, 
                        reservation.checkin, reservation.checkout, rooms);

    status int = email.SendMail("to", "from", "subject", "message");
  end
   
  function findReservation(lastname string in, 
                           reservation reservationRec out)
  end

  function cancelReservation(reservationNum bigint in)
  end

  function listReservations(reservations reservationRec[] out)
  end
end

Record customerRec
	name String;
end
Record criteria
	stuff any;
end
Record room
end
Record reservationRec
	criteria Criteria;
	checkin date;
	checkout date;
	customer customerRec;
end
Comment 1 Brian Svihovec CLA 2011-12-16 15:47:56 EST
Has this issue been resolved?
Comment 2 Paul Harmon CLA 2012-03-12 15:58:11 EDT
I compiled this (with SDK) and do not get any exceptions (just a few syntax errors).
Comment 3 Justin Spadea CLA 2012-03-14 14:28:33 EDT
Verified I get syntax errors not stack traces.