rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
if (target instanceof RuntimeBeanReference) { builder.addPropertyValue("targetBeanName", ((RuntimeBeanReference)target).getBeanName()); }
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(OsgiServiceExporter.class); // parse attributes ParserUtils.parseCustomAttributes(element, builder, new AttributeCallback() { /* * (non-Javadoc...
registerBeanDefinitionParser("bundle", new DependentAbstractSingleBeanDefinitionParser() { protected Class getBeanClass(Element element) { return BundleFactoryBean.class; } });
registerBeanDefinitionParser("bundle", new BundleBeanDefinitionParser());
public void init() { registerBeanDefinitionParser("reference", new ReferenceBeanDefinitionParser()); registerBeanDefinitionParser("service", new ServiceBeanDefinitionParser()); registerBeanDefinitionParser("property-placeholder", new OsgiPropertyPlaceholderDefinitionParser()); registerBeanDefinitionParser("con...
WebdavFileObject fo = (WebdavFileObject) getFileSystem().resolveFile(
WebdavFileObject fo = (WebdavFileObject) FileObjectUtils.getAbstractFileObject(getFileSystem().resolveFile(
protected FileObject[] doListChildrenResolved() throws Exception { doAttach(); WebdavResource[] children = new org.apache.webdav.lib.WebdavResource[0]; try { children = resource.listWebdavResources(); } catch (HttpException e) { if (e.getReas...
NameScope.CHILD));
NameScope.CHILD)));
protected FileObject[] doListChildrenResolved() throws Exception { doAttach(); WebdavResource[] children = new org.apache.webdav.lib.WebdavResource[0]; try { children = resource.listWebdavResources(); } catch (HttpException e) { if (e.getReas...
WebdavFileObject parent = (WebdavFileObject) getParent();
WebdavFileObject parent = (WebdavFileObject) FileObjectUtils.getAbstractFileObject(getParent());
private void processParentDavResource() throws FileSystemException { WebdavFileObject parent = (WebdavFileObject) getParent(); try { // after this our resource should be reset parent.doListChildrenResolved(); } catch (Exception e) { throw...
assertNotNull(mock.getEntry(MockBundleTest.class.getPackage().getName().replace(".", "/")
assertNotNull(mock.getEntry(MockBundleTest.class.getPackage().getName().replace('.', '/')
public void testGetEntry() throws Exception { assertNotNull(mock.getEntry(MockBundleTest.class.getPackage().getName().replace(".", "/") + "/MockBundleTest.class")); }
assertNotNull(mock.getResource(MockBundleTest.class.getPackage().getName().replace(".", "/")
assertNotNull(mock.getResource(MockBundleTest.class.getPackage().getName().replace('.', '/')
public void testGetResource() { assertNotNull(mock.getResource(MockBundleTest.class.getPackage().getName().replace(".", "/") + "/MockBundleTest.class")); }
assertNotNull(mock.getResources(MockBundleTest.class.getPackage().getName().replace(".", "/")));
assertNotNull(mock.getResources(MockBundleTest.class.getPackage().getName().replace('.', '/')));
public void testGetResources() throws Exception { assertNotNull(mock.getResources(MockBundleTest.class.getPackage().getName().replace(".", "/"))); }
doddle.getOptionDialog().loadOption(new File(openDir, "option.txt"));
doddle.getOptionDialog().loadOption(new File(openDir, "option.txt"), doddle.getCurrentProject().getDisambiguationPanel());
public void actionPerformed(ActionEvent e) { JFileChooser chooser = new JFileChooser(DODDLE.PROJECT_DIR); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int retval = chooser.showOpenDialog(DODDLE.rootPane); if (retval != JFileChooser.APPROVE_OPTION) { return; } openD...
doddle.getOptionDialog().loadOption(new File(openDir, "option.txt"));
doddle.getOptionDialog().loadOption(new File(openDir, "option.txt"), doddle.getCurrentProject().getDisambiguationPanel());
public void run() { try { DODDLE.STATUS_BAR.setLastMessage("プロジェクト復元完了"); DODDLE.STATUS_BAR.startTime(); DODDLE.STATUS_BAR.initNormal(17); DODDLE.STATUS_BAR.lock(); DODDLEProject project = new DODDL...
this.primitiveID = istate.id;
private ShadingState(ShadingState previous, IntersectionState istate, Ray r, int i, int d) { this.r = r; this.istate = istate; this.i = i; this.d = d; this.object = istate.object; // local copy this.hitU = istate.u; this.hitV = istate.v; if (previous == null) ...
if (args.length == 0) { printUsage(); return; } ScriptsRunner runner = new ScriptsRunner(); runner.setProgressIndicator(new ConsoleProgressIndicator( "Scripts execution")); for (int i = 0; i < args.length; i++) { String fileName = args[i];
for (File file : files) {
public static void main(final String args[]) { boolean failed = false; if (args.length == 0) { printUsage(); return; } ScriptsRunner runner = new ScriptsRunner(); runner.setProgressIndicator(new ConsoleProgressIndicator( "Scripts execution")); ...
runner.execute(new File(fileName)); LOG.info("Script " + fileName +
runner.execute(file); LOG.info("Script " + file +
public static void main(final String args[]) { boolean failed = false; if (args.length == 0) { printUsage(); return; } ScriptsRunner runner = new ScriptsRunner(); runner.setProgressIndicator(new ConsoleProgressIndicator( "Scripts execution")); ...
"Script " + fileName + " execution failed.", e);
"Script " + file + " execution failed.", e);
public static void main(final String args[]) { boolean failed = false; if (args.length == 0) { printUsage(); return; } ScriptsRunner runner = new ScriptsRunner(); runner.setProgressIndicator(new ConsoleProgressIndicator( "Scripts execution")); ...
" <file 1>[ ... <file N>]");
" [-options] [<file 1> ... <file N>]"); System.out.println("where options include:"); System.out.println(" -h displays help "); System.out.println(" A ; separated list of directories, JAR archives,\n" + " and ZIP archives to search for drivers.");
private static void printUsage() { System.out.println("Usage java " + ScriptsRunner.class.getName() + " <file 1>[ ... <file N>]"); }
final int baseLen = basePath.length(); if ( !path.startsWith( basePath ) || path.length() == baseLen
if ( path.length() == baseLen
public boolean checkName( final String basePath, final String path, final NameScope scope ) { if ( scope == NameScope.CHILD ) { final int baseLen = basePath.length(); if ( !path.startsWith( basePath ) || ...
final int baseLen = basePath.length(); if ( !path.startsWith( basePath ) || ( path.length() != baseLen && path.charAt( baseLen ) != separatorChar ) )
if ( baseLen > 1 && path.length() > baseLen && path.charAt( baseLen ) != separatorChar )
public boolean checkName( final String basePath, final String path, final NameScope scope ) { if ( scope == NameScope.CHILD ) { final int baseLen = basePath.length(); if ( !path.startsWith( basePath ) || ...
if (filesets.isEmpty()) { files.add(new File(getProject().getBaseDir(), "script.xml"));
if (filesets.isEmpty()) { files.add(new File(getProject().getBaseDir(), "etl.xml"));
public void execute() throws BuildException { List<File> files = new ArrayList<File>(); if (filesets.isEmpty()) { //if no files - script.xml is a default name files.add(new File(getProject().getBaseDir(), "script.xml")); } else { for (FileSet fs : filesets) { ...
m_manager.addProvider( "smb", new SmbFileSystemProvider() ); return m_manager.resolveFile( uri );
getManager().addProvider( "smb", new SmbFileSystemProvider() ); return getManager().resolveFile( uri );
protected FileObject getBaseFolder() throws Exception { final String uri = System.getProperty( "test.smb.uri" ) + "/read-tests"; m_manager.addProvider( "smb", new SmbFileSystemProvider() ); return m_manager.resolveFile( uri ); }
return m_manager.resolveFile( uri );
return getManager().resolveFile( uri );
protected FileObject getWriteFolder() throws Exception { final String uri = System.getProperty( "test.smb.uri" ) + "/write-tests"; return m_manager.resolveFile( uri ); }
new VFSClassLoader( getReadFolder(), getManager() );
new VFSClassLoader( getBaseFolder(), getManager() );
private VFSClassLoader createClassLoader() throws FileSystemException { final VFSClassLoader loader = new VFSClassLoader( getReadFolder(), getManager() ); return loader; }
verifyPackage( getReadFolder(), pack, false );
verifyPackage( pack, false );
public void testLoadClass() throws Exception { final VFSClassLoader loader = createClassLoader(); final Class testClass = loader.loadClass( "code.ClassToLoad" ); final Package pack = testClass.getPackage(); assertEquals( "code", pack.getName() ); verifyPackage( getReadFolder(),...
final URL resource = loader.getResource( "file1.txt" );
final URL resource = loader.getResource( "read-tests/file1.txt" );
public void testLoadResource() throws Exception { final VFSClassLoader loader = createClassLoader(); final URL resource = loader.getResource( "file1.txt" ); assertNotNull( resource ); final URLConnection urlCon = resource.openConnection(); assertSameURLContent( FILE1_CONTENT, u...
verifyPackage( getReadFolder(), pack, true );
verifyPackage( pack, true );
public void testSealing() throws Exception { final VFSClassLoader loader = createClassLoader(); final Class testClass = loader.loadClass( "code.sealed.AnotherClass" ); final Package pack = testClass.getPackage(); assertEquals( "code.sealed", pack.getName() ); verifyPackage( get...
private void verifyPackage( final FileObject baseFolder, final Package pack, boolean sealed )
private void verifyPackage( final Package pack, final boolean sealed )
private void verifyPackage( final FileObject baseFolder, final Package pack, boolean sealed ) throws FileSystemException { if ( baseFolder.getFileSystem().hasCapability( Capability.MANIFEST_ATTRIBUTES ) ) { assertEquals...
if ( baseFolder.getFileSystem().hasCapability( Capability.MANIFEST_ATTRIBUTES ) )
if ( getBaseFolder().getFileSystem().hasCapability( Capability.MANIFEST_ATTRIBUTES ) )
private void verifyPackage( final FileObject baseFolder, final Package pack, boolean sealed ) throws FileSystemException { if ( baseFolder.getFileSystem().hasCapability( Capability.MANIFEST_ATTRIBUTES ) ) { assertEquals...
newFs.addJunction( junctionPoint + "/read-tests", baseFolder.resolveFile( "read-tests" ) );
newFs.addJunction( junctionPoint, baseFolder );
public FileObject getBaseTestFolder( final FileSystemManager manager ) throws Exception { final FileObject baseFolder = config.getBaseTestFolder( manager ); // Create an empty file system, then link in read-tests and write-tests final FileSystem newFs = manager.createFileSystem( "vfs:" ).get...
addComponent(fs); FileSystemKey treeKey = new FileSystemKey(key, fs.getFileSystemOptions()); ((AbstractFileSystem) fs).setCacheKey(treeKey);
protected void addFileSystem(final Comparable key, final FileSystem fs) throws FileSystemException { synchronized (fileSystems) { // Add to the cache addComponent(fs); FileSystemKey treeKey = new FileSystemKey(key, fs.getFileSystemOptions()); ((Abs...
removeComponent(fileSystems);
removeComponent(fs);
public void closeFileSystem(final FileSystem filesystem) { AbstractFileSystem fs = (AbstractFileSystem) filesystem; synchronized (fileSystems) { fileSystems.remove(fs.getCacheKey()); } removeComponent(fileSystems); fs.close(); }
FileSystemKey treeKey = new FileSystemKey(key, fileSystemProps);
protected FileSystem findFileSystem(final Comparable key, final FileSystemOptions fileSystemProps) { synchronized (fileSystems) { FileSystemKey treeKey = new FileSystemKey(key, fileSystemProps); return (FileSystem) fileSystems.get(treeKey); } }
Iterator iterFileSystems = fileSystems.values().iterator(); while (iterFileSystems.hasNext())
item = fileSystems.values().toArray(); } for (int i = 0; i < item.length; ++i) { AbstractFileSystem fs = (AbstractFileSystem) item[i]; if (fs.isReleaseable())
public void freeUnusedResources() { synchronized (fileSystems) { Iterator iterFileSystems = fileSystems.values().iterator(); while (iterFileSystems.hasNext()) { AbstractFileSystem fs = (AbstractFileSystem) iterFileSystems.next(); if (fs...
AbstractFileSystem fs = (AbstractFileSystem) iterFileSystems.next(); if (fs.isReleaseable()) { fs.closeCommunicationLink(); }
fs.closeCommunicationLink();
public void freeUnusedResources() { synchronized (fileSystems) { Iterator iterFileSystems = fileSystems.values().iterator(); while (iterFileSystems.hasNext()) { AbstractFileSystem fs = (AbstractFileSystem) iterFileSystems.next(); if (fs...
MyServiceInterface serviceObj = new MyServiceInterface() {};
MyServiceInterface serviceObj = new MyServiceInterface() { public ClassLoader getContextClassLoader() { return null; } };
public void testGetObjectWithFilterOnly() throws Exception { // OsgiServiceUtils are tested independently in error cases, here we // test the // correct behaviour of the ProxyFactoryBean when OsgiServiceUtils // succesfully // finds the service. this.serviceFactoryBean.setBundleContext(this.bundleContext); this...
this.bundleContext.getBundle(); this.mockControl.setReturnValue(new MockBundle());
this.bundleContext.getBundle(); this.mockControl.setReturnValue(new MockBundle()); this.bundleContext.getBundle(); this.mockControl.setReturnValue(new MockBundle());
public void testGetObjectWithFilterOnly() throws Exception { // OsgiServiceUtils are tested independently in error cases, here we // test the // correct behaviour of the ProxyFactoryBean when OsgiServiceUtils // succesfully // finds the service. this.serviceFactoryBean.setBundleContext(this.bundleContext); this...
final File baseDir = AbstractVfsTestCase.getTestDirectory();
final File baseDir = AbstractVfsTestCase.getTestDirectoryFile();
public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception { final File baseDir = AbstractVfsTestCase.getTestDirectory(); final FileObject baseFile = manager.toFileObject(baseDir); return manager.createVirtualFileSystem(baseFile); }
protected static String extractPort( final StringBuffer name )
private static int extractPort( final StringBuffer name, final String uri ) throws FileSystemException
protected static String extractPort( final StringBuffer name ) { if ( name.length() < 1 || name.charAt( 0 ) != ':' ) { return null; } final int maxlen = name.length(); int pos = 1; for ( ; pos < maxlen; pos++ ) { final char ch = name.charAt( ...
return null;
return -1;
protected static String extractPort( final StringBuffer name ) { if ( name.length() < 1 || name.charAt( 0 ) != ':' ) { return null; } final int maxlen = name.length(); int pos = 1; for ( ; pos < maxlen; pos++ ) { final char ch = name.charAt( ...
return port;
if ( port.length() == 0 ) { throw new FileSystemException( "vfs.provider/missing-port.error", uri ); } return Integer.parseInt( port );
protected static String extractPort( final StringBuffer name ) { if ( name.length() < 1 || name.charAt( 0 ) != ':' ) { return null; } final int maxlen = name.length(); int pos = 1; for ( ; pos < maxlen; pos++ ) { final char ch = name.charAt( ...
m_manager.createFileSystem( "jar", jarFile );
getManager().createFileSystem( "jar", jarFile );
protected FileObject getBaseFolder() throws Exception { topFolder = getTopFolder(); final FileObject jarFile = topFolder.resolveFile( "test.jar" ); // Now build the nested file system final FileObject nestedFS = m_manager.createFileSystem( "jar", jarFile ); return ne...
m_manager.addProvider( "jar", new JarFileSystemProvider() );
getManager().addProvider( "jar", new JarFileSystemProvider() );
protected FileObject getTopFolder() throws Exception { m_manager.addProvider( "jar", new JarFileSystemProvider() ); File jarFile = getTestResource( "nested.jar" ); String uri = "jar:" + jarFile.getAbsolutePath() + "!/"; return m_manager.resolveFile( uri ); }
return m_manager.resolveFile( uri );
return getManager().resolveFile( uri );
protected FileObject getTopFolder() throws Exception { m_manager.addProvider( "jar", new JarFileSystemProvider() ); File jarFile = getTestResource( "nested.jar" ); String uri = "jar:" + jarFile.getAbsolutePath() + "!/"; return m_manager.resolveFile( uri ); }
new VFSClassLoader( objects, m_manager );
new VFSClassLoader( objects, getManager() );
public void testJarClassLoader() throws Exception { FileObject test = topFolder.resolveFile( "normal.jar" ); final FileObject[] objects = { test }; VFSClassLoader loader = new VFSClassLoader( objects, m_manager ); Class testClass = loader.loadClass( "code.ClassToLoad" ); ...
assertSameURLContent( m_charContent, urlCon );
assertSameURLContent( getCharContent(), urlCon );
public void testJarClassLoader() throws Exception { FileObject test = topFolder.resolveFile( "normal.jar" ); final FileObject[] objects = { test }; VFSClassLoader loader = new VFSClassLoader( objects, m_manager ); Class testClass = loader.loadClass( "code.ClassToLoad" ); ...
int stackPos = 0;
int stackTop = state.getStackTop(); int stackPos = stackTop;
public void intersect(Ray r, IntersectionState state) { float intervalMin = r.getMin(); float intervalMax = r.getMax(); float orgX = r.ox; float dirX = r.dx, invDirX = 1 / dirX; float t1, t2; t1 = (bounds.getMinimum().x - orgX) * invDirX; t2 = (bounds.getMaximum().x ...
protected Object doGetAttribute( String atttrName )
protected Object doGetAttribute( String attrName )
protected Object doGetAttribute( String atttrName ) throws FileSystemException { return null; }
String jarPath = DODDLE.class.getClassLoader().getResource("").getFile(); File file = new File(jarPath); String doddleHome = file.getParentFile().getPath() + File.separator; EDRDic.ID_DEFINITION_MAP = doddleHome + EDRDic.ID_DEFINITION_MAP; EDRDic.WORD_IDSET_MAP = doddleHome + EDRDic.WORD_IDSET_MAP;
public void exec() { SplashWindow splashWindow = new SplashWindow(); try { String jarPath = DODDLE.class.getClassLoader().getResource("").getFile(); File file = new File(jarPath); String doddleHome = file.getParentFile().getPath() + File.separator; EDRDic.ID...
DODDLE.LANG = "en"; DODDLE.initOptions(new String[] { "lang=en"});
DODDLE.initOptions(new String[] {});
public void exec() { SplashWindow splashWindow = new SplashWindow(); try { String jarPath = DODDLE.class.getClassLoader().getResource("").getFile(); File file = new File(jarPath); String doddleHome = file.getParentFile().getPath() + File.separator; EDRDic.ID...
FileObject root = m_baseFolder.getFileSystem().getRoot(); assertNull( "root has null parent", root.getParent() );
final FileSystem fileSystem = m_baseFolder.getFileSystem(); FileObject root = fileSystem.getRoot(); if ( fileSystem.getParentLayer() == null ) { assertNull( "root has null parent", root.getParent() ); } else { assertSame( fileSystem.getParentLayer().getParent(), root.getParent() ); }
public void testParent() throws FileSystemException { // Test when both exist FileObject folder = m_baseFolder.resolveFile( "dir1" ); FileObject child = folder.resolveFile( "file3.txt" ); assertTrue( "folder exists", folder.exists() ); assertTrue( "child exists", child.exists()...
bundleRelativePath = felixHack(bundleRelativePath);
protected URL getResourceFromBundle(String bundleRelativePath) { return bundle.getEntry(bundleRelativePath); }
bundleRelativePath = felixHack(bundleRelativePath);
protected URL getResourceFromBundleClasspath(String bundleRelativePath) { return bundle.getResource(bundleRelativePath); }
final String message = REZ.getString( "list-children-not-folder.error", file ); assertSameMessage( message, e );
assertSameMessage( "vfs.provider/list-children-not-folder.error", file, e );
public void testChildren() throws FileSystemException { // Check for file FileObject file = m_baseFolder.resolveFile( "file1.txt" ); assertSame( FileType.FILE, file.getType() ); try { file.getChildren(); fail(); } catch( FileSystemException e...
final String message = REZ.getString( "list-children-no-exist.error", file ); assertSameMessage( message, e );
assertSameMessage( "vfs.provider/list-children-no-exist.error", file, e );
public void testChildren() throws FileSystemException { // Check for file FileObject file = m_baseFolder.resolveFile( "file1.txt" ); assertSame( FileType.FILE, file.getType() ); try { file.getChildren(); fail(); } catch( FileSystemException e...
final String message = REZ.getString( "read-folder.error", folder ); assertSameMessage( message, e );
assertSameMessage( "vfs.provider/read-folder.error", folder, e );
public void testNoContent() throws Exception { // Try getting the content of a folder FileObject folder = m_baseFolder.resolveFile( "dir1" ); try { folder.getContent().getInputStream(); fail(); } catch( FileSystemException e ) { fi...
final String message = REZ.getString( "read-no-exist.error", unknownFile ); assertSameMessage( message, e );
assertSameMessage( "vfs.provider/read-no-exist.error", unknownFile, e );
public void testNoContent() throws Exception { // Try getting the content of a folder FileObject folder = m_baseFolder.resolveFile( "dir1" ); try { folder.getContent().getInputStream(); fail(); } catch( FileSystemException e ) { fi...
final String message = REZ.getString( "get-size-no-exist.error", unknownFile ); assertSameMessage( message, e );
assertSameMessage( "vfs.provider/get-size-no-exist.error", unknownFile, e );
public void testNoContent() throws Exception { // Try getting the content of a folder FileObject folder = m_baseFolder.resolveFile( "dir1" ); try { folder.getContent().getInputStream(); fail(); } catch( FileSystemException e ) { fi...
final String message = REZ.getString( "read-folder.error", folder ); assertSameMessage( message, e );
assertSameMessage( "vfs.provider/read-folder.error", folder, e );
public void testNoURLContent() throws Exception { // Try getting the content of a folder FileObject folder = m_baseFolder.resolveFile( "dir1" ); try { folder.getURL().openConnection().getInputStream(); fail(); } catch( IOException e ) { ...
final String message = REZ.getString( "read-no-exist.error", unknownFile ); assertSameMessage( message, e );
assertSameMessage( "vfs.provider/read-no-exist.error", unknownFile, e );
public void testNoURLContent() throws Exception { // Try getting the content of a folder FileObject folder = m_baseFolder.resolveFile( "dir1" ); try { folder.getURL().openConnection().getInputStream(); fail(); } catch( IOException e ) { ...
final String message = REZ.getString( "get-type-no-exist.error", file ); assertSameMessage( message, e );
assertSameMessage( "vfs.provider/get-type-no-exist.error", file, e );
public void testType() throws Exception { // Test a file FileObject file = m_baseFolder.resolveFile( "file1.txt" ); assertSame( FileType.FILE, file.getType() ); // Test a folder file = m_baseFolder.resolveFile( "dir1" ); assertSame( FileType.FOLDER, file.getType() ); ...
public BezierMesh() {
public BezierMesh(float[][] patches) {
public BezierMesh() { subdivs = 8; smooth = true; }
this.patches = patches;
public BezierMesh() { subdivs = 8; smooth = true; }
private void getPatchPoint(float u, float v, double[] ctrl, float[] bu, float[] bv, float[] bdu, float[] bdv, Point3 p, Vector3 n) { double px = 0; double py = 0; double pz = 0;
private void getPatchPoint(float u, float v, float[] ctrl, float[] bu, float[] bv, float[] bdu, float[] bdv, Point3 p, Vector3 n) { float px = 0; float py = 0; float pz = 0;
private void getPatchPoint(float u, float v, double[] ctrl, float[] bu, float[] bv, float[] bdu, float[] bdv, Point3 p, Vector3 n) { double px = 0; double py = 0; double pz = 0; for (int i = 0, index = 0; i < 4; i++) { for (int j = 0; j < 4; j++, index += 3) { f...
p.x = (float) px; p.y = (float) py; p.z = (float) pz;
p.x = px; p.y = py; p.z = pz;
private void getPatchPoint(float u, float v, double[] ctrl, float[] bu, float[] bv, float[] bdu, float[] bdv, Point3 p, Vector3 n) { double px = 0; double py = 0; double pz = 0; for (int i = 0, index = 0; i < 4; i++) { for (int j = 0; j < 4; j++, index += 3) { f...
double dpdux = 0; double dpduy = 0; double dpduz = 0; double dpdvx = 0; double dpdvy = 0; double dpdvz = 0;
float dpdux = 0; float dpduy = 0; float dpduz = 0; float dpdvx = 0; float dpdvy = 0; float dpdvz = 0;
private void getPatchPoint(float u, float v, double[] ctrl, float[] bu, float[] bv, float[] bdu, float[] bdv, Point3 p, Vector3 n) { double px = 0; double py = 0; double pz = 0; for (int i = 0, index = 0; i < 4; i++) { for (int j = 0; j < 4; j++, index += 3) { f...
n.x = (float) (dpduy * dpdvz - dpduz * dpdvy); n.y = (float) (dpduz * dpdvx - dpdux * dpdvz); n.z = (float) (dpdux * dpdvy - dpduy * dpdvx);
n.x = (dpduy * dpdvz - dpduz * dpdvy); n.y = (dpduz * dpdvx - dpdux * dpdvz); n.z = (dpdux * dpdvy - dpduy * dpdvx);
private void getPatchPoint(float u, float v, double[] ctrl, float[] bu, float[] bv, float[] bdu, float[] bdv, Point3 p, Vector3 n) { double px = 0; double py = 0; double pz = 0; for (int i = 0, index = 0; i < 4; i++) { for (int j = 0; j < 4; j++, index += 3) { f...
double[][] patchData = getPatches();
public BoundingBox getWorldBounds(Matrix4 o2w) { double[][] patchData = getPatches(); BoundingBox bounds = new BoundingBox(); if (o2w == null) { for (int i = 0; i < patchData.length; i++) { double[] patch = patchData[i]; for (int j = 0; j < patch.length;...
for (int i = 0; i < patchData.length; i++) { double[] patch = patchData[i];
for (int i = 0; i < patches.length; i++) { float[] patch = patches[i];
public BoundingBox getWorldBounds(Matrix4 o2w) { double[][] patchData = getPatches(); BoundingBox bounds = new BoundingBox(); if (o2w == null) { for (int i = 0; i < patchData.length; i++) { double[] patch = patchData[i]; for (int j = 0; j < patch.length;...
bounds.include((float) patch[j], (float) patch[j + 1], (float) patch[j + 2]);
bounds.include(patch[j], patch[j + 1], patch[j + 2]);
public BoundingBox getWorldBounds(Matrix4 o2w) { double[][] patchData = getPatches(); BoundingBox bounds = new BoundingBox(); if (o2w == null) { for (int i = 0; i < patchData.length; i++) { double[] patch = patchData[i]; for (int j = 0; j < patch.length;...
float x = (float) patch[j]; float y = (float) patch[j + 1]; float z = (float) patch[j + 2];
float x = patch[j]; float y = patch[j + 1]; float z = patch[j + 2];
public BoundingBox getWorldBounds(Matrix4 o2w) { double[][] patchData = getPatches(); BoundingBox bounds = new BoundingBox(); if (o2w == null) { for (int i = 0; i < patchData.length; i++) { double[] patch = patchData[i]; for (int j = 0; j < patch.length;...
double[][] patchData = getPatches(); float[] vertices = new float[patchData.length * (subdivs + 1) * (subdivs + 1) * 3]; float[] normals = smooth ? new float[patchData.length * (subdivs + 1) * (subdivs + 1) * 3] : null; float[] uvs = new float[patchData.length * (subdivs + 1) * (subdivs + 1) * 2]; int[] triangles = new...
float[] vertices = new float[patches.length * (subdivs + 1) * (subdivs + 1) * 3]; float[] normals = smooth ? new float[patches.length * (subdivs + 1) * (subdivs + 1) * 3] : null; float[] uvs = new float[patches.length * (subdivs + 1) * (subdivs + 1) * 2]; int[] triangles = new int[patches.length * subdivs * subdivs * 2...
public PrimitiveList tesselate() { double[][] patchData = getPatches(); float[] vertices = new float[patchData.length * (subdivs + 1) * (subdivs + 1) * 3]; float[] normals = smooth ? new float[patchData.length * (subdivs + 1) * (subdivs + 1) * 3] : null; float[] uvs = new float[patchData...
for (double[] patch : patchData) {
for (float[] patch : patches) {
public PrimitiveList tesselate() { double[][] patchData = getPatches(); float[] vertices = new float[patchData.length * (subdivs + 1) * (subdivs + 1) * 3]; float[] normals = smooth ? new float[patchData.length * (subdivs + 1) * (subdivs + 1) * 3] : null; float[] uvs = new float[patchData...
if (intervalMin > intervalMax) return;
public void intersect(Ray r, IntersectionState state) { float intervalMin = r.getMin(); float intervalMax = r.getMax(); float orgX = r.ox; float dirX = r.dx, invDirX = 1 / dirX; float t1, t2; t1 = (bounds.getMinimum().x - orgX) * invDirX; t2 = (bounds.getMaximum().x ...
if (intervalMin > intervalMax) return;
public void intersect(Ray r, IntersectionState state) { float intervalMin = r.getMin(); float intervalMax = r.getMax(); float orgX = r.ox; float dirX = r.dx, invDirX = 1 / dirX; float t1, t2; t1 = (bounds.getMinimum().x - orgX) * invDirX; t2 = (bounds.getMaximum().x ...
return (parent == null ? true : parent.equals(bundleDelegatingClassLoader.parent));
return (parent == null || parent.equals(bundleDelegatingClassLoader.parent));
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof BundleDelegatingClassLoader)) return false; final BundleDelegatingClassLoader bundleDelegatingClassLoader = (BundleDelegatingClassLoader) o; if (backingBundle.equals(bundleDelegatingClassLoader.backingBundle)) return (parent == ...
return this.backingBundle.loadClass(name);
try { return this.backingBundle.loadClass(name); } catch (ClassNotFoundException ex) { return parent.loadClass(name); }
protected Class findClass(String name) throws ClassNotFoundException { try { return this.backingBundle.loadClass(name); } catch (ClassNotFoundException ex) { return parent.loadClass(name); } }
catch (ClassNotFoundException ex) { return parent.loadClass(name);
catch (ClassNotFoundException cnfe) { if ((log.isDebugEnabled() || DEBUG) && !name.endsWith("BeanInfo")) { debugClassLoading(name, null); } throw cnfe; } catch (NoClassDefFoundError ncdfe) { if (log.isWarnEnabled() || DEBUG) { String cname = ncdfe.getMessage().replace('/', '.'); debugClassLoading(cname, name); } th...
protected Class findClass(String name) throws ClassNotFoundException { try { return this.backingBundle.loadClass(name); } catch (ClassNotFoundException ex) { return parent.loadClass(name); } }
for (int i = 0; !match && i < reserved.length; i++)
if (reserved != null)
public static void encode(final StringBuffer buffer, final int offset, final int length, final char[] reserved) { int index = offset; int count = length; for (; count > 0; index++, count--) { ...
if (ch == reserved[i])
for (int i = 0; !match && i < reserved.length; i++)
public static void encode(final StringBuffer buffer, final int offset, final int length, final char[] reserved) { int index = offset; int count = length; for (; count > 0; index++, count--) { ...
match = true;
if (ch == reserved[i]) { match = true; }
public static void encode(final StringBuffer buffer, final int offset, final int length, final char[] reserved) { int index = offset; int count = length; for (; count > 0; index++, count--) { ...
evaluator.cook(r);
evaluator.cook(content.toString(), r);
private Object compile(final Resource content, final boolean query) { Object ctx = objectCache.get(content); if (ctx == null) { ScriptEvaluator evaluator = new ScriptEvaluator(); //Exception are not required to be handled evaluator.setThrownExceptions(THROWN_EXCEPTIONS...
throw new JaninoProviderException("Compilation failed", e);
throw guestErrorStatement(new JaninoProviderException("Compilation failed", e), content);
private Object compile(final Resource content, final boolean query) { Object ctx = objectCache.get(content); if (ctx == null) { ScriptEvaluator evaluator = new ScriptEvaluator(); //Exception are not required to be handled evaluator.setThrownExceptions(THROWN_EXCEPTIONS...
api.primitive(new Instance(shaders, m, g));
api.instance(new Instance(shaders, m, g));
private void parseObjectBlock(SunflowAPI api) throws ParserException, IOException { p.checkNextToken("{"); Shader[] shaders = null; boolean multiShader = false; if (p.peekNextToken("shaders")) { int n = p.getNextInt(); shaders = new Shader[n]; for (int i ...
api.primitive(new Instance(shaders, m, geo));
api.instance(new Instance(shaders, m, geo));
private void parseObjectBlock(SunflowAPI api) throws ParserException, IOException { p.checkNextToken("{"); Shader[] shaders = null; boolean multiShader = false; if (p.peekNextToken("shaders")) { int n = p.getNextInt(); shaders = new Shader[n]; for (int i ...
Shader shader = (Shader) ClassBodyEvaluator.createFastClassBodyEvaluator(new Scanner(null, new StringReader(code)), Shader.class, (ClassLoader) null);
Shader shader = (Shader) ClassBodyEvaluator.createFastClassBodyEvaluator(new Scanner(null, new StringReader(code)), Shader.class, ClassLoader.getSystemClassLoader());
private boolean parseShader(SunflowAPI api) throws ParserException, IOException { p.checkNextToken("{"); p.checkNextToken("name"); String name = p.getNextToken(); UI.printInfo("[API] Reading shader: %s ...", name); p.checkNextToken("type"); if (p.peekNextToken("diffuse")) {...
String driver = drivers[i].trim(); props.put("driver1", driver); props.put("driver", driver); String url = urls[i].trim(); props.put("url1", url); props.put("url", url); props.put("user1", users[i].trim()); props.put("user", users[i].trim()); props.put("password1", passwords[i].trim()); props.put("password", passwords[...
props.put("driver1", drivers[i]); props.put("url1", urls[i]); props.put("user1", users[i]); props.put("password1", passwords[i]);
public void test() throws ScriptsExecutorException, ClassNotFoundException { int n = drivers.length; //just to make sure properties are valid assertTrue(n == urls.length && n == users.length && n == passwords.length); ScriptsExecutor se = newScriptsExecutor(); Map<String,String> p...
props.put("driver", drivers[j].trim()); props.put("driver2", drivers[j].trim()); props.put("url", urls[j].trim()); props.put("url2", urls[j].trim()); props.put("user", users[j].trim()); props.put("user2", users[j].trim()); props.put("password", passwords[j].trim()); props.put("password2", passwords[j].trim()); initDb(p...
props.put("driver2", drivers[j]); props.put("url2", urls[j]); props.put("user2", users[j]); props.put("password2", passwords[j]);
public void test() throws ScriptsExecutorException, ClassNotFoundException { int n = drivers.length; //just to make sure properties are valid assertTrue(n == urls.length && n == users.length && n == passwords.length); ScriptsExecutor se = newScriptsExecutor(); Map<String,String> p...
pw.println("Loaded packages info: "+ Arrays.toString(Package.getPackages()));
public String toString() { //produce bug report StringWriter rep = new StringWriter(); PrintWriter pw = new PrintWriter(rep); pw.println("Scriptella bug report. Submit to issue tracker."); pw.println("Exception: "); throwable.printStackTrace(pw); pw.println("Environm...
final String basename = baseName + "_" + filecount + ".tmp";
final String basename = createFilename(baseName);
public File allocateFile(final String baseName) { // Create a unique-ish file name final String basename = baseName + "_" + filecount + ".tmp"; filecount++; final File file = new File(tempDir, basename); // Keep track to delete later copies.add(file); return file;...
final File file = new File(tempDir, basename);
final File file = createFile(tempDir, basename);
public File allocateFile(final String baseName) { // Create a unique-ish file name final String basename = baseName + "_" + filecount + ".tmp"; filecount++; final File file = new File(tempDir, basename); // Keep track to delete later copies.add(file); return file;...
if (idleClient == null || !idleClient.isConnected())
synchronized(idleClientSync)
public FtpClient getClient() throws FileSystemException { if (idleClient == null || !idleClient.isConnected()) { idleClient = new FTPClientWrapper((GenericFileName) getRoot().getName(), getFileSystemOptions()); return idleClient; /* final GenericFileName ...
idleClient = new FTPClientWrapper((GenericFileName) getRoot().getName(), getFileSystemOptions()); return idleClient; /* final GenericFileName rootName = (GenericFileName) getRoot().getName();
if (idleClient == null || !idleClient.isConnected()) { FtpClient ftpClient = new FTPClientWrapper((GenericFileName) getRoot().getName(), getFileSystemOptions()); return ftpClient; /* final GenericFileName rootName = (GenericFileName) getRoot().getName();
public FtpClient getClient() throws FileSystemException { if (idleClient == null || !idleClient.isConnected()) { idleClient = new FTPClientWrapper((GenericFileName) getRoot().getName(), getFileSystemOptions()); return idleClient; /* final GenericFileName ...
return FtpClientFactory.createConnection(rootName.getHostName(), rootName.getPort(), rootName.getUserName(), rootName.getPassword(), rootName.getPath(), getFileSystemOptions()); */ } else { final FtpClient client = idleClient; idleClient = null; return client;
return FtpClientFactory.createConnection(rootName.getHostName(), rootName.getPort(), rootName.getUserName(), rootName.getPassword(), rootName.getPath(), getFileSystemOptions()); */ } else { final FtpClient client = idleClient; idleClient = null; return client; }
public FtpClient getClient() throws FileSystemException { if (idleClient == null || !idleClient.isConnected()) { idleClient = new FTPClientWrapper((GenericFileName) getRoot().getName(), getFileSystemOptions()); return idleClient; /* final GenericFileName ...
if (idleClient == null)
synchronized(idleClientSync)
public void putClient(final FtpClient client) { if (idleClient == null) { // Hang on to client for later idleClient = client; } else { // Close the client closeConnection(client); } }
idleClient = client; } else { closeConnection(client);
if (idleClient == null) { idleClient = client; } else { closeConnection(client); }
public void putClient(final FtpClient client) { if (idleClient == null) { // Hang on to client for later idleClient = client; } else { // Close the client closeConnection(client); } }
return new String[] { getCommonLibUrl(), getSpringCoreBundleUrl(), getSpringOSGiTestBundleUrl() };
return new String[] { getJUnitLibUrl(), getLog4jLibUrl(), getCommonsLoggingLibUrl(), getSpringCoreBundleUrl(), getSpringOSGiTestBundleUrl() };
private String[] getMandatoryBundles() { return new String[] { getCommonLibUrl(), getSpringCoreBundleUrl(), getSpringOSGiTestBundleUrl() }; }
return localMavenBundle("org.springframework", "spring-core", "2.1");
return localMavenBundle("org.springframework.osgi", "spring-core", "2.1-SNAPSHOT");
private static String getSpringCoreBundleUrl() { return localMavenBundle("org.springframework", "spring-core", "2.1"); }
return localMavenBundle("org.springframework", "spring-osgi-test", "2.1");
return localMavenBundle("org.springframework.osgi", "org.springframework.osgi.test", "1.0-SNAPSHOT");
private static String getSpringOSGiTestBundleUrl() { return localMavenBundle("org.springframework", "spring-osgi-test", "2.1"); }
log.info("shuting down OSGi platform");
log.info("shutting down OSGi platform");
private void shutdownTest() { cleanupStreams(); log.info("shuting down OSGi platform"); if (osgiPlatform != null) { try { osgiPlatform.stop(); } catch (Exception ex) { // swallow log.warn("shutdown procedure threw exception " + ex); } osgiPlatform = null; } }
catch (RuntimeException ex) {
catch (Throwable ex) {
private void startup() throws Exception { if (osgiPlatform == null) { // make sure the platform is closed properly registerShutdownHook(); log.info("initializing OSGi platform..."); osgiPlatform = createPlatform(); // start platform osgiPlatform.start(); context = osgiPlatform.getBundleContext(); /...
final int count = listeners.size(); for (int i = 0; i < count; i++)
FileListener[] fileListeners = (FileListener[]) listeners.toArray(new FileListener[listeners.size()]); for (int i = 0; i < fileListeners.length; i++)
private void fireEvent(final AbstractFileChangeEvent event) { synchronized (listenerMap) { final FileObject file = event.getFile(); final ArrayList listeners = (ArrayList) listenerMap.get(file.getName()); if (listeners != null) { final int ...
final FileListener listener = (FileListener) listeners.get(i);
final FileListener fileListener = fileListeners[i];
private void fireEvent(final AbstractFileChangeEvent event) { synchronized (listenerMap) { final FileObject file = event.getFile(); final ArrayList listeners = (ArrayList) listenerMap.get(file.getName()); if (listeners != null) { final int ...