code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
ContractChecker(ExecutableSequence s,List<ObjectContract> contracts){
this.s=s;
this.contracts=contracts;
}
| Creates a contract checker for value tuples. All contracts must have the same arity. |
public CEdgeLabelEnterState(final CStateFactory<NodeType,EdgeType> factory,final AbstractZyGraph<NodeType,EdgeType> graph,final EdgeLabel label){
m_factory=Preconditions.checkNotNull(factory,"Error: factory argument can not be null");
m_graph=Preconditions.checkNotNull(graph,"Error: graph argument can not be null")... | Creates a new state object. |
synchronized public static JMenu makeWarrantMenu(boolean edit){
if (jmri.InstanceManager.getDefault(OBlockManager.class).getSystemNameList().size() > 1) {
_edit=edit;
_warrantMenu=new JMenu(Bundle.getMessage("MenuWarrant"));
updateWarrantMenu();
return _warrantMenu;
}
return null;
}
| Note: _warrantMenu is static |
private void saveDescendantState(){
FacesContext context=getFacesContext();
if (getChildCount() > 0) {
for ( UIComponent kid : getChildren()) {
if (kid instanceof UIColumn) {
saveDescendantState(kid,context);
}
}
}
}
| <p>Save state information for all descendant components, as described for <code>setRowIndex()</code>.</p> |
protected void paintBackground(Graphics g){
super.paintBackground(g);
if (!isUseParentPaint()) {
JTextComponent editor=this.getComponent();
BETextFieldUI.paintBg(g,0,0,editor.getWidth(),editor.getHeight(),editor.isEnabled(),bg);
}
}
| Paints a background for the view. This will only be called if isOpaque() on the associated component is true. The default is to paint the background color of the component. |
public int idHighCodeAsValueFromSystemName(String systemName){
int dCode=-1;
if (!iCodes.reset(systemName).matches() || !validSystemNameFormat(systemName,iCodes.group(2).charAt(0))) {
}
else {
if (iCodes.groupCount() == 5) {
try {
dCode=Integer.parseInt(iCodes.group(3),16);
}
catch ( ... | Extract Insteon high device id from system name <P> If the supplied system name does not have a valid format, an empty string is returned. |
public byte[] generatePrivateKeyPairBytes(KeyPair keyPair){
byte[] privateKeyBytes=null;
try {
privateKeyBytes=privateKey.getEncoded();
}
catch ( Exception e) {
LOG.error("Error converting private Key to bytes",e);
}
return privateKeyBytes;
}
| * * |
static PageFreeList create(PageStore store,int pageId){
return new PageFreeList(store,pageId);
}
| Create a new free-list page. |
public EventSecurityExpressionRoot(Authentication authentication,Message<?> message){
super(authentication);
this.message=message;
}
| Instantiates a new event security expression root. |
public static <T>T splitEachLine(URL self,String regex,@ClosureParams(value=FromString.class,options={"List<String>","String[]"},conflictResolutionStrategy=PickFirstResolver.class) Closure<T> closure) throws IOException {
return IOGroovyMethods.splitEachLine(newReader(self),regex,closure);
}
| Iterates through the input stream associated with this URL line by line, splitting each line using the given regex separator. For each line, the given closure is called with a single parameter being the list of strings computed by splitting the line around matches of the given regular expression. Finally the resources ... |
public void accept(AmqpSession txnSession,boolean settle) throws Exception {
if (receiver == null) {
throw new IllegalStateException("Can't accept non-received message.");
}
receiver.accept(delivery,txnSession,settle);
}
| Accepts the message marking it as consumed on the remote peer. |
private synchronized long commitAndSave(){
if (closed) {
return currentVersion;
}
if (fileStore == null) {
throw DataUtils.newIllegalStateException(DataUtils.ERROR_WRITING_FAILED,"This is an in-memory store");
}
if (currentStoreVersion >= 0) {
return currentVersion;
}
if (!hasUnsavedChanges())... | Commit all changes and persist them to disk. This method does nothing if there are no unsaved changes, otherwise it increments the current version and stores the data (for file based stores). <p> At most one store operation may run at any time. |
public void chainFlap(MowzieModelRenderer[] boxes,float speed,float degree,double rootOffset,float f,float f1){
int numberOfSegments=boxes.length;
float offset=(float)((rootOffset * Math.PI) / (2 * numberOfSegments));
for (int i=0; i < numberOfSegments; i++) boxes[i].rotateAngleZ+=MathHelper.cos(f * speed + off... | Flaps a chain of parented boxes up and down (rotateAngleZ). Useful for tails. <p/> Note: Just keep f and f1 from the setRotationAngles() method. |
public int discardBodyData(){
return readBodyData(null);
}
| <p> Reads <code>body-data</code> from the current <code>encapsulation</code> and discards it. </p> <p>Use this method to skip encapsulations you don't need or don't understand.</p> |
@Override public Request<Workspace> withName(String name){
for ( Map.Entry<String,Workspace> entry : workspaces.entrySet()) {
if (name.equals(entry.getKey())) {
return new DummyRequest<Workspace>(entry.getValue());
}
}
return new DummyRequest<>(null);
}
| Retrieves a Codenvy workspace by it's name. |
private void updateProgress(String progressLabel,int progress){
if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) {
myHost.updateProgress(progressLabel,progress);
}
previousProgress=progress;
previousProgressLabel=progressLabel;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
public static void moveFile(File srcFile,File destFile) throws IOException {
if (srcFile == null) {
throw new NullPointerException("Source must not be null");
}
if (destFile == null) {
throw new NullPointerException("Destination must not be null");
}
if (!srcFile.exists()) {
throw new FileNotFound... | Moves a file. <p> When the destination file is on another file system, do a "copy and delete". |
public Element create(String prefix,Document doc){
return new SVGOMAnimateColorElement(prefix,(AbstractDocument)doc);
}
| Creates an instance of the associated element type. |
public static GeometryFactory extractFactory(Collection geoms){
if (geoms.isEmpty()) return null;
return ((Geometry)geoms.iterator().next()).getFactory();
}
| Extracts the GeometryFactory used by the geometries in a collection |
public boolean isShiftPressed(){
return shiftPressed;
}
| Returns true if the shift key is pressed on the keyboard. |
public void removeHost(String hostPortPair) throws SQLException {
removeHost(hostPortPair,false);
}
| Remove the given host (host:port pair) from this Connection Group. |
public Node(final CharSequence s,final int offset,final int length,final boolean isWord,final int numNodes){
path=new char[length];
MutableString.getChars(s,offset,offset + length,path,0);
this.isWord=isWord;
this.numNodes=numNodes;
}
| Creates a new node containing a path specified by a character-sequence fragment. |
protected void intrinsifyAbortIntrinsics(){
intrinsics.put("@_gfortran_abort",LLVMAbortFactory.getInstance());
intrinsics.put("@abort",LLVMAbortFactory.getInstance());
intrinsics.put("@exit",LLVMExitFactory.getInstance());
intrinsics.put("@signal",LLVMSignalFactory.getInstance());
}
| This method intrinsifies functions that exit the process such as <code>abort</code> or <code>exit</code> in C or <code>_gfortran_abort</code> in Fortran. Not intrinsifying these functions and directly executing the JVM process upon their invocation would not desirable, since cleanups or exit functions (such as shared l... |
protected void connectionFailed(Channel failedChannel,IOException cause){
failureCause=IOExceptionSupport.create(cause);
channel=failedChannel;
connected.set(false);
handshakeFuture.setFailure(cause);
}
| Called when the transport connection failed and an error should be returned. |
public Scroll(TimeValue keepAlive){
this.keepAlive=keepAlive;
}
| Constructs a new scroll of the provided keep alive. |
public VNXeCommandJob deleteShareForSnapshot(String shareId){
_url=URL_SHARE + shareId;
if (getShare(shareId) != null) {
unsetQueryParameters();
return deleteRequestAsync(null);
}
else {
throw VNXeException.exceptions.vnxeCommandFailed("The shareId is not found: " + shareId);
}
}
| Delete CIFS share |
public static void main(final String[] args){
DOMTestCase.doMain(hc_commentgetcomment.class,args);
}
| Runs this test from the command line. |
public SearchObject(String imageUrl,String keyword,String link){
this.imageUrl=imageUrl;
this.keyword=keyword;
this.link=link;
}
| Search result with image url component and link |
public RepairContext(final List<String> nodes,final List<String> keySpaces,final List<String> columnFamilies){
this.nodes=(nodes == null) ? Collections.emptyList() : nodes;
this.keySpaces=(keySpaces == null) ? Collections.emptyList() : keySpaces;
this.columnFamilies=(columnFamilies == null) ? Collections.emptyLis... | Constructs a new RepairContext. |
public FileTimeDisplay(boolean showTimeForOldDaysThisYear,boolean showTimeForOldDays){
mShowTimeForOldDaysThisYear=showTimeForOldDaysThisYear;
mShowTimeForOldDays=showTimeForOldDays;
}
| Creates new instance. |
public static void save(String filename){
File file=new File(filename);
String suffix=filename.substring(filename.lastIndexOf('.') + 1);
if (suffix.toLowerCase().equals("png")) {
try {
ImageIO.write(onscreenImage,suffix,file);
}
catch ( IOException e) {
e.printStackTrace();
}
}
else... | Save onscreen image to file - suffix must be png, jpg, or gif. |
private void unionTermGroups(ArrayList<FixedBitSet> bb){
int incr;
for (int i=0; i < bb.size() - 1; i+=incr) {
incr=1;
int j=i + 1;
while (j < bb.size()) {
if (bb.get(i).intersects(bb.get(j))) {
bb.get(i).or(bb.get(j));
bb.remove(j);
incr=0;
}
else {
++j;
... | union (term group) bit-sets until they are disjoint (O(n^^2)), and each group have different terms |
public Object convert(final Object value,final Class<?> targetType){
Class<?> sourceType=value == null ? null : value.getClass();
Object converted=value;
Converter converter=this.lookup(sourceType,targetType);
if (converter != null) {
converted=converter.convert(targetType,value);
}
if (targetType == St... | <p>Convert the value to an object of the specified class (if possible).</p> |
public void vspan(long start,long end,Paint color){
vspan(start,end,color,null);
}
| Draws a vertical span into the graph. |
public void append(int key,boolean value){
if (mSize != 0 && key <= mKeys[mSize - 1]) {
put(key,value);
return;
}
int pos=mSize;
if (pos >= mKeys.length) {
int n=ArrayUtils.idealIntArraySize(pos + 1);
int[] nkeys=new int[n];
boolean[] nvalues=new boolean[n];
System.arraycopy(mKeys,0,nkey... | Puts a key/value pair into the array, optimizing for the case where the key is greater than all existing keys in the array. |
public void visitLocalVariable(String name,String desc,String signature,Label start,Label end,int index){
if (mv != null) {
mv.visitLocalVariable(name,desc,signature,start,end,index);
}
}
| Visits a local variable declaration. |
public void turnQuotaOn(String volume){
QuotaCommands commands=new QuotaCommands(server.getNaServer());
commands.turnQuotaOn(volume);
}
| Starts to turn quotas on for a volume. A successful return from this API does not mean that quotas are on, merely that an attempt to start it has been triggered |
public void clearSounds(){
mSoundMap.clear();
}
| Clears all of the previously set sounds and events. |
public JSONArray(){
this.myArrayList=new ArrayList<Object>();
}
| Construct an empty JSONArray. |
public Workflow.Method zoneExportRemoveInitiatorsMethod(List<NetworkZoningParam> zoningParam){
return new Workflow.Method("zoneExportRemoveInitiators",zoningParam);
}
| Generate Workflow.Method for zoneExportRemoveInitiators |
@Override public void add(final URL input,final String baseURI,final RDFFormat format,final Resource... c) throws IOException, RDFParseException, RepositoryException {
final AddOp op=new AddOp(input.toString());
add(op,c);
}
| TODO support baseURI |
public SearchSourceBuilder fields(List<String> fields){
this.fieldNames=fields;
return this;
}
| Sets the fields to load and return as part of the search request. If none are specified, the source of the document will be returned. |
public boolean removeParameter(String name){
throw new UnsupportedOperationException("Removing parameters in a stack is not supported.");
}
| Does <i>not</i> remove a parameter. Parameter stacks are read-only. It is possible, though discouraged, to access and modify specific stack entries. Derived classes may change this behavior. |
public GetTVShowDetails(int tvshowId,String... properties){
super();
addParameterToRequest("tvshowid",tvshowId);
addParameterToRequest("properties",properties);
}
| Retrieve details about a specific tv show |
private void closeOrder() throws Exception {
if (m_orderLine != null) {
m_orderLine.saveEx();
}
if (m_order != null) {
m_order.load(get_TrxName());
addLog(0,null,m_order.getGrandTotal(),m_order.getDocumentNo());
}
m_order=null;
m_orderLine=null;
}
| Close Order |
public Type4(Type2 model1,Type3 model2){
}
| It should be possible to construct a Type4-model with both Type2 and Type2-nodes as parents. |
public CompilationUnitChange(String name,Document document){
super(name,document);
setTextType("java");
}
| Creates a new <code>CompilationUnitChange</code>. |
public String useBetterEncodingTipText(){
return "Uses a more efficient split point encoding.";
}
| Returns the tip text for this property |
static void verifyRegistryStateAllowsLaunchFlows(Registry registry,DateTime now) throws BadCommandForRegistryPhaseException {
if (DISALLOWED_TLD_STATES_FOR_LAUNCH_FLOWS.contains(registry.getTldState(now))) {
throw new BadCommandForRegistryPhaseException();
}
}
| Check that the registry phase is not incompatible with launch extension flows. |
public int[] variables(){
IntArrayList variables=new IntArrayList();
for (int i=0; i < list.size(); i++) if (list.getLong(i) != 0) variables.add(i);
return variables.toIntArray();
}
| Returns an array containing the variables in increasing order. <p>Mainly for debugging purposes. |
public NULLRecord(Name name,int dclass,long ttl,byte[] data){
super(name,Type.NULL,dclass,ttl);
if (data.length > 0xFFFF) {
throw new IllegalArgumentException("data must be <65536 bytes");
}
this.data=data;
}
| Creates a NULL record from the given data. |
protected final SpecObj processSpec(SpecObj spec){
if (spec == null) {
spec=new SpecObj(this.rootFile,resolver);
if (TLCGlobals.tool) {
MP.printMessage(EC.TLC_SANY_START);
}
try {
SANY.frontEndMain(spec,this.rootFile,ToolIO.out);
}
catch ( FrontEndException e) {
Assert.fail(E... | Processes the specification and collects information to be used by tools. The processing tries to use any customized module (Java class) to override the corresponding TLA+ module. |
public double negativeLogLikelihood(Matrix logtheta,Matrix x,Matrix y,Matrix df0){
int n=x.getRowDimension();
Matrix K=covFunction.compute(logtheta,x);
CholeskyDecomposition cd=K.chol();
if (!cd.isSPD()) {
throw new RuntimeException("The covariance Matrix is not SDP, check your covariance function (maybe yo... | Computes minus the log likelihood and its partial derivatives with respect to the hyperparameters; this mode is used to fit the hyperparameters. |
public void selectByCriteria(){
GuiHelper.centerChildToParent(m_model.getParent(),m_criteriaDlg,true);
m_criteriaDlg.setVisible(true);
m_criteriaDlg.setVisible(false);
if (m_criteriaDlg.isClosedOk()) {
final CCriteriumTree tree=m_criteriaDlg.getCriteriumTree();
m_menuBar.getCriteriumCache().add(tree.cre... | Shows the Select by Criteria dialog of this graph panel. |
public static void skipFields(@Nonnull DexReader reader,int count){
for (int i=0; i < count; i++) {
reader.skipUleb128();
reader.skipUleb128();
}
}
| Skips the reader over the specified number of encoded_field structures |
public ToolEvent(Tool src,DrawingView view,Rectangle invalidatedArea){
super(src);
this.view=view;
this.invalidatedArea=invalidatedArea;
}
| Creates a new instance. |
public PutRepositoryRequest source(Map repositoryDefinition){
Map<String,Object> source=repositoryDefinition;
for ( Map.Entry<String,Object> entry : source.entrySet()) {
String name=entry.getKey();
if (name.equals("type")) {
type(entry.getValue().toString());
}
else if (name.equals("settings... | Parses repository definition. |
public Implementation(){
super();
plugin=this;
}
| Creates an instance. <!-- begin-user-doc --> <!-- end-user-doc --> |
protected void paintTitlePaneImpl(Insets frameInsets,Graphics g,int width,int height,boolean isSelected){
BETitlePane.paintTitlePane(g,frameInsets.left,frameInsets.top,width - frameInsets.left - frameInsets.right,height,isSelected);
}
| Paint title pane impl. |
@Override protected boolean isExpirationAllowed(ExpiryTask expiry){
if (this.requiresReliabilityCheck && this.isMissingRequiredRoles) {
if (getMembershipAttributes().getLossAction().isNoAccess()) {
return false;
}
if (getMembershipAttributes().getLossAction().isLimitedAccess() && expiry.isDistribute... | Returns true if the ExpiryTask is currently allowed to expire. <p> If the region is in NO_ACCESS due to reliability configuration, then no expiration actions are allowed. <p> If the region is in LIMITED_ACCESS due to reliability configuration, then only non-distributed expiration actions are allowed. |
@DSComment("Package priviledge") @DSSafe(DSCat.UTIL_FUNCTION) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:52.968 -0500",hash_original_method="94A8BA1BB14E20FE8AAE958A036048A6",hash_generated_method="03DE6BA56337AAD75057F043E8AE104E") static byte[] discardNonBase64(byte[] data... | Discards any characters outside of the base64 alphabet, per the requirements on page 25 of RFC 2045 - "Any characters outside of the base64 alphabet are to be ignored in base64 encoded data." |
public RangeQueryBuilder queryName(String queryName){
this.queryName=queryName;
return this;
}
| Sets the query name for the filter that can be used when searching for matched_filters per hit. |
public Object runSafely(Catbert.FastStack stack) throws Exception {
CaptureDevice[] capdevs=Scheduler.getInstance().getMyEncoders();
if (capdevs.length == 0) return MMC.getInstance().getAllEncodingQualities();
else {
java.util.Set rv=new java.util.HashSet();
for (int i=0; i < capdevs.length; i++) rv.... | Returns a list of the different recording quality names available in the system |
public static String jdkString(){
return jdkStr;
}
| Gets JDK string. |
public StringRequest(int method,String url,Listener<String> listener,ErrorListener errorListener){
super(method,url,errorListener);
mListener=listener;
}
| Creates a new request with the given method. |
void startAsyncThumbnailsLoading(ArrayList<POI> pois){
if (pois == null) return;
mThreadPool.shutdownNow();
mThreadPool=Executors.newFixedThreadPool(3);
for (int i=0; i < pois.size(); i++) {
final POI poi=pois.get(i);
final Marker marker=mPoiMarkers.getItem(i);
mThreadPool.submit(new ThumbnailLoad... | Loads all thumbnails in background |
public void test_CreateDestroy_ticket_948_02() throws Exception {
if (!BigdataStatics.runKnownBadTests) {
return;
}
final String namespace=getName();
final Properties properties1=new Properties(getProperties());
properties1.setProperty(AbstractTripleStore.Options.VOCABULARY_CLASS,BSBMVocabulary.class.getN... | A non-concurrent version testing both create, destroy, and then re-create where the KB properties have been changed (especially the Vocabulary class). <p> In this variant, we shutdown the Journal and then re-open it. |
public ItemLabelPosition(ItemLabelAnchor itemLabelAnchor,TextAnchor textAnchor,TextAnchor rotationAnchor,double angle){
ParamChecks.nullNotPermitted(itemLabelAnchor,"itemLabelAnchor");
ParamChecks.nullNotPermitted(textAnchor,"textAnchor");
ParamChecks.nullNotPermitted(rotationAnchor,"rotationAnchor");
this.item... | Creates a new position record. The item label anchor is a point relative to the data item (dot, bar or other visual item) on a chart. The item label is aligned by aligning the text anchor with the item label anchor. |
@Override public void eUnset(int featureID){
switch (featureID) {
case FunctionblockPackage.EVENT__NAME:
setName(NAME_EDEFAULT);
return;
case FunctionblockPackage.EVENT__PROPERTIES:
getProperties().clear();
return;
}
super.eUnset(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public void reconfigZKToWritable(List<String> observerNodes,List<String> readOnlyNodes){
log.info("Standby is running in read-only mode due to connection loss with active site. " + "Reconfig coordinatorsvc of all nodes to writable");
try {
boolean reconfigLocal=false;
for ( String node : observerNodes) {... | reconfigure ZooKeeper to participant mode within the local site |
public String remoteToString(){
return Util.getUnqualifiedName(getClass()) + " [liveRef: " + ref+ "]";
}
| Method from object, forward from RemoteObject |
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
for (int k=0; k < segments.length; ++k) ensureSegment(k);
s.defaultWriteObject();
final Segment<K,V>[] segments=this.segments;
for (int k=0; k < segments.length; ++k) {
Segment<K,V> seg=segmentAt(segments,k);
seg.lock(... | Saves the state of the <tt>ConcurrentHashMap</tt> instance to a stream (i.e., serializes it). |
public static Vector3 abs(Vector3 o){
return new Vector3(Math.abs(o.x),Math.abs(o.y),Math.abs(o.z));
}
| Sets the X, Y, and Z values of the given Vector3 to their absolute value. |
public String toString(){
return "Easting:" + easting + " Northing:"+ northing;
}
| Description of the Method |
public HashCodeBuilder append(Object[] array){
if (array == null) {
iTotal=iTotal * iConstant;
}
else {
for (int i=0; i < array.length; i++) {
append(array[i]);
}
}
return this;
}
| <p> Append a <code>hashCode</code> for an <code>Object</code> array. </p> |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
public int compareTo(UUID val){
return (this.mostSigBits < val.mostSigBits ? -1 : (this.mostSigBits > val.mostSigBits ? 1 : (this.leastSigBits < val.leastSigBits ? -1 : (this.leastSigBits > val.leastSigBits ? 1 : 0))));
}
| Compares this UUID with the specified UUID. <p> The first of two UUIDs is greater than the second if the most significant field in which the UUIDs differ is greater for the first UUID. |
public void addSpokenLanguage(Language lang){
this.spokenLanguages.add(lang);
}
| Add a spoken language to the country. The language is described by its Alpha2 Code. |
public java.util.ArrayList<TreeNode<E>> path(E e){
java.util.ArrayList<TreeNode<E>> list=new java.util.ArrayList<>();
TreeNode<E> current=root;
while (current != null) {
list.add(current);
if (e.compareTo(current.element) < 0) {
current=current.left;
}
else if (e.compareTo(current.element) ... | Return a path from the root leadting to the specified element |
public void zoomTo(Coord coord,int zoomLevel){
if (coord.isProjected()) {
throw new IllegalArgumentException("coord should be wg84 format");
}
_center=_map.projection().fromWGS84(coord);
_zoom=zoomLevel;
_needTiles=true;
super.repaint();
}
| Zoom map to the center of the given coordinate with the given zoom level |
public String replaceAll(String expr,String substitute){
return Pattern.compile(expr).matcher(this).replaceAll(substitute);
}
| Replace any substrings within this String that match the supplied regular expression expr, with the String substitute. |
public synchronized int totalSize(){
if (destroyed) return 0;
return connections.size();
}
| The total amount of pooled connections in any state. |
private SimpleHashSetEntry<T>[] doubleCapacity(){
SimpleHashSetEntry<T>[] oldTable=mTable;
int oldCapacity=oldTable.length;
if (oldCapacity == MAXIMUM_CAPACITY) {
return oldTable;
}
int newCapacity=oldCapacity * 2;
SimpleHashSetEntry<T>[] newTable=makeTable(newCapacity);
if (mSize == 0) {
return n... | Doubles the capacity of the hash table. Existing entries are placed in the correct bucket on the enlarged table. If the current capacity is, MAXIMUM_CAPACITY, this method is a no-op. Returns the table, which will be new unless we were already at MAXIMUM_CAPACITY. |
@Ignore("TODO") @Test public void testS2CDeltaPropagationFailedStats2() throws Exception {
}
| Simulates old value null, entry null, InvalidDeltaExeption |
public void runTest() throws Throwable {
Document doc;
NodeList elementList;
Attr newAttribute;
Node testAddress;
NamedNodeMap attributes;
Node newNode;
doc=(Document)load("staff",true);
elementList=doc.getElementsByTagName("address");
testAddress=elementList.item(2);
newAttribute=doc.createAttribut... | Runs the test case. |
public void valueChange(ValueChangeEvent evt){
if (evt.getSource() instanceof WEditor) {
GridField changedField=((WEditor)evt.getSource()).getGridField();
if (changedField != null) {
processDependencies(changedField);
}
}
processNewValue(evt.getNewValue(),evt.getPropertyName());
}
| Editor Listener |
public static BigInteger toBigInteger(Number self){
if (self instanceof BigInteger) {
return (BigInteger)self;
}
else if (self instanceof BigDecimal) {
return ((BigDecimal)self).toBigInteger();
}
else if (self instanceof Double) {
return new BigDecimal((Double)self).toBigInteger();
}
else i... | Transform this Number into a BigInteger. |
public UnionType newUnionType(){
return new UnionType(this);
}
| Creates a new unparented union type node owned by this AST. By default, the union type has no types. |
public boolean isIncoming(){
return _incoming;
}
| Returns true if the file transfer is incoming (somebody is sending the file to us). |
private double angleTo(Point2D that){
double dx=that.x - this.x;
double dy=that.y - this.y;
return Math.atan2(dy,dx);
}
| Returns the angle between this point and that point. |
public boolean isSelected(String optionId){
for ( String propertyTypeId : typedPropertyLists.keySet()) {
if (isSelected(propertyTypeId,optionId)) {
return true;
}
}
return false;
}
| Check if given option is selected for any of the properties. |
public JavaDocContextType(){
addResolver(new GlobalTemplateVariables.Cursor());
addResolver(new SurroundWithLineSelection());
addResolver(new SurroundWithWordSelection());
addResolver(new GlobalTemplateVariables.Dollar());
addResolver(new GlobalTemplateVariables.Date());
addResolver(new GlobalTemplateVariab... | Creates a java context type. |
public void exit() throws RemoteException {
System.err.println("received call to exit");
System.exit(0);
}
| Ask the registry to exit instead of forcing it do so; this works better on windows... |
static boolean deleteApplicationIntent(){
final Uri packageURI=Uri.parse("package:" + Status.getAppContext().getPackageName());
if (Cfg.DEBUG) {
Check.log(TAG + " (deleteApplication): " + packageURI.toString());
}
final Intent uninstallIntent=new Intent(Intent.ACTION_DELETE,packageURI);
uninstallIntent.ad... | Deletes the application |
public void sort(int columnIndex,boolean ascending){
int columnType;
int i;
ArrayList<SortContainer> sorted;
SortContainer cont;
Object value;
if ((!isInitialized()) || (getModel().getRowCount() != mIndices.length)) {
System.out.println(this.getClass().getName() + ": Table model not initialized!");
... | sorts the table over the given column, either ascending or descending |
@Override public void eUnset(int featureID){
switch (featureID) {
case OrientedPackage.PORT__ID:
setId(ID_EDEFAULT);
return;
case OrientedPackage.PORT__TYPE:
setType(TYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private String findCurrentUser(){
if (sessionCtx == null) {
return "";
}
if (sessionCtx.getCallerPrincipal() == null) {
return "";
}
return sessionCtx.getCallerPrincipal().getName();
}
| returns the current user key given by the getCallerPrincipal method |
@Override public double confSmallM(double totalExampleWeight,double delta){
return 3.0d * Math.sqrt(Math.log(4.0d / delta) / (2.0d * totalExampleWeight));
}
| Calculate confidence intervall without a specific rule for small m. |
public boolean isRecording(){
return mIsRecording;
}
| Helper function to check if we're currently recording |
public static boolean isKali(){
if (onKali == null) {
onKali=Boolean.FALSE;
File osReleaseFile=new File("/etc/os-release");
if (isLinux() && !isDailyBuild() && osReleaseFile.exists()) {
try (InputStream in=Files.newInputStream(osReleaseFile.toPath())){
Properties osProps=new Properties();
... | Tells whether or not ZAP is running in Kali (and it's not a daily build). |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.