code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
@Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
return application.sources(Application.class);
}
| An opinionated WebApplicationInitializer to run a SpringApplication from a traditional WAR deployment. Binds Servlet, Filter and ServletContextInitializer beans from the application context to the servlet container. |
private VOUser createUser(){
String organizationId=accountServiceClient.getOrganization().getOrganizationId();
VOUserDetails userDetails=identityServiceClient.createUser(organizationId);
VOUser voUser=identityServiceClient.getVOUser(userDetails.getUserId());
System.out.println("Created user ID is: \"" + voUser.... | Create new user |
public static void upto(Number self,Number to,@ClosureParams(FirstParam.class) Closure closure){
int self1=self.intValue();
int to1=to.intValue();
if (self1 <= to1) {
for (int i=self1; i <= to1; i++) {
closure.call(i);
}
}
else throw new GroovyRuntimeException("The argument (" + to + ") to upto... | Iterates from this number up to the given number, inclusive, incrementing by one each time. |
public String toString(){
if (root instanceof Map) {
if (((Map)root).containsKey("ROOT")) {
return PrettyPrinter.print((Map)((Map)root).get("ROOT"));
}
else {
return PrettyPrinter.print((Map)root);
}
}
else if (root instanceof List) {
return PrettyPrinter.print((List)root);
}
else... | Convert the object back to an JSON string. |
public static void main(String[] args){
String matrixFilename=null;
String coordinateFilename=null;
String externalZonesFilename=null;
String networkFilename=null;
String plansFilename=null;
Double populationFraction=null;
if (args.length != 6) {
throw new IllegalArgumentException("Wrong number of arg... | Class to generate plans files from the Saturn OD-matrices provided by Sanral's modelling consultant, Alan Robinson. |
private long doCreate(String roleID) throws Exception {
TechnicalProduct technicalProduct=createTechnicalProduct();
final long key=createRoleDefinition(technicalProduct,roleID);
return key;
}
| Create role definition. |
public Rule(final String name,final boolean water,final GameData data){
super(name,data);
m_water=water;
m_units=new UnitCollection(this,getData());
}
| Creates new Territory |
public static void createShortcutIntent(final String displayName,final String artistName,final Long id,final String mimeType,final Activity context){
try {
final ImageFetcher fetcher=getImageFetcher(context);
Bitmap bitmap=null;
if (mimeType.equals(MediaStore.Audio.Albums.CONTENT_TYPE)) {
bitmap=fet... | Used to create shortcuts for an artist, album, or playlist that is then placed on the default launcher homescreen |
private void writeAttribute(java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
if (namespace.equals("")) {
xmlWriter.writeAttribute(attName,attValue);
}
else {
registerPrefix(xmlWriter,namesp... | Util method to write an attribute without the ns prefix |
public static String unescapeXml(String str){
if (str == null) {
return null;
}
return EntitiesUtils.XML.unescape(str);
}
| <p>Unescapes a string containing XML entity escapes to a string containing the actual Unicode characters corresponding to the escapes.</p> <p>Supports only the five basic XML entities (gt, lt, quot, amp, apos). Does not support DTDs or external entities.</p> <p>Note that numerical \\u unicode codes are unescaped to the... |
public String encodeAttribute(final String name){
return nameCoder.encodeAttribute(name);
}
| Encode the attribute name into the name of the target format. |
public static PcRunner serializableInstance(){
return PcRunner.serializableInstance();
}
| Generates a simple exemplar of this class to test serialization. |
public Statistics(){
dataMap=new HashMap<String,Data>(50);
}
| Constructs an instance. |
public Matrix(int m,int n){
this.m=m;
this.n=n;
A=new double[m][n];
}
| Construct an m-by-n matrix of zeros. |
public Node replaceChild(Node newChild,Node oldChild) throws DOMException {
if (oldChild == null || oldChild.getParentNode() != this) return null;
ElemTemplateElement newChildElem=((ElemTemplateElement)newChild);
ElemTemplateElement oldChildElem=((ElemTemplateElement)oldChild);
ElemTemplateElement prev=(ElemT... | Replace the old child with a new child. |
public static int negHalfWidth(int min,int max){
if (min > max) {
throw new IllegalArgumentException("min [" + min + "] must be <= max ["+ max+ "]");
}
int mean=meanLow(min,max);
return min - mean - ((min ^ max) & 1);
}
| Useful because a positive int value could not represent half the width of full int range width, which is mathematically Integer.MAX_VALUE+1. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:42.559 -0500",hash_original_method="5451311C0FC76A3AF05558D3E031ACC9",hash_generated_method="FE186EAE434EB3A5D7066811DBEC7D9B") public SIPHeader parse() throws ParseException {
if (debug) dbg_enter("MimeVersionParser.parse");
... | parse the String message |
public static IgfsLogger disabledLogger(){
return disabledLogger;
}
| Get disabled logger. |
protected ReactionFiredImpl(){
super();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public Iterator<Entry<String,String>> httpHeaders(){
return headers.iterator();
}
| Returns a new iterator of response headers |
public RRLoadBalanceStrategy(FailStrategy failStrategy){
this.failStrategy=failStrategy;
}
| Creates a new instance of RRLoadBalanceStrategy. |
public synchronized void add(K obj){
head=Entry.append(head,obj);
}
| Add an element at the end. |
@Override public boolean containsValue(Object val){
return _map.containsValue(unwrapValue(val));
}
| Checks for the presence of <tt>val</tt> in the values of the map. |
public List<CarrierService> parseDemand(String demandFile,Network network,Carrier carrier){
List<CarrierService> services=new ArrayList<CarrierService>();
BufferedReader br=IOUtils.getBufferedReader(demandFile);
try {
br.readLine();
String input;
int i=1;
while ((input=br.readLine()) != null) {
... | This method reads in a file with shipments in the format: <br> customer, long, lat, product, mass, sale, duration, start, end <br><br> Where the fields refer to: <ul> <li> customer: name of customer with demand <li> long: longitude of customer <li> lat: latitude of customer <li> product: name of product requested <li> ... |
public void windowDeiconified(WindowEvent e){
if (AWTEventMonitor.windowListener_private != null) {
AWTEventMonitor.windowListener_private.windowDeiconified(e);
}
}
| Called when a window is deiconified. |
public Volcano(){
super();
}
| Needed by CGLib |
public String[] validBaudRates(){
return null;
}
| Get an array of valid baud rates. This is currently just a message saying its fixed |
public Enumeration<BasicBlock> reverseBlockEnumerator(){
return IREnumeration.reverseBE(this);
}
| Reverse (with respect to the current code linearization order) iteration overal all the basic blocks in the IR. |
private static IAbstractNode convert(final CommonTree ast) throws RecognitionException {
if (ast.getType() == FilterParser.PREDICATE) {
return new CPredicateExpression(ast.getText());
}
else if (ast.getType() == FilterParser.AND) {
return convertAnd(ast);
}
else if (ast.getType() == FilterParser.OR)... | Converts an ANTLR AST into a filter AST. |
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 15:01:21.279 -0400",hash_original_method="C9A6323D3BA7CB7A5EE47D73A9DDDABE",hash_generated_method="A0963F5476A8C96D4BE368C106BF9C8F") public V put(K key,V value){
if (value == null) throw new NullPointerExcept... | Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced. |
public GeoPoint[] interpolate(final GeoPoint start,final GeoPoint end,final double[] proportions){
double A=x;
double B=y;
double C=z;
final double transX=-D * A;
final double transY=-D * B;
final double transZ=-D * C;
double cosRA;
double sinRA;
double cosHA;
double sinHA;
double magnitude=magnit... | Find points on the boundary of the intersection of a plane and the unit sphere, given a starting point, and ending point, and a list of proportions of the arc (e.g. 0.25, 0.5, 0.75). The angle between the starting point and ending point is assumed to be less than pi. |
public TimingSpecifierListProducer(TimedElement owner,boolean isBegin){
this.owner=owner;
this.isBegin=isBegin;
}
| Creates a new TimingSpecifierListProducer. |
public boolean isItemLootingRewardable(){
return !get("class").equals("player");
}
| Checks if looting this corpse will be rewarded (i.e. for achievements). |
public void notifyEvent(MessageEvent e,Vector<Object> parm){
Object[] listenerList=this.listeners.getListenerList();
for (int i=listenerList.length - 2; i >= 0; i-=2) {
if (listenerList[i] == MessageListener.class) {
((MessageListener)listenerList[i + 1]).handleEvent(e,parm);
}
}
}
| notifyEvent() - |
@Nullable public static PsiMethod findPublicStaticVoidMainMethod(PsiClass clazz){
PsiMethod[] methods=clazz.findMethodsByName("main",false);
for ( PsiMethod method : methods) {
if (!method.hasModifierProperty(PsiModifier.PUBLIC)) {
continue;
}
if (!method.hasModifierProperty(PsiModifier.STATIC)) ... | Finds the public static void main(String[] args) method. |
public boolean hasIncomingBatchInstances(){
if (m_listenees.size() == 0) {
return false;
}
if (m_listenees.containsKey("trainingSet") || m_listenees.containsKey("testSet")) {
return true;
}
return false;
}
| Returns true if this classifier has an incoming connection that is a batch set of instances |
@Override public IBinder onBind(Intent intent){
return mUpstreamMessenger.getBinder();
}
| When binding to the service, we return an interface to our messenger for sending messages to the service. |
public ModifiableBOpBase clearProperty(final String name){
if (name == null) throw new IllegalArgumentException();
if (annotations.remove(name) != null) {
mutation();
}
return this;
}
| Clear the named annotation (destructive mutation). |
public void paintEditorPaneBorder(SynthContext context,Graphics g,int x,int y,int w,int h){
paintBorder(context,g,x,y,w,h,null);
}
| Paints the border of an editor pane. |
public static MGRSCoord fromLatLon(Angle latitude,Angle longitude,int precision){
if (latitude == null || longitude == null) {
throw new IllegalArgumentException("Latitude Or Longitude Is Null");
}
final MGRSCoordConverter converter=new MGRSCoordConverter();
long err=converter.convertGeodeticToMGRS(latitude... | Create a MGRS coordinate from a pair of latitude and longitude <code>Angle</code> with the given precision or number of digits (1 to 5). |
private void showFeedback(String message){
if (myHost != null) {
myHost.showFeedback(message);
}
else {
System.out.println(message);
}
}
| Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface. |
static void offerLastTemporaryDirectBuffer(ByteBuffer buf){
if (isBufferTooLarge(buf)) {
free(buf);
return;
}
assert buf != null;
BufferCache cache=bufferCache.get();
if (!cache.offerLast(buf)) {
free(buf);
}
}
| Releases a temporary buffer by returning to the cache or freeing it. If returning to the cache then insert it at the end. This makes it suitable for scatter/gather operations where the buffers are returned to cache in same order that they were obtained. |
public static void main(String[] args){
Scanner input=new Scanner(System.in);
Map<String,String> statesAndCapitals=getData();
System.out.print("Enter a state: ");
String state=input.nextLine();
if (statesAndCapitals.get(state) != null) {
System.out.println("The capital of " + state + " is "+ statesAndCapi... | Main method |
public void dupX1(){
mv.visitInsn(Opcodes.DUP_X1);
}
| Generates a DUP_X1 instruction. |
protected void _collectAndResolve(AnnotatedClass annotatedType,NamedType namedType,MapperConfig<?> config,AnnotationIntrospector ai,HashMap<NamedType,NamedType> collectedSubtypes){
if (!namedType.hasName()) {
String name=ai.findTypeName(annotatedType);
if (name != null) {
namedType=new NamedType(namedTy... | Method called to find subtypes for a specific type (class) |
void registerContentObserver(Cursor cursor,ContentObserver observer){
cursor.registerContentObserver(this.observer);
}
| Registers an observer to get notifications from the content provider when the cursor needs to be refreshed. |
@DSSafe(DSCat.SAFE_OTHERS) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:51.652 -0500",hash_original_method="451E311949AEF6CA521A34CAA7EB210C",hash_generated_method="71F12EF3151EC3E6B6E3F6468216C725") public LogConfigurationException(String message,Throwable cause){
super(mes... | Construct a new exception with the specified detail message and cause. |
public byte[] readStringBytes() throws IOException {
synchBits();
List<Byte> chars=new ArrayList();
byte[] aChar=new byte[1];
int num=0;
while ((num=in.read(aChar)) == 1) {
bytesRead++;
if (aChar[0] == 0) {
byte[] string=new byte[chars.size()];
int i=0;
for ( Object b : chars) {... | Read a string from the input stream |
public String toString(){
return toXML(false);
}
| Devuelve los valores de la instancia en una cadena de caracteres. |
public SVGRectRadiusHandle(Figure owner){
super(owner);
}
| Creates a new instance. |
private void cmd_print(){
ValueNamePair pp=(ValueNamePair)fPaymentRule.getSelectedItem();
if (pp == null) return;
String PaymentRule=pp.getValue();
log.info(PaymentRule);
if (!getChecks(PaymentRule)) return;
panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
boolean somethingPrinted=fals... | Print Checks and/or Remittance |
public static <V>int distinctList(List<V> sourceList){
if (isEmpty(sourceList)) {
return 0;
}
int sourceCount=sourceList.size();
int sourceListSize=sourceList.size();
for (int i=0; i < sourceListSize; i++) {
for (int j=(i + 1); j < sourceListSize; j++) {
if (sourceList.get(i).equals(sourceList.g... | remove duplicate entries in list |
public int addPodcast(Podcast podcast) throws IOException, FeedException {
LOG.debug("invoked" + getClass().getSimpleName() + "."+ Thread.currentThread().getStackTrace()[1].getMethodName()+ "to add new podcast to database ");
podcast.setAvailability(HttpStatus.SC_OK);
try {
this.setHeaderFieldAttributes(podca... | Adds podcast to the database |
public void onSaveInstanceState(Bundle outState){
outState.putBoolean("SlidingActivityHelper.open",mSlidingMenu.isMenuShowing());
outState.putBoolean("SlidingActivityHelper.secondary",mSlidingMenu.isSecondaryMenuShowing());
}
| Called to retrieve per-instance state from an activity before being killed so that the state can be restored in onCreate(Bundle) or onRestoreInstanceState(Bundle) (the Bundle populated by this method will be passed to both). |
public static String escapeFilterParameter(String parameter){
return parameter.replace("\\","\\\\").replace(",","\\,");
}
| Escape special characters for a parameter being used in a filter. |
public Polyline2D(float[] xpoints,float[] ypoints,int npoints){
if (npoints > xpoints.length || npoints > ypoints.length) {
throw new IndexOutOfBoundsException("npoints > xpoints.length || npoints > ypoints.length");
}
this.npoints=npoints;
this.xpoints=new float[npoints + 1];
this.ypoints=new float[npoin... | Constructs and initializes a <code>Polyline2D</code> from the specified parameters. |
public boolean isClosed(){
return lifecycle.closed();
}
| Returns <tt>true</tt> if the node is closed. |
protected boolean checkDrawerItem(int position,boolean includeOffset){
return getAdapter().getItem(position) != null;
}
| check if the item is within the bounds of the list |
public Request(SecurityHeaderType header,RequestSecurityTokenType rst,Signature signature,ServerValidatableSamlToken token,ServerValidatableSamlToken actAsToken){
assert header != null;
assert rst != null;
assert (rst.getActAs() != null) == (actAsToken != null) : "Failed ActAs token precondition!";
this.header=... | Creates a request |
public void reset(){
setCenter(centerOriginal);
setZoom(1.0);
}
| Sets the object's position and zoom level to the default state. |
public static Set<String> varyFields(Headers responseHeaders){
Set<String> result=Collections.emptySet();
for (int i=0, size=responseHeaders.size(); i < size; i++) {
if (!"Vary".equalsIgnoreCase(responseHeaders.name(i))) continue;
String value=responseHeaders.value(i);
if (result.isEmpty()) {
... | Returns the names of the request headers that need to be checked for equality when caching. |
public NeuronGroup(final Network net,Point2D initialPosition,final int numNeurons){
super(net);
neuronList=new ArrayList<Neuron>(numNeurons);
for (int i=0; i < numNeurons; i++) {
addNeuron(new Neuron(net),false);
}
neuronList=new CopyOnWriteArrayList<Neuron>(neuronList);
layout.setInitialLocation(initia... | Construct a new neuron group with a specified number of neurons. |
@Override public boolean shouldNotBeLogged(){
return false;
}
| Api for the subclasses to decide if this exception should be treated as a bug and hence to be get logged or not in the service layer just before AIDL connection to client. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:00.532 -0500",hash_original_method="C604A793DAEAE92DAC99FA0862A74B19",hash_generated_method="20ACC0777E5DF4C5A88542C7A7DB4716") public String encodeBody(){
return Integer.toString(majorVersion) + DOT + Integer.toString(minorVersio... | Return canonical form. |
public MatchConditionBuilder docValues(Boolean docValues){
this.docValues=docValues;
return this;
}
| Sets if the generated query should use doc values. Doc values queries are typically slower, but they can be faster in the dense case where most rows match the search. |
public static void saveDescription(final Window parent,final INaviAddressSpace addressSpace,final String description){
try {
addressSpace.getConfiguration().setDescription(description);
}
catch ( final CouldntSaveDataException e) {
CUtilityFunctions.logException(e);
final String innerMessage="E00154: ... | Saves the address space description to the database. |
@Override public void deleteBCVHelperVolume(StorageSystem storageSystem,Volume volume) throws Exception {
_log.info(String.format("Start executing BCV helper volume from array: %s, for volume: %s",storageSystem.getId(),volume.getId()));
try {
String deviceName=volume.getNativeId();
String deviceNameWithoutL... | Deletes 'SMI_BCV_META_...' helper volume form array. |
private Finalizer(Class<?> finalizableReferenceClass,ReferenceQueue<Object> queue,PhantomReference<Object> frqReference){
this.queue=queue;
this.finalizableReferenceClassReference=new WeakReference<Class<?>>(finalizableReferenceClass);
this.frqReference=frqReference;
}
| Constructs a new finalizer thread. |
public static GraphRequest newUpdateOpenGraphObjectRequest(AccessToken accessToken,String id,String title,String imageUrl,String url,String description,JSONObject objectProperties,Callback callback){
JSONObject openGraphObject=GraphUtil.createOpenGraphObjectForPost(null,title,imageUrl,url,description,objectProperties... | Creates a new Request configured to update a user owned Open Graph object. |
public boolean abort() throws LoginException {
if (!isAuthSucceeded()) {
return false;
}
else {
if (isAuthSucceeded() && !isCommitSucceeded()) {
reset();
}
else {
logout();
}
}
return true;
}
| Abort authentication (when overall authentication fails) |
public void startElement(StylesheetHandler handler,String uri,String localName,String rawName,Attributes attributes) throws org.xml.sax.SAXException {
try {
ElemTemplateElement p=handler.getElemTemplateElement();
boolean excludeXSLDecl=false;
boolean isLREAsStyleSheet=false;
if (null == p) {
XSL... | Receive notification of the start of an element. |
@Override protected void computeExtremesFromLocations(Dimension dim,float[] xs,float[] ys){
if (!this.longitudesCrossDateline(dim,xs)) {
super.computeExtremesFromLocations(dim,xs,ys);
return;
}
this.minx=180f;
this.maxx=-180f;
this.miny=Float.MAX_VALUE;
this.maxy=-Float.MAX_VALUE;
this.crossesDate... | Overridden to correctly compute the extremes for leaf cells which cross the international dateline. If this cell does not cross the dateline, this invokes the superclass' functionality. |
public boolean remove(final URI uri){
return this.uris.remove(uri);
}
| Removes a URI from the list of redirects. |
public void update(float delta){
CGPoint location=convertToWorldSpace(0,0);
ribbon_.setPosition(CGPoint.make(-1 * location.x,-1 * location.y));
float len=(float)Math.sqrt((float)Math.pow(lastLocation_.x - location.x,2) + (float)Math.pow(lastLocation_.y - location.y,2));
if (len > segThreshold_) {
ribbon_.ad... | polling function |
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){
switch (featureID) {
case N4JSPackage.VARIABLE_DECLARATION__DECLARED_TYPE_REF:
return getDeclaredTypeRef();
case N4JSPackage.VARIABLE_DECLARATION__BOGUS_TYPE_REF:
return getBogusTypeRef();
case N4JSPackage.VARIABLE_DECLARATION__NAME:
re... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public void addViews(T parent,List<View> views){
for (int i=0, size=views.size(); i < size; i++) {
addView(parent,views.get(i),i);
}
}
| Convenience method for batching a set of addView calls Note that this adds the views to the beginning of the ViewGroup |
public void writeClusters(OutputStreamWriter outStream,MultipleObjectsBundle data) throws IOException {
int modelcol=-1;
{
for (int i=0; i < data.metaLength(); i++) {
if (TypeUtil.MODEL.isAssignableFromType(data.meta(i))) {
modelcol=i;
break;
}
}
}
if (modelcol < 0) {
throw... | Write the resulting clusters to an output stream. |
public final CC endGroupY(String s){
ver.setEndGroup(s);
return this;
}
| The end group that this component should be placed in. <p> For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. |
private DiffPart decodeCut(final int blockSize_S,final int blockSize_E,final int blockSize_B) throws DecodingException {
if (blockSize_S < 1 || blockSize_E < 1 || blockSize_B < 1) {
throw new DecodingException("Invalid value for blockSize_S: " + blockSize_S + ", blockSize_E: "+ blockSize_E+ " or blockSize_B: "+ b... | Decodes a Cut operation. |
public BuildingTarget(Coords coords,IBoard board,int nType){
init(coords,board,nType);
}
| Target a single hex of a building. |
public List<String> findCreatorPropertyNames(){
List<String> names=null;
for (int i=0; i < 2; ++i) {
List<? extends AnnotatedWithParams> l=(i == 0) ? getConstructors() : getFactoryMethods();
for ( AnnotatedWithParams creator : l) {
int argCount=creator.getParameterCount();
if (argCount < 1) ... | Method for getting ordered list of named Creator properties. Returns an empty list is none found. If multiple Creator methods are defined, order between properties from different methods is undefined; however, properties for each such Creator are ordered properly relative to each other. For the usual case of just a sin... |
public IdsQueryBuilder ids(Collection<String> ids){
return addIds(ids);
}
| Adds ids to the filter. |
@Override public boolean equals(Object o){
if (o instanceof Domain) {
File src1=((Domain)o).getSourceFile();
if (src1 == xmlFile) {
return true;
}
return (src1 != null && xmlFile != null && src1.equals(xmlFile));
}
return false;
}
| Returns true if o is a domain with the same source file, and false otherwise. |
public synchronized void restart() throws IOException {
s_logger.info("listener restart initiated");
stop();
startup();
}
| close's exiting tcp secure port 7012 and re'opens new socket to indications from smi-s provider. |
public void testRegisterCustomConfigurationOnExistingContainer() throws Exception {
this.factory.registerConfiguration("testableContainerId",ContainerType.INSTALLED,ConfigurationType.STANDALONE,StandaloneLocalConfigurationStub.class);
Configuration configuration=this.factory.createConfiguration("testableContainerId... | Test custom configuration registration on an existing container. |
private void popContentSource(){
buffer=nextContentSource.buffer;
position=nextContentSource.position;
limit=nextContentSource.limit;
nextContentSource=nextContentSource.next;
}
| Replaces the current exhausted buffer with the next buffer in the chain. |
public Boolean isVmfsDatastoreMountCapable(){
return vmfsDatastoreMountCapable;
}
| Gets the value of the vmfsDatastoreMountCapable property. |
public NonScanDynamicClassLoader(ClassLoader parent){
super(parent);
}
| Creates a new SystemClassLoader. |
public HadoopLocalFileSystemV2(Configuration cfg) throws IOException, URISyntaxException {
super(new DelegateFS(cfg));
}
| Creates new local file system. |
public static void main(String[] args){
GridlockWithUI simple=new GridlockWithUI(new Gridlock(System.currentTimeMillis()));
Console c=new Console(simple);
c.setVisible(true);
}
| Main function |
private void processResponseHeaders(State state,InnerState innerState,HttpResponse response) throws StopRequest {
if (innerState.mContinuingDownload) {
return;
}
readResponseHeaders(state,innerState,response);
try {
state.mFilename=mService.generateSaveFile(mInfo.mFileName,mInfo.mTotalBytes);
}
catch... | Read HTTP response headers and take appropriate action, including setting up the destination file and updating the database. |
public static boolean isLastUnManagedVolumeToIngest(UnManagedConsistencyGroup unManagedCG,UnManagedVolume unManagedVolume){
return unManagedCG.getUnManagedVolumesMap().containsKey(unManagedVolume.getNativeGuid()) && unManagedCG.getUnManagedVolumesMap().size() == 1;
}
| Checks whether we are ingesting the last UnManagedVolume in the UnManagedConsistencyGroup. |
public AppVersion(int major,int minor,int patch){
this(major,minor,patch,-1,null);
}
| Creates a new <tt>major.minor.patch</tt> version number, e.g. <tt>1.0.1</tt>. |
protected void processChunkContent(ChunkRaw chunkRaw,int offsetinchunk,byte[] buf,int off,int len){
}
| this will be called upon reading portions of the chunk, if in PROCESS mode |
public static void main(String[] args){
runClassifier(new SerializedClassifier(),args);
}
| Runs the classifier with the given options |
@Override public String toString(){
return "CUevent[" + "nativePointer=0x" + Long.toHexString(getNativePointer()) + "]";
}
| Returns a String representation of this object. |
public static Server createJetty(Handler handler) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {
final Server server=new Server();
server.setHandler(handler);
HttpConfiguration httpConfig=new HttpConfiguration();
httpConfig.addCustomizer(new ForwardedRequestCustomizer())... | Creates a Jetty server listening on HTTP and HTTPS, serving handlers. |
public static boolean isChildPath(String path,String parentPath){
if (parentPath == null || path == null) {
return false;
}
if (!path.startsWith(parentPath)) {
return false;
}
if (!parentPath.endsWith(URI_PATH_CHAR) && !path.startsWith(URI_PATH_CHAR,parentPath.length())) {
return false;
}
retu... | Determines whether the path represents a child path of the specified path. E.g. isChildPath("/x/y/z", "/x/y") -> true isChildPath("y/z", "y") -> true isChildPath("/x/y/z", "/x/w") -> false isChildPath("y/z", "/x/y") -> false isChildPath("/x/yy/z", "/x/y") -> false |
public boolean remove(Attribute attribute){
return attribute != null && attrMap.remove(attribute.getCategory()) != null;
}
| Removes the specified attribute from this attribute set if present. If <CODE>attribute</CODE> is null, then <CODE>remove()</CODE> does nothing and returns <tt>false</tt>. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:07.360 -0500",hash_original_method="A7CA2EB6DD40139D85B6778D2C783F9F",hash_generated_method="EC2C494CA659AFA06CA752F5FEFC3E49") public ServiceRouteHeader createServiceRouteHeader(Address address){
if (address == null) throw new ... | Service-Route header |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.