idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
1,200 | public void setShortAttribute ( String name , Short value ) { ensureValue ( ) ; Attribute attribute = new ShortAttribute ( value ) ; attribute . setEditable ( isEditable ( name ) ) ; getValue ( ) . getAllAttributes ( ) . put ( name , attribute ) ; } | Sets the specified short attribute to the specified value . | 62 | 11 |
1,201 | public boolean load ( ) { _load ( ) ; java . util . Iterator it = this . alChildren . iterator ( ) ; while ( it . hasNext ( ) ) { Object o = it . next ( ) ; if ( o instanceof OjbMetaTreeNode ) ( ( OjbMetaTreeNode ) o ) . load ( ) ; } return true ; } | Recursively loads the metadata for this node | 80 | 9 |
1,202 | @ Deprecated @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public Map < String , PrimitiveAttribute < ? > > getAttributes ( ) { if ( ! isPrimitiveOnly ( ) ) { throw new UnsupportedOperationException ( "Primitive API not supported for nested association values" ) ; } return ( Map ) attributes ; } | Get the primitive attributes for the associated object . | 78 | 9 |
1,203 | @ Deprecated @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public void setAttributes ( Map < String , PrimitiveAttribute < ? > > attributes ) { if ( ! isPrimitiveOnly ( ) ) { throw new UnsupportedOperationException ( "Primitive API not supported for nested association values" ) ; } this . attributes = ( Map ) att... | Set the attributes for the associated object . | 83 | 8 |
1,204 | public Object getAttributeValue ( String attributeName ) { Attribute attribute = getAllAttributes ( ) . get ( attributeName ) ; if ( attribute != null ) { return attribute . getValue ( ) ; } return null ; } | Convenience method that returns the attribute value for the specified attribute name . | 47 | 15 |
1,205 | public void setDateAttribute ( String name , Date value ) { ensureAttributes ( ) ; Attribute attribute = new DateAttribute ( value ) ; attribute . setEditable ( isEditable ( name ) ) ; getAllAttributes ( ) . put ( name , attribute ) ; } | Sets the specified date attribute to the specified value . | 57 | 11 |
1,206 | public void setDoubleAttribute ( String name , Double value ) { ensureAttributes ( ) ; Attribute attribute = new DoubleAttribute ( value ) ; attribute . setEditable ( isEditable ( name ) ) ; getAllAttributes ( ) . put ( name , attribute ) ; } | Sets the specified double attribute to the specified value . | 57 | 11 |
1,207 | public void setManyToOneAttribute ( String name , AssociationValue value ) { ensureAttributes ( ) ; Attribute attribute = new ManyToOneAttribute ( value ) ; attribute . setEditable ( isEditable ( name ) ) ; getAllAttributes ( ) . put ( name , attribute ) ; } | Sets the specified many - to - one attribute to the specified value . | 62 | 15 |
1,208 | protected void addImage ( PdfContext context , ImageResult imageResult ) throws BadElementException , IOException { Bbox imageBounds = imageResult . getRasterImage ( ) . getBounds ( ) ; float scaleFactor = ( float ) ( 72 / getMap ( ) . getRasterResolution ( ) ) ; float width = ( float ) imageBounds . getWidth ( ) * sca... | Add image in the document . | 331 | 6 |
1,209 | protected void addLoadError ( PdfContext context , ImageException e ) { Bbox imageBounds = e . getRasterImage ( ) . getBounds ( ) ; float scaleFactor = ( float ) ( 72 / getMap ( ) . getRasterResolution ( ) ) ; float width = ( float ) imageBounds . getWidth ( ) * scaleFactor ; float height = ( float ) imageBounds . getH... | Add image with a exception message in the PDF document . | 461 | 11 |
1,210 | public void doLocalClear ( ) { if ( log . isDebugEnabled ( ) ) log . debug ( "Clear materialization cache" ) ; invokeCounter = 0 ; enabledReadCache = false ; objectBuffer . clear ( ) ; } | Clears the internal used cache for object materialization . | 49 | 11 |
1,211 | @ AfterThrowing ( pointcut = "execution(* org.apache.cassandra.thrift.CassandraServer.doInsert(..))" , throwing = "throwable" ) public void logErrorFromThrownException ( final JoinPoint joinPoint , final Throwable throwable ) { final String className = joinPoint . getTarget ( ) . getClass ( ) . getName ( ) ; final Stri... | Logs an error message for unhandled exception thrown from the target method . | 139 | 15 |
1,212 | public String getDependencyJsonModel ( ) throws IOException { final Artifact artifact = DataModelFactory . createArtifact ( "" , "" , "" , "" , "" , "" , "" ) ; return JsonUtils . serialize ( DataModelFactory . createDependency ( artifact , Scope . COMPILE ) ) ; } | Returns an empty model of a Dependency in Json | 71 | 11 |
1,213 | public String getPromotionDetailsJsonModel ( ) throws IOException { final PromotionEvaluationReport sampleReport = new PromotionEvaluationReport ( ) ; sampleReport . addMessage ( String . format ( TWO_PLACES , PromotionReportTranslator . UNPROMOTED_MSG , "com.acme.secure-smh:core-relay:1.2.0" ) , MAJOR ) ; sampleReport... | Returns an empty Promotion details in Json | 345 | 8 |
1,214 | public String getSearchJsonModel ( ) throws IOException { DbSearch search = new DbSearch ( ) ; search . setArtifacts ( new ArrayList <> ( ) ) ; search . setModules ( new ArrayList <> ( ) ) ; return JsonUtils . serialize ( search ) ; } | Returns an empty Search object in Json | 68 | 8 |
1,215 | public String getScopes ( ) { final StringBuilder sb = new StringBuilder ( ) ; for ( final Scope scope : Scope . values ( ) ) { sb . append ( scope ) ; sb . append ( ", " ) ; } final String scopes = sb . toString ( ) . trim ( ) ; return scopes . substring ( 0 , scopes . length ( ) - 1 ) ; } | Returns the comma separated list of available scopes | 88 | 9 |
1,216 | public String [ ] getReportSamples ( ) { final Map < String , String > sampleValues = new HashMap <> ( ) ; sampleValues . put ( "name1" , "Secure Transpiler Mars" ) ; sampleValues . put ( "version1" , "4.7.0" ) ; sampleValues . put ( "name2" , "Secure Transpiler Bounty" ) ; sampleValues . put ( "version2" , "5.0.0" ) ;... | Displays a sample model for the report request . | 349 | 10 |
1,217 | public static void startMockJadexAgent ( String agent_name , String agent_path , MockConfiguration configuration , BeastTestCase story ) { story . startAgent ( agent_name , agent_path ) ; story . sendMessageToAgent ( agent_name , SFipa . INFORM , configuration ) ; story . setExecutionTime ( 2000 ) ; // To get time to e... | This method is used to launch mock agents . First it creates them with the generic df_service_name \ mock_agent \ and then the method sends to the agent a message with the new df_service_name and its behaviour . | 87 | 48 |
1,218 | public static String changeFirstLetterToCapital ( String word ) { char [ ] letras = word . toCharArray ( ) ; char a = letras [ 0 ] ; letras [ 0 ] = Character . toUpperCase ( a ) ; return new String ( letras ) ; } | Method used to write the name of the scenarios | 61 | 9 |
1,219 | public static String changeFirstLetterToLowerCase ( String word ) { char [ ] letras = word . toCharArray ( ) ; char a = letras [ 0 ] ; letras [ 0 ] = Character . toLowerCase ( a ) ; return new String ( letras ) ; } | Method used to write the name of the scenarios methods | 61 | 10 |
1,220 | public static String createClassName ( String scenarioDescription ) { String [ ] words = scenarioDescription . trim ( ) . split ( " " ) ; String name = "" ; for ( int i = 0 ; i < words . length ; i ++ ) { name += changeFirstLetterToCapital ( words [ i ] ) ; } return name ; } | Given a string with the scenario or story name creates a Class Name with no spaces and first letter capital | 71 | 20 |
1,221 | public static String createFirstLowCaseName ( String scenarioDescription ) { String [ ] words = scenarioDescription . trim ( ) . split ( " " ) ; String name = "" ; for ( int i = 0 ; i < words . length ; i ++ ) { name += changeFirstLetterToCapital ( words [ i ] ) ; } return changeFirstLetterToLowerCase ( name ) ; } | Given a string with method or package name creates a Class Name with no spaces and first letter lower case | 81 | 20 |
1,222 | protected static boolean fileDoesNotExist ( String file , String path , String dest_dir ) { File f = new File ( dest_dir ) ; if ( ! f . isDirectory ( ) ) return false ; String folderPath = createFolderPath ( path ) ; f = new File ( f , folderPath ) ; File javaFile = new File ( f , file ) ; boolean result = ! javaFile .... | Method to know if already exists one file with the same name in the same folder | 94 | 16 |
1,223 | public static File createFolder ( String path , String dest_dir ) throws BeastException { File f = new File ( dest_dir ) ; if ( ! f . isDirectory ( ) ) { try { f . mkdirs ( ) ; } catch ( Exception e ) { logger . severe ( "Problem creating directory: " + path + File . separator + dest_dir ) ; } } String folderPath = cre... | This method returns the existing folder and if it does not exist the method generates it . | 176 | 17 |
1,224 | public static String createFolderPath ( String path ) { String [ ] pathParts = path . split ( "\\." ) ; String path2 = "" ; for ( String part : pathParts ) { if ( path2 . equals ( "" ) ) { path2 = part ; } else { path2 = path2 + File . separator + changeFirstLetterToLowerCase ( createClassName ( part ) ) ; } } return p... | This method changes package_path into folder s path | 93 | 10 |
1,225 | protected static BufferedReader createFileReader ( String file_name ) throws BeastException { try { return new BufferedReader ( new FileReader ( file_name ) ) ; } catch ( FileNotFoundException e ) { Logger logger = Logger . getLogger ( MASReader . class . getName ( ) ) ; logger . severe ( "ERROR: " + e . toString ( ) )... | Method to read our client s plain text | 107 | 8 |
1,226 | public static void createDotStoryFile ( String scenarioName , String srcTestRootFolder , String packagePath , String givenDescription , String whenDescription , String thenDescription ) throws BeastException { String [ ] folders = packagePath . split ( "." ) ; for ( String folder : folders ) { srcTestRootFolder += "/" ... | Creates the . story file necessary for every Beast Test Case . | 231 | 13 |
1,227 | protected static FileWriter createFileWriter ( String scenarioName , String aux_package_path , String dest_dir ) throws BeastException { try { return new FileWriter ( new File ( createFolder ( aux_package_path , dest_dir ) , scenarioName + ".story" ) ) ; } catch ( IOException e ) { String message = "ERROR writing the "... | Method to get the file writer required for the . story files | 113 | 12 |
1,228 | protected static String createDotStoryName ( String scenarioName ) { String [ ] words = scenarioName . trim ( ) . split ( " " ) ; String result = "" ; for ( int i = 0 ; i < words . length ; i ++ ) { String word1 = words [ i ] ; String word2 = word1 . toLowerCase ( ) ; if ( ! word1 . equals ( word2 ) ) { String finalWor... | Creates the name of the . story file to be wrote with the testcase . The name of the scenario must be given with spaces . | 258 | 28 |
1,229 | private Criteria buildPrefetchCriteriaMultipleKeys ( Collection ids , FieldDescriptor fields [ ] ) { Criteria crit = new Criteria ( ) ; Iterator iter = ids . iterator ( ) ; Object [ ] val ; Identity id ; while ( iter . hasNext ( ) ) { Criteria c = new Criteria ( ) ; id = ( Identity ) iter . next ( ) ; val = id . getPri... | Build the Criteria using multiple ORs | 184 | 8 |
1,230 | public static void setCurrentPersistenceBroker ( PBKey key , PersistenceBrokerInternal broker ) throws PBFactoryException { HashMap map = ( HashMap ) currentBrokerMap . get ( ) ; WeakHashMap set = null ; if ( map == null ) { map = new HashMap ( ) ; currentBrokerMap . set ( map ) ; synchronized ( lock ) { loadedHMs . ad... | Mark a PersistenceBroker as preferred choice for current Thread | 154 | 12 |
1,231 | public static void unsetCurrentPersistenceBroker ( PBKey key , PersistenceBrokerInternal broker ) throws PBFactoryException { HashMap map = ( HashMap ) currentBrokerMap . get ( ) ; WeakHashMap set = null ; if ( map != null ) { set = ( WeakHashMap ) map . get ( key ) ; if ( set != null ) { set . remove ( broker ) ; if (... | Unmark a PersistenceBroker as preferred choice for current Thread | 143 | 13 |
1,232 | public void actionPerformed ( java . awt . event . ActionEvent actionEvent ) { new Thread ( ) { public void run ( ) { final java . sql . Connection conn = new JDlgDBConnection ( containingFrame , false ) . showAndReturnConnection ( ) ; if ( conn != null ) { javax . swing . SwingUtilities . invokeLater ( new Runnable ( ... | Called to execute this action . | 149 | 7 |
1,233 | public void setRoles ( List < NamedRoleInfo > roles ) { this . roles = roles ; List < AuthorizationInfo > authorizations = new ArrayList < AuthorizationInfo > ( ) ; for ( NamedRoleInfo role : roles ) { authorizations . addAll ( role . getAuthorizations ( ) ) ; } super . setAuthorizations ( authorizations ) ; } | Set the role info for this user . If set this will be used to set the user s authorizations . | 76 | 22 |
1,234 | public static double [ ] getTileLayerSize ( TileCode code , Envelope maxExtent , double scale ) { double div = Math . pow ( 2 , code . getTileLevel ( ) ) ; double tileWidth = Math . ceil ( ( scale * maxExtent . getWidth ( ) ) / div ) / scale ; double tileHeight = Math . ceil ( ( scale * maxExtent . getHeight ( ) ) / di... | Calculates the tiles width and height . | 111 | 9 |
1,235 | public static int [ ] getTileScreenSize ( double [ ] worldSize , double scale ) { int screenWidth = ( int ) Math . round ( scale * worldSize [ 0 ] ) ; int screenHeight = ( int ) Math . round ( scale * worldSize [ 1 ] ) ; return new int [ ] { screenWidth , screenHeight } ; } | Calculate the screen size of a tile . Normally the screen size is expressed in pixels and should therefore be integers but for the sake of accuracy we try to keep a double value as long as possible . | 74 | 41 |
1,236 | public static Envelope getTileBounds ( TileCode code , Envelope maxExtent , double scale ) { double [ ] layerSize = getTileLayerSize ( code , maxExtent , scale ) ; if ( layerSize [ 0 ] == 0 ) { return null ; } double cX = maxExtent . getMinX ( ) + code . getX ( ) * layerSize [ 0 ] ; double cY = maxExtent . getMinY ( ) ... | Get the bounding box for a certain tile . | 146 | 10 |
1,237 | public void check ( ReferenceDescriptorDef refDef , String checkLevel ) throws ConstraintException { ensureClassRef ( refDef , checkLevel ) ; checkProxyPrefetchingLimit ( refDef , checkLevel ) ; } | Checks the given reference descriptor . | 48 | 7 |
1,238 | @ PostConstruct protected void postConstruct ( ) { if ( null == authenticationServices ) { authenticationServices = new ArrayList < AuthenticationService > ( ) ; } if ( ! excludeDefault ) { authenticationServices . add ( staticAuthenticationService ) ; } } | Finish initialization of the configuration . | 52 | 6 |
1,239 | public static String getMemberName ( ) throws XDocletException { if ( getCurrentField ( ) != null ) { return getCurrentField ( ) . getName ( ) ; } else if ( getCurrentMethod ( ) != null ) { return MethodTagsHandler . getPropertyNameFor ( getCurrentMethod ( ) ) ; } else { return null ; } } | Returns the name of the current member which is the name in the case of a field or the property name for an accessor method . | 75 | 27 |
1,240 | public static XClass getMemberType ( ) throws XDocletException { if ( getCurrentField ( ) != null ) { return getCurrentField ( ) . getType ( ) ; } else if ( getCurrentMethod ( ) != null ) { XMethod method = getCurrentMethod ( ) ; if ( MethodTagsHandler . isGetterMethod ( method ) ) { return method . getReturnType ( ) .... | Returns the type of the current member which is the type in the case of a field the return type for a getter method or the type of the parameter for a setter method . | 144 | 37 |
1,241 | public static int getMemberDimension ( ) throws XDocletException { if ( getCurrentField ( ) != null ) { return getCurrentField ( ) . getDimension ( ) ; } else if ( getCurrentMethod ( ) != null ) { XMethod method = getCurrentMethod ( ) ; if ( MethodTagsHandler . isGetterMethod ( method ) ) { return method . getReturnTyp... | Returns the dimension of the type of the current member . | 147 | 11 |
1,242 | public void forAllMemberTags ( String template , Properties attributes ) throws XDocletException { if ( getCurrentField ( ) != null ) { forAllMemberTags ( template , attributes , FOR_FIELD , XDocletTagshandlerMessages . ONLY_CALL_FIELD_NOT_NULL , new String [ ] { "forAllMemberTags" } ) ; } else if ( getCurrentMethod ( ... | Iterates over all tags of current member and evaluates the template for each one . | 141 | 16 |
1,243 | public void forAllMemberTagTokens ( String template , Properties attributes ) throws XDocletException { if ( getCurrentField ( ) != null ) { forAllMemberTagTokens ( template , attributes , FOR_FIELD ) ; } else if ( getCurrentMethod ( ) != null ) { forAllMemberTagTokens ( template , attributes , FOR_METHOD ) ; } } | Iterates over all tokens in current member tag with the name tagName and evaluates the body for every token . | 76 | 22 |
1,244 | public void ifDoesntHaveMemberTag ( String template , Properties attributes ) throws XDocletException { boolean result = false ; if ( getCurrentField ( ) != null ) { if ( ! hasTag ( attributes , FOR_FIELD ) ) { result = true ; generate ( template ) ; } } else if ( getCurrentMethod ( ) != null ) { if ( ! hasTag ( attrib... | Evaluates the body if current member has no tag with the specified name . | 138 | 16 |
1,245 | public void ifHasMemberWithTag ( String template , Properties attributes ) throws XDocletException { ArrayList allMemberNames = new ArrayList ( ) ; HashMap allMembers = new HashMap ( ) ; boolean hasTag = false ; addMembers ( allMemberNames , allMembers , getCurrentClass ( ) , null , null , null ) ; for ( Iterator it = ... | Evaluates the body if the current class has at least one member with at least one tag with the specified name . | 226 | 24 |
1,246 | public void ifMemberTagValueEquals ( String template , Properties attributes ) throws XDocletException { if ( getCurrentField ( ) != null ) { if ( isTagValueEqual ( attributes , FOR_FIELD ) ) { generate ( template ) ; } } else if ( getCurrentMethod ( ) != null ) { if ( isTagValueEqual ( attributes , FOR_METHOD ) ) { ge... | Evaluates the body if value for the member tag equals the specified value . | 91 | 16 |
1,247 | private void addMembersInclSupertypes ( Collection memberNames , HashMap members , XClass type , String tagName , String paramName , String paramValue ) throws XDocletException { addMembers ( memberNames , members , type , tagName , paramName , paramValue ) ; if ( type . getInterfaces ( ) != null ) { for ( Iterator it ... | Retrieves the members of the type and of its super types . | 191 | 14 |
1,248 | private void addMembers ( Collection memberNames , HashMap members , XClass type , String tagName , String paramName , String paramValue ) throws XDocletException { if ( ! type . isInterface ( ) && ( type . getFields ( ) != null ) ) { XField field ; for ( Iterator it = type . getFields ( ) . iterator ( ) ; it . hasNext... | Retrieves the members of the given type . | 399 | 10 |
1,249 | private boolean checkTagAndParam ( XDoc doc , String tagName , String paramName , String paramValue ) { if ( tagName == null ) { return true ; } if ( ! doc . hasTag ( tagName ) ) { return false ; } if ( paramName == null ) { return true ; } if ( ! doc . getTag ( tagName ) . getAttributeNames ( ) . contains ( paramName ... | Determines whether the given documentation part contains the specified tag with the given parameter having the given value . | 123 | 21 |
1,250 | final void waitForSizeQueue ( final int queueSize ) { synchronized ( this . queue ) { while ( this . queue . size ( ) > queueSize ) { try { this . queue . wait ( 250L ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } } try { Thread . sleep ( 500L ) ; } catch ( InterruptedException ... | For test purposes only . | 110 | 5 |
1,251 | final void begin ( ) { if ( LogFileCompressionStrategy . existsFor ( this . properties ) ) { final Thread thread = new Thread ( this , "Log4J File Compressor" ) ; thread . setDaemon ( true ) ; thread . start ( ) ; this . threadRef = thread ; } } | Starts the compressor . | 67 | 5 |
1,252 | final void end ( ) { final Thread thread = this . threadRef ; this . keepRunning . set ( false ) ; if ( thread != null ) { // thread.interrupt(); try { thread . join ( ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } } this . threadRef = null ; } | Stops the compressor . | 76 | 5 |
1,253 | public static void addStory ( File caseManager , String storyName , String testPath , String user , String feature , String benefit ) throws BeastException { FileWriter caseManagerWriter ; String storyClass = SystemReader . createClassName ( storyName ) ; try { BufferedReader reader = new BufferedReader ( new FileReade... | The third method to write caseManager . Its task is to write the call to the story to be run . | 601 | 22 |
1,254 | public static void closeMASCaseManager ( File caseManager ) { FileWriter caseManagerWriter ; try { caseManagerWriter = new FileWriter ( caseManager , true ) ; caseManagerWriter . write ( "}\n" ) ; caseManagerWriter . flush ( ) ; caseManagerWriter . close ( ) ; } catch ( IOException e ) { Logger logger = Logger . getLog... | Method to close the file caseManager . It is called just one time by the MASReader once every test and stroy have been added . | 118 | 28 |
1,255 | public void fillTile ( InternalTile tile , Envelope maxTileExtent ) throws GeomajasException { List < InternalFeature > origFeatures = tile . getFeatures ( ) ; tile . setFeatures ( new ArrayList < InternalFeature > ( ) ) ; for ( InternalFeature feature : origFeatures ) { if ( ! addTileCode ( tile , maxTileExtent , feat... | Put features in a tile . This will assure all features are only added in one tile . When a feature s unique tile is different from this one a link is added in the tile . | 110 | 37 |
1,256 | public void clipTile ( InternalTile tile , double scale , Coordinate panOrigin ) throws GeomajasException { log . debug ( "clipTile before {}" , tile ) ; List < InternalFeature > orgFeatures = tile . getFeatures ( ) ; tile . setFeatures ( new ArrayList < InternalFeature > ( ) ) ; Geometry maxScreenBbox = null ; // The ... | Apply clipping to the features in a tile . The tile and its features should already be in map space . | 277 | 21 |
1,257 | private boolean exceedsScreenDimensions ( InternalFeature f , double scale ) { Envelope env = f . getBounds ( ) ; return ( env . getWidth ( ) * scale > MAXIMUM_TILE_COORDINATE ) || ( env . getHeight ( ) * scale > MAXIMUM_TILE_COORDINATE ) ; } | The test that checks if clipping is needed . | 76 | 9 |
1,258 | private Envelope getMaxScreenEnvelope ( InternalTile tile , Coordinate panOrigin ) { int nrOfTilesX = Math . max ( 1 , MAXIMUM_TILE_COORDINATE / tile . getScreenWidth ( ) ) ; int nrOfTilesY = Math . max ( 1 , MAXIMUM_TILE_COORDINATE / tile . getScreenHeight ( ) ) ; double x1 = panOrigin . x - nrOfTilesX * tile . getTil... | What is the maximum bounds in screen space? Needed for correct clipping calculation . | 247 | 16 |
1,259 | private Client getClient ( ) { final ClientConfig cfg = new DefaultClientConfig ( ) ; cfg . getClasses ( ) . add ( com . fasterxml . jackson . jaxrs . json . JacksonJsonProvider . class ) ; cfg . getProperties ( ) . put ( ClientConfig . PROPERTY_CONNECT_TIMEOUT , timeout ) ; return Client . create ( cfg ) ; } | Provide Jersey client for the targeted Grapes server | 90 | 11 |
1,260 | public boolean isServerAvailable ( ) { final Client client = getClient ( ) ; final ClientResponse response = client . resource ( serverURL ) . get ( ClientResponse . class ) ; if ( ClientResponse . Status . OK . getStatusCode ( ) == response . getStatus ( ) ) { return true ; } if ( LOG . isErrorEnabled ( ) ) { LOG . er... | Checks if the dependency server is available | 130 | 8 |
1,261 | public void postBuildInfo ( final String moduleName , final String moduleVersion , final Map < String , String > buildInfo , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { final Client client = getClient ( user , password ) ; final WebResource resource = clie... | Post a build info to the server | 226 | 7 |
1,262 | public void postModule ( final Module module , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . moduleResourcePath ( ) ) ;... | Post a module to the server | 201 | 6 |
1,263 | public void deleteModule ( final String name , final String version , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . get... | Delete a module from Grapes server | 212 | 8 |
1,264 | public Module getModule ( final String name , final String version ) throws GrapesCommunicationException { final Client client = getClient ( ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getModulePath ( name , version ) ) ; final ClientResponse response = resource . accept ( M... | Send a get module request | 220 | 5 |
1,265 | public List < Module > getModules ( final Map < String , String > filters ) throws GrapesCommunicationException { final Client client = getClient ( ) ; WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getAllModulesPath ( ) ) ; for ( final Map . Entry < String , String > queryParam : filter... | Get a list of modules regarding filters | 263 | 7 |
1,266 | public void promoteModule ( final String name , final String version , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . pr... | Promote a module in the Grapes server | 223 | 10 |
1,267 | public PromotionEvaluationReport getModulePromotionReport ( final String name , final String version ) throws GrapesCommunicationException { return getModulePromotionReportRaw ( name , version , false , PromotionEvaluationReport . class ) ; } | Check if a module can be promoted in the Grapes server | 52 | 13 |
1,268 | public void postArtifact ( final Artifact artifact , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . artifactResourcePath... | Post an artifact to the Grapes server | 202 | 9 |
1,269 | public void deleteArtifact ( final String gavc , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getArtifactPath ( gavc )... | Delete an artifact in the Grapes server | 200 | 9 |
1,270 | public List < Artifact > getArtifacts ( final Boolean hasLicense ) throws GrapesCommunicationException { final Client client = getClient ( ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getArtifactsPath ( ) ) ; final ClientResponse response = resource . queryParam ( ServerAPI .... | Send a get artifacts request | 226 | 5 |
1,271 | public void postDoNotUseArtifact ( final String gavc , final Boolean doNotUse , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestU... | Post boolean flag DO_NOT_USE to an artifact | 241 | 11 |
1,272 | public List < String > getArtifactVersions ( final String gavc ) throws GrapesCommunicationException { final Client client = getClient ( ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getArtifactVersions ( gavc ) ) ; final ClientResponse response = resource . accept ( MediaType... | Returns the artifact available versions | 224 | 5 |
1,273 | public void postLicense ( final License license , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . licenseResourcePath ( )... | Post a license to the server | 201 | 6 |
1,274 | public List < Dependency > getModuleAncestors ( final String moduleName , final String moduleVersion ) throws GrapesCommunicationException { final Client client = getClient ( ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getArtifactAncestors ( moduleName , moduleVersion ) ) ; ... | Return the list of module ancestors | 330 | 6 |
1,275 | public List < Dependency > getModuleDependencies ( final String moduleName , final String moduleVersion , final Boolean fullRecursive , final Boolean corporate , final Boolean thirdParty ) throws GrapesCommunicationException { final Client client = getClient ( ) ; final WebResource resource = client . resource ( server... | Return the list of module dependencies | 417 | 6 |
1,276 | public Organization getModuleOrganization ( final String moduleName , final String moduleVersion ) throws GrapesCommunicationException { final Client client = getClient ( ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getModuleOrganizationPath ( moduleName , moduleVersion ) ) ;... | Returns the organization of a given module | 212 | 7 |
1,277 | public void createProductDelivery ( final String productLogicalName , final Delivery delivery , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) .... | Create an Product delivery | 214 | 4 |
1,278 | public Identity refreshIdentity ( ) { Identity oldOid = getIdentity ( ) ; this . oid = getBroker ( ) . serviceIdentity ( ) . buildIdentity ( myObj ) ; return oldOid ; } | Replace the current with a new generated identity object and returns the old one . | 50 | 16 |
1,279 | private void prepareInitialState ( boolean isNewObject ) { // determine appropriate modification state ModificationState initialState ; if ( isNewObject ) { // if object is not already persistent it must be marked as new // it must be marked as dirty because it must be stored even if it will not modified during tx init... | Sets the initial MoificationState of the wrapped object myObj . The initial state will be StateNewDirty if myObj is not persisten already . The state will be set to StateOldClean if the object is already persistent . | 197 | 48 |
1,280 | public boolean isDeleted ( Identity id ) { ObjectEnvelope envelope = buffer . getByIdentity ( id ) ; return ( envelope != null && envelope . needsDelete ( ) ) ; } | Checks if the object with the given identity has been deleted within the transaction . | 40 | 16 |
1,281 | public void setModificationState ( ModificationState newModificationState ) { if ( newModificationState != modificationState ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "object state transition for object " + this . oid + " (" + modificationState + " --> " + newModificationState + ")" ) ; // try{throw new Excep... | set the Modification state to a new value . Used during state transitions . | 110 | 15 |
1,282 | void markReferenceElements ( PersistenceBroker broker ) { // these cases will be handled by ObjectEnvelopeTable#cascadingDependents() // if(getModificationState().needsInsert() || getModificationState().needsDelete()) return; Map oldImage = getBeforeImage ( ) ; Map newImage = getCurrentImage ( ) ; Iterator iter = newIm... | Mark new or deleted reference elements | 193 | 6 |
1,283 | public void createContainer ( String container ) { ContainerController controller = this . platformContainers . get ( container ) ; if ( controller == null ) { // TODO make this configurable Profile p = new ProfileImpl ( ) ; p . setParameter ( Profile . PLATFORM_ID , PLATFORM_ID ) ; p . setParameter ( Profile . MAIN_HO... | Create a container in the platform | 275 | 6 |
1,284 | public Query customizeQuery ( Object anObject , PersistenceBroker aBroker , CollectionDescriptor aCod , QueryByCriteria aQuery ) { return aQuery ; } | Default implementation returns unmodified original Query | 37 | 7 |
1,285 | public Iterator < ? > getElements ( Filter filter , int offset , int maxResultSize ) throws LayerException { if ( null == filter ) { filter = Filter . INCLUDE ; } List < Object > filteredList = new ArrayList < Object > ( ) ; try { synchronized ( featuresById ) { for ( Object feature : featuresById . values ( ) ) { if (... | This implementation does not support the offset and maxResultSize parameters . | 259 | 13 |
1,286 | public void setTileUrls ( List < String > tileUrls ) { this . tileUrls = tileUrls ; if ( null != urlStrategy ) { urlStrategy . setUrls ( tileUrls ) ; } } | Set possible tile URLs . | 50 | 5 |
1,287 | public void postConstruct ( GeoService geoService , DtoConverterService converterService ) throws GeomajasException { if ( null == layerInfo ) { layerInfo = new RasterLayerInfo ( ) ; } layerInfo . setCrs ( TiledRasterLayerService . MERCATOR ) ; crs = geoService . getCrs2 ( TiledRasterLayerService . MERCATOR ) ; layerIn... | Finish initialization of state object . | 303 | 6 |
1,288 | public synchronized void addListener ( MaterializationListener listener ) { if ( _listeners == null ) { _listeners = new ArrayList ( ) ; } // add listener only once if ( ! _listeners . contains ( listener ) ) { _listeners . add ( listener ) ; } } | Adds a materialization listener . | 61 | 6 |
1,289 | protected void beforeMaterialization ( ) { if ( _listeners != null ) { MaterializationListener listener ; for ( int idx = _listeners . size ( ) - 1 ; idx >= 0 ; idx -- ) { listener = ( MaterializationListener ) _listeners . get ( idx ) ; listener . beforeMaterialization ( this , _id ) ; } } } | Calls beforeMaterialization on all registered listeners in the reverse order of registration . | 80 | 16 |
1,290 | protected void afterMaterialization ( ) { if ( _listeners != null ) { MaterializationListener listener ; // listeners may remove themselves during the afterMaterialization // callback. // thus we must iterate through the listeners vector from back to // front // to avoid index problems. for ( int idx = _listeners . siz... | Calls afterMaterialization on all registered listeners in the reverse order of registration . | 115 | 16 |
1,291 | protected TemporaryBrokerWrapper getBroker ( ) throws PBFactoryException { PersistenceBrokerInternal broker ; boolean needsClose = false ; if ( getBrokerKey ( ) == null ) { /* arminw: if no PBKey is set we throw an exception, because we don't know which PB (connection) should be used. */ throw new OJBRuntimeException (... | Gets the persistence broker used by this indirection handler . If no PBKey is available a runtime exception will be thrown . | 242 | 25 |
1,292 | public Object getRealSubject ( ) throws PersistenceBrokerException { if ( _realSubject == null ) { beforeMaterialization ( ) ; _realSubject = materializeSubject ( ) ; afterMaterialization ( ) ; } return _realSubject ; } | Returns the proxies real subject . The subject will be materialized if necessary . | 52 | 15 |
1,293 | protected synchronized Object materializeSubject ( ) throws PersistenceBrokerException { TemporaryBrokerWrapper tmp = getBroker ( ) ; try { Object realSubject = tmp . broker . getObjectByIdentity ( _id ) ; if ( realSubject == null ) { LoggerFactory . getLogger ( IndirectionHandler . class ) . warn ( "Can not materializ... | Retrieves the real subject from the underlying RDBMS . Override this method if the object is to be materialized in a specific way . | 134 | 30 |
1,294 | public void ojbAdd ( Object anObject ) { DSetEntry entry = prepareEntry ( anObject ) ; entry . setPosition ( elements . size ( ) ) ; elements . add ( entry ) ; } | add a single Object to the Collection . This method is used during reading Collection elements from the database . Thus it is is save to cast anObject to the underlying element type of the collection . | 44 | 38 |
1,295 | private String generateAbbreviatedExceptionMessage ( final Throwable throwable ) { final StringBuilder builder = new StringBuilder ( ) ; builder . append ( ": " ) ; builder . append ( throwable . getClass ( ) . getCanonicalName ( ) ) ; builder . append ( ": " ) ; builder . append ( throwable . getMessage ( ) ) ; Throwa... | Method generates abbreviated exception message . | 219 | 7 |
1,296 | @ PostConstruct protected void postConstruct ( ) throws GeomajasException { if ( null != crsDefinitions ) { for ( CrsInfo crsInfo : crsDefinitions . values ( ) ) { try { CoordinateReferenceSystem crs = CRS . parseWKT ( crsInfo . getCrsWkt ( ) ) ; String code = crsInfo . getKey ( ) ; crsCache . put ( code , CrsFactory .... | Finish service initialization . | 462 | 4 |
1,297 | public int getSridFromCrs ( String crs ) { int crsInt ; if ( crs . indexOf ( ' ' ) != - 1 ) { crsInt = Integer . parseInt ( crs . substring ( crs . indexOf ( ' ' ) + 1 ) ) ; } else { try { crsInt = Integer . parseInt ( crs ) ; } catch ( NumberFormatException e ) { crsInt = 0 ; } } return crsInt ; } | Isn t there a method for this in GeoTools? | 105 | 11 |
1,298 | public void configure ( Configuration pConfig ) throws ConfigurationException { if ( pConfig instanceof PBPoolConfiguration ) { PBPoolConfiguration conf = ( PBPoolConfiguration ) pConfig ; this . setMaxActive ( conf . getMaxActive ( ) ) ; this . setMaxIdle ( conf . getMaxIdle ( ) ) ; this . setMaxWait ( conf . getMaxWa... | Read in the configuration properties . | 206 | 6 |
1,299 | public OTMConnection acquireConnection ( PBKey pbKey ) { TransactionFactory txFactory = getTransactionFactory ( ) ; return txFactory . acquireConnection ( pbKey ) ; } | Obtain an OTMConnection for the given persistence broker key | 38 | 12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.