code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public ConfProxyProperties(final String name) throws ConfigurationException {
this.instance=name;
String confDir=SystemProperties.getConfigurationProxyConfPath();
File configFile=Paths.get(confDir,instance,CONF_INI).toFile();
if (!configFile.exists()) {
throw new ConfigurationException("'" + CONF_INI + "' d... | Constructs the configuration for the given configuration proxy instance id. |
public StackedBarChart(final String title,final String xAxisLabel,final String yAxisLabel,final String[] categories){
super(title,xAxisLabel,yAxisLabel);
this.dataset=new DefaultCategoryDataset();
this.chart=createChart(title,xAxisLabel,yAxisLabel,this.dataset);
this.plot=this.chart.getCategoryPlot();
this.ca... | Creates a new BarChart with the specified category-labels. |
private void initProgressBar(){
mMax=100;
mProgress=0;
mSecondaryProgress=0;
mIndeterminate=false;
mOnlyIndeterminate=false;
mDuration=4000;
mBehavior=AlphaAnimation.RESTART;
mMinWidth=24;
mMaxWidth=48;
mMinHeight=24;
mMaxHeight=48;
}
| <p> Initialize the progress bar's default values: </p> <ul> <li>progress = 0</li> <li>max = 100</li> <li>animation duration = 4000 ms</li> <li>indeterminate = false</li> <li>behavior = repeat</li> </ul> |
private void returnData(Object ret){
if (myHost != null) {
myHost.returnData(ret);
}
}
| Used to communicate a return object from a plugin tool to the main Whitebox user-interface. |
public boolean isLocalVdcId(String shortVdcId){
return StringUtils.isBlank(shortVdcId) || StringUtils.equals(shortVdcId,VdcUtil.getLocalShortVdcId());
}
| Is the provided short VDC id this VDC's id (or empty) |
public final double doOperation(){
int[] allocations=new int[allocationParameter.getDimension()];
int[] occupancy=new int[N];
int K=0;
for (int i=0; i < allocations.length; i++) {
allocations[i]=(int)allocationParameter.getParameterValue(i);
occupancy[allocations[i]]+=1;
if (occupancy[allocations[i]... | change the parameter and return the hastings ratio. |
protected boolean draggingOver(Component dragged,int x,int y){
return dropTarget;
}
| This method allows a component to indicate if it is a drop target for the given component at the given x/y location (in component coordiate space). This method can also update the drop tagets appearance to indicate the drop location. |
public static <K,V>boolean putMapNotNullKey(Map<K,V> map,K key,V value){
if (map == null || key == null) {
return false;
}
map.put(key,value);
return true;
}
| add key-value pair to map, key need not null |
void checkTimeout(){
if (!requestPending) return;
synchronized (this) {
if (!requestPending) return;
long now=System.nanoTime();
if (now - this.roleSubmitTimeNs > roleTimeoutNs) {
switchManagerCounters.roleReplyTimeout.increment();
setSwitchRole(pendingRole,RoleRecvStatus.NO_REPLY);
... | Check if a pending role request has timed out. |
public String address(){
return hostAddress;
}
| returns the remote ip address as string |
public float floatValue(){
return 0.0f;
}
| Returns the value of this Long as a float. |
@Override public void updateTimestamp(int columnIndex,Timestamp x) throws SQLException {
try {
if (isDebugEnabled()) {
debugCode("updateTimestamp(" + columnIndex + ", x);");
}
update(columnIndex,x == null ? (Value)ValueNull.INSTANCE : ValueTimestamp.get(x));
}
catch ( Exception e) {
throw lo... | Updates a column in the current or insert row. |
public ToStringBuilder append(final String fieldName,final Object[] array,final boolean fullDetail){
style.append(buffer,fieldName,array,Boolean.valueOf(fullDetail));
return this;
}
| <p>Append to the <code>toString</code> an <code>Object</code> array.</p> <p>A boolean parameter controls the level of detail to show. Setting <code>true</code> will output the array in full. Setting <code>false</code> will output a summary, typically the size of the array.</p> |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public Gender lookupGender(String text){
return lookup(exactGender,startsWithGender,endsWithGender,text,Gender.UNKNOWN);
}
| Return the gender for a given string, if it is known, or UNKNOWN otherwise |
public static void send(InternalDistributedMember recipient,int processorId,Object returnValue,ReplySender dm){
Assert.assertTrue(recipient != null,"Sending a ReplyMessage to ALL");
ReplyMessage m=new ReplyMessage();
m.processorId=processorId;
if (returnValue != null) {
m.returnValue=returnValue;
m.retu... | Send an ack |
public void createInfoDialog(String message,int code){
MessageDialog.openInformation(null,"Information",message);
}
| Creates a simple info dialog. |
private CodeAttribute(ConstPool cp,CodeAttribute src,Map classnames) throws BadBytecode {
super(cp,tag);
maxStack=src.getMaxStack();
maxLocals=src.getMaxLocals();
exceptions=src.getExceptionTable().copy(cp,classnames);
attributes=new ArrayList();
List src_attr=src.getAttributes();
int num=src_attr.size();... | Constructs a copy of <code>Code_attribute</code>. Specified class names are replaced during the copy. |
protected int[] dummyColorInscribedDataCircleFromYuvImage(ImageProxy img,int subsample){
logWrapper("RUNNING DUMMY dummyColorInscribedDataCircleFromYuvImage");
int w=img.getWidth() / subsample;
int h=img.getHeight() / subsample;
int r=inscribedCircleRadius(w,h);
int len=r * r * 4;
int[] colors=new int[len];... | DEBUG IMAGE FUNCTION Converts an Android Image to a inscribed circle bitmap, currently wired to the test pattern. Will subsample and optimize the image given a target resolution. |
@Override public String toStringNoWeight(int afterDecimalPoint){
StringBuffer text=new StringBuffer();
text.append('{');
for (int i=0; i < m_Indices.length; i++) {
if (i > 0) {
text.append(",");
}
if (isMissingSparse(i)) {
text.append(m_Indices[i] + " ?");
}
else {
if (m_Dataset... | Returns the description of one instance in sparse format. If the instance doesn't have access to a dataset, it returns the internal floating-point values. Quotes string values that contain whitespace characters. |
public void testGetInt24(){
byte[] bytes={12,0,0,1,-1,-1,-1,0,0,0,0,0,-128,-1,-1,127};
MySQLPacket array=new MySQLPacket(bytes.length - MySQLPacket.HEADER_LENGTH,bytes,(byte)1);
assertEquals(-1,array.getInt24());
assertEquals(0,array.getInt24());
assertEquals(-0x800000,array.getInt24());
assertEquals(0x7fff... | Test the getInt24() method. |
public final boolean isErrorEnabled(){
return isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR);
}
| <p> Are error messages currently enabled? </p> <p> This allows expensive operations such as <code>String</code> concatenation to be avoided when the message will be ignored by the logger. </p> |
public LabelEx(Image i){
setIcon(i);
}
| Construct a Label with passed Image as its icon. |
public static void d(String tag,String message){
if (DEBUG_ON) {
Log.d(tag,message);
}
}
| Method to do a debug log |
public static int[][] scanChunk(World world,int offsetX,int offsetZ,int radius,int blocksPerPixel){
blocksPerPixel=Math.max(blocksPerPixel,1);
int[][] ret=new int[(radius * 2) / blocksPerPixel][(radius * 2) / blocksPerPixel];
Chunk chunk=world.getChunkFromBlockCoords(offsetX,offsetZ);
IChunkProvider provider=wo... | Note: array returned will be [radius/blocksPerPixel][radius/blocksPerPixel] |
public TraceNodeExecuted createTraceNodeExecuted(){
TraceNodeExecutedImpl traceNodeExecuted=new TraceNodeExecutedImpl();
return traceNodeExecuted;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static int computeRawVarint64Size(final long value){
if ((value & (0xffffffffffffffffL << 7)) == 0) return 1;
if ((value & (0xffffffffffffffffL << 14)) == 0) return 2;
if ((value & (0xffffffffffffffffL << 21)) == 0) return 3;
if ((value & (0xffffffffffffffffL << 28)) == 0) return 4;
if ((value ... | Compute the number of bytes that would be needed to encode a varint. |
public BurlapProtocolException(String message,Throwable rootCause){
super(message,rootCause);
}
| Create the exception. |
public final void yyclose() throws java.io.IOException {
zzAtEOF=true;
zzEndRead=zzStartRead;
if (zzReader != null) zzReader.close();
}
| Closes the input stream. |
public static double weightedCoefficient(double[] x,double[] y,double[] weights){
final int xdim=x.length;
final int ydim=y.length;
if (xdim != ydim) {
throw new IllegalArgumentException("Invalid arguments: arrays differ in length.");
}
if (xdim != weights.length) {
throw new IllegalArgumentException(... | Compute the Pearson product-moment correlation coefficient for two FeatureVectors. |
public void ret(final int local){
mv.visitVarInsn(Opcodes.RET,local);
}
| Generates a RET instruction. |
public <K>T delete(String url,Class<K> type,Object handler,String callback){
AjaxCallback<K> cb=new AjaxCallback<K>();
cb.weakHandler(handler,callback);
return delete(url,type,cb);
}
| Ajax HTTP delete. The handler signature must be (String url, <K> object, AjaxStatus status) |
public Address __rmul__(final Object rhs){
return new Address(m_value.multiply(getBigInteger(rhs)));
}
| Used to support reverse MUL operations on addresses in Python scripts. |
private Socket connect(String host,String portString) throws IOException {
int port=0;
Socket sock=null;
boolean DEBUG=Debug.debugging("netmap");
try {
port=Integer.parseInt(portString,10);
}
catch ( NumberFormatException e) {
if (DEBUG) Debug.output("Illegal name " + host + ":"+ portString);
... | A general connection method that returns a socket for a host and port. |
final public SyntaxTreeNode Lambda() throws ParseException {
SyntaxTreeNode tn;
Token t;
bpa("Lambda");
t=jj_consume_token(LAMBDA);
addHeir(new SyntaxTreeNode(mn,t));
expecting="Identifier";
tn=Identifier();
addHeir(tn);
expecting="`,' or `:'";
label_48: while (true) {
switch ((jj_ntk == -1) ? jj_... | Lambda expression added by LL on 27 March 2007 * L.Lambda ::= <LAMBDA> (IdentDecl | SomeFixDecl) (<COMMA> (IdentDecl | SomeFixDecl))* <COLON> Expression ... |
public static void main(String[] args){
int count=0;
double sum=0.0;
while (!StdIn.isEmpty()) {
double value=StdIn.readDouble();
sum+=value;
count++;
}
double average=sum / count;
StdOut.println("Average is " + average);
}
| Reads in a sequence of real numbers from standard input and prints out their average to standard output. |
@CanIgnoreReturnValue @Deprecated @Override public final E remove(int index){
throw new UnsupportedOperationException();
}
| Guaranteed to throw an exception and leave the list unmodified. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:49.367 -0500",hash_original_method="B186F7F0BF353B1A746862E337C50A69",hash_generated_method="7727160CCA8A9EE39BE8CC36CB939BC2") public void pushContext(){
int max=contexts.length;
contexts[contextPos].declsOK=false;
contextPos... | Start a new Namespace context. The new context will automatically inherit the declarations of its parent context, but it will also keep track of which declarations were made within this context. <p>Event callback code should start a new context once per element. This means being ready to call this in either of two plac... |
public void incrementFor(T key){
Integer value=counter.get(key);
if (value == null) {
counter.put(key,1);
}
else {
counter.put(key,value + 1);
}
total++;
}
| Increments the count to which the specified key is mapped in this frequency counter, or puts 1 if the map contains no mapping for this key. |
public LnSv2MessageContents(LocoNetMessage m) throws java.lang.IllegalArgumentException {
log.debug("interpreting a LocoNet message - may be an SV2 message");
if (!isSupportedSv2Message(m)) {
log.debug("interpreting a LocoNet message is NOT an SV2 message");
throw new java.lang.IllegalArgumentException("Loc... | Create a new LnSV2MessageContents object from a LocoNet message |
public SoftValueHashMap(int initialCapacity){
hash=new HashMap(initialCapacity);
}
| Constructs a new, empty <code>WeakHashMap</code> with the given initial capacity and the default load factor, which is <code>0.75</code>. |
public FilteredWarmEmissionHandler(final double simulationEndTime,final int noOfTimeBins){
this(simulationEndTime,noOfTimeBins,null,null,null,null);
LOGGER.info("No filtering is used, result will include all links, persons from all user groups..");
}
| No filtering will be used, result will include all links, persons from all user groups. |
private int readFrameType(final Object[] frame,final int index,int v,final char[] buf,final Label[] labels){
int type=b[v++] & 0xFF;
switch (type) {
case 0:
frame[index]=Opcodes.TOP;
break;
case 1:
frame[index]=Opcodes.INTEGER;
break;
case 2:
frame[index]=Opcodes.FLOAT;
break;
case 3:
frame[index]=Opcodes.DOUBL... | Reads a stack map frame type and stores it at the given index in the given array. |
public void updateTask(){
if (toDistance - theMaid.getActiveModeClass().getDistanceSqToStartFollow() > 1.0) {
theMaid.getLookHelper().setLookPositionWithEntity(theOwner,10F,theMaid.getVerticalFaceSpeed());
}
if (theMaid.isSitting()) {
return;
}
if (!theMaid.isInWater()) {
theMaid.setSprinting(toDi... | Updates the task |
private void gobble(Iterator iter){
if (eatTheRest) {
while (iter.hasNext()) {
tokens.add(iter.next());
}
}
}
| Adds the remaining tokens to the processed tokens list. |
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 static boolean dateBeforeInclusive(final Date date1,final Date date2){
return !date1.after(date2);
}
| Checks if a date is before another date or if they are equal. |
public boolean hasSize(){
return hasExtension(Size.class);
}
| Returns whether it has the size. |
public LineIterator(final Reader reader) throws IllegalArgumentException {
if (reader == null) {
throw new IllegalArgumentException("Reader must not be null");
}
if (reader instanceof BufferedReader) {
bufferedReader=(BufferedReader)reader;
}
else {
bufferedReader=new BufferedReader(reader);
}
}
| Constructs an iterator of the lines for a <code>Reader</code>. |
public CassandraConfig build(){
return create(version,cpus,memoryMb,diskMb,diskType,replaceIp,heap,location,jmxPort,publishDiscoveryInfo,application);
}
| Creates a CassandraConfig with the properties of the Builder. |
@Override public void onMessageReceived(String from,Bundle data){
String message=data.getString("message");
Log.d(TAG,"From: " + from);
Log.d(TAG,"Message: " + message);
sendNotification(message);
}
| Called when message is received. |
public static _Fields findByThriftIdOrThrow(int fieldId){
_Fields fields=findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
| Find the _Fields constant that matches fieldId, throwing an exception if it is not found. |
public boolean isWhiteOnTop(){
return isWhiteOnTop;
}
| Returns true if white is on top, false if white is on botton. |
private void endFling(boolean scrollIntoSlots){
synchronized (this) {
mRotator.forceFinished(true);
}
if (scrollIntoSlots) scrollIntoSlots();
}
| End fling. |
private void updateProgress(int progress){
if (myHost != null && progress != previousProgress) {
myHost.updateProgress(progress);
}
previousProgress=progress;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
public Bitmap toBitmap(int width,int height,int edge,int numSample,int color){
final Bitmap bitmap=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);
final Canvas canvas=new Canvas(bitmap);
canvas.translate(edge,edge);
final Paint paint=new Paint();
paint.setAntiAlias(BITMAP_RENDERING_ANTIALIAS);
pa... | Creates a bitmap of the gesture with a transparent background. |
private char replaceEntity() throws XMLStreamException {
if ((_state == STATE_COMMENT) || (_state == STATE_PI) || (_state == STATE_CDATA)) return '&';
int start=_index;
_data[_index++]='&';
while (true) {
if (_readIndex >= _readCount) reloadBuffer();
char c=_data[_index++]=_readBuffer[_readIndex++... | Replaces an entity if the current state allows it. |
@Util private static void removeResponseCookie(String name){
response.setCookie(name,"",null,"/",0,true,true);
}
| Removes the session cookie from the response by setting the cookie value with "" and path with "/". We could have used play framework's Http.Response.removeCookie() only but the reason for not using that is, Http.Response.removeCookie() sets the HttpOnly and secure attributes of the cookie to false and that could lead ... |
public CryptoProvider(){
super("Crypto",1.0,"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)");
final String MD_NAME="org.apache.harmony.security.provider.crypto.SHA1_MessageDigestImpl";
final String SR_NAME="org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl";
final String SIGN_NA... | Creates a Provider and puts parameters |
public ReplDBMSEvent filter(ReplDBMSEvent event) throws ReplicatorException, InterruptedException {
ArrayList<DBMSData> data=event.getData();
if (data == null) return event;
for (Iterator<DBMSData> iterator=data.iterator(); iterator.hasNext(); ) {
DBMSData dataElem=iterator.next();
if (dataElem instance... | Filters transactions using do and ignore rules. The logic is as follows. <ol> <li>If the operation matches a schema or table to ignore, drop it.</li> <li>If the operation matches a schema or table to do, forward it.</li> <li>If the do list is enabled and the operation does not match, drop it.</li> </ol> Individual oper... |
private DoubleConstant parseDoubleConstant(int index) throws IOException {
long bits=readLong();
double value=Double.longBitsToDouble(bits);
return new DoubleConstant(_class.getConstantPool(),index,value);
}
| Parses a double constant pool entry. |
public static IgniteCheckedException unwrapQueryException(Throwable err){
assert err != null;
Throwable parent=err;
Throwable child=parent.getCause();
while (true) {
if (child == null || child == parent) break;
if (child instanceof IgniteException || child instanceof IgniteCheckedException || child ... | Unwrap query exception. |
public static boolean isUnreserved(char a){
return isAlphaNumeric(a) || a == '-' || a == '.' || a == '_' || a == '~';
}
| Checks if character is a valid unreserved character. This is defined by the RFC 3986 ABNF |
public static void main(String[] args){
new ConvertDialog();
}
| Start Dialog |
public static boolean isWellFormedAddress(String p_address){
if (p_address == null) {
return false;
}
String address=p_address.trim();
int addrLength=address.length();
if (addrLength == 0 || addrLength > 255) {
return false;
}
if (address.startsWith(".") || address.startsWith("-")) {
return fa... | Determine whether a string is syntactically capable of representing a valid IPv4 address or the domain name of a network host. A valid IPv4 address consists of four decimal digit groups separated by a '.'. A hostname consists of domain labels (each of which must begin and end with an alphanumeric but may contain '-') s... |
private void closeAll(List nodeList,CleanTimeValues cleanTimeValues){
TagPos firstTagPos=getOpenTags(cleanTimeValues).findFirstTagPos();
for ( TagPos pos : getOpenTags(cleanTimeValues).list) {
if (Thread.currentThread().isInterrupted()) {
handleInterruption();
return;
}
properties.fireHtmlE... | Close all unclosed tags if there are any. |
public Vineyard(){
super();
}
| Needed by CGLib |
public static ErThrowableInformation fromThrowableInformation(ThrowableInformation tw){
ErThrowableInformation ert=new ErThrowableInformation();
ert.setThrowable(ErThrowable.formThrowable(tw.getThrowable()));
ert.setRep(tw.getThrowableStrRep());
try {
Field field=tw.getClass().getDeclaredField("category");
... | Make from org.apache.log4j.spi.ThrowableInformation (Log4j 1.x) |
private void cleanupCustomizations(){
if (!m_source.isObjectExists("AD_ChangeLog",m_source.getTables())) return;
if (!m_source.isObjectExists("AD_Table",m_source.getTables())) return;
if (!m_source.isObjectExists("AD_Column",m_source.getTables())) return;
if (!m_source.isObjectExists("AD_Reference",m_sour... | re-apply customizations |
public boolean hasEndDate(){
return hasExtension(EndDate.class);
}
| Returns whether it has the end date. |
public void processSequences() throws IOException {
processSequences(true,true);
}
| Processes input sequences into output files |
private static final boolean subPartMatchNS(String p,String t){
return (p == t) || ((null != p) && ((p.length() > 0) ? ((t == WILD) || p.equals(t)) : null == t));
}
| This is temporary to patch over Xerces issue with representing DOM namespaces as "". |
public Socks4Message(int cmd){
super(cmd,null,0);
this.user=null;
msgLength=2;
msgBytes=new byte[2];
msgBytes[0]=(byte)0;
msgBytes[1]=(byte)command;
}
| Server failed reply, cmd command for failed request |
public UrlEncodedFormWriter(){
}
| Constructs an UrlEncodedFormWriter. |
protected void traverseDelta(IJavaElementDelta delta,IPackageFragmentRoot root,IJavaProject project){
boolean processChildren=true;
Openable element=(Openable)delta.getElement();
switch (element.getElementType()) {
case IJavaElement.JAVA_PROJECT:
project=(IJavaProject)element;
break;
case IJavaElement.PACKAGE... | Converts an <code>IResourceDelta</code> and its children into the corresponding <code>IJavaElementDelta</code>s. Return whether the delta corresponds to a resource on the classpath. If it is not a resource on the classpath, it will be added as a non-java resource by the sender of this method. |
public boolean isFavorite(String word){
QueryBuilder queryBuilder=new QueryBuilder(Result.class);
queryBuilder=queryBuilder.whereEquals("query ",word);
return !mLiteOrm.query(queryBuilder).isEmpty();
}
| check the word is favorite or not |
public String sslKeyStoreKeyPassword(){
return reader.getString(SSL_KEY_STORE_KEY_PASSWORD,null);
}
| The SSL key store key password. |
public Transfer writeBytes(byte[] buff,int off,int len) throws IOException {
out.write(buff,off,len);
return this;
}
| Write a number of bytes. |
public void update(String roadName,String roadNumber,String dccAddress,String mfg,String decoderMfgID,String decoderVersionID,String id){
update(this._group,roadName,roadNumber,dccAddress,mfg,decoderMfgID,decoderVersionID,id);
}
| Update the combo box with the currently selected roster group, using new roster entry attributes. |
public OnSetClause addAssignment(Expression expression){
assignments.add(new Assignment(expression));
return this;
}
| Adds a variable to set to the clause. |
public boolean isVariadic(){
return variadic;
}
| Returns true if this is a variadic function-like macro. |
public void e(Object str){
if (debug) {
if (logLevel <= Log.ERROR) {
String name=getFunctionName();
if (name != null) {
Log.e(tag,name + "\n" + str+ "\n------------------------------------------------------------------------------");
}
else {
Log.e(tag,str.toString());
}
... | The Log Level:e |
public Master(String filename,Name origin) throws IOException {
this(new File(filename),origin,-1);
}
| Initializes the master file reader and opens the specified master file. |
public boolean add(final short[] a){
int i=d, l=a.length;
long bits[]=this.bits;
boolean alreadySet=true;
while (i-- != 0) alreadySet&=set(bits,hash(a,l,i));
if (!alreadySet) size++;
return !alreadySet;
}
| Adds a short array to the filter. |
public void updateDataPointColors(Dataset data){
for (int i=0; i < data.getNumPoints(); i++) {
DataPointColored point=(DataPointColored)data.getPoint(i);
updateColorOfPoint(point);
}
}
| Update the colors of all the datapoints in a dataset. |
public synchronized int numChildren(){
if (m_Current.children == null) {
return 0;
}
return m_Current.children.size();
}
| The number of the children nodes. If current node is leaf, it returns 0. |
public static int readUnsignedMediumInt(IoBuffer in){
byte[] bytes=new byte[3];
in.get(bytes);
int val=0;
val+=(bytes[0] & 0xFF) * 256 * 256;
val+=(bytes[1] & 0xFF) * 256;
val+=(bytes[2] & 0xFF);
return val;
}
| Reads an unsigned Medium Int from the in buffer |
public static void preinstall(File userSettingsDir) throws InstallFailedException {
if (!preinstalled.compareAndSet(false,true)) return;
try {
CommonUtils.setUserSettingsDir(userSettingsDir);
LibrarySettings.resetLibraryFoldersIfPortable();
}
catch ( Exception e) {
throw new InstallFailedException... | Wires initial pieces together that are required for nearly everything. |
public static ValidationExceptionBeanE parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception {
ValidationExceptionBeanE object=new ValidationExceptionBeanE();
int event;
java.lang.String nillableValue=null;
java.lang.String prefix="";
java.lang.String namespaceuri="";
try {
while (!r... | static method to create the object Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable If this object is not an element, it is a complex type and the reader is at the event just after the outer start element Postcondition: If t... |
public static LocatorStatusResponse statusLocator(int port,InetAddress bindAddress) throws IOException {
final int timeout=Integer.MAX_VALUE;
try {
TcpClient client=new TcpClient(new DistributionConfigImpl(new Properties()));
return (LocatorStatusResponse)client.requestToServer(bindAddress,port,new LocatorS... | Returns the status of the locator on the given host & port |
private void visitSyscall(HLEModuleFunction func,boolean fastSyscall){
maxStackSize=SYSCALL_MAX_STACK_SIZE;
if (!fastSyscall) {
mv.visitMethodInsn(Opcodes.INVOKESTATIC,runtimeContextInternalName,"preSyscall","()V");
}
Label afterSyscallLabel=new Label();
if (func.checkInsideInterrupt()) {
mv.visitMeth... | Generate the required Java code to call a syscall function. The code generated much match the Java behavior implemented in jpcsp.HLE.modules.HLEModuleFunctionReflection The following code is generated: if (!fastSyscall) { RuntimeContext.preSyscall(); } if (func.checkInsideInterrupt()) { if (IntrManager.getInstance.isIn... |
public void show(){
for (int i=0; i < values.length; i++) {
for (int j=0; j < values[0].length; j++) System.out.printf("%9.4f ",values[i][j]);
System.out.println();
}
}
| Prints matrix to standard output |
public void stop(){
try {
stopAsync();
log.info("Awaiting PeerGroup shutdown ...");
executor.awaitTermination(Long.MAX_VALUE,TimeUnit.SECONDS);
}
catch ( InterruptedException e) {
throw new RuntimeException(e);
}
}
| Does a blocking stop |
public Marker createMarker(BridgeContext ctx,Element markerElement,Element paintedElement){
GVTBuilder builder=ctx.getGVTBuilder();
CompositeGraphicsNode markerContentNode=new CompositeGraphicsNode();
boolean hasChildren=false;
for (Node n=markerElement.getFirstChild(); n != null; n=n.getNextSibling()) {
if... | Creates a <tt>Marker</tt> according to the specified parameters. |
private void prepareTrackForDisplay(Track track,Map<String,Object> resultMap){
TripStatistics tripStatitics=track.getTripStatistics();
String icon=track.getIcon();
String category=icon != null && !icon.equals("") ? null : track.getCategory();
resultMap.put(IS_RECORDING_FIELD,track.getId() == recordingTrackId);
... | Prepares a track for display by filling in a result map. |
public void putShort(short x){
bb.putShort(space-=2,x);
}
| Add a `short` to the buffer, backwards from the current location. Doesn't align nor check for space. |
void commit(Transaction t,long maxLogId){
if (store.isClosed()) {
return;
}
synchronized (undoLog) {
t.setStatus(Transaction.STATUS_COMMITTING);
for (long logId=0; logId < maxLogId; logId++) {
Long undoKey=getOperationId(t.getId(),logId);
Object[] op=undoLog.get(undoKey);
if (op == nul... | Commit a transaction. |
public static PrincipalUserDto transformToDto(PrincipalUser user){
if (user == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.",Status.INTERNAL_SERVER_ERROR);
}
PrincipalUserDto result=createDtoObject(PrincipalUserDto.class,user);
for ( Dashboard dashboard :... | Converts a user entity to DTO. |
@Override public boolean execute(String sql) throws SQLException {
try {
debugCodeCall("execute",sql);
throw DbException.get(ErrorCode.METHOD_NOT_ALLOWED_FOR_PREPARED_STATEMENT);
}
catch ( Exception e) {
throw logAndConvert(e);
}
}
| Calling this method is not legal on a PreparedStatement. |
void markActivityUsed(int activityIndex,String webappId){
int elementIndex=findActivityElement(activityIndex);
if (elementIndex == -1) {
Log.e(TAG,"Failed to find WebappActivity entry: " + activityIndex + ", "+ webappId);
return;
}
ActivityEntry updatedEntry=new ActivityEntry(activityIndex,webappId);
... | Moves a WebappActivity to the back of the queue, indicating that the Webapp is still in use and shouldn't be killed. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.