code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
@Deprecated public void templateType(ScriptService.ScriptType templateType){
updateOrCreateScript(null,templateType,null,null);
}
| The type of the stored template |
public static boolean hasNextKeyTyped(){
synchronized (keyLock) {
return !keysTyped.isEmpty();
}
}
| Has the user typed a key? |
public boolean isEagerLock(){
return eagerLock;
}
| Eager locking effectively locks the right/left images as well as the main image, as a result more heap is taken |
static boolean isPostgreSQL(){
if (s_type == null) getServerType();
if (s_type != null) return TYPE_POSTGRESQL.equals(s_type);
return false;
}
| Is this PostgreSQL ? |
private static boolean isViewRecycled(PaletteTarget target){
if (target != null && target.getPath() != null && target.getView() != null && target.getView().getTag() != null) {
if (target.getView().getTag() instanceof PaletteTag) {
return !target.getPath().equals(((PaletteTag)target.getView().getTag()).getPa... | Is it null? Is that null? What about that one? Is that null too? What about this one? And this one? Is this null? Is null even null? How can null be real if our eyes aren't real? <p>Checks whether the view has been recycled or not.</p> |
public final void incrementIdCounterTo(int id){
int diff=id - mIdCounter.get();
if (diff < 0) return;
mIdCounter.addAndGet(diff);
updateSharedPreference();
}
| Ensures the counter is at least as high as the specified value. The counter should always point to an unused ID (which will be handed out next time a request comes in). Exposed so that anything externally loading tabs and ids can set enforce new tabs start at the correct id. TODO(dfalcantara): Reduce the visibility o... |
public void remove(String userId) throws ServerException {
requireNonNull(userId,"Required non-null user id");
profileDao.remove(userId);
}
| Removes the user's profile. <p>Note that this method won't throw any exception when user doesn't have the corresponding profile. |
public Topology buildAppTopology(){
Topology t=tp.newTopology("kafkaClientSubscriber");
Map<String,Object> config=newConfig(t);
KafkaConsumer kafka=new KafkaConsumer(t,null);
System.out.println("Using Kafka consumer group.id " + config.get(OPT_GROUP_ID));
TStream<String> msgs=kafka.subscribe(null,(String)opti... | Create a topology for the subscriber application. |
public SVGPath ellipticalArc(double rx,double ry,double ar,double la,double sp,double[] xy){
append(SVGConstants.PATH_ARC,rx,ry,ar,la,sp,xy[0],xy[1]);
return this;
}
| Elliptical arc curve to the given coordinates. |
public void testParsingDotAsHostname() throws Exception {
assertEquals(null,new URI("http://./").getHost());
}
| Regression test for http://b/issue?id=2604061 |
public void endElement() throws Exception {
}
| Description of the Method |
void addBridgeIfNeeded(DiagnosticPosition pos,Symbol sym,ClassSymbol origin,ListBuffer<JCTree> bridges){
if (sym.kind == MTH && sym.name != names.init && (sym.flags() & (PRIVATE | STATIC)) == 0 && (sym.flags() & (SYNTHETIC | OVERRIDE_BRIDGE)) != SYNTHETIC && sym.isMemberOf(origin,types)) {
MethodSymbol meth=(Meth... | Add bridge if given symbol is a non-private, non-static member of the given class, which is either defined in the class or non-final inherited, and one of the two following conditions holds: 1. The method's type changes in the given class, as compared to the class where the symbol was defined, (in this case we have ext... |
public PathMatchingResourcePatternResolver(ResourceLoader resourceLoader){
Assert.notNull(resourceLoader,"ResourceLoader must not be null");
this.resourceLoader=resourceLoader;
}
| Create a new PathMatchingResourcePatternResolver. <p>ClassLoader access will happen via the thread context class loader. |
protected final static byte composeMessagingMode(byte esmClass,byte messagingModeValue){
return (byte)(cleanMessagingMode(esmClass) | messagingModeValue);
}
| Compose the Messaging Mode. Messaging Mode encoded on ESM Class at bits 1 - 0. |
public static void checkArgument(boolean expression){
if (!expression) {
throw new IllegalArgumentException();
}
}
| Ensures the truth of an expression involving one or more parameters to the calling method. |
public EntityView(){
}
| Constructs a view with no content. |
public void writeProperties(Path path) throws IOException {
logger.info("Writing properties to path: " + path.toAbsolutePath());
FileOutputStream stream=new FileOutputStream(path.toFile());
try {
toProperties().store(stream,"DCOS got yo Cassandra!");
}
finally {
stream.close();
}
}
| Writes the Location as a Properties file. |
public void cloneMethodClassifications(SootMethod original,SootMethod clone){
if (API.v().isBannedMethod(original.getSignature())) API.v().addBanMethod(clone);
else if (API.v().isSpecMethod(original)) API.v().addSpecMethod(clone);
else if (API.v().isSafeMethod(original)) API.v().addSafeMethod(clone);
els... | When adding a method clone, make sure the cloned method has all same designations as original. |
public Integer remove(Integer key){
return wrapValue(_map.remove(unwrapKey(key)));
}
| Deletes a key/value pair from the map. |
public void testCheckFoundWithResultAsFailed(){
LOGGER.debug("check found with result as failed");
initCheckerAndLaunch("src/test/resources/css/test3.css",null,TestSolution.FAILED,".selector");
}
| Test of check method, of class CssPropertyPresenceChecker. |
private void jbInit() throws Exception {
CompiereColor.setBackground(this);
mainPanel.setLayout(mainLayout);
parameterLayout=new MigLayout("fillx, wrap 4, hidemode 0"," [150:150][250:250][100:100][200:200]");
parameterPanel.setLayout(parameterLayout);
bRefresh.addActionListener(this);
bReset.addActionListen... | Static Init |
public void calcMinMax(int start,int end){
if (mDataSets == null || mDataSets.size() < 1) {
mYMax=0f;
mYMin=0f;
}
else {
mLastStart=start;
mLastEnd=end;
mYMin=Float.MAX_VALUE;
mYMax=-Float.MAX_VALUE;
for (int i=0; i < mDataSets.size(); i++) {
mDataSets.get(i).calcMinMax(start,end)... | calc minimum and maximum y value over all datasets |
public PipeConnectionEvent(Object source){
super(source);
}
| Construct an object with the specific pipe as the <tt>source</tt> |
@SuppressWarnings("unchecked") static final <K,V>Segment<K,V> segmentAt(Segment<K,V>[] ss,int j){
long u=(j << SSHIFT) + SBASE;
return ss == null ? null : (Segment<K,V>)UNSAFE.getObjectVolatile(ss,u);
}
| Gets the jth element of given segment array (if nonnull) with volatile element access semantics via Unsafe. (The null check can trigger harmlessly only during deserialization.) Note: because each element of segments array is set only once (using fully ordered writes), some performance-sensitive methods rely on this met... |
public void createMissingCaches() throws IgniteCheckedException {
for ( Map.Entry<String,DynamicCacheDescriptor> e : registeredCaches.entrySet()) {
CacheConfiguration ccfg=e.getValue().cacheConfiguration();
if (!caches.containsKey(maskNull(ccfg.getName())) && GridQueryProcessor.isEnabled(ccfg)) dynamicSt... | Starts client caches that do not exist yet. |
public GSSResult authenticate(String tenantName,String contextId,byte[] gssTicket) throws Exception {
return getService().authenticate(tenantName,contextId,gssTicket,this.getServiceContext());
}
| Authenticates using a ticket obtained through GSSAPI. |
public void testSetF25(){
boolean f25=false;
AbstractThrottle instance=new AbstractThrottleImpl();
instance.setF25(f25);
jmri.util.JUnitAppender.assertErrorMessage("Can't send F21-F28 since no command station defined");
}
| Test of setF25 method, of class AbstractThrottle. |
public ByteBuffer(){
this(64);
}
| Create a new byte buffer. |
static PotionType fromName(String name){
for ( PotionTypeTable table : values()) {
if (name.equalsIgnoreCase(table.name)) return table.type;
}
return PotionType.valueOf(name.toUpperCase());
}
| Converts a Vanilla Potion ID to an equivalent Bukkit PotionType |
private synchronized void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
s.defaultReadObject();
init(getName());
}
| readObject is called to restore the state of the DelegationPermission from a stream. |
private void createSampler(){
this.sampler=glGenSamplers();
glSamplerParameteri(this.sampler,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glSamplerParameteri(this.sampler,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
}
| Create the sampler to sample the framebuffer texture within the shader. |
public static ContactList blockingGetByUris(Parcelable[] uris){
ContactList list=new ContactList();
if (uris != null && uris.length > 0) {
for ( Parcelable p : uris) {
Uri uri=(Uri)p;
if ("tel".equals(uri.getScheme())) {
Contact contact=Contact.get(uri.getSchemeSpecificPart(),true);
... | Returns a ContactList for the corresponding recipient URIs passed in. This method will always block to query provider. The given URIs could be the phone data URIs or tel URI for the numbers don't belong to any contact. |
public static String toString(URL url,Charset encoding) throws IOException {
InputStream inputStream=url.openStream();
try {
return toString(inputStream,encoding);
}
finally {
inputStream.close();
}
}
| Gets the contents at the given URL. |
public int addEdge(int s,int t){
throw new UnsupportedOperationException("Changes to graph structure not allowed for spanning trees.");
}
| Unsupported operation. Spanning trees should not be edited. |
LocalVarState(Method m,Block b,Typeref[] initial_frame_state){
this.conservative_verifier_rules=b.is_backwards_branch_target;
this.fs_in=new Typeref[initial_frame_state.length];
if (!this.conservative_verifier_rules) {
System.arraycopy(initial_frame_state,0,this.fs_in,0,initial_frame_state.length);
}
else ... | Construct a LocalVariableState; compute its def, kill, and upwardly-exposed sets; and compute its frame state. |
public void sort(){
Map<String,PsiMethod> methods=getMethodsMap();
Map<String,PsiMethod> sortedMethods=null;
LifecycleFactory lifecycleFactory=new LifecycleFactory();
Lifecycle lifecycle=lifecycleFactory.createLifecycle(mPsiClass,methods);
if (lifecycle != null && !methods.isEmpty()) {
sortedMethods=lifec... | Formats the activity/fragment lifecycle methods |
public _ScheduleDays(final String[] flagStrings){
super(flagStrings);
}
| Constructs a _ScheduleDays with the given flags initially set. |
public static ApexStream<String> fromKafka08(String zookeepers,String topic,Option... opts){
KafkaSinglePortStringInputOperator kafkaSinglePortStringInputOperator=new KafkaSinglePortStringInputOperator();
kafkaSinglePortStringInputOperator.getConsumer().setTopic(topic);
kafkaSinglePortStringInputOperator.getConsu... | Create a stream of string reading input from kafka 0.8 |
private static Object unwrap(Object object){
if (object instanceof Reflect) {
return ((Reflect)object).get();
}
return object;
}
| Unwrap an object |
protected final void LONG_DIVIDES(Instruction s,RegisterOperand result,Operand val1,Operand val2,boolean isDiv,boolean signed){
EMIT(CPOS(s,MIR_Move.create(IA32_MOV,new RegisterOperand(getEDX(),TypeReference.Long),val1)));
EMIT(CPOS(s,MIR_Move.create(IA32_MOV,new RegisterOperand(getEAX(),TypeReference.Long),val1.co... | Expansion of LONG_DIV and LONG_REM |
private void updateSelection(Projection proj,SVGPoint p1,SVGPoint p2){
DBIDSelection selContext=context.getSelection();
ModifiableDBIDs selection;
if (selContext != null) {
selection=DBIDUtil.newHashSet(selContext.getSelectedIds());
}
else {
selection=DBIDUtil.newHashSet();
}
ModifiableHyperBoundin... | Update the selection in the context. |
public OMScalingIcon(double centerLat,double centerLon,int offsetX,int offsetY,Image ii,float baseScale){
super();
setRenderType(OMGraphic.RENDERTYPE_LATLON);
setColorModel(COLORMODEL_IMAGEICON);
lat=centerLat;
lon=centerLon;
setImage(ii);
setX(offsetX);
setY(offsetY);
this.baseScale=baseScale;
}
| Create an OMRaster, Lat/Lon placement with an Image. |
@Override public void actionPerformed(ActionEvent event){
if (verifyMessagePanel == null) {
return;
}
String addressText=null;
if (verifyMessagePanel.getAddressTextArea() != null) {
addressText=verifyMessagePanel.getAddressTextArea().getText();
if (addressText != null) {
addressText=Whitespace... | Verify the message. |
protected void registerValidatableTextFieldAttributes(){
addAttributeProcessor(new RestoreLastValidLmlAttribute(),"restore","restoreLastValid");
addAttributeProcessor(new ValidationEnabledLmlAttribute(),"enabled","validate","validationEnabled");
}
| VisValidatableTextField attributes. |
private ResultPoint correctTopRight(ResultPoint bottomLeft,ResultPoint bottomRight,ResultPoint topLeft,ResultPoint topRight,int dimension){
float corr=distance(bottomLeft,bottomRight) / (float)dimension;
int norm=distance(topLeft,topRight);
float cos=(topRight.getX() - topLeft.getX()) / norm;
float sin=(topRigh... | Calculates the position of the white top right module using the output of the rectangle detector for a square matrix |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public static void showOnMap(Activity activity,double[] latLong){
try {
String uri=String.format(Locale.ENGLISH,"http://maps.google.com/maps?f=q&q=(%f,%f)",latLong[0],latLong[1]);
ComponentName compName=new ComponentName(MAPS_PACKAGE_NAME,MAPS_CLASS_NAME);
Intent mapsIntent=new Intent(Intent.ACTION_VIEW,U... | Starts GMM with the given location shown. If this fails, and GMM could not be found, we use a geo intent as a fallback. |
public Constituent(String label,double score,String viewName,TextAnnotation text,int start,int end){
if (label == null) label="";
int labelId=text.symtab.getId(label);
if (labelId == -1) labelId=text.symtab.add(label);
this.label=labelId;
this.constituentScore=score;
this.viewName=viewName;
textAnnota... | start, end offsets are token indexes, and use one-past-the-end indexing -- so a one-token constituent right at the beginning of a text has start/end (0,1) offsets are relative to the entire text span (i.e. NOT sentence-relative) |
public void handleAnimatedAttributeChanged(AnimatedLiveAttributeValue alav){
if (alav.getNamespaceURI() == null) {
String ln=alav.getLocalName();
if (ln.equals(SVG_CX_ATTRIBUTE) || ln.equals(SVG_CY_ATTRIBUTE) || ln.equals(SVG_RX_ATTRIBUTE)|| ln.equals(SVG_RY_ATTRIBUTE)) {
buildShape(ctx,e,(ShapeNode)nod... | Invoked when the animated value of an animatable attribute has changed. |
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. |
boolean createSnapshot(String snapshotName,boolean async){
NaElement elem=new NaElement("snapshot-create");
elem.addNewChild("volume",name);
elem.addNewChild("snapshot",snapshotName);
elem.addNewChild("async",Boolean.toString(async));
try {
server.invokeElem(elem);
}
catch ( Exception e) {
String ... | Creates a new snapshot of the volume. |
private static void center(Box box,float axis){
float h=box.getHeight(), total=h + box.getDepth();
box.setShift(-(total / 2 - h) - axis);
}
| Centers the given box with resprect to the given axis, by setting an appropriate shift value. |
public XlsxSheetContentParser(File xlsxFile,String workbookZipEntryPath,String[] sharedStrings,XlsxNumberFormats numberFormats,XlsxSheetMetaData sheetMetaData,XMLInputFactory factory,Charset encoding) throws XMLStreamException, IOException {
this.xlsxFile=xlsxFile;
this.workbookZipEntryPath=workbookZipEntryPath;
... | Constructs object by saving the shared strings and instantiating a XML reader. |
@Override public void activateGroupClones(StorageSystem storage,List<URI> clones,TaskCompleter completer){
log.info("activateGroupClones operation START");
try {
modifyGroupClones(storage,clones,SmisConstants.SPLIT_VALUE);
List<Volume> cloneVols=_dbClient.queryObject(Volume.class,clones);
for ( Volum... | This interface is for the clone activate in CG, for vnx, it is to Split (Consistent Fracture) the mirror. |
public static void logTradeOrder(TradeOrder order){
_log.debug("OrderKey: " + +order.getOrderKey() + " ClientId: "+ order.getClientId()+ " PermId: "+ order.getPermId()+ " Action: "+ order.getAction()+ " TotalQuantity: "+ order.getQuantity()+ " OrderType: "+ order.getOrderType()+ " LmtPrice: "+ order.getLimitPrice()+ ... | Method logTradeOrder. |
public void testCase17(){
byte aBytes[]={-127,100,56,7,98,-1,39,-128,127,75};
byte bBytes[]={27,-15,65,39,100};
int aSign=1;
int bSign=1;
byte rBytes[]={12,-21,73,56,27};
BigInteger aNumber=new BigInteger(aSign,aBytes);
BigInteger bNumber=new BigInteger(bSign,bBytes);
BigInteger result=aNumber.remainder... | Remainder of division of two positive numbers |
public static void doMain(File modelFile,Properties properties,IssueAcceptor issueAcceptor) throws N4JSCompileException {
N4HeadlessCompiler hlc=injectAndSetup(properties);
hlc.compileSingleFile(modelFile,issueAcceptor);
}
| Compiles a single n4js/js file |
private VariableReference addPrimitive(TestCase test,PrimitiveStatement<?> old,int position) throws ConstructionFailedException {
logger.debug("Adding primitive");
Statement st=old.clone(test);
return test.addStatement(st,position);
}
| Add primitive statement at position |
@GET @Path("/{id}/refresh-matched-pools") @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @CheckPermission(roles={Role.SYSTEM_ADMIN,Role.RESTRICTED_SYSTEM_ADMIN}) public StoragePoolList refreshMatchedStoragePools(@PathParam("id") URI id){
return refreshMatchedPools(VirtualPool.Type.file,id);
}
| This method re-computes the matched pools for this VirtualPool and returns this information. Where as getStoragePools {id}/storage-pools returns whatever is already computed, for matched pools. |
public void applyPattern(String pattern){
this.pattern=pattern;
if (patternTokens != null) {
patternTokens.clear();
patternTokens=null;
}
}
| Apply a new pattern. |
public ClassifierReference(String classifierModuleSpecifier,String classifierName){
this.classifierModuleSpecifier=classifierModuleSpecifier;
this.classifierName=classifierName;
this.uri=null;
}
| Creates a unresolved classifier reference. |
public void writeAsSerializedByteArray(Object v) throws IOException {
if (this.ignoreWrites) return;
checkIfWritable();
ensureCapacity(5);
if (v instanceof HeapDataOutputStream) {
HeapDataOutputStream other=(HeapDataOutputStream)v;
other.finishWriting();
InternalDataSerializer.writeArrayLength(oth... | Writes the given object to this stream as a byte array. The byte array is produced by serializing v. The serialization is done by calling DataSerializer.writeObject. |
public final String executeStringQuery(String sql,boolean mandatory) throws AdeException {
return SpecialSqlQueries.executeStringQuery(sql,m_connection,mandatory);
}
| Executes a given query, that is expected to return a String result. If the query returns more than one result, an exception is thrown. If it returns no result, and mandatory flag is true an exception is thrown. Otherwise null is returned. To distinguish between no result and null in the database use the StringQueryExec... |
@SuppressWarnings("unchecked") public static <T>ManyAssociationFunction<T> manyAssociation(ManyAssociation<T> association){
return ((ManyAssociationReferenceHandler<T>)Proxy.getInvocationHandler(association)).manyAssociation();
}
| Create a new Query Template ManyAssociationFunction. |
public void rechazarExecuteLogic(ActionMapping mappings,ActionForm form,HttpServletRequest request,HttpServletResponse response){
DocumentoVitalForm frm=(DocumentoVitalForm)form;
getGestionDocumentosVitalesBI(request).rechazarDocumentoVital(frm.getId());
goBackExecuteLogic(mappings,form,request,response);
}
| Rechaza un documento vital. |
public void putValue(String name,Object value){
if (name == null || value == null) {
throw new IllegalArgumentException("name == null || value == null");
}
Object old=values.put(name,value);
if (value instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener)value).valueBound(new SSLSessionBin... | A link (name) with the specified value object of the SSL session's application layer data is created or replaced. If the new (or existing) value object implements the <code>SSLSessionBindingListener</code> interface, that object will be notified in due course. |
public static void main(final String[] args){
DOMTestCase.doMain(setAttributeNodeNS03.class,args);
}
| Runs this test from the command line. |
public void print(Object o) throws IOException {
if (_startLine) printIndent();
_os.print(o);
_lastCr=false;
}
| Prints an object. |
public Status stop(boolean failover){
LOGGER.info("Stopping driver");
Status status=driver.stop(failover);
LOGGER.info("Driver stopped with status: {}",status);
return status;
}
| Stops the underlying Mesos SchedulerDriver. If the failover flag is set to false, Myriad will not reconnect to Mesos. Consequently, Mesos will unregister the Myriad framework and shutdown all the Myriad tasks and executors. If failover is set to true, all Myriad executors and tasks will remain running for a defined p... |
private Map<Id<TransitRoute>,List<Id<Link>>> createRoutesNetworkLinksMap(TransitSchedule transitSchedule){
log.info("Start generating transitRouteNetworkLinksMap -- thread = " + threadName);
Map<Id<TransitRoute>,List<Id<Link>>> transitRouteNetworkLinksMap=new HashMap<Id<TransitRoute>,List<Id<Link>>>();
for ( Tra... | Creates a map with all transit routes and a list holding the network links belonging to each route |
boolean merge(final ClassWriter cw,final Frame frame,final int edge){
boolean changed=false;
int i, s, dim, kind, t;
int nLocal=inputLocals.length;
int nStack=inputStack.length;
if (frame.inputLocals == null) {
frame.inputLocals=new int[nLocal];
changed=true;
}
for (i=0; i < nLocal; ++i) {
if ... | Merges the input frame of the given basic block with the input and output frames of this basic block. Returns <tt>true</tt> if the input frame of the given label has been changed by this operation. |
public static <K,V>ImmutableListMultimap<K,V> of(K k1,V v1,K k2,V v2,K k3,V v3,K k4,V v4,K k5,V v5){
ImmutableListMultimap.Builder<K,V> builder=ImmutableListMultimap.builder();
builder.put(k1,v1);
builder.put(k2,v2);
builder.put(k3,v3);
builder.put(k4,v4);
builder.put(k5,v5);
return builder.build();
}
| Returns an immutable multimap containing the given entries, in order. |
protected void trimStackFrames(List stacks){
for (int size=stacks.size(), i=size - 1; i > 0; i--) {
String[] curr=(String[])stacks.get(i);
String[] next=(String[])stacks.get(i - 1);
List currList=new ArrayList(Arrays.asList(curr));
List nextList=new ArrayList(Arrays.asList(next));
ExceptionUtils.r... | Trims the stack frames. The first set is left untouched. The rest of the frames are truncated from the bottom by comparing with one just on top. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:31.644 -0500",hash_original_method="8ECE0FD94D831C743ACA34A8ACB9471A",hash_generated_method="E27A767163647451E623E9852DB7A221") public javax.sip.address.Address createAddress(String displayName,javax.sip.address.URI uri){
if (uri ... | Creates an Address with the new display name and URI attribute values. |
@Override public final boolean onOptionsItemSelected(final MenuItem item){
switch (item.getItemId()) {
case R.id.menu_stoptracking:
stopTracking();
break;
default :
break;
}
return super.onOptionsItemSelected(item);
}
| Context menu, while in "tracking" mode |
public void printPC(DMLProgramCounter pc){
if (pc != null) System.out.println(" Current program counter at " + pc.toString());
else System.out.println("DML runtime is currently inactive.");
}
| Print current program counter |
public void clearSounds(){
mSoundMap.clear();
}
| Clears all of the previously set sounds and events. |
@Override protected void invalidated(){
getTableView().refresh();
if (!getValue()) expandedNodeCache.remove(getBean());
}
| When the expanded state change we refresh the tableview. If the expanded state changes to false we remove the cached expanded node. |
public Engine newEngine(String engineRoad,String engineNumber){
Engine engine=getByRoadAndNumber(engineRoad,engineNumber);
if (engine == null) {
engine=new Engine(engineRoad,engineNumber);
register(engine);
}
return engine;
}
| Finds an existing engine or creates a new engine if needed requires engine's road and number |
static MyDialogFragment newInstance(int num){
MyDialogFragment f=new MyDialogFragment();
Bundle args=new Bundle();
args.putInt("num",num);
f.setArguments(args);
return f;
}
| Create a new instance of MyDialogFragment, providing "num" as an argument. |
public synchronized void flush() throws IOException {
checkNotClosed();
trimToSize();
journalWriter.flush();
}
| Force buffered operations to the filesystem. |
public static void moveFile(String srcFilePath,String destFilePath) throws FileNotFoundException {
if (StringUtils.isEmpty(srcFilePath) || StringUtils.isEmpty(destFilePath)) {
throw new RuntimeException("Both srcFilePath and destFilePath cannot be null.");
}
moveFile(new File(srcFilePath),new File(destFilePat... | Move file |
public void test_dataTypeLiterals(){
final Literal a=new LiteralImpl("bigdata",XMLSchema.INT);
assertEquals(a,roundTrip_tuned(a));
}
| Test round trip of some datatype literals. |
public static StringSet extractValuesFromStringSet(String key,StringSetMap volumeInformation){
try {
StringSet returnSet=new StringSet();
StringSet availableValueSet=volumeInformation.get(key);
if (null != availableValueSet) {
for ( String value : availableValueSet) {
returnSet.add(valu... | Copied from PropertySetterUtil, which is in apisvc and can't be accessed from controllersvc. |
private void sendFeaturesRequest() throws IOException {
OFFeaturesRequest m=factory.buildFeaturesRequest().setXid(handshakeTransactionIds--).build();
write(m);
}
| Send a features request message to the switch using the handshake transactions ids. |
@Override public Query newFuzzyQuery(String text,int fuzziness){
if (settings.lowercaseExpandedTerms()) {
text=text.toLowerCase(settings.locale());
}
BooleanQuery.Builder bq=new BooleanQuery.Builder();
bq.setDisableCoord(true);
for ( Map.Entry<String,Float> entry : weights.entrySet()) {
try {
Q... | Dispatches to Lucene's SimpleQueryParser's newFuzzyQuery, optionally lowercasing the term first |
public TransformerConfigurationException(Throwable e){
super(e);
}
| Create a new <code>TransformerConfigurationException</code> with a given <code>Exception</code> base cause of the error. |
public boolean canTab(){
List constraints=dockPanel.getConstraints(getChildren());
return DockConstraint.canTab(constraints);
}
| Determine if this can tab |
public static GenericValue create(GenericPK primaryKey){
GenericValue newValue=new GenericValue();
newValue.init(primaryKey);
return newValue;
}
| Creates new GenericValue from existing GenericValue |
public static String readFirstLine(File file,Charset charset) throws IOException {
return asCharSource(file,charset).readFirstLine();
}
| Reads the first line from a file. The line does not include line-termination characters, but does include other leading and trailing whitespace. |
public HttpsURL(final String userinfo,final String host,final int port,final String path,final String query,final String fragment) throws URIException {
final StringBuffer buff=new StringBuffer();
if (userinfo != null || host != null || port != -1) {
_scheme=DEFAULT_SCHEME;
buff.append(_default_scheme);
... | Construct a HTTPS URL from given components. Note: The <code>userinfo</code> format is normally <code><username>:<password></code> where username and password must both be URL escaped. |
private void handleArgumentField(int begin,int end,int argIndex,FieldPosition position,List<FieldContainer> fields){
if (fields != null) {
fields.add(new FieldContainer(begin,end,Field.ARGUMENT,Integer.valueOf(argIndex)));
}
else {
if (position != null && position.getFieldAttribute() == Field.ARGUMENT && p... | Adds a new FieldContainer with MessageFormat.Field.ARGUMENT field, argIndex, begin and end index to the fields list, or sets the position's begin and end index if it has MessageFormat.Field.ARGUMENT as its field attribute. |
@SuppressWarnings("unchecked") private void insertion(int low,int high){
if (high <= low) {
return;
}
for (int t=low; t < high; t++) {
for (int i=t + 1; i <= high; i++) {
if (ar[i].compareTo((E)ar[t]) < 0) {
Comparable<E> c=ar[t];
ar[t]=ar[i];
ar[i]=c;
}
}
}
}
| Private code to use InsertionSort on the range ar[low,high]. |
public void clearData(){
if (disposed) {
throw new IllegalStateException("disposed profiler");
}
for ( Counter counter : counters.values()) {
counter.clear();
}
}
| Resets all collected data to zero. |
@Override public String toString(){
return (getClass().getName() + "[" + getKeyValue()+ "]");
}
| return String representation |
public long readLongSkewedGolomb(final long b) throws IOException {
if (b < 0) throw new IllegalArgumentException("The modulus " + b + " is negative");
if (b == 0) return 0;
final long M=((1 << readUnary() + 1) - 1) * b;
final long m=(M / (2 * b)) * b;
return m + readLongMinimalBinary(M - m);
}
| Reads a long natural number in skewed Golomb coding. <P>This method implements also the case in which <code>b</code> is 0: in this case, nothing will be read, and 0 will be returned. |
@SkipValidation @Action(value="/modifyProperty-view") public String view(){
LOGGER.debug("Entered into view, BasicProperty: " + basicProp + ", ModelId: "+ getModelId());
if (getModelId() != null) {
propertyModel=(PropertyImpl)getPersistenceService().findByNamedQuery(QUERY_PROPERTYIMPL_BYID,Long.valueOf(getModel... | Returns modify property view screen when modify property inbox item is opened |
public VCardParameter(String value){
this(value,false);
}
| Creates a new parameter. |
public static int dip2px(Context context,float dip){
float density=getDensity(context);
return (int)(dip * density + DensityUtils.DOT_FIVE);
}
| dip to px |
public void testCameraPairwiseScenario24() throws Exception {
genericPairwiseTestCase(Flash.AUTO,Exposure.NONE,WhiteBalance.FLUORESCENT,SceneMode.AUTO,PictureSize.SMALL,Geotagging.ON);
}
| Flash: Auto / Exposure: None / WB: Fluorescent Scene: Auto / Pic: Small / Geo: on |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.