code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:27:57.904 -0500",hash_original_method="4C3F0CF20A3CBF82271A73533254C678",hash_generated_method="ECFEA25F0D89855BF10D19CCE99981F3") protected boolean up(TextView widget,Spannab... | Performs an up movement action. Moves the cursor or scrolls up by one line. |
@DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:07.206 -0500",hash_original_method="2B62AE770A28023C5424C7B7718E4BD4",hash_generated_method="452226191162440A69C61CCC2956DB5F") public MaxForwardsHeader createMaxForwardsHeader(int m... | Creates a new MaxForwardsHeader based on the newly supplied maxForwards value. |
boolean updateProvidersForPackageLocked(String pkgName,Set<ComponentName> removedProviders){
boolean providersUpdated=false;
HashSet<String> keep=new HashSet<String>();
Intent intent=new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
intent.setPackage(pkgName);
List<ResolveInfo> broadcastReceivers;
try {... | Updates all providers with the specified package names, and records any providers that were pruned. |
public static void saveDom(OutputStream os,Element e){
DOMSource source=new DOMSource(e);
TransformerFactory transFactory=TransformerFactory.newInstance();
Transformer transformer;
try {
transformer=transFactory.newTransformer();
transformer.setOutputProperty("indent","yes");
StreamResult result=new... | save dom into ouputstream |
public static Sentence convert(Sentence s){
Sentence result=null;
Sentence biconditionalsRemoved=BiconditionalElimination.eliminate(s);
Sentence implicationsRemoved=ImplicationElimination.eliminate(biconditionalsRemoved);
Sentence notsMovedIn=MoveNotInwards.moveNotsInward(implicationsRemoved);
result=notsMove... | Returns the specified sentence in its logically equivalent negation normal form. |
private JSONArray readArray(boolean stringy) throws JSONException {
JSONArray jsonarray=new JSONArray();
jsonarray.put(stringy ? readString() : readValue());
while (true) {
if (probe) {
log("\n");
}
if (!bit()) {
if (!bit()) {
return jsonarray;
}
jsonarray.put(stringy ?... | Read a JSONArray. |
private void tokenVerifiedInternal(String token,TokenInfo tokenInfo){
client.stopWebserver();
String result;
String currentUsername=client.settings.getString("username");
boolean getNewLogin=tokenGetDialog.isVisible();
boolean showInDialog=tokenDialog.isVisible();
boolean changedTokenResponse=token == null ... | This does the main work when a response for verifying the token is received from the Twitch API. A Token can be verified manually by pressing the button or automatically when a new Token was received by the webserver. So when this is called the original source can be both. The tokenGetDialog is closed if necessary. |
@Override public final Serializer clone(){
return new Serializer(registry,allocator,whitelistRequired,classLoaders);
}
| Clones the object. |
@Override public final long encodeNormValue(float f){
return Float.floatToIntBits(f);
}
| Encodes a normalization factor for storage in an index. <p> The encoding uses a three-bit mantissa, a five-bit exponent, and the zero-exponent point at 15, thus representing values from around 7x10^9 to 2x10^-9 with about one significant decimal digit of accuracy. Zero is also represented. Negative numbers are rounded ... |
@POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) @Path("/logout") public Response logoutToken(@Context HttpServletRequest httpRequest,@QueryParam("username") String username,@QueryParam("force") boolean force){
boolean res=internalLogoutClient.logoutUser(username,httpRequest,force,false... | Makes an internal api call to authsvc to logout the token present in the request. |
public void accept(MemberValueVisitor visitor){
visitor.visitAnnotationMemberValue(this);
}
| Accepts a visitor. |
@Override public boolean mayFireAgain(){
return (getNextFireTime() != null);
}
| <p> Determines whether or not the <code>SimpleTrigger</code> will occur again. </p> |
private static void initInstance(){
myInstance=new JLogoutputFrame();
}
| initInstance <p> |
public ImSwitch(){
if (modelPackage == null) {
modelPackage=ImPackage.eINSTANCE;
}
}
| Creates an instance of the switch. <!-- begin-user-doc --> <!-- end-user-doc --> |
public static byte[] fillHeader(byte[] hdr,long reqId,IgfsIpcCommand cmd){
assert cmd != null;
Arrays.fill(hdr,(byte)0);
U.longToBytes(reqId,hdr,0);
U.intToBytes(cmd.ordinal(),hdr,8);
return hdr;
}
| Creates new header with given request ID and command. |
public String nextElement(){
return this.iterator.next();
}
| Gets the next element out of the iterator. |
protected int clipCode(double x,double y,double z){
int code=0;
code|=(x < this.clip[0] ? 0x0001 : 0x0);
code|=(x > this.clip[1] ? 0x0010 : 0x0);
code|=(y < this.clip[2] ? 0x0100 : 0x0);
code|=(y > this.clip[3] ? 0x1000 : 0x0);
return code;
}
| Computes a 4-bit code indicating the vertex's location in the 9 cell grid defined by the clip bounds and the eight adjacent spaces defined by extending the min/max boundaries to infinity. 0 indicates that the vertex is inside the clip bounds. |
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. |
static <E>ImmutableList<E> asImmutableList(Object[] elements,int length){
switch (length) {
case 0:
return of();
case 1:
@SuppressWarnings("unchecked") ImmutableList<E> list=new SingletonImmutableList<E>((E)elements[0]);
return list;
default :
if (length < elements.length) {
elements=arraysCopyOf(elements,length)... | Views the array as an immutable list. Copies if the specified range does not cover the complete array. Does not check for nulls. |
public NTLMEngineException(String message,Throwable cause){
super(message,cause);
}
| Creates a new NTLMEngineException with the specified detail message and cause. |
private ClassTypeSignature parseClassTypeSignature(){
assert (current() == 'L');
if (current() != 'L') {
throw error("expected a class type");
}
advance();
List<SimpleClassTypeSignature> scts=new ArrayList<>(5);
scts.add(parsePackageNameAndSimpleClassTypeSignature());
parseClassTypeSignatureSuffix(sct... | ClassTypeSignature: "L" PackageSpecifier_opt SimpleClassTypeSignature ClassTypeSignatureSuffix* ";" |
public static Distribution guessR(DataSet d){
return new LogUniform(1,1e5);
}
| Guesses the distribution to use for the R parameter |
private void validateChrono(TemporalAccessor temporal){
Objects.requireNonNull(temporal,"temporal");
Chronology temporalChrono=temporal.query(TemporalQueries.chronology());
if (temporalChrono != null && IsoChronology.INSTANCE.equals(temporalChrono) == false) {
throw new DateTimeException("Chronology mismatch,... | Validates that the temporal has the correct chronology. |
public static Vector<OCFile> sortFolder(Vector<OCFile> files){
switch (mSortOrder) {
case 0:
files=FileStorageUtils.sortByName(files);
break;
case 1:
files=FileStorageUtils.sortByDate(files);
break;
case 2:
break;
}
return files;
}
| Sorts all filenames, regarding last user decision |
public E[] toArray(E[] storage){
int idx=0;
DoubleNode<E> ptr=head;
while (ptr != null) {
storage[idx++]=ptr.value;
ptr=ptr.next;
}
if (idx < storage.length) {
storage[idx]=null;
}
return storage;
}
| Return list in order as an array. If not enough room is available in storage, an Exception is thrown. If there is excess storage, then the contents of the first unneeded position in storage will be set to null. |
private void restartProximityBrowsing(){
m_lastShown=new HashSet<>();
final Collection<NodeType> selectedNodes=SelectedVisibleFilter.filter(m_graph.getSelectedNodes());
if (!selectedNodes.isEmpty()) {
final List<NodeType> allNodes=GraphHelpers.getNodes(m_graph);
allNodes.removeAll(selectedNodes);
m_gr... | Restarts proximity browsing by setting only the selected nodes visible. |
public boolean pemEncode(){
return pemEncode;
}
| Was the option to PEM encode selected? |
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE",justification="not possible") public void deleteOperationsFiles(){
File files=getOperationsRoot();
if (!files.exists()) {
return;
}
String[] operationFileNames=files.list();
for ( String fileName : operatio... | Reset Operations by deleting XML files, leaves directories and backup files in place. |
public boolean swapBuffers(){
boolean result=mEglCore.swapBuffers(mEGLSurface);
if (!result) {
Log.d(TAG,"WARNING: swapBuffers() failed");
}
return result;
}
| Calls eglSwapBuffers. Use this to "publish" the current frame. |
public void write(byte[] data) throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.write(byte[])");
this.write(data,0,data.length);
}
| Writes the specified bytes to the output stream. |
@DSSink({DSSinkKind.SENSITIVE_UNCATEGORIZED}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:47.411 -0500",hash_original_method="63AD54FC39DDE8BE3BBE5131906AC91A",hash_generated_method="8FEBD7F0FD6B5B81CFD174CB6858AB6D") @Override public void put(String name,int value){
emulat... | Find and set the int value of a given field named <code>name</code> in the receiver. |
public String toString(){
final String TAB=" ";
StringBuffer retValue=new StringBuffer();
retValue.append("CustomFlagCriterion ( ").append("flag = ").append(this.flag).append(TAB).append("operator = ").append(this.operator).append(TAB).append(" )");
return retValue.toString();
}
| Constructs a <code>String</code> with all attributes in name = value format. |
public static int numberAwareCompareTo(Comparable self,Comparable other){
return COMPARABLE_NUMBER_AWARE_COMPARATOR.compare(self,other);
}
| Provides a method that compares two comparables using Groovy's default number aware comparator. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:43.592 -0500",hash_original_method="38BC76D95CA0A954EB857B91A285A324",hash_generated_method="82ACD7F436AB6358B2DD98EC3EEF7E28") public void doDatabaseCleanup(Account[] accounts){
synchronized (mAuthorities) {
if (Log.isLoggable(... | Called when the set of account has changed, given the new array of active accounts. |
protected Anonymous_invariant_1_Impl(){
super();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private void resizeTabs(int tabCount,int totalLength,int buttonLength,int tabAreaLength){
if (leadingTabIndex > 0) {
tabAreaLength-=buttonLength;
}
if (trailingTabIndex < tabCount - 1) {
tabAreaLength-=buttonLength;
}
Insets tabAreaInsets=getTabAreaInsets(tabPlacement);
Point corner=new Point(tabAre... | Fill out the visible tabs and scroll buttons to fit the available length. |
public StreamSpecBase(){
viewSpecs=ViewSpec.EMPTY_VIEWSPEC_ARRAY;
}
| Default ctor. |
private void addGeneralDescription(Document doc,Eml eml) throws DocumentException {
if (exists(eml.getPurpose()) || exists(eml.getAdditionalInfo())) {
Paragraph p=new Paragraph();
p.setAlignment(Element.ALIGN_JUSTIFIED);
p.setFont(font);
p.add(new Phrase(getText("rtf.generalDesciption"),fontTitle));
... | Add general description section. |
@Override public String toString(){
return getDescriptor();
}
| Returns a string representation of this type. |
protected boolean match(Object o1,Object o2){
if (key1 != null) {
if (!key1.equals(o1)) {
return false;
}
}
else if (o1 != null) {
return false;
}
if (key2 != null) {
return key2.equals(o2);
}
return o2 == null;
}
| Whether this entry match the given keys. |
public void update(final T item){
update(item,1);
}
| Update this sketch with an item and a frequency count of one. |
private void testCommandLine(String expectedError) throws Exception {
File file2=TestUtils.createTempFile();
File file3=TestUtils.createTempFile();
corruptFile();
FileProtection.main(new String[]{file2.getPath()});
File output=TestUtils.createTempFile();
File error=TestUtils.createTempFile();
TestUtils.pi... | Tests the command line utility with one file corrupted, one file with a valid digest, and one file missing the digest file. |
public HashIndexSet(){
this(DEFAULT_INITIAL_CAPACITY,DEFAULT_LOAD_FACTOR);
}
| This is used when inplace modification is off to detect old key |
public void addStringToTable(final byte[] oldString,final byte newString){
final int length=oldString.length;
final byte[] string=new byte[length + 1];
System.arraycopy(oldString,0,string,0,length);
string[length]=newString;
addStringToTable(string);
}
| Add a new string to the string table. |
private boolean isValidGeometryPath(String path){
return path.equals("") || path.equals("geometry") || path.equals("features.[].geometry");
}
| Returns true if the object path is a valid location to see a Multi/Polygon geometry |
public void readExif(byte[] jpeg) throws IOException {
readExif(new ByteArrayInputStream(jpeg));
}
| Reads the exif tags from a byte array, clearing this ExifInterface object's existing exif tags. |
private void updatePlaybackState(String error){
LogUtils.d(TAG,"updatePlaybackState, playback state=" + mPlayback.getState());
long position=PlaybackStateCompat.PLAYBACK_POSITION_UNKNOWN;
if (mPlayback != null && mPlayback.isConnected()) {
position=mPlayback.getCurrentStreamPosition();
}
PlaybackStateComp... | Update the current media player state, optionally showing an error message. |
public void moveToMessagesFragment(String chatKey,String friendName,String fcmKeyId){
Bundle args=new Bundle();
args.putString(Constants.KEY_CHAT_CHILD,chatKey);
args.putString(Constants.KEY_USER_DISPLAY_NAME,friendName);
args.putString(Constants.KEY_USER_FCM_DEVICE_ID,fcmKeyId);
if (sharedArgs != null) {
... | Move para o fragment do chat para realizar troca de mensagens |
@Override public void postProcess(ResultProducer rp) throws Exception {
m_ResultListener.postProcess(this);
}
| When this method is called, it indicates that no more results will be sent that need to be grouped together in any way. |
public void testSaveGeoJson() throws IOException {
FreeFormPointSet points1=FreeFormPointSet.fromGeoJson(new File("src/test/resources/pointset/population.geo.json"));
File tempFile=File.createTempFile("population","geo.json");
tempFile.deleteOnExit();
OutputStream out=new FileOutputStream(tempFile);
points1.w... | Load a point set from a GeoJson file, save it to a temporary file, then load it again. Assert that both versions are the same. This should test load and save. |
@POST @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("/{id}/protection/continuous-copies/swap") @CheckPermission(roles={Role.TENANT_ADMIN},acls={ACL.OWN,ACL.ALL}) public TaskList swap(@PathParam("id") URI id,CopiesParam param) th... | Request to reverse the replication direction, i.e. R1 and R2 are interchanged.. |
public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception {
BackTracker.markForBack(request,null,null,false,true);
sessionContext.checkPermission(Right.Classes);
sessionContext.setAttribute("callingPage","classShowSearch");
Objec... | Method execute |
public static float checkArgumentInRange(float value,float lower,float upper,String valueName){
if (Float.isNaN(value)) {
throw new IllegalArgumentException(valueName + " must not be NaN");
}
else if (value < lower) {
throw new IllegalArgumentException(String.format(Locale.US,"%s is out of range of [%f, ... | Ensures that the argument floating point value is within the inclusive range. <p>While this can be used to range check against +/- infinity, note that all NaN numbers will always be out of range.</p> |
public Analyzer showStatisticalSignificance(){
showStatisticalSignificance=true;
return this;
}
| Enables the output of statistical significance tests. If enabled, it is necessary to record multiple seeds for each entry. |
@Override public void send(Object message,boolean sent) throws RemotingException {
channel.send(message,sent);
}
| Description: <br> |
public DrawerBuilder withActivity(@NonNull Activity activity){
this.mRootView=(ViewGroup)activity.findViewById(android.R.id.content);
this.mActivity=activity;
this.mLayoutManager=new LinearLayoutManager(mActivity);
return this;
}
| Sets the activity which will be generated for the generation The activity is required and will be used to inflate the content in. After generation it is set to null to prevent a memory leak. |
private void pop(final String desc){
char c=desc.charAt(0);
if (c == '(') {
pop((Type.getArgumentsAndReturnSizes(desc) >> 2) - 1);
}
else if (c == 'J' || c == 'D') {
pop(2);
}
else {
pop(1);
}
}
| Pops a type from the output frame stack. |
public boolean isBeingInstantiated(){
return beingInstantiated;
}
| Checks if is being instantiated. |
public int partition(int left,int right,int pivotIndex){
E pivot=ar[pivotIndex];
E tmp;
if (pivotIndex != right) {
tmp=ar[right];
ar[right]=ar[pivotIndex];
ar[pivotIndex]=tmp;
}
int store=left;
for (int idx=left; idx < right; idx++) {
if (ar[idx].compareTo(pivot) <= 0) {
tmp=ar[idx];
... | In linear time, group an array into two parts, those less than or equal to a certain value (left), and those greater than a certain value (right). |
public static byte successor(final byte n) throws NoSuccessorException {
if (Byte.MAX_VALUE == n) {
throw new NoSuccessorException();
}
else {
return (byte)(n + 1);
}
}
| Computes the successor of a <code>byte</code> value. |
public static void removeUserAuths(final String userName,final SecurityOperations secOps,final String authsToRemove) throws AccumuloException, AccumuloSecurityException {
final Authorizations currentUserAuths=secOps.getUserAuthorizations(userName);
final List<String> authList=convertAuthStringToList(currentUserAuth... | Removes the specified authorizations from the user. |
public boolean hasReason(){
return getReason() != null;
}
| Returns whether it has the reason. |
public Boolean isSupportsCpuHotAdd(){
return supportsCpuHotAdd;
}
| Gets the value of the supportsCpuHotAdd property. |
public long checkSumAdjustment(){
return this.data.readULong(Offset.checkSumAdjustment.offset);
}
| Get the checksum adjustment. To compute: set it to 0, sum the entire font as ULONG, then store 0xB1B0AFBA - sum. |
public synchronized Long addModerator(String publicSID){
try {
log.debug("*..*addModerator publicSID: " + publicSID);
RoomClient currentClient=this.clientListManager.getClientByPublicSID(publicSID,false);
if (currentClient == null) {
return -1L;
}
Long room_id=currentClient.getRoom_id();
... | Adds a Moderator by its publicSID |
public String nodeLabel(){
StringBuilder sb=new StringBuilder();
for (int c=0; c <= MaxC; c++) {
sb.append("{");
for (int r=0; r <= MaxR; r++) {
int val=cell(r,c);
if (val == EmptyMark) {
sb.append(" ");
}
else {
sb.append(val);
}
if (r <= MaxR - 1) {
s... | Return label to appear within the debugger output. |
public void delete(String key) throws IOException {
try {
Variable value=zkState.fetch(key).get();
if (value.value().length == 0) {
throw new InvalidParameterException("Key does not exist:" + key);
}
zkState.expunge(value);
}
catch ( InterruptedException|ExecutionException e) {
throw new... | Delete a path in zk |
public static ArrayDBIDs topologicalSort(DBIDs oids,DBIDDataStore parent,DoubleDataStore parentDistance){
ArrayModifiableDBIDs ids=DBIDUtil.newArray(oids);
ids.sort(new DataStoreUtil.DescendingByDoubleDataStoreAndId(parentDistance));
final int size=ids.size();
ModifiableDBIDs seen=DBIDUtil.newHashSet(size);
A... | Perform topological sorting based on the successor order. |
@Override public double mean(){
return convertFromNS(histogram.mean());
}
| Returns the arithmetic mean of all recorded durations. |
String constructComponentName(){
synchronized (Canvas.class) {
return base + nameCounter++;
}
}
| Construct a name for this component. Called by getName() when the name is null. |
void ioMessage(Throwable ex){
log.printLines(PrefixKind.JAVAC,"msg.io");
ex.printStackTrace(log.getWriter(WriterKind.NOTICE));
}
| Print a message reporting an input/output error. |
public void configureManagers(){
if (manager != null) {
manager.configureManagers();
}
}
| Configure the common managers for Can connections. This puts the common manager config in one place. |
public double noise(double x,double y,double frequency,double amplitude){
return this.noise(x,y,0,frequency,amplitude);
}
| Generates noise for the 2D coordinates using the specified number of octaves and parameters |
@Override public String toString(){
StringBuffer sb=new StringBuffer("MWMSectionDetail[").append(get_ID()).append("]");
return sb.toString();
}
| String representation |
public boolean openForm(int AD_Form_ID){
Properties ctx=Env.getCtx();
String name=null;
String className=null;
String sql="SELECT Name, Description, ClassName, Help FROM AD_Form WHERE AD_Form_ID=?";
boolean trl=!Env.isBaseLanguage(ctx,"AD_Form");
if (trl) sql="SELECT t.Name, t.Description, f.ClassName, t.... | Open Form |
private static void bindPreferenceSummaryToValue(Preference preference){
preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,PreferenceManager.getDefaultSharedPreferences(preference.getContext()).getString(preference.ge... | Binds a preference's summary to its value. More specifically, when the preference's value is changed, its summary (line of text below the preference title) is updated to reflect the value. The summary is also immediately updated upon calling this method. The exact display format is dependent on the type of preference. |
public static double sinToCos(double angle,double sin){
if ((-1e-5 < sin && sin < 1e-5) || sin > 0.99999 || sin < -0.99999) {
return Math.cos(angle);
}
angle=normAngle(angle);
final double s=Math.sqrt(1 - sin * sin);
return (angle < HALFPI || angle > ONEHALFPI) ? s : -s;
}
| <b>Fast</b> way of computing cos(x) from x and sin(x). |
public MosaicFeeInformation(final Supply supply,final int divisibility){
this.supply=supply;
this.divisibility=divisibility;
}
| Creates a mosaic fee information. |
public static DateTimeFormatter date(){
return yearMonthDay();
}
| Returns a formatter for a full date as four digit year, two digit month of year, and two digit day of month (yyyy-MM-dd). |
public void log(@GuardSatisfied Level level,String msg){
throw new RuntimeException();
}
| Log a message, with no arguments. <p> If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects. <p> |
public void onRedButtonClick(View v){
if (isSubscribed()) {
centerButton.setBackgroundDrawable(getResources().getDrawable(R.drawable.redbutton));
update();
}
else {
generateSubscribeDialog();
}
}
| Called when the customer presses the red swatch Since the Red Button is unlocked by default, we simply change the color and update the UI |
private void dumpThreadInfoWithLocks(){
System.out.println("Full Java thread dump with locks info");
ThreadInfo[] tinfos=tmbean.dumpAllThreads(true,true);
for ( ThreadInfo ti : tinfos) {
printThreadInfo(ti);
LockInfo[] syncs=ti.getLockedSynchronizers();
printLockInfo(syncs);
}
System.out.println(... | Prints the thread dump information with locks info to System.out. |
public static double WCorrRMSEfitness(boolean useTrainingData,GEPIndividual ind,double corrWeight_RMSEweight[]){
return WCorrRMSEfitness(useTrainingData,ind,0,corrWeight_RMSEweight);
}
| Calculates the fitness for the WCorrRMSE (Weighted correlation coefficient and Root Mean Squared Error) type fitness (before the normalization from 0 to max value is done). The function calculates the RMSE and the correlation coefficient (both normalized to a value from 0 to 1000) and uses the weights to calculate a ... |
private CopyStateTaskService.State buildValidPatchState(TaskState.TaskStage stage){
CopyStateTaskService.State patchState=new CopyStateTaskService.State();
patchState.taskState=new TaskState();
patchState.taskState.stage=stage;
return patchState;
}
| This method creates a patch State object which is sufficient to patch a CopyStateTaskService instance. |
public CoapObserveRelation observeAndWait(Request request,CoapHandler handler){
if (request.getOptions().hasObserve()) {
Endpoint outEndpoint=getEffectiveEndpoint(request);
CoapObserveRelation relation=new CoapObserveRelation(request,outEndpoint);
request.addMessageObserver(new ObserveMessageObserverImpl(... | Sends the specified observe request and waits for the response whereupon the specified handler is invoked when a notification arrives. |
private static PrintWriter makeWriter(final File buildxmlFile) throws UnsupportedEncodingException, FileNotFoundException {
return new PrintWriter(new OutputStreamWriter(new FileOutputStream(buildxmlFile),CharsetToolkit.UTF8_CHARSET));
}
| Create print writer over file with UTF-8 encoding |
public <T>T newModel(Class<T> type,EntityConstraint constraints){
return newModel(type,null,constraints);
}
| Creates a new entity of the given type with the given constraints |
public LocalDateTime(int year,int monthOfYear,int dayOfMonth,int hourOfDay,int minuteOfHour,int secondOfMinute,int millisOfSecond,Chronology chronology){
super();
chronology=DateTimeUtils.getChronology(chronology).withUTC();
long instant=chronology.getDateTimeMillis(year,monthOfYear,dayOfMonth,hourOfDay,minuteOfH... | Constructs an instance set to the specified date and time using the specified chronology, whose zone is ignored. <p> If the chronology is null, <code>ISOChronology</code> is used. |
public void say(String sentence){
if (entity instanceof SpeakerNPC) {
((SpeakerNPC)entity).say(sentence);
}
}
| lets the SpeakerNPC say a sentence |
protected void serializeAttribute(TagNode tagNode,Writer writer,String attName,String attValue) throws IOException {
if (!isForbiddenAttribute(tagNode,attName,attValue)) {
writer.write(" " + attName + "=\""+ escapeXml(attValue)+ "\"");
}
}
| This allows overriding to eliminate forbidden attributes (for example javascript attributes onclick, onblur, etc. ) |
public boolean isPayToScriptHash(){
byte[] program=getProgram();
return program.length == 23 && (program[0] & 0xff) == OP_HASH160 && (program[1] & 0xff) == 0x14 && (program[22] & 0xff) == OP_EQUAL;
}
| <p>Whether or not this is a scriptPubKey representing a pay-to-script-hash output. In such outputs, the logic that controls reclamation is not actually in the output at all. Instead there's just a hash, and it's up to the spending input to provide a program matching that hash. This rule is "soft enforced" by the networ... |
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. |
@DSSink({DSSinkKind.SENSITIVE_UNCATEGORIZED}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:27:55.860 -0500",hash_original_method="C96E973D3DD249985D67DC789B41FB05",hash_generated_method="49FA704FE1EBD1FB743F960B79C013B7") public void notifyAppWidgetViewDataChanged(int appWidgetId... | Notifies the specified collection view in all the specified AppWidget instance to invalidate it's currently data. |
public static void writeTransitSchedule(TransitSchedule schedule,String fileName){
log.info("Writing transit schedule to file " + fileName);
new TransitScheduleWriter(schedule).writeFile(fileName);
log.info("done.");
}
| Writes the transit schedule to filePath. |
public void writeExternal(ObjectOutput out) throws IOException {
}
| Write out external representation for remote ref. |
public RVMMethod findDeclaredMethod(Atom methodName,Atom methodDescriptor){
for ( RVMMethod method : declaredMethods) {
if (method.getName() == methodName && method.getDescriptor() == methodDescriptor) {
return method;
}
}
return null;
}
| Find description of a method of this class. |
public static long runMultiThreaded(Runnable run,int threadNum,String threadName) throws Exception {
return runMultiThreaded(makeCallable(run,null),threadNum,threadName);
}
| Runs runnable object in specified number of threads. |
public BreakpointStmt newBreakpointStmt(){
return new JBreakpointStmt();
}
| Constructs a BreakpointStmt() grammar chunk. |
public boolean isRejectUserUndefined(){
return fieldRejectUserUndefined;
}
| Returns the localRecipientsOnly. |
public LabelledPortrayal2D(SimplePortrayal2D child,String label){
this(child,label,Color.blue,false);
}
| Draws 10 pixels down from the [dx=0, dy=0.5] prescaled position of the Portrayal2D, using the SansSerif 10pt font, blue, and left alignment. If label is null, then object.toString() is used. Labelling will always occur. If child is null, then the underlying model object is presumed to be a Portrayal2D and will be... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.