signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class EJBSerializerImpl { /** * ( non - Javadoc )
* @ see com . ibm . ws . ejbcontainer . util . EJBSerializer # serialize ( java . lang . Object ) */
@ Override public byte [ ] serialize ( Object theObject ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "serialize = " + theObject . getClass ( ) ) ; } byte [ ] idBytes = null ; if ( theObject instanceof WrapperProxy ) // F58064
{ WrapperProxyState state = WrapperProxyState . getWrapperProxyState ( theObject ) ; idBytes = state . getSerializerBytes ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "serialized a WrapperProxy for " + state ) ; } else { EJSWrapperBase wrapper = null ; if ( theObject instanceof EJSWrapperBase ) { wrapper = ( EJSWrapperBase ) theObject ; } else if ( theObject instanceof LocalBeanWrapper ) // d609263
{ wrapper = EJSWrapperCommon . getLocalBeanWrapperBase ( ( LocalBeanWrapper ) theObject ) ; } else { throw new IllegalArgumentException ( " theObject parameter must be a EJB_LOCAL, EJB_LOCAL_HOME" + ", EJB_BUSINESS_LOCAL, or EJB_BUSINESS_REMOTE ObjectType. Use the getObjectType" + " to obtain the ObjectType." ) ; } // Get the BeanId and WrapperInterface from the wrapper .
BeanId beanId = wrapper . beanId ; WrapperInterface wrapperInterface = wrapper . ivInterface ; BeanMetaData bmd = wrapper . bmd ; // Use type of wrapper interface to determine whether to
// serialize a WrapperId or a BeanId object .
if ( wrapperInterface == WrapperInterface . BUSINESS_LOCAL ) { // Serialize a WrapperId for local business interface .
int interfaceIndex = wrapper . ivBusinessInterfaceIndex ; String interfaceName ; if ( interfaceIndex == EJSWrapperBase . AGGREGATE_LOCAL_INDEX ) { // F743-34304
interfaceName = EJSWrapperBase . AGGREGATE_EYE_CATCHER ; // d677413
} else { Class < ? > biClass = bmd . ivBusinessLocalInterfaceClasses [ interfaceIndex ] ; interfaceName = biClass . getName ( ) ; } WrapperId wrapperId = new WrapperId ( beanId . getByteArrayBytes ( ) // d458325
, interfaceName , interfaceIndex ) ; idBytes = wrapperId . getBytes ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "serialized a WrapperId for BeanId = " + beanId + ", local business interface = " + interfaceName ) ; } } else if ( wrapperInterface == WrapperInterface . BUSINESS_REMOTE ) { // Serialize a WrapperId for remote business interface .
int interfaceIndex = wrapper . ivBusinessInterfaceIndex ; Class < ? > biClass = bmd . ivBusinessRemoteInterfaceClasses [ interfaceIndex ] ; String interfaceName = biClass . getName ( ) ; WrapperId wrapperId = new WrapperId ( beanId . getByteArrayBytes ( ) // d458325
, interfaceName , interfaceIndex ) ; idBytes = wrapperId . getBytes ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "serialized a WrapperId for BeanId = " + beanId + ", remote business interface = " + interfaceName ) ; } } else if ( wrapperInterface == WrapperInterface . BUSINESS_RMI_REMOTE ) { // Serialize a WrapperId for a RMI remote business interface .
int interfaceIndex = wrapper . ivBusinessInterfaceIndex ; Class < ? > biClass = bmd . ivBusinessRemoteInterfaceClasses [ interfaceIndex ] ; String interfaceName = biClass . getName ( ) ; WrapperId wrapperId = new WrapperId ( beanId . getByteArrayBytes ( ) // d458325
, interfaceName , interfaceIndex ) ; idBytes = wrapperId . getBytes ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "serialized a WrapperId for BeanId = " + beanId + ", RMI remote business interface = " + interfaceName ) ; } } else { // Not a business interface , so must be a local or remote interface of
// a 2.1 bean or a 2.1 view of a EJB 3 bean . Either case , we only need
// to save the BeanId for this kind of wrapper .
idBytes = beanId . getByteArrayBytes ( ) ; // d466573
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "serialized a BeanId = " + beanId ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "serialize" ) ; } return idBytes ; |
public class SystemDnsServer { /** * has 300s latency when system resolv change https : / / community . oracle . com / thread / 1148912 */
public static String [ ] getByJNDI ( ) { } } | try { Class < ? > dirContext = Class . forName ( "javax.naming.directory.DirContext" ) ; Hashtable < String , String > env = new Hashtable < String , String > ( ) ; env . put ( "java.naming.factory.initial" , "com.sun.jndi.dns.DnsContextFactory" ) ; Class < ? > initialDirContext = Class . forName ( "javax.naming.directory.InitialDirContext" ) ; Constructor < ? > constructor = initialDirContext . getConstructor ( Hashtable . class ) ; Object obj = constructor . newInstance ( env ) ; Method m = dirContext . getMethod ( "getEnvironment" ) ; Hashtable newEnv = ( Hashtable ) m . invoke ( obj ) ; String dns = ( String ) newEnv . get ( "java.naming.provider.url" ) ; String dnsTrim = dns . replace ( "dns://" , "" ) ; return dnsTrim . split ( " " ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return null ; |
public class DeleteApplicationOutputRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteApplicationOutputRequest deleteApplicationOutputRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteApplicationOutputRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteApplicationOutputRequest . getApplicationName ( ) , APPLICATIONNAME_BINDING ) ; protocolMarshaller . marshall ( deleteApplicationOutputRequest . getCurrentApplicationVersionId ( ) , CURRENTAPPLICATIONVERSIONID_BINDING ) ; protocolMarshaller . marshall ( deleteApplicationOutputRequest . getOutputId ( ) , OUTPUTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class GMRKImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EList < GMRKRG > getRg ( ) { } } | if ( rg == null ) { rg = new EObjectContainmentEList . Resolving < GMRKRG > ( GMRKRG . class , this , AfplibPackage . GMRK__RG ) ; } return rg ; |
public class BeanHelper { /** * Applies bean action by using given factory
* < p > Bean actions are :
* < p > List item property remove by adding ' # ' to the end of pattern .
* < p > E . g . list . 3 - - list . remove ( 3)
* < p > List item creation to the end of the list .
* < p > E . g . list + - add ( factory . get ( cls , null ) )
* < p > E . g . list + hint - add ( factory . get ( cls , hint ) )
* @ param < T >
* @ param bean
* @ param property
* @ param factory
* @ return true if pattern was applied */
public static final < T > T applyList ( Object bean , String property , BiFunction < Class < T > , String , T > factory ) { } } | int addIdx = property . lastIndexOf ( Add ) ; if ( addIdx != - 1 ) { String hint = property . substring ( addIdx + 1 ) ; return addList ( bean , property . substring ( 0 , addIdx ) , hint , factory ) ; } else { int assignIdx = property . lastIndexOf ( Assign ) ; if ( assignIdx != - 1 ) { String hint = property . substring ( assignIdx + 1 ) ; return assignList ( bean , property . substring ( 0 , assignIdx ) , hint , factory ) ; } else { if ( property . endsWith ( Remove ) ) { return ( T ) removeList ( bean , property . substring ( 0 , property . length ( ) - 1 ) ) ; } else { return null ; } } } |
public class PhysicalEntityWrapper { /** * Finds member nodes if this is a homology node */
protected void initLowerEquivalent ( ) { } } | this . lowerEquivalent = new HashSet < Node > ( ) ; for ( PhysicalEntity eq : pe . getMemberPhysicalEntity ( ) ) { Node node = ( Node ) graph . getGraphObject ( eq ) ; if ( node != null ) this . lowerEquivalent . add ( node ) ; } lowerEquivalentInited = true ; |
public class ICalendar { /** * Assigns a human - readable description to the calendar as a whole .
* An iCalendar object can only have one description , but multiple
* { @ link Description } properties can exist in order to specify the
* description in multiple languages . In this case , each property instance
* must be assigned a LANGUAGE parameter .
* @ param description the description
* @ return the property object that was created
* @ see < a
* href = " http : / / tools . ietf . org / html / draft - ietf - calext - extensions - 01 # page - 6 " > draft - ietf - calext - extensions - 01
* p . 6 < / a > */
public Description addDescription ( String description ) { } } | Description property = new Description ( description ) ; addProperty ( property ) ; return property ; |
public class JMMap { /** * New changed key value with entry map map .
* @ param < K > the type parameter
* @ param < V > the type parameter
* @ param < NK > the type parameter
* @ param < NV > the type parameter
* @ param map the map
* @ param changingKeyFunction the changing key function
* @ param changingValueFunction the changing value function
* @ return the map */
public static < K , V , NK , NV > Map < NK , NV > newChangedKeyValueWithEntryMap ( Map < K , V > map , Function < Entry < K , V > , NK > changingKeyFunction , Function < Entry < K , V > , NV > changingValueFunction ) { } } | return buildEntryStream ( map ) . collect ( toMap ( changingKeyFunction , changingValueFunction ) ) ; |
public class UiSessionDestinationBusCommand { /** * This simply takes the given { @ code message } and sends it directly to the UI client over
* that UI client ' s websocket connection .
* @ see org . hawkular . cmdgw . command . bus . BusCommand # execute ( org . hawkular . bus . common . BasicMessageWithExtraData ,
* org . hawkular . cmdgw . command . bus . BusCommandContext ) */
@ Override public void execute ( BasicMessageWithExtraData < UiSessionDestination > message , BusCommandContext context ) throws Exception { } } | UiSessionDestination request = message . getBasicMessage ( ) ; String destinationSessionId = request . getDestinationSessionId ( ) ; if ( destinationSessionId == null ) { throw new IllegalStateException ( request . getClass ( ) . getName ( ) + ".destinationSessionId must not be null" ) ; } log . tracef ( "[%s] is about to execute the request [%s] " , getClass ( ) . getName ( ) , request ) ; Session session = context . getConnectedUIClients ( ) . getSession ( destinationSessionId ) ; if ( session != null ) { new WebSocketHelper ( ) . sendSync ( session , message ) ; } else { throw new Exception ( "No such sessionId [" + destinationSessionId + "]" ) ; } |
public class Snapshot { /** * Update snapshot by specific contract
* @ param contractId Contract ID
* @ param ts Timestamp
* @ param params Parameters
* @ throwsJSONException If error occurred
* @ return { @ link JSONObject } */
public JSONObject updateByContract ( String contractId , String ts , HashMap < String , String > params ) throws JSONException { } } | return oClient . put ( "/team/v3/snapshots/contracts/" + contractId + "/" + ts , params ) ; |
public class appfwtransactionrecords { /** * Use this API to fetch filtered set of appfwtransactionrecords resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static appfwtransactionrecords [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | appfwtransactionrecords obj = new appfwtransactionrecords ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; appfwtransactionrecords [ ] response = ( appfwtransactionrecords [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class Matrix4f { /** * Pre - multiply a rotation around the X axis to this matrix by rotating the given amount of radians
* about the X axis and store the result in < code > dest < / code > .
* When used with a right - handed coordinate system , the produced rotation will rotate a vector
* counter - clockwise around the rotation axis , when viewing along the negative axis direction towards the origin .
* When used with a left - handed coordinate system , the rotation is clockwise .
* If < code > M < / code > is < code > this < / code > matrix and < code > R < / code > the rotation matrix ,
* then the new matrix will be < code > R * M < / code > . So when transforming a
* vector < code > v < / code > with the new matrix by using < code > R * M * v < / code > , the
* rotation will be applied last !
* In order to set the matrix to a rotation matrix without pre - multiplying the rotation
* transformation , use { @ link # rotationX ( float ) rotationX ( ) } .
* Reference : < a href = " http : / / en . wikipedia . org / wiki / Rotation _ matrix # Rotation _ matrix _ from _ axis _ and _ angle " > http : / / en . wikipedia . org < / a >
* @ see # rotationX ( float )
* @ param ang
* the angle in radians to rotate about the X axis
* @ param dest
* will hold the result
* @ return dest */
public Matrix4f rotateLocalX ( float ang , Matrix4f dest ) { } } | float sin = ( float ) Math . sin ( ang ) ; float cos = ( float ) Math . cosFromSin ( sin , ang ) ; float nm01 = cos * m01 - sin * m02 ; float nm02 = sin * m01 + cos * m02 ; float nm11 = cos * m11 - sin * m12 ; float nm12 = sin * m11 + cos * m12 ; float nm21 = cos * m21 - sin * m22 ; float nm22 = sin * m21 + cos * m22 ; float nm31 = cos * m31 - sin * m32 ; float nm32 = sin * m31 + cos * m32 ; dest . _m00 ( m00 ) ; dest . _m01 ( nm01 ) ; dest . _m02 ( nm02 ) ; dest . _m03 ( m03 ) ; dest . _m10 ( m10 ) ; dest . _m11 ( nm11 ) ; dest . _m12 ( nm12 ) ; dest . _m13 ( m13 ) ; dest . _m20 ( m20 ) ; dest . _m21 ( nm21 ) ; dest . _m22 ( nm22 ) ; dest . _m23 ( m23 ) ; dest . _m30 ( m30 ) ; dest . _m31 ( nm31 ) ; dest . _m32 ( nm32 ) ; dest . _m33 ( m33 ) ; dest . _properties ( properties & ~ ( PROPERTY_PERSPECTIVE | PROPERTY_IDENTITY | PROPERTY_TRANSLATION ) ) ; return dest ; |
public class AbstractHBCIJob { /** * Legt die Versionsnummer des Segments manuell fest .
* Ist u . a . noetig , um HKTAN - Segmente in genau der Version zu senden , in der
* auch die HITANS empfangen wurden . Andernfalls koennte es passieren , dass
* wir ein HKTAN mit einem TAN - Verfahren senden , welches in dieser HKTAN - Version
* gar nicht von der Bank unterstuetzt wird . Das ist ein Dirty - Hack , ich weiss ; )
* Falls das noch IRGENDWO anders verwendet wird , muss man hoellisch aufpassen ,
* dass alle Stellen , wo " this . name " bzw . " this . segVersion " direkt oder indirekt
* verwendet wurde , ebenfalls beruecksichtigt werden .
* @ param version die neue Versionsnummer . */
public void setSegVersion ( int version ) { } } | if ( version < 1 ) { log . warn ( "tried to change segment version for task " + this . jobName + " explicit, but no version given" ) ; return ; } // Wenn sich die Versionsnummer nicht geaendert hat , muessen wir die
// Huehner ja nicht verrueckt machen ; )
if ( version == this . segVersion ) return ; log . info ( "changing segment version for task " + this . jobName + " explicit from " + this . segVersion + " to " + version ) ; // Der alte Name
String oldName = this . name ; // Neuer Name und neue Versionsnummer
this . segVersion = version ; this . name = this . jobName + version ; // Bereits gesetzte llParams fixen
String [ ] names = this . llParams . keySet ( ) . toArray ( new String [ 0 ] ) ; for ( String s : names ) { if ( ! s . startsWith ( oldName ) ) continue ; // nicht betroffen
// Alten Schluessel entfernen und neuen einfuegen
String value = this . llParams . get ( s ) ; String newName = s . replaceFirst ( oldName , this . name ) ; this . llParams . remove ( s ) ; this . llParams . put ( newName , value ) ; } // Destination - Namen in den LowLevel - Parameter auf den neuen Namen umbiegen
constraints . forEach ( ( frontendName , values ) -> { for ( String [ ] value : values ) { // value [ 0 ] ist das Target
if ( ! value [ 0 ] . startsWith ( oldName ) ) continue ; // Hier ersetzen wir z . Bsp . " TAN2Step5 . process " gegen " TAN2Step3 . process "
value [ 0 ] = value [ 0 ] . replaceFirst ( oldName , this . name ) ; } } ) ; |
public class Task { /** * Called by the TaskManagerService to begin the execution of the task . */
@ Override public final void run ( ) { } } | String taskID = m_taskRecord . getTaskID ( ) ; m_logger . debug ( "Starting task '{}' in tenant '{}'" , taskID , m_tenant ) ; try { TaskManagerService . instance ( ) . registerTaskStarted ( this ) ; m_lastProgressTimestamp = System . currentTimeMillis ( ) ; setTaskStart ( ) ; execute ( ) ; setTaskFinish ( ) ; } catch ( Throwable e ) { m_logger . error ( "Task '" + taskID + "' failed" , e ) ; String stackTrace = Utils . getStackTrace ( e ) ; setTaskFailed ( stackTrace ) ; } finally { TaskManagerService . instance ( ) . registerTaskEnded ( this ) ; } |
public class AbstractConfigBuilder { /** * { @ inheritDoc } */
@ Override public ConfigBuilder withConverters ( Converter < ? > ... converters ) { } } | synchronized ( this ) { for ( Converter < ? > con : converters ) { UserConverter < ? > userConverter = UserConverter . newInstance ( con ) ; addUserConverter ( userConverter ) ; } } return this ; |
public class IndexForVc { /** * Iterates over all the configurations of indexVars where the subset of
* variables in config have been clamped to their given values . The
* iterator returns the configuration index of variables in indexVars .
* @ param indexVars Variable set over which to iterate .
* @ param config Clamped assignment .
* @ return Iterator . */
public static IndexForVc getConfigIter ( VarSet indexVars , VarConfig config ) { } } | int fixedConfigContrib = getConfigIndex ( indexVars , config ) ; VarSet forVars = new VarSet ( indexVars ) ; forVars . removeAll ( config . getVars ( ) ) ; return new IndexForVc ( indexVars , forVars , fixedConfigContrib ) ; |
public class InstanceClient { /** * Returns the specified Instance resource . Gets a list of available instances by making a list ( )
* request .
* < p > Sample code :
* < pre > < code >
* try ( InstanceClient instanceClient = InstanceClient . create ( ) ) {
* ProjectZoneInstanceName instance = ProjectZoneInstanceName . of ( " [ PROJECT ] " , " [ ZONE ] " , " [ INSTANCE ] " ) ;
* Instance response = instanceClient . getInstance ( instance ) ;
* < / code > < / pre >
* @ param instance Name of the instance resource to return .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final Instance getInstance ( ProjectZoneInstanceName instance ) { } } | GetInstanceHttpRequest request = GetInstanceHttpRequest . newBuilder ( ) . setInstance ( instance == null ? null : instance . toString ( ) ) . build ( ) ; return getInstance ( request ) ; |
public class MultiIndex { /** * Removes the < code > index < / code > from the list of active sub indexes . The
* Index is not actually deleted right away , but postponed to the
* transaction commit .
* < br >
* This method does not close the index , but rather expects that the index
* has already been closed .
* @ param index
* the index to delete . */
synchronized void deleteIndex ( PersistentIndex index ) { } } | // remove it from the lists if index is registered
indexes . remove ( index ) ; indexNames . removeName ( index . getName ( ) ) ; synchronized ( deletable ) { LOG . debug ( "Moved " + index . getName ( ) + " to deletable" ) ; deletable . add ( index . getName ( ) ) ; } |
public class Service { /** * Get the value of the given parameter name belonging to this service as a LIst of
* Strings . If no such parameter name is known , null is returned . If the parameter is
* defined but is not a list , an IllegalArgumentException is thrown .
* @ param paramName Name of parameter to get value of .
* @ return Parameter value as a List of Strings or null if unknown . */
@ SuppressWarnings ( "unchecked" ) public List < String > getParamList ( String paramName ) { } } | Object paramValue = getParam ( paramName ) ; if ( paramValue == null ) { return null ; } if ( ! ( paramValue instanceof List ) ) { throw new IllegalArgumentException ( "Parameter '" + paramName + "' must be a list: " + paramValue ) ; } return ( List < String > ) paramValue ; |
public class OptionsImpl { /** * Load the properties in the specified url into < code > props < / code > .
* @ param props the properties object to update
* @ param url the properties file to load */
protected void loadFromUrl ( Properties props , URL url ) { } } | InputStream is = null ; try { is = url . openStream ( ) ; props . load ( is ) ; } catch ( IOException ex ) { if ( log . isLoggable ( Level . WARNING ) ) { log . log ( Level . WARNING , ex . getMessage ( ) , ex ) ; } } finally { try { if ( is != null ) is . close ( ) ; } catch ( IOException ignore ) { } } |
public class InventoryTargeting { /** * Gets the targetedAdUnits value for this InventoryTargeting .
* @ return targetedAdUnits * A list of targeted { @ link AdUnitTargeting } . */
public com . google . api . ads . admanager . axis . v201808 . AdUnitTargeting [ ] getTargetedAdUnits ( ) { } } | return targetedAdUnits ; |
public class UnprocessedStatisticsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UnprocessedStatistics unprocessedStatistics , ProtocolMarshaller protocolMarshaller ) { } } | if ( unprocessedStatistics == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( unprocessedStatistics . getRuleName ( ) , RULENAME_BINDING ) ; protocolMarshaller . marshall ( unprocessedStatistics . getErrorCode ( ) , ERRORCODE_BINDING ) ; protocolMarshaller . marshall ( unprocessedStatistics . getMessage ( ) , MESSAGE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class A_CmsImport { /** * Returns a byte array containing the content of the file . < p >
* @ param filename the name of the file to read
* @ return a byte array containing the content of the file */
protected byte [ ] getFileBytes ( String filename ) { } } | try { // is this a zip - file ?
if ( m_importZip != null ) { // yes
ZipEntry entry = m_importZip . getEntry ( filename ) ; // path to file might be relative , too
if ( ( entry == null ) && filename . startsWith ( "/" ) ) { entry = m_importZip . getEntry ( filename . substring ( 1 ) ) ; } if ( entry == null ) { throw new ZipException ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_IMPORTEXPORT_FILE_NOT_FOUND_IN_ZIP_1 , filename ) ) ; } InputStream stream = m_importZip . getInputStream ( entry ) ; int size = new Long ( entry . getSize ( ) ) . intValue ( ) ; return CmsFileUtil . readFully ( stream , size ) ; } else { // no - use directory
File file = new File ( m_importResource , filename ) ; return CmsFileUtil . readFile ( file ) ; } } catch ( FileNotFoundException fnfe ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_IMPORTEXPORT_FILE_NOT_FOUND_1 , filename ) , fnfe ) ; } m_report . println ( fnfe ) ; } catch ( IOException ioe ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_IMPORTEXPORT_ERROR_READING_FILE_1 , filename ) , ioe ) ; } m_report . println ( ioe ) ; } // this will only be returned in case there was an exception
return "" . getBytes ( ) ; |
public class SourceModel { /** * ZIP output */
public void writeArchive ( OutputStream output ) throws IOException , RepositoryException { } } | ZipOutputStream zipStream = new ZipOutputStream ( output ) ; writeZip ( zipStream , resource . getPath ( ) , true ) ; zipStream . flush ( ) ; zipStream . close ( ) ; |
public class StackTraceUtils { /** * Remove all apparently groovy - internal trace entries from the exception instance
* This modifies the original instance and returns it , it does not clone
* @ param t the Throwable whose stack trace we want to sanitize
* @ return The original Throwable but with a sanitized stack trace */
public static Throwable sanitize ( Throwable t ) { } } | // Note that this getBoolean access may well be synced . . .
if ( ! SystemUtil . getBooleanSafe ( "groovy.full.stacktrace" ) ) { StackTraceElement [ ] trace = t . getStackTrace ( ) ; List < StackTraceElement > newTrace = new ArrayList < StackTraceElement > ( ) ; for ( StackTraceElement stackTraceElement : trace ) { if ( isApplicationClass ( stackTraceElement . getClassName ( ) ) ) { newTrace . add ( stackTraceElement ) ; } } // We don ' t want to lose anything , so log it
STACK_LOG . log ( Level . WARNING , "Sanitizing stacktrace:" , t ) ; StackTraceElement [ ] clean = new StackTraceElement [ newTrace . size ( ) ] ; newTrace . toArray ( clean ) ; t . setStackTrace ( clean ) ; } return t ; |
public class ClassHelper { /** * Get a stream of all interfaces of the given class including extended interfaces and interfaces of all
* superclasses .
* If the given class is an interface , it will be included in the result , otherwise not .
* @ param clazz The class to get the interfaces for .
* @ return The stream of interfaces of the given class . */
public static Stream < Class < ? > > getInterfacesAsStream ( Class < ? > clazz ) { } } | return getSuperclassesAsStream ( clazz , true ) . flatMap ( superClass -> Stream . concat ( superClass . isInterface ( ) ? Stream . of ( superClass ) : Stream . empty ( ) , Arrays . stream ( superClass . getInterfaces ( ) ) . flatMap ( ClassHelper :: getInterfacesAsStream ) ) ) . distinct ( ) ; |
public class RequestHandler2 { /** * region FluentAPI */
public < U > RequestHandler3 < T , R , U > param ( final Class < U > paramClass ) { } } | return new RequestHandler3 < > ( method , path , resolverParam1 , resolverParam2 , ParameterResolver . path ( 2 , paramClass ) , errorHandler ) ; |
public class Streamer { /** * Returns true if the supplied target class can be streamed using a streamer . */
public synchronized static boolean isStreamable ( Class < ? > target ) { } } | // if we have not yet initialized ourselves , do so now
maybeInit ( ) ; // if we already have a streamer , or it ' s an enum , it ' s good
if ( _streamers . containsKey ( target ) || target . isEnum ( ) ) { return true ; } // arrays are streamable , let ' s check the component type
if ( target . isArray ( ) ) { return isStreamable ( target . getComponentType ( ) ) ; } // otherwise it must be Streamable , or an Iterable or Map
return Streamable . class . isAssignableFrom ( target ) || Iterable . class . isAssignableFrom ( target ) || Map . class . isAssignableFrom ( target ) ; |
public class Matchers { /** * Matches the boolean constant ( { @ link Boolean # TRUE } or { @ link Boolean # FALSE } ) corresponding to
* the given value . */
public static Matcher < ExpressionTree > booleanConstant ( final boolean value ) { } } | return new Matcher < ExpressionTree > ( ) { @ Override public boolean matches ( ExpressionTree expressionTree , VisitorState state ) { if ( expressionTree instanceof JCFieldAccess ) { Symbol symbol = ASTHelpers . getSymbol ( expressionTree ) ; if ( symbol . isStatic ( ) && state . getTypes ( ) . unboxedTypeOrType ( symbol . type ) . getTag ( ) == TypeTag . BOOLEAN ) { return ( ( value && symbol . getSimpleName ( ) . contentEquals ( "TRUE" ) ) || symbol . getSimpleName ( ) . contentEquals ( "FALSE" ) ) ; } } return false ; } } ; |
public class FirewallPolicyFilter { /** * { @ inheritDoc } */
@ Override public FirewallPolicyFilter or ( FirewallPolicyFilter otherFilter ) { } } | checkNotNull ( otherFilter , "Other filter must be not a null" ) ; evaluation = new OrEvaluation < > ( evaluation , otherFilter , LoadBalancerMetadata :: getName ) ; return this ; |
public class WxApi2Impl { /** * 发送代金卷
* @ param key
* 商户KEY
* @ param wxPayCoupon
* 代金卷内容
* @ param file
* 证书文件
* @ param password
* 证书密码
* @ return */
@ Override public NutMap send_coupon ( String key , WxPayCoupon wxPayCoupon , File file , String password ) { } } | String url = payBase + "/mmpaymkttransfers/send_coupon" ; Map < String , Object > params = Lang . obj2map ( wxPayCoupon ) ; return this . postPay ( url , key , params , file , password ) ; |
public class S3LogResource { /** * Finding request group */
private Optional < String > getRequestGroupForTask ( final SingularityTaskId taskId , SingularityUser user ) { } } | Optional < SingularityTaskHistory > maybeTaskHistory = getTaskHistory ( taskId , user ) ; if ( maybeTaskHistory . isPresent ( ) ) { SingularityRequest request = maybeTaskHistory . get ( ) . getTask ( ) . getTaskRequest ( ) . getRequest ( ) ; authorizationHelper . checkForAuthorization ( request , user , SingularityAuthorizationScope . READ ) ; return request . getGroup ( ) ; } else { return getRequestGroup ( taskId . getRequestId ( ) , user ) ; } |
public class MyXMLFilter { /** * / * - - - - - [ Parsing ] - - - - - */
private void setupParsing ( ) throws SAXException { } } | parent . setEntityResolver ( handler ) ; parent . setDTDHandler ( handler ) ; parent . setContentHandler ( handler ) ; parent . setErrorHandler ( handler ) ; parent . setProperty ( SAXProperties . LEXICAL_HANDLER , handler ) ; parent . setProperty ( SAXProperties . DECL_HANDLER_ALT , handler ) ; |
public class HtmlValidationResponseFilter { /** * Called when no known { @ link DocType } could be determined from the
* { @ code responseBuffer } . The markup is not validated .
* @ param responseBuffer
* the response markup that could not be validated . */
protected void onUnknownDocType ( AppendingStringBuffer response ) { } } | IRequestablePage responsePage = getResponsePage ( ) ; String detectionString = getFirstCharacters ( response , 128 ) ; if ( responsePage != null ) { log . info ( "No or unknown DOCTYPE detected for page {}: {}" , responsePage . getClass ( ) . getName ( ) , detectionString ) ; } else { log . info ( "No or unknown DOCTYPE detected: {}" , detectionString ) ; } |
public class MainForm { /** * Default Close Operation
* @ since 22.06.2006 */
private void doClose ( ) { } } | // set visible , if system tray active and frame is iconified
if ( useSystemTray && ( getExtendedState ( ) & ICONIFIED ) != 0 ) setVisible ( true ) ; doStopPlaying ( ) ; getSeekBarPanel ( ) . pauseThread ( ) ; getVULMeterPanel ( ) . pauseThread ( ) ; getVURMeterPanel ( ) . pauseThread ( ) ; getSALMeterPanel ( ) . pauseThread ( ) ; getSARMeterPanel ( ) . pauseThread ( ) ; getLEDScrollPanel ( ) . pauseThread ( ) ; writePropertyFile ( ) ; if ( audioProcessor != null ) audioProcessor . removeListener ( this ) ; MultimediaContainerManager . removeMultimediaContainerEventListener ( this ) ; useSystemTray = false ; setSystemTray ( ) ; for ( Window win : windows ) { win . setVisible ( false ) ; win . dispose ( ) ; } setVisible ( false ) ; dispose ( ) ; System . exit ( 0 ) ; // this should not be needed ! |
public class PasswordUtil { /** * Convert the string to bytes using UTF - 8 encoding and then run it through
* the base64 decoding .
* @ param string
* @ return byte [ ] - null if null input or an error in the conversion happens */
private static byte [ ] convert_viewable_to_bytes ( String string ) { } } | if ( null == string ) { return null ; } if ( 0 == string . length ( ) ) { return EMPTY_BYTE_ARRAY ; } return Base64Coder . base64Decode ( convert_to_bytes ( string ) ) ; |
public class AppServiceEnvironmentsInner { /** * Get metric definitions for a worker pool of an App Service Environment .
* Get metric definitions for a worker pool of an App Service Environment .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service Environment .
* @ param workerPoolName Name of the worker pool .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; ResourceMetricDefinitionInner & gt ; object */
public Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > listWebWorkerMetricDefinitionsWithServiceResponseAsync ( final String resourceGroupName , final String name , final String workerPoolName ) { } } | return listWebWorkerMetricDefinitionsSinglePageAsync ( resourceGroupName , name , workerPoolName ) . concatMap ( new Func1 < ServiceResponse < Page < ResourceMetricDefinitionInner > > , Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > call ( ServiceResponse < Page < ResourceMetricDefinitionInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listWebWorkerMetricDefinitionsNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ; |
public class ConvertImage { /** * Converts a { @ link Planar } into the equivalent { @ link InterleavedS64}
* @ param input ( Input ) Planar image that is being converted . Not modified .
* @ param output ( Optional ) The output image . If null a new image is created . Modified .
* @ return Converted image . */
public static InterleavedS64 convert ( Planar < GrayS64 > input , InterleavedS64 output ) { } } | if ( output == null ) { output = new InterleavedS64 ( input . width , input . height , input . getNumBands ( ) ) ; } else { output . reshape ( input . width , input . height , input . getNumBands ( ) ) ; } if ( BoofConcurrency . USE_CONCURRENT ) { ImplConvertImage_MT . convert ( input , output ) ; } else { ImplConvertImage . convert ( input , output ) ; } return output ; |
public class DialogDaemonCommand { /** * { @ inheritDoc } */
@ Override @ OnWave ( OPEN_DIALOG_WT ) protected void processWave ( final Wave wave ) { } } | if ( OPEN_DIALOG . equals ( wave . waveType ( ) ) ) { callCommand ( DialogCommand . class , waveBean ( wave ) ) ; } |
public class ThreadContext { /** * Retrieves a copy of the thread context for the given thread */
public Map < String , Object > forThread ( Thread t ) { } } | return new HashMap < String , Object > ( PER_THREAD_CONTEXTS . getUnchecked ( t ) ) ; |
public class JCRCacheHandler { /** * { @ inheritDoc } */
public Object get ( Serializable key , CacheType cacheType ) { } } | if ( enabled ) { return super . get ( key , cacheType ) ; } return null ; |
public class JavacMessager { /** * Prints a message of the specified kind at the location of the
* annotation value inside the annotation mirror of the annotated
* element .
* @ param kind the kind of message
* @ param msg the message , or an empty string if none
* @ param e the annotated element
* @ param a the annotation containing the annotaiton value
* @ param v the annotation value to use as a position hint */
public void printMessage ( Diagnostic . Kind kind , CharSequence msg , Element e , AnnotationMirror a , AnnotationValue v ) { } } | JavaFileObject oldSource = null ; JavaFileObject newSource = null ; JCDiagnostic . DiagnosticPosition pos = null ; JavacElements elemUtils = processingEnv . getElementUtils ( ) ; Pair < JCTree , JCCompilationUnit > treeTop = elemUtils . getTreeAndTopLevel ( e , a , v ) ; if ( treeTop != null ) { newSource = treeTop . snd . sourcefile ; if ( newSource != null ) { // save the old version and reinstate it later
oldSource = log . useSource ( newSource ) ; pos = treeTop . fst . pos ( ) ; } } try { switch ( kind ) { case ERROR : errorCount ++ ; boolean prev = log . multipleErrors ; log . multipleErrors = true ; try { log . error ( pos , "proc.messager" , msg . toString ( ) ) ; } finally { log . multipleErrors = prev ; } break ; case WARNING : warningCount ++ ; log . warning ( pos , "proc.messager" , msg . toString ( ) ) ; break ; case MANDATORY_WARNING : warningCount ++ ; log . mandatoryWarning ( pos , "proc.messager" , msg . toString ( ) ) ; break ; default : log . note ( pos , "proc.messager" , msg . toString ( ) ) ; break ; } } finally { // reinstate the saved version , only if it was saved earlier
if ( newSource != null ) log . useSource ( oldSource ) ; } |
public class AmazonEC2Client { /** * Deletes the specified Client VPN endpoint . You must disassociate all target networks before you can delete a
* Client VPN endpoint .
* @ param deleteClientVpnEndpointRequest
* @ return Result of the DeleteClientVpnEndpoint operation returned by the service .
* @ sample AmazonEC2 . DeleteClientVpnEndpoint
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / DeleteClientVpnEndpoint " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public DeleteClientVpnEndpointResult deleteClientVpnEndpoint ( DeleteClientVpnEndpointRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDeleteClientVpnEndpoint ( request ) ; |
public class XPathException { /** * Get the XSLT ElemVariable that this sub - expression references . In order for
* this to work , the SourceLocator must be the owning ElemTemplateElement .
* @ return The dereference to the ElemVariable , or null if not found . */
public org . w3c . dom . Node getStylesheetNode ( ExpressionNode ex ) { } } | ExpressionNode owner = getExpressionOwner ( ex ) ; if ( null != owner && owner instanceof org . w3c . dom . Node ) { return ( ( org . w3c . dom . Node ) owner ) ; } return null ; |
public class BlockHouseHolder_DDRB { /** * Applies a householder reflector stored in row ' row ' to the remainder of the row
* in the block after it . Takes in account leading zeros and one . < br >
* < br >
* A = A * ( I - & gamma ; * u * u < sup > T < / sup > ) < br >
* @ param A submatrix that is block aligned
* @ param row The row in A containing ' u '
* @ param colStart First index in ' u ' that the reflector starts at */
public static void rank1UpdateMultL_Row ( final int blockLength , final DSubmatrixD1 A , final int row , final int colStart , final double gamma ) { } } | final int height = Math . min ( blockLength , A . row1 - A . row0 ) ; final double dataA [ ] = A . original . data ; int zeroOffset = colStart - row ; for ( int i = row + 1 ; i < height ; i ++ ) { // total = U ^ T * A ( i , : )
double total = innerProdRow ( blockLength , A , row , A , i , zeroOffset ) ; total *= gamma ; // A ( i , : ) - gamma * U * total
for ( int j = A . col0 ; j < A . col1 ; j += blockLength ) { int width = Math . min ( blockLength , A . col1 - j ) ; int indexU = A . row0 * A . original . numCols + height * j + row * width ; int indexA = A . row0 * A . original . numCols + height * j + i * width ; if ( j == A . col0 ) { indexU += colStart + 1 ; indexA += colStart ; dataA [ indexA ++ ] -= total ; for ( int k = colStart + 1 ; k < width ; k ++ ) { dataA [ indexA ++ ] -= total * dataA [ indexU ++ ] ; } } else { for ( int k = 0 ; k < width ; k ++ ) { dataA [ indexA ++ ] -= total * dataA [ indexU ++ ] ; } } } } |
public class Validate { /** * < p > Validate that the specified argument collection is neither { @ code null } nor a size of zero ( no elements ) ; otherwise throwing an exception with the specified message .
* < pre > Validate . notEmpty ( myCollection , " The collection must not be empty " ) ; < / pre >
* @ param < T >
* the collection type
* @ param collection
* the collection to check , validated not null by this method
* @ param message
* the { @ link String # format ( String , Object . . . ) } exception message if invalid , not null
* @ param values
* the optional values for the formatted exception message , null array not recommended
* @ return the validated collection ( never { @ code null } method for chaining )
* @ throws NullPointerValidationException
* if the collection is { @ code null }
* @ throws IllegalArgumentException
* if the collection is empty
* @ see # notEmpty ( Object [ ] ) */
public static < T extends Collection < ? > > T notEmpty ( final T collection , final String message , final Object ... values ) { } } | return INSTANCE . notEmpty ( collection , message , values ) ; |
public class Metadata { /** * Get a value from a date metadata field .
* @ param path the key path in the metadata object . Must be prefixed with a " / " .
* @ return the metadata value as a Date .
* @ throws ParseException when the value cannot be parsed as a valid date */
public Date getDate ( String path ) throws ParseException { } } | return BoxDateFormat . parse ( this . getValue ( path ) . asString ( ) ) ; |
public class MetaMultilabelGenerator { /** * Generate Set .
* @ returna label set Y */
private HashSet generateSet ( ) { } } | int y [ ] = new int [ m_L ] ; // [0,0,0]
int k = samplePMF ( priors_norm ) ; // k = 1 / / y [ k ] ~ p ( k = = 1)
y [ k ] = 1 ; // [0,1,0]
ArrayList < Integer > indices = getShuffledListToLWithoutK ( m_L , k ) ; for ( int j : indices ) { // y [ j ] ~ p ( j = = 1 | y )
y [ j ] = ( joint ( j , y ) > m_MetaRandom . nextDouble ( ) ) ? 1 : 0 ; } return vector2set ( y ) ; |
public class SplitAmong { /** * Get the group of nodes associated to a given node .
* @ param u the node
* @ return the associated group of nodes if exists . An empty set otherwise */
public Collection < Node > getAssociatedPGroup ( Node u ) { } } | for ( Collection < Node > pGrp : pGroups ) { if ( pGrp . contains ( u ) ) { return pGrp ; } } return Collections . emptySet ( ) ; |
public class ToolbarRegistry { /** * Get the toolbar action which matches the given key .
* @ param key
* key for toolbar action
* @ param mapWidget
* map which will contain this tool
* @ return toolbar action or null when key not found */
public static ToolbarBaseAction getToolbarAction ( String key , MapWidget mapWidget ) { } } | ToolCreator toolCreator = REGISTRY . get ( key ) ; if ( null == toolCreator ) { return null ; } return toolCreator . createTool ( mapWidget ) ; |
public class DroolsFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object createFromString ( EDataType eDataType , String initialValue ) { } } | switch ( eDataType . getClassifierID ( ) ) { case DroolsPackage . PACKAGE_NAME_TYPE : return createPackageNameTypeFromString ( eDataType , initialValue ) ; case DroolsPackage . PRIORITY_TYPE : return createPriorityTypeFromString ( eDataType , initialValue ) ; case DroolsPackage . RULE_FLOW_GROUP_TYPE : return createRuleFlowGroupTypeFromString ( eDataType , initialValue ) ; case DroolsPackage . TASK_NAME_TYPE : return createTaskNameTypeFromString ( eDataType , initialValue ) ; case DroolsPackage . VERSION_TYPE : return createVersionTypeFromString ( eDataType , initialValue ) ; default : throw new IllegalArgumentException ( "The datatype '" + eDataType . getName ( ) + "' is not a valid classifier" ) ; } |
public class Math { /** * Returns the minimum of a matrix . */
public static int min ( int [ ] [ ] matrix ) { } } | int m = matrix [ 0 ] [ 0 ] ; for ( int [ ] x : matrix ) { for ( int y : x ) { if ( m > y ) { m = y ; } } } return m ; |
public class AbstractBaseTarget { /** * { @ inheritDoc } */
public Updater getUpdater ( String propertyName ) { } } | Updater updater = m_updaters . get ( propertyName ) ; if ( updater == null ) { updater = createDefaultUpdater ( propertyName ) ; m_updaters . put ( propertyName , updater ) ; } return updater ; |
public class CmsSerialDateView { /** * Configure all UI elements in the exceptions panel . */
private void initExceptionsPanel ( ) { } } | m_exceptionsPanel . setLegend ( Messages . get ( ) . key ( Messages . GUI_SERIALDATE_PANEL_EXCEPTIONS_0 ) ) ; m_exceptionsPanel . addCloseHandler ( this ) ; m_exceptionsPanel . setVisible ( false ) ; |
public class FrozenSymbolTable { /** * Freeze the given symbol table by decorating it ( or just returning if its already frozen )
* @ param symbolTable
* @ return */
public static FrozenSymbolTable freeze ( SymbolTable symbolTable ) { } } | if ( symbolTable instanceof FrozenSymbolTable ) { return ( FrozenSymbolTable ) symbolTable ; } return new FrozenSymbolTable ( symbolTable ) ; |
public class IntervalTree { /** * / * From CLR */
private void fixAfterDeletion ( TreeEntry < E > x ) { } } | while ( x != root && colorOf ( x ) == BLACK ) { if ( x == leftOf ( parentOf ( x ) ) ) { TreeEntry < E > sib = rightOf ( parentOf ( x ) ) ; if ( colorOf ( sib ) == RED ) { setColor ( sib , BLACK ) ; setColor ( parentOf ( x ) , RED ) ; rotateLeft ( parentOf ( x ) ) ; sib = rightOf ( parentOf ( x ) ) ; } if ( colorOf ( leftOf ( sib ) ) == BLACK && colorOf ( rightOf ( sib ) ) == BLACK ) { setColor ( sib , RED ) ; x = parentOf ( x ) ; } else { if ( colorOf ( rightOf ( sib ) ) == BLACK ) { setColor ( leftOf ( sib ) , BLACK ) ; setColor ( sib , RED ) ; rotateRight ( sib ) ; sib = rightOf ( parentOf ( x ) ) ; } setColor ( sib , colorOf ( parentOf ( x ) ) ) ; setColor ( parentOf ( x ) , BLACK ) ; setColor ( rightOf ( sib ) , BLACK ) ; rotateLeft ( parentOf ( x ) ) ; x = root ; } } else { // symmetric
TreeEntry < E > sib = leftOf ( parentOf ( x ) ) ; if ( colorOf ( sib ) == RED ) { setColor ( sib , BLACK ) ; setColor ( parentOf ( x ) , RED ) ; rotateRight ( parentOf ( x ) ) ; sib = leftOf ( parentOf ( x ) ) ; } if ( colorOf ( rightOf ( sib ) ) == BLACK && colorOf ( leftOf ( sib ) ) == BLACK ) { setColor ( sib , RED ) ; x = parentOf ( x ) ; } else { if ( colorOf ( leftOf ( sib ) ) == BLACK ) { setColor ( rightOf ( sib ) , BLACK ) ; setColor ( sib , RED ) ; rotateLeft ( sib ) ; sib = leftOf ( parentOf ( x ) ) ; } setColor ( sib , colorOf ( parentOf ( x ) ) ) ; setColor ( parentOf ( x ) , BLACK ) ; setColor ( leftOf ( sib ) , BLACK ) ; rotateRight ( parentOf ( x ) ) ; x = root ; } } } setColor ( x , BLACK ) ; |
import java . util . Stack ; class BalancedExpression { /** * Function to verify if the provided string expression contains matching pairs of parentheses .
* Examples :
* isBalanced ( " { ( ) } [ { } ] " )
* - > True
* isBalanced ( " { ( ) } [ { ] " )
* - > False
* isBalanced ( " { ( ) } [ { } ] [ ] ( { } ) " )
* - > True */
public static boolean isBalanced ( String expression ) { } } | // A stack to hold unmatched parentheses
Stack < Character > trackedPairs = new Stack < > ( ) ; for ( char character : expression . toCharArray ( ) ) { if ( character == '(' || character == '{' || character == '[' ) { trackedPairs . push ( character ) ; } else if ( character == ')' || character == '}' || character == ']' ) { if ( trackedPairs . isEmpty ( ) ) return false ; char openPair = trackedPairs . pop ( ) ; if ( ( character == ')' && openPair != '(' ) || ( character == '}' && openPair != '{' ) || ( character == ']' && openPair != '[' ) ) return false ; } } return trackedPairs . isEmpty ( ) ; |
public class EnumFacingUtils { /** * Gets the real side of a rotated block .
* @ param state the state
* @ param side the side
* @ return the real side */
public static EnumFacing getRealSide ( IBlockState state , EnumFacing side ) { } } | if ( state == null || side == null ) return side ; EnumFacing direction = DirectionalComponent . getDirection ( state ) ; if ( direction == EnumFacing . SOUTH ) return side ; if ( direction == EnumFacing . DOWN ) return side . rotateAround ( Axis . X ) ; else if ( direction == EnumFacing . UP ) switch ( side ) { case UP : return EnumFacing . SOUTH ; case DOWN : return EnumFacing . NORTH ; case NORTH : return EnumFacing . UP ; case SOUTH : return EnumFacing . DOWN ; default : return side ; } int count = EnumFacingUtils . getRotationCount ( direction ) ; side = EnumFacingUtils . rotateFacing ( side , count ) ; return side ; |
public class AbstractDiscretePartitionRefiner { /** * Does the work of the class , that refines a coarse partition into a finer
* one using the supplied automorphism group to prune the search .
* @ param group the automorphism group of the graph
* @ param coarser the partition to refine */
private void refine ( PermutationGroup group , Partition coarser ) { } } | int vertexCount = getVertexCount ( ) ; Partition finer = equitableRefiner . refine ( coarser ) ; int firstNonDiscreteCell = finer . getIndexOfFirstNonDiscreteCell ( ) ; if ( firstNonDiscreteCell == - 1 ) { firstNonDiscreteCell = vertexCount ; } Permutation pi1 = new Permutation ( firstNonDiscreteCell ) ; Result result = Result . BETTER ; if ( bestExist ) { pi1 = finer . setAsPermutation ( firstNonDiscreteCell ) ; result = compareRowwise ( pi1 ) ; } // partition is discrete
if ( finer . size ( ) == vertexCount ) { if ( ! bestExist ) { best = finer . toPermutation ( ) ; first = finer . toPermutation ( ) ; bestExist = true ; } else { if ( result == Result . BETTER ) { best = new Permutation ( pi1 ) ; } else if ( result == Result . EQUAL ) { group . enter ( pi1 . multiply ( best . invert ( ) ) ) ; } } } else { if ( result != Result . WORSE ) { Set < Integer > blockCopy = finer . copyBlock ( firstNonDiscreteCell ) ; for ( int vertexInBlock = 0 ; vertexInBlock < vertexCount ; vertexInBlock ++ ) { if ( blockCopy . contains ( vertexInBlock ) ) { Partition nextPartition = finer . splitBefore ( firstNonDiscreteCell , vertexInBlock ) ; this . refine ( group , nextPartition ) ; int [ ] permF = new int [ vertexCount ] ; int [ ] invF = new int [ vertexCount ] ; for ( int i = 0 ; i < vertexCount ; i ++ ) { permF [ i ] = i ; invF [ i ] = i ; } for ( int j = 0 ; j <= firstNonDiscreteCell ; j ++ ) { int x = nextPartition . getFirstInCell ( j ) ; int i = invF [ x ] ; int h = permF [ j ] ; permF [ j ] = x ; permF [ i ] = h ; invF [ h ] = i ; invF [ x ] = j ; } Permutation pPermF = new Permutation ( permF ) ; group . changeBase ( pPermF ) ; for ( int j = 0 ; j < vertexCount ; j ++ ) { Permutation g = group . get ( firstNonDiscreteCell , j ) ; if ( g != null ) { blockCopy . remove ( g . get ( vertexInBlock ) ) ; } } } } } } |
public class ImgUtil { /** * 缩放图像 ( 按比例缩放 ) < br >
* 缩放后默认为jpeg格式
* @ param srcImageFile 源图像文件
* @ param destImageFile 缩放后的图像文件
* @ param scale 缩放比例 。 比例大于1时为放大 , 小于1大于0为缩小 */
public static void scale ( File srcImageFile , File destImageFile , float scale ) { } } | scale ( read ( srcImageFile ) , destImageFile , scale ) ; |
public class AsmValidatorMethodGenerator { /** * 为待校验的值 ( 原值及转换后的字符串值 ) 创建字节码局部变量 。
* @ param localIndices 局部变量索引
* @ param mv 方法访问器
* @ param f 字段 */
protected void createValueLocal ( LocalIndices localIndices , MethodVisitor mv , Field f ) { } } | visitGetter ( mv , f ) ; localIndices . incrementAndSetOriginalLocalIndex ( ) ; mv . visitVarInsn ( storeOpCode ( f . getType ( ) ) , localIndices . getLocalIndex ( ) ) ; mv . visitVarInsn ( loadOpCode ( f . getType ( ) ) , localIndices . getLocalIndex ( ) ) ; AsmValidators . processWideLocal ( f . getType ( ) , localIndices ) ; if ( f . getType ( ) == String . class ) return ; if ( f . getType ( ) . isPrimitive ( ) ) { localIndices . setOriginalPrimitive ( true ) ; mv . visitMethodInsn ( INVOKESTATIC , p ( String . class ) , "valueOf" , sig ( String . class , f . getType ( ) ) , false ) ; localIndices . incrementAndSetStringLocalIndex ( ) ; mv . visitVarInsn ( ASTORE , localIndices . getLocalIndex ( ) ) ; mv . visitVarInsn ( ALOAD , localIndices . getLocalIndex ( ) ) ; return ; } |
public class TmdbKeywords { /** * Get the list of movies for a particular keyword by id .
* @ param keywordId
* @ param language
* @ param page
* @ return List of movies with the keyword
* @ throws MovieDbException */
public ResultList < MovieBasic > getKeywordMovies ( String keywordId , String language , Integer page ) throws MovieDbException { } } | TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . ID , keywordId ) ; parameters . add ( Param . LANGUAGE , language ) ; parameters . add ( Param . PAGE , page ) ; URL url = new ApiUrl ( apiKey , MethodBase . KEYWORD ) . subMethod ( MethodSub . MOVIES ) . buildUrl ( parameters ) ; WrapperGenericList < MovieBasic > wrapper = processWrapper ( getTypeReference ( MovieBasic . class ) , url , "keyword movies" ) ; return wrapper . getResultsList ( ) ; |
public class MoleculeSetRenderer { /** * Paint a set of molecules .
* @ param molecules the { @ link IAtomContainerSet } to paint
* @ param drawVisitor the visitor that does the drawing
* @ param bounds the bounds on the screen
* @ param resetCenter
* if true , set the draw center to be the center of bounds */
@ Override public void paint ( IAtomContainerSet molecules , IDrawVisitor drawVisitor , Rectangle2D bounds , boolean resetCenter ) { } } | // total up the bounding boxes
Rectangle2D totalBounds = BoundsCalculator . calculateBounds ( molecules ) ; this . setupTransformToFit ( bounds , totalBounds , AverageBondLengthCalculator . calculateAverageBondLength ( molecules ) , resetCenter ) ; IRenderingElement diagram = this . generateDiagram ( molecules ) ; this . paint ( drawVisitor , diagram ) ; |
public class ResponseCreationSupport { /** * Shorthand for invoking
* { @ link # sendResponse ( HttpRequest , IOSubchannel , int , String ) }
* with a predefined HTTP status .
* @ param request the request
* @ param channel the channel
* @ param status the status */
public static void sendResponse ( HttpRequest request , IOSubchannel channel , HttpStatus status ) { } } | sendResponse ( request , channel , status . statusCode ( ) , status . reasonPhrase ( ) ) ; |
public class GetComplianceDetailRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetComplianceDetailRequest getComplianceDetailRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getComplianceDetailRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getComplianceDetailRequest . getPolicyId ( ) , POLICYID_BINDING ) ; protocolMarshaller . marshall ( getComplianceDetailRequest . getMemberAccount ( ) , MEMBERACCOUNT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Part { /** * Set content type for this part . */
public Part < T > contentType ( String contentType ) { } } | requireNonNull ( contentType ) ; return new Part < > ( name , fileName , body , contentType , charset , partWriter ) ; |
public class IPUtils { /** * # func 返回本机IP < br >
* @ author v _ dongguoshuang
* @ version 4.0.0 */
public static String getLocalHostAddress ( ) { } } | try { InetAddress inet = InetAddress . getLocalHost ( ) ; String hostAddress = inet . getHostAddress ( ) ; return hostAddress ; } catch ( UnknownHostException e ) { e . printStackTrace ( ) ; } return null ; |
public class ScanProgressItem { /** * Refresh the state of this scan progress item . */
void refresh ( ) { } } | if ( isCompleted ( ) ) { return ; } if ( hProcess . getCompleted ( ) . contains ( plugin ) ) { status = STATUS_COMPLETED ; } else if ( hProcess . getRunning ( ) . contains ( plugin ) ) { status = STATUS_RUNNING ; } |
public class KeyboardUtils { /** * Delayed version of { @ link # hideSoftKeyboard ( Context , View )
* hideSoftKeyboard } method
* @ param context
* @ param view View holding keypad control */
public static void delayedHideSoftKeyboard ( final Context context , final View view , int delay ) { } } | TimerTask task = new TimerTask ( ) { @ Override public void run ( ) { hideSoftKeyboard ( context , view ) ; } } ; Timer timer = new Timer ( ) ; timer . schedule ( task , delay ) ; |
public class HtmlDocletWriter { /** * Check whether there are any tags for Serialization Overview
* section to be printed .
* @ param field the FieldDoc object to check for tags .
* @ return true if there are tags to be printed else return false . */
protected boolean hasSerializationOverviewTags ( FieldDoc field ) { } } | Content output = new ContentBuilder ( ) ; TagletWriter . genTagOuput ( configuration . tagletManager , field , configuration . tagletManager . getCustomTaglets ( field ) , getTagletWriterInstance ( false ) , output ) ; return ! output . isEmpty ( ) ; |
public class Pool { /** * the id and and int id is easier to handle than a reference . */
public int writeShort ( OutputStream dest , int id , Object obj ) throws IOException { } } | int idx ; idx = addIfNew ( id , obj ) ; if ( idx >>> 8 != 0 ) { throw new RuntimeException ( "idx not short " + idx ) ; } IO . writeU1 ( dest , idx ) ; return idx ; |
public class TimestampWatermark { /** * recalculate interval ( in hours ) if total number of partitions greater than maximum number of allowed partitions
* @ param diffInMilliSecs difference in range
* @ param hourInterval hour interval ( ex : 4 hours )
* @ param maxIntervals max number of allowed partitions
* @ return calculated interval in hours */
private static int getInterval ( long diffInMilliSecs , long hourInterval , int maxIntervals ) { } } | long totalHours = DoubleMath . roundToInt ( ( double ) diffInMilliSecs / ( 60 * 60 * 1000 ) , RoundingMode . CEILING ) ; long totalIntervals = DoubleMath . roundToInt ( ( double ) totalHours / hourInterval , RoundingMode . CEILING ) ; if ( totalIntervals > maxIntervals ) { hourInterval = DoubleMath . roundToInt ( ( double ) totalHours / maxIntervals , RoundingMode . CEILING ) ; } return Ints . checkedCast ( hourInterval ) ; |
public class MpPromoteAlgo { /** * Have all survivors supplied a full repair log ? */
public boolean areRepairLogsComplete ( ) { } } | for ( Entry < Long , ReplicaRepairStruct > entry : m_replicaRepairStructs . entrySet ( ) ) { if ( ! entry . getValue ( ) . logsComplete ( ) ) { return false ; } } return true ; |
public class SuperToast { /** * Sets the icon position and icon resource of the main TextView .
* The recommended icon position for most applications is
* { @ link Style # ICONPOSITION _ LEFT } .
* @ param iconPosition The desired icon position
* @ param iconResource The desired icon resource
* @ return The current SuperToast instance
* @ see # setIconPosition ( int )
* @ see # setIconResource ( int ) */
public SuperToast setIconResource ( @ Style . IconPosition int iconPosition , @ DrawableRes int iconResource ) { } } | this . mStyle . messageIconPosition = iconPosition ; this . mStyle . messageIconResource = iconResource ; return this ; |
public class StyledTextArea { /** * Creates a { @ link TextExt } node using the given styled text . */
public static < S > Node createStyledTextNode ( String text , S style , BiConsumer < ? super TextExt , S > applyStyle ) { } } | TextExt t = new TextExt ( text ) ; t . setTextOrigin ( VPos . TOP ) ; t . getStyleClass ( ) . add ( "text" ) ; applyStyle . accept ( t , style ) ; return t ; |
public class ServerSentEvent { /** * Creates a { @ link ServerSentEvent } instance with an event id and type .
* @ param eventType Type for the event .
* @ param eventId Id for the event .
* @ param data Data for the event .
* @ return The { @ link ServerSentEvent } instance . */
public static ServerSentEvent withEventIdAndType ( ByteBuf eventId , ByteBuf eventType , ByteBuf data ) { } } | return new ServerSentEvent ( eventId , eventType , data ) ; |
public class JdbcDatabaseConnection { /** * Return the id associated with the column . */
private Number getIdColumnData ( ResultSet resultSet , ResultSetMetaData metaData , int columnIndex ) throws SQLException { } } | int typeVal = metaData . getColumnType ( columnIndex ) ; switch ( typeVal ) { case Types . BIGINT : case Types . DECIMAL : case Types . NUMERIC : return ( Number ) resultSet . getLong ( columnIndex ) ; case Types . INTEGER : return ( Number ) resultSet . getInt ( columnIndex ) ; default : String columnName = metaData . getColumnName ( columnIndex ) ; throw new SQLException ( "Unexpected ID column type " + TypeValMapper . getSqlTypeForTypeVal ( typeVal ) + " (typeVal " + typeVal + ") in column " + columnName + "(#" + columnIndex + ") is not a number" ) ; } |
public class Cipher { /** * Continues a multiple - part encryption or decryption operation
* ( depending on how this cipher was initialized ) , processing another data
* part .
* < p > The bytes in the < code > input < / code > buffer are processed , and the
* result is stored in a new buffer .
* < p > If < code > input < / code > has a length of zero , this method returns
* < code > null < / code > .
* @ param input the input buffer
* @ return the new buffer with the result , or null if the underlying
* cipher is a block cipher and the input data is too short to result in a
* new block .
* @ exception IllegalStateException if this cipher is in a wrong state
* ( e . g . , has not been initialized ) */
public final byte [ ] update ( byte [ ] input ) { } } | checkCipherState ( ) ; // Input sanity check
if ( input == null ) { throw new IllegalArgumentException ( "Null input buffer" ) ; } updateProviderIfNeeded ( ) ; if ( input . length == 0 ) { return null ; } return spi . engineUpdate ( input , 0 , input . length ) ; |
public class IntervalParser { /** * < p > General factory method . < / p >
* @ param < T > generic temporal type
* @ param < I > generic interval type
* @ param factory interval factory
* @ param startFormat formatter for lower interval boundary
* @ param endFormat formatter for upper interval boundary
* @ param policy bracket policy
* @ param separator separation char between start and end component
* @ return new interval parser
* @ since 3.9/4.6 */
static < T extends Temporal < ? super T > , I extends IsoInterval < T , I > > IntervalParser < T , I > of ( IntervalFactory < T , I > factory , ChronoParser < T > startFormat , ChronoParser < T > endFormat , BracketPolicy policy , char separator ) { } } | if ( startFormat == null ) { throw new NullPointerException ( "Missing start boundary parser." ) ; } else if ( endFormat == null ) { throw new NullPointerException ( "Missing end boundary parser." ) ; } return new IntervalParser < > ( factory , startFormat , endFormat , policy , Character . valueOf ( separator ) ) ; |
public class ImplConvertRaster { /** * A faster convert that works directly with a specific raster */
public static void bufferedToInterleaved ( DataBufferInt buffer , WritableRaster src , InterleavedU8 dst ) { } } | int [ ] srcData = buffer . getData ( ) ; int srcStride = stride ( src ) ; int srcOffset = getOffset ( src ) ; int numBands = src . getNumBands ( ) ; if ( numBands == 3 ) { // CONCURRENT _ BELOW BoofConcurrency . loopFor ( 0 , dst . height , y - > {
for ( int y = 0 ; y < dst . height ; y ++ ) { int indexSrc = srcOffset + y * srcStride ; int indexDst = dst . startIndex + y * dst . stride ; for ( int x = 0 ; x < dst . width ; x ++ ) { int rgb = srcData [ indexSrc ++ ] ; dst . data [ indexDst ++ ] = ( byte ) ( rgb >>> 16 ) ; dst . data [ indexDst ++ ] = ( byte ) ( rgb >>> 8 ) ; dst . data [ indexDst ++ ] = ( byte ) rgb ; } } // CONCURRENT _ ABOVE } ) ;
} else if ( numBands == 4 ) { // CONCURRENT _ BELOW BoofConcurrency . loopFor ( 0 , dst . height , y - > {
for ( int y = 0 ; y < dst . height ; y ++ ) { int indexSrc = srcOffset + y * srcStride ; int indexDst = dst . startIndex + y * dst . stride ; for ( int x = 0 ; x < dst . width ; x ++ ) { int rgb = srcData [ indexSrc ++ ] ; dst . data [ indexDst ++ ] = ( byte ) ( rgb >>> 24 ) ; dst . data [ indexDst ++ ] = ( byte ) ( rgb >>> 16 ) ; dst . data [ indexDst ++ ] = ( byte ) ( rgb >>> 8 ) ; dst . data [ indexDst ++ ] = ( byte ) rgb ; } } // CONCURRENT _ ABOVE } ) ;
} |
public class FileUtil { /** * Load an input stream ( e . g . , a Java resource ) into a String buffer . The
* stream is closed afterwards .
* @ param is Input stream
* @ return String with file / resource contents .
* @ throws IOException on IO errors */
public static String slurp ( InputStream is ) throws IOException { } } | StringBuilder buf = new StringBuilder ( ) ; final byte [ ] b = new byte [ 4096 ] ; for ( int n ; ( n = is . read ( b ) ) != - 1 ; ) { buf . append ( new String ( b , 0 , n ) ) ; } is . close ( ) ; return buf . toString ( ) ; |
public class Mutator { /** * Passes the underlying value to a consumer , with two arguments .
* Usage :
* < pre >
* Map & lt ; String , String & gt ; map = mutate ( new HashMap & lt ; String , String & gt ; ( ) )
* . nil ( Map : : put , " a " , " A " )
* . nil ( Map : : put , " b " , " B " )
* . nil ( Map : : put , " c " , " C " )
* . map ( Collections : : unmodifiableMap )
* . get ( ) ;
* < / pre >
* @ param consumer typically a method reference for T
* @ param a first argument
* @ param b second argument
* @ param < A > type of a
* @ param < B > type of b
* @ return this */
public < A , B > Mutator < T > bi ( TriConsumer < ? super T , A , B > consumer , A a , B b ) { } } | consumer . accept ( t , a , b ) ; return this ; |
public class BaseLexicon { /** * Trains this lexicon on the Collection of trees .
* Also trains the unknown word model pointed to by this lexicon . */
public final void train ( Collection < Tree > trees , double weight ) { } } | // scan data
for ( Tree tree : trees ) { train ( tree , weight ) ; } |
public class BatchHystrixCommand { /** * { @ inheritDoc } */
@ Override @ SuppressWarnings ( "unchecked" ) protected List < Object > run ( ) throws Exception { } } | Object [ ] args = toArgs ( getCollapsedRequests ( ) ) ; return ( List ) process ( args ) ; |
public class TransactionSynchronizationRegistryImpl { /** * { @ inheritDoc } */
public void setRollbackOnly ( ) { } } | TransactionImpl tx = registry . getTransaction ( ) ; if ( tx == null ) throw new IllegalStateException ( ) ; try { tx . setRollbackOnly ( ) ; } catch ( Throwable t ) { // Nothing to do
} |
public class AbstractPool { /** * Get from existing pools or create mcp w / specified credential
* It ' s used during prefill operation
* @ param credential credential used to match
* @ return */
private ManagedConnectionPool getManagedConnectionPool ( Credential credential ) { } } | ManagedConnectionPool mcp = pools . get ( credential ) ; if ( mcp == null ) { synchronized ( this ) { mcp = pools . get ( credential ) ; if ( mcp == null ) { ManagedConnectionPool newMcp = createManagedConnectionPool ( credential ) ; mcp = pools . putIfAbsent ( credential , newMcp ) ; if ( mcp == null ) { mcp = newMcp ; if ( Tracer . isEnabled ( ) ) Tracer . createManagedConnectionPool ( poolConfiguration . getId ( ) , mcp ) ; } else { newMcp . shutdown ( ) ; } } } } return mcp ; |
public class CmsObject { /** * Creates a new user . < p >
* @ param userFqn the name for the new user
* @ param password the password for the new user
* @ param description the description for the new user
* @ param additionalInfos the additional infos for the user
* @ return the created user
* @ throws CmsException if something goes wrong */
public CmsUser createUser ( String userFqn , String password , String description , Map < String , Object > additionalInfos ) throws CmsException { } } | return m_securityManager . createUser ( m_context , userFqn , password , description , additionalInfos ) ; |
public class QName { /** * Returns a QName holding the value of the specified String .
* The string must be in the form returned by the QName . toString ( )
* method , i . e . " { namespaceURI } localPart " , with the " { namespaceURI } "
* part being optional .
* This method doesn ' t do a full validation of the resulting QName .
* In particular , it doesn ' t check that the resulting namespace URI
* is a legal URI ( per RFC 2396 and RFC 2732 ) , nor that the resulting
* local part is a legal NCName per the XML Namespaces specification .
* @ param s the string to be parsed
* @ throws java . lang . IllegalArgumentException If the specified String cannot be parsed as a QName
* @ return QName corresponding to the given String */
public static QName valueOf ( String s ) { } } | if ( ( s == null ) || s . equals ( "" ) ) { throw new IllegalArgumentException ( "invalid QName literal" ) ; } if ( s . charAt ( 0 ) == '{' ) { int i = s . indexOf ( '}' ) ; if ( i == - 1 ) { throw new IllegalArgumentException ( "invalid QName literal" ) ; } if ( i == s . length ( ) - 1 ) { throw new IllegalArgumentException ( "invalid QName literal" ) ; } else { return new QName ( s . substring ( 1 , i ) , s . substring ( i + 1 ) ) ; } } else { return new QName ( s ) ; } |
public class CmsVfsSitemapService { /** * Applys the given changes to the entry . < p >
* @ param change the change to apply
* @ throws CmsException if something goes wrong */
private void modifyEntry ( CmsSitemapChange change ) throws CmsException { } } | CmsObject cms = getCmsObject ( ) ; CmsResource entryPage = null ; CmsResource entryFolder = null ; CmsResource ownRes = null ; CmsResource defaultFileRes = null ; try { // lock all resources necessary first to avoid doing changes only half way through
if ( hasOwnChanges ( change ) ) { ownRes = cms . readResource ( change . getEntryId ( ) , CmsResourceFilter . ONLY_VISIBLE_NO_DELETED ) ; ensureLock ( ownRes ) ; } if ( hasDefaultFileChanges ( change ) ) { defaultFileRes = cms . readResource ( change . getDefaultFileId ( ) , CmsResourceFilter . ONLY_VISIBLE_NO_DELETED ) ; ensureLock ( defaultFileRes ) ; } if ( ( ownRes != null ) && ownRes . isFolder ( ) ) { entryFolder = ownRes ; } if ( ( ownRes != null ) && ownRes . isFile ( ) ) { entryPage = ownRes ; } if ( defaultFileRes != null ) { entryPage = defaultFileRes ; } if ( change . isLeafType ( ) ) { entryFolder = entryPage ; } updateProperties ( cms , ownRes , defaultFileRes , change . getPropertyChanges ( ) ) ; if ( change . hasChangedPosition ( ) ) { updateNavPos ( ownRes , change ) ; } if ( entryFolder != null ) { if ( change . hasNewParent ( ) || change . hasChangedName ( ) ) { String destinationPath ; if ( change . hasNewParent ( ) ) { CmsResource futureParent = cms . readResource ( change . getParentId ( ) , CmsResourceFilter . ONLY_VISIBLE_NO_DELETED ) ; destinationPath = CmsStringUtil . joinPaths ( cms . getSitePath ( futureParent ) , change . getName ( ) ) ; } else { destinationPath = CmsStringUtil . joinPaths ( CmsResource . getParentFolder ( cms . getSitePath ( entryFolder ) ) , change . getName ( ) ) ; } if ( change . isLeafType ( ) && destinationPath . endsWith ( "/" ) ) { destinationPath = destinationPath . substring ( 0 , destinationPath . length ( ) - 1 ) ; } // only if the site - path has really changed
if ( ! cms . getSitePath ( entryFolder ) . equals ( destinationPath ) ) { cms . moveResource ( cms . getSitePath ( entryFolder ) , destinationPath ) ; } entryFolder = cms . readResource ( entryFolder . getStructureId ( ) , CmsResourceFilter . ONLY_VISIBLE_NO_DELETED ) ; } } } finally { if ( entryPage != null ) { tryUnlock ( entryPage ) ; } if ( entryFolder != null ) { tryUnlock ( entryFolder ) ; } } |
public class Matrix4x3d { /** * Set the value of the matrix element at column 2 and row 2.
* @ param m22
* the new value
* @ return this */
public Matrix4x3d m22 ( double m22 ) { } } | this . m22 = m22 ; properties &= ~ PROPERTY_ORTHONORMAL ; if ( m22 != 1.0 ) properties &= ~ ( PROPERTY_IDENTITY | PROPERTY_TRANSLATION ) ; return this ; |
public class EstimatePlaneAtInfinityGivenK { /** * Computes rotators which rotate t into [ | t | , 0,0]
* @ param t Input the vector , Output vector after rotator has been applied */
static void computeRotation ( DMatrix3 t , DMatrix3x3 R ) { } } | for ( int i = 1 ; i >= 0 ; i -- ) { double a = t . get ( i , 0 ) ; double b = t . get ( i + 1 , 0 ) ; // compute the rotator such that [ a , b ] = [ | | X | | , 0]
double r = Math . sqrt ( a * a + b * b ) ; double q11 = a / r ; double q21 = b / r ; // apply rotator to t and R
t . set ( i , 0 , r ) ; t . set ( i + 1 , 0 , 0 ) ; if ( i == 1 ) { R . a11 = 1 ; R . a12 = 0 ; R . a13 = 0 ; R . a21 = 0 ; R . a22 = q11 ; R . a23 = q21 ; R . a31 = 0 ; R . a32 = - q21 ; R . a33 = q11 ; } else { R . a11 = q11 ; R . a12 = R . a22 * q21 ; R . a13 = R . a23 * q21 ; R . a21 = - q21 ; R . a22 = R . a22 * q11 ; R . a23 = R . a23 * q11 ; } } |
public class Builder { /** * Adds a new row with two columns , the first one being a header cell .
* @ param < T > the type parameter
* @ param label the header cell content
* @ param data the second cell content
* @ return this builder */
public < T > Builder rowh ( String label , T data ) { } } | return tag ( "tr" ) . cellHeader ( label , false ) . cell ( data ) . end ( ) ; |
public class HtmlInputFile { /** * < p > Return the value of the < code > onselect < / code > property . < / p >
* < p > Contents : Javascript code executed when text within this
* element is selected by the user . */
public java . lang . String getOnselect ( ) { } } | return ( java . lang . String ) getStateHelper ( ) . eval ( PropertyKeys . onselect ) ; |
public class TopicApi { /** * subscribe to receive user events regarding specific topic ( s ) .
* subscribe to receive user events regarding specific topic ( s ) from interaction server .
* @ param subscribeTopicData ( 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 > subscribeTopicWithHttpInfo ( SubscribeTopicData subscribeTopicData ) throws ApiException { } } | com . squareup . okhttp . Call call = subscribeTopicValidateBeforeCall ( subscribeTopicData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class Props { /** * Returns a list of strings with the comma as the separator of the value . If the value is null ,
* it ' ll return the defaultValue . */
public List < String > getStringList ( final String key , final List < String > defaultValue ) { } } | if ( containsKey ( key ) ) { return getStringList ( key ) ; } else { return defaultValue ; } |
public class CalendarPeriod { /** * NOT operator */
public void Not ( ) { } } | if ( periods == null ) { if ( days == null ) // / / security added to avoid null exception
return ; for ( int i = 0 ; i < 7 ; i ++ ) days . getDay ( i ) . not ( ) ; return ; } List < Period > result = new ArrayList < Period > ( ) ; String curBegin = CalendarFunctions . TIME_BEGIN ; for ( int i = 0 ; i < periods . size ( ) ; i ++ ) { Period period = periods . get ( i ) ; if ( ( ! period . getFrom ( ) . equals ( CalendarFunctions . TIME_BEGIN ) ) && ( CalendarFunctions . date_add_day ( period . getFrom ( ) , - 1 ) . compareTo ( curBegin ) >= 0 ) ) result . add ( new Period ( curBegin , CalendarFunctions . date_add_day ( period . getFrom ( ) , - 1 ) ) ) ; curBegin = CalendarFunctions . date_add_day ( period . getTo ( ) , 1 ) ; } if ( CalendarFunctions . TIME_END . compareTo ( curBegin ) >= 0 ) result . add ( new Period ( curBegin , CalendarFunctions . TIME_END ) ) ; periods = result ; |
public class RequestUtils { /** * < p > Retrieves the proper extension of { @ link HttpRequestBase } for the given { @ link InvocationContext } .
* This implementation is solely dependent upon the { @ link RequestMethod } property in the annotated
* metdata of the endpoint method definition . < / p >
* @ param context
* the { @ link InvocationContext } for which a { @ link HttpRequestBase } is to be generated
* < br > < br >
* @ return the { @ link HttpRequestBase } translated from the { @ link InvocationContext } ' s { @ link RequestMethod }
* < br > < br >
* @ throws NullPointerException
* if the supplied { @ link InvocationContext } was { @ code null }
* < br > < br >
* @ since 1.3.0 */
static HttpRequestBase translateRequestMethod ( InvocationContext context ) { } } | RequestMethod requestMethod = Metadata . findMethod ( assertNotNull ( context ) . getRequest ( ) ) ; switch ( requestMethod ) { case POST : return new HttpPost ( ) ; case PUT : return new HttpPut ( ) ; case PATCH : return new HttpPatch ( ) ; case DELETE : return new HttpDelete ( ) ; case HEAD : return new HttpHead ( ) ; case TRACE : return new HttpTrace ( ) ; case OPTIONS : return new HttpOptions ( ) ; case GET : default : return new HttpGet ( ) ; } |
public class ApplicationUserRepository { /** * region > findByEmailAddress ( programmatic ) */
@ Programmatic public ApplicationUser findByEmailAddressCached ( final String emailAddress ) { } } | return queryResultsCache . execute ( new Callable < ApplicationUser > ( ) { @ Override public ApplicationUser call ( ) throws Exception { return findByEmailAddress ( emailAddress ) ; } } , ApplicationUserRepository . class , "findByEmailAddressCached" , emailAddress ) ; |
public class ModelMethod { /** * Check if method contains a parameter with value as typeName .
* @ param name the name
* @ return TypeMirror associated */
public TypeName findParameterType ( String name ) { } } | for ( Pair < String , TypeName > item : parameters ) { if ( item . value0 . equals ( name ) ) { return item . value1 ; } } return null ; |
public class CertificateVersion { /** * Delete the attribute value . */
public void delete ( String name ) throws IOException { } } | if ( name . equalsIgnoreCase ( VERSION ) ) { version = V1 ; } else { throw new IOException ( "Attribute name not recognized by " + "CertAttrSet: CertificateVersion." ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.