signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public ObjectClassificationObjClass createObjectClassificationObjClassFromString ( EDataType eDataType , String initialValue ) { } }
ObjectClassificationObjClass result = ObjectClassificationObjClass . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class StandardBullhornData { /** * { @ inheritDoc } */ @ Override public < T extends BullhornEntity , L extends ListWrapper < T > > L findMultipleEntity ( Class < T > type , Set < Integer > idList , Set < String > fieldSet ) { } }
return this . handleGetMultipleEntities ( type , idList , fieldSet , ParamFactory . entityParams ( ) ) ;
public class RiakClient { /** * Execute a StreamableRiakCommand asynchronously , and stream the results back before * the command { @ link RiakFuture # isDone ( ) is done } . * Calling this method causes the client to execute the provided * StreamableRiakCommand asynchronously . * It will immediately return a RiakFuture that contains an * < b > immediately < / b > available result ( via { @ link RiakFuture # get ( ) } ) that * data will be streamed to . * The RiakFuture will also keep track of the overall operation ' s progress * with the { @ link RiakFuture # isDone } , etc methods . * Because the consumer thread will poll for new results , it is advisable to check the * consumer thread ' s interrupted status via * { @ link Thread # isInterrupted ( ) Thread . currentThread ( ) . isInterrupted ( ) } , as the result * iterator will not propagate an InterruptedException , but it will set the Thread ' s * interrupted flag . * @ param < I > StreamableRiakCommand ' s immediate return type , available before the command / operation is complete . * @ param < S > The RiakCommand ' s query info type . * @ param command The RiakCommand to execute . * @ param timeoutMS The polling timeout in milliseconds for each result chunk . * If the timeout is reached it will try again , instead of blocking indefinitely . * If the value is too small ( less than the average chunk arrival time ) , the * result iterator will essentially busy wait . * If the timeout is too large ( much greater than the average chunk arrival time ) , * the result iterator can block the consuming thread from seeing the done ( ) * status until the timeout is reached . * @ return a RiakFuture for the operation * @ since 2.1.0 * @ see RiakFuture */ public < I extends StreamableRiakCommand . StreamableResponse , S > RiakFuture < I , S > executeAsyncStreaming ( StreamableRiakCommand < I , S , ? , ? > command , int timeoutMS ) { } }
return command . executeAsyncStreaming ( cluster , timeoutMS ) ;
public class ExcelFunctions { /** * Returns the remainder after number is divided by divisor */ public static BigDecimal mod ( EvaluationContext ctx , Object number , Object divisor ) { } }
BigDecimal _number = Conversions . toDecimal ( number , ctx ) ; BigDecimal _divisor = Conversions . toDecimal ( divisor , ctx ) ; return _number . subtract ( _divisor . multiply ( new BigDecimal ( _int ( ctx , _number . divide ( _divisor , 10 , RoundingMode . HALF_UP ) ) ) ) ) ;
public class ReflectUtils { /** * Load the given class using a specific class loader . * @ param className The name of the class * @ param cl The Class Loader to be used for finding the class . * @ return The class object */ public static Class < ? > loadClass ( String className , ClassLoader cl ) { } }
try { return Class . forName ( className , false , cl ) ; } catch ( ClassNotFoundException e ) { throw new IllegalArgumentException ( e ) ; }
public class BuildWrapper { /** * for compatibility we can ' t use BuildWrapperDescriptor */ public static DescriptorExtensionList < BuildWrapper , Descriptor < BuildWrapper > > all ( ) { } }
// use getDescriptorList and not getExtensionList to pick up legacy instances return Jenkins . getInstance ( ) . < BuildWrapper , Descriptor < BuildWrapper > > getDescriptorList ( BuildWrapper . class ) ;
public class AipOcr { /** * 网络图片文字识别接口 * 用户向服务请求识别一些网络上背景复杂 , 特殊字体的文字 。 * @ param url - 图片完整URL , URL长度不超过1024字节 , URL对应的图片base64编码后大小不超过4M , 最短边至少15px , 最长边最大4096px , 支持jpg / png / bmp格式 , 当image字段存在时url字段失效 * @ param options - 可选参数对象 , key : value都为string类型 * options - options列表 : * detect _ direction 是否检测图像朝向 , 默认不检测 , 即 : false 。 朝向是指输入图像是正常方向 、 逆时针旋转90/180/270度 。 可选值包括 : < br > - true : 检测朝向 ; < br > - false : 不检测朝向 。 * detect _ language 是否检测语言 , 默认不检测 。 当前支持 ( 中文 、 英语 、 日语 、 韩语 ) * @ return JSONObject */ public JSONObject webImageUrl ( String url , HashMap < String , String > options ) { } }
AipRequest request = new AipRequest ( ) ; preOperation ( request ) ; request . addBody ( "url" , url ) ; if ( options != null ) { request . addBody ( options ) ; } request . setUri ( OcrConsts . WEB_IMAGE ) ; postOperation ( request ) ; return requestServer ( request ) ;
public class AbstractRestClient { /** * Build a ClientHttpRequestInterceptor that adds three request headers * @ param header1name of header 1 * @ param value1value of header 1 * @ param header2name of header 2 * @ param value2value of header 2 * @ param header3name of header 3 * @ param value3value of header 3 * @ param header4name of the header 4 * @ param value4value of the header 4 * @ return the ClientHttpRequestInterceptor built */ protected ClientHttpRequestInterceptor buildAddHeadersRequestInterceptor ( String header1 , String value1 , String header2 , String value2 , String header3 , String value3 , String header4 , String value4 ) { } }
return new AddHeadersRequestInterceptor ( new String [ ] { header1 , header2 , header3 , header4 } , new String [ ] { value1 , value2 , value3 , value4 } ) ;
public class SeaGlassLookAndFeel { /** * Get a derived color , derived colors are shared instances and will be * updated when its parent UIDefault color changes . * @ param uiDefaultParentName The parent UIDefault key * @ param hOffset The hue offset * @ param sOffset The saturation offset * @ param bOffset The brightness offset * @ param aOffset The alpha offset * @ param uiResource True if the derived color should be a UIResource , * false if it should not be a UIResource * @ return The stored derived color */ public DerivedColor getDerivedColor ( String parentUin , float hOffset , float sOffset , float bOffset , int aOffset , boolean uiResource ) { } }
return getDerivedColor ( null , parentUin , hOffset , sOffset , bOffset , aOffset , uiResource ) ;
public class SequenceValidationCheck { /** * Creates a warning validation message for the sequence and adds it to * the validation result . * @ param messageKey a message key * @ param params message parameters */ protected void reportWarning ( ValidationResult result , String messageKey , Object ... params ) { } }
reportMessage ( result , Severity . WARNING , messageKey , params ) ;
public class FeatureLinkHelper { /** * / * @ Nullable */ public XExpression getSyntacticReceiver ( XExpression expression ) { } }
if ( expression instanceof XAbstractFeatureCall ) { if ( expression instanceof XFeatureCall ) { return null ; } if ( expression instanceof XMemberFeatureCall ) { return ( ( XMemberFeatureCall ) expression ) . getMemberCallTarget ( ) ; } if ( expression instanceof XAssignment ) { return ( ( XAssignment ) expression ) . getAssignable ( ) ; } if ( expression instanceof XBinaryOperation ) { return ( ( XBinaryOperation ) expression ) . getLeftOperand ( ) ; } if ( expression instanceof XUnaryOperation ) { return ( ( XUnaryOperation ) expression ) . getOperand ( ) ; } if ( expression instanceof XPostfixOperation ) { return ( ( XPostfixOperation ) expression ) . getOperand ( ) ; } } return null ;
public class Assert2 { /** * Asserts that two paths are deeply byte - equivalent . * @ param expected one of the paths * @ param actual the other path * @ throws IOException if the paths cannot be traversed */ public static void assertEquals ( final Path expected , final Path actual ) throws IOException { } }
containsAll ( actual , expected ) ; if ( Files . exists ( expected ) ) { containsAll ( expected , actual ) ; walkFileTree ( expected , new SimpleFileVisitor < Path > ( ) { @ Override public FileVisitResult visitFile ( final Path file , final BasicFileAttributes attrs ) throws IOException { final Path sub = relativize ( expected , file ) ; final Path therePath = resolve ( actual , sub ) ; final long hereSize = Files . size ( file ) ; final long thereSize = Files . size ( therePath ) ; assertThat ( thereSize , asserts ( ( ) -> sub + " is " + hereSize + " bytes" , t -> t == hereSize ) ) ; assertByteEquals ( sub , file , therePath ) ; return super . visitFile ( file , attrs ) ; } } ) ; }
public class CryptoUtils { /** * See https : / / developers . facebook . com / docs / graph - api / securing - requests */ public static String makeAppSecretProof ( String appSecret , String accessToken ) { } }
try { Mac mac = Mac . getInstance ( "HmacSHA256" ) ; SecretKeySpec secretKey = new SecretKeySpec ( appSecret . getBytes ( ) , "HmacSHA256" ) ; mac . init ( secretKey ) ; byte [ ] bytes = mac . doFinal ( accessToken . getBytes ( ) ) ; return Hex . encodeHexString ( bytes ) ; } catch ( NoSuchAlgorithmException | InvalidKeyException e ) { throw new RuntimeException ( e ) ; }
public class Syncer { /** * Registers a { @ link ISyncHandler } to the { @ link Syncer } . * @ param name the name * @ param supplier the supplier */ public static void registerHandlerFactory ( String name , Supplier < ISyncHandler < ? , ? extends ISyncableData > > supplier ) { } }
instance . registerFactory ( name , supplier ) ;
public class DevPollStatusCmd { public Any execute ( DeviceImpl device , Any in_any ) throws DevFailed { } }
Util . out4 . println ( "DevPollStatusCmd.execute(): arrived " ) ; // Call the device method and return to caller String argin = extract_DevString ( in_any ) ; return insert ( ( ( DServer ) ( device ) ) . dev_poll_status ( argin ) ) ;
public class SpellingCheckRule { /** * Returns true iff the word should be ignored by the spell checker . * If possible , use { @ link # ignoreToken ( AnalyzedTokenReadings [ ] , int ) } instead . */ protected boolean ignoreWord ( String word ) throws IOException { } }
if ( ! considerIgnoreWords ) { return false ; } if ( word . endsWith ( "." ) && ! wordsToBeIgnored . contains ( word ) ) { return isIgnoredNoCase ( word . substring ( 0 , word . length ( ) - 1 ) ) ; // e . g . word at end of sentence } return isIgnoredNoCase ( word ) ;
public class GeometryEncoder { /** * Encodes the { @ code centres [ ] } specified in the constructor as either * clockwise / anticlockwise or none . If there is a permutation parity but no * geometric parity then we can not encode the configuration and ' true ' is * returned to indicate the perception is done . If there is no permutation * parity this may changed with the next { @ code current [ ] } values and so * ' false ' is returned . * { @ inheritDoc } */ @ Override public boolean encode ( long [ ] current , long [ ] next ) { } }
int p = permutation . parity ( current ) ; // if is a permutation parity ( all neighbors are different ) if ( p != 0 ) { // multiple with the geometric parity int q = geometric . parity ( ) * p ; // configure anticlockwise / clockwise if ( q > 0 ) { for ( int i : centres ) { next [ i ] = current [ i ] * ANTICLOCKWISE ; } } else if ( q < 0 ) { for ( int i : centres ) { next [ i ] = current [ i ] * CLOCKWISE ; } } // 0 parity ignored return true ; } return false ;
public class Maven { /** * - - resolve */ public FileNode resolve ( String groupId , String artifactId , String version ) throws ArtifactResolutionException { } }
return resolve ( groupId , artifactId , "jar" , version ) ;
public class StringSerializer { /** * Checks whether mime types is supported by this serializer implementation */ @ Override public boolean canRead ( @ Nonnull MediaType mimeType , Class < ? > resultType ) { } }
MediaType type = mimeType . withoutParameters ( ) ; return ( type . is ( MediaType . ANY_TEXT_TYPE ) || MediaType . APPLICATION_XML_UTF_8 . withoutParameters ( ) . is ( type ) || MediaType . JSON_UTF_8 . withoutParameters ( ) . is ( type ) ) && String . class . equals ( resultType ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcPerformanceHistoryTypeEnum ( ) { } }
if ( ifcPerformanceHistoryTypeEnumEEnum == null ) { ifcPerformanceHistoryTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1026 ) ; } return ifcPerformanceHistoryTypeEnumEEnum ;
public class ActivityListItemMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ActivityListItem activityListItem , ProtocolMarshaller protocolMarshaller ) { } }
if ( activityListItem == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( activityListItem . getActivityArn ( ) , ACTIVITYARN_BINDING ) ; protocolMarshaller . marshall ( activityListItem . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( activityListItem . getCreationDate ( ) , CREATIONDATE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class CmsSimpleEditor { /** * Initializes the editor content when opening the editor for the first time . < p > */ @ Override protected void initContent ( ) { } }
// save initialized instance of this class in request attribute for included sub - elements getJsp ( ) . getRequest ( ) . setAttribute ( SESSION_WORKPLACE_CLASS , this ) ; // get the default encoding String content = getParamContent ( ) ; if ( CmsStringUtil . isNotEmpty ( content ) ) { // content already read , must be decoded setParamContent ( decodeContent ( content ) ) ; return ; } else { content = "" ; } try { // lock resource if autolock is enabled checkLock ( getParamResource ( ) ) ; CmsFile editFile = getCms ( ) . readFile ( getParamResource ( ) , CmsResourceFilter . ALL ) ; content = CmsEncoder . createString ( editFile . getContents ( ) , getFileEncoding ( ) ) ; } catch ( CmsException e ) { // reading of file contents failed , show error dialog try { showErrorPage ( this , e ) ; } catch ( JspException exc ) { // should usually never happen if ( LOG . isInfoEnabled ( ) ) { LOG . info ( exc ) ; } } } setParamContent ( content ) ;
public class URLPattern { /** * Checks if this pattern matches the specified pattern String . * The matching rules from the { @ code WebResourcePermission # implies } : * < ol > * < li > their pattern values are { @ code String } equivalent , or < / li > * < li > this pattern is the path - prefix pattern " / * " , or < / li > * < li > this pattern is a path - prefix pattern ( that is , it starts with " / " and ends with " / * " ) and the argument * pattern starts with the substring of this pattern , minus its last 2 characters , and the next character of the * argument pattern , if there is one , is " / " , or < / li > * < li > this pattern is an extension pattern ( that is , it starts with " * . " ) and the argument pattern ends with this * pattern , or 5 . the reference pattern is the special default pattern , " / " , which matches all argument patterns . < / li > * < / ol > * @ param urlPattern * a { @ code String } representing the pattern to which this pattern is to be matched . * @ return { @ code true } if this pattern matches the specified { @ code URLPattern } ; { @ code false } otherwise . */ boolean matches ( String urlPattern ) { } }
// 2 or 5 if ( type == PatternType . DEFAULT || type == PatternType . THE_PATH_PREFIX ) return true ; // 4 , extension pattern if ( type == PatternType . EXTENSION && urlPattern . endsWith ( ext ) ) return true ; // 3 . a path - prefix pattern if ( type == PatternType . PATH_PREFIX ) { if ( urlPattern . regionMatches ( 0 , pattern , 0 , length - 2 ) ) { int last = length - 2 ; if ( urlPattern . length ( ) > last && urlPattern . charAt ( last ) != '/' ) return false ; return true ; } return false ; } // 1 . pattern values are String equivalent for exact pattern if ( pattern . equals ( urlPattern ) ) return true ; return false ;
public class Utils { /** * Returns true if { @ code element } is a { @ code TypeAdapter } type . */ static boolean isAdapterType ( Element element , Elements elements , Types types ) { } }
TypeMirror typeAdapterType = types . getDeclaredType ( elements . getTypeElement ( TYPE_ADAPTER_CLASS_NAME ) , types . getWildcardType ( null , null ) ) ; return types . isAssignable ( element . asType ( ) , typeAdapterType ) ;
public class LogRequestor { /** * This is a copy of ByteStreams . readFully ( ) , with the slight change that it throws * NoBytesReadException if zero bytes are read . Otherwise it is identical . * @ param in * @ param bytes * @ throws IOException */ private void readFully ( InputStream in , byte [ ] bytes ) throws IOException { } }
int read = ByteStreams . read ( in , bytes , 0 , bytes . length ) ; if ( read == 0 ) { throw new NoBytesReadException ( ) ; } else if ( read != bytes . length ) { throw new EOFException ( "reached end of stream after reading " + read + " bytes; " + bytes . length + " bytes expected" ) ; }
public class VersionSpecificTemplates { /** * Templatized due to version differences . Only fields used in search are declared */ String spanIndexTemplate ( ) { } }
String result = "{\n" + " \"TEMPLATE\": \"${__INDEX__}:" + SPAN + "-*\",\n" + " \"settings\": {\n" + " \"index.number_of_shards\": ${__NUMBER_OF_SHARDS__},\n" + " \"index.number_of_replicas\": ${__NUMBER_OF_REPLICAS__},\n" + " \"index.requests.cache.enable\": true,\n" + " \"index.mapper.dynamic\": false,\n" + " \"analysis\": {\n" + " \"analyzer\": {\n" + " \"traceId_analyzer\": {\n" + " \"type\": \"custom\",\n" + " \"tokenizer\": \"keyword\",\n" + " \"filter\": \"traceId_filter\"\n" + " }\n" + " },\n" + " \"filter\": {\n" + " \"traceId_filter\": {\n" + " \"type\": \"pattern_capture\",\n" + " \"patterns\": [\"([0-9a-f]{1,16})$\"],\n" + " \"preserve_original\": true\n" + " }\n" + " }\n" + " }\n" + " },\n" ; if ( searchEnabled ) { return result + ( " \"mappings\": {\n" + " \"_default_\": {\n" + " DISABLE_ALL" // don ' t concat all fields into big string + " \"dynamic_templates\": [\n" + " {\n" + " \"strings\": {\n" + " \"mapping\": {\n" + " KEYWORD,\n" + " \"ignore_above\": 256\n" + " },\n" + " \"match_mapping_type\": \"string\",\n" + " \"match\": \"*\"\n" + " }\n" + " }\n" + " ]\n" + " },\n" + " \"" + SPAN + "\": {\n" + " \"_source\": {\"excludes\": [\"_q\"] },\n" + " \"properties\": {\n" + " \"traceId\": ${__TRACE_ID_MAPPING__},\n" + " \"name\": { KEYWORD },\n" + " \"localEndpoint\": {\n" + " \"type\": \"object\",\n" + " \"dynamic\": false,\n" + " \"properties\": { \"serviceName\": { KEYWORD } }\n" + " },\n" + " \"remoteEndpoint\": {\n" + " \"type\": \"object\",\n" + " \"dynamic\": false,\n" + " \"properties\": { \"serviceName\": { KEYWORD } }\n" + " },\n" + " \"timestamp_millis\": {\n" + " \"type\": \"date\",\n" + " \"format\": \"epoch_millis\"\n" + " },\n" + " \"duration\": { \"type\": \"long\" },\n" + " \"annotations\": { \"enabled\": false },\n" + " \"tags\": { \"enabled\": false },\n" + " \"_q\": { KEYWORD }\n" + " }\n" + " }\n" + " }\n" + "}" ) ; } return result + ( " \"mappings\": {\n" + " \"_default_\": { DISABLE_ALL },\n" + " \"" + SPAN + "\": {\n" + " \"properties\": {\n" + " \"traceId\": ${__TRACE_ID_MAPPING__},\n" + " \"annotations\": { \"enabled\": false },\n" + " \"tags\": { \"enabled\": false }\n" + " }\n" + " }\n" + " }\n" + "}" ) ;
public class PLRenderHelper { /** * Create the background fill ( debug and real ) and draw the border ( debug and * real ) of an element . * @ param aElement * The element to be rendered . May not be < code > null < / code > . * @ param aCtx * The render context incl . the content stream . * @ param fIndentX * Additional x - indentation * @ param fIndentY * Additional y - indentation * @ throws IOException * in case writing fails * @ param < T > * element type to render */ public static < T extends IPLElement < T > > void fillAndRenderBorder ( @ Nonnull final T aElement , @ Nonnull final PageRenderContext aCtx , final float fIndentX , final float fIndentY ) throws IOException { } }
// Border starts after margin final float fLeft = aCtx . getStartLeft ( ) + aElement . getMarginLeft ( ) + fIndentX ; final float fTop = aCtx . getStartTop ( ) - aElement . getMarginTop ( ) - fIndentY ; final float fWidth = aElement . getRenderWidth ( ) + aElement . getBorderXSumWidth ( ) + aElement . getPaddingXSum ( ) ; final float fHeight = aElement . getRenderHeight ( ) + aElement . getBorderYSumWidth ( ) + aElement . getPaddingYSum ( ) ; fillAndRenderBorder ( aElement , fLeft , fTop , fWidth , fHeight , aCtx . getContentStream ( ) ) ;
public class UIViewRoot { /** * < p class = " changed _ added _ 2_0 " > If { @ link # getAfterPhaseListener } * returns non - < code > null < / code > , invoke it , passing a { @ link * PhaseEvent } for the { @ link PhaseId # RENDER _ RESPONSE } phase . Any * errors that occur during invocation of the afterPhase listener * must be logged and swallowed . If the current view has view * parameters , as indicated by a non - empty and * non - < code > UnsupportedOperationException < / code > throwing return * from { @ link javax . faces . view . ViewDeclarationLanguage # getViewMetadata ( javax . faces . context . FacesContext , String ) } , * call { @ link UIViewParameter # encodeAll } on each parameter . If * calling < code > getViewParameters ( ) < / code > causes * < code > UnsupportedOperationException < / code > to be thrown , the * exception must be silently swallowed . < / p > */ @ Override public void encodeEnd ( FacesContext context ) throws IOException { } }
super . encodeEnd ( context ) ; encodeViewParameters ( context ) ; notifyAfter ( context , PhaseId . RENDER_RESPONSE ) ;
public class ClientFactory { /** * Create { @ link IMessageReceiver } in default { @ link ReceiveMode # PEEKLOCK } mode from service bus connection string with < a href = " https : / / docs . microsoft . com / en - us / azure / service - bus - messaging / service - bus - sas " > Shared Access Signatures < / a > * @ param amqpConnectionString the connection string * @ param receiveMode { @ link ReceiveMode } PeekLock or ReceiveAndDelete * @ return { @ link IMessageReceiver } instance * @ throws InterruptedException if the current thread was interrupted while waiting * @ throws ServiceBusException if the receiver cannot be created */ public static IMessageReceiver createMessageReceiverFromConnectionString ( String amqpConnectionString , ReceiveMode receiveMode ) throws InterruptedException , ServiceBusException { } }
return Utils . completeFuture ( createMessageReceiverFromConnectionStringAsync ( amqpConnectionString , receiveMode ) ) ;
public class ObjectReader { /** * Builds extra SQL WHERE clause * @ param keys An array of ID names * @ param mapping The hashtable containing the object mapping * @ return A string containing valid SQL */ private String buildWhereClause ( String [ ] pKeys , Hashtable pMapping ) { } }
StringBuilder sqlBuf = new StringBuilder ( ) ; for ( int i = 0 ; i < pKeys . length ; i ++ ) { String column = ( String ) pMapping . get ( pKeys [ i ] ) ; sqlBuf . append ( " AND " ) ; sqlBuf . append ( column ) ; sqlBuf . append ( " = ?" ) ; } return sqlBuf . toString ( ) ;
public class GenericField { public static boolean isSupportedFieldType ( String className ) { } }
if ( className . equals ( "String" ) || String . class . getName ( ) . equals ( className ) ) { return true ; } else if ( className . equalsIgnoreCase ( "Double" ) || Double . class . getName ( ) . equals ( className ) ) { return true ; } else if ( className . equals ( "int" ) || className . equals ( "Integer" ) || Integer . class . getName ( ) . equals ( className ) ) { return true ; } else if ( className . equalsIgnoreCase ( "Long" ) || Long . class . getName ( ) . equals ( className ) ) { return true ; } else if ( className . equalsIgnoreCase ( "Float" ) || Float . class . getName ( ) . equals ( className ) ) { return true ; } else if ( className . equalsIgnoreCase ( "byte" ) || Byte . class . getName ( ) . equals ( className ) ) { return true ; } else if ( className . equalsIgnoreCase ( "Short" ) || Short . class . getName ( ) . equals ( className ) ) { return true ; } else if ( "Date" . equalsIgnoreCase ( className ) || java . util . Date . class . getName ( ) . equals ( className ) ) { return true ; } else if ( className . equalsIgnoreCase ( "char" ) || className . equalsIgnoreCase ( "Character" ) || Character . class . getName ( ) . equals ( className ) ) { return true ; } else { return false ; }
public class DaoTemplate { /** * 删除 * @ param < T > 主键类型 * @ param pk 主键 * @ return 删除行数 * @ throws SQLException SQL执行异常 */ public < T > int del ( T pk ) throws SQLException { } }
if ( pk == null ) { return 0 ; } return this . del ( Entity . create ( tableName ) . set ( primaryKeyField , pk ) ) ;
public class FederationPresenter { /** * - - - - - saml & key store configuration */ public void modifySamlConfiguration ( final Map < String , Object > changedValues ) { } }
ResourceAddress address = SAML_TEMPLATE . resolve ( statementContext , federation ) ; modifySingleton ( "SAML configuration" , address , changedValues ) ;
public class HostProcess { /** * Scans the message with the given ID with the given plugin . * It ' s used a new instance of the given plugin . * @ param plugin the scanner * @ param messageId the ID of the message . * @ return { @ code true } if the { @ code plugin } was run , { @ code false } otherwise . */ private boolean scanMessage ( Plugin plugin , int messageId ) { } }
Plugin test ; HistoryReference historyReference ; HttpMessage msg ; try { historyReference = new HistoryReference ( messageId , true ) ; msg = historyReference . getHttpMessage ( ) ; } catch ( HttpMalformedHeaderException | DatabaseException e ) { log . warn ( "Failed to read message with ID [" + messageId + "], cause: " + e . getMessage ( ) ) ; return false ; } try { // Ensure the temporary nodes , added automatically to Sites tree , have a response . // The scanners might base the logic / attacks on the state of the response ( e . g . status code ) . if ( msg . getResponseHeader ( ) . isEmpty ( ) ) { msg = msg . cloneRequest ( ) ; if ( ! obtainResponse ( historyReference , msg ) ) { return false ; } } if ( log . isDebugEnabled ( ) ) { log . debug ( "scanSingleNode node plugin=" + plugin . getName ( ) + " node=" + historyReference . getURI ( ) . toString ( ) ) ; } test = plugin . getClass ( ) . getDeclaredConstructor ( ) . newInstance ( ) ; test . setConfig ( plugin . getConfig ( ) ) ; if ( this . ruleConfigParam != null ) { // Set the configuration rules for ( RuleConfig rc : this . ruleConfigParam . getAllRuleConfigs ( ) ) { test . getConfig ( ) . setProperty ( rc . getKey ( ) , rc . getValue ( ) ) ; } } test . setDelayInMs ( plugin . getDelayInMs ( ) ) ; test . setDefaultAlertThreshold ( plugin . getAlertThreshold ( ) ) ; test . setDefaultAttackStrength ( plugin . getAttackStrength ( ) ) ; test . setTechSet ( getTechSet ( ) ) ; test . init ( msg , this ) ; notifyHostProgress ( plugin . getName ( ) + ": " + msg . getRequestHeader ( ) . getURI ( ) . toString ( ) ) ; } catch ( Exception e ) { log . error ( e . getMessage ( ) + " " + historyReference . getURI ( ) . toString ( ) , e ) ; return false ; } Thread thread ; do { if ( this . isStop ( ) ) { return false ; } thread = threadPool . getFreeThreadAndRun ( test ) ; if ( thread == null ) { Util . sleep ( 200 ) ; } } while ( thread == null ) ; mapPluginStats . get ( plugin . getId ( ) ) . incProgress ( ) ; return true ;
public class WSClientConfig { /** * Add a hint that this client understands compressed HTTP content . Disabled * by default . * @ param bCompress * < code > true < / code > to enable , < code > false < / code > to disable . * @ return this for chaining */ @ Nonnull public final WSClientConfig setCompressedResponse ( final boolean bCompress ) { } }
if ( bCompress ) m_aHTTPHeaders . setHeader ( CHttpHeader . ACCEPT_ENCODING , "gzip" ) ; else m_aHTTPHeaders . removeHeaders ( CHttpHeader . ACCEPT_ENCODING ) ; return this ;
public class CaptureSearchResults { /** * Add a result to this results , at either the beginning or the end , * depending on the append argument * @ param result SearchResult to add to this set * @ param append */ public void addSearchResult ( CaptureSearchResult result , boolean append ) { } }
String resultDate = result . getCaptureTimestamp ( ) ; if ( ( firstResultTimestamp == null ) || ( firstResultTimestamp . compareTo ( resultDate ) > 0 ) ) { firstResultTimestamp = resultDate ; } if ( ( lastResultTimestamp == null ) || ( lastResultTimestamp . compareTo ( resultDate ) < 0 ) ) { lastResultTimestamp = resultDate ; } if ( append ) { if ( ! results . isEmpty ( ) ) { results . getLast ( ) . setNextResult ( result ) ; result . setPrevResult ( results . getLast ( ) ) ; } results . add ( result ) ; } else { if ( ! results . isEmpty ( ) ) { results . getFirst ( ) . setPrevResult ( result ) ; result . setNextResult ( results . getFirst ( ) ) ; } results . add ( 0 , result ) ; }
public class ParseBigDecimal { /** * { @ inheritDoc } * @ throws SuperCsvCellProcessorException * if value is null , isn ' t a String , or can ' t be parsed as a BigDecimal */ public Object execute ( final Object value , final CsvContext context ) { } }
validateInputNotNull ( value , context ) ; final BigDecimal result ; if ( value instanceof String ) { final String s = ( String ) value ; try { if ( symbols == null ) { result = new BigDecimal ( s ) ; } else { result = new BigDecimal ( fixSymbols ( s , symbols ) ) ; } } catch ( final NumberFormatException e ) { throw new SuperCsvCellProcessorException ( String . format ( "'%s' could not be parsed as a BigDecimal" , value ) , context , this , e ) ; } } else { throw new SuperCsvCellProcessorException ( String . class , value , context , this ) ; } return next . execute ( result , context ) ;
public class CodecInfo { /** * Gets the positioned terms by prefixes and position . * @ param field * the field * @ param docId * the doc id * @ param prefixes * the prefixes * @ param position * the position * @ return the positioned terms by prefixes and position * @ throws IOException * Signals that an I / O exception has occurred . */ public List < MtasTreeHit < String > > getPositionedTermsByPrefixesAndPosition ( String field , int docId , List < String > prefixes , int position ) throws IOException { } }
return getPositionedTermsByPrefixesAndPositionRange ( field , docId , prefixes , position , position ) ;
public class LenskitRecommenderRunner { /** * Runs the recommender using the provided datamodels . * @ param opts see * { @ link net . recommenders . rival . recommend . frameworks . AbstractRunner . RUN _ OPTIONS } * @ param trainingModel model to be used to train the recommender . * @ param testModel model to be used to test the recommender . * @ return see * { @ link # runLenskitRecommender ( net . recommenders . rival . recommend . frameworks . AbstractRunner . RUN _ OPTIONS , org . grouplens . lenskit . data . dao . EventDAO , org . grouplens . lenskit . data . dao . EventDAO ) } * @ throws RecommenderException see * { @ link # runLenskitRecommender ( net . recommenders . rival . recommend . frameworks . AbstractRunner . RUN _ OPTIONS , org . grouplens . lenskit . data . dao . EventDAO , org . grouplens . lenskit . data . dao . EventDAO ) } */ @ Override public TemporalDataModelIF < Long , Long > run ( final RUN_OPTIONS opts , final TemporalDataModelIF < Long , Long > trainingModel , final TemporalDataModelIF < Long , Long > testModel ) throws RecommenderException { } }
if ( isAlreadyRecommended ( ) ) { return null ; } // transform from core ' s DataModels to Lenskit ' s EventDAO DataAccessObject trainingModelLensKit = new EventDAOWrapper ( trainingModel ) ; DataAccessObject testModelLensKit = new EventDAOWrapper ( testModel ) ; return runLenskitRecommender ( opts , trainingModelLensKit , testModelLensKit ) ;
public class AcpService { /** * 获取应答报文中的加密公钥证书 , 并存储到本地 , 备份原始证书 , 并自动替换证书 < br > * 更新成功则返回1 , 无更新返回0 , 失败异常返回 - 1 < br > * @ param resData 返回报文 * @ param encoding * @ return */ public static int updateEncryptCert ( Map < String , String > resData , String encoding ) { } }
return SDKUtil . getEncryptCert ( resData , encoding ) ;
public class JNRPEClient { /** * Prints the application version . */ private static void printVersion ( ) { } }
System . out . println ( "jcheck_nrpe version " + JNRPEClient . class . getPackage ( ) . getImplementationVersion ( ) ) ; System . out . println ( "Copyright (c) 2013 Massimiliano Ziccardi" ) ; System . out . println ( "Licensed under the Apache License, Version 2.0" ) ; System . out . println ( ) ;
public class CheckConsistencyContext { /** * Merges and embeds the given { @ link CheckConsistencyPOptions } with the corresponding master * options . * @ param optionsBuilder Builder for proto { @ link CheckConsistencyPOptions } to merge with defaults * @ return the instance of { @ link CheckConsistencyContext } with default values for master */ public static CheckConsistencyContext mergeFrom ( CheckConsistencyPOptions . Builder optionsBuilder ) { } }
CheckConsistencyPOptions masterOptions = FileSystemOptions . checkConsistencyDefaults ( ServerConfiguration . global ( ) ) ; CheckConsistencyPOptions . Builder mergedOptionsBuilder = masterOptions . toBuilder ( ) . mergeFrom ( optionsBuilder . build ( ) ) ; return create ( mergedOptionsBuilder ) ;
public class SOAPMessageTransport { /** * From this external message , figure out the message type . * @ externalMessage The external message just received . * @ return The message type for this kind of message ( transport specific ) . */ public String getMessageVersion ( BaseMessage externalMessage ) { } }
String version = null ; if ( ! ( externalMessage . getExternalMessage ( ) instanceof SoapTrxMessageIn ) ) return null ; SOAPMessage message = ( SOAPMessage ) ( ( SoapTrxMessageIn ) externalMessage . getExternalMessage ( ) ) . getRawData ( ) ; try { // Message creation takes care of creating the SOAPPart - a // required part of the message as per the SOAP 1.1 // specification . SOAPPart sp = message . getSOAPPart ( ) ; // Retrieve the envelope from the soap part to start building // the soap message . SOAPEnvelope envelope = sp . getEnvelope ( ) ; // Create a soap header from the envelope . // ? SOAPHeader hdr = envelope . getHeader ( ) ; // Get the body SOAPBody body = envelope . getBody ( ) ; SOAPElement element = this . getElement ( body , null ) ; if ( element != null ) { QName na = new QName ( "http://www.w3.org/2001/XMLSchema-instance" , "schemaLocation" ) ; String attribute = element . getAttributeValue ( na ) ; if ( attribute != null ) { Record recMessageControl = this . getRecord ( MessageControlModel . MESSAGE_CONTROL_FILE ) ; if ( recMessageControl == null ) recMessageControl = Record . makeRecordFromClassName ( MessageControlModel . THICK_CLASS , this ) ; version = ( ( MessageControlModel ) recMessageControl ) . getVersionFromSchemaLocation ( attribute ) ; } } } catch ( Throwable ex ) { ex . printStackTrace ( ) ; } if ( version != null ) return version ; return super . getMessageVersion ( externalMessage ) ; // No type found .
public class IPSettings { /** * returns a List of all the nodes ( from root to best matching ) for the given address * @ param iaddr * @ return */ public List < IPRangeNode > getChain ( InetAddress iaddr ) { } }
List < IPRangeNode > result = new ArrayList ( ) ; result . add ( root ) ; IPRangeNode node = isV4 ( iaddr ) ? ipv4 : ipv6 ; node . findFast ( iaddr , result ) ; return result ;
public class URLHelper { /** * Create a parameter string . This is also suitable for POST body ( e . g . for * web form submission ) . * @ param aQueryParams * Parameter map . May be < code > null < / code > or empty . * @ param aQueryParameterEncoder * The encoder to be used to encode parameter names and parameter * values . May be < code > null < / code > . This may be e . g . a * { @ link URLParameterEncoder } . * @ return < code > null < / code > if no parameter is present . */ @ Nullable public static String getQueryParametersAsString ( @ Nullable final List < ? extends URLParameter > aQueryParams , @ Nullable final IEncoder < String , String > aQueryParameterEncoder ) { } }
if ( CollectionHelper . isEmpty ( aQueryParams ) ) return null ; final StringBuilder aSB = new StringBuilder ( ) ; // add all values for ( final URLParameter aParam : aQueryParams ) { // Separator if ( aSB . length ( ) > 0 ) aSB . append ( AMPERSAND ) ; aParam . appendTo ( aSB , aQueryParameterEncoder ) ; } return aSB . toString ( ) ;
public class AliPayApi { /** * 查询授权信息 * @ param model * { AlipayOpenAuthTokenAppQueryModel } * @ return { AlipayOpenAuthTokenAppQueryResponse } * @ throws { AlipayApiException } */ public static AlipayOpenAuthTokenAppQueryResponse openAuthTokenAppQueryToResponse ( AlipayOpenAuthTokenAppQueryModel model ) throws AlipayApiException { } }
AlipayOpenAuthTokenAppQueryRequest request = new AlipayOpenAuthTokenAppQueryRequest ( ) ; request . setBizModel ( model ) ; return AliPayApiConfigKit . getAliPayApiConfig ( ) . getAlipayClient ( ) . execute ( request ) ;
public class SipStandardManager { /** * { @ inheritDoc } */ public MobicentsSipSession getSipSession ( final MobicentsSipSessionKey key , final boolean create , final MobicentsSipFactory sipFactoryImpl , final MobicentsSipApplicationSession sipApplicationSessionImpl ) { } }
return sipManagerDelegate . getSipSession ( ( SipSessionKey ) key , create , ( SipFactoryImpl ) sipFactoryImpl , sipApplicationSessionImpl ) ;
public class BasePath { /** * Returns a new path pointing to a child of this Path . * @ param path A relative path */ B append ( BasePath < B > path ) { } }
ImmutableList . Builder < String > components = ImmutableList . builder ( ) ; components . addAll ( this . getSegments ( ) ) ; components . addAll ( path . getSegments ( ) ) ; return createPathWithSegments ( components . build ( ) ) ;
public class DFACacheOracle { /** * Creates a cache oracle for a DFA learning setup , using a tree for internal cache organization . * @ param alphabet * the alphabet containing the symbols of possible queries * @ param delegate * the oracle to delegate queries to , in case of a cache - miss . * @ param < I > * input symbol type * @ return the cached { @ link DFACacheOracle } . * @ see IncrementalDFATreeBuilder */ public static < I > DFACacheOracle < I > createTreeCacheOracle ( Alphabet < I > alphabet , MembershipOracle < I , Boolean > delegate ) { } }
return new DFACacheOracle < > ( new IncrementalDFATreeBuilder < > ( alphabet ) , delegate ) ;
public class AWSElasticsearchClient { /** * Returns the name of all Elasticsearch domains owned by the current user ' s account . * @ param listDomainNamesRequest * @ return Result of the ListDomainNames operation returned by the service . * @ throws BaseException * An error occurred while processing the request . * @ throws ValidationException * An exception for missing / invalid input fields . Gives http status code of 400. * @ sample AWSElasticsearch . ListDomainNames */ @ Override public ListDomainNamesResult listDomainNames ( ListDomainNamesRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListDomainNames ( request ) ;
public class MBeanAccessChecker { /** * Extract configuration and put it into a given MBeanPolicyConfig */ private void extractMbeanConfiguration ( NodeList pNodes , MBeanPolicyConfig pConfig ) throws MalformedObjectNameException { } }
for ( int i = 0 ; i < pNodes . getLength ( ) ; i ++ ) { Node node = pNodes . item ( i ) ; if ( node . getNodeType ( ) != Node . ELEMENT_NODE ) { continue ; } extractPolicyConfig ( pConfig , node . getChildNodes ( ) ) ; }
public class DateHelper { /** * Returns the later of two dates , handling null values . A non - null Date * is always considered to be later than a null Date . * @ param d1 Date instance * @ param d2 Date instance * @ return Date latest date */ public static Date max ( Date d1 , Date d2 ) { } }
Date result ; if ( d1 == null ) { result = d2 ; } else if ( d2 == null ) { result = d1 ; } else { result = ( d1 . compareTo ( d2 ) > 0 ) ? d1 : d2 ; } return result ;
public class Model { /** * Gets the relationship with the specified ID . * @ param id the { @ link Relationship # getId ( ) } of the relationship * @ return the relationship in this model with the specified ID ( or null if it doesn ' t exist ) . * @ see Relationship # getId ( ) */ @ Nullable public Relationship getRelationship ( @ Nonnull String id ) { } }
if ( id == null || id . trim ( ) . length ( ) == 0 ) { throw new IllegalArgumentException ( "A relationship ID must be specified." ) ; } return relationshipsById . get ( id ) ;
public class RTMPConnManager { /** * { @ inheritDoc } */ @ Override public RTMPConnection removeConnection ( int clientId ) { } }
log . trace ( "Removing connection with id: {}" , clientId ) ; // remove from map for ( RTMPConnection conn : connMap . values ( ) ) { if ( conn . getId ( ) == clientId ) { // remove the conn return removeConnection ( conn . getSessionId ( ) ) ; } } log . warn ( "Connection was not removed by id: {}" , clientId ) ; return null ;
public class AdjacencyList { /** * Depth - first search of graph . * @ param v the start vertex . * @ param pre the array to store the mask if vertex has been visited . * @ param ts the array to store the reverse topological order . * @ param count the number of vertices have been visited before this search . * @ return the number of vertices that have been visited after this search . */ private int dfsearch ( int v , int [ ] pre , int [ ] ts , int count ) { } }
pre [ v ] = 0 ; for ( Edge edge : graph [ v ] ) { int t = edge . v2 ; if ( pre [ t ] == - 1 ) { count = dfsearch ( t , pre , ts , count ) ; } } ts [ count ++ ] = v ; return count ;
public class RangeTombstoneList { /** * Adds a new range tombstone . * This method will be faster if the new tombstone sort after all the currently existing ones ( this is a common use case ) , * but it doesn ' t assume it . */ public void add ( Composite start , Composite end , long markedAt , int delTime ) { } }
if ( isEmpty ( ) ) { addInternal ( 0 , start , end , markedAt , delTime ) ; return ; } int c = comparator . compare ( ends [ size - 1 ] , start ) ; // Fast path if we add in sorted order if ( c <= 0 ) { addInternal ( size , start , end , markedAt , delTime ) ; } else { // Note : insertFrom expect i to be the insertion point in term of interval ends int pos = Arrays . binarySearch ( ends , 0 , size , start , comparator ) ; insertFrom ( ( pos >= 0 ? pos : - pos - 1 ) , start , end , markedAt , delTime ) ; } boundaryHeapSize += start . unsharedHeapSize ( ) + end . unsharedHeapSize ( ) ;
public class LoginResponseState { /** * { @ inheritDoc } */ @ Override public final Exception isCorrect ( final ProtocolDataUnit protocolDataUnit ) { } }
if ( protocolDataUnit . getBasicHeaderSegment ( ) . getParser ( ) instanceof LoginResponseParser ) { return null ; } else { return new IllegalStateException ( new StringBuilder ( "Parser " ) . append ( protocolDataUnit . getBasicHeaderSegment ( ) . getParser ( ) . toString ( ) ) . append ( " is instance of " ) . append ( protocolDataUnit . getBasicHeaderSegment ( ) . getParser ( ) . getClass ( ) . toString ( ) ) . append ( " and not instance if LoginParser!" ) . toString ( ) ) ; }
public class WSDirectorySocket { /** * { @ inheritDoc } */ @ Override public void onWebSocketError ( Throwable error ) { } }
LOGGER . error ( "WebSocket client get error." ) ; if ( LOGGER . isTraceEnabled ( ) ) { LOGGER . trace ( "WebSocket client get error." , error ) ; } clientConnection . onSocketError ( ) ; if ( ! connected ) { synchronized ( sessionLock ) { sessionLock . notifyAll ( ) ; } } // cleanup ( ) ; // clientConnection . onSocketError ( ) ;
public class PersistentMessageStoreImpl { /** * This method checks the ME _ UUID stored in the permanent object store for this messaging engine * to see if it matches that which we retrieve from the admin object . If the ME _ UUID matches it * then updates the INC _ UUID to one that is associated with this current incarnation . * @ return < UL > * < LI > true - If all checks and updates are successful < / LI > * < LI > false - If a check or update fails < / LI > * < / UL > */ public boolean checkAndUpdateMEOwner ( MELockOwner owner ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "checkAndUpdateMEOwner" , "Owner=" + owner ) ; // Venu mock mock disableUUIDCheck for now in this version of Liberty profile . boolean disableUUIDCheck = true ; /* / / set always true to / / Defect 601995 / / Check to see if UUID checking has been disabled . String disableUUIDCheckStr = _ ms . getProperty ( MessageStoreConstants . PROP _ OBJECT _ MANAGER _ DISABLE _ UUID _ CHECK , MessageStoreConstants . PROP _ OBJECT _ MANAGER _ DISABLE _ UUID _ CHECK _ DEFAULT ) ; boolean disableUUIDCheck = Boolean . parseBoolean ( disableUUIDCheckStr ) ; */ boolean success = true ; if ( disableUUIDCheck ) { // Start regardless of the contents of our owner objects if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Owner checking skipped as " + MessageStoreConstants . PROP_OBJECT_MANAGER_DISABLE_UUID_CHECK + "=true" ) ; } else { MEStoredOwner storedOwner = null ; Transaction transaction = null ; SibTr . info ( tc , "FILE_STORE_LOCK_ATTEMPTING_SIMS1564" , new Object [ ] { owner . getMeUUID ( ) , owner . getIncUUID ( ) } ) ; try { transaction = _objectManager . getTransaction ( ) ; Token storedOwnerToken = _anchor . getMEOwnerToken ( ) ; if ( storedOwnerToken != null ) { storedOwner = ( MEStoredOwner ) storedOwnerToken . getManagedObject ( ) ; SibTr . info ( tc , "FILE_STORE_LOCK_ONE_OWNER_SIMS1566" , new Object [ ] { storedOwner . getMeUUID ( ) , storedOwner . getIncUUID ( ) } ) ; // F008622 - start if ( _ms . getProperty ( MessageStoreConstants . START_MODE , MessageStoreConstants . DEAFULT_START_MODE ) . equalsIgnoreCase ( "RECOVERY" ) ) { owner = new MELockOwner ( storedOwner . getMeUUID ( ) , storedOwner . getIncUUID ( ) , storedOwner . getVersion ( ) , storedOwner . getMigrationVersion ( ) , "default" ) ; } // F008622 end // If our ME _ UUID matches that found then we need // to update our incarnation id . if ( owner . getMeUUID ( ) . equals ( storedOwner . getMeUUID ( ) ) ) { if ( owner . getVersion ( ) == storedOwner . getVersion ( ) ) { transaction . lock ( storedOwner ) ; storedOwner . setIncUUID ( owner . getIncUUID ( ) ) ; transaction . replace ( storedOwner ) ; } else { // Different Version SibTr . error ( tc , "FILE_STORE_LOCK_VERSION_DOESNT_MATCH_SIMS1562" , new Object [ ] { Integer . valueOf ( owner . getVersion ( ) ) , Integer . valueOf ( storedOwner . getVersion ( ) ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Different ME version found in file store!" , "ME Version=" + owner . getVersion ( ) + ", ME Version(FS)=" + storedOwner . getVersion ( ) ) ; // Defect 496893 // We know that no instance of this ME will ever work with these // files so we report a global error to stop us from failing over // to a new instance . _ms . reportGlobalError ( ) ; success = false ; } } else { // Different ME _ UUID SibTr . error ( tc , "FILE_STORE_LOCK_MEUUID_DOESNT_MATCH_SIMS1561" , new Object [ ] { owner . getMeUUID ( ) , storedOwner . getMeUUID ( ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Different ME unique id found in file store!" , "ME_UUID=" + owner . getMeUUID ( ) + ", ME_UUID(FS)=" + storedOwner . getMeUUID ( ) ) ; // Defect 496893 // We know that no instance of this ME will ever work with these // files so we report a global error to stop us from failing over // to a new instance . _ms . reportGlobalError ( ) ; success = false ; } } else { // We are starting with an empty object store // so we need to add our ME owner information // to the anchor . SibTr . info ( tc , "FILE_STORE_LOCK_NO_OWNER_SIMS1565" ) ; storedOwner = new MEStoredOwner ( owner . getMeUUID ( ) , owner . getIncUUID ( ) , 1 , 0 ) ; storedOwnerToken = _permanentStore . allocate ( storedOwner ) ; transaction . lock ( _anchor ) ; _anchor . setMEOwnerToken ( storedOwnerToken ) ; transaction . replace ( _anchor ) ; transaction . add ( storedOwner ) ; } transaction . commit ( false ) ; } catch ( ObjectManagerException ome ) { com . ibm . ws . ffdc . FFDCFilter . processException ( ome , "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.checkAndUpdateMEOwner" , "1:2214:1.81.1.6" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Exception caught updating ME Owner information!" , ome ) ; if ( transaction != null ) { try { // Clean up our ObjectManager work . transaction . backout ( false ) ; } catch ( ObjectManagerException e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.checkAndUpdateMEOwner" , "1:2226:1.81.1.6" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Exception caught backing out update of ME Owner information!" , e ) ; } } // Defect 496893 // We don ' t know what problem we ' ve had but we can ' t guarantee that we have // successfully checked our owner information so we should ask to be failed // over to a new instance to see if we have more luck next time . _ms . reportLocalError ( ) ; success = false ; } if ( success ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "ME Owner information in ObjectStore updated successfully: " + storedOwner ) ; SibTr . info ( tc , "FILE_STORE_LOCK_ACQUIRED_SIMS1563" , new Object [ ] { storedOwner . getMeUUID ( ) , storedOwner . getIncUUID ( ) } ) ; } else { SibTr . error ( tc , "CANNOT_OBTAIN_FILE_STORE_LOCK_SIMS1567" , new Object [ ] { owner . getMeName ( ) } ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "checkAndUpdateMEOwner" , "return=" + success ) ; return success ;
public class CreateGatewayGroupRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateGatewayGroupRequest createGatewayGroupRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createGatewayGroupRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createGatewayGroupRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createGatewayGroupRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( createGatewayGroupRequest . getClientRequestToken ( ) , CLIENTREQUESTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class HttpRequestMessageImpl { /** * @ see * com . ibm . ws . http . channel . internal . HttpBaseMessageImpl # readExternal ( java . * io . ObjectInput ) */ @ Override public void readExternal ( ObjectInput input ) throws IOException , ClassNotFoundException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "De-serializing into: " + this ) ; } super . readExternal ( input ) ; deserializeMethod ( input ) ; deserializeScheme ( input ) ; this . myURIBytes = readByteArray ( input ) ; setQueryString ( readByteArray ( input ) ) ;
public class Level { /** * Compares this level against the levels passed as arguments and returns true if this level is in between the given * levels . * @ param minLevel The minimum level to test . * @ param maxLevel The maximum level to test . * @ return True true if this level is in between the given levels * @ since 2.4 */ public boolean isInRange ( final Level minLevel , final Level maxLevel ) { } }
return this . intLevel >= minLevel . intLevel && this . intLevel <= maxLevel . intLevel ;
public class PositionFromPairLinear2 { /** * Computes the translation given two or more feature observations and the known rotation * @ param R Rotation matrix . World to view . * @ param worldPts Location of features in world coordinates . * @ param observed Observations of point in current view . Normalized coordinates . * @ return true if it succeeded . */ public boolean process ( DMatrixRMaj R , List < Point3D_F64 > worldPts , List < Point2D_F64 > observed ) { } }
if ( worldPts . size ( ) != observed . size ( ) ) throw new IllegalArgumentException ( "Number of worldPts and observed must be the same" ) ; if ( worldPts . size ( ) < 2 ) throw new IllegalArgumentException ( "A minimum of two points are required" ) ; int N = worldPts . size ( ) ; A . reshape ( 3 * N , 3 ) ; b . reshape ( A . numRows , 1 ) ; for ( int i = 0 ; i < N ; i ++ ) { Point3D_F64 X = worldPts . get ( i ) ; Point2D_F64 o = observed . get ( i ) ; int indexA = i * 3 * 3 ; int indexB = i * 3 ; A . data [ indexA + 1 ] = - 1 ; A . data [ indexA + 2 ] = o . y ; A . data [ indexA + 3 ] = 1 ; A . data [ indexA + 5 ] = - o . x ; A . data [ indexA + 6 ] = - o . y ; A . data [ indexA + 7 ] = o . x ; GeometryMath_F64 . mult ( R , X , RX ) ; b . data [ indexB ++ ] = 1 * RX . y - o . y * RX . z ; b . data [ indexB ++ ] = - 1 * RX . x + o . x * RX . z ; b . data [ indexB ] = o . y * RX . x - o . x * RX . y ; } if ( ! solver . setA ( A ) ) return false ; solver . solve ( b , x ) ; T . x = x . data [ 0 ] ; T . y = x . data [ 1 ] ; T . z = x . data [ 2 ] ; return true ;
public class GeomFactory3ifx { /** * Create a point with properties . * @ param x the x property . * @ param y the y property . * @ param z the z property . * @ return the vector . */ @ SuppressWarnings ( "static-method" ) public Point3ifx newPoint ( IntegerProperty x , IntegerProperty y , IntegerProperty z ) { } }
return new Point3ifx ( x , y , z ) ;
public class ServerSentEventConnection { /** * execute a graceful shutdown once all data has been sent */ public void shutdown ( ) { } }
if ( open == 0 || shutdown ) { return ; } shutdown = true ; sink . getIoThread ( ) . execute ( new Runnable ( ) { @ Override public void run ( ) { synchronized ( ServerSentEventConnection . this ) { if ( queue . isEmpty ( ) && pooled == null ) { exchange . endExchange ( ) ; } } } } ) ;
public class HttpUtil { /** * Performs an HTTP POST on the given URL . * Basic auth is used if credentials object is not null . * @ param url The URL to connect to . * @ param file The file to send as MultiPartFile . * @ param credentials Instance implementing { @ link Credentials } interface holding a set of credentials * @ return The HTTP response as Response object . * @ throws URISyntaxException * @ throws HttpException */ public static Response post ( String url , File file , Credentials credentials ) throws URISyntaxException , HttpException { } }
return postMultiPart ( new HttpPost ( url ) , new FileBody ( file ) , credentials , null ) ;
public class CertificateDetail { /** * Contains information about the initial validation of each domain name that occurs as a result of the * < a > RequestCertificate < / a > request . This field exists only when the certificate type is < code > AMAZON _ ISSUED < / code > * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setDomainValidationOptions ( java . util . Collection ) } or * { @ link # withDomainValidationOptions ( java . util . Collection ) } if you want to override the existing values . * @ param domainValidationOptions * Contains information about the initial validation of each domain name that occurs as a result of the * < a > RequestCertificate < / a > request . This field exists only when the certificate type is * < code > AMAZON _ ISSUED < / code > . * @ return Returns a reference to this object so that method calls can be chained together . */ public CertificateDetail withDomainValidationOptions ( DomainValidation ... domainValidationOptions ) { } }
if ( this . domainValidationOptions == null ) { setDomainValidationOptions ( new java . util . ArrayList < DomainValidation > ( domainValidationOptions . length ) ) ; } for ( DomainValidation ele : domainValidationOptions ) { this . domainValidationOptions . add ( ele ) ; } return this ;
public class PhoneIntents { /** * Creates an intent that will immediately dispatch a call to the given number . NOTE that unlike * { @ link # newDialNumberIntent ( String ) } , this intent requires the { @ link android . Manifest . permission # CALL _ PHONE } * permission to be set . * @ param phoneNumber the number to call * @ return the intent */ public static Intent newCallNumberIntent ( String phoneNumber ) { } }
final Intent intent ; if ( phoneNumber == null || phoneNumber . trim ( ) . length ( ) <= 0 ) { intent = new Intent ( Intent . ACTION_CALL , Uri . parse ( "tel:" ) ) ; } else { intent = new Intent ( Intent . ACTION_CALL , Uri . parse ( "tel:" + phoneNumber . replace ( " " , "" ) ) ) ; } return intent ;
public class XStringForChars { /** * Copies characters from this string into the destination character * array . * @ param srcBegin index of the first character in the string * to copy . * @ param srcEnd index after the last character in the string * to copy . * @ param dst the destination array . * @ param dstBegin the start offset in the destination array . * @ exception IndexOutOfBoundsException If any of the following * is true : * < ul > < li > < code > srcBegin < / code > is negative . * < li > < code > srcBegin < / code > is greater than < code > srcEnd < / code > * < li > < code > srcEnd < / code > is greater than the length of this * string * < li > < code > dstBegin < / code > is negative * < li > < code > dstBegin + ( srcEnd - srcBegin ) < / code > is larger than * < code > dst . length < / code > < / ul > * @ exception NullPointerException if < code > dst < / code > is < code > null < / code > */ public void getChars ( int srcBegin , int srcEnd , char dst [ ] , int dstBegin ) { } }
System . arraycopy ( ( char [ ] ) m_obj , m_start + srcBegin , dst , dstBegin , srcEnd ) ;
public class GVRVideoSceneObject { /** * Creates a player wrapper for the Android MediaPlayer . */ public static GVRVideoSceneObjectPlayer < MediaPlayer > makePlayerInstance ( final MediaPlayer mediaPlayer ) { } }
return new GVRVideoSceneObjectPlayer < MediaPlayer > ( ) { @ Override public MediaPlayer getPlayer ( ) { return mediaPlayer ; } @ Override public void setSurface ( Surface surface ) { mediaPlayer . setSurface ( surface ) ; } @ Override public void release ( ) { mediaPlayer . release ( ) ; } @ Override public boolean canReleaseSurfaceImmediately ( ) { return true ; } @ Override public void pause ( ) { try { mediaPlayer . pause ( ) ; } catch ( final IllegalStateException exc ) { // intentionally ignored ; might have been released already or never got to be // initialized } } @ Override public void start ( ) { mediaPlayer . start ( ) ; } @ Override public boolean isPlaying ( ) { return mediaPlayer . isPlaying ( ) ; } } ;
public class OcciVMUtils { /** * Retrieves VM status ( tested on CA only ) . * @ param hostIpPort IP and port of OCCI server ( eg . " 172.16.225.91:8080 " ) * @ param id Unique VM ID * @ return The VM ' s status * @ throws TargetException */ public static String getVMStatus ( String hostIpPort , String id ) throws TargetException { } }
if ( id . startsWith ( "urn:uuid:" ) ) id = id . substring ( 9 ) ; String status = null ; URL url = null ; try { CookieHandler . setDefault ( new CookieManager ( null , CookiePolicy . ACCEPT_ALL ) ) ; url = new URL ( "http://" + hostIpPort + "/compute/" + id ) ; } catch ( MalformedURLException e ) { throw new TargetException ( e ) ; } HttpURLConnection httpURLConnection = null ; DataInputStream in = null ; try { httpURLConnection = ( HttpURLConnection ) url . openConnection ( ) ; httpURLConnection . setRequestMethod ( "GET" ) ; httpURLConnection . setRequestProperty ( "Accept" , "application/json" ) ; in = new DataInputStream ( httpURLConnection . getInputStream ( ) ) ; ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; Utils . copyStreamSafely ( in , out ) ; // Parse JSON response to extract VM status ObjectMapper objectMapper = new ObjectMapper ( ) ; JsonResponse rsp = objectMapper . readValue ( out . toString ( "UTF-8" ) , JsonResponse . class ) ; status = rsp . getState ( ) ; } catch ( IOException e ) { throw new TargetException ( e ) ; } finally { Utils . closeQuietly ( in ) ; if ( httpURLConnection != null ) { httpURLConnection . disconnect ( ) ; } } return status ;
public class WebAppDispatcherContext { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . webcontainer . webapp . IWebAppDispatcherContext # getWebApp ( ) */ public WebApp getWebApp ( ) { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getWebApp" , "webapp -> " + _webApp + " ,this -> " + this ) ; } return _webApp ;
public class BytecodeUtils { /** * Pushes a class type onto the stack from the string representation This can * also handle primitives * @ param b the bytecode * @ param classType the type descriptor for the class or primitive to push . * This will accept both the java . lang . Object form and the * Ljava / lang / Object ; form */ public static void pushClassType ( CodeAttribute b , String classType ) { } }
if ( classType . length ( ) != 1 ) { if ( classType . startsWith ( "L" ) && classType . endsWith ( ";" ) ) { classType = classType . substring ( 1 , classType . length ( ) - 1 ) ; } b . loadClass ( classType ) ; } else { char type = classType . charAt ( 0 ) ; switch ( type ) { case 'I' : b . getstatic ( Integer . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case 'J' : b . getstatic ( Long . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case 'S' : b . getstatic ( Short . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case 'F' : b . getstatic ( Float . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case 'D' : b . getstatic ( Double . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case 'B' : b . getstatic ( Byte . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case 'C' : b . getstatic ( Character . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case 'Z' : b . getstatic ( Boolean . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; default : throw new RuntimeException ( "Cannot handle primitive type: " + type ) ; } }
public class CursorList { /** * Unsupported since { @ link CursorList } s aren ' t backed by columns . */ @ Override public int getColumnIndexOrThrow ( String columnName ) throws IllegalArgumentException { } }
int result = getColumnIndex ( columnName ) ; if ( result == - 1 ) { throw new IllegalArgumentException ( "CursorList is not backed by columns." ) ; } return result ;
public class Gen { /** * Generate code for a catch clause . * @ param tree The catch clause . * @ param env The environment current in the enclosing try . * @ param startpc Start pc of try - block . * @ param endpc End pc of try - block . */ void genCatch ( JCCatch tree , Env < GenContext > env , int startpc , int endpc , List < Integer > gaps ) { } }
if ( startpc != endpc ) { List < JCExpression > subClauses = TreeInfo . isMultiCatch ( tree ) ? ( ( JCTypeUnion ) tree . param . vartype ) . alternatives : List . of ( tree . param . vartype ) ; while ( gaps . nonEmpty ( ) ) { for ( JCExpression subCatch : subClauses ) { int catchType = makeRef ( tree . pos ( ) , subCatch . type ) ; int end = gaps . head . intValue ( ) ; registerCatch ( tree . pos ( ) , startpc , end , code . curCP ( ) , catchType ) ; if ( subCatch . type . isAnnotated ( ) ) { for ( Attribute . TypeCompound tc : subCatch . type . getAnnotationMirrors ( ) ) { tc . position . type_index = catchType ; } } } gaps = gaps . tail ; startpc = gaps . head . intValue ( ) ; gaps = gaps . tail ; } if ( startpc < endpc ) { for ( JCExpression subCatch : subClauses ) { int catchType = makeRef ( tree . pos ( ) , subCatch . type ) ; registerCatch ( tree . pos ( ) , startpc , endpc , code . curCP ( ) , catchType ) ; if ( subCatch . type . isAnnotated ( ) ) { for ( Attribute . TypeCompound tc : subCatch . type . getAnnotationMirrors ( ) ) { tc . position . type_index = catchType ; } } } } VarSymbol exparam = tree . param . sym ; code . statBegin ( tree . pos ) ; code . markStatBegin ( ) ; int limit = code . nextreg ; int exlocal = code . newLocal ( exparam ) ; items . makeLocalItem ( exparam ) . store ( ) ; code . statBegin ( TreeInfo . firstStatPos ( tree . body ) ) ; genStat ( tree . body , env , CRT_BLOCK ) ; code . endScopes ( limit ) ; code . statBegin ( TreeInfo . endPos ( tree . body ) ) ; }
public class ColumnPairAction { /** * 添加Channel * @ param channelInfo * @ param channelParameterInfo * @ throws Exception */ public void doSave ( @ Param ( "dataMediaPairId" ) Long dataMediaPairId , @ Param ( "submitKey" ) String submitKey , @ Param ( "channelId" ) Long channelId , @ Param ( "pipelineId" ) Long pipelineId , @ Param ( "sourceMediaId" ) Long sourceMediaId , @ Param ( "targetMediaId" ) Long targetMediaId , @ FormGroup ( "columnPairInfo" ) Group columnPairInfo , @ FormField ( name = "formColumnPairError" , group = "columnPairInfo" ) CustomErrors err , Navigator nav ) throws Exception { } }
String [ ] sourceColumns = columnPairInfo . getField ( "dltTarget_l" ) . getStringValues ( ) ; String [ ] targetColumns = columnPairInfo . getField ( "dltTarget_r" ) . getStringValues ( ) ; List < String > sourceColumnNames = new ArrayList < String > ( ) ; List < String > targetColumnNames = new ArrayList < String > ( ) ; for ( String sourceColumn : sourceColumns ) { sourceColumnNames . add ( sourceColumn ) ; } for ( String targetColumn : targetColumns ) { targetColumnNames . add ( targetColumn ) ; } DataMedia targetMedia = dataMediaPairService . findById ( dataMediaPairId ) . getTarget ( ) ; if ( ! targetMedia . getSource ( ) . getType ( ) . isNapoli ( ) && sourceColumnNames . size ( ) != targetColumnNames . size ( ) ) { err . setMessage ( "invalidColumnPair" ) ; return ; } List < ColumnPair > columnPairsInDb = dataColumnPairService . listByDataMediaPairId ( dataMediaPairId ) ; List < ColumnPair > columnPairsTemp = new ArrayList < ColumnPair > ( ) ; List < String > columnPairsNameSource = new ArrayList < String > ( ) ; List < String > columnPairsNameTarget = new ArrayList < String > ( ) ; List < ColumnPair > columnPairs = new ArrayList < ColumnPair > ( ) ; if ( targetMedia . getSource ( ) . getType ( ) . isNapoli ( ) ) { for ( ColumnPair columnPair : columnPairsInDb ) { for ( String sourceColumnName : sourceColumnNames ) { if ( StringUtils . isEquals ( columnPair . getSourceColumn ( ) . getName ( ) , sourceColumnName ) ) { columnPairsTemp . add ( columnPair ) ; columnPairsNameSource . add ( sourceColumnName ) ; } } } // 要从数据库中删除这些columnPair columnPairsInDb . removeAll ( columnPairsTemp ) ; sourceColumnNames . removeAll ( columnPairsNameSource ) ; for ( String columnName : sourceColumnNames ) { ColumnPair columnPair = new ColumnPair ( ) ; columnPair . setSourceColumn ( new Column ( columnName ) ) ; columnPair . setDataMediaPairId ( dataMediaPairId ) ; columnPairs . add ( columnPair ) ; } } else if ( targetMedia . getSource ( ) . getType ( ) . isMysql ( ) || targetMedia . getSource ( ) . getType ( ) . isOracle ( ) ) { for ( ColumnPair columnPair : columnPairsInDb ) { int i = 0 ; for ( String sourceColumnName : sourceColumnNames ) { if ( StringUtils . isEquals ( columnPair . getSourceColumn ( ) . getName ( ) , sourceColumnName ) && StringUtils . isEquals ( columnPair . getTargetColumn ( ) . getName ( ) , targetColumnNames . get ( i ) ) ) { columnPairsTemp . add ( columnPair ) ; columnPairsNameSource . add ( sourceColumnName ) ; columnPairsNameTarget . add ( targetColumnNames . get ( i ) ) ; } i ++ ; } } // 要从数据库中删除这些columnPair columnPairsInDb . removeAll ( columnPairsTemp ) ; sourceColumnNames . removeAll ( columnPairsNameSource ) ; targetColumnNames . removeAll ( columnPairsNameTarget ) ; int i = 0 ; for ( String columnName : sourceColumnNames ) { ColumnPair columnPair = new ColumnPair ( ) ; columnPair . setSourceColumn ( new Column ( columnName ) ) ; columnPair . setTargetColumn ( new Column ( targetColumnNames . get ( i ) ) ) ; columnPair . setDataMediaPairId ( dataMediaPairId ) ; columnPairs . add ( columnPair ) ; i ++ ; } } for ( ColumnPair columnPair : columnPairsInDb ) { dataColumnPairService . remove ( columnPair . getId ( ) ) ; } dataColumnPairService . createBatch ( columnPairs ) ; if ( submitKey . equals ( "保存" ) ) { nav . redirectToLocation ( "dataMediaPairList.htm?pipelineId=" + pipelineId ) ; } else if ( submitKey . equals ( "下一步" ) ) { nav . redirectToLocation ( "addColumnPairGroup.htm?dataMediaPairId=" + dataMediaPairId + "&channelId=" + channelId + "&pipelineId=" + pipelineId + "&sourceMediaId=" + sourceMediaId + "&targetMediaId=" + targetMediaId ) ; }
public class MIDDCombiner { /** * Combine two MIDD DAG using PCA algorithm . testing version 2012.11.02 : this version is to support ordered * combining algorithms ( e . g . first - applicable ) * @ param midd1 * @ param midd2 * @ return */ public AbstractNode combine ( AbstractNode midd1 , AbstractNode midd2 ) throws MIDDException { } }
if ( midd1 instanceof ExternalNode3 ) { if ( midd2 instanceof ExternalNode3 ) { return combineExternalNodes ( ( ExternalNode3 ) midd1 , ( ExternalNode3 ) midd2 ) ; // combine two external nodes } else { ExternalNode3 n1 = ( ExternalNode3 ) midd1 ; InternalNode < ? > n2 = ( InternalNode < ? > ) midd2 ; return combineIDD ( n1 , n2 ) ; // combine an external node n1 with an internal node n2 } } else { InternalNode < ? > n1 = ( InternalNode < ? > ) midd1 ; if ( midd2 instanceof ExternalNode3 ) { // combine an internal node ( midd1 ) with an external node ( midd2) ExternalNode3 n2 = ( ExternalNode3 ) midd2 ; return combineIDD ( n1 , n2 ) ; // combine an internal node n1 with an external node2 } else { // both are internal nodes , combine two internal nodes here InternalNode < ? > n2 = ( InternalNode < ? > ) midd2 ; if ( n1 . getID ( ) == n2 . getID ( ) ) { return combineIDDSameLevel ( n1 , n2 ) ; } else { // Algorithm : find a node with lower order , e . g : n1 // - Create a node clone from n1 - > n // - combine n2 with all children of n1 - > children [ 1 . . k ] , add them to children of n InternalNode < ? > n = null ; if ( n1 . getID ( ) < n2 . getID ( ) ) { // Clone n1 n = NodeUtils . createInternalNode ( n1 , n1 . getType ( ) ) ; for ( AbstractEdge < ? > e : n1 . getEdges ( ) ) { AbstractNode child = combine ( e . getSubDiagram ( ) , n2 ) ; if ( child != null ) { n . addChild ( EdgeUtils . cloneEdge ( e ) , child ) ; } else { log . error ( "empty child" ) ; } } // Create a new edge containing the complement of n1 children intervals , connecting n with n2 List < Interval < ? > > complementIntervals = IntervalUtils . complement ( n1 . getIntervals ( ) ) ; if ( complementIntervals . size ( ) > 0 ) { AbstractEdge < ? > edge = EdgeUtils . createEdge ( complementIntervals , n1 . getType ( ) ) ; n . addChild ( edge , n2 ) ; } } else { // n2 has lower id than n1 , do in other way . n = NodeUtils . createInternalNode ( n2 , n2 . getType ( ) ) ; for ( AbstractEdge < ? > e : n2 . getEdges ( ) ) { AbstractNode child = combine ( n1 , e . getSubDiagram ( ) ) ; if ( child != null ) { n . addChild ( EdgeUtils . cloneEdge ( e ) , child ) ; } } // Create a new edge containing the complement of n2 children intervals , connecting n with n1 List < Interval < ? > > complementIntervals = IntervalUtils . complement ( n2 . getIntervals ( ) ) ; if ( complementIntervals . size ( ) > 0 ) { AbstractEdge < ? > edge = EdgeUtils . createEdge ( complementIntervals , n2 . getType ( ) ) ; n . addChild ( edge , n1 ) ; } } if ( n . getEdges ( ) . size ( ) > 0 ) { return n ; } else { return null ; } } } }
public class AbstractXServlet { /** * This method logs errors , in case a HttpServletRequest object is missing basic * information or uses unsupported values for e . g . HTTP version and HTTP method . * @ param sMsg * The concrete message to emit . May not be < code > null < / code > . * @ param aHttpRequest * The current HTTP request . May not be < code > null < / code > . */ @ OverrideOnDemand protected void logInvalidRequestSetup ( @ Nonnull final String sMsg , @ Nonnull final HttpServletRequest aHttpRequest ) { } }
log ( sMsg + ":\n" + RequestLogger . getRequestDebugString ( aHttpRequest ) . toString ( ) ) ;
public class SecurityDomainJBossASClient { /** * Create a new security domain using the SecureIdentity authentication method . * This is used when you want to obfuscate a database password in the configuration . * This is the version for as7.2 + ( e . g . eap 6.1) * @ param securityDomainName the name of the new security domain * @ param username the username associated with the security domain * @ param password the value of the password to store in the configuration * ( e . g . the obfuscated password itself ) * @ throws Exception if failed to create security domain */ public void createNewSecureIdentitySecurityDomain72 ( String securityDomainName , String username , String password ) throws Exception { } }
Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_SECURITY , SECURITY_DOMAIN , securityDomainName ) ; ModelNode addTopNode = createRequest ( ADD , addr ) ; addTopNode . get ( CACHE_TYPE ) . set ( "default" ) ; Address authAddr = addr . clone ( ) . add ( AUTHENTICATION , CLASSIC ) ; ModelNode addAuthNode = createRequest ( ADD , authAddr ) ; Address loginAddr = authAddr . clone ( ) . add ( "login-module" , "SecureIdentity" ) ; ModelNode loginModule = createRequest ( ADD , loginAddr ) ; loginModule . get ( CODE ) . set ( "SecureIdentity" ) ; loginModule . get ( FLAG ) . set ( "required" ) ; ModelNode moduleOptions = loginModule . get ( MODULE_OPTIONS ) ; moduleOptions . setEmptyList ( ) ; addPossibleExpression ( moduleOptions , USERNAME , username ) ; addPossibleExpression ( moduleOptions , PASSWORD , password ) ; ModelNode batch = createBatchRequest ( addTopNode , addAuthNode , loginModule ) ; ModelNode results = execute ( batch ) ; if ( ! isSuccess ( results ) ) { throw new FailureException ( results , "Failed to create security domain [" + securityDomainName + "]" ) ; } return ;
public class CmsUgcSession { /** * Creates a new edit resource . < p > * @ return the newly created resource * @ throws CmsUgcException if creating the resource fails */ public CmsResource createXmlContent ( ) throws CmsUgcException { } }
checkNotFinished ( ) ; checkEditResourceNotSet ( ) ; CmsUgcSessionSecurityUtil . checkCreateContent ( m_cms , m_configuration ) ; try { I_CmsResourceType type = OpenCms . getResourceManager ( ) . getResourceType ( m_configuration . getResourceType ( ) ) ; m_editResource = m_cms . createResource ( getNewContentName ( ) , type ) ; return m_editResource ; } catch ( CmsException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; throw new CmsUgcException ( e , CmsUgcConstants . ErrorCode . errMisc , e . getLocalizedMessage ( ) ) ; }
public class RandomUtil { /** * Returns the random generator . */ public static Random getRandom ( ) { } }
if ( _isTest ) { return _testRandom ; } Random random = _freeRandomList . allocate ( ) ; if ( random == null ) { random = new SecureRandom ( ) ; } return random ;
public class ViewPositionAnimator { /** * Stops current animation and sets position state to particular values . * Note , that once animator reaches { @ code state = 0f } and { @ code isLeaving = true } * it will cleanup all internal stuff . So you will need to call { @ link # enter ( View , boolean ) } * or { @ link # enter ( ViewPosition , boolean ) } again in order to continue using animator . * @ param pos Current position * @ param leaving Whether we we are in exiting direction ( { @ code true } ) or in entering * ( { @ code false } ) * @ param animate Whether we should start animating from given position and in given direction */ public void setState ( @ FloatRange ( from = 0f , to = 1f ) float pos , boolean leaving , boolean animate ) { } }
if ( ! isActivated ) { throw new IllegalStateException ( "You should call enter(...) before calling setState(...)" ) ; } stopAnimation ( ) ; position = pos < 0f ? 0f : ( pos > 1f ? 1f : pos ) ; isLeaving = leaving ; if ( animate ) { startAnimationInternal ( ) ; } applyCurrentPosition ( ) ;
public class PhoneNumberUtil { /** * parse phone number . * @ param pphoneNumber phone number as string with length * @ return PhoneNumberData with length */ public ValueWithPos < PhoneNumberData > parsePhoneNumber ( final ValueWithPos < String > pphoneNumber ) { } }
return this . parsePhoneNumber ( pphoneNumber , new PhoneNumberData ( ) , defaultCountryData ) ;
public class SortedArrayList { /** * adds an element to the list in its place based on natural order . allows duplicates . * @ param element * element to be appended to this list * @ return true if this collection changed as a result of the call */ public boolean addSorted ( E element ) { } }
boolean added = false ; added = super . add ( element ) ; Comparable < E > cmp = ( Comparable < E > ) element ; for ( int i = size ( ) - 1 ; i > 0 && cmp . compareTo ( get ( i - 1 ) ) < 0 ; i -- ) Collections . swap ( this , i , i - 1 ) ; return added ;
public class ForkOperatorUtils { /** * Get a new property key from an original one based on the branch id . The method assumes the branch id specified by * the { @ link ConfigurationKeys # FORK _ BRANCH _ ID _ KEY } parameter in the given WorkUnitState . The fork id key specifies * which fork this parameter belongs to . Note this method will only provide the aforementioned functionality for * { @ link org . apache . gobblin . converter . Converter } s . To get the same functionality in { @ link org . apache . gobblin . writer . DataWriter } s use * the { @ link org . apache . gobblin . writer . DataWriterBuilder # forBranch ( int ) } to construct a writer with a specific branch id . * @ param workUnitState contains the fork id key * @ param key property key * @ return a new property key */ public static String getPropertyNameForBranch ( WorkUnitState workUnitState , String key ) { } }
Preconditions . checkNotNull ( workUnitState , "Cannot get a property from a null WorkUnit" ) ; Preconditions . checkNotNull ( key , "Cannot get a the value for a null key" ) ; if ( ! workUnitState . contains ( ConfigurationKeys . FORK_BRANCH_ID_KEY ) ) { return key ; } return workUnitState . getPropAsInt ( ConfigurationKeys . FORK_BRANCH_ID_KEY ) >= 0 ? key + "." + workUnitState . getPropAsInt ( ConfigurationKeys . FORK_BRANCH_ID_KEY ) : key ;
public class ThreadBoundLogOutputStream { /** * get the thread ' s event buffer , reset it if it is empty * @ return */ private Holder < T > getOrReset ( ) { } }
if ( buffer . get ( ) == null || buffer . get ( ) . getBuffer ( ) . isEmpty ( ) ) { resetEventBuffer ( ) ; } return buffer . get ( ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcLightDistributionDataSourceSelect ( ) { } }
if ( ifcLightDistributionDataSourceSelectEClass == null ) { ifcLightDistributionDataSourceSelectEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 960 ) ; } return ifcLightDistributionDataSourceSelectEClass ;
public class LineReader { /** * Read a line into the given buffer . * @ param buf Buffer . * @ return { @ code true } if some characters have been read . */ public boolean readLine ( Appendable buf ) throws IOException { } }
boolean success = false ; while ( true ) { // Process buffer : while ( pos < end ) { success = true ; final char c = buffer [ pos ++ ] ; if ( c == '\n' ) { return success ; } if ( c == '\r' ) { continue ; } buf . append ( c ) ; } // Refill buffer : assert ( pos >= end ) : "Buffer wasn't empty when refilling!" ; end = in . read ( buffer , 0 , buffer . length ) ; pos = 0 ; if ( end < 0 ) { // End of stream . return success ; } }
public class UserApi { /** * Get an impersonation token of a user as an Optional instance . Available only for admin users . * < pre > < code > GitLab Endpoint : GET / users / : user _ id / impersonation _ tokens / : impersonation _ token _ id < / code > < / pre > * @ param userIdOrUsername the user in the form of an Integer ( ID ) , String ( username ) , or User instance * @ param tokenId the impersonation token ID to get * @ return the specified impersonation token as an Optional instance */ public Optional < ImpersonationToken > getOptionalImpersonationToken ( Object userIdOrUsername , Integer tokenId ) { } }
try { return ( Optional . ofNullable ( getImpersonationToken ( userIdOrUsername , tokenId ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; }
public class TrieIterator { /** * Set the result values * @ param element return result object * @ param start codepoint of range * @ param limit ( end + 1 ) codepoint of range * @ param value common value of range */ private final void setResult ( Element element , int start , int limit , int value ) { } }
element . start = start ; element . limit = limit ; element . value = value ;
public class AbstractVersionIdentifier { /** * This method performs the part of { @ link # compareTo ( VersionIdentifier ) } for the { @ link # getRevision ( ) * revision } . * @ param currentResult is the current result so far . * @ param otherVersion is the { @ link VersionIdentifier } to compare to . * @ return the result of comparison . */ private int compareToRevision ( int currentResult , VersionIdentifier otherVersion ) { } }
return compareToLinear ( currentResult , getRevision ( ) , otherVersion . getRevision ( ) , otherVersion ) ;
public class TrieMap { /** * { @ inheritDoc } */ @ Override public Set < CharSequence > keySet ( ) { } }
final Set < CharSequence > ks = keySet ; return ks != null ? ks : ( keySet = new KeySet ( ) ) ;
public class RegistryAuth { /** * This function looks for and parses credentials for logging into the Docker registry specified * by serverAddress . We first look in ~ / . docker / config . json and fallback to ~ / . dockercfg . These * files are created from running ` docker login ` . * @ param serverAddress A string representing the server address * @ return a { @ link Builder } * @ throws IOException when we can ' t parse the docker config file */ @ SuppressWarnings ( "unused" ) public static Builder fromDockerConfig ( final String serverAddress ) throws IOException { } }
DockerConfigReader dockerCfgReader = new DockerConfigReader ( ) ; return dockerCfgReader . authForRegistry ( dockerCfgReader . defaultConfigPath ( ) , serverAddress ) . toBuilder ( ) ;
public class SourceStream { /** * any messages while some are being reallocated */ public synchronized void guessesInStream ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "guessesInStream" , Boolean . valueOf ( containsGuesses ) ) ; containsGuesses = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "guessesInStream" , Boolean . valueOf ( containsGuesses ) ) ;
public class ClientState { /** * This clock guarantees that updates for the same ClientState will be ordered * in the sequence seen , even if multiple updates happen in the same millisecond . */ public long getTimestamp ( ) { } }
while ( true ) { long current = System . currentTimeMillis ( ) * 1000 ; long last = lastTimestampMicros . get ( ) ; long tstamp = last >= current ? last + 1 : current ; if ( lastTimestampMicros . compareAndSet ( last , tstamp ) ) return tstamp ; }
public class CloudVirtualNetworkController { /** * Cloud Virtual Network Endpoints */ @ RequestMapping ( value = "/cloud/virtualnetwork/create" , method = POST , consumes = APPLICATION_JSON_VALUE , produces = APPLICATION_JSON_VALUE ) public ResponseEntity < List < ObjectId > > upsertVirtualNetwork ( @ Valid @ RequestBody List < CloudVirtualNetwork > request ) { } }
return ResponseEntity . ok ( ) . body ( cloudVirtualNetworkService . upsertVirtualNetwork ( request ) ) ;
public class ExtensionRegistries { /** * Adds all extensions , including dependencies , for the given FileDescriptor to the registry . */ public static ExtensionRegistry addWithDependeciesToRegistry ( final FileDescriptor file , final ExtensionRegistry registry ) { } }
for ( final FileDescriptor dependency : getFileWithAllDependencies ( file ) ) { addToRegistry ( dependency , registry ) ; } return registry ;
public class QueryBitmapConverter { /** * Set up the default control for this field . * A SCannedBox for a query bitmap converter . * @ param itsLocation Location of this component on screen ( ie . , GridBagConstraint ) . * @ param targetScreen Where to place this component ( ie . , Parent screen or GridBagLayout ) . * @ param iDisplayFieldDesc Display the label ? ( optional ) . * @ return Return the component or ScreenField that is created for this field . */ public ScreenComponent setupDefaultView ( ScreenLoc itsLocation , ComponentParent targetScreen , Convert converter , int iDisplayFieldDesc , Map < String , Object > properties ) { } }
properties = new HashMap < String , Object > ( ) ; properties . put ( ScreenModel . COMMAND , MenuConstants . FORMLINK ) ; properties . put ( ScreenModel . IMAGE , MenuConstants . FORM ) ; return BaseField . createScreenComponent ( ScreenModel . CANNED_BOX , targetScreen . getNextLocation ( ScreenConstants . RIGHT_OF_LAST , ScreenConstants . DONT_SET_ANCHOR ) , targetScreen , converter , iDisplayFieldDesc , properties ) ;
public class RuntimeTypeAdapterFactory { /** * Creates a new runtime type adapter for { @ code baseType } using { @ code " type " } as * the type field name . */ public static < T > RuntimeTypeAdapterFactory < T > of ( Class < T > baseType ) { } }
return new RuntimeTypeAdapterFactory < T > ( baseType , "type" , false ) ;
public class RESTClient { /** * Old REST client uses old REST service */ public void useOldRESTService ( ) throws Exception { } }
List < Object > providers = createJAXRSProviders ( ) ; com . example . customerservice . CustomerService customerService = JAXRSClientFactory . createFromModel ( "http://localhost:" + port + "/examples/direct/rest" , com . example . customerservice . CustomerService . class , "classpath:/model/CustomerService-jaxrs.xml" , providers , null ) ; System . out . println ( "Using old RESTful CustomerService with old client" ) ; customer . v1 . Customer customer = createOldCustomer ( "Smith Old REST" ) ; customerService . updateCustomer ( customer ) ; customer = customerService . getCustomerByName ( "Smith Old REST" ) ; printOldCustomerDetails ( customer ) ;