signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CleverTapAPI { /** * Event */
private void scheduleQueueFlush ( final Context context ) { } } | if ( commsRunnable == null ) commsRunnable = new Runnable ( ) { @ Override public void run ( ) { flushQueueAsync ( context ) ; } } ; // Cancel any outstanding send runnables , and issue a new delayed one
getHandlerUsingMainLooper ( ) . removeCallbacks ( commsRunnable ) ; getHandlerUsingMainLooper ( ) . postDelayed ( co... |
public class DnsAddressResolverGroup { /** * Creates a new { @ link AddressResolver } . Override this method to create an alternative { @ link AddressResolver }
* implementation or override the default configuration . */
protected AddressResolver < InetSocketAddress > newAddressResolver ( EventLoop eventLoop , NameRe... | return new InetSocketAddressResolver ( eventLoop , resolver ) ; |
public class TransactionScope { /** * Returns the isolation level of the active transaction , or null if there
* is no active transaction . */
public IsolationLevel getIsolationLevel ( ) { } } | mLock . lock ( ) ; try { return ( mClosed || mActive == null ) ? null : mActive . getIsolationLevel ( ) ; } finally { mLock . unlock ( ) ; } |
public class CronTabList { /** * Returns true if the given calendar matches */
public synchronized boolean check ( Calendar cal ) { } } | for ( CronTab tab : tabs ) { if ( tab . check ( cal ) ) return true ; } return false ; |
public class CcgParse { /** * Gets all of the words spanned by this node of the parse tree ,
* in sentence order .
* @ return */
public List < String > getSpannedWords ( ) { } } | if ( isTerminal ( ) ) { return words ; } else { List < String > words = Lists . newArrayList ( ) ; words . addAll ( left . getSpannedWords ( ) ) ; words . addAll ( right . getSpannedWords ( ) ) ; return words ; } |
public class FileLogSet { /** * Create a new unique file name . If the source file is specified , the new
* file should be created by renaming the source file as the unique file .
* @ param srcFile the file to rename , or null to create a new file
* @ param show error message if showError is true
* @ return the... | String dateString = getDateString ( ) ; int index = findFileIndexAndUpdateCounter ( dateString ) ; String destFileName ; File destFile ; do { int counter = lastCounter ++ ; destFileName = fileName + dateString + '.' + counter + fileExtension ; destFile = new File ( directory , destFileName ) ; boolean success ; if ( sr... |
public class PlainChangesLogImpl { /** * Search for an item state of item with given id and filter parameters .
* @ param id
* - item id
* @ param states
* - filter only the given list states ( ORed ) , or all if it ' s null
* @ param isPersisted
* - filter only persisted / not persisted , or all if it ' s ... | List < ItemState > allStates = getAllStates ( ) ; // search from the end for state
for ( int i = allStates . size ( ) - 1 ; i >= 0 ; i -- ) { ItemState istate = allStates . get ( i ) ; boolean byState = false ; if ( states != null ) { for ( int state : states ) { if ( istate . getState ( ) == state ) { byState = true ;... |
public class Marc { /** * Transform W3C document of the record in the ISO 2709 input stream by an XSL stylesheet .
* @ param factory the transformer factory
* @ param stylesheetUrl the URL of the stylesheet
* @ param result the result of the transformation
* @ throws IOException if transformation fails */
publi... | try ( InputStream xslInputStream = stylesheetUrl . openStream ( ) ) { factory . newTemplates ( new StreamSource ( xslInputStream ) ) . newTransformer ( ) . transform ( new DOMSource ( document ( ) ) , result ) ; } catch ( TransformerException e ) { throw new IOException ( e ) ; } finally { if ( builder . getInputStream... |
public class VecUtils { /** * Create a new { @ link Vec } of numeric values from an existing { @ link Vec } .
* This method accepts all { @ link Vec } types as input . The original Vec is not mutated .
* If src is a categorical { @ link Vec } , a copy is returned .
* If src is a string { @ link Vec } , all values... | switch ( src . get_type ( ) ) { case Vec . T_CAT : return categoricalToInt ( src ) ; case Vec . T_STR : return stringToNumeric ( src ) ; case Vec . T_NUM : case Vec . T_TIME : case Vec . T_UUID : return src . makeCopy ( null , Vec . T_NUM ) ; default : throw new H2OIllegalArgumentException ( "Unrecognized column type "... |
public class CoreOptions { /** * Creates a { @ link org . ops4j . pax . exam . options . MavenPluginGeneratedConfigOption } .
* @ param url of configuration to be used
* @ return Args option with file written from paxexam plugin */
public static MavenPluginGeneratedConfigOption mavenConfiguration ( String url ) { }... | validateNotEmpty ( url , "specified configuration url must not be empty " ) ; try { return mavenConfiguration ( new URL ( url ) ) ; } catch ( MalformedURLException mE ) { throw new IllegalArgumentException ( "url " + url + " is not a valid url" , mE ) ; } |
public class AbstractQueuedSynchronizer { /** * Acquires in exclusive uninterruptible mode for thread already in
* queue . Used by condition wait methods as well as acquire .
* @ param node the node
* @ param arg the acquire argument
* @ return { @ code true } if interrupted while waiting */
final boolean acqui... | try { boolean interrupted = false ; for ( ; ; ) { final Node p = node . predecessor ( ) ; if ( p == head && tryAcquire ( arg ) ) { setHead ( node ) ; p . next = null ; // help GC
return interrupted ; } if ( shouldParkAfterFailedAcquire ( p , node ) && parkAndCheckInterrupt ( ) ) interrupted = true ; } } catch ( Throwab... |
public class ServerNetwork { /** * Returns the socket pool as a load - balancer . */
public final ClientSocketFactory getLoadBalanceSocketPool ( ) { } } | ClientSocketFactory factory = getLoadBalanceSocketFactory ( ) ; if ( factory == null ) return null ; if ( _serverBartender . getState ( ) . isDisableSoft ( ) ) { factory . enableSessionOnly ( ) ; } else if ( _serverBartender . getState ( ) . isDisabled ( ) ) { // server / 269g
factory . disable ( ) ; } else { factory .... |
public class SpaceAPI { /** * Returns a list of the members that have been removed from the space .
* @ param spaceId
* The id of the space
* @ return The active members of the space */
public List < SpaceMember > getEndedMembers ( int spaceId ) { } } | return getResourceFactory ( ) . getApiResource ( "/space/" + spaceId + "/member/ended/" ) . get ( new GenericType < List < SpaceMember > > ( ) { } ) ; |
public class SingleDbJDBCConnection { /** * { @ inheritDoc } */
@ Override protected int deleteReference ( String propertyCid ) throws SQLException { } } | if ( deleteReference == null ) { deleteReference = dbConnection . prepareStatement ( DELETE_REF ) ; } else { deleteReference . clearParameters ( ) ; } deleteReference . setString ( 1 , propertyCid ) ; return deleteReference . executeUpdate ( ) ; |
public class MutableBigInteger { /** * Subtracts the smaller of this and b from the larger and places the
* result into this MutableBigInteger . */
int subtract ( MutableBigInteger b ) { } } | MutableBigInteger a = this ; int [ ] result = value ; int sign = a . compare ( b ) ; if ( sign == 0 ) { reset ( ) ; return 0 ; } if ( sign < 0 ) { MutableBigInteger tmp = a ; a = b ; b = tmp ; } int resultLen = a . intLen ; if ( result . length < resultLen ) result = new int [ resultLen ] ; long diff = 0 ; int x = a . ... |
public class BackedHashMap { /** * get */
public Object get ( Object key , int version ) { } } | if ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ GET ] , key + " " + version ) ; } String id = ( String ) key ; Object obj = getSessio... |
public class HadoopKeyStoreManager { /** * Stores the keystore onto HDFS . Overwrites existing one .
* @ param path
* @ param keyStorePassword
* @ throws KeyStoreException
* @ throws NoSuchAlgorithmException
* @ throws CertificateException
* @ throws IOException */
public void store ( Path path , String key... | OutputStream os = this . fs . create ( path , true ) ; this . keystore . store ( os , keyStorePassword . toCharArray ( ) ) ; if ( os != null ) { os . close ( ) ; } |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getPPORGObjType ( ) { } } | if ( pporgObjTypeEEnum == null ) { pporgObjTypeEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 122 ) ; } return pporgObjTypeEEnum ; |
public class IntMap { /** * Finds the highest key LE ` max ` ,
* for which there is a value . */
public int findHighestKey ( int max ) { } } | int highest = Integer . MIN_VALUE ; int index = index ( hash ( max ) ) ; final int maxTry = capacity ; for ( int i = 0 ; i < maxTry ; i ++ ) { if ( ! slotIsFree ( index ) ) { int k = keys [ index ] ; if ( k == max ) return max ; if ( max > k && k > highest ) highest = k ; } index = nextIndex ( index ) ; } return highes... |
public class Util { /** * Get the singleton object reference .
* This method returns a reference to the object of the Util class . If the
* class has not been initialised with it ' s init method , this method print a
* message and abort the device server process
* @ return The Util object reference */
public st... | if ( _instance == null ) { System . err . println ( "Util is not initialised !!!" ) ; System . err . println ( "Exiting" ) ; System . exit ( - 1 ) ; } return _instance ; |
public class MessageCombiner { /** * Sends the combined message to the target vertex .
* @ param combinedMessage
* @ throws Exception */
public final void sendCombinedMessage ( Message combinedMessage ) { } } | outValue . f1 = Either . Right ( combinedMessage ) ; out . collect ( outValue ) ; |
public class QueryAtomContainer { /** * Grows the atom array by a given size .
* @ see # growArraySize */
private void growAtomArray ( ) { } } | growArraySize = ( atoms . length < growArraySize ) ? growArraySize : atoms . length ; IAtom [ ] newatoms = new IAtom [ atoms . length + growArraySize ] ; System . arraycopy ( atoms , 0 , newatoms , 0 , atoms . length ) ; atoms = newatoms ; |
public class Validator { /** * Validate Required . Allow space characters . */
protected void validateRequired ( String field , String errorKey , String errorMessage ) { } } | String value = controller . getPara ( field ) ; if ( value == null || "" . equals ( value ) ) { // 经测试 , form表单域无输入时值为 " " , 跳格键值为 " \ t " , 输入空格则为空格 " "
addError ( errorKey , errorMessage ) ; } |
public class SaneClientAuthentication { /** * Returns { @ code true } if the configuration contains an entry for the given resource . */
@ Override public boolean canAuthenticate ( String resource ) { } } | if ( resource == null ) { return false ; } ClientCredential credential = getCredentialForResource ( resource ) ; return credential != null ; |
public class CollectionUtils { /** * Null - safe method returning the given { @ link Set } or an empty { @ link Set } if null .
* @ param < T > Class type of the elements in the { @ link Set } .
* @ param set { @ link Set } to evaluate .
* @ return the given { @ link Set } or an empty { @ link Set } if null .
*... | return set != null ? set : Collections . emptySet ( ) ; |
public class TriangulateMetricLinearDLT { /** * Given N observations of the same point from two views and a known motion between the
* two views , triangulate the point ' s position in camera ' b ' reference frame .
* Modification of [ 1 ] to be less generic and use calibrated cameras .
* @ param observations Obs... | if ( observations . size ( ) != worldToView . size ( ) ) throw new IllegalArgumentException ( "Number of observations must match the number of motions" ) ; final int N = worldToView . size ( ) ; A . reshape ( 2 * N , 4 , false ) ; int index = 0 ; for ( int i = 0 ; i < N ; i ++ ) { index = addView ( worldToView . get ( ... |
public class SingletonInitialContext { /** * A convenience method that registers the supplied object with the supplied name .
* @ param name the JNDI name
* @ param obj the object to be registered */
public static void register ( String name , Object obj ) { } } | register ( name , obj , null , null , null , null ) ; |
public class TagHandler { /** * Utility method for fetching a required TagAttribute
* @ param localName
* name of the attribute
* @ return TagAttribute if found , otherwise error
* @ throws TagException
* if the attribute was not found */
protected final TagAttribute getRequiredAttribute ( String localName ) ... | TagAttribute attr = this . getAttribute ( localName ) ; if ( attr == null ) { throw new TagException ( this . tag , "Attribute '" + localName + "' is required" ) ; } return attr ; |
public class CentralAnalyzer { /** * Determines if this analyzer is enabled .
* @ return < code > true < / code > if the analyzer is enabled ; otherwise
* < code > false < / code > */
private boolean checkEnabled ( ) { } } | boolean retVal = false ; try { if ( getSettings ( ) . getBoolean ( Settings . KEYS . ANALYZER_CENTRAL_ENABLED ) ) { if ( ! getSettings ( ) . getBoolean ( Settings . KEYS . ANALYZER_NEXUS_ENABLED ) || NexusAnalyzer . DEFAULT_URL . equals ( getSettings ( ) . getString ( Settings . KEYS . ANALYZER_NEXUS_URL ) ) ) { LOGGER... |
public class ObjectRange { /** * throws IllegalArgumentException if to and from are incompatible , meaning they e . g . ( likely ) produce infinite sequences .
* Called at construction time , subclasses may override cautiously ( using only members to and from ) . */
protected void checkBoundaryCompatibility ( ) { } } | if ( from instanceof String && to instanceof String ) { // this test depends deeply on the String . next implementation
// 009 . next is 00 : , not 010
final String start = from . toString ( ) ; final String end = to . toString ( ) ; if ( start . length ( ) != end . length ( ) ) { throw new IllegalArgumentException ( "... |
public class XBasicForLoopExpressionImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EList < XExpression > getInitExpressions ( ) { } } | if ( initExpressions == null ) { initExpressions = new EObjectContainmentEList < XExpression > ( XExpression . class , this , XbasePackage . XBASIC_FOR_LOOP_EXPRESSION__INIT_EXPRESSIONS ) ; } return initExpressions ; |
public class SequenceResource { /** * Returns the mimetype of the first resource in the given Iterable , or
* " application / octet - stream " if no resources are provided .
* @ param resources
* The resources from which the mimetype should be retrieved .
* @ return
* The mimetype of the first resource , or "... | // If no resources , just assume application / octet - stream
Iterator < Resource > resourceIterator = resources . iterator ( ) ; if ( ! resourceIterator . hasNext ( ) ) return "application/octet-stream" ; // Return mimetype of first resource
return resourceIterator . next ( ) . getMimeType ( ) ; |
public class AuthenticationServiceImpl { /** * { @ inheritDoc } */
@ Override public Subject authenticate ( String jaasEntryName , AuthenticationData authenticationData , Subject subject ) throws AuthenticationException { } } | ReentrantLock currentLock = optionallyObtainLockedLock ( authenticationData ) ; try { // If basic auth login to a different realm , then create a basic auth subject
if ( isBasicAuthLogin ( authenticationData ) ) { return createBasicAuthSubject ( authenticationData , subject ) ; } else { Subject authenticatedSubject = f... |
public class GeoPackageCoreImpl { /** * { @ inheritDoc } */
@ Override public AttributesTable createAttributesTable ( String tableName , String idColumnName , List < AttributesColumn > additionalColumns , List < UserUniqueConstraint < AttributesColumn > > uniqueConstraints ) { } } | if ( idColumnName == null ) { idColumnName = "id" ; } List < AttributesColumn > columns = new ArrayList < AttributesColumn > ( ) ; columns . add ( AttributesColumn . createPrimaryKeyColumn ( 0 , idColumnName ) ) ; if ( additionalColumns != null ) { columns . addAll ( additionalColumns ) ; } return createAttributesTable... |
public class B2buaHelperImpl { /** * Issue 1151 : For Contact header if present only the user part and some
* parameters are to be used as defined in 4.1.3 The Contact Header Field
* @ param newRequest
* @ param contactHeaderSet
* @ param newSipServletRequest
* @ param contactHeader
* @ throws ParseExceptio... | // we parse and add the contact headers defined in the map
Request newRequest = ( Request ) newSipServletRequest . getMessage ( ) ; for ( String contactHeaderValue : contactHeaderSet ) { newSipServletRequest . addHeaderInternal ( ContactHeader . NAME , contactHeaderValue , true ) ; } // we set up a list of contact head... |
public class Utils { /** * Reads an long value from the buffer starting at the given index relative to the current
* position ( ) of the buffer , without mutating the buffer in any way ( so it ' s thread safe ) . */
public static long getLong ( ByteBuffer buf , int index ) { } } | return buf . order ( ) == BIG_ENDIAN ? getLongB ( buf , index ) : getLongL ( buf , index ) ; |
public class AbstractMkTree { /** * Performs a batch k - nearest neighbor query for a list of query objects .
* @ param node the node representing the subtree on which the query should be
* performed
* @ param ids the ids of the query objects
* @ param kmax Maximum k value
* @ deprecated Change to use by - ob... | Map < DBID , KNNList > res = new HashMap < > ( ids . size ( ) ) ; for ( DBIDIter iter = ids . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { DBID id = DBIDUtil . deref ( iter ) ; res . put ( id , knnq . getKNNForDBID ( id , kmax ) ) ; } return res ; |
public class VMath { /** * Returns a matrix which consists of this matrix and the specified columns .
* @ param m1 Input matrix
* @ param m2 the columns to be appended
* @ return the new matrix with the appended columns */
public static double [ ] [ ] appendColumns ( final double [ ] [ ] m1 , final double [ ] [ ]... | final int columndimension = getColumnDimensionality ( m1 ) ; final int ccolumndimension = getColumnDimensionality ( m2 ) ; assert m1 . length == m2 . length : "m.getRowDimension() != column.getRowDimension()" ; final int rcolumndimension = columndimension + ccolumndimension ; final double [ ] [ ] result = new double [ ... |
public class NodeDetailsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( NodeDetails nodeDetails , ProtocolMarshaller protocolMarshaller ) { } } | if ( nodeDetails == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( nodeDetails . getNodeIndex ( ) , NODEINDEX_BINDING ) ; protocolMarshaller . marshall ( nodeDetails . getIsMainNode ( ) , ISMAINNODE_BINDING ) ; } catch ( Exception e ) { thr... |
public class FileSystem { /** * Verifies a directory and checks to see if it ' s writeable or not if
* configured
* @ param dir The path to check on
* @ param need _ write Set to true if the path needs write access
* @ param create Set to true if the directory should be created if it does not
* exist
* @ th... | if ( dir . isEmpty ( ) ) throw new IllegalArgumentException ( "Directory path is empty" ) ; final File f = new File ( dir ) ; if ( ! f . exists ( ) && ! ( create && f . mkdirs ( ) ) ) { throw new IllegalArgumentException ( "No such directory [" + dir + "]" ) ; } else if ( ! f . isDirectory ( ) ) { throw new IllegalArgu... |
public class CmsXmlEntityResolver { /** * Proves if there is at least one xsd or dtd file in the list of resources to publish . < p >
* @ param publishHistoryId the publish history id
* @ return true , if there is at least one xsd or dtd file in the list of resources to publish , otherwise false */
private boolean ... | if ( m_cms == null ) { // CmsObject not available , assume there may be a schema definition in the publish history
return true ; } try { List < CmsPublishedResource > publishedResources = m_cms . readPublishedResources ( publishHistoryId ) ; for ( CmsPublishedResource cmsPublishedResource : publishedResources ) { Strin... |
public class lbvserver_stats { /** * Use this API to fetch statistics of lbvserver _ stats resource of given name . */
public static lbvserver_stats get ( nitro_service service , String name ) throws Exception { } } | lbvserver_stats obj = new lbvserver_stats ( ) ; obj . set_name ( name ) ; lbvserver_stats response = ( lbvserver_stats ) obj . stat_resource ( service ) ; return response ; |
public class HtmlTextareaRendererBase { /** * Subclasses can override the writing of the " text " value of the textarea */
protected void renderTextAreaValue ( FacesContext facesContext , UIComponent uiComponent ) throws IOException { } } | ResponseWriter writer = facesContext . getResponseWriter ( ) ; Object addNewLineAtStart = uiComponent . getAttributes ( ) . get ( ADD_NEW_LINE_AT_START_ATTR ) ; if ( addNewLineAtStart != null ) { boolean addNewLineAtStartBoolean = false ; if ( addNewLineAtStart instanceof String ) { addNewLineAtStartBoolean = Boolean .... |
public class JsType { /** * Returns a Soy assertion expression that asserts that the given value has this type , or { @ link
* Optional # absent ( ) } if no assertion is necessary . */
public final Optional < Expression > getSoyTypeAssertion ( Expression value , String valueName , Generator codeGenerator ) { } } | Optional < Expression > typeAssertion = getTypeAssertion ( value , codeGenerator ) ; if ( ! typeAssertion . isPresent ( ) ) { return Optional . absent ( ) ; } return Optional . of ( SOY_ASSERTS_ASSERT_TYPE . call ( typeAssertion . get ( ) , stringLiteral ( valueName ) , value , stringLiteral ( typeExpr ( ) ) ) ) ; |
public class DomImplIE { /** * { @ inheritDoc } */
@ Override public Element createElementNS ( String ns , String tag , String id ) { } } | Element element ; if ( Dom . NS_HTML . equals ( ns ) ) { element = DOM . createElement ( tag ) ; } else { element = DOM . createElement ( ns + ":" + tag ) ; } if ( id != null ) { DOM . setElementAttribute ( element , "id" , id ) ; } return element ; |
public class AbstractElementTransformer { /** * Returns true if that is the case , false otherwise */
private boolean isReadObjectOrWriteObjectMethod ( Symbol symbol ) { } } | if ( symbol instanceof DynamicFunctionSymbol ) { DynamicFunctionSymbol dfs = ( DynamicFunctionSymbol ) symbol ; if ( dfs . getDisplayName ( ) . equals ( "readObject" ) ) { IType [ ] argTypes = dfs . getArgTypes ( ) ; return argTypes != null && argTypes . length == 1 && argTypes [ 0 ] . equals ( JavaTypes . getJreType (... |
public class NotificationBoardCallback { /** * Called only once after this callback is set .
* @ param board */
public void onBoardSetup ( NotificationBoard board ) { } } | if ( DBG ) Log . v ( TAG , "onBoardSetup" ) ; LayoutInflater inflater = board . getInflater ( ) ; View footer = inflater . inflate ( R . layout . notification_board_footer , null , false ) ; board . addFooterView ( footer ) ; board . setFooterHeight ( 200 ) ; // board . setHeaderHeight ( 150 ) ;
board . setHeaderMargin... |
public class EventListenerListHelper { /** * Adds < code > listener < / code > to the list of registered listeners . If
* listener is already registered this method will do nothing .
* @ param listener The event listener to be registered .
* @ return true if the listener was registered , false if { @ code listene... | if ( listener == null ) { return false ; } checkListenerType ( listener ) ; synchronized ( this ) { if ( listeners == EMPTY_OBJECT_ARRAY ) { listeners = new Object [ ] { listener } ; } else { int listenersLength = listeners . length ; for ( int i = 0 ; i < listenersLength ; i ++ ) { if ( listeners [ i ] == listener ) {... |
public class CmsCategoryTree { /** * Sets the given tree list enabled / disabled . < p >
* @ param list the list of tree items
* @ param enabled < code > true < / code > to enable
* @ param disabledReason the disable reason , will be displayed as check box title */
private void setListEnabled ( CmsList < ? extend... | for ( Widget child : list ) { CmsTreeItem treeItem = ( CmsTreeItem ) child ; if ( enabled ) { treeItem . getCheckBox ( ) . enable ( ) ; } else { treeItem . getCheckBox ( ) . disable ( disabledReason ) ; } setListEnabled ( treeItem . getChildren ( ) , enabled , disabledReason ) ; } |
public class LabelGetterFactory { /** * フィールドのラベル情報を取得するためのアクセッサを作成します 。
* @ param beanClass フィールドが定義されているクラス情報
* @ param fieldName フィールドの名称
* @ return ラベル情報のgetterが存在しない場合は空を返す 。
* @ throws IllegalArgumentException { @ literal beanClass = = null or fieldName = = null }
* @ throws IllegalArgumentExcept... | ArgUtils . notNull ( beanClass , "beanClass" ) ; ArgUtils . notEmpty ( fieldName , "fieldName" ) ; // フィールド Map labelsの場合
Optional < LabelGetter > LabelGetter = createMapField ( beanClass , fieldName ) ; if ( LabelGetter . isPresent ( ) ) { return LabelGetter ; } // setter メソッドの場合
LabelGetter = createMethod ( beanCla... |
public class PathMappingUtil { /** * Returns the logger name from the specified { @ code pathish } . */
public static String newLoggerName ( @ Nullable String pathish ) { } } | if ( pathish == null ) { return UNKNOWN_LOGGER_NAME ; } String normalized = pathish ; if ( "/" . equals ( normalized ) ) { return ROOT_LOGGER_NAME ; } if ( normalized . startsWith ( "/" ) ) { normalized = normalized . substring ( 1 ) ; // Strip the first slash .
} final int end ; if ( normalized . endsWith ( "/" ) ) { ... |
public class HieroSettings { /** * Saves the settings to a file .
* @ param file The file we ' re saving to
* @ throws IOException if the file could not be saved . */
public void save ( File file ) throws IOException { } } | PrintStream out = new PrintStream ( new FileOutputStream ( file ) ) ; out . println ( "font.size=" + fontSize ) ; out . println ( "font.bold=" + bold ) ; out . println ( "font.italic=" + italic ) ; out . println ( ) ; out . println ( "pad.top=" + paddingTop ) ; out . println ( "pad.right=" + paddingRight ) ; out . prin... |
public class HttpServlet { /** * Dispatches client requests to the protected
* < code > service < / code > method . There ' s no need to
* override this method .
* @ param req the { @ link HttpServletRequest } object that
* contains the request the client made of
* the servlet
* @ param res the { @ link Htt... | HttpServletRequest request ; HttpServletResponse response ; if ( ! ( req instanceof HttpServletRequest && res instanceof HttpServletResponse ) ) { throw new ServletException ( "non-HTTP request or response" ) ; } request = ( HttpServletRequest ) req ; response = ( HttpServletResponse ) res ; service ( request , respons... |
public class RestUriVariablesFactory { /** * Returns the uri variables needed for a resume text request
* @ param params
* @ return */
public Map < String , String > getUriVariablesForResumeTextParse ( ResumeTextParseParams params ) { } } | if ( params == null ) { params = ParamFactory . resumeTextParseParams ( ) ; } Map < String , String > uriVariables = params . getParameterMap ( ) ; String bhRestToken = bullhornApiRest . getBhRestToken ( ) ; uriVariables . put ( BH_REST_TOKEN , bhRestToken ) ; return uriVariables ; |
public class Transaction { /** * Returns false if this transaction has at least one output that is owned by the given wallet and unspent , true
* otherwise . */
public boolean isEveryOwnedOutputSpent ( TransactionBag transactionBag ) { } } | for ( TransactionOutput output : outputs ) { if ( output . isAvailableForSpending ( ) && output . isMineOrWatched ( transactionBag ) ) return false ; } return true ; |
public class LogUtils { /** * Dynamically sets the log4j log level for the given class to the specified level .
* @ param loggerName Name of the logger to set its log level . If blank , root logger will be used .
* @ param logLevel One of the supported log levels : TRACE , DEBUG , INFO , WARN , ERROR , FATAL ,
* ... | String logLevelUpper = ( logLevel == null ) ? "OFF" : logLevel . toUpperCase ( ) ; try { Package log4jPackage = Package . getPackage ( LOG4J_CLASSIC ) ; if ( log4jPackage == null ) { LOG . warn ( "Log4j is not in the classpath!" ) ; return false ; } Class < ? > clz = Class . forName ( LOG4J_CLASSIC_LOGGER ) ; // Obtain... |
public class JDBC4PreparedStatement { /** * Sets the designated parameter to the given java . sql . Date value using the default time zone of the virtual machine that is running the application . */
@ Override public void setDate ( int parameterIndex , Date x ) throws SQLException { } } | checkParameterBounds ( parameterIndex ) ; throw SQLError . noSupport ( ) ; |
public class CollapsibleList { /** * Returns the list object associated with the specified section . */
public JList getSectionList ( int index ) { } } | @ SuppressWarnings ( "unchecked" ) JList list = ( JList ) getComponent ( index * 2 + 1 ) ; return list ; |
public class JKObjectUtil { /** * Gets the field name by type .
* @ param classType the class type
* @ param fieldType the field type
* @ return the field name by type */
public static String getFieldNameByType ( Class < ? > classType , Class < ? > fieldType ) { } } | Field [ ] declaredFields = classType . getDeclaredFields ( ) ; for ( Field field : declaredFields ) { if ( field . getType ( ) . isAssignableFrom ( fieldType ) ) { return field . getName ( ) ; } } if ( classType . getSuperclass ( ) != null ) { return getFieldNameByType ( classType . getSuperclass ( ) , fieldType ) ; } ... |
public class NonBlockingBufferedInputStream { /** * See the general contract of the < code > skip < / code > method of
* < code > InputStream < / code > .
* @ exception IOException
* if the stream does not support seek , or if this input stream has
* been closed by invoking its { @ link # close ( ) } method , o... | _getBufIfOpen ( ) ; // Check for closed stream
if ( nBytesToSkip <= 0 ) return 0 ; long nAvail = ( long ) m_nCount - m_nPos ; if ( nAvail <= 0 ) { // If no mark position set then don ' t keep in buffer
if ( m_nMarkPos < 0 ) return _getInIfOpen ( ) . skip ( nBytesToSkip ) ; // Fill in buffer to save bytes for reset
_fil... |
public class JarWithFile { /** * Readable if the jar is readable and the path refers to a file . */
public boolean canRead ( String path ) { } } | try { ZipEntry entry = getZipEntry ( path ) ; return entry != null && ! entry . isDirectory ( ) ; } catch ( IOException e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; return false ; } |
public class Job { /** * Gets the youngest build # m that satisfies { @ code n & lt ; = m } .
* This is useful when you ' d like to fetch a build but the exact build might
* be already gone ( deleted , rotated , etc . )
* @ see LazyBuildMixIn # getNearestBuild */
public RunT getNearestBuild ( int n ) { } } | SortedMap < Integer , ? extends RunT > m = _getRuns ( ) . headMap ( n - 1 ) ; // the map should
// include n , so n - 1
if ( m . isEmpty ( ) ) return null ; return m . get ( m . lastKey ( ) ) ; |
public class Connectors { /** * Determine there is a projection with the given alias and projected ( internal ) node key
* @ param alias the alias
* @ param externalNodeKey the node key of the projected ( internal ) node
* @ return true if there is such a projection , or false otherwise */
public boolean hasExter... | return this . snapshot . get ( ) . hasExternalProjection ( alias , externalNodeKey ) ; |
public class MapUtils { /** * Creates a copy of the supplied map with its keys transformed by the supplied function , which
* must be one - to - one on the keys of the original map . If two keys are mapped to the same value by
* { @ code injection } , an { @ code IllegalArgumentException } is thrown . */
public sta... | final ImmutableMap . Builder < K2 , V > ret = ImmutableMap . builder ( ) ; for ( final Map . Entry < K1 , V > entry : map . entrySet ( ) ) { ret . put ( injection . apply ( entry . getKey ( ) ) , entry . getValue ( ) ) ; } return ret . build ( ) ; |
public class EventServicesImpl { /** * Returns the ActivityInstance identified by the passed in Id
* @ param pActivityInstId
* @ return ActivityInstance */
public ActivityInstance getActivityInstance ( Long pActivityInstId ) throws ProcessException , DataAccessException { } } | ActivityInstance ai ; TransactionWrapper transaction = null ; EngineDataAccessDB edao = new EngineDataAccessDB ( ) ; try { transaction = edao . startTransaction ( ) ; ai = edao . getActivityInstance ( pActivityInstId ) ; } catch ( SQLException e ) { throw new ProcessException ( 0 , "Failed to get activity instance" , e... |
public class CmsExport { /** * Writes the data for a resource ( like access - rights ) to the < code > manifest . xml < / code > file . < p >
* @ param resource the resource to get the data from
* @ param source flag to show if the source information in the xml file must be written
* @ param isSuperFolder flag to... | try { // only write < source > if resource is a file
String fileName = trimResourceName ( getCms ( ) . getSitePath ( resource ) ) ; if ( fileName . startsWith ( "system/orgunits" ) ) { // it is not allowed to export organizational unit resources
// export the organizational units instead
return ; } // define the file n... |
public class Headers { /** * Get the first value found for this key even if there are multiple . If none , then
* return null .
* @ param name
* @ return */
public String getFirst ( String name ) { } } | HeaderName hn = getHeaderName ( name ) ; return getFirst ( hn ) ; |
public class FileUtils { /** * Verificamos que file es un fichero y que tenemos permisos de lectura
* @ param dir
* @ return */
public static String verifyReadFile ( String filePath ) { } } | if ( filePath == null ) { return "The path is null" ; } File dir = new File ( filePath ) ; return verifyReadFile ( dir ) ; |
public class ProxyOverrider { /** * Used by LittleProxy to connect to a downstream proxy if there is one . */
@ Override public void lookupChainedProxies ( HttpRequest request , Queue < ChainedProxy > chainedProxies ) { } } | final InetSocketAddress originalProxy = originalProxies . get ( URI . create ( request . getUri ( ) ) . getScheme ( ) ) ; if ( originalProxy != null ) { ChainedProxy chainProxy = new ChainedProxyAdapter ( ) { @ Override public InetSocketAddress getChainedProxyAddress ( ) { return originalProxy ; } } ; chainedProxies . ... |
public class TimerTrace { /** * End a preformance profiling with the < code > name < / code > given . Deal with
* profile hierarchy automatically , so caller don ' t have to be concern about it . */
public static void end ( ) { } } | if ( ! active ) return ; TimerStack stack = curStack . get ( ) ; if ( null == stack ) return ; TimerNode currentNode = stack . pop ( ) ; if ( currentNode != null ) { TimerNode parent = stack . peek ( ) ; long total = currentNode . end ( ) ; // if we are the root timer , then print out the times
if ( parent == null ) { ... |
public class ProbeManagerImpl { /** * Determine of the specified class can be monitored via the probes
* infrastructure .
* @ param clazz the monitoring candidate
* @ return false if the class can ' t be monitored */
public boolean isMonitorable ( Class < ? > clazz ) { } } | // Faster ( ? ) path
if ( notMonitorable . contains ( clazz ) ) { return false ; } else if ( monitorable . contains ( clazz ) ) { return true ; } boolean isMonitorable = true ; if ( ! instrumentation . isModifiableClass ( clazz ) ) { isMonitorable = false ; } else if ( clazz . isInterface ( ) ) { isMonitorable = false ... |
public class JdbcDeepJobConfig { /** * { @ inheritDoc } */
@ Override public JdbcDeepJobConfig < T > partitionKey ( String partitionKey ) { } } | if ( dbTable != null ) { this . partitionKey = new DbColumn ( dbTable , partitionKey , "" , null , null ) ; } return this ; |
public class Stream { /** * Zip together the " a " , " b " and " c " iterators until all of them runs out of values .
* Each triple of values is combined into a single value using the supplied zipFunction function .
* @ param a
* @ param b
* @ param c
* @ param valueForNoneA value to fill if " a " runs out of... | return zip ( IntIteratorEx . of ( a ) , IntIteratorEx . of ( b ) , IntIteratorEx . of ( c ) , valueForNoneA , valueForNoneB , valueForNoneC , zipFunction ) ; |
public class NetworkBufferPool { /** * Destroys all buffer pools that allocate their buffers from this
* buffer pool ( created via { @ link # createBufferPool ( int , int ) } ) . */
public void destroyAllBufferPools ( ) { } } | synchronized ( factoryLock ) { // create a copy to avoid concurrent modification exceptions
LocalBufferPool [ ] poolsCopy = allBufferPools . toArray ( new LocalBufferPool [ allBufferPools . size ( ) ] ) ; for ( LocalBufferPool pool : poolsCopy ) { pool . lazyDestroy ( ) ; } // some sanity checks
if ( allBufferPools . s... |
public class GetStaticIpsResult { /** * An array of key - value pairs containing information about your get static IPs request .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setStaticIps ( java . util . Collection ) } or { @ link # withStaticIps ( java . u... | if ( this . staticIps == null ) { setStaticIps ( new java . util . ArrayList < StaticIp > ( staticIps . length ) ) ; } for ( StaticIp ele : staticIps ) { this . staticIps . add ( ele ) ; } return this ; |
public class OAuthCredentialsCache { /** * Clear the cache .
* @ param oldToken for a comparison . Only revoke the cache if the oldToken matches the current one . */
void revokeUnauthToken ( HeaderToken oldToken ) { } } | synchronized ( lock ) { if ( headerCache . getToken ( ) == oldToken ) { LOG . warn ( "Got unauthenticated response from server, revoking the current token" ) ; headerCache = EMPTY_HEADER ; } else { LOG . info ( "Skipping revoke, since the revoked token has already changed" ) ; } } |
public class JenkinsServer { /** * Delete a job from Jenkins within a folder .
* @ param folder The folder where the given job is located .
* @ param jobName The job which should be deleted .
* @ throws IOException in case of an error . */
public JenkinsServer deleteJob ( FolderJob folder , String jobName ) throw... | return deleteJob ( folder , jobName , false ) ; |
public class Version { /** * Creates a new instance of { @ code Version }
* for the specified version numbers .
* @ param major the major version number
* @ param minor the minor version number
* @ param patch the patch version number
* @ return a new instance of the { @ code Version } class
* @ throws Ille... | return new Version ( new NormalVersion ( major , minor , patch ) ) ; |
public class EmulatedFields { /** * Returns { @ code true } indicating the field called { @ code name } has not had
* a value explicitly assigned and that it still holds a default value for
* its type , or { @ code false } indicating that the field named has been
* assigned a value explicitly .
* @ param name
... | ObjectSlot slot = findSlot ( name , null ) ; if ( slot == null ) { throw new IllegalArgumentException ( "no field '" + name + "'" ) ; } return slot . defaulted ; |
public class DataPipeline { /** * Return true if at least one source is active .
* @ param skipSource don ' t consider this data source when determining if the
* pipeline is active . */
public boolean isActive ( VehicleDataSource skipSource ) { } } | boolean connected = false ; for ( VehicleDataSource s : mSources ) { if ( s != skipSource ) { connected = connected || s . isConnected ( ) ; } } return connected ; |
public class MessageSerializer { /** * Serializes the exception containing the failure message sent to the
* { @ link org . apache . flink . queryablestate . network . Client } in case of
* protocol related errors .
* @ param allocThe { @ link ByteBufAllocator } used to allocate the buffer to serialize the messag... | final ByteBuf buf = alloc . ioBuffer ( ) ; // Frame length is set at the end
buf . writeInt ( 0 ) ; writeHeader ( buf , MessageType . REQUEST_FAILURE ) ; buf . writeLong ( requestId ) ; try ( ByteBufOutputStream bbos = new ByteBufOutputStream ( buf ) ; ObjectOutput out = new ObjectOutputStream ( bbos ) ) { out . writeO... |
public class EmoTableAllTablesReportDAO { /** * Accepts the table portion of a table report entry and converts it to a TableReportEntryTable . If the
* entry doesn ' t match all of the configured filters then null is returned . */
@ Nullable private TableReportEntryTable convertToTableReportEntryTable ( String tableI... | // Check the filters for placement , dropped , and facade
String placement = ( String ) map . get ( "placement" ) ; if ( ! placementFilter . apply ( placement ) ) { return null ; } Boolean dropped = Objects . firstNonNull ( ( Boolean ) map . get ( "dropped" ) , false ) ; if ( ! droppedFilter . apply ( dropped ) ) { ret... |
public class FileUtils { /** * Writes map entries from symbols to file absolute paths to a file . Each line has a mapping with
* the key and value separated by a single tab . The file will have a trailing newline . Note that
* the same " key " may appear in the file with multiple mappings . */
public static void wr... | writeUnixLines ( transform ( MapUtils . transformValues ( entries , toAbsolutePathFunction ( ) ) , TO_TAB_SEPARATED_ENTRY ) , sink ) ; |
public class CETR { /** * Extracts the main content for an HTML page .
* @ param html
* @ param parameters
* @ return */
public String extract ( String html , CETR . Parameters parameters ) { } } | html = clearText ( html ) ; // preprocess the Document by removing irrelevant HTML tags and empty lines and break the document to its lines
List < String > rows = extractRows ( html ) ; List < Integer > selectedRowIds = selectRows ( rows , parameters ) ; StringBuilder sb = new StringBuilder ( html . length ( ) ) ; for ... |
public class ConsoleConsumer { /** * Creates and starts a daemon thread which pipes int { @ link InputStream } to the { @ link OutputStream } .
* @ param in the input stream that should be pipped
* @ param out the output stream where the data should be written
* @ return the thread that was started */
public stat... | final Thread thread = new Thread ( new ConsoleConsumer ( in , out ) , "WildFly-Console-Consumer" ) ; thread . setDaemon ( true ) ; thread . start ( ) ; return thread ; |
public class RequestHelper { /** * Get the request path info without an eventually appended session
* ( " ; jsessionid = . . . " )
* @ param aHttpRequest
* The HTTP request
* @ return Returns any extra path information associated with the URL the
* client sent when it made this request . The extra path inform... | ValueEnforcer . notNull ( aHttpRequest , "HttpRequest" ) ; final String sPathInfo = ServletHelper . getRequestPathInfo ( aHttpRequest ) ; if ( StringHelper . hasNoText ( sPathInfo ) ) return sPathInfo ; return getWithoutSessionID ( sPathInfo ) ; |
public class PatriciaTrie { /** * Returns a copy of the keys contained in this trie as a Set
* @ return keys in the trie , not null */
@ Override public Set < String > keySet ( ) { } } | Set < String > keys = new HashSet < > ( ) ; keysR ( root . getLeft ( ) , - 1 , keys ) ; return keys ; |
public class CheckedInputStream { /** * Reads a byte . Will block if no input is available .
* @ return the byte read , or - 1 if the end of the stream is reached .
* @ exception IOException if an I / O error has occurred */
public int read ( ) throws IOException { } } | int b = in . read ( ) ; if ( b != - 1 ) { cksum . update ( b ) ; } return b ; |
public class DbLoadAction { /** * 分析整个数据 , 将datas划分为多个批次 . ddl sql前的DML并发执行 , 然后串行执行ddl后 , 再并发执行DML
* @ return */
private boolean isDdlDatas ( List < EventData > eventDatas ) { } } | boolean result = false ; for ( EventData eventData : eventDatas ) { result |= eventData . getEventType ( ) . isDdl ( ) ; if ( result && ! eventData . getEventType ( ) . isDdl ( ) ) { throw new LoadException ( "ddl/dml can't be in one batch, it's may be a bug , pls submit issues." , DbLoadDumper . dumpEventDatas ( event... |
public class GraphRowSumValues { /** * Method used to getMaxX without taking in account out of range
* values . I . E . we don ' t take in account on value if the distance
* with the last point is greater than getGranulationValue ( ) * excludeCount .
* @ return the evaluated MaxX */
@ Override public long getMaxX... | if ( ! excludeOutOfRangeValues ) { return super . getMaxX ( ) ; } else { long retMax = 0 ; Iterator < Long > iter = values . keySet ( ) . iterator ( ) ; if ( iter . hasNext ( ) ) { retMax = iter . next ( ) ; } long excludeValue = getGranulationValue ( ) * excludeCount ; while ( iter . hasNext ( ) ) { long value = iter ... |
public class PlanNode { /** * Find the first node with one of the specified types that are at or below this node .
* @ param order the order to traverse ; may not be null
* @ param firstTypeToFind the first type of node to find ; may not be null
* @ param additionalTypesToFind the additional types of node to find... | return findAtOrBelow ( order , EnumSet . of ( firstTypeToFind , additionalTypesToFind ) ) ; |
public class AppListenerUtil { /** * translate int definition of script protect to string definition
* @ param scriptProtect
* @ return */
public static String translateScriptProtect ( int scriptProtect ) { } } | if ( scriptProtect == ApplicationContext . SCRIPT_PROTECT_NONE ) return "none" ; if ( scriptProtect == ApplicationContext . SCRIPT_PROTECT_ALL ) return "all" ; Array arr = new ArrayImpl ( ) ; if ( ( scriptProtect & ApplicationContext . SCRIPT_PROTECT_CGI ) > 0 ) arr . appendEL ( "cgi" ) ; if ( ( scriptProtect & Applica... |
public class LayoutExtensions { /** * Adds the component .
* @ param gbl
* the gbl
* @ param gbc
* the gbc
* @ param anchor
* the anchor
* @ param fill
* the fill
* @ param insets
* the insets
* @ param gridx
* the gridx
* @ param gridy
* the gridy
* @ param gridwidth
* the gridwidth
*... | gbc . anchor = anchor ; gbc . fill = fill ; gbc . insets = insets ; gbc . gridx = gridx ; gbc . gridy = gridy ; gbc . gridwidth = gridwidth ; gbc . gridheight = gridheight ; gbc . weightx = weightx ; gbc . weighty = weighty ; gbl . setConstraints ( addComponentToPanel , gbc ) ; panelToAdd . add ( addComponentToPanel ) ... |
public class LongStream { /** * Returns a stream consisting of the results of replacing each element of
* this stream with the contents of a mapped stream produced by applying
* the provided mapping function to each element .
* < p > This is an intermediate operation .
* < p > Example :
* < pre >
* mapper :... | return new LongStream ( params , new LongFlatMap ( iterator , mapper ) ) ; |
public class CubicInterpolation { /** * In C : again - two - registers cubic _ interpolate _ with _ x _ arr _ and _ y _ stride _ aux L1402 */
private static double interpolateUsingXArrAndYStride ( final double [ ] xArr , final double yStride , final int offset , final double x ) { } } | return cubicInterpolate ( xArr [ offset + 0 ] , yStride * ( offset + 0 ) , xArr [ offset + 1 ] , yStride * ( offset + 1 ) , xArr [ offset + 2 ] , yStride * ( offset + 2 ) , xArr [ offset + 3 ] , yStride * ( offset + 3 ) , x ) ; |
public class ExportRecordsScreen { /** * SetupSFields Method . */
public void setupSFields ( ) { } } | this . getRecord ( ClassInfo . CLASS_INFO_FILE ) . getField ( ClassInfo . CLASS_PACKAGE ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( ClassInfo . CLASS_INFO_FILE ) . getField ( ClassIn... |
public class AdminDictProtwordsAction { @ Execute public HtmlResponse create ( final CreateForm form ) { } } | verifyCrudMode ( form . crudMode , CrudMode . CREATE , form . dictId ) ; validate ( form , messages -> { } , ( ) -> asEditHtml ( ) ) ; verifyToken ( ( ) -> asEditHtml ( ) ) ; createProtwordsItem ( form , ( ) -> asEditHtml ( ) ) . ifPresent ( entity -> { protwordsService . store ( form . dictId , entity ) ; saveInfo ( m... |
public class LongParameter { /** * Set the maximum value .
* < p > If a minimum value has been set then the maximum value must not be
* less than the minimum value .
* @ param maximumValue the maximum value
* @ return this */
public LongParameter setMaximumValue ( long maximumValue ) { } } | if ( hasMinimumValue ) { Util . checkParameter ( maximumValue >= minimumValue , "Maximum value (" + maximumValue + ") must be greater than or equal to minimum (" + minimumValue + ")" ) ; } this . hasMaximumValue = true ; this . maximumValue = maximumValue ; return this ; |
public class AlignmentTools { /** * Rotate the Atoms / Groups so they are aligned for the 3D visualisation
* @ param afpChain
* @ param ca1
* @ param ca2
* @ return an array of Groups that are transformed for 3D display
* @ throws StructureException */
public static Group [ ] prepareGroupsForDisplay ( AFPChai... | if ( afpChain . getBlockRotationMatrix ( ) . length == 0 ) { // probably the alignment is too short !
System . err . println ( "No rotation matrix found to rotate 2nd structure!" ) ; afpChain . setBlockRotationMatrix ( new Matrix [ ] { Matrix . identity ( 3 , 3 ) } ) ; afpChain . setBlockShiftVector ( new Atom [ ] { ne... |
public class Unchecked { /** * Wrap a { @ link CheckedToLongFunction } in a { @ link ToLongFunction } with a custom handler for checked exceptions .
* Example :
* < code > < pre >
* map . forEach ( Unchecked . toLongFunction (
* if ( k . length ( ) > 10)
* throw new Exception ( " Only short strings allowed " ... | return t -> { try { return function . applyAsLong ( t ) ; } catch ( Throwable e ) { handler . accept ( e ) ; throw new IllegalStateException ( "Exception handler must throw a RuntimeException" , e ) ; } } ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.