signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Util { /** * Build the URL from the data obtained from the user . * @ param url * The URL to be transformed . * @ param user * The user name . * @ param password * The password . * @ return The URL with userInfo . * @ exception MalformedURLException * Exception thrown if the URL is malfor...
if ( url == null ) { return null ; } if ( ( url . getAuthority ( ) == null || "" . equals ( url . getAuthority ( ) ) ) && ! "jar" . equals ( url . getProtocol ( ) ) ) { return url ; } StringBuilder buf = new StringBuilder ( ) ; String protocol = url . getProtocol ( ) ; if ( protocol . equals ( "jar" ) ) { URL newURL = ...
public class FeedbackController { /** * Creates a MimeMessage based on a FeedbackForm . */ @ SuppressWarnings ( "squid:S3457" ) // do not use platform specific line ending private SimpleMailMessage createFeedbackMessage ( FeedbackForm form ) { } }
SimpleMailMessage message = new SimpleMailMessage ( ) ; message . setTo ( userService . getSuEmailAddresses ( ) . toArray ( new String [ ] { } ) ) ; if ( form . hasEmail ( ) ) { message . setCc ( form . getEmail ( ) ) ; message . setReplyTo ( form . getEmail ( ) ) ; } else { message . setReplyTo ( "no-reply@molgenis.or...
public class Context { /** * Get the connections for a connection listener * @ param cl The connection listener * @ return The value */ List < Object > getConnections ( ConnectionListener cl ) { } }
List < Object > l = null ; if ( clToC != null ) l = clToC . get ( cl ) ; if ( l == null ) l = Collections . emptyList ( ) ; return Collections . unmodifiableList ( l ) ;
public class ApplicationElement { /** * - - - - - state update */ void update ( ) { } }
Application . update ( filter , list , main , footer , toggleAll , count , clearCompleted ) ;
public class CareMessages { /** * 客服发送文本消息 * @ param openId * @ param text * @ param from 客服账号 */ public void text ( String openId , String text , String from ) { } }
Map < String , Object > request = initMessage ( openId , "text" , from ) ; request . put ( "text" , new Text ( text ) ) ; String url = WxEndpoint . get ( "url.care.message.send" ) ; wxClient . post ( url , JsonMapper . defaultMapper ( ) . toJson ( request ) ) ;
public class DocumentRevisionBuilder { /** * < p > Builds and returns the { @ link InternalDocumentRevision } for this builder . < / p > * @ return the { @ link InternalDocumentRevision } for this builder */ public InternalDocumentRevision build ( ) { } }
DocumentRevisionOptions options = new DocumentRevisionOptions ( ) ; options . sequence = sequence ; options . docInternalId = docInternalId ; options . deleted = deleted ; options . current = current ; options . parent = parent ; options . attachments = attachments ; return new InternalDocumentRevision ( docId , revId ...
public class DeleteEnvironmentMembershipRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteEnvironmentMembershipRequest deleteEnvironmentMembershipRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteEnvironmentMembershipRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteEnvironmentMembershipRequest . getEnvironmentId ( ) , ENVIRONMENTID_BINDING ) ; protocolMarshaller . marshall ( deleteEnvironmentMembershipReque...
public class OrmBase { /** * Case insensitive comparison . */ protected static boolean isIgnoredColumn ( final Set < String > ignoredColumns , final String columnName ) { } }
return ignoredColumns . stream ( ) . anyMatch ( s -> s . equalsIgnoreCase ( columnName ) ) ;
public class OpenVidu { /** * Starts the recording of a { @ link io . openvidu . java . client . Session } * @ param sessionId The sessionId of the session you want to start recording * @ param name The name you want to give to the video file . You can access * this same value in your clients on recording events ...
if ( name == null ) { name = "" ; } return this . startRecording ( sessionId , new RecordingProperties . Builder ( ) . name ( name ) . build ( ) ) ;
public class WVideoRenderer { /** * Converts a Track kind to the client track kind identifier . * @ param kind the Track Kind to convert . * @ return a client track kind identifier , or null if it could not be converted . */ private String trackKindToString ( final Track . Kind kind ) { } }
if ( kind == null ) { return null ; } switch ( kind ) { case SUBTITLES : return "subtitles" ; case CAPTIONS : return "captions" ; case DESCRIPTIONS : return "descriptions" ; case CHAPTERS : return "chapters" ; case METADATA : return "metadata" ; default : LOG . error ( "Unknown track kind " + kind ) ; return null ; }
public class MediaExceptionProcessor { /** * ( non - Javadoc ) * @ see * com . microsoft . windowsazure . services . media . entityoperations . EntityContract * # create ( com . microsoft . windowsazure . services . media . entityoperations . * EntityCreateOperation ) */ @ Override public < T > T create ( Entit...
try { return service . create ( creator ) ; } catch ( UniformInterfaceException e ) { throw processCatch ( new ServiceException ( e ) ) ; } catch ( ClientHandlerException e ) { throw processCatch ( new ServiceException ( e ) ) ; }
public class CPDefinitionLinkLocalServiceBaseImpl { /** * Deletes the cp definition link from the database . Also notifies the appropriate model listeners . * @ param cpDefinitionLink the cp definition link * @ return the cp definition link that was removed */ @ Indexable ( type = IndexableType . DELETE ) @ Overrid...
return cpDefinitionLinkPersistence . remove ( cpDefinitionLink ) ;
public class DescribeEcsClustersResult { /** * A list of < code > EcsCluster < / code > objects containing the cluster descriptions . * @ param ecsClusters * A list of < code > EcsCluster < / code > objects containing the cluster descriptions . */ public void setEcsClusters ( java . util . Collection < EcsCluster >...
if ( ecsClusters == null ) { this . ecsClusters = null ; return ; } this . ecsClusters = new com . amazonaws . internal . SdkInternalList < EcsCluster > ( ecsClusters ) ;
public class BitSetOrdinalIterator { /** * { @ inheritDoc } */ @ Override public int nextOrdinal ( ) { } }
if ( offset >>> 3 == reader . length ( ) ) return NO_MORE_ORDINALS ; skipToNextPopulatedByte ( ) ; while ( moreBytesToRead ( ) ) { if ( testCurrentBit ( ) ) { return offset ++ ; } offset ++ ; } return NO_MORE_ORDINALS ;
public class JpaDistributionSetManagement { /** * Method to get the latest distribution set based on DS ID after the * metadata changes for that distribution set . * @ param distId * of the DS to touch */ private JpaDistributionSet touch ( final Long distId ) { } }
return touch ( get ( distId ) . orElseThrow ( ( ) -> new EntityNotFoundException ( DistributionSet . class , distId ) ) ) ;
public class BingSpellCheckOperationsImpl { /** * The Bing Spell Check API lets you perform contextual grammar and spell checking . Bing has developed a web - based spell - checker that leverages machine learning and statistical machine translation to dynamically train a constantly evolving and highly contextual algori...
if ( text == null ) { throw new IllegalArgumentException ( "Parameter text is required and cannot be null." ) ; } final String xBingApisSDK = "true" ; return service . spellChecker ( xBingApisSDK , acceptLanguage , pragma , userAgent , clientId , clientIp , location , actionType , appName , countryCode , clientMachineN...
public class AOValue { /** * Returns the source meUuid this message is being requested from . ( Usually the local ME unless * gathering is taking place ) * Returns null if pre - WAS70 data * @ return */ public SIBUuid8 getSourceMEUuid ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getSourceMEUuid" ) ; SibTr . exit ( tc , "getSourceMEUuid" , sourceMEUuid ) ; } return sourceMEUuid ;
public class DefaultGrailsApplication { /** * Retrieves a class from the GrailsApplication for the given name . * @ param className The class name * @ return Either the Class instance or null if it doesn ' t exist */ public Class < ? > getClassForName ( String className ) { } }
if ( ! StringUtils . hasText ( className ) ) { return null ; } for ( Class < ? > c : allClasses ) { if ( c . getName ( ) . equals ( className ) ) { return c ; } } return null ;
public class AWSDirectoryServiceClient { /** * Removes the specified directory as a publisher to the specified SNS topic . * @ param deregisterEventTopicRequest * Removes the specified directory as a publisher to the specified SNS topic . * @ return Result of the DeregisterEventTopic operation returned by the ser...
request = beforeClientExecution ( request ) ; return executeDeregisterEventTopic ( request ) ;
public class Provisioner { /** * InstallStatus object and used in FFDC at a more appropriate time . */ public void installBundles ( final BundleContext bContext , final BundleList bundleList , final BundleInstallStatus installStatus , final int minStartLevel , final int defaultStartLevel , final int defaultInitialStart...
if ( bundleList == null || bundleList . isEmpty ( ) ) return ; final FrameworkWiring fwkWiring = featureManager . bundleContext . getBundle ( Constants . SYSTEM_BUNDLE_LOCATION ) . adapt ( FrameworkWiring . class ) ; final File bootFile = getBootJar ( ) ; bundleList . foreach ( new BundleList . FeatureResourceHandler (...
public class MapEventPublisherImpl { /** * Return { @ code true } if the { @ code filter } requires the entry * values ( old , new , merging ) to be included in the event . * @ throws IllegalArgumentException if the filter type is not known */ static boolean isIncludeValue ( EventFilter filter ) { } }
// the order of the following ifs is important ! // QueryEventFilter is instance of EntryEventFilter if ( filter instanceof EventListenerFilter ) { filter = ( ( EventListenerFilter ) filter ) . getEventFilter ( ) ; } if ( filter instanceof TrueEventFilter ) { return true ; } if ( filter instanceof QueryEventFilter ) { ...
public class ChunkTopicParser { /** * Append XML content into root element * @ param hrefValue href of the topicref * @ param parentResult XML content to insert into * @ param tmpContent XML content to insert */ private void insertAfter ( final URI hrefValue , final StringBuffer parentResult , final CharSequence ...
int insertpoint = parentResult . lastIndexOf ( "</" ) ; final int end = parentResult . indexOf ( ">" , insertpoint ) ; if ( insertpoint == - 1 || end == - 1 ) { logger . error ( MessageUtils . getMessage ( "DOTJ033E" , hrefValue . toString ( ) ) . toString ( ) ) ; } else { if ( ELEMENT_NAME_DITA . equals ( parentResult...
public class DefaultBrokerCache { /** * Get an object for the specified factory , key , scope , and broker . { @ link DefaultBrokerCache } * guarantees that calling this method for the same factory , key , and scope will return the same object . */ @ SuppressWarnings ( value = "unchecked" ) < T , K extends SharedReso...
SharedResourceFactory < T , K , S > currentFactory = factory ; K currentKey = key ; ScopeWrapper < S > currentScope = scope ; Object obj = getScopedFromCache ( currentFactory , currentKey , currentScope , broker ) ; // this loop is to continue looking up objects through redirection or reloading until a valid resource i...
public class MongodbQueue { /** * Insert / Update the message to collection . * @ param msg * @ return */ protected boolean upsertToCollection ( IQueueMessage < ID , DATA > msg ) { } }
getCollection ( ) . replaceOne ( Filters . eq ( COLLECTION_FIELD_ID , msg . getId ( ) ) , toDocument ( msg ) , REPLACE_OPTIONS ) ; return true ;
public class MemcachedHandler { /** * On receive message from memcached server */ @ Override public final void onMessageReceived ( final Session session , final Object msg ) { } }
Command command = ( Command ) msg ; if ( this . statisticsHandler . isStatistics ( ) ) { if ( command . getCopiedMergeCount ( ) > 0 && command instanceof MapReturnValueAware ) { Map < String , CachedData > returnValues = ( ( MapReturnValueAware ) command ) . getReturnValues ( ) ; int size = returnValues . size ( ) ; th...
public class CommercePriceListPersistenceImpl { /** * Returns the last commerce price list in the ordered set where groupId = & # 63 ; and status = & # 63 ; . * @ param groupId the group ID * @ param status the status * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / co...
int count = countByG_S ( groupId , status ) ; if ( count == 0 ) { return null ; } List < CommercePriceList > list = findByG_S ( groupId , status , count - 1 , count , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class NatsConnectionReader { /** * Gather the op , either up to the first space or the first carraige return . */ void gatherOp ( int maxPos ) throws IOException { } }
try { while ( this . bufferPosition < maxPos ) { byte b = this . buffer [ this . bufferPosition ] ; this . bufferPosition ++ ; if ( gotCR ) { if ( b == NatsConnection . LF ) { // Got CRLF , jump to parsing this . op = opFor ( opArray , opPos ) ; this . gotCR = false ; this . opPos = 0 ; this . mode = Mode . PARSE_PROTO...
public class PlannerReader { /** * This method extracts task data from a Planner file . * @ param plannerProject Root node of the Planner file */ private void readTasks ( Project plannerProject ) throws MPXJException { } }
Tasks tasks = plannerProject . getTasks ( ) ; if ( tasks != null ) { for ( net . sf . mpxj . planner . schema . Task task : tasks . getTask ( ) ) { readTask ( null , task ) ; } for ( net . sf . mpxj . planner . schema . Task task : tasks . getTask ( ) ) { readPredecessors ( task ) ; } } m_projectFile . updateStructure ...
public class QDate { /** * Calculates the month based on the day of the year . */ private void calculateMonth ( ) { } }
_dayOfMonth = _dayOfYear ; for ( _month = 0 ; _month < 12 ; _month ++ ) { if ( _month == 1 && _isLeapYear ) { if ( _dayOfMonth < 29 ) return ; else _dayOfMonth -= 29 ; } else if ( _dayOfMonth < DAYS_IN_MONTH [ ( int ) _month ] ) return ; else _dayOfMonth -= DAYS_IN_MONTH [ ( int ) _month ] ; }
public class TupleComparatorBase { /** * ScalaTupleComparator */ protected void privateDuplicate ( TupleComparatorBase < T > toClone ) { } }
// copy fields and serializer factories this . keyPositions = toClone . keyPositions ; this . serializers = new TypeSerializer [ toClone . serializers . length ] ; for ( int i = 0 ; i < toClone . serializers . length ; i ++ ) { this . serializers [ i ] = toClone . serializers [ i ] . duplicate ( ) ; } this . comparator...
public class DefaultFileIO { /** * Set whether file should be created if it does not exist . When this method is not invoked , * * bind operations will fail if the file does not exist . * @ return this to provide a fluent API . */ @ Override public FileIO failIfNotExists ( final boolean ... failOnFNF ) { } }
this . failIfNotExists = ( failOnFNF != null ) && ( ( failOnFNF . length == 0 ) || ( ( failOnFNF . length > 0 ) && failOnFNF [ 0 ] ) ) ; return this ;
public class CreateDocumentRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateDocumentRequest createDocumentRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createDocumentRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createDocumentRequest . getContent ( ) , CONTENT_BINDING ) ; protocolMarshaller . marshall ( createDocumentRequest . getAttachments ( ) , ATTACHMENTS_BINDING ) ; p...
public class SubtitleLineContentToHtmlBase { /** * TODO : write furigana separately on each kanji section */ private void appendRubyElements ( RendersnakeHtmlCanvas html , List < SubtitleItem . Inner > elements ) throws IOException { } }
for ( SubtitleItem . Inner element : elements ) { String kanji = element . getKanji ( ) ; if ( kanji != null ) { html . ruby ( ) ; html . spanKanji ( kanji ) ; html . rt ( element . getText ( ) ) ; html . _ruby ( ) ; } else { html . write ( element . getText ( ) ) ; } }
public class PartialResponseWriter { /** * < p class = " changed _ added _ 2_0 " > Write the end of an update operation . < / p > * @ throws IOException if an input / output error occurs * @ since 2.0 */ public void endUpdate ( ) throws IOException { } }
ResponseWriter writer = getWrapped ( ) ; writer . endCDATA ( ) ; writer . endElement ( "update" ) ; inUpdate = false ;
public class ZkConnection { /** * 仅供内部测试使用 */ public static void start ( String connectionStr ) { } }
synchronized ( zkConnectionStartStopLock ) { if ( connected . get ( ) ) { LOG . info ( "zkConnection已经启动,不再重复启动" ) ; return ; } try { RetryPolicy retryPolicy = new ExponentialBackoffRetry ( 1000 , 3 ) ; client = CuratorFrameworkFactory . newClient ( connectionStr , retryPolicy ) ; client . start ( ) ; LOG . info ( "阻塞直...
public class XMLUtils { /** * Returns Apache Solr add command . * @ param values * values to include * @ return XML as String */ public static String getSolrAddDocument ( Map < String , String > values ) { } }
StringBuilder builder = new StringBuilder ( ) ; builder . append ( "<add><doc>" ) ; for ( Map . Entry < String , String > pair : values . entrySet ( ) ) { XMLUtils . addSolrField ( builder , pair ) ; } builder . append ( "</doc></add>" ) ; return builder . toString ( ) ;
public class FileListener { /** * Decode and read this field from the stream . * Will create a new field , init it and set the data if the field is not passed in . * @ param daIn The input stream to unmarshal the data from . * @ param fldCurrent The field to unmarshall the data into ( optional ) . */ public BaseF...
String strFieldName = daIn . readUTF ( ) ; Object objData = daIn . readObject ( ) ; if ( fldCurrent == null ) if ( strFieldName . length ( ) > 0 ) { fldCurrent = ( BaseField ) ClassServiceUtility . getClassService ( ) . makeObjectFromClassName ( strFieldName ) ; if ( fldCurrent != null ) { fldCurrent . init ( null , nu...
public class BridgeManager { /** * Events */ @ Override public void onReceive ( Object message ) throws Exception { } }
final Class < ? > klass = message . getClass ( ) ; final ActorRef self = self ( ) ; final ActorRef sender = sender ( ) ; if ( CreateBridge . class . equals ( klass ) ) { onCreateBridge ( ( CreateBridge ) message , self , sender ) ; } else if ( BridgeStateChanged . class . equals ( klass ) ) { onBridgeStateChanged ( ( B...
public class MaintenanceWindowLayout { /** * Text field to specify the schedule . */ private void createMaintenanceScheduleControl ( ) { } }
schedule = new TextFieldBuilder ( Action . MAINTENANCE_WINDOW_SCHEDULE_LENGTH ) . id ( UIComponentIdProvider . MAINTENANCE_WINDOW_SCHEDULE_ID ) . caption ( i18n . getMessage ( "caption.maintenancewindow.schedule" ) ) . validator ( new CronValidator ( ) ) . prompt ( "0 0 3 ? * 6" ) . required ( true , i18n ) . buildText...
public class TreeIterable { /** * Creates an { @ code Iterable } that starts at { @ code node } and iterates deeper into the tree in a depth - first order . */ public static < T > Iterable < T > depthFirst ( TreeDef < T > treeDef , T node ) { } }
return ( ) -> new Iterator < T > ( ) { Deque < T > queue = new ArrayDeque < > ( Arrays . asList ( node ) ) ; @ Override public boolean hasNext ( ) { return ! queue . isEmpty ( ) ; } @ Override public T next ( ) { if ( queue . isEmpty ( ) ) { throw new NoSuchElementException ( ) ; } T next = queue . removeLast ( ) ; Lis...
public class UpdateUtils { /** * Update a destination file with an updater implementation , while maintaining appropriate * locks around the action and file * @ param updater updater * @ param destFile destination * @ throws UpdateException on error */ public static void update ( final FileUpdater updater , fin...
final File lockFile = new File ( destFile . getAbsolutePath ( ) + ".lock" ) ; final File newDestFile = new File ( destFile . getAbsolutePath ( ) + ".new" ) ; try { // synchronize writing to file within this jvm synchronized ( UpdateUtils . class ) { final FileChannel channel = new RandomAccessFile ( lockFile , "rw" ) ....
public class AbstractResultSetWrapper { /** * { @ inheritDoc } * @ see java . sql . ResultSet # updateString ( java . lang . String , java . lang . String ) */ @ Override public void updateString ( final String columnLabel , final String x ) throws SQLException { } }
wrapped . updateString ( columnLabel , x ) ;
public class CmsPreferences { /** * Returns the values of all parameter methods of this workplace class instance . < p > * This overwrites the super method because of the possible dynamic editor selection entries . < p > * @ return the values of all parameter methods of this workplace class instance * @ see org ....
Map < String , Object > map = super . paramValues ( ) ; HttpServletRequest request = getJsp ( ) . getRequest ( ) ; Enumeration < ? > en = request . getParameterNames ( ) ; while ( en . hasMoreElements ( ) ) { String paramName = ( String ) en . nextElement ( ) ; if ( paramName . startsWith ( PARAM_PREFERREDEDITOR_PREFIX...
public class ProxyDataSourceBuilder { /** * Register { @ link SystemOutSlowQueryListener } . * @ return builder * @ since 1.4.1 */ public ProxyDataSourceBuilder logSlowQueryToSysOut ( long thresholdTime , TimeUnit timeUnit ) { } }
this . createSysOutSlowQueryListener = true ; this . slowQueryThreshold = thresholdTime ; this . slowQueryTimeUnit = timeUnit ; return this ;
public class AreaConversions { /** * Convert an area . * @ param a The area * @ param < S > A phantom type parameter indicating the coordinate space of the * area * @ return An area */ public static < S > PAreaL < S > toPAreaL ( final AreaL a ) { } }
Objects . requireNonNull ( a , "area" ) ; return PAreaL . of ( a . minimumX ( ) , a . maximumX ( ) , a . minimumY ( ) , a . maximumY ( ) ) ;
public class ImageTransformationPanel { /** * This method is called from within the constructor to * initialize the form . * WARNING : Do NOT modify this code . The content of this method is * always regenerated by the Form Editor . */ @ SuppressWarnings ( "unchecked" ) // < editor - fold defaultstate = " collaps...
setDoubleBuffered ( false ) ; setOpaque ( false ) ; addComponentListener ( new java . awt . event . ComponentAdapter ( ) { public void componentResized ( java . awt . event . ComponentEvent evt ) { formComponentResized ( evt ) ; } } ) ; javax . swing . GroupLayout layout = new javax . swing . GroupLayout ( this ) ; thi...
public class PlaybackService { /** * Pause the playback . */ private void pause ( ) { } }
if ( mHasAlreadyPlayed && ! mIsPaused ) { mIsPaused = true ; if ( ! mIsPreparing ) { mMediaPlayer . pause ( ) ; } // broadcast event Intent intent = new Intent ( PlaybackListener . ACTION_ON_PLAYER_PAUSED ) ; mLocalBroadcastManager . sendBroadcast ( intent ) ; updateNotification ( ) ; mMediaSession . setPlaybackState (...
public class AudioNormalizationSettingsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AudioNormalizationSettings audioNormalizationSettings , ProtocolMarshaller protocolMarshaller ) { } }
if ( audioNormalizationSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( audioNormalizationSettings . getAlgorithm ( ) , ALGORITHM_BINDING ) ; protocolMarshaller . marshall ( audioNormalizationSettings . getAlgorithmControl ( ) , A...
public class AbstractWComponent { /** * { @ inheritDoc } */ @ Override public void setAccessibleText ( final String text , final Serializable ... args ) { } }
ComponentModel model = getOrCreateComponentModel ( ) ; model . setAccessibleText ( text , args ) ;
public class JacksonJsonFunction { /** * using toJson ( ) function */ private static void selectToJson ( CqlSession session ) { } }
Statement stmt = selectFrom ( "examples" , "json_jackson_function" ) . column ( "id" ) . function ( "toJson" , Selector . column ( "user" ) ) . as ( "user" ) . function ( "toJson" , Selector . column ( "scores" ) ) . as ( "scores" ) . whereColumn ( "id" ) . in ( literal ( 1 ) , literal ( 2 ) ) . build ( ) ; System . ou...
public class Analysis { /** * while 循环调用 . 直到返回为null则分词结束 * @ return * @ throws IOException */ public Term next ( ) throws IOException { } }
Term term = null ; if ( ! terms . isEmpty ( ) ) { term = terms . poll ( ) ; term . updateOffe ( offe ) ; return term ; } String temp = br . readLine ( ) ; while ( StringUtil . isBlank ( temp ) ) { if ( temp == null ) { offe = br . getStart ( ) ; return null ; } else { temp = br . readLine ( ) ; } } offe = br . getStart...
public class forwardingsession { /** * Use this API to update forwardingsession resources . */ public static base_responses update ( nitro_service client , forwardingsession resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { forwardingsession updateresources [ ] = new forwardingsession [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new forwardingsession ( ) ; updateresources [ i ] . name = resources [ i ...
public class Node { /** * Merges the line number and character number in one integer . The Character * number takes the first 12 bits and the line number takes the rest . If * the character number is greater than < code > 2 < sup > 12 < / sup > - 1 < / code > it is * adjusted to < code > 2 < sup > 12 < / sup > - ...
if ( lineno < 0 || charno < 0 ) { return - 1 ; } else if ( ( charno & ~ COLUMN_MASK ) != 0 ) { return lineno << COLUMN_BITS | COLUMN_MASK ; } else { return lineno << COLUMN_BITS | ( charno & COLUMN_MASK ) ; }
public class StreamletUtils { /** * Verifies not blank text as the utility function . * @ param text The text to verify * @ param errorMessage The error message * @ throws IllegalArgumentException if the requirement fails */ public static String checkNotBlank ( String text , String errorMessage ) { } }
if ( StringUtils . isBlank ( text ) ) { throw new IllegalArgumentException ( errorMessage ) ; } else { return text ; }
public class DeAromatizationTool { /** * Methods that takes a ring of which all bonds are aromatic , and assigns single * and double bonds . It does this in a non - general way by looking at the ring * size and take everything as a special case . * @ param ring Ring to dearomatize * @ return False if it could n...
boolean allaromatic = true ; for ( int i = 0 ; i < ring . getBondCount ( ) ; i ++ ) { if ( ! ring . getBond ( i ) . getFlag ( CDKConstants . ISAROMATIC ) ) allaromatic = false ; } if ( ! allaromatic ) return false ; for ( int i = 0 ; i < ring . getBondCount ( ) ; i ++ ) { if ( ring . getBond ( i ) . getFlag ( CDKConsta...
public class MnistManager { /** * Writes the given image in the given file using the PPM data format . * @ param image * @ param ppmFileName * @ throws java . io . IOException */ public static void writeImageToPpm ( int [ ] [ ] image , String ppmFileName ) throws IOException { } }
try ( BufferedWriter ppmOut = new BufferedWriter ( new FileWriter ( ppmFileName ) ) ) { int rows = image . length ; int cols = image [ 0 ] . length ; ppmOut . write ( "P3\n" ) ; ppmOut . write ( "" + rows + " " + cols + " 255\n" ) ; for ( int [ ] anImage : image ) { StringBuilder s = new StringBuilder ( ) ; for ( int j...
public class Region { /** * 华南机房相关域名 */ public static Region region2 ( ) { } }
return new Builder ( ) . region ( "z2" ) . srcUpHost ( "up-z2.qiniup.com" , "up-dg.qiniup.com" , "up-fs.qiniup.com" ) . accUpHost ( "upload-z2.qiniup.com" , "upload-dg.qiniup.com" , "upload-fs.qiniup.com" ) . iovipHost ( "iovip-z2.qbox.me" ) . rsHost ( "rs-z2.qbox.me" ) . rsfHost ( "rsf-z2.qbox.me" ) . apiHost ( "api-z...
public class SolutionUtils { /** * Return the best solution between those passed as arguments . If they are equal or incomparable * one of them is chosen randomly . * @ param randomGenerator { @ link RandomGenerator } for the equality case * @ return The best solution */ public static < S extends Solution < ? > >...
return getBestSolution ( solution1 , solution2 , comparator , ( a , b ) -> randomGenerator . getRandomValue ( ) < 0.5 ? a : b ) ;
public class Observation { /** * Determines moments ( probabilistic measure ) of all degrees specified by { @ link # momentDegrees } . * Moments are characteristics of random variables ( in this case relating to the inserted values ) * < ul > * < li > 2nd moment : variance < / li > * < li > 3rd moment : skewnes...
moments . clear ( ) ; for ( Integer i : momentDegrees ) moments . put ( i , 0.0 ) ; for ( Double d : insertStat . keySet ( ) ) { for ( int j : momentDegrees ) moments . put ( j , moments . get ( j ) + Math . pow ( d - expectation , j ) * ( insertStat . get ( d ) / observationCount ) ) ; }
public class XmlUtil { /** * object - > xml * @ param object * @ param childClass */ public static String marshal ( Object object ) { } }
if ( object == null ) { return null ; } try { JAXBContext jaxbCtx = JAXBContext . newInstance ( object . getClass ( ) ) ; Marshaller marshaller = jaxbCtx . createMarshaller ( ) ; marshaller . setProperty ( Marshaller . JAXB_FRAGMENT , Boolean . TRUE ) ; StringWriter sw = new StringWriter ( ) ; marshaller . marshal ( ob...
public class MapPolygon { /** * Replies the distance between this figure and the specified point . * @ param point is the x - coordinate of the point . * @ param width is the width of the polygon . * @ return the computed distance */ @ Pure public double distance ( Point2D < ? , ? > point , double width ) { } }
double mind = Double . MAX_VALUE ; double dist ; final Point2d pts1 = new Point2d ( ) ; final Point2d pts2 = new Point2d ( ) ; double w = width ; w = Math . abs ( w ) / 2. ; for ( final PointGroup grp : groups ( ) ) { for ( int idx = 0 ; idx < grp . size ( ) ; idx += 2 ) { if ( grp . getMany ( idx , pts1 , pts2 ) > 1 )...
public class RtfDocumentSettings { /** * Converts protection level from internal bitmap value to protlevel output value . * Author : Howard Shank ( hgshank @ yahoo . com ) * @ return < pre > * 0 = Revision protection * 1 = Annotation / Comment protection * 2 = Form protection * 3 = Read only protection * ...
int level = 0 ; switch ( this . protectionLevel ) { case RtfProtection . LEVEL_NONE : break ; case RtfProtection . LEVEL_REVPROT : level = 0 ; break ; case RtfProtection . LEVEL_ANNOTPROT : level = 1 ; break ; case RtfProtection . LEVEL_FORMPROT : level = 2 ; break ; case RtfProtection . LEVEL_READPROT : level = 3 ; br...
public class Crypto { /** * Encrypt data with TLS certificate and convert cipher to base64 * @ param data * byte array to encrypt * @ return cipher in base64 * @ throws NoSuchAlgorithmException * NoSuchAlgorithmException * @ throws NoSuchProviderException * NoSuchProviderException * @ throws NoSuchPaddi...
byte [ ] cipher = encryptBytes ( data ) ; return Base64 . toBase64String ( cipher ) ;
public class DefaultComponentFactory { /** * ( non - Javadoc ) * @ see org . springframework . richclient . factory . ComponentFactory # createRadioButton ( java . lang . String ) */ public JRadioButton createRadioButton ( String labelKey ) { } }
return ( JRadioButton ) getButtonLabelInfo ( getRequiredMessage ( labelKey ) ) . configure ( createNewRadioButton ( ) ) ;
public class AbstractJpaEventStore { /** * Tries to find a serializer for the given type of object and converts it * into a storable data block . * @ param type * Type of event . * @ param data * Event of the given type . * @ return Event ready to persist . */ protected final SerializedData serialize ( fina...
return EscSpiUtils . serialize ( serRegistry , type , data ) ;
public class SystemConfig { /** * Inicializa la configuracion . */ private void init ( ) throws ConfigFileIOException { } }
this . props = new Properties ( ) ; log . info ( "Reading config file: {}" , this . configFile ) ; boolean ok = true ; try { // El fichero esta en el CLASSPATH this . props . load ( SystemConfig . class . getResourceAsStream ( this . configFile ) ) ; } catch ( Exception e ) { log . warn ( "File not found in the Classpa...
public class GetResourcesResult { /** * The folders in the specified folder . * @ param folders * The folders in the specified folder . */ public void setFolders ( java . util . Collection < FolderMetadata > folders ) { } }
if ( folders == null ) { this . folders = null ; return ; } this . folders = new java . util . ArrayList < FolderMetadata > ( folders ) ;
public class Base64Coder { /** * Converts a String to a byte array by using UTF - 8 character sets . * This code is needed even converting US - ASCII characters since there are some character sets which are not compatible with US - ASCII code area . * For example , CP - 1399 , which is z / OS Japanese EBCDIC charac...
byte output [ ] = null ; try { if ( input != null ) { output = input . getBytes ( "UTF-8" ) ; } } catch ( UnsupportedEncodingException e ) { // This should not happen . // If it happens , it would be some runtime or operating system issue , so just give up and return null . // ffdc data will be logged automatically . }...
public class NumberFormatContext { /** * Convert the given value to a { @ link Float } . If the value is not in a * valid numeric format , then a default value is returned . * @ param value The value to convert * @ return The converted numeric value * @ see # isFloat ( String ) * @ see Float # valueOf ( Strin...
Float result ; try { result = Float . valueOf ( value ) ; } catch ( NumberFormatException e ) { result = DEFAULT_FLOAT_VALUE ; } return result ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcExternallyDefinedSymbol ( ) { } }
if ( ifcExternallyDefinedSymbolEClass == null ) { ifcExternallyDefinedSymbolEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 217 ) ; } return ifcExternallyDefinedSymbolEClass ;
public class Webcam { /** * Reset webcam driver . < br > * < br > * < b > This method is not thread - safe ! < / b > */ public static void resetDriver ( ) { } }
synchronized ( DRIVERS_LIST ) { DRIVERS_LIST . clear ( ) ; } if ( discovery != null ) { discovery . shutdown ( ) ; discovery = null ; } driver = null ;
public class ExtractFunctionExecutor { /** * 删除指定的文本 使用方法 : removeText ( 作者 : ) 括号内的参数为文本字符 , 从CSS路径匹配的文本中删除参数文本 * @ param text CSS路径抽取出来的文本 * @ param parseExpression 抽取函数 * @ return 抽取函数处理之后的文本 */ public static String executeRemoveText ( String text , String parseExpression ) { } }
LOGGER . debug ( "removeText抽取函数之前:" + text ) ; String parameter = parseExpression . replace ( "removeText(" , "" ) ; parameter = parameter . substring ( 0 , parameter . length ( ) - 1 ) ; text = text . replace ( parameter , "" ) ; LOGGER . debug ( "removeText抽取函数之后:" + text ) ; return text ;
public class HttpFields { /** * Adds the value of a date field . * @ param name the field name * @ param date the field date value */ public void addDateField ( String name , long date ) { } }
if ( _dateBuffer == null ) { _dateBuffer = new StringBuffer ( 32 ) ; _calendar = new HttpCal ( ) ; } _dateBuffer . setLength ( 0 ) ; _calendar . setTimeInMillis ( date ) ; formatDate ( _dateBuffer , _calendar , false ) ; add ( name , _dateBuffer . toString ( ) ) ;
public class TECore { /** * Submits a request to some HTTP endpoint using the given request details . * @ param xml * An ctl : request element . * @ return A URLConnection object representing an open communications link . * @ throws Exception * If any error occurs while submitting the request or * establish...
Node body = null ; ArrayList < String [ ] > headers = new ArrayList < String [ ] > ( ) ; ArrayList < Node > parts = new ArrayList < Node > ( ) ; String sUrl = null ; String sParams = "" ; String method = "GET" ; String charset = "UTF-8" ; boolean multipart = false ; // Read in the test information ( from CTL ) NodeList...
public class PersonDirectoryPrincipalResolver { /** * Retrieve person attributes map . * @ param principalId the principal id * @ param credential the credential whose id we have extracted . This is passed so that implementations * can extract useful bits of authN info such as attributes into the principal . * ...
return CoreAuthenticationUtils . retrieveAttributesFromAttributeRepository ( this . attributeRepository , principalId , activeAttributeRepositoryIdentifiers ) ;
public class Collectors { /** * Use occurrences to save the count of largest objects if { @ code areAllSmallestSame = true } ( e . g . { @ code Number / String / . . . } ) and return a list by repeat the smallest object { @ code n } times . * @ param areAllSmallestSame * @ return * @ see Collectors # maxAll ( Com...
return minAll ( Integer . MAX_VALUE , areAllSmallestSame ) ;
public class BPSImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . BPS__PSEG_NAME : setPsegName ( PSEG_NAME_EDEFAULT ) ; return ; case AfplibPackage . BPS__TRIPLETS : getTriplets ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ;
public class LogsSummaryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LogsSummary logsSummary , ProtocolMarshaller protocolMarshaller ) { } }
if ( logsSummary == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( logsSummary . getAudit ( ) , AUDIT_BINDING ) ; protocolMarshaller . marshall ( logsSummary . getAuditLogGroup ( ) , AUDITLOGGROUP_BINDING ) ; protocolMarshaller . marshall (...
public class KeyPairFactory { /** * Factory method for creating a new { @ link KeyPairGenerator } from the given parameters . * @ param algorithm * the algorithm * @ param keySize * the key size * @ return the new { @ link KeyPairGenerator } from the given parameters * @ throws NoSuchAlgorithmException * ...
KeyPairGenerator generator ; if ( "EC" . equals ( algorithm ) ) { generator = KeyPairGenerator . getInstance ( algorithm , "BC" ) ; } else { generator = KeyPairGenerator . getInstance ( algorithm ) ; generator . initialize ( keySize ) ; } return generator ;
public class ChronoEntity { /** * < p > Liefert den Selbstbezug . < / p > * @ return time context ( usually this instance ) */ protected T getContext ( ) { } }
Chronology < T > c = this . getChronology ( ) ; Class < T > type = c . getChronoType ( ) ; if ( type . isInstance ( this ) ) { return type . cast ( this ) ; } else { for ( ChronoElement < ? > element : c . getRegisteredElements ( ) ) { if ( type == element . getType ( ) ) { return type . cast ( this . get ( element ) )...
public class PublicIpv4Pool { /** * The address ranges . * @ return The address ranges . */ public java . util . List < PublicIpv4PoolRange > getPoolAddressRanges ( ) { } }
if ( poolAddressRanges == null ) { poolAddressRanges = new com . amazonaws . internal . SdkInternalList < PublicIpv4PoolRange > ( ) ; } return poolAddressRanges ;
public class SimpleHadoopFilesystemConfigStore { /** * Retrieves the dataset dir on HDFS associated with the given { @ link ConfigKeyPath } and the given version . This * directory contains the { @ link # MAIN _ CONF _ FILE _ NAME } and { @ link # INCLUDES _ CONF _ FILE _ NAME } file , as well as any child * datase...
String datasetFromConfigKey = getDatasetFromConfigKey ( configKey ) ; if ( StringUtils . isBlank ( datasetFromConfigKey ) ) { return getVersionRoot ( version ) ; } return new Path ( getVersionRoot ( version ) , datasetFromConfigKey ) ;
public class SequenceConverter { /** * method to read a rna / dna sequence and generate a HELM2Notation object of * it * @ param notation rna / dna sequence * @ return HELM2Notation object * @ throws FastaFormatException * if the rna / dna sequence is not in the right format * @ throws NotationException *...
HELM2Notation helm2notation = new HELM2Notation ( ) ; PolymerNotation polymer = new PolymerNotation ( "RNA1" ) ; if ( ! ( FastaFormat . isNormalDirection ( notation ) ) ) { String annotation = "3'-5'" ; helm2notation . addPolymer ( new PolymerNotation ( polymer . getPolymerID ( ) , FastaFormat . generateElementsforRNA ...
public class KTypeArrayDeque { /** * Ensures the internal buffer has enough free slots to store * < code > expectedAdditions < / code > . Increases internal buffer size if needed . */ protected void ensureBufferSpace ( int expectedAdditions ) { } }
final int bufferLen = buffer . length ; final int elementsCount = size ( ) ; if ( elementsCount + expectedAdditions >= bufferLen ) { final int emptySlot = 1 ; // deque invariant : always an empty slot . final int newSize = resizer . grow ( bufferLen , elementsCount + emptySlot , expectedAdditions ) ; assert newSize >= ...
public class CLI { /** * Create a simulation object . * @ param script the script * @ param groovy * @ param ll * @ return the simulation object . */ public static Object createSim ( String script , boolean groovy , String ll ) throws Exception { } }
setOMSProperties ( ) ; Level . parse ( ll ) ; // may throw IAE String prefix = groovy ? "" : "import static oms3.SimConst.*\n" + "def __sb__ = new oms3.SimBuilder(logging:'" + ll + "')\n" + "__sb__." ; ClassLoader parent = Thread . currentThread ( ) . getContextClassLoader ( ) ; Binding b = new Binding ( ) ; b . setVar...
public class JDBCDatabaseMetaData { /** * # ifdef JAVA4 */ public ResultSet getSuperTypes ( String catalog , String schemaPattern , String typeNamePattern ) throws SQLException { } }
if ( wantsIsNull ( typeNamePattern ) ) { return executeSelect ( "SYSTEM_SUPERTYPES" , "0=1" ) ; } schemaPattern = translateSchema ( schemaPattern ) ; StringBuffer select = toQueryPrefixNoSelect ( "SELECT * FROM (SELECT USER_DEFINED_TYPE_CATALOG, USER_DEFINED_TYPE_SCHEMA, USER_DEFINED_TYPE_NAME," + "CAST (NULL AS INFORM...
public class LogbackAdapter { /** * { @ inheritDoc } */ @ Override public void error ( final MessageItem messageItem ) { } }
getLogger ( ) . log ( messageItem . getMarker ( ) , FQCN , LocationAwareLogger . ERROR_INT , messageItem . getText ( ) , null , null ) ; throwError ( messageItem , null ) ;
public class JSON { /** * parse json * @ param reader json source . * @ param type target type . * @ return result . * @ throws IOException * @ throws ParseException */ @ SuppressWarnings ( "unchecked" ) public static < T > T parse ( Reader reader , Class < T > type , Converter < Object , Map < String , Objec...
return ( T ) parse ( reader , new JSONVisitor ( type , new JSONValue ( mc ) , mc ) , JSONToken . ANY ) ;
public class ObjectsApi { /** * Get Skills . * Get Skills from Configuration Server with the specified filters . * @ param searchParams object containing remaining search parameters ( limit , offset , searchTerm , searchKey , matchMethod , sortKey , sortAscending , sortMethod ) . * @ param inUse Specifies whether...
return searchSkills ( searchParams . getLimit ( ) , searchParams . getOffset ( ) , searchParams . getSearchTerm ( ) , searchParams . getSearchKey ( ) , searchParams . getMatchMethod ( ) , searchParams . getSortKey ( ) , searchParams . getSortAscending ( ) , searchParams . getSortMethod ( ) , inUse ) ;
public class AccountsInner { /** * Creates the specified Data Lake Store account . * @ param resourceGroupName The name of the Azure resource group . * @ param accountName The name of the Data Lake Store account . * @ param parameters Parameters supplied to create the Data Lake Store account . * @ throws Illega...
return createWithServiceResponseAsync ( resourceGroupName , accountName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class DataLabelingServiceClient { /** * Lists annotation spec sets for a project . Pagination is supported . * < p > Sample code : * < pre > < code > * try ( DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient . create ( ) ) { * String formattedParent = DataLabelingServiceClie...
PROJECT_PATH_TEMPLATE . validate ( parent , "listAnnotationSpecSets" ) ; ListAnnotationSpecSetsRequest request = ListAnnotationSpecSetsRequest . newBuilder ( ) . setParent ( parent ) . setFilter ( filter ) . build ( ) ; return listAnnotationSpecSets ( request ) ;
public class LZ4Factory { /** * Returns a { @ link LZ4Compressor } which requires more memory than * { @ link # fastCompressor ( ) } and is slower but compresses more efficiently . * The compression level can be customized . * < p > For current implementations , the following is true about compression level : < o...
if ( compressionLevel > MAX_COMPRESSION_LEVEL ) { compressionLevel = MAX_COMPRESSION_LEVEL ; } else if ( compressionLevel < 1 ) { compressionLevel = DEFAULT_COMPRESSION_LEVEL ; } return highCompressors [ compressionLevel ] ;
public class Memoize { /** * Creates a new closure delegating to the supplied one and memoizing all return values by the arguments . * The memoizing closure will use SoftReferences to remember the return values allowing the garbage collector * to reclaim the memory , if needed . * The supplied cache is used to st...
final ProtectionStorage lruProtectionStorage = protectedCacheSize > 0 ? new LRUProtectionStorage ( protectedCacheSize ) : new NullProtectionStorage ( ) ; // Nothing should be done when no elements need protection against eviction final ReferenceQueue queue = new ReferenceQueue ( ) ; return new SoftReferenceMemoizeFunct...
public class ResendContactReachabilityEmailRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ResendContactReachabilityEmailRequest resendContactReachabilityEmailRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( resendContactReachabilityEmailRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resendContactReachabilityEmailRequest . getDomainName ( ) , DOMAINNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable...
public class Hyperalgo { /** * Runs the inside algorithm on a hypergraph . * @ param graph The hypergraph . * @ return The beta value for each Hypernode . Where beta [ i ] is the inside * score for the i ' th node in the Hypergraph , graph . getNodes ( ) . get ( i ) . */ public static double [ ] insideAlgorithm (...
final int n = graph . getNodes ( ) . size ( ) ; final double [ ] beta = new double [ n ] ; // \ beta _ i = 0 \ forall i Arrays . fill ( beta , s . zero ( ) ) ; graph . applyTopoSort ( new HyperedgeFn ( ) { @ Override public void apply ( Hyperedge e ) { // \ beta _ { H ( e ) } + = w _ e \ prod _ { j \ in T ( e ) } \ bet...
public class NumberingSystem { /** * Factory method for creating a numbering system . * @ param name _ in The string representing the name of the numbering system . * @ param radix _ in The radix for this numbering system . ICU currently * supports only numbering systems whose radix is 10. * @ param isAlgorithm...
if ( radix_in < 2 ) { throw new IllegalArgumentException ( "Invalid radix for numbering system" ) ; } if ( ! isAlgorithmic_in ) { if ( desc_in . length ( ) != radix_in || ! isValidDigitString ( desc_in ) ) { throw new IllegalArgumentException ( "Invalid digit string for numbering system" ) ; } } NumberingSystem ns = ne...
public class DefaultPolicyGenerator { /** * Connects to a DuraCloud instance as root */ private ContentStoreManager connectToDuraCloud ( String account , String rootPass ) throws ContentStoreException { } }
String host = account + DURACLOUD_URL_SUFFIX ; ContentStoreManager storeManager = new ContentStoreManagerImpl ( host , DURACLOUD_PORT ) ; Credential credential = new Credential ( DURACLOUD_ROOT_USER , rootPass ) ; storeManager . login ( credential ) ; return storeManager ;
public class EventCMLHandler { /** * Procedure required by the CDOInterface . This function is only * supposed to be called by the JCFL library */ public void setObjectProperty ( String objectType , String propertyType , String propertyValue ) { } }
logger . debug ( "objectType: " + objectType ) ; logger . debug ( "propType: " + propertyType ) ; logger . debug ( "property: " + propertyValue ) ; if ( objectType == null ) { logger . error ( "Cannot add property for null object" ) ; return ; } if ( propertyType == null ) { logger . error ( "Cannot add property for nu...
public class Patterns { /** * Adapts a regular expression pattern to a { @ link Pattern } . * < p > < em > WARNING < / em > : in addition to regular expression cost , the returned { @ code Pattern } object needs * to make a substring copy every time it ' s evaluated . This can incur excessive copying and memory ove...
return new Pattern ( ) { @ Override public int match ( CharSequence src , int begin , int end ) { if ( begin > end ) return MISMATCH ; Matcher matcher = p . matcher ( src . subSequence ( begin , end ) ) ; if ( matcher . lookingAt ( ) ) return matcher . end ( ) ; return MISMATCH ; } } ;
public class SolrResultPage { /** * ( non - Javadoc ) * @ see org . springframework . data . solr . core . query . result . SpellcheckQueryResult # getAlternatives ( ) */ @ Override public Collection < Alternative > getAlternatives ( ) { } }
List < Alternative > allSuggestions = new ArrayList < > ( ) ; for ( List < Alternative > suggestions : this . suggestions . values ( ) ) { allSuggestions . addAll ( suggestions ) ; } return allSuggestions ;