_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q180500 | WAMBaseMachine.resolveCallPoint | test | public WAMCallPoint resolveCallPoint(int functorName)
{
/*log.fine("public WAMCallPoint resolveCallPoint(int functorName): called");*/
WAMCallPoint result = (WAMCallPoint) symbolTable.get(functorName, SYMKEY_CALLPOINTS);
if (result == null)
{
result = new WAMCallPoint(-... | java | {
"resource": ""
} |
q180501 | WAMBaseMachine.setCodeAddress | test | protected WAMCallPoint setCodeAddress(int functorName, int offset, int length)
{
WAMCallPoint entry = new WAMCallPoint(offset, length, functorName);
symbolTable.put(functorName, SYMKEY_CALLPOINTS, entry);
// Keep a reverse lookup from address to functor name.
reverseTable.put(offset... | java | {
"resource": ""
} |
q180502 | HierarchyAttribute.isSubCategory | test | public boolean isSubCategory(HierarchyAttribute comp)
{
// Check that the comparator is of the same type class as this one.
if (!comp.attributeClass.attributeClassName.equals(attributeClass.attributeClassName))
{
return false;
}
// Extract the path labels from th... | java | {
"resource": ""
} |
q180503 | HierarchyAttribute.getId | test | public long getId()
{
// Find the category for this hierarchy attribute value.
Tree<CategoryNode> category = attributeClass.lookup.get(value);
// Extract and return the id.
return category.getElement().id;
} | java | {
"resource": ""
} |
q180504 | HierarchyAttribute.getValueAtLevel | test | public String getValueAtLevel(String level)
{
/*log.fine("public String getValueAtLevel(String level): called");*/
/*log.fine("level = " + level);*/
int index = attributeClass.levels.indexOf(level);
/*log.fine("index = " + index);*/
if (index == -1)
{
t... | java | {
"resource": ""
} |
q180505 | HierarchyAttribute.getLastValue | test | public String getLastValue()
{
List<String> pathValue = getPathValue();
return pathValue.get(pathValue.size() - 1);
} | java | {
"resource": ""
} |
q180506 | HierarchyAttribute.writeObject | test | private void writeObject(ObjectOutputStream out) throws IOException
{
// Print out some information about the serialized object.
/*log.fine("Serialized hierarchy attribute = " + this);*/
/*log.fine("Serialized hierarchy attribute class = " + attributeClass);*/
/*log.fine("Serialized... | java | {
"resource": ""
} |
q180507 | HierarchyAttribute.readObject | test | private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
// Perform default de-serialization.
// in.defaultReadObject();
// Deserialize the attribute by value, from its attribute class and full path.
String[] pathArrayValue = (String[]) in.readObjec... | java | {
"resource": ""
} |
q180508 | ManhattanHeuristic.computeH | test | public float computeH(EightPuzzleState state, HeuristicSearchNode searchNode)
{
// Get the parent heuristic search node.
HeuristicSearchNode parentNode = (HeuristicSearchNode) searchNode.getParent();
// Check if there is no parent, in which case this is the start state so the complete heuri... | java | {
"resource": ""
} |
q180509 | HashMapXY.mod | test | private int mod(long c, int bucketSize)
{
return (int) ((c < 0) ? ((bucketSize + (c % bucketSize)) % bucketSize) : (c % bucketSize));
} | java | {
"resource": ""
} |
q180510 | MultipleUserErrorException.addErrorMessage | test | public void addErrorMessage(String key, String userMessage)
{
/*log.fine("addErrorMessage(String key, String userMessage): called");*/
/*log.fine("userMessage = " + userMessage);*/
errors.add(new UserReadableErrorImpl(key, userMessage));
} | java | {
"resource": ""
} |
q180511 | ErrorHandler.handleErrors | test | public static void handleErrors(Throwable exception, ActionErrors errors)
{
// Log the error.
log.log(Level.SEVERE, exception.getMessage(), exception);
if (exception.getCause() == null)
{
log.fine("Exception.getCause() is null");
}
// Unwrap the exceptio... | java | {
"resource": ""
} |
q180512 | HTMLFilter.write | test | public void write(String str, int off, int len) throws IOException
{
// Get just the portion of the input string to display
String inputString = str.substring(off, off + len);
StringBuffer outputString = new StringBuffer();
// Build a string tokenizer that uses '\n' as its splittin... | java | {
"resource": ""
} |
q180513 | ProtoDTMachine.classify | test | public Map<String, OrdinalAttribute> classify(State state) throws ClassifyingFailureException
{
// Start at the root of the decision tree.
DecisionTree currentNode = dt;
// Loop down the decision tree until a leaf node is found.
while (true) // !currentNode.isLeaf())
{
... | java | {
"resource": ""
} |
q180514 | PartialOrdering.compare | test | public int compare(T a, T b)
{
boolean aRb = partialOrdering.evaluate(a, b);
if (!aRb)
{
return -1;
}
boolean bRa = partialOrdering.evaluate(b, a);
return (aRb && bRa) ? 0 : 1;
} | java | {
"resource": ""
} |
q180515 | DistributedList.iterator | test | public Iterator iterator()
{
try
{
DistributedIteratorImpl di;
di = new DistributedIteratorImpl(super.iterator());
return new ClientIterator(di);
}
catch (RemoteException e)
{
// Rethrow the RemoteException as a RuntimeExcepti... | java | {
"resource": ""
} |
q180516 | BitHackUtils.intLogBase2 | test | public static int intLogBase2(int value)
{
int temp1;
int temp2 = value >> 16;
if (temp2 > 0)
{
temp1 = temp2 >> 8;
return (temp1 > 0) ? (24 + LOG_TABLE_256[temp1]) : (16 + LOG_TABLE_256[temp2]);
}
else
{
temp1 = value >> ... | java | {
"resource": ""
} |
q180517 | BitHackUtils.intLogBase2v2 | test | public static int intLogBase2v2(int value)
{
int temp;
if ((temp = value >> 24) > 0)
{
return 24 + LOG_TABLE_256[temp];
}
else if ((temp = value >> 16) > 0)
{
return 16 + LOG_TABLE_256[temp];
}
else if ((temp = value >> 8) > 0)... | java | {
"resource": ""
} |
q180518 | BitHackUtils.intLogBase10v2 | test | public static int intLogBase10v2(int value)
{
return (value >= 1000000000)
? 9
: ((value >= 100000000)
? 8
: ((value >= 10000000)
? 7
: ((value >= 1000000)
? 6
: ((... | java | {
"resource": ""
} |
q180519 | BitHackUtils.intLogBase10v3 | test | public static int intLogBase10v3(int value)
{
return (value < 10)
? 0
: ((value < 100)
? 1
: ((value < 1000)
? 2
: ((value < 10000)
? 3
: ((value < 100000)
... | java | {
"resource": ""
} |
q180520 | BitHackUtils.intLogBase10 | test | public static int intLogBase10(long value)
{
return (value >= 1000000000000000000L)
? 18
: ((value >= 100000000000000000L)
? 17
: ((value >= 10000000000000000L)
? 16
: ((value >= 1000000000000000L)
... | java | {
"resource": ""
} |
q180521 | BitHackUtils.intLogBase10v2 | test | public static int intLogBase10v2(long value)
{
return (value < 10)
? 0
: ((value < 100)
? 1
: ((value < 1000)
? 2
: ((value < 10000)
? 3
: ((value < 100000)
... | java | {
"resource": ""
} |
q180522 | BitHackUtils.getCharacterCountInt32 | test | public static int getCharacterCountInt32(int value)
{
if (value >= 0)
{
return getCharacterCountUInt32(value);
}
else if (value == Integer.MIN_VALUE)
{
return getCharacterCountUInt32(Integer.MAX_VALUE) + 1;
}
else
{
... | java | {
"resource": ""
} |
q180523 | BitHackUtils.getCharacterCountInt64 | test | public static int getCharacterCountInt64(long value)
{
if (value >= 0)
{
return getCharacterCountUInt64(value);
}
else if (value == Long.MIN_VALUE)
{
return getCharacterCountUInt64(Long.MAX_VALUE) + 1;
}
else
{
retur... | java | {
"resource": ""
} |
q180524 | BitHackUtils.getCharacterCountDecimal | test | public static int getCharacterCountDecimal(long integerValue, int scale)
{
boolean isNeg = integerValue < 0;
// Work out how many digits will be needed for the number, adding space for the minus sign, the decimal
// point and leading zeros if needed.
int totalDigits = BitHackUtils.g... | java | {
"resource": ""
} |
q180525 | WAMCompiledQuery.setHead | test | public void setHead(Functor head, SizeableList<WAMInstruction> instructions)
{
this.head = head;
addInstructions(instructions);
} | java | {
"resource": ""
} |
q180526 | WAMCompiledQuery.emmitCode | test | public void emmitCode(ByteBuffer buffer, WAMMachine machine, WAMCallPoint callPoint) throws LinkageException
{
// Ensure that the size of the instruction listing does not exceed max int (highly unlikely).
if (sizeof() > Integer.MAX_VALUE)
{
throw new IllegalStateException("The in... | java | {
"resource": ""
} |
q180527 | WorkFlowController.setCurrentScreen | test | protected void setCurrentScreen(WorkFlowScreenPanel screen)
{
// Remove any existing screen from the panel
panel.removeAll();
// Place the new screen into the panel
panel.add(screen);
// Check if the screen is not already in the stack of accessed screens. It may be if this ... | java | {
"resource": ""
} |
q180528 | UnaryPredicateConjunction.evaluate | test | public boolean evaluate(T t)
{
// Start by assuming that the candidate will be a member of the predicate.
boolean passed = true;
// Loop through all predicates and fail if any one of them does.
for (UnaryPredicate<T> predicate : chain)
{
if (!predicate.evaluate(t... | java | {
"resource": ""
} |
q180529 | ContextualProperties.getProperty | test | public String getProperty(String key)
{
// Try to get the callers class name and method name by examing the stack.
String className = null;
String methodName = null;
// Java 1.4 onwards only.
/*try
{
throw new Exception();
}
catch (Excepti... | java | {
"resource": ""
} |
q180530 | ContextualProperties.getProperties | test | public String[] getProperties(String key)
{
// Try to get the callers class name and method name by throwing an exception an searching the stack frames.
String className = null;
String methodName = null;
/* Java 1.4 onwards only.
try {
throw new Exception();
... | java | {
"resource": ""
} |
q180531 | ContextualProperties.getKeyIterator | test | protected Iterator getKeyIterator(final String base, final String modifier, final String key)
{
return new Iterator()
{
// The key ordering count always begins at the start of the ORDER array.
private int i;
public boolean hasNext()
... | java | {
"resource": ""
} |
q180532 | ContextualProperties.createArrayProperties | test | protected void createArrayProperties()
{
// Scan through all defined properties.
for (Object o : keySet())
{
String key = (String) o;
String value = super.getProperty(key);
// Split the property key into everything before the last '.' and after it.
... | java | {
"resource": ""
} |
q180533 | BaseThrottle.setRate | test | public void setRate(float hertz)
{
// Check that the argument is above zero.
if (hertz <= 0.0f)
{
throw new IllegalArgumentException("The throttle rate must be above zero.");
}
// Calculate the cycle time.
cycleTimeNanos = (long) (1000000000f / hertz);
... | java | {
"resource": ""
} |
q180534 | UMinus.evaluate | test | protected NumericType evaluate(NumericType firstNumber)
{
// If the argument is a real number, then use real number arithmetic, otherwise use integer arithmetic.
if (firstNumber.isInteger())
{
return new IntLiteral(-firstNumber.intValue());
}
else
{
... | java | {
"resource": ""
} |
q180535 | PropertyReaderBase.findProperties | test | protected void findProperties()
{
/*log.fine("findProperties: called");*/
// Try to load the properties from a file referenced by the system property matching
// the properties file name.
properties = getPropertiesUsingSystemProperty();
if (properties != null)
{
... | java | {
"resource": ""
} |
q180536 | PropertyReaderBase.getPropertiesUsingSystemProperty | test | protected Properties getPropertiesUsingSystemProperty()
{
/*log.fine("getPropertiesUsingSystemProperty: called");*/
// Get the path to the file from the system properties
/*log.fine("getPropertiesResourceName() = " + getPropertiesResourceName());*/
String path = System.getProperty(... | java | {
"resource": ""
} |
q180537 | PropertyReaderBase.getPropertiesUsingClasspath | test | protected Properties getPropertiesUsingClasspath()
{
/*log.fine("getPropertiesUsingClasspath: called");*/
// Try to open the properties resource name as an input stream from the classpath
InputStream is = this.getClass().getClassLoader().getResourceAsStream(getPropertiesResourceName());
... | java | {
"resource": ""
} |
q180538 | PropertyReaderBase.getPropertiesUsingCWD | test | protected Properties getPropertiesUsingCWD()
{
/*log.fine("getPropertiesUsingCWD: called");*/
// Use PropertiesHelper to try to load the properties from a file or URl
try
{
return PropertiesHelper.getProperties(getPropertiesResourceName());
}
catch (IOExc... | java | {
"resource": ""
} |
q180539 | BuiltInTransformVisitor.leaveFunctor | test | protected void leaveFunctor(Functor functor)
{
int pos = traverser.getPosition();
if (!traverser.isInHead() && (pos >= 0))
{
Functor transformed = builtInTransform.apply(functor);
if (functor != transformed)
{
/*log.fine("Transformed: " +... | java | {
"resource": ""
} |
q180540 | Variable.getValue | test | public Term getValue()
{
Term result = this;
Term assignment = this.substitution;
// If the variable is assigned, loops down the chain of assignments until no more can be found. Whatever term
// is found at the end of the chain of assignments is the value of this variable.
w... | java | {
"resource": ""
} |
q180541 | Variable.setSubstitution | test | public void setSubstitution(Term term)
{
Term termToBindTo = term;
// When binding against a variable, always bind to its storage cell and not the variable itself.
if (termToBindTo instanceof Variable)
{
Variable variableToBindTo = (Variable) term;
termToBind... | java | {
"resource": ""
} |
q180542 | GreedySearch.createQueue | test | public Queue<SearchNode<O, T>> createQueue()
{
return new PriorityQueue<SearchNode<O, T>>(11, new GreedyComparator());
} | java | {
"resource": ""
} |
q180543 | SilentFailSocketAppender.cleanUp | test | public void cleanUp()
{
if (oos != null)
{
try
{
oos.close();
}
catch (IOException e)
{
LogLog.error("Could not close oos.", e);
}
oos = null;
}
if (connector != null... | java | {
"resource": ""
} |
q180544 | SilentFailSocketAppender.append | test | public void append(LoggingEvent event)
{
if (event == null)
{
return;
}
if (address == null)
{
errorHandler.error("No remote host is set for SocketAppender named \"" + this.name + "\".");
return;
}
if (oos != null)
... | java | {
"resource": ""
} |
q180545 | SilentFailSocketAppender.fireConnector | test | void fireConnector()
{
if (connector == null)
{
LogLog.debug("Starting a new connector thread.");
connector = new Connector();
connector.setDaemon(true);
connector.setPriority(Thread.MIN_PRIORITY);
connector.start();
}
} | java | {
"resource": ""
} |
q180546 | WAMCompiledTermsPrintingVisitor.initializePrinters | test | protected void initializePrinters()
{
int maxColumns = 0;
printers.add(new SourceClausePrinter(interner, symbolTable, traverser, maxColumns++, printTable));
printers.add(new PositionPrinter(interner, symbolTable, traverser, maxColumns++, printTable));
printers.add(new UnoptimizedLab... | java | {
"resource": ""
} |
q180547 | GlobalWriteLockWithWriteBehindTxMethod.commit | test | public void commit()
{
TxId txId = null;
// Check if in a higher transactional mode than none, otherwise commit does nothing.
if (!getIsolationLevel().equals(IsolationLevel.None))
{
// Extract the current transaction id.
txId = TxManager.getTxIdFromThread();
... | java | {
"resource": ""
} |
q180548 | GlobalWriteLockWithWriteBehindTxMethod.rollback | test | public void rollback()
{
TxId txId = null;
// Check if in a higher transactional mode than none, otherwise commit does nothing.
if (!getIsolationLevel().equals(IsolationLevel.None))
{
// Extract the current transaction id.
txId = TxManager.getTxIdFromThread()... | java | {
"resource": ""
} |
q180549 | GlobalWriteLockWithWriteBehindTxMethod.requestWriteOperation | test | public void requestWriteOperation(TxOperation op)
{
// Check if in a higher transactional mode than none and capture the transaction id if so.
TxId txId = null;
if (getIsolationLevel().compareTo(IsolationLevel.None) > 0)
{
// Extract the current transaction id.
... | java | {
"resource": ""
} |
q180550 | GlobalWriteLockWithWriteBehindTxMethod.addCachedOperation | test | private void addCachedOperation(TxId txId, TxOperation cachedWriteOperation)
{
List<TxOperation> writeCache = txWrites.get(txId);
if (writeCache == null)
{
writeCache = new ArrayList<TxOperation>();
txWrites.put(txId, writeCache);
}
writeCache.add(ca... | java | {
"resource": ""
} |
q180551 | GlobalWriteLockWithWriteBehindTxMethod.acquireGlobalWriteLock | test | private void acquireGlobalWriteLock(TxId txId) throws InterruptedException
{
// Get the global write lock to ensure only one thread at a time can execute this code.
globalLock.writeLock().lock();
// Use a try block so that the corresponding finally block guarantees release of the thread loc... | java | {
"resource": ""
} |
q180552 | GlobalWriteLockWithWriteBehindTxMethod.releaseGlobalWriteLock | test | private void releaseGlobalWriteLock()
{
// Get the global write lock to ensure only one thread at a time can execute this code.
globalLock.writeLock().lock();
// Use a try block so that the corresponding finally block guarantees release of the thread lock.
try
{
... | java | {
"resource": ""
} |
q180553 | GlobalWriteLockWithWriteBehindTxMethod.enlistWithSession | test | private void enlistWithSession()
{
TxSession session = TxSessionImpl.getCurrentSession();
// Ensure that this resource is being used within a session.
if (session == null)
{
throw new IllegalStateException("Cannot access transactional resource outside of a session.");
... | java | {
"resource": ""
} |
q180554 | NestedMediaQueries.enter | test | @Override
public boolean enter(RuleSetNode ruleSetNode) {
ScopeNode scopeNode = NodeTreeUtils.getFirstChild(ruleSetNode, ScopeNode.class);
SelectorGroupNode selectorGroupNode = NodeTreeUtils.getFirstChild(ruleSetNode, SelectorGroupNode.class);
if (selectorGroupNode == null) {
r... | java | {
"resource": ""
} |
q180555 | BatchSynchQueueBase.offer | test | public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException
{
if (e == null)
{
throw new IllegalArgumentException("The 'e' parameter may not be null.");
}
ReentrantLock lock = this.lock;
lock.lockInterruptibly();
long nanos = unit.... | java | {
"resource": ""
} |
q180556 | BatchSynchQueueBase.poll | test | public E poll(long timeout, TimeUnit unit) throws InterruptedException
{
ReentrantLock lock = this.lock;
lock.lockInterruptibly();
try
{
long nanos = unit.toNanos(timeout);
do
{
if (count != 0)
{
... | java | {
"resource": ""
} |
q180557 | BatchSynchQueueBase.put | test | public void put(E e) throws InterruptedException
{
try
{
tryPut(e);
}
catch (SynchException ex)
{
// This exception is deliberately ignored. See the method comment for information about this.
ex = null;
}
} | java | {
"resource": ""
} |
q180558 | BatchSynchQueueBase.insert | test | protected boolean insert(E element, boolean unlockAndBlock)
{
// Create a new record for the data item.
SynchRecordImpl<E> record = new SynchRecordImpl<E>(element);
boolean result = buffer.offer(record);
if (result)
{
count++;
// Tell any waiting co... | java | {
"resource": ""
} |
q180559 | ClientIterator.next | test | public Object next()
{
try
{
Object ob = source.next();
return ob;
}
catch (RemoteException e)
{
throw new IllegalStateException(e);
}
} | java | {
"resource": ""
} |
q180560 | ParsedProperties.getPropertyAsBoolean | test | public boolean getPropertyAsBoolean(String propName)
{
String prop = getProperty(propName);
return (prop != null) && Boolean.parseBoolean(prop);
} | java | {
"resource": ""
} |
q180561 | ParsedProperties.getPropertyAsInteger | test | public Integer getPropertyAsInteger(String propName)
{
String prop = getProperty(propName);
return (prop != null) ? Integer.valueOf(prop) : null;
} | java | {
"resource": ""
} |
q180562 | ParsedProperties.getPropertyAsLong | test | public Long getPropertyAsLong(String propName)
{
String prop = getProperty(propName);
return (prop != null) ? Long.valueOf(prop) : null;
} | java | {
"resource": ""
} |
q180563 | ScopeNode.callMixin | test | public ScopeNode callMixin(String name, ArgumentsNode arguments) {
List<ExpressionGroupNode> argumentList = (arguments != null) ? NodeTreeUtils.getChildren(arguments, ExpressionGroupNode.class) : Collections.<ExpressionGroupNode>emptyList();
if (argumentList.size() > _parameterDefinitions.size()) {
... | java | {
"resource": ""
} |
q180564 | ScopeNode.setAdditionVisitor | test | private void setAdditionVisitor() {
setAdditionVisitor(new InclusiveNodeVisitor() {
/**
* Add parameter set as a child for printing input, but also add each defined value to the variable map.
*/
@Override
public boolean add(ParametersNode node) {
... | java | {
"resource": ""
} |
q180565 | BacktrackingAlgorithm.backtrack | test | protected void backtrack(SearchNode checkNode)
{
while ((checkNode != null) && (checkNode.unexaminedSuccessorCount == 0))
{
Reversable undoState = (ReTraversable) checkNode.getState();
undoState.undoOperator();
checkNode = checkNode.getParent();
}
} | java | {
"resource": ""
} |
q180566 | WAMResolvingMachine.retrieveCode | test | public byte[] retrieveCode(WAMCallPoint callPoint)
{
byte[] result = new byte[callPoint.length];
codeBuffer.get(result, callPoint.entryPoint, callPoint.length);
return result;
} | java | {
"resource": ""
} |
q180567 | WAMResolvingMachine.executeAndExtractBindings | test | protected Set<Variable> executeAndExtractBindings(WAMCompiledQuery query)
{
// Execute the query and program. The starting point for the execution is the first functor in the query
// body, this will follow on to the subsequent functors and make calls to functors in the compiled programs.
bo... | java | {
"resource": ""
} |
q180568 | WAMResolvingMachine.decodeHeap | test | protected Term decodeHeap(int start, Map<Integer, Variable> variableContext)
{
/*log.fine("private Term decodeHeap(int start = " + start + ", Map<Integer, Variable> variableContext = " +
variableContext + "): called");*/
// Used to hold the decoded argument in.
Term result = nul... | java | {
"resource": ""
} |
q180569 | DirectMemento.capture | test | public void capture()
{
// Get the class of the object to build a memento for.
Class cls = ob.getClass();
// Iterate through the classes whole inheritence chain.
while (!cls.equals(Object.class))
{
// Get the classes fields.
Field[] attrs = cls.getDec... | java | {
"resource": ""
} |
q180570 | DirectMemento.restore | test | public void restore(Object ob) throws NoSuchFieldException
{
/*log.fine("public void map(Object ob): called");*/
/*log.fine("class is " + ob.getClass());*/
// Iterate over the whole inheritence chain.
for (Object key : values.keySet())
{
// Get the next class fro... | java | {
"resource": ""
} |
q180571 | DirectMemento.get | test | public Object get(Class cls, String attr)
{
HashMap map;
// See if the class exists in the cache.
if (!values.containsKey(cls))
{
// Class not in cache so return null.
return null;
}
// Get the cache of field values for the class.
map... | java | {
"resource": ""
} |
q180572 | DirectMemento.put | test | public void put(Class cls, String attr, Object val)
{
/*log.fine("public void put(Class cls, String attr, Object val): called");*/
/*log.fine("class name is " + cls.getName());*/
/*log.fine("attribute is " + attr);*/
/*log.fine("value to set is " + val);*/
HashMap map;
... | java | {
"resource": ""
} |
q180573 | DirectMemento.getAllFieldNames | test | public Collection getAllFieldNames(Class cls)
{
/*log.fine("public Collection getAllFieldNames(Class cls): called");*/
// See if the class exists in the cache
if (!values.containsKey(cls))
{
// Class not in cache so return null
return null;
}
... | java | {
"resource": ""
} |
q180574 | ProductionScriptGenMojo.execute | test | public void execute() throws MojoExecutionException, MojoFailureException
{
//log.debug("public void execute() throws MojoExecutionException: called");
// Turn each of the test runner command lines into a script.
for (String commandName : commands.keySet())
{
if (prodScr... | java | {
"resource": ""
} |
q180575 | LockFreeNQueue.offer | test | public boolean offer(E o)
{
/*log.fine("public boolean offer(E o): called");*/
/*log.fine("o = " + o);*/
// Ensure that the item to add is not null.
if (o == null)
{
throw new IllegalArgumentException("The 'o' parameter may not be null.");
}
// D... | java | {
"resource": ""
} |
q180576 | LockFreeNQueue.poll | test | public E poll()
{
/*log.fine("public E poll(): called");*/
// This is used to keep track of the level of the list that is found to have data in it.
int currentLevel = 0;
while (true)
{
// This is used to locate the marker head of a list that contains data.
... | java | {
"resource": ""
} |
q180577 | UniformCostSearch.createSearchNode | test | public SearchNode<O, T> createSearchNode(T state)
{
return new SearchNode<O, T>(state);
} | java | {
"resource": ""
} |
q180578 | UniformCostSearch.createQueue | test | public Queue<SearchNode<O, T>> createQueue()
{
return new PriorityQueue<SearchNode<O, T>>(11, new UniformCostComparator());
} | java | {
"resource": ""
} |
q180579 | TermWalkers.simpleWalker | test | public static TermWalker simpleWalker(TermVisitor visitor)
{
DepthFirstBacktrackingSearch<Term, Term> search = new DepthFirstBacktrackingSearch<Term, Term>();
return new TermWalker(search, new DefaultTraverser(), visitor);
} | java | {
"resource": ""
} |
q180580 | TermWalkers.goalWalker | test | public static TermWalker goalWalker(UnaryPredicate<Term> unaryPredicate, TermVisitor visitor)
{
TermWalker walker = simpleWalker(visitor);
walker.setGoalPredicate(unaryPredicate);
return walker;
} | java | {
"resource": ""
} |
q180581 | TermWalkers.positionalWalker | test | public static TermWalker positionalWalker(PositionalTermVisitor visitor)
{
PositionalTermTraverser positionalTraverser = new PositionalTermTraverserImpl();
positionalTraverser.setContextChangeVisitor(visitor);
visitor.setPositionalTraverser(positionalTraverser);
return new TermWalke... | java | {
"resource": ""
} |
q180582 | TermWalkers.positionalGoalWalker | test | public static TermWalker positionalGoalWalker(UnaryPredicate<Term> unaryPredicate, PositionalTermVisitor visitor)
{
TermWalker walker = positionalWalker(visitor);
walker.setGoalPredicate(unaryPredicate);
return walker;
} | java | {
"resource": ""
} |
q180583 | TermWalkers.positionalPostfixWalker | test | public static TermWalker positionalPostfixWalker(PositionalTermVisitor visitor)
{
PositionalTermTraverser positionalTraverser = new PositionalTermTraverserImpl();
positionalTraverser.setContextChangeVisitor(visitor);
visitor.setPositionalTraverser(positionalTraverser);
return new Te... | java | {
"resource": ""
} |
q180584 | PropertiesHelper.getProperties | test | public static Properties getProperties(InputStream is) throws IOException
{
/*log.fine("getProperties(InputStream): called");*/
// Create properties object laoded from input stream
Properties properties = new Properties();
properties.load(is);
return properties;
} | java | {
"resource": ""
} |
q180585 | PropertiesHelper.getProperties | test | public static Properties getProperties(File file) throws IOException
{
/*log.fine("getProperties(File): called");*/
// Open the file as an input stream
InputStream is = new FileInputStream(file);
// Create properties object loaded from the stream
Properties properties = get... | java | {
"resource": ""
} |
q180586 | PropertiesHelper.getProperties | test | public static Properties getProperties(URL url) throws IOException
{
/*log.fine("getProperties(URL): called");*/
// Open the URL as an input stream
InputStream is = url.openStream();
// Create properties object loaded from the stream
Properties properties = getProperties(is... | java | {
"resource": ""
} |
q180587 | PropertiesHelper.getProperties | test | public static Properties getProperties(String pathname) throws IOException
{
/*log.fine("getProperties(String): called");*/
// Check that the path is not null
if (pathname == null)
{
return null;
}
// Check if the path is a URL
if (isURL(pathname... | java | {
"resource": ""
} |
q180588 | JTextGrid.computeGridSize | test | protected Dimension computeGridSize()
{
int cols = model.getWidth();
int rows = model.getHeight();
int horizSeparatorSize = 0;
for (int size : model.getHorizontalSeparators().values())
{
horizSeparatorSize += size;
}
int vertSeparatorSize = 0;
... | java | {
"resource": ""
} |
q180589 | JTextGrid.initializeFontMetrics | test | private void initializeFontMetrics()
{
if (!fontMetricsInitialized)
{
FontMetrics fontMetrics = getFontMetrics(getFont());
charWidth = fontMetrics.charWidth(' ');
charHeight = fontMetrics.getHeight();
descent = fontMetrics.getDescent();
fon... | java | {
"resource": ""
} |
q180590 | BaseState.addPropertyChangeListener | test | public void addPropertyChangeListener(PropertyChangeListener l)
{
// Check if the listneres list has been initialized
if (listeners == null)
{
// Listeneres list not intialized so create a new list
listeners = new ArrayList();
}
synchronized (listener... | java | {
"resource": ""
} |
q180591 | BaseState.addPropertyChangeListener | test | public void addPropertyChangeListener(String p, PropertyChangeListener l)
{
// Check if the listeneres list has been initialized
if (listeners == null)
{
// Listeneres list not initialized so create a new list
listeners = new ArrayList();
}
synchroniz... | java | {
"resource": ""
} |
q180592 | BaseState.removePropertyChangeListener | test | public void removePropertyChangeListener(String p, PropertyChangeListener l)
{
if (listeners == null)
{
return;
}
synchronized (listeners)
{
listeners.remove(l);
}
} | java | {
"resource": ""
} |
q180593 | BaseState.firePropertyChange | test | protected void firePropertyChange(PropertyChangeEvent evt)
{
/*log.fine("firePropertyChange: called");*/
// Take a copy of the event as a final variable so that it can be used in an inner class
final PropertyChangeEvent finalEvent = evt;
Iterator it;
// Check if the list o... | java | {
"resource": ""
} |
q180594 | DoubleRangeType.createInstance | test | public static Type createInstance(String name, double min, double max)
{
// Ensure that min is less than or equal to max.
if (min > max)
{
throw new IllegalArgumentException("'min' must be less than or equal to 'max'.");
}
synchronized (DOUBLE_RANGE_TYPES)
... | java | {
"resource": ""
} |
q180595 | FaderImpl.doFade | test | public void doFade(ColorDelta target, String groupName)
{
FadeState fadeState = timers.get(groupName);
// Set up the color interpolator.
Iterator<Color> interpolator = new ColorInterpolator(startColor, endColor, 8).iterator();
if (fadeState == null)
{
// Create ... | java | {
"resource": ""
} |
q180596 | SwingMainWindow.showHorizontalBar | test | private void showHorizontalBar()
{
// Left vertical bar.
Component bar = factory.createGripPanel(layout.getConsoleHeightResizer(), false);
frame.getContentPane().add(bar, DesktopAppLayout.STATUS_BAR);
} | java | {
"resource": ""
} |
q180597 | SwingMainWindow.showLeftBar | test | private void showLeftBar()
{
// Left vertical bar.
Component bar = factory.createGripPanel(layout.getLeftPaneWidthResizer(), true);
frame.getContentPane().add(bar, DesktopAppLayout.LEFT_VERTICAL_BAR);
} | java | {
"resource": ""
} |
q180598 | SwingMainWindow.showRightBar | test | private void showRightBar()
{
// Right vertical bar.
Component bar = factory.createGripPanel(layout.getRightPaneWidthResizer(), true);
frame.getContentPane().add(bar, DesktopAppLayout.RIGHT_VERTICAL_BAR);
} | java | {
"resource": ""
} |
q180599 | JsoupMicrodataDocument.sanitizeRadioControls | test | private static void sanitizeRadioControls(FormElement form)
{
Map<String, Element> controlsByName = new HashMap<String, Element>();
for (Element control : form.elements())
{
// cannot use Element.select since Element.hashCode collapses like elements
if ("radio".equals(control.attr("type")) && control.ha... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.