signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class SipAssert { /** * Asserts that the given message listener object has not received a request with the indicated
* CSeq method and sequence number .
* @ param method The CSeq method to verify absent ( SipRequest . INVITE , etc . )
* @ param sequenceNumber The CSeq sequence number to verify absent
* @ param obj The MessageListener object ( ie , SipCall , Subscription , etc . ) . */
public static void assertRequestNotReceived ( String method , long sequenceNumber , MessageListener obj ) { } } | assertRequestNotReceived ( null , method , sequenceNumber , obj ) ; |
public class SIPBalancerForwarder { /** * ( non - Javadoc )
* @ see javax . sip . SipListener # processTimeout ( javax . sip . TimeoutEvent ) */
public void processTimeout ( TimeoutEvent timeoutEvent ) { } } | Transaction transaction = null ; if ( timeoutEvent . isServerTransaction ( ) ) { transaction = timeoutEvent . getServerTransaction ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "timeout => " + transaction . getRequest ( ) . toString ( ) ) ; } } else { transaction = timeoutEvent . getClientTransaction ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "timeout => " + transaction . getRequest ( ) . toString ( ) ) ; } } String callId = ( ( CallIdHeader ) transaction . getRequest ( ) . getHeader ( CallIdHeader . NAME ) ) . getCallId ( ) ; register . unStickSessionFromNode ( callId ) ; |
public class IOUtils { /** * Create a Reader with an explicit encoding around an InputStream .
* This static method will treat null as meaning to use the platform default ,
* unlike the Java library methods that disallow a null encoding .
* @ param stream An InputStream
* @ param encoding A charset encoding
* @ return A Reader
* @ throws IOException If any IO problem */
public static Writer encodedOutputStreamWriter ( OutputStream stream , String encoding ) throws IOException { } } | // OutputStreamWriter doesn ' t allow encoding to be null ;
if ( encoding == null ) { return new OutputStreamWriter ( stream ) ; } else { return new OutputStreamWriter ( stream , encoding ) ; } |
public class JvmTypesBuilder { /** * Detects whether the type reference refers to primitive boolean .
* @ since 2.9 */
protected boolean isPrimitiveBoolean ( JvmTypeReference typeRef ) { } } | if ( InferredTypeIndicator . isInferred ( typeRef ) ) { return false ; } return typeRef != null && typeRef . getType ( ) != null && ! typeRef . getType ( ) . eIsProxy ( ) && "boolean" . equals ( typeRef . getType ( ) . getIdentifier ( ) ) ; |
public class CmsImageFormatsTab { /** * Displays the provided image information . < p >
* @ param imageInfo the image information */
public void fillContent ( CmsImageInfoBean imageInfo ) { } } | String viewLink = imageInfo . getViewLink ( ) != null ? imageInfo . getViewLink ( ) : CmsCoreProvider . get ( ) . link ( imageInfo . getResourcePath ( ) ) ; CmsCroppingDialog croppingDialog = new CmsCroppingDialog ( viewLink ) ; m_handler . getGalleryDialog ( ) . getParentPanel ( ) . add ( croppingDialog ) ; CmsImageFormatHandler formatHandler = new CmsImageFormatHandler ( getDialogMode ( ) , m_handler . getGalleryDialog ( ) , imageInfo . getSelectedPath ( ) , imageInfo . getHeight ( ) , imageInfo . getWidth ( ) ) ; CmsImageFormatsForm formatsForm = new CmsImageFormatsForm ( formatHandler ) ; formatHandler . init ( formatsForm , croppingDialog ) ; m_handler . setFormatHandler ( formatHandler ) ; m_content . clear ( ) ; m_content . add ( formatsForm ) ; |
public class CmsTemplateContextManager { /** * Checks if the property value starts with the prefix which marks a dynamic template provider . < p >
* @ param propertyValue the property value to check
* @ return true if the value has the format of a dynamic template provider */
public static boolean hasPropertyPrefix ( String propertyValue ) { } } | return ( propertyValue != null ) && ( propertyValue . startsWith ( DYNAMIC_TEMPLATE_PREFIX ) || propertyValue . startsWith ( DYNAMIC_TEMPLATE_LEGACY_PREFIX ) ) ; |
public class JXLCellFormatter { /** * エラー型のセルの値を取得する 。
* @ since 0.4
* @ param cell
* @ param locale
* @ param isStartDate1904
* @ return */
private CellFormatResult getErrorCellValue ( final Cell cell , final Locale locale , final boolean isStartDate1904 ) { } } | final CellFormatResult result = new CellFormatResult ( ) ; result . setCellType ( FormatCellType . Error ) ; final ErrorCell errorCell = ( ErrorCell ) cell ; final int errorCode = errorCell . getErrorCode ( ) ; result . setValue ( errorCode ) ; if ( isErrorCellAsEmpty ( ) ) { result . setText ( "" ) ; } else { /* * エラーコードについては 、 POIクラスを参照 。
* ・ org . apache . poi . ss . usermodel . FormulaError
* ・ org . apache . poi . ss . usermodel . ErrorConstants */
switch ( errorCode ) { case 7 : // 0除算
result . setText ( "#DIV/0!" ) ; break ; case 42 : // 関数や数式に使用できる値がない
result . setText ( "#N/A" ) ; break ; case 29 : // 数式が参照している名称がない
result . setText ( "#NAME?" ) ; break ; case 0 : // 正しくない参照演算子または正しくないセル参照を使っている
result . setText ( "#NULL!" ) ; break ; case 36 : // 数式または関数の数値が不適切
result . setText ( "#NUM!" ) ; break ; case 23 : // 数式が参照しているセルがない
result . setText ( "#REF!" ) ; break ; case 15 : // 文字列が正しいデータ型に変換されない
result . setText ( "#VALUE!" ) ; break ; default : result . setText ( "" ) ; break ; } } return result ; |
public class SliceUtf8 { /** * Removes all white { @ code whiteSpaceCodePoints } from the left and right side of the string .
* Note : Invalid UTF - 8 sequences are not trimmed . */
public static Slice trim ( Slice utf8 , int [ ] whiteSpaceCodePoints ) { } } | int start = firstNonMatchPosition ( utf8 , whiteSpaceCodePoints ) ; int end = lastNonMatchPosition ( utf8 , start , whiteSpaceCodePoints ) ; return utf8 . slice ( start , end - start ) ; |
public class TCPChannel { /** * @ see com . ibm . wsspi . channelfw . Channel # update ( ChannelData ) */
@ Override public void update ( ChannelData cc ) { } } | synchronized ( this ) { // can ' t do two updates at the same time
if ( this . config . checkAndSetValues ( cc ) ) { this . alists = AccessLists . getInstance ( this . config ) ; } } |
public class FileUtil { /** * 转换文件编码 < br >
* 此方法用于转换文件编码 , 读取的文件实际编码必须与指定的srcCharset编码一致 , 否则导致乱码
* @ param file 文件
* @ param srcCharset 原文件的编码 , 必须与文件内容的编码保持一致
* @ param destCharset 转码后的编码
* @ return 被转换编码的文件
* @ see CharsetUtil # convert ( File , Charset , Charset )
* @ since 3.1.0 */
public static File convertCharset ( File file , Charset srcCharset , Charset destCharset ) { } } | return CharsetUtil . convert ( file , srcCharset , destCharset ) ; |
public class Interval { /** * Compares this to another Interval
* @ return { @ code 1 } if this Interval ' s lower bound is lower than the argument ' s , { @ code 0 } if they are the same , { @ code 1 } otherwise */
@ Override public int compareTo ( Object arg0 ) { } } | Interval that = ( Interval ) arg0 ; return this . bounds . compareTo ( that . getBounds ( ) ) ; |
import java . util . HashMap ; import java . util . Map ; import java . util . Collections ; class mostFrequentChar { /** * This function calculates the character that appears most frequently in a provided string .
* Examples :
* mostFrequentChar ( " hello world " ) ; - > ' l '
* mostFrequentChar ( " hello " ) ; - > ' l '
* mostFrequentChar ( " python pr " ) ; - > ' p '
* args :
* input _ str : A string where to find the most frequent character .
* returns :
* The most common character in the string . */
public static char mostFrequentChar ( String input_str ) { } } | Map < Character , Integer > charFreq = new HashMap < Character , Integer > ( ) ; for ( char c : input_str . toCharArray ( ) ) { if ( charFreq . containsKey ( c ) ) { charFreq . put ( c , charFreq . get ( c ) + 1 ) ; } else { charFreq . put ( c , 1 ) ; } } char dominantChar = Collections . max ( charFreq . entrySet ( ) , Map . Entry . comparingByValue ( ) ) . getKey ( ) ; return dominantChar ; |
public class MultiPartParser { private void setString ( String s ) { } } | _string . reset ( ) ; _string . append ( s ) ; _length = s . length ( ) ; |
public class ContentSceneController { /** * Execute a task in the { @ linkplain MainThread # runOnMainThread ( Runnable )
* main thread } and { @ link ContentScene # hide ( ) hide ( ) } has been called on
* the { @ link ContentScene } at the top of the view stack ( if there is one ) .
* The task ' s { @ link Runnable # run ( ) run ( ) } method may freely manipulate the
* { @ code ContentScene } view stack .
* After the task has been run , if there is a { @ code ContentScene } on the
* view stack , { @ code drawFrameListener } will be re - registered and
* { @ link ContentScene # show ( ) show ( ) } will be called on the
* { @ code ContentScene } .
* @ param contentScene
* The { @ link Runnable } to execute . */
private void executeHideShowCycle ( final ContentScene contentScene ) { } } | // When there is no ongoing show - hide execution chain , create a new one
if ( nextContentScene == null ) { nextContentScene = contentScene ; new ExecutionChain ( mGvrContext ) . runOnMainThread ( new Runnable ( ) { @ Override public void run ( ) { ContentScene localNextContentScene = null ; // Recursively execute hide - show cycle until stablized
while ( nextContentScene != localNextContentScene ) { localNextContentScene = nextContentScene ; if ( curContentScene == localNextContentScene ) { Log . d ( TAG , "skip the same scene to show %s" , curContentScene . getName ( ) ) ; break ; } // Hide current contentScene
if ( curContentScene != null ) { Log . d ( TAG , "executeHideShowCycle(): hiding %s" , curContentScene . getName ( ) ) ; curContentScene . hide ( ) ; WidgetLib . getTouchManager ( ) . setFlingHandler ( null ) ; } // Show next contentScene
if ( localNextContentScene != null ) { Log . d ( TAG , "executeHideShowCycle(): showing %s" , localNextContentScene . getName ( ) ) ; localNextContentScene . show ( ) ; WidgetLib . getTouchManager ( ) . setFlingHandler ( localNextContentScene . getFlingHandler ( ) ) ; curContentScene = localNextContentScene ; } } nextContentScene = null ; } } ) . execute ( ) ; } else { nextContentScene = contentScene ; } |
public class JMSMbeansActivator { /** * Registers MBean for JMSServiceProvider . . in future can be made generic .
* @ param jmsResourceName
* @ param bundleContext
* @ return */
private ServiceRegistration < ? > registerMBeanService ( String jmsResourceName , BundleContext bundleContext ) { } } | Dictionary < String , String > props = new Hashtable < String , String > ( ) ; props . put ( KEY_SERVICE_VENDOR , "IBM" ) ; JmsServiceProviderMBeanImpl jmsProviderMBean = new JmsServiceProviderMBeanImpl ( getServerName ( ) , KEY_JMS2_PROVIDER ) ; props . put ( KEY_JMX_OBJECTNAME , jmsProviderMBean . getobjectName ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "JmsQueueMBeanImpl=" + jmsProviderMBean . getobjectName ( ) + " props=" + props ) ; } return bundleContext . registerService ( JmsServiceProviderMBeanImpl . class , jmsProviderMBean , props ) ; |
public class GalaxyProperties { /** * Gets the config ini for this Galaxy installation .
* @ param galaxyRoot The root directory of Galaxy .
* @ return A File object for the config ini for Galaxy . */
private File getConfigIni ( File galaxyRoot ) { } } | if ( isPre20141006Release ( galaxyRoot ) ) { return new File ( galaxyRoot , "universe_wsgi.ini" ) ; } else { File configDirectory = new File ( galaxyRoot , CONFIG_DIR_NAME ) ; return new File ( configDirectory , "galaxy.ini" ) ; } |
public class BpmnParseUtil { /** * Returns the { @ link IoMapping } of an element .
* @ param element the element to parse
* @ return the input output mapping or null if non defined
* @ throws BpmnParseException if a input / output parameter element is malformed */
public static IoMapping parseInputOutput ( Element element ) { } } | Element inputOutputElement = element . elementNS ( BpmnParse . CAMUNDA_BPMN_EXTENSIONS_NS , "inputOutput" ) ; if ( inputOutputElement != null ) { IoMapping ioMapping = new IoMapping ( ) ; parseCamundaInputParameters ( inputOutputElement , ioMapping ) ; parseCamundaOutputParameters ( inputOutputElement , ioMapping ) ; return ioMapping ; } return null ; |
public class Media { /** * Writes the given { @ code byte [ ] } to a stream .
* @ throws IOException if the steam cannot be written to */
@ VisibleForTesting static void writeBytesToStream ( byte [ ] bytes , final OutputStream outputStream ) throws IOException { } } | new ByteSink ( ) { @ Override public OutputStream openStream ( ) { return outputStream ; } } . write ( bytes ) ; |
public class RTMPConnection { /** * { @ inheritDoc } */
public ISingleItemSubscriberStream newSingleItemSubscriberStream ( Number streamId ) { } } | if ( isValidStreamId ( streamId ) ) { // get SingleItemSubscriberStream defined as a prototype in red5 - common . xml
SingleItemSubscriberStream siss = ( SingleItemSubscriberStream ) scope . getContext ( ) . getBean ( "singleItemSubscriberStream" ) ; customizeStream ( streamId , siss ) ; if ( ! registerStream ( siss ) ) { siss = null ; } return siss ; } return null ; |
public class MtasDataDoubleOperations { /** * ( non - Javadoc )
* @ see mtas . codec . util . DataCollector . MtasDataOperations # divide2 ( java . lang .
* Number , long ) */
@ Override public Double divide2 ( Double arg1 , long arg2 ) { } } | if ( arg1 == null ) { return Double . NaN ; } else { return arg1 / arg2 ; } |
public class Sql { /** * Base internal method for call ( ) , callWithRows ( ) , and callWithAllRows ( ) style of methods .
* Performs a stored procedure call with the given parameters ,
* calling the closure once with all result objects ,
* and also returning the rows of the ResultSet ( s ) ( if processResultSets is set to
* Sql . FIRST _ RESULT _ SET , Sql . ALL _ RESULT _ SETS )
* Main purpose of processResultSets param is to retain original call ( ) method
* performance when this is set to Sql . NO _ RESULT _ SETS
* Resource handling is performed automatically where appropriate .
* @ param sql the sql statement
* @ param params a list of parameters
* @ param processResultsSets the result sets to process , either Sql . NO _ RESULT _ SETS , Sql . FIRST _ RESULT _ SET , or Sql . ALL _ RESULT _ SETS
* @ param closure called once with all out parameter results
* @ return a list of GroovyRowResult objects
* @ throws SQLException if a database access error occurs
* @ see # callWithRows ( String , List , Closure ) */
protected List < List < GroovyRowResult > > callWithRows ( String sql , List < Object > params , int processResultsSets , Closure closure ) throws SQLException { } } | Connection connection = createConnection ( ) ; CallableStatement statement = null ; List < GroovyResultSet > resultSetResources = new ArrayList < GroovyResultSet > ( ) ; try { statement = connection . prepareCall ( sql ) ; LOG . fine ( sql + " | " + params ) ; setParameters ( params , statement ) ; boolean hasResultSet = statement . execute ( ) ; List < Object > results = new ArrayList < Object > ( ) ; int indx = 0 ; int inouts = 0 ; for ( Object value : params ) { if ( value instanceof OutParameter ) { if ( value instanceof ResultSetOutParameter ) { GroovyResultSet resultSet = CallResultSet . getImpl ( statement , indx ) ; resultSetResources . add ( resultSet ) ; results . add ( resultSet ) ; } else { Object o = statement . getObject ( indx + 1 ) ; if ( o instanceof ResultSet ) { GroovyResultSet resultSet = new GroovyResultSetProxy ( ( ResultSet ) o ) . getImpl ( ) ; results . add ( resultSet ) ; resultSetResources . add ( resultSet ) ; } else { results . add ( o ) ; } } inouts ++ ; } indx ++ ; } closure . call ( results . toArray ( new Object [ inouts ] ) ) ; List < List < GroovyRowResult > > resultSets = new ArrayList < List < GroovyRowResult > > ( ) ; if ( processResultsSets == NO_RESULT_SETS ) { resultSets . add ( new ArrayList < GroovyRowResult > ( ) ) ; return resultSets ; } // Check both hasResultSet and getMoreResults ( ) because of differences in vendor behavior
if ( ! hasResultSet ) { hasResultSet = statement . getMoreResults ( ) ; } while ( hasResultSet && ( processResultsSets != NO_RESULT_SETS ) ) { resultSets . add ( asList ( sql , statement . getResultSet ( ) ) ) ; if ( processResultsSets == FIRST_RESULT_SET ) { break ; } else { hasResultSet = statement . getMoreResults ( ) ; } } return resultSets ; } catch ( SQLException e ) { LOG . warning ( "Failed to execute: " + sql + " because: " + e . getMessage ( ) ) ; throw e ; } finally { for ( GroovyResultSet rs : resultSetResources ) { closeResources ( null , null , rs ) ; } closeResources ( connection , statement ) ; } |
public class SQLiteAssetHelper { /** * Create and / or open a database . This will be the same object returned by
* { @ link # getWritableDatabase } unless some problem , such as a full disk ,
* requires the database to be opened read - only . In that case , a read - only
* database object will be returned . If the problem is fixed , a future call
* to { @ link # getWritableDatabase } may succeed , in which case the read - only
* database object will be closed and the read / write object will be returned
* in the future .
* < p class = " caution " > Like { @ link # getWritableDatabase } , this method may
* take a long time to return , so you should not call it from the
* application main thread , including from
* { @ link android . content . ContentProvider # onCreate ContentProvider . onCreate ( ) } .
* @ throws SQLiteException if the database cannot be opened
* @ return a database object valid until { @ link # getWritableDatabase }
* or { @ link # close } is called . */
@ Override public synchronized SQLiteDatabase getReadableDatabase ( ) { } } | if ( mDatabase != null && mDatabase . isOpen ( ) ) { return mDatabase ; // The database is already open for business
} if ( mIsInitializing ) { throw new IllegalStateException ( "getReadableDatabase called recursively" ) ; } try { return getWritableDatabase ( ) ; } catch ( SQLiteException e ) { if ( mName == null ) throw e ; // Can ' t open a temp database read - only !
Log . e ( TAG , "Couldn't open " + mName + " for writing (will try read-only):" , e ) ; } SQLiteDatabase db = null ; try { mIsInitializing = true ; String path = mContext . getDatabasePath ( mName ) . getPath ( ) ; db = SQLiteDatabase . openDatabase ( path , mFactory , SQLiteDatabase . OPEN_READONLY ) ; if ( db . getVersion ( ) != mNewVersion ) { throw new SQLiteException ( "Can't upgrade read-only database from version " + db . getVersion ( ) + " to " + mNewVersion + ": " + path ) ; } onOpen ( db ) ; Log . w ( TAG , "Opened " + mName + " in read-only mode" ) ; mDatabase = db ; return mDatabase ; } finally { mIsInitializing = false ; if ( db != null && db != mDatabase ) db . close ( ) ; } |
public class SemanticSearchServiceHelper { /** * Create a boolean should query for composite tags containing multiple ontology terms
* @ return return a boolean should queryRule */
public QueryRule createShouldQueryRule ( String multiOntologyTermIri ) { } } | QueryRule shouldQueryRule = new QueryRule ( new ArrayList < > ( ) ) ; shouldQueryRule . setOperator ( Operator . SHOULD ) ; for ( String ontologyTermIri : multiOntologyTermIri . split ( COMMA_CHAR ) ) { OntologyTerm ontologyTerm = ontologyService . getOntologyTerm ( ontologyTermIri ) ; List < String > queryTerms = parseOntologyTermQueries ( ontologyTerm ) ; Double termFrequency = getBestInverseDocumentFrequency ( queryTerms ) ; shouldQueryRule . getNestedRules ( ) . add ( createBoostedDisMaxQueryRuleForTerms ( queryTerms , termFrequency ) ) ; } return shouldQueryRule ; |
public class ConnectorManager { /** * Start the connector , accepting new connections */
@ Override public void start ( ) { } } | synchronized ( this . lifecycleMonitor ) { if ( ! isRunning ( ) ) { log . info ( "start: Starting ConnectorManager" ) ; try { connector . start ( ) ; } catch ( ConfigError | RuntimeError ex ) { throw new ConfigurationException ( ex . getMessage ( ) , ex ) ; } catch ( Throwable ex ) { throw new IllegalStateException ( "Could not start the connector" , ex ) ; } running = true ; } } |
public class Layers { /** * Removes all layers .
* @ param redraw Whether the map should be redrawn after removing the layers
* @ see List # clear ( ) */
public synchronized void clear ( boolean redraw ) { } } | for ( Layer layer : this . layersList ) { layer . unassign ( ) ; } this . layersList . clear ( ) ; if ( redraw ) { this . redrawer . redrawLayers ( ) ; } |
public class druidGLexer { /** * $ ANTLR start " THEN " */
public final void mTHEN ( ) throws RecognitionException { } } | try { int _type = THEN ; int _channel = DEFAULT_TOKEN_CHANNEL ; // druidG . g : 644:6 : ( ( ' THEN ' | ' then ' ) )
// druidG . g : 644:8 : ( ' THEN ' | ' then ' )
{ // druidG . g : 644:8 : ( ' THEN ' | ' then ' )
int alt32 = 2 ; int LA32_0 = input . LA ( 1 ) ; if ( ( LA32_0 == 'T' ) ) { alt32 = 1 ; } else if ( ( LA32_0 == 't' ) ) { alt32 = 2 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 32 , 0 , input ) ; throw nvae ; } switch ( alt32 ) { case 1 : // druidG . g : 644:9 : ' THEN '
{ match ( "THEN" ) ; } break ; case 2 : // druidG . g : 644:18 : ' then '
{ match ( "then" ) ; } break ; } } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving
} |
public class JavadocConverter { /** * Set a TreeNode ' s position using begin and end source offsets . Its line number
* is unchanged . */
private TreeNode setPos ( TreeNode newNode , int pos , int endPos ) { } } | return newNode . setPosition ( new SourcePosition ( pos , endPos - pos , lineNumber ( pos ) ) ) ; |
public class GeneralOperations { /** * It closes a < code > Connection < / code > if not < code > null < / code > . */
public static void closeConnection ( Connection connection ) throws InternalErrorException { } } | if ( connection != null ) { try { connection . close ( ) ; } catch ( SQLException e ) { throw new InternalErrorException ( e ) ; } } |
public class BindCursorBuilder { /** * / * ( non - Javadoc )
* @ see com . abubusoft . kripton . processor . core . ModelElementVisitor # visit ( com . abubusoft . kripton . processor . core . ModelProperty ) */
@ Override public void visit ( SQLProperty property ) throws Exception { } } | // add property index
classBuilder . addField ( FieldSpec . builder ( Integer . TYPE , "index" + ( counter ++ ) , Modifier . PROTECTED ) . addJavadoc ( "Index for column $S\n" , property . getName ( ) ) . build ( ) ) ; |
public class DataStream { /** * Adds the given sink to this DataStream . Only streams with sinks added
* will be executed once the { @ link StreamExecutionEnvironment # execute ( ) }
* method is called .
* @ param sinkFunction
* The object containing the sink ' s invoke function .
* @ return The closed DataStream . */
public DataStreamSink < T > addSink ( SinkFunction < T > sinkFunction ) { } } | // read the output type of the input Transform to coax out errors about MissingTypeInfo
transformation . getOutputType ( ) ; // configure the type if needed
if ( sinkFunction instanceof InputTypeConfigurable ) { ( ( InputTypeConfigurable ) sinkFunction ) . setInputType ( getType ( ) , getExecutionConfig ( ) ) ; } StreamSink < T > sinkOperator = new StreamSink < > ( clean ( sinkFunction ) ) ; DataStreamSink < T > sink = new DataStreamSink < > ( this , sinkOperator ) ; getExecutionEnvironment ( ) . addOperator ( sink . getTransformation ( ) ) ; return sink ; |
public class ResourceList { /** * This method makes the API call to get the list value for the specified resource . It loads the return
* from the API into the arrayList , updates the index if necessary and sets the new link values
* @ param params the params */
protected void getPage ( final JSONObject params ) { } } | if ( this . client == null ) client = BandwidthClient . getInstance ( ) ; try { final RestResponse response = client . get ( resourceUri , params ) ; final JSONArray array = Utils . response2JSONArray ( response ) ; for ( final Object obj : array ) { final E elem = clazz . getConstructor ( BandwidthClient . class , JSONObject . class ) . newInstance ( client , ( JSONObject ) obj ) ; add ( elem ) ; } // if anything comes back , reset the index
if ( array . size ( ) > 0 ) this . index = 0 ; // set the next links
this . setNextLink ( response . getNextLink ( ) ) ; this . setFirstLink ( response . getFirstLink ( ) ) ; this . setPreviousLink ( response . getPreviousLink ( ) ) ; } catch ( final Exception e ) { e . printStackTrace ( ) ; } |
public class SumExpression { /** * / * Calculate the sum of two numbers , preserving integral type if possible . */
private static Number sum_impl_ ( Number x , Number y ) { } } | if ( x instanceof Double || y instanceof Double ) return Double . valueOf ( x . doubleValue ( ) + y . doubleValue ( ) ) ; else return Long . valueOf ( x . longValue ( ) + y . longValue ( ) ) ; |
public class YarnIntraNonHaMasterServices { @ Override public void close ( ) throws Exception { } } | if ( enterUnlessClosed ( ) ) { try { try { // this class ' own cleanup logic
resourceManagerLeaderElectionService . shutdown ( ) ; dispatcher . shutdownNow ( ) ; } finally { // in any case must we call the parent cleanup logic
super . close ( ) ; } } finally { exit ( ) ; } } |
public class ModelAnnotation { /** * Gets the attribute as int .
* @ param attribute the attribute
* @ return the attribute as int */
public int getAttributeAsInt ( AnnotationAttributeType attribute ) { } } | String temp = attributes . get ( attribute . getValue ( ) ) ; return Integer . parseInt ( temp ) ; |
public class AbstractParamDialog { /** * Adds the given panel with the given name positioned under the given parents ( or root node if none given ) .
* If not sorted the panel is appended to existing panels .
* @ param parentParams the name of the parent nodes of the panel , might be { @ code null } .
* @ param name the name of the panel , must not be { @ code null } .
* @ param panel the panel , must not be { @ code null } .
* @ param sort { @ code true } if the panel should be added in alphabetic order , { @ code false } otherwise */
public void addParamPanel ( String [ ] parentParams , String name , AbstractParamPanel panel , boolean sort ) { } } | this . getJSplitPane ( ) . addParamPanel ( parentParams , name , panel , sort ) ; |
public class DateRangeParam { /** * Sets the lower bound to be greaterthan or equal to the given date */
public DateRangeParam setLowerBoundInclusive ( Date theLowerBound ) { } } | validateAndSet ( new DateParam ( ParamPrefixEnum . GREATERTHAN_OR_EQUALS , theLowerBound ) , myUpperBound ) ; return this ; |
public class InjectionService { /** * Returns the received { @ code x - armeria - text } , { @ code x - armeria - sequence } , { @ code Cookie } headers
* to the sender as a JSON list . */
@ Get ( "/header" ) public HttpResponse header ( @ Header String xArmeriaText , /* no conversion */
@ Header List < Integer > xArmeriaSequence , /* converted into integer */
Cookies cookies /* converted into Cookies object */
) throws JsonProcessingException { } } | return HttpResponse . of ( HttpStatus . OK , MediaType . JSON_UTF_8 , mapper . writeValueAsBytes ( Arrays . asList ( xArmeriaText , xArmeriaSequence , cookies . stream ( ) . map ( Cookie :: name ) . collect ( Collectors . toList ( ) ) ) ) ) ; |
public class ElemWithParam { /** * Call the children visitors .
* @ param visitor The visitor whose appropriate method will be called . */
protected void callChildVisitors ( XSLTVisitor visitor , boolean callAttrs ) { } } | if ( callAttrs && ( null != m_selectPattern ) ) m_selectPattern . getExpression ( ) . callVisitors ( m_selectPattern , visitor ) ; super . callChildVisitors ( visitor , callAttrs ) ; |
public class Configuration { /** * Same as { @ link Configuration # getProperty ( String , String ) } , but a integer is parsed .
* @ param category The category of the property
* @ param key The key ( identifier ) of the property
* @ return the integer value parsed from the property */
public int getInt ( String category , String key ) { } } | String value = this . getProperty ( category , key ) . toLowerCase ( ) . trim ( ) ; return Integer . parseInt ( value ) ; |
public class CommonUtils { /** * to compensate https : / / hibernate . atlassian . net / browse / HHH - 8091 add empty element to the roles in case it ' s empty */
public static List < String > getCallbackUserRoles ( UserGroupCallback userGroupCallback , String userId ) { } } | List < String > roles = userGroupCallback != null ? userGroupCallback . getGroupsForUser ( userId ) : new ArrayList < > ( ) ; if ( roles == null || roles . isEmpty ( ) ) { roles = new ArrayList < > ( ) ; roles . add ( "" ) ; } return roles ; |
public class AbstractTemplateView { /** * Build and return the footer panel .
* @ return the footer panel */
protected Node getFooterPanel ( ) { } } | this . pageLabel = LabelBuilder . create ( ) . text ( String . valueOf ( model ( ) . getSlide ( ) . getPage ( ) ) ) . font ( PrezFonts . PAGE . get ( ) ) . build ( ) ; final AnchorPane ap = AnchorPaneBuilder . create ( ) . children ( this . pageLabel ) . build ( ) ; AnchorPane . setRightAnchor ( this . pageLabel , 20.0 ) ; final StackPane sp = StackPaneBuilder . create ( ) . styleClass ( "footer" ) . prefHeight ( 35.0 ) . minHeight ( Region . USE_PREF_SIZE ) . maxHeight ( Region . USE_PREF_SIZE ) . children ( ap ) . build ( ) ; StackPane . setAlignment ( ap , Pos . CENTER_RIGHT ) ; return sp ; |
public class ParentDrawController { public void setEditMode ( EditMode currentMode ) { } } | super . setEditMode ( currentMode ) ; if ( controller != null ) { controller . setEditMode ( currentMode ) ; } |
public class ExtensionRegistryLite { /** * Add an extension from a lite generated file to the registry . */
public final void add ( final GeneratedMessageLite . GeneratedExtension < ? , ? > extension ) { } } | extensionsByNumber . put ( new ObjectIntPair ( extension . getContainingTypeDefaultInstance ( ) , extension . getNumber ( ) ) , extension ) ; |
public class OrderPreservingFilteredIterator { /** * Returns the next word from the reader that has passed the filter . */
public String next ( ) { } } | if ( next == null ) { throw new NoSuchElementException ( ) ; } String s = next ; advance ( ) ; return s ; |
public class AmazonMachineLearningClient { /** * Creates a new < code > MLModel < / code > using the < code > DataSource < / code > and the recipe as information sources .
* An < code > MLModel < / code > is nearly immutable . Users can update only the < code > MLModelName < / code > and the
* < code > ScoreThreshold < / code > in an < code > MLModel < / code > without creating a new < code > MLModel < / code > .
* < code > CreateMLModel < / code > is an asynchronous operation . In response to < code > CreateMLModel < / code > , Amazon
* Machine Learning ( Amazon ML ) immediately returns and sets the < code > MLModel < / code > status to < code > PENDING < / code >
* . After the < code > MLModel < / code > has been created and ready is for use , Amazon ML sets the status to
* < code > COMPLETED < / code > .
* You can use the < code > GetMLModel < / code > operation to check the progress of the < code > MLModel < / code > during the
* creation operation .
* < code > CreateMLModel < / code > requires a < code > DataSource < / code > with computed statistics , which can be created by
* setting < code > ComputeStatistics < / code > to < code > true < / code > in < code > CreateDataSourceFromRDS < / code > ,
* < code > CreateDataSourceFromS3 < / code > , or < code > CreateDataSourceFromRedshift < / code > operations .
* @ param createMLModelRequest
* @ return Result of the CreateMLModel operation returned by the service .
* @ throws InvalidInputException
* An error on the client occurred . Typically , the cause is an invalid input value .
* @ throws InternalServerException
* An error on the server occurred when trying to process a request .
* @ throws IdempotentParameterMismatchException
* A second request to use or change an object was not allowed . This can result from retrying a request
* using a parameter that was not present in the original request .
* @ sample AmazonMachineLearning . CreateMLModel */
@ Override public CreateMLModelResult createMLModel ( CreateMLModelRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeCreateMLModel ( request ) ; |
public class PinViewUtils { /** * Hides the already popped up keyboard from the screen .
* @ param context Context to get current focus . */
public static void hideKeyboard ( Context context ) { } } | try { InputMethodManager imm = ( InputMethodManager ) context . getSystemService ( Context . INPUT_METHOD_SERVICE ) ; View currentFocus = ( ( Activity ) context ) . getCurrentFocus ( ) ; if ( imm != null && currentFocus != null ) { IBinder windowToken = currentFocus . getWindowToken ( ) ; if ( windowToken != null ) { imm . hideSoftInputFromWindow ( windowToken , 0 ) ; } } } catch ( Exception e ) { Log . e ( LOG_TAG , "Can't even hide keyboard " + e . getMessage ( ) ) ; } |
public class StartupDatabaseConnection { /** * The class defined with parameter _ classTM initialized and bind to { @ link # RESOURCE _ TRANSSYNREG } . The initialized
* class must implement interface { @ link TransactionSynchronizationRegistry } .
* @ param _ compCtx Java root naming context
* @ param _ classTSR class name of the transaction SynchronizationRegistry
* @ throws StartupException if the transaction manager class could not be found , initialized , accessed or bind to
* the context */
protected static void configureTransactionSynchronizationRegistry ( final Context _compCtx , final String _classTSR ) throws StartupException { } } | try { final Object clzz = Class . forName ( _classTSR ) . newInstance ( ) ; if ( clzz == null ) { throw new StartupException ( "could not initaliase database type" ) ; } else { if ( clzz instanceof TransactionSynchronizationRegistry ) { Util . bind ( _compCtx , "env/" + INamingBinds . RESOURCE_TRANSSYNREG , clzz ) ; Util . bind ( _compCtx , "TransactionSynchronizationRegistry" , clzz ) ; } else if ( clzz instanceof ObjectFactory ) { final Reference ref = new Reference ( TransactionSynchronizationRegistry . class . getName ( ) , clzz . getClass ( ) . getName ( ) , null ) ; Util . bind ( _compCtx , "env/" + INamingBinds . RESOURCE_TRANSSYNREG , ref ) ; Util . bind ( _compCtx , "TransactionSynchronizationRegistry" , ref ) ; } } } catch ( final ClassNotFoundException e ) { throw new StartupException ( "could not found TransactionSynchronizationRegistry '" + _classTSR + "'" , e ) ; } catch ( final InstantiationException e ) { throw new StartupException ( "could not initialise TransactionSynchronizationRegistry class '" + _classTSR + "'" , e ) ; } catch ( final IllegalAccessException e ) { throw new StartupException ( "could not access TransactionSynchronizationRegistry class '" + _classTSR + "'" , e ) ; } catch ( final NamingException e ) { throw new StartupException ( "could not bind Transaction Synchronization Registry class '" + _classTSR + "'" , e ) ; } |
public class CmsPatternPanelYearlyController { /** * Set the week day .
* @ param weekDayStr the week day to set . */
public void setWeekDay ( String weekDayStr ) { } } | final WeekDay weekDay = WeekDay . valueOf ( weekDayStr ) ; if ( ( m_model . getWeekDay ( ) != null ) || ! m_model . getWeekDay ( ) . equals ( weekDay ) ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { m_model . setWeekDay ( weekDay ) ; onValueChange ( ) ; } } ) ; } |
public class Matrix4d { /** * / * ( non - Javadoc )
* @ see org . joml . Matrix4dc # shadow ( double , double , double , double , double , double , double , double , org . joml . Matrix4d ) */
public Matrix4d shadow ( double lightX , double lightY , double lightZ , double lightW , double a , double b , double c , double d , Matrix4d dest ) { } } | // normalize plane
double invPlaneLen = 1.0 / Math . sqrt ( a * a + b * b + c * c ) ; double an = a * invPlaneLen ; double bn = b * invPlaneLen ; double cn = c * invPlaneLen ; double dn = d * invPlaneLen ; double dot = an * lightX + bn * lightY + cn * lightZ + dn * lightW ; // compute right matrix elements
double rm00 = dot - an * lightX ; double rm01 = - an * lightY ; double rm02 = - an * lightZ ; double rm03 = - an * lightW ; double rm10 = - bn * lightX ; double rm11 = dot - bn * lightY ; double rm12 = - bn * lightZ ; double rm13 = - bn * lightW ; double rm20 = - cn * lightX ; double rm21 = - cn * lightY ; double rm22 = dot - cn * lightZ ; double rm23 = - cn * lightW ; double rm30 = - dn * lightX ; double rm31 = - dn * lightY ; double rm32 = - dn * lightZ ; double rm33 = dot - dn * lightW ; // matrix multiplication
double nm00 = m00 * rm00 + m10 * rm01 + m20 * rm02 + m30 * rm03 ; double nm01 = m01 * rm00 + m11 * rm01 + m21 * rm02 + m31 * rm03 ; double nm02 = m02 * rm00 + m12 * rm01 + m22 * rm02 + m32 * rm03 ; double nm03 = m03 * rm00 + m13 * rm01 + m23 * rm02 + m33 * rm03 ; double nm10 = m00 * rm10 + m10 * rm11 + m20 * rm12 + m30 * rm13 ; double nm11 = m01 * rm10 + m11 * rm11 + m21 * rm12 + m31 * rm13 ; double nm12 = m02 * rm10 + m12 * rm11 + m22 * rm12 + m32 * rm13 ; double nm13 = m03 * rm10 + m13 * rm11 + m23 * rm12 + m33 * rm13 ; double nm20 = m00 * rm20 + m10 * rm21 + m20 * rm22 + m30 * rm23 ; double nm21 = m01 * rm20 + m11 * rm21 + m21 * rm22 + m31 * rm23 ; double nm22 = m02 * rm20 + m12 * rm21 + m22 * rm22 + m32 * rm23 ; double nm23 = m03 * rm20 + m13 * rm21 + m23 * rm22 + m33 * rm23 ; dest . m30 = m00 * rm30 + m10 * rm31 + m20 * rm32 + m30 * rm33 ; dest . m31 = m01 * rm30 + m11 * rm31 + m21 * rm32 + m31 * rm33 ; dest . m32 = m02 * rm30 + m12 * rm31 + m22 * rm32 + m32 * rm33 ; dest . m33 = m03 * rm30 + m13 * rm31 + m23 * rm32 + m33 * rm33 ; dest . m00 = nm00 ; dest . m01 = nm01 ; dest . m02 = nm02 ; dest . m03 = nm03 ; dest . m10 = nm10 ; dest . m11 = nm11 ; dest . m12 = nm12 ; dest . m13 = nm13 ; dest . m20 = nm20 ; dest . m21 = nm21 ; dest . m22 = nm22 ; dest . m23 = nm23 ; dest . properties = properties & ~ ( PROPERTY_PERSPECTIVE | PROPERTY_IDENTITY | PROPERTY_TRANSLATION | PROPERTY_ORTHONORMAL ) ; return dest ; |
public class hqlParser { /** * hql . g : 436:1 : equalityExpression : x = relationalExpression ( ( EQ ^ | isx = IS ^ ( NOT ! ) ? | NE ^ | ne = SQL _ NE ^ ) y = relationalExpression ) * ; */
public final hqlParser . equalityExpression_return equalityExpression ( ) throws RecognitionException { } } | hqlParser . equalityExpression_return retval = new hqlParser . equalityExpression_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token isx = null ; Token ne = null ; Token EQ163 = null ; Token NOT164 = null ; Token NE165 = null ; ParserRuleReturnScope x = null ; ParserRuleReturnScope y = null ; CommonTree isx_tree = null ; CommonTree ne_tree = null ; CommonTree EQ163_tree = null ; CommonTree NOT164_tree = null ; CommonTree NE165_tree = null ; try { // hql . g : 441:2 : ( x = relationalExpression ( ( EQ ^ | isx = IS ^ ( NOT ! ) ? | NE ^ | ne = SQL _ NE ^ ) y = relationalExpression ) * )
// hql . g : 441:4 : x = relationalExpression ( ( EQ ^ | isx = IS ^ ( NOT ! ) ? | NE ^ | ne = SQL _ NE ^ ) y = relationalExpression ) *
{ root_0 = ( CommonTree ) adaptor . nil ( ) ; pushFollow ( FOLLOW_relationalExpression_in_equalityExpression1987 ) ; x = relationalExpression ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , x . getTree ( ) ) ; // hql . g : 441:27 : ( ( EQ ^ | isx = IS ^ ( NOT ! ) ? | NE ^ | ne = SQL _ NE ^ ) y = relationalExpression ) *
loop56 : while ( true ) { int alt56 = 2 ; int LA56_0 = input . LA ( 1 ) ; if ( ( LA56_0 == EQ || LA56_0 == IS || LA56_0 == NE || LA56_0 == SQL_NE ) ) { alt56 = 1 ; } switch ( alt56 ) { case 1 : // hql . g : 442:3 : ( EQ ^ | isx = IS ^ ( NOT ! ) ? | NE ^ | ne = SQL _ NE ^ ) y = relationalExpression
{ // hql . g : 442:3 : ( EQ ^ | isx = IS ^ ( NOT ! ) ? | NE ^ | ne = SQL _ NE ^ )
int alt55 = 4 ; switch ( input . LA ( 1 ) ) { case EQ : { alt55 = 1 ; } break ; case IS : { alt55 = 2 ; } break ; case NE : { alt55 = 3 ; } break ; case SQL_NE : { alt55 = 4 ; } break ; default : NoViableAltException nvae = new NoViableAltException ( "" , 55 , 0 , input ) ; throw nvae ; } switch ( alt55 ) { case 1 : // hql . g : 442:5 : EQ ^
{ EQ163 = ( Token ) match ( input , EQ , FOLLOW_EQ_in_equalityExpression1995 ) ; EQ163_tree = ( CommonTree ) adaptor . create ( EQ163 ) ; root_0 = ( CommonTree ) adaptor . becomeRoot ( EQ163_tree , root_0 ) ; } break ; case 2 : // hql . g : 443:5 : isx = IS ^ ( NOT ! ) ?
{ isx = ( Token ) match ( input , IS , FOLLOW_IS_in_equalityExpression2004 ) ; isx_tree = ( CommonTree ) adaptor . create ( isx ) ; root_0 = ( CommonTree ) adaptor . becomeRoot ( isx_tree , root_0 ) ; isx . setType ( EQ ) ; // hql . g : 443:35 : ( NOT ! ) ?
int alt54 = 2 ; int LA54_0 = input . LA ( 1 ) ; if ( ( LA54_0 == NOT ) ) { alt54 = 1 ; } switch ( alt54 ) { case 1 : // hql . g : 443:36 : NOT !
{ NOT164 = ( Token ) match ( input , NOT , FOLLOW_NOT_in_equalityExpression2010 ) ; isx . setType ( NE ) ; } break ; } } break ; case 3 : // hql . g : 444:5 : NE ^
{ NE165 = ( Token ) match ( input , NE , FOLLOW_NE_in_equalityExpression2022 ) ; NE165_tree = ( CommonTree ) adaptor . create ( NE165 ) ; root_0 = ( CommonTree ) adaptor . becomeRoot ( NE165_tree , root_0 ) ; } break ; case 4 : // hql . g : 445:5 : ne = SQL _ NE ^
{ ne = ( Token ) match ( input , SQL_NE , FOLLOW_SQL_NE_in_equalityExpression2031 ) ; ne_tree = ( CommonTree ) adaptor . create ( ne ) ; root_0 = ( CommonTree ) adaptor . becomeRoot ( ne_tree , root_0 ) ; ne . setType ( NE ) ; } break ; } pushFollow ( FOLLOW_relationalExpression_in_equalityExpression2042 ) ; y = relationalExpression ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , y . getTree ( ) ) ; } break ; default : break loop56 ; } } } retval . stop = input . LT ( - 1 ) ; retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; // Post process the equality expression to clean up ' is null ' , etc .
retval . tree = ProcessEqualityExpression ( retval . tree ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( CommonTree ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { // do for sure before leaving
} return retval ; |
public class Node { /** * Check for has exactly the number of specified children .
* @ return Whether the node has exactly the number of children specified . */
public final boolean hasXChildren ( int x ) { } } | int c = 0 ; for ( Node n = first ; n != null && c <= x ; n = n . next ) { c ++ ; } return c == x ; |
public class Rollbar { /** * Record an error or message with extra data at the level specified .
* At least ene of ` error ` or ` description ` must
* be non - null . If error is null , ` description ` will be sent as a message .
* If error is non - null , description will be
* sent as the description of the error .
* Custom data will be attached to message if the error is null .
* @ param error the error ( if any )
* @ param custom the custom data ( if any )
* @ param description the description of the error , or the message to send
* @ param level the level to send it at
* @ param isUncaught whether or not this set of data originates from an uncaught exception . */
public void log ( Throwable error , Map < String , Object > custom , String description , Level level , boolean isUncaught ) { } } | this . rollbar . log ( error , custom , description , level , isUncaught ) ; |
public class OWLObjectUnionOfImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the
* { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } .
* @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } to read the
* object ' s content from
* @ param instance the object instance to deserialize
* @ throws com . google . gwt . user . client . rpc . SerializationException
* if the deserialization operation is not
* successful */
@ Override public void deserializeInstance ( SerializationStreamReader streamReader , OWLObjectUnionOfImpl instance ) throws SerializationException { } } | deserialize ( streamReader , instance ) ; |
public class AmazonAlexaForBusinessClient { /** * Updates room skill parameter details by room , skill , and parameter key ID . Not all skills have a room skill
* parameter .
* @ param putRoomSkillParameterRequest
* @ return Result of the PutRoomSkillParameter operation returned by the service .
* @ throws ConcurrentModificationException
* There is a concurrent modification of resources .
* @ sample AmazonAlexaForBusiness . PutRoomSkillParameter
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / alexaforbusiness - 2017-11-09 / PutRoomSkillParameter "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public PutRoomSkillParameterResult putRoomSkillParameter ( PutRoomSkillParameterRequest request ) { } } | request = beforeClientExecution ( request ) ; return executePutRoomSkillParameter ( request ) ; |
public class OldSyntaxMappingConverter { /** * read and store datasource information */
private void readSourceDeclaration ( LineNumberReader reader ) throws IOException { } } | String line ; dataSourceProperties = new Properties ( ) ; while ( ! ( line = reader . readLine ( ) ) . isEmpty ( ) ) { int lineNumber = reader . getLineNumber ( ) ; String [ ] tokens = line . split ( "[\t| ]+" , 2 ) ; final String parameter = tokens [ 0 ] . trim ( ) ; final String inputParameter = tokens [ 1 ] . trim ( ) ; if ( parameter . equals ( Label . sourceUri . name ( ) ) ) { dataSourceProperties . put ( OntopSQLCoreSettings . JDBC_NAME , inputParameter ) ; } else if ( parameter . equals ( Label . connectionUrl . name ( ) ) ) { dataSourceProperties . put ( OntopSQLCoreSettings . JDBC_URL , inputParameter ) ; } else if ( parameter . equals ( Label . username . name ( ) ) ) { dataSourceProperties . put ( OntopSQLCredentialSettings . JDBC_USER , inputParameter ) ; } else if ( parameter . equals ( Label . password . name ( ) ) ) { dataSourceProperties . put ( OntopSQLCredentialSettings . JDBC_PASSWORD , inputParameter ) ; } else if ( parameter . equals ( Label . driverClass . name ( ) ) ) { dataSourceProperties . put ( OntopSQLCoreSettings . JDBC_DRIVER , inputParameter ) ; } else { String msg = String . format ( "Unknown parameter name \"%s\" at line: %d." , parameter , lineNumber ) ; throw new IOException ( msg ) ; } } |
public class CmsXmlContent { /** * Adds a new XML schema type with the default value to the given parent node . < p >
* @ param cms the cms context
* @ param parent the XML parent element to add the new value to
* @ param type the type of the value to add
* @ param locale the locale to add the new value for
* @ param insertIndex the index in the XML document where to add the XML node
* @ return the created XML content value */
protected I_CmsXmlContentValue addValue ( CmsObject cms , Element parent , I_CmsXmlSchemaType type , Locale locale , int insertIndex ) { } } | // first generate the XML element for the new value
Element element = type . generateXml ( cms , this , parent , locale ) ; // detach the XML element from the appended position in order to insert it at the required position
element . detach ( ) ; // add the XML element at the required position in the parent XML node
CmsXmlGenericWrapper . content ( parent ) . add ( insertIndex , element ) ; // create the type and return it
I_CmsXmlContentValue value = type . createValue ( this , element , locale ) ; // generate the default value again - required for nested mappings because only now the full path is available
String defaultValue = m_contentDefinition . getContentHandler ( ) . getDefault ( cms , value , locale ) ; if ( defaultValue != null ) { // only if there is a default value available use it to overwrite the initial default
value . setStringValue ( cms , defaultValue ) ; } // finally return the value
return value ; |
public class RadioButtonGroup { /** * Save any body content of this tag , which will generally be the
* option ( s ) representing the values displayed to the user .
* @ throws JspException if a JSP exception has occurred */
public int doAfterBody ( ) throws JspException { } } | StringBuilderRenderAppender writer = new StringBuilderRenderAppender ( _saveBody ) ; if ( bodyContent != null ) { String value = bodyContent . getString ( ) ; bodyContent . clearBody ( ) ; if ( value == null ) value = "" ; _saveBody . append ( value ) ; } if ( _repeater ) { ServletRequest req = pageContext . getRequest ( ) ; if ( _cr == null ) _cr = TagRenderingBase . Factory . getConstantRendering ( req ) ; if ( isVertical ( ) ) _cr . end_TD_TR ( writer ) ; while ( ( ( Iterator ) _dynamicAttrs ) . hasNext ( ) ) { _repCurItem = ( ( Iterator ) _dynamicAttrs ) . next ( ) ; if ( _repCurItem != null ) { _repIdx ++ ; if ( isVertical ( ) ) _cr . TR_TD ( writer ) ; return EVAL_BODY_AGAIN ; } } } return SKIP_BODY ; |
public class DataSetLineageService { /** * Return the lineage outputs graph for the given datasetName .
* @ param datasetName datasetName
* @ return Outputs Graph as JSON */
@ Override @ GraphTransaction public String getOutputsGraph ( String datasetName ) throws AtlasException { } } | LOG . info ( "Fetching lineage outputs graph for datasetName={}" , datasetName ) ; datasetName = ParamChecker . notEmpty ( datasetName , "dataset name" ) ; TypeUtils . Pair < String , String > typeIdPair = validateDatasetNameExists ( datasetName ) ; return getOutputsGraphForId ( typeIdPair . right ) ; |
public class ChainrFactory { /** * The main engine in ChainrFactory for building a Chainr Instance .
* @ param chainrInstantiator The ChainrInstantiator to use . If null it will not be used .
* @ param chainrSpec The json spec for the chainr transformation
* @ return the Chainr instance created from the chainrInstantiator and inputStream */
private static Chainr getChainr ( ChainrInstantiator chainrInstantiator , Object chainrSpec ) { } } | Chainr chainr ; if ( chainrInstantiator == null ) { chainr = Chainr . fromSpec ( chainrSpec ) ; } else { chainr = Chainr . fromSpec ( chainrSpec , chainrInstantiator ) ; } return chainr ; |
public class ThriftCodec { /** * Encoding overhead is thrift type plus 32 - bit length prefix */
static < T > int listSizeInBytes ( Buffer . Writer < T > writer , List < T > values ) { } } | int sizeInBytes = 5 ; for ( int i = 0 , length = values . size ( ) ; i < length ; i ++ ) { sizeInBytes += writer . sizeInBytes ( values . get ( i ) ) ; } return sizeInBytes ; |
public class EntityType { /** * Returns all attributes . In case of compound attributes ( attributes consisting of atomic
* attributes ) only the compound attribute is returned . This attribute can be used to retrieve
* parts of the compound attribute .
* < p > In case EntityType extends other EntityType then the attributes of this EntityType as well
* as its parent class are returned .
* @ return entity attributes */
public Iterable < Attribute > getAttributes ( ) { } } | Iterable < Attribute > attrs = getOwnAttributes ( ) ; EntityType extend = getExtends ( ) ; if ( extend != null ) { attrs = concat ( attrs , extend . getAttributes ( ) ) ; } return attrs ; |
public class TextBuilder { /** * Print a long to internal buffer or output ( os or writer )
* @ param l
* @ return this builder */
public final TextBuilder p ( long l ) { } } | if ( null != __buffer ) __append ( l ) ; else __caller . p ( l ) ; return this ; |
public class DivSufSort { /** * sort suffixes of middle partition by using sorted order of suffixes of left and
* right partition . */
private void trCopy ( int ISA , int first , int a , int b , int last , int depth ) { } } | int c , d , e ; // ptr
int s , v ; v = b - 1 ; for ( c = first , d = a - 1 ; c <= d ; ++ c ) { s = SA [ c ] - depth ; if ( ( 0 <= s ) && ( SA [ ISA + s ] == v ) ) { SA [ ++ d ] = s ; SA [ ISA + s ] = d ; } } for ( c = last - 1 , e = d + 1 , d = b ; e < d ; -- c ) { s = SA [ c ] - depth ; if ( ( 0 <= s ) && ( SA [ ISA + s ] == v ) ) { SA [ -- d ] = s ; SA [ ISA + s ] = d ; } } |
public class QueryImpl { /** * ( non - Javadoc )
* @ see javax . persistence . Query # setParameter ( javax . persistence . Parameter ,
* java . util . Calendar , javax . persistence . TemporalType ) */
@ Override public Query setParameter ( Parameter < Calendar > paramParameter , Calendar paramCalendar , TemporalType paramTemporalType ) { } } | throw new UnsupportedOperationException ( "setParameter is unsupported by Kundera" ) ; |
public class CheckPreCommitHook { /** * Investigates the version of an JPAObject and checks if a conflict can be found . */
private Integer investigateVersionAndCheckForConflict ( JPAObject newObject ) throws EDBException { } } | JPAEntry entry = newObject . getEntry ( EDBConstants . MODEL_VERSION ) ; String oid = newObject . getOID ( ) ; Integer modelVersion = 0 ; if ( entry != null ) { modelVersion = Integer . parseInt ( entry . getValue ( ) ) ; Integer currentVersion = dao . getVersionOfOid ( oid ) ; if ( ! modelVersion . equals ( currentVersion ) ) { try { checkForConflict ( newObject ) ; } catch ( EDBException e ) { LOGGER . info ( "conflict detected, user get informed" ) ; throw new EDBException ( "conflict was detected. There is a newer version of the model with the oid " + oid + " saved." ) ; } modelVersion = currentVersion ; } } else { modelVersion = dao . getVersionOfOid ( oid ) ; } return modelVersion ; |
public class FctBnAccEntitiesProcessors { /** * < p > Get InvTxMeth < PurchaseReturn , PurchaseReturnTaxLine > . < / p >
* @ param pAddParam additional param
* @ return requested InvTxMeth < PurchaseReturn , PurchaseReturnTaxLine >
* @ throws Exception - an exception */
protected final InvTxMeth < PurchaseReturn , PurchaseReturnTaxLine > lazyGetPurRetTxMeth ( final Map < String , Object > pAddParam ) throws Exception { } } | InvTxMeth < PurchaseReturn , PurchaseReturnTaxLine > purRetTxMe = this . purRetTxMeth ; if ( purRetTxMe == null ) { purRetTxMe = new InvTxMeth < PurchaseReturn , PurchaseReturnTaxLine > ( ) ; purRetTxMe . setGoodLnCl ( PurchaseReturnLine . class ) ; purRetTxMe . setInvTxLnCl ( PurchaseReturnTaxLine . class ) ; purRetTxMe . setIsTxByUser ( true ) ; purRetTxMe . setStWhereAdjGdLnInvBas ( "where TAXCATEGORY is not null and PURCHASERETURNLINE.REVERSEDID " + "is null and PURCHASERETURNLINE.ITSOWNER=" ) ; purRetTxMe . setFlTotals ( "invGdTotals.sql" ) ; purRetTxMe . setFlTxItBas ( "invGdTxItBas.sql" ) ; purRetTxMe . setFlTxItBasAggr ( "purRtTxItBasAggr.sql" ) ; purRetTxMe . setFlTxInvBas ( "purRtTxInvBas.sql" ) ; purRetTxMe . setFlTxInvAdj ( "purRtTxInvAdj.sql" ) ; purRetTxMe . setFlTxInvBasAggr ( "purRtTxInvBasAggr.sql" ) ; purRetTxMe . setTblNmsTot ( new String [ ] { "PURCHASERETURNLINE" , "PURCHASERETURNTAXLINE" , "PURCHASERETURNGOODSTAXLINE" } ) ; FactoryPersistableBase < PurchaseReturnTaxLine > fctItl = new FactoryPersistableBase < PurchaseReturnTaxLine > ( ) ; fctItl . setObjectClass ( PurchaseReturnTaxLine . class ) ; fctItl . setDatabaseId ( getSrvDatabase ( ) . getIdDatabase ( ) ) ; purRetTxMe . setFctInvTxLn ( fctItl ) ; // assigning fully initialized object :
this . purRetTxMeth = purRetTxMe ; } return purRetTxMe ; |
public class ElemWithParam { /** * This function is called after everything else has been
* recomposed , and allows the template to set remaining
* values that may be based on some other property that
* depends on recomposition . */
public void compose ( StylesheetRoot sroot ) throws TransformerException { } } | // See if we can reduce an RTF to a select with a string expression .
if ( null == m_selectPattern && sroot . getOptimizer ( ) ) { XPath newSelect = ElemVariable . rewriteChildToExpression ( this ) ; if ( null != newSelect ) m_selectPattern = newSelect ; } m_qnameID = sroot . getComposeState ( ) . getQNameID ( m_qname ) ; super . compose ( sroot ) ; java . util . Vector vnames = sroot . getComposeState ( ) . getVariableNames ( ) ; if ( null != m_selectPattern ) m_selectPattern . fixupVariables ( vnames , sroot . getComposeState ( ) . getGlobalsSize ( ) ) ; // m _ index must be resolved by ElemApplyTemplates and ElemCallTemplate ! |
public class AbstractMenu { /** * The instance method gets all sub menus and commands and adds them to this
* menu instance via method { @ link # add ( long ) } .
* @ see # readFromDB
* @ see # add ( long )
* @ throws CacheReloadException on error during load */
private void readFromDB4Childs ( ) throws CacheReloadException { } } | try { final QueryBuilder queryBldr = new QueryBuilder ( CIAdminUserInterface . Menu2Command ) ; queryBldr . addWhereAttrEqValue ( CIAdminUserInterface . Menu2Command . FromMenu , getId ( ) ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; multi . addAttribute ( CIAdminUserInterface . Menu2Command . ToCommand ) ; multi . executeWithoutAccessCheck ( ) ; while ( multi . next ( ) ) { final long commandId = multi . < Long > getAttribute ( CIAdminUserInterface . Menu2Command . ToCommand ) ; add ( multi . getCurrentInstance ( ) . getId ( ) , commandId ) ; } } catch ( final EFapsException e ) { throw new CacheReloadException ( "could not read childs for menu '" + getName ( ) + "'" , e ) ; } |
public class ExceptionSoftener { /** * Soften a BooleanSuppler that throws a checked exception into one that still throws the exception , but doesn ' t need to declare it .
* < pre >
* { @ code
* assertThat ( ExceptionSoftener . softenBooleanSupplier ( ( ) - > true ) . getAsBoolean ( ) , equalTo ( true ) ) ;
* BooleanSupplier supplier = ExceptionSoftener . softenBooleanSupplier ( ( ) - > { throw new IOException ( ) ; } ) ;
* supplier . getValue ( ) / / throws IOException but doesn ' t need to declare it
* < / pre >
* @ param s CheckedBooleanSupplier to soften
* @ return Plain old BooleanSupplier */
public static BooleanSupplier softenBooleanSupplier ( final CheckedBooleanSupplier s ) { } } | return ( ) -> { try { return s . getAsBoolean ( ) ; } catch ( final Throwable e ) { throw throwSoftenedException ( e ) ; } } ; |
public class ExtendedData { /** * Retrieves an integer value from the extended data .
* @ param type Type identifier
* @ return integer value */
public int getInt ( Integer type ) { } } | int result = 0 ; byte [ ] item = m_map . get ( type ) ; if ( item != null ) { result = MPPUtility . getInt ( item , 0 ) ; } return ( result ) ; |
public class VariantAlternateRearranger { /** * Recursive genotype ordering algorithm as seen in VCF - spec .
* @ link https : / / samtools . github . io / hts - specs / VCFv4.3 . pdf
* @ param p ploidy
* @ param n Number of alternates
* @ param list List where to store the genotypes
* @ param gt Shared array
* @ param pos Position where to write in the array
* @ param map Map from reordered allele position to original allele position */
public static void getOrdering ( int p , int n , List < String > list , int [ ] gt , int pos , int [ ] map ) { } } | for ( int a = 0 ; a <= n ; a ++ ) { if ( map == null ) { gt [ pos ] = a ; } else { // Remap allele
gt [ pos ] = remapAllele ( map , a ) ; } if ( p == 1 ) { int prev = gt [ 0 ] ; int [ ] gtSorted = gt ; // Check if sorted
for ( int g : gt ) { if ( prev > g ) { // Sort if needed . Do not modify original array
gtSorted = Arrays . copyOf ( gt , gt . length ) ; Arrays . sort ( gtSorted ) ; break ; } } StringBuilder sb = new StringBuilder ( ) ; for ( int g : gtSorted ) { sb . append ( g ) ; } list . add ( sb . toString ( ) ) ; } else { getOrdering ( p - 1 , a , list , gt , pos - 1 , map ) ; } } |
public class SibRaStaticDestinationEndpointActivation { /** * Schedules the creation of a remote listener to take place after the retry
* interval . */
private void scheduleCreateRemoteListener ( ) { } } | final String methodName = "scheduleCreateRemoteListener" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } _timer . schedule ( new TimerTask ( ) { public void run ( ) { createRemoteListenerDeactivateOnException ( false ) ; synchronized ( SibRaStaticDestinationEndpointActivation . this ) { if ( _remoteConnection != null ) { /* * Successfully created a connection */
SibTr . info ( TRACE , "CONNECTED_CWSIV0777" , new Object [ ] { _remoteConnection . getConnection ( ) . getMeName ( ) , _endpointConfiguration . getDestination ( ) . getDestinationName ( ) , _endpointConfiguration . getBusName ( ) , SibRaStaticDestinationEndpointActivation . this } ) ; } } } } , RETRY_INTERVAL ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } |
public class Property { /** * Writes one value of the property to { @ link DataWriter } . */
private void writeValue ( Type expected , Object value , TreePruner pruner , DataWriter writer ) throws IOException { } } | writeValue ( expected , value , pruner , writer , writer . getExportConfig ( ) . isSkipIfFail ( ) ) ; |
public class TDRequestErrorHandler { /** * Show or suppress warning messages for TDClientHttpException */
private static TDClientHttpException clientError ( TDClientHttpException e , ResponseContext responseContext ) { } } | boolean showWarning = true ; boolean showStackTrace = false ; int code = e . getStatusCode ( ) ; switch ( code ) { case HttpStatus . NOT_FOUND_404 : // Not found ( e . g . , database , table , table distribution data might be missing )
showWarning = false ; break ; case HttpStatus . CONFLICT_409 : // Suppress stack trace because 409 frequently happens when checking the presence of databases and tables .
showStackTrace = false ; break ; default : if ( ! ( HttpStatus . isClientError ( code ) || HttpStatus . isServerError ( code ) ) ) { // Show stack trace for non 4xx , 5xx errors
showStackTrace = true ; } break ; } if ( showWarning ) { if ( showStackTrace ) { logger . warn ( e . getCause ( ) == null ? e . getMessage ( ) : e . getCause ( ) . getClass ( ) . toString ( ) , e ) ; } else { logger . warn ( e . getCause ( ) == null ? e . getMessage ( ) : e . getCause ( ) . getClass ( ) . toString ( ) ) ; } } return e ; |
public class YamlUtils { /** * if allowsEmpty , returns null for the case no key entry or null value */
public static Integer getIntValue ( Map < String , Object > yamlObject , String key , boolean allowsEmpty ) throws YamlConvertException { } } | Object obj = getObjectValue ( yamlObject , key , allowsEmpty ) ; if ( obj == null && allowsEmpty ) { return null ; } String objStr ; if ( obj == null ) { objStr = null ; } else { objStr = obj . toString ( ) ; } try { return new Integer ( objStr ) ; } catch ( NumberFormatException e ) { throw new YamlConvertException ( String . format ( MSG_VALUE_NOT_INT , key , objStr ) ) ; } |
public class FairSchedulerShell { /** * Displays format of commands . */
private static void printUsage ( String cmd ) { } } | String prefix = "Usage: java " + FairSchedulerShell . class . getSimpleName ( ) ; if ( "-getfsmaxslots" . equalsIgnoreCase ( cmd ) ) { System . err . println ( prefix + " [-getfsmaxslots trackerName1, trackerName2 ... ]" ) ; } else if ( "-setfsmaxslots" . equalsIgnoreCase ( cmd ) ) { System . err . println ( prefix + " [-setfsmaxslots trackerName #maps #reduces trackerName2 #maps #reduces ... ]" ) ; } else { System . err . println ( prefix ) ; System . err . println ( " [-setfsmaxslots trackerName #maps #reduces trackerName2 #maps #reduces ... ]" ) ; System . err . println ( " [-getfsmaxslots trackerName1, trackerName2 ... ]" ) ; System . err . println ( " [-resetfsmaxslots]" ) ; System . err . println ( " [-help [cmd]]" ) ; System . err . println ( ) ; ToolRunner . printGenericCommandUsage ( System . err ) ; } |
public class Ingest { /** * Returns the distance in bytes between the current position inside of the
* edits log and the length of the edits log */
public long getLagBytes ( ) { } } | try { if ( inputEditStream != null && inputEditStream . isInProgress ( ) ) { // for file journals it may happen that we read a segment finalized
// by primary , but not refreshed by the standby , so length ( ) returns 0
// hence we take max ( - 1 , lag )
return Math . max ( - 1 , inputEditStream . length ( ) - this . inputEditStream . getPosition ( ) ) ; } return - 1 ; } catch ( IOException ex ) { LOG . error ( "Error getting the lag" , ex ) ; return - 1 ; } |
public class MergeSmallRegions { /** * Examine edges for the specified node and select node which it is the best match for it to merge with
* @ param pruneId The prune Id of the segment which is to be merged into another segment
* @ param regionColor List of region colors */
protected void selectMerge ( int pruneId , FastQueue < float [ ] > regionColor ) { } } | // Grab information on the region which is being pruned
Node n = pruneGraph . get ( pruneId ) ; float [ ] targetColor = regionColor . get ( n . segment ) ; // segment ID and distance away from the most similar neighbor
int bestId = - 1 ; float bestDistance = Float . MAX_VALUE ; // Examine all the segments it is connected to to see which one it is most similar too
for ( int i = 0 ; i < n . edges . size ; i ++ ) { int segment = n . edges . get ( i ) ; float [ ] neighborColor = regionColor . get ( segment ) ; float d = SegmentMeanShiftSearch . distanceSq ( targetColor , neighborColor ) ; if ( d < bestDistance ) { bestDistance = d ; bestId = segment ; } } if ( bestId == - 1 ) throw new RuntimeException ( "No neighbors? Something went really wrong." ) ; markMerge ( n . segment , bestId ) ; |
public class SortUtils { /** * To restore the max - heap condition when a node ' s priority is increased .
* We move up the heap , exchaning the node at position k with its parent
* ( at postion k / 2 ) if necessary , continuing as long as a [ k / 2 ] & lt ; a [ k ] or
* until we reach the top of the heap . */
public static void siftUp ( int [ ] arr , int k ) { } } | while ( k > 1 && arr [ k / 2 ] < arr [ k ] ) { swap ( arr , k , k / 2 ) ; k = k / 2 ; } |
public class BaseDestinationHandler { /** * If a temporary BaseDestinationHandler has been recovered from the Message Store
* we need to reconstitute enough of it such that none of the transactional
* callbacks will suffer Null Pointer Exceptions when our items
* ( e . g . MessageItems ) are deleted .
* Most Message Store problems ( MessageStoreException ) will
* be allowed to fall through to the DestinationManager for handling . Only a
* failure to recover the durable subscriptions of a topicspace is dealt with
* here .
* @ param processor
* @ param durableSubscriptionsTable
* @ throws MessageStoreException
* @ throws SIResourceException */
private void reconstituteEnoughForDeletion ( MessageProcessor processor , HashMap < String , Object > durableSubscriptionsTable ) throws MessageStoreException , SIRollbackException , SIConnectionLostException , SIIncorrectCallException , SIResourceException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reconstituteEnoughForDeletion" , new Object [ ] { processor , durableSubscriptionsTable } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Reconstituting for deletion " + ( isPubSub ( ) ? "pubsub" : "ptp" ) + " BaseDestinationHandler " + getName ( ) ) ; initializeNonPersistent ( processor , durableSubscriptionsTable , null ) ; /* * For temporary destinations , we only need to set up the parent streams of
* the message items and references . Partitioned point to point temporary
* destinations are not valid , so we don ' t check for more than one
* localisation .
* Some of these ItemStreams may be recoverable ( and hence need to be
* deleted ) and some may not . The exact situation is determined by
* what the Message Store actually stored ( before a non - clean shutdown ) . */
_protoRealization . reconstituteEnoughForDeletion ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Reconstituted for deletion " + ( isPubSub ( ) ? "pubsub" : "ptp" ) + " BaseDestinationHandler " + getName ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstituteEnoughForDeletion" ) ; |
public class CmsWorkplaceEditorConfiguration { /** * Sets the editor label key used for the localized nice name . < p >
* @ param label the editor label key used for the localized nice name */
private void setEditorLabel ( String label ) { } } | if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( label ) ) { setValidConfiguration ( false ) ; LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_EDITOR_CONFIG_NO_LABEL_0 ) ) ; } m_editorLabel = label ; |
public class CommonOps_DDF3 { /** * Performs an in - place element by element scalar division . Scalar denominator . < br >
* < br >
* a < sub > ij < / sub > = a < sub > ij < / sub > / & alpha ;
* @ param a The matrix whose elements are to be divided . Modified .
* @ param alpha the amount each element is divided by . */
public static void divide ( DMatrix3x3 a , double alpha ) { } } | a . a11 /= alpha ; a . a12 /= alpha ; a . a13 /= alpha ; a . a21 /= alpha ; a . a22 /= alpha ; a . a23 /= alpha ; a . a31 /= alpha ; a . a32 /= alpha ; a . a33 /= alpha ; |
public class ParserDQL { /** * Reads a NULLIF expression */
private Expression readNullIfExpression ( ) { } } | // turn into a CASEWHEN
read ( ) ; readThis ( Tokens . OPENBRACKET ) ; Expression c = XreadValueExpression ( ) ; readThis ( Tokens . COMMA ) ; Expression thenelse = new ExpressionOp ( OpTypes . ALTERNATIVE , new ExpressionValue ( ( Object ) null , ( Type ) null ) , c ) ; c = new ExpressionLogical ( c , XreadValueExpression ( ) ) ; c = new ExpressionOp ( OpTypes . CASEWHEN , c , thenelse ) ; readThis ( Tokens . CLOSEBRACKET ) ; return c ; |
public class ChannelResponseMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ChannelResponse channelResponse , ProtocolMarshaller protocolMarshaller ) { } } | if ( channelResponse == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( channelResponse . getApplicationId ( ) , APPLICATIONID_BINDING ) ; protocolMarshaller . marshall ( channelResponse . getCreationDate ( ) , CREATIONDATE_BINDING ) ; protocolMarshaller . marshall ( channelResponse . getEnabled ( ) , ENABLED_BINDING ) ; protocolMarshaller . marshall ( channelResponse . getHasCredential ( ) , HASCREDENTIAL_BINDING ) ; protocolMarshaller . marshall ( channelResponse . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( channelResponse . getIsArchived ( ) , ISARCHIVED_BINDING ) ; protocolMarshaller . marshall ( channelResponse . getLastModifiedBy ( ) , LASTMODIFIEDBY_BINDING ) ; protocolMarshaller . marshall ( channelResponse . getLastModifiedDate ( ) , LASTMODIFIEDDATE_BINDING ) ; protocolMarshaller . marshall ( channelResponse . getVersion ( ) , VERSION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class SignatureUtil { /** * Scans the given string for a list of type argument signatures starting at
* the given index and returns the index of the last character .
* < pre >
* TypeArgumentSignatures :
* < b > & lt ; < / b > TypeArgumentSignature * < b > & gt ; < / b >
* < / pre >
* Note that although there is supposed to be at least one type argument , there
* is no syntactic ambiguity if there are none . This method will accept zero
* type argument signatures without complaint .
* @ param string the signature string
* @ param start the 0 - based character index of the first character
* @ return the 0 - based character index of the last character
* @ exception IllegalArgumentException if this is not a list of type arguments
* signatures */
private static int scanTypeArgumentSignatures ( String string , int start ) { } } | // need a minimum 2 char " < > "
if ( start >= string . length ( ) - 1 ) { throw new IllegalArgumentException ( ) ; } char c = string . charAt ( start ) ; if ( c != C_GENERIC_START ) { throw new IllegalArgumentException ( ) ; } int p = start + 1 ; while ( true ) { if ( p >= string . length ( ) ) { throw new IllegalArgumentException ( ) ; } c = string . charAt ( p ) ; if ( c == C_GENERIC_END ) { return p ; } int e = scanTypeArgumentSignature ( string , p ) ; p = e + 1 ; } |
public class Matching { /** * Attempt to augment the matching such that it is perfect over the subset
* of vertices in the provided graph .
* @ param graph adjacency list representation of graph
* @ param subset subset of vertices
* @ return the matching was perfect
* @ throws IllegalArgumentException the graph was a different size to the
* matching capacity */
public boolean perfect ( int [ ] [ ] graph , BitSet subset ) { } } | if ( graph . length != match . length || subset . cardinality ( ) > graph . length ) throw new IllegalArgumentException ( "graph and matching had different capacity" ) ; // and odd set can never provide a perfect matching
if ( ( subset . cardinality ( ) & 0x1 ) == 0x1 ) return false ; // arbitrary matching was perfect
if ( arbitaryMatching ( graph , subset ) ) return true ; EdmondsMaximumMatching . maxamise ( this , graph , subset ) ; // the matching is imperfect if any vertex was
for ( int v = subset . nextSetBit ( 0 ) ; v >= 0 ; v = subset . nextSetBit ( v + 1 ) ) if ( unmatched ( v ) ) return false ; return true ; |
public class HBasePanel { /** * Print the top nav menu .
* @ param out The html out stream .
* @ param reg The resources object .
* @ exception DBException File exception . */
public void printHtmlTrailer ( PrintWriter out , ResourceBundle reg ) throws DBException { } } | char chMenubar = HBasePanel . getFirstToUpper ( this . getProperty ( DBParams . TRAILERS ) , 'H' ) ; if ( chMenubar == 'H' ) if ( ( ( BasePanel ) this . getScreenField ( ) ) . isMainMenu ( ) ) chMenubar = 'Y' ; if ( chMenubar == 'Y' ) { String strNav = reg . getString ( "htmlTrailer" ) ; strNav = Utility . replaceResources ( strNav , reg , null , null ) ; String strScreen = ( ( BasePanel ) this . getScreenField ( ) ) . getScreenURL ( ) ; strScreen = Utility . encodeXML ( strScreen ) ; strNav = Utility . replace ( strNav , HtmlConstants . URL_TAG , strScreen ) ; this . writeHtmlString ( strNav , out ) ; } |
public class LabeledEmailTextFieldPanel { /** * Factory method for create the new { @ link EmailTextField } . This method is invoked in the
* constructor from the derived classes and can be overridden so users can provide their own
* version of a new { @ link EmailTextField } .
* @ param id
* the id
* @ param model
* the model
* @ return the new { @ link EmailTextField } */
protected EmailTextField newEmailTextField ( final String id , final IModel < M > model ) { } } | return ComponentFactory . newEmailTextField ( id , new PropertyModel < String > ( model . getObject ( ) , getId ( ) ) ) ; |
public class OcpiRepository { /** * get the date the tokens where last synced for the subscriptionId passed as argument
* getTokenSyncDate
* @ param subscriptionId
* @ return */
public TokenSyncDate getTokenSyncDate ( Integer subscriptionId ) { } } | EntityManager entityManager = getEntityManager ( ) ; try { List < TokenSyncDate > list = entityManager . createQuery ( "SELECT syncDate FROM TokenSyncDate AS syncDate WHERE subscriptionId = :subscriptionId" , TokenSyncDate . class ) . setMaxResults ( 1 ) . setParameter ( "subscriptionId" , subscriptionId ) . getResultList ( ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; } finally { entityManager . close ( ) ; } |
public class ConnectionManager { /** * When it is time to actually close a client , do so , and clean up the related data structures .
* @ param client the client which has been idle for long enough to be closed */
private void closeClient ( Client client ) { } } | logger . debug ( "Closing client {}" , client ) ; client . close ( ) ; openClients . remove ( client . targetPlayer ) ; useCounts . remove ( client ) ; timestamps . remove ( client ) ; |
public class PluginRegistry { /** * Stops all plugins in the given logger repository . */
public void stopAllPlugins ( ) { } } | synchronized ( pluginMap ) { // remove the listener for this repository
loggerRepository . removeLoggerRepositoryEventListener ( listener ) ; Iterator iter = pluginMap . values ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Plugin plugin = ( Plugin ) iter . next ( ) ; plugin . shutdown ( ) ; firePluginStopped ( plugin ) ; } } |
public class JMMap { /** * New combined map map .
* @ param < K > the type parameter
* @ param < V > the type parameter
* @ param keys the keys
* @ param values the values
* @ return the map */
public static < K , V > Map < K , V > newCombinedMap ( K [ ] keys , V [ ] values ) { } } | HashMap < K , V > map = new HashMap < > ( ) ; for ( int i = 0 ; i < keys . length ; i ++ ) map . put ( keys [ i ] , getValueOfIndex ( values , i ) ) ; return map ; |
public class Entities { /** * Gets a random entity from the container of the given type ( if there is one ) .
* @ param container
* Source container .
* @ param type
* Entity type .
* @ return Random entity ( if found ) . */
public static < T extends Entity > Optional < T > randomEntityOfType ( final EntityContainer container , final Class < T > type ) { } } | final Set < T > entities = container . getEntitiesOfType ( type ) ; final int size = entities . size ( ) ; return randomEntity0 ( entities . stream ( ) , size ) ; |
public class MACUtil { /** * Look through the text for all the MAC addresses we can find . */
protected static String [ ] parseMACs ( String text ) { } } | if ( text == null ) { return new String [ 0 ] ; } Matcher m = MACRegex . matcher ( text ) ; ArrayList < String > list = new ArrayList < String > ( ) ; while ( m . find ( ) ) { String mac = m . group ( 1 ) . toUpperCase ( ) ; mac = mac . replace ( ':' , '-' ) ; // " Didn ' t you get that memo ? " Apparently some people are not
// up on MAC addresses actually being unique , so we will ignore those .
// 44-45-53 - XX - XX - XX - PPP Adaptor
// 00-53-45 - XX - XX - XX - PPP Adaptor
// 00 - E0-06-09-55-66 - Some bogus run of ASUS motherboards
// 00-04-4B - 80-80-03 - Some nvidia built - in lan issues
// 00-03-8A - XX - XX - XX - MiniWAN or AOL software
// 02-03-8A - 00-00-11 - Westell Dual ( USB / Ethernet ) modem
// FF - FF - FF - FF - FF - FF - Tunnel adapter Teredo
// 02-00-4C - 4F - 4F - 50 - MSFT thinger , loopback of some sort
// 00-00-00-00-00-00 ( - 00 - E0 ) - IP6 tunnel
if ( mac . startsWith ( "44-45-53" ) ) { continue ; } else if ( mac . startsWith ( "00-53-45-00" ) ) { continue ; } else if ( mac . startsWith ( "00-E0-06-09-55-66" ) ) { continue ; } else if ( mac . startsWith ( "00-04-4B-80-80-03" ) ) { continue ; } else if ( mac . startsWith ( "00-03-8A" ) ) { continue ; } else if ( mac . startsWith ( "02-03-8A-00-00-11" ) ) { continue ; } else if ( mac . startsWith ( "FF-FF-FF-FF-FF-FF" ) ) { continue ; } else if ( mac . startsWith ( "02-00-4C-4F-4F-50" ) ) { continue ; } else if ( mac . startsWith ( "00-00-00-00-00-00" ) ) { continue ; } list . add ( mac ) ; } return list . toArray ( new String [ 0 ] ) ; |
public class CommerceAccountUserRelUtil { /** * Returns an ordered range of all the commerce account user rels where commerceAccountUserId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceAccountUserRelModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order .
* @ param commerceAccountUserId the commerce account user ID
* @ param start the lower bound of the range of commerce account user rels
* @ param end the upper bound of the range of commerce account user rels ( not inclusive )
* @ param orderByComparator the comparator to order the results by ( optionally < code > null < / code > )
* @ return the ordered range of matching commerce account user rels */
public static List < CommerceAccountUserRel > findByCommerceAccountUserId ( long commerceAccountUserId , int start , int end , OrderByComparator < CommerceAccountUserRel > orderByComparator ) { } } | return getPersistence ( ) . findByCommerceAccountUserId ( commerceAccountUserId , start , end , orderByComparator ) ; |
public class Streams { /** * Prepend given values to the skip of the Stream
* < pre >
* { @ code
* List < String > result = of ( 1,2,3 ) . prependAll ( 100,200,300)
* . map ( it - > it + " ! ! " ) . collect ( CyclopsCollectors . toList ( ) ) ;
* assertThat ( result , equalTo ( Arrays . asList ( " 100 ! ! " , " 200 ! ! " , " 300 ! ! " , " 1 ! ! " , " 2 ! ! " , " 3 ! ! " ) ) ) ;
* @ param values to prependAll
* @ return Stream with values prepended */
public static final < T > Stream < T > prepend ( final Stream < T > stream , final T ... values ) { } } | return appendStream ( Stream . of ( values ) , stream ) ; |
public class AddInstanceGroupsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AddInstanceGroupsRequest addInstanceGroupsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( addInstanceGroupsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( addInstanceGroupsRequest . getInstanceGroups ( ) , INSTANCEGROUPS_BINDING ) ; protocolMarshaller . marshall ( addInstanceGroupsRequest . getJobFlowId ( ) , JOBFLOWID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class CmsSolrSpellchecker { /** * Sets the appropriate headers to response of this request .
* @ param response The HttpServletResponse response object . */
private void setResponeHeaders ( HttpServletResponse response ) { } } | response . setHeader ( "Cache-Control" , "no-store, no-cache" ) ; response . setHeader ( "Pragma" , "no-cache" ) ; response . setDateHeader ( "Expires" , System . currentTimeMillis ( ) ) ; response . setContentType ( "text/plain; charset=utf-8" ) ; response . setCharacterEncoding ( "utf-8" ) ; |
public class ImageHeaderReaderAbstract { /** * Skipped message error .
* @ param skipped The skipped value .
* @ param instead The instead value .
* @ throws IOException If not skipped the right number of bytes . */
protected static void checkSkippedError ( long skipped , int instead ) throws IOException { } } | if ( skipped != instead ) { throw new IOException ( MESSAGE_SKIPPED + skipped + MESSAGE_BYTES_INSTEAD_OF + instead ) ; } |
public class ReflectionUtil { /** * Resolves the { @ link Type } of the lower bound of a single type argument of a
* { @ link ParameterizedType } .
* < pre >
* private List & lt ; MyModel & gt ; myModel - & gt ; MyModel .
* private Optional & lt ; MyModel & gt ; myModel - & gt ; MyModel .
* < / pre >
* @ param type must not be < code > null < / code > .
* @ return never null . */
public static Type getLowerBoundOfSingleTypeParameter ( Type type ) { } } | if ( type == null ) { throw new IllegalArgumentException ( "Method parameter type must not be null." ) ; } // The generic type may contain the generic type declarations , e . g . List < String > .
if ( ! ( type instanceof ParameterizedType ) ) { throw new IllegalArgumentException ( "Cannot obtain the component type of " + type + ", it does not declare generic type parameters." ) ; } // Only the ParametrizedType contains reflection information about the actual type .
ParameterizedType parameterizedType = ( ParameterizedType ) type ; Type [ ] typeArguments = parameterizedType . getActualTypeArguments ( ) ; // We expect exactly one argument representing the model type .
if ( typeArguments . length != 1 ) { signalUnsupportedNumberOfTypeDeclarations ( type ) ; } Type typeArgument = typeArguments [ 0 ] ; // Wildcard type < X . . . Y >
if ( typeArgument instanceof WildcardType ) { WildcardType wildcardType = ( WildcardType ) typeArgument ; Type [ ] lowerBounds = wildcardType . getLowerBounds ( ) ; if ( lowerBounds . length == 0 ) { throw new IllegalArgumentException ( "Cannot obtain the generic type of " + type + ", it has a wildcard declaration with an upper" + " bound (<? extends Y>) and is thus read-only." + " Only simple type parameters (e.g. <MyType>)" + " or lower bound wildcards (e.g. <? super MyModel>)" + " are supported." ) ; } typeArgument = lowerBounds [ 0 ] ; } return typeArgument ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.