id
stringlengths
7
14
text
stringlengths
1
106k
904044_9
;
904873_0
public MavenRepositoryURL getRepositoryURL() { return m_repositoryURL; }
904873_1
public String getSnapshotPath( final String version, final String timestamp, final String buildnumber ) { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( version ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( VERSION_SEPARATOR ) .append( getSnapshotVersion( version, timestamp, buildnumber ) ) .append( m_fullClassifier ) .append( TYPE_SEPARATOR ) .append( m_type ) .toString(); }
904873_2
public String getArtifactPath() { return getArtifactPath( m_version ); }
904873_3
public String getVersionMetadataPath( final String version ) { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( version ) .append( FILE_SEPARATOR ) .append( METADATA_FILE ) .toString(); }
904873_4
public String getArtifactMetdataPath() { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( METADATA_FILE ) .toString(); }
904873_5
public String getArtifactLocalMetdataPath() { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( METADATA_FILE_LOCAL ) .toString(); }
904873_6
public MavenRepositoryURL( final String repositorySpec ) throws MalformedURLException { NullArgumentException.validateNotEmpty( repositorySpec, true, "Repository spec" ); final String[] segments = repositorySpec.split( ServiceConstants.SEPARATOR_OPTIONS ); final StringBuilder urlBuilder = new StringBuilder(); boolean snapshotEnabled = false; boolean releasesEnabled = true; boolean multi = false; String name = null; String update = null; String updateReleases = null; String updateSnapshots = null; String checksum = null; String checksumReleases = null; String checksumSnapshots = null; for( int i = 0; i < segments.length; i++ ) { String segment = segments[i].trim(); if( segment.equalsIgnoreCase( ServiceConstants.OPTION_ALLOW_SNAPSHOTS ) ) { snapshotEnabled = true; } else if( segment.equalsIgnoreCase( ServiceConstants.OPTION_DISALLOW_RELEASES ) ) { releasesEnabled = false; } else if( segment.equalsIgnoreCase( ServiceConstants.OPTION_MULTI ) ) { multi = true; } else if( segment.startsWith( ServiceConstants.OPTION_ID + "=" ) ) { try { name = segments[ i ].split( "=" )[1].trim(); } catch (Exception e) { LOG.warn( "Problem with segment " + segments[i] + " in " + repositorySpec ); } } else if( segment.startsWith( ServiceConstants.OPTION_RELEASES_UPDATE + "=" ) ) { try { updateReleases = segments[ i ].split( "=" )[1].trim(); } catch (Exception e) { LOG.warn( "Problem with segment " + segments[i] + " in " + repositorySpec ); } } else if( segment.startsWith( ServiceConstants.OPTION_SNAPSHOTS_UPDATE + "=" ) ) { try { updateSnapshots = segments[ i ].split( "=" )[1].trim(); } catch (Exception e) { LOG.warn( "Problem with segment " + segments[i] + " in " + repositorySpec ); } } else if( segment.startsWith( ServiceConstants.OPTION_UPDATE + "=" ) ) { try { update = segments[ i ].split( "=" )[1].trim(); } catch (Exception e) { LOG.warn( "Problem with segment " + segments[i] + " in " + repositorySpec ); } } else if( segment.startsWith( ServiceConstants.OPTION_RELEASES_CHECKSUM + "=" ) ) { try { checksumReleases = segments[ i ].split( "=" )[1].trim(); } catch (Exception e) { LOG.warn( "Problem with segment " + segments[i] + " in " + repositorySpec ); } } else if( segment.startsWith( ServiceConstants.OPTION_SNAPSHOTS_CHECKSUM + "=" ) ) { try { checksumSnapshots = segments[ i ].split( "=" )[1].trim(); } catch (Exception e) { LOG.warn( "Problem with segment " + segments[i] + " in " + repositorySpec ); } } else if( segment.startsWith( ServiceConstants.OPTION_CHECKSUM + "=" ) ) { try { checksum = segments[ i ].split( "=" )[1].trim(); } catch (Exception e) { LOG.warn( "Problem with segment " + segments[i] + " in " + repositorySpec ); } } else { if( i > 0 ) { urlBuilder.append( ServiceConstants.SEPARATOR_OPTIONS ); } urlBuilder.append( segments[ i ] ); } } String spec = buildSpec( urlBuilder ); m_repositoryURL = new URL( spec ); m_snapshotsEnabled = snapshotEnabled; m_releasesEnabled = releasesEnabled; m_multi = multi; if (name == null) { String warn = "Repository spec " + spec + " does not contain an identifier. Give your repository a name, for example: " + repositorySpec + "@id=MyName"; LOG.warn( warn ); name = "repo_" + spec.hashCode(); } m_id = name; m_releasesUpdatePolicy = updateReleases != null ? updateReleases : update; m_snapshotsUpdatePolicy = updateSnapshots != null ? updateSnapshots : update; m_releasesChecksumPolicy = checksumReleases != null ? checksumReleases : checksum; m_snapshotsChecksumPolicy = checksumSnapshots != null ? checksumSnapshots : checksum; if( m_repositoryURL.getProtocol().equals( "file" ) ) { try { // You must transform to URI to decode the path (manage a path with a space or non // us character) // like D:/documents%20and%20Settings/SESA170017/.m2/repository // the path can be store in path part or in scheme specific part (if is relatif // path) // the anti-slash character is not a valid character for uri. spec = spec.replaceAll( "\\\\", "/" ); spec = spec.replaceAll( " ", "%20" ); URI uri = new URI( spec ); String path = uri.getPath(); if( path == null ) path = uri.getSchemeSpecificPart(); m_file = new File( path ); } catch ( URISyntaxException e ) { throw new MalformedURLException( e.getMessage() ); } } else { m_file = null; } }
904873_7
public InputStream getInputStream() throws IOException { connect(); InputStream is; if( url.getAuthority() != null ) { is = getFromSpecificBundle(); } else { is = getFromClasspath(); if( is == null ) { is = getFromInstalledBundles(); } } if( is == null ) { throw new IOException( "URL [" + m_parser.getResourceName() + "] could not be resolved from classpath" ); } return is; }
904873_8
public String getResourceName() { return m_resourceName; }
904873_9
public String getResourceName() { return m_resourceName; }
905232_0
static String getJavaExecutable( final String javaHome ) throws PlatformException { if( javaHome == null ) { throw new PlatformException( "JAVA_HOME is not set." ); } return javaHome + "/bin/java"; }
905232_1
static String getJavaExecutable( final String javaHome ) throws PlatformException { if( javaHome == null ) { throw new PlatformException( "JAVA_HOME is not set." ); } return javaHome + "/bin/java"; }
905232_2
public void start( final BundleContext bundleContext ) throws Exception { NullArgumentException.validateNotNull( bundleContext, "Bundle context" ); m_bundleContext = bundleContext; m_registrations = new HashMap<ServiceReference, ServiceRegistration>(); m_platforms = Collections.synchronizedMap( new HashMap<ServiceReference, PlatformImpl>() ); trackPlatformBuilders(); registerManagedService(); LOGGER.debug( "Platform extender started" ); }
905232_3
public void start( final BundleContext bundleContext ) throws Exception { NullArgumentException.validateNotNull( bundleContext, "Bundle context" ); m_bundleContext = bundleContext; m_registrations = new HashMap<ServiceReference, ServiceRegistration>(); m_platforms = Collections.synchronizedMap( new HashMap<ServiceReference, PlatformImpl>() ); trackPlatformBuilders(); registerManagedService(); LOGGER.debug( "Platform extender started" ); }
905232_4
public void start( final BundleContext bundleContext ) throws Exception { NullArgumentException.validateNotNull( bundleContext, "Bundle context" ); m_bundleContext = bundleContext; m_registrations = new HashMap<ServiceReference, ServiceRegistration>(); m_platforms = Collections.synchronizedMap( new HashMap<ServiceReference, PlatformImpl>() ); trackPlatformBuilders(); registerManagedService(); LOGGER.debug( "Platform extender started" ); }
905232_5
public void stop( final BundleContext bundleContext ) throws Exception { NullArgumentException.validateNotNull( bundleContext, "Bundle context" ); if( m_serviceTracker != null ) { m_serviceTracker.close(); m_serviceTracker = null; } if( m_registrations != null ) { for( ServiceRegistration registration : m_registrations.values() ) { if( registration != null ) { registration.unregister(); } } } if( m_managedServiceReg != null ) { m_managedServiceReg.unregister(); } m_platforms = null; m_bundleContext = null; LOGGER.debug( "Platform extender stopped" ); }
905232_6
public void stop( final BundleContext bundleContext ) throws Exception { NullArgumentException.validateNotNull( bundleContext, "Bundle context" ); if( m_serviceTracker != null ) { m_serviceTracker.close(); m_serviceTracker = null; } if( m_registrations != null ) { for( ServiceRegistration registration : m_registrations.values() ) { if( registration != null ) { registration.unregister(); } } } if( m_managedServiceReg != null ) { m_managedServiceReg.unregister(); } m_platforms = null; m_bundleContext = null; LOGGER.debug( "Platform extender stopped" ); }
905232_7
public void start( final List<SystemFileReference> systemFiles, final List<BundleReference> bundles, final Properties properties, @SuppressWarnings("rawtypes") final Dictionary config, final JavaRunner javaRunner ) throws PlatformException { LOGGER.info( "Preparing framework [" + this + "]" ); // we should fail fast so let's do first what is easy final String mainClassName = m_platformBuilder.getMainClassName(); if ( mainClassName == null || mainClassName.trim().length() == 0 ) { throw new PlatformException( "Main class of the platform cannot be null or empty" ); } // create context final PlatformContext context = mandatory( "Platform context", createPlatformContext() ); // set platform properties context.setProperties( properties ); // create a configuration to look up the rest of the properties final Configuration configuration = mandatory( "Configuration", createConfiguration( config ) ); context.setConfiguration( configuration ); // create the platform definition from the configured url or from the platform builder final PlatformDefinition definition = mandatory( "Definition", createPlatformDefinition( configuration ) ); LOGGER.debug( "Using platform definition [" + definition + "]" ); // create a working directory on the file system final File workDir = mandatory( "Working dir", createWorkingDir( configuration.getWorkingDirectory() ) ); LOGGER.debug( "Using working directory [" + workDir + "]" ); context.setWorkingDirectory( workDir ); // set file path strategy if ( configuration.useAbsoluteFilePaths() ) { context.setFilePathStrategy( new AbsoluteFilePathStrategy() ); } else { context.setFilePathStrategy( new RelativeFilePathStrategy( workDir ) ); } final Boolean overwriteBundles = configuration.isOverwrite(); final Boolean overwriteUserBundles = configuration.isOverwriteUserBundles(); final Boolean overwriteSystemBundles = configuration.isOverwriteSystemBundles(); final Boolean downloadFeeback = configuration.isDownloadFeedback(); LOGGER.info( "Downloading bundles..." ); // download system package LOGGER.debug( "Download system package" ); final File systemFile = downloadSystemFile( workDir, definition, overwriteBundles || overwriteSystemBundles, downloadFeeback ); LOGGER.debug( "Download additional system libraries" ); final List<LocalSystemFile> localSystemFiles = downloadSystemFiles( workDir, systemFiles, overwriteBundles || overwriteSystemBundles, downloadFeeback ); // download the rest of the bundles final List<BundleReference> bundlesToInstall = new ArrayList<BundleReference>(); LOGGER.debug( "Download platform bundles" ); bundlesToInstall.addAll( downloadPlatformBundles( workDir, definition, context, overwriteBundles || overwriteSystemBundles, downloadFeeback, configuration.validateBundles(), configuration.skipInvalidBundles() ) ); LOGGER.debug( "Download bundles" ); bundlesToInstall.addAll( downloadBundles( workDir, bundles, overwriteBundles || overwriteUserBundles, downloadFeeback, configuration.isAutoWrap(), configuration.keepOriginalUrls(), configuration.validateBundles(), configuration.skipInvalidBundles() ) ); context.setBundles( bundlesToInstall ); final ExecutionEnvironment ee = new ExecutionEnvironment( configuration.getExecutionEnvironment() ); context.setSystemPackages( createPackageList( ee.getSystemPackages(), configuration.getSystemPackages(), definition.getPackages() ) ); context.setExecutionEnvironment( ee.getExecutionEnvironment() ); // and then ask the platform builder to prepare platform for start up (e.g. create configuration file) m_platformBuilder.prepare( context ); final CommandLineBuilder vmOptions = new CommandLineBuilder(); vmOptions.append( configuration.getVMOptions() ); vmOptions.append( m_platformBuilder.getVMOptions( context ) ); if ( configuration.keepOriginalUrls() ) { vmOptions.append( "-Djava.protocol.handler.pkgs=org.ops4j.pax.url" ); } final String[] classpath = buildClassPath( systemFile, localSystemFiles, configuration, context ); final CommandLineBuilder programOptions = new CommandLineBuilder(); programOptions.append( m_platformBuilder.getArguments( context ) ); programOptions.append( getFrameworkOptions() ); JavaRunner runner = javaRunner; if ( runner == null ) { runner = new DefaultJavaRunner(); } final String javaHome = configuration.getJavaHome(); LOGGER.debug( "Using " + runner.getClass() + " [" + mainClassName + "]" ); LOGGER.debug( "VM options: [" + Arrays.toString( vmOptions.toArray() ) + "]" ); LOGGER.debug( "Classpath: [" + Arrays.toString( classpath ) + "]" ); LOGGER.debug( "Platform options: [" + Arrays.toString( programOptions.toArray() ) + "]" ); LOGGER.debug( "Java home: [" + javaHome + "]" ); LOGGER.debug( "Working dir: [" + workDir + "]" ); LOGGER.debug( "Environment options: [" + Arrays.toString( configuration.getEnvOptions() ) + "]" ); runner.exec( vmOptions.toArray(), classpath, mainClassName, programOptions.toArray(), javaHome, workDir, configuration.getEnvOptions() ); }
905232_8
public void start( final List<SystemFileReference> systemFiles, final List<BundleReference> bundles, final Properties properties, @SuppressWarnings("rawtypes") final Dictionary config, final JavaRunner javaRunner ) throws PlatformException { LOGGER.info( "Preparing framework [" + this + "]" ); // we should fail fast so let's do first what is easy final String mainClassName = m_platformBuilder.getMainClassName(); if ( mainClassName == null || mainClassName.trim().length() == 0 ) { throw new PlatformException( "Main class of the platform cannot be null or empty" ); } // create context final PlatformContext context = mandatory( "Platform context", createPlatformContext() ); // set platform properties context.setProperties( properties ); // create a configuration to look up the rest of the properties final Configuration configuration = mandatory( "Configuration", createConfiguration( config ) ); context.setConfiguration( configuration ); // create the platform definition from the configured url or from the platform builder final PlatformDefinition definition = mandatory( "Definition", createPlatformDefinition( configuration ) ); LOGGER.debug( "Using platform definition [" + definition + "]" ); // create a working directory on the file system final File workDir = mandatory( "Working dir", createWorkingDir( configuration.getWorkingDirectory() ) ); LOGGER.debug( "Using working directory [" + workDir + "]" ); context.setWorkingDirectory( workDir ); // set file path strategy if ( configuration.useAbsoluteFilePaths() ) { context.setFilePathStrategy( new AbsoluteFilePathStrategy() ); } else { context.setFilePathStrategy( new RelativeFilePathStrategy( workDir ) ); } final Boolean overwriteBundles = configuration.isOverwrite(); final Boolean overwriteUserBundles = configuration.isOverwriteUserBundles(); final Boolean overwriteSystemBundles = configuration.isOverwriteSystemBundles(); final Boolean downloadFeeback = configuration.isDownloadFeedback(); LOGGER.info( "Downloading bundles..." ); // download system package LOGGER.debug( "Download system package" ); final File systemFile = downloadSystemFile( workDir, definition, overwriteBundles || overwriteSystemBundles, downloadFeeback ); LOGGER.debug( "Download additional system libraries" ); final List<LocalSystemFile> localSystemFiles = downloadSystemFiles( workDir, systemFiles, overwriteBundles || overwriteSystemBundles, downloadFeeback ); // download the rest of the bundles final List<BundleReference> bundlesToInstall = new ArrayList<BundleReference>(); LOGGER.debug( "Download platform bundles" ); bundlesToInstall.addAll( downloadPlatformBundles( workDir, definition, context, overwriteBundles || overwriteSystemBundles, downloadFeeback, configuration.validateBundles(), configuration.skipInvalidBundles() ) ); LOGGER.debug( "Download bundles" ); bundlesToInstall.addAll( downloadBundles( workDir, bundles, overwriteBundles || overwriteUserBundles, downloadFeeback, configuration.isAutoWrap(), configuration.keepOriginalUrls(), configuration.validateBundles(), configuration.skipInvalidBundles() ) ); context.setBundles( bundlesToInstall ); final ExecutionEnvironment ee = new ExecutionEnvironment( configuration.getExecutionEnvironment() ); context.setSystemPackages( createPackageList( ee.getSystemPackages(), configuration.getSystemPackages(), definition.getPackages() ) ); context.setExecutionEnvironment( ee.getExecutionEnvironment() ); // and then ask the platform builder to prepare platform for start up (e.g. create configuration file) m_platformBuilder.prepare( context ); final CommandLineBuilder vmOptions = new CommandLineBuilder(); vmOptions.append( configuration.getVMOptions() ); vmOptions.append( m_platformBuilder.getVMOptions( context ) ); if ( configuration.keepOriginalUrls() ) { vmOptions.append( "-Djava.protocol.handler.pkgs=org.ops4j.pax.url" ); } final String[] classpath = buildClassPath( systemFile, localSystemFiles, configuration, context ); final CommandLineBuilder programOptions = new CommandLineBuilder(); programOptions.append( m_platformBuilder.getArguments( context ) ); programOptions.append( getFrameworkOptions() ); JavaRunner runner = javaRunner; if ( runner == null ) { runner = new DefaultJavaRunner(); } final String javaHome = configuration.getJavaHome(); LOGGER.debug( "Using " + runner.getClass() + " [" + mainClassName + "]" ); LOGGER.debug( "VM options: [" + Arrays.toString( vmOptions.toArray() ) + "]" ); LOGGER.debug( "Classpath: [" + Arrays.toString( classpath ) + "]" ); LOGGER.debug( "Platform options: [" + Arrays.toString( programOptions.toArray() ) + "]" ); LOGGER.debug( "Java home: [" + javaHome + "]" ); LOGGER.debug( "Working dir: [" + workDir + "]" ); LOGGER.debug( "Environment options: [" + Arrays.toString( configuration.getEnvOptions() ) + "]" ); runner.exec( vmOptions.toArray(), classpath, mainClassName, programOptions.toArray(), javaHome, workDir, configuration.getEnvOptions() ); }
905232_9
public void start( final List<SystemFileReference> systemFiles, final List<BundleReference> bundles, final Properties properties, @SuppressWarnings("rawtypes") final Dictionary config, final JavaRunner javaRunner ) throws PlatformException { LOGGER.info( "Preparing framework [" + this + "]" ); // we should fail fast so let's do first what is easy final String mainClassName = m_platformBuilder.getMainClassName(); if ( mainClassName == null || mainClassName.trim().length() == 0 ) { throw new PlatformException( "Main class of the platform cannot be null or empty" ); } // create context final PlatformContext context = mandatory( "Platform context", createPlatformContext() ); // set platform properties context.setProperties( properties ); // create a configuration to look up the rest of the properties final Configuration configuration = mandatory( "Configuration", createConfiguration( config ) ); context.setConfiguration( configuration ); // create the platform definition from the configured url or from the platform builder final PlatformDefinition definition = mandatory( "Definition", createPlatformDefinition( configuration ) ); LOGGER.debug( "Using platform definition [" + definition + "]" ); // create a working directory on the file system final File workDir = mandatory( "Working dir", createWorkingDir( configuration.getWorkingDirectory() ) ); LOGGER.debug( "Using working directory [" + workDir + "]" ); context.setWorkingDirectory( workDir ); // set file path strategy if ( configuration.useAbsoluteFilePaths() ) { context.setFilePathStrategy( new AbsoluteFilePathStrategy() ); } else { context.setFilePathStrategy( new RelativeFilePathStrategy( workDir ) ); } final Boolean overwriteBundles = configuration.isOverwrite(); final Boolean overwriteUserBundles = configuration.isOverwriteUserBundles(); final Boolean overwriteSystemBundles = configuration.isOverwriteSystemBundles(); final Boolean downloadFeeback = configuration.isDownloadFeedback(); LOGGER.info( "Downloading bundles..." ); // download system package LOGGER.debug( "Download system package" ); final File systemFile = downloadSystemFile( workDir, definition, overwriteBundles || overwriteSystemBundles, downloadFeeback ); LOGGER.debug( "Download additional system libraries" ); final List<LocalSystemFile> localSystemFiles = downloadSystemFiles( workDir, systemFiles, overwriteBundles || overwriteSystemBundles, downloadFeeback ); // download the rest of the bundles final List<BundleReference> bundlesToInstall = new ArrayList<BundleReference>(); LOGGER.debug( "Download platform bundles" ); bundlesToInstall.addAll( downloadPlatformBundles( workDir, definition, context, overwriteBundles || overwriteSystemBundles, downloadFeeback, configuration.validateBundles(), configuration.skipInvalidBundles() ) ); LOGGER.debug( "Download bundles" ); bundlesToInstall.addAll( downloadBundles( workDir, bundles, overwriteBundles || overwriteUserBundles, downloadFeeback, configuration.isAutoWrap(), configuration.keepOriginalUrls(), configuration.validateBundles(), configuration.skipInvalidBundles() ) ); context.setBundles( bundlesToInstall ); final ExecutionEnvironment ee = new ExecutionEnvironment( configuration.getExecutionEnvironment() ); context.setSystemPackages( createPackageList( ee.getSystemPackages(), configuration.getSystemPackages(), definition.getPackages() ) ); context.setExecutionEnvironment( ee.getExecutionEnvironment() ); // and then ask the platform builder to prepare platform for start up (e.g. create configuration file) m_platformBuilder.prepare( context ); final CommandLineBuilder vmOptions = new CommandLineBuilder(); vmOptions.append( configuration.getVMOptions() ); vmOptions.append( m_platformBuilder.getVMOptions( context ) ); if ( configuration.keepOriginalUrls() ) { vmOptions.append( "-Djava.protocol.handler.pkgs=org.ops4j.pax.url" ); } final String[] classpath = buildClassPath( systemFile, localSystemFiles, configuration, context ); final CommandLineBuilder programOptions = new CommandLineBuilder(); programOptions.append( m_platformBuilder.getArguments( context ) ); programOptions.append( getFrameworkOptions() ); JavaRunner runner = javaRunner; if ( runner == null ) { runner = new DefaultJavaRunner(); } final String javaHome = configuration.getJavaHome(); LOGGER.debug( "Using " + runner.getClass() + " [" + mainClassName + "]" ); LOGGER.debug( "VM options: [" + Arrays.toString( vmOptions.toArray() ) + "]" ); LOGGER.debug( "Classpath: [" + Arrays.toString( classpath ) + "]" ); LOGGER.debug( "Platform options: [" + Arrays.toString( programOptions.toArray() ) + "]" ); LOGGER.debug( "Java home: [" + javaHome + "]" ); LOGGER.debug( "Working dir: [" + workDir + "]" ); LOGGER.debug( "Environment options: [" + Arrays.toString( configuration.getEnvOptions() ) + "]" ); runner.exec( vmOptions.toArray(), classpath, mainClassName, programOptions.toArray(), javaHome, workDir, configuration.getEnvOptions() ); }
906854_0
public String getSettingsForArtifact( String fullSettings, String groupId, String artifactId ) { if( fullSettings != null ) { for( String token : fullSettings.split( "," ) ) { int end = ( token.indexOf( "@" ) >= 0 ) ? token.indexOf( "@" ) : token.length(); String ga_part[] = token.substring( 0, end ).split( ":" ); if( ga_part[ 0 ].equals( groupId ) && ga_part[ 1 ].equals( artifactId ) ) { return token.substring( end ); } } } return ""; }
906854_1
public String getURL() { final StringBuilder url = new StringBuilder() .append( SCHEMA ) .append( SEPARATOR_SCHEME ) .append( super.getURL() ) .append( SEPARATOR_FILTER ); boolean first = true; for( String feature : m_features ) { if( !first ) { url.append( FEATURE_SEPARATOR ); } first = false; url.append( feature ); } url.append( getOptions( this ) ); return url.toString(); }
906854_2
public String getURL() { final StringBuilder url = new StringBuilder() .append( SCHEMA ) .append( SEPARATOR_SCHEME ) .append( super.getURL() ) .append( SEPARATOR_FILTER ); boolean first = true; for( String feature : m_features ) { if( !first ) { url.append( FEATURE_SEPARATOR ); } first = false; url.append( feature ); } url.append( getOptions( this ) ); return url.toString(); }
906854_3
public String getURL() { final StringBuilder url = new StringBuilder() .append( SCHEMA ) .append( SEPARATOR_SCHEME ) .append( super.getURL() ) .append( SEPARATOR_FILTER ); boolean first = true; for( String feature : m_features ) { if( !first ) { url.append( FEATURE_SEPARATOR ); } first = false; url.append( feature ); } url.append( getOptions( this ) ); return url.toString(); }
906854_4
public String getURL() { final StringBuilder url = new StringBuilder() .append( SCHEMA ) .append( SEPARATOR_SCHEME ) .append( super.getURL() ) .append( SEPARATOR_FILTER ); boolean first = true; for( String feature : m_features ) { if( !first ) { url.append( FEATURE_SEPARATOR ); } first = false; url.append( feature ); } url.append( getOptions( this ) ); return url.toString(); }
906854_5
public String getURL() { final StringBuilder url = new StringBuilder() .append( SCHEMA ) .append( SEPARATOR_SCHEME ) .append( super.getURL() ) .append( SEPARATOR_FILTER ); boolean first = true; for( String feature : m_features ) { if( !first ) { url.append( FEATURE_SEPARATOR ); } first = false; url.append( feature ); } url.append( getOptions( this ) ); return url.toString(); }
906854_6
public String getURL() { final StringBuilder url = new StringBuilder() .append( SCHEMA ) .append( SEPARATOR_SCHEME ) .append( super.getURL() ) .append( SEPARATOR_FILTER ); boolean first = true; for( String feature : m_features ) { if( !first ) { url.append( FEATURE_SEPARATOR ); } first = false; url.append( feature ); } url.append( getOptions( this ) ); return url.toString(); }
906854_7
public String getURL() { return new StringBuilder() .append( SCHEMA ) .append( SEPARATOR_SCHEME ) .append( super.getURL() ) .append( getOptions( this ) ) .toString(); }
906854_8
public String getURL() { return new StringBuilder() .append( SCHEMA ) .append( SEPARATOR_SCHEME ) .append( super.getURL() ) .append( getOptions( this ) ) .toString(); }
906854_9
public String getURL() { return new StringBuilder() .append( SCHEMA ) .append( SEPARATOR_SCHEME ) .append( super.getURL() ) .append( getOptions( this ) ) .toString(); }
907274_0
@Override public void dispatch(String name, Object event) { logger.debug("DispatchEvent: {} ({})", name, event); final Object[] args = event!=null?new Object[]{event}:new Object[]{}; dispatch(name, args); }
907274_1
@Override public void dispatch(String name, Object event) { logger.debug("DispatchEvent: {} ({})", name, event); final Object[] args = event!=null?new Object[]{event}:new Object[]{}; dispatch(name, args); }
907274_2
@Override public void dispatch(String name, Object event) { logger.debug("DispatchEvent: {} ({})", name, event); final Object[] args = event!=null?new Object[]{event}:new Object[]{}; dispatch(name, args); }
907274_3
@Override public void dispatch(String name, Object event) { logger.debug("DispatchEvent: {} ({})", name, event); final Object[] args = event!=null?new Object[]{event}:new Object[]{}; dispatch(name, args); }
907274_4
@Override public void dispatch(String name, Object event) { logger.debug("DispatchEvent: {} ({})", name, event); final Object[] args = event!=null?new Object[]{event}:new Object[]{}; dispatch(name, args); }
907274_5
public <T extends Component> T bind(Class<T> viewClass, Locale locale, IEventBinder eventBinder) throws UiBinderException { try { T view = (T) viewClass.newInstance(); view = bind(viewClass.getName(), view, locale, eventBinder); return (T) view; } catch (InstantiationException e) { throw new UiConstraintException("Failed to instantiate component type: " + viewClass.getName()); } catch (IllegalAccessException e) { throw new UiConstraintException("Failed to instantiate component type: " + viewClass.getName()); } }
907274_6
public <T extends Component> T bind(Class<T> viewClass, Locale locale, IEventBinder eventBinder) throws UiBinderException { try { T view = (T) viewClass.newInstance(); view = bind(viewClass.getName(), view, locale, eventBinder); return (T) view; } catch (InstantiationException e) { throw new UiConstraintException("Failed to instantiate component type: " + viewClass.getName()); } catch (IllegalAccessException e) { throw new UiConstraintException("Failed to instantiate component type: " + viewClass.getName()); } }
907274_7
public <T extends Component> T bind(Class<T> viewClass, Locale locale, IEventBinder eventBinder) throws UiBinderException { try { T view = (T) viewClass.newInstance(); view = bind(viewClass.getName(), view, locale, eventBinder); return (T) view; } catch (InstantiationException e) { throw new UiConstraintException("Failed to instantiate component type: " + viewClass.getName()); } catch (IllegalAccessException e) { throw new UiConstraintException("Failed to instantiate component type: " + viewClass.getName()); } }
907274_8
public <T extends Component> T bind(Class<T> viewClass, Locale locale, IEventBinder eventBinder) throws UiBinderException { try { T view = (T) viewClass.newInstance(); view = bind(viewClass.getName(), view, locale, eventBinder); return (T) view; } catch (InstantiationException e) { throw new UiConstraintException("Failed to instantiate component type: " + viewClass.getName()); } catch (IllegalAccessException e) { throw new UiConstraintException("Failed to instantiate component type: " + viewClass.getName()); } }
907274_9
public <T extends Component> T bind(Class<T> viewClass, Locale locale, IEventBinder eventBinder) throws UiBinderException { try { T view = (T) viewClass.newInstance(); view = bind(viewClass.getName(), view, locale, eventBinder); return (T) view; } catch (InstantiationException e) { throw new UiConstraintException("Failed to instantiate component type: " + viewClass.getName()); } catch (IllegalAccessException e) { throw new UiConstraintException("Failed to instantiate component type: " + viewClass.getName()); } }
908709_0
public static int tokenOverlap(String[] tokens1, String[] tokens2) { Set<String> tokenSet2 = new HashSet<String>(Arrays.asList(tokens2)); int score = 0; for (String word : tokens1) if (tokenSet2.contains(word)) score++; return score; }
908709_1
public static int tokenOverlap(String[] tokens1, String[] tokens2) { Set<String> tokenSet2 = new HashSet<String>(Arrays.asList(tokens2)); int score = 0; for (String word : tokens1) if (tokenSet2.contains(word)) score++; return score; }
908709_2
public static int tokenOverlap(String[] tokens1, String[] tokens2) { Set<String> tokenSet2 = new HashSet<String>(Arrays.asList(tokens2)); int score = 0; for (String word : tokens1) if (tokenSet2.contains(word)) score++; return score; }
908709_3
public static int tokenOverlapExp(String[] tokens1, String[] tokens2) { int index1 = 0; int index2 = 0; int score = 0; for (int i = 0; i < tokens1.length; ++i) for (int j = 0; j < tokens2.length; ++j) if (tokens1[i].equals(tokens2[j])) score += Math.pow(findOverlap(tokens1, i, tokens2, j), 2); return score; }
908709_4
public static int tokenOverlapExp(String[] tokens1, String[] tokens2) { int index1 = 0; int index2 = 0; int score = 0; for (int i = 0; i < tokens1.length; ++i) for (int j = 0; j < tokens2.length; ++j) if (tokens1[i].equals(tokens2[j])) score += Math.pow(findOverlap(tokens1, i, tokens2, j), 2); return score; }
908709_5
public int size() { int size = 0; for (Set<T> set : sets) size += set.size(); return size; }
908709_6
public Iterator<T> iterator() { List<Iterator<T>> iters = new ArrayList<Iterator<T>>(); for (Set<T> set : sets) iters.add(set.iterator()); return new CombinedIterator<T>(iters); }
908709_7
public V put(K key, V value) { if (baseMap.containsKey(key)) throw new IllegalArgumentException("Should not reinsert keys"); return extendedMap.put(key, value); }
908709_8
public V get(Object key) { V value = baseMap.get(key); return (value != null) ? value : extendedMap.get(key); }
908709_9
public int compareTo(Object o) { return compareTo((StringPair) o); }
909809_0
public final void setSparkline(final boolean isSparkline) { this.isSparkline = isSparkline; }
909809_1
public static String normalize(final String s) { if (s == null) { return ""; } final ImmutableList<String> stringList = Lists.of(s.split("\\?")); if (stringList.size() != 2) { return s; } final String args = stringList.get(1); final List<String> params = Arrays.asList(args.split("&")); Collections.sort(params); final StringBuilder sb = new StringBuilder(stringList.get(0) + "?"); int cnt = 0; for (String p : params) { sb.append(cnt++ > 0 ? "&" : "").append(p); } return sb.toString(); }
909809_2
public final void setTitle(final String title) { checkNotNull(title, "Title cannot be null."); this.chartTitle = new ChartTitle(title); }
909809_3
public final void setTitle(final String title) { checkNotNull(title, "Title cannot be null."); this.chartTitle = new ChartTitle(title); }
909809_4
public final void setTitle(final String title) { checkNotNull(title, "Title cannot be null."); this.chartTitle = new ChartTitle(title); }
909809_5
public final void setTitle(final String title) { checkNotNull(title, "Title cannot be null."); this.chartTitle = new ChartTitle(title); }
909809_6
public final void setLegendPosition(final LegendPosition legendPosition) { checkNotNull(legendPosition, "Legend position cannot be null."); this.legendPosition = legendPosition; }
909809_7
public final void setLegendPosition(final LegendPosition legendPosition) { checkNotNull(legendPosition, "Legend position cannot be null."); this.legendPosition = legendPosition; }
909809_8
public void setLegendMargins(final int legendWidth, final int legendHeight) { this.legendMargins = new LegendMargins(legendWidth, legendHeight); }
909809_9
public final void setAreaFill(final Fill fill) { areaFill = fill.klone(); }
912291_0
public Attributes readDataset(Attributes attrs) { boolean wrappedInArray = next() == Event.START_ARRAY; if (wrappedInArray) next(); expect(Event.START_OBJECT); if (attrs == null) { attrs = new Attributes(); } fmi = null; next(); doReadDataset(attrs); if (wrappedInArray) next(); return attrs; }
912291_1
public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); }
912291_2
public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); }
912291_3
@Override public HL7Application findHL7Application(String name) throws ConfigurationException { Device device = config.findDevice( "(&(objectclass=hl7Application)(hl7ApplicationName=" + name + "))", name); HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class); return hl7Ext.getHL7Application(name); }
912291_4
@Override public synchronized boolean registerAETitle(String aet) throws ConfigurationException { ensureConfigurationExists(); try { registerAET(aet); return true; } catch (AETitleAlreadyExistsException e) { return false; } }
912291_5
@Override public synchronized ConfigurationChanges persist(Device device, EnumSet<Option> options) throws ConfigurationException { ensureConfigurationExists(); String deviceName = device.getDeviceName(); String deviceDN = deviceRef(deviceName); boolean rollback = false; ArrayList<String> destroyDNs = new ArrayList<>(); try { if (options != null && options.contains(Option.REGISTER)) register(device, destroyDNs); ConfigurationChanges diffs = configurationChangesOf(options); ConfigurationChanges.ModifiedObject ldapObj = ConfigurationChanges.addModifiedObject(diffs, deviceDN, ConfigurationChanges.ChangeType.C); createSubcontext(deviceDN, storeTo(ConfigurationChanges.nullifyIfNotVerbose(diffs, ldapObj), device, new BasicAttributes(true))); rollback = true; storeChilds(ConfigurationChanges.nullifyIfNotVerbose(diffs, diffs), deviceDN, device); if (options == null || !options.contains(Option.PRESERVE_CERTIFICATE)) updateCertificates(device); rollback = false; destroyDNs.clear(); return diffs; } catch (NameAlreadyBoundException e) { throw new ConfigurationAlreadyExistsException(deviceName); } catch (NamingException e) { throw new ConfigurationException(e); } catch (CertificateException e) { throw new ConfigurationException(e); } finally { if (rollback) { try { destroySubcontextWithChilds(deviceDN); } catch (NamingException e) { LOG.warn("Rollback failed:", e); } } unregister(destroyDNs); } }
912291_6
@Override public ConfigurationChanges merge(Device device, EnumSet<Option> options) throws ConfigurationException { ConfigurationChanges diffs = configurationChangesOf(options); merge(device, options, diffs); return diffs; }
912291_7
public void writeTo(DeviceInfo deviceInfo, JsonGenerator gen) { JsonWriter writer = new JsonWriter(gen); gen.writeStartObject(); gen.write("dicomDeviceName", deviceInfo.getDeviceName()); writer.writeNotNullOrDef("dicomDescription", deviceInfo.getDescription(), null); writer.writeNotNullOrDef("dicomManufacturer", deviceInfo.getManufacturer(), null); writer.writeNotNullOrDef("dicomManufacturerModelName", deviceInfo.getManufacturerModelName(), null); writer.writeNotEmpty("dicomSoftwareVersion", deviceInfo.getSoftwareVersions()); writer.writeNotNullOrDef("dicomStationName", deviceInfo.getStationName(), null); writer.writeNotEmpty("dicomInstitutionName", deviceInfo.getInstitutionNames()); writer.writeNotEmpty("dicomInstitutionDepartmentName", deviceInfo.getInstitutionalDepartmentNames()); writer.writeNotEmpty("dicomPrimaryDeviceType", deviceInfo.getPrimaryDeviceTypes()); gen.write("dicomInstalled", deviceInfo.getInstalled()); gen.write("hasArcDevExt", deviceInfo.getArcDevExt()); gen.writeEnd(); }
912291_8
@Override public String toString() { if (str == null) str = toStringBuilder().toString(); return str; }
912291_9
public static AttributeSelector valueOf(String s) { int fromIndex = s.lastIndexOf("DicomAttribute"); try { return new AttributeSelector( selectTag(s, fromIndex), selectPrivateCreator(s, fromIndex), itemPointersOf(s, fromIndex)); } catch (Exception e) { throw new IllegalArgumentException(s); } }
915029_0
public void setValue(Object newValue) { throw new UnsupportedOperationException("ListItemsUniqueModel is read-only"); }
915029_1
public Boolean getValue() { return d_val; }
915029_2
public void setValue(Object value) { throw new UnsupportedOperationException(); }
915029_3
public Boolean getValue() { return d_val; }
915029_4
public void setValue(Object value) { throw new UnsupportedOperationException(); }
915029_5
public void setValue(Object value) { throw new UnsupportedOperationException(); }
915029_6
public static double getT(int v) { if (v < 1) { throw new IllegalArgumentException("student T distribution defined only for positive degrees of freedom"); } TDistribution dist = new TDistribution(v); return dist.inverseCumulativeProbability(0.975); }
915029_7
public double getLength() { return d_upperBound.doubleValue() - d_lowerBound.doubleValue(); }
915029_8
@Override public boolean equals(Object o) { if (o instanceof Interval<?>) { Interval<?> other = (Interval<?>) o; if (other.canEqual(this)) { if (other.getLowerBound().getClass().equals(getLowerBound().getClass())) { return ((getLowerBound().equals(other.getLowerBound())) && (getUpperBound().equals(other.getUpperBound()))); } } } return false; }
915029_9
@Override public String toString() { return getLowerBound().toString() + "-" + getUpperBound().toString(); }
917362_0
Solve() { }
917362_1
Solve() { }
917947_0
public static <T> DecoratingWith<T> proxy(final Class<T> type) { return new DecoratingWith<T>(new Decorating<T, T>((T)null, type)); }
917947_1
public static <T> DecoratingWith<T> proxy(final Class<T> type) { return new DecoratingWith<T>(new Decorating<T, T>((T)null, type)); }
917947_2
public static <T> DecoratingWith<T> proxy(final Class<T> type) { return new DecoratingWith<T>(new Decorating<T, T>((T)null, type)); }
917947_3
public static <T> DecoratingWith<T> proxy(final Class<T> type) { return new DecoratingWith<T>(new Decorating<T, T>((T)null, type)); }
917947_4
public static <T> DecoratingWith<T> proxy(final Class<T> type) { return new DecoratingWith<T>(new Decorating<T, T>((T)null, type)); }
917947_5
public static <T> FutureWith<T> proxy(Class<T> primaryType) { Future<T> future = new Future<T>(new Class<?>[]{primaryType}); return new FutureWith<T>(future); }
917947_6
public static <T> FutureWith<T> proxy(Class<T> primaryType) { Future<T> future = new Future<T>(new Class<?>[]{primaryType}); return new FutureWith<T>(future); }
917947_7
public static <T> FutureWith<T> proxy(Class<T> primaryType) { Future<T> future = new Future<T>(new Class<?>[]{primaryType}); return new FutureWith<T>(future); }
917947_8
public static <T> FutureWith<T> proxy(Class<T> primaryType) { Future<T> future = new Future<T>(new Class<?>[]{primaryType}); return new FutureWith<T>(future); }
917947_9
public static <T> PrivilegingWith<T> proxy(Class<T> type) { return new PrivilegingWith<T>(new Privileging<T>(type)); }
918574_0
HttpServiceContext getOrCreateContext(final Model model) { return getOrCreateContext(model.getContextModel()); }
918574_1
HttpServiceContext getOrCreateContext(final Model model) { return getOrCreateContext(model.getContextModel()); }
918574_2
HttpServiceContext getContext(final HttpContext httpContext) { readLock.lock(); try { ServletContextInfo servletContextInfo = contexts.get(httpContext); if (servletContextInfo != null) { return servletContextInfo.getHandler(); } return null; } finally { readLock.unlock(); } }
918574_3
static String replaceSlashes(final String target) { String replaced = target; if (replaced != null) { replaced = replaced.replaceAll("/+", "/"); } return replaced; }
918574_4
static String replaceSlashes(final String target) { String replaced = target; if (replaced != null) { replaced = replaced.replaceAll("/+", "/"); } return replaced; }
918574_5
static String replaceSlashes(final String target) { String replaced = target; if (replaced != null) { replaced = replaced.replaceAll("/+", "/"); } return replaced; }
918574_6
static String replaceSlashes(final String target) { String replaced = target; if (replaced != null) { replaced = replaced.replaceAll("/+", "/"); } return replaced; }