code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
@SideOnly(Side.CLIENT) public static void drawQuad(final float x,final float y,final float w,final float h,final float u0,final float v0,final float u1,final float v1){
final Tessellator tessellator=Tessellator.getInstance();
final WorldRenderer worldRenderer=tessellator.getWorldRenderer();
worldRenderer.begin(GL... | Draw an arbitrarily sized quad with the specified texture coordinates. |
protected void handleGenericBridges(BridgeContext ctx,Element e){
for (Node n=e.getFirstChild(); n != null; n=n.getNextSibling()) {
if (n instanceof Element) {
Element e2=(Element)n;
Bridge b=ctx.getBridge(e2);
if (b instanceof GenericBridge) {
((GenericBridge)b).handleElement(ctx,e2);
... | Handles any GenericBridge elements which are children of the specified element. |
public static void main(String[] args) throws IOException {
boolean enableOutput=true;
boolean outputToFile=false;
String inputFolder=LrRs.class.getClassLoader().getResource("workload/planetlab").getPath();
String outputFolder="output";
String workload="20110303";
String vmAllocationPolicy="lr";
String vm... | The main method. |
public final ASTNode createMoveTarget(ASTNode first,ASTNode last,ASTNode replacingNode,TextEditGroup editGroup){
if (first == last) {
replace(first,replacingNode,editGroup);
return this.rewriter.createMoveTarget(first);
}
else {
return createTargetNode(first,last,true,replacingNode,editGroup);
}
}
| Creates and returns a placeholder node for a move of a range of nodes of the current list. The moved nodes can optionally be replaced by a specified node. <p/> The placeholder node can either be inserted as new or used to replace an existing node. When the document is rewritten, a copy of the source code for the given ... |
protected void flowThrough(Object inValue,Unit unit,List outFallValues,List outBranchValues){
final LocalTypeSet in=(LocalTypeSet)inValue;
final LocalTypeSet out=(LocalTypeSet)in.clone();
LocalTypeSet outBranch=out;
final Stmt stmt=(Stmt)unit;
for (Iterator bIt=stmt.getDefBoxes().iterator(); bIt.hasNext(); ) ... | This is the flow function as described in the assignment write-up. |
public static int cleanSuspendedTransactions() throws GenericTransactionException {
Transaction trans=null;
int num=0;
while ((trans=popSuspendedTransaction()) != null) {
resume(trans);
rollback();
num++;
}
clearTransactionStartStampStack();
return num;
}
| BE VERY CAREFUL WHERE YOU CALL THIS!! |
public boolean isVisibleInCatalogChecked(){
return isVisibleInCatalog();
}
| Value for helper checkbox on page. <p> The real value will be exchanged within a hidden field for supporting a dynamically disabling. |
public boolean removeAll(Collection c){
throw new UnsupportedOperationException();
}
| <b>Not supported</b> - Throws <tt>UnsupportedOperationException</tt> exception. |
protected void handleResize(double newratio){
if (currentSubplot == null) {
ResultWindow.this.overview.setRatio(newratio);
}
}
| Handle a resize event. |
private Map<String,String> readInPantherFamilyNames(Resource modelFile) throws IOException {
Map<String,String> result=null;
File globalsDir=new File(modelFile.getFile().getPath() + "/globals");
if (globalsDir.exists()) {
File namesTabFile=new File(globalsDir.getPath() + "/" + namesTabFileStr);
result=par... | Handles parsing process of the specified file resource. |
@Override public boolean equals(Object o){
return (compareTo((String)o) == 0);
}
| whether the given version string is equal to this version |
protected static final Map<String,String> newKeyValues(String key,String value){
Map<String,String> keyValues=new HashMap<String,String>(1);
keyValues.put(nonNull(key),nonNull(value));
return keyValues;
}
| Creates a map with just one key-value pair. |
public SolrQuery addFacetPivotField(String... fields){
add(FacetParams.FACET_PIVOT,fields);
this.set(FacetParams.FACET,true);
return this;
}
| Add field(s) for pivot computation. pivot fields are comma separated |
private void memoryForGEUpdated(){
if (useTextureCache) {
TextureCache.getInstance().resetTextureAlreadyHashed();
}
if (useVertexCache) {
VertexCache.getInstance().resetVertexAlreadyChecked();
}
VertexBufferManager.getInstance().resetAddressAlreadyChecked();
}
| The memory used by GE has been updated or changed. Update the caches so that they see these changes. |
private void testLobStaysOpenUntilCommitted() throws Exception {
Connection conn=getConnection();
stat=conn.createStatement();
stat.execute("create table test(id identity, c clob, b blob)");
PreparedStatement prep=conn.prepareStatement("insert into test values(null, ?, ?)");
prep.setString(1,"");
prep.setBy... | According to the JDBC spec, BLOB and CLOB objects must stay open even if the result set is closed (see ResultSet.close). |
public static boolean isCounterClockwise(List<ReadOnlyVector3> points){
double area=computePolygonArea2D(points);
if (area < 0) {
return (false);
}
return (true);
}
| Determine if a set of points is listed in the counter clockwise direction on the XY plane. |
public static List<org.oscm.vo.VOPricedParameter> convertToApiVOPricedParameter(List<org.oscm.internal.vo.VOPricedParameter> oldVO){
if (oldVO == null) {
return null;
}
List<org.oscm.vo.VOPricedParameter> newVO=new ArrayList<org.oscm.vo.VOPricedParameter>();
for ( org.oscm.internal.vo.VOPricedParameter tmp... | Convert list of VOPricedParameter. |
public static Vec4 fromArray4(double[] array,int offset){
if (array == null) {
throw new IllegalArgumentException("Array Is Null");
}
return fromDoubleArray(array,offset,4);
}
| Constructs a new Vec4 with <code>x</code>, <code>y</code>, <code>z</code> and <code>w</code> values from the specified double array. The specified offset must be 0 or greater, and the array must have capacity equal to or greater than <code>offset + 4</code>. Coordinates are assigned as follows:<p><code>x = array[offset... |
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){
switch (featureID) {
case MappingPackage.STATUS_SOURCE__PROPERTY:
if (resolve) return getProperty();
return basicGetProperty();
}
return super.eGet(featureID,resolve,coreType);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public MaxCountExceededException(Number max){
this(LocalizedFormats.MAX_COUNT_EXCEEDED,max);
}
| Construct the exception. |
public static List<Integer> inorderTraversal(TreeNode root){
List<Integer> result=new ArrayList<Integer>();
Stack<TreeNode> s=new Stack<TreeNode>();
while (!s.isEmpty() || root != null) {
if (root != null) {
s.push(root);
root=root.left;
}
else {
root=s.pop();
result.add(root.val)... | Stack solution, O(n) Space Use a stack to store TreeNodes Go to left most and add each node Pop the node from stack, add its value, and try to go right Stop if stack is empty or node is null |
@Override protected void onProgressUpdate(Integer... values){
}
| Updates the progress bar |
private void mergeReleasedEntries(Segment segment,Segment compactSegment){
for (long i=segment.firstIndex(); i <= segment.lastIndex(); i++) {
if (!segment.isLive(i)) {
compactSegment.release(i);
}
}
}
| Updates the new compact segment with entries that were released from the given segment during compaction. |
public void cast(final Type from,final Type to){
if (from != to) {
if (from == Type.DOUBLE_TYPE) {
if (to == Type.FLOAT_TYPE) {
mv.visitInsn(Opcodes.D2F);
}
else if (to == Type.LONG_TYPE) {
mv.visitInsn(Opcodes.D2L);
}
else {
mv.visitInsn(Opcodes.D2I);
cas... | Generates the instructions to cast a numerical value from one type to another. |
public HostAddresses(DerValue encoding) throws Asn1Exception, IOException {
Vector<HostAddress> tempAddresses=new Vector<>();
DerValue der=null;
while (encoding.getData().available() > 0) {
der=encoding.getData().getDerValue();
tempAddresses.addElement(new HostAddress(der));
}
if (tempAddresses.size()... | Constructs a new <code>HostAddresses</code> object. |
@Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case RegularExpressionPackage.IDENTITY_ESCAPE_SEQUENCE__CHARACTER:
setCharacter((String)newValue);
return;
case RegularExpressionPackage.IDENTITY_ESCAPE_SEQUENCE__SEQUENCE:
setSequence((String)newValue);
return;
}
super.eSet(featureID... | <!-- begin-user-doc --> <!-- end-user-doc --> |
private Set<RoleAssignment> createRoleAssignment(PlatformUser user,UserRoleType roleType){
Set<RoleAssignment> roles=new HashSet<RoleAssignment>();
RoleAssignment ra=new RoleAssignment();
ra.setKey(1L);
ra.setUser(user);
ra.setRole(new UserRole(roleType));
roles.add(ra);
return roles;
}
| create roles for user |
public static void main(String[] args) throws Exception {
ICluster alice=Cluster.joinAwait();
alice.listenGossips().subscribe(null);
ICluster bob=Cluster.joinAwait(alice.address());
bob.listenGossips().subscribe(null);
ICluster carol=Cluster.joinAwait(alice.address());
carol.listenGossips().subscribe(null);... | Main method. |
public void subQuat(Quaternion input,Quaternion output){
output.setX(getX() - input.getX());
output.setY(getY() - input.getY());
output.setZ(getZ() - input.getZ());
output.setW(getW() - input.getW());
}
| Subtract another quaternion from this quaternion and store the result in the output quaternion |
public static void main(String[] options){
try {
Attribute length=new Attribute("length");
Attribute weight=new Attribute("weight");
ArrayList<String> my_nominal_values=new ArrayList<String>(3);
my_nominal_values.add("first");
my_nominal_values.add("second");
my_nominal_values.add("third");
... | Main method for testing this class. |
public ProcessorBasedRefactoring(RefactoringProcessor processor){
setProcessor(processor);
}
| Creates a new processor based refactoring. |
@Override public void testRunFinished(Result result){
LoggingUtils.getEvoLogger().info("* Number of test cases executed: " + result.getRunCount());
}
| Called when all tests have finished |
public Object runSafely(Catbert.FastStack stack) throws Exception {
return Sage.get("mmc/country",Sage.rez("default_country"));
}
| Gets the country that SageTV is configured for. This is used for determining the frequencies used for tuning television signals. |
public synchronized void createVersion(File file) throws IOException {
try (KeyTabOutputStream kos=new KeyTabOutputStream(new FileOutputStream(file))){
kos.write16(KRB5_KT_VNO);
}
}
| Creates key table file version. |
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:11.443 -0500",hash_original_method="50B637C031C7A89AA164A5082D6A3A93",hash_generated_method="B2AEC5AD9697F2A0503EB686601715D6") @Deprecated public NinePatchDrawable(NinePat... | Create drawable from existing nine-patch, not dealing with density. |
@Override public void execute(){
m_result=new TaskStatusInfo();
m_result.setStatusMessage("Running...");
String goodResult="(sub)experiment completed successfully";
String subTaskType;
if (m_experiment.getRunLower() != m_experiment.getRunUpper()) {
subTaskType="(dataset " + ((File)m_experiment.getDatasets... | Run the experiment |
public static ServiceErrorRestRep toServiceError(final Throwable e,final Locale locale){
if (e instanceof ServiceCoded) {
return toServiceErrorRestRep((ServiceCoded)e,locale);
}
else if (e instanceof WebApplicationException) {
return toServiceErrorRestRep((WebApplicationException)e,locale);
}
else i... | Convert the Exception to a ServiceError |
private void unregisterFsm(final String sessionId){
if (debugEnabled) {
LOGGER.debug("Unregistering FSM with '" + sessionId + "' session ID...");
}
cache.invalidate(sessionId);
checkState(!exists(sessionId),"Error while unregistering session with '" + sessionId + "' session ID.");
if (debugEnabled) {
... | Removes the FSM with the given session ID argument. Has no effect if no FSMs exist with the given session identifier. |
private void updateProgress(int progress){
if (myHost != null && progress != previousProgress) {
myHost.updateProgress(progress);
}
previousProgress=progress;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
public ReferenceBinding convertToParameterizedType(ReferenceBinding originalType){
if (originalType != null) {
boolean isGeneric=originalType.isGenericType();
ReferenceBinding originalEnclosingType=originalType.enclosingType();
ReferenceBinding convertedEnclosingType=originalEnclosingType;
boolean nee... | Convert a given source type into a parameterized form if generic. generic X<E> --> param X<E> |
public ReadInputRegistersResponse(){
super();
setFunctionCode(Modbus.READ_INPUT_REGISTERS);
}
| Constructs a new <tt>ReadInputRegistersResponse</tt> instance. |
public EllipticalOrbitAnimation3D(Vector3 focalPoint,Vector3 periapsis,double eccentricity,Axis axis,double angle){
this(focalPoint,periapsis,Vector3.getAxisVector(axis),eccentricity,angle);
}
| Defines an elliptical orbit around a point with no orbital inclination. |
private IgfsStringDelimiterRecordResolver resolver(String... delims){
return new IgfsStringDelimiterRecordResolver(UTF8,delims);
}
| Create resolver. |
public com.wipro.ats.bdre.imcrawler.mr.Contents.Builder clearBinary(){
binary=null;
fieldSetFlags()[8]=false;
return this;
}
| Clears the value of the 'binary' field |
private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
if (xmlWriter.getPrefix(namespace) == null) {
xmlWriter.writeNamespace(prefix,namespace);
x... | Util method to write an attribute with the ns prefix |
public List<CharsRef> uniqueStems(char word[],int length){
List<CharsRef> stems=stem(word,length);
if (stems.size() < 2) {
return stems;
}
CharArraySet terms=new CharArraySet(8,dictionary.ignoreCase);
List<CharsRef> deduped=new ArrayList<>();
for ( CharsRef s : stems) {
if (!terms.contains(s)) {
... | Find the unique stem(s) of the provided word |
@Deprecated public AccountHeaderBuilder withSelectionFistLineShown(boolean selectionFirstLineShown){
this.mSelectionFirstLineShown=selectionFirstLineShown;
return this;
}
| set this to false if you want to hide the first line of the selection box in the header (first line would be the name) |
void dispatchOnLauncherTransitionStep(View v,float t){
if (v instanceof LauncherTransitionable) {
((LauncherTransitionable)v).onLauncherTransitionStep(mLauncher,t);
}
}
| Dispatches the step-transition event to suitable views. |
protected void cleanup() throws CqException {
try {
if (this.cqBaseRegion != null && !this.cqBaseRegion.isDestroyed()) {
this.cqBaseRegion.getFilterProfile().closeCq(this);
CacheClientProxy clientProxy=ccn.getClientProxy(clientProxyId);
clientProxy.decCqCount();
if (clientProxy.hasNoCq()) ... | Clears the resource used by CQ. |
@Override public Enumeration<Option> listOptions(){
Vector<Option> result=new Vector<Option>();
result.add(new Option("\tFull name and options of the evaluator analyzed.\n" + "\teg: weka.attributeSelection.CfsSubsetEval","eval",1,"-eval name [options]"));
result.add(new Option("\tFull name and options of the sear... | Returns an enumeration describing the available options. |
@Override public void output(Vertex output){
}
| Post, process the post request. |
public void test_getInstanceLjava_lang_StringLjava_security_Provider03() throws Exception {
for ( String validValue : getValidValues()) {
TrustManagerFactory trustMF=TrustManagerFactory.getInstance(validValue,getDefaultProvider());
assertTrue("Not TrustManagerFactory object",trustMF instanceof TrustManagerFa... | Test for <code>getInstance(String algorithm, Provider provider)</code> method Assertion: returns instance of TrustManagerFactory |
public void tick(){
final long count=uncounted.getAndSet(0);
final double instantRate=count / interval;
if (initialized) {
rate+=(alpha * (instantRate - rate));
}
else {
rate=instantRate;
initialized=true;
}
}
| Mark the passage of time and decay the current rate accordingly. |
public boolean isIn(MessageUid value){
return lowValue.compareTo(value) <= 0 && highValue.compareTo(value) >= 0;
}
| Is the given value in this range? |
public Type basicGetType(){
return type;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static float colorToFloat(final Color clr){
return Color.RGBtoHSB(clr.getRed(),clr.getGreen(),clr.getBlue(),null)[0];
}
| Returns the Hue associated with a Color. |
public void init(TempCharBuffer head){
_top=head;
_head=head;
if (head != null) {
_buffer=head.buffer();
_length=head.getLength();
}
else _length=0;
_offset=0;
}
| Initialize the reader. |
public RequestHandle delete(Context context,String url,Header[] headers,RequestParams params,ResponseHandlerInterface responseHandler){
HttpDelete httpDelete=new HttpDelete(getUrlWithQueryString(isUrlEncodingEnabled,url,params));
if (headers != null) httpDelete.setHeaders(headers);
return sendRequest(httpClient... | Perform a HTTP DELETE request. |
public final void remove(DiskRegion dr,DiskEntry entry){
try {
basicRemove(dr,entry);
}
catch ( IOException ex) {
throw new DiskAccessException(LocalizedStrings.Oplog_FAILED_WRITING_KEY_TO_0.toLocalizedString(this.diskFile.getPath()),ex,dr.getName());
}
catch ( InterruptedException ie) {
Thread.cur... | Removes the key/value pair with the given id on disk. |
public boolean isNetworkConnected(){
ConnectivityManager connectivityManager=(ConnectivityManager)getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo networkInfo=connectivityManager.getActiveNetworkInfo();
return networkInfo != null && networkInfo.isConnectedOrConnecting();
}
| Check the current active network is available. |
public NamedMediaType(MediaType mt){
if (mt == null) throw new NullPointerException("Null media type.");
this._mediaType=mt;
this._name=constructName(_mediaType);
this._icon=getIcon(_mediaType);
}
| Constructs a new NamedMediaType, associating the MediaType with the LimeXMLSchema. |
public synchronized void add(double value){
add(mCategories.size() + "",value);
}
| Adds a new value to the series. |
public Boolean isRepeat(){
return repeat;
}
| Gets the value of the repeat property. |
private boolean shouldIconBeShown(){
SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(getActivity());
String key=getString(R.string.show_bottom_sheet_icon_preference_key);
boolean defaultValue=getResources().getBoolean(R.bool.show_bottom_sheet_icon_preference_default_value);
ret... | Returns, whether the icon of bottom sheets should be shown, depending on the app's settings, or not. |
public void incrByFloat(String key,double doubleValue){
if (isInTransaction()) {
transaction.incrByFloat(key,doubleValue);
if (keyExpiryTime != -1) {
transaction.expire(key,keyExpiryTime);
}
}
else {
jedis.incrByFloat(key,doubleValue);
if (keyExpiryTime != -1) {
jedis.expire(key,key... | Calls incrbyfloat on the redis store. |
public void open(){
MigrateLogger_Formatter traceFormatter=new MigrateLogger_Formatter(true);
MigrateLogger_Formatter warningFormatter=new MigrateLogger_Formatter(false);
MigrateLogger_Formatter errorFormatter=new MigrateLogger_Formatter(false);
FileHandler traceLog=null;
FileHandler warningLog=null;
FileHa... | create logger's handlers and files |
public static void removeIncompleteUploads_test() throws Exception {
println("Test: removeIncompleteUpload(String bucketName, String objectName)");
String fileName=createFile(6 * MB);
InputStream is=Files.newInputStream(Paths.get(fileName));
try {
client.putObject(bucketName,fileName,is,9 * 1024 * 1024,null... | Test: removeIncompleteUpload(String bucketName, String objectName). |
public void sendData(byte[][] data,String targetHostName,int targetPort,long interval){
sendData(data,0,data.length,targetHostName,targetPort,interval);
}
| send the data by UDP |
public static int hash(int seed,byte[] byteArray){
if (byteArray == null) {
return 0;
}
for ( byte aByte : byteArray) {
seed=hash(seed,aByte);
}
return seed;
}
| Calculates hash code for byte array. |
protected OrdinalOp_Impl(){
super();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public void error(XPathContext xctxt,String msg,Object args[]) throws javax.xml.transform.TransformerException {
String formattedMsg=XSLMessages.createMessage(msg,args);
ErrorListener errHandler=xctxt.getErrorListener();
TransformerException spe=new TransformerException(formattedMsg,(SourceLocator)xctxt.getSAXLoc... | Tell the user of an error, and probably throw an exception. |
private String generatePortName(){
StringBuffer portName=new StringBuffer("Cinder Storage Port:");
int portCount=allStoragePortsList.size();
portName=portName.append(String.valueOf(portCount - 1));
return portName.toString();
}
| Generates the name for storage port. All Cinder storage system ports will be named as First port would have been named as "DEFAULT" during the first discovery, then onwards ports will be named as. 'Cinder Storage Port:0' 'Cinder Storage Port:1' 'Cinder Storage Port:2' and so on .... |
static byte[] readFile(InputStream in,long expectedSize) throws IOException {
if (expectedSize > Integer.MAX_VALUE) {
throw new OutOfMemoryError("file is too large to fit in a byte array: " + expectedSize + " bytes");
}
return expectedSize == 0 ? ByteStreams.toByteArray(in) : ByteStreams.toByteArray(in,(int)e... | Reads a file of the given expected size from the given input stream, if it will fit into a byte array. This method handles the case where the file size changes between when the size is read and when the contents are read from the stream. |
private void checkResource(ResourceImpl resource){
checkArgument(ID.equals(resource.getType()),"Resource should have '" + ID + "' type");
checkArgument(SUPPORTED_UNITS.contains(resource.getUnit()),"Resource has unsupported unit '" + resource.getUnit() + "'");
}
| Checks that given resources can be processed by this resource type |
private static boolean isInVerticalTargetZone(float x,float y,float handleX,float handleYStart,float handleYEnd,float targetRadius){
if (Math.abs(x - handleX) <= targetRadius && y > handleYStart && y < handleYEnd) {
return true;
}
return false;
}
| Determines if the specified coordinate is in the target touch zone for a vertical bar handle. |
public static boolean contains(Iterable self,Object item){
for ( Object e : self) {
if (item == null ? e == null : item.equals(e)) {
return true;
}
}
return false;
}
| Returns <tt>true</tt> if this iterable contains the item. |
@Override public boolean batchFinished() throws Exception {
int i;
Instances inst;
if (getInputFormat() == null) {
throw new IllegalStateException("No input instance format defined");
}
inst=new Instances(getInputFormat());
if (!hasImmediateOutputFormat() && !isFirstBatchDone()) {
if (allowAccessToF... | Signify that this batch of input to the filter is finished. If the filter requires all instances prior to filtering, output() may now be called to retrieve the filtered instances. Any subsequent instances filtered should be filtered based on setting obtained from the first batch (unless the setInputFormat has been re-a... |
public LatvianStemFilterFactory(Map<String,String> args){
super(args);
if (!args.isEmpty()) {
throw new IllegalArgumentException("Unknown parameters: " + args);
}
}
| Creates a new LatvianStemFilterFactory |
public String remoteToString(){
return Util.getUnqualifiedName(getClass()) + " [remoteRef: " + ref+ "]";
}
| Method from object, forward from RemoteObject |
public boolean exists(){
return scanner != null;
}
| Does the input stream exist? |
private void createCompilationThread(){
CompilationThread ct=new CompilationThread();
Controller.compilationThread=ct;
ct.start();
}
| Creates and schedules the compilationThread. |
public static Font createTrueTypeFont(String fontName,String fileName){
String alreadyLoaded=fileName + "_" + fontReturnedHeight+ "_"+ Font.STYLE_PLAIN;
Font f=derivedFontCache.get(alreadyLoaded);
if (f != null) {
return f;
}
if (fontName.startsWith("native:")) {
if (!Display.impl.isNativeFontSchemeSu... | Creates a true type font with the given name/filename (font name might be different from the file name and is required by some devices e.g. iOS). The font file must reside in the src root of the project in order to be detectable. The file name should contain no slashes or any such value.<br> <b>Important</b> some platf... |
@Override public void writeXML(String fileName) throws IOException {
OutputStream out=new FileOutputStream(fileName);
if (fileName.endsWith(".gz")) {
out=new GZIPOutputStream(out);
}
writeXML(out);
}
| Write this BugCollection to a file as XML. |
@DSSpec(DSCat.SPEC_OTHERS) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:51.152 -0400",hash_original_method="25C5B7A23CB49F643BCDC481452D2C99",hash_generated_method="2B8C00376BFC582E1797467A1C8ED4E6") public static Collection<File> listFiles(File directory,String[] extensions,b... | Finds files within a given directory (and optionally its subdirectories) which match an array of extensions. |
private void purgeMissingInstExtModConfigs(){
final InstExtModConfsBean instExtModConfsBean=Env.LAUNCHER_SETTINGS.get(LSettings.INST_EXT_MOD_CONFS);
InstExtModConfsBean instExtModConfsBeanClone=null;
for ( final InstExtModConfBean conf : instExtModConfsBean.getInstExtModConfBeanList()) {
boolean found=false;... | Removes configs of installed external modules from the settings which are no longer available. |
public static float exp(float fValue){
return (float)Math.exp(fValue);
}
| Returns E^fValue |
public void addNotificationListener(ObjectName name,ObjectName listener,NotificationFilter filter,Object handback) throws InstanceNotFoundException {
mbsInterceptor.addNotificationListener(cloneObjectName(name),listener,filter,handback);
}
| Adds a listener to a registered MBean. |
public void testDoConfigureSetsConfigurationVersion() throws Exception {
configuration.setProperty(WebLogicPropertySet.CONFIGURATION_VERSION,CONFIGURATION_VERSION);
configuration.doConfigure(container);
String config=configuration.getFileHandler().readTextFile(DOMAIN_HOME + "/config/config.xml","UTF-8");
XMLAss... | Test changing configuration version. |
public JavaResult waitForCompletion(String messageID) throws Exception {
log.info("Verifying the Async task status for message {}",messageID);
InputStream responseStream=null;
EchoCommand command=null;
JavaResult result=null;
String statusQueryWithParams=String.format(STATUS_QUERY,messageID);
int retries=0;... | This method is responsible to check the async task status for every 3 seconds and if we don't get status in 60 retries, throw exception. |
public void writeExifData() throws IOException {
if (this.outFile == null) {
return;
}
if (this.aperture != null) {
this.outFile.setAttribute(ExifInterface.TAG_APERTURE,this.aperture);
}
if (this.datetime != null) {
this.outFile.setAttribute(ExifInterface.TAG_DATETIME,this.datetime);
}
if (thi... | Writes the previously stored EXIF data to the output file. |
@Override public void tags(Map<String,Object> metricTags){
this.metricTags.putAll(metricTags);
}
| Add additional tags. |
public RangeQueryBuilder format(String format){
this.format=format;
return this;
}
| In case of date field, we can set the format to be used instead of the mapper format |
public void removeField(CtField f) throws NotFoundException {
checkModify();
}
| Removes a field declared in this class. |
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) private void dequeueOutputBuffer(MediaCodec codec,ByteBuffer[] outputBuffers,int index,MediaCodec.BufferInfo info){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
ByteBuffer buffer=outputBuffers[index];
Log.i("size/remaining: " + info.size + "/"+ buff... | Save the encoded (output) buffer into the complete encoded recording. TODO: copy directly (without the intermediate byte array) |
@Override public void processResponse(StunResponseEvent event){
TransactionID transactionID=event.getTransactionID();
logger.finest("Received a message: tranid= " + transactionID);
logger.finest("localCand= " + hostCandidate);
synchronized (requests) {
requests.remove(transactionID);
}
Response response=e... | Notifies this <tt>ResponseCollector</tt> that a STUN response described by the specified <tt>StunResponseEvent</tt> has been received. |
private boolean isConvertedSubq(RexNode rex){
if ((rex instanceof RexLiteral) || (rex instanceof RexDynamicParam)) {
return true;
}
if (rex instanceof RexCall) {
RexCall call=(RexCall)rex;
if (call.getOperator() == SqlStdOperatorTable.CAST) {
RexNode operand=call.getOperands().get(0);
if (... | Determines whether a RexNode corresponds to a subquery that's been converted to a constant. |
public static void updateExpandedVolume(Volume volume,StorageVolume deviceVolume,DbClient dbClient){
volume.setCapacity(deviceVolume.getRequestedCapacity());
volume.setProvisionedCapacity(deviceVolume.getProvisionedCapacity());
volume.setAllocatedCapacity(deviceVolume.getAllocatedCapacity());
dbClient.updateObj... | Updates the ViPR volume from the passed, newly expanded external device volume to reflect the expanded capacity. |
private java.awt.Color fxToAWTColor(Color color){
int r=((int)color.getRed() * 255);
int g=((int)color.getGreen() * 255);
int b=((int)color.getBlue() * 255);
int rgb=(r << 16) + (g << 8) + b;
return new java.awt.Color(rgb);
}
| Get a AWT Color from JavaFX Color. |
void updateTabState(int newState){
long now=System.currentTimeMillis();
recordTabStateTransition(mLastTabState,newState,now - mLastTabStateChangeMillis);
mLastTabStateChangeMillis=now;
mLastTabState=newState;
}
| Updates saved TabState and its timestamp. Records the state transition into the histogram. |
public static void centerOnWindow(Component componentToMove){
center(componentToMove,SwingUtilities.windowForComponent(componentToMove));
}
| Centers the component on its window |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.