code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public synchronized String format(LogRecord record){
final StringBuffer sb=new StringBuffer();
sb.append(formatMessage(record));
sb.append(lineSeparator);
return sb.toString();
}
| Format the given LogRecord. |
public SlowPathException(){
CompilerDirectives.transferToInterpreterAndInvalidate();
}
| Creates an exception thrown to enter a slow path. |
public Object name(){
return name;
}
| Returns an <code>Object</code> representing the name of the node. |
public void putTrip(String key,Trip trip){
trips.put(key,trip);
}
| Puts a new trip |
public boolean isEnabled(){
boolean enabled=false;
if (getValue(UI_WIDGET_ENABLED).equalsIgnoreCase("true")) {
enabled=true;
}
return enabled;
}
| Method isEnabled. |
public MatlabTest(String name){
super(name);
}
| Constructs the <code>MatlabTest</code>. |
public void assertSame(Object expected,Object actual){
TestUtils.assertSame(expected,actual);
}
| This method just invokes the test utils method, it is here for convenience |
public static String readAsciiLine(InputStream in) throws IOException {
StringBuilder result=new StringBuilder(80);
while (true) {
int c=in.read();
if (c == -1) {
throw new EOFException();
}
else if (c == '\n') {
break;
}
result.append((char)c);
}
int length=result.length();... | Returns the ASCII characters up to but not including the next "\r\n", or "\n". |
public static void logAndShow(Activity activity,String tag,Throwable t){
Log.e(tag,"Error",t);
String message=t.getMessage();
if (t instanceof GoogleJsonResponseException) {
GoogleJsonError details=((GoogleJsonResponseException)t).getDetails();
if (details != null) {
message=details.getMessage();
... | Logs the given throwable and shows an error alert dialog with its message. |
private static PublicKey generatePublicKey(final String filename){
try {
File f=new File(filename);
FileInputStream fis=new FileInputStream(f);
DataInputStream dis=new DataInputStream(fis);
byte[] keyBytes=new byte[(int)f.length()];
dis.readFully(keyBytes);
dis.close();
X509EncodedKeySpec ... | read public key |
public void endRegisterInstantiators(long startTime,boolean timedOut,boolean failed){
long duration=getStatTime() - startTime;
endClientOp(duration,timedOut,failed);
this.stats.incInt(registerInstantiatorsInProgressId,-1);
int endRegisterInstantiatorsId;
if (timedOut) {
endRegisterInstantiatorsId=register... | Records that the specified registerInstantiators has ended |
public void stopWork(){
if (DEBUG) {
Log.d(Log_TAG,String.format("work_status: stopWork %s",this));
}
mExitTasksEarly=true;
setPause(false);
if (null != mImageProvider) {
mImageProvider.flushFileCache();
}
}
| Drop all the work, and leave it in the work list. |
public synchronized long verifyBeginUpdateMemoryUsed(boolean expected_willSendEvent){
if (!beginUpdateMemoryUsed) {
fail("beginUpdateMemoryUsed was not called");
}
assertEquals(expected_willSendEvent,beginUpdateMemoryUsed_willSendEvent);
return beginUpdateMemoryUsed_bytesUsed;
}
| Verify that beginUpdateMemoryUsed was called, event will be sent, and return the "bytesUsed" it recorded. |
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. |
private void processWorkerExit(Worker w,boolean completedAbruptly){
if (completedAbruptly) decrementWorkerCount();
final ReentrantLock mainLock=this.mainLock;
mainLock.lock();
try {
completedTaskCount+=w.completedTasks;
workers.remove(w);
}
finally {
mainLock.unlock();
}
tryTerminate();
... | Performs cleanup and bookkeeping for a dying worker. Called only from worker threads. Unless completedAbruptly is set, assumes that workerCount has already been adjusted to account for exit. This method removes thread from worker set, and possibly terminates the pool or replaces the worker if either it exited due to u... |
static byte[] toByteArray(InputStream in,int expectedSize) throws IOException {
byte[] bytes=new byte[expectedSize];
int remaining=expectedSize;
while (remaining > 0) {
int off=expectedSize - remaining;
int read=in.read(bytes,off,remaining);
if (read == -1) {
return Arrays.copyOf(bytes,off);
... | Reads all bytes from an input stream into a byte array. The given expected size is used to create an initial byte array, but if the actual number of bytes read from the stream differs, the correct result will be returned anyway. |
private static List<SessionNodeModelConfig> buildModelConfigs(Element models){
Elements modelElements=models.getChildElements();
List<SessionNodeModelConfig> configs=new LinkedList<>();
ClassLoader loader=getClassLoader();
for (int i=0; i < modelElements.size(); i++) {
Element model=modelElements.get(i);
... | Builds the model configs from the models element. |
public void runTest() throws Throwable {
Document doc;
DOMImplementation domImpl;
String version="";
String version1="1.0";
String version2="2.0";
String featureCore;
String featureXML;
boolean success;
java.util.List featuresXML=new java.util.ArrayList();
featuresXML.add("XML");
featuresXML.add("... | Runs the test case. |
private static Element buildTableFieldUIControlNode(Element node,Element bodyNode){
Element controlNode=bodyNode.createElement(NAMESPACE_XFORMS,null);
String name=node.getName();
if (name.equalsIgnoreCase(NODE_ENCOUNTER_LOCATION_ID) || name.equalsIgnoreCase(NODE_ENCOUNTER_PROVIDER_ID)) {
if (useAutoCompleteFo... | Builds a UI control node for a table field. |
private static <DescriptorType>Map<DescriptorType,Object> findOrCreateDescriptorMap(final Map<Class<?>,Map<DescriptorType,Object>> analysisClassToDescriptorMapMap,final Map<Class<?>,? extends IAnalysisEngine<DescriptorType,?>> engineMap,final Class<?> analysisClass){
Map<DescriptorType,Object> descriptorMap=analysisC... | Find or create a descriptor to analysis object map. |
@Override protected Instance process(Instance instance) throws Exception {
Instance result;
int i;
double val;
double factor;
result=(Instance)instance.copy();
if (m_Decimals > -1) {
factor=StrictMath.pow(10,m_Decimals);
}
else {
factor=1;
}
for (i=0; i < result.numAttributes(); i++) {
if... | processes the given instance (may change the provided instance) and returns the modified version. |
public boolean succeeded(){
return succeeded;
}
| Returns a boolean indicating whether the append was successful. |
private static String findJarServiceProviderName(String factoryId){
SecuritySupport ss=SecuritySupport.getInstance();
String serviceId=SERVICES_PATH + factoryId;
InputStream is=null;
ClassLoader cl=findClassLoader();
is=ss.getResourceAsStream(cl,serviceId);
if (is == null) {
ClassLoader current=ObjectFa... | Find the name of service provider using Jar Service Provider Mechanism |
@Override public NotificationChain eInverseRemove(InternalEObject otherEnd,int featureID,NotificationChain msgs){
switch (featureID) {
case SexecPackage.EXECUTION_FLOW__STATE_VECTOR:
return basicSetStateVector(null,msgs);
case SexecPackage.EXECUTION_FLOW__SUB_SCOPES:
return ((InternalEList<?>)getSubScopes()).basi... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public static Map<String,Object> createPerson(DispatchContext ctx,Map<String,? extends Object> context){
Map<String,Object> result=FastMap.newInstance();
Delegator delegator=ctx.getDelegator();
Timestamp now=UtilDateTime.nowTimestamp();
List<GenericValue> toBeStored=FastList.newInstance();
Locale locale=(Loca... | Creates a Person. If no partyId is specified a numeric partyId is retrieved from the Party sequence. |
public static void close(Iterable<? extends Closeable> objects) throws IOException {
Throwable th=null;
for ( Closeable object : objects) {
try {
if (object != null) {
object.close();
}
}
catch ( Throwable t) {
addSuppressed(th,t);
if (th == null) {
th=t;
}... | Closes all given <tt>Closeable</tt>s. |
public static void overScrollBy(final PullToRefreshBase<?> view,final int deltaX,final int scrollX,final int deltaY,final int scrollY,final int scrollRange,final boolean isTouchEvent){
overScrollBy(view,deltaX,scrollX,deltaY,scrollY,scrollRange,0,DEFAULT_OVERSCROLL_SCALE,isTouchEvent);
}
| Helper method for Overscrolling that encapsulates all of the necessary function. This version of the call is used for Views that need to specify a Scroll Range but scroll back to it's edge correctly. |
public int selectNumberOfControlBits(){
int iNum=0;
iNum=javax.swing.JOptionPane.showOptionDialog(null,"How many C/MRI output bits should be used to control this turnout?","C/MRI Turnout Question",javax.swing.JOptionPane.DEFAULT_OPTION,javax.swing.JOptionPane.QUESTION_MESSAGE,null,new String[]{"Use 1 bit","Use 2 bi... | Public method to allow user to specify one or two output bits for turnout control Note: This method returns 1 or 2 if the user selected, or 0 if the user cancelled without selecting. |
public boolean checkLimits(DiagnosticPosition pos,Log log){
if (cp > ClassFile.MAX_CODE) {
log.error(pos,"limit.code");
return true;
}
if (max_locals > ClassFile.MAX_LOCALS) {
log.error(pos,"limit.locals");
return true;
}
if (max_stack > ClassFile.MAX_STACK) {
log.error(pos,"limit.stack");... | Check the code against VM spec limits; if problems report them and return true. |
public void restartCoordinator(String type) throws LocalRepositoryException {
final String prefix=String.format("resetCoordinator (%s): ",type);
_log.debug(prefix);
final String[] cmd={_SYSTOOL_CMD,_SYSTOOL_RESTART_COORDINATOR,type};
final Exec.Result result=Exec.sudo(_SYSTOOL_TIMEOUT,cmd);
checkFailure(resul... | Reset coordinator and restart services on standby site. It applies on DR standby site only |
public AuthPermission(String name){
super(init(name));
}
| Creates an authentication permission with the specified target name. |
private void findTypesIn(Object model,Map<String,Type> types){
requireNonNull(model);
requireNonNull(types);
if (HasSupertype.class.isAssignableFrom(model.getClass())) {
((HasSupertype<?>)model).getSupertype().ifPresent(null);
}
if (HasAnnotationUsage.class.isAssignableFrom(model.getClass())) {
((HasA... | A recursive method that parses through the model hierarchy of the specified object and adds all found types to the supplied map. The type names will be used as keys. |
public static boolean isButtonPressed(InputEvent e,int button){
return (e.getModifiers() & button) == button;
}
| Indicates if a given mouse button is being pressed. |
public static void main(String[] args) throws IOException {
boolean enableOutput=true;
boolean outputToFile=false;
String inputFolder=MadMmt.class.getClassLoader().getResource("workload/planetlab").getPath();
String outputFolder="output";
String workload="20110303";
String vmAllocationPolicy="mad";
String... | The main method. |
private synchronized void execute(){
callback.run();
}
| Executes the task. |
public static ComponentUI createUI(JComponent c){
return new BEComboBoxUI();
}
| Creates the ui. |
public static double atan2(double y,double x){
if (USE_JDK_MATH) {
return STRICT_MATH ? StrictMath.atan2(y,x) : Math.atan2(y,x);
}
if (x > 0.0) {
if (y == 0.0) {
return (1 / y == Double.NEGATIVE_INFINITY) ? -0.0 : 0.0;
}
if (x == Double.POSITIVE_INFINITY) {
if (y == Double.POSITIVE_INF... | For special values for which multiple conventions could be adopted, behaves like Math.atan2(double,double). |
private String createPasswordForUser(String clearTextPassword){
String encryptedPassword=clearTextPassword;
if (this.authenticationInfo.isUseEncryptedPasswords()) {
Encryptor encryptor=null;
;
try {
encryptor=new Encryptor(this.authenticationInfo);
}
catch ( ConfigurationException e) {
... | create an encoded or clear text password (depending on settings) for the given user. |
private void showFeedback(String message){
if (myHost != null) {
myHost.showFeedback(message);
}
else {
System.out.println(message);
}
}
| Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface. |
public void init(int WindowNo,FormFrame frame){
m_WindowNo=WindowNo;
m_frame=frame;
log.info("VMerge.init - WinNo=" + m_WindowNo);
try {
preInit();
jbInit();
frame.getContentPane().add(panel,BorderLayout.CENTER);
}
catch ( Exception ex) {
log.log(Level.SEVERE,"",ex);
}
}
| Initialize Panel |
@Deprecated public static void dragViewToBottom(ActivityInstrumentationTestCase test,View v,int stepCount){
dragViewToBottom(test,test.getActivity(),v,stepCount);
}
| Simulate touching the center of a view and dragging to the bottom of the screen. |
public ToStringHelper addValue(boolean value){
return addHolder(String.valueOf(value));
}
| Adds an unnamed value to the formatted output. |
public K auth(Activity act,String type,String account){
if (android.os.Build.VERSION.SDK_INT >= 5 && type.startsWith("g.")) {
ah=new GoogleHandle(act,type,account);
}
return self();
}
| Set the authentication type of this request. This method requires API 5+. |
public static double stddev(int[] a){
return Math.sqrt(var(a));
}
| Returns the sample standard deviation in the specified array. |
public static int reflectionCompare(final Object lhs,final Object rhs,final Collection<String> excludeFields){
return reflectionCompare(lhs,rhs,ReflectionToStringBuilder.toNoNullStringArray(excludeFields));
}
| <p>Compares two <code>Object</code>s via reflection.</p> <p>Fields can be private, thus <code>AccessibleObject.setAccessible</code> is used to bypass normal access control checks. This will fail under a security manager unless the appropriate permissions are set.</p> <ul> <li>Static fields will not be compared</li> <l... |
protected void sequence_MemberExpression(ISerializationContext context,NewTarget semanticObject){
genericSequencer.createSequence(context,semanticObject);
}
| Contexts: LeftHandSideExpression<Yield> returns NewTarget LeftHandSideExpression returns NewTarget LeftHandSideExpression.ParameterizedCallExpression_1_0<Yield> returns NewTarget LeftHandSideExpression.ParameterizedCallExpression_1_0<PostfixExpression.Yield> returns NewTarget LeftHandSideExpression.ParameterizedCallExp... |
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){
switch (featureID) {
case TypesPackage.ARRAY_TYPE_SPECIFIER__SIZE:
return getSize();
}
return super.eGet(featureID,resolve,coreType);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public void init(SolrResourceLoader loader,NamedList<String> initArgs,StorageIO storageIO) throws SolrException {
log.info("Initializing RestManager with initArgs: " + initArgs);
if (storageIO == null) throw new IllegalArgumentException("Must provide a valid StorageIO implementation to the RestManager!");
this.... | Initializes the RestManager with the storageIO being optionally created outside of this implementation such as to use ZooKeeper instead of the local FS. |
public static void loadConfigResource(String resourceName) throws IOException {
config.clear();
config.putAll(loadPropertiesFromResource(resourceName));
}
| Load configuration from resource in current class loader. |
public TypeValue(String value){
super(SootUtils.toSootType(value));
}
| Create a new class type with the argument as the underlying class. |
public boolean isPowerOfThree(int n){
if (n <= 0) return false;
while (n > 1 && n % 3 == 0) {
n/=3;
}
return n == 1;
}
| Check if n's modular of 3 is zero. If yes, divide n by 3 and check again. Stop till n is 1. |
public InputStreamReader(java.io.InputStream is,java.lang.String enc) throws java.io.UnsupportedEncodingException {
}
| Create an InputStreamReader that uses the named character encoding. is - An InputStreamenc - The name of a supported character encoding - If the named encoding is not supported |
public ul addElement(li[] list){
for (int x=0; x < list.length; x++) {
addElement(list[x]);
}
return (this);
}
| Add a list to the ul |
@Override public int hashCode(){
return (value == null ? 0 : value.hashCode());
}
| Computes the hash value of this in/out parameter value. <p/> |
public boolean contains(String field){
return delegate.contains(field);
}
| Returns true if this tuple contains the specified name of the field. |
public void test_tx_begin_UPDATE_commit() throws RepositoryException, MalformedQueryException, UpdateExecutionException {
if (true) return;
assertFalse(cxn.isActive());
cxn.begin();
assertTrue(cxn.isActive());
final URI a=cxn.getValueFactory().createURI(DEFAULT_PREFIX + "a");
final URI b=cxn.getValueFacto... | Basic test creates a read/write connection, issues begin(), and then issues commit() on the connection. TODO Test where we abort the connection. Verify write set is discarded. |
public void error(String trace){
printTrace(trace,ERROR_LEVEL);
}
| Error trace |
public void process(JCas jcas) throws AnalysisEngineProcessException {
Integer offset=0;
String docText=jcas.getDocumentText();
TokenizerFactory<Word> fac=PTBTokenizerFactory.newTokenizerFactory();
fac.setOptions("ptb3Escaping=false,untokenizable=noneKeep");
List<List<HasWord>> tokenArray=MaxentTagger.tokeniz... | Method that gets called to process the documents' cas objects |
void renderEdge(){
glDisable(GL_DEPTH_TEST);
glUseProgram(this.edgeProgram);
glClear(GL_COLOR_BUFFER_BIT);
glUniformMatrix4fv(inverseMatrixUniform,false,invMatrix.get(matrixBuffer));
glUniform1f(invWidthUniform,1.0f / width);
glUniform1f(invHeightUniform,1.0f / height);
glUniform1i(normalTexUniform,0);
... | Render the edges using the edge detection filter and blend that with the normals. |
static Varargs rep(Varargs args){
LuaString s=args.checkstring(1);
int n=args.checkint(2);
final byte[] bytes=new byte[s.length() * n];
int len=s.length();
for (int offset=0; offset < bytes.length; offset+=len) {
s.copyInto(0,bytes,offset,len);
}
return LuaString.valueOf(bytes);
}
| string.rep (s, n) Returns a string that is the concatenation of n copies of the string s. |
@Override void drawAffine(final double[] afValues){
pageObjects.addElement(null);
objectType.addElement(DynamicVectorRenderer.AF);
areas.addElement(null);
af1.addElement(afValues[0]);
af2.addElement(afValues[1]);
af3.addElement(afValues[2]);
af4.addElement(afValues[3]);
x_coord=RenderUtils.checkSize(x_c... | store af info |
public static void deleteFileWithRetry(Path path) throws IOException {
try {
deleteFileWithRetry0(path);
}
catch ( InterruptedException x) {
throw new IOException("Interrupted while deleting.",x);
}
}
| Deletes a file, retrying if necessary. |
@DSSource({DSSourceKind.BLUETOOTH}) @DSSpec(DSCat.IO) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:32:34.447 -0500",hash_original_method="2059D974D6DFEDC9A8B8553096188222",hash_generated_method="6E79AC07ED988EFBA15A6F1994AEF577") public int read() throws IOException {
byte b[]=... | Reads a single byte from this stream and returns it as an integer in the range from 0 to 255. Returns -1 if the end of the stream has been reached. Blocks until one byte has been read, the end of the source stream is detected or an exception is thrown. |
public static InlineQueryResultCachedVoiceBuilder builder(){
return new InlineQueryResultCachedVoiceBuilder();
}
| This builder will allow you to progressively construct this object. |
public boolean isNew(){
return m_fdr.isNew();
}
| Determina si una carpeta es nueva o no |
public void closeAsMarkedForReschedule(final JsonCommand command,final LoanLifecycleStateMachine loanLifecycleStateMachine,final Map<String,Object> changes){
final LocalDate rescheduledOn=command.localDateValueOfParameterNamed("transactionDate");
final LoanStatus statusEnum=loanLifecycleStateMachine.transition(Loan... | Behaviour added to comply with capability of previous mifos product to support easier transition to fineract platform. |
private void makeRoom(int numValues){
if (values == null) {
values=new float[2 * numValues];
types=new int[2];
numVals=0;
numSeg=0;
return;
}
int newSize=numVals + numValues;
if (newSize > values.length) {
int nlen=values.length * 2;
if (nlen < newSize) nlen=newSize;
float[] ... | Make sure, that the requested number of slots in vales[] are available. Must be called even for numValues = 0, because it is also used for initialization of those arrays. |
@Override @Inline public ObjectReference traceObject(ObjectReference object,boolean root){
if (root && RCBase.isRCObject(object)) {
rootBuffer.push(object);
}
return object;
}
| When we trace a root object we remember it. |
private boolean recursiveDelete(PreferenceGroup group,Preference preference){
if (group == null) {
Log.d(TAG,"attempting to delete from null preference group");
return false;
}
if (preference == null) {
Log.d(TAG,"attempting to delete null preference");
return false;
}
if (group.removePreferen... | Recursively traverses the tree from the given group as the route and tries to delete the preference. Traversal stops once the preference was found and removed. |
protected void doParse() throws ParseException, IOException {
bufferSize=0;
current=reader.read();
fragmentIdentifierHandler.startFragmentIdentifier();
ident: {
String id=null;
switch (current) {
case 'x':
bufferize();
current=reader.read();
if (current != 'p') {
parseIdentifier();
break... | Parses the current reader. |
public void paintTreeBackground(SynthContext context,Graphics g,int x,int y,int w,int h){
}
| Paints the background of a tree. |
public static RecordBuilder snap(View measuredView){
return ScreenshotImpl.getInstance().snap(measuredView);
}
| Take a snapshot of an already measured and layout-ed view. See adb-logcat for how to pull the screenshot. This method is thread safe. |
public boolean containsKey(Object key){
return m_lookup.containsKey(key);
}
| The Lookup contains the key |
public ProjectionStackSupport(){
}
| Construct a ProjectionStackSupport. |
public final boolean isRaw(){
return this.raw;
}
| Returns whether the associated element is a raw type/method or not. |
public BaseDocumentListEntry(){
super();
}
| Constructs a new uninitialized entry, to be populated by the GData parsers. |
public UniformCostSearch(){
this(new GraphSearch());
}
| Creates a UniformCostSearch instance using GraphSearch |
public void testApp(){
assertTrue(true);
}
| Rigourous Test :-) |
public void addTab(String title,Icon icon,Component component){
insertTab(title,icon,component,null,pages.size());
}
| Adds a <code>component</code> represented by a <code>title</code> and/or <code>icon</code>, either of which can be <code>null</code>. Cover method for <code>insertTab</code>. |
public void registerElement(String name) throws Exception {
if (!order.contains(name)) {
order.add(name);
}
elements.put(name,null);
}
| This is used to register an XML entity within the model. The registration process has the affect of telling the model that it will contain a specific, named, XML entity. It also has the affect of ordering them within the model, such that the first registered entity is the first iterated over. |
public static boolean hasCapturedParametersInInvocationSequence(InvocationSequenceData data){
return (null != data.getParameterContentData()) && !data.getParameterContentData().isEmpty();
}
| Checks if the invocation sequence data object itself contains parameters. |
@Override protected SystemMember createSystemMember(ApplicationVM app) throws org.apache.geode.admin.AdminException {
return new SystemMemberJmxImpl(this,app);
}
| Override createSystemMember by instantiating SystemMemberJmxImpl |
public String randomAlphaUpper(int length){
return randomString(JexlStringFunctions.alphaUpper,length);
}
| Get a random string of upper case letters of given length |
public BlockTarget(){
setRPClass("blocktarget");
put("type","blocktarget");
hide();
}
| Create a BlockTarget accepting any Block |
private CommandMessage continueSet(Channel channel,SessionStatus state,ChannelBuffer remainder,ChannelHandlerContext channelHandlerContext){
state.cmd.element.setData(remainder);
return state.cmd;
}
| Handles the continuation of a SET/ADD/REPLACE command with the data it was waiting for. |
@Override public void draw(final Graphics g,final int x,final int y){
}
| Draw the sprite onto the graphics context provided. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
private static long CallStaticLongMethodA(JNIEnvironment env,int classJREF,int methodID,Address argAddress) throws Exception {
if (traceJNI) VM.sysWrite("JNI called: CallStaticLongMethodA \n");
Object returnObj=JNIGenericHelpers.callMethodJValuePtr(env,0,methodID,argAddress,TypeReference.Long,true);
return Ref... | CallStaticLongMethodA: invoke a static method that returns a long value |
public Object read(InputNode node) throws Exception {
Object value=factory.getInstance();
Collection list=(Collection)value;
if (list != null) {
return read(node,list);
}
return null;
}
| This <code>read</code> method wll read the XML element list from the provided node and deserialize its children as entry types. This will deserialize each entry type as a primitive value. In order to do this the parent string provided forms the element. |
public static String renderBooleanPassthruAttributes(FacesContext context,UIComponent component){
int i=0, len=booleanPassthruAttributes.length;
String value;
boolean thisIsTheFirstAppend=true;
StringBuffer renderedText=new StringBuffer();
for (i=0; i < len; i++) {
if (null != (value=(String)component.get... | Render any boolean "passthru" attributes. <p/> |
public static DateTimeFormatter dateHourMinuteSecond(){
return Constants.dhms;
}
| Returns a formatter that combines a full date, two digit hour of day, two digit minute of hour, and two digit second of minute. (yyyy-MM-dd'T'HH:mm:ss) |
public void testZonesAndTentsDisplayed_afterPatientListView(){
inUserLoginGoToLocationSelection();
inLocationSelectionClickLocation("ALL PRESENT PATIENTS");
pressBack();
inLocationSelectionCheckZonesAndTentsDisplayed();
}
| Tests that zones and tents are still displayed after returning from list view. |
public static Graph addCycles(Graph dag,int maxNumCycles,int minCycleLength){
if (maxNumCycles <= 0) {
throw new IllegalArgumentException("maxNumCycles most be > 0: " + maxNumCycles);
}
if (minCycleLength <= 0) {
throw new IllegalArgumentException("minCycleLength most be > 0: " + minCycleLength);
}
Se... | This method builds on the randomDag methods by implementing a procedure for adding cycles to a graph. |
public static Object[] nullToEmpty(final Object[] array){
if (array == null || array.length == 0) {
return ArrayUtils.EMPTY_OBJECT_ARRAY;
}
return array;
}
| <p>Defensive programming technique to change a <code>null</code> reference to an empty one.</p> <p>This method returns an empty array for a <code>null</code> input array.</p> <p>As a memory optimizing technique an empty array passed in will be overridden with the empty <code>public static</code> references in this cla... |
public static <T>List<T> defaultList(List<T> value){
if (value == null) {
return new ArrayList<T>();
}
else {
return value;
}
}
| Defaults the list to an empty list if null. |
public static int compileShader(@ShaderType final int shaderType,final String shaderSource){
int shaderHandle=GLES20.glCreateShader(shaderType);
if (shaderHandle != 0) {
GLES20.glShaderSource(shaderHandle,shaderSource);
GLES20.glCompileShader(shaderHandle);
final int[] compilationStatus=new int[1];
... | Helper function to compile a shader. |
protected final void mergeSecurityRoles(WebXml theWebXml){
List<String> securityRoleNames=WebXmlUtils.getSecurityRoleNames(theWebXml);
int count=0;
for ( String securityRoleName : securityRoleNames) {
if (!WebXmlUtils.hasSecurityRole(this.webXml,securityRoleName)) {
WebXmlUtils.addSecurityRole(this.web... | Merges the security roles from the provided descriptor into the original descriptor. |
protected boolean allKeyFieldsPresent(Entity e,EnumSet<DeviceField> keyFields){
for ( DeviceField f : keyFields) {
switch (f) {
case MAC:
break;
case IPV4:
if (e.ipv4Address == null) return false;
break;
case SWITCH:
if (e.switchDPID == null) return false;
break;
case PORT:
if (e.switchPort == null) ... | Check if the entity e has all the keyFields set. Returns false if not |
@Override public void close() throws IOException {
_stream.close();
}
| Closes the stream. |
public LogPanel(){
this(null,false,false,true);
}
| Creates the log panel with no task monitor and the log always visible. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.