code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
private boolean compileAndInstall(String className,String... methodNames){
boolean atLeastOneCompiled=false;
for ( String methodName : methodNames) {
Method method=lookup(className,methodName);
if (method != null) {
ResolvedJavaMethod installedCodeOwner=getMetaAccess().lookupJavaMethod(method);
... | Compiles and installs the substitution for some specified methods. Once installed, the next execution of the methods will use the newly installed code. |
public Object nextValue() throws JSONException {
char c=nextClean();
String s;
if (c == '\7') c=nextClean();
switch (c) {
case '"':
case '\'':
return nextString(c);
case '{':
back();
return new JSONObject(this);
case '[':
case '(':
back();
return new JSONArray(this);
}
StringBuffer sb=new StringBuffer();
... | Get the next value. The value can be a Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object. |
public static void assertEquals(Object expected,Object actual){
assertEquals(null,expected,actual);
}
| Assert that two values equal. |
public boolean canBeInstantiatedTo(GenericClass otherType){
if (isPrimitive() && otherType.isWrapperType()) return false;
if (isAssignableTo(otherType)) return true;
if (!isTypeVariable() && !otherType.isTypeVariable() && otherType.isGenericSuperTypeOf(this)) return true;
Class<?> otherRawClass=otherType.... | Determine if there exists an instantiation of the type variables such that the class matches otherType |
static boolean handleHotseatButtonKeyEvent(View v,int keyCode,KeyEvent e){
boolean consume=FocusLogic.shouldConsume(keyCode);
if (e.getAction() == KeyEvent.ACTION_UP || !consume) {
return consume;
}
final Launcher launcher=(Launcher)v.getContext();
final DeviceProfile profile=launcher.getDeviceProfile();
... | Handles key events in the workspace hotseat (bottom of the screen). <p>Currently we don't special case for the phone UI in different orientations, even though the hotseat is on the side in landscape mode. This is to ensure that accessibility consistency is maintained across rotations. |
protected final boolean hasResult(){
return hasResult;
}
| indicates whether current LiteFragment has set result, the field hasResult always be set by setResult(int resultCode, Intent result) . |
@Override public List<EvaluationStatistics> read(){
return m_Statistics;
}
| Reads the statistics. |
private boolean isThousandSeparator(char c){
}
| Thousand separator predicate |
public ShearingGraphMousePlugin(int modifiers){
super(modifiers);
Dimension cd=Toolkit.getDefaultToolkit().getBestCursorSize(16,16);
BufferedImage cursorImage=new BufferedImage(cd.width,cd.height,BufferedImage.TYPE_INT_ARGB);
Graphics g=cursorImage.createGraphics();
Graphics2D g2=(Graphics2D)g;
g2.addRender... | create an instance with passed modifier values |
private void init(){
setTitle("World Dialog");
fillFieldValues();
worldWidth.setColumns(initialWorldWidth);
mainPanel.addItem("World Width",worldWidth);
mainPanel.addItem("World Height",worldHeight);
mainPanel.addItem("Moving objects initiates creature movement",initiateMovement);
mainPanel.addItem("Objec... | This method initialises the components on the panel. |
public void init(){
_zkConnection.curator().getConnectionStateListenable().addListener(_connectionListener);
_zkConnection.connect();
if (siteSpecific) {
_serviceParentPath=String.format("%1$s/%2$s%3$s/%4$s/%5$s",ZkPath.SITES,_zkConnection.getSiteId(),ZkPath.SERVICE,_service.getName(),_service.getVersion());
... | Init method. Add state change listener Connect to zk cluster Remove stale service registration from zk |
public Container(boolean debugBootstrap) throws Exception {
System.setProperty(SwarmProperties.VERSION,VERSION);
createServer(debugBootstrap,null);
createShrinkWrapDomain();
}
| Construct a new, un-started container. |
public static _Fields findByName(String name){
return byName.get(name);
}
| Find the _Fields constant that matches name, or null if its not found. |
@Override public void updateSQLXML(String columnLabel,SQLXML xmlObject) throws SQLException {
throw unsupported("SQLXML");
}
| [Not supported] Updates a column in the current or insert row. |
@Override public void visit(Tree.InvocationExpression that){
visitInvocationPositionalArgs(that);
Tree.Primary p=that.getPrimary();
p.visit(this);
Tree.PositionalArgumentList pal=that.getPositionalArgumentList();
if (pal != null) {
inferParameterTypes(p,pal);
pal.visit(this);
}
Tree.NamedArgumentL... | Typecheck an invocation expression. Note that this is a tricky process involving type argument inference, anonymous function parameter type inference, function reference type argument inference, Java overload resolution, and argument type checking, and it all has to happen in exactly the right order, which is not at al... |
public boolean addAll(Collection<? extends E> c){
if (m.size() == 0 && c.size() > 0 && c instanceof SortedSet && m instanceof TreeMap) {
SortedSet<? extends E> set=(SortedSet<? extends E>)c;
TreeMap<E,Object> map=(TreeMap<E,Object>)m;
Comparator<?> cc=set.comparator();
Comparator<? super E> mc=map.com... | Adds all of the elements in the specified collection to this set. |
protected void fireRetransmissionTimer(){
try {
if (this.getState() == null || !this.isMapped) return;
boolean inv=isInviteTransaction();
TransactionState s=this.getState();
if ((inv && TransactionState.CALLING == s) || (!inv && (TransactionState.TRYING == s || TransactionState.PROCEEDING == s))) ... | Called by the transaction stack when a retransmission timer fires. |
public Value[] readRow(Value[] row) throws SQLException {
StatementBuilder buff=new StatementBuilder("SELECT ");
appendColumnList(buff,false);
buff.append(" FROM ");
appendTableName(buff);
appendKeyCondition(buff);
PreparedStatement prep=conn.prepareStatement(buff.toString());
setKey(prep,1,row);
Result... | Re-reads a row from the database and updates the values in the array. |
public static boolean isSupported(byte[] version){
if (version[0] != 3 || (version[1] != 0 && version[1] != 1)) {
return false;
}
return true;
}
| Returns true if protocol version is supported |
public void layout(FlowView fv){
super.layout(fv);
}
| Does a a full layout on the given View. This causes all of the rows (child views) to be rebuilt to match the given constraints for each row. This is called by a FlowView.layout to update the child views in the flow. |
public static boolean isLegal(boolean expression){
return isLegal(expression,"");
}
| Asserts that an argument is legal. If the given boolean is not <code>true</code>, an <code>IllegalArgumentException</code> is thrown. |
private void ensureWebContentKeyBindings(){
if (sBindings.size() > 0) {
return;
}
String webContentKeyBindingsString=Settings.Secure.getString(mWebView.getContext().getContentResolver(),Settings.Secure.ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS);
SimpleStringSplitter semiColonSplitter=new SimpleStringSplitter('... | Ensures that the Web content key bindings are loaded. |
public static String sqlEscapeString(String value){
StringBuilder escaper=new StringBuilder();
DatabaseUtils.appendEscapedSQLString(escaper,value);
return escaper.toString();
}
| SQL-escape a string. |
public static boolean isXML11NCName(int c){
return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_NCNAME) != 0) || (0x10000 <= c && c < 0xF0000);
}
| Returns true if the specified character is a valid NCName character as defined by production [5] in Namespaces in XML 1.1 recommendation. |
private void drawSecondAnimation(Canvas canvas){
if (arcO == limite) arcD+=6;
if (arcD >= 290 || arcO > limite) {
arcO+=6;
arcD-=6;
}
if (arcO > limite + 290) {
limite=arcO;
arcO=limite;
arcD=1;
}
rotateAngle+=4;
canvas.rotate(rotateAngle,getWidth() / 2,getHeight() / 2);
Bitmap bit... | Draw second animation of view |
public static float mapEnterCurveToExitCurveAtT(UnitCurve enterCurve,UnitCurve exitCurve,float t){
return exitCurve.tAt(1 - enterCurve.valueAt(t));
}
| Given two curves (from and to) and a time along the from curve, compute the time at t, and find a t along the 'toCurve' that will produce the same output. This is useful when interpolating between two different curves when the animation is not at the beginning or end. |
public String findOSVersion(){
return _productIdent;
}
| Retrieve the storageos version from /.product_ident |
public static String createFilterFromJMSSelector(final String selectorStr) throws ActiveMQException {
return selectorStr == null || selectorStr.trim().length() == 0 ? null : SelectorTranslator.convertToActiveMQFilterString(selectorStr);
}
| Returns null if the string is null or empty |
public static DefaultIntervalXYDataset createDefaultIntervalXYDataset(ValueSource valueSource,PlotInstance plotInstance,boolean createRangeIntervals) throws ChartPlottimeException {
ValueSourceData valueSourceData=plotInstance.getPlotData().getValueSourceData(valueSource);
assertMaxValueCountNotExceededOrThrowExcep... | Creates a dataset which supports custom intervals on both axes. Expects a grouping on the domain axis. |
protected void updateOnEventQueue(){
double[] x=problem.getX();
double[] actualY=problem.getActualY();
double[] approximatedY=problem.getApproximatedY(solution);
XYSeries actualSeries=new XYSeries("Target Function",false,false);
XYSeries approximatedSeries=new XYSeries("Estimated Function",false,false);
for... | Updates the GUI. This method updates a Swing GUI, and therefore must only be invoked on the event dispatch thread. |
private static short CallNonvirtualShortMethod(JNIEnvironment env,int objJREF,int classJREF,int methodID) throws Exception {
if (VM.VerifyAssertions) {
VM._assert(VM.BuildForPowerPC,ERROR_MSG_WRONG_IMPLEMENTATION);
}
if (traceJNI) VM.sysWrite("JNI called: CallNonvirtualShortMethod \n");
RuntimeEntrypoint... | CallNonvirtualShortMethod: invoke a virtual method that returns a short value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame <p> <strong>NOTE: This implementation is NOT used for IA32. On IA32, it is ov... |
private MInvoice completeInvoice(MInvoice invoice){
if (invoice != null) {
if (!invoice.processIt(p_docAction)) {
log.warning("completeInvoice - failed: " + invoice);
addLog("completeInvoice - failed: " + invoice);
}
invoice.save();
addLog(invoice.getC_Invoice_ID(),invoice.getDateInvoiced(... | Complete Invoice |
public CharSet(){
chars=new int[0];
}
| Creates an empty CharSet. |
private long startNewTrack(){
if (isRecording()) {
Log.d(TAG,"Ignore startNewTrack. Already recording.");
return -1L;
}
long now=System.currentTimeMillis();
trackTripStatisticsUpdater=new TripStatisticsUpdater(now);
markerTripStatisticsUpdater=new TripStatisticsUpdater(now);
Track track=new Track();... | Starts a new track. |
@Override public void addAttribute(String name,boolean value){
current.setAttribute(name,Boolean.valueOf(value).toString());
}
| Adds an attribute to current element of the DOM Document. |
public static void main(String[] argv){
try {
double delta=0.5;
double xmean=0;
double lower=0;
double upper=10;
Matrix covariance=new Matrix(2,2);
covariance.set(0,0,2);
covariance.set(0,1,-3);
covariance.set(1,0,-4);
covariance.set(1,1,5);
if (argv.length > 0) {
covaria... | Main method for testing this class. |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
private void merge(MatrixBlock out,MatrixBlock in,boolean appendOnly) throws DMLRuntimeException {
if (_compare == null) mergeWithoutComp(out,in,appendOnly);
else mergeWithComp(out,in,_compare);
}
| Merges <code>in</code> into <code>out</code> by inserting all non-zeros of <code>in</code> into <code>out</code> at their given positions. This is an update-in-place. NOTE: similar to converters, but not directly applicable as we are interested in combining two objects with each other; not unary transformation. |
public void stop(boolean forceIfNecessary) throws IOException {
if (this.serverProcess != null) {
String basedir=getServerProps().getProperty(BASEDIR_KEY);
StringBuilder pathBuf=new StringBuilder(basedir);
if (!basedir.endsWith(File.separator)) {
pathBuf.append(File.separator);
}
pathBuf.app... | Stops the server (if started) |
public HttpErrorResponseException(Throwable cause,int statusCode,String statusDescription,String responseMessage){
super(cause);
this.statusCode=statusCode;
this.statusDescription=statusDescription;
this.responseMessage=responseMessage;
}
| Constructs an HTTP error response exception with a cause, status code, status description, and response message. |
private void adjustAllocation(int index) throws Exception {
MDistributionRunLine runLine=m_runLines[index];
BigDecimal difference=runLine.getActualAllocationDiff();
if (difference.compareTo(Env.ZERO) == 0) return;
boolean adjustBiggest=difference.abs().compareTo(Env.ONE) <= 0 || difference.abs().compareTo(run... | Adjust Run Line Allocation |
public final void openFile(final String defaultList,final String extraUserList){
if (ALWAYS_RECREATE_SSID_BLACKLIST) {
SsidBlackListBootstraper.run(defaultList);
}
if (defaultList != null) {
try {
final File file=new File(defaultList);
final FileInputStream defaultStream=new FileInputStream(fi... | Loads blacklist from xml files |
private void checkMappingsCompatibility(IndexMetaData indexMetaData){
Index index=new Index(indexMetaData.getIndex());
Settings settings=indexMetaData.getSettings();
try {
SimilarityLookupService similarityLookupService=new SimilarityLookupService(index,settings);
try (AnalysisService analysisService=new ... | Checks the mappings for compatibility with the current version |
public KeyBuilder shift(){
modifiers|=ModifierKeys.SHIFT;
return this;
}
| Add SHIFT modifier. |
public void onCTA(Function callback){
peer.onCTA(callback);
}
| callback for the optional call-to-action button |
public void stop(){
if ((m_Experiment == null) || !m_Experiment.isRunning()) return;
m_Experiment.stop();
}
| Stops the current experiment. |
public synchronized void reopen(int seekRow) throws FormatException {
try {
if (inputFile == null) {
inputFile=new BinaryBufferedFile(filename);
inputFile.byteOrder(byteorder);
}
if (seekRow > 0) {
seekToRow(seekRow);
}
}
catch ( IOException i) {
throw new FormatException(i.g... | Reopen the associated input file. |
public void clean(){
ChronoFullRevision cfr=firstCFR;
totalSize=size;
while (cfr != null) {
totalSize+=cfr.size();
cfr=cfr.getNext();
}
if (totalSize < MAX_STORAGE_SIZE) {
return;
}
cfr=firstCFR;
while (cfr != null) {
totalSize+=cfr.clean(revisionIndex,0);
cfr=cfr.getNext();
}
Ch... | Reduces the amount of used storage by discarding chrono storage blocks. |
public void addComponentListener(final ComponentUpdateListener listener){
componentListeners.add(listener);
}
| Adds a component listener to this instance. |
public int executeUpdate(String sql) throws GenericDataSourceException {
Statement stmt=null;
try {
stmt=_connection.createStatement();
return stmt.executeUpdate(sql);
}
catch ( SQLException sqle) {
throw new GenericDataSourceException("SQL Exception while executing the following:" + _sql,sqle);
}... | Execute update based on the SQL statement given |
public DomAdapterFactory(){
if (modelPackage == null) {
modelPackage=DomPackage.eINSTANCE;
}
}
| Creates an instance of the adapter factory. <!-- begin-user-doc --> <!-- end-user-doc --> |
public final boolean containsDividers(){
return dividerCount > 0;
}
| Returns, whether the adapter contains dividers, or not. |
public AsyncResult CreateSessionAsync(RequestHeader RequestHeader,ApplicationDescription ClientDescription,String ServerUri,String EndpointUrl,String SessionName,byte[] ClientNonce,byte[] ClientCertificate,Double RequestedSessionTimeout,UnsignedInteger MaxResponseMessageSize){
CreateSessionRequest req=new CreateSessi... | Asynchronous CreateSession service request. |
public WeightedNIPaths(DirectedGraph<V,E> graph,Supplier<V> vertexFactory,Supplier<E> edgeFactory,double alpha,int maxDepth,Set<V> priors){
super.initialize(graph,true,false);
this.vertexFactory=vertexFactory;
this.edgeFactory=edgeFactory;
mAlpha=alpha;
mMaxDepth=maxDepth;
mPriors=priors;
for ( V v : gra... | Constructs and initializes the algorithm. |
public void registerParameterDataType(String parameterName,VCardDataType dataType){
parameterName=parameterName.toLowerCase();
if (dataType == null) {
parameterDataTypes.remove(parameterName);
}
else {
parameterDataTypes.put(parameterName,dataType);
}
}
| Registers the data type of an experimental parameter. Experimental parameters use the "unknown" data type by default. |
public void dispose(){
removeAll();
}
| clean up at end |
private void revalidate(){
setTitle(Msg.getMsg(Env.getCtx(),"Report") + ": " + m_reportEngine.getName()+ " "+ Env.getHeader(Env.getCtx(),0));
StringBuffer sb=new StringBuffer();
sb.append(Msg.getMsg(Env.getCtx(),"DataCols")).append("=").append(m_reportEngine.getColumnCount()).append(", ").append(Msg.getMsg(Env.g... | Revalidate settings after change of environment |
private TimSort(T[] a,Comparator<? super T> c){
this.a=a;
this.c=c;
int len=a.length;
@SuppressWarnings({"unchecked","UnnecessaryLocalVariable"}) T[] newArray=(T[])new Object[len < 2 * INITIAL_TMP_STORAGE_LENGTH ? len >>> 1 : INITIAL_TMP_STORAGE_LENGTH];
tmp=newArray;
int stackLen=(len < 120 ? 5 : len < 154... | Creates a TimSort instance to maintain the state of an ongoing sort. |
@Timed @ExceptionMetered @GET public Response findClient(@Auth AutomationClient automationClient,@QueryParam("name") Optional<String> name){
logger.info("Automation ({}) - Looking up a name {}",automationClient.getName(),name);
if (name.isPresent()) {
Client client=clientDAO.getClient(name.get()).orElseThrow(nu... | Retrieve Client by a specified name, or all Clients if no name given |
public NotificationChain basicSet_lok(LocalArgumentsVariable new_lok,NotificationChain msgs){
LocalArgumentsVariable old_lok=_lok;
_lok=new_lok;
if (eNotificationRequired()) {
ENotificationImpl notification=new ENotificationImpl(this,Notification.SET,N4JSPackage.FUNCTION_OR_FIELD_ACCESSOR__LOK,old_lok,new_lok... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public static PublicKey createPublicKeyFromBytes(byte[] keyBytes){
PublicKey pk=null;
try {
KeyFactory keyFactory=KeyFactory.getInstance(KeyConstants.KEY_FACTORY,new BouncyCastleProvider());
pk=keyFactory.generatePublic(new X509EncodedKeySpec(keyBytes));
}
catch ( NoSuchAlgorithmException|InvalidKeySpec... | Creates a public key from a byte[] |
@Override public void replace(int index,Solution newSolution){
Iterator<Solution> iterator=iterator();
while (iterator.hasNext()) {
Solution oldSolution=iterator.next();
int flag=comparator.compare(newSolution,oldSolution);
if (flag < 0) {
iterator.remove();
}
else if (flag > 0) {
r... | Replace the solution at the given index with the new solution, but only if the new solution is non-dominated. To maintain non-dominance within this population, any solutions dominated by the new solution will also be replaced. |
public void readGraphics() throws java.io.IOException {
if (Debug.debugging("cachelayer")) {
Debug.output("Reading cached graphics");
}
if (omgraphics == null) {
omgraphics=new OMGraphicList();
}
if (cacheURL != null) {
omgraphics.readGraphics(cacheURL);
}
}
| Read a cache of OMGraphics |
private void drawSplat(Canvas canvas,float x,float y,float orientation,float distance,float tilt,Paint paint){
float z=distance * 2 + 10;
float nx=(float)(Math.sin(orientation) * Math.sin(tilt));
float ny=(float)(-Math.cos(orientation) * Math.sin(tilt));
float nz=(float)Math.cos(tilt);
if (nz < 0.05) {
re... | Splatter paint in an area. Chooses random vectors describing the flow of paint from a round nozzle across a range of a few degrees. Then adds this vector to the direction indicated by the orientation and tilt of the tool and throws paint at the canvas along that vector. Repeats the process until a masterpiece is born. |
public void deleteSnapshot(String id) throws IsilonException {
delete(_baseUrl.resolve(URI_SNAPSHOTS),id,"snapshot");
}
| Delete a snapshot |
public MutableInt(final Number value){
super();
this.value=value.intValue();
}
| Constructs a new MutableInt with the specified value. |
public void start(){
try {
mRunning=true;
if (mSsl) {
final KeyStore keystore=KeyStore.getInstance(mKeystoreDefaultType);
keystore.load(new FileInputStream(mKeystoreFile),mKeystorePassword.toCharArray());
final KeyStore tks=KeyStore.getInstance(mTrustoreDefaultType);
tks.load(new FileI... | main loop for web server mRunning. |
private E firstDataItem(){
for (Node p=head; p != null; p=succ(p)) {
Object item=p.item;
if (p.isData) {
if (item != null && item != p) return LinkedTransferQueue.<E>cast(item);
}
else if (item == null) return null;
}
return null;
}
| Returns the item in the first unmatched node with isData; or null if none. Used by peek. |
@Override protected void applyEditorTo(DLangRunDubConfiguration config) throws ConfigurationException {
config.setModule(comboModule.getSelectedModule());
config.setRunAfterBuild(cbRunAfterBuild.isSelected());
config.setVerbose(cbVerbose.isSelected());
config.setQuiet(cbQuiet.isSelected());
config.setWorkingD... | Save state of editor UI to DLangRunDubConfiguration instance. |
public NodeElementProcessor(ElementProcessor parentProcessor,MapBuilder mdConsumer){
super(parentProcessor,mdConsumer);
tagElementProcessor=new TagElementProcessor(this,this);
nodeAttributes=new ArrayList<EntityAttribute>();
}
| Creates a new instance. |
public static XMLTree from(InputStream is) throws IOException {
return new XMLTree(toByteArray(is));
}
| Creates XMLTree from input stream. Doesn't close the stream |
@DSComment("Package priviledge") @DSBan(DSCat.DEFAULT_MODIFIER) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:59:04.813 -0500",hash_original_method="3BCED7FFBE0FE784BA49584BB088736F",hash_generated_method="A6D1542B468031E8023E6CF76568C729") static String retrieveTextString(Compreh... | Retrieves text from the Text COMPREHENSION-TLV object, and decodes it into a Java String. |
public static Field findField(Class clazz,String name){
Field[] fields=clazz.getDeclaredFields();
for ( Field field : fields) {
if (name.equals(field.getName())) {
return field;
}
}
Class superClass=clazz.getSuperclass();
if (superClass != null) {
return findField(superClass,name);
}
re... | Find field. |
static int inverseMod32(int val){
int t=val;
t*=2 - val * t;
t*=2 - val * t;
t*=2 - val * t;
t*=2 - val * t;
return t;
}
| Returns the multiplicative inverse of val mod 2^32. Assumes val is odd. |
public ObjectStoreGlobFilter(String filePattern,PathFilter filter) throws IOException {
init(filePattern,filter);
}
| Creates a glob filter with the specified file pattern and an user filter. |
protected void UnionExpr() throws javax.xml.transform.TransformerException {
int opPos=m_ops.getOp(OpMap.MAPINDEX_LENGTH);
boolean continueOrLoop=true;
boolean foundUnion=false;
do {
PathExpr();
if (tokenIs('|')) {
if (false == foundUnion) {
foundUnion=true;
insertOp(opPos,2,OpCode... | The context of the right hand side expressions is the context of the left hand side expression. The results of the right hand side expressions are node sets. The result of the left hand side UnionExpr is the union of the results of the right hand side expressions. UnionExpr ::= PathExpr | UnionExpr '|' PathExpr |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:59:45.530 -0500",hash_original_method="BD4B3A181E1CE5BF498106AFACED886D",hash_generated_method="30CA07B05F86A174B85EE2CBAC1889BC") public void replyToMessage(Message srcMsg,int what){
Message msg=Message.obtain();
msg.what=what;
... | Reply to srcMsg |
public boolean writeToNode(Short nodeId,SyncMessage bsm) throws InterruptedException {
if (nodeId == null) return false;
NodeConnection nc=connections.get(nodeId);
if (nc != null && nc.state == NodeConnectionState.CONNECTED) {
waitForMessageWindow(bsm.getType(),nodeId,0);
nc.nodeChannel.write(bsm);
... | Write a message to the node specified |
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 void addInfo(String msg,RefactoringStatusContext context){
fEntries.add(new RefactoringStatusEntry(RefactoringStatus.INFO,msg,context));
fSeverity=Math.max(fSeverity,INFO);
}
| Adds an <code>INFO</code> entry filled with the given message and context to this status. If the current severity is <code>OK</code> it will be changed to <code>INFO</code>. It will remain unchanged otherwise. |
private void testIsoWeekJanuary1thFriday() throws Exception {
assertEquals(53,getIsoWeek(parse("2009-12-31")));
assertEquals(53,getIsoWeek(parse("2010-01-01")));
assertEquals(53,getIsoWeek(parse("2010-01-03")));
assertEquals(1,getIsoWeek(parse("2010-01-04")));
}
| January 1st is a Friday therefore the week belongs to the previous year. |
protected int estimateParametersLen(final NameValuePair[] nvps){
if ((nvps == null) || (nvps.length < 1)) return 0;
int result=(nvps.length - 1) * 2;
for (int i=0; i < nvps.length; i++) {
result+=estimateNameValuePairLen(nvps[i]);
}
return result;
}
| Estimates the length of formatted parameters. |
public void unsynchronizeWith(UpdateSynchronizer sync){
runner.unsynchronizeWith(sync);
}
| Detach from synchronization. |
public final double numCorrect(){
return m_perClass[maxClass()];
}
| Returns perClass(maxClass()). |
void focusTriangle(){
setFocusType(2);
}
| Gives focus to the triangle. |
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. |
@Override public void clear(){
throw new UnsupportedOperationException("ProtectedProperties cannot be modified!");
}
| Overrides a method to prevent the properties from being modified. |
private State buildPatch(TaskState.TaskStage stage,@Nullable Throwable e){
State state=new State();
state.taskState=new TaskState();
state.taskState.stage=stage;
if (null != e) {
state.taskState.failure=Utils.toServiceErrorResponse(e);
}
return state;
}
| This method builds a state object that is used to submit a stage process self-patch. |
public void testCanConvert(){
final Class type=URI.class;
final URIConverter instance=new URIConverter();
final boolean expResult=true;
final boolean result=instance.canConvert(type);
assertEquals(expResult,result);
}
| Test of canConvert method, of class URIConverter. |
public boolean isImageDisabled(){
return imageDisabled;
}
| Used to know if the default image must be ignored. |
public static List<ErrorLogger.ErrorObject> areAllVirtualTracksInCPLConformed(PayloadRecord cplPayloadRecord,List<PayloadRecord> essencesHeaderPartitionPayloads) throws IOException {
IMFErrorLogger imfErrorLogger=new IMFErrorLoggerImpl();
ApplicationComposition applicationComposition=ApplicationCompositionFactory.g... | A stateless method that can be used to determine if a Composition is conformant. Conformance checks perform deeper inspection of the Composition and the EssenceDescriptors corresponding to all the Virtual Tracks that are a part of the Composition |
public boolean equals(shift_action other){
return other != null && other.shift_to() == shift_to();
}
| Equality test. |
public void addInternetScsiSendTargets(HostInternetScsiHba hba,String... addresses){
addInternetScsiSendTargets(getStorageSystem(),hba,addresses);
}
| Adds iSCSI send targets to the given host. |
public IllegalThreadStateException(java.lang.String s){
}
| Constructs an IllegalThreadStateException with the specified detail message. s - the detail message. |
public static short toShort(byte[] bytes,int offset){
if (littleEndian) {
return Short.reverseBytes(theUnsafe.getShort(bytes,offset + BYTE_ARRAY_BASE_OFFSET));
}
else {
return theUnsafe.getShort(bytes,offset + BYTE_ARRAY_BASE_OFFSET);
}
}
| Converts a byte array to a short value considering it was written in big-endian format. |
public String valueString(){
byte[] barr=new byte[rawData.length * 4];
ByteBuffer b=ByteBuffer.wrap(barr,0,barr.length);
b.order(java.nio.ByteOrder.LITTLE_ENDIAN);
IntBuffer i=b.asIntBuffer();
i.put(rawData);
try {
String str=new String(barr,"US-ASCII");
str=str.substring(0,str.indexOf("\0"));
r... | Convert tag value to a string. For now it assumes US-ASCII and thus does not support non-ASCII in column/table names. See RQ-1881 |
public ModuleUnloadedReply(final int packetId,final int errorCode,final MemoryModule module){
super(packetId,errorCode);
this.module=module;
}
| Creates a new Module Unloaded reply. |
private static Credential authorize() throws Exception {
GoogleClientSecrets clientSecrets=GoogleClientSecrets.load(JSON_FACTORY,new InputStreamReader(HelloAnalyticsApiSample.class.getResourceAsStream("/client_secrets.json")));
if (clientSecrets.getDetails().getClientId().startsWith("Enter") || clientSecrets.getDet... | Authorizes the installed application to access user's protected data. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public MapTileMaker(Properties props){
super(props);
}
| To create the TileMaker, you hand it a set of properties that let it create an array of layers, and also to set the properties for those layers. The properties file for the ImageServer looks strikingly similar to the openmap.properties file. So, all the layers get set up here... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.