code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
---|---|
public static SipRequest createUpdate(SipDialogPath dialog) throws PayloadException {
try {
Request update=dialog.getStackDialog().createRequest(Request.UPDATE);
Header supportedHeader=SipUtils.HEADER_FACTORY.createHeader(SupportedHeader.NAME,"timer");
update.addHeader(supportedHeader);
Header sessionExpiresHeader=SipUtils.HEADER_FACTORY.createHeader(SipUtils.HEADER_SESSION_EXPIRES,"" + dialog.getSessionExpireTime());
update.addHeader(sessionExpiresHeader);
ViaHeader viaHeader=(ViaHeader)update.getHeader(ViaHeader.NAME);
viaHeader.setRPort();
return new SipRequest(update);
}
catch ( ParseException|SipException e) {
throw new PayloadException("Can't create SIP message!",e);
}
}
| Create a SIP UPDATE request |
@Override public boolean hasOverlappingRendering(){
return false;
}
| ReactImageViews only render a single image. |
private boolean updateOutlierList(OutlierList list,Outlier outlier){
boolean result=false;
result=list.add(outlier);
list.updateAveragedOutlier();
list.setMultiple(true);
return result;
}
| Updates the outlier list by adding the outlier to the end of the list and setting the averaged outlier to the average x and y coordinnate values of the outliers in the list. |
public void testColdDeployEJBJar(){
this.fileHandler.createFile("ram:///test.jar");
EJB ejb=(EJB)factory.createDeployable("jonas4x","ram:///test.jar",DeployableType.EJB);
setupAdminColdDeployment();
deployer.deploy(ejb);
assertTrue(fileHandler.exists(deployer.getDeployableDir(ejb) + "/autoload/test.jar"));
}
| Test EJB cold deployment. |
@Override public boolean isObstacle(final Entity entity){
if (entity instanceof RPEntity) {
return true;
}
return super.isObstacle(entity);
}
| Determine if this is an obstacle for another entity. |
public void testCreateConfigurationWithAPropertyWithNullValue() throws Exception {
Configuration configurationElement=new Configuration();
configurationElement.setImplementation(StandaloneLocalConfigurationStub.class.getName());
Map<String,String> properties=new HashMap<String,String>();
properties.put("someName",null);
configurationElement.setProperties(properties);
org.codehaus.cargo.container.configuration.Configuration configuration=configurationElement.createConfiguration("testcontainer",ContainerType.INSTALLED,null,new CargoProject(null,null,null,null,null,Collections.<Artifact>emptySet(),null));
assertEquals("",configuration.getPropertyValue("someName"));
}
| Setting a Null property is the way Maven2 operates when the user specifies an empty element. We need to verify that the Cargo plugin intercepts that and replaces the Null with an empty String. |
protected AbstractMatrix3D vDice(int axis0,int axis1,int axis2){
super.vDice(axis0,axis1,axis2);
int[][] offsets=new int[3][];
offsets[0]=this.sliceOffsets;
offsets[1]=this.rowOffsets;
offsets[2]=this.columnOffsets;
this.sliceOffsets=offsets[axis0];
this.rowOffsets=offsets[axis1];
this.columnOffsets=offsets[axis2];
return this;
}
| Self modifying version of viewDice(). |
protected boolean isFullDetail(Boolean fullDetailRequest){
if (fullDetailRequest == null) {
return defaultFullDetail;
}
return fullDetailRequest.booleanValue();
}
| <p>Is this field to be output in full detail.</p> <p>This method converts a detail request into a detail level. The calling code may request full detail (<code>true</code>), but a subclass might ignore that and always return <code>false</code>. The calling code may pass in <code>null</code> indicating that it doesn't care about the detail level. In this case the default detail level is used.</p> |
public void union(Node a,Node b){
union(getNodeId(a),getNodeId(b));
}
| Merge the equivalence sets of two nodes. After calling this function, find(a) == find(b). |
static void accumSingle(int counts[],int startTermIndex,SortedDocValues si,DocIdSetIterator disi,int subIndex,OrdinalMap map) throws IOException {
if (startTermIndex == -1 && (map == null || si.getValueCount() < disi.cost() * 10)) {
accumSingleSeg(counts,si,disi,subIndex,map);
}
else {
accumSingleGeneric(counts,startTermIndex,si,disi,subIndex,map);
}
}
| accumulates per-segment single-valued facet counts |
public static S2Cap full(){
return new S2Cap(new S2Point(1,0,0),2);
}
| Return a full cap, i.e. a cap that contains all points. |
@Override protected void initialize(){
super.initialize();
m_FileChooserDatasets=GUIHelper.newConverterFileChooser();
}
| Initializes the member variables. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:35:44.058 -0500",hash_original_method="7E0E89252855B3CDBF126F525B8DFC31",hash_generated_method="B543AE4E1838FF864DE64776FEE21A06") public void onDestroy(){
}
| Called when the instrumented application is stopping, after all of the normal application cleanup has occurred. |
public void forceStop(){
if (this.serverProcess != null) {
this.serverProcess.destroy();
this.serverProcess=null;
}
}
| Forcefully terminates the server process (if started). |
protected void saveDialogBounds(Shell shell){
IDialogSettings settings=getDialogSettings();
if (settings != null) {
Point shellLocation=shell.getLocation();
Point shellSize=shell.getSize();
Shell parent=getParentShell();
if (parent != null) {
Point parentLocation=parent.getLocation();
shellLocation.x-=parentLocation.x;
shellLocation.y-=parentLocation.y;
}
String prefix=getClass().getName();
if (persistSize) {
settings.put(prefix + DIALOG_WIDTH,shellSize.x);
settings.put(prefix + DIALOG_HEIGHT,shellSize.y);
}
if (persistLocation) {
settings.put(prefix + DIALOG_ORIGIN_X,shellLocation.x);
settings.put(prefix + DIALOG_ORIGIN_Y,shellLocation.y);
}
if (showPersistActions && showDialogMenu) {
settings.put(getClass().getName() + DIALOG_USE_PERSISTED_SIZE,persistSize);
settings.put(getClass().getName() + DIALOG_USE_PERSISTED_LOCATION,persistLocation);
}
}
}
| Saves the bounds of the shell in the appropriate dialog settings. The bounds are recorded relative to the parent shell, if there is one, or display coordinates if there is no parent shell. Subclasses typically need not override this method, but may extend it (calling <code>super.saveDialogBounds</code> if additional bounds information should be stored. Clients may also call this method to persist the bounds at times other than closing the dialog. |
public Debug(String clientID,ClientComms comms){
this.clientID=clientID;
this.comms=comms;
log.setResourceName(clientID);
}
| Set the debug facility up for a specific client |
public static String flatten(Object[] lines,String sep){
StringBuilder result;
int i;
result=new StringBuilder();
for (i=0; i < lines.length; i++) {
if (i > 0) result.append(sep);
result.append(lines[i].toString());
}
return result.toString();
}
| Flattens the array into a single, long string. The separator string gets added between the objects, but not after the last one. Uses the "toString()" method of the objects to turn them into a string. |
private boolean isLetter(char value){
return Character.isLetterOrDigit(value);
}
| This is used to determine if the provided character is an alpha numeric character. This is used to ensure all extracted element and attribute names conform to the XML specification. |
public Long updateUserSelfSmall(String SID,@SuppressWarnings("rawtypes") ObjectMap values){
try {
Long users_id=sessionManagement.checkSession(SID);
Long user_level=userManagement.getUserLevelByID(users_id);
if (user_level != null && user_level >= 1) {
return userManagement.saveOrUpdateUser(new Long(3),values,users_id);
}
else {
return new Long(-2);
}
}
catch ( Exception err) {
log.error("[updateUserSelfSmall] " + err);
return new Long(-1);
}
}
| updates the user profile, every user can update his own profile |
public TextSliceExtractor(int start,int stop){
this.start=start;
this.stop=stop;
this.featureName="Suffix";
}
| Create an extractor for a given slice of the text. E.g. <code>new TextSliceExtractor(1, -1)</code> would extract all of the text but its first and last characters. |
@Override public void qtest(Query q,int[] expDocNrs) throws Exception {
CheckHits.checkNoMatchExplanations(q,FIELD,searcher,expDocNrs);
}
| Overrides superclass to ignore matches and focus on non-matches |
public String toString(){
return m_Formatter.format(getStamp());
}
| returns the timestamp as string in the specified format |
static String toString(CharSequence charSequence){
return new StringBuilder().append(charSequence).toString();
}
| Converts a CharSequence to a string the slow way. Useful for testing a CharSequence implementation. |
private void writeAttribute(java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
if (namespace.equals("")) {
xmlWriter.writeAttribute(attName,attValue);
}
else {
registerPrefix(xmlWriter,namespace);
xmlWriter.writeAttribute(namespace,attName,attValue);
}
}
| Util method to write an attribute without the ns prefix |
public static float fArrayGet(float[] a,int i){
try {
return a[i];
}
catch ( Throwable t) {
return a[DefaultGroovyMethodsSupport.normaliseIndex(i,a.length)];
}
}
| get value from float[] using normalized index |
public ColladaRoot parse(Object... args) throws XMLStreamException {
ColladaParserContext ctx=this.parserContext;
try {
for (XMLEvent event=ctx.nextEvent(); ctx.hasNext(); event=ctx.nextEvent()) {
if (event == null) continue;
if (event.isStartElement() && event.asStartElement().getName().getLocalPart().equals("COLLADA")) {
super.parse(ctx,event,args);
return this;
}
}
}
finally {
ctx.getEventReader().close();
this.closeEventStream();
}
return null;
}
| Starts document parsing. This method initiates parsing of the COLLADA document and returns when the full document has been parsed. |
@SuppressWarnings({"unchecked","rawtypes"}) private CIMObjectPath createCIMPath(String nativeGUID,String volume,String system,Map<String,Object> keyMap){
String[] tokens=nativeGUID.split(Constants.PATH_DELIMITER_REGEX);
String SystemName=tokens[0] + Constants._plusDelimiter + tokens[1];
String deviceID=tokens[3];
if (tokens.length > 4) {
for (int i=4; i < tokens.length; i++) {
deviceID=deviceID + "+" + tokens[i];
}
}
CIMProperty<?> CreationClassName=new CIMProperty(CreationClassNamestr,CIMDataType.STRING_T,volume,true,false,null);
CIMProperty<?> SystemCreationClassName=new CIMProperty(SystemCreationClassNamestr,CIMDataType.STRING_T,system,true,false,null);
CIMProperty<?> systemName=new CIMProperty(SystemNamestr,CIMDataType.STRING_T,SystemName,true,false,null);
CIMProperty<?> Id=new CIMProperty(DeviceIDstr,CIMDataType.STRING_T,deviceID,true,false,null);
CIMProperty<?>[] keys=new CIMProperty<?>[4];
keys[0]=CreationClassName;
keys[1]=SystemCreationClassName;
keys[2]=systemName;
keys[3]=Id;
return CimObjectPathCreator.createInstance(volume,keyMap.get(Constants._InteropNamespace).toString(),keys);
}
| Create CIMObjectPath using the nativeGUID got from Statistics Call. |
public boolean remove(int val){
Integer v=val;
boolean flag=list.contains(v);
list.remove(v);
return flag;
}
| Removes a value from the collection. Returns true if the collection contained the specified element. |
public static double latJLT90(double val){
return justLessThan(val,90,.00001);
}
| lat just less than 90 degrees. |
public void updateUi(){
BusProvider.getInstance().post(new Event.OnUpdateUi());
}
| Renders the days again. If you depend on deferred data which need to update the calendar after it's resolved to decorate the days. |
private double dmsToDeg(Integer d,Integer m,Double s){
double seconds=m * 60.0;
if (s != null) {
seconds+=s;
}
return d + (seconds / 3600);
}
| Converts a Degrees Minutes Seconds coordinate into a decimal degree value The conversion is ignorant of the cardinality (N, S, E, W) so degrees value should be positive and the conversion of an S latitude or W longitude coordinate to a negative value should be carried out by the calling function. |
public Class<K> keyType(){
return keyType;
}
| Returns the associated key type. |
public RequestInputDataSimple(String clientUrl,TestRequest testRequest,String contentType){
super(clientUrl,testRequest);
this.contentType=contentType;
}
| Creates a simple request. |
public static long copyLarge(InputStream input,OutputStream output,final long inputOffset,final long length,byte[] buffer) throws IOException {
if (inputOffset > 0) {
skipFully(input,inputOffset);
}
if (length == 0) {
return 0;
}
final int bufferLength=buffer.length;
int bytesToRead=bufferLength;
if (length > 0 && length < bufferLength) {
bytesToRead=(int)length;
}
int read;
long totalRead=0;
while (bytesToRead > 0 && EOF != (read=input.read(buffer,0,bytesToRead))) {
output.write(buffer,0,read);
totalRead+=read;
if (length > 0) {
bytesToRead=(int)Math.min(length - totalRead,bufferLength);
}
}
return totalRead;
}
| Copy some or all bytes from a large (over 2GB) <code>InputStream</code> to an <code>OutputStream</code>, optionally skipping input bytes. <p> This method uses the provided buffer, so there is no need to use a <code>BufferedInputStream</code>. <p> |
protected static MethodHandle makeFallBack(MutableCallSite mc,Class<?> sender,String name,int callID,MethodType type,boolean safeNavigation,boolean thisCall,boolean spreadCall){
MethodHandle mh=MethodHandles.insertArguments(SELECT_METHOD,0,mc,sender,name,callID,safeNavigation,thisCall,spreadCall,1);
mh=mh.asCollector(Object[].class,type.parameterCount()).asType(type);
return mh;
}
| Makes a fallback method for an invalidated method selection |
public static final Parameter base(){
return GPDefaults.base().push(P_BUILD);
}
| Returns the default base. |
public void writeToCheckpoint(OutputStream stream) throws IOException {
preCheckpoint();
GZIPOutputStream g=new GZIPOutputStream(new BufferedOutputStream(stream));
ObjectOutputStream s=new ObjectOutputStream(g);
s.writeObject(this);
s.flush();
g.finish();
g.flush();
postCheckpoint();
}
| Serializes out the SimState, and the entire simulation state (not including the graphical interfaces) to the provided stream. Calls preCheckpoint() before and postCheckpoint() afterwards. Throws an IOException if the stream becomes invalid (prematurely closes, etc.). Does not close or flush the stream. |
public Texture(int width,int height,int pixelFormat) throws Exception {
this.id=glGenTextures();
this.width=width;
this.height=height;
glBindTexture(GL_TEXTURE_2D,this.id);
glTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT,this.width,this.height,0,pixelFormat,GL_FLOAT,(ByteBuffer)null);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);
}
| Creates an empty texture. |
private MLTResult buildQueryForField(String fieldName,PriorityQueue<MLTTerm> q,BooleanQuery query,boolean contentStreamQuery){
List<MLTTerm> interestingTerms=new ArrayList<MLTTerm>();
int qterms=0;
int maxTerms=maxQueryTermsPerField;
if (maxTerms <= 0) {
maxTerms=Integer.MAX_VALUE;
}
BooleanQuery tmpQuery=new BooleanQuery();
double sumQuaredBoost=0.0f;
MLTTerm cur;
while ((cur=q.pop()) != null) {
Query tq=null;
final Term term=new Term(cur.getFieldName(),cur.getWord());
if (isPayloadField(cur.getFieldName())) {
tq=new PayloadTermQuery(term,new AveragePayloadFunction(),true);
}
else {
tq=new TermQuery(term);
}
if (boost) {
float boost=cur.getScore();
tq.setBoost(boost);
sumQuaredBoost+=boost * boost;
}
else {
sumQuaredBoost+=1.0;
}
try {
tmpQuery.add(tq,BooleanClause.Occur.SHOULD);
interestingTerms.add(cur);
qterms++;
}
catch ( BooleanQuery.TooManyClauses ignore) {
break;
}
if (qterms >= maxTerms) {
break;
}
}
double vectorLength=Math.sqrt(sumQuaredBoost);
if (vectorLength <= 0.0) {
return new MLTResult(interestingTerms,query);
}
buildBoostedNormalizedQuery(fieldName,tmpQuery,query,vectorLength,contentStreamQuery);
return new MLTResult(interestingTerms,query);
}
| Build the More queryFromDocuments query from a PriorityQueue and an initial Boolean query |
private int shouldKillIndex(int x,int y){
int idx=getIndexForPoint(x,y);
if (idx != -1) {
Icon icon=tabbedPane.getIconAt(idx);
if (icon != null && icon instanceof CancelSearchIconProxy) if (((CancelSearchIconProxy)icon).shouldKill(x,y)) return idx;
}
return -1;
}
| Returns the index of the tab if the coordinates x,y can close it. Otherwise returns -1. |
public void writeKtab(String tab) throws IOException, KrbException {
writeKtab(tab,false);
}
| Write a ktab for this KDC. |
public void createEmptyDB(SQLiteDatabase db){
db.execSQL("DROP TABLE IF EXISTS " + TABLE_FAVORITES);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_WORKSPACE_SCREENS);
onCreate(db);
}
| Clears all the data for a fresh start. |
public static boolean isFileExist(String filePath){
File f=new File(filePath);
return f.exists() && !f.isDirectory();
}
| Checks if is file exist. |
public static Typeface droidSerifRegular(Context context){
sDroidSerifRegular=getFontFromRes(R.raw.droidserif_regular,context);
return sDroidSerifRegular;
}
| Droid Serif-Regular font face |
public Builder bufferSize(int bufferSize){
this._bufferSize=bufferSize;
return this;
}
| Set the output buffer size. <p>If output buffer size is 0, the writes will be transmitted to wire immediately. |
public static void silentCloseInputStream(InputStream is){
try {
if (is != null) {
is.close();
}
}
catch ( IOException e) {
e.printStackTrace();
}
}
| A utility function to close an input stream without raising an exception. |
public void turnRight(double amount){
if (amount == 0) {
return;
}
if (!isBlocked()) {
heading-=amount;
}
}
| Rotate right by the specified amount. |
public static IProposalComputer newUrnImportProposalComputer(ContentAssistRequest contentAssistRequest,IJavaProject javaProject){
IDOMAttr attribute=XmlContentAssistUtilities.getAttribute(contentAssistRequest);
if (attribute == null) {
return null;
}
String attrValue=XmlContentAssistUtilities.getAttributeValueUsingMatchString(contentAssistRequest);
if (!UiBinderXmlModelUtilities.isUrnImportAttribute(attribute)) {
return null;
}
int urnImportLength=UiBinderConstants.URN_IMPORT_NAMESPACE_BEGINNING.length();
if (attrValue.length() < urnImportLength) {
return null;
}
String replaceText=attrValue.substring(urnImportLength);
int replaceOffset=XmlContentAssistUtilities.getAttributeValueOffset(contentAssistRequest) + urnImportLength;
return new CodeCompleteProposalComputer(new int[]{CompletionProposal.PACKAGE_REF},javaProject,replaceText,replaceOffset,replaceText.length(),null,false);
}
| Creates a proposal computer for autocompleting the UiBinder root element URN import scheme. For example, <ui:UiBinder xmlns:g="urn:import:com.google.gwt._" /> |
private void printGroupInformation(String output,String[][] array){
if (array.length > 0) {
for (int i=0; i < array.length; i++) {
output+="\n Group: " + array[i][0] + " Nested Groups: "+ array[i][1]+ " Criteria Count: "+ array[i][2];
}
}
}
| This method generates strings for group information. |
public static Builder builder(){
return new Builder();
}
| Create a builder. |
public boolean isEmployee(){
Object oo=get_Value(COLUMNNAME_IsEmployee);
if (oo != null) {
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
| Get Employee. |
@Override public boolean handles(ResultHistoryList history,int index){
return (getClassifier(history,index) instanceof IncrementalMultiLabelClassifier);
}
| Checks whether the current item can be handled. Disables/enables the menu item. |
public RegistrationResponse build(){
return new RegistrationResponse(mRequest,mClientId,mClientIdIssuedAt,mClientSecret,mClientSecretExpiresAt,mRegistrationAccessToken,mRegistrationClientUri,mTokenEndpointAuthMethod,mAdditionalParameters);
}
| Creates the token response instance. |
public boolean isStatic(){
return ref == null;
}
| Return whether or not this is a static field. |
public static <NodeType extends IGraphNode<NodeType> & ISelectableNode>void selectPredecessorsOfSelection(final ISelectableGraph<NodeType> graph){
graph.selectNodes(getPredecessorsOfSelection(graph),true);
}
| Selects all predecessors of the selected nodes. |
public ClampMountTank(){
super();
}
| Create a space to mount clamp-equipped troopers on a Mech. |
protected void sequence_TStructField(ISerializationContext context,TStructField semanticObject){
genericSequencer.createSequence(context,semanticObject);
}
| Contexts: TStructMember returns TStructField TStructField returns TStructField Constraint: (name=IdentifierName typeRef=TypeRef?) |
public void dump(Printer pw,String prefix){
pw.println(prefix + "durationMillis: " + durationMillis);
pw.println(prefix + "serviceDetails: " + serviceDetails);
}
| Dump a BatteryInfo instance to a Printer. |
public static void main(String[] args){
GenericStack<String> stack1=new GenericStack<>();
stack1.push("London");
stack1.push("Paris");
stack1.push("Berlin");
GenericStack<Integer> stack2=new GenericStack<>();
for (int i=0; i < 100; i++) {
stack2.push(i + 1);
}
System.out.print("Stack 1: ");
while (!stack1.isEmpty()) {
System.out.print(stack1.pop() + " ");
}
System.out.println("\n");
System.out.println("Stack 2: ");
for (int i=1; !stack2.isEmpty(); i++) {
if (i % 10 == 0) System.out.println(stack2.pop());
else System.out.print(stack2.pop() + " ");
}
System.out.println();
}
| Main method |
public Quaternionf fromAxisAngleDeg(float axisX,float axisY,float axisZ,float angle){
return fromAxisAngleRad(axisX,axisY,axisZ,(float)Math.toRadians(angle));
}
| Set this quaternion to be a representation of the supplied axis and angle (in degrees). |
public static String stringFor(int m){
switch (m) {
case cudaReadModeElementType:
return "cudaReadModeElementType";
case cudaReadModeNormalizedFloat:
return "cudaReadModeNormalizedFloat";
}
return "INVALID cudaTextureReadMode: " + m;
}
| Returns the String identifying the given cudaTextureReadMode |
protected PLPosition convertPitchAndYawToPosition(float pitch,float yaw){
float r=this.getZ(), pr=(90.0f - pitch) * PLConstants.kToRadians, yr=-yaw * PLConstants.kToRadians;
float x=r * (float)Math.sin(pr) * (float)Math.cos(yr);
float y=r * (float)Math.sin(pr) * (float)Math.sin(yr);
float z=r * (float)Math.cos(pr);
return PLPosition.PLPositionMake(y,z,x);
}
| calculate methods |
public static void copyResourceFromClass(Class clazz,String file,File toFile) throws IOException {
try (InputStream ins=clazz.getResourceAsStream(clazz.getSimpleName() + "/" + file)){
if (ins == null) {
throw new IllegalStateException("Resource file " + file + " not found");
}
FileUtils.copyInputStreamToFile(ins,toFile);
}
}
| Unused and replaced with resources dir. |
private void registerReflectiveClass(CtClass clazz){
CtField[] fs=clazz.getDeclaredFields();
for (int i=0; i < fs.length; ++i) {
CtField f=fs[i];
int mod=f.getModifiers();
if ((mod & Modifier.PUBLIC) != 0 && (mod & Modifier.FINAL) == 0) {
String name=f.getName();
converter.replaceFieldRead(f,clazz,readPrefix + name);
converter.replaceFieldWrite(f,clazz,writePrefix + name);
}
}
}
| Registers a reflective class. The field accesses to the instances of this class are instrumented. |
@Override public boolean hasNext(){
if (null != this.buffer) {
return true;
}
else if (null != this.error) {
return false;
}
else {
try {
this.buffer=this.reader.readLine();
}
catch ( IOException e) {
this.buffer=null;
this.error=e;
return false;
}
return (null != this.buffer);
}
}
| Returns <code>true</code> if the iteration has more elements. (In other words, returns <code>true</code> if <code>next</code> would return an element rather than throwing an exception.) |
protected SVGOMFontFaceUriElement(){
}
| Creates a new SVGOMFontFaceUriElement object. |
public void invalidate(){
}
| Overridden for performance reasons. See the <a href="#override">Implementation Note</a> for more information. |
public static String unescapeChar(String parseStr){
switch (parseStr) {
case "\\001":
return "\001";
case "\\t":
return "\t";
case "\\r":
return "\r";
case "\\b":
return "\b";
case "\\f":
return "\f";
case "\\n":
return "\n";
default :
return parseStr;
}
}
| From beeline if a delimeter is passed as \001, in code we get it as escaped string as \\001. So this method will unescape the slash again and convert it back t0 \001 |
@Override synchronized public void invalidate(){
if (this == nullSession) {
return;
}
invalidated=true;
if (debug != null && Debug.isOn("session")) {
System.out.println("%% Invalidated: " + this);
}
if (context != null) {
context.remove(sessionId);
context=null;
}
}
| Invalidate a session. Active connections may still exist, but no connections will be able to rejoin this session. |
private void publishRemoteDownloadLeader(String leader){
if (leader != null) {
_svc.setAttribute(REMOTE_DOWNLOAD_LEADER,leader);
}
else {
_svc.setAttribute(REMOTE_DOWNLOAD_LEADER,"");
}
try {
_log.info("Publishing leader: {}",leader);
_beacon.publish();
}
catch ( Exception ex) {
_log.error("Failed to publish the leader",ex);
}
}
| The method to publish/store the identification of the node which holds the non-persistent lock. When the node releases the lock, it still needs to call this method with "null" argument to clear/reset the lock owner status |
public Frame<V> init(final Frame<? extends V> src){
returnValue=src.returnValue;
System.arraycopy(src.values,0,values,0,values.length);
top=src.top;
return this;
}
| Copies the state of the given frame into this frame. |
public LineNumberList(RTextArea textArea){
this(textArea,Color.GRAY);
}
| Constructs a new <code>LineNumberList</code> using default values for line number color (gray) and highlighting the current line. |
public void initAllDayHeights(){
if (mMaxAlldayEvents <= mMaxUnexpandedAlldayEventCount) {
return;
}
if (mShowAllAllDayEvents) {
int maxADHeight=mViewHeight - DAY_HEADER_HEIGHT - MIN_HOURS_HEIGHT;
maxADHeight=Math.min(maxADHeight,(int)(mMaxAlldayEvents * MIN_UNEXPANDED_ALLDAY_EVENT_HEIGHT));
mAnimateDayEventHeight=maxADHeight / mMaxAlldayEvents;
}
else {
mAnimateDayEventHeight=(int)MIN_UNEXPANDED_ALLDAY_EVENT_HEIGHT;
}
}
| Figures out the initial heights for allDay events and space when a view is being set up. |
public static String encode(byte[] binaryData){
if (binaryData == null) return null;
int lengthDataBits=binaryData.length * EIGHTBIT;
if (lengthDataBits == 0) {
return "";
}
int fewerThan24bits=lengthDataBits % TWENTYFOURBITGROUP;
int numberTriplets=lengthDataBits / TWENTYFOURBITGROUP;
int numberQuartet=fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
char encodedData[]=null;
encodedData=new char[numberQuartet * 4];
byte k=0, l=0, b1=0, b2=0, b3=0;
int encodedIndex=0;
int dataIndex=0;
if (fDebug) {
System.out.println("number of triplets = " + numberTriplets);
}
for (int i=0; i < numberTriplets; i++) {
b1=binaryData[dataIndex++];
b2=binaryData[dataIndex++];
b3=binaryData[dataIndex++];
if (fDebug) {
System.out.println("b1= " + b1 + ", b2= "+ b2+ ", b3= "+ b3);
}
l=(byte)(b2 & 0x0f);
k=(byte)(b1 & 0x03);
byte val1=((b1 & SIGN) == 0) ? (byte)(b1 >> 2) : (byte)((b1) >> 2 ^ 0xc0);
byte val2=((b2 & SIGN) == 0) ? (byte)(b2 >> 4) : (byte)((b2) >> 4 ^ 0xf0);
byte val3=((b3 & SIGN) == 0) ? (byte)(b3 >> 6) : (byte)((b3) >> 6 ^ 0xfc);
if (fDebug) {
System.out.println("val2 = " + val2);
System.out.println("k4 = " + (k << 4));
System.out.println("vak = " + (val2 | (k << 4)));
}
encodedData[encodedIndex++]=lookUpBase64Alphabet[val1];
encodedData[encodedIndex++]=lookUpBase64Alphabet[val2 | (k << 4)];
encodedData[encodedIndex++]=lookUpBase64Alphabet[(l << 2) | val3];
encodedData[encodedIndex++]=lookUpBase64Alphabet[b3 & 0x3f];
}
if (fewerThan24bits == EIGHTBIT) {
b1=binaryData[dataIndex];
k=(byte)(b1 & 0x03);
if (fDebug) {
System.out.println("b1=" + b1);
System.out.println("b1<<2 = " + (b1 >> 2));
}
byte val1=((b1 & SIGN) == 0) ? (byte)(b1 >> 2) : (byte)((b1) >> 2 ^ 0xc0);
encodedData[encodedIndex++]=lookUpBase64Alphabet[val1];
encodedData[encodedIndex++]=lookUpBase64Alphabet[k << 4];
encodedData[encodedIndex++]=PAD;
encodedData[encodedIndex++]=PAD;
}
else if (fewerThan24bits == SIXTEENBIT) {
b1=binaryData[dataIndex];
b2=binaryData[dataIndex + 1];
l=(byte)(b2 & 0x0f);
k=(byte)(b1 & 0x03);
byte val1=((b1 & SIGN) == 0) ? (byte)(b1 >> 2) : (byte)((b1) >> 2 ^ 0xc0);
byte val2=((b2 & SIGN) == 0) ? (byte)(b2 >> 4) : (byte)((b2) >> 4 ^ 0xf0);
encodedData[encodedIndex++]=lookUpBase64Alphabet[val1];
encodedData[encodedIndex++]=lookUpBase64Alphabet[val2 | (k << 4)];
encodedData[encodedIndex++]=lookUpBase64Alphabet[l << 2];
encodedData[encodedIndex++]=PAD;
}
return new String(encodedData);
}
| Encodes hex octects into Base64 |
public final View startVideoConsumerPreview(){
if (mVideoConsumer != null) {
return mVideoConsumer.startPreview(mContext);
}
return null;
}
| Starts the video consumer. A video consumer view used to display the video stream sent from the remote party. It's up to you to embed this view into a layout (LinearLayout, RelativeLayou, FrameLayout, ...) in order to display it. |
public void readFromNBT(NBTTagCompound compound){
if (compound != null) {
this.state=MatterNetworkTaskState.get(compound.getInteger("State"));
this.id=compound.getLong("id");
}
}
| Read the NBT data of the task. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public static void loadDataObjectConfiguration(List<DataObjectFieldConfiguration> configuration){
for ( DataObjectFieldConfiguration fieldConfig : configuration) {
DataObjectType doType=getDoType(fieldConfig.getDoClass());
ColumnField field=doType.getColumnField(fieldConfig.getFieldName());
if (field == null) {
throw new IllegalArgumentException(String.format("Unknown field: %1$s",fieldConfig.getFieldName()));
}
field.setTtl(fieldConfig.getTtl());
}
}
| User may optionally override default data object configuration (like TTL) by calling this method. Note that configuration must be loaded before DbClient is used |
@Override public void validateVarrayStoragePorts(Set<URI> storageSystemURIs,VirtualArray varray,List<URI> allHosts) throws InternalException {
try {
Map<Network,Set<StoragePort>> networkToPortsMap=getVirtualArrayTaggedPortsByNework(varray.getId());
Map<URI,Set<URI>> vplexCluster1ports=new HashMap<URI,Set<URI>>();
Map<URI,Set<URI>> vplexCluster2ports=new HashMap<URI,Set<URI>>();
Map<URI,StorageSystem> storageSystems=new HashMap<URI,StorageSystem>();
for ( URI uri : storageSystemURIs) {
StorageSystem storageSystem=_dbClient.queryObject(StorageSystem.class,uri);
URIQueryResultList storagePortURIs=new URIQueryResultList();
_dbClient.queryByConstraint(ContainmentConstraint.Factory.getStorageDeviceStoragePortConstraint(storageSystem.getId()),storagePortURIs);
final String cluster1="1";
final String cluster2="2";
Set<URI> cluster1StoragePorts=new HashSet<URI>();
Set<URI> cluster2StoragePorts=new HashSet<URI>();
Iterator<URI> storagePortsIter=storagePortURIs.iterator();
while (storagePortsIter.hasNext()) {
URI storagePortURI=storagePortsIter.next();
StoragePort storagePort=_dbClient.queryObject(StoragePort.class,storagePortURI);
if (storagePort != null && !storagePort.getInactive() && storagePort.getRegistrationStatus().equals(DiscoveredDataObject.RegistrationStatus.REGISTERED.name()) && !storagePort.getDiscoveryStatus().equalsIgnoreCase(DiscoveryStatus.NOTVISIBLE.name())) {
if (storagePort.getPortGroup() != null) {
String[] tokens=storagePort.getPortGroup().split("-");
if (cluster1.equals(tokens[1])) {
cluster1StoragePorts.add(storagePort.getId());
}
else if (cluster2.equals(tokens[1])) {
cluster2StoragePorts.add(storagePort.getId());
}
else {
_log.warn("Could not determine cluster for storageport:" + storagePort.getPortNetworkId() + " "+ storagePort.getId()+ " Port group is:"+ storagePort.getPortGroup());
}
}
else {
_log.warn("Could not determine cluster for storageport:" + storagePort.getPortNetworkId() + " "+ storagePort.getId());
}
}
}
vplexCluster1ports.put(uri,cluster1StoragePorts);
vplexCluster2ports.put(uri,cluster2StoragePorts);
storageSystems.put(uri,storageSystem);
}
for ( URI hostUri : allHosts) {
Map<URI,StoragePort> networkStoragePortsForHost=getNetworkTaggedPortsForHost(hostUri,networkToPortsMap);
for ( URI uri : storageSystemURIs) {
Set<URI> intersection1=new HashSet<URI>(networkStoragePortsForHost.keySet());
Set<URI> intersection2=new HashSet<URI>(networkStoragePortsForHost.keySet());
intersection1.retainAll(vplexCluster1ports.get(uri));
intersection2.retainAll(vplexCluster2ports.get(uri));
if (!intersection1.isEmpty() && !intersection2.isEmpty()) {
Map<URI,String> cluster1Ports=new HashMap<URI,String>();
Map<URI,String> cluster2Ports=new HashMap<URI,String>();
for ( URI uriIntersection1 : intersection1) {
if (networkStoragePortsForHost.get(uriIntersection1) != null) {
cluster1Ports.put(uriIntersection1,networkStoragePortsForHost.get(uriIntersection1).getPortNetworkId());
}
}
for ( URI uriIntersection2 : intersection2) {
if (networkStoragePortsForHost.get(uriIntersection2) != null) {
cluster2Ports.put(uriIntersection2,networkStoragePortsForHost.get(uriIntersection2).getPortNetworkId());
}
}
Host host=_dbClient.queryObject(Host.class,hostUri);
_log.error("Varray " + varray.getLabel() + " has storageports from Cluster 1 and Cluster 2 of the Vplex "+ storageSystems.get(uri).getLabel()+ " "+ storageSystems.get(uri).getId().toString()+ ". This is detected for the host "+ host.getHostName()+ "\n Cluster 1 storageports in varray are"+ cluster1Ports+ "\n Cluster 2 storageports in varray are"+ cluster2Ports);
throw APIException.badRequests.invalidVarrayNetworkConfiguration(varray.getLabel(),storageSystems.get(uri).getLabel());
}
}
}
_log.info("Done validating vplex cluster 1 and 2 ports for the Varray:" + varray.getLabel());
}
catch ( InternalException ex) {
_log.error(ex.getLocalizedMessage());
throw (ex);
}
}
| Validate varray ports during Export Group Create. If varray contains ports from both Vplex Cluster 1 and Cluster 2 thats an invalid network configuration. It could be one or more network within a varray. If initiators of a host are in two networks then vplex storage ports from both networks are taken into account to check if ports belong to both Vplex Cluster 1 and Cluster 2. |
private void putObject(String bucketName,String objectName,String contentType,long size,Object data) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException, InvalidArgumentException, InsufficientDataException {
if (size <= MIN_MULTIPART_SIZE) {
putObject(bucketName,objectName,(int)size,data,null,contentType,0);
return;
}
int[] rv=calculateMultipartSize(size);
int partSize=rv[0];
int partCount=rv[1];
int lastPartSize=rv[2];
Part[] totalParts=new Part[partCount];
String uploadId=getLatestIncompleteUploadId(bucketName,objectName);
Iterator<Result<Part>> existingParts=null;
Part part=null;
if (uploadId != null) {
existingParts=listObjectParts(bucketName,objectName,uploadId).iterator();
if (existingParts.hasNext()) {
part=existingParts.next().get();
}
}
else {
uploadId=initMultipartUpload(bucketName,objectName,contentType);
}
int expectedReadSize=partSize;
for (int partNumber=1; partNumber <= partCount; partNumber++) {
if (partNumber == partCount) {
expectedReadSize=lastPartSize;
}
if (part != null && partNumber == part.partNumber() && expectedReadSize == part.partSize()) {
String md5Hash=Digest.md5Hash(data,expectedReadSize);
if (md5Hash.equals(part.etag())) {
totalParts[partNumber - 1]=new Part(part.partNumber(),part.etag());
skipStream(data,expectedReadSize);
part=getPart(existingParts);
continue;
}
}
String etag=putObject(bucketName,objectName,expectedReadSize,data,uploadId,null,partNumber);
totalParts[partNumber - 1]=new Part(partNumber,etag);
}
completeMultipart(bucketName,objectName,uploadId,totalParts);
}
| Executes put object. If size of object data is <= 5MiB, single put object is used else multipart put object is used. This method also resumes if previous multipart put is found. |
private static boolean dataSetsAreOk(){
if (fileList1 != null && fileList2 != null && (fileList1.length == fileList2.length)) {
for ( File file1 : fileList1) {
String fileName1=file1.getName();
boolean foundRelatedFile=false;
for ( File file2 : fileList2) {
String fileName2=file2.getName();
if (fileName1.equalsIgnoreCase(fileName2)) {
foundRelatedFile=true;
break;
}
}
if (!foundRelatedFile) {
System.err.println("Didn't found related file for : " + fileName1);
return false;
}
}
return true;
}
System.err.println("Number of datasets not equal or fileList variables is null.");
return false;
}
| checks the correct number of data sets in each folder (number of data sets should be equal) and the data set names (every data set needs to be in both folders). |
public static boolean isFullCopyInactive(Volume volume,DbClient dbClient){
boolean result=true;
String replicaState=volume.getReplicaState();
if (isVolumeFullCopy(volume,dbClient) && replicaState != null && !replicaState.isEmpty()) {
ReplicationState state=ReplicationState.getEnumValue(replicaState);
if (state != null && state != ReplicationState.INACTIVE) {
result=false;
}
}
return result;
}
| Check if the full copy is inactive. |
public boolean doAccessibleAction(int i){
if (i == 0) {
doClick();
return true;
}
else {
return false;
}
}
| Perform the specified Action on the object |
static Object[] packageParameterFromVarArg(MethodReference targetMethod,Address argAddress){
TypeReference[] argTypes=targetMethod.getParameterTypes();
int argCount=argTypes.length;
Object[] argObjectArray=new Object[argCount];
JNIEnvironment env=RVMThread.getCurrentThread().getJNIEnv();
Address addr=argAddress;
for (int i=0; i < argCount; i++) {
long hiword=VM.BuildFor64Addr ? addr.loadLong() : (long)addr.loadInt();
addr=addr.plus(BYTES_IN_ADDRESS);
if (argTypes[i].isFloatType()) {
if (VM.BuildFor32Addr) {
int loword=addr.loadInt();
addr=addr.plus(BYTES_IN_ADDRESS);
long doubleBits=(hiword << BITS_IN_INT) | (loword & 0xFFFFFFFFL);
argObjectArray[i]=Reflection.wrapFloat((float)(Double.longBitsToDouble(doubleBits)));
}
else {
argObjectArray[i]=Reflection.wrapFloat((float)(Double.longBitsToDouble(hiword)));
}
}
else if (argTypes[i].isDoubleType()) {
if (VM.BuildFor32Addr) {
int loword=addr.loadInt();
addr=addr.plus(BYTES_IN_ADDRESS);
long doubleBits=(hiword << BITS_IN_INT) | (loword & 0xFFFFFFFFL);
argObjectArray[i]=Reflection.wrapDouble(Double.longBitsToDouble(doubleBits));
}
else {
argObjectArray[i]=Reflection.wrapDouble(Double.longBitsToDouble(hiword));
}
}
else if (argTypes[i].isLongType()) {
if (VM.BuildFor32Addr) {
int loword=addr.loadInt();
addr=addr.plus(BYTES_IN_ADDRESS);
long longValue=(hiword << BITS_IN_INT) | (loword & 0xFFFFFFFFL);
argObjectArray[i]=Reflection.wrapLong(longValue);
}
else {
argObjectArray[i]=Reflection.wrapLong(hiword);
}
}
else if (argTypes[i].isBooleanType()) {
argObjectArray[i]=Reflection.wrapBoolean((int)hiword);
}
else if (argTypes[i].isByteType()) {
argObjectArray[i]=Reflection.wrapByte((byte)hiword);
}
else if (argTypes[i].isCharType()) {
argObjectArray[i]=Reflection.wrapChar((char)hiword);
}
else if (argTypes[i].isShortType()) {
argObjectArray[i]=Reflection.wrapShort((short)hiword);
}
else if (argTypes[i].isReferenceType()) {
argObjectArray[i]=env.getJNIRef((int)hiword);
}
else if (argTypes[i].isIntType()) {
argObjectArray[i]=Reflection.wrapInt((int)hiword);
}
else {
return null;
}
}
return argObjectArray;
}
| Repackage the arguments passed as a variable argument list into an array of Object, used by the JNI functions CallStatic<type>MethodV |
@Override protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.messenger_service_binding);
Button button=(Button)findViewById(R.id.bind);
button.setOnClickListener(mBindListener);
button=(Button)findViewById(R.id.unbind);
button.setOnClickListener(mUnbindListener);
mCallbackText=(TextView)findViewById(R.id.callback);
mCallbackText.setText("Not attached.");
}
| Standard initialization of this activity. Set up the UI, then wait for the user to poke it before doing anything. |
public static int calcRLen(int diff){
return (int)Math.round(1.5 * Math.log(rand.nextInt(diff + 1) + 1) + rand.nextInt(1));
}
| Calculate length of randomly generated char sequence. |
public DataSourceCreateException(){
super();
}
| Creates a new instance of CreateConnectionException |
public void enableLight(boolean enabled){
light.setEnabled(enabled);
lightEnabled=enabled;
headlight.setEnabled(headlightEnabled && enabled);
}
| Make the lights visible |
public static TimePeriodExpression timePeriod(Object days,Object hours,Object minutes,Object seconds,Object milliseconds){
Expression daysExpr=convertVariableNumeric(days);
Expression hoursExpr=convertVariableNumeric(hours);
Expression minutesExpr=convertVariableNumeric(minutes);
Expression secondsExpr=convertVariableNumeric(seconds);
Expression millisecondsExpr=convertVariableNumeric(milliseconds);
return new TimePeriodExpression(daysExpr,hoursExpr,minutesExpr,secondsExpr,millisecondsExpr);
}
| Returns a time period expression for the specified parts. <p> Each part can be a null value in which case the part is left out. <p> Each object value may be a String value for an event property, or a number for a constant. |
private void crossover(int[] individual1,int[] individual2){
switch (crossoverType) {
case CROSSOVER_ONE_POINT:
int n=1 + random.nextInt(individual1.length - 1);
for (int i=n; i < individual1.length; i++) {
int dummy=individual1[i];
individual1[i]=individual2[i];
individual2[i]=dummy;
}
break;
case CROSSOVER_UNIFORM:
for (int i=0; i < individual1.length; i++) {
if (random.nextBoolean()) {
int dummy=individual1[i];
individual1[i]=individual2[i];
individual2[i]=dummy;
}
}
break;
default :
break;
}
}
| Changes the individual. Make clones if original individuals should be kept. |
public static String[] toStringArray(int[] array){
if (array == null) {
return null;
}
String[] result=new String[array.length];
for (int i=0; i < array.length; i++) {
result[i]=String.valueOf(array[i]);
}
return result;
}
| Converts an array to string array. |
public void incrementAccessCount(){
if (isPrimitive()) {
return;
}
if ((this.accessDate != null) && ((System.currentTimeMillis() - this.accessDate.getTime()) < (24 * Utils.HOUR))) {
return;
}
setAccessDate(new Date());
setAccessCount(this.accessCount + 1);
}
| Record that the vertex was accessed, update the access time and increment the access count. |
public static void processSource(Context cx,String filename){
if (filename == null || filename.equals("-")) {
PrintStream ps=global.getErr();
if (filename == null) {
ps.println(cx.getImplementationVersion());
}
String charEnc=shellContextFactory.getCharacterEncoding();
if (charEnc == null) {
charEnc=System.getProperty("file.encoding");
}
BufferedReader in;
try {
in=new BufferedReader(new InputStreamReader(global.getIn(),charEnc));
}
catch ( UnsupportedEncodingException e) {
throw new UndeclaredThrowableException(e);
}
int lineno=1;
boolean hitEOF=false;
while (!hitEOF) {
String[] prompts=global.getPrompts(cx);
if (filename == null) ps.print(prompts[0]);
ps.flush();
String source="";
while (true) {
String newline;
try {
newline=in.readLine();
}
catch ( IOException ioe) {
ps.println(ioe.toString());
break;
}
if (newline == null) {
hitEOF=true;
break;
}
source=source + newline + "\n";
lineno++;
if (cx.stringIsCompilableUnit(source)) break;
ps.print(prompts[1]);
}
Script script=loadScriptFromSource(cx,source,"<stdin>",lineno,null);
if (script != null) {
Object result=evaluateScript(script,cx,global);
if (result != Context.getUndefinedValue() && !(result instanceof Function && source.trim().startsWith("function"))) {
try {
ps.println(Context.toString(result));
}
catch ( RhinoException rex) {
ToolErrorReporter.reportException(cx.getErrorReporter(),rex);
}
}
NativeArray h=global.history;
h.put((int)h.getLength(),h,source);
}
}
ps.println();
}
else if (filename.equals(mainModule)) {
try {
require.requireMain(cx,filename);
}
catch ( RhinoException rex) {
ToolErrorReporter.reportException(cx.getErrorReporter(),rex);
exitCode=EXITCODE_RUNTIME_ERROR;
}
catch ( VirtualMachineError ex) {
ex.printStackTrace();
String msg=ToolErrorReporter.getMessage("msg.uncaughtJSException",ex.toString());
exitCode=EXITCODE_RUNTIME_ERROR;
Context.reportError(msg);
}
}
else {
processFile(cx,global,filename);
}
}
| Evaluate JavaScript source. |
public void initDDLFields(){
scale=0;
length=0;
precision=0;
isUnique=false;
isNullable=true;
isUpdatable=true;
isInsertable=true;
isCreatable=true;
isPrimaryKey=false;
columnDefinition="";
}
| Inits the DDL generation fields with our defaults. Note: we used to initialize the length to the JPA default of 255 but since this default value should only apply for string fields we set it to 0 to indicate that it was not specified and rely on the default (255) to come from individual platforms. |
private void browseGroup(Group group){
if (group.getPaths() != null) {
for (int i=0; i < group.getPaths().size(); i++) {
if (group.getPaths().get(i).getMorphingName() != null) {
morphPathNameFound=true;
pathToMorphSortByMorphingName.put(group.getPaths().get(i).getMorphingName(),group.getPaths().get(i));
}
}
}
if (group.getGroups() != null) {
for (int i=0; i < group.getGroups().size(); i++) {
browseGroup(group.getGroups().get(i));
}
}
}
| Recursive browse of the Group to find path with name |
@NotNull @ObjectiveCName("build") public Configuration build(){
if (endpoints.size() == 0) {
throw new RuntimeException("Endpoints not set");
}
if (phoneBookProvider == null) {
throw new RuntimeException("Phonebook Provider not set");
}
if (apiConfiguration == null) {
throw new RuntimeException("Api Configuration not set");
}
if (deviceCategory == null) {
throw new RuntimeException("Device Category not set");
}
if (platformType == null) {
throw new RuntimeException("App Category not set");
}
if (trustedKeys.size() == 0) {
Log.w("ConfigurationBuilder","No Trusted keys set. Using anonymous server authentication.");
}
return new Configuration(endpoints.toArray(new ConnectionEndpoint[endpoints.size()]),phoneBookProvider,notificationProvider,apiConfiguration,enableContactsLogging,enableNetworkLogging,enableFilesLogging,deviceCategory,platformType,minDelay,maxDelay,maxFailureCount,timeZone,preferredLanguages.toArray(new String[preferredLanguages.size()]),customAppName,trustedKeys.toArray(new TrustedKey[trustedKeys.size()]),isPhoneBookImportEnabled,isOnClientPrivacyEnabled,callsProvider,rawUpdatesHandler,voiceCallsEnabled,videoCallsEnabled,isEnabledGroupedChatList,autoJoinGroups.toArray(new String[autoJoinGroups.size()]),autoJoinType);
}
| Build configuration |
@Override public void write(byte[] b){
checkNotNull(b);
}
| Discards the specified byte array. |
public int equivHashCode(){
return name.hashCode() * 101 + type.hashCode() * 17;
}
| Returns a hash code for this object, consistent with structural equality. |
public CellRenderers(int size){
cellRenderers=new ArrayList<List<TableCellRenderer>>(size);
for (int i=0; i < size; i++) {
cellRenderers.add(new ArrayList<TableCellRenderer>());
}
}
| Creates a new cell renderer collection. |
public void render(DrawContext dc){
if (dc == null) {
String msg=Logging.getMessage("nullValue.DrawContextIsNull");
Logging.logger().severe(msg);
throw new IllegalArgumentException(msg);
}
GL2 gl=dc.getGL().getGL2();
gl.glPushAttrib(GL2.GL_ENABLE_BIT | GL2.GL_CURRENT_BIT);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glPushMatrix();
gl.glTranslated(this.center.x,this.center.y,this.center.z);
GLUquadric quadric=dc.getGLU().gluNewQuadric();
dc.getGLU().gluQuadricDrawStyle(quadric,GLU.GLU_LINE);
dc.getGLU().gluSphere(quadric,this.radius,10,10);
gl.glPopMatrix();
dc.getGLU().gluDeleteQuadric(quadric);
gl.glPopAttrib();
}
| Causes this <code>Sphere</code> to render itself using the <code>DrawContext</code> provided. <code>dc</code> may not be null. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.