signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AnnotationUtil { /** * Attempts to populate a domain object with user metadata by looking for a * { @ literal @ RiakUsermeta } annotated member . * @ param < T > the type of the domain object * @ param usermetaData a Map of user metadata . * @ param domainObject the domain object . * @ return the domain object . */ public static < T > T populateUsermeta ( RiakUserMetadata usermetaData , T domainObject ) { } }
return AnnotationHelper . getInstance ( ) . setUsermetaData ( usermetaData , domainObject ) ;
public class MapPolyline { /** * Replies the Path2D that corresponds to this polyline . * If < var > startPosition < / var > is greater to zero , * the replied path will be clipped to ignore the part of * the polyline before the given value . * If < var > endPosition < / var > is lower to the length of the polyline , * the replied path will be clipped to ignore the part of * the polyline after the given value . * @ param startPosition is the curviline position from which the polyline is drawn . * @ param endPosition is the curviline position to which the polyline is drawn . * @ return the clipped 2D path . * @ since 4.0 */ @ SuppressWarnings ( { } }
"checkstyle:cyclomaticcomplexity" , "checkstyle:npathcomplexity" } ) @ Pure public final Path2d toPath2D ( double startPosition , double endPosition ) { final Path2d path = new Path2d ( ) ; toPath2D ( path , startPosition , endPosition ) ; return path ;
public class InternalXtextParser { /** * InternalXtext . g : 1346:1 : entryRuleAction returns [ EObject current = null ] : iv _ ruleAction = ruleAction EOF ; */ public final EObject entryRuleAction ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleAction = null ; try { // InternalXtext . g : 1346:47 : ( iv _ ruleAction = ruleAction EOF ) // InternalXtext . g : 1347:2 : iv _ ruleAction = ruleAction EOF { newCompositeNode ( grammarAccess . getActionRule ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_1 ) ; iv_ruleAction = ruleAction ( ) ; state . _fsp -- ; current = iv_ruleAction ; match ( input , EOF , FollowSets000 . FOLLOW_2 ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class AbstractSingleFileObjectStore { /** * Alter the store file size . Callers of this method need to check the size asked for is within * the maximum and minium . TODO : refactor the checking into this method . * 2 versions of this method so that callers may get at the IOException if needed . * @ param storeFileSizeRequired The requested size of the store file . * @ return boolean true if the store file is set to the required size . */ private void setStoreFileSizeInternalWithException ( long storeFileSizeRequired ) throws java . io . IOException { } }
final String methodName = "setStoreFileSizeInternalWithException" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { new Long ( storeFileSizeRequired ) , new Long ( storeFileSizeAllocated ) , new Long ( storeFileSizeUsed ) } ) ; java . io . RandomAccessFile f = null ; try { f = new java . io . RandomAccessFile ( storeFileName , "rw" ) ; // rw is required to set the length in java 1.5 f . setLength ( storeFileSizeRequired ) ; // check we got what we asked for final long length = f . length ( ) ; if ( length != storeFileSizeRequired ) { // we are not using a translated exception here because it will only be FFDC ' d so service // is essentially the only consumer , and this error really should have been an IOException . java . io . IOException exception = new java . io . IOException ( "Store file size not what was requested. Requested " + storeFileSizeRequired + ", got + " + length ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { exception } ) ; throw exception ; } storeFileSizeAllocated = storeFileSizeRequired ; } finally { if ( f != null ) { try { f . close ( ) ; } catch ( java . io . IOException e ) { // No FFDC code needed . } } } if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ;
public class ObjectTypedValueWrapper { /** * Instantiate or get the wrapped value . * @ param annotationClassInfo * if non - null , instantiate this object as a parameter value of this annotation class . * @ param paramName * if non - null , instantiate this object as a value of this named parameter . * @ return The value wrapped by this wrapper class . */ Object instantiateOrGet ( final ClassInfo annotationClassInfo , final String paramName ) { } }
final boolean instantiate = annotationClassInfo != null ; if ( enumValue != null ) { return instantiate ? enumValue . loadClassAndReturnEnumValue ( ) : enumValue ; } else if ( classRef != null ) { return instantiate ? classRef . loadClass ( ) : classRef ; } else if ( annotationInfo != null ) { return instantiate ? annotationInfo . loadClassAndInstantiate ( ) : annotationInfo ; } else if ( stringValue != null ) { return stringValue ; } else if ( integerValue != null ) { return integerValue ; } else if ( longValue != null ) { return longValue ; } else if ( shortValue != null ) { return shortValue ; } else if ( booleanValue != null ) { return booleanValue ; } else if ( characterValue != null ) { return characterValue ; } else if ( floatValue != null ) { return floatValue ; } else if ( doubleValue != null ) { return doubleValue ; } else if ( byteValue != null ) { return byteValue ; } else if ( stringArrayValue != null ) { return stringArrayValue ; } else if ( intArrayValue != null ) { return intArrayValue ; } else if ( longArrayValue != null ) { return longArrayValue ; } else if ( shortArrayValue != null ) { return shortArrayValue ; } else if ( booleanArrayValue != null ) { return booleanArrayValue ; } else if ( charArrayValue != null ) { return charArrayValue ; } else if ( floatArrayValue != null ) { return floatArrayValue ; } else if ( doubleArrayValue != null ) { return doubleArrayValue ; } else if ( byteArrayValue != null ) { return byteArrayValue ; } else if ( objectArrayValue != null ) { // Get the element type of the array final Class < ? > eltClass = instantiate ? ( Class < ? > ) getArrayValueClassOrName ( annotationClassInfo , paramName , /* getClass = */ true ) : null ; // Allocate array as either a generic Object [ ] array , if the element type could not be determined , // or as an array of specific element type , if the element type was determined . final Object annotationValueObjectArray = eltClass == null ? new Object [ objectArrayValue . length ] : Array . newInstance ( eltClass , objectArrayValue . length ) ; // Fill the array instance . for ( int i = 0 ; i < objectArrayValue . length ; i ++ ) { if ( objectArrayValue [ i ] != null ) { // Get the element value ( may also cause the element to be instantiated ) final Object eltValue = objectArrayValue [ i ] . instantiateOrGet ( annotationClassInfo , paramName ) ; // Store the possibly - instantiated value in the array Array . set ( annotationValueObjectArray , i , eltValue ) ; } } return annotationValueObjectArray ; } else { return null ; }
public class ViewHelpers { /** * Test if a Predicate is managed * @ param property the property * @ return whether the property is managed */ public static boolean isManagedProperty ( final Node property ) { } }
return property . isURI ( ) && isManagedPredicate . test ( createProperty ( property . getURI ( ) ) ) ;
public class JDBC4ResultSet { /** * Deprecated . use getCharacterStream in place of getUnicodeStream */ @ Override @ Deprecated public InputStream getUnicodeStream ( int columnIndex ) throws SQLException { } }
checkColumnBounds ( columnIndex ) ; throw SQLError . noSupport ( ) ;
public class PluginManager { /** * Get the plugin instance with the given short name . * @ param shortName the short name of the plugin * @ return The plugin singleton or { @ code null } if a plugin with the given short name does not exist . * The fact the plugin is loaded does not mean it is enabled and fully initialized for the current Jenkins session . * Use { @ link PluginWrapper # isActive ( ) } to check it . */ @ CheckForNull public PluginWrapper getPlugin ( String shortName ) { } }
for ( PluginWrapper p : getPlugins ( ) ) { if ( p . getShortName ( ) . equals ( shortName ) ) return p ; } return null ;
public class SquareRegularClustersIntoGrids { /** * Converts the set of provided clusters into ordered grids . * @ param clusters List of clustered nodes */ public void process ( List < List < SquareNode > > clusters ) { } }
valid . reset ( ) ; for ( int i = 0 ; i < clusters . size ( ) ; i ++ ) { List < SquareNode > graph = clusters . get ( i ) ; if ( graph . size ( ) < minimumElements ) continue ; switch ( checkNumberOfConnections ( graph ) ) { case 1 : orderIntoLine ( graph ) ; break ; case 2 : orderIntoGrid ( graph ) ; break ; // default : System . out . println ( " Failed number of connections . size = " + graph . size ( ) ) ; } }
public class AbstractFileServlet { /** * Called if an uncaught error was detected while processing given request . * Default implementation just sends a * { @ linkplain HttpServletResponse # SC _ INTERNAL _ SERVER _ ERROR } status and the * error stack trace embedded in response body . * @ param request HTTP request . * @ param response HTTP response . * @ param error uncaught error . * @ throws IOException */ protected void onUncaughtException ( HttpServletRequest request , HttpServletResponse response , RuntimeException error ) throws IOException { } }
response . setStatus ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ; response . getWriter ( ) . print ( __getStackTrace ( error ) ) ;
public class ItemsSketch { /** * Returns a byte array representation of this sketch * @ param serDe an instance of ArrayOfItemsSerDe * @ return a byte array representation of this sketch */ @ SuppressWarnings ( "null" ) public byte [ ] toByteArray ( final ArrayOfItemsSerDe < T > serDe ) { } }
final int preLongs ; final int outBytes ; final boolean empty = isEmpty ( ) ; final int activeItems = getNumActiveItems ( ) ; byte [ ] bytes = null ; if ( empty ) { preLongs = 1 ; outBytes = 8 ; } else { preLongs = Family . FREQUENCY . getMaxPreLongs ( ) ; bytes = serDe . serializeToByteArray ( hashMap . getActiveKeys ( ) ) ; outBytes = ( ( preLongs + activeItems ) << 3 ) + bytes . length ; } final byte [ ] outArr = new byte [ outBytes ] ; final WritableMemory mem = WritableMemory . wrap ( outArr ) ; // build first preLong empty or not long pre0 = 0L ; pre0 = insertPreLongs ( preLongs , pre0 ) ; // Byte 0 pre0 = insertSerVer ( SER_VER , pre0 ) ; // Byte 1 pre0 = insertFamilyID ( Family . FREQUENCY . getID ( ) , pre0 ) ; // Byte 2 pre0 = insertLgMaxMapSize ( lgMaxMapSize , pre0 ) ; // Byte 3 pre0 = insertLgCurMapSize ( hashMap . getLgLength ( ) , pre0 ) ; // Byte 4 pre0 = empty ? insertFlags ( EMPTY_FLAG_MASK , pre0 ) : insertFlags ( 0 , pre0 ) ; // Byte 5 if ( empty ) { mem . putLong ( 0 , pre0 ) ; } else { final long pre = 0 ; final long [ ] preArr = new long [ preLongs ] ; preArr [ 0 ] = pre0 ; preArr [ 1 ] = insertActiveItems ( activeItems , pre ) ; preArr [ 2 ] = this . streamWeight ; preArr [ 3 ] = this . offset ; mem . putLongArray ( 0 , preArr , 0 , preLongs ) ; final int preBytes = preLongs << 3 ; mem . putLongArray ( preBytes , hashMap . getActiveValues ( ) , 0 , activeItems ) ; mem . putByteArray ( preBytes + ( this . getNumActiveItems ( ) << 3 ) , bytes , 0 , bytes . length ) ; } return outArr ;
public class MwsAQCall { /** * Random exponential back - off sleep on failed request . * If retry needed sleeps and then return true . * Sleep is random so that retry requests do not form spikes . * @ param retries * current retry , 0 for first retry * @ return true if should retry . */ private boolean pauseIfRetryNeeded ( int retries ) { } }
if ( retries >= connection . getMaxErrorRetry ( ) ) { return false ; } long delay = ( long ) ( Math . random ( ) * Math . pow ( 4 , retries ) * 125 ) ; try { Thread . sleep ( delay ) ; } catch ( Exception e ) { throw MwsUtl . wrap ( e ) ; } return true ;
public class DistributedObjectCacheAdapter { /** * used by subclass DistributedNioMap */ final protected void common_put ( Object key , Object value , Object userMetaData , int priority , int timeToLive , int sharingPolicy , Object dependencyIds [ ] , Object aliasIds [ ] ) { } }
try { internal_putAndGet ( key , value , userMetaData , priority , timeToLive , - 1 , sharingPolicy , dependencyIds , aliasIds , ! INCREMENT_REF_COUNT , ! SKIP_MEMORY_WRITE_TO_DISK ) ; } catch ( DynamicCacheException ex ) { com . ibm . ws . ffdc . FFDCFilter . processException ( ex , "com.ibm.ws.cache.DistribtedObjectCacheAdapter" , "669" , this ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "common_put - exception: " + ExceptionUtility . getStackTrace ( ex ) ) ; }
public class JBBPTextWriter { /** * Print horizontal rule . If comments are disabled then only next line will be * added . * @ return the context * @ throws IOException it will be thrown for transport errors * @ see # EnableComments ( ) * @ see # DisableComments ( ) */ public JBBPTextWriter HR ( ) throws IOException { } }
if ( this . flagCommentsAllowed ) { this . ensureNewLineMode ( ) ; this . writeIndent ( ) ; this . write ( this . prefixHR ) ; for ( int i = 0 ; i < this . hrLength ; i ++ ) { this . write ( this . hrChar ) ; } } this . BR ( ) ; return this ;
public class VdmRtLogEditor { /** * ( non - Javadoc ) * @ see org . overture . ide . plugins . rttraceviewer . viewer . IViewCallback # showMessage ( java . lang . String ) */ public void showMessage ( final String message ) { } }
display . asyncExec ( new Runnable ( ) { public void run ( ) { cw . println ( message ) ; cw . show ( ) ; } } ) ;
public class DeclarativeAggregateFunction { /** * Merge input of { @ link # mergeExpressions ( ) } , the input are AGG buffer generated by user definition . */ public final UnresolvedReferenceExpression mergeOperand ( UnresolvedReferenceExpression aggBuffer ) { } }
String name = String . valueOf ( Arrays . asList ( aggBufferAttributes ( ) ) . indexOf ( aggBuffer ) ) ; validateOperandName ( name ) ; return new UnresolvedReferenceExpression ( name ) ;
public class VersionInfo { /** * Get the date when ANNIS was built . * @ return Either the date or { @ code null } if unknown . */ public static Date getBuildDate ( ) { } }
Date result = null ; try { DateFormat format = new SimpleDateFormat ( "yyyy-MM-dd_HH-mm-ss" ) ; String raw = versionProperties . getProperty ( "build_date" ) ; if ( raw != null ) { result = format . parse ( raw ) ; } } catch ( ParseException ex ) { log . debug ( null , ex ) ; } return result ;
public class FileSinkFactory { /** * Turns a class name like foo . bar . Baz into the path destDirName / foo / bar / Baz . java * @ param className * @ return a path name based onthe class and destDirName */ public String convertToPath ( String className ) { } }
final String fixedDir = destDirName . endsWith ( File . separator ) ? destDirName : destDirName + File . separator ; final String fixedClassName = className . replace ( '.' , '/' ) ; return fixedDir + fixedClassName + ".java" ;
public class DialogFragmentUtils { /** * Find fragment registered on the manager . * @ param manager the manager . * @ param tag the tag string that is related to the { @ link android . support . v4 . app . DialogFragment } . * @ param < F > the dialog fragment impl . * @ return the { @ link android . support . v4 . app . DialogFragment } . { @ code null } if the fragment not found . */ @ SuppressWarnings ( "unchecked" ) // we know the dialog fragment is a child of fragment . public static < F extends android . support . v4 . app . DialogFragment > F supportFindDialogFragmentByTag ( android . support . v4 . app . FragmentManager manager , String tag ) { } }
return ( F ) manager . findFragmentByTag ( tag ) ;
public class Input { /** * Returns InputReader for input * @ param < T > * @ param input Any supported input type * @ return * @ throws IOException */ public static < T > InputReader getInstance ( T input ) throws IOException { } }
return getInstance ( input , - 1 , UTF_8 , NO_FEATURES ) ;
public class AttackDetailMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AttackDetail attackDetail , ProtocolMarshaller protocolMarshaller ) { } }
if ( attackDetail == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( attackDetail . getAttackId ( ) , ATTACKID_BINDING ) ; protocolMarshaller . marshall ( attackDetail . getResourceArn ( ) , RESOURCEARN_BINDING ) ; protocolMarshaller . marshall ( attackDetail . getSubResources ( ) , SUBRESOURCES_BINDING ) ; protocolMarshaller . marshall ( attackDetail . getStartTime ( ) , STARTTIME_BINDING ) ; protocolMarshaller . marshall ( attackDetail . getEndTime ( ) , ENDTIME_BINDING ) ; protocolMarshaller . marshall ( attackDetail . getAttackCounters ( ) , ATTACKCOUNTERS_BINDING ) ; protocolMarshaller . marshall ( attackDetail . getAttackProperties ( ) , ATTACKPROPERTIES_BINDING ) ; protocolMarshaller . marshall ( attackDetail . getMitigations ( ) , MITIGATIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SerializableKit { /** * 将byte [ ] 反序列化为Object * @ param bytes * @ return */ public static Serializable toObject ( byte [ ] bytes ) { } }
Serializable obj = null ; ObjectInputStream ois = null ; try { ByteArrayInputStream bais = new ByteArrayInputStream ( bytes ) ; ois = new ObjectInputStream ( bais ) ; obj = ( Serializable ) ois . readObject ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } finally { if ( ois != null ) { try { ois . close ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } } return obj ;
public class ImagesInner { /** * Create or update an image . * @ param resourceGroupName The name of the resource group . * @ param imageName The name of the image . * @ param parameters Parameters supplied to the Create Image operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the ImageInner object if successful . */ public ImageInner beginCreateOrUpdate ( String resourceGroupName , String imageName , ImageInner parameters ) { } }
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , imageName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class BlockingInputStream { /** * Appends bytes to the end of the stream . If the number of bytes to be written is greater than the remaining * capacity , write ( ) will block until the bytes can be added , or the stream is closed . * This method will try to append partial buffers to the stream , e . g . if the remaining capacity is 2K , but the * length of the buffer is 5K , 2K will be written and then write ( ) will block until the remaining 3K can be * added . * @ param buf The buffer to be added to the end of the stream * @ param offset The offset within buf at which bytes are read * @ param length The number of bytes to be added * @ throws IOException */ public void write ( byte [ ] buf , int offset , int length ) throws IOException { } }
if ( buf == null ) return ; sanityCheck ( buf , offset , length ) ; lock . lock ( ) ; try { if ( closed ) return ; int bytes_written = 0 ; while ( bytes_written < length && ! closed ) { if ( read_pos > 0 && length - bytes_written > remaining ( ) ) compact ( ) ; if ( remaining ( ) > 0 ) { int bytes_to_write = Math . min ( length - bytes_written , remaining ( ) ) ; System . arraycopy ( buf , offset + bytes_written , this . buf , write_pos , bytes_to_write ) ; write_pos += bytes_to_write ; bytes_written += bytes_to_write ; not_empty . signalAll ( ) ; } else { try { not_full . await ( ) ; } catch ( InterruptedException e ) { } } } } finally { lock . unlock ( ) ; }
public class Slf4jLogger { /** * This method implements LocationAwareLogger . log * The caller passes in it ' s own Fully Qualified Class Name ( fqcn ) . * @ param marker * @ param fqcn the fully qualified class name ( FQCN ) of the < b > caller < / b > * @ param level Integer representation of the log level as defined in LocationAwareLogger * @ param message the message as a format string * @ param argArray an array of arguments to use in the message format string * @ param t the throwable to log */ public void log ( Marker marker , String fqcn , int level , String message , Object [ ] argArray , Throwable t ) { } }
setMDCMarker ( marker ) ; switch ( level ) { case ( TRACE_INT ) : if ( m_delegate . isTraceEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . arrayFormat ( message , argArray ) ; m_delegate . trace ( tuple . getMessage ( ) , t , fqcn ) ; } break ; case ( DEBUG_INT ) : if ( m_delegate . isDebugEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . arrayFormat ( message , argArray ) ; m_delegate . debug ( tuple . getMessage ( ) , t , fqcn ) ; } break ; case ( INFO_INT ) : if ( m_delegate . isInfoEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . arrayFormat ( message , argArray ) ; m_delegate . inform ( tuple . getMessage ( ) , t , fqcn ) ; } break ; case ( WARN_INT ) : if ( m_delegate . isWarnEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . arrayFormat ( message , argArray ) ; m_delegate . warn ( tuple . getMessage ( ) , t , fqcn ) ; } break ; case ( ERROR_INT ) : if ( m_delegate . isErrorEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . arrayFormat ( message , argArray ) ; m_delegate . error ( tuple . getMessage ( ) , t , fqcn ) ; } break ; default : break ; } resetMDCMarker ( ) ;
public class DistributedObjectCacheAdapter { /** * Returns < tt > true < / tt > if this map contains a mapping for the specified * key . * @ param key key whose presence in this map is to be tested . * @ param includeDiskCache true to check the specified key contained in the memory or * disk maps ; false to check the specified key contained in the memory map . * @ return < tt > true < / tt > if this map contains a mapping for the specified * key . * @ throws ClassCastException if the key is of an inappropriate type for * this map . * @ throws NullPointerException if the key is < tt > null < / tt > and this map * does not not permit < tt > null < / tt > keys . */ @ Override public boolean containsKey ( Object key , boolean includeDiskCache ) { } }
ValidateUtility . objectNotNull ( key , "key" ) ; boolean found = cache . containsCacheId ( key ) ; if ( found ) { return found ; } if ( includeDiskCache ) { if ( cache instanceof CacheProviderWrapper ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "containKey instanceof CacheProviderWrapper" ) ; CacheProviderWrapper cpw = ( CacheProviderWrapper ) cache ; if ( cpw . featureSupport . isDiskCacheSupported ( ) ) found = cache . containsKeyDisk ( key ) ; } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "containKey not instanceof CacheProviderWrapper" ) ; found = cache . containsKeyDisk ( key ) ; } } return found ;
public class AttributeSet { /** * Writer a single attribute to the specified { @ link XMLStreamWriter } using the supplied name * @ param writer the writer * @ param def the Attribute definition * @ param name the XML tag name for the attribute * @ throws XMLStreamException */ public void write ( XMLStreamWriter writer , AttributeDefinition < ? > def , String name ) throws XMLStreamException { } }
Attribute < ? > attribute = attribute ( def ) ; attribute . write ( writer , name ) ;
public class JqPlotUtils { /** * Retorna os recursos de javascript * @ param chart Chart * @ return lista de com os javascripts dos gráficos */ public static List < String > retriveJavaScriptResources ( Chart < ? > chart ) { } }
List < String > resources = new ArrayList < String > ( ) ; Class < ? > clazz = chart . getClass ( ) ; if ( clazz . isAnnotationPresent ( JqPlotPlugin . class ) ) { JqPlotResources [ ] jqPlotResourceses = clazz . getAnnotation ( JqPlotPlugin . class ) . values ( ) ; for ( JqPlotResources jqPlotResources : jqPlotResourceses ) { resources . add ( jqPlotResources . getResource ( ) ) ; } } // can it / should we make this more generic ? if ( chart . getChartConfiguration ( ) . getHighlighter ( ) != null ) { resources . add ( JqPlotResources . Highlighter . getResource ( ) ) ; } return resources ;
public class ConstraintMappingsTypeImpl { /** * Returns all < code > bean < / code > elements * @ return list of < code > bean < / code > */ public List < BeanType < ConstraintMappingsType < T > > > getAllBean ( ) { } }
List < BeanType < ConstraintMappingsType < T > > > list = new ArrayList < BeanType < ConstraintMappingsType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "bean" ) ; for ( Node node : nodeList ) { BeanType < ConstraintMappingsType < T > > type = new BeanTypeImpl < ConstraintMappingsType < T > > ( this , "bean" , childNode , node ) ; list . add ( type ) ; } return list ;
public class CmsDomUtil { /** * Gets the vertical position of the given y - coordinate relative to a given element . < p > * @ param y the coordinate to use * @ param target the element whose coordinate system is to be used * @ return the relative vertical position * @ see com . google . gwt . event . dom . client . MouseEvent # getRelativeY ( com . google . gwt . dom . client . Element ) */ public static int getRelativeY ( int y , Element target ) { } }
return ( y - target . getAbsoluteTop ( ) ) + /* target . getScrollTop ( ) + */ target . getOwnerDocument ( ) . getScrollTop ( ) ;
public class CompensationScope { /** * Resolves in one of two cases : when the ( String ) activityRefStr is equal to : * 1 . the id of an activity that has a compensation handler . * This could be a task with a compensation boundary event or a sub - process * that contains a compensation event sub - process . * 2 . " general : " + the id of the ( sub ) process that contains the compensation handler . In this * case , we are signalling the " implicit compensation handler " , a . k . a . * broadcast / general compensation . */ public Context resolveContext ( Object activityRefStr ) { } }
if ( activityRefStr == null || ! ( activityRefStr instanceof String ) ) { throw new IllegalArgumentException ( "CompensationScope can only resolve based on node id strings: " + activityRefStr ) ; } String activityRef = ( String ) activityRefStr ; if ( getExceptionHandler ( activityRef ) != null ) { return this ; } if ( activityRef . startsWith ( IMPLICIT_COMPENSATION_PREFIX ) ) { String containerRef = activityRef . substring ( IMPLICIT_COMPENSATION_PREFIX . length ( ) ) ; if ( containerId . equals ( containerRef ) ) { return this ; } } return null ;
public class CoverageDataCore { /** * Interpolate 4 values using the offset between value1 and value2 * @ param values * coverage data values * @ param offset * offset between the middle two pixels * @ return value coverage data value */ protected Double getCubicInterpolationValue ( Double [ ] values , double offset ) { } }
Double value = null ; if ( values != null ) { value = getCubicInterpolationValue ( values [ 0 ] , values [ 1 ] , values [ 2 ] , values [ 3 ] , offset ) ; } return value ;
public class Projection { /** * Project logical coordinates in base ratio to Java2D coordinates . */ public int [ ] screenProjectionBaseRatio ( double ... coord ) { } }
double [ ] sc = new double [ 2 ] ; sc [ 0 ] = baseScreenCoords [ 0 ] [ 0 ] ; sc [ 1 ] = baseScreenCoords [ 0 ] [ 1 ] ; for ( int i = 0 ; i < canvas . base . dimension ; i ++ ) { sc [ 0 ] += coord [ i ] * ( baseScreenCoords [ i + 1 ] [ 0 ] - baseScreenCoords [ 0 ] [ 0 ] ) ; sc [ 1 ] += coord [ i ] * ( baseScreenCoords [ i + 1 ] [ 1 ] - baseScreenCoords [ 0 ] [ 1 ] ) ; } return new int [ ] { ( int ) sc [ 0 ] , ( int ) sc [ 1 ] } ;
public class ExecutorCommand { /** * Creates new executor with circuit breaker with name { @ code circuitName } * used to determine if circuit is closed or open by another executors . * @ param < V > type returned by callable methods * @ param circuitName used to enable circuit breaker * @ return { @ code ExecutorCommand < V > } */ public static < V > ExecutorCommand < V > executor ( String circuitName ) { } }
CommandConfig commandConfig = new CommandConfig ( ) ; commandConfig . setCommandName ( circuitName ) ; return new ExecutorCommand < > ( commandConfig ) ;
public class RetryableTask { /** * Invokes the supplied task and catches any thrown exceptions . In the * event of an exception , the provided message is displayed to the * user and the are allowed to retry the task or allow it to fail . */ public void invokeTask ( Component parent , String retryMessage ) throws Exception { } }
while ( true ) { try { invoke ( ) ; return ; } catch ( Exception e ) { Object [ ] options = new Object [ ] { "Retry operation" , "Abort operation" } ; int rv = JOptionPane . showOptionDialog ( parent , retryMessage + "\n\n" + e . getMessage ( ) , "Operation failure" , JOptionPane . YES_NO_OPTION , JOptionPane . WARNING_MESSAGE , null , options , options [ 1 ] ) ; if ( rv == 1 ) { throw e ; } } }
public class ParagraphVectors { /** * This method calculates inferred vector for given text , with default parameters for learning rate and iterations * @ param text * @ return */ public INDArray inferVector ( String text ) { } }
return inferVector ( text , this . learningRate . get ( ) , this . minLearningRate , this . numEpochs * this . numIterations ) ;
public class FileAwareInputStreamDataWriter { /** * Sets the { @ link FsPermission } , owner , group for the path passed . And recursively to all directories and files under * it . */ private void setRecursivePermission ( Path path , OwnerAndPermission ownerAndPermission ) throws IOException { } }
List < FileStatus > files = FileListUtils . listPathsRecursively ( this . fs , path , FileListUtils . NO_OP_PATH_FILTER ) ; // Set permissions bottom up . Permissions are set to files first and then directories Collections . reverse ( files ) ; for ( FileStatus file : files ) { safeSetPathPermission ( file . getPath ( ) , addExecutePermissionsIfRequired ( file , ownerAndPermission ) ) ; }
public class ChatController { /** * Handles message status update service response . * @ param msgStatusList List of message status updates to process . * @ param result Service call response . * @ return Observable emitting result of operations . */ Observable < ChatResult > handleMessageStatusToUpdate ( String conversationId , List < MessageStatusUpdate > msgStatusList , ComapiResult < Void > result ) { } }
if ( result . isSuccessful ( ) && msgStatusList != null && ! msgStatusList . isEmpty ( ) ) { return persistenceController . upsertMessageStatuses ( conversationId , getProfileId ( ) , msgStatusList ) . map ( success -> adapter . adaptResult ( result , success ) ) ; } else { return Observable . fromCallable ( ( ) -> adapter . adaptResult ( result ) ) ; }
public class FacesConfigManagedPropertyTypeImpl { /** * If not already created , a new < code > icon < / code > element will be created and returned . * Otherwise , the first existing < code > icon < / code > element will be returned . * @ return the instance defined for the element < code > icon < / code > */ public IconType < FacesConfigManagedPropertyType < T > > getOrCreateIcon ( ) { } }
List < Node > nodeList = childNode . get ( "icon" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new IconTypeImpl < FacesConfigManagedPropertyType < T > > ( this , "icon" , childNode , nodeList . get ( 0 ) ) ; } return createIcon ( ) ;
public class ClassGraph { /** * Return true if the class name is associated to an hidden class or matches a hide expression */ private boolean hidden ( String className ) { } }
className = removeTemplate ( className ) ; ClassInfo ci = classnames . get ( className ) ; return ci != null ? ci . hidden : optionProvider . getOptionsFor ( className ) . matchesHideExpression ( className ) ;
public class BaseXianConnection { /** * create a new local transaction . * All transactions are produced by connections . * @ param transId transaction id */ private BaseLocalTransaction createLocalTransaction ( String transId ) { } }
BaseLocalTransaction baseLocalTransaction ; try { baseLocalTransaction = localTransactionConstructor . newInstance ( transId , this ) ; } catch ( InstantiationException | IllegalAccessException | InvocationTargetException e ) { throw new RuntimeException ( e ) ; } BaseLocalTransaction . addLocalTransaction ( baseLocalTransaction ) ; return baseLocalTransaction ;
public class ArrayFile { /** * Checks the header of this ArrayFile upon initial loading . * @ throws IOException the header is not valid . */ protected void initCheck ( ) throws IOException { } }
// Check storage version if ( _version != STORAGE_VERSION ) { throw new IOException ( "Invalid version in " + _file . getName ( ) + ": " + _version + ", " + STORAGE_VERSION + " expected" ) ; } // Check array file header if ( ! checkHeader ( ) ) { throw new IOException ( "Invalid header in " + _file . getName ( ) + ": " + getHeader ( ) ) ; }
public class WebServicesStore { /** * - - - - - provider configuration */ @ Process ( actionType = ModifyProviderConfiguration . class ) public void modifyProviderConfiguration ( final ModifyProviderConfiguration action , final Dispatcher . Channel channel ) { } }
operationDelegate . onSaveResource ( WS_SUBSYSTEM , null , action . getChangedValues ( ) , new CrudOperationDelegate . Callback ( ) { @ Override public void onSuccess ( final AddressTemplate addressTemplate , final String name ) { final ModelNode op = readProviderConfiguration ( ) ; dispatcher . execute ( new DMRAction ( op ) , new AsyncCallback < DMRResponse > ( ) { @ Override public void onFailure ( Throwable caught ) { channel . nack ( caught ) ; } @ Override public void onSuccess ( DMRResponse dmrResponse ) { ModelNode response = dmrResponse . get ( ) ; if ( response . isFailure ( ) ) { channel . nack ( new RuntimeException ( "Failed to read " + addressTemplate + " using " + op + ": " + response . getFailureDescription ( ) ) ) ; } else { providerConfiguration = response . get ( RESULT ) ; channel . ack ( ) ; } } } ) ; } @ Override public void onFailure ( AddressTemplate addressTemplate , String name , Throwable t ) { channel . nack ( t ) ; } } ) ;
public class MutableHashTable { /** * Set all the bucket memory except bucket header as the bit set of bloom filter , and use hash code of build records * to build bloom filter . */ final void buildBloomFilterForBucket ( int bucketInSegmentPos , MemorySegment bucket , HashPartition < BT , PT > p ) { } }
final int count = bucket . getShort ( bucketInSegmentPos + HEADER_COUNT_OFFSET ) ; if ( count <= 0 ) { return ; } int [ ] hashCodes = new int [ count ] ; // As the hashcode and bloom filter occupy same bytes , so we read all hashcode out at first and then write back to bloom filter . for ( int i = 0 ; i < count ; i ++ ) { hashCodes [ i ] = bucket . getInt ( bucketInSegmentPos + BUCKET_HEADER_LENGTH + i * HASH_CODE_LEN ) ; } this . bloomFilter . setBitsLocation ( bucket , bucketInSegmentPos + BUCKET_HEADER_LENGTH ) ; for ( int hashCode : hashCodes ) { this . bloomFilter . addHash ( hashCode ) ; } buildBloomFilterForExtraOverflowSegments ( bucketInSegmentPos , bucket , p ) ;
public class ReadOnlyStyledDocumentBuilder { /** * Returns an unmodifiable list of the constructed { @ link Paragraph } s and ensures this builder cannot be used again . */ public ReadOnlyStyledDocument < PS , SEG , S > build ( ) { } }
ensureNotYetCreated ( ) ; if ( paragraphList . isEmpty ( ) ) { throw new IllegalStateException ( "Cannot build a ReadOnlyStyledDocument with an empty list of paragraphs!" ) ; } alreadyCreated = true ; return new ReadOnlyStyledDocument < > ( paragraphList ) ;
public class XmlEscape { /** * Perform an XML < strong > unescape < / strong > operation on a < tt > Reader < / tt > input , * writing results to a < tt > Writer < / tt > . * No additional configuration arguments are required . Unescape operations * will always perform < em > complete < / em > XML 1.0/1.1 unescape of CERs , decimal * and hexadecimal references . * This method is < strong > thread - safe < / strong > . * @ param reader the < tt > Reader < / tt > reading the text to be unescaped . * @ param writer the < tt > java . io . Writer < / tt > to which the unescaped result will be written . Nothing will * be written at all to this writer if input is < tt > null < / tt > . * @ throws IOException if an input / output exception occurs * @ since 1.1.2 */ public static void unescapeXml ( final Reader reader , final Writer writer ) throws IOException { } }
if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } // The chosen symbols ( 1.0 or 1.1 ) don ' t really matter , as both contain the same CERs XmlEscapeUtil . unescape ( reader , writer , XmlEscapeSymbols . XML11_SYMBOLS ) ;
public class KdTreeConstructor { /** * Convenient function for creating a leaf node */ private KdTree . Node createLeaf ( List < P > points , GrowQueue_I32 indexes ) { } }
int index = indexes == null ? - 1 : indexes . get ( 0 ) ; return memory . requestNode ( points . get ( 0 ) , index ) ;
public class StringBuilders { /** * Ensures that the char [ ] array of the specified StringBuilder does not exceed the specified number of characters . * This method is useful to ensure that excessively long char [ ] arrays are not kept in memory forever . * @ param stringBuilder the StringBuilder to check * @ param maxSize the maximum number of characters the StringBuilder is allowed to have * @ since 2.9 */ public static void trimToMaxSize ( final StringBuilder stringBuilder , final int maxSize ) { } }
if ( stringBuilder != null && stringBuilder . capacity ( ) > maxSize ) { stringBuilder . setLength ( maxSize ) ; stringBuilder . trimToSize ( ) ; }
public class UserClient { /** * Get all groups of a user * @ param username Necessary * @ return Group info list * @ throws APIConnectionException connect exception * @ throws APIRequestException request exception */ public UserGroupsResult getGroupList ( String username ) throws APIConnectionException , APIRequestException { } }
StringUtils . checkUsername ( username ) ; ResponseWrapper response = _httpClient . sendGet ( _baseUrl + userPath + "/" + username + "/groups" ) ; return UserGroupsResult . fromResponse ( response ) ;
public class RepositoryResourceImpl { /** * { @ inheritDoc } */ @ Override public AttachmentResource getAttachment ( String attachmentName ) throws RepositoryBackendException , RepositoryResourceException { } }
for ( AttachmentResource at : getAttachments ( ) ) { if ( at . getName ( ) . equals ( attachmentName ) ) { return at ; } } return null ;
public class EffectUtil { /** * Prompts the user for float value * @ param name The name of the dialog to show * @ param currentValue The current value to be displayed * @ param description The help text to provide * @ param min The minimum value to allow * @ param max The maximum value to allow * @ return The value selected by the user */ static public Value floatValue ( String name , final float currentValue , final float min , final float max , final String description ) { } }
return new DefaultValue ( name , String . valueOf ( currentValue ) ) { public void showDialog ( ) { JSpinner spinner = new JSpinner ( new SpinnerNumberModel ( currentValue , min , max , 0.1f ) ) ; if ( showValueDialog ( spinner , description ) ) value = String . valueOf ( ( ( Double ) spinner . getValue ( ) ) . floatValue ( ) ) ; } public Object getObject ( ) { return Float . valueOf ( value ) ; } } ;
public class CmsJlanUsers { /** * Computes an MD4 hash for the password . * @ param password the password for which to compute the hash * @ throws NoSuchAlgorithmException * @ throws InvalidKeyException * @ return the password hash */ public static byte [ ] hashPassword ( String password ) throws InvalidKeyException , NoSuchAlgorithmException { } }
PasswordEncryptor encryptor = new PasswordEncryptor ( ) ; return encryptor . generateEncryptedPassword ( password , null , PasswordEncryptor . MD4 , null , null ) ;
public class TemplateList { /** * Get the head of the assocation list that is keyed by target . * @ param key * @ param assoc */ private void putHead ( String key , TemplateSubPatternAssociation assoc ) { } }
if ( key . equals ( PsuedoNames . PSEUDONAME_TEXT ) ) m_textPatterns = assoc ; else if ( key . equals ( PsuedoNames . PSEUDONAME_ROOT ) ) m_docPatterns = assoc ; else if ( key . equals ( PsuedoNames . PSEUDONAME_COMMENT ) ) m_commentPatterns = assoc ; m_patternTable . put ( key , assoc ) ;
public class Panel { /** * click on element with class " x - tool - " + id * @ param id element * @ return true | false */ public boolean clickOnTool ( String id ) { } }
ExtJsComponent toolElement = getToolElement ( id ) . setVisibility ( true ) ; return toolElement . click ( ) ;
public class LifecycleHooks { /** * Get fully - qualified name to use for hooked test class . * @ param testObj test class object being hooked * @ return fully - qualified name for hooked subclass */ static String getSubclassName ( Object testObj ) { } }
Class < ? > testClass = testObj . getClass ( ) ; String testClassName = testClass . getSimpleName ( ) ; String testPackageName = testClass . getPackage ( ) . getName ( ) ; ReportsDirectory constant = ReportsDirectory . fromObject ( testObj ) ; switch ( constant ) { case FAILSAFE_2 : case FAILSAFE_3 : case SUREFIRE_2 : case SUREFIRE_3 : case SUREFIRE_4 : return testPackageName + ".Hooked" + testClassName ; default : return testClass . getCanonicalName ( ) + "Hooked" ; }
public class DataContextUtils { /** * Return a converter that can expand the property references within a string * @ param data property context data * @ param converter secondary converter to apply to property values before replacing in a string * @ param failOnUnexpanded if true , fail if a property value cannot be expanded * @ return a Converter to expand property values within a string */ public static Converter < String , String > replaceDataReferencesConverter ( final Map < String , Map < String , String > > data , final Converter < String , String > converter , final boolean failOnUnexpanded ) { } }
return s -> replaceDataReferencesInString ( s , data , converter , failOnUnexpanded ) ;
public class OSMFileHeader { /** * Constructor for XML Parser */ public static OSMFileHeader create ( long id , XMLStreamReader parser ) throws XMLStreamException { } }
OSMFileHeader header = new OSMFileHeader ( ) ; parser . nextTag ( ) ; return header ;
public class AbstractCob2JavaGeneratorMain { /** * Take arguments received on the command line and setup corresponding * options . * No arguments is valid . It means use the defaults . * @ param options the expected options * @ param args the actual arguments received on the command line * @ return true if arguments were valid */ protected boolean collectOptions ( final Options options , final String [ ] args ) { } }
try { if ( args != null && args . length > 0 ) { CommandLineParser parser = new PosixParser ( ) ; CommandLine line = parser . parse ( options , args ) ; return processLine ( line , options ) ; } return true ; } catch ( ParseException e ) { log . error ( "Invalid option" , e ) ; return false ; } catch ( IllegalArgumentException e ) { log . error ( "Invalid option value" , e ) ; return false ; }
public class BaseSimpleReact { /** * Start a reactive dataflow from a stream of CompletableFutures . * @ param stream of CompletableFutures that will be used to drive the reactive dataflow * @ return Next stage in the reactive flow */ public < U > BaseSimpleReactStream < U > fromStream ( final Stream < CompletableFuture < U > > stream ) { } }
final Stream s = stream ; return construct ( s ) ;
public class CmsMultiSelectBox { /** * Sets the text that is used for the " not selected " option . < p > * @ param text the text which should be used for the " not selected " option */ public void setTextForNullSelection ( String text ) { } }
// do nothing if there ' s no null option CmsMultiSelectCell cell = m_selectCells . get ( "" ) ; if ( cell == null ) { return ; } cell . setTitle ( text ) ; // if the null option is selected , we still need to update the opener if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( m_selectedValue ) ) { selectValue ( "" ) ; }
public class RendererRequestUtils { /** * Returns the bundle renderer context . * @ param request * the request * @ param renderer * the bundle renderer * @ return the bundle renderer context . */ public static BundleRendererContext getBundleRendererContext ( HttpServletRequest request , BundleRenderer renderer ) { } }
String bundleRendererCtxAttributeName = BUNDLE_RENDERER_CONTEXT_ATTR_PREFIX + renderer . getResourceType ( ) ; // If we are handling an error dispatch , we should remove the current // RendererContext to use a new one String jawrErrorDispathAttributeName = JAWR_ERROR_DISPATCH + renderer . getResourceType ( ) ; clearRequestWhenDispatch ( request , ERROR_EXCEPTION , bundleRendererCtxAttributeName , jawrErrorDispathAttributeName ) ; // If we are handling a forward dispatch , we should remove the current // RendererContext to use a new one String jawrForwardDispathAttributeName = JAWR_FOWARD_DISPATCH + renderer . getResourceType ( ) ; clearRequestWhenDispatch ( request , FORWARD_REQUEST_URI , bundleRendererCtxAttributeName , jawrForwardDispathAttributeName ) ; BundleRendererContext ctx = ( BundleRendererContext ) request . getAttribute ( bundleRendererCtxAttributeName ) ; if ( ctx == null ) { ctx = new BundleRendererContext ( request , renderer . getBundler ( ) . getConfig ( ) ) ; request . setAttribute ( bundleRendererCtxAttributeName , ctx ) ; } return ctx ;
public class Matrix4x3f { /** * Set the value of the matrix element at column 2 and row 1. * @ param m21 * the new value * @ return this */ public Matrix4x3f m21 ( float m21 ) { } }
this . m21 = m21 ; properties &= ~ PROPERTY_ORTHONORMAL ; if ( m21 != 0.0f ) properties &= ~ ( PROPERTY_IDENTITY | PROPERTY_TRANSLATION ) ; return this ;
public class AAFLurPerm { /** * / * ( non - Javadoc ) * @ see com . att . cadi . Lur # createPerm ( java . lang . String ) */ @ Override public Permission createPerm ( String p ) { } }
String [ ] params = Split . split ( '|' , p ) ; if ( params . length == 3 ) { return new AAFPermission ( params [ 0 ] , params [ 1 ] , params [ 2 ] ) ; } else { return new LocalPermission ( p ) ; }
public class Reader { /** * Return a { @ code Reader } which reads the value from the child elements of * the given parent element { @ code name } . * < b > XML < / b > * < pre > { @ code < min > < property name = " size " > 1234 < property > < / min > } < / pre > * < b > Reader definition < / b > * < pre > { @ code * final Reader < Property > reader = * elem ( " min " , * elem ( * final String name = ( String ) v [ 0 ] ; * final Integer value = ( Integer ) v [ 1 ] ; * return Property . of ( name , value ) ; * " property " , * attr ( " name " ) , * text ( ) . map ( Integer : : parseInt ) * } < / pre > * @ param name the parent element name * @ param reader the child elements reader * @ param < T > the result type * @ return a node reader * @ throws NullPointerException if one of the given arguments is { @ code null } */ public static < T > Reader < T > elem ( final String name , final Reader < ? extends T > reader ) { } }
requireNonNull ( name ) ; requireNonNull ( reader ) ; return elem ( v -> { @ SuppressWarnings ( "unchecked" ) T value = v . length > 0 ? ( T ) v [ 0 ] : null ; return value ; } , name , reader ) ;
public class CommerceOrderNotePersistenceImpl { /** * Removes the commerce order note where companyId = & # 63 ; and externalReferenceCode = & # 63 ; from the database . * @ param companyId the company ID * @ param externalReferenceCode the external reference code * @ return the commerce order note that was removed */ @ Override public CommerceOrderNote removeByC_ERC ( long companyId , String externalReferenceCode ) throws NoSuchOrderNoteException { } }
CommerceOrderNote commerceOrderNote = findByC_ERC ( companyId , externalReferenceCode ) ; return remove ( commerceOrderNote ) ;
public class activity_status { /** * < pre > * Use this operation to get activity status . * < / pre > */ public static activity_status [ ] get ( nitro_service client ) throws Exception { } }
activity_status resource = new activity_status ( ) ; resource . validate ( "get" ) ; return ( activity_status [ ] ) resource . get_resources ( client ) ;
public class XMLMessages { /** * Creates a message from the specified key and replacement * arguments , localized to the given locale . * @ param fResourceBundle The resource bundle to use . * @ param msgKey The message key to use . * @ param args The arguments to be used as replacement text * in the message created . * @ return The formatted message string . */ public static final String createMsg ( ListResourceBundle fResourceBundle , String msgKey , Object args [ ] ) // throws Exception { } }
String fmsg = null ; boolean throwex = false ; String msg = null ; if ( msgKey != null ) msg = fResourceBundle . getString ( msgKey ) ; if ( msg == null ) { msg = fResourceBundle . getString ( BAD_CODE ) ; throwex = true ; } if ( args != null ) { try { // Do this to keep format from crying . // This is better than making a bunch of conditional // code all over the place . int n = args . length ; for ( int i = 0 ; i < n ; i ++ ) { if ( null == args [ i ] ) args [ i ] = "" ; } fmsg = java . text . MessageFormat . format ( msg , args ) ; } catch ( Exception e ) { fmsg = fResourceBundle . getString ( FORMAT_FAILED ) ; fmsg += " " + msg ; } } else fmsg = msg ; if ( throwex ) { throw new RuntimeException ( fmsg ) ; } return fmsg ;
public class DateTimePicker { /** * Converts the date from the moment . js format to a java . util . Date . */ @ Override public Object getConvertedValue ( FacesContext context , Object submittedValue ) throws ConverterException { } }
if ( submittedValue == null ) { return null ; } String val = ( String ) submittedValue ; // If the Trimmed submitted value is empty , return null if ( val . trim ( ) . length ( ) == 0 ) { return null ; } Converter converter = this . getConverter ( ) ; // If the user supplied a converter , use it if ( converter != null ) { return converter . getAsObject ( context , this , val ) ; } // Else we use our own converter Locale sloc = BsfUtils . selectLocale ( context . getViewRoot ( ) . getLocale ( ) , this . getLocale ( ) , this ) ; String momentJSFormat = BsfUtils . selectMomentJSDateTimeFormat ( sloc , this . getFormat ( ) , this . isShowDate ( ) , this . isShowTime ( ) ) ; String javaFormat = LocaleUtils . momentToJavaFormat ( momentJSFormat ) ; Calendar cal = Calendar . getInstance ( sloc ) ; SimpleDateFormat format = new SimpleDateFormat ( javaFormat , sloc ) ; format . setTimeZone ( cal . getTimeZone ( ) ) ; try { cal . setTime ( format . parse ( val ) ) ; return cal . getTime ( ) ; } catch ( ParseException e ) { // FIRST STEP GONE : TRY THE AUTO - PARSER try { cal . setTime ( LocaleUtils . autoParseDateFormat ( val ) ) ; return cal . getTime ( ) ; } catch ( Exception pe ) { this . setValid ( false ) ; throw new ConverterException ( BsfUtils . getMessage ( "javax.faces.converter.DateTimeConverter.DATE" , val , javaFormat , BsfUtils . getLabel ( context , this ) ) ) ; } }
public class SearchResultUtils { /** * Extract the documents from the specified result . * @ param result the result containing the documents * @ return the documents */ @ SuppressWarnings ( "unchecked" ) public static final List < Map < String , Object > > getDocuments ( Map < String , Object > result ) { } }
if ( MapUtils . isNotEmpty ( result ) && result . containsKey ( RESPONSE_KEY ) ) { Map < String , Object > response = ( Map < String , Object > ) result . get ( RESPONSE_KEY ) ; if ( MapUtils . isNotEmpty ( response ) && response . containsKey ( DOCUMENTS_KEY ) ) { return ( List < Map < String , Object > > ) response . get ( DOCUMENTS_KEY ) ; } } return null ;
public class JMLog { /** * Debug . * @ param log the log * @ param methodName the method name * @ param params the params */ public static void debug ( Logger log , String methodName , Object ... params ) { } }
if ( log . isDebugEnabled ( ) ) log . debug ( buildMethodLogString ( methodName , params ) ) ;
public class JobsInner { /** * Get Job . * Gets a Job . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ param transformName The Transform name . * @ param jobName The Job name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the JobInner object */ public Observable < JobInner > getAsync ( String resourceGroupName , String accountName , String transformName , String jobName ) { } }
return getWithServiceResponseAsync ( resourceGroupName , accountName , transformName , jobName ) . map ( new Func1 < ServiceResponse < JobInner > , JobInner > ( ) { @ Override public JobInner call ( ServiceResponse < JobInner > response ) { return response . body ( ) ; } } ) ;
public class ListVoiceConnectorTerminationCredentialsResult { /** * A list of user names . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setUsernames ( java . util . Collection ) } or { @ link # withUsernames ( java . util . Collection ) } if you want to * override the existing values . * @ param usernames * A list of user names . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListVoiceConnectorTerminationCredentialsResult withUsernames ( String ... usernames ) { } }
if ( this . usernames == null ) { setUsernames ( new java . util . ArrayList < String > ( usernames . length ) ) ; } for ( String ele : usernames ) { this . usernames . add ( ele ) ; } return this ;
public class Speller { /** * Propose suggestions for misspelled run - on words . This algorithm is inspired * by spell . cc in s _ fsa package by Jan Daciuk . * @ param original * The original misspelled word . * @ return The list of suggested pairs , as space - concatenated strings . */ public List < String > replaceRunOnWords ( final String original ) { } }
final List < String > candidates = new ArrayList < String > ( ) ; String wordToCheck = original ; if ( ! dictionaryMetadata . getInputConversionPairs ( ) . isEmpty ( ) ) { wordToCheck = DictionaryLookup . applyReplacements ( original , dictionaryMetadata . getInputConversionPairs ( ) ) ; } if ( ! isInDictionary ( wordToCheck ) && dictionaryMetadata . isSupportingRunOnWords ( ) ) { for ( int i = 1 ; i < wordToCheck . length ( ) ; i ++ ) { // chop from left to right final CharSequence firstCh = wordToCheck . subSequence ( 0 , i ) ; if ( isInDictionary ( firstCh ) && isInDictionary ( wordToCheck . subSequence ( i , wordToCheck . length ( ) ) ) ) { if ( dictionaryMetadata . getOutputConversionPairs ( ) . isEmpty ( ) ) { candidates . add ( firstCh + " " + wordToCheck . subSequence ( i , wordToCheck . length ( ) ) ) ; } else { candidates . add ( DictionaryLookup . applyReplacements ( firstCh + " " + wordToCheck . subSequence ( i , wordToCheck . length ( ) ) , dictionaryMetadata . getOutputConversionPairs ( ) ) . toString ( ) ) ; } } } } return candidates ;
public class Helper { /** * Loads the available corpus configurations for a list of specific corpora . * @ param corpora A Set of corpora names . * @ return A { @ link CorpusConfigMap } object , which wraps a Map of * { @ link Properties } objects . The keys to the properties are the corpus * names . A Properties object stores the corpus configuration as simple * key - value pairs . The map includes the default configuration . */ public static CorpusConfigMap getCorpusConfigs ( Set < String > corpora ) { } }
CorpusConfigMap corpusConfigurations = new CorpusConfigMap ( ) ; for ( String corpus : corpora ) { corpusConfigurations . put ( corpus , getCorpusConfig ( corpus ) ) ; } corpusConfigurations . put ( DEFAULT_CONFIG , getDefaultCorpusConfig ( ) ) ; return corpusConfigurations ;
public class AWSAmplifyClient { /** * Updates a branch for an Amplify App . * @ param updateBranchRequest * Request structure for update branch request . * @ return Result of the UpdateBranch operation returned by the service . * @ throws BadRequestException * Exception thrown when a request contains unexpected data . * @ throws UnauthorizedException * Exception thrown when an operation fails due to a lack of access . * @ throws NotFoundException * Exception thrown when an entity has not been found during an operation . * @ throws InternalFailureException * Exception thrown when the service fails to perform an operation due to an internal issue . * @ throws DependentServiceFailureException * Exception thrown when an operation fails due to a dependent service throwing an exception . * @ sample AWSAmplify . UpdateBranch * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / amplify - 2017-07-25 / UpdateBranch " target = " _ top " > AWS API * Documentation < / a > */ @ Override public UpdateBranchResult updateBranch ( UpdateBranchRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeUpdateBranch ( request ) ;
public class Utils { /** * Returns the value associated with with a given key or null if no such key is present in the * set of tags . * @ param tags * Set of tags to search . * @ param k * Key to search for . * @ return * Value for the key or null if the key is not present . */ public static String getTagValue ( Iterable < Tag > tags , String k ) { } }
Preconditions . checkNotNull ( tags , "tags" ) ; Preconditions . checkNotNull ( k , "key" ) ; for ( Tag t : tags ) { if ( k . equals ( t . key ( ) ) ) { return t . value ( ) ; } } return null ;
public class FunctionForVoltDB { /** * Given a function name and signature , find if there is * an existing definition or saved defintion which matches the * name and signature , and return the definition . * @ param functionName * @ param returnType * @ param parameterType * @ return The matching definition , or null if there is no matching definition . */ private static FunctionDescriptor findFunction ( String functionName , Type returnType , Type [ ] parameterType ) { } }
m_logger . debug ( "Looking for UDF " + functionName ) ; FunctionDescriptor fd = FunctionDescriptor . m_by_LC_name . get ( functionName ) ; if ( fd == null ) { m_logger . debug ( " Not defined in by_LC_name. Maybe it's saved." ) ; fd = FunctionDescriptor . m_saved_functions . get ( functionName ) ; } if ( fd != null && functionMatches ( fd , returnType , parameterType ) ) { m_logger . debug ( " " + functionName + " is defined or saved. id == " + fd . getId ( ) ) ; return fd ; } m_logger . debug ( " " + functionName + " is not defined or saved." ) ; return null ;
public class EntityREST { /** * Updates classifications to an existing entity represented by a guid . * @ param guid globally unique identifier for the entity * @ return classification for the given entity guid */ @ PUT @ Path ( "/guid/{guid}/classifications" ) @ Produces ( Servlets . JSON_MEDIA_TYPE ) public void updateClassification ( @ PathParam ( "guid" ) final String guid , List < AtlasClassification > classifications ) throws AtlasBaseException { } }
AtlasPerfTracer perf = null ; try { if ( AtlasPerfTracer . isPerfTraceEnabled ( PERF_LOG ) ) { perf = AtlasPerfTracer . getPerfTracer ( PERF_LOG , "EntityREST.updateClassification(" + guid + ")" ) ; } if ( StringUtils . isEmpty ( guid ) ) { throw new AtlasBaseException ( AtlasErrorCode . INSTANCE_GUID_NOT_FOUND , guid ) ; } entitiesStore . updateClassifications ( guid , classifications ) ; } finally { AtlasPerfTracer . log ( perf ) ; }
public class HttpClientConnection { /** * Sends the request , recycles it and closes connection in case of timeout * @ param request request for sending */ public Promise < HttpResponse > send ( HttpRequest request ) { } }
SettablePromise < HttpResponse > promise = new SettablePromise < > ( ) ; this . promise = promise ; assert pool == null ; ( pool = client . poolReadWrite ) . addLastNode ( this ) ; poolTimestamp = eventloop . currentTimeMillis ( ) ; HttpHeaderValue connectionHeader = CONNECTION_KEEP_ALIVE_HEADER ; if ( client . maxKeepAliveRequests != - 1 ) { if ( ++ numberOfKeepAliveRequests >= client . maxKeepAliveRequests ) { connectionHeader = CONNECTION_CLOSE_HEADER ; } } request . addHeader ( CONNECTION , connectionHeader ) ; ByteBuf buf = renderHttpMessage ( request ) ; if ( buf != null ) { writeBuf ( buf ) ; } else { writeHttpMessageAsChunkedStream ( request ) ; } request . recycle ( ) ; if ( ! isClosed ( ) ) { try { readHttpMessage ( ) ; } catch ( ParseException e ) { closeWithError ( e ) ; } } return promise ;
public class GetVoiceChannelRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetVoiceChannelRequest getVoiceChannelRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getVoiceChannelRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getVoiceChannelRequest . getApplicationId ( ) , APPLICATIONID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class RMIRegistryManager { /** * Starts rmiregistry in a separate process on the specified port . * @ param port on which the rmiregistry needs to be started * @ return true if successful , false otherwise */ public static boolean startOutProcRMIRegistry ( Configuration configuration , final int port ) { } }
LOGGER . info ( "Starting rmiregistry on port " + port ) ; try { Registry registryStarted = RegistryFinder . getInstance ( ) . getRegistry ( configuration , port ) ; if ( registryStarted != null ) { LOGGER . info ( "rmiregistry started on " + port ) ; } else { LOGGER . error ( "Failed to start rmiregistry on " + port ) ; } } catch ( Exception e ) { // TODO Auto - generated catch block e . printStackTrace ( ) ; } return false ; // return startProcess ( port , JAVA _ HOME _ RMI _ REGISTRY ) | | startProcess ( port , RMI _ REGISTRY ) ;
public class SpaceResource { /** * Gets a listing of the contents of a space . * @ param spaceID * @ param storeID * @ param prefix * @ param maxResults * @ param marker * @ return XML listing of space contents */ public String getSpaceContents ( String spaceID , String storeID , String prefix , long maxResults , String marker ) throws ResourceException { } }
Element spaceElem = new Element ( "space" ) ; spaceElem . setAttribute ( "id" , spaceID ) ; try { StorageProvider storage = storageProviderFactory . getStorageProvider ( storeID ) ; List < String > contents = storage . getSpaceContentsChunked ( spaceID , prefix , maxResults , marker ) ; if ( contents != null ) { for ( String contentItem : contents ) { Element contentElem = new Element ( "item" ) ; contentElem . setText ( contentItem ) ; spaceElem . addContent ( contentElem ) ; } } } catch ( NotFoundException e ) { throw new ResourceNotFoundException ( "build space XML for" , spaceID , e ) ; } catch ( Exception e ) { storageProviderFactory . expireStorageProvider ( storeID ) ; throw new ResourceException ( "build space XML for" , spaceID , e ) ; } Document doc = new Document ( spaceElem ) ; XMLOutputter xmlConverter = new XMLOutputter ( ) ; return xmlConverter . outputString ( doc ) ;
public class RootNodeRunner { /** * TODO rootnode recording of result is sutbly different - the rootnode is just the sum of its parts , but features can be tagged with non fatal tags */ @ Override protected void recordResult ( final RootNode node , final boolean success , final RootNodeExecutionContext context ) { } }
if ( success ) { if ( log . isTraceEnabled ( ) ) { log . trace ( "node success" ) ; } node . getResult ( ) . setFinished ( ) ; context . getNotificationDistributor ( ) . onNodeFinished ( node ) ; } else { final List < SubstepExecutionFailure > failures = context . getFailures ( ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "node failures" ) ; } // have a look at the constituent features List < FeatureNode > featureNodes = node . getChildren ( ) ; boolean rootNodeStateSet = false ; for ( FeatureNode featureNode : node . getChildren ( ) ) { if ( featureNode . getResult ( ) . getResult ( ) == ExecutionResult . FAILED && ! featureNode . getResult ( ) . getFailure ( ) . isNonCritical ( ) ) { // we ' ve got one valid feature failure , fail the root node SubstepsRuntimeException e = new SubstepsRuntimeException ( "At least one critical Feature failed" ) ; SubstepExecutionFailure sef = new SubstepExecutionFailure ( e , node , ExecutionResult . FAILED ) ; context . getNotificationDistributor ( ) . onNodeFailed ( node , e ) ; rootNodeStateSet = true ; break ; } } if ( ! rootNodeStateSet ) { // got this far , must be ok node . getResult ( ) . setFinished ( ) ; context . getNotificationDistributor ( ) . onNodeFinished ( node ) ; } // final Throwable lastException ; // boolean nonCritical = false ; // if ( ! failures . isEmpty ( ) ) { // final SubstepExecutionFailure lastFailure = failures . get ( failures . size ( ) - 1 ) ; // / / just notify on the last one in . . ? // lastException = lastFailure . getCause ( ) ; // node . getResult ( ) . setScreenshot ( lastFailure . getScreenshot ( ) ) ; // nonCritical = lastFailure . isNonCritical ( ) ; // else { // lastException = new SubstepsRuntimeException ( " Error throw during startup , initialisation issue ? " ) ; // lastException . fillInStackTrace ( ) ; // SubstepExecutionFailure sef = new SubstepExecutionFailure ( lastException , node , ExecutionResult . FAILED ) ; // SubstepExecutionFailure sef = new SubstepExecutionFailure ( lastException , node , ExecutionResult . FAILED ) ; // sef . setNonCritical ( nonCritical ) ; // context . getNotificationDistributor ( ) . onNodeFailed ( node , lastException ) ; }
public class TypeUtils { /** * < p > Return a map of the type arguments of a class in the context of { @ code toClass } . < / p > * @ param cls the class in question * @ param toClass the context class * @ param subtypeVarAssigns a map with type variables * @ return the { @ code Map } with type arguments */ private static Map < TypeVariable < ? > , Type > getTypeArguments ( Class < ? > cls , final Class < ? > toClass , final Map < TypeVariable < ? > , Type > subtypeVarAssigns ) { } }
// make sure they ' re assignable if ( ! isAssignable ( cls , toClass ) ) { return null ; } // can ' t work with primitives if ( cls . isPrimitive ( ) ) { // both classes are primitives ? if ( toClass . isPrimitive ( ) ) { // dealing with widening here . No type arguments to be // harvested with these two types . return new HashMap < > ( ) ; } // work with wrapper the wrapper class instead of the primitive cls = ClassUtils . primitiveToWrapper ( cls ) ; } // create a copy of the incoming map , or an empty one if it ' s null final HashMap < TypeVariable < ? > , Type > typeVarAssigns = subtypeVarAssigns == null ? new HashMap < TypeVariable < ? > , Type > ( ) : new HashMap < > ( subtypeVarAssigns ) ; // has target class been reached ? if ( toClass . equals ( cls ) ) { return typeVarAssigns ; } // walk the inheritance hierarchy until the target class is reached return getTypeArguments ( getClosestParentType ( cls , toClass ) , toClass , typeVarAssigns ) ;
public class IIDImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . IID__CON_DATA1 : return getConData1 ( ) ; case AfplibPackage . IID__XBASE : return getXBase ( ) ; case AfplibPackage . IID__YBASE : return getYBase ( ) ; case AfplibPackage . IID__XUNITS : return getXUnits ( ) ; case AfplibPackage . IID__YUNITS : return getYUnits ( ) ; case AfplibPackage . IID__XSIZE : return getXSize ( ) ; case AfplibPackage . IID__YSIZE : return getYSize ( ) ; case AfplibPackage . IID__CON_DATA2 : return getConData2 ( ) ; case AfplibPackage . IID__XC_SIZE_D : return getXCSizeD ( ) ; case AfplibPackage . IID__YC_SIZE_D : return getYCSizeD ( ) ; case AfplibPackage . IID__CON_DATA3 : return getConData3 ( ) ; case AfplibPackage . IID__COLOR : return getColor ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class CommerceSubscriptionEntryPersistenceImpl { /** * Caches the commerce subscription entries in the entity cache if it is enabled . * @ param commerceSubscriptionEntries the commerce subscription entries */ @ Override public void cacheResult ( List < CommerceSubscriptionEntry > commerceSubscriptionEntries ) { } }
for ( CommerceSubscriptionEntry commerceSubscriptionEntry : commerceSubscriptionEntries ) { if ( entityCache . getResult ( CommerceSubscriptionEntryModelImpl . ENTITY_CACHE_ENABLED , CommerceSubscriptionEntryImpl . class , commerceSubscriptionEntry . getPrimaryKey ( ) ) == null ) { cacheResult ( commerceSubscriptionEntry ) ; } else { commerceSubscriptionEntry . resetOriginalValues ( ) ; } }
public class Table { /** * Returns a copy of this table sorted using the given comparator */ private Table sortOn ( IntComparator rowComparator ) { } }
Table newTable = emptyCopy ( rowCount ( ) ) ; int [ ] newRows = rows ( ) ; IntArrays . parallelQuickSort ( newRows , rowComparator ) ; Rows . copyRowsToTable ( newRows , this , newTable ) ; return newTable ;
public class Portfolio { /** * This method returns the value random variable of the product within the specified model , evaluated at a given evalutationTime . * Note : For a lattice this is often the value conditional to evalutationTime , for a Monte - Carlo simulation this is the ( sum of ) value discounted to evaluation time . * Cashflows prior evaluationTime are not considered . * @ TODO The conversion between different currencies is currently not performed . * @ param evaluationTime The time on which this products value should be observed . * @ param model The model used to price the product . * @ return The random variable representing the value of the product discounted to evaluation time * @ throws net . finmath . exception . CalculationException Thrown if the valuation fails , specific cause may be available via the < code > cause ( ) < / code > method . */ @ Override public RandomVariableInterface getValue ( double evaluationTime , LIBORModelMonteCarloSimulationInterface model ) throws CalculationException { } }
RandomVariableInterface values = new RandomVariable ( 0.0 ) ; for ( int productIndex = 0 ; productIndex < products . length ; productIndex ++ ) { RandomVariableInterface valueOfProduct = products [ productIndex ] . getValue ( evaluationTime , model ) ; double weightOfProduct = weights [ productIndex ] ; values = values . addProduct ( valueOfProduct , weightOfProduct ) ; } return values ;
public class lbmetrictable_metric_binding { /** * Use this API to fetch lbmetrictable _ metric _ binding resources of given name . */ public static lbmetrictable_metric_binding [ ] get ( nitro_service service , String metrictable ) throws Exception { } }
lbmetrictable_metric_binding obj = new lbmetrictable_metric_binding ( ) ; obj . set_metrictable ( metrictable ) ; lbmetrictable_metric_binding response [ ] = ( lbmetrictable_metric_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class JmxMonitorRegistry { /** * Unregister a Monitor from the registry . */ @ Override public void unregister ( Monitor < ? > monitor ) { } }
try { List < MonitorMBean > beans = MonitorMBean . createMBeans ( name , monitor , mapper ) ; for ( MonitorMBean bean : beans ) { try { mBeanServer . unregisterMBean ( bean . getObjectName ( ) ) ; locks . remove ( bean . getObjectName ( ) ) ; } catch ( InstanceNotFoundException ignored ) { // ignore errors attempting to unregister a non - registered monitor // a common error is to unregister twice } } monitors . remove ( monitor . getConfig ( ) ) ; updatePending . set ( true ) ; } catch ( Exception e ) { LOG . warn ( "Unable to un-register Monitor:" + monitor . getConfig ( ) , e ) ; }
public class AbstractMutableStore { /** * ( non - Javadoc ) * @ see com . arakelian . dao . Dao # delete ( com . arakelian . dao . feature . HasId ) */ @ Override public void delete ( final T value ) { } }
if ( value != null ) { final String id = value . getId ( ) ; if ( ! StringUtils . isEmpty ( id ) ) { doDelete ( id ) ; notifyDeleted ( value ) ; } }
public class PDF417 { /** * Calculates the number of pad codewords as described in 4.9.2 of ISO / IEC 15438:2001 ( E ) . * @ param m the number of source codewords prior to the additional of the Symbol Length * Descriptor and any pad codewords * @ param k the number of error correction codewords * @ param c the number of columns in the symbol in the data region ( excluding start , stop and * row indicator codewords ) * @ param r the number of rows in the symbol * @ return the number of pad codewords */ private static int getNumberOfPadCodewords ( int m , int k , int c , int r ) { } }
int n = c * r - k ; return n > m + 1 ? n - m - 1 : 0 ;
public class XMeans { /** * Estimate the log - likelihood of the data for the given model . * @ param k the number of clusters . * @ param n the total number of samples . * @ param ni the number of samples belong to this cluster . * @ param d the dimensionality of data . * @ param variance the estimated variance of clusters . * @ return the likelihood estimate */ private static double logLikelihood ( int k , int n , int ni , int d , double variance ) { } }
double p1 = - ni * LOG2PI ; double p2 = - ni * d * Math . log ( variance ) ; double p3 = - ( ni - k ) ; double p4 = ni * Math . log ( ni ) ; double p5 = - ni * Math . log ( n ) ; double loglike = ( p1 + p2 + p3 ) / 2 + p4 + p5 ; return loglike ;
public class DefaultTokenServices { /** * The refresh token validity period in seconds * @ param clientAuth the current authorization request * @ return the refresh token validity period in seconds */ protected int getRefreshTokenValiditySeconds ( OAuth2Request clientAuth ) { } }
if ( clientDetailsService != null ) { ClientDetails client = clientDetailsService . loadClientByClientId ( clientAuth . getClientId ( ) ) ; Integer validity = client . getRefreshTokenValiditySeconds ( ) ; if ( validity != null ) { return validity ; } } return refreshTokenValiditySeconds ;
public class WLabel { /** * Sets the label " hint " text , which can be used to provide additional information to the user . * @ param hint the hint text , using { @ link MessageFormat } syntax . * @ param args optional arguments for the message format string . */ public void setHint ( final String hint , final Serializable ... args ) { } }
Serializable currHint = getComponentModel ( ) . hint ; Serializable hintToBeSet = I18nUtilities . asMessage ( hint , args ) ; if ( ! Objects . equals ( hintToBeSet , currHint ) ) { getOrCreateComponentModel ( ) . hint = hintToBeSet ; }
public class PatternUtils { /** * 判断字符串参数是否是数字字符串 , 只要全是数字即可 * @ param arg 字符串 * @ return 如果参数是数字则返回 < code > true < / code > */ public static boolean isNumberStr ( String arg ) { } }
if ( StringUtils . isEmpty ( arg ) ) { return false ; } return check ( arg , NUMBER_STR_PARTER ) ;
public class CmsTwoListsDialog { /** * Display method for two list dialogs , executes actions , but only displays if needed . < p > * @ param writeLater if < code > true < / code > no output is written , * you have to call manually the < code > { @ link # defaultActionHtml ( ) } < / code > method . * @ throws JspException if dialog actions fail * @ throws IOException if writing to the JSP out fails , or in case of errors forwarding to the required result page * @ throws ServletException in case of errors forwarding to the required result page */ public void displayDialog ( boolean writeLater ) throws JspException , IOException , ServletException { } }
// perform the active list actions m_activeWp . actionDialog ( ) ; if ( m_activeWp . isForwarded ( ) ) { return ; } m_activeWp . refreshList ( ) ; m_passiveWp . refreshList ( ) ; if ( writeLater ) { return ; } JspWriter out = m_activeWp . getJsp ( ) . getJspContext ( ) . getOut ( ) ; out . print ( defaultActionHtml ( ) ) ;
public class Colorization { /** * Returns the distance between the supplied to numbers modulo N . */ public static int distance ( int a , int b , int N ) { } }
return ( a > b ) ? Math . min ( a - b , b + N - a ) : Math . min ( b - a , a + N - b ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ActionsType } { @ code > } } */ @ XmlElementDecl ( namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os" , name = "Actions" ) public JAXBElement < ActionsType > createActions ( ActionsType value ) { } }
return new JAXBElement < ActionsType > ( _Actions_QNAME , ActionsType . class , null , value ) ;
public class Controller { /** * Feedback connect out to in * @ param from * @ param from _ out * @ param to * @ param to _ in */ void feedback ( Object from , String from_out , Object to , String to_in ) { } }
// add them to the set of commands if ( from == to ) { throw new ComponentException ( "src == dest." ) ; } if ( to_in == null || from_out == null ) { throw new ComponentException ( "Some field arguments are null" ) ; } ComponentAccess ca_from = lookup ( from ) ; ComponentAccess ca_to = lookup ( to ) ; Access from_access = ca_from . output ( from_out ) ; checkFA ( from_access , from , from_out ) ; Access to_access = ca_to . input ( to_in ) ; checkFA ( to_access , to , to_in ) ; if ( ! canConnect ( from_access , to_access ) ) { throw new ComponentException ( "Type/Access mismatch, Cannot connect: " + from + '.' + to_in + " -> " + to + '.' + from_out ) ; } // src data object FieldContent data = from_access . getData ( ) ; data . tagIn ( ) ; data . tagOut ( ) ; // dataSet . add ( data ) ; to_access . setData ( data ) ; // connect the two ca_from . setOutput ( from_out , new AsyncFieldAccess ( from_access ) ) ; ca_to . setInput ( to_in , new AsyncFieldAccess ( to_access ) ) ; if ( checkCircular ) { // val . addConnection ( from , to ) ; // val . checkCircular ( ) ; } if ( log . isLoggable ( Level . CONFIG ) ) { log . config ( String . format ( "feedback @Out(%s) -> @In(%s)" , from_access . toString ( ) , to_access . toString ( ) ) ) ; } // ens . fireConnect ( from _ access , to _ access ) ;