idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
134,800
protected void addContainerTags ( ) { final RootContainer rc = getRootContainer ( container ) ; if ( rc != null ) { tags . add ( rc ) ; } final TreeDepth parentDepth = getTreeDepth ( container ) ; tags . add ( parentDepth != null ? parentDepth . increment ( ) : TreeDepth . ROOT ) ; }
Adds tree based tags for when a non - null container is set .
134,801
protected void removeContainerTags ( ) { tags . removeOfType ( TreeMember . class ) ; tags . removeOfType ( RootContainer . class ) ; tags . removeOfType ( TreeDepth . class ) ; }
Removes tree based tags for when a null container is set .
134,802
protected void setContainer ( final EntityContainer container ) { if ( ! Objects . equals ( this . container , container ) ) { this . container = container ; if ( ! isAlive ( ) ) { return ; } if ( container == null ) { removeContainerTags ( ) ; } else { addContainerTags ( ) ; } } }
Sets the parent container for the entity .
134,803
public void uncacheProxyOfEntity ( final Entity e , final Class < ? extends Entity > type ) { cache . invalidateType ( e , type ) ; }
Uncaches the specific type proxy for an entity .
134,804
private Map < String , TrackedNode < T > > trackNode ( String path , Map < String , TrackedNode < T > > tree , Collection < NodeEvent < T > > events , int depth ) throws InterruptedException , KeeperException { if ( depth > _depth ) { if ( log . isDebugEnabled ( ) ) log . debug ( logString ( path , "max depth reached $...
Must be called from a synchronized section
134,805
public static < T > NamedAttributeType < T > newNamedTypeOf ( final String name , final Class < T > type ) { return new NamedAttributeType < > ( name , newTypeOf ( type ) ) ; }
Creates a new named type of the supplied simple type .
134,806
public static NamedAttributeType < Object > newNamedUnknownType ( final String name , final Type type ) { return new NamedAttributeType < > ( name , new AttributeType < Object > ( type ) { } ) ; }
Creates a new named unknown type .
134,807
public static < T > AttributeType < T > newTypeOf ( final Class < T > type ) { return new AttributeType < T > ( type ) { } ; }
Creates a new attribute type of the supplied simple type .
134,808
public static String requireNotEmpty ( final String str ) throws NullPointerException , IllegalArgumentException { if ( str . length ( ) == 0 ) { throw new IllegalArgumentException ( ) ; } return str ; }
Ensures the String is not null or empty .
134,809
public boolean addWaitingWork ( final T context ) { write . lock ( ) ; try { boolean result = ! waitingWork . contains ( context ) ; if ( result ) { waitingWork . add ( context ) ; workChanged . signalAll ( ) ; } return result ; } finally { write . unlock ( ) ; } }
Adds work to the queue .
134,810
public boolean isWaitingWork ( final T context ) { read . lock ( ) ; try { return waitingWork . contains ( context ) ; } finally { read . unlock ( ) ; } }
Whether the work is contained in the queue .
134,811
public boolean removeWaitingWork ( final T context ) { write . lock ( ) ; try { boolean result = waitingWork . remove ( context ) ; if ( result ) { workChanged . signalAll ( ) ; } return result ; } finally { write . unlock ( ) ; } }
Removes work from the queue .
134,812
public boolean unresolveType ( final Class < ? extends Entity > type ) { return resolved . remove ( Objects . requireNonNull ( type ) ) != null ; }
Uncaches a resolved type .
134,813
public Stat exists ( String path ) throws InterruptedException , KeeperException { return exists ( path , false ) ; }
ZooKeeper convenient calls
134,814
public ZKData < String > getZKStringData ( String path ) throws InterruptedException , KeeperException { return getZKStringData ( path , null ) ; }
Returns both the data as a string as well as the stat
134,815
public Stat createOrSetWithParents ( String path , String data , List < ACL > acl , CreateMode createMode ) throws InterruptedException , KeeperException { if ( exists ( path ) != null ) return setData ( path , data ) ; try { createWithParents ( path , data , acl , createMode ) ; return null ; } catch ( KeeperException...
Tries to create first and if the node exists then does a setData .
134,816
public void deleteWithChildren ( String path ) throws InterruptedException , KeeperException { List < String > allChildren = findAllChildren ( path ) ; for ( String child : allChildren ) { delete ( PathUtils . addPaths ( path , child ) ) ; } delete ( path ) ; }
delete all the children if they exist
134,817
public void waitForShutdown ( Object timeout ) throws InterruptedException , IllegalStateException , TimeoutException { if ( ! _shutdown ) throw new IllegalStateException ( "call shutdown first" ) ; ConcurrentUtils . joinFor ( clock , _mainThread , timeout ) ; }
Waits for shutdown to be completed . After calling shutdown there may still be some pending work that needs to be accomplised . This method will block until it is done but no longer than the timeout .
134,818
protected boolean addWork ( final ForkJoinContext < ? > context ) { requireNotStopped ( this ) ; final boolean result = workQueue . addWaitingWork ( context ) ; if ( result ) { addWorkerIfNeeded ( ) ; } return result ; }
Adds work to the engine .
134,819
public JFreeChartRender setDomainAxis ( double lowerBound , double upperBound ) { ValueAxis valueAxis = getPlot ( ) . getDomainAxis ( ) ; valueAxis . setUpperBound ( upperBound ) ; valueAxis . setLowerBound ( lowerBound ) ; return this ; }
Sets bounds for domain axis .
134,820
public JFreeChartRender setRangeAxis ( double lowerBound , double upperBound ) { ValueAxis valueAxis = getPlot ( ) . getRangeAxis ( ) ; valueAxis . setUpperBound ( upperBound ) ; valueAxis . setLowerBound ( lowerBound ) ; return this ; }
Sets bounds for range axis .
134,821
public JFreeChartRender setStyle ( int style ) { switch ( style ) { case JFreeChartRender . STYLE_THESIS : return this . setBaseShapesVisible ( true ) . setBaseShapesFilled ( false ) . setBaseLinesVisible ( false ) . setLegendItemFont ( new Font ( "Dialog" , Font . PLAIN , 9 ) ) . setBackgroundPaint ( Color . white ) ....
Applies prepared style to a chart .
134,822
protected CompletableFuture < R > enqueue ( final Meta meta , final T context ) { State < T , R > state = objectQueue . get ( meta . getOid ( ) ) ; if ( state != null ) { if ( state . future . isCancelled ( ) ) { objectQueue . remove ( meta . getOid ( ) , state ) ; state = null ; } } if ( state == null ) { final State ...
This method start send object metadata to server .
134,823
public BatchRes postBatch ( final BatchReq batchReq ) throws IOException { return doWork ( auth -> doRequest ( auth , new JsonPost < > ( batchReq , BatchRes . class ) , AuthHelper . join ( auth . getHref ( ) , PATH_BATCH ) ) , batchReq . getOperation ( ) ) ; }
Send batch request to the LFS - server .
134,824
public < T > T getObject ( final String hash , final StreamHandler < T > handler ) throws IOException { return doWork ( auth -> { final ObjectRes links = doRequest ( auth , new MetaGet ( ) , AuthHelper . join ( auth . getHref ( ) , PATH_OBJECTS + "/" + hash ) ) ; if ( links == null ) { throw new FileNotFoundException (...
Download object by hash .
134,825
public < T > T getObject ( final Meta meta , final Links links , final StreamHandler < T > handler ) throws IOException { final Link link = links . getLinks ( ) . get ( LinkType . Download ) ; if ( link == null ) { throw new FileNotFoundException ( ) ; } return doRequest ( link , new ObjectGet < > ( inputStream -> hand...
Download object by metadata .
134,826
public static Meta generateMeta ( final StreamProvider streamProvider ) throws IOException { final MessageDigest digest = sha256 ( ) ; final byte [ ] buffer = new byte [ 0x10000 ] ; long size = 0 ; try ( InputStream stream = streamProvider . getStream ( ) ) { while ( true ) { int read = stream . read ( buffer ) ; if ( ...
Generate object metadata .
134,827
public boolean putObject ( final StreamProvider streamProvider , final Meta meta , final Links links ) throws IOException { if ( links . getLinks ( ) . containsKey ( LinkType . Download ) ) { return false ; } final Link uploadLink = links . getLinks ( ) . get ( LinkType . Upload ) ; if ( uploadLink == null ) { throw ne...
Upload object by metadata .
134,828
public long getPrice ( Configuration configuration ) { long total = 0 ; for ( KnapsackItem knapsackItem : getKnapsackItems ( ) ) { if ( configuration . valueAt ( knapsackItem . getIndex ( ) ) == 1 ) { total += knapsackItem . getPrice ( ) ; } } return total ; }
Returns price of items in given configuration .
134,829
public City addDistance ( City city , Integer distance ) { this . distances . put ( city , distance ) ; return this ; }
Adds new distance to city .
134,830
protected MoveOperation counterToOperation ( int counter ) { int jobIndex = counter / ( this . problem . machines - 1 ) ; int machineIndex = counter % ( this . problem . machines - 1 ) ; if ( machineIndex >= this . configuration . valueAt ( jobIndex ) ) machineIndex ++ ; return this . problem . moveOperations . get ( j...
Returns operation for given counter .
134,831
public static void randomPathFast ( int [ ] result , int size ) { for ( int i = 0 ; i < size ; i ++ ) result [ i ] = i ; for ( int k = size - 1 ; k > 0 ; k -- ) { int w = ( int ) Math . floor ( Math . random ( ) * ( k + 1 ) ) ; int temp = result [ w ] ; result [ w ] = result [ k ] ; result [ k ] = temp ; } }
generates random permutation of cities
134,832
public CompletableFuture < Meta > upload ( final StreamProvider streamProvider ) { final CompletableFuture < Meta > future = new CompletableFuture < > ( ) ; getPool ( ) . submit ( ( ) -> { try { future . complete ( Client . generateMeta ( streamProvider ) ) ; } catch ( Throwable e ) { future . completeExceptionally ( e...
This method computes stream metadata and upload object .
134,833
public CompletableFuture < Meta > upload ( final Meta meta , final StreamProvider streamProvider ) { return enqueue ( meta , streamProvider ) ; }
This method start uploading object to server .
134,834
public OETLProcessor parse ( final Collection < ODocument > iBeginBlocks , final ODocument iSource , final ODocument iExtractor , final Collection < ODocument > iTransformers , final ODocument iLoader , final Collection < ODocument > iEndBlocks , final OCommandContext iContext ) { if ( iExtractor == null ) throw new Il...
Creates an ETL processor by setting the configuration of each component .
134,835
protected boolean fill ( final Context2D context , final Attributes attr , double alpha ) { final boolean filled = attr . hasFill ( ) ; if ( ( filled ) || ( attr . isFillShapeForSelection ( ) ) ) { alpha = alpha * attr . getFillAlpha ( ) ; if ( alpha <= 0 ) { return false ; } if ( context . isSelection ( ) ) { final St...
Fills the Shape using the passed attributes . This method will silently also fill the Shape to its unique rgb color if the context is a buffer .
134,836
protected boolean setStrokeParams ( final Context2D context , final Attributes attr , double alpha , final boolean filled ) { double width = attr . getStrokeWidth ( ) ; String color = attr . getStrokeColor ( ) ; if ( null == color ) { if ( width > 0 ) { color = LienzoCore . get ( ) . getDefaultStrokeColor ( ) ; } } els...
Sets the Shape Stroke parameters .
134,837
protected final void doApplyShadow ( final Context2D context , final Attributes attr ) { if ( ( false == isAppliedShadow ( ) ) && ( attr . hasShadow ( ) ) ) { setAppliedShadow ( true ) ; final Shadow shadow = attr . getShadow ( ) ; if ( null != shadow ) { context . setShadow ( shadow ) ; } } }
Applies this shape s Shadow .
134,838
public T setDashArray ( final double dash , final double ... dashes ) { getAttributes ( ) . setDashArray ( new DashArray ( dash , dashes ) ) ; return cast ( ) ; }
Sets the dash array with individual dash lengths .
134,839
@ SuppressWarnings ( "unchecked" ) public T moveUp ( ) { final Node < ? > parent = getParent ( ) ; if ( null != parent ) { final IContainer < ? , IPrimitive < ? > > container = ( IContainer < ? , IPrimitive < ? > > ) parent . asContainer ( ) ; if ( null != container ) { container . moveUp ( this ) ; } } return cast ( )...
Moves this shape one layer up .
134,840
public T setScale ( final double x , final double y ) { getAttributes ( ) . setScale ( x , y ) ; return cast ( ) ; }
Sets this shape s scale starting at the given x and y
134,841
public T setShear ( final double x , final double y ) { getAttributes ( ) . setShear ( x , y ) ; return cast ( ) ; }
Sets this shape s shear
134,842
public T setOffset ( final double x , final double y ) { getAttributes ( ) . setOffset ( x , y ) ; return cast ( ) ; }
Sets this shape s offset at the given x and y coordinates .
134,843
public T setFillColor ( final IColor color ) { return setFillColor ( null == color ? null : color . getColorString ( ) ) ; }
Sets the fill color .
134,844
public T setStrokeColor ( final IColor color ) { return setStrokeColor ( null == color ? null : color . getColorString ( ) ) ; }
Sets the stroke color .
134,845
private static synchronized void decrementUseCount ( ) { final String methodName = "decrementUseCount" ; logger . entry ( methodName ) ; -- useCount ; if ( useCount <= 0 ) { if ( bootstrap != null ) { bootstrap . group ( ) . shutdownGracefully ( 0 , 500 , TimeUnit . MILLISECONDS ) ; } bootstrap = null ; useCount = 0 ; ...
Decrement the use count of the workerGroup and request a graceful shutdown once it is no longer being used by anyone .
134,846
public boolean awaitTermination ( long timeout ) throws InterruptedException { final String methodName = "awaitTermination" ; logger . entry ( methodName ) ; final boolean terminated ; if ( bootstrap != null ) { terminated = bootstrap . group ( ) . awaitTermination ( timeout , TimeUnit . SECONDS ) ; } else { terminated...
Waits for the underlying network service to terminate .
134,847
public String getDebugString ( ) { final StringBuilder b = new StringBuilder ( ) ; boolean first = true ; for ( final ValidationError e : m_errors ) { if ( first ) { first = false ; } else { b . append ( "\n" ) ; } b . append ( e . getContext ( ) ) . append ( " - " ) . append ( e . getMessage ( ) ) ; } return b . toStr...
Returns a string with all error messages for debugging purposes .
134,848
public static String removeJavaPackageName ( String className ) { int idx = className . lastIndexOf ( '.' ) ; if ( idx >= 0 ) { return className . substring ( idx + 1 ) ; } else { return className ; } }
Removes the package from the type name from the given type
134,849
public static Class < ? > loadProjectClass ( Project project , String className ) { URLClassLoader classLoader = getProjectClassLoader ( project ) ; if ( classLoader != null ) { try { return classLoader . loadClass ( className ) ; } catch ( ClassNotFoundException e ) { } finally { try { classLoader . close ( ) ; } catc...
Loads a class of the given name from the project class loader or returns null if its not found
134,850
protected boolean prepare ( final Context2D context , final Attributes attr , final double alpha ) { final Point2DArray points = attr . getControlPoints ( ) ; if ( ( points != null ) && ( points . size ( ) == 3 ) ) { context . beginPath ( ) ; final Point2D p0 = points . get ( 0 ) ; final Point2D p1 = points . get ( 1 )...
Draws this quadratic curve
134,851
public final ImageData copy ( ) { final Context2D context = new ScratchPad ( getWidth ( ) , getHeight ( ) ) . getContext ( ) ; context . putImageData ( this , 0 , 0 ) ; return context . getImageData ( 0 , 0 , getWidth ( ) , getHeight ( ) ) ; }
ImageData can t be cloned or deep - copied it s an internal data structure and has some CRAZY crap in it this is cheeeeeezy but hey it works and it s portable!!!
134,852
protected boolean prepare ( final Context2D context , final Attributes attr , final double alpha ) { if ( m_list . size ( ) < 1 ) { if ( false == parse ( attr ) ) { return false ; } } if ( m_list . size ( ) < 1 ) { return false ; } context . path ( m_list ) ; return true ; }
Draws this star .
134,853
protected boolean prepare ( final Context2D context , final Attributes attr , final double alpha ) { final double r = attr . getRadius ( ) ; if ( r > 0 ) { context . beginPath ( ) ; context . arc ( 0 , 0 , r , 0 , Math . PI * 2 , true ) ; context . closePath ( ) ; return true ; } return false ; }
Draws this circle
134,854
public Layer getLayer ( ) { final Node < ? > parent = getParent ( ) ; if ( null != parent ) { return parent . getLayer ( ) ; } return null ; }
Returns the Layer that this Node is on .
134,855
public Scene getScene ( ) { final Node < ? > parent = getParent ( ) ; if ( null != parent ) { return parent . getScene ( ) ; } return null ; }
Returns the Scene that this Node is on .
134,856
public Viewport getViewport ( ) { final Node < ? > parent = getParent ( ) ; if ( null != parent ) { return parent . getViewport ( ) ; } return null ; }
Returns the Viewport that this Node is on .
134,857
public static Plugin findPlugin ( List < Plugin > plugins , String artifactId ) { if ( plugins != null ) { for ( Plugin plugin : plugins ) { String groupId = plugin . getGroupId ( ) ; if ( Strings . isNullOrBlank ( groupId ) || Objects . equal ( groupId , mavenPluginsGroupId ) ) { if ( Objects . equal ( artifactId , pl...
Returns the maven plugin for the given artifact id or returns null if it cannot be found
134,858
public static Profile findProfile ( Model mavenModel , String profileId ) { List < Profile > profiles = mavenModel . getProfiles ( ) ; if ( profiles != null ) { for ( Profile profile : profiles ) { if ( Objects . equal ( profile . getId ( ) , profileId ) ) { return profile ; } } } return null ; }
Returns the profile for the given id or null if it could not be found
134,859
public static boolean ensureMavenDependencyAdded ( Project project , DependencyInstaller dependencyInstaller , String groupId , String artifactId , String scope ) { List < Dependency > dependencies = project . getFacet ( DependencyFacet . class ) . getEffectiveDependencies ( ) ; for ( Dependency d : dependencies ) { if...
Returns true if the dependency was added or false if its already there
134,860
public static boolean hasDependency ( Model pom , String groupId , String artifactId ) { if ( pom != null ) { List < org . apache . maven . model . Dependency > dependencies = pom . getDependencies ( ) ; return hasDependency ( dependencies , groupId , artifactId ) ; } return false ; }
Returns true if the pom has the given dependency
134,861
public static boolean hasDependency ( List < org . apache . maven . model . Dependency > dependencies , String groupId , String artifactId ) { if ( dependencies != null ) { for ( org . apache . maven . model . Dependency dependency : dependencies ) { if ( Objects . equal ( groupId , dependency . getGroupId ( ) ) && Obj...
Returns true if the list has the given dependency
134,862
public static boolean hasManagedDependency ( Model pom , String groupId , String artifactId ) { if ( pom != null ) { DependencyManagement dependencyManagement = pom . getDependencyManagement ( ) ; if ( dependencyManagement != null ) { return hasDependency ( dependencyManagement . getDependencies ( ) , groupId , artifac...
Returns true if the pom has the given managed dependency
134,863
public static boolean updatePomProperty ( Properties properties , String name , Object value , boolean updated ) { if ( value != null ) { Object oldValue = properties . get ( name ) ; if ( ! Objects . equal ( oldValue , value ) ) { getLOG ( ) . debug ( "Updating pom.xml property: " + name + " to " + value ) ; propertie...
Updates the given maven property value if value is not null and returns true if the pom has been changed
134,864
protected boolean prepare ( final Context2D context , final Attributes attr , final double alpha ) { final double w = attr . getWidth ( ) ; final double h = attr . getHeight ( ) ; if ( ( w > 0 ) && ( h > 0 ) ) { context . beginPath ( ) ; context . ellipse ( 0 , 0 , w / 2 , h / 2 , 0 , 0 , Math . PI * 2 , true ) ; conte...
Draws this ellipse .
134,865
public static Result loadCamelComponentDetails ( CamelCatalog camelCatalog , String camelComponentName , CamelComponentDetails details ) { String json = camelCatalog . componentJSonSchema ( camelComponentName ) ; if ( json == null ) { return Results . fail ( "Could not find catalog entry for component name: " + camelCo...
Populates the details for the given component returning a Result if it fails .
134,866
public static Class < Object > loadValidInputTypes ( String javaType , String type ) { int idx = javaType . indexOf ( '<' ) ; if ( idx > 0 ) { javaType = javaType . substring ( 0 , idx ) ; } try { Class < Object > clazz = getPrimitiveWrapperClassType ( type ) ; if ( clazz == null ) { clazz = loadPrimitiveWrapperType ( ...
Converts a java type as a string to a valid input type and returns the class or null if its not supported
134,867
public static Class getPrimitiveWrapperClassType ( String name ) { if ( "string" . equals ( name ) ) { return String . class ; } else if ( "boolean" . equals ( name ) ) { return Boolean . class ; } else if ( "integer" . equals ( name ) ) { return Integer . class ; } else if ( "number" . equals ( name ) ) { return Float...
Gets the JSon schema primitive type .
134,868
public void addValidationError ( String message ) { messages . add ( new UIMessageDTO ( message , null , UIMessage . Severity . ERROR ) ) ; valid = false ; canExecute = false ; }
Adds an extra validation error
134,869
public Object marshalRootElement ( ) { if ( justRoutes ) { RoutesDefinition routes = new RoutesDefinition ( ) ; routes . setRoutes ( contextElement . getRoutes ( ) ) ; return routes ; } else { return contextElement ; } }
Returns the root element to be marshalled as XML
134,870
public Set < String > endpointUris ( ) { try { List < CamelEndpointFactoryBean > endpoints = contextElement . getEndpoints ( ) ; List < String > uris = new LinkedList < String > ( ) ; if ( endpoints != null ) { for ( CamelEndpointFactoryBean cefb : endpoints ) { uris . add ( cefb . getUri ( ) ) ; } } List < Node > sess...
Returns the endpoint URIs used in the context
134,871
protected boolean isValidCommandName ( String name ) { if ( Strings . isNullOrBlank ( name ) || ignoreCommands . contains ( name ) ) { return false ; } for ( String prefix : ignoreCommandPrefixes ) { if ( name . startsWith ( prefix ) ) { return false ; } } return true ; }
Returns true if the name is valid . Lets filter out commands which are not suitable to run inside fabric8 - forge
134,872
public static String mandatoryAttributeValue ( Map < Object , Object > attributeMap , String name ) { Object value = attributeMap . get ( name ) ; if ( value != null ) { String text = value . toString ( ) ; if ( ! Strings . isBlank ( text ) ) { return text ; } } throw new IllegalArgumentException ( "The attribute value...
Returns the mandatory String value of the given name
134,873
public void validateFileDoesNotExist ( UIInput < String > directory , UIInput < String > fileName , UIValidationContext validator ) { String resourcePath = CamelXmlHelper . createFileName ( directory , fileName ) ; if ( files . contains ( resourcePath ) ) { validator . addValidationError ( fileName , "A file with that ...
Validates that the given selected directory and fileName are valid and that the file doesn t already exist
134,874
protected boolean prepare ( final Context2D context , final Attributes attr , final double alpha ) { final double r = attr . getRadius ( ) ; final double beg = attr . getStartAngle ( ) ; final double end = attr . getEndAngle ( ) ; if ( r > 0 ) { context . beginPath ( ) ; if ( beg == end ) { context . arc ( 0 , 0 , r , ...
Draws this chord .
134,875
private void writeToNetwork ( EngineConnection engineConnection ) { final String methodName = "writeToNetwork" ; logger . entry ( this , methodName , engineConnection ) ; if ( engineConnection . transport . pending ( ) > 0 ) { ByteBuffer head = engineConnection . transport . head ( ) ; int amount = head . remaining ( )...
Drains any pending data from a Proton transport object onto the network
134,876
private void resetReceiveIdleTimer ( Event event ) { final String methodName = "resetReceiveIdleTimer" ; logger . entry ( this , methodName , event ) ; if ( receiveScheduledFuture != null ) { receiveScheduledFuture . cancel ( false ) ; } final Transport transport = event . getTransport ( ) ; if ( transport != null ) { ...
Reset the local idle timers now that we have received some data .
134,877
private WiresMagnet getCloserMagnet ( final WiresShape shape , final WiresContainer parent , final boolean allowOverlap ) { final WiresShape parentShape = ( WiresShape ) parent ; final MagnetManager . Magnets magnets = parentShape . getMagnets ( ) ; final Point2D shapeLocation = shape . getComputedLocation ( ) ; final ...
Reurn the closer magnet
134,878
public static void stop ( ) { final ILoggerFactory loggerFactory = org . slf4j . LoggerFactory . getILoggerFactory ( ) ; if ( loggerFactory instanceof LoggerContext ) { final LoggerContext context = ( LoggerContext ) loggerFactory ; context . stop ( ) ; } setup . getAndSet ( false ) ; }
Stops the logging .
134,879
public void move ( final double dx , final double dy , final boolean midPointsOnly , final boolean moveLinePoints ) { final IControlHandleList handles = m_connector . getPointHandles ( ) ; int start = 0 ; int end = handles . size ( ) ; if ( midPointsOnly ) { if ( m_connector . getHeadConnection ( ) . getMagnet ( ) != n...
See class javadocs to explain why we have these booleans
134,880
public static String getVersion ( ) { String version = "unknown" ; final URLClassLoader cl = ( URLClassLoader ) cclass . getClassLoader ( ) ; try { final URL url = cl . findResource ( "META-INF/MANIFEST.MF" ) ; final Manifest manifest = new Manifest ( url . openStream ( ) ) ; for ( Entry < Object , Object > entry : man...
obtains the MQ Light version information from the manifest .
134,881
public static String after ( String text , String after ) { if ( ! text . contains ( after ) ) { return null ; } return text . substring ( text . indexOf ( after ) + after . length ( ) ) ; }
Returns the string after the given token
134,882
public static String before ( String text , String before ) { if ( ! text . contains ( before ) ) { return null ; } return text . substring ( 0 , text . indexOf ( before ) ) ; }
Returns the string before the given token
134,883
public static String between ( String text , String after , String before ) { text = after ( text , after ) ; if ( text == null ) { return null ; } return before ( text , before ) ; }
Returns the string between the given tokens
134,884
public static List < InputComponent > addInputComponents ( UIBuilder builder , InputComponent ... components ) { List < InputComponent > inputComponents = new ArrayList < > ( ) ; for ( InputComponent component : components ) { builder . add ( component ) ; inputComponents . add ( component ) ; } return inputComponents ...
A helper function to add the components to the builder and return a list of all the components
134,885
public static < T > void setInitialComponentValue ( UIInput < T > inputComponent , T value ) { if ( value != null ) { inputComponent . setValue ( value ) ; } }
If the initial value is not blank lets set the value on the underlying component
134,886
public static String createCommitMessage ( String name , ExecutionRequest executionRequest ) { StringBuilder builder = new StringBuilder ( name ) ; List < Map < String , Object > > inputList = executionRequest . getInputList ( ) ; for ( Map < String , Object > map : inputList ) { Set < Map . Entry < String , Object > >...
Lets generate a commit message with the command name and all the parameters we specify
134,887
public static ObjectMapper createObjectMapper ( ) { ObjectMapper mapper = new ObjectMapper ( ) ; mapper . enable ( SerializationFeature . INDENT_OUTPUT ) ; return mapper ; }
Creates a configured Jackson object mapper for parsing JSON
134,888
public static String asTitleCase ( String text ) { StringBuilder sb = new StringBuilder ( ) ; boolean next = true ; for ( char c : text . toCharArray ( ) ) { if ( Character . isSpaceChar ( c ) ) { next = true ; } else if ( next ) { c = Character . toTitleCase ( c ) ; next = false ; } sb . append ( c ) ; } return sb . t...
Returns the text in title case
134,889
public static boolean isDefaultValue ( CamelCatalog camelCatalog , String scheme , String key , String value ) { String json = camelCatalog . componentJSonSchema ( scheme ) ; if ( json == null ) { throw new IllegalArgumentException ( "Could not find catalog entry for component name: " + scheme ) ; } List < Map < String...
Checks whether the given value is matching the default value from the given component .
134,890
public static boolean isModelDefaultValue ( CamelCatalog camelCatalog , String modelName , String key , String value ) { String json = camelCatalog . modelJSonSchema ( modelName ) ; if ( json == null ) { throw new IllegalArgumentException ( "Could not find catalog entry for model name: " + modelName ) ; } List < Map < ...
Checks whether the given value is matching the default value from the given model .
134,891
public static String getModelJavaType ( CamelCatalog camelCatalog , String modelName ) { String json = camelCatalog . modelJSonSchema ( modelName ) ; if ( json == null ) { throw new IllegalArgumentException ( "Could not find catalog entry for model name: " + modelName ) ; } List < Map < String , String > > data = JSonS...
Gets the java type of the given model
134,892
public static boolean isModelSupportOutput ( CamelCatalog camelCatalog , String modelName ) { String json = camelCatalog . modelJSonSchema ( modelName ) ; if ( json == null ) { throw new IllegalArgumentException ( "Could not find catalog entry for model name: " + modelName ) ; } List < Map < String , String > > data = ...
Whether the EIP supports outputs
134,893
public static boolean isComponentConsumerOnly ( CamelCatalog camelCatalog , String scheme ) { String json = camelCatalog . componentJSonSchema ( scheme ) ; if ( json == null ) { return false ; } List < Map < String , String > > data = JSonSchemaHelper . parseJsonSchema ( "component" , json , false ) ; if ( data != null...
Whether the component is consumer only
134,894
public GitContext commitMessage ( String message ) { if ( commitMessage . length ( ) == 0 ) { commitMessage . append ( message + "\n" ) ; } else { commitMessage . append ( "\n- " + message ) ; } return this ; }
Append the commit message .
134,895
public List < Certificate > getCertificates ( ) throws CertificateException , IOException { final String methodName = "getCertificates" ; logger . entry ( this , methodName ) ; final String fileData = getPemFileData ( ) ; final List < ByteBuf > certDataList = new ArrayList < ByteBuf > ( ) ; final Matcher m = CERTIFICAT...
Obtains the list of certificates stored in the PEM file .
134,896
private String getPemFileData ( ) throws IOException { final String methodName = "getPemFileData" ; logger . entry ( this , methodName ) ; if ( pemFileData != null ) { logger . exit ( this , methodName , pemFileData ) ; return pemFileData ; } final StringBuilder sb = new StringBuilder ( ) ; final InputStreamReader isr ...
Read the PEM file data caching it locally such that the file is only read on first use .
134,897
public static < T > T newInstance ( Class < T > type ) { try { return type . newInstance ( ) ; } catch ( InstantiationException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } }
A helper method to create a new instance of a type using the default constructor arguments .
134,898
public static boolean hasMethodWithAnnotation ( Class < ? > type , Class < ? extends Annotation > annotationType , boolean checkMetaAnnotations ) { try { do { Method [ ] methods = type . getDeclaredMethods ( ) ; for ( Method method : methods ) { if ( hasAnnotation ( method , annotationType , checkMetaAnnotations ) ) { ...
Returns true if the given type has a method with the given annotation
134,899
public static boolean hasAnnotation ( AnnotatedElement elem , Class < ? extends Annotation > annotationType , boolean checkMetaAnnotations ) { if ( elem . isAnnotationPresent ( annotationType ) ) { return true ; } if ( checkMetaAnnotations ) { for ( Annotation a : elem . getAnnotations ( ) ) { for ( Annotation meta : a...
Checks if a Class or Method are annotated with the given annotation