Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357247 - Java code is not copied during deployment
Summary: Java code is not copied during deployment
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P1 blocker (vote)
Target Milestone: ---   Edit
Assignee: Paul Harmon CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-09 11:06 EDT by Joseph Vincens CLA
Modified: 2017-02-23 14:15 EST (History)
3 users (show)

See Also:


Attachments
Testcase. (611 bytes, application/octet-stream)
2011-09-16 16:39 EDT, Brian Svihovec CLA
no flags Details
Patch (1.08 KB, patch)
2011-09-19 06:04 EDT, Yun Feng Ma CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Vincens CLA 2011-09-09 11:06:26 EDT
1.Create an EGL project.
2.Add a service.
3.Open the egldd create a new target project.
4.Press the deploy button in the egldd editor.
No java files are copied.
The problem is EclipseUtilities.getJavaSourceFolderName only returns a source folder for an EGL project. The target project is a dynamic web project so you need to get the java source folder from it.

You may need to do something like:
if(EclipseUtilities.getJavaSourceFolderName == null || EclipseUtilities.getJavaSourceFolderName.isEmpty()){

	IJavaProject javaProject = JavaCore.create(project);
	if(javaProject != null && javaProject.exists()){
		int segments = new Path(project.getName()).segmentCount();
		for( IPackageFragmentRoot root : javaProject.getAllPackageFragmentRoots()){
			if(root.getKind() == IPackageFragmentRoot.K_SOURCE){
				name = root.getPath().removeFirstSegments(segments).toOSString();
				break;
			}
		}
	}
Comment 1 Yun Feng Ma CLA 2011-09-13 21:09:22 EDT
This is resolved by the change for bug 357390. Thanks.
Comment 2 Brian Svihovec CLA 2011-09-14 20:51:29 EDT
This defect has been fixed.
Comment 3 Brian Svihovec CLA 2011-09-14 20:52:54 EDT
I thought this was a different bug that I opened.  I am marking it as resolved again so that Joe can verify and close.
Comment 4 Joseph Vincens CLA 2011-09-15 08:27:35 EDT
verified
Comment 5 Brian Svihovec CLA 2011-09-16 16:39:54 EDT
Created attachment 203528 [details]
Testcase.
Comment 6 Brian Svihovec CLA 2011-09-16 16:41:10 EDT
In the attached testcase, the constructor for Span cannot be found at runtime.

This was found in the RUI Technical Sample, but I have worked around it for now.
Comment 7 Yun Feng Ma CLA 2011-09-19 06:04:57 EDT
Created attachment 203579 [details]
Patch

I think this is an issue in Egl2Mof, here is a patch, need Paul review.
Comment 8 Yun Feng Ma CLA 2011-09-19 06:06:54 EDT
Hi Paul,

Please review the patch. Thanks.

Please see Brian's comment in comment 6. You can download Brian's test case, and deployment it.

Thanks.
Comment 9 Brian Svihovec CLA 2011-09-23 09:39:09 EDT
Re-assigning to Paul temporarily so that he can review the patch proposed by Yun Feng.
Comment 10 Paul Harmon CLA 2011-09-26 15:43:46 EDT
I have fixed this with a change to IRUtils.

The problem is that the NewExpression does not directly hold onto the type that is being "newed". Because of this, the visitor is not getting to the referenced Part. I have added an explicit visit for NewExpression to force the  type to be loaded.
Comment 11 Joseph Vincens CLA 2011-10-03 09:13:29 EDT
verified