idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
11,100 | public static < T > Set < T > toSet ( final Collection < T > collection ) { if ( isEmpty ( collection ) ) { return new HashSet < T > ( 0 ) ; } else { return new HashSet < T > ( collection ) ; } } | Convert given collection to a set . |
11,101 | public static < T > T [ ] toArray ( final Collection < T > collection ) { T next = getFirstNotNullValue ( collection ) ; if ( next != null ) { Object [ ] objects = collection . toArray ( ) ; @ SuppressWarnings ( "unchecked" ) T [ ] convertedObjects = ( T [ ] ) Array . newInstance ( next . getClass ( ) , objects . lengt... | Convert given collection to an array . |
11,102 | public void setMappings ( List < String > mappings ) { if ( mappings . size ( ) > 0 ) { @ SuppressWarnings ( "unchecked" ) Pair < String , String > [ ] renames = ( Pair < String , String > [ ] ) Array . newInstance ( Pair . class , mappings . size ( ) ) ; for ( int i = 0 ; i < _renames . length ; ++ i ) { String [ ] na... | Defines parameter mappings . One parameter can be mapped to multiple new names so a list is used instead of a map as the input to this method . |
11,103 | public static ICommonsNavigableSet < EContinent > getContinentsOfCountry ( final Locale aLocale ) { final Locale aCountry = CountryCache . getInstance ( ) . getCountry ( aLocale ) ; if ( aCountry != null ) { final ICommonsNavigableSet < EContinent > ret = s_aMap . get ( aCountry ) ; if ( ret != null ) return ret . getC... | Get all continents for the specified country ID |
11,104 | public boolean isLoadable ( ) { if ( getPayload ( ) instanceof NullPayload ) { return false ; } try { InputStream is = getInputStream ( ) ; try { is . read ( ) ; return true ; } finally { is . close ( ) ; } } catch ( IOException ex ) { return false ; } } | Tests whether the Cargo s payload is loadable . |
11,105 | public String loadString ( String encoding ) throws IOException { byte [ ] bytes = loadByteArray ( ) ; ByteOrderMask bom = ByteOrderMask . valueOf ( bytes ) ; if ( bom != null ) { int offset = ( bom . getBytes ( ) ) . length ; return new String ( bytes , offset , bytes . length - offset , bom . getEncoding ( ) ) ; } re... | Loads the string in the user specified character encoding . |
11,106 | public Result transfer ( long count ) { if ( count < 0L ) throw new IllegalArgumentException ( "negative count" ) ; return buffer == null ? transferNoBuffer ( count ) : transferBuffered ( count ) ; } | Transfers the specified number of bytes from the source to the target . Fewer bytes may be transferred if an end - of - stream condition occurs in either the source or the target . |
11,107 | public static TreePath getPath ( TreePath path , Tree target ) { path . getClass ( ) ; target . getClass ( ) ; class Result extends Error { static final long serialVersionUID = - 5942088234594905625L ; TreePath path ; Result ( TreePath path ) { this . path = path ; } } class PathFinder extends TreePathScanner < TreePat... | Gets a tree path for a tree node within a subtree identified by a TreePath object . |
11,108 | public Reifier addTypeSet ( Class < ? > spec ) { for ( Field field : spec . getDeclaredFields ( ) ) { if ( Modifier . isPublic ( field . getModifiers ( ) ) ) { String name = field . getName ( ) ; try { _named . put ( name , new Validator ( name , field . getType ( ) , field ) ) ; } catch ( IllegalArgumentException x ) ... | Adds a set of data type specifications . |
11,109 | public < T extends DataObject > T collect ( T data , Map < String , String > binder ) throws SecurityException , DataValidationException { return collect ( data , binder , null ) ; } | Populates a data object by collecting and validating the named values from a Map< ; String String> ; . |
11,110 | public static boolean localeSupportsCurrencyRetrieval ( final Locale aLocale ) { return aLocale != null && aLocale . getCountry ( ) != null && aLocale . getCountry ( ) . length ( ) == 2 ; } | Check if a currency could be available for the given locale . |
11,111 | public static BigDecimal parseCurrency ( final String sStr , final DecimalFormat aFormat , final BigDecimal aDefault , final RoundingMode eRoundingMode ) { if ( StringHelper . hasNoText ( sStr ) ) return aDefault ; aFormat . setParseBigDecimal ( true ) ; aFormat . setRoundingMode ( eRoundingMode ) ; final BigDecimal aN... | Parse a currency value from string using a custom rounding mode . |
11,112 | private static String _getTextValueForDecimalSeparator ( final String sTextValue , final EDecimalSeparator eDecimalSep , final EGroupingSeparator eGroupingSep ) { ValueEnforcer . notNull ( eDecimalSep , "DecimalSeparator" ) ; ValueEnforcer . notNull ( eGroupingSep , "GroupingSeparator" ) ; final String ret = StringHelp... | Adopt the passed text value according to the requested decimal separator . |
11,113 | public static void setRoundingMode ( final ECurrency eCurrency , final RoundingMode eRoundingMode ) { getSettings ( eCurrency ) . setRoundingMode ( eRoundingMode ) ; } | Change the rounding mode of this currency . |
11,114 | public List < Symbol > functionalInterfaceBridges ( TypeSymbol origin ) { Assert . check ( isFunctionalInterface ( origin ) ) ; Symbol descSym = findDescriptorSymbol ( origin ) ; CompoundScope members = membersClosure ( origin . type , false ) ; ListBuffer < Symbol > overridden = new ListBuffer < > ( ) ; outer : for ( ... | Find the minimal set of methods that are overridden by the functional descriptor in origin . All returned methods are assumed to have different erased signatures . |
11,115 | public boolean isEqualityComparable ( Type s , Type t , Warner warn ) { if ( t . isNumeric ( ) && s . isNumeric ( ) ) return true ; boolean tPrimitive = t . isPrimitive ( ) ; boolean sPrimitive = s . isPrimitive ( ) ; if ( ! tPrimitive && ! sPrimitive ) { return isCastable ( s , t , warn ) || isCastable ( t , s , warn ... | Can t and s be compared for equality? Any primitive == primitive or primitive == object comparisons here are an error . Unboxing and correct primitive == primitive comparisons are already dealt with in Attr . visitBinary . |
11,116 | public Type elemtype ( Type t ) { switch ( t . getTag ( ) ) { case WILDCARD : return elemtype ( wildUpperBound ( t ) ) ; case ARRAY : t = t . unannotatedType ( ) ; return ( ( ArrayType ) t ) . elemtype ; case FORALL : return elemtype ( ( ( ForAll ) t ) . qtype ) ; case ERROR : return t ; default : return null ; } } | The element type of an array . |
11,117 | public int rank ( Type t ) { t = t . unannotatedType ( ) ; switch ( t . getTag ( ) ) { case CLASS : { ClassType cls = ( ClassType ) t ; if ( cls . rank_field < 0 ) { Name fullname = cls . tsym . getQualifiedName ( ) ; if ( fullname == names . java_lang_Object ) cls . rank_field = 0 ; else { int r = rank ( supertype ( c... | The rank of a class is the length of the longest path between the class and java . lang . Object in the class inheritance graph . Undefined for all but reference types . |
11,118 | public boolean covariantReturnType ( Type t , Type s , Warner warner ) { return isSameType ( t , s ) || allowCovariantReturns && ! t . isPrimitive ( ) && ! s . isPrimitive ( ) && isAssignable ( t , s , warner ) ; } | Is t an appropriate return type in an overrider for a method that returns s? |
11,119 | public ClassSymbol boxedClass ( Type t ) { return reader . enterClass ( syms . boxedName [ t . getTag ( ) . ordinal ( ) ] ) ; } | Return the class that boxes the given primitive . |
11,120 | protected String getSpace ( Request req ) { String spaceToken = req . headers ( SPACE_TOKEN_HEADER ) ; if ( StringUtils . isBlank ( spaceToken ) ) { throw new MissingSpaceTokenException ( "Missing header '" + SPACE_TOKEN_HEADER + "'." ) ; } String space = this . spacesService . getSpaceForAuthenticationToken ( spaceTok... | Extract spaceToken from request headers . |
11,121 | public WithCache . CacheState getCacheState ( ) { return new WithCache . CacheState ( size ( ) , _max , _get , _hit , _rep ) ; } | Reports the cumulative statistics of this cache . |
11,122 | static Class < ? > resolveParameterName ( String parameterName , Class < ? > target ) { Map < Type , Type > typeVariableMap = getTypeVariableMap ( target ) ; Set < Entry < Type , Type > > set = typeVariableMap . entrySet ( ) ; Type type = Object . class ; for ( Entry < Type , Type > entry : set ) { if ( entry . getKey ... | Resolves the generic parameter name of a class . |
11,123 | public List < Widget > putFactories ( Iterable < ? extends IWidgetFactory > factories ) throws IndexOutOfBoundsException { List < Widget > instances = new LinkedList < Widget > ( ) ; for ( IWidgetFactory factory : factories ) { instances . add ( put ( factory ) ) ; } return instances ; } | Creates widgets instance from given iterable and adds it to this panel |
11,124 | protected List < File > getSpooledFileList ( ) { final List < File > spooledFileList = new ArrayList < File > ( ) ; for ( final File file : spoolDirectory . listFiles ( ) ) { if ( file . isFile ( ) ) { spooledFileList . add ( file ) ; } } return spooledFileList ; } | protected for overriding during unit tests |
11,125 | public void add ( Collection < Application > applications ) { for ( Application application : applications ) this . applications . put ( application . getId ( ) , application ) ; } | Adds the application list to the applications for the account . |
11,126 | public ApplicationHostCache applicationHosts ( long applicationId ) { ApplicationHostCache cache = applicationHosts . get ( applicationId ) ; if ( cache == null ) applicationHosts . put ( applicationId , cache = new ApplicationHostCache ( applicationId ) ) ; return cache ; } | Returns the cache of application hosts for the given application creating one if it doesn t exist . |
11,127 | public KeyTransactionCache keyTransactions ( long applicationId ) { KeyTransactionCache cache = keyTransactions . get ( applicationId ) ; if ( cache == null ) keyTransactions . put ( applicationId , cache = new KeyTransactionCache ( applicationId ) ) ; return cache ; } | Returns the cache of key transactions for the given application creating one if it doesn t exist . |
11,128 | public void addKeyTransactions ( Collection < KeyTransaction > keyTransactions ) { for ( KeyTransaction keyTransaction : keyTransactions ) { long applicationId = keyTransaction . getLinks ( ) . getApplication ( ) ; Application application = applications . get ( applicationId ) ; if ( application != null ) keyTransactio... | Adds the key transactions to the applications for the account . |
11,129 | public DeploymentCache deployments ( long applicationId ) { DeploymentCache cache = deployments . get ( applicationId ) ; if ( cache == null ) deployments . put ( applicationId , cache = new DeploymentCache ( applicationId ) ) ; return cache ; } | Returns the cache of deployments for the given application creating one if it doesn t exist . |
11,130 | public LabelCache labels ( long applicationId ) { LabelCache cache = labels . get ( applicationId ) ; if ( cache == null ) labels . put ( applicationId , cache = new LabelCache ( applicationId ) ) ; return cache ; } | Returns the cache of labels for the given application creating one if it doesn t exist . |
11,131 | public void addLabel ( Label label ) { List < Long > applicationIds = label . getLinks ( ) . getApplications ( ) ; for ( long applicationId : applicationIds ) { Application application = applications . get ( applicationId ) ; if ( application != null ) labels ( applicationId ) . add ( label ) ; else logger . severe ( S... | Adds the label to the applications for the account . |
11,132 | private static < T , R > Function < T , R > doThrow ( Supplier < ? extends RuntimeException > exceptionSupplier ) { return t -> { throw exceptionSupplier . get ( ) ; } ; } | Returns a function that throws the exception supplied by the given supplier . |
11,133 | @ SuppressWarnings ( "unchecked" ) public < E extends BaseException > E put ( String name , Object value ) { properties . put ( name , value ) ; return ( E ) this ; } | Put a property in this exception . |
11,134 | @ Path ( "uniquetag/{uniqueTag}" ) public Response findByUniqueTag ( @ PathParam ( "uniqueTag" ) String uniqueTag ) { checkNotNull ( uniqueTag ) ; DContact contact = dao . findByUniqueTag ( null , uniqueTag ) ; return null != contact ? Response . ok ( contact ) . build ( ) : Response . status ( Response . Status . NOT_... | Find a contact based on its unique tag . |
11,135 | public static void generate ( ConfigurationImpl configuration ) { ProfileIndexFrameWriter profilegen ; DocPath filename = DocPaths . PROFILE_OVERVIEW_FRAME ; try { profilegen = new ProfileIndexFrameWriter ( configuration , filename ) ; profilegen . buildProfileIndexFile ( "doclet.Window_Overview" , false ) ; profilegen... | Generate the profile index file named profile - overview - frame . html . |
11,136 | protected Content getProfile ( String profileName ) { Content profileLinkContent ; Content profileLabel ; profileLabel = new StringContent ( profileName ) ; profileLinkContent = getHyperLink ( DocPaths . profileFrame ( profileName ) , profileLabel , "" , "packageListFrame" ) ; Content li = HtmlTree . LI ( profileLinkCo... | Gets each profile name as a separate link . |
11,137 | public void newRound ( Context context ) { this . context = context ; this . log = Log . instance ( context ) ; clearRoundState ( ) ; } | Update internal state for a new round . |
11,138 | public static GameSettings getInstance ( ) { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { sm . checkPermission ( new GamePermission ( "readSettings" ) ) ; } return INSTANCE ; } | Checks if the caller has permission to read the game settings |
11,139 | public static ClassFileReader newInstance ( Path path , JarFile jf ) throws IOException { return new JarFileReader ( path , jf ) ; } | Returns a ClassFileReader instance of a given JarFile . |
11,140 | Type rawInstantiate ( Env < AttrContext > env , Type site , Symbol m , ResultInfo resultInfo , List < Type > argtypes , List < Type > typeargtypes , boolean allowBoxing , boolean useVarargs , Warner warn ) throws Infer . InferenceException { Type mt = types . memberType ( site , m ) ; List < Type > tvars = List . nil (... | Try to instantiate the type of a method so that it fits given type arguments and argument types . If successful return the method s instantiated type else return null . The instantiation will take into account an additional leading formal parameter if the method is an instance method seen as a member of an under determ... |
11,141 | @ SuppressWarnings ( "fallthrough" ) Symbol selectBest ( Env < AttrContext > env , Type site , List < Type > argtypes , List < Type > typeargtypes , Symbol sym , Symbol bestSoFar , boolean allowBoxing , boolean useVarargs , boolean operator ) { if ( sym . kind == ERR || ! sym . isInheritedIn ( site . tsym , types ) ) {... | Select the best method for a call site among two choices . |
11,142 | Symbol findMethod ( Env < AttrContext > env , Type site , Name name , List < Type > argtypes , List < Type > typeargtypes , boolean allowBoxing , boolean useVarargs , boolean operator ) { Symbol bestSoFar = methodNotFound ; bestSoFar = findMethod ( env , site , name , argtypes , typeargtypes , site . tsym . type , best... | Find best qualified method matching given name type and value arguments . |
11,143 | public void printscopes ( Scope s ) { while ( s != null ) { if ( s . owner != null ) System . err . print ( s . owner + ": " ) ; for ( Scope . Entry e = s . elems ; e != null ; e = e . sibling ) { if ( ( e . sym . flags ( ) & ABSTRACT ) != 0 ) System . err . print ( "abstract " ) ; System . err . print ( e . sym + " " ... | print all scopes starting with scope s and proceeding outwards . used for debugging . |
11,144 | Symbol resolveBinaryOperator ( DiagnosticPosition pos , JCTree . Tag optag , Env < AttrContext > env , Type left , Type right ) { return resolveOperator ( pos , optag , env , List . of ( left , right ) ) ; } | Resolve binary operator . |
11,145 | private boolean matches ( String classname , AccessFlags flags ) { if ( options . apiOnly && ! flags . is ( AccessFlags . ACC_PUBLIC ) ) { return false ; } else if ( options . includePattern != null ) { return options . includePattern . matcher ( classname . replace ( '/' , '.' ) ) . matches ( ) ; } else { return true ... | Tests if the given class matches the pattern given in the - include option or if it s a public class if - apionly option is specified |
11,146 | private String replacementFor ( String cn ) { String name = cn ; String value = null ; while ( value == null && name != null ) { try { value = ResourceBundleHelper . jdkinternals . getString ( name ) ; } catch ( MissingResourceException e ) { int i = name . lastIndexOf ( '.' ) ; name = i > 0 ? name . substring ( 0 , i ... | Returns the recommended replacement API for the given classname ; or return null if replacement API is not known . |
11,147 | public void setContract ( Contract c ) { super . setContract ( c ) ; for ( Field f : params ) { f . setContract ( c ) ; } if ( returns != null ) { returns . setContract ( c ) ; } } | Sets the Contract for this Function . Propegates this down to its param and return Fields |
11,148 | public Object invoke ( RpcRequest req , Object handler ) throws RpcException , IllegalAccessException , InvocationTargetException { if ( contract == null ) { throw new IllegalStateException ( "contract cannot be null" ) ; } if ( req == null ) { throw new IllegalArgumentException ( "req cannot be null" ) ; } if ( handle... | Invokes this Function against the given handler Class for the given request . This is the heart of the RPC dispatch and is where your application code gets run . |
11,149 | public Object [ ] marshalParams ( RpcRequest req ) throws RpcException { Object [ ] converted = new Object [ params . size ( ) ] ; Object [ ] reqParams = req . getParams ( ) ; if ( reqParams . length != converted . length ) { String msg = "Function '" + req . getMethod ( ) + "' expects " + params . size ( ) + " param(s... | Marshals the req . params to their RPC format equivalents . For example a Java Struct class will be converted to a Map . |
11,150 | public Object unmarshalResult ( Object respObj ) throws RpcException { if ( returns == null ) { if ( respObj != null ) { throw new IllegalArgumentException ( "Function " + name + " is a notification and should not have a result" ) ; } } return returns . getTypeConverter ( ) . unmarshal ( respObj ) ; } | Unmarshals respObj into its Java representation |
11,151 | public Object [ ] unmarshalParams ( RpcRequest req ) throws RpcException { Object reqParams [ ] = req . getParams ( ) ; if ( reqParams . length != params . size ( ) ) { String msg = "Function '" + req . getMethod ( ) + "' expects " + params . size ( ) + " param(s). " + reqParams . length + " given." ; throw invParams (... | Unmarshals req . params into their Java representations |
11,152 | public static String getCompactMessage ( final String sMsg ) { UPCA . validateMessage ( sMsg ) ; final String sUPCA = UPCA . handleChecksum ( sMsg , EEANChecksumMode . AUTO ) ; final byte nNumberSystem = _extractNumberSystem ( sUPCA ) ; if ( nNumberSystem != 0 && nNumberSystem != 1 ) return null ; final byte nCheck = S... | Compacts an UPC - A message to an UPC - E message if possible . |
11,153 | public static String getExpandedMessage ( final String sMsg ) { final char cCheck = sMsg . length ( ) == 8 ? sMsg . charAt ( 7 ) : '\u0000' ; final String sUpce = sMsg . substring ( 0 , 0 + 7 ) ; final byte nNumberSystem = _extractNumberSystem ( sUpce ) ; if ( nNumberSystem != 0 && nNumberSystem != 1 ) throw new Illega... | Expands an UPC - E message to an UPC - A message . |
11,154 | public static EValidity validateMessage ( final String sMsg ) { final int nLen = StringHelper . getLength ( sMsg ) ; if ( nLen >= 7 && nLen <= 8 ) { final byte nNumberSystem = _extractNumberSystem ( sMsg ) ; if ( nNumberSystem >= 0 && nNumberSystem <= 1 ) return EValidity . VALID ; } return EValidity . INVALID ; } | Validates an UPC - E message . The message can also be UPC - A in which case the message is compacted to a UPC - E message if possible . If it s not possible an IllegalArgumentException is thrown |
11,155 | public Iterable < DUser > queryByBirthInfo ( java . lang . String birthInfo ) { return queryByField ( null , DUserMapper . Field . BIRTHINFO . getFieldName ( ) , birthInfo ) ; } | query - by method for field birthInfo |
11,156 | public Iterable < DUser > queryByFriends ( java . lang . Object friends ) { return queryByField ( null , DUserMapper . Field . FRIENDS . getFieldName ( ) , friends ) ; } | query - by method for field friends |
11,157 | public Iterable < DUser > queryByPassword ( java . lang . String password ) { return queryByField ( null , DUserMapper . Field . PASSWORD . getFieldName ( ) , password ) ; } | query - by method for field password |
11,158 | public Iterable < DUser > queryByPhoneNumber1 ( java . lang . String phoneNumber1 ) { return queryByField ( null , DUserMapper . Field . PHONENUMBER1 . getFieldName ( ) , phoneNumber1 ) ; } | query - by method for field phoneNumber1 |
11,159 | public Iterable < DUser > queryByPhoneNumber2 ( java . lang . String phoneNumber2 ) { return queryByField ( null , DUserMapper . Field . PHONENUMBER2 . getFieldName ( ) , phoneNumber2 ) ; } | query - by method for field phoneNumber2 |
11,160 | public Iterable < DUser > queryByPreferredLanguage ( java . lang . String preferredLanguage ) { return queryByField ( null , DUserMapper . Field . PREFERREDLANGUAGE . getFieldName ( ) , preferredLanguage ) ; } | query - by method for field preferredLanguage |
11,161 | public Iterable < DUser > queryByTimeZoneCanonicalId ( java . lang . String timeZoneCanonicalId ) { return queryByField ( null , DUserMapper . Field . TIMEZONECANONICALID . getFieldName ( ) , timeZoneCanonicalId ) ; } | query - by method for field timeZoneCanonicalId |
11,162 | public DUser findByUsername ( java . lang . String username ) { return queryUniqueByField ( null , DUserMapper . Field . USERNAME . getFieldName ( ) , username ) ; } | find - by method for unique field username |
11,163 | public < T > T executeSelect ( Connection conn , DataObject object , ResultSetWorker < T > worker ) throws Exception { PreparedStatement statement = conn . prepareStatement ( _sql ) ; try { load ( statement , object ) ; return worker . process ( statement . executeQuery ( ) ) ; } finally { statement . close ( ) ; } } | Executes the SELECT statement passing the result set to the ResultSetWorker for processing . |
11,164 | public ClassDoc [ ] enums ( ) { ListBuffer < ClassDocImpl > ret = new ListBuffer < ClassDocImpl > ( ) ; for ( ClassDocImpl c : getClasses ( true ) ) { if ( c . isEnum ( ) ) { ret . append ( c ) ; } } return ret . toArray ( new ClassDocImpl [ ret . length ( ) ] ) ; } | Get included enum types in this package . |
11,165 | public ClassDoc [ ] interfaces ( ) { ListBuffer < ClassDocImpl > ret = new ListBuffer < ClassDocImpl > ( ) ; for ( ClassDocImpl c : getClasses ( true ) ) { if ( c . isInterface ( ) ) { ret . append ( c ) ; } } return ret . toArray ( new ClassDocImpl [ ret . length ( ) ] ) ; } | Get included interfaces in this package omitting annotation types . |
11,166 | public Rejected acquirePermits ( long number , long nanoTime ) { for ( int i = 0 ; i < backPressureList . size ( ) ; ++ i ) { BackPressure < Rejected > bp = backPressureList . get ( i ) ; Rejected rejected = bp . acquirePermit ( number , nanoTime ) ; if ( rejected != null ) { rejectedCounts . write ( rejected , number ... | Acquire permits for task execution . If the acquisition is rejected then a reason will be returned . If the acquisition is successful null will be returned . |
11,167 | public void releasePermitsWithoutResult ( long number , long nanoTime ) { for ( BackPressure < Rejected > backPressure : backPressureList ) { backPressure . releasePermit ( number , nanoTime ) ; } } | Release acquired permits without result . Since there is not a known result the result count object and latency will not be updated . |
11,168 | @ Path ( "{taskName}" ) public Response enqueueTask ( @ PathParam ( "taskName" ) String taskName ) { checkNotNull ( taskName ) ; taskQueue . enqueueTask ( taskName , requestParamsProvider . get ( ) ) ; return Response . ok ( ) . build ( ) ; } | Enqueue an admin task for processing . The request will return immediately and the task will be run in a separate thread . The execution model depending on the implementation of the queue . |
11,169 | @ Path ( "{taskName}" ) public Response processTask ( @ PathParam ( "taskName" ) String taskName ) { checkNotNull ( requestParamsProvider . get ( ) ) ; checkNotNull ( taskName ) ; LOGGER . info ( "Processing task for {}..." , taskName ) ; for ( AdminTask adminTask : adminTasks ) { final Object body = adminTask . proces... | Process an admin task . The admin task will be processed on the requesting thread . |
11,170 | public void run ( Map < String , Object > extra ) { if ( getParameterConfig ( ) != null ) { Boolean parametersRequired = false ; List < String > requiredParameters = new ArrayList < String > ( ) ; for ( ParamConfig paramConfig : getParameterConfig ( ) ) { if ( BooleanUtils . isTrue ( paramConfig . getRequired ( ) ) ) {... | Runs the report . |
11,171 | public static Date getDateFromString ( final String dateString , final String pattern ) { try { SimpleDateFormat df = buildDateFormat ( pattern ) ; return df . parse ( dateString ) ; } catch ( ParseException e ) { throw new DateException ( String . format ( "Could not parse %s with pattern %s." , dateString , pattern )... | Get data from data string using the given pattern and the default date format symbols for the default locale . |
11,172 | public static String getDateFormat ( final Date date , final String pattern ) { SimpleDateFormat simpleDateFormat = buildDateFormat ( pattern ) ; return simpleDateFormat . format ( date ) ; } | Format date by given pattern . |
11,173 | public static Date getDateOfSecondsBack ( final int secondsBack , final Date date ) { return dateBack ( Calendar . SECOND , secondsBack , date ) ; } | Get specify seconds back form given date . |
11,174 | public static Date getDateOfMinutesBack ( final int minutesBack , final Date date ) { return dateBack ( Calendar . MINUTE , minutesBack , date ) ; } | Get specify minutes back form given date . |
11,175 | public static Date getDateOfHoursBack ( final int hoursBack , final Date date ) { return dateBack ( Calendar . HOUR_OF_DAY , hoursBack , date ) ; } | Get specify hours back form given date . |
11,176 | public static Date getDateOfDaysBack ( final int daysBack , final Date date ) { return dateBack ( Calendar . DAY_OF_MONTH , daysBack , date ) ; } | Get specify days back from given date . |
11,177 | public static Date getDateOfWeeksBack ( final int weeksBack , final Date date ) { return dateBack ( Calendar . WEEK_OF_MONTH , weeksBack , date ) ; } | Get specify weeks back from given date . |
11,178 | public static Date getDateOfMonthsBack ( final int monthsBack , final Date date ) { return dateBack ( Calendar . MONTH , monthsBack , date ) ; } | Get specify months back from given date . |
11,179 | public static Date getDateOfYearsBack ( final int yearsBack , final Date date ) { return dateBack ( Calendar . YEAR , yearsBack , date ) ; } | Get specify years back from given date . |
11,180 | public static boolean isLastDayOfTheMonth ( final Date date ) { Date dateOfMonthsBack = getDateOfMonthsBack ( - 1 , date ) ; int dayOfMonth = getDayOfMonth ( dateOfMonthsBack ) ; Date dateOfDaysBack = getDateOfDaysBack ( dayOfMonth , dateOfMonthsBack ) ; return dateOfDaysBack . equals ( date ) ; } | Return true if the given date is the last day of the month ; false otherwise . |
11,181 | public static long subSeconds ( final Date date1 , final Date date2 ) { return subTime ( date1 , date2 , DatePeriod . SECOND ) ; } | Get how many seconds between two date . |
11,182 | public static long subMinutes ( final Date date1 , final Date date2 ) { return subTime ( date1 , date2 , DatePeriod . MINUTE ) ; } | Get how many minutes between two date . |
11,183 | public static long subHours ( final Date date1 , final Date date2 ) { return subTime ( date1 , date2 , DatePeriod . HOUR ) ; } | Get how many hours between two date . |
11,184 | public static long subDays ( final Date date1 , final Date date2 ) { return subTime ( date1 , date2 , DatePeriod . DAY ) ; } | Get how many days between two date . |
11,185 | public static long subMonths ( final String dateString1 , final String dateString2 ) { Date date1 = getDateFromString ( dateString1 , DEFAULT_DATE_SIMPLE_PATTERN ) ; Date date2 = getDateFromString ( dateString2 , DEFAULT_DATE_SIMPLE_PATTERN ) ; return subMonths ( date1 , date2 ) ; } | Get how many months between two date the date pattern is yyyy - MM - dd . |
11,186 | public static long subMonths ( final Date date1 , final Date date2 ) { Calendar calendar1 = buildCalendar ( date1 ) ; int monthOfDate1 = calendar1 . get ( Calendar . MONTH ) ; int yearOfDate1 = calendar1 . get ( Calendar . YEAR ) ; Calendar calendar2 = buildCalendar ( date2 ) ; int monthOfDate2 = calendar2 . get ( Cale... | Get how many months between two date . |
11,187 | public static long subYears ( final Date date1 , final Date date2 ) { return Math . abs ( getYear ( date1 ) - getYear ( date2 ) ) ; } | Get how many years between two date . |
11,188 | private static SimpleDateFormat buildDateFormat ( final String pattern ) { SimpleDateFormat simpleDateFormat = simpleDateFormatCache . get ( ) ; if ( simpleDateFormat == null ) { simpleDateFormat = new SimpleDateFormat ( ) ; simpleDateFormatCache . set ( simpleDateFormat ) ; } simpleDateFormat . applyPattern ( pattern ... | Get a SimpleDateFormat object by given pattern . |
11,189 | Type fold1 ( int opcode , Type operand ) { try { Object od = operand . constValue ( ) ; switch ( opcode ) { case nop : return operand ; case ineg : return syms . intType . constType ( - intValue ( od ) ) ; case ixor : return syms . intType . constType ( ~ intValue ( od ) ) ; case bool_not : return syms . booleanType . ... | Fold unary operation . |
11,190 | public synchronized void addHandler ( Class iface , Object handler ) { try { iface . cast ( handler ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( "Handler: " + handler . getClass ( ) . getName ( ) + " does not implement: " + iface . getName ( ) ) ; } if ( contract . getInterfaces ( ) . get ( iface ... | Associates the handler instance with the given IDL interface . Replaces an existing handler for this iface if one was previously registered . |
11,191 | @ SuppressWarnings ( "unchecked" ) public void call ( Serializer ser , InputStream is , OutputStream os ) throws IOException { Object obj = null ; try { obj = ser . readMapOrList ( is ) ; } catch ( Exception e ) { String msg = "Unable to deserialize request: " + e . getMessage ( ) ; ser . write ( new RpcResponse ( null... | Reads a RpcRequest from the input stream deserializes it invokes the matching handler method serializes the result and writes it to the output stream . |
11,192 | public RpcResponse call ( RpcRequest req ) { for ( Filter filter : filters ) { RpcRequest tmp = filter . alterRequest ( req ) ; if ( tmp != null ) { req = tmp ; } } RpcResponse resp = null ; for ( Filter filter : filters ) { resp = filter . preInvoke ( req ) ; if ( resp != null ) { break ; } } if ( resp == null ) { res... | Calls the method associated with the RpcRequest and wraps the result as a RpcResponse . |
11,193 | public static String doGet ( final String url , final int retryTimes ) { try { return doGetByLoop ( url , retryTimes ) ; } catch ( HttpException e ) { throw new HttpException ( format ( "Failed to download content for url: '%s'. Tried '%s' times" , url , Math . max ( retryTimes + 1 , 1 ) ) ) ; } } | access given url by get request if get exception will retry by given retryTimes . |
11,194 | public static String doPost ( final String action , final Map < String , String > parameters , final int retryTimes ) { try { return doPostByLoop ( action , parameters , retryTimes ) ; } catch ( HttpException e ) { throw new HttpException ( format ( "Failed to download content for action url: '%s' with parameters. Trie... | access given action with given parameters by post if get exception will retry by given retryTimes . |
11,195 | public < A extends Appendable > A document ( A output ) throws IOException { StringBuilder line = new StringBuilder ( ) ; for ( Field field : Beans . getKnownInstanceFields ( _prototype ) ) { description d = field . getAnnotation ( description . class ) ; if ( d == null ) continue ; placeholder p = field . getAnnotatio... | Writes usage documentation to an Appendable . |
11,196 | public static InetAddress getAddress ( String host ) throws UnknownHostException { if ( timeToClean ( ) ) { synchronized ( storedAddresses ) { if ( timeToClean ( ) ) { cleanOldAddresses ( ) ; } } } Pair < InetAddress , Long > cachedAddress ; synchronized ( storedAddresses ) { cachedAddress = storedAddresses . get ( hos... | only allow 5 simultaneous DNS requests |
11,197 | private VarSymbol enterConstant ( String name , Type type ) { VarSymbol c = new VarSymbol ( PUBLIC | STATIC | FINAL , names . fromString ( name ) , type , predefClass ) ; c . setData ( type . constValue ( ) ) ; predefClass . members ( ) . enter ( c ) ; return c ; } | Enter a constant into symbol table . |
11,198 | private void enterBinop ( String name , Type left , Type right , Type res , int opcode ) { predefClass . members ( ) . enter ( new OperatorSymbol ( makeOperatorName ( name ) , new MethodType ( List . of ( left , right ) , res , List . < Type > nil ( ) , methodClass ) , opcode , predefClass ) ) ; } | Enter a binary operation into symbol table . |
11,199 | private OperatorSymbol enterUnop ( String name , Type arg , Type res , int opcode ) { OperatorSymbol sym = new OperatorSymbol ( makeOperatorName ( name ) , new MethodType ( List . of ( arg ) , res , List . < Type > nil ( ) , methodClass ) , opcode , predefClass ) ; predefClass . members ( ) . enter ( sym ) ; return sym... | Enter a unary operation into symbol table . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.