code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public static long checkArgumentNonnegative(final long value,final String errorMessage){
if (value < 0) {
throw new IllegalArgumentException(errorMessage);
}
return value;
}
| Ensures that that the argument numeric value is non-negative. |
public void stopJumping(){
for ( JumpingBeansSpan bean : jumpingBeans) {
if (bean != null) {
bean.teardown();
}
}
cleanupSpansFrom(textView.get());
}
| Stops the jumping animation and frees up the animations. |
private void handleScreenOn(){
mSpeechController.setScreenIsOn(true);
final SpannableStringBuilder builder=new SpannableStringBuilder();
if (isIdle()) {
if (Settings.Secure.getInt(mContext.getContentResolver(),Settings.Secure.DEVICE_PROVISIONED,0) != 0) {
appendCurrentTimeAnnouncement(builder);
}
e... | Handles when the screen is turned on. Announces the current time and the current ringer state when phone is idle. |
protected void storeImageReplacedElement(Element e,ReplacedElement cc){
System.out.println("\n*** Cached image for element");
imageComponents.put(e,cc);
}
| Adds a ReplacedElement containing an image to a cache of images for quick lookup. |
public String historyString(){
StringBuilder sb=new StringBuilder();
String nl=System.getProperty("line.separator");
Stack<Featurizable<TK,FV>> featurizables=featurizables();
Featurizable<TK,FV> f=null;
while (!featurizables.isEmpty()) {
f=featurizables.pop();
sb.append(f.rule).append(nl);
}
retur... | Print out list of rules participating in building up this translation Useful for JointNNLM model |
public TvListing(List<Channel> channels,List<Program> programs){
this.channels=channels;
Iterator<Channel> xmlTvChannelIterator=channels.iterator();
while (xmlTvChannelIterator.hasNext()) {
Channel tvChannel=xmlTvChannelIterator.next();
if (tvChannel.getInternalProviderData() == null) {
Log.e(TAG,tv... | Constructs a listing with a list of channels and programs |
public void sync(){
checkOpen();
FileStore f=fileStore;
if (f != null) {
f.sync();
}
}
| Force all stored changes to be written to the storage. The default implementation calls FileChannel.force(true). |
public static Stats of(Iterator<? extends Number> values){
StatsAccumulator accumulator=new StatsAccumulator();
accumulator.addAll(values);
return accumulator.snapshot();
}
| Returns statistics over a dataset containing the given values. |
@Override protected void validate(){
failIf(this.value < 1,"Must have at least one gc thread");
}
| Only accept values of 1 or higher. |
public JSONObject put(String name,int value){
put(name,JSON.value(value));
return this;
}
| Appends a new member to the end of this object, with the specified name and the JSON representation of the specified <code>int</code> value. <p> This method <strong>does not prevent duplicate names</strong>. Calling this method with a name that already exists in the object will append another member with the same name.... |
public ZoomToFitControl(String group,int margin,long duration,int button){
this.m_group=group;
this.m_margin=margin;
this.m_duration=duration;
this.m_button=button;
}
| Create a new ZoomToFitControl. |
public void notifyClientsOffline(){
for ( MqttConnection connection : connections.values()) {
connection.offline();
}
}
| Notify clients we're offline |
public BarChartSetter(final int index){
this.index=index;
}
| Construct a setter object. |
public static VOServiceFeedback toVOServiceFeedback(Product product,PlatformUser currentUser){
Product template=product.getTemplateOrSelf();
ProductFeedback domainObject=template.getProductFeedback();
VOServiceFeedback valueObject=createEmptyValueObject();
mapProductKey(product,valueObject);
if (domainObject ... | Constructs a new transfer object and copies all values from the given domain object. |
public static int installSilent(Context context,String filePath,String pmParams){
if (filePath == null || filePath.length() == 0) {
return INSTALL_FAILED_INVALID_URI;
}
File file=new File(filePath);
if (file == null || file.length() <= 0 || !file.exists() || !file.isFile()) {
return INSTALL_FAILED_INVAL... | install package silent by root <ul> <strong>Attentions:</strong> <li>Don't call this on the ui thread, it may costs some times.</li> <li>You should add <strong>android.permission.INSTALL_PACKAGES</strong> in manifest, so no need to request root permission, if you are system app.</li> </ul> |
public boolean isRemitTo(){
Object oo=get_Value(COLUMNNAME_IsRemitTo);
if (oo != null) {
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
| Get Remit-To Address. |
public boolean equals(Object arg){
if (arg == this) return true;
if (arg == null || !(arg instanceof Name)) return false;
Name d=(Name)arg;
if (d.hashcode == 0) d.hashCode();
if (hashcode == 0) hashCode();
if (d.hashcode != hashcode) return false;
if (d.labels() != labels()) return false;
re... | Are these two Names equivalent? |
public void add(Token token,String suggestion,int docFreq){
LinkedHashMap<String,Integer> map=this.suggestions.get(token);
if (map == null) {
map=new LinkedHashMap<>();
this.suggestions.put(token,map);
}
map.put(suggestion,docFreq);
}
| Suggestions must be added with the best suggestion first. ORDER is important. |
@SuppressWarnings("unchecked") public void shouldThrowOnNonRetriableFailure() throws Throwable {
when(service.connect()).thenThrow(ConnectException.class,ConnectException.class,IllegalStateException.class);
RetryPolicy retryPolicy=new RetryPolicy().retryOn(ConnectException.class);
assertThrows(null,FailsafeExcept... | Asserts that retries are performed then a non-retryable failure is thrown. |
public void writeAuth(CCacheOutputStream cos) throws IOException {
for (int i=0; i < entry.length; i++) {
entry[i].writeEntry(cos);
}
}
| Writes <code>AuthorizationData</code> data fields to a output stream. |
private void validateTag(final ITreeNode<CTag> tag){
Preconditions.checkNotNull(tag,"IE00859: Tag argument can't be null");
Preconditions.checkNotNull(tag.getObject(),"IE00860: Tag object can't be null");
Preconditions.checkArgument(tag.getObject().getType() == m_type,"IE00861: Tag has an incorrect type");
Prec... | Makes sure that a tag is a valid tag in the context of this tag manager. |
private void updateProgress(String progressLabel,int progress){
if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) {
myHost.updateProgress(progressLabel,progress);
}
previousProgress=progress;
previousProgressLabel=progressLabel;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
protected void exitForm(Form f){
}
| This method allows binding an action that should occur before leaving the given form, e.g. memory cleanup |
public int diff_commonSuffix(String text1,String text2){
int text1_length=text1.length();
int text2_length=text2.length();
int n=Math.min(text1_length,text2_length);
for (int i=1; i <= n; i++) {
if (text1.charAt(text1_length - i) != text2.charAt(text2_length - i)) {
return i - 1;
}
}
return n;... | Determine the common suffix of two strings |
public static String createPath(final String... pathElements){
return createPath(pathElements,File.separator);
}
| Creates a path with the given path elements delimited with File.separator. </p> |
public byte[] readBlock(String id,int version,long block){
if (id == null) throw new IllegalArgumentException();
final IKeyBuilder keyBuilder=getFileDataIndex().getIndexMetadata().getKeyBuilder();
final byte[] fromKey=keyBuilder.reset().appendText(id,true,false).append(version).append(block).getKey();
final b... | Atomic read of a block for a file version. |
public static void mergeSort(int[] a,int fromIndex,int toIndex){
rangeCheck(a.length,fromIndex,toIndex);
int aux[]=(int[])a.clone();
mergeSort1(aux,a,fromIndex,toIndex);
}
| Sorts the specified range of the specified array of elements. <p>This sort is guaranteed to be <i>stable</i>: equal elements will not be reordered as a result of the sort.<p> The sorting algorithm is a modified mergesort (in which the merge is omitted if the highest element in the low sublist is less than the lowest e... |
public static final long cores(){
return runtime.availableProcessors();
}
| get number of CPU cores |
public DockerContainersUtil filterByImage(String pattern){
if (this.containers == null) {
return this;
}
List<Container> matched=new ArrayList<>();
for ( Container container : containers) {
if (container.getImage().matches(pattern)) {
matched.add(container);
}
}
return new DockerContainer... | Filters the set based on the constainer name |
public static List<Attachment> findByContainer(ResourceType containerType,String containerId){
List<Attachment> cachedData=AttachmentCache.get(containerType,containerId);
if (cachedData != null) {
return cachedData;
}
List<Attachment> list=find.where().eq("containerType",containerType).eq("containerId",cont... | Gets all attachments from a container. |
public static Number count(short[] self,Object value){
return count(InvokerHelper.asIterator(self),value);
}
| Counts the number of occurrences of the given value inside this array. Comparison is done using Groovy's == operator (using <code>compareTo(value) == 0</code> or <code>equals(value)</code> ). |
public void onAddHostWelcomeNext(){
switchToFragment(new AddHostFragmentZeroconf());
}
| Welcome fragment callbacks |
private void init(){
if (!Strings.isNullOrEmpty(excelInputreaderConfig.columnList)) {
String[] columnsList=excelInputreaderConfig.columnList.split(",");
inputColumns=Arrays.asList(columnsList);
}
if (!Strings.isNullOrEmpty(excelInputreaderConfig.columnMapping)) {
String[] mappings=excelInputreaderConf... | Initialize and set maps from input config object |
public Name add(int posn,String comp) throws InvalidNameException {
Rdn rdn=(new Rfc2253Parser(comp)).parseRdn();
rdns.add(posn,rdn);
unparsed=null;
return this;
}
| Adds a single component at a specified position within this LDAP name. Components of this LDAP name at or after the index (if any) of the new component are shifted up by one (away from index 0) to accommodate the new component. |
public WFLine(MWFNodeNext next){
m_next=next;
setFocusable(false);
m_description=next.getDescription();
if (m_description != null && m_description.length() > 0) m_description="{" + String.valueOf(next.getSeqNo()) + ": "+ m_description+ "}";
}
| Create Line |
public static void $unzip(String zipFilePath,String destPath) throws IOException {
File destFile=new File(destPath);
if (!destFile.exists()) {
destFile.mkdirs();
}
ZipInputStream zipInputStream=new ZipInputStream(new FileInputStream(zipFilePath));
ZipEntry zipEntry;
String zipEntryName;
while ((zipEnt... | unzip zip file to dest folder |
protected boolean[] canHandleClassAsNthAttribute(boolean nominalPredictor,boolean numericPredictor,boolean stringPredictor,boolean datePredictor,boolean relationalPredictor,boolean multiInstance,int classType,int classIndex){
if (classIndex == TestInstances.CLASS_IS_LAST) {
print("class attribute as last attribut... | Checks whether the scheme can handle class attributes as Nth attribute. |
public Approximator(ApproximatorType type,double tolerance){
setup(type,tolerance);
}
| Initializes the approximator with the given type and tolerance. If toleranec <= 0, no filtering will be done. |
public void handleDOMNodeInsertedEvent(MutationEvent evt){
if (evt.getTarget() instanceof Element) {
handleElementAdded((CompositeGraphicsNode)node,e,(Element)evt.getTarget());
}
else {
super.handleDOMNodeInsertedEvent(evt);
}
}
| Invoked when an MutationEvent of type 'DOMNodeInserted' is fired. |
public BindableRockerModel __body(RockerContent __body){
return bind("__body",__body);
}
| Do not use this method in your controller code. Intended for internal use. |
public void addToHistory(CAS cas,HistoryEvent event){
try {
getDocumentHistory(cas.getJCas()).add(event);
}
catch ( CASException e) {
monitor.error("Unable to add to history on add",e);
}
}
| Adds a event to the history for this CAS document. |
public String format(EmrVpcPricingState emrVpcPricingState){
StringBuilder builder=new StringBuilder();
builder.append(String.format("Subnet IP Availability:%n"));
for ( Map.Entry<String,Integer> subnet : emrVpcPricingState.getSubnetAvailableIpAddressCounts().entrySet()) {
builder.append(String.format("\t%s=... | Formats a EMR VPC pricing state into a human readable string. |
public static ToHitData nightModifiers(IGame game,Targetable target,AmmoType atype,Entity attacker,boolean isWeapon){
ToHitData toHit=null;
Entity te=null;
if (target.getTargetType() == Targetable.TYPE_ENTITY) {
te=(Entity)target;
}
toHit=new ToHitData();
int lightCond=game.getPlanetaryConditions().getL... | used by the toHit of derived classes atype may be null if not using an ammo based weapon |
public TabSet(TabStop[] tabs){
if (tabs != null) {
int tabCount=tabs.length;
this.tabs=new TabStop[tabCount];
System.arraycopy(tabs,0,this.tabs,0,tabCount);
}
else this.tabs=null;
}
| Creates and returns an instance of TabSet. The array of Tabs passed in must be sorted in ascending order. |
public Instruction firstInstructionInCodeOrder(){
return firstBasicBlockInCodeOrder().firstInstruction();
}
| Return the first instruction with respect to the current code linearization order. |
public static void createTaskFile(@NotNull final VirtualFile taskDir,@NotNull final File resourceRoot,@NotNull final String name) throws IOException {
String systemIndependentName=FileUtil.toSystemIndependentName(name);
final int index=systemIndependentName.lastIndexOf("/");
if (index > 0) {
systemIndependent... | Creates task files in its task folder in project user created |
private int refreshFileList(){
File[] files=null;
try {
files=new File(path).listFiles();
}
catch ( Exception e) {
files=null;
}
if (files == null) {
Toast.makeText(getContext(),sOnErrorMsg,Toast.LENGTH_SHORT).show();
return -1;
}
if (list != null) {
list.clear();
}
else {
lis... | Refresh the file list in Window |
public boolean pop(){
return backStack.pop(parentKey);
}
| Pops the last fragment added to the back stack, reattaching the previous one if it exists. This is only scoped to this container. |
public static boolean runQueryOnInstance(QueryWrapper queryWrapper,Model queryModel,Model newTriples,Resource instance,boolean checkContains){
boolean changed=false;
QuerySolutionMap bindings=new QuerySolutionMap();
bindings.add(SPIN.THIS_VAR_NAME,instance);
Map<String,RDFNode> initialBindings=queryWrapper.getT... | Runs a given Jena Query on a given instance and adds the inferred triples to a given Model. |
public static void verifyValueBounds(DateTimeField field,int value,int lowerBound,int upperBound){
if ((value < lowerBound) || (value > upperBound)) {
throw new IllegalFieldValueException(field.getType(),Integer.valueOf(value),Integer.valueOf(lowerBound),Integer.valueOf(upperBound));
}
}
| Verify that input values are within specified bounds. |
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
int size=s.readInt();
allocateElements(size);
head=0;
tail=size;
for (int i=0; i < size; i++) elements[i]=s.readObject();
}
| Deserialize this deque. |
public boolean hasSubject(){
return hasExtension(Subject.class);
}
| Returns whether it has the subject. |
private int readHeaders(InputStream is){
int nread=0;
log("Read headers");
while (true) {
int headerLen=0;
headerLen=parseHeader(is);
if (headerLen == -1) return -1;
nread+=headerLen;
if (headerLen <= 2) {
return nread;
}
}
}
| Read all headers from the input stream |
public boolean checkManagementExceptions(ManagementException e){
if (e.getMessage().equals(ManagementStrings.Management_Service_CLOSED_CACHE) || e.getMessage().equals(ManagementStrings.Management_Service_MANAGEMENT_SERVICE_IS_CLOSED.toLocalizedString()) || e.getMessage().equals(ManagementStrings.Management_Service_MA... | All the expected exceptions are checked here |
public RetriesLimitReachedException(int retries){
super(String.format("Reached retries limit : %d",retries));
}
| Creates a new instance. |
public final void testEqualsObject04(){
Certificate c1=new MyCertificate("TEST_TYPE",testEncoding);
assertFalse(c1.equals("TEST_TYPE"));
}
| Test for <code>equals(Object)</code> method<br> Assertion: object not equals to other which is not instance of <code>Certificate</code> |
public int decode(byte[] data,int off,int length,OutputStream out) throws IOException {
byte b1, b2, b3, b4;
int outLen=0;
int end=off + length;
while (end > off) {
if (!ignore((char)data[end - 1])) {
break;
}
end--;
}
int i=off;
int finish=end - 4;
i=nextI(data,i,finish);
while (i <... | decode the base 64 encoded byte data writing it to the given output stream, whitespace characters will be ignored. |
public boolean hasThree(){
return points.size() > 2;
}
| Determine if there are more than 2 points currently in the partial hull. |
private void putPropertyStrings(Service s){
String type=s.getType();
String algorithm=s.getAlgorithm();
super.put(type + "." + algorithm,s.getClassName());
for ( String alias : s.getAliases()) {
super.put(ALIAS_PREFIX + type + "."+ alias,algorithm);
}
for ( Map.Entry<UString,String> entry : s.attribut... | Put the string properties for this Service in this Provider's Hashtable. |
private void initNumericValue(){
if (numericValue == 0) {
numericValue=NumberUtils.stringToInt(StringUtils.trim(value));
if (numericValue == 0 && !"0".equals(value)) {
setError("Value " + value + " is not a valid number (tried to cast to java type long)");
}
}
}
| Will init a numeric value type ie port. |
public SynchronizedProtocolDecoder(ProtocolDecoder decoder){
if (decoder == null) {
throw new IllegalArgumentException("decoder");
}
this.decoder=decoder;
}
| Creates a new instance which decorates the specified <tt>decoder</tt>. |
@Override public boolean batchFinished() throws Exception {
if (getInputFormat() == null) {
throw new IllegalStateException("No input instance format defined");
}
if (m_attStats == null) {
Instances input=getInputFormat();
m_attStats=new AttributeStats[input.numAttributes()];
for (int i=0; i < inp... | Signify that this batch of input to the filter is finished. If the filter requires all instances prior to filtering, output() may now be called to retrieve the filtered instances. |
public boolean endBatchEdit(){
return false;
}
| Default implementation does nothing. |
public static void dropTable(HiveMetastoreClient ms,HiveObjectSpec spec) throws HiveMetastoreException {
ms.dropTable(spec.getDbName(),spec.getTableName(),true);
}
| Drops a table from the given Hive DB. |
public void updateAsciiStream(int columnIndex,java.io.InputStream x,int length) throws SQLException {
throw new NotUpdatable();
}
| JDBC 2.0 Update a column with an ascii stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database. |
public ReadRequest clone(){
ReadRequest result=new ReadRequest();
result.RequestHeader=RequestHeader == null ? null : RequestHeader.clone();
result.MaxAge=MaxAge;
result.TimestampsToReturn=TimestampsToReturn;
if (NodesToRead != null) {
result.NodesToRead=new ReadValueId[NodesToRead.length];
for (int i... | Deep clone |
@NotNull public PsiQuery children(@NotNull final Class<? extends PsiElement> clazz){
final List<PsiElement> result=new ArrayList<PsiElement>();
for ( final PsiElement element : myPsiElements) {
result.addAll(PsiTreeUtil.findChildrenOfType(element,clazz));
}
return new PsiQuery(result.toArray(new PsiElement... | Filter children by class |
public int iterativeSize(){
return 0;
}
| Returns the size of this IntList. |
public Object jjtAccept(ParserVisitor visitor,Object data){
return visitor.visit(this,data);
}
| Accept the visitor. * |
@Override public SocialUserDetails loadUserByUserId(String userId) throws UsernameNotFoundException, DataAccessException {
LOGGER.debug("Loading user by user id: {}",userId);
UserDetails userDetails=userDetailsService.loadUserByUsername(userId);
LOGGER.debug("Found user details: {}",userDetails);
return (Social... | Loads the username by using the account ID of the user. |
public static void deleteUmptyFoldersInFolder(File folder){
if (folder.isFile()) return;
if (folder.listFiles() == null || folder.listFiles().length <= 0) {
folder.delete();
}
else {
for ( File f : folder.listFiles()) {
if (f.isDirectory()) deleteUmptyFoldersInFolder(f);
}
}
if (... | cleans the given folder from all it's unpty folders |
public long calculateLastFetchTime(CrawlDatum datum){
return datum.getFetchTime() - (long)datum.getFetchInterval() * 1000;
}
| This method return the last fetch time of the CrawlDatum |
@Override public boolean isInfoEnabled(){
return logger.isLoggable(Level.INFO);
}
| Is this logger instance enabled for the INFO level? |
UnknownFunctionException(String i18n,Object... arguments){
super(i18n,arguments);
}
| Creates a parsing exception with message associated to the i18n and the arguments. |
public InvalidOpenTypeException(String msg){
super(msg);
}
| An InvalidOpenTypeException with a detail message. |
@Nullable public static Class<?> box(@Nullable Class<?> cls){
if (cls == null) return null;
if (!cls.isPrimitive()) return cls;
return boxedClsMap.get(cls);
}
| Gets wrapper class for a primitive type. |
public static void segregate0sAnd1s(int[] a){
for (int i=0, j=a.length - 1; i < j; i++, j--) {
if (a[i] > a[j]) {
a[i]=a[i] + a[j];
a[j]=a[i] - a[j];
a[i]=a[i] - a[j];
}
}
}
| Segregate 0s and 1s by traversing the array only once. |
public void menuDeselected(final MenuEvent arg0){
}
| Responds to menu deslected events. |
public Aggregate(){
this(IoBuffer.allocate(0).flip());
}
| Constructs a new Aggregate. |
public final synchronized void resignGame(){
if (game.getGameState() == GameState.ALIVE) {
game.processString("resign");
updateGUI();
}
}
| Resign game for current player. |
public static <E>Set<E> newSetFromMap(Map<E,Boolean> map){
if (map.isEmpty()) {
return new SetFromMap<E>(map);
}
throw new IllegalArgumentException();
}
| Answers a set backed by a map. And the map must be empty when this method is called. |
public boolean isDragEnabled(){
return mDragEnabled;
}
| Returns true if dragging is enabled for the chart, false if not. |
public boolean isSetValues(){
return this.values != null;
}
| Returns true if field values is set (has been assigned a value) and false otherwise |
public static void logFinishedTask(final SpeedTestMode mode,final long packetSize,final BigDecimal transferRateBitPerSeconds,final BigDecimal transferRateOctetPerSeconds,final Logger logger){
if (logger.isDebugEnabled()) {
switch (mode) {
case DOWNLOAD:
logger.debug("======== Download [ OK ] =============");
... | print upload/download result. |
public String toString(){
StringBuffer buf=new StringBuffer(getClass().getName());
buf.append("@");
buf.append(Integer.toHexString(hashCode()));
buf.append("[");
extendToString(buf);
buf.append("]");
return buf.toString();
}
| Converts the object to a string. |
public WebgraphConfiguration(boolean lazy){
super();
this.lazy=lazy;
}
| initialize with an empty ConfigurationSet which will cause that all the index attributes are used |
@Override public Optional<MessageUid> lastUid(MailboxSession session,Mailbox mailbox) throws MailboxException {
HTable mailboxes=null;
HBaseId mailboxId=(HBaseId)mailbox.getMailboxId();
try {
mailboxes=new HTable(conf,MAILBOXES_TABLE);
Get get=new Get(mailboxId.toBytes());
get.addColumn(MAILBOX_CF,MAI... | Returns the last message uid used in a mailbox. |
public double borderDistance(double lat,double lon){
double nsdistance;
double ewdistance;
if (south <= lat && lat <= north) {
nsdistance=0;
}
else {
nsdistance=Math.min((Math.abs(lat - north)),(Math.abs(lat - south)));
}
if (west <= lon && lon <= east) {
ewdistance=0;
}
else {
ewdistanc... | A utility method to figure out the closest distance of a border to a point. If the point is inside the rectangle, return 0. |
public static boolean isExtension(String filename,Collection<String> extensions){
if (filename == null) {
return false;
}
if (extensions == null || extensions.isEmpty()) {
return indexOfExtension(filename) == -1;
}
String fileExt=getExtension(filename);
for ( String extension : extensions) {
if... | Checks whether the extension of the filename is one of those specified. <p> This method obtains the extension as the textual part of the filename after the last dot. There must be no directory separator after the dot. The extension check is case-sensitive on all platforms. |
public void dismiss(){
if (notificationManager != null) {
notificationManager.cancel(notificationInfo.getNotificationId());
}
}
| Dismisses the current active notification |
public OpenIntIntHashMap(int initialCapacity,double minLoadFactor,double maxLoadFactor){
setUp(initialCapacity,minLoadFactor,maxLoadFactor);
}
| Constructs an empty map with the specified initial capacity and the specified minimum and maximum load factor. |
@DELETE @Path("/{token}") public void invalidateToken(@PathParam("token") String authToken) throws GuacamoleException {
if (!authenticationService.destroyGuacamoleSession(authToken)) throw new GuacamoleResourceNotFoundException("No such token.");
}
| Invalidates a specific auth token, effectively logging out the associated user. |
public static boolean playerAttack(final Player player,final RPEntity defender){
boolean result=false;
final StendhalRPZone zone=player.getZone();
if (!zone.has(defender.getID()) || (defender.getHP() == 0)) {
logger.debug("Attack from " + player + " to "+ defender+ " stopped because target was lost("+ zone.ha... | Lets the attacker try to attack the defender. |
public boolean disableImageAccessSingleStep(URI rpSystemId,URI exportGroupURI,List<URI> snapshots,boolean isRollback,String token) throws ControllerException {
try {
WorkflowStepCompleter.stepExecuting(token);
disableImageForSnapshots(rpSystemId,snapshots,isRollback,false,token);
WorkflowStepCompleter.ste... | Workflow step method for disabling an image access |
public boolean contains(int value){
return lastIndexOf(value) >= 0;
}
| Searches the list for <tt>value</tt> |
public boolean isWordToken(final BashPsiBuilder builder){
return isWordToken(builder,false);
}
| Checks whether the next tokens might belong to a word token. The upcoming tokens are not remapped. |
public RegistrationBuilder addContact(URI contact){
contacts.add(contact);
return this;
}
| Add a contact URI to the list of contacts. |
public void run(){
try {
synchronized (this) {
while (true) {
while (this.poolFile == null) {
this.wait();
if (this.poolFile == null) {
return;
}
}
ValueOutputStream vos=new ValueOutputStream(this.poolFile);
for (int i=0; i < this.buf.len... | Write "buf" to "poolFile". The objects in the queue are written using Java's object serialization facilities. |
private void initGzipFilter(ServletContext servletContext,EnumSet<DispatcherType> disps){
log.debug("Registering GZip Filter");
FilterRegistration.Dynamic compressingFilter=servletContext.addFilter("gzipFilter",new GZipServletFilter());
Map<String,String> parameters=new HashMap<>();
compressingFilter.setInitPar... | Initializes the GZip filter. |
public static void put(long[] bits,int bitIndex,boolean value){
if (value) set(bits,bitIndex);
else clear(bits,bitIndex);
}
| Sets the bit with index <tt>bitIndex</tt> in the bitvector <tt>bits</tt> to the state specified by <tt>value</tt>. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.