code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
---|---|
protected void fixupJumps(byte[] bytes2){
byte[] bytes=bytes2;
for (Iterator enumumerator=jumps.iterator(); enumumerator.hasNext(); ) {
Object[] obja=(Object[])enumumerator.next();
String label=(String)obja[0];
int target=((Integer)obja[1]).intValue();
int[] labelInfo=(int[])labels.get(label);
if (labelInfo == null) {
System.out.println("Missing label '" + label + "' in action code");
continue;
}
int absolute=labelInfo[0];
int relative=absolute - (target + 2);
byte[] val=OutStream.sintTo2Bytes(relative);
bytes[target]=val[0];
bytes[target + 1]=val[1];
}
}
| Description of the Method |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:47.828 -0500",hash_original_method="01B4469A7119F79BBDA4CF4D6616EEC2",hash_generated_method="C70CBD95926A226F6C9CF5E1BEC7E5B3") public void processingInstruction(String target,String data) throws SAXException {
if (documentHandler != null) documentHandler.processingInstruction(target,data);
}
| Adapt a SAX2 processing instruction event. |
public java.lang.String toLowerCase(){
return null;
}
| Converts all of the characters in this String to lower case. |
public double localScore(int i){
double sum=0.0;
for ( BDeuScore score : scores) {
sum+=score.localScore(i);
}
return sum / scores.size();
}
| Specialized scoring method for no parents. Used to speed up the effect edges search. |
public synchronized void add(String name,long threadId){
if (mFinished) {
throw new IllegalStateException("Marker added to finished log");
}
mMarkers.add(new Marker(name,threadId,SystemClock.elapsedRealtime()));
}
| Adds a marker to this log with the specified name. |
public int sizeInPackets(final int packetSize) throws IOException {
final int sizeInBytes=sizeInBytes();
return sizeInBytes / packetSize + ((sizeInBytes % packetSize) > 0 ? 1 : 0);
}
| Returns the total number of packets with given size that are needed to get all available data |
public Request addRequestHeader(String header,String value){
if (header == null) {
throw new NullPointerException("header cannot be null");
}
if (header.contains(":")) {
throw new IllegalArgumentException("header may not contain ':'");
}
if (value == null) {
value="";
}
mRequestHeaders.add(Pair.create(header,value));
return this;
}
| Add an HTTP header to be included with the download request. The header will be added to the end of the list. |
private boolean checkClassInstanceCreation(){
if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_BETWEEN_NEW_AND_LEFT_BRACKET) {
int length=this.identifierLengthStack[this.identifierLengthPtr];
int numberOfIdentifiers=this.genericsIdentifiersLengthStack[this.genericsIdentifiersLengthPtr];
if (length != numberOfIdentifiers || this.genericsLengthStack[this.genericsLengthPtr] != 0) {
return true;
}
TypeReference type;
if (this.invocationType == ALLOCATION) {
AllocationExpression allocExpr=new AllocationExpression();
if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER,1) == K_INSIDE_THROW_STATEMENT && topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER,1) == this.bracketDepth) {
pushOnElementStack(K_NEXT_TYPEREF_IS_EXCEPTION);
type=getTypeReference(0);
popElement(K_NEXT_TYPEREF_IS_EXCEPTION);
}
else {
type=getTypeReference(0);
}
if (type instanceof CompletionOnSingleTypeReference) {
((CompletionOnSingleTypeReference)type).isConstructorType=true;
}
else if (type instanceof CompletionOnQualifiedTypeReference) {
((CompletionOnQualifiedTypeReference)type).isConstructorType=true;
}
allocExpr.type=type;
allocExpr.sourceStart=type.sourceStart;
allocExpr.sourceEnd=type.sourceEnd;
pushOnExpressionStack(allocExpr);
this.isOrphanCompletionNode=false;
}
else {
QualifiedAllocationExpression allocExpr=new QualifiedAllocationExpression();
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
pushOnGenericsLengthStack(0);
if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER,1) == K_INSIDE_THROW_STATEMENT && topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER,1) == this.bracketDepth) {
pushOnElementStack(K_NEXT_TYPEREF_IS_EXCEPTION);
type=getTypeReference(0);
popElement(K_NEXT_TYPEREF_IS_EXCEPTION);
}
else {
type=getTypeReference(0);
}
if (type instanceof CompletionOnSingleTypeReference) {
((CompletionOnSingleTypeReference)type).isConstructorType=true;
}
allocExpr.type=type;
allocExpr.enclosingInstance=this.expressionStack[this.qualifier];
allocExpr.sourceStart=this.intStack[this.intPtr--];
allocExpr.sourceEnd=type.sourceEnd;
this.expressionStack[this.qualifier]=allocExpr;
this.isOrphanCompletionNode=false;
}
this.assistNode=type;
this.lastCheckPoint=type.sourceEnd + 1;
popElement(K_BETWEEN_NEW_AND_LEFT_BRACKET);
return true;
}
return false;
}
| Checks if the completion is on the type following a 'new'. Returns whether we found a completion node. |
public int treeNumber(){
if (owner == null) return NO_TREENUM;
if (owner.trees == null) return NO_TREENUM;
for (int x=0; x < owner.trees.length; x++) if (owner.trees[x] == this) return x;
return NO_TREENUM;
}
| An expensive function which determines my tree number -- only use for errors, etc. Returns ec.gp.GPTree.NO_TREENUM if the tree number could not be determined (might happen if it's not been assigned yet). |
public RolloutRenderer(final RendererClickListener listener){
this();
addClickListener(listener);
}
| Creates a new custom object renderer and adds the given click listener to it. |
public boolean equals(Object o){
IntCharSet set=(IntCharSet)o;
return intervals.equals(set.intervals);
}
| o instanceof Interval |
public void addExtendedProperty(ExtendedProperty extendedProperty){
getExtendedProperties().add(extendedProperty);
}
| Adds a new contact extended property. |
@Override public boolean eIsSet(int featureID){
switch (featureID) {
case N4JSPackage.POSTFIX_EXPRESSION__EXPRESSION:
return expression != null;
case N4JSPackage.POSTFIX_EXPRESSION__OP:
return op != OP_EDEFAULT;
}
return super.eIsSet(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public void syncBeforeInvoke(){
copyTagToPageScope(VariableInfo.NESTED);
copyTagToPageScope(VariableInfo.AT_BEGIN);
}
| Synchronize variables before fragment invokation |
private boolean keyChainContainsPrivateKey(Collection<ECKey> keyChain,ECKey keyToAdd){
if (keyChain == null || keyToAdd == null) {
return false;
}
else {
for ( ECKey loopKey : keyChain) {
if (Arrays.equals(keyToAdd.getPrivKeyBytes(),loopKey.getPrivKeyBytes())) {
return true;
}
}
return false;
}
}
| This method is here because there is no equals on ECKey. |
public LuceneLevenshteinDistance(){
}
| Creates a new comparator, mimicing the behavior of Lucene's internal edit distance. |
public File resolve(String name,boolean isModule){
if (isModule && name.endsWith(".tla")) {
name=name.substring(0,name.length() - 4);
}
String sourceFileName;
if (isModule) {
sourceFileName=name + ".tla";
}
else {
sourceFileName=name;
}
File sourceFile=locate(sourceFileName);
return sourceFile;
}
| Tries to find the specified module. Starts in work directory and then looks up in to the library paths for modules. |
public SocialShare image(Uri imageUri){
if (imageUri == null) throw new IllegalArgumentException("imageUri == null");
if (this.uri != null) throw new IllegalStateException("Not allowed multiple uri's");
this.uri=imageUri;
this.mimeType=Mime.ANY_IMAGE;
return this;
}
| Sets the image to share. This can only be called once, and you can only share a video or an image. Not both. |
public Model(DatasetGenerator datasetGenerator){
this.datasetGenerator=datasetGenerator;
columnNames[0]="";
columnNames[1]="";
for (int metric=DatasetGenerator.METRIC_FIRST; metric <= DatasetGenerator.METRIC_LAST; ++metric) {
String metricName=DatasetGenerator.getMetricNameWithUnit(metric);
int c=metricToColumn(metric);
columnNames[c]=metricName;
datasets[metric - DatasetGenerator.METRIC_FIRST]=datasetGenerator.newCategoryDataset(metric,false);
}
update();
}
| It creates a new instance of this table model. |
public ItemStreamRequest(final String requestUrl,final IOneDriveClient client,final List<Option> options){
super(requestUrl,client,options);
}
| The request for the ItemStream |
public boolean removeNeighbour(Triangle triangle){
return getNeighbours().remove(triangle);
}
| Remove a neighbour triangle of the triangle. |
protected void parseDefineFunction(InStream in) throws IOException {
String name=in.readString();
int paramCount=in.readUI16();
String[] params=new String[paramCount];
for (int i=0; i < params.length; i++) {
params[i]=in.readString();
}
actions.startFunction(name,params);
blockDepth++;
}
| Description of the Method |
private void validateQuietZone(BitArray row,int startPattern) throws NotFoundException {
int quietCount=this.narrowLineWidth * 10;
for (int i=startPattern - 1; quietCount > 0 && i >= 0; i--) {
if (row.get(i)) {
break;
}
quietCount--;
}
if (quietCount != 0) {
throw NotFoundException.getNotFoundInstance();
}
}
| The start & end patterns must be pre/post fixed by a quiet zone. This zone must be at least 10 times the width of a narrow line. Scan back until we either get to the start of the barcode or match the necessary number of quiet zone pixels. Note: Its assumed the row is reversed when using this method to find quiet zone after the end pattern. ref: http://www.barcode-1.net/i25code.html |
protected SystemMember removeSystemMember(InternalDistributedMember internalId){
if (internalId == null) return null;
boolean found=false;
SystemMemberImpl member=null;
synchronized (this.cacheServerSet) {
SERVERS: for (Iterator iter=this.cacheServerSet.iterator(); iter.hasNext() && !found; ) {
Future future=(Future)iter.next();
if (future instanceof AdminFutureTask) {
AdminFutureTask task=(AdminFutureTask)future;
if (task.getMemberId().equals(internalId)) {
future.cancel(true);
}
else {
continue SERVERS;
}
}
for (; ; ) {
checkCancellation();
boolean interrupted=Thread.interrupted();
try {
member=(SystemMemberImpl)future.get();
break;
}
catch ( InterruptedException ex) {
interrupted=true;
continue;
}
catch ( CancellationException ex) {
continue SERVERS;
}
catch ( ExecutionException ex) {
handle(ex);
return null;
}
finally {
if (interrupted) {
Thread.currentThread().interrupt();
}
}
}
InternalDistributedMember cacheServerId=member.getInternalId();
if (internalId.equals(cacheServerId)) {
iter.remove();
found=true;
}
}
}
synchronized (this.applicationSet) {
for (Iterator iter=this.applicationSet.iterator(); iter.hasNext() && !found; ) {
Future future=(Future)iter.next();
try {
if (future instanceof AdminFutureTask) {
AdminFutureTask task=(AdminFutureTask)future;
if (task.getMemberId().equals(internalId)) {
iter.remove();
found=true;
if (future.isDone()) {
member=(SystemMemberImpl)future.get();
}
break;
}
else {
continue;
}
}
if (future.isDone()) {
member=(SystemMemberImpl)future.get();
}
else {
future.cancel(true);
}
}
catch ( InterruptedException ex) {
Thread.currentThread().interrupt();
checkCancellation();
throw new RuntimeException(LocalizedStrings.AdminDistributedSystemImpl_INTERRUPTED.toLocalizedString(),ex);
}
catch ( CancellationException ex) {
continue;
}
catch ( ExecutionException ex) {
handle(ex);
return null;
}
InternalDistributedMember applicationId=member.getInternalId();
if (internalId.equals(applicationId)) {
iter.remove();
found=true;
}
}
}
if (found) {
try {
if (member != null) {
member.setGemFireVM(null);
}
}
catch ( AdminException ex) {
logger.fatal(LocalizedMessage.create(LocalizedStrings.AdminDistributedSystem_UNEXPECTED_ADMINEXCEPTION),ex);
}
return member;
}
else {
if (logger.isDebugEnabled()) {
logger.debug("Couldn't remove member {}",internalId);
}
return null;
}
}
| Removes a SystemMember from this system's list of known members. This method is called in response to a member leaving the system. TODO: this method is a mess of defns |
public final boolean put(long k){
if (count >= thresh) this.grow();
if (k == 0) {
if (this.hasZero) return true;
this.hasZero=true;
this.count++;
return false;
}
else {
int loc=((int)k & 0x7FFFFFFF) % this.length;
while (true) {
long ent=this.table[loc];
if (ent == k) return true;
if (ent == 0) {
table[loc]=k;
count++;
return false;
}
loc=(loc + 1) % this.length;
}
}
}
| Add k into the table. Return true iff the table has already contained k. |
public CustomerServiceImpl(final GenericDAO<Customer,Long> genericDao,final HashHelper passwordHashHelper,final GenericDAO<Object,Long> customerShopDao,final AttributeService attributeService,final ShopService shopService,final CustomerNameFormatter customerNameFormatter){
super(genericDao);
this.passwordHashHelper=passwordHashHelper;
this.customerShopDao=customerShopDao;
this.attributeService=attributeService;
this.shopService=shopService;
this.customerNameFormatter=customerNameFormatter;
}
| Construct customer service. |
private void drawHeader(){
final String title=this.getParentWizardTitle();
Pane header=new Pane();
header.setId("header");
header.setPrefSize(722,65);
header.setLayoutX(-1);
header.setLayoutY(-1);
header.setBackground(new Background(new BackgroundFill(Color.WHITE,CornerRadii.EMPTY,Insets.EMPTY)));
ImageView topImage=new ImageView(this.createTopImage());
topImage.setLayoutX(626);
header.getChildren().add(topImage);
this.addToStep(header);
}
| Draw the header at the top of the window |
public boolean isSetHost(){
return this.host != null;
}
| Returns true if field host is set (has been assigned a value) and false otherwise |
private static void encodeBinary(byte[] bytes,int startpos,int count,int startmode,StringBuilder sb){
if (count == 1 && startmode == TEXT_COMPACTION) {
sb.append((char)SHIFT_TO_BYTE);
}
int idx=startpos;
if (count >= 6) {
sb.append((char)LATCH_TO_BYTE);
char[] chars=new char[5];
while ((startpos + count - idx) >= 6) {
long t=0;
for (int i=0; i < 6; i++) {
t<<=8;
t+=bytes[idx + i] & 0xff;
}
for (int i=0; i < 5; i++) {
chars[i]=(char)(t % 900);
t/=900;
}
for (int i=chars.length - 1; i >= 0; i--) {
sb.append(chars[i]);
}
idx+=6;
}
}
if (idx < startpos + count) {
sb.append((char)LATCH_TO_BYTE_PADDED);
}
for (int i=idx; i < startpos + count; i++) {
int ch=bytes[i] & 0xff;
sb.append((char)ch);
}
}
| Encode parts of the message using Byte Compaction as described in ISO/IEC 15438:2001(E), chapter 4.4.3. The Unicode characters will be converted to binary using the cp437 codepage. |
public String push(){
String text=indent(index++);
if (indent > 0) {
count+=indent;
}
return text;
}
| This is used to push an indent on to the cache. The first indent created by this is an empty string, this is because an indent is not required for the start of an XML file. If there are multiple roots written to the same writer then the start and end tags of a root element will exist on the same line. |
public boolean moreWorkThan(StoredBlock other){
return chainWork.compareTo(other.chainWork) > 0;
}
| Returns true if this objects chainWork is higher than the others. |
@Override public void send(final Queue destination,final Message message,final int deliveryMode,final int priority,final long timeToLive) throws JMSException {
session.lock();
try {
if (ActiveMQRAQueueSender.trace) {
ActiveMQRALogger.LOGGER.trace("send " + this + " destination="+ destination+ " message="+ message+ " deliveryMode="+ deliveryMode+ " priority="+ priority+ " ttl="+ timeToLive);
}
checkState();
producer.send(destination,message,deliveryMode,priority,timeToLive);
if (ActiveMQRAQueueSender.trace) {
ActiveMQRALogger.LOGGER.trace("sent " + this + " result="+ message);
}
}
finally {
session.unlock();
}
}
| Send message |
@Override public synchronized void removeDataSourceListener(DataSourceListener dsl){
m_dataListeners.remove(dsl);
}
| Remove a data source listener |
public float readFloat(){
return readFloatArray()[0];
}
| Read a binary File |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:59:02.993 -0500",hash_original_method="7D555C87655E096A1AB206CCF6046FBB",hash_generated_method="DCDF332367FDF65B6154F1DE58068709") private boolean shouldPostNotification(FailCause cause){
return (cause != FailCause.UNKNOWN);
}
| Returns true if the last fail cause is something that seems like it deserves an error notification. Transient errors are ignored |
public static String rightPad(String str,int size,String delim){
size=(size - str.length()) / delim.length();
if (size > 0) {
str+=repeat(delim,size);
}
return str;
}
| <p> Right pad a String with a specified string. </p> <p/> <p> The String is padded to the size of <code>n</code>. </p> |
public DefaultDependencyManager(){
ignorePatterns=emptySet();
}
| Initializes the DependencyManager. |
@Override public void renderFormsOntoG2(final Object raw,final int pageIndex,final int currentIndent,final int currentRotation,final Map componentsToIgnore,final FormFactory formFactory,final int pageHeight){
if (formsUnordered == null || rasterizeForms) {
}
else if (this.formFactory.getType() == FormFactory.HTML || this.formFactory.getType() == FormFactory.SVG) {
renderFormsOntoG2WithHTML(pageIndex,componentsToIgnore);
}
else if (GraphicsEnvironment.isHeadless() || formFactory == null) {
renderFormsOntoG2InHeadless(raw,pageIndex,componentsToIgnore,formFactory);
}
else {
renderFormsOntoG2WithSwing(raw,pageIndex,currentIndent,currentRotation,componentsToIgnore,formFactory,pageHeight);
}
}
| draw the forms onto display for print of image. Note different routine to handle forms also displayed at present |
@Action(value="/reports/cashCollectionReport-submissionReport") public String submissionReport(){
final Map<String,Object> session=getSession();
collectionsUtil.getLoggedInUser();
SimpleDateFormat sdf=new SimpleDateFormat("dd/MM/yyyy");
Date rcptDate=null;
try {
rcptDate=sdf.parse(receiptDate);
}
catch ( ParseException e) {
LOGGER.error("Exception occured while parsing receipt created date",e);
}
critParams.put(EGOV_FROM_DATE,rcptDate);
critParams.put(EGOV_TO_DATE,rcptDate);
critParams.put(EGOV_COUNTER_OPERATOR_ID,Long.valueOf(-1L));
critParams.put(EGOV_COUNTER_ID,collectionsUtil.getLocationOfUser(getSession()).getId().longValue());
critParams.put(EGOV_RECEIPT_IDS,Arrays.asList((Long[])session.get(CollectionConstants.SESSION_VAR_RECEIPT_IDS)));
return report();
}
| Action method to create the cash submission report |
public void removeRow(int row){
dataVector.removeElementAt(row);
fireTableRowsDeleted(row,row);
}
| Removes the row at <code>row</code> from the model. Notification of the row being removed will be sent to all the listeners. |
public T screenColors(String value){
setString(SCREEN_COLORS,value);
return (T)this;
}
| <div class="ind"> <p> Optional. </p> <p>Specifies the screen color depth.</p> <table border="1"> <tbody> <tr> <th>Parameter</th> <th>Value Type</th> <th>Default Value</th> <th>Max Length</th> <th>Supported Hit Types</th> </tr> <tr> <td><code>sd</code></td> <td>text</td> <td><span class="none">None</span> </td> <td>20 Bytes </td> <td>all</td> </tr> </tbody> </table> <div> Example value: <code>24-bits</code><br> Example usage: <code>sd=24-bits</code> </div> </div> |
public static <K,V>ImmutableListMultimap<K,V> of(K k1,V v1,K k2,V v2,K k3,V v3,K k4,V v4,K k5,V v5){
ImmutableListMultimap.Builder<K,V> builder=ImmutableListMultimap.builder();
builder.put(k1,v1);
builder.put(k2,v2);
builder.put(k3,v3);
builder.put(k4,v4);
builder.put(k5,v5);
return builder.build();
}
| Returns an immutable multimap containing the given entries, in order. |
public static LatLonPoint UTMtoLL(Ellipsoid ellip,double UTMNorthing,double UTMEasting,int ZoneNumber,boolean isNorthern,LatLonPoint llpoint){
return UTMtoLL(ellip,UTMNorthing,UTMEasting,ZoneNumber,(isNorthern) ? 'N' : 'S',llpoint);
}
| Converts UTM coords to lat/long given an ellipsoid. This is a convenience class where the exact Zone letter is not known. Instead only the hemisphere needs to be indicated. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
@Override public void onDestroy(){
this.pluginDestroyed=true;
}
| The final call you receive before your activity is destroyed. |
public QualifiedName(String name){
if (name == null) throw new IllegalArgumentException("name argument must not be null");
namespaceIndex=0;
this.name=name;
}
| Initializes the object with a name. In this convenience method the namespaceIndex is 0. |
public double absSum(){
return this.matrix.absSum();
}
| Gets the sum of the absolute value of all the vector's elements. |
private PathPatternProcessorDecorator(final Object processor,final boolean includes,final String... patterns){
super(processor);
notEmpty(patterns,"A pattern set is required.");
this.includes=includes;
matcher=new AntPathMatcher();
this.patterns=patterns;
LOG.debug("{} patterns {}",includes ? "include" : "exclude",Arrays.toString(patterns));
}
| Decorates the processor which should be applied or not (based on includes parameter) on resources which matches the provided patterns. |
public boolean equals(Object obj){
if (this == obj) return true;
if (obj instanceof ECFieldF2m) {
return ((m == ((ECFieldF2m)obj).m) && (Arrays.equals(ks,((ECFieldF2m)obj).ks)));
}
return false;
}
| Compares this finite field for equality with the specified object. |
public void testAddLocationSimple(){
long startTime=1000;
tripStatisticsUpdater=new TripStatisticsUpdater(startTime);
TripStatistics tripStatistics=tripStatisticsUpdater.getTripStatistics();
assertEquals(0.0,tripStatisticsUpdater.getSmoothedElevation());
assertEquals(Double.POSITIVE_INFINITY,tripStatistics.getMinElevation());
assertEquals(Double.NEGATIVE_INFINITY,tripStatistics.getMaxElevation());
assertEquals(0.0,tripStatistics.getMaxSpeed());
assertEquals(Double.POSITIVE_INFINITY,tripStatistics.getMinGrade());
assertEquals(Double.NEGATIVE_INFINITY,tripStatistics.getMaxGrade());
assertEquals(0.0,tripStatistics.getTotalElevationGain());
assertEquals(0,tripStatistics.getMovingTime());
assertEquals(0.0,tripStatistics.getTotalDistance());
addMoveLocations(100,startTime,tripStatistics,0,0);
addWaitLocations(100,startTime,tripStatistics,100,99);
addMoveLocations(100,startTime,tripStatistics,200,100);
addWaitLocations(100,startTime,tripStatistics,300,199);
addMoveLocations(100,startTime,tripStatistics,400,200);
addWaitLocations(100,startTime,tripStatistics,500,299);
addMoveLocations(100,startTime,tripStatistics,600,300);
}
| Sends some moving and waiting locations and then checks the statistics. |
public static double cosh(double value){
if (USE_JDK_MATH) {
return Math.cosh(value);
}
if (value < 0.0) {
value=-value;
}
if (value < LOG_TWO_POW_27) {
if (value < TWO_POW_N27) {
return 1;
}
else {
final double t=exp(value);
return 0.5 * (t + 1 / t);
}
}
else if (value < LOG_DOUBLE_MAX_VALUE) {
return 0.5 * exp(value);
}
else {
final double t=exp(value * 0.5);
return 0.5 * t * t;
}
}
| Some properties of cosh(x) = (exp(x)+exp(-x))/2: 1) defined on ]-Infinity,+Infinity[ 2) result in [1,+Infinity[ 3) cosh(0) = 1 4) cosh(x) = cosh(-x) 5) lim(cosh(x),x->+Infinity) = +Infinity (y increasing exponentially faster than x) 6) reaches +Infinity (double overflow) for x >= 710.475860073944, i.e. a bit further than exp(x) |
public Boolean isWriteLocked(K token){
RWLock<K> lock=locks.get(token);
if (lock == null) return null;
return lock.isWriteLocked();
}
| Queries if the write lock is held by any thread on given lock token, returns null when lock with this token does not exists |
public ClassSignature(final Class<?> clazz,boolean isRuntimeClass){
this.reader=null;
this.isRuntimeClass=isRuntimeClass;
this.className=Type.getType(clazz).getInternalName();
final Class<?> superclazz=clazz.getSuperclass();
this.superName=superclazz == null ? null : Type.getType(superclazz).getInternalName();
final Class<?>[] interfClasses=clazz.getInterfaces();
this.interfaces=new String[interfClasses.length];
for (int i=0; i < interfClasses.length; i++) {
this.interfaces[i]=Type.getType(interfClasses[i]).getInternalName();
}
final Set<Method> methods=new HashSet<Method>();
final Set<String> fields=new HashSet<String>();
final Set<String> signaturePolymorphicMethods=new HashSet<String>();
for ( final java.lang.reflect.Method m : clazz.getDeclaredMethods()) {
methods.add(Method.getMethod(m));
if (className.startsWith(SIGNATURE_POLYMORPHIC_PKG_INTERNALNAME) && m.isVarArgs() && (m.getModifiers() & Modifier.NATIVE) != 0 && SIGNATURE_POLYMORPHIC_DESCRIPTOR.equals(Type.getMethodDescriptor(m))) {
signaturePolymorphicMethods.add(m.getName());
}
}
for ( final java.lang.reflect.Constructor<?> m : clazz.getDeclaredConstructors()) {
methods.add(Method.getMethod(m));
}
for ( final java.lang.reflect.Field f : clazz.getDeclaredFields()) {
fields.add(f.getName());
}
this.methods=createSet(methods);
this.fields=createSet(fields);
this.signaturePolymorphicMethods=createSet(signaturePolymorphicMethods);
}
| Alternative ctor that can be used to build the information via reflection from an already loaded class. Useful for Java 9 Jigsaw. |
public void runTest() throws Throwable {
Document doc;
NodeList elementList;
Node nameNode;
CharacterData child;
String childData;
doc=(Document)load("hc_staff",true);
elementList=doc.getElementsByTagName("acronym");
nameNode=elementList.item(0);
child=(CharacterData)nameNode.getFirstChild();
child.replaceData(0,50,"2600");
childData=child.getData();
assertEquals("characterdataReplaceDataExceedsLengthOfDataAssert","2600",childData);
}
| Runs the test case. |
public ASTFlattener(){
this.fBuffer=new StringBuffer();
}
| Creates a new AST printer. |
@SuppressWarnings("unchecked") public static <C extends Comparable>ImmutableRangeSet<C> of(){
return (ImmutableRangeSet<C>)EMPTY;
}
| Returns an empty immutable range set. |
public static void unPad(byte[] src,int start,byte[] dest){
System.arraycopy(src,start,dest,0,CG2_PAD_POSITION);
System.arraycopy(src,start + CG2_PAD_POSITION + 1,dest,CG2_PAD_POSITION,CG2_RAW_READ_LENGTH - CG2_PAD_POSITION);
}
| Strip single padding base that Complete Genomics v2 reads contain, if present. |
public static boolean isBetween(double val,double theshold1,double theshold2){
return theshold2 > theshold1 ? val > theshold1 && val < theshold2 : val > theshold2 && val < theshold1;
}
| Used to determine whether a value is between two thresholds. |
private void periodicallyPublishLastNInfo(TStream<JsonObject> stream,int count,int nSec,String event){
List<JsonObject> lastN=Collections.synchronizedList(new ArrayList<>());
stream.last(count,JsonTuples.keyFn()).aggregate(null).tag(event + ".lastN").sink(null);
TStream<JsonObject> periodicLastN=t.poll(null,nSec,TimeUnit.SECONDS).tag(event + ".trigger").filter(null).tag(event + ".changed").map(null).tag(event);
traceStream(periodicLastN,event);
app.mqttDevice().events(PlumbingStreams.pressureReliever(periodicLastN,null,30).tag(event + ".pressureRelieved"),app.sensorEventId(sensorId,event),QoS.FIRE_AND_FORGET);
}
| Periodically publish the lastN on a stream. |
protected int estimateProtocolVersionLen(final ProtocolVersion version){
return version.getProtocol().length() + 4;
}
| Guesses the length of a formatted protocol version. Needed to guess the length of a formatted request or status line. |
@DSSink({DSSinkKind.SENSITIVE_UNCATEGORIZED}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:12.574 -0500",hash_original_method="345309F322E0CB3C0BD3B9A37C988F09",hash_generated_method="C3E285EC69CC0008B4692DA77698D14C") @Override public void send(HandshakeIODataStream out){
int total_length=0;
if (encoded_certs == null) {
encoded_certs=new byte[certs.length][];
for (int i=0; i < certs.length; i++) {
try {
encoded_certs[i]=certs[i].getEncoded();
}
catch ( CertificateEncodingException e) {
fatalAlert(AlertProtocol.INTERNAL_ERROR,"INTERNAL ERROR",e);
}
}
}
total_length=3 * encoded_certs.length;
for (int i=0; i < encoded_certs.length; i++) {
total_length+=encoded_certs[i].length;
}
out.writeUint24(total_length);
for (int i=0; i < encoded_certs.length; i++) {
out.writeUint24(encoded_certs[i].length);
out.write(encoded_certs[i]);
}
}
| Sends message |
public static <V>CaseInsensitiveMap<V> createCaseInsensitiveMap(int initial){
return new CaseInsensitiveMapImpl<>(initial);
}
| Construct new case insensitive map. |
private void resolveRights(MailboxACLEntryKey queryKey,GroupMembershipResolver groupMembershipResolver,Map<MailboxACLEntryKey,MailboxACLRights> entries,String resourceOwner,boolean resourceOwnerIsGroup,MailboxACL.MailboxACLRights[] positiveNegativePair) throws UnsupportedRightException {
if (entries != null) {
for ( Entry<MailboxACLEntryKey,MailboxACLRights> entry : entries.entrySet()) {
final MailboxACLEntryKey key=entry.getKey();
if (applies(key,queryKey,groupMembershipResolver,resourceOwner,resourceOwnerIsGroup)) {
if (key.isNegative()) {
positiveNegativePair[NEGATIVE_INDEX]=positiveNegativePair[NEGATIVE_INDEX].union(entry.getValue());
}
else {
positiveNegativePair[POSITIVE_INDEX]=positiveNegativePair[POSITIVE_INDEX].union(entry.getValue());
}
}
}
}
}
| What needs to be done for both global ACL and the given mailboxe's ACL. |
protected V12Database(WireDatabaseConnection connection,ProtocolDescriptor descriptor){
super(connection,descriptor);
}
| Creates a V12Database instance. |
public static boolean isEmpty(Object value){
return (null == value) || (value.getClass().equals(String.class) && isNullOrEmpty((String)value) || (Collection.class.isAssignableFrom(value.getClass()) && ((Collection)value).isEmpty()) || (Map.class.isAssignableFrom(value.getClass()) && ((Map)value).isEmpty()));
}
| Check that value wasn't set by json parser. |
public Vector3f cross(Vector3f v,Vector3f result){
return cross(v.x,v.y,v.z,result);
}
| <code>cross</code> calculates the cross product of this vector with a parameter vector v. The result is stored in <code>result</code> |
public SelectAllAction(@Nullable JComponent target){
super(target);
ResourceBundleUtil labels=ResourceBundleUtil.getBundle("org.jhotdraw.app.Labels");
labels.configureAction(this,ID);
}
| Creates a new instance which acts on the specified component. |
public boolean isBroken(){
final ReentrantLock lock=this.lock;
lock.lock();
try {
return generation.broken;
}
finally {
lock.unlock();
}
}
| Queries if this barrier is in a broken state. |
VPlexDeviceInfo findLocalDevice(String deviceName) throws VPlexApiException {
VPlexDeviceInfo deviceInfo=null;
List<VPlexClusterInfo> clusterInfoList=getClusterInfoLite();
for ( VPlexClusterInfo clusterInfo : clusterInfoList) {
String clusterName=clusterInfo.getName();
s_logger.info("Find device {} on cluster {}",deviceName,clusterName);
List<VPlexDeviceInfo> deviceInfoList=getLocalDeviceInfoOnCluster(clusterName);
for ( VPlexDeviceInfo clusterDeviceInfo : deviceInfoList) {
if (clusterDeviceInfo.getName().equals(deviceName)) {
deviceInfo=clusterDeviceInfo;
deviceInfo.setCluster(clusterName);
break;
}
}
if (deviceInfo != null) {
break;
}
}
return deviceInfo;
}
| Attempts to find the local device with the passed name. |
private static boolean isUriHandled(Uri uri){
String scheme=uri.getScheme();
if (TextUtils.equals(scheme,FRODO_SCHEME)) {
return true;
}
else if (MoreTextUtils.equalsAny(scheme,"https","http")) {
String host=uri.getHost();
if (!TextUtils.isEmpty(host) && MoreTextUtils.equalsAny(host,"www.douban.com","m.douban.com","book.douban.com","movie.douban.com","music.douban.com","dongxi.douban.com")) {
List<String> pathSegments=uri.getPathSegments();
String pathSegment0=pathSegments.size() >= 1 ? pathSegments.get(0) : null;
if (!TextUtils.isEmpty(pathSegment0)) {
if (MoreTextUtils.equalsAny(pathSegment0,"group","theme","update","hashtag","app_topic","subject","book","music","movie","game","mobileapp","event","note","show","doulist","review","photos","celebrity")) {
return true;
}
else if (TextUtils.equals(pathSegment0,"people")) {
String pathSegment2=pathSegments.size() >= 3 ? pathSegments.get(2) : null;
if (TextUtils.isEmpty(pathSegment2)) {
return true;
}
else if (MoreTextUtils.equalsAny(pathSegment2,"reviews","wish","collect","games","apps","status")) {
return true;
}
}
}
}
}
return false;
}
| Whether an uri is likely to be handled by native in Frodo. We don't need Frodo's WebActivity. |
public AttributeSet parseDeclaration(String string){
try {
return parseDeclaration(new StringReader(string));
}
catch ( IOException ioe) {
}
return null;
}
| Parses the passed in CSS declaration into an AttributeSet. |
public boolean isGet(){
return HttpMethod.GET.equals(getMethod());
}
| Determines whether this is an HTTP GET request. <p/> |
public void blend(PImage src,int sx,int sy,int sw,int sh,int dx,int dy,int dw,int dh,int mode){
g.blend(src,sx,sy,sw,sh,dx,dy,dw,dh,mode);
}
| Copies area of one image into another PImage object. |
@Override public String toString(){
return mUuid.toString();
}
| Returns a string representation of the ParcelUuid For example: 0000110B-0000-1000-8000-00805F9B34FB will be the return value. |
public void propertyChange(PropertyChangeEvent evt){
if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) setValue(evt.getNewValue());
}
| Property Change Listener |
private boolean findNodeFromTail(Node node){
Node t=tail;
for (; ; ) {
if (t == node) return true;
if (t == null) return false;
t=t.prev;
}
}
| Returns true if node is on sync queue by searching backwards from tail. Called only when needed by isOnSyncQueue. |
private void write(Map<String,String> sortedProps,String filePath) throws IOException {
File outFile=new File(filePath);
if (outFile.exists()) {
outFile.delete();
}
outFile.createNewFile();
FileOutputStream fos=null;
try {
fos=new FileOutputStream(outFile);
for ( String key : sortedProps.keySet()) {
String entry=String.format("%s=%s%n",key,saveConvert(sortedProps.get(key),false));
fos.write(entry.getBytes("UTF-8"));
}
}
finally {
if (fos != null) {
fos.close();
}
}
}
| Writes out the properties to a new file named '_<old_source_file>'. |
public void diff_cleanupSemantic(LinkedList<Diff> diffs){
if (diffs.isEmpty()) {
return;
}
boolean changes=false;
Stack<Diff> equalities=new Stack<Diff>();
String lastequality=null;
ListIterator<Diff> pointer=diffs.listIterator();
int length_insertions1=0;
int length_deletions1=0;
int length_insertions2=0;
int length_deletions2=0;
Diff thisDiff=pointer.next();
while (thisDiff != null) {
if (thisDiff.operation == Operation.EQUAL) {
equalities.push(thisDiff);
length_insertions1=length_insertions2;
length_deletions1=length_deletions2;
length_insertions2=0;
length_deletions2=0;
lastequality=thisDiff.text;
}
else {
if (thisDiff.operation == Operation.INSERT) {
length_insertions2+=thisDiff.text.length();
}
else {
length_deletions2+=thisDiff.text.length();
}
if (lastequality != null && (lastequality.length() <= Math.max(length_insertions1,length_deletions1)) && (lastequality.length() <= Math.max(length_insertions2,length_deletions2))) {
while (thisDiff != equalities.lastElement()) {
thisDiff=pointer.previous();
}
pointer.next();
pointer.set(new Diff(Operation.DELETE,lastequality));
pointer.add(new Diff(Operation.INSERT,lastequality));
equalities.pop();
if (!equalities.empty()) {
equalities.pop();
}
if (equalities.empty()) {
while (pointer.hasPrevious()) {
pointer.previous();
}
}
else {
thisDiff=equalities.lastElement();
while (thisDiff != pointer.previous()) {
}
}
length_insertions1=0;
length_insertions2=0;
length_deletions1=0;
length_deletions2=0;
lastequality=null;
changes=true;
}
}
thisDiff=pointer.hasNext() ? pointer.next() : null;
}
if (changes) {
diff_cleanupMerge(diffs);
}
diff_cleanupSemanticLossless(diffs);
pointer=diffs.listIterator();
Diff prevDiff=null;
thisDiff=null;
if (pointer.hasNext()) {
prevDiff=pointer.next();
if (pointer.hasNext()) {
thisDiff=pointer.next();
}
}
while (thisDiff != null) {
if (prevDiff.operation == Operation.DELETE && thisDiff.operation == Operation.INSERT) {
String deletion=prevDiff.text;
String insertion=thisDiff.text;
int overlap_length1=this.diff_commonOverlap(deletion,insertion);
int overlap_length2=this.diff_commonOverlap(insertion,deletion);
if (overlap_length1 >= overlap_length2) {
if (overlap_length1 >= deletion.length() / 2.0 || overlap_length1 >= insertion.length() / 2.0) {
pointer.previous();
pointer.add(new Diff(Operation.EQUAL,insertion.substring(0,overlap_length1)));
prevDiff.text=deletion.substring(0,deletion.length() - overlap_length1);
thisDiff.text=insertion.substring(overlap_length1);
}
}
else {
if (overlap_length2 >= deletion.length() / 2.0 || overlap_length2 >= insertion.length() / 2.0) {
pointer.previous();
pointer.add(new Diff(Operation.EQUAL,deletion.substring(0,overlap_length2)));
prevDiff.operation=Operation.INSERT;
prevDiff.text=insertion.substring(0,insertion.length() - overlap_length2);
thisDiff.operation=Operation.DELETE;
thisDiff.text=deletion.substring(overlap_length2);
}
}
thisDiff=pointer.hasNext() ? pointer.next() : null;
}
prevDiff=thisDiff;
thisDiff=pointer.hasNext() ? pointer.next() : null;
}
}
| Reduce the number of edits by eliminating semantically trivial equalities. |
public boolean equals(Object obj){
if (this == obj) return true;
if (this == POINT_INFINITY) return false;
if (obj instanceof ECPoint) {
return ((x.equals(((ECPoint)obj).x)) && (y.equals(((ECPoint)obj).y)));
}
return false;
}
| Compares this elliptic curve point for equality with the specified object. |
public Location(String address){
setAddress(address);
}
| Creates an address location. |
protected void updateLocalBest(){
for (int i=0; i < swarmSize; i++) {
int flag=dominanceComparator.compare(particles[i],localBestParticles[i]);
if (flag <= 0) {
localBestParticles[i]=particles[i];
}
}
}
| Updates the local best particles. |
private void add(int[] ngram,long value,long[][] funcs){
if (ngram == null) return;
int qValue=quantize(value);
for (int i=1; i <= qValue; i++) {
int hash=hashNgram(ngram,0,ngram.length,i);
bf.add(hash,funcs);
}
}
| Adds an ngram, along with an associated value, to the Bloom filter. This corresponds to Talbot and Osborne's "Tera-scale LMs on the cheap", algorithm 1. |
public AuthorizationData(DerValue der) throws Asn1Exception, IOException {
Vector<AuthorizationDataEntry> v=new Vector<>();
if (der.getTag() != DerValue.tag_Sequence) {
throw new Asn1Exception(Krb5.ASN1_BAD_ID);
}
while (der.getData().available() > 0) {
v.addElement(new AuthorizationDataEntry(der.getData().getDerValue()));
}
if (v.size() > 0) {
entry=new AuthorizationDataEntry[v.size()];
v.copyInto(entry);
}
}
| Constructs a new <code>AuthorizationData,</code> instance. |
protected void processDocType() throws Exception {
if (!XMLUtil.checkLiteral(this.reader,"OCTYPE")) {
XMLUtil.errorExpectedInput(reader.getSystemID(),reader.getLineNr(),"<!DOCTYPE");
return;
}
XMLUtil.skipWhitespace(this.reader,null);
String systemID=null;
StringBuffer publicID=new StringBuffer();
String rootElement=XMLUtil.scanIdentifier(this.reader);
XMLUtil.skipWhitespace(this.reader,null);
char ch=this.reader.read();
if (ch == 'P') {
systemID=XMLUtil.scanPublicID(publicID,reader);
XMLUtil.skipWhitespace(this.reader,null);
ch=this.reader.read();
}
else if (ch == 'S') {
systemID=XMLUtil.scanSystemID(reader);
XMLUtil.skipWhitespace(this.reader,null);
ch=this.reader.read();
}
if (ch == '[') {
this.validator.parseDTD(publicID.toString(),this.reader,this.entityResolver,false);
XMLUtil.skipWhitespace(this.reader,null);
ch=this.reader.read();
}
if (ch != '>') {
XMLUtil.errorExpectedInput(reader.getSystemID(),reader.getLineNr(),"`>'");
}
if (false) {
if (systemID != null) {
Reader reader=this.reader.openStream(publicID.toString(),systemID);
this.reader.startNewStream(reader);
this.reader.setSystemID(systemID);
this.reader.setPublicID(publicID.toString());
this.validator.parseDTD(publicID.toString(),this.reader,this.entityResolver,true);
}
}
}
| Processes a document type declaration. |
private StorageSample(){
}
| This class is never instantiated. |
private void addFacetSelection(AppContext ctx,Universe universe,List<Facet> facetsSel,DashboardSelection ds,DashboardSelection compareFrom) throws ScopeException, ComputingException, InterruptedException {
for ( Facet facetSel : facetsSel) {
if (SegmentManager.isSegmentFacet(facetSel)) {
SegmentManager.addSegmentSelection(ctx,universe,facetSel,ds);
}
else {
Axis axis=getFacetAxis(ctx,universe,facetSel);
if (axis != null) {
Domain domain=axis.getParent().getRoot();
DimensionIndex index=universe.getDomainHierarchy(domain,true).getDimensionIndex(axis);
if (index == null) {
if (axis.getDimension() != null) {
Domain shortcut=axis.getParent().getDomain();
index=universe.getDomainHierarchy(shortcut,true).getDimensionIndex(axis.prune());
}
else {
throw new ScopeException("unable to filter on " + axis.getDefinitionSafe().prettyPrint());
}
}
AccessRightsUtils.getInstance().checkRole(ctx,index.getDimension(),Role.READ);
for ( FacetMember selectedItem : facetSel.getSelectedItems()) {
if (selectedItem instanceof FacetMemberInterval) {
IntervalleObject compareFromInterval=null;
if (compareFrom != null) {
Collection<DimensionMember> members=compareFrom.getMembers(axis);
if (members.size() == 1) {
DimensionMember member=members.iterator().next();
if (member.getID() instanceof IntervalleObject) {
compareFromInterval=(IntervalleObject)member.getID();
}
}
}
FacetMemberInterval fmi=(FacetMemberInterval)selectedItem;
try {
Date lowerDate=convertToDate(universe,index,Bound.LOWER,fmi.getLowerBound(),compareFromInterval);
Date upperDate=convertToDate(universe,index,Bound.UPPER,fmi.getUpperBound(),compareFromInterval);
ds.add(axis,IntervalleObject.createInterval(lowerDate,upperDate));
}
catch ( java.text.ParseException e) {
throw new ComputingException(e);
}
}
else if (selectedItem instanceof FacetMemberString) {
FacetMemberString fmember=(FacetMemberString)selectedItem;
if (fmember.getId() != null && !fmember.getId().equals("") && facetSel.getId() != null) {
DimensionMember member=index.getMemberByKey(fmember.getId());
if (member != null) {
ds.add(axis,member);
}
else if (fmember.getValue() != null) {
member=index.getMemberByID(fmember.getValue());
if (member != null) {
fmember.setId(member.getKey());
ds.add(axis,member);
}
else {
throw new ComputingException("invalid selection, unkonwn index value");
}
}
else {
throw new ComputingException("invalid selection, unkonwn index reference");
}
}
else if (fmember.getValue() != null) {
DimensionMember member=index.getMemberByID(fmember.getValue());
if (member != null) {
fmember.setId(member.getKey());
ds.add(axis,member);
}
else {
throw new ComputingException("invalid selection, unkonwn index value");
}
}
else {
throw new ComputingException("invalid selection, undefine index");
}
}
}
}
else {
logger.info("ignoring invalid facet selection");
}
}
}
}
| initialise the DashboardSelection |
@Override @Inline public ObjectReference traceObject(ObjectReference object){
return object;
}
| When we trace a non-root object we do nothing. |
@SuppressWarnings("restriction") public boolean load(java.io.InputStream in) throws XMLStreamException {
XMLStreamReader reader=null;
try {
reader=inputFactory.createXMLStreamReader(new java.io.InputStreamReader(in));
while (reader.hasNext()) {
int evtType=reader.next();
if (evtType != XMLStreamConstants.START_ELEMENT) continue;
String tagName=reader.getLocalName();
if (!"stat".equals(tagName)) continue;
String name=reader.getAttributeValue(null,"name");
if (name != null && name.trim().length() > 0) {
this.statMap.put(name.toLowerCase(),reader.getElementText());
}
}
}
finally {
if (reader != null) try {
reader.close();
reader=null;
}
catch ( Exception iex) {
}
}
return false;
}
| Load all predefined sqls |
public ExecutionSynchronization createExecutionSynchronization(){
ExecutionSynchronizationImpl executionSynchronization=new ExecutionSynchronizationImpl();
return executionSynchronization;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public boolean isLogicalFunction(){
return false;
}
| E is not a logical function. |
public List<String> updateDeletionStatus(String loadDate,String tableFolderPath,Long loadStartTime){
ICarbonLock carbonLock=CarbonLockFactory.getCarbonLockObj(absoluteTableIdentifier.getCarbonTableIdentifier(),LockUsage.METADATA_LOCK);
List<String> invalidLoadTimestamps=new ArrayList<String>(0);
try {
if (carbonLock.lockWithRetries()) {
LOG.info("Metadata lock has been successfully acquired");
CarbonTablePath carbonTablePath=CarbonStorePath.getCarbonTablePath(absoluteTableIdentifier.getStorePath(),absoluteTableIdentifier.getCarbonTableIdentifier());
String dataLoadLocation=carbonTablePath.getTableStatusFilePath();
LoadMetadataDetails[] listOfLoadFolderDetailsArray=null;
if (!FileFactory.isFileExist(dataLoadLocation,FileFactory.getFileType(dataLoadLocation))) {
LOG.error("Error message: " + "Load metadata file is not present.");
invalidLoadTimestamps.add(loadDate);
return invalidLoadTimestamps;
}
listOfLoadFolderDetailsArray=readLoadMetadata(tableFolderPath);
if (listOfLoadFolderDetailsArray != null && listOfLoadFolderDetailsArray.length != 0) {
updateDeletionStatus(loadDate,listOfLoadFolderDetailsArray,invalidLoadTimestamps,loadStartTime);
if (invalidLoadTimestamps.isEmpty()) {
writeLoadDetailsIntoFile(dataLoadLocation,listOfLoadFolderDetailsArray);
}
else {
return invalidLoadTimestamps;
}
}
else {
LOG.audit("Delete load by date is failed. No matching load found.");
invalidLoadTimestamps.add(loadDate);
return invalidLoadTimestamps;
}
}
else {
LOG.error("Error message: " + "Unable to acquire the metadata lock");
}
}
catch ( IOException e) {
LOG.error("Error message: " + "IOException" + e.getMessage());
}
finally {
fileUnlock(carbonLock);
}
return invalidLoadTimestamps;
}
| updates deletion status |
public PortUnreachableException(String detailMessage){
super(detailMessage);
}
| Constructs a new instance with the given detail message. |
public void trimToSize(){
if (size < array.length) {
int[] olddata=array;
array=new int[size];
System.arraycopy(olddata,0,array,0,size);
}
}
| Trims the capacity of this instance to be the list's current size. An application can use this operation to minimize the storage of some instance. |
public Message(MessageLevel level,Object sender,String id,String[] idParams){
this(level,sender,new String[0],id,idParams);
}
| Instantiates a new message. |
public void removeUINodes(Node... nodes){
for ( Node node : nodes) removeUINode(node);
}
| Remove nodes from the UI overlay. |
private synchronized CompletableFuture<Void> compact(Compaction compaction,CompletableFuture<Void> future,ThreadContext context){
CompactionManager manager=compaction.manager(this);
AtomicInteger counter=new AtomicInteger();
Collection<CompactionTask> tasks=manager.buildTasks(storage,segments);
if (!tasks.isEmpty()) {
LOGGER.info("Compacting log with compaction: {}",compaction);
LOGGER.debug("Executing {} compaction task(s)",tasks.size());
for ( CompactionTask task : tasks) {
LOGGER.debug("Executing {}",task);
ThreadContext taskThread=new ThreadPoolContext(executor,segments.serializer());
taskThread.execute(task).whenComplete(null);
}
}
else {
future.complete(null);
}
return future;
}
| Compacts the log. |
private boolean isMoveOperation(TransferSupport ts,boolean isRepositoryInLocations){
return (latestAction == MOVE || ts.isDrop() && ts.getDropAction() == MOVE) && !isRepositoryInLocations;
}
| Checks, if the current operation is a MOVE operation. If not, it is a COPY operation. |
public static WrapperQueryBuilder wrapperQuery(String source){
return new WrapperQueryBuilder(source);
}
| A Query builder which allows building a query thanks to a JSON string or binary data. |
public static boolean isPortalBlock(Block b){
for ( BlockFace face : BlockFace.values()) if (b.getRelative(face).getType() == Material.PORTAL) return true;
return false;
}
| Checks if a block is part of a Nether Portal. |
public T casePreValidation(PreValidation object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>Pre Validation</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.