eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

Unnecessary java.net.MalformedURLException: unknown protocol: no-such-protocol #2020

Closed eclipse-ocl-bot closed 3 hours ago

eclipse-ocl-bot commented 3 hours ago

| --- | --- | | Bugzilla Link | 542546 | | Status | RESOLVED FIXED | | Importance | P3 enhancement | | Reported | Dec 08, 2018 05:43 EDT | | Modified | Dec 11, 2018 12:48 EDT | | See also | 364797 | | Reporter | Ed Willink |

Description

In Bug 364797, Classic OCL established a URI mapping from

http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore 

to

no-such-protocol://this/does/not/exist

to ensure that resolution of references to OCL standard library elements failed promptly on a bad protocol without waiting for an HTTP 404 from www.eclipse.org. The failure ensures that the OCL standard library is initialized programmatically.

QVTo transformation execution uses generic OCL loading and so incurs the cost of the MalformedURLException. This could be avoided if QVTo requested programmatic initialization directly. Inefficient call path below:

Thread [main] (Suspended (breakpoint at line 278 in ResourceSetImpl)) \ ResourceSetImpl.demandLoadHelper(Resource) line: 278 \ ResourceSetImpl.getResource(URI, boolean) line: 406 \ OCLStandardLibraryImpl.init() line: 214 \ OCLStandardLibraryImpl.() line: 91 \ EcoreOCLStandardLibrary.() line: 39 \ QvtOperationalStdLibrary.() line: 70 \ QvtOperationalFileEnv.(URI, EPackage$Registry) line: 40 \ QvtOperationalEnvFactory.createEnvironment(URI) line: 85 \ QVTOCompiler.parse(UnitProxy, QvtCompilerOptions) line: 226 \ QVTOCompiler.doCompile(UnitProxy, QvtCompilerOptions, IProgressMonitor) line: 362 \ QVTOCompiler.compileSingleFile(UnitProxy, QvtCompilerOptions, IProgressMonitor) line: 322 \ QVTOCompiler.compile(UnitProxy[], QvtCompilerOptions, IProgressMonitor) line: 186 \ QVTOCompiler.compile(UnitProxy, QvtCompilerOptions, IProgressMonitor) line: 208 \ CstTransformation.getCompiledUnit(IProgressMonitor) line: 74 \ CstTransformation.doLoad(IProgressMonitor) line: 97 \ CstTransformation.loadTransformation(IProgressMonitor) line: 228 \ CstTransformation.getTransformation(IProgressMonitor) line: 189 \ InternalTransformationExecutor$TracesAwareExecutor(InternalTransformationExecutor).doLoad(IProgressMonitor) line: 255 \ InternalTransformationExecutor$TracesAwareExecutor(InternalTransformationExecutor).loadTransformation(IProgressMonitor) line: 121 \ TransformationExecutor.loadTransformation(IProgressMonitor) line: 132 \ TransformationExecutor.loadTransformation() line: 116 \ QVToTransformationExecutor.invokeInternal(WorkflowContext, ProgressMonitor, Issues) line: 141 \ QVToTransformationExecutor(AbstractWorkflowComponent).invoke(WorkflowContext, ProgressMonitor, Issues) line: 126 \ Mwe2Bridge.invoke(IWorkflowContext) line: 34 \ QVToTransformationExecutor(AbstractWorkflowComponent).invoke(IWorkflowContext) line: 201 \ Workflow(AbstractCompositeWorkflowComponent).invoke(IWorkflowContext) line: 35 \ Workflow.run(IWorkflowContext) line: 19 \ Mwe2Runner.run(Module, Map<String,String>, IWorkflowContext) line: 102 \ Mwe2Runner.run(URI, Map<String,String>, IWorkflowContext) line: 62 \ Mwe2Runner.run(URI, Map<String,String>) line: 52 \ Mwe2Launcher.run(String[]) line: 78 \ Mwe2Launcher.main(String[]) line: 36

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on Dec 08, 2018 07:37

(In reply to Ed Willink from comment #0)

In Bug 364797, Classic OCL established a URI mapping from

http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore 

to

no-such-protocol://this/does/not/exist

Wrong this is in org.eclipse.ocl.examples.build.utilities.OCLStandaloneSetup and appears to have been an interim solution.

Mapping direct to null activates programmatic construction directly.

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on Dec 11, 2018 12:48

OCLStandaloneSetup init simplified. Exception no longwer occurs.

Pushed to master for 2019-03M1