signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BuySr { /** * < p > Get authorized or not buyer . < / p > * @ param pRqVs request scoped vars * @ param pRqDt Request Data * @ return buyer or null * @ throws Exception - an exception */ @ Override public final OnlineBuyer getBuyr ( final Map < String , Object > pRqVs , final IRequestData pRqDt ) throws Exception { } }
Long buyerId = null ; String buyerIdStr = pRqDt . getCookieValue ( "cBuyerId" ) ; if ( buyerIdStr != null && buyerIdStr . length ( ) > 0 ) { buyerId = Long . valueOf ( buyerIdStr ) ; } OnlineBuyer buyer = null ; if ( buyerId != null ) { buyer = getSrvOrm ( ) . retrieveEntityById ( pRqVs , OnlineBuyer . class , buyerId ) ; } if ( buyer != null && buyer . getRegEmail ( ) != null && buyer . getBuSeId ( ) != null ) { String buSeId = pRqDt . getCookieValue ( "buSeId" ) ; if ( ! buyer . getBuSeId ( ) . equals ( buSeId ) ) { this . spamHnd . handle ( pRqVs , pRqDt , 100 , "Buyer. Authorized invasion? cBuyerId: " + buyerIdStr ) ; // buyer also might clears cookie , so it ' s need new authorization // new / free buyer will be used till authorization : buyer = null ; } } return buyer ;
public class LongIterator { /** * Lazy evaluation . * @ param iteratorSupplier * @ return */ public static LongIterator of ( final Supplier < ? extends LongIterator > iteratorSupplier ) { } }
N . checkArgNotNull ( iteratorSupplier , "iteratorSupplier" ) ; return new LongIterator ( ) { private LongIterator iter = null ; private boolean isInitialized = false ; @ Override public boolean hasNext ( ) { if ( isInitialized == false ) { init ( ) ; } return iter . hasNext ( ) ; } @ Override public long nextLong ( ) { if ( isInitialized == false ) { init ( ) ; } return iter . nextLong ( ) ; } private void init ( ) { if ( isInitialized == false ) { isInitialized = true ; iter = iteratorSupplier . get ( ) ; } } } ;
public class ArrayUtil { /** * Returns first element in given { @ code array } . * if { @ code array } is null or of length zero , then returns { @ code null } */ public static < T > T getFirst ( T array [ ] ) { } }
return array != null && array . length > 0 ? array [ 0 ] : null ;
public class FeedbackApi { /** * Submit a feedback * Submit a feedback * @ param submitFeedbackData Request parameters . ( required ) * @ return ApiResponse & lt ; ApiSuccessResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < ApiSuccessResponse > submitFeedbackWithHttpInfo ( SubmitFeedbackData submitFeedbackData ) throws ApiException { } }
com . squareup . okhttp . Call call = submitFeedbackValidateBeforeCall ( submitFeedbackData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class DropboxClient { /** * Returns metadata information about specified resource with * checking for its hash with specified max child entries count . * If nothing changes ( hash isn ' t changed ) then 304 will returns . * @ param path to file or directory * @ param fileLimit max child entries count * @ param hash to check smth changed * @ param list true to include child entries and false to not * @ return metadata of specified resource * @ see Entry * @ see DropboxDefaults */ @ SuppressWarnings ( { } }
"PointlessBooleanExpression" } ) public Entry getMetadata ( String path , int fileLimit , @ Nullable String hash , boolean list ) { OAuthRequest request = new OAuthRequest ( Verb . GET , METADATA_URL + encode ( path ) ) ; if ( fileLimit != FILE_LIMIT ) request . addQuerystringParameter ( "file_limit" , Integer . toString ( fileLimit ) ) ; if ( hash != null ) { request . addQuerystringParameter ( "hash" , hash ) ; } if ( list != LIST ) { request . addQuerystringParameter ( "list" , Boolean . toString ( list ) ) ; } service . signRequest ( accessToken , request ) ; String content = checkMetadata ( request . send ( ) ) . getBody ( ) ; return Json . parse ( content , Entry . class ) ;
public class CssSkinGenerator { /** * Initialize the skinMapping from the parent path * @ param rsBrowser * the resource browser * @ param rootDir * the skin root dir path * @ param defaultSkinName * the default skin name * @ param defaultLocaleName * the default locale name */ private Map < String , VariantSet > getVariants ( ResourceBrowser rsBrowser , String rootDir , String defaultSkinName , String defaultLocaleName , boolean mappingSkinLocale ) { } }
Set < String > paths = rsBrowser . getResourceNames ( rootDir ) ; Set < String > skinNames = new HashSet < > ( ) ; Set < String > localeVariants = new HashSet < > ( ) ; for ( Iterator < String > itPath = paths . iterator ( ) ; itPath . hasNext ( ) ; ) { String path = rootDir + itPath . next ( ) ; if ( rsBrowser . isDirectory ( path ) ) { String dirName = PathNormalizer . getPathName ( path ) ; if ( mappingSkinLocale ) { skinNames . add ( dirName ) ; // check if there are locale variants for this skin , // and update the localeVariants if needed updateLocaleVariants ( rsBrowser , path , localeVariants ) ; } else { if ( LocaleUtils . LOCALE_SUFFIXES . contains ( dirName ) ) { localeVariants . add ( dirName ) ; // check if there are skin variants for this locales , // and update the skinVariants if needed updateSkinVariants ( rsBrowser , path , skinNames ) ; } } } } // Initialize the variant mapping for the skin root directory return getVariants ( defaultSkinName , skinNames , defaultLocaleName , localeVariants ) ;
public class OrtcClient { /** * = = = = = Raise of events = = = = = */ protected void raiseOrtcEvent ( EventEnum eventToRaise , Object ... args ) { } }
switch ( eventToRaise ) { case OnConnected : raiseOnConnected ( args ) ; break ; case OnDisconnected : raiseOnDisconnected ( args ) ; break ; case OnException : raiseOnException ( args ) ; break ; case OnReconnected : raiseOnReconnected ( args ) ; break ; case OnReconnecting : raiseOnReconnecting ( args ) ; break ; case OnSubscribed : raiseOnSubscribed ( args ) ; break ; case OnUnsubscribed : raiseOnUnsubscribed ( args ) ; break ; case OnReceived : raiseOnReceived ( args ) ; break ; }
public class CountingLruMap { /** * Adds the element to the map , and removes the old element with the same key if any . */ @ Nullable public synchronized V put ( K key , V value ) { } }
// We do remove and insert instead of just replace , in order to cause a structural change // to the map , as we always want the latest inserted element to be last in the queue . V oldValue = mMap . remove ( key ) ; mSizeInBytes -= getValueSizeInBytes ( oldValue ) ; mMap . put ( key , value ) ; mSizeInBytes += getValueSizeInBytes ( value ) ; return oldValue ;
public class XmlTransformer { /** * Returns a Templates object , i . e . a compiled XSLT stylesheet * of the specified URL . * Once the stylesheet is loaded , it is cached for the next time . * That is , firstly , the cache is searched for the URL . * @ param stylesheet * the URL of the stylesheet . * @ return * a Templates object . * @ throws XmlException * if the loading of the XSLT stylesheet fails . */ protected static Templates _getTemplates ( final URL stylesheet ) { } }
Templates templates = _templatesCache . get ( stylesheet ) ; if ( templates == null ) { InputStream is = null ; try { is = stylesheet . openStream ( ) ; // throws IOException templates = TransformerFactory . newInstance ( ) . newTemplates ( new StreamSource ( is ) ) ; // throws TransformerConfigurationException } catch ( Exception ex ) { throw new XmlException ( ex ) ; } finally { try { if ( is != null ) { is . close ( ) ; } } catch ( IOException io_ex ) { // not a fatal error _LOG_ . warn ( io_ex . toString ( ) ) ; } } _templatesCache . put ( stylesheet , templates ) ; } return templates ;
public class CmsUgcSessionFactory { /** * Returns the session , if already initialized . < p > * @ param request the request * @ param sessionId the form session id * @ return the session */ public CmsUgcSession getSession ( HttpServletRequest request , CmsUUID sessionId ) { } }
return ( CmsUgcSession ) request . getSession ( true ) . getAttribute ( "" + sessionId ) ;
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 121:1 : entryRuleSpecialBlockExpression returns [ EObject current = null ] : iv _ ruleSpecialBlockExpression = ruleSpecialBlockExpression EOF ; */ public final EObject entryRuleSpecialBlockExpression ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleSpecialBlockExpression = null ; try { // InternalPureXbase . g : 121:63 : ( iv _ ruleSpecialBlockExpression = ruleSpecialBlockExpression EOF ) // InternalPureXbase . g : 122:2 : iv _ ruleSpecialBlockExpression = ruleSpecialBlockExpression EOF { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getSpecialBlockExpressionRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; iv_ruleSpecialBlockExpression = ruleSpecialBlockExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = iv_ruleSpecialBlockExpression ; } match ( input , EOF , FOLLOW_2 ) ; if ( state . failed ) return current ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class Utils { /** * Transforms the given map by replacing the keys mapped by { @ code mapper } . Any keys not in the * mapper preserve their original keys . If a key in the mapper maps to null or a blank string , * that value is dropped . * < p > e . g . transform ( { a : 1 , b : 2 , c : 3 } , { a : a , c : " " } ) - > { $ a : 1 , b : 2 } - transforms a to $ a - * keeps b - removes c */ public static < T > Map < String , T > transform ( Map < String , T > in , Map < String , String > mapper ) { } }
Map < String , T > out = new LinkedHashMap < > ( in . size ( ) ) ; for ( Map . Entry < String , T > entry : in . entrySet ( ) ) { String key = entry . getKey ( ) ; if ( ! mapper . containsKey ( key ) ) { out . put ( key , entry . getValue ( ) ) ; // keep the original key . continue ; } String mappedKey = mapper . get ( key ) ; if ( ! isNullOrEmpty ( mappedKey ) ) { out . put ( mappedKey , entry . getValue ( ) ) ; } } return out ;
public class PolygonType { /** * Gets the value of the interior property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < / CODE > method for the interior property . * For example , to add a new item , do as follows : * < pre > * getInterior ( ) . add ( newItem ) ; * < / pre > * Objects of the following type ( s ) are allowed in the list * { @ link JAXBElement } { @ code < } { @ link AbstractRingPropertyType } { @ code > } * { @ link JAXBElement } { @ code < } { @ link AbstractRingPropertyType } { @ code > } */ public List < JAXBElement < AbstractRingPropertyType > > getInterior ( ) { } }
if ( interior == null ) { interior = new ArrayList < JAXBElement < AbstractRingPropertyType > > ( ) ; } return this . interior ;
public class LogicalUnitOfWork { /** * Simplified serialization . * @ param java . io . DataOutputStream to write the serialized Object into . */ public void writeObject ( java . io . DataOutputStream dataOutputStream ) throws ObjectManagerException { } }
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "writeObject" , "dataOutputStream=" + dataOutputStream ) ; try { dataOutputStream . writeByte ( SimpleSerialVersion ) ; dataOutputStream . writeLong ( identifier ) ; if ( XID == null ) { dataOutputStream . writeByte ( 0 ) ; } else { // Non null XID . dataOutputStream . writeByte ( XID . length ) ; dataOutputStream . write ( XID ) ; } // if ( XID = = null ) . } catch ( java . io . IOException exception ) { // No FFDC Code Needed . ObjectManager . ffdc . processException ( this , cclass , "writeObject" , exception , "1:177:1.9" ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "writeObject" ) ; throw new PermanentIOException ( this , exception ) ; } // catch ( java . io . IOException exception ) . if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "writeObject" ) ;
public class LogbackReconfigure { /** * 重新配置当前logback * @ param config logback的xml配置文件 */ public static void reconfigure ( InputStream config ) { } }
if ( CONTEXT == null ) { log . warn ( "当前日志上下文不是logback,不能使用该配置器重新配置" ) ; return ; } reconfigure ( config , CONTEXT ) ;
public class CommerceSubscriptionEntryPersistenceImpl { /** * Returns the commerce subscription entry where CPInstanceUuid = & # 63 ; and CProductId = & # 63 ; and commerceOrderItemId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param CPInstanceUuid the cp instance uuid * @ param CProductId the c product ID * @ param commerceOrderItemId the commerce order item ID * @ param retrieveFromCache whether to retrieve from the finder cache * @ return the matching commerce subscription entry , or < code > null < / code > if a matching commerce subscription entry could not be found */ @ Override public CommerceSubscriptionEntry fetchByC_C_C ( String CPInstanceUuid , long CProductId , long commerceOrderItemId , boolean retrieveFromCache ) { } }
Object [ ] finderArgs = new Object [ ] { CPInstanceUuid , CProductId , commerceOrderItemId } ; Object result = null ; if ( retrieveFromCache ) { result = finderCache . getResult ( FINDER_PATH_FETCH_BY_C_C_C , finderArgs , this ) ; } if ( result instanceof CommerceSubscriptionEntry ) { CommerceSubscriptionEntry commerceSubscriptionEntry = ( CommerceSubscriptionEntry ) result ; if ( ! Objects . equals ( CPInstanceUuid , commerceSubscriptionEntry . getCPInstanceUuid ( ) ) || ( CProductId != commerceSubscriptionEntry . getCProductId ( ) ) || ( commerceOrderItemId != commerceSubscriptionEntry . getCommerceOrderItemId ( ) ) ) { result = null ; } } if ( result == null ) { StringBundler query = new StringBundler ( 5 ) ; query . append ( _SQL_SELECT_COMMERCESUBSCRIPTIONENTRY_WHERE ) ; boolean bindCPInstanceUuid = false ; if ( CPInstanceUuid == null ) { query . append ( _FINDER_COLUMN_C_C_C_CPINSTANCEUUID_1 ) ; } else if ( CPInstanceUuid . equals ( "" ) ) { query . append ( _FINDER_COLUMN_C_C_C_CPINSTANCEUUID_3 ) ; } else { bindCPInstanceUuid = true ; query . append ( _FINDER_COLUMN_C_C_C_CPINSTANCEUUID_2 ) ; } query . append ( _FINDER_COLUMN_C_C_C_CPRODUCTID_2 ) ; query . append ( _FINDER_COLUMN_C_C_C_COMMERCEORDERITEMID_2 ) ; String sql = query . toString ( ) ; Session session = null ; try { session = openSession ( ) ; Query q = session . createQuery ( sql ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; if ( bindCPInstanceUuid ) { qPos . add ( CPInstanceUuid ) ; } qPos . add ( CProductId ) ; qPos . add ( commerceOrderItemId ) ; List < CommerceSubscriptionEntry > list = q . list ( ) ; if ( list . isEmpty ( ) ) { finderCache . putResult ( FINDER_PATH_FETCH_BY_C_C_C , finderArgs , list ) ; } else { CommerceSubscriptionEntry commerceSubscriptionEntry = list . get ( 0 ) ; result = commerceSubscriptionEntry ; cacheResult ( commerceSubscriptionEntry ) ; } } catch ( Exception e ) { finderCache . removeResult ( FINDER_PATH_FETCH_BY_C_C_C , finderArgs ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } if ( result instanceof List < ? > ) { return null ; } else { return ( CommerceSubscriptionEntry ) result ; }
public class CmsPreEditorAction { /** * Forwards to the editor and opens it after the action was performed . < p > * @ param dialog the dialog instance forwarding to the editor * @ param additionalParams eventual additional request parameters for the editor to use */ public static void sendForwardToEditor ( CmsDialog dialog , Map < String , String [ ] > additionalParams ) { } }
// create the Map of original request parameters Map < String , String [ ] > params = CmsRequestUtil . createParameterMap ( dialog . getParamOriginalParams ( ) ) ; // put the parameter indicating that the pre editor action was executed params . put ( PARAM_PREACTIONDONE , new String [ ] { CmsStringUtil . TRUE } ) ; if ( additionalParams != null ) { // put the additional parameters to the Map params . putAll ( additionalParams ) ; } try { // now forward to the editor frameset dialog . sendForward ( CmsWorkplace . VFS_PATH_EDITORS + "editor.jsp" , params ) ; } catch ( Exception e ) { // error forwarding , log the exception as error if ( LOG . isErrorEnabled ( ) ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } }
public class DateCaster { /** * parse a string to a Datetime Object * @ param locale * @ param str String representation of a locale Date * @ param tz * @ return DateTime Object * @ throws PageException */ public static DateTime toDateTime ( Locale locale , String str , TimeZone tz , boolean useCommomDateParserAsWell ) throws PageException { } }
DateTime dt = toDateTime ( locale , str , tz , null , useCommomDateParserAsWell ) ; if ( dt == null ) { String prefix = locale . getLanguage ( ) + "-" + locale . getCountry ( ) + "-" ; throw new ExpressionException ( "can't cast [" + str + "] to date value" , "to add custom formats for " + LocaleFactory . toString ( locale ) + ", create/extend on of the following files [" + prefix + "datetime.df (for date time formats), " + prefix + "date.df (for date formats) or " + prefix + "time.df (for time formats)] in the following directory [<context>/lucee/locales]." + "" ) ; // throw new ExpressionException ( " can ' t cast [ " + str + " ] to date value " ) ; } return dt ;
public class JoinNode { /** * Split a join tree into one or more sub - trees . Each sub - tree has the same join type * for all join nodes . The root of the child tree in the parent tree is replaced with a ' dummy ' node * which id is negated id of the child root node . * @ param tree - The join tree * @ return the list of sub - trees from the input tree */ public List < JoinNode > extractSubTrees ( ) { } }
List < JoinNode > subTrees = new ArrayList < > ( ) ; // Extract the first sub - tree starting at the root subTrees . add ( this ) ; List < JoinNode > leafNodes = new ArrayList < > ( ) ; extractSubTree ( leafNodes ) ; // Continue with the leafs for ( JoinNode leaf : leafNodes ) { subTrees . addAll ( leaf . extractSubTrees ( ) ) ; } return subTrees ;
public class PDBDomainProvider { /** * Gets a list of all domain representatives */ @ Override public SortedSet < String > getRepresentativeDomains ( ) { } }
String url = base + "representativeDomains?cluster=" + cutoff ; return requestRepresentativeDomains ( url ) ;
public class GroovyRuntimeImpl { /** * Creates a { @ link GroovyResourceLoader } from a { @ link ResourceLoader } . */ public GroovyResourceLoader createGroovyResourceLoader ( final ResourceLoader resourceLoader ) { } }
checkNotNull ( resourceLoader ) ; return new GroovyResourceLoader ( ) { @ Override public URL loadGroovySource ( final String name ) throws MalformedURLException { return resourceLoader . loadResource ( name ) ; } } ;
public class IsaTranslations { /** * FIXME Unhack invariant extraction for namedt ypes */ public String hackInv ( ARecordDeclIR type ) { } }
if ( type . getInvariant ( ) != null ) { AFuncDeclIR invFunc = ( AFuncDeclIR ) type . getInvariant ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "inv " ) ; sb . append ( invFunc . getFormalParams ( ) . get ( 0 ) . getPattern ( ) . toString ( ) ) ; sb . append ( " == " ) ; sb . append ( invFunc . getName ( ) ) ; sb . append ( "(" ) ; sb . append ( "&" ) ; sb . append ( invFunc . getFormalParams ( ) . get ( 0 ) . getPattern ( ) . toString ( ) ) ; sb . append ( ")" ) ; return sb . toString ( ) ; } return "" ;
public class Http2ServerUpgradeCodec { /** * Creates an HTTP2 - Settings header with the given payload . The payload buffer is released . */ private static ByteBuf createSettingsFrame ( ChannelHandlerContext ctx , ByteBuf payload ) { } }
ByteBuf frame = ctx . alloc ( ) . buffer ( FRAME_HEADER_LENGTH + payload . readableBytes ( ) ) ; writeFrameHeader ( frame , payload . readableBytes ( ) , SETTINGS , new Http2Flags ( ) , 0 ) ; frame . writeBytes ( payload ) ; payload . release ( ) ; return frame ;
public class CmsContextMenuWidget { /** * Adds new item as context menu root item . < p > * @ param rootItem the root item * @ param connector the connector */ public void addRootMenuItem ( ContextMenuItemState rootItem , CmsContextMenuConnector connector ) { } }
CmsContextMenuItemWidget itemWidget = createEmptyItemWidget ( rootItem . getId ( ) , rootItem . getCaption ( ) , rootItem . getDescription ( ) , connector ) ; itemWidget . setEnabled ( rootItem . isEnabled ( ) ) ; itemWidget . setSeparatorVisible ( rootItem . isSeparator ( ) ) ; setStyleNames ( itemWidget , rootItem . getStyles ( ) ) ; m_menuOverlay . addMenuItem ( itemWidget ) ; for ( ContextMenuItemState childState : rootItem . getChildren ( ) ) { createSubMenu ( itemWidget , childState , connector ) ; }
public class TypeMaker { /** * Return the formal type parameters of a class or method as an * angle - bracketed string . Each parameter is a type variable with * optional bounds . Class names are qualified if " full " is true . * Return " " if there are no type parameters or we ' re hiding generics . */ static String typeParametersString ( DocEnv env , Symbol sym , boolean full ) { } }
if ( env . legacyDoclet || sym . type . getTypeArguments ( ) . isEmpty ( ) ) { return "" ; } StringBuilder s = new StringBuilder ( ) ; for ( Type t : sym . type . getTypeArguments ( ) ) { s . append ( s . length ( ) == 0 ? "<" : ", " ) ; s . append ( TypeVariableImpl . typeVarToString ( env , ( TypeVar ) t , full ) ) ; } s . append ( ">" ) ; return s . toString ( ) ;
public class Configuration { /** * Get the value of the < code > name < / code > property as a < code > boolean < / code > . * If no such property is specified , or if the specified value is not a valid * < code > boolean < / code > , then < code > defaultValue < / code > is returned . * @ param name property name . * @ param defaultValue default value . * @ return property value as a < code > boolean < / code > , * or < code > defaultValue < / code > . */ public boolean getBoolean ( String name , boolean defaultValue ) { } }
String valueString = get ( name ) ; return "true" . equals ( valueString ) || ! "false" . equals ( valueString ) && defaultValue ;
public class LegacyHyperionClient { /** * { @ inheritDoc } */ @ Override public < T extends ApiObject > EntityResponse < T > query ( Request < T > request ) { } }
LegacyEntityResponse < T > legacyResponse = executeRequest ( request , objectMapper . getTypeFactory ( ) . constructParametrizedType ( LegacyEntityResponse . class , LegacyEntityResponse . class , request . getEntityType ( ) ) ) ; EntityResponse < T > response = new EntityResponse < T > ( ) ; response . setEntries ( legacyResponse . getEntries ( ) ) ; Page page = new Page ( ) ; response . setPage ( page ) ; page . setStart ( legacyResponse . getStart ( ) ) ; page . setResponseCount ( legacyResponse . getResponseCount ( ) ) ; page . setTotalCount ( legacyResponse . getTotalCount ( ) ) ; return response ;
public class CheckAccessControls { /** * Checks the given NAME node to ensure that access restrictions are obeyed . */ private void checkNameDeprecation ( NodeTraversal t , Node n ) { } }
if ( ! n . isName ( ) ) { return ; } if ( ! shouldEmitDeprecationWarning ( t , n ) ) { return ; } Var var = t . getScope ( ) . getVar ( n . getString ( ) ) ; JSDocInfo docInfo = var == null ? null : var . getJSDocInfo ( ) ; if ( docInfo != null && docInfo . isDeprecated ( ) ) { if ( docInfo . getDeprecationReason ( ) != null ) { compiler . report ( JSError . make ( n , DEPRECATED_NAME_REASON , n . getString ( ) , docInfo . getDeprecationReason ( ) ) ) ; } else { compiler . report ( JSError . make ( n , DEPRECATED_NAME , n . getString ( ) ) ) ; } }
public class EventManager { /** * Register an event handler . The registration looks at the interfaces * that the handler implements . An entry is created in the event handler * map for each event interface that is implemented . * Event interfaces are named in the form [ Category ] Event ( e . g . ProductEvent ) * @ param handler handler class */ public synchronized void registerHandler ( Object handler ) { } }
boolean validClass = false ; if ( handler == null ) { throw new IllegalArgumentException ( "Null handler class" ) ; } // Get the implemented interfaces . This gets only the // directly implemented interfaces Class < ? > clazz = handler . getClass ( ) ; Class < ? > interfaces [ ] = clazz . getInterfaces ( ) ; for ( int i = 0 ; i < interfaces . length ; i ++ ) { String iName = interfaces [ i ] . getSimpleName ( ) ; // verify the interface is for an event interface if ( iName . contains ( EVENT_INTERFACE_SUFFIX ) ) { validClass = true ; String eventCategory = iName . substring ( 0 , iName . indexOf ( EVENT_INTERFACE_SUFFIX ) ) . toLowerCase ( ) ; // see if a handler has been registered for the interface type if ( eventHandlers . get ( eventCategory ) == null ) { eventHandlers . put ( eventCategory , handler ) ; } else { throw new ApiException ( "Handler already registered for event type " + iName ) ; } } } if ( ! validClass ) { throw new ApiException ( "Class is invalid, it does not implement any event interfaces: " + clazz . getName ( ) ) ; }
public class Text { /** * Same as { @ link # getName ( String ) } but adding the possibility to pass paths that end with a * trailing ' / ' * @ see # getName ( String ) */ public static String getName ( String path , boolean ignoreTrailingSlash ) { } }
if ( ignoreTrailingSlash && path . endsWith ( "/" ) && path . length ( ) > 1 ) { path = path . substring ( 0 , path . length ( ) - 1 ) ; } return getName ( path ) ;
public class WDefinitionListExample { /** * Adds some items to a definition list . * @ param list the list to add the items to . */ private void addListItems ( final WDefinitionList list ) { } }
// Example of adding multiple data items at once . list . addTerm ( "Colours" , new WText ( "Red" ) , new WText ( "Green" ) , new WText ( "Blue" ) ) ; // Example of adding multiple data items using multiple calls . list . addTerm ( "Shapes" , new WText ( "Circle" ) ) ; list . addTerm ( "Shapes" , new WText ( "Square" ) , new WText ( "Triangle" ) ) ;
public class CDIRuntimeImpl { /** * If we are deploying a WAR file ( which gets wrapped into a synthetic EAR by WAS ) * we need to take the webapp classloader , because the surrounding EAR class loader * actually doesn ' t even contain a single class . . . */ public ClassLoader getRealAppClassLoader ( Application application ) { } }
try { List < CDIArchive > moduleArchives = new ArrayList < CDIArchive > ( application . getModuleArchives ( ) ) ; if ( moduleArchives . isEmpty ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , Util . identity ( this ) , "Application {0} has no modules so no thread context class loader will be set, this is expected for an OSGI app." , application ) ; } return null ; } if ( moduleArchives . size ( ) == 1 && ArchiveType . WEB_MODULE == moduleArchives . get ( 0 ) . getType ( ) ) { return moduleArchives . get ( 0 ) . getClassLoader ( ) ; } return application . getClassLoader ( ) ; } catch ( CDIException e ) { return null ; }
public class BeanMappingFactoryHelper { /** * カラム番号が重複しているかチェックする 。 また 、 番号が1以上かもチェックする 。 * @ param beanType Beanタイプ * @ param list カラム情報の一覧 * @ return チェック済みの番号 * @ throws SuperCsvInvalidAnnotationException { @ link CsvColumn } の定義が間違っている場合 */ public static TreeSet < Integer > validateDuplicatedColumnNumber ( final Class < ? > beanType , final List < ColumnMapping > list ) { } }
final TreeSet < Integer > checkedNumber = new TreeSet < > ( ) ; final TreeSet < Integer > duplicatedNumbers = new TreeSet < > ( ) ; for ( ColumnMapping columnMapping : list ) { if ( checkedNumber . contains ( columnMapping . getNumber ( ) ) ) { duplicatedNumbers . add ( columnMapping . getNumber ( ) ) ; } checkedNumber . add ( columnMapping . getNumber ( ) ) ; } if ( ! duplicatedNumbers . isEmpty ( ) ) { // 重複している 属性 numberが存在する場合 throw new SuperCsvInvalidAnnotationException ( MessageBuilder . create ( "anno.attr.duplicated" ) . var ( "property" , beanType . getName ( ) ) . varWithAnno ( "anno" , CsvColumn . class ) . var ( "attrName" , "number" ) . var ( "attrValues" , duplicatedNumbers ) . format ( ) ) ; } // カラム番号が1以上かチェックする final int minColumnNumber = checkedNumber . first ( ) ; if ( minColumnNumber <= 0 ) { throw new SuperCsvInvalidAnnotationException ( MessageBuilder . create ( "anno.attr.min" ) . var ( "property" , beanType . getName ( ) ) . varWithAnno ( "anno" , CsvColumn . class ) . var ( "attrName" , "number" ) . var ( "attrValue" , minColumnNumber ) . var ( "min" , 1 ) . format ( ) ) ; } return checkedNumber ;
public class PropertyAccessors { /** * < p > getAnnotation < / p > * @ param annotation a { @ link java . lang . String } object . * @ param < T > the type * @ return a { @ link com . google . gwt . thirdparty . guava . common . base . Optional } object . */ public < T extends Annotation > Optional < T > getAnnotation ( String annotation ) { } }
return CreatorUtils . getAnnotation ( annotation , accessors ) ;
public class MetadataClient { /** * Removes the workflow definition of a workflow from the conductor server . * It does not remove associated workflows . Use with caution . * @ param name Name of the workflow to be unregistered . * @ param version Version of the workflow definition to be unregistered . */ public void unregisterWorkflowDef ( String name , Integer version ) { } }
Preconditions . checkArgument ( StringUtils . isNotBlank ( name ) , "Workflow name cannot be blank" ) ; Preconditions . checkNotNull ( version , "Version cannot be null" ) ; delete ( "metadata/workflow/{name}/{version}" , name , version ) ;
public class TimeCategory { /** * Get the DST offset ( if any ) for the default locale and the given date . * @ param self a Date * @ return the DST offset as a Duration . */ public static Duration getDaylightSavingsOffset ( Date self ) { } }
TimeZone timeZone = getTimeZone ( self ) ; int millis = ( timeZone . useDaylightTime ( ) && timeZone . inDaylightTime ( self ) ) ? timeZone . getDSTSavings ( ) : 0 ; return new TimeDuration ( 0 , 0 , 0 , millis ) ;
public class AdaptiveGrid { /** * Returns a random hypercube that has more than zero solutions . * @ param randomGenerator the { @ link BoundedRandomGenerator } to use for selecting the hypercube * @ return The hypercube . */ public int randomOccupiedHypercube ( BoundedRandomGenerator < Integer > randomGenerator ) { } }
int rand = randomGenerator . getRandomValue ( 0 , occupied . length - 1 ) ; return occupied [ rand ] ;
public class SpaceAPI { /** * Returns the space and organization with the given full URL . * @ param url * The full URL of the space * @ return The space with organization */ public SpaceWithOrganization getSpaceByURL ( String url ) { } }
return getResourceFactory ( ) . getApiResource ( "/space/url" ) . queryParam ( "url" , url ) . get ( SpaceWithOrganization . class ) ;
public class QueryParametersLazyList { /** * Reads cached values from { @ link # generatedCacheMap } ( first ) and { @ link # resultSetCacheMap } ( second ) . * @ param index row index which should be read * @ return value from cache , or null if it is not present in cache . */ private QueryParameters readCachedValue ( int index ) { } }
QueryParameters result = null ; if ( generatedCacheMap . containsKey ( index ) == true ) { result = generatedCacheMap . get ( index ) ; } else if ( resultSetCacheMap . containsKey ( index ) == true ) { result = resultSetCacheMap . get ( index ) ; } return result ;
public class UnconditionalValueDerefAnalysis { /** * Return a duplicate of given dataflow fact . * @ param fact * a dataflow fact * @ return a duplicate of the input dataflow fact */ private UnconditionalValueDerefSet duplicateFact ( UnconditionalValueDerefSet fact ) { } }
UnconditionalValueDerefSet copyOfFact = createFact ( ) ; copy ( fact , copyOfFact ) ; fact = copyOfFact ; return fact ;
public class ShippingInclusionRuleUrl { /** * Get Resource Url for GetShippingInclusionRules * @ param profilecode The unique , user - defined code of the profile with which the shipping inclusion rule is associated . * @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This parameter should only be used to retrieve data . Attempting to update data using this parameter may cause data loss . * @ return String Resource Url */ public static MozuUrl getShippingInclusionRulesUrl ( String profilecode , String responseFields ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/shipping/admin/profiles/{profilecode}/rules/shippinginclusions?responseFields={responseFields}" ) ; formatter . formatUrl ( "profilecode" , profilecode ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class FlowControllerFactory { /** * Create a page flow of the given type . The page flow stack ( for nesting ) will be cleared or pushed , and the new * instance will be stored as the current page flow . * @ deprecated Use { @ link # createPageFlow ( RequestContext , String ) } instead . * @ param request the current HttpServletRequest . * @ param response the current HttpServletResponse . * @ param pageFlowClassName the type name of the desired page flow . * @ param servletContext the current ServletContext . * @ return the newly - created { @ link PageFlowController } , or < code > null < / code > if none was found . */ public static PageFlowController getPageFlow ( String pageFlowClassName , HttpServletRequest request , HttpServletResponse response , ServletContext servletContext ) { } }
try { return get ( servletContext ) . createPageFlow ( new RequestContext ( request , response ) , pageFlowClassName ) ; } catch ( ClassNotFoundException e ) { LOG . error ( "Requested page flow class " + pageFlowClassName + " not found." ) ; return null ; } catch ( InstantiationException e ) { LOG . error ( "Could not instantiate PageFlowController of type " + pageFlowClassName , e ) ; return null ; } catch ( IllegalAccessException e ) { LOG . error ( "Could not instantiate PageFlowController of type " + pageFlowClassName , e ) ; return null ; }
public class AbstractSessionManager { public Cookie getSessionCookie ( HttpSession session , boolean requestIsSecure ) { } }
if ( _handler . isUsingCookies ( ) ) { Cookie cookie = _handler . getSessionManager ( ) . getHttpOnly ( ) ? new HttpOnlyCookie ( SessionManager . __SessionCookie , session . getId ( ) ) : new Cookie ( SessionManager . __SessionCookie , session . getId ( ) ) ; String domain = _handler . getServletContext ( ) . getInitParameter ( SessionManager . __SessionDomain ) ; String maxAge = _handler . getServletContext ( ) . getInitParameter ( SessionManager . __MaxAge ) ; String path = _handler . getServletContext ( ) . getInitParameter ( SessionManager . __SessionPath ) ; if ( path == null ) path = getCrossContextSessionIDs ( ) ? "/" : _handler . getHttpContext ( ) . getContextPath ( ) ; if ( path == null || path . length ( ) == 0 ) path = "/" ; if ( domain != null ) cookie . setDomain ( domain ) ; if ( maxAge != null ) cookie . setMaxAge ( Integer . parseInt ( maxAge ) ) ; else cookie . setMaxAge ( - 1 ) ; cookie . setSecure ( requestIsSecure && getSecureCookies ( ) ) ; cookie . setPath ( path ) ; return cookie ; } return null ;
public class ApiOvhDedicatednasha { /** * Schedule a new snapshot type * REST : POST / dedicated / nasha / { serviceName } / partition / { partitionName } / snapshot * @ param snapshotType [ required ] Snapshot interval to add * @ param serviceName [ required ] The internal name of your storage * @ param partitionName [ required ] the given name of partition */ public OvhTask serviceName_partition_partitionName_snapshot_POST ( String serviceName , String partitionName , OvhSnapshotEnum snapshotType ) throws IOException { } }
String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot" ; StringBuilder sb = path ( qPath , serviceName , partitionName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "snapshotType" , snapshotType ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ;
public class AnalysisRunnerJobDelegate { /** * Starts row processing job flows . * @ param publishers * @ param analysisJobMetrics * @ param injectionManager */ private void scheduleRowProcessing ( RowProcessingPublishers publishers , LifeCycleHelper lifeCycleHelper , JobCompletionTaskListener jobCompletionTaskListener , AnalysisJobMetrics analysisJobMetrics ) { } }
logger . info ( "Created {} row processor publishers" , publishers . size ( ) ) ; final List < TaskRunnable > finalTasks = new ArrayList < TaskRunnable > ( 2 ) ; finalTasks . add ( new TaskRunnable ( null , jobCompletionTaskListener ) ) ; finalTasks . add ( new TaskRunnable ( null , new CloseReferenceDataTaskListener ( lifeCycleHelper ) ) ) ; final ForkTaskListener finalTaskListener = new ForkTaskListener ( "All row consumers finished" , _taskRunner , finalTasks ) ; final TaskListener rowProcessorPublishersDoneCompletionListener = new JoinTaskListener ( publishers . size ( ) , finalTaskListener ) ; final Collection < RowProcessingPublisher > rowProcessingPublishers = publishers . getRowProcessingPublishers ( ) ; for ( RowProcessingPublisher rowProcessingPublisher : rowProcessingPublishers ) { logger . debug ( "Scheduling row processing publisher: {}" , rowProcessingPublisher ) ; rowProcessingPublisher . runRowProcessing ( _resultQueue , rowProcessorPublishersDoneCompletionListener ) ; }
public class SyncClientHelpers { /** * Sends a single message synchronously , and blocks until the responses is received . * NOTE : the underlying transport may be non - blocking , in which case the blocking is simulated * by waits instead of using blocking network operations . * @ param request * @ return The response , stored in a ChannelBuffer * @ throws TException if an error occurs while serializing or sending the request or * while receiving or de - serializing the response * @ throws InterruptedException if the operation is interrupted before the response arrives */ public static ChannelBuffer sendSynchronousTwoWayMessage ( RequestChannel channel , final ChannelBuffer request ) throws TException , InterruptedException { } }
final ChannelBuffer [ ] responseHolder = new ChannelBuffer [ 1 ] ; final TException [ ] exceptionHolder = new TException [ 1 ] ; final CountDownLatch latch = new CountDownLatch ( 1 ) ; responseHolder [ 0 ] = null ; exceptionHolder [ 0 ] = null ; channel . sendAsynchronousRequest ( request , false , new RequestChannel . Listener ( ) { @ Override public void onRequestSent ( ) { } @ Override public void onResponseReceived ( ChannelBuffer response ) { responseHolder [ 0 ] = response ; latch . countDown ( ) ; } @ Override public void onChannelError ( TException e ) { exceptionHolder [ 0 ] = e ; latch . countDown ( ) ; } } ) ; latch . await ( ) ; if ( exceptionHolder [ 0 ] != null ) { throw exceptionHolder [ 0 ] ; } return responseHolder [ 0 ] ;
public class GatewayConfigParser { /** * Count the number of new lines * @ param ch * @ param start * @ param length */ private static int countNewLines ( char [ ] ch , int start , int length ) { } }
int newLineCount = 0 ; // quite reliable , since only Commodore 8 - bit machines , TRS - 80 , Apple II family , Mac OS up to version 9 and OS - 9 // use only ' \ r ' for ( int i = start ; i < length ; i ++ ) { newLineCount = newLineCount + ( ( ch [ i ] == '\n' ) ? 1 : 0 ) ; } return newLineCount ;
public class ModuleInitDataFactory { /** * Return the ManagedBean name to be used internally by the EJBContainer . * The internal ManagedBean name is the value on the annotation ( which * must be unique even compared to EJBs in the module ) or the class name * of the ManagedBean with a $ prefix . This is done for two reasons : * 1 - when a name is not specified , our internal derived name cannot * conflict with other EJB names that happen to be the same . * 2 - when a name is not specified , the managed bean is not supposed * to be bound into naming . . . the ' $ ' will tip off the binding code . * ' $ ' is used for consistency with JDK synthesized names . */ private String getManagedBeansInternalEJBName ( ClassInfo classInfo , AnnotationInfo managedBeanAnn ) { } }
String name = getStringValue ( managedBeanAnn , "value" ) ; if ( name == null ) { name = '$' + classInfo . getName ( ) ; } return name ;
public class CmsResourceTypeApp { /** * Is the given resource type id free ? * @ param id to be checked * @ return boolean */ public static boolean isResourceTypeIdFree ( int id ) { } }
try { OpenCms . getResourceManager ( ) . getResourceType ( id ) ; } catch ( CmsLoaderException e ) { return true ; } return false ;
public class PhotosInterface { /** * Request an image from the Flickr - servers . < br > * Callers must close the stream upon completion . * At { @ link Size } you can find constants for the available sizes . * @ param photo * A photo - object * @ param size * The Size * @ return InputStream The InputStream * @ throws FlickrException */ public InputStream getImageAsStream ( Photo photo , int size ) throws FlickrException { } }
try { String urlStr = "" ; if ( size == Size . SQUARE ) { urlStr = photo . getSmallSquareUrl ( ) ; } else if ( size == Size . THUMB ) { urlStr = photo . getThumbnailUrl ( ) ; } else if ( size == Size . SMALL ) { urlStr = photo . getSmallUrl ( ) ; } else if ( size == Size . MEDIUM ) { urlStr = photo . getMediumUrl ( ) ; } else if ( size == Size . LARGE ) { urlStr = photo . getLargeUrl ( ) ; } else if ( size == Size . LARGE_1600 ) { urlStr = photo . getLarge1600Url ( ) ; } else if ( size == Size . LARGE_2048 ) { urlStr = photo . getLarge2048Url ( ) ; } else if ( size == Size . ORIGINAL ) { urlStr = photo . getOriginalUrl ( ) ; } else if ( size == Size . SQUARE_LARGE ) { urlStr = photo . getSquareLargeUrl ( ) ; } else if ( size == Size . SMALL_320 ) { urlStr = photo . getSmall320Url ( ) ; } else if ( size == Size . MEDIUM_640 ) { urlStr = photo . getMedium640Url ( ) ; } else if ( size == Size . MEDIUM_800 ) { urlStr = photo . getMedium800Url ( ) ; } else if ( size == Size . VIDEO_ORIGINAL ) { urlStr = photo . getVideoOriginalUrl ( ) ; } else if ( size == Size . VIDEO_PLAYER ) { urlStr = photo . getVideoPlayerUrl ( ) ; } else if ( size == Size . SITE_MP4 ) { urlStr = photo . getSiteMP4Url ( ) ; } else if ( size == Size . MOBILE_MP4 ) { urlStr = photo . getMobileMp4Url ( ) ; } else if ( size == Size . HD_MP4 ) { urlStr = photo . getHdMp4Url ( ) ; } else { throw new FlickrException ( "0" , "Unknown Photo-size" ) ; } URL url = new URL ( urlStr ) ; HttpsURLConnection conn = ( HttpsURLConnection ) url . openConnection ( ) ; if ( transport instanceof REST ) { if ( ( ( REST ) transport ) . isProxyAuth ( ) ) { conn . setRequestProperty ( "Proxy-Authorization" , "Basic " + ( ( REST ) transport ) . getProxyCredentials ( ) ) ; } } conn . connect ( ) ; return conn . getInputStream ( ) ; } catch ( IOException e ) { throw new FlickrException ( e . getMessage ( ) , e . getCause ( ) ) ; }
public class AbstractTreebankLanguagePack { /** * Returns the syntactic category and ' function ' of a String . * This normally involves truncating numerical coindexation * showing coreference , etc . By ' function ' , this means * keeping , say , Penn Treebank functional tags or ICE phrasal functions , * perhaps returning them as < code > category - function < / code > . * This implementation strips numeric tags after label introducing * characters ( assuming that non - numeric things are functional tags ) . * @ param category The whole String name of the label * @ return A String giving the category and function */ public String categoryAndFunction ( String category ) { } }
if ( category == null ) { return null ; } String catFunc = category ; int i = lastIndexOfNumericTag ( catFunc ) ; while ( i >= 0 ) { catFunc = catFunc . substring ( 0 , i ) ; i = lastIndexOfNumericTag ( catFunc ) ; } return catFunc ;
public class JMPath { /** * Apply sub file paths and get applied list list . * @ param < R > the type parameter * @ param startDirectoryPath the start directory path * @ param maxDepth the max depth * @ param filter the filter * @ param function the function * @ param isParallel the is parallel * @ return the list */ public static < R > List < R > applySubFilePathsAndGetAppliedList ( Path startDirectoryPath , int maxDepth , Predicate < Path > filter , Function < Path , R > function , boolean isParallel ) { } }
return applyPathListAndGetResultList ( isParallel , getSubFilePathList ( startDirectoryPath , maxDepth , filter ) , function ) ;
public class ConcurrentTaskScheduler { /** * { @ inheritDoc } * @ see org . audit4j . core . schedule . TaskScheduler # scheduleAtFixedRate ( java . lang . Runnable , * long ) */ @ Override public ScheduledFuture < ? > scheduleAtFixedRate ( Runnable task , long period ) { } }
try { return this . scheduledExecutor . scheduleAtFixedRate ( decorateTask ( task , true ) , 0 , period , TimeUnit . MILLISECONDS ) ; } catch ( RejectedExecutionException ex ) { throw new TaskRejectedException ( "Executor [" + this . scheduledExecutor + "] did not accept task: " + task , ex ) ; }
public class ReservoirItemsSketch { /** * Returns a sketch instance of this class from the given srcMem , * which must be a Memory representation of this sketch class . * @ param < T > The type of item this sketch contains * @ param srcMem a Memory representation of a sketch of this class . * < a href = " { @ docRoot } / resources / dictionary . html # mem " > See Memory < / a > * @ param serDe An instance of ArrayOfItemsSerDe * @ return a sketch instance of this class */ public static < T > ReservoirItemsSketch < T > heapify ( final Memory srcMem , final ArrayOfItemsSerDe < T > serDe ) { } }
Family . RESERVOIR . checkFamilyID ( srcMem . getByte ( FAMILY_BYTE ) ) ; final int numPreLongs = extractPreLongs ( srcMem ) ; final ResizeFactor rf = ResizeFactor . getRF ( extractResizeFactor ( srcMem ) ) ; final int serVer = extractSerVer ( srcMem ) ; final boolean isEmpty = ( extractFlags ( srcMem ) & EMPTY_FLAG_MASK ) != 0 ; final long itemsSeen = ( isEmpty ? 0 : extractN ( srcMem ) ) ; int k = extractK ( srcMem ) ; // Check values final boolean preLongsEqMin = ( numPreLongs == Family . RESERVOIR . getMinPreLongs ( ) ) ; final boolean preLongsEqMax = ( numPreLongs == Family . RESERVOIR . getMaxPreLongs ( ) ) ; if ( ! preLongsEqMin & ! preLongsEqMax ) { throw new SketchesArgumentException ( "Possible corruption: Non-empty sketch with only " + Family . RESERVOIR . getMinPreLongs ( ) + " preLong(s)" ) ; } if ( serVer != SER_VER ) { if ( serVer == 1 ) { final short encK = extractEncodedReservoirSize ( srcMem ) ; k = ReservoirSize . decodeValue ( encK ) ; } else { throw new SketchesArgumentException ( "Possible Corruption: Ser Ver must be " + SER_VER + ": " + serVer ) ; } } if ( isEmpty ) { return new ReservoirItemsSketch < > ( k , rf ) ; } final int preLongBytes = numPreLongs << 3 ; int allocatedItems = k ; // default to full reservoir if ( itemsSeen < k ) { // under - full so determine size to allocate , using ceilingLog2 ( totalSeen ) as minimum // casts to int are safe since under - full final int ceilingLgK = Util . toLog2 ( Util . ceilingPowerOf2 ( k ) , "heapify" ) ; final int minLgSize = Util . toLog2 ( Util . ceilingPowerOf2 ( ( int ) itemsSeen ) , "heapify" ) ; final int initialLgSize = SamplingUtil . startingSubMultiple ( ceilingLgK , rf . lg ( ) , Math . max ( minLgSize , MIN_LG_ARR_ITEMS ) ) ; allocatedItems = SamplingUtil . getAdjustedSize ( k , 1 << initialLgSize ) ; } final int itemsToRead = ( int ) Math . min ( k , itemsSeen ) ; final T [ ] data = serDe . deserializeFromMemory ( srcMem . region ( preLongBytes , srcMem . getCapacity ( ) - preLongBytes ) , itemsToRead ) ; final ArrayList < T > dataList = new ArrayList < > ( Arrays . asList ( data ) ) ; final ReservoirItemsSketch < T > ris = new ReservoirItemsSketch < > ( dataList , itemsSeen , rf , k ) ; ris . data_ . ensureCapacity ( allocatedItems ) ; ris . currItemsAlloc_ = allocatedItems ; return ris ;
public class FilesystemUtil { /** * Set the 755 permissions on the given script . * @ param config - the instance config * @ param scriptName - the name of the script ( located in the bin directory ) to make executable */ public static void setScriptPermission ( InstanceConfiguration config , String scriptName ) { } }
if ( SystemUtils . IS_OS_WINDOWS ) { // we do not have file permissions on windows return ; } if ( VersionUtil . isEqualOrGreater_7_0_0 ( config . getClusterConfiguration ( ) . getVersion ( ) ) ) { // ES7 and above is packaged as a . tar . gz , and as such the permissions are preserved return ; } CommandLine command = new CommandLine ( "chmod" ) . addArgument ( "755" ) . addArgument ( String . format ( "bin/%s" , scriptName ) ) ; ProcessUtil . executeScript ( config , command ) ; command = new CommandLine ( "sed" ) . addArguments ( "-i''" ) . addArgument ( "-e" ) . addArgument ( "1s:.*:#!/usr/bin/env bash:" , false ) . addArgument ( String . format ( "bin/%s" , scriptName ) ) ; ProcessUtil . executeScript ( config , command ) ;
public class Email { /** * Adds an attachment to the email message and generates the necessary { @ link DataSource } with the given byte data . * Then delegates to { @ link # addAttachment ( String , DataSource ) } . At this point the datasource is actually a * { @ link ByteArrayDataSource } . * @ param name The name of the extension ( eg . filename including extension ) . * @ param data The byte data of the attachment . * @ param mimetype The content type of the given data ( eg . " plain / text " , " image / gif " or " application / pdf " ) . * @ see ByteArrayDataSource * @ see # addAttachment ( String , DataSource ) */ public void addAttachment ( final String name , final byte [ ] data , final String mimetype ) { } }
final ByteArrayDataSource dataSource = new ByteArrayDataSource ( data , mimetype ) ; dataSource . setName ( name ) ; addAttachment ( name , dataSource ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcWindowLiningProperties ( ) { } }
if ( ifcWindowLiningPropertiesEClass == null ) { ifcWindowLiningPropertiesEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 646 ) ; } return ifcWindowLiningPropertiesEClass ;
public class BmrClient { /** * Modify the instance groups of the target cluster . * @ param request The request containing the ID of BMR cluster and the instance groups to be modified . */ public void modifyInstanceGroups ( ModifyInstanceGroupsRequest request ) { } }
checkNotNull ( request , "request should not be null." ) ; checkStringNotEmpty ( request . getClusterId ( ) , "The clusterId should not be null or empty string." ) ; checkNotNull ( request . getInstanceGroups ( ) , "The instanceGroups should not be null." ) ; StringWriter writer = new StringWriter ( ) ; try { JsonGenerator jsonGenerator = JsonUtils . jsonGeneratorOf ( writer ) ; jsonGenerator . writeStartObject ( ) ; jsonGenerator . writeArrayFieldStart ( "instanceGroups" ) ; for ( ModifyInstanceGroupConfig instanceGroup : request . getInstanceGroups ( ) ) { checkStringNotEmpty ( instanceGroup . getId ( ) , "The instanceGroupId should not be null or empty string." ) ; jsonGenerator . writeStartObject ( ) ; jsonGenerator . writeStringField ( "id" , instanceGroup . getId ( ) ) ; jsonGenerator . writeNumberField ( "instanceCount" , instanceGroup . getInstanceCount ( ) ) ; jsonGenerator . writeEndObject ( ) ; } jsonGenerator . writeEndArray ( ) ; jsonGenerator . writeEndObject ( ) ; jsonGenerator . close ( ) ; } catch ( IOException e ) { throw new BceClientException ( "Fail to generate json" , e ) ; } byte [ ] json = null ; try { json = writer . toString ( ) . getBytes ( DEFAULT_ENCODING ) ; } catch ( UnsupportedEncodingException e ) { throw new BceClientException ( "Fail to get UTF-8 bytes" , e ) ; } InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . PUT , CLUSTER , request . getClusterId ( ) , INSTANCE_GROUP ) ; internalRequest . addHeader ( Headers . CONTENT_LENGTH , String . valueOf ( json . length ) ) ; internalRequest . addHeader ( Headers . CONTENT_TYPE , "application/json" ) ; internalRequest . setContent ( RestartableInputStream . wrap ( json ) ) ; if ( request . getClientToken ( ) != null ) { internalRequest . addParameter ( "clientToken" , request . getClientToken ( ) ) ; } this . invokeHttpClient ( internalRequest , AbstractBceResponse . class ) ;
public class AdBrokerBenchmark { /** * Print stats for the last displayinterval seconds to the console . */ public synchronized void printStatistics ( ) { } }
ClientStats stats = m_periodicStatsContext . fetchAndResetBaseline ( ) . getStats ( ) ; long time = Math . round ( ( stats . getEndTimestamp ( ) - m_benchmarkStartTS ) / 1000.0 ) ; System . out . printf ( "%02d:%02d:%02d " , time / 3600 , ( time / 60 ) % 60 , time % 60 ) ; System . out . printf ( "Throughput %d/s, " , stats . getTxnThroughput ( ) ) ; System . out . printf ( "Aborts/Failures %d/%d" , stats . getInvocationAborts ( ) , stats . getInvocationErrors ( ) ) ; if ( m_config . latencyreport ) { System . out . printf ( ", Avg/95%% Latency %.2f/%.2fms" , stats . getAverageLatency ( ) , stats . kPercentileLatencyAsDouble ( 0.95 ) ) ; } System . out . printf ( "\n" ) ; VoltTable [ ] tables = null ; try { tables = m_client . callProcedure ( "GetStats" , m_config . displayinterval ) . getResults ( ) ; } catch ( IOException | ProcCallException e ) { e . printStackTrace ( ) ; System . exit ( 1 ) ; } VoltTable hits = tables [ 0 ] ; hits . advanceRow ( ) ; assert ( hits . getLong ( 0 ) == 0 ) ; long unmetRequests = hits . getLong ( 1 ) ; hits . advanceRow ( ) ; assert ( hits . getLong ( 0 ) == 1 ) ; long metRequests = hits . getLong ( 1 ) ; long totalRequests = unmetRequests + metRequests ; double percentMet = ( ( ( double ) metRequests ) / totalRequests ) * 100.0 ; System . out . printf ( "Total number of ad requests: %d, %3.2f%% resulted in an ad being served\n" , totalRequests , percentMet ) ; VoltTable recentAdvertisers = tables [ 1 ] ; System . out . println ( "\nTop 5 advertisers of the last " + m_config . displayinterval + " seconds, " + "by sorted on the sum of dollar amounts of bids won:" ) ; System . out . println ( "Advertiser Revenue Count" ) ; System . out . println ( "---------- ------- -----" ) ; while ( recentAdvertisers . advanceRow ( ) ) { System . out . printf ( "%-40s %9.2f %d\n" , recentAdvertisers . getString ( 0 ) , recentAdvertisers . getDouble ( 1 ) , recentAdvertisers . getLong ( 2 ) ) ; } System . out . println ( ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public ColorFidelityRepCoEx createColorFidelityRepCoExFromString ( EDataType eDataType , String initialValue ) { } }
ColorFidelityRepCoEx result = ColorFidelityRepCoEx . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class PipelineSqlMapDao { /** * This is only used in test for legacy purpose . Please call pipelineService . save ( aPipeline ) instead . * This is particularly bad as it does NOT do the same as what the system does in the real code . * In particular it does not save the JobInstances correctly . We need to remove this method and make * sure that tests are using the same behaviour as the real code . * @ see { Mingle # 2867} * @ deprecated */ public Pipeline saveWithStages ( Pipeline pipeline ) { } }
updateCounter ( pipeline ) ; Pipeline savedPipeline = save ( pipeline ) ; for ( Stage stage : pipeline . getStages ( ) ) { stageDao . saveWithJobs ( savedPipeline , stage ) ; } return savedPipeline ;
public class InternalPureXbaseLexer { /** * $ ANTLR start " T _ _ 68" */ public final void mT__68 ( ) throws RecognitionException { } }
try { int _type = T__68 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalPureXbase . g : 66:7 : ( ' do ' ) // InternalPureXbase . g : 66:9 : ' do ' { match ( "do" ) ; } state . type = _type ; state . channel = _channel ; } finally { }
public class SimpleRepository { /** * Executes the supplied read - write operation . In the event of a transient failure , the * repository will attempt to reestablish the database connection and try the operation again . * @ return whatever value is returned by the invoked operation . */ protected < V > V executeUpdate ( Operation < V > op ) throws PersistenceException { } }
return execute ( op , true , false ) ;
public class MatrixIO { /** * Returns an iterator over the matrix entries in the data file . For sparse * formats that specify only non - zero , no zero valued entries will be * returened . Conversely , for dense matrix formats , all of the entries , * including zero entries will be returned . * @ param matrixFile the file containing matrix data in the specified format * @ param fileFormat the format of the matrix file * @ return an interator over the entries in the matrix file */ public static Iterator < MatrixEntry > getMatrixFileIterator ( File matrixFile , Format fileFormat ) throws IOException { } }
switch ( fileFormat ) { case DENSE_TEXT : return new DenseTextFileIterator ( matrixFile ) ; case SVDLIBC_SPARSE_BINARY : return new SvdlibcSparseBinaryFileIterator ( matrixFile ) ; case SVDLIBC_SPARSE_TEXT : return new SvdlibcSparseTextFileIterator ( matrixFile ) ; case SVDLIBC_DENSE_BINARY : return new SvdlibcDenseBinaryFileIterator ( matrixFile ) ; case CLUTO_SPARSE : return new ClutoSparseFileIterator ( matrixFile ) ; case CLUTO_DENSE : // Cluto dense and svdlibc ' s dense text formats are equivalent . case SVDLIBC_DENSE_TEXT : return new SvdlibcDenseTextFileIterator ( matrixFile ) ; case MATLAB_SPARSE : return new MatlabSparseFileIterator ( matrixFile ) ; } throw new Error ( "Iterating over matrices of " + fileFormat + " format is not " + "currently supported. Email " + "s-space-research-dev@googlegroups.com to request its" + "inclusion and it will be quickly added" ) ;
public class ThreadContext { /** * 设置做分表分库的切分的key * @ param shardKey 下午8:37:51 created by Darwin ( Tianxin ) */ public final static < K extends Serializable , U extends BaseObject < K > > void putSessionVisitor ( U sessionVisitor ) { } }
putContext ( VISITOR_KEY , sessionVisitor ) ;
public class GVRPeriodicEngine { /** * Run a task periodically , for a set number of times . * @ param task * Task to run . * @ param delay * The first execution will happen in { @ code delay } seconds . * @ param period * Subsequent executions will happen every { @ code period } seconds * after the first . * @ param repetitions * Repeat count * @ return { @ code null } if { @ code repetitions < 1 } ; otherwise , an interface * that lets you query the status ; cancel ; or reschedule the event . */ public PeriodicEvent runEvery ( Runnable task , float delay , float period , int repetitions ) { } }
if ( repetitions < 1 ) { return null ; } else if ( repetitions == 1 ) { // Better to burn a handful of CPU cycles than to churn memory by // creating a new callback return runAfter ( task , delay ) ; } else { return runEvery ( task , delay , period , new RunFor ( repetitions ) ) ; }
public class DebugUtils { /** * Prettifies the { @ link Object # toString ( ) } output generated by IntelliJ . * @ param object The object to print * @ param indentation The number of blanks on a new line * @ return The toString representation with line breaks and indentations */ public static String prettyToString ( final Object object , final int indentation ) { } }
final String string = object . toString ( ) ; // position of new lines and number of intending spaces final Map < Integer , Integer > newLines = new TreeMap < > ( ) ; int currentLevel = 0 ; boolean inStringLiteral = false ; for ( int i = 0 ; i < string . length ( ) ; i ++ ) { final char currentChar = string . charAt ( i ) ; if ( currentChar == ',' && ! inStringLiteral ) newLines . put ( i , currentLevel ) ; if ( currentChar == '{' && ! inStringLiteral ) currentLevel ++ ; if ( currentChar == '}' && ! inStringLiteral ) currentLevel -- ; // known flaw - > will fail for string containing a ' character if ( currentChar == '\'' ) inStringLiteral = ! inStringLiteral ; } final StringBuilder builder = new StringBuilder ( string ) ; int modifiedLength = 0 ; for ( final Map . Entry < Integer , Integer > entry : newLines . entrySet ( ) ) { final String intend = IntStream . range ( 0 , entry . getValue ( ) * indentation ) . mapToObj ( c -> INDENTATION_CHARACTER ) . collect ( ( ) -> new StringBuilder ( "\n" ) , StringBuilder :: append , StringBuilder :: append ) . toString ( ) ; builder . insert ( modifiedLength + entry . getKey ( ) + 1 , intend ) ; modifiedLength += intend . length ( ) ; } return builder . toString ( ) ;
public class AbstractBrowsableResourceFactory { /** * This method { @ link # createBrowsableResource ( String ) creates } the actual raw { @ link BrowsableResource } . * @ param resourceUri is the parsed and qualified { @ link ResourceUriImpl } . * @ return the created { @ link BrowsableResource } . * @ throws ResourceUriUndefinedException if the given { @ code resourceUri } is undefined , e . g . the * { @ link ResourceUriImpl # getSchemePrefix ( ) scheme - prefix } is NOT supported by this factory . */ protected BrowsableResource createBrowsableResource ( ResourceUri resourceUri ) throws ResourceUriUndefinedException { } }
DataResourceProvider < ? extends DataResource > provider = getProvider ( resourceUri ) ; if ( ! BrowsableResource . class . isAssignableFrom ( provider . getResourceType ( ) ) ) { Exception cause = new IllegalArgumentException ( provider . getResourceType ( ) . getSimpleName ( ) ) ; throw new ResourceUriUndefinedException ( cause , resourceUri . getUri ( ) ) ; } return ( BrowsableResource ) provider . createResource ( resourceUri ) ;
public class Utils { /** * Obtains the data to store in file for a double number * @ param num number to convert * @ param characterSetName charset to use ( ignored ) * @ param fieldLength field size * @ param sizeDecimalPart sizeDecimalPart * @ return byte [ ] to store in the file * @ throws UnsupportedEncodingException since no charset is used , no excpetion is thrown * @ deprecated Use { @ link DBFUtils # doubleFormating ( Number , Charset , int , int ) } */ @ Deprecated public static byte [ ] doubleFormating ( Number num , String characterSetName , int fieldLength , int sizeDecimalPart ) throws UnsupportedEncodingException { } }
return doubleFormating ( num . doubleValue ( ) , characterSetName , fieldLength , sizeDecimalPart ) ;
public class NonBlockingBufferedReader { /** * Reads characters into a portion of an array . * This method implements the general contract of the corresponding * < code > { @ link Reader # read ( char [ ] , int , int ) read } < / code > method of the * < code > { @ link Reader } < / code > class . As an additional convenience , it * attempts to read as many characters as possible by repeatedly invoking the * < code > read < / code > method of the underlying stream . This iterated * < code > read < / code > continues until one of the following conditions becomes * true : * < ul > * < li > The specified number of characters have been read , * < li > The < code > read < / code > method of the underlying stream returns * < code > - 1 < / code > , indicating end - of - file , or * < li > The < code > ready < / code > method of the underlying stream returns * < code > false < / code > , indicating that further input requests would block . * < / ul > * If the first < code > read < / code > on the underlying stream returns * < code > - 1 < / code > to indicate end - of - file then this method returns * < code > - 1 < / code > . Otherwise this method returns the number of characters * actually read . * Subclasses of this class are encouraged , but not required , to attempt to * read as many characters as possible in the same fashion . * Ordinarily this method takes characters from this stream ' s character * buffer , filling it from the underlying stream as necessary . If , however , * the buffer is empty , the mark is not valid , and the requested length is at * least as large as the buffer , then this method will read characters * directly from the underlying stream into the given array . Thus redundant * < code > NonBlockingBufferedReader < / code > s will not copy data unnecessarily . * @ param cbuf * Destination buffer * @ param nOfs * Offset at which to start storing characters * @ param nLen * Maximum number of characters to read * @ return The number of characters read , or - 1 if the end of the stream has * been reached * @ exception IOException * If an I / O error occurs */ @ Override public int read ( final char [ ] cbuf , final int nOfs , final int nLen ) throws IOException { } }
_ensureOpen ( ) ; ValueEnforcer . isArrayOfsLen ( cbuf , nOfs , nLen ) ; if ( nLen == 0 ) return 0 ; // Main read int n = _internalRead ( cbuf , nOfs , nLen ) ; if ( n <= 0 ) return n ; while ( n < nLen && m_aReader . ready ( ) ) { final int n1 = _internalRead ( cbuf , nOfs + n , nLen - n ) ; if ( n1 <= 0 ) break ; n += n1 ; } return n ;
public class ActionStatusBeanQuery { /** * Creates a list of { @ link ProxyActionStatus } for presentation layer from * page of { @ link ActionStatus } . * @ param actionBeans * page of { @ link ActionStatus } * @ return list of { @ link ProxyActionStatus } */ private static List < ProxyActionStatus > createProxyActionStates ( final Page < ActionStatus > actionStatusBeans ) { } }
final List < ProxyActionStatus > proxyActionStates = new ArrayList < > ( ) ; for ( final ActionStatus actionStatus : actionStatusBeans ) { final ProxyActionStatus proxyAS = new ProxyActionStatus ( ) ; proxyAS . setCreatedAt ( actionStatus . getCreatedAt ( ) ) ; proxyAS . setStatus ( actionStatus . getStatus ( ) ) ; proxyAS . setId ( actionStatus . getId ( ) ) ; proxyActionStates . add ( proxyAS ) ; } return proxyActionStates ;
public class ResolvedTypes { /** * / * @ Nullable */ @ Override public LightweightTypeReference getReturnType ( XExpression expression , boolean onlyExplicitReturns ) { } }
LightweightTypeReference result = doGetReturnType ( expression , onlyExplicitReturns ) ; return toOwnedReference ( result ) ;
public class ChatScreen { /** * Process this action . * @ param strAction The action to process . * By default , this method handles RESET , SUBMIT , and DELETE . */ public boolean doAction ( String strAction , int iOptions ) { } }
if ( SEND . equalsIgnoreCase ( strAction ) ) { String strMessage = m_tfTextIn . getText ( ) ; m_tfTextIn . setText ( Constants . BLANK ) ; Map < String , Object > properties = new Hashtable < String , Object > ( ) ; properties . put ( MESSAGE_PARAM , strMessage ) ; BaseMessage message = new MapMessage ( new BaseMessageHeader ( CHAT_TYPE , MessageConstants . INTRANET_QUEUE , null , null ) , properties ) ; this . getBaseApplet ( ) . getApplication ( ) . getMessageManager ( ) . sendMessage ( message ) ; return true ; } return super . doAction ( strAction , iOptions ) ;
public class HtmlTool { /** * Replaces elements in HTML . * @ param content * HTML content to modify * @ param selector * CSS selector for elements to replace * @ param replacement * HTML replacement ( must parse to a single element ) * @ return HTML content with replaced elements . If no elements are found , the original content is * returned . * @ since 1.0 */ public String replace ( String content , String selector , String replacement ) { } }
return replaceAll ( content , Collections . singletonMap ( selector , replacement ) ) ;
public class RxApollo { /** * Converts an { @ link ApolloCall } to a Observable with backpressure mode { @ link rx . Emitter . BackpressureMode # BUFFER } . * The number of emissions this Observable will have is based on the { @ link ResponseFetcher } used with the call . * @ param call the ApolloCall to convert * @ param < T > the value type * @ return the converted Observable */ @ NotNull public static < T > Observable < Response < T > > from ( @ NotNull final ApolloCall < T > call ) { } }
return from ( call , Emitter . BackpressureMode . BUFFER ) ;
public class Symbol { /** * < p > Sets the type of input data . This setting influences what pre - processing is done on * data before encoding in the symbol . For example : for < code > GS1 < / code > mode the AI * data will be used to calculate the position of ' FNC1 ' characters . * < p > Valid values are : * < ul > * < li > < code > UTF8 < / code > ( default ) Unicode encoding * < li > < code > LATIN1 < / code > ISO 8859-1 ( Latin - 1 ) encoding * < li > < code > BINARY < / code > Byte encoding mode * < li > < code > GS1 < / code > Application Identifier and data pairs in " [ AI ] DATA " format * < li > < code > HIBC < / code > Health Industry Bar Code number ( without check digit ) * < li > < code > ECI < / code > Extended Channel Interpretations * < / ul > * @ param dataType the type of input data */ public void setDataType ( DataType dataType ) { } }
if ( dataType == DataType . GS1 && ! gs1Supported ( ) ) { throw new IllegalArgumentException ( "This symbology type does not support GS1 data." ) ; } inputDataType = dataType ;
public class CmsSolrQuery { /** * Adds the given fields / orders to the existing sort fields . < p > * @ param sortFields the sortFields to set */ public void addSortFieldOrders ( Map < String , ORDER > sortFields ) { } }
if ( ( sortFields != null ) && ! sortFields . isEmpty ( ) ) { // add the sort fields to the query for ( Map . Entry < String , ORDER > entry : sortFields . entrySet ( ) ) { addSort ( entry . getKey ( ) , entry . getValue ( ) ) ; } }
public class Role { /** * Method to initialize the Cache of this CacheObjectInterface . */ public static void initialize ( ) { } }
if ( InfinispanCache . get ( ) . exists ( Role . UUIDCACHE ) ) { InfinispanCache . get ( ) . < UUID , Role > getCache ( Role . UUIDCACHE ) . clear ( ) ; } else { InfinispanCache . get ( ) . < UUID , Role > getCache ( Role . UUIDCACHE ) . addListener ( new CacheLogListener ( Role . LOG ) ) ; } if ( InfinispanCache . get ( ) . exists ( Role . IDCACHE ) ) { InfinispanCache . get ( ) . < Long , Role > getCache ( Role . IDCACHE ) . clear ( ) ; } else { InfinispanCache . get ( ) . < Long , Role > getCache ( Role . IDCACHE ) . addListener ( new CacheLogListener ( Role . LOG ) ) ; } if ( InfinispanCache . get ( ) . exists ( Role . NAMECACHE ) ) { InfinispanCache . get ( ) . < String , Role > getCache ( Role . NAMECACHE ) . clear ( ) ; } else { InfinispanCache . get ( ) . < String , Role > getCache ( Role . NAMECACHE ) . addListener ( new CacheLogListener ( Role . LOG ) ) ; }
public class GVRFrustumPicker { /** * Set the view frustum to pick against from the given projection matrix . * If the projection matrix is null , the picker will revert to picking * objects that are visible from the viewpoint of the scene ' s current camera . * If a matrix is given , the picker will pick objects that are visible * from the viewpoint of it ' s owner the given projection matrix . * @ param projMatrix 4x4 projection matrix or null * @ see GVRScene # setPickVisible ( boolean ) */ public void setFrustum ( Matrix4f projMatrix ) { } }
if ( projMatrix != null ) { if ( mProjMatrix == null ) { mProjMatrix = new float [ 16 ] ; } mProjMatrix = projMatrix . get ( mProjMatrix , 0 ) ; mScene . setPickVisible ( false ) ; if ( mCuller != null ) { mCuller . set ( projMatrix ) ; } else { mCuller = new FrustumIntersection ( projMatrix ) ; } } mProjection = projMatrix ;
public class SSLEngineImpl { /** * We ' ve got a fatal error here , so start the shutdown process . * Because of the way the code was written , we have some code * calling fatal directly when the " description " is known * and some throwing Exceptions which are then caught by higher * levels which then call here . This code needs to determine * if one of the lower levels has already started the process . * We won ' t worry about Error ' s , if we have one of those , * we ' re in worse trouble . Note : the networking code doesn ' t * deal with Errors either . */ synchronized void fatal ( byte description , String diagnostic , Throwable cause ) throws SSLException { } }
/* * If we have no further information , make a general - purpose * message for folks to see . We generally have one or the other . */ if ( diagnostic == null ) { diagnostic = "General SSLEngine problem" ; } if ( cause == null ) { cause = Alerts . getSSLException ( description , cause , diagnostic ) ; } /* * If we ' ve already shutdown because of an error , * there is nothing we can do except rethrow the exception . * Most exceptions seen here will be SSLExceptions . * We may find the occasional Exception which hasn ' t been * converted to a SSLException , so we ' ll do it here . */ if ( closeReason != null ) { if ( ( debug != null ) && Debug . isOn ( "ssl" ) ) { System . out . println ( threadName ( ) + ", fatal: engine already closed. Rethrowing " + cause . toString ( ) ) ; } if ( cause instanceof RuntimeException ) { throw ( RuntimeException ) cause ; } else if ( cause instanceof SSLException ) { throw ( SSLException ) cause ; } else if ( cause instanceof Exception ) { SSLException ssle = new SSLException ( "fatal SSLEngine condition" ) ; ssle . initCause ( cause ) ; throw ssle ; } } if ( ( debug != null ) && Debug . isOn ( "ssl" ) ) { System . out . println ( threadName ( ) + ", fatal error: " + description + ": " + diagnostic + "\n" + cause . toString ( ) ) ; } /* * Ok , this engine ' s going down . */ int oldState = connectionState ; connectionState = cs_ERROR ; inboundDone = true ; sess . invalidate ( ) ; if ( handshakeSession != null ) { handshakeSession . invalidate ( ) ; } /* * If we haven ' t even started handshaking yet , no need * to generate the fatal close alert . */ if ( oldState != cs_START ) { sendAlert ( Alerts . alert_fatal , description ) ; } if ( cause instanceof SSLException ) { // only true if ! = null closeReason = ( SSLException ) cause ; } else { /* * Including RuntimeExceptions , but we ' ll throw those * down below . The closeReason isn ' t used again , * except for null checks . */ closeReason = Alerts . getSSLException ( description , cause , diagnostic ) ; } writer . closeOutbound ( ) ; connectionState = cs_CLOSED ; // See comment in changeReadCiphers ( ) readCipher . dispose ( ) ; writeCipher . dispose ( ) ; if ( cause instanceof RuntimeException ) { throw ( RuntimeException ) cause ; } else { throw closeReason ; }
public class FlowConfigResourceLocalHandler { /** * Add flowConfig locally and trigger all listeners iff @ param triggerListener is set to true */ public CreateResponse createFlowConfig ( FlowConfig flowConfig , boolean triggerListener ) throws FlowConfigLoggedException { } }
log . info ( "[GAAS-REST] Create called with flowGroup " + flowConfig . getId ( ) . getFlowGroup ( ) + " flowName " + flowConfig . getId ( ) . getFlowName ( ) ) ; if ( flowConfig . hasExplain ( ) ) { // Return Error if FlowConfig has explain set . Explain request is only valid for v2 FlowConfig . return new CreateResponse ( new RestLiServiceException ( HttpStatus . S_400_BAD_REQUEST , "FlowConfig with explain not supported." ) ) ; } FlowSpec flowSpec = createFlowSpecForConfig ( flowConfig ) ; // Existence of a flow spec in the flow catalog implies that the flow is currently running . // If the new flow spec has a schedule we should allow submission of the new flow to accept the new schedule . // However , if the new flow spec does not have a schedule , we should allow submission only if it is not running . if ( ! flowConfig . hasSchedule ( ) && this . flowCatalog . exists ( flowSpec . getUri ( ) ) ) { return new CreateResponse ( new ComplexResourceKey < > ( flowConfig . getId ( ) , new EmptyRecord ( ) ) , HttpStatus . S_409_CONFLICT ) ; } else { this . flowCatalog . put ( flowSpec , triggerListener ) ; return new CreateResponse ( new ComplexResourceKey < > ( flowConfig . getId ( ) , new EmptyRecord ( ) ) , HttpStatus . S_201_CREATED ) ; }
public class DebugAndFilterModule { /** * Check if path falls outside start document directory * @ param filePathName absolute path to test * @ param inputMap absolute input map path * @ return { @ code true } if outside start directory , otherwise { @ code false } */ private static boolean isOutFile ( final File filePathName , final File inputMap ) { } }
final File relativePath = FileUtils . getRelativePath ( inputMap . getAbsoluteFile ( ) , filePathName . getAbsoluteFile ( ) ) ; return ! ( relativePath . getPath ( ) . length ( ) == 0 || ! relativePath . getPath ( ) . startsWith ( ".." ) ) ;
public class ClusteringVisualTab { /** * This method is called from within the constructor to * initialize the form . * WARNING : Do NOT modify this code . The content of this method is * always regenerated by the Form Editor . */ @ SuppressWarnings ( "unchecked" ) // < editor - fold defaultstate = " collapsed " desc = " Generated Code " > / / GEN - BEGIN : initComponents private void initComponents ( ) { } }
java . awt . GridBagConstraints gridBagConstraints ; jSplitPane1 = new javax . swing . JSplitPane ( ) ; topWrapper = new javax . swing . JPanel ( ) ; panelVisualWrapper = new javax . swing . JPanel ( ) ; splitVisual = new javax . swing . JSplitPane ( ) ; scrollPane1 = new javax . swing . JScrollPane ( ) ; streamPanel1 = new moa . gui . visualization . StreamPanel ( ) ; scrollPane0 = new javax . swing . JScrollPane ( ) ; streamPanel0 = new moa . gui . visualization . StreamPanel ( ) ; panelControl = new javax . swing . JPanel ( ) ; buttonRun = new javax . swing . JButton ( ) ; buttonStop = new javax . swing . JButton ( ) ; buttonScreenshot = new javax . swing . JButton ( ) ; speedSlider = new javax . swing . JSlider ( ) ; jLabel1 = new javax . swing . JLabel ( ) ; comboX = new javax . swing . JComboBox ( ) ; labelX = new javax . swing . JLabel ( ) ; comboY = new javax . swing . JComboBox ( ) ; labelY = new javax . swing . JLabel ( ) ; checkboxDrawPoints = new javax . swing . JCheckBox ( ) ; checkboxDrawGT = new javax . swing . JCheckBox ( ) ; checkboxDrawMicro = new javax . swing . JCheckBox ( ) ; checkboxDrawClustering = new javax . swing . JCheckBox ( ) ; label_processed_points = new javax . swing . JLabel ( ) ; label_processed_points_value = new javax . swing . JLabel ( ) ; labelNumPause = new javax . swing . JLabel ( ) ; numPauseAfterPoints = new javax . swing . JTextField ( ) ; panelEvalOutput = new javax . swing . JPanel ( ) ; clusteringVisualEvalPanel1 = new moa . gui . clustertab . ClusteringVisualEvalPanel ( ) ; graphPanel = new javax . swing . JPanel ( ) ; graphPanelControlTop = new javax . swing . JPanel ( ) ; buttonZoomInY = new javax . swing . JButton ( ) ; buttonZoomOutY = new javax . swing . JButton ( ) ; labelEvents = new javax . swing . JLabel ( ) ; graphScrollPanel = new javax . swing . JScrollPane ( ) ; graphCanvas = new moa . gui . visualization . GraphCanvas ( ) ; graphPanelControlBottom = new javax . swing . JPanel ( ) ; buttonZoomInX = new javax . swing . JButton ( ) ; buttonZoomOutX = new javax . swing . JButton ( ) ; setLayout ( new java . awt . GridBagLayout ( ) ) ; jSplitPane1 . setDividerLocation ( 400 ) ; jSplitPane1 . setOrientation ( javax . swing . JSplitPane . VERTICAL_SPLIT ) ; topWrapper . setPreferredSize ( new java . awt . Dimension ( 688 , 500 ) ) ; topWrapper . setLayout ( new java . awt . GridBagLayout ( ) ) ; panelVisualWrapper . setBorder ( javax . swing . BorderFactory . createBevelBorder ( javax . swing . border . BevelBorder . RAISED ) ) ; panelVisualWrapper . setLayout ( new java . awt . BorderLayout ( ) ) ; splitVisual . setDividerLocation ( 403 ) ; splitVisual . setResizeWeight ( 1.0 ) ; streamPanel1 . setPreferredSize ( new java . awt . Dimension ( 400 , 250 ) ) ; javax . swing . GroupLayout streamPanel1Layout = new javax . swing . GroupLayout ( streamPanel1 ) ; streamPanel1 . setLayout ( streamPanel1Layout ) ; streamPanel1Layout . setHorizontalGroup ( streamPanel1Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGap ( 0 , 428 , Short . MAX_VALUE ) ) ; streamPanel1Layout . setVerticalGroup ( streamPanel1Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGap ( 0 , 339 , Short . MAX_VALUE ) ) ; scrollPane1 . setViewportView ( streamPanel1 ) ; splitVisual . setRightComponent ( scrollPane1 ) ; scrollPane0 . addMouseWheelListener ( new java . awt . event . MouseWheelListener ( ) { public void mouseWheelMoved ( java . awt . event . MouseWheelEvent evt ) { scrollPane0MouseWheelMoved ( evt ) ; } } ) ; streamPanel0 . setPreferredSize ( new java . awt . Dimension ( 400 , 250 ) ) ; javax . swing . GroupLayout streamPanel0Layout = new javax . swing . GroupLayout ( streamPanel0 ) ; streamPanel0 . setLayout ( streamPanel0Layout ) ; streamPanel0Layout . setHorizontalGroup ( streamPanel0Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGap ( 0 , 400 , Short . MAX_VALUE ) ) ; streamPanel0Layout . setVerticalGroup ( streamPanel0Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGap ( 0 , 339 , Short . MAX_VALUE ) ) ; scrollPane0 . setViewportView ( streamPanel0 ) ; splitVisual . setLeftComponent ( scrollPane0 ) ; panelVisualWrapper . add ( splitVisual , java . awt . BorderLayout . CENTER ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 0 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . gridheight = java . awt . GridBagConstraints . RELATIVE ; gridBagConstraints . fill = java . awt . GridBagConstraints . BOTH ; gridBagConstraints . ipadx = 400 ; gridBagConstraints . ipady = 200 ; gridBagConstraints . anchor = java . awt . GridBagConstraints . NORTHWEST ; gridBagConstraints . weightx = 1.0 ; gridBagConstraints . weighty = 1.0 ; topWrapper . add ( panelVisualWrapper , gridBagConstraints ) ; panelControl . setMinimumSize ( new java . awt . Dimension ( 600 , 76 ) ) ; panelControl . setPreferredSize ( new java . awt . Dimension ( 2000 , 76 ) ) ; panelControl . setLayout ( new java . awt . GridBagLayout ( ) ) ; buttonRun . setText ( "Start" ) ; buttonRun . setPreferredSize ( new java . awt . Dimension ( 70 , 33 ) ) ; buttonRun . addMouseListener ( new java . awt . event . MouseAdapter ( ) { public void mouseClicked ( java . awt . event . MouseEvent evt ) { buttonRunMouseClicked ( evt ) ; } } ) ; buttonRun . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { buttonRunActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 0 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . insets = new java . awt . Insets ( 3 , 5 , 1 , 5 ) ; panelControl . add ( buttonRun , gridBagConstraints ) ; buttonStop . setText ( "Stop" ) ; buttonStop . setPreferredSize ( new java . awt . Dimension ( 70 , 33 ) ) ; buttonStop . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { buttonStopActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 0 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . insets = new java . awt . Insets ( 1 , 5 , 1 , 5 ) ; panelControl . add ( buttonStop , gridBagConstraints ) ; buttonScreenshot . setText ( "Screenshot" ) ; buttonScreenshot . setPreferredSize ( new java . awt . Dimension ( 90 , 23 ) ) ; buttonScreenshot . addMouseListener ( new java . awt . event . MouseAdapter ( ) { public void mouseClicked ( java . awt . event . MouseEvent evt ) { buttonScreenshotMouseClicked ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 1 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . insets = new java . awt . Insets ( 3 , 5 , 1 , 5 ) ; // # # # panelControl . add ( buttonScreenshot , gridBagConstraints ) ; speedSlider . setValue ( 100 ) ; speedSlider . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "Visualisation Speed" ) ) ; speedSlider . setMinimumSize ( new java . awt . Dimension ( 150 , 68 ) ) ; speedSlider . setPreferredSize ( new java . awt . Dimension ( 160 , 68 ) ) ; speedSlider . addMouseMotionListener ( new java . awt . event . MouseMotionAdapter ( ) { public void mouseDragged ( java . awt . event . MouseEvent evt ) { speedSliderMouseDragged ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 6 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . gridheight = 2 ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 16 , 1 , 5 ) ; panelControl . add ( speedSlider , gridBagConstraints ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 9 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . gridheight = 2 ; gridBagConstraints . fill = java . awt . GridBagConstraints . HORIZONTAL ; gridBagConstraints . weightx = 1.0 ; panelControl . add ( jLabel1 , gridBagConstraints ) ; comboX . setModel ( new javax . swing . DefaultComboBoxModel ( new String [ ] { "Dim 1" , "Dim 2" , "Dim 3" , "Dim 4" } ) ) ; comboX . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { comboXActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 3 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 4 , 0 , 4 ) ; panelControl . add ( comboX , gridBagConstraints ) ; labelX . setText ( "X" ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 2 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 14 , 0 , 5 ) ; panelControl . add ( labelX , gridBagConstraints ) ; comboY . setModel ( new javax . swing . DefaultComboBoxModel ( new String [ ] { "Dim 1" , "Dim 2" , "Dim 3" , "Dim 4" } ) ) ; comboY . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { comboYActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 3 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 4 , 0 , 4 ) ; panelControl . add ( comboY , gridBagConstraints ) ; labelY . setText ( "Y" ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 2 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 14 , 0 , 5 ) ; panelControl . add ( labelY , gridBagConstraints ) ; checkboxDrawPoints . setSelected ( true ) ; checkboxDrawPoints . setText ( "Points" ) ; checkboxDrawPoints . setMargin ( new java . awt . Insets ( 0 , 0 , 0 , 0 ) ) ; checkboxDrawPoints . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { checkboxDrawPointsActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 4 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . anchor = java . awt . GridBagConstraints . SOUTHWEST ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 20 , 0 , 4 ) ; panelControl . add ( checkboxDrawPoints , gridBagConstraints ) ; checkboxDrawGT . setSelected ( true ) ; checkboxDrawGT . setText ( "Ground truth" ) ; checkboxDrawGT . setMargin ( new java . awt . Insets ( 0 , 0 , 0 , 0 ) ) ; checkboxDrawGT . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { checkboxDrawGTActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 5 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . anchor = java . awt . GridBagConstraints . SOUTHWEST ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 4 , 0 , 4 ) ; panelControl . add ( checkboxDrawGT , gridBagConstraints ) ; checkboxDrawMicro . setSelected ( true ) ; checkboxDrawMicro . setText ( "Microclustering" ) ; checkboxDrawMicro . setMargin ( new java . awt . Insets ( 0 , 0 , 0 , 0 ) ) ; checkboxDrawMicro . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { checkboxDrawMicroActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 4 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . anchor = java . awt . GridBagConstraints . NORTHWEST ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 20 , 0 , 4 ) ; panelControl . add ( checkboxDrawMicro , gridBagConstraints ) ; checkboxDrawClustering . setSelected ( true ) ; checkboxDrawClustering . setText ( "Clustering" ) ; checkboxDrawClustering . setMargin ( new java . awt . Insets ( 0 , 0 , 0 , 0 ) ) ; checkboxDrawClustering . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { checkboxDrawClusteringActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 5 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . anchor = java . awt . GridBagConstraints . NORTHWEST ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 4 , 0 , 4 ) ; panelControl . add ( checkboxDrawClustering , gridBagConstraints ) ; label_processed_points . setText ( "Processed:" ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 7 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . anchor = java . awt . GridBagConstraints . WEST ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 6 , 0 , 0 ) ; panelControl . add ( label_processed_points , gridBagConstraints ) ; label_processed_points_value . setText ( "0" ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 8 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . anchor = java . awt . GridBagConstraints . WEST ; gridBagConstraints . weightx = 1.0 ; panelControl . add ( label_processed_points_value , gridBagConstraints ) ; labelNumPause . setText ( "Pause in:" ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 7 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . anchor = java . awt . GridBagConstraints . WEST ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 6 , 0 , 0 ) ; panelControl . add ( labelNumPause , gridBagConstraints ) ; numPauseAfterPoints . setHorizontalAlignment ( javax . swing . JTextField . RIGHT ) ; numPauseAfterPoints . setText ( Integer . toString ( RunVisualizer . initialPauseInterval ) ) ; numPauseAfterPoints . setMinimumSize ( new java . awt . Dimension ( 70 , 25 ) ) ; numPauseAfterPoints . setPreferredSize ( new java . awt . Dimension ( 70 , 25 ) ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 8 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . anchor = java . awt . GridBagConstraints . WEST ; panelControl . add ( numPauseAfterPoints , gridBagConstraints ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 0 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . fill = java . awt . GridBagConstraints . HORIZONTAL ; gridBagConstraints . anchor = java . awt . GridBagConstraints . NORTHWEST ; gridBagConstraints . weightx = 1.0 ; topWrapper . add ( panelControl , gridBagConstraints ) ; jSplitPane1 . setLeftComponent ( topWrapper ) ; panelEvalOutput . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "Evaluation" ) ) ; panelEvalOutput . setLayout ( new java . awt . GridBagLayout ( ) ) ; clusteringVisualEvalPanel1 . setMinimumSize ( new java . awt . Dimension ( 280 , 118 ) ) ; clusteringVisualEvalPanel1 . setPreferredSize ( new java . awt . Dimension ( 290 , 115 ) ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 0 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . fill = java . awt . GridBagConstraints . BOTH ; gridBagConstraints . anchor = java . awt . GridBagConstraints . WEST ; gridBagConstraints . weighty = 1.0 ; panelEvalOutput . add ( clusteringVisualEvalPanel1 , gridBagConstraints ) ; graphPanel . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "Plot" ) ) ; graphPanel . setPreferredSize ( new java . awt . Dimension ( 530 , 115 ) ) ; graphPanel . setLayout ( new java . awt . GridBagLayout ( ) ) ; graphPanelControlTop . setLayout ( new java . awt . GridBagLayout ( ) ) ; buttonZoomInY . setText ( "Zoom in Y" ) ; buttonZoomInY . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { buttonZoomInYActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 2 , 0 , 2 ) ; graphPanelControlTop . add ( buttonZoomInY , gridBagConstraints ) ; buttonZoomOutY . setText ( "Zoom out Y" ) ; buttonZoomOutY . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { buttonZoomOutYActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 2 , 0 , 2 ) ; graphPanelControlTop . add ( buttonZoomOutY , gridBagConstraints ) ; labelEvents . setHorizontalAlignment ( javax . swing . SwingConstants . CENTER ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . fill = java . awt . GridBagConstraints . HORIZONTAL ; gridBagConstraints . weightx = 1.0 ; gridBagConstraints . insets = new java . awt . Insets ( 0 , 2 , 0 , 2 ) ; graphPanelControlTop . add ( labelEvents , gridBagConstraints ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 0 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . fill = java . awt . GridBagConstraints . HORIZONTAL ; gridBagConstraints . anchor = java . awt . GridBagConstraints . WEST ; gridBagConstraints . weightx = 1.0 ; graphPanel . add ( graphPanelControlTop , gridBagConstraints ) ; graphCanvas . setPreferredSize ( new java . awt . Dimension ( 500 , 111 ) ) ; javax . swing . GroupLayout graphCanvasLayout = new javax . swing . GroupLayout ( graphCanvas ) ; graphCanvas . setLayout ( graphCanvasLayout ) ; graphCanvasLayout . setHorizontalGroup ( graphCanvasLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGap ( 0 , 515 , Short . MAX_VALUE ) ) ; graphCanvasLayout . setVerticalGroup ( graphCanvasLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGap ( 0 , 128 , Short . MAX_VALUE ) ) ; graphScrollPanel . setViewportView ( graphCanvas ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 0 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . gridwidth = 2 ; gridBagConstraints . fill = java . awt . GridBagConstraints . BOTH ; gridBagConstraints . weightx = 1.0 ; gridBagConstraints . weighty = 1.0 ; gridBagConstraints . insets = new java . awt . Insets ( 2 , 2 , 2 , 2 ) ; graphPanel . add ( graphScrollPanel , gridBagConstraints ) ; buttonZoomInX . setText ( "Zoom in X" ) ; buttonZoomInX . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { buttonZoomInXActionPerformed ( evt ) ; } } ) ; graphPanelControlBottom . add ( buttonZoomInX ) ; buttonZoomOutX . setText ( "Zoom out X" ) ; buttonZoomOutX . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { buttonZoomOutXActionPerformed ( evt ) ; } } ) ; graphPanelControlBottom . add ( buttonZoomOutX ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridx = 1 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . anchor = java . awt . GridBagConstraints . EAST ; graphPanel . add ( graphPanelControlBottom , gridBagConstraints ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . fill = java . awt . GridBagConstraints . BOTH ; gridBagConstraints . anchor = java . awt . GridBagConstraints . WEST ; gridBagConstraints . weightx = 2.0 ; gridBagConstraints . weighty = 1.0 ; panelEvalOutput . add ( graphPanel , gridBagConstraints ) ; jSplitPane1 . setRightComponent ( panelEvalOutput ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . fill = java . awt . GridBagConstraints . BOTH ; gridBagConstraints . weightx = 1.0 ; gridBagConstraints . weighty = 1.0 ; add ( jSplitPane1 , gridBagConstraints ) ;
public class TaskLockbox { /** * Return all locks that overlap some search interval . */ private List < TaskLockPosse > findLockPossesOverlapsInterval ( final String dataSource , final Interval interval ) { } }
giant . lock ( ) ; try { final NavigableMap < DateTime , SortedMap < Interval , List < TaskLockPosse > > > dsRunning = running . get ( dataSource ) ; if ( dsRunning == null ) { // No locks at all return Collections . emptyList ( ) ; } else { // Tasks are indexed by locked interval , which are sorted by interval start . Intervals are non - overlapping , so : final NavigableSet < DateTime > dsLockbox = dsRunning . navigableKeySet ( ) ; final Iterable < DateTime > searchStartTimes = Iterables . concat ( // Single interval that starts at or before ours Collections . singletonList ( dsLockbox . floor ( interval . getStart ( ) ) ) , // All intervals that start somewhere between our start instant ( exclusive ) and end instant ( exclusive ) dsLockbox . subSet ( interval . getStart ( ) , false , interval . getEnd ( ) , false ) ) ; return StreamSupport . stream ( searchStartTimes . spliterator ( ) , false ) . filter ( java . util . Objects :: nonNull ) . map ( dsRunning :: get ) . filter ( java . util . Objects :: nonNull ) . flatMap ( sortedMap -> sortedMap . entrySet ( ) . stream ( ) ) . filter ( entry -> entry . getKey ( ) . overlaps ( interval ) ) . flatMap ( entry -> entry . getValue ( ) . stream ( ) ) . collect ( Collectors . toList ( ) ) ; } } finally { giant . unlock ( ) ; }
public class RestService { /** * returns authenticated user cuid */ protected String getAuthUser ( Map < String , String > headers ) { } }
return headers . get ( Listener . AUTHENTICATED_USER_HEADER ) ;
public class ServerContext { /** * Sets the global index . * @ param globalIndex The global index . * @ return The Raft context . */ ServerContext setGlobalIndex ( long globalIndex ) { } }
Assert . argNot ( globalIndex < 0 , "global index must be positive" ) ; this . globalIndex = Math . max ( this . globalIndex , globalIndex ) ; log . compactor ( ) . majorIndex ( this . globalIndex - 1 ) ; return this ;
public class OutputMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Output output , ProtocolMarshaller protocolMarshaller ) { } }
if ( output == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( output . getAudioDescriptionNames ( ) , AUDIODESCRIPTIONNAMES_BINDING ) ; protocolMarshaller . marshall ( output . getCaptionDescriptionNames ( ) , CAPTIONDESCRIPTIONNAMES_BINDING ) ; protocolMarshaller . marshall ( output . getOutputName ( ) , OUTPUTNAME_BINDING ) ; protocolMarshaller . marshall ( output . getOutputSettings ( ) , OUTPUTSETTINGS_BINDING ) ; protocolMarshaller . marshall ( output . getVideoDescriptionName ( ) , VIDEODESCRIPTIONNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Record { /** * Converts a Record into canonical DNS uncompressed wire format ( all names are * converted to lowercase ) , optionally ignoring the TTL . */ private byte [ ] toWireCanonical ( boolean noTTL ) { } }
DNSOutput out = new DNSOutput ( ) ; toWireCanonical ( out , noTTL ) ; return out . toByteArray ( ) ;
public class SignedBytes { /** * Returns the least value present in { @ code array } . * @ param array a < i > nonempty < / i > array of { @ code byte } values * @ return the value present in { @ code array } that is less than or equal to every other value in * the array * @ throws IllegalArgumentException if { @ code array } is empty */ public static byte min ( byte ... array ) { } }
checkArgument ( array . length > 0 ) ; byte min = array [ 0 ] ; for ( int i = 1 ; i < array . length ; i ++ ) { if ( array [ i ] < min ) { min = array [ i ] ; } } return min ;
public class QueryUtil { /** * Checks if the given expression has any wildcard characters * @ param expression a { @ code String } value , never { @ code null } * @ return true if the expression has wildcard characters , false otherwise */ public static boolean hasWildcardCharacters ( String expression ) { } }
Objects . requireNonNull ( expression ) ; CharacterIterator iter = new StringCharacterIterator ( expression ) ; boolean skipNext = false ; for ( char c = iter . first ( ) ; c != CharacterIterator . DONE ; c = iter . next ( ) ) { if ( skipNext ) { skipNext = false ; continue ; } if ( c == '*' || c == '?' || c == '%' || c == '_' ) return true ; if ( c == '\\' ) skipNext = true ; } return false ;
public class AtomicServiceReference { /** * Clear the service reference associated with this service . This first * checks to see whether or not the reference being unset matches the * current reference . For Declarative Services dynamic components : if a replacement * is available for a dynamic reference , DS will call set with the new * reference before calling unset to clear the old one . * @ param reference ServiceReference associated with service to be unset . * @ return true if a non - null value was replaced */ public boolean unsetReference ( ServiceReference < T > reference ) { } }
ReferenceTuple < T > previous = null ; ReferenceTuple < T > newTuple = null ; // Try this until we either manage to make our update or we know we don ' t have to do { // Get the current tuple previous = tuple . get ( ) ; // If we have something to do . . if ( reference == previous . serviceRef ) { newTuple = new ReferenceTuple < T > ( previous . context , null , null ) ; } else { break ; // break out . Nothing to see here . } // Try to save the new tuple : retry if someone changed the value meanwhile } while ( ! tuple . compareAndSet ( previous , newTuple ) ) ; return newTuple != null ;
public class StorageAccountCredentialsInner { /** * Creates or updates the storage account credential . * @ param deviceName The device name . * @ param name The storage account credential name . * @ param resourceGroupName The resource group name . * @ param storageAccountCredential The storage account credential . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < StorageAccountCredentialInner > createOrUpdateAsync ( String deviceName , String name , String resourceGroupName , StorageAccountCredentialInner storageAccountCredential , final ServiceCallback < StorageAccountCredentialInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( deviceName , name , resourceGroupName , storageAccountCredential ) , serviceCallback ) ;
public class HpelSystemStream { /** * Print a boolean value . The string produced by * < code > { @ link java . lang . String # valueOf ( boolean ) } < / code > is translated into * bytes according to the platform ' s default character encoding , and these * bytes are written in exactly the manner of the * < code > { @ link # write ( int ) } < / code > method . * @ param x * The < code > boolean < / code > to be printed */ public void print ( boolean x ) { } }
if ( ivSuppress == true ) return ; if ( x == false ) doPrint ( svFalse ) ; else doPrint ( svTrue ) ;
public class AbstractWizardPanel { /** * Callback method for the previous action . */ protected void onPrevious ( ) { } }
stateMachine . previous ( ) ; updateButtonState ( ) ; final String name = getStateMachine ( ) . getCurrentState ( ) . getName ( ) ; final CardLayout cardLayout = getWizardContentPanel ( ) . getCardLayout ( ) ; cardLayout . show ( getWizardContentPanel ( ) , name ) ;
public class Trapezoid { /** * Computes the membership function evaluated at ` x ` * @ param x * @ return ` \ begin { cases } 0h & \ mbox { if $ x \ not \ in [ a , d ] $ } \ cr h \ times * \ min ( 1 , ( x - a ) / ( b - a ) ) & \ mbox { if $ x < b $ } \ cr 1h & \ mbox { if $ x \ leq * c $ } \ cr h ( d - x ) / ( d - c ) & \ mbox { if $ x < d $ } \ cr 0h & \ mbox { otherwise } * \ end { cases } ` * where ` h ` is the height of the Term , ` a ` is the first vertex of the * Trapezoid , ` b ` is the second vertex of the Tr a pezoid , ` c ` is the * third vertex of the Trapezoid , ` d ` is the fourth vertex of the * Trapezoid */ @ Override public double membership ( double x ) { } }
if ( Double . isNaN ( x ) ) { return Double . NaN ; } if ( Op . isLt ( x , vertexA ) || Op . isGt ( x , vertexD ) ) { return height * 0.0 ; } else if ( Op . isLt ( x , vertexB ) ) { return height * Math . min ( 1.0 , ( x - vertexA ) / ( vertexB - vertexA ) ) ; } else if ( Op . isLE ( x , vertexC ) ) { return height * 1.0 ; } else if ( Op . isLt ( x , vertexD ) ) { return height * ( vertexD - x ) / ( vertexD - vertexC ) ; } return height * 0.0 ;
public class AVTrack { /** * Get the file where this track can be found ( or null if this information is not available ) * @ return */ public String getSource ( ) { } }
final Element element = getElement ( "Source" , 0 ) ; if ( element != null ) return element . getText ( ) ; else return null ;
public class CmsInternalLinkValidationDialog { /** * Returns the list of VFS resources . < p > * @ return the list of VFS resources */ public List getResources ( ) { } }
if ( ( m_resources == null ) || m_resources . isEmpty ( ) ) { m_resources = new ArrayList ( ) ; m_resources . add ( "/" ) ; } return m_resources ;
public class LoadReportAnalysisMetadataHolderStep { /** * Check that the Quality profiles sent by scanner correctly relate to the project organization . */ private void checkQualityProfilesConsistency ( ScannerReport . Metadata metadata , Organization organization ) { } }
List < String > profileKeys = metadata . getQprofilesPerLanguage ( ) . values ( ) . stream ( ) . map ( QProfile :: getKey ) . collect ( toList ( metadata . getQprofilesPerLanguage ( ) . size ( ) ) ) ; try ( DbSession dbSession = dbClient . openSession ( false ) ) { List < QProfileDto > profiles = dbClient . qualityProfileDao ( ) . selectByUuids ( dbSession , profileKeys ) ; String badKeys = profiles . stream ( ) . filter ( p -> ! p . getOrganizationUuid ( ) . equals ( organization . getUuid ( ) ) ) . map ( QProfileDto :: getKee ) . collect ( MoreCollectors . join ( Joiner . on ( ", " ) ) ) ; if ( ! badKeys . isEmpty ( ) ) { throw MessageException . of ( format ( "Quality profiles with following keys don't exist in organization [%s]: %s" , organization . getKey ( ) , badKeys ) ) ; } }
public class AuthorizationInterceptors { /** * START SNIPPET : conditionalUpdate */ @ Update ( ) public MethodOutcome update ( @ IdParam IdDt theId , @ ResourceParam Patient theResource , @ ConditionalUrlParam String theConditionalUrl , ServletRequestDetails theRequestDetails , IInterceptorBroadcaster theInterceptorBroadcaster ) { } }
// If we ' re processing a conditional URL . . . if ( isNotBlank ( theConditionalUrl ) ) { // Pretend we ' ve done the conditional processing . Now let ' s // notify the interceptors that an update has been performed // and supply the actual ID that ' s being updated IdDt actual = new IdDt ( "Patient" , "1123" ) ; } // In a real server , perhaps we would process the conditional // request differently and follow a separate path . Either way , // let ' s pretend there is some storage code here . theResource . setId ( theId . withVersion ( "2" ) ) ; // Notify the interceptor framework when we ' re about to perform an update . This is // useful as the authorization interceptor will pick this event up and use it // to factor into a decision about whether the operation should be allowed to proceed . IBaseResource previousContents = theResource ; IBaseResource newContents = theResource ; HookParams params = new HookParams ( ) . add ( IBaseResource . class , previousContents ) . add ( IBaseResource . class , newContents ) . add ( RequestDetails . class , theRequestDetails ) . add ( ServletRequestDetails . class , theRequestDetails ) ; theInterceptorBroadcaster . callHooks ( Pointcut . STORAGE_PRESTORAGE_RESOURCE_UPDATED , params ) ; MethodOutcome retVal = new MethodOutcome ( ) ; retVal . setCreated ( true ) ; retVal . setResource ( theResource ) ; return retVal ;
public class Director { /** * Gets the sample licenses from install resources * @ param locale Locale of license * @ return Collection of licenses as Strings for samples * @ throws InstallException */ public Collection < String > getSampleLicense ( Locale locale ) throws InstallException { } }
Collection < String > licenses = new ArrayList < String > ( ) ; for ( List < List < RepositoryResource > > targetList : getResolveDirector ( ) . getInstallResources ( ) . values ( ) ) { for ( List < RepositoryResource > mrList : targetList ) { for ( RepositoryResource mr : mrList ) { ResourceType type = mr . getType ( ) ; if ( type . equals ( ResourceType . PRODUCTSAMPLE ) || type . equals ( ResourceType . OPENSOURCE ) ) { try { AttachmentResource lar = mr . getLicenseAgreement ( locale ) ; if ( lar != null ) licenses . add ( InstallLicenseImpl . getLicense ( lar ) ) ; } catch ( RepositoryException e ) { throw ExceptionUtils . createByKey ( e , "ERROR_FAILED_TO_GET_ASSET_LICENSE" , mr . getName ( ) ) ; } } } } } return licenses ;