code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public LogicalRelationExpressionItemProvider(AdapterFactory adapterFactory){
super(adapterFactory);
}
| This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc --> |
private void selectAndReveal(int newOffset,int newLength){
Assert.isTrue(newOffset >= 0);
Assert.isTrue(newLength >= 0);
ITextEditor editor=getTextEditor();
if (editor instanceof TypeScriptEditor) {
ISourceViewer viewer=((TypeScriptEditor)editor).getViewer();
if (viewer != null) viewer.setSelectedRa... | Selects the given range on the editor. |
@Override public void recycle(){
impl.recycle();
}
| Frees up the memory associated with this region decoder, and mark the region decoder as "dead", meaning it will throw an exception if decodeRegion(), getWidth() or getHeight() is called. |
public void resize(final int width,final int height){
stage.getViewport().update(width,height);
}
| Updates stage's viewport. |
public static double dnorm(double x,double mean,double sd){
if (sd <= 0.0) throw new IllegalArgumentException("standard deviation <= 0.0");
return dnorm((x - mean) / sd);
}
| Returns the density value of a standard normal. |
public static Data create(int capacity){
return new Data(new byte[capacity]);
}
| Create a new buffer for the given handler. The handler will decide what type of buffer is created. |
public boolean removeConstraint(ParticleConstraint3D c){
return constraints.remove(c);
}
| Attempts to remove the given constraint instance from the list of active constraints. |
private void initResourceBundle(final UIDefaults table){
table.setDefaultLocale(Locale.getDefault());
table.addResourceBundle(PKG_PREFIX + "resources.aqua");
try {
final ResourceBundle aquaProperties=ResourceBundle.getBundle(PKG_PREFIX + "resources.aqua");
final Enumeration<String> propertyKeys=aquaProper... | Initialize the defaults table with the name of the ResourceBundle used for getting localized defaults. Also initialize the default locale used when no locale is passed into UIDefaults.get(). The default locale should generally not be relied upon. It is here for compatibility with releases prior to 1.4. |
public MoveStep(MovePath path,MoveStepType type,int mineToLay){
this(path,type);
this.mineToLay=mineToLay;
}
| Create a step with the given mine to lay. |
public void close(){
this.continueProcessing.set(false);
try {
if (socket != null) {
socket.close();
}
}
catch ( Exception e) {
}
try {
this.stats.close();
}
catch ( Exception e) {
}
try {
if (cacheHelper != null) {
cacheHelper.close();
}
}
catch ( Exception e) {
... | Signals the run thread to stop, closes underlying resources. |
@Override public boolean supportsSubqueriesInComparisons(){
debugCodeCall("supportsSubqueriesInComparisons");
return true;
}
| Returns whether subqueries (SELECT) in comparisons are supported. |
protected void processKeyEvent(KeyEvent evt){
MenuSelectionManager.defaultManager().processKeyEvent(evt);
if (evt.isConsumed()) return;
super.processKeyEvent(evt);
}
| Processes key stroke events such as mnemonics and accelerators. |
public SqlCodeNodeProvider(final ResultSet resultSet){
m_resultSet=resultSet;
}
| Creates a new SQL provider object. |
private void updateMessageIndacators(){
int supplierCount=this.messageSuppliers.size();
int labelsCount=this.messageLabels.size();
if (supplierCount != labelsCount) {
resizeTo(supplierCount,this.messageLabels);
}
Object[] suppliers=this.messageSuppliers.toArray();
Object[] labels=this.messageLabels.toAr... | Removed unused indicators and updates the messages displayed for each JLabel. |
public void testCase11(){
byte aBytes[]={1,2,3,4,5,6,7,1,2,3,4,5,6,7};
byte bBytes[]={10,20,30,40,50,60,70,10,20,30};
int aSign=1;
int bSign=-1;
byte rBytes[]={1,2,3,3,-6,-15,-24,-40,-49,-58,-67,-6,-15,-23};
BigInteger aNumber=new BigInteger(aSign,aBytes);
BigInteger bNumber=new BigInteger(bSign,bBytes);
... | Add two numbers of different length and sign. The first is positive. The first is longer. |
public static String tree2Words(Tree t){
StringBuilder buffer=new StringBuilder();
List<Tree> leaves=t.getLeaves();
for ( Tree leaf : leaves) {
String word=((CoreLabel)leaf.label()).get(CoreAnnotations.ValueAnnotation.class);
String trailingWhitespaces=((CoreLabel)leaf.label()).get(CoreAnnotations.AfterA... | Returns the sentence from its tree representation. |
public static void checkDocIds(String mes,int[] results,ScoreDoc[] hits){
Assert.assertEquals(mes + " nr of hits",hits.length,results.length);
for (int i=0; i < results.length; i++) {
Assert.assertEquals(mes + " doc nrs for hit " + i,results[i],hits[i].doc);
}
}
| Tests that a Hits has an expected order of documents |
public static NameMatcher<JobKey> jobNameContains(String compareTo){
return NameMatcher.nameContains(compareTo);
}
| Create a NameMatcher that matches job names containing the given string. |
public static void typeface(Activity activity,TypefaceCollection typefaceCollection){
typeface(activity.findViewById(android.R.id.content),typefaceCollection);
}
| Apply typefaces to main acitivty view (android.R.id.content). |
Injector(final Map<Class<?>,Object> map){
notNull(map);
this.map=map;
}
| Mapping of classes to be annotated and the corresponding injected object. |
public void loadArg(final int arg){
loadInsn(argumentTypes[arg],getArgIndex(arg));
}
| Generates the instruction to load the given method argument on the stack. |
public static void invoke(Interpreter env,CallStack callstack,String dir){
File file;
String path;
try {
path=env.pathToFile(dir).getAbsolutePath();
file=env.pathToFile(dir);
}
catch ( IOException e) {
env.println("error reading path: " + e);
return;
}
if (!file.exists() || !file.canRead()... | Implement dir( String directory ) command. |
@Deprecated public static void assertNotEquals(double notExpected,double actual,double delta){
try {
Verify.assertNotEquals("double",notExpected,actual,delta);
}
catch ( AssertionError e) {
Verify.throwMangledException(e);
}
}
| Asserts that two doubles are not equal concerning a delta. If the expected value is infinity then the delta value is ignored. |
private void blockIfBusy(IncomingMessageEnvelope envelope){
synchronized (latch) {
while (!shutdownNow && throwable == null) {
for ( AsyncTaskWorker worker : taskWorkers.values()) {
if (worker.state.isReady()) {
return;
}
}
try {
log.trace("Block loop thread"... | Block the runloop thread if all tasks are busy. When a task worker finishes or window/commit completes, it will resume the runloop. |
public BERSequence(ASN1Encodable[] array){
super(array);
}
| create a sequence containing an array of objects. |
public static double NHfitness(boolean useTrainingData,GEPIndividual ind){
double NH=NHrawFitness(useTrainingData,ind,0);
return (NH);
}
| Calculates the fitness for the NH (Number of Hits) type fitness. Gets the raw fitness and then normalizes between 0 and max value (number of test cases). |
public static GeoTimeSerie compact(GeoTimeSerie gts,boolean preserveRanges){
GeoTimeSerie clone=gts.clone();
GTSHelper.sort(clone);
if (2 >= clone.values) {
return clone;
}
int idx=0;
int offset=0;
int compactIdx=1;
while (idx < clone.values - 1) {
while (idx + 1 + offset < clone.values - 1 && l... | Compact a GeoTimeSerie instance by removing measurements which have the same value/location/elevation as the previous one. We retain the last value so the resulting GTS instance spans the same time interval as the original one. Otherwise for example in the case of a constant GTS, there would be only a single value whic... |
public boolean isContinuousFocusEnabled(){
return continuousFocusEnabled;
}
| Default to false. |
public CurrencyValue convertTo(ExchangeRateProvider exchangeRates,String targetCurrencyCode){
return new CurrencyValue(convertAmount(exchangeRates,this.getCurrencyCode(),this.getAmount(),targetCurrencyCode),targetCurrencyCode);
}
| Returns a new CurrencyValue that is the conversion of this CurrencyValue to the specified currency. |
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. |
public Integer maxAlternatives(){
return maxAlternatives;
}
| Gets the max alternatives. |
public CSVParser(char separator,char quotechar,char escape,boolean strictQuotes,boolean ignoreLeadingWhiteSpace){
this(separator,quotechar,escape,strictQuotes,ignoreLeadingWhiteSpace,DEFAULT_IGNORE_QUOTATIONS);
}
| Constructs CSVParser with supplied separator and quote char. Allows setting the "strict quotes" and "ignore leading whitespace" flags |
public byte[] toByteArray(){
int len=(mPos >>> 3) + ((mPos & 0x07) > 0 ? 1 : 0);
byte[] newBuf=new byte[len];
System.arraycopy(mBuf,0,newBuf,0,len);
return newBuf;
}
| Return byte array containing accumulated data, sized to just fit. |
public void add(DiscordRecord discord){
this.discords.insertSorted(discord);
}
| Add a new discord to the list. |
private synchronized void reopen(String msg,long targetPos,long length) throws IOException {
if (wrappedStream != null) {
closeStream("reopen(" + msg + ")",contentRangeFinish);
}
contentRangeFinish=getReadLimit(readStrategy,targetPos,length,contentLength,readahead);
LOG.trace("reopen({}) for {} range[{}-{}]... | Reopen stream if closed |
protected Component createComponent(){
AttributeSet attr=getElement().getAttributes();
HTML.Tag t=(HTML.Tag)attr.getAttribute(StyleConstants.NameAttribute);
JComponent c=null;
Object model=attr.getAttribute(StyleConstants.ModelAttribute);
removeStaleListenerForModel(model);
if (t == HTML.Tag.INPUT) {
c=... | Create the component. This is basically a big switch statement based upon the tag type and html attributes of the associated element. |
public static Path createDirectory(final Path parent){
File file;
try {
file=Files.createTempDirectory(parent,null).toFile();
}
catch ( IOException e) {
throw new RuntimeException(e);
}
if (!file.exists()) {
throw new RuntimeException("Error while trying to create folder at " + parent + ".");
... | Creates a new temp directory with the given parent. The newly created folder will be deleted on graceful VM shutdown. |
public void add(TagLibTag libTag,Tag tag,FunctionLib[] flibs,SourceCode cfml){
tags.add(new TagData(libTag,tag,flibs,cfml));
}
| add a tag to the pool to evaluate at the end |
protected void processDoneCallback(){
}
| Callback, to be implemented in callbackMode <p> This will be called once to notify state done |
public boolean contains(double p){
if (p == -S2.M_PI) {
p=S2.M_PI;
}
return fastContains(p);
}
| Return true if the interval (which is closed) contains the point 'p'. |
public DefaultExtendedState(){
this.variables=new ObservableMap<Object,Object>(new ConcurrentHashMap<Object,Object>(),new LocalMapChangeListener());
}
| Instantiates a new default extended state. |
private boolean doAcquireNanos(int arg,long nanosTimeout) throws InterruptedException {
if (nanosTimeout <= 0L) return false;
final long deadline=System.nanoTime() + nanosTimeout;
final Node node=addWaiter(Node.EXCLUSIVE);
boolean failed=true;
try {
for (; ; ) {
final Node p=node.predecessor();
... | Acquires in exclusive timed mode. |
public JobConf jobConf(){
return jobCtx.getJobConf();
}
| Gets job configuration of the task. |
public MainScorerImpl(int analysisGroup,Map<String,ScoringSchemaType> scorerSchemas,FramingFlowType framingFlow,String finalMessageAnomalyScorer,String flowName,String finalIntervalAnomalyScorer,int trainFrameFactor) throws AdeException {
m_scorerSchemas=scorerSchemas;
m_framingFlow=framingFlow;
m_finalIntervalAn... | create a new, empty main scorer. |
public RunNetworkAction(final NetworkPanel networkPanel){
super();
if (networkPanel == null) {
throw new IllegalArgumentException("networkPanel must not be null");
}
this.networkPanel=networkPanel;
putValue(SMALL_ICON,ResourceManager.getImageIcon("Play.png"));
putValue(SHORT_DESCRIPTION,"Iterate network... | Create a new run network action with the specified network panel. |
public static int wasSqlEsception(){
return sqlException;
}
| Determine if an SQL Exception occurred trying to load the database. |
public MJPEGGenerator(File aviFile,int width,int height,double framerate,int numFrames) throws Exception {
this.aviFile=aviFile;
this.width=width;
this.height=height;
this.framerate=framerate;
this.numFrames=numFrames;
aviOutput=new FileOutputStream(aviFile);
aviChannel=aviOutput.getChannel();
RIFFHeade... | Creates a new instance of MJPEGGenerator |
public static X509Certificate readX509Certificate(URL url) throws IOException, CertificateException {
URLConnection connection=url.openConnection();
InputStream is=connection.getInputStream();
try {
CertificateFactory servercf=CertificateFactory.getInstance("X.509");
return (X509Certificate)servercf.gener... | Load X.509 Certificate from an url |
public FolderTokenFdrLink findByName(String name) throws Exception {
int idx;
FolderTokenFdrLink link=null;
idx=super.findIndexByName(name);
if (idx == -1) {
throw new IeciTdException(FolderBaseError.EC_NOT_FOUND,FolderBaseError.EM_NOT_FOUND);
}
link=get(idx);
return link;
}
| Devuelve el enlace con el nombre especificado |
public boolean isCreateReservation(){
String s=getCommitmentType();
if (s == null) return false;
return COMMITMENTTYPE_POCommitmentReservation.equals(s) || COMMITMENTTYPE_POSOCommitmentReservation.equals(s);
}
| Create Commitment/Reservation Accounting |
public ServerSpace(org.mmtk.vm.gcspy.ServerInterpreter serverInterpreter,String serverName,String driverName,String title,String blockInfo,int tileNum,String unused,boolean mainSpace){
if (VM.BuildWithGCSpy) {
spaceId=serverInterpreter.addSpace(this);
driver=sysCall.gcspyMainServerAddDriver(serverInterpreter.... | Create a new GCspy Space |
public void withVoidTransaction(@NotNull Isolation isolation,@NotNull VoidTransactionCallback callback){
withVoidTransaction(Propagation.REQUIRED,isolation,callback);
}
| Executes a block of code with given isolation. |
public static final double[] fromBitString(String s){
char a[]=s.toCharArray();
double d[]=new double[a.length];
for (int i=0; i < a.length; i++) {
d[i]=(double)char2int(a[i]);
}
return d;
}
| FromBitString - returns a double[] representation of s. |
public static double[][] selectColumns(double matrix[][],int columns[]){
double[][] data=new double[matrix.length][columns.length];
for (int r=0; r < matrix.length; r++) {
for (int cIndex=0; cIndex < columns.length; cIndex++) {
data[r][cIndex]=matrix[r][columns[cIndex]];
}
}
return data;
}
| Extract the required columns from the matrix |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public static void main(final String[] args){
DOMTestCase.doMain(namednodemapreturnlastitem.class,args);
}
| Runs this test from the command line. |
public static String removeTrailingZeros(final String str){
String result=str;
if (str != null && str.length() != 0) {
int endIndex=str.length();
while (endIndex > 1) {
final char ch=str.charAt(endIndex - 1);
if (ch != '0') {
break;
}
endIndex--;
}
if (endIndex < str.... | Remove trailing zeros from string. |
private void validateBillingResult(BillingResult billingResult,String currency,BigDecimal amount) throws ParserConfigurationException, SAXException, IOException, XPathExpressionException {
System.out.println(billingResult.getResultXML());
Document doc=XMLConverter.convertToDocument(billingResult.getResultXML(),fals... | Validates the content of the specified billing result structure. |
public void testAddPageUploadAudit(){
System.out.println("addPageUploadAudit");
AuditServiceThreadQueueImpl instance=new AuditServiceThreadQueueImpl();
AuditCommand auditCommand=EasyMock.createMock(AuditCommand.class);
AuditServiceThread auditServiceThread=createMockAuditServiceThread(instance);
AuditServiceT... | Test of addPageUploadAudit method, of class AuditServiceThreadQueueImpl. |
public void dpln(String text){
if (m_verboseOn) {
System.out.println(text);
}
}
| prints out text + endofline if verbose is on. helps to make debug output commands more visible in text |
public Entity createEntity(){
EntityImpl entity=new EntityImpl();
return entity;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public boolean isRTPRTSPTCP(){
return rtprtsptcp;
}
| Ruft den Wert der rtprtsptcp-Eigenschaft ab. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:11.637 -0500",hash_original_method="8888AACA46E7314FC33FB1B59D843324",hash_generated_method="64A07152E1DD1B44B78BA36B11FFD423") public char nextClean() throws JSONException {
int nextCleanInt=nextCleanInternal();
return nextClea... | Returns the next character that is not whitespace and does not belong to a comment. If the input is exhausted before such a character can be found, the null character '\0' is returned. The return value of this method is ambiguous for JSON strings that contain the character '\0'. |
public final void testSetErrorColor(){
int errorColor=Color.RED;
AbstractValidateableViewImplementation abstractValidateableView=new AbstractValidateableViewImplementation(getContext());
abstractValidateableView.setErrorColor(errorColor);
assertEquals(errorColor,abstractValidateableView.getErrorColor());
}
| Tests the functionality of the method, which allows to set the error color. |
public char last(){
if (start == end) {
return DONE;
}
offset=end - 1;
return string.charAt(offset);
}
| Sets the current position to the end index - 1 and returns the character at the new position. |
public void remove(Object object){
int index=findIndex(object);
if (index != -1) {
count--;
for (int i=index; i < count; i++) {
objects[i]=objects[i + 1];
methods[i]=methods[i + 1];
}
objects[count]=null;
methods[count]=null;
}
}
| Removes first object/method pair matched (and only the first, must be called multiple times if object is registered multiple times). Does not shrink array afterwards, silently returns if method not found. |
public boolean isDiscountUptoLimitPrice(){
Object oo=get_Value(COLUMNNAME_IsDiscountUptoLimitPrice);
if (oo != null) {
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
| Get IsDiscountUptoLimitPrice. |
@Override public int eDerivedOperationID(int baseOperationID,Class<?> baseClass){
if (baseClass == TMember.class) {
switch (baseOperationID) {
case TypesPackage.TMEMBER___GET_MEMBER_TYPE:
return TypesPackage.TSETTER___GET_MEMBER_TYPE;
case TypesPackage.TMEMBER___IS_READABLE:
return TypesPackage.TSETTER___IS... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public final boolean removeElement(Object s){
for (int i=0; i < m_firstFree; i++) {
if (m_map[i] == s) {
if ((i + 1) < m_firstFree) System.arraycopy(m_map,i + 1,m_map,i - 1,m_firstFree - i);
else m_map[i]=null;
m_firstFree--;
return true;
}
}
return false;
}
| Removes the first occurrence of the argument from this vector. If the object is found in this vector, each component in the vector with an index greater or equal to the object's index is shifted downward to have an index one smaller than the value it had previously. |
@Override public void onClick(AjaxRequestTarget aTarget){
editor.reset(aTarget);
aTarget.addChildren(getPage(),FeedbackPanel.class);
List<SourceDocument> listOfSourceDocuements=getListOfDocs();
int currentDocumentIndex=listOfSourceDocuements.indexOf(bModel.getDocument());
if (currentDocumentIndex == listOfSou... | Get the current beginning sentence address and add on it the size of the display window |
BufferedImage makeBufferedImage(Image img,Color bgColor,int type,int sx1,int sy1,int sx2,int sy2){
final int width=sx2 - sx1;
final int height=sy2 - sy1;
final BufferedImage bimg=new BufferedImage(width,height,type);
final SunGraphics2D g2d=(SunGraphics2D)bimg.createGraphics();
g2d.setComposite(AlphaComposite... | Return a non-accelerated BufferedImage of the requested type with the indicated subimage of the original image located at 0,0 in the new image. If a bgColor is supplied, composite the original image over that color with a SrcOver operation, otherwise make a SrcNoEa copy. <p> Returned BufferedImage is not accelerated fo... |
public ValueGrid2DPortrayal3D(String valueName,double transparency){
this.valueName=valueName;
sim.util.gui.SimpleColorMap cm=new sim.util.gui.SimpleColorMap();
cm.setLevels(0.0,1.0,java.awt.Color.blue,java.awt.Color.red);
defaultPortrayal=new TilePortrayal(cm);
this.transparency=transparency;
mPolyAttribut... | Be somewhat transparent (1.0 is fully opaque, 0.0f is fully transparent). The default portrayal is a simple TilePortrayal which ranges from blue to red. |
public static byte[] randomBytes(byte len){
char u8=convertByte2Uint8(len);
return randomBytes(u8);
}
| Generate the random byte to be sent |
public boolean leftClickOff(OMGraphic omg,MouseEvent me){
if (DEBUG) {
Debug.output("leftClickOff(" + omg.getClass().getName() + ") at "+ me.getX()+ ", "+ me.getY());
}
deselect(omg);
return false;
}
| Notification that the user clicked on something else other than the provided OMGraphic that was previously left-clicked on. Calls deselect(omg). |
private static void addDefaultProfile(SpringApplication app,SimpleCommandLinePropertySource source){
if (!source.containsProperty("spring.profiles.active") && !System.getenv().containsKey("SPRING_PROFILES_ACTIVE")) {
app.setAdditionalProfiles(Constants.SPRING_PROFILE_DEVELOPMENT);
}
}
| If no profile has been configured, set by default the "dev" profile. |
private void selectCasualties(final DiceRoll dice,final Collection<Unit> allFriendlyUnits,final Collection<Unit> validTargetedUnitsForThisRoll,final Collection<Unit> defendingAA,final Collection<Unit> allEnemyUnits,final Territory territory,final String currentTypeAA){
final CasualtyDetails casualties=BattleCalculato... | hits are removed from units. Note that units are removed in the order that the iterator will move through them. |
public ItemStack toItemStack() throws Exception {
return toItemStack(1);
}
| Get an ItemStack of one spawn egg |
public boolean isNotificationAddressAvailable(){
if (sRoster != null) {
for ( String notifiedAddress : sSettings.getNotifiedAddresses().getAll()) {
Presence presence=sRoster.getPresence(notifiedAddress);
if (presence.isAvailable()) {
return true;
}
}
return false;
}
return... | Checks if the notification address is available return also true if no roster is loaded |
public void calculateTwilight(long time,double latiude,double longitude){
final float daysSince2000=(float)(time - UTC_2000) / DateUtils.DAY_IN_MILLIS;
final float meanAnomaly=6.240059968f + daysSince2000 * 0.01720197f;
final float trueAnomaly=meanAnomaly + C1 * FloatMath.sin(meanAnomaly) + C2 * FloatMath.sin(2 *... | calculates the civil twilight bases on time and geo-coordinates. |
public static int[] shuffle(int[] intArray){
if (intArray == null) {
return null;
}
return shuffle(intArray,getRandom(intArray.length));
}
| Shuffling algorithm, Randomly permutes the specified int array using a default source of randomness |
private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter,java.lang.String namespace) throws javax.xml.stream.XMLStreamException {
java.lang.String prefix=xmlWriter.getPrefix(namespace);
if (prefix == null) {
prefix=generatePrefix(namespace);
while (xmlWriter.getNamespaceContext().g... | Register a namespace prefix |
public void testRandomStrings() throws Exception {
checkRandomData(random(),a,1000 * RANDOM_MULTIPLIER);
}
| blast some random strings through the analyzer |
protected static Config topologyConfigs(String topologyBinaryFile,String topologyDefnFile,TopologyAPI.Topology topology){
String basename=FileUtils.getBaseName(topologyBinaryFile);
String pkgType;
if (FileUtils.isOriginalPackagePex(basename)) {
pkgType="pex";
}
else if (FileUtils.isOriginalPackageJar(bas... | Load the topology config |
private String add(String sourceString,String success){
if (sourceString == null) {
return null;
}
return sourceString + success;
}
| Appends the operation result to the basic redirect URL. If the basic value is null, null will be returned. |
public void shutdown(){
gossipServiceRunning.set(false);
gossipThreadExecutor.shutdown();
if (passiveGossipThread != null) {
passiveGossipThread.shutdown();
}
if (activeGossipThread != null) {
activeGossipThread.shutdown();
}
try {
boolean result=gossipThreadExecutor.awaitTermination(1000,Time... | Shutdown the gossip service. |
public static final ArrayList readThisListXml(XmlPullParser parser,String endTag,String[] name) throws XmlPullParserException, IOException {
ArrayList list=new ArrayList();
int eventType=parser.getEventType();
do {
if (eventType == parser.START_TAG) {
Object val=readThisValueXml(parser,name);
list... | Read an ArrayList object from an XmlPullParser. The XML data could previously have been generated by writeListXml(). The XmlPullParser must be positioned <em>after</em> the tag that begins the list. |
public void testCentralEndpointHeuristicFailure() throws ParseException {
checkIntersection("LINESTRING (163.81867067 -211.31840378, 165.9174252 -214.1665075)","LINESTRING (2.84139601 -57.95412726, 469.59990601 -502.63851732)",1,"POINT (163.81867067 -211.31840378)",0);
}
| Following cases were failures when using the CentralEndpointIntersector heuristic. This is because one segment lies at a significant angle to the other, with only one endpoint is close to the other segment. The CE heuristic chose the wrong endpoint to return. The fix is to use a new heuristic which out of the 4 endpoin... |
@SuppressWarnings("rawtypes") public Iterator<T> postorder(){
if (root == null) {
return empty();
}
return new ValueExtractor<T>(new PostorderTraversal(root));
}
| Use post-order traversal over the tree. |
public OverlayMapPanel(PropertyHandler propertyHandler,boolean delayCreation){
super(propertyHandler,delayCreation);
}
| Create a OverlayMapPanel that configures itself with properties contained in the PropertyHandler provided, and with the option of delaying the search for properties until the <code>create()</code> call is made. |
public Skein512(){
super();
}
| Create the engine. |
private int[] packTimes(){
int[] times=new int[2];
times[0]=startTime;
times[1]=endTime;
return times;
}
| Pack the start and end times into an array of bytes. This is required as of serial version 2. |
public void prepareToPullUpShade(int shadeColorId,int iconId,CameraAppUI.AnimationFinishedListener listener){
prepareShadeAnimation(PULL_UP_SHADE,shadeColorId,iconId,listener);
}
| Set the states for the animation that pulls up a shade with given shade color. |
public static void main(String[] args){
if (args.length != 3) {
printUsage();
System.exit(1);
}
boolean label=(args[0].toLowerCase().trim().equals("-lbl"));
try {
String inputWhat=args[1].toLowerCase().trim();
if (inputWhat.equals("-inputfile")) {
BufferedReader in=new BufferedReader(new I... | The main method. |
public StringBuilder reverse(){
reverse0();
return this;
}
| Reverses the order of characters in this builder. |
public static GetConfigResponse checkGetConfigResponse(GetConfigResponse getConfigResponse) throws RpcException {
logger.info("Checking {}",getConfigResponse);
switch (getConfigResponse.getResult()) {
case OK:
break;
case SYSTEM_ERROR:
throw new SystemErrorException(getConfigResponse.getError());
default :
thro... | This method validates a GetConfigResponse object, raising an exception if the response reflects an operation failure. |
synchronized void validate(X509Certificate c) throws CertificateException {
Cert cert=certMap.get(c);
if (cert == null) {
cert=new Cert(c);
certMap.put(c,cert);
}
StatusCode code=validator.validateCertificate(cert);
boolean valid=code == null || code.isGood();
if (valid) {
acceptedCertificates.a... | Encode X509Certificate to binary and cache |
public void updatePosicionEnCaja(final String udoc,final String uinstalacion,final int posicion){
StringBuffer qual=new StringBuffer("WHERE ").append(DBUtils.generateEQTokenField(UDOC_FIELD,udoc)).append(" AND ").append(DBUtils.generateEQTokenField(UINSTALACION_RELACION_FIELD,uinstalacion));
Map colToUpdate=Collect... | Actualiza en la base de datos la posicion que ocupa una unidad documental dentro de una unidad de instalacion |
protected void traceMemory(){
trace("mem=" + getMemoryUsed());
}
| Print how much memory is currently used. |
public static Character[] toObject(final char[] array){
if (array == null) {
return null;
}
else if (array.length == 0) {
return ArrayUtils.EMPTY_CHARACTER_OBJECT_ARRAY;
}
final Character[] result=new Character[array.length];
for (int i=0; i < array.length; i++) {
result[i]=new Character(array[... | <p>Converts an array of primitive chars to objects.</p> <p>This method returns <code>null</code> for a <code>null</code> input array.</p> |
public synchronized Configuration loadConfiguration(){
if (buffer.position(12).readByte() == 1) {
return new Configuration(buffer.readLong(),buffer.readLong(),buffer.readLong(),serializer.readObject(buffer));
}
return null;
}
| Loads the current cluster configuration. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.