signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class CoreDefinitionVersion { /** * A list of cores in the core definition version .
* @ param cores
* A list of cores in the core definition version . */
public void setCores ( java . util . Collection < Core > cores ) { } }
|
if ( cores == null ) { this . cores = null ; return ; } this . cores = new java . util . ArrayList < Core > ( cores ) ;
|
public class Selection { /** * Sort the int array in ascending order using this algorithm .
* @ param intArray the array of ints that we want to sort */
public static void sort ( int [ ] intArray ) { } }
|
int minIndex = 0 ; for ( int i = 0 ; i < intArray . length ; i ++ ) { minIndex = i ; for ( int j = minIndex ; j < intArray . length ; j ++ ) { if ( intArray [ j ] < intArray [ minIndex ] ) { minIndex = j ; } } XORSwap . swap ( intArray , i , minIndex ) ; }
|
public class JSONObjectException { /** * Method that can be called to either create a new JsonMappingException
* ( if underlying exception is not a JsonMappingException ) , or augment
* given exception with given path / reference information . */
public static JSONObjectException wrapWithPath ( Throwable src , Reference ref ) { } }
|
JSONObjectException jme ; if ( src instanceof JSONObjectException ) { jme = ( JSONObjectException ) src ; } else { String msg = src . getMessage ( ) ; if ( msg == null || msg . length ( ) == 0 ) { msg = "(was " + src . getClass ( ) . getName ( ) + ")" ; } jme = new JSONObjectException ( msg , null , src ) ; } jme . prependPath ( ref ) ; return jme ;
|
public class LucenePDFConfiguration { /** * Sets Field attributes that will be used when creating the Field object for the main text content of
* a PDF document . These attributes correspond to the < code > store < / code > ,
* < code > index < / code > , and < code > token < / code > parameters of the { @ link org . apache . lucene . document . Field }
* constructor before Lucene v4 . x and the same - named attributes of { @ link org . apache . lucene . document . FieldType }
* afterwards . */
public void setBodyTextSettings ( boolean store , boolean index , boolean token ) { } }
|
indexBodyText = index ; storeBodyText = store ; tokenizeBodyText = token ;
|
public class RequestCreator { /** * A placeholder drawable to be used while the image is being loaded . If the requested image is
* not immediately available in the memory cache then this resource will be set on the target
* { @ link ImageView } . */
@ NonNull public RequestCreator placeholder ( @ DrawableRes int placeholderResId ) { } }
|
if ( ! setPlaceholder ) { throw new IllegalStateException ( "Already explicitly declared as no placeholder." ) ; } if ( placeholderResId == 0 ) { throw new IllegalArgumentException ( "Placeholder image resource invalid." ) ; } if ( placeholderDrawable != null ) { throw new IllegalStateException ( "Placeholder image already set." ) ; } this . placeholderResId = placeholderResId ; return this ;
|
public class BeanUtils { /** * Helper method for getting a read method for a property .
* @ param clazz the type to get the method for .
* @ param propertyName the name of the property .
* @ return the method for reading the property . */
public static Method getReadMethod ( Class < ? > clazz , String propertyName ) { } }
|
Method readMethod = null ; try { PropertyDescriptor [ ] thisProps = Introspector . getBeanInfo ( clazz ) . getPropertyDescriptors ( ) ; for ( PropertyDescriptor pd : thisProps ) { if ( pd . getName ( ) . equals ( propertyName ) && pd . getReadMethod ( ) != null ) { readMethod = pd . getReadMethod ( ) ; break ; } } } catch ( IntrospectionException ex ) { Logger . getLogger ( BeanUtils . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } return readMethod ;
|
public class NativeInterface { /** * an object WRITES a primitive field of another object */
public static void modify ( int calleeValKind , Object callee , String calleeClass , String fieldName , int callerValKind , Object caller , String callerClass ) { } }
|
System . err . println ( "modify( " + valAndValKindToString ( callee , calleeClass , calleeValKind ) + " . " + fieldName + ", " + // " calleeClass = " + calleeClass + " , " +
"caller=" + valAndValKindToString ( caller , callerClass , callerValKind ) + ", " + // " callerClass = " + callerClass + " , " +
")" ) ;
|
public class UploadPartRequest { /** * Sets the optional progress listener for receiving updates about object
* upload status .
* @ param progressListener
* The legacy progress listener that is used exclusively for Amazon S3 client .
* @ deprecated use { @ link # setGeneralProgressListener ( ProgressListener ) } instead . */
@ Deprecated public void setProgressListener ( com . amazonaws . services . s3 . model . ProgressListener progressListener ) { } }
|
setGeneralProgressListener ( new LegacyS3ProgressListener ( progressListener ) ) ;
|
public class TemplateReactionWrapper { /** * Binds to template and controllers . */
@ Override public void initUpstream ( ) { } }
|
NucleicAcid nuc = tempReac . getTemplate ( ) ; if ( nuc != null ) addToUpstream ( nuc , getGraph ( ) ) ; for ( Control cont : tempReac . getControlledOf ( ) ) { addToUpstream ( cont , graph ) ; }
|
public class CmsLanguageCopySelectionList { /** * Fills a single item .
* @ param resource the corresponding resource .
* @ param item the item to fill .
* @ param id used for the ID column . */
private void fillItem ( final CmsResource resource , final CmsListItem item , final int id ) { } }
|
CmsObject cms = getCms ( ) ; CmsXmlContent xmlContent ; I_CmsResourceType type ; String iconPath ; // fill path column :
String sitePath = cms . getSitePath ( resource ) ; item . set ( LIST_COLUMN_PATH , sitePath ) ; // fill language node existence column :
item . set ( LIST_COLUMN_PATH , sitePath ) ; boolean languageNodeExists = false ; String languageNodeHtml ; List < Locale > sysLocales = OpenCms . getLocaleManager ( ) . getAvailableLocales ( ) ; try { xmlContent = CmsXmlContentFactory . unmarshal ( cms , cms . readFile ( resource ) ) ; for ( Locale locale : sysLocales ) { languageNodeExists = xmlContent . hasLocale ( locale ) ; if ( languageNodeExists ) { languageNodeHtml = "<input type=\"checkbox\" checked=\"checked\" disabled=\"disabled\"/>" ; } else { languageNodeHtml = "<input type=\"checkbox\" disabled=\"disabled\"/>" ; } item . set ( locale . toString ( ) , languageNodeHtml ) ; } } catch ( Throwable e1 ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_ERR_LANGUAGECOPY_DETERMINE_LANGUAGE_NODE_1 ) , e1 ) ; languageNodeHtml = "n/a" ; for ( Locale locale : sysLocales ) { item . set ( locale . toString ( ) , languageNodeHtml ) ; } } // type column :
type = OpenCms . getResourceManager ( ) . getResourceType ( resource ) ; item . set ( LIST_COLUMN_RESOURCETYPE , type . getTypeName ( ) ) ; // icon column with title property for tooltip :
String title = "" ; try { CmsProperty titleProperty = cms . readPropertyObject ( resource , CmsPropertyDefinition . PROPERTY_TITLE , true ) ; title = titleProperty . getValue ( ) ; } catch ( CmsException e ) { LOG . warn ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_WARN_LANGUAGECOPY_READPROP_1 ) , e ) ; } iconPath = getSkinUri ( ) + CmsWorkplace . RES_PATH_FILETYPES + OpenCms . getWorkplaceManager ( ) . getExplorerTypeSetting ( type . getTypeName ( ) ) . getIcon ( ) ; String iconImage ; iconImage = "<img src=\"" + iconPath + "\" alt=\"" + type . getTypeName ( ) + "\" title=\"" + title + "\" />" ; item . set ( LIST_COLUMN_ICON , iconImage ) ;
|
public class Gauge { /** * The factor defines the length of the major tick mark .
* It can be in the range from 0 - 1.
* @ param FACTOR */
public void setMajorTickMarkLengthFactor ( final double FACTOR ) { } }
|
if ( null == majorTickMarkLengthFactor ) { _majorTickMarkLengthFactor = Helper . clamp ( 0.0 , 1.0 , FACTOR ) ; fireUpdateEvent ( REDRAW_EVENT ) ; } else { majorTickMarkLengthFactor . set ( FACTOR ) ; }
|
public class StrBuilder { /** * Replaces the search string with the replace string throughout the builder .
* @ param searchStr the search string , null causes no action to occur
* @ param replaceStr the replace string , null is equivalent to an empty string
* @ return this , to enable chaining */
public StrBuilder replaceAll ( final String searchStr , final String replaceStr ) { } }
|
final int searchLen = ( searchStr == null ? 0 : searchStr . length ( ) ) ; if ( searchLen > 0 ) { final int replaceLen = ( replaceStr == null ? 0 : replaceStr . length ( ) ) ; int index = indexOf ( searchStr , 0 ) ; while ( index >= 0 ) { replaceImpl ( index , index + searchLen , searchLen , replaceStr , replaceLen ) ; index = indexOf ( searchStr , index + replaceLen ) ; } } return this ;
|
public class RedisPubSubHub { /** * { @ inheritDoc } */
@ Override public void unsubscribe ( String channel , ISubscriber < ID , DATA > subscriber ) { } }
|
try { Set < ISubscriber < ID , DATA > > subs = subscriptions . get ( channel ) ; synchronized ( subs ) { subs . remove ( subscriber ) ; } } catch ( ExecutionException e ) { throw new RuntimeException ( e ) ; }
|
public class WritableColumnVector { /** * Resets this column for writing . The currently stored values are no longer accessible . */
public void reset ( ) { } }
|
if ( isConstant ) return ; if ( childColumns != null ) { for ( ColumnVector c : childColumns ) { ( ( WritableColumnVector ) c ) . reset ( ) ; } } elementsAppended = 0 ; if ( numNulls > 0 ) { putNotNulls ( 0 , capacity ) ; numNulls = 0 ; }
|
public class CmsGalleryService { /** * Helper method to construct a sitemap entry bean for the sitemap tab filter functionality . < p >
* @ param cms the CMS context
* @ param node the root node of the filtered tree
* @ param isRoot true if this is the root node
* @ return the sitemap entry bean */
private CmsSitemapEntryBean convertNavigationTreeToBean ( CmsObject cms , NavigationNode node , boolean isRoot ) { } }
|
CmsSitemapEntryBean bean = null ; try { bean = prepareSitemapEntry ( cms , node . getNavElement ( ) , isRoot , false ) ; bean . setSearchMatch ( node . isMatch ( ) ) ; List < NavigationNode > children = node . getChildren ( ) ; List < CmsSitemapEntryBean > childBeans = Lists . newArrayList ( ) ; if ( children . size ( ) > 0 ) { for ( NavigationNode child : children ) { childBeans . add ( convertNavigationTreeToBean ( cms , child , false ) ) ; } } else if ( node . isLeaf ( ) ) { childBeans = Lists . newArrayList ( ) ; } else { // no children in filter result , but can still load children by clicking on tree item
childBeans = null ; } bean . setChildren ( childBeans ) ; } catch ( CmsException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } return bean ;
|
public class GeometryUtilities { /** * Calculates the 3d distance between two coordinates that have an elevation information .
* < p > Note that the { @ link Coordinate # distance ( Coordinate ) } method does only 2d .
* @ param c1 coordinate 1.
* @ param c2 coordinate 2.
* @ param geodeticCalculator If supplied it will be used for planar distance calculation .
* @ return the distance considering also elevation . */
public static double distance3d ( Coordinate c1 , Coordinate c2 , GeodeticCalculator geodeticCalculator ) { } }
|
if ( Double . isNaN ( c1 . z ) || Double . isNaN ( c2 . z ) ) { throw new IllegalArgumentException ( "Missing elevation information in the supplied coordinates." ) ; } double deltaElev = Math . abs ( c1 . z - c2 . z ) ; double projectedDistance ; if ( geodeticCalculator != null ) { geodeticCalculator . setStartingGeographicPoint ( c1 . x , c1 . y ) ; geodeticCalculator . setDestinationGeographicPoint ( c2 . x , c2 . y ) ; projectedDistance = geodeticCalculator . getOrthodromicDistance ( ) ; } else { projectedDistance = c1 . distance ( c2 ) ; } double distance = NumericsUtilities . pythagoras ( projectedDistance , deltaElev ) ; return distance ;
|
public class AgentSession { /** * Invites a user or agent to an existing session support . The provided invitee ' s JID can be of
* a user , an agent , a queue or a workgroup . In the case of a queue or a workgroup the workgroup service
* will decide the best agent to receive the invitation . < p >
* This method will return either when the service returned an ACK of the request or if an error occurred
* while requesting the invitation . After sending the ACK the service will send the invitation to the target
* entity . When dealing with agents the common sequence of offer - response will be followed . However , when
* sending an invitation to a user a standard MUC invitation will be sent . < p >
* The agent or user that accepted the offer < b > MUST < / b > join the room . Failing to do so will make
* the invitation to fail . The inviter will eventually receive a message error indicating that the invitee
* accepted the offer but failed to join the room .
* Different situations may lead to a failed invitation . Possible cases are : 1 ) all agents rejected the
* offer and there are no agents available , 2 ) the agent that accepted the offer failed to join the room or
* 2 ) the user that received the MUC invitation never replied or joined the room . In any of these cases
* ( or other failing cases ) the inviter will get an error message with the failed notification .
* @ param type type of entity that will get the invitation .
* @ param invitee JID of entity that will get the invitation .
* @ param sessionID ID of the support session that the invitee is being invited .
* @ param reason the reason of the invitation .
* @ throws XMPPErrorException if the sender of the invitation is not an agent or the service failed to process
* the request .
* @ throws NoResponseException
* @ throws NotConnectedException
* @ throws InterruptedException */
public void sendRoomInvitation ( RoomInvitation . Type type , Jid invitee , String sessionID , String reason ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } }
|
final RoomInvitation invitation = new RoomInvitation ( type , invitee , sessionID , reason ) ; IQ iq = new RoomInvitation . RoomInvitationIQ ( invitation ) ; iq . setType ( IQ . Type . set ) ; iq . setTo ( workgroupJID ) ; iq . setFrom ( connection . getUser ( ) ) ; connection . createStanzaCollectorAndSend ( iq ) . nextResultOrThrow ( ) ;
|
public class PackagesScreen { /** * Add button ( s ) to the toolbar . */
public void addToolbarButtons ( ToolScreen toolScreen ) { } }
|
new SCannedBox ( toolScreen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , toolScreen , null , ScreenConstants . DEFAULT_DISPLAY , null , Packages . SCAN , MenuConstants . SELECT , Packages . SCAN , null ) ;
|
public class FnJodaTimeUtils { /** * The function receives a { @ link Collection } of two { @ link Timestamp } elements used as the start and end of the
* { @ link Period } it creates . The { @ link Period } will be created using the
* specified { @ link Chronology }
* @ param chronology { @ link Chronology } to be used
* @ return the { @ link Period } created from the input and arguments */
public static final Function < Collection < Timestamp > , Period > timestampFieldCollectionToPeriod ( final Chronology chronology ) { } }
|
return FnPeriod . timestampFieldCollectionToPeriod ( chronology ) ;
|
public class AmazonPinpointEmailClient { /** * Enable or disable the Deliverability dashboard . When you enable the Deliverability dashboard , you gain access to
* reputation metrics for the domains that you use to send email using Amazon Pinpoint . You also gain the ability to
* perform predictive inbox placement tests .
* When you use the Deliverability dashboard , you pay a monthly charge of USD $ 1,250.00 , in addition to any other
* fees that you accrue by using Amazon Pinpoint . If you enable the Deliverability dashboard after the first day of
* a calendar month , we prorate the monthly charge based on how many days have elapsed in the current calendar
* month .
* @ param putDeliverabilityDashboardOptionRequest
* A request to enable or disable the Deliverability dashboard . When you enable the Deliverability dashboard ,
* you gain access to reputation metrics for the domains that you use to send email using Amazon Pinpoint .
* You also gain the ability to perform predictive inbox placement tests . < / p >
* When you use the Deliverability dashboard , you pay a monthly charge of USD $ 1,250.00 , in addition to any
* other fees that you accrue by using Amazon Pinpoint . If you enable the Deliverability dashboard after the
* first day of a calendar month , we prorate the monthly charge based on how many days have elapsed in the
* current calendar month .
* @ return Result of the PutDeliverabilityDashboardOption operation returned by the service .
* @ throws AlreadyExistsException
* The resource specified in your request already exists .
* @ throws NotFoundException
* The resource you attempted to access doesn ' t exist .
* @ throws TooManyRequestsException
* Too many requests have been made to the operation .
* @ throws LimitExceededException
* There are too many instances of the specified resource type .
* @ throws BadRequestException
* The input you provided is invalid .
* @ sample AmazonPinpointEmail . PutDeliverabilityDashboardOption
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / pinpoint - email - 2018-07-26 / PutDeliverabilityDashboardOption "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public PutDeliverabilityDashboardOptionResult putDeliverabilityDashboardOption ( PutDeliverabilityDashboardOptionRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executePutDeliverabilityDashboardOption ( request ) ;
|
public class ConfigureForm { /** * Set the JID ' s in the whitelist of users that can associate child nodes with the collection
* node . This is only relevant if { @ link # getChildrenAssociationPolicy ( ) } is set to
* { @ link ChildrenAssociationPolicy # whitelist } .
* @ param whitelist The list of JID ' s */
public void setChildrenAssociationWhitelist ( List < String > whitelist ) { } }
|
addField ( ConfigureNodeFields . children_association_whitelist , FormField . Type . jid_multi ) ; setAnswer ( ConfigureNodeFields . children_association_whitelist . getFieldName ( ) , whitelist ) ;
|
public class ListRoleAliasesResult { /** * The role aliases .
* @ param roleAliases
* The role aliases . */
public void setRoleAliases ( java . util . Collection < String > roleAliases ) { } }
|
if ( roleAliases == null ) { this . roleAliases = null ; return ; } this . roleAliases = new java . util . ArrayList < String > ( roleAliases ) ;
|
public class ObjectiveFactory { /** * This method retrieves all the values accessible through a getter (
* < code > getX ( ) < / code > method ) in order to build the corresponding set of
* { @ link Objective } s . At the opposite of { @ link # createFromGetters ( Class ) } ,
* an additional filter is used : we build an { @ link Objective } for each
* getter which does not correspond to a setter ( < code > setX ( ) < / code > method
* with the same < code > X < / code > than the getter ) . This method is adapted for
* { @ link Solution } implementations which provide setters only for their
* fundamental values ( e . g . the path of a TSP { @ link Solution } ) and use
* getters only for the computed values ( e . g . the length of such a path ) . < br / >
* < br / >
* Notice that , if all the relevant getters are not present , the
* corresponding { @ link Objective } s will not be retrieved . On the opposite ,
* any additional getter which does not correspond to a relevant
* { @ link Objective } will be mistakenly retrieved . So be sure that the
* relevant elements ( and only these ones ) have their getter ( and no
* setter ) . Otherwise , you should use a different method or generate the
* { @ link Objective } s manually .
* @ param solutionClass
* the { @ link Solution } class to analyze
* @ return the set of { @ link Objective } s retrieved from this class */
public < Solution > Collection < Objective < Solution , ? > > createFromGettersWithoutSetters ( Class < Solution > solutionClass ) { } }
|
Map < String , Method > getters = new HashMap < > ( ) ; Map < String , Method > setters = new HashMap < > ( ) ; for ( Method method : solutionClass . getMethods ( ) ) { if ( isGetter ( method ) ) { String name = method . getName ( ) . substring ( 3 ) ; getters . put ( name , method ) ; } else if ( isSetter ( method ) ) { String name = method . getName ( ) . substring ( 3 ) ; setters . put ( name , method ) ; } else { // not a getter / setter , ignore it
} } getters . keySet ( ) . removeAll ( setters . keySet ( ) ) ; Collection < Objective < Solution , ? > > objectives = new LinkedList < > ( ) ; for ( Entry < String , Method > entry : getters . entrySet ( ) ) { String name = entry . getKey ( ) ; Method getter = entry . getValue ( ) ; objectives . add ( createObjectiveOn ( solutionClass , getter , name , getter . getReturnType ( ) ) ) ; } return objectives ;
|
public class ProofObligation { /** * Generate an AApplyExp with varargs arguments */
protected AApplyExp getApplyExp ( PExp root , PExp ... arglist ) { } }
|
return getApplyExp ( root , Arrays . asList ( arglist ) ) ;
|
public class PlatformDependent { /** * Raises an exception bypassing compiler checks for checked exceptions . */
public static void throwException ( Throwable t ) { } }
|
if ( hasUnsafe ( ) ) { PlatformDependent0 . throwException ( t ) ; } else { PlatformDependent . < RuntimeException > throwException0 ( t ) ; }
|
public class LPAChangeParameter { /** * Change the parameter for a channel in both the ILF and PLF using the appropriate mechanisms
* for incorporated nodes versus owned nodes . */
@ Override public void perform ( ) throws PortalException { } }
|
// push the change into the PLF
if ( nodeId . startsWith ( Constants . FRAGMENT_ID_USER_PREFIX ) ) { // we are dealing with an incorporated node , adding will replace
// an existing one for the same target node id and name
ParameterEditManager . addParmEditDirective ( nodeId , name , value , person ) ; } else { // node owned by user so change existing parameter child directly
Document plf = RDBMDistributedLayoutStore . getPLF ( person ) ; Element plfNode = plf . getElementById ( nodeId ) ; changeParameterChild ( plfNode , name , value ) ; } // push the change into the ILF
changeParameterChild ( ilfNode , name , value ) ;
|
public class Request { /** * 获得GET请求参数 < br >
* 会根据浏览器类型自动识别GET请求的编码方式从而解码 < br >
* 考虑到Servlet容器中会首先解码 , 给定的charsetOfServlet就是Servlet设置的解码charset < br >
* charsetOfServlet为null则默认的ISO _ 8859_1
* @ param name 参数名
* @ param charsetOfServlet Servlet容器中的字符集
* @ return 获得请求参数 */
public static String getParam ( String name , String charsetOfServlet ) { } }
|
return convertGetMethodParamValue ( getParam ( name ) , charsetOfServlet ) ;
|
public class Exceptions { /** * TODO : was package - level initially */
public static RuntimeException launderCacheWriterException ( Exception e ) { } }
|
if ( ! ( e instanceof CacheWriterException ) ) return new CacheWriterException ( "Exception in CacheWriter" , e ) ; return new CacheException ( "Error in CacheWriter" , e ) ;
|
public class StatisticsJDBCStorageConnection { /** * { @ inheritDoc } */
public void update ( NodeData data ) throws RepositoryException , UnsupportedOperationException , InvalidItemStateException , IllegalStateException { } }
|
Statistics s = ALL_STATISTICS . get ( UPDATE_NODE_DATA_DESCR ) ; try { s . begin ( ) ; wcs . update ( data ) ; } finally { s . end ( ) ; }
|
public class MobileUrlNodeSyntaxHelper { /** * / * ( non - Javadoc )
* @ see org . apereo . portal . url . IUrlNodeSyntaxHelper # getPortletForFolderName ( javax . servlet . http . HttpServletRequest , java . lang . String , java . lang . String ) */
@ Override public IPortletWindowId getPortletForFolderName ( HttpServletRequest request , String targetedLayoutNodeId , String folderName ) { } }
|
final IUserInstance userInstance = this . userInstanceManager . getUserInstance ( request ) ; final String fname ; final IPortletEntity portletEntity ; final int seperatorIndex = folderName . indexOf ( PORTLET_PATH_ELEMENT_SEPERATOR ) ; if ( seperatorIndex <= 0 || seperatorIndex + 1 == folderName . length ( ) ) { fname = folderName ; portletEntity = this . portletEntityRegistry . getOrCreatePortletEntityByFname ( request , userInstance , fname ) ; } else { fname = folderName . substring ( 0 , seperatorIndex ) ; final String subscribeId = folderName . substring ( seperatorIndex + 1 ) ; portletEntity = this . portletEntityRegistry . getOrCreatePortletEntityByFname ( request , userInstance , fname , subscribeId ) ; } if ( portletEntity != null ) { final IPortletEntityId portletEntityId = portletEntity . getPortletEntityId ( ) ; final IPortletWindow portletWindow = this . portletWindowRegistry . getOrCreateDefaultPortletWindow ( request , portletEntityId ) ; return portletWindow . getPortletWindowId ( ) ; } else { this . logger . warn ( targetedLayoutNodeId + " node for portlet of folder " + folderName + " can't be targeted by the request." ) ; return null ; }
|
public class StreamEx { /** * Creates a new { @ code EntryStream } whose keys are elements of current
* stream and corresponding values are supplied by given function . Each
* mapped stream is { @ link java . util . stream . BaseStream # close ( ) closed } after
* its contents have been placed into this stream . ( If a mapped stream is
* { @ code null } an empty stream is used , instead . )
* This is an < a href = " package - summary . html # StreamOps " > intermediate < / a >
* operation .
* @ param < V > the type of values .
* @ param mapper a non - interfering , stateless function to apply to each
* element which produces a stream of the values corresponding to the
* single element of the current stream .
* @ return the new { @ code EntryStream }
* @ since 0.2.3 */
public < V > EntryStream < T , V > cross ( Function < ? super T , ? extends Stream < ? extends V > > mapper ) { } }
|
return new EntryStream < > ( stream ( ) . flatMap ( a -> EntryStream . withKey ( a , mapper . apply ( a ) ) ) , context ) ;
|
public class AbstractBean { /** * Notifies all VetoableChangeListeners of a property change event occurring on this Bean . The change to
* the property may potentially be vetoed by one of the VetoableChangeListeners listening to property changes
* on this Bean , resulting in preventing the value of the property to change .
* @ param event the PropertyChangeEvent indicating the property who ' s value is changing .
* @ throws NullPointerException if the PropertyChangeEvent is null .
* @ throws PropertyVetoException if the property change is vetoed by a VetoableChangeListener listening to
* property changes on this Bean .
* @ see java . beans . PropertyChangeEvent
* @ see java . beans . VetoableChangeListener
* @ see java . beans . VetoableChangeSupport # fireVetoableChange ( java . beans . PropertyChangeEvent )
* @ see java . beans . VetoableChangeSupport # hasListeners ( String ) */
protected void fireVetoableChange ( PropertyChangeEvent event ) throws PropertyVetoException { } }
|
if ( isEventDispatchEnabled ( ) ) { Assert . notNull ( event , "The PropertyChangeEvent cannot be null!" ) ; if ( vetoableChangeSupport . hasListeners ( event . getPropertyName ( ) ) ) { vetoableChangeSupport . fireVetoableChange ( event ) ; } }
|
public class CheckSumUtils { /** * Return the checksum of the path given in parameter , if the resource is
* not found , null will b returned .
* @ param url
* the url path to the resource file
* @ param rsReader
* the resource reader handler
* @ param jawrConfig
* the jawrConfig
* @ return checksum of the path given in parameter
* @ throws IOException
* if an IO exception occurs .
* @ throws ResourceNotFoundException
* if the resource is not found . */
public static String getChecksum ( String url , ResourceReaderHandler rsReader , JawrConfig jawrConfig ) throws IOException , ResourceNotFoundException { } }
|
String checksum = null ; InputStream is = null ; boolean generatedBinaryResource = jawrConfig . getGeneratorRegistry ( ) . isGeneratedBinaryResource ( url ) ; try { if ( ! generatedBinaryResource ) { url = PathNormalizer . asPath ( url ) ; } is = rsReader . getResourceAsStream ( url ) ; if ( is != null ) { checksum = CheckSumUtils . getChecksum ( is , jawrConfig . getBinaryHashAlgorithm ( ) ) ; } else { throw new ResourceNotFoundException ( url ) ; } } catch ( FileNotFoundException e ) { throw new ResourceNotFoundException ( url ) ; } finally { IOUtils . close ( is ) ; } return checksum ;
|
public class HttpInboundChannel { /** * @ see
* com . ibm . wsspi . channelfw . Channel # getConnectionLink ( com . ibm . wsspi . channelfw
* . VirtualConnection ) */
public ConnectionLink getConnectionLink ( VirtualConnection vc ) { } }
|
HttpInboundLink link = ( HttpInboundLink ) vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPICL ) ; if ( null == link ) { link = new HttpInboundLink ( this , vc ) ; } return link ;
|
public class AsmByteCodeUtils { /** * if分支调用String的equals方法 , 失败则跳转到指定位置
* @ param mv MethodVisitor
* @ param load 加载要比较的字符串
* @ param content 常量字符串
* @ param next 比较失败后跳转的位置
* @ param success 比较一致后执行的操作 */
public static void stringEquals ( MethodVisitor mv , Runnable load , String content , Label next , Runnable success ) { } }
|
// 加载String
load . run ( ) ; // 加载实际方法名
mv . visitLdcInsn ( content ) ; // 调用String的equals方法
mv . visitMethodInsn ( INVOKEVIRTUAL , convert ( String . class ) , "equals" , ByteCodeUtils . getMethodDesc ( MethodConst . EQUALAS_METHOD ) , false ) ; // 如果结果为false则跳转到下一个
mv . visitJumpInsn ( IFEQ , next ) ; success . run ( ) ;
|
public class JQMHeader { /** * Sets the left button to be the given button . Any existing button is removed .
* @ param button - the button to set on the left slot */
@ UiChild ( tagname = "leftButton" , limit = 1 ) public void setLeftButton ( JQMButton button ) { } }
|
if ( left != null ) remove ( left ) ; button . setPosOnBand ( PosOnBand . LEFT ) ; left = button ; insert ( left , 0 ) ;
|
public class StringUtil { /** * Strips any of a set of characters from the start and end of a String .
* This is similar to { @ link String # trim ( ) } but allows the characters to be
* stripped to be controlled .
* A { @ code null } input String returns { @ code null } . An empty string ( " " )
* input returns the empty string .
* If the stripChars String is { @ code null } , whitespace is stripped as
* defined by { @ link Character # isWhitespace ( char ) } . Alternatively use
* { @ link # strip ( String ) } .
* < pre >
* N . strip ( null , * ) = null
* N . strip ( " " , * ) = " "
* N . strip ( " abc " , null ) = " abc "
* N . strip ( " abc " , null ) = " abc "
* N . strip ( " abc " , null ) = " abc "
* N . strip ( " abc " , null ) = " abc "
* N . strip ( " abcyx " , " xyz " ) = " abc "
* < / pre >
* @ param str
* the String to remove characters from , may be null
* @ param stripChars
* the characters to remove , null treated as whitespace
* @ return the stripped String , { @ code null } if null String input */
public static String strip ( final String str , final String stripChars ) { } }
|
if ( N . isNullOrEmpty ( str ) ) { return str ; } return stripEnd ( stripStart ( str , stripChars ) , stripChars ) ;
|
public class TypesafeConfig { /** * Initialize JDBC drivers from config .
* @ throws InitializationException if driver could not be initialized */
static void initDrivers ( final Config config ) throws InitializationException { } }
|
for ( String driverName : uniquePrefixSet ( config ) ) { Config driverConfig = config . getObject ( driverName ) . toConfig ( ) ; if ( driverConfig . hasPath ( "class" ) ) { String className = driverConfig . getString ( "class" ) ; try { Class . forName ( className ) ; } catch ( Throwable t ) { throw new InitializationException ( "Unable to load JDBC driver, '" + className + "'" , t ) ; } } else { throw new InitializationException ( "A 'class' must be specified for JDBC driver, '" + driverName + "'" ) ; } }
|
public class NetworkConfigurationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( NetworkConfiguration networkConfiguration , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( networkConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( networkConfiguration . getAwsvpcConfiguration ( ) , AWSVPCCONFIGURATION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class JSONConverter { /** * Encode a String value as JSON . An array is used to wrap the value :
* [ String ]
* @ param out The stream to write JSON to
* @ param value The String value to encode .
* @ throws IOException If an I / O error occurs
* @ see # readString ( InputStream ) */
public void writeString ( OutputStream out , String value ) throws IOException { } }
|
writeStartArray ( out ) ; writeStringInternal ( out , value ) ; writeEndArray ( out ) ;
|
public class CompositeHandler { /** * Returns a new handler based on this one ,
* but with given update | handler | appended .
* @ param handler Update handler
* @ return a new composite handler with given update handler
* @ throws IllegalArgumentException if handler is null */
public CompositeHandler withUpdateHandler ( final UpdateHandler handler ) { } }
|
if ( handler == null ) { throw new IllegalArgumentException ( ) ; } // end of if
return new CompositeHandler ( this . queryDetection , this . queryHandler , handler ) ;
|
public class PropertyChangeUtils { /** * Tries to add the given PropertyChangeListener to the given target
* object .
* If the given target object does not
* { @ link # maintainsPropertyChangeListeners ( Class )
* maintain PropertyChangeListeners } , then nothing is done .
* @ param target The target object
* @ param propertyChangeListener The PropertyChangeListener to add
* @ throws IllegalArgumentException If the attempt to invoke the method
* for adding the given listener failed .
* @ throws NullPointerException If any argument is < code > null < / code > */
public static void tryAddPropertyChangeListenerUnchecked ( Object target , PropertyChangeListener propertyChangeListener ) { } }
|
Objects . requireNonNull ( target , "The target may not be null" ) ; Objects . requireNonNull ( propertyChangeListener , "The propertyChangeListener may not be null" ) ; if ( maintainsPropertyChangeListeners ( target . getClass ( ) ) ) { PropertyChangeUtils . addPropertyChangeListenerUnchecked ( target , propertyChangeListener ) ; }
|
public class CPDefinitionLinkPersistenceImpl { /** * Clears the cache for the cp definition link .
* The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */
@ Override public void clearCache ( CPDefinitionLink cpDefinitionLink ) { } }
|
entityCache . removeResult ( CPDefinitionLinkModelImpl . ENTITY_CACHE_ENABLED , CPDefinitionLinkImpl . class , cpDefinitionLink . getPrimaryKey ( ) ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ; clearUniqueFindersCache ( ( CPDefinitionLinkModelImpl ) cpDefinitionLink , true ) ;
|
public class Href { /** * Add this extra param .
* @ param key Key of the param
* @ param value The value
* @ return New HREF */
public Href with ( final Object key , final Object value ) { } }
|
final SortedMap < String , List < String > > map = new TreeMap < > ( this . params ) ; if ( ! map . containsKey ( key . toString ( ) ) ) { map . put ( key . toString ( ) , new LinkedList < > ( ) ) ; } map . get ( key . toString ( ) ) . add ( value . toString ( ) ) ; return new Href ( this . uri , map , this . fragment ) ;
|
public class DNSSEC { /** * Creates a byte array containing the concatenation of the fields of the
* SIG record and the RRsets to be signed / verified . This does not perform
* a cryptographic digest .
* @ param rrsig The RRSIG record used to sign / verify the rrset .
* @ param rrset The data to be signed / verified .
* @ return The data to be cryptographically signed or verified . */
public static byte [ ] digestRRset ( RRSIGRecord rrsig , RRset rrset ) { } }
|
DNSOutput out = new DNSOutput ( ) ; digestSIG ( out , rrsig ) ; int size = rrset . size ( ) ; Record [ ] records = new Record [ size ] ; Iterator it = rrset . rrs ( ) ; Name name = rrset . getName ( ) ; Name wild = null ; int sigLabels = rrsig . getLabels ( ) + 1 ; // Add the root label back .
if ( name . labels ( ) > sigLabels ) wild = name . wild ( name . labels ( ) - sigLabels ) ; while ( it . hasNext ( ) ) records [ -- size ] = ( Record ) it . next ( ) ; Arrays . sort ( records ) ; DNSOutput header = new DNSOutput ( ) ; if ( wild != null ) wild . toWireCanonical ( header ) ; else name . toWireCanonical ( header ) ; header . writeU16 ( rrset . getType ( ) ) ; header . writeU16 ( rrset . getDClass ( ) ) ; header . writeU32 ( rrsig . getOrigTTL ( ) ) ; for ( int i = 0 ; i < records . length ; i ++ ) { out . writeByteArray ( header . toByteArray ( ) ) ; int lengthPosition = out . current ( ) ; out . writeU16 ( 0 ) ; out . writeByteArray ( records [ i ] . rdataToWireCanonical ( ) ) ; int rrlength = out . current ( ) - lengthPosition - 2 ; out . save ( ) ; out . jump ( lengthPosition ) ; out . writeU16 ( rrlength ) ; out . restore ( ) ; } return out . toByteArray ( ) ;
|
public class LogRecordHandler { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . logging . hpel . WsHandler # processEvent ( java . util . logging . LogRecord ) */
public void processEvent ( LogRecord record ) { } }
|
byte [ ] bytes ; SerializationObject serializationObject = pool . getSerializationObject ( ) ; try { bytes = serializationObject . serialize ( record ) ; } finally { pool . returnSerializationObject ( serializationObject ) ; } synchronized ( this ) { if ( traceWriter != null && record . getLevel ( ) . intValue ( ) < traceThreshold ) { traceWriter . logRecord ( record . getMillis ( ) , bytes ) ; } else if ( logWriter != null ) { logWriter . logRecord ( record . getMillis ( ) , bytes ) ; } }
|
public class PrimaryRole { /** * Applies a heartbeat to the service to ensure timers can be triggered . */
private void heartbeat ( ) { } }
|
long index = context . nextIndex ( ) ; long timestamp = System . currentTimeMillis ( ) ; replicator . replicate ( new HeartbeatOperation ( index , timestamp ) ) . thenRun ( ( ) -> context . setTimestamp ( timestamp ) ) ;
|
public class CouchDbChangeMonitorThread { /** * Converts the object " last _ seq " found in the change feed to a String .
* In CouchDB 1 . x , last _ seq is an integer . In CouchDB 2 . x , last _ seq is a string .
* @ param lastSeqObj Object retrieved from the change feed
* @ return A string representing the object
* @ throws Exception */
private String convertLastSeqObj ( Object lastSeqObj ) throws Exception { } }
|
if ( null == lastSeqObj ) { return null ; } else if ( lastSeqObj instanceof String ) { return ( String ) lastSeqObj ; } else if ( lastSeqObj instanceof Number ) { // Convert to string
return "" + lastSeqObj ; } else { throw new Exception ( "Do not know how to handle parameter 'last_seq' in change feed: " + lastSeqObj . getClass ( ) ) ; }
|
public class NimbusSummary { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */
public boolean isSet ( _Fields field ) { } }
|
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case NIMBUS_MASTER : return is_set_nimbusMaster ( ) ; case NIMBUS_SLAVES : return is_set_nimbusSlaves ( ) ; case SUPERVISOR_NUM : return is_set_supervisorNum ( ) ; case TOTAL_PORT_NUM : return is_set_totalPortNum ( ) ; case USED_PORT_NUM : return is_set_usedPortNum ( ) ; case FREE_PORT_NUM : return is_set_freePortNum ( ) ; case VERSION : return is_set_version ( ) ; } throw new IllegalStateException ( ) ;
|
public class AiMesh { /** * Returns the vertex tangent as 3 - dimensional vector . < p >
* This method is part of the wrapped API ( see { @ link AiWrapperProvider }
* for details on wrappers ) . < p >
* The built - in behavior is to return a { @ link AiVector } .
* @ param vertex the vertex index
* @ param wrapperProvider the wrapper provider ( used for type inference )
* @ return the tangent wrapped as object */
public < V3 , M4 , C , N , Q > V3 getWrappedTangent ( int vertex , AiWrapperProvider < V3 , M4 , C , N , Q > wrapperProvider ) { } }
|
if ( ! hasTangentsAndBitangents ( ) ) { throw new IllegalStateException ( "mesh has no tangents" ) ; } checkVertexIndexBounds ( vertex ) ; return wrapperProvider . wrapVector3f ( m_tangents , vertex * 3 * SIZEOF_FLOAT , 3 ) ;
|
public class Model { /** * Wrapper around the main predict call , including the signature and return value */
private SB toJavaPredict ( SB ccsb , SB fileCtxSb ) { } }
|
// ccsb = classContext
ccsb . nl ( ) ; ccsb . p ( " // Pass in data in a double[], pre-aligned to the Model's requirements." ) . nl ( ) ; ccsb . p ( " // Jam predictions into the preds[] array; preds[0] is reserved for the" ) . nl ( ) ; ccsb . p ( " // main prediction (class for classifiers or value for regression)," ) . nl ( ) ; ccsb . p ( " // and remaining columns hold a probability distribution for classifiers." ) . nl ( ) ; ccsb . p ( " public final float[] predict( double[] data, float[] preds) { preds = predict( data, preds, " + toJavaDefaultMaxIters ( ) + "); return preds; }" ) . nl ( ) ; // ccsb . p ( " public final float [ ] predict ( double [ ] data , float [ ] preds ) { return predict ( data , preds , " + toJavaDefaultMaxIters ( ) + " ) ; } " ) . nl ( ) ;
ccsb . p ( " public final float[] predict( double[] data, float[] preds, int maxIters ) {" ) . nl ( ) ; SB classCtxSb = new SB ( ) ; toJavaPredictBody ( ccsb . ii ( 1 ) , classCtxSb , fileCtxSb ) ; ccsb . di ( 1 ) ; ccsb . p ( " return preds;" ) . nl ( ) ; ccsb . p ( " }" ) . nl ( ) ; ccsb . p ( classCtxSb ) ; return ccsb ;
|
public class AsyncRequest { /** * Mark the record associated with this request
* @ param record buffered record
* @ param bytesWritten bytes of the record written into the request */
public void markRecord ( BufferedRecord < D > record , int bytesWritten ) { } }
|
synchronized ( this ) { thunks . add ( new Thunk < > ( record , bytesWritten ) ) ; byteSize += bytesWritten ; }
|
public class TvdbParser { /** * Get a list of series from the URL
* @ param urlString
* @ return
* @ throws com . omertron . thetvdbapi . TvDbException */
public static List < Series > getSeriesList ( String urlString ) throws TvDbException { } }
|
List < Series > seriesList = new ArrayList < > ( ) ; Series series ; NodeList nlSeries ; Node nSeries ; Element eSeries ; Document doc = DOMHelper . getEventDocFromUrl ( urlString ) ; if ( doc == null ) { return Collections . emptyList ( ) ; } nlSeries = doc . getElementsByTagName ( SERIES ) ; for ( int loop = 0 ; loop < nlSeries . getLength ( ) ; loop ++ ) { nSeries = nlSeries . item ( loop ) ; if ( nSeries . getNodeType ( ) == Node . ELEMENT_NODE ) { eSeries = ( Element ) nSeries ; series = parseNextSeries ( eSeries ) ; if ( series != null ) { seriesList . add ( series ) ; } } } return seriesList ;
|
public class WarpExecutionInitializer { /** * Activates / deactivates { @ link WarpExecutionContext } .
* Provides { @ link WarpContext } instance .
* Provides { @ link SynchronizationPoint } instance .
* Setups / resets { @ link WarpContextStore } */
public void provideWarpContext ( @ Observes EventContext < ExecuteWarp > eventContext ) { } }
|
warpExecutionContext . get ( ) . activate ( ) ; try { WarpContext context = eventContext . getEvent ( ) . getWarpContext ( ) ; warpContext . set ( context ) ; WarpContextStore . set ( context ) ; synchronization . set ( eventContext . getEvent ( ) . getWarpContext ( ) . getSynchronization ( ) ) ; eventContext . proceed ( ) ; } finally { WarpContextStore . reset ( ) ; warpExecutionContext . get ( ) . deactivate ( ) ; }
|
public class AmazonSimpleEmailServiceClient { /** * Reorders the receipt rules within a receipt rule set .
* < note >
* All of the rules in the rule set must be represented in this request . That is , this API will return an error if
* the reorder request doesn ' t explicitly position all of the rules .
* < / note >
* For information about managing receipt rule sets , see the < a
* href = " http : / / docs . aws . amazon . com / ses / latest / DeveloperGuide / receiving - email - managing - receipt - rule - sets . html "
* > Amazon SES Developer Guide < / a > .
* You can execute this operation no more than once per second .
* @ param reorderReceiptRuleSetRequest
* Represents a request to reorder the receipt rules within a receipt rule set . You use receipt rule sets to
* receive email with Amazon SES . For more information , see the < a
* href = " http : / / docs . aws . amazon . com / ses / latest / DeveloperGuide / receiving - email - concepts . html " > Amazon SES
* Developer Guide < / a > .
* @ return Result of the ReorderReceiptRuleSet operation returned by the service .
* @ throws RuleSetDoesNotExistException
* Indicates that the provided receipt rule set does not exist .
* @ throws RuleDoesNotExistException
* Indicates that the provided receipt rule does not exist .
* @ sample AmazonSimpleEmailService . ReorderReceiptRuleSet
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / email - 2010-12-01 / ReorderReceiptRuleSet " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public ReorderReceiptRuleSetResult reorderReceiptRuleSet ( ReorderReceiptRuleSetRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeReorderReceiptRuleSet ( request ) ;
|
public class Dependency { /** * Returns the file name to display in reports ; if no display file name has
* been set it will default to constructing a name based on the name and
* version fields , otherwise it will return the actual file name .
* @ return the file name to display */
public String getDisplayFileName ( ) { } }
|
if ( displayName != null ) { return displayName ; } if ( ! isVirtual ) { return fileName ; } if ( name == null ) { return fileName ; } if ( version == null ) { return name ; } return name + ":" + version ;
|
public class HBaseReader { /** * ( non - Javadoc )
* @ see
* com . impetus . client . hbase . Reader # scanRowKeys ( org . apache . hadoop . hbase . client
* . Table , org . apache . hadoop . hbase . filter . Filter , java . lang . String ,
* java . lang . String , java . lang . Class ) */
@ Override public Object [ ] scanRowKeys ( final Table hTable , final Filter filter , final String columnFamilyName , final String columnName , final Class rowKeyClazz ) throws IOException { } }
|
List < Object > rowKeys = new ArrayList < Object > ( ) ; if ( scanner == null ) { Scan s = new Scan ( ) ; s . setFilter ( filter ) ; s . addColumn ( Bytes . toBytes ( columnFamilyName ) , Bytes . toBytes ( columnName ) ) ; scanner = hTable . getScanner ( s ) ; resultsIter = scanner . iterator ( ) ; } if ( fetchSize == null ) { for ( Result result : scanner ) { for ( Cell cell : result . listCells ( ) ) { rowKeys . add ( HBaseUtils . fromBytes ( CellUtil . cloneFamily ( cell ) , rowKeyClazz ) ) ; } } } if ( rowKeys != null && ! rowKeys . isEmpty ( ) ) { return rowKeys . toArray ( new Object [ 0 ] ) ; } return null ;
|
public class HBeanRowCollector { /** * Filter out the rows that we have not yet visited . */
public Set < HBeanRow > filterUnvisted ( Set < HBeanRow > rows ) { } }
|
Set < HBeanRow > unvisted = new HashSet < > ( ) ; for ( HBeanRow row : rows ) { if ( ! references . containsKey ( row ) && ! inital . containsKey ( row ) ) { unvisted . add ( row ) ; } } return unvisted ;
|
public class GatewayConfigParser { /** * Get the root cause from a < code > Throwable < / code > stack
* @ param throwable
* @ return */
private static Throwable getRootCause ( Throwable throwable ) { } }
|
List < Throwable > list = new ArrayList < > ( ) ; while ( throwable != null && ! list . contains ( throwable ) ) { list . add ( throwable ) ; throwable = throwable . getCause ( ) ; } return list . get ( list . size ( ) - 1 ) ;
|
public class TiffUtil { /** * Reads orientation information from TIFF data .
* @ param is the input stream of TIFF data
* @ param length length of the TIFF data
* @ return orientation information ( 1/3/6/8 on success , 0 if not found ) */
public static int readOrientationFromTIFF ( InputStream is , int length ) throws IOException { } }
|
// read tiff header
TiffHeader tiffHeader = new TiffHeader ( ) ; length = readTiffHeader ( is , length , tiffHeader ) ; // move to the first IFD
// offset is relative to the beginning of the TIFF data
// and we already consumed the first 8 bytes of header
int toSkip = tiffHeader . firstIfdOffset - 8 ; if ( length == 0 || toSkip > length ) { return 0 ; } is . skip ( toSkip ) ; length -= toSkip ; // move to the entry with orientation tag
length = moveToTiffEntryWithTag ( is , length , tiffHeader . isLittleEndian , TIFF_TAG_ORIENTATION ) ; // read orientation
return getOrientationFromTiffEntry ( is , length , tiffHeader . isLittleEndian ) ;
|
public class RelationalOperations { /** * Returns true if intersects and false if nothing can be determined . */
private static boolean checkVerticesForIntersection_ ( MultiVertexGeometryImpl geom , RasterizedGeometry2D rgeom ) { } }
|
// Do a quick raster test for each point . If any point is inside , then
// there is an intersection .
int pointCount = geom . getPointCount ( ) ; Point2D pt = new Point2D ( ) ; for ( int ipoint = 0 ; ipoint < pointCount ; ipoint ++ ) { geom . getXY ( ipoint , pt ) ; RasterizedGeometry2D . HitType hit = rgeom . queryPointInGeometry ( pt . x , pt . y ) ; if ( hit == RasterizedGeometry2D . HitType . Inside ) { return true ; } } return false ;
|
public class KeywordUtils { /** * Builds mapping of robot keywords to actual bean names in spring context .
* @ param context Spring application context .
* @ return mapping of robot keywords to bean names */
public static Map < String , String > getKeywordMap ( ApplicationContext context ) { } }
|
Map < String , String > keywordToBeanMap = new HashMap < String , String > ( ) ; // Retrieve beans implementing the Keyword interface .
String [ ] beanNames = context . getBeanNamesForType ( Keyword . class ) ; for ( String beanName : beanNames ) { Object bean = context . getBean ( beanName ) ; // Retrieve keyword information
KeywordInfo keywordInfo = AnnotationUtils . findAnnotation ( bean . getClass ( ) , KeywordInfo . class ) ; // Set keyword name as specified in the keyword info , or if information is not available , use bean name .
String keywordName = keywordInfo != null ? keywordInfo . name ( ) : beanName ; if ( keywordToBeanMap . put ( keywordName , beanName ) != null ) { // If map already contains the keyword name , throw an exception . Keywords should be unique .
throw new RuntimeException ( "Multiple definitions for keyword '" + keywordName + "' exists." ) ; } } return keywordToBeanMap ;
|
public class PersistenceUnitMetadata { /** * Gets the client . In case client is not configure , it throws
* IllegalArgumentException .
* @ return the client */
public String getClient ( ) { } }
|
String client = null ; if ( this . properties != null ) { client = ( String ) this . properties . get ( PersistenceProperties . KUNDERA_CLIENT_FACTORY ) ; } if ( client == null ) { log . error ( "kundera.client property is missing for persistence unit:" + persistenceUnitName ) ; throw new IllegalArgumentException ( "kundera.client property is missing for persistence unit:" + persistenceUnitName ) ; } return client ;
|
public class AbstractManagedType { /** * ( non - Javadoc )
* @ see
* javax . persistence . metamodel . ManagedType # getDeclaredSingularAttribute (
* java . lang . String , java . lang . Class ) */
@ Override public < Y > SingularAttribute < X , Y > getDeclaredSingularAttribute ( String paramString , Class < Y > paramClass ) { } }
|
return getDeclaredSingularAttribute ( paramString , paramClass , true ) ;
|
public class SortableIdAndNameListBox { /** * fill entries of the listbox .
* @ param pids list of entries */
public final void fillEntries ( final Collection < T > pids ) { } }
|
final List < IdAndNameBean < T > > entries = new ArrayList < > ( ) ; for ( final T proEnum : pids ) { entries . add ( new IdAndNameBean < > ( proEnum , this . messages . name ( proEnum ) ) ) ; } if ( this . sortOrder != null ) { switch ( this . sortOrder ) { case ID_ASC : Collections . sort ( entries , new IdAndNameIdComperator < T > ( ) ) ; break ; case ID_DSC : Collections . sort ( entries , Collections . reverseOrder ( new IdAndNameIdComperator < T > ( ) ) ) ; break ; case NAME_ASC : Collections . sort ( entries , new IdAndNameNameComperator < T > ( ) ) ; break ; case NAME_DSC : Collections . sort ( entries , Collections . reverseOrder ( new IdAndNameNameComperator < T > ( ) ) ) ; break ; default : break ; } } fillEntryCollections ( entries ) ;
|
public class WImageRenderer { /** * Builds the " open tag " part of the XML , that is the tagname and attributes .
* E . g . & lt ; ui : image src = " example . png " alt = " some alt txt "
* The caller may then append any additional attributes and then close the XML tag .
* @ param imageComponent The WImage to render .
* @ param xml The buffer to render the XML into . */
protected static void renderTagOpen ( final WImage imageComponent , final XmlStringBuilder xml ) { } }
|
// Check for alternative text on the image
String alternativeText = imageComponent . getAlternativeText ( ) ; if ( alternativeText == null ) { alternativeText = "" ; } else { alternativeText = I18nUtilities . format ( null , alternativeText ) ; } xml . appendTagOpen ( "img" ) ; xml . appendAttribute ( "id" , imageComponent . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , imageComponent . getHtmlClass ( ) ) ; xml . appendOptionalAttribute ( "track" , imageComponent . isTracking ( ) , "true" ) ; xml . appendUrlAttribute ( "src" , imageComponent . getTargetUrl ( ) ) ; xml . appendAttribute ( "alt" , alternativeText ) ; xml . appendOptionalAttribute ( "hidden" , imageComponent . isHidden ( ) , "hidden" ) ; // Check for size information on the image
Dimension size = imageComponent . getSize ( ) ; if ( size != null ) { if ( size . getHeight ( ) >= 0 ) { xml . appendAttribute ( "height" , size . height ) ; } if ( size . getWidth ( ) >= 0 ) { xml . appendAttribute ( "width" , size . width ) ; } }
|
public class ReportUtil { /** * Get detail band subreports for a report layout
* @ param reportLayout current report layout
* @ return list of subreports from detail band */
public static List < Report > getDetailSubreports ( ReportLayout reportLayout ) { } }
|
List < Report > subreports = new ArrayList < Report > ( ) ; Band band = reportLayout . getDetailBand ( ) ; for ( int i = 0 , rows = band . getRowCount ( ) ; i < rows ; i ++ ) { List < BandElement > list = band . getRow ( i ) ; for ( int j = 0 , size = list . size ( ) ; j < size ; j ++ ) { BandElement be = list . get ( j ) ; if ( be instanceof ReportBandElement ) { subreports . add ( ( ( ReportBandElement ) be ) . getReport ( ) ) ; } } } return subreports ;
|
public class ChatProvider { /** * Broadcast with support for a customizable level or mode .
* @ param levelOrMode if from is null , it ' s an attentionLevel , else it ' s a mode code . */
public void broadcast ( Name from , byte levelOrMode , String bundle , String msg , boolean forward ) { } }
|
if ( _broadcastObject != null ) { broadcastTo ( _broadcastObject , from , levelOrMode , bundle , msg ) ; } else { for ( Iterator < PlaceObject > iter = _plreg . enumeratePlaces ( ) ; iter . hasNext ( ) ; ) { PlaceObject plobj = iter . next ( ) ; if ( plobj . shouldBroadcast ( ) ) { broadcastTo ( plobj , from , levelOrMode , bundle , msg ) ; } } } if ( forward && _chatForwarder != null ) { _chatForwarder . forwardBroadcast ( from , levelOrMode , bundle , msg ) ; }
|
public class ThinTableModel { /** * Update the currently updated record if the row is different from this row .
* @ param iRowIndex Row to read . . . If different from current record , update current . If - 1 , update and don ' t read . */
public void updateIfNewRow ( int iRowIndex ) throws DBException { } }
|
if ( ( m_iCurrentLockedRowIndex != - 1 ) && ( m_iCurrentLockedRowIndex != iRowIndex ) ) if ( m_buffCurrentLockedData != null ) { { FieldList fieldList = this . makeRowCurrent ( m_iCurrentLockedRowIndex , false ) ; // Read this row if it isn ' t current
if ( this . isRecordChanged ( ) ) { // Only update if there are changes .
synchronized ( this ) { // This time do the physical read ( last time I asked for the cache )
DBException ex = null ; fieldList = this . makeRowCurrent ( m_iCurrentLockedRowIndex , true ) ; // Read this row if it isn ' t current
if ( ( this . isAppending ( ) ) && ( ( m_iCurrentLockedRowIndex == m_iLastRecord + 1 ) && ( m_iLastRecord != RECORD_UNKNOWN ) ) ) { m_table . add ( fieldList ) ; // New record = add
this . setCurrentRow ( - 1 ) ; // Make sure I don ' t try to use this unknown record without re - reading it .
if ( m_iLastRecord != RECORD_UNKNOWN ) // Could have been set in ' add '
m_iLastRecord ++ ; } else { if ( ( fieldList . getEditMode ( ) == Constants . EDIT_CURRENT ) || ( fieldList . getEditMode ( ) == Constants . EDIT_IN_PROGRESS ) ) { try { m_table . set ( fieldList ) ; // Current record = set
} catch ( DBException e ) { ex = e ; } } this . setCurrentRow ( - 1 ) ; // Can ' t use current record anymore
} m_iCurrentLockedRowIndex = - 1 ; m_buffCurrentLockedData = null ; if ( ex != null ) throw ex ; } } } }
|
public class GrapesClient { /** * Post a build info to the server
* @ param moduleName String
* @ param moduleVersion String
* @ param buildInfo Map < String , String >
* @ param user String
* @ param password String
* @ throws GrapesCommunicationException
* @ throws javax . naming . AuthenticationException */
public void postBuildInfo ( final String moduleName , final String moduleVersion , final Map < String , String > buildInfo , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { } }
|
final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getBuildInfoPath ( moduleName , moduleVersion ) ) ; final ClientResponse response = resource . type ( MediaType . APPLICATION_JSON ) . post ( ClientResponse . class , buildInfo ) ; client . destroy ( ) ; if ( ClientResponse . Status . CREATED . getStatusCode ( ) != response . getStatus ( ) ) { final String message = "Failed to POST buildInfo" ; if ( LOG . isErrorEnabled ( ) ) { LOG . error ( String . format ( HTTP_STATUS_TEMPLATE_MSG , message , response . getStatus ( ) ) ) ; } throw new GrapesCommunicationException ( message , response . getStatus ( ) ) ; }
|
public class SVGParser { private void parseAttributesCore ( SvgElementBase obj , Attributes attributes ) throws SVGParseException { } }
|
for ( int i = 0 ; i < attributes . getLength ( ) ; i ++ ) { String qname = attributes . getQName ( i ) ; if ( qname . equals ( "id" ) || qname . equals ( "xml:id" ) ) { obj . id = attributes . getValue ( i ) . trim ( ) ; break ; } else if ( qname . equals ( "xml:space" ) ) { String val = attributes . getValue ( i ) . trim ( ) ; if ( "default" . equals ( val ) ) { obj . spacePreserve = Boolean . FALSE ; } else if ( "preserve" . equals ( val ) ) { obj . spacePreserve = Boolean . TRUE ; } else { throw new SVGParseException ( "Invalid value for \"xml:space\" attribute: " + val ) ; } break ; } }
|
public class AnyValueMap { /** * Converts map element into an AnyValueMap or returns null if conversion is not
* possible .
* @ param key a key of element to get .
* @ return AnyValueMap value of the element or null if conversion is not
* supported .
* @ see # fromValue ( Object ) */
public AnyValueMap getAsNullableMap ( String key ) { } }
|
Object value = getAsObject ( key ) ; return value != null ? AnyValueMap . fromValue ( value ) : null ;
|
public class QueryImpl { /** * Populate using lucene .
* @ param m
* the m
* @ param client
* the client
* @ param result
* the result
* @ param columnsToSelect
* List of column names to be selected ( rest should be ignored )
* @ return the list */
protected List < Object > populateUsingLucene ( EntityMetadata m , Client client , List < Object > result , String [ ] columnsToSelect ) { } }
|
Set < Object > uniquePKs = null ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; if ( client . getIndexManager ( ) . getIndexer ( ) . getClass ( ) . getName ( ) . equals ( IndexingConstants . LUCENE_INDEXER ) ) { String luceneQ = KunderaCoreUtils . getLuceneQueryFromJPAQuery ( kunderaQuery , kunderaMetadata ) ; Map < String , Object > searchFilter = client . getIndexManager ( ) . search ( m . getEntityClazz ( ) , luceneQ , Constants . INVALID , Constants . INVALID ) ; // Map < String , Object > searchFilter =
// client . getIndexManager ( ) . search ( kunderaMetadata , kunderaQuery ,
// persistenceDelegeator , m ) ;
boolean isEmbeddedId = metaModel . isEmbeddable ( m . getIdAttribute ( ) . getBindableJavaType ( ) ) ; if ( isEmbeddedId ) { return populateEmbeddedIdUsingLucene ( m , client , result , searchFilter , metaModel ) ; } Object [ ] primaryKeys = searchFilter . values ( ) . toArray ( new Object [ ] { } ) ; // Object [ ] primaryKeys =
// ( ( List ) searchFilter . get ( " primaryKeys " ) ) . toArray ( new Object [ ] { } ) ;
uniquePKs = new HashSet < Object > ( Arrays . asList ( primaryKeys ) ) ; return findUsingLucene ( m , client , uniquePKs . toArray ( ) ) ; } else { return populateUsingElasticSearch ( client , m ) ; }
|
public class Modifiers { /** * When set native , non - native - method settings are cleared . */
public static int setNative ( int modifier , boolean b ) { } }
|
if ( b ) { return ( modifier | NATIVE ) & ( ~ VOLATILE & ~ TRANSIENT & ~ INTERFACE & ~ ABSTRACT & ~ STRICT ) ; } else { return modifier & ~ NATIVE ; }
|
public class GetSnapshotContentsTaskRunner { /** * Create URL to call bridge app */
protected String buildBridgeURL ( GetSnapshotContentsTaskParameters taskParams ) { } }
|
int pageNumber = taskParams . getPageNumber ( ) ; if ( pageNumber < SnapshotConstants . DEFAULT_CONTENT_PAGE_NUMBER ) { pageNumber = SnapshotConstants . DEFAULT_CONTENT_PAGE_NUMBER ; } int pageSize = taskParams . getPageSize ( ) ; if ( pageSize < SnapshotConstants . MIN_CONTENT_PAGE_SIZE || pageSize > SnapshotConstants . MAX_CONTENT_PAGE_SIZE ) { pageSize = SnapshotConstants . MAX_CONTENT_PAGE_SIZE ; } String snapshotId = taskParams . getSnapshotId ( ) ; String prefix = taskParams . getPrefix ( ) ; String prefixParam = "&prefix=" + ( prefix != null ? prefix : "" ) ; return MessageFormat . format ( "{0}/snapshot/{1}/content?page={2}&pageSize={3}{4}" , buildBridgeBaseURL ( ) , snapshotId , String . valueOf ( pageNumber ) , String . valueOf ( pageSize ) , prefixParam ) ;
|
public class AdminParserUtils { /** * Checks if there ' s exactly one option that exists among all possible opts .
* @ param options OptionSet to checked
* @ param opt1 Possible required option to check
* @ param opt2 Possible required option to check
* @ throws VoldemortException */
public static void checkRequired ( OptionSet options , String opt1 , String opt2 ) throws VoldemortException { } }
|
List < String > opts = Lists . newArrayList ( ) ; opts . add ( opt1 ) ; opts . add ( opt2 ) ; checkRequired ( options , opts ) ;
|
public class QueryExecutorImpl { /** * Wait for a row of data to be received from server on an active copy operation
* Connection gets unlocked by processCopyResults ( ) at end of operation .
* @ param op the copy operation presumably currently holding lock on this connection
* @ param block whether to block waiting for input
* @ throws SQLException on any failure */
synchronized void readFromCopy ( CopyOperationImpl op , boolean block ) throws SQLException { } }
|
if ( ! hasLock ( op ) ) { throw new PSQLException ( GT . tr ( "Tried to read from inactive copy" ) , PSQLState . OBJECT_NOT_IN_STATE ) ; } try { processCopyResults ( op , block ) ; // expect a call to handleCopydata ( ) to store the data
} catch ( IOException ioe ) { throw new PSQLException ( GT . tr ( "Database connection failed when reading from copy" ) , PSQLState . CONNECTION_FAILURE , ioe ) ; }
|
public class ThroughputDistribution { /** * Calculate a z - score for the specified value from the current
* throughput data . The z - score helps to normalize a distribution
* to the < em > standard < / em > normal distribution required to use
* cumulative tables to determine probability .
* @ param value the random value to evaluate against the distribution
* @ return the number of standard deviations between the specified value
* and the mean
* @ see http : / / en . wikipedia . org / wiki / Standard _ normal _ table */
synchronized double getZScore ( double value ) { } }
|
// Generate a random value between - 0.5 and 0.5 if we have no
// historical data . This will result in a score that is well
// within 1 standard deviation from the specified value and
// avoid divide - by - zero issues .
if ( ewmaVariance == Double . NEGATIVE_INFINITY ) { return Math . random ( ) - 0.5 ; } double score = ( value - ewma ) / ewmaStddev ; // Limit the z - score to the range where we ' ve calculated the
// standard normal distribution probabilities
if ( score < - 3.4 ) { return - 3.4 ; } else if ( score > 3.4 ) { return 3.4 ; } return score ;
|
public class DomainsInner { /** * Generate a single sign - on request for the domain management portal .
* Generate a single sign - on request for the domain management portal .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the DomainControlCenterSsoRequestInner object */
public Observable < ServiceResponse < DomainControlCenterSsoRequestInner > > getControlCenterSsoRequestWithServiceResponseAsync ( ) { } }
|
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . getControlCenterSsoRequest ( this . client . subscriptionId ( ) , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < DomainControlCenterSsoRequestInner > > > ( ) { @ Override public Observable < ServiceResponse < DomainControlCenterSsoRequestInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < DomainControlCenterSsoRequestInner > clientResponse = getControlCenterSsoRequestDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
|
public class RandomDateUtils { /** * Returns a random valid value for the given { @ link TemporalField } between < code >
* TemporalField . range ( ) . min ( ) < / code > and < code > TemporalField . range ( ) . max ( ) < / code > . For example ,
* < code > random ( { @ link ChronoField # HOUR _ OF _ DAY } ) < / code > will return a random value between 0-23.
* < p > Note : This will never return { @ link Long # MAX _ VALUE } . Even if it ' s a valid value for the
* given { @ link TemporalField } .
* @ param field the { @ link TemporalField } to return a valid value for
* @ return the random value */
public static long random ( TemporalField field ) { } }
|
long max = Math . min ( field . range ( ) . getMaximum ( ) , Long . MAX_VALUE - 1 ) ; return randomLong ( field . range ( ) . getMinimum ( ) , max + 1 ) ;
|
public class Lexer { /** * 多行注释 , 开始状态 200 , 关注结尾标记与 EOF */
boolean scanMultiLineComment ( ) { } }
|
while ( true ) { switch ( state ) { case 200 : if ( peek ( ) == '#' && next ( ) == '-' && next ( ) == '-' ) { state = 201 ; continue ; } return fail ( ) ; case 201 : for ( char c = next ( ) ; true ; c = next ( ) ) { if ( c == '-' && buf [ forward + 1 ] == '-' && buf [ forward + 2 ] == '#' ) { forward = forward + 3 ; if ( lookForwardLineFeedAndEof ( ) && deletePreviousTextTokenBlankTails ( ) ) { return prepareNextScan ( peek ( ) != EOF ? 1 : 0 ) ; } else { return prepareNextScan ( 0 ) ; } } if ( c == EOF ) { throw new ParseException ( "The multiline comment start block \"#--\" can not match the end block: \"--#\"" , new Location ( fileName , beginRow ) ) ; } } default : return fail ( ) ; } }
|
public class ModbusTCPMaster { /** * Connects this < tt > ModbusTCPMaster < / tt > with the slave .
* @ throws Exception if the connection cannot be established . */
public void connect ( ) throws Exception { } }
|
if ( connection != null && ! connection . isConnected ( ) ) { connection . connect ( useRtuOverTcp ) ; transaction = connection . getModbusTransport ( ) . createTransaction ( ) ; ( ( ModbusTCPTransaction ) transaction ) . setReconnecting ( reconnecting ) ; setTransaction ( transaction ) ; }
|
public class CmsSitemapController { /** * Returns the no edit reason or < code > null < / code > if editing is allowed . < p >
* @ param entry the entry to get the no edit reason for
* @ return the no edit reason */
public String getNoEditReason ( CmsClientSitemapEntry entry ) { } }
|
String reason = entry . getNoEditReason ( ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( reason ) ) { reason = null ; if ( ( entry . getLock ( ) != null ) && ( entry . getLock ( ) . getLockOwner ( ) != null ) && ! entry . getLock ( ) . isOwnedByUser ( ) ) { reason = Messages . get ( ) . key ( Messages . GUI_DISABLED_LOCKED_BY_1 , entry . getLock ( ) . getLockOwner ( ) ) ; } if ( entry . hasBlockingLockedChildren ( ) ) { reason = Messages . get ( ) . key ( Messages . GUI_DISABLED_BLOCKING_LOCKED_CHILDREN_0 ) ; } } return reason ;
|
public class DomainsInner { /** * Lists domain ownership identifiers .
* Lists domain ownership identifiers .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param domainName Name of domain .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; DomainOwnershipIdentifierInner & gt ; object */
public Observable < ServiceResponse < Page < DomainOwnershipIdentifierInner > > > listOwnershipIdentifiersWithServiceResponseAsync ( final String resourceGroupName , final String domainName ) { } }
|
return listOwnershipIdentifiersSinglePageAsync ( resourceGroupName , domainName ) . concatMap ( new Func1 < ServiceResponse < Page < DomainOwnershipIdentifierInner > > , Observable < ServiceResponse < Page < DomainOwnershipIdentifierInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < DomainOwnershipIdentifierInner > > > call ( ServiceResponse < Page < DomainOwnershipIdentifierInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listOwnershipIdentifiersNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ;
|
public class WVideoExample { /** * Set the video configuration options . */
private void setupVideo ( ) { } }
|
video . setAutoplay ( cbAutoPlay . isSelected ( ) ) ; video . setLoop ( cbLoop . isSelected ( ) ) ; video . setMuted ( ! cbMute . isDisabled ( ) && cbMute . isSelected ( ) ) ; video . setControls ( cbControls . isSelected ( ) ? WVideo . Controls . PLAY_PAUSE : WVideo . Controls . NATIVE ) ; video . setDisabled ( cbControls . isSelected ( ) && cbDisable . isSelected ( ) ) ;
|
public class ObjectSerialization { /** * Writes an object ot a file */
public static void serialize ( File file , SerializableObject object ) throws IOException { } }
|
AtomicFile atomicFile = new AtomicFile ( file ) ; FileOutputStream stream = null ; try { stream = atomicFile . startWrite ( ) ; DataOutputStream out = new DataOutputStream ( stream ) ; object . writeExternal ( out ) ; atomicFile . finishWrite ( stream ) ; // serialization was successful
} catch ( Exception e ) { atomicFile . failWrite ( stream ) ; // serialization failed
throw new IOException ( e ) ; // throw exception up the chain
}
|
public class ExtensionAuthentication { /** * Gets the authentication method type for a given identifier .
* @ param id the id
* @ return the authentication method type for identifier */
public AuthenticationMethodType getAuthenticationMethodTypeForIdentifier ( int id ) { } }
|
for ( AuthenticationMethodType t : getAuthenticationMethodTypes ( ) ) if ( t . getUniqueIdentifier ( ) == id ) return t ; return null ;
|
public class AbstractContext { /** * / * ( non - Javadoc )
* @ see com . abubusoft . kripton . BinderContext # canPersist ( java . lang . Class ) */
public boolean canPersist ( Class < ? > cls ) { } }
|
Object mapper = OBJECT_MAPPERS . get ( cls ) ; if ( mapper == null ) { // The only way the mapper wouldn ' t already be loaded into
// OBJECT _ MAPPERS is if it was compiled separately , but let ' s handle
// it anyway
String beanClassName = cls . getName ( ) ; String mapperClassName = cls . getName ( ) + KriptonBinder . MAPPER_CLASS_SUFFIX ; try { Class < ? > mapperClass = ( Class < ? > ) Class . forName ( mapperClassName ) ; mapper = mapperClass . newInstance ( ) ; // mapper .
return true ; } catch ( ClassNotFoundException e ) { e . printStackTrace ( ) ; throw new KriptonRuntimeException ( String . format ( "Class '%s' does not exist. Does '%s' have @BindType annotation?" , mapperClassName , beanClassName ) ) ; } catch ( InstantiationException e ) { e . printStackTrace ( ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } } return false ;
|
public class BytecodeUtils { /** * Implements the short circuiting logical or ( { @ code | | } ) operator over the list of boolean
* expressions . */
public static Expression logicalOr ( List < ? extends Expression > expressions ) { } }
|
return doShortCircuitingLogicalOperator ( ImmutableList . copyOf ( expressions ) , true ) ;
|
public class ContractsApi { /** * Get contracts ( asynchronously ) Returns contracts available to a
* character , only if the character is issuer , acceptor or assignee . Only
* returns contracts no older than 30 days , or if the status is
* \ & quot ; in _ progress \ & quot ; . - - - This route is cached for up to 300 seconds
* @ param characterId
* An EVE character ID ( required )
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param ifNoneMatch
* ETag from a previous request . A 304 will be returned if this
* matches the current ETag ( optional )
* @ param page
* Which page of results to return ( optional , default to 1)
* @ param token
* Access token to use if unable to set a header ( optional )
* @ param callback
* The callback to be executed when the API call finishes
* @ return The request call
* @ throws ApiException
* If fail to process the API call , e . g . serializing the request
* body object */
public com . squareup . okhttp . Call getCharactersCharacterIdContractsAsync ( Integer characterId , String datasource , String ifNoneMatch , Integer page , String token , final ApiCallback < List < CharacterContractsResponse > > callback ) throws ApiException { } }
|
com . squareup . okhttp . Call call = getCharactersCharacterIdContractsValidateBeforeCall ( characterId , datasource , ifNoneMatch , page , token , callback ) ; Type localVarReturnType = new TypeToken < List < CharacterContractsResponse > > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType , callback ) ; return call ;
|
public class TcpServer { /** * Setups a callback called when { @ link io . netty . channel . ServerChannel } is about to
* bind .
* @ param doOnBind a consumer observing server start event
* @ return a new { @ link TcpServer } */
public final TcpServer doOnBind ( Consumer < ? super ServerBootstrap > doOnBind ) { } }
|
Objects . requireNonNull ( doOnBind , "doOnBind" ) ; return new TcpServerDoOn ( this , doOnBind , null , null ) ;
|
public class CommerceAccountLocalServiceBaseImpl { /** * Returns the commerce account with the matching external reference code and company .
* @ param companyId the primary key of the company
* @ param externalReferenceCode the commerce account ' s external reference code
* @ return the matching commerce account , or < code > null < / code > if a matching commerce account could not be found */
@ Override public CommerceAccount fetchCommerceAccountByReferenceCode ( long companyId , String externalReferenceCode ) { } }
|
return commerceAccountPersistence . fetchByC_ERC ( companyId , null ) ;
|
public class ExtractZooKeeperArbitrateEvent { /** * < pre >
* 算法 :
* 1 . 检查当前的Permit , 阻塞等待其授权 ( 解决Channel的pause状态处理 )
* 2 . 开始阻塞获取符合条件的processId
* 3 . 检查当前的即时Permit状态 ( 在阻塞获取processId过程会出现一些error信号 , process节点会被删除 )
* 4 . 获取Select传递的EventData数据 , 添加next node信息后直接返回
* < / pre >
* @ return */
public EtlEventData await ( Long pipelineId ) throws InterruptedException { } }
|
Assert . notNull ( pipelineId ) ; PermitMonitor permitMonitor = ArbitrateFactory . getInstance ( pipelineId , PermitMonitor . class ) ; permitMonitor . waitForPermit ( ) ; // 阻塞等待授权
ExtractStageListener extractStageListener = ArbitrateFactory . getInstance ( pipelineId , ExtractStageListener . class ) ; Long processId = extractStageListener . waitForProcess ( ) ; // 符合条件的processId
ChannelStatus status = permitMonitor . getChannelPermit ( ) ; if ( status . isStart ( ) ) { // 即时查询一下当前的状态 , 状态随时可能会变
// 根据pipelineId + processId构造对应的path
String path = StagePathUtils . getSelectStage ( pipelineId , processId ) ; try { byte [ ] data = zookeeper . readData ( path ) ; EtlEventData eventData = JsonUtils . unmarshalFromByte ( data , EtlEventData . class ) ; Node node = LoadBalanceFactory . getNextTransformNode ( pipelineId ) ; // 获取下一个处理节点信息
if ( node == null ) { // 没有后端节点
// TerminEventData termin = new TerminEventData ( ) ;
// termin . setPipelineId ( pipelineId ) ;
// termin . setType ( TerminType . ROLLBACK ) ;
// termin . setCode ( " no _ node " ) ;
// termin . setDesc ( MessageFormat . format ( " pipeline [ { } ] extract stage has no node ! " , pipelineId ) ) ;
// terminEvent . single ( termin ) ;
throw new ArbitrateException ( "Extract_single" , "no next node" ) ; } else { eventData . setNextNid ( node . getId ( ) ) ; return eventData ; // 只有这一条路返回
} } catch ( ZkNoNodeException e ) { logger . error ( "pipeline[{}] processId[{}] is invalid , retry again" , pipelineId , processId ) ; return await ( pipelineId ) ; // / 出现节点不存在 , 说明出现了error情况 , 递归调用重新获取一次
} catch ( ZkException e ) { throw new ArbitrateException ( "Extract_await" , e . getMessage ( ) , e ) ; } } else { logger . warn ( "pipelineId[{}] extract ignore processId[{}] by status[{}]" , new Object [ ] { pipelineId , processId , status } ) ; // 释放下processId , 因为load是等待processId最小值完成Tranform才继续 , 如果这里不释放 , 会一直卡死等待
String path = StagePathUtils . getProcess ( pipelineId , processId ) ; zookeeper . delete ( path ) ; return await ( pipelineId ) ; // 递归调用
}
|
public class SarlArtifactBuilderImpl { /** * Initialize the Ecore element when inside a script . */
public void eInit ( SarlScript script , String name , IJvmTypeProvider context ) { } }
|
setTypeResolutionContext ( context ) ; if ( this . sarlArtifact == null ) { this . sarlArtifact = SarlFactory . eINSTANCE . createSarlArtifact ( ) ; script . getXtendTypes ( ) . add ( this . sarlArtifact ) ; this . sarlArtifact . setAnnotationInfo ( XtendFactory . eINSTANCE . createXtendTypeDeclaration ( ) ) ; if ( ! Strings . isEmpty ( name ) ) { this . sarlArtifact . setName ( name ) ; } }
|
public class CreateUserRequest { /** * The unique identifier of the security profile to assign to the user created .
* @ param securityProfileIds
* The unique identifier of the security profile to assign to the user created . */
public void setSecurityProfileIds ( java . util . Collection < String > securityProfileIds ) { } }
|
if ( securityProfileIds == null ) { this . securityProfileIds = null ; return ; } this . securityProfileIds = new java . util . ArrayList < String > ( securityProfileIds ) ;
|
public class DoLock { /** * Executes the lock for a Mac OS Finder client */
private void doMacLockRequestWorkaround ( final ITransaction transaction , final WebdavRequest req , final WebdavResponse resp ) throws LockFailedException , IOException { } }
|
LockedObject lo ; final int depth = getDepth ( req ) ; int lockDuration = getTimeout ( transaction , req ) ; if ( lockDuration < 0 || lockDuration > MAX_TIMEOUT ) { lockDuration = DEFAULT_TIMEOUT ; } boolean lockSuccess = false ; lockSuccess = _resourceLocks . exclusiveLock ( transaction , _path , _lockOwner , depth , lockDuration ) ; if ( lockSuccess ) { // Locks successfully placed - return information about
lo = _resourceLocks . getLockedObjectByPath ( transaction , _path ) ; if ( lo != null ) { generateXMLReport ( transaction , resp , lo ) ; } else { resp . sendError ( SC_INTERNAL_SERVER_ERROR ) ; } } else { // Locking was not successful
sendLockFailError ( transaction , req , resp ) ; }
|
public class Probe { /** * Returns a mutable copy of the captured event information ( in reverse order - last added events go first ) .
* @ return mutable copy of the captured event information */
List < EventInfo > getEvents ( ) { } }
|
synchronized ( events ) { List < EventInfo > result = new ArrayList < > ( events . size ( ) ) ; for ( ListIterator < EventInfo > iterator = events . listIterator ( events . size ( ) ) ; iterator . hasPrevious ( ) ; ) { result . add ( iterator . previous ( ) ) ; } return result ; }
|
public class DatadogHttpReporter { /** * Get tags from MetricGroup # getAllVariables ( ) , excluding ' host ' . */
private List < String > getTagsFromMetricGroup ( MetricGroup metricGroup ) { } }
|
List < String > tags = new ArrayList < > ( ) ; for ( Map . Entry < String , String > entry : metricGroup . getAllVariables ( ) . entrySet ( ) ) { if ( ! entry . getKey ( ) . equals ( HOST_VARIABLE ) ) { tags . add ( getVariableName ( entry . getKey ( ) ) + ":" + entry . getValue ( ) ) ; } } return tags ;
|
public class Jenkins { /** * Gets the JDK installation of the given name , or returns null . */
public JDK getJDK ( String name ) { } }
|
if ( name == null ) { // if only one JDK is configured , " default JDK " should mean that JDK .
List < JDK > jdks = getJDKs ( ) ; if ( jdks . size ( ) == 1 ) return jdks . get ( 0 ) ; return null ; } for ( JDK j : getJDKs ( ) ) { if ( j . getName ( ) . equals ( name ) ) return j ; } return null ;
|
public class ResultsPartitionsFactory { /** * Determine the correct ResultsPartitioner to use given the SearchResults
* search range , and use that to break the SearchResults into partitions .
* @ param results
* @ param wbRequest
* @ return ArrayList of ResultsPartition objects */
public static ArrayList < ResultsPartition > get ( CaptureSearchResults results , WaybackRequest wbRequest ) { } }
|
return get ( results , wbRequest , null ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.