code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public void testRestartWithNoDeployable() throws Exception {
if ("glassfish4x".equals(getTestData().containerId)) {
return;
}
if ("jonas4x".equals(getTestData().containerId)) {
return;
}
setContainer(createContainer(createConfiguration(ConfigurationType.STANDALONE)));
if (ContainerType.EMBEDDED.equa... | Smoke test: startup with no deployable. |
public void finer(CharSequence message,Throwable e){
log(Level.FINER,message,e);
}
| Log a message at the 'finer' debugging level. You should check isDebugging() before building the message. |
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
String reclassFile=null;
int row, col;
float progress=0;
double z, val;
int i;
double noData;
boolean assignMode=false;
boolean assignModeFound=false;
boolean delimiterFound=false;
double[][] reclas... | Used to execute this plugin tool. |
protected <S extends PropertySource<?>>List<S> findPropertySources(Class<S> sourceClass){
List<S> managedSources=new LinkedList<>();
LinkedList<PropertySource<?>> sources=toLinkedList(environment.getPropertySources());
while (!sources.isEmpty()) {
PropertySource<?> source=sources.pop();
if (source instanc... | Finds all registered property sources of the given type. |
private synchronized long applyTermDeletes(CoalescedUpdates updates,SegmentState[] segStates) throws IOException {
long startNS=System.nanoTime();
int numReaders=segStates.length;
long delTermVisitedCount=0;
long segTermVisitedCount=0;
FieldTermIterator iter=updates.termIterator();
String field=null;
Segm... | Merge sorts the deleted terms and all segments to resolve terms to docIDs for deletion. |
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. |
public static short parseShort(String string,int radix) throws NumberFormatException {
int intValue=Integer.parseInt(string,radix);
short result=(short)intValue;
if (result == intValue) {
return result;
}
throw new NumberFormatException("Value out of range for short: \"" + string + "\"");
}
| Parses the specified string as a signed short value using the specified radix. The ASCII character \u002d ('-') is recognized as the minus sign. |
public void reply(NceReply r){
if (!r.isUnsolicited()) {
int bits;
synchronized (this) {
bits=r.pollValue();
awaitingReply=false;
this.notify();
}
currentAIU.markChanges(bits);
if (log.isDebugEnabled()) {
String str=jmri.util.StringUtil.twoHexFromInt((bits >> 4) & 0xf);
s... | Process single received reply from sensor poll |
public NavigationEvent(Navigator source,T valueOld,T valueNew){
this.source=source;
this.valueOld=valueOld;
this.valueNew=valueNew;
}
| Initializes a new instance. |
public void addEntry(PutAllEntryData putAllEntry){
this.putAllData[this.putAllDataSize]=putAllEntry;
this.putAllDataSize+=1;
}
| Add an entry that this putall operation should distribute. |
private static ParseResults parseMimeType(String mimeType){
String[] parts=StringKit.split(mimeType,";");
ParseResults results=new ParseResults();
results.params=new HashMap<String,String>();
for (int i=1; i < parts.length; ++i) {
String p=parts[i];
String[] subParts=StringKit.split(p,"=");
if (subP... | Carves up a mime-type and returns a ParseResults object For example, the media range 'application/xhtml;q=0.5' would get parsed into: ('application', 'xhtml', {'q', '0.5'}) |
public static String keyString(SecretKeys keys){
return keys.toString();
}
| Converts the given AES/HMAC keys into a base64 encoded string suitable for storage. Sister function of keys. |
public SelectionDialog(Dialog owner,String key,int mode,Object[] arguments,List<String> optionsToSelect,List<String> optionsToCheck){
this(owner,key,mode,arguments);
this.optionsToSelect=optionsToSelect;
this.optionsToCheck=optionsToCheck;
}
| Constructs new dialog. Only sets object variables. |
private String makeDeleteAllUrl() throws UnsupportedEncodingException {
HttpSolrClient client=(HttpSolrClient)getSolrClient();
String deleteQuery="<delete><query>*:*</query></delete>";
return client.getBaseURL() + "/update?commit=true&stream.body=" + URLEncoder.encode(deleteQuery,"UTF-8");
}
| Compose a url that if you get it, it will delete all the data. |
public static boolean isEquals(Object actual,Object expected){
return actual == expected || (actual == null ? expected == null : actual.equals(expected));
}
| compare two object |
@Override public void clear(){
this._map.clear();
}
| Empties the map. |
public Piece(int magnitude){
this.magnitude=new BigDecimal(magnitude);
this.unitType=PieceUnit.PC.getBaseUnit();
}
| Create a new <code>Piece</code>. |
public void removeFromTags(String removeTag){
tags.remove(removeTag);
firePropertyChange(TAG,null,removeTag);
firePropertyChange(TAGS_AS_STRING,null,removeTag);
}
| Removes the from tags. |
@DSSafe(DSCat.ANDROID_CALLBACK) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:35:26.538 -0500",hash_original_method="A28646D8654C968065CCEE80C360B171",hash_generated_method="5BDF40E1FD876DCB9A201D9F7020DAE4") @Override public void onDestroyView(){
super.onDestroyView();
if (mD... | Remove dialog. |
protected void notifyDataChangedEvent(){
if (datasetObservers != null) {
for ( DataSetObserver observer : datasetObservers) {
observer.onChanged();
}
}
}
| Notifies observers about data changing |
public boolean hasPurchase(String sku){
return mPurchaseMap.containsKey(sku);
}
| Returns whether or not there exists a purchase of the given product. |
public static boolean isBookmarkInMobileBookmarksBranch(Context context,long nodeId){
Boolean result=chromeBrowserProviderCall(Boolean.class,ChromeBrowserProvider.CLIENT_API_IS_BOOKMARK_IN_MOBILE_BOOKMARKS_BRANCH,context,argsToBundle(nodeId));
return result != null ? result.booleanValue() : false;
}
| Checks if a bookmark node is in the Mobile Bookmarks folder branch. |
public Object remove(int index){
Object o=opt(index);
this.myArrayList.remove(index);
return o;
}
| Remove an index and close the hole. |
private void processIfCmp(Instruction s){
ValueGraphVertex v=new ValueGraphVertex(s);
graph.addGraphNode(v);
nameMap.put(s,v);
v.setLabel(s.operator(),3);
link(v,findOrCreateVertex(bypassMoves(IfCmp.getVal1(s))),0);
link(v,findOrCreateVertex(bypassMoves(IfCmp.getVal2(s))),1);
link(v,findOrCreateVertex(IfC... | Update the value graph to account for a given IfCmp instruction. <p><b>PRECONDITION:</b> <code> IfCmp.conforms(s); </code> |
public void write(long x){
writeByte((int)((x >>> 56) & 0xff));
writeByte((int)((x >>> 48) & 0xff));
writeByte((int)((x >>> 40) & 0xff));
writeByte((int)((x >>> 32) & 0xff));
writeByte((int)((x >>> 24) & 0xff));
writeByte((int)((x >>> 16) & 0xff));
writeByte((int)((x >>> 8) & 0xff));
writeByte((int)((x ... | Writes the 64-bit long to the binary output stream. |
public void install(ISelectionProvider selectionProvider){
if (selectionProvider == null) return;
if (selectionProvider instanceof IPostSelectionProvider) {
IPostSelectionProvider provider=(IPostSelectionProvider)selectionProvider;
provider.addPostSelectionChangedListener(this);
}
else {
selectionP... | Installs this selection changed listener with the given selection provider. If the selection provider is a post selection provider, post selection changed events are the preferred choice, otherwise normal selection changed events are requested. |
int compareTo(PageParamInfo other){
if (mFormula != null && other.mFormula == null) return 1;
if (mFormula == null && other.mFormula != null) return -1;
if (mType == other.mType) return 0;
if (mType == Type.PAGE_NUMBER) return 1;
if (other.mType == Type.PAGE_NUMBER) return -1;
return 0;
}
| Evaluates which PageParamInfo is better based on the properties of PageParamInfo. We prefer the one if the list of PageLinkInfo forms a linear formula, see getLinearFormula(). Returns 1 if this is better, -1 if other is better and 0 if they are equal. |
public void insertBack(Item x){
if (size == items.length) {
resize(size * RFACTOR);
}
items[size]=x;
size=size + 1;
}
| Inserts X into the back of the list. |
private boolean holdsSinglePolyfillSource(PolyfillValidationState state){
EList<TMember> myPolyMember=state.polyType.getOwnedMembers();
XtextResource res=(XtextResource)state.polyType.eResource();
IResourceDescriptions index=resourceDescriptionsProvider.getResourceDescriptions(res);
IContainer container=contain... | Constraints 129 (Applying Polyfills) No member must be filled by more than one polyfill. |
public static <T>T checkNotNull(T reference){
if (reference == null) {
throw new NullPointerException();
}
return reference;
}
| Ensures that an object reference passed as a parameter to the calling method is not null. |
public ValueModelUserLink(String name,ArrayListUserLink defaultValue){
super(name,defaultValue);
}
| Create ValueModel |
public String toString(){
final String TAB=" ";
StringBuffer retValue=new StringBuffer();
retValue.append("ConjunctionCriterion ( ").append("criteria = ").append(this.criteria).append(TAB).append("type = ").append(this.type).append(TAB).append(" )");
return retValue.toString();
}
| Constructs a <code>String</code> with all attributes in name = value format. |
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 boolean isInArea(Coord coord,Coord[] area){
return (getCompassQuarter(area[0],coord) == 1 && getCompassQuarter(area[1],coord) == 3);
}
| Checks if a coordinate is in the area |
public JSONObject putOpt(String key,Object value) throws JSONException {
if (key != null && value != null) {
put(key,value);
}
return this;
}
| Put a key/value pair in the JSONObject, but only if the key and the value are both non-null. |
public void testSerialization(){
LogFormat f1=new LogFormat(10.0,"10",true);
LogFormat f2=(LogFormat)TestUtilities.serialised(f1);
assertEquals(f1,f2);
}
| Serialize an instance, restore it, and check for equality. |
public void addProcessListener(INodejsProcessListener listener){
synchronized (listeners) {
listeners.add(listener);
}
}
| Add the given process listener. |
@Override protected void propertyChange(PropertyChangeEvent evt){
if (SynthLookAndFeel.shouldUpdateStyle(evt)) {
updateStyle((JTextComponent)evt.getSource());
}
super.propertyChange(evt);
}
| This method gets called when a bound property is changed on the associated JTextComponent. This is a hook which UI implementations may change to reflect how the UI displays bound properties of JTextComponent subclasses. This is implemented to rebuild the ActionMap based upon an EditorKit change. |
protected void checkConsistency(){
for ( Collection<? extends ConfigGroup> sets : getParameterSets().values()) {
for ( ConfigGroup set : sets) set.checkConsistency();
}
}
| Check if the set values go well together. This method is usually called after reading the configuration from a file. If an inconsistency is found, a warning or error should be issued and (optionally) a RuntimeException being thrown. |
public void lookupTable(String[] values) throws IOException {
writeCode(LOOKUP_TABLE);
ByteArrayOutputStream baout=new ByteArrayOutputStream();
OutStream bout=new OutStream(baout);
bout.writeUI16(values.length);
for (int i=0; i < values.length; i++) {
bout.writeString(values[i]);
}
bout.flush();
byt... | SWFActions interface |
public CDumpAllWaiter(final IDebugger debugger,final IAddress offset,final int size){
m_debugger=Preconditions.checkNotNull(debugger,"IE01429: Debugger argument can not be null");
m_offset=Preconditions.checkNotNull(offset,"IE01430: Offset argument can not be null");
m_size=size;
debugger.addListener(m_debugger... | Creates a new waiter object. |
private void bindPhoto(Bitmap bitmap){
if (bitmap != null) {
if (mPhotoView != null) {
mPhotoView.bindPhoto(bitmap);
}
enableImageTransforms(true);
}
}
| Binds an image to the photo view. |
public void put(int b){
put((byte)(b & 0xFF));
}
| Writes the lowest 8 bits of the given int to this ByteBuffer, at the current position. Advances the current position by 1. |
protected LiteralImpl(){
super();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
protected void revalidate(){
valid=true;
}
| Initializes the list, if needed. Does nothing, since there is no attribute to read the list from. |
public static void main(String... a) throws Exception {
TestBase.createCaller().init().test();
}
| Run just this test. |
@NonNull public static Animator alpha(float alpha){
return alpha(alpha,0);
}
| Sets view alpha to specified value instantly |
@Override public boolean equals(Object obj){
if (obj instanceof Video) {
Video other=(Video)obj;
return Objects.equal(name,other.name) && Objects.equal(url,other.url) && duration == other.duration;
}
else {
return false;
}
}
| Two Videos are considered equal if they have exactly the same values for their name, url, and duration. |
public List transform(OrganoProductor[] organosProductores){
List ltOrganosProductores=new ArrayList();
if (organosProductores != null) {
for (int i=0; i < organosProductores.length; i++) {
OrganoProductor organoProductor=(OrganoProductor)organosProductores[i];
OrganoProductorImpl organoProductorImp... | Transforma una lista de organos productores procedentes del API en una lista de objetos que implemementan el interfaz de organos productores |
private boolean parseZoneLine(Scanner s,List<TZDBZone> zoneList){
TZDBZone zone=new TZDBZone();
zoneList.add(zone);
zone.standardOffset=parseOffset(s.next());
String savingsRule=parseOptional(s.next());
if (savingsRule == null) {
zone.fixedSavingsSecs=0;
zone.savingsRule=null;
}
else {
try {
... | Parses a Zone line. |
protected VisualizePanel createPanel(Instances data) throws Exception {
VisualizePanel result=new ThresholdVisualizePanel();
PlotData2D plot=new PlotData2D(data);
plot.setPlotName("Micro-averaged Performance");
plot.m_displayAllPoints=true;
boolean[] connectPoints=new boolean[data.numInstances()];
for (int ... | Creates a panel displaying the data. |
public Bundle onSaveInstanceState(){
Bundle bundle=new Bundle();
bundle.putBoolean(DIALOG_SHOWING_TAG,mShowing);
if (mCreated) {
bundle.putBundle(DIALOG_HIERARCHY_TAG,mWindow.saveHierarchyState());
}
return bundle;
}
| Saves the state of the dialog into a bundle. The default implementation saves the state of its view hierarchy, so you'll likely want to call through to super if you override this to save additional state. |
public static BoundThisTypeRef createBoundThisTypeRefStructural(ParameterizedTypeRef actualThisTypeRef,ThisTypeRefStructural thisTypeStructural){
if (actualThisTypeRef == null) {
throw new NullPointerException("Actual this type must not be null!");
}
BoundThisTypeRef boundThisTypeRef=TypeRefsFactory.eINSTANCE... | Creates a new this type reference bound to the given actual type. |
public Matrix3f rotationZYX(float angleZ,float angleY,float angleX){
float cosZ=(float)Math.cos(angleZ);
float sinZ=(float)Math.sin(angleZ);
float cosY=(float)Math.cos(angleY);
float sinY=(float)Math.sin(angleY);
float cosX=(float)Math.cos(angleX);
float sinX=(float)Math.sin(angleX);
float m_sinZ=-sinZ;
... | Set this matrix to a rotation of <code>angleZ</code> radians about the Z axis, followed by a rotation of <code>angleY</code> radians about the Y axis and followed by a rotation of <code>angleX</code> radians about the X axis. <p> When used with a right-handed coordinate system, the produced rotation will rotate a vecto... |
public ToStringBuilder append(String fieldName,short[] array,boolean fullDetail){
style.append(buffer,fieldName,array,BooleanUtils.toBooleanObject(fullDetail));
return this;
}
| <p>Append to the <code>toString</code> a <code>short</code> array.</p> <p>A boolean parameter controls the level of detail to show. Setting <code>true</code> will output the array in full. Setting <code>false</code> will output a summary, typically the size of the array. |
public void add(BaseBlock... blocks){
for ( BaseBlock block : blocks) {
add(block);
}
}
| Add the given blocks to the list of criteria. |
protected boolean beforeSave(boolean newRecord){
if (!isInstanceAttribute() && (isSerNo() || isLot() || isGuaranteeDate())) setIsInstanceAttribute(true);
return true;
}
| Before Save. - set instance attribute flag |
public PaymentChannelServerState(TransactionBroadcaster broadcaster,Wallet wallet,ECKey serverKey,long minExpireTime){
this.state=State.WAITING_FOR_REFUND_TRANSACTION;
this.serverKey=checkNotNull(serverKey);
this.wallet=checkNotNull(wallet);
this.broadcaster=checkNotNull(broadcaster);
this.minExpireTime=minEx... | Creates a new state object to track the server side of a payment channel. |
public void commit(){
if (database != null) {
lastModificationId=database.getNextModificationDataId();
}
}
| Mark the transaction as committed, so that the modification counter of the database is incremented. |
public void testLastMessageAcked() throws JMSException {
connection.start();
Session session=connection.createSession(false,ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
Queue queue=session.createQueue(getQueueName());
MessageProducer producer=session.createProducer(queue);
TextMessage msg1=session.createTextMessa... | Tests if acknowledged messages are being consumed. |
public boolean isAlwaysUpdateable(){
if (isVirtualColumn() || !m_vo.IsUpdateable) return false;
return m_vo.IsAlwaysUpdateable;
}
| Is Always Updateable |
public static String convertTime(int time){
time/=1000;
int minute=time / 60;
int second=time % 60;
minute%=60;
return String.format("%02d:%02d",minute,second);
}
| convert time str |
protected synchronized void putJarTypeInfo(IJavaElement type,Object info){
this.cache.jarTypeCache.put(type,info);
}
| Remember the info for the jar binary type |
protected boolean activateAccelerometer(){
if (mSensorManager != null && mSensorManager.registerListener(this,mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),(int)(mAccelerometerInterval * 1000.0f))) return true;
PLLog.debug("PLView::activateAccelerometer","Accelerometer sensor is not available on the ... | accelerometer methods |
public static void addEmojis(Context context,Spannable text,int emojiSize,int emojiAlignment,int textSize,int index,int length){
addEmojis(context,text,emojiSize,emojiAlignment,textSize,index,length,false);
}
| Convert emoji characters of the given Spannable to the according emojicon. |
protected void notifyReceivedMsg(MqttWireMessage message) throws MqttException {
final String methodName="notifyReceivedMsg";
this.lastInboundActivity=System.currentTimeMillis();
log.fine(CLASS_NAME,methodName,"651",new Object[]{new Integer(message.getMessageId()),message});
if (!quiescing) {
if (message in... | Called by the CommsReceiver when a message has been received. Handles inbound messages and other flows such as PUBREL. |
private void clearCache(){
getCacheForEntryById().clear();
getCacheForEntryByParentId().clear();
getCacheForDeletedEntries().clear();
getCacheForUserById().clear();
}
| Clear the cache of records that have been created, modified or queried during the transaction. |
public static boolean isRunningMacOSX(){
return System.getProperty("os.name").startsWith("Mac");
}
| Determines whether the program is running in Windows. |
public static void visitClassLiteral(MethodVisitor mv,ClassNode classNode){
if (ClassHelper.isPrimitiveType(classNode)) {
mv.visitFieldInsn(GETSTATIC,getClassInternalName(ClassHelper.getWrapper(classNode)),"TYPE","Ljava/lang/Class;");
}
else {
mv.visitLdcInsn(org.objectweb.asm.Type.getType(getTypeDescripti... | Visits a class literal. If the type of the classnode is a primitive type, the generated bytecode will be a GETSTATIC Integer.TYPE. If the classnode is not a primitive type, we will generate a LDC instruction. |
public boolean isPsuedoVarRef(){
java.lang.String ns=m_qname.getNamespaceURI();
if ((null != ns) && ns.equals(PSUEDOVARNAMESPACE)) {
if (m_qname.getLocalName().startsWith("#")) return true;
}
return false;
}
| Tell if this is a psuedo variable reference, declared by Xalan instead of by the user. |
public static boolean isSupplementaryCodePoint(int codePoint){
return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT && codePoint < MAX_CODE_POINT + 1;
}
| Determines whether the specified character (Unicode code point) is in the <a href="#supplementary">supplementary character</a> range. |
public void updateAmountCost(){
if (movementQuantity.signum() > 0) {
costDetail.setCostAmt(costDetail.getAmt().subtract(costDetail.getCostAdjustment()));
costDetail.setCostAmtLL(costDetail.getAmtLL().subtract(costDetail.getCostAdjustmentLL()));
}
else if (movementQuantity.signum() < 0) {
costDetail.s... | Update Cost Amt |
@SuppressWarnings({"UseOfSystemOutOrSystemErr","HardCodedStringLiteral","CallToPrintStackTrace","UseOfObsoleteCollectionType"}) public static void main(String[] args){
if (args.length != 2) {
System.err.println("Invalid amount of arguments: " + Arrays.asList(args));
System.exit(ERROR_EXIT_CODE);
}
int por... | The application entry point |
protected void replaceText(CharSequence text){
switch (mAutoCompleteMode) {
case AUTOCOMPLETE_MODE_SINGLE:
((InternalAutoCompleteTextView)mInputView).superReplaceText(text);
break;
case AUTOCOMPLETE_MODE_MULTI:
((InternalMultiAutoCompleteTextView)mInputView).superReplaceText(text);
break;
}
}
| <p>Performs the text completion by replacing the current text by the selected item. Subclasses should override this method to avoid replacing the whole content of the edit box.</p> |
protected StepExecution(){
}
| Don't use! Only here because required by JPA. |
@Override public void addEdge(final InstructionGraphEdge edge){
super.addEdge(edge);
}
| Adds an instruction edge to the instruction graph. |
public AccountInfo(final Account a){
id=a.getId();
fullName=a.getFullName();
preferredEmail=a.getPreferredEmail();
username=a.getUserName();
}
| Create an account description from a real data store record. |
public int hammingWeightB(int n){
int res=0;
for (int i=0; i < 32; i++) if ((n >>> i & 0x1) == 1) res++;
return res;
}
| Most straight forward solution Iterate 32 times to check each digit in n |
private ResourceImpl aggregate(ResourceImpl resourceA,ResourceImpl resourceB) throws NotFoundException {
final String typeId=resourceA.getType();
final ResourceType resourceType=getResourceType(typeId);
return resourceType.aggregate(resourceA,resourceB);
}
| Aggregates two resources which have the same type. |
public void addValue(String key,boolean val,String comment) throws HeaderCardException {
addHeaderCard(key,new HeaderCard(key,val,comment));
}
| Add or replace a key with the given boolean value and comment. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
@Override public boolean equals(Object obj){
if (obj == null) {
return false;
}
else if (obj instanceof String) {
String theString=(String)obj;
return toString().equalsIgnoreCase(theString);
}
else if (obj instanceof MailAddress) {
MailAddress addr=(MailAddress)obj;
return getLocalPart()... | Indicates whether some other object is "equal to" this one. Note that this implementation breaks the general contract of the <code>equals</code> method by allowing an instance to equal to a <code>String</code>. It is recommended that implementations avoid relying on this design which may be removed in a future release. |
public static void time(ErrorMessages message,Timer time){
if (Options.time) {
String msg=ErrorMessages.get(message,time.toString());
out.println(msg);
}
}
| Report time statistic data. |
public SaveVisionWorldAsAction(final VisionWorldDesktopComponent desktopComponent){
super("Save As...");
if (desktopComponent == null) {
throw new IllegalArgumentException("Desktop component must not be null");
}
this.desktopComponent=desktopComponent;
putValue(SMALL_ICON,ResourceManager.getImageIcon("Sav... | Create a new create pixel matrix action. |
protected void processBDDPLists(){
int count=0;
Set<NodePortTuple> nptList=new HashSet<NodePortTuple>();
while (count < BDDP_TASK_SIZE && quarantineQueue.peek() != null) {
NodePortTuple npt;
npt=quarantineQueue.remove();
if (!toRemoveFromQuarantineQueue.remove(npt)) {
sendDiscoveryMessage(npt.ge... | This method processes the quarantine list in bursts. The task is at most once per BDDP_TASK_INTERVAL. One each call, BDDP_TASK_SIZE number of switch ports are processed. Once the BDDP packets are sent out through the switch ports, the ports are removed from the quarantine list. |
public Counter newCounter(String key){
return new UnsynchronizedLongCounter(key);
}
| Generate a new counter. |
public Provider<TypeDefinitionGitLocationProvider> provideTypeDefinitionGitLocationProvider(){
return Access.contributedProvider(TypeDefinitionGitLocationProvider.class);
}
| Binds the type definition Git location provider. |
public List<NamedRelatedResourceRep> listStoragePools(URI id){
StoragePoolList response=client.get(StoragePoolList.class,getIdUrl() + "/storage-pools",id);
return defaultList(response.getPools());
}
| Lists the storage pools for the given file virtual pool by ID. <p> API Call: <tt>GET /file/vpools/{id}/storage-pools</tt> |
public static String buildUiResourceUriPrefixPath(Service service){
return buildUiResourceUriPrefixPath(service.getClass());
}
| Compute URI prefix for static resources of a service. |
public double distance(final Double2D p){
final double dx=(double)this.x - p.x;
final double dy=(double)this.y - p.y;
return Math.sqrt(dx * dx + dy * dy);
}
| Returns the distance FROM this MutableInt2D TO the specified point. |
private boolean checkBreachDuration(double threshold,Trigger t){
long expectedBreachDuration=t.getBreachDurationSecs() * 1000L;
Long breachStartTime=this.breachCounterMap.get(t.generateKey());
if (null == breachStartTime) {
setBreachStartTime(t,Long.valueOf(System.currentTimeMillis()));
logger.debug("Set ... | Check if the metric value is greater than the upper threshold or less than the lower threshold for the breach duration |
public static boolean handleEvaluationVersion(final Window parent){
if (isBetaVersion() && hasExpired()) {
CMessageBox.showInformation(parent,String.format("Your beta version of %s has expired.",Constants.PROJECT_NAME_VERSION));
return false;
}
return true;
}
| Handles everything that is necessary for expired and non-expired evaluation version. |
public void stop(){
stopped=true;
focusing=false;
cancelOutstandingTask();
if (useAutoFocus) {
try {
camera.cancelAutoFocus();
}
catch ( RuntimeException re) {
Log.w(TAG,"Unexpected exception while cancelling focusing",re);
}
}
}
| Stop auto-focus. |
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
doGet(request,response);
}
| The doPost method of the servlet. <br> This method is called when a form has its tag value method equals to post. |
public void doPut(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
doGet(request,response);
}
| Put - Processes Get |
public static void onlyNominalAttributes(Attributes attributes,String task) throws OperatorException {
for ( Attribute attribute : attributes) {
if (!Ontology.ATTRIBUTE_VALUE_TYPE.isA(attribute.getValueType(),Ontology.NOMINAL)) {
throw new UserError(null,103,task,attribute.getName());
}
}
}
| The attributes all have to be nominal or binary. |
public void startElement(StylesheetHandler handler,String uri,String localName,String rawName,Attributes attributes) throws org.xml.sax.SAXException {
setPropertiesFromAttributes(handler,rawName,attributes,this);
try {
Source sourceFromURIResolver=getSourceFromUriResolver(handler);
String hrefUrl=getBaseURI... | Receive notification of the start of an xsl:include element. |
public static String enumToCounter(Enum e){
return e.name();
}
| Convert an Enum to the counter portion of its name. |
protected void processPacket(Packet packet){
if (packet == null) {
return;
}
while (!resultQueue.offer(packet)) {
resultQueue.poll();
}
}
| Processes a packet to see if it meets the criteria for this packet collector. If so, the packet is added to the result queue. |
public static void editLocalEdgeComment(final AbstractSQLProvider provider,final INaviEdge edge,final Integer commentId,final Integer userId,final String newComment) throws CouldntSaveDataException {
Preconditions.checkNotNull(provider,"IE00856: provider argument can not be null");
Preconditions.checkNotNull(edge,"... | This function edits a local edge comment which is associated with the edge provided as argument. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.