code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public static SynapseGroupDialog createSynapseGroupDialog(final NetworkPanel np,final SynapseGroup sg){
SynapseGroupDialog sgd=new SynapseGroupDialog(np,sg);
sgd.addListeners();
sgd.tabbedPane.setSelectedIndex(0);
return sgd;
}
| Creates a synapse group dialog based on a given synapse group it goes without saying that this means this dialog will be editing the given synapse group. |
@Override public int hashCode(){
return HashUtilities.hashCodeForDoubleArray(this.coefficients);
}
| Returns a hash code for this instance. |
@Override public List<Product> scroll(String clauses,int skip,int n){
checkProductNumber(n);
if (n < 0) n=ProductDao.getMaxPageSize();
return super.scroll(clauses,skip,n);
}
| Override Hibernate scroll to add the page size limitation. |
public XintroActivityBuilder withCustomImageLoader(ImageLoader customImageLoader){
this.customImageLoader=customImageLoader;
return this;
}
| With custom image loader. |
public MDTransformationRule makePassThroughRule(InputPort inputPort){
return new OneToManyPassThroughRule(inputPort,getManagedPorts());
}
| The generated rule copies all meta data from the input port to all generated output ports. |
public DigitalSignature(String algorithm){
try {
sha=MessageDigest.getInstance("SHA-1");
if ("RSA".equals(algorithm)) {
md5=MessageDigest.getInstance("MD5");
cipher=Cipher.getInstance("RSA/ECB/PKCS1Padding");
signature=null;
}
else if ("DSA".equals(algorithm)) {
signature=Sign... | Create Signature type |
public boolean unlockIt(){
log.info(toString());
setProcessing(false);
return true;
}
| Unlock Document. |
public <T extends ManagedEntity>T findByName(T[] entities,String name){
if (entities != null) {
for ( T entity : entities) {
if (StringUtils.equals(entity.getName(),name)) {
return entity;
}
}
}
return null;
}
| Finds a managed entity by name in an array (null-safe). |
public AtomicByteArray(int length){
this.length=length;
this.array=new AtomicIntegerArray((length + 3) / 4);
}
| Creates a new AtomicByteArray of the given length, with all elements initially zero. |
public static CompValidateChecker assertValidate(ICalComponent component){
return new CompValidateChecker(component);
}
| Asserts the validation of a component object. |
public void testParseCustomSimpleProperty(){
String toBeParsed="com.ibm.ssl.rootCertValidDays#" + " com.ibm.websphere.security.krb.canonical_host";
List<String> parsedProperty=ComplexPropertyUtils.parseProperty(toBeParsed,"#");
assertEquals(2,parsedProperty.size());
assertEquals("com.ibm.ssl.rootCertValidDays... | Test parsing of provided simple property. |
private List<Byte> toList(byte[] bytes){
List<Byte> result=new ArrayList<Byte>();
for ( byte b : bytes) {
result.add(b);
}
return result;
}
| Arrays.asList() does not work with arrays of primitives. :( |
public SimpleReact(){
this(ThreadPools.getStandard());
}
| Construct a SimpleReact builder using standard thread pool. By default, unless ThreadPools is configured otherwise this will be sized to the available processors |
public void testSplit1(){
SplittableRandom sr=new SplittableRandom();
for (int reps=0; reps < REPS; ++reps) {
SplittableRandom sc=sr.split();
int i=0;
while (i < NCALLS && sr.nextLong() == sc.nextLong()) ++i;
assertTrue(i < NCALLS);
}
}
| A SplittableRandom produced by split() of a default-constructed SplittableRandom generates a different sequence |
@Override public Object clone(){
return new PolynominalAttribute(this);
}
| Clones this attribute. |
public static boolean initDebug(boolean InitCuda){
return StaticHelper.initOpenCV(InitCuda);
}
| Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java"). |
@SuppressWarnings("deprecation") public static String urlEncode(String s){
try {
return URLEncoder.encode(s,"UTF-8");
}
catch ( UnsupportedEncodingException e) {
return URLEncoder.encode(s);
}
}
| Return a URL encoded string, assuming "UTF-8" encoding for input. If UTF-8 is not supported, used default platform encoding. |
protected StyleSheetProcessingInstruction(){
}
| Creates a new ProcessingInstruction object. |
protected void visitPage(String page,String referer){
if (appsMode) {
ConnectionRequest req=GetGARequest();
req.addArgument("t","appview");
req.addArgument("an",Display.getInstance().getProperty("AppName","Codename One App"));
String version=Display.getInstance().getProperty("AppVersion","1.0");
r... | Subclasses should override this method to track page visits |
public Message authResponse(ParameterList requestParams,String userSelId,String userSelClaimed,boolean authenticatedAndApproved){
return authResponse(requestParams,userSelId,userSelClaimed,authenticatedAndApproved,_opEndpointUrl,true);
}
| Processes a Authentication Request received from a consumer site. <p> Uses ServerManager's global OpenID Provider endpoint URL. |
public void checkValid(FactoryDto factory,boolean isUpdate) throws ConflictException {
if (null == factory) {
throw new ConflictException(FactoryConstants.UNPARSABLE_FACTORY_MESSAGE);
}
if (factory.getV() == null) {
throw new ConflictException(FactoryConstants.INVALID_VERSION_MESSAGE);
}
Version v;
... | Validate factory compatibility. |
@Override public boolean equals(Object object){
return object == null || object == this;
}
| A Null object is equal to the null value and to itself. |
public void processTag(Tag tag){
String key=tag.getKey();
String value=tag.getValue();
if (key.equals("name")) {
nodeName=value;
}
else {
EntityAttribute att=EntityAttributeManager.instance().intern(new EntityAttribute(key,value));
if (att != null) nodeAttributes.add(att);
}
}
| This is called by child element processors when a tag object is encountered. |
public AbstractConnector(Figure owner){
this.owner=owner;
}
| Constructs a connector with the given owner figure. |
public static final StringBuilder stripArrows(final StringBuilder text){
int pointer2=text.length() - 1;
if (pointer2 >= 0) {
while (true) {
if ((text.charAt(pointer2) == '<') || (text.charAt(pointer2) == '>')) {
text.deleteCharAt(pointer2);
}
pointer2--;
if (pointer2 < 0) {
... | removes all the spaces |
@Inject CarrierControlerListener(Carriers carriers,CarrierPlanStrategyManagerFactory strategyManagerFactory,CarrierScoringFunctionFactory scoringFunctionFactory){
this.carriers=carriers;
this.carrierPlanStrategyManagerFactory=strategyManagerFactory;
this.carrierScoringFunctionFactory=scoringFunctionFactory;
}
| Constructs a controller with a set of carriers, re-planning capabilities and scoring-functions. |
public SVGClipDescriptor(String clipPathValue,Element clipPathDef){
if (clipPathValue == null) throw new SVGGraphics2DRuntimeException(ErrorConstants.ERR_CLIP_NULL);
this.clipPathValue=clipPathValue;
this.clipPathDef=clipPathDef;
}
| Creates a new SVGClipDescriptor. |
public static boolean isValidPassword(String password){
final int LENGTH_OF_VALID_PASSWORD=8;
final int MINIMUM_NUMBER_OF_DIGITS=2;
boolean validPassword=isLengthValid(password,LENGTH_OF_VALID_PASSWORD) && isOnlyLettersAndDigits(password) && hasNDigits(password,MINIMUM_NUMBER_OF_DIGITS);
return validPassword;
}... | Method isPasswordVaild tests whether a string is a valid password |
private synchronized void rebuildJournal() throws IOException {
if (journalWriter != null) {
journalWriter.close();
}
Writer writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(journalFileTmp),Util.US_ASCII));
try {
writer.write(MAGIC);
writer.write("\n");
writer.write(VERSION_... | Creates a new journal that omits redundant information. This replaces the current journal if it exists. |
public static IsNullValue nullValue(){
return instanceByFlagsList[0][NULL];
}
| Get the instance representing values that are definitely null. |
public boolean voidIt(){
log.info("voidIt - " + toString());
m_processMsg=ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
if (m_processMsg != null) return false;
if (!closeIt()) return false;
m_processMsg=ModelValidationEngine.get().fireDocValidate(this,ModelValidator.... | Void Document. Same as Close. |
protected static Image loadFluffImageHeuristic(final Entity unit){
Image fluff=null;
String dir=DIR_NAME_MECH;
if (unit instanceof Aero) {
dir=DIR_NAME_AERO;
}
else if (unit instanceof BattleArmor) {
dir=DIR_NAME_BA;
}
else if (unit instanceof Tank) {
dir=DIR_NAME_VEHICLE;
}
File fluff_i... | Attempt to load a fluff image by combining elements of type and name. |
public Object runSafely(Catbert.FastStack stack) throws Exception {
Object obj=stack.pop();
if (obj == null) return null;
String s=obj.toString();
return (StringMatchUtils.convertFromNte(s));
}
| converts a string of NTE key characters (and normal characters) into their default character representation - given by the first character in the NTE chatacter list<br> The NTE key characters are the Unicode characters u2460-u2468 and u24EA (Unicode Circled Digits), representing the numeric Text Keys 1-9 and 0.<br> Th... |
public void add(int id,String name,int parentId,int srvArchId,String srvArchName,int srvFdrId){
FolderTokenFdrLink link;
link=new FolderTokenFdrLink(id,name,parentId,srvArchId,srvArchName,srvFdrId);
super.add(link);
}
| Agrega un nuevo enlace a la lista |
@Mod.EventHandler public void preInit(FMLPreInitializationEvent e){
rftools=Loader.isModLoaded("rftools");
logger=e.getModLog();
mainConfigDir=e.getModConfigurationDirectory();
modConfigDir=new File(mainConfigDir.getPath() + File.separator + "deepresonance");
versionConfig=new Configuration(new File(modConfig... | Run before anything else. Read your config, create blocks, items, etc, and register them with the GameRegistry. |
public static _Fields findByThriftIdOrThrow(int fieldId){
_Fields fields=findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
| Find the _Fields constant that matches fieldId, throwing an exception if it is not found. |
protected boolean isHTMLSupported(){
return htmlData != null;
}
| Should the HTML flavors be offered? If so, the method getHTMLData should be implemented to provide something reasonable. |
public WheelVerticalView(Context context,AttributeSet attrs){
this(context,attrs,R.attr.abstractWheelViewStyle);
}
| Create a new wheel vertical view. |
public static boolean isPrime(int number){
for (int divisor=2; divisor <= number / 2; divisor++) {
if (number % divisor == 0) {
return false;
}
}
return true;
}
| Check whether number is prime |
private AlarmEvent block(AlarmPoint alarm){
AlarmStatus status=alarm.currentStatus();
if (status.name(null).equals(AlarmPoint.STATUS_BLOCKED) || status.name(null).equals(AlarmPoint.STATUS_DISABLED)) {
return null;
}
AlarmStatus newStatus=createStatus(AlarmPoint.STATUS_BLOCKED);
return createEvent(alarm.id... | StateMachine change for block trigger. |
public void connectionUp(Connection con){
this.router.changedConnection(con);
}
| Informs the router of this host about state change in a connection object. |
public synchronized void ensureUpdated(){
}
| Should be invoked from the playback thread after the counters have been updated. Should also be invoked from any other thread that wishes to read the counters, before reading. These calls ensure that counter updates are made visible to the reading threads. |
protected void assertNumDocs(int expectedNumDocs,String collection) throws SolrServerException, IOException, InterruptedException {
CloudSolrClient client=createCloudClient(collection);
try {
int cnt=30;
AssertionError lastAssertionError=null;
while (cnt > 0) {
try {
assertEquals(expectedN... | Assert the number of documents in a given collection |
public VNXeCommandResult deleteConsistencyGroup(String cgId,boolean isForceSnapDeletion,boolean isForceVolumeDeletion){
if (isForceVolumeDeletion) {
DeleteStorageResourceRequest deleteReq=new DeleteStorageResourceRequest(_khClient);
return deleteReq.deleteLunGroup(cgId,isForceSnapDeletion);
}
else {
Bl... | Delete Consistency group. if isForceVolumeDeletion is true, it would delete all the volumes in the Consistency group and the Consistency group. if isForceVolumeDeletion is false, it would remove all the volumes from the Consistency group, then delete the Consistency group. |
public void test_engineInit_01(){
KeyManagerFactorySpiImpl kmf=new KeyManagerFactorySpiImpl();
KeyStore ks;
char[] psw="password".toCharArray();
try {
kmf.engineInit(null,null);
fail("NoSuchAlgorithmException wasn't thrown");
}
catch ( NoSuchAlgorithmException kse) {
}
catch ( Exception e) {
... | javax.net.ssl.KeyManagerFactorySpi#KengineInit(KeyStore ks, char[] password) |
@Override public boolean index(Resource resource){
return false;
}
| Unused, not implemented |
public static int findPerceptuallyNearestColor(int rgb,int[] colors){
int nearestColor=0;
double closest=Double.MAX_VALUE;
float[] original=convertRGBtoLAB(rgb);
for (int i=0; i < colors.length; i++) {
float[] cl=convertRGBtoLAB(colors[i]);
double deltaE=calculateDeltaE(original[0],original[1],original[... | Finds the "perceptually nearest" color from a list of colors to the given RGB value. This is done by converting to L*a*b colorspace and using the CIE2000 deltaE algorithm. |
@Override public boolean supportsConvert(int fromType,int toType){
if (isDebugEnabled()) {
debugCode("supportsConvert(" + fromType + ", "+ fromType+ ");");
}
return true;
}
| Returns whether CONVERT is supported for one datatype to another. |
public void remove(int childIndex){
MutableTreeNode child=(MutableTreeNode)getChildAt(childIndex);
children.removeElementAt(childIndex);
child.setParent(null);
}
| Removes the child at the specified index from this node's children and sets that node's parent to null. The child node to remove must be a <code>MutableTreeNode</code>. |
public void flushBase64() throws java.io.IOException {
if (position > 0) {
if (encode) {
out.write(encode3to4(b4,buffer,position));
position=0;
}
else {
throw new java.io.IOException("Base64 input not properly padded.");
}
}
}
| Method added by PHIL. [Thanks, PHIL. -Rob] This pads the buffer without closing the stream. |
private DisplayUtils(){
throw new Error("Do not need instantiate!");
}
| Don't let anyone instantiate this class. |
protected int bytesPerAtom(){
return (2);
}
| this clase encodes two bytes per atom |
protected Markup(final String agentId_){
this();
markupId=agentId_;
}
| Instantiates a new markup. |
public void removeAllTrackingIcons(){
iconArea.removeAllTrackingIcons();
}
| Removes all tracking icons. |
private void checkRoundTrip(WikibaseDate wbDate){
long seconds=wbDate.secondsSinceEpoch();
WikibaseDate roundDate=fromSecondsSinceEpoch(seconds);
assertEquals(wbDate,roundDate);
long roundSeconds=roundDate.secondsSinceEpoch();
assertEquals(seconds,roundSeconds);
String string=wbDate.toString(WIKIDATA);
ro... | Round trips the date through secondsSinceEpoch and all the toString and fromString formats. |
void parseTag() throws IOException {
Element elem;
boolean net=false;
boolean warned=false;
boolean unknown=false;
switch (ch=readCh()) {
case '!':
switch (ch=readCh()) {
case '-':
while (true) {
if (ch == '-') {
if (!strict || ((ch=readCh()) == '-')) {
ch=readCh();
... | Parse a start or end tag. |
public ECHO384(){
super();
}
| Create the engine. |
protected OperationSourceImpl(){
super();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public void push(EventQueue newEventQueue){
if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
getEventLog().fine("EventQueue.push(" + newEventQueue + ")");
}
pushPopLock.lock();
try {
EventQueue topQueue=this;
while (topQueue.nextQueue != null) {
topQueue=topQueue.nextQueue;
}
... | Replaces the existing <code>EventQueue</code> with the specified one. Any pending events are transferred to the new <code>EventQueue</code> for processing by it. |
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:58:04.513 -0500",hash_original_method="EBAE74DC80F9C6BC38A9630AD570AE77",hash_generated_method="A44B995D98502C226FF53B0B869781E4") public ServiceConfigurationError(String mess... | Constructs a new error with the given detail message. |
public LayerTreeNode(Layer layer){
super(layer != null ? layer.getName() : "");
if (layer == null) {
String message=Logging.getMessage("nullValue.LayerIsNull");
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
this.layer=layer;
this.initialize();
}
| Creates a new <code>LayerTreeNode</code> from the specified <code>layer</code>. The node's name is set to the layer's name. |
public boolean isPersist(){
return persist;
}
| Gets the value of the persist property. |
public static void deleteSection(final SQLProvider provider,final Section section) throws CouldntLoadDataException {
Preconditions.checkNotNull(provider,"Error: provider argument can not be null");
Preconditions.checkNotNull(section,"Error: section argument can not be null");
final String query=" { call delete_se... | Deletes a section from the database. |
public Matrix invert(){
if (rows != columns) {
throw new IllegalArgumentException("Only square matrices can be inverted");
}
Matrix work=augment(identity(rows));
work.gaussianElimination();
return work.submatrix(0,rows,columns,columns * 2);
}
| Returns the inverse of this matrix. |
protected boolean readRecords(DataInputStream is) throws IOException {
short functionId=1;
int recSize=0;
short recData;
numRecords=0;
while (functionId > 0) {
recSize=readInt(is);
recSize-=3;
functionId=readShort(is);
if (functionId <= 0) break;
MetaRecord mr=new MetaRecord();
switch ... | Reads the WMF file from the specified Stream. |
public void addStreamHost(final StreamHost host){
streamHosts.add(host);
}
| Adds a potential stream host that the remote user can transfer the file through. |
public MessageBuilder appendContent(String content,Styles styles){
this.content+=(styles.getMarkdown() + content + styles.getReverseMarkdown());
return this;
}
| Appends extra text to the current content with given style. |
protected final void fireVetoableChange(String propertyName,long oldValue,long newValue) throws PropertyVetoException {
fireVetoableChange(propertyName,Long.valueOf(oldValue),Long.valueOf(newValue));
}
| Support for reporting changes for constrained integer properties. This method can be called before a constrained property will be changed and it will send the appropriate PropertyChangeEvent to any registered VetoableChangeListeners. |
public void push(final float value){
int bits=Float.floatToIntBits(value);
if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) {
mv.visitInsn(Opcodes.FCONST_0 + (int)value);
}
else {
mv.visitLdcInsn(value);
}
}
| Generates the instruction to push the given value on the stack. |
public DGeneralSubtreeChooser(JFrame parent,String title,GeneralSubtree generalSubtree){
super(parent,title,ModalityType.DOCUMENT_MODAL);
initComponents(generalSubtree);
}
| Constructs a new DGeneralSubtreeChooser dialog. |
public static void resumeEventStream(Context context){
Log.d(LOG_TAG,"resumeEventStream");
sendEventStreamAction(context,EventStreamService.StreamAction.RESUME);
}
| Resume the events stream |
public void testNewClassLoaderHotRedeploymentPrivateMode() throws Exception {
processTestClassLoaderHotRedeployment(DeploymentMode.PRIVATE);
}
| Test GridDeploymentMode.ISOLATED mode. |
public FixedByteArrayBuffer(final byte[] buf,final int off,final int len){
super(off,len);
if (buf == null) throw new IllegalArgumentException("buf");
if (off + len > buf.length) throw new IllegalArgumentException("off+len>buf.length");
this.buf=buf;
}
| Create a slice of a byte[]. |
public ConnPoolByRoute(final ClientConnectionOperator operator,final HttpParams params){
super();
if (operator == null) {
throw new IllegalArgumentException("Connection operator may not be null");
}
this.operator=operator;
freeConnections=createFreeConnQueue();
waitingThreads=createWaitingThreadQueue();... | Creates a new connection pool, managed by route. |
public td[] addWindowFooters(){
if (m_table == null) return null;
td left=new td("windowFooter",AlignType.LEFT,AlignType.MIDDLE,false);
td right=new td("windowFooter",AlignType.RIGHT,AlignType.MIDDLE,false);
m_table.addElement(new tr().addElement(left).addElement(right));
return new td[]{left,right};
}
| Add Window Footer |
public static void initThreadsFlag(CFlags flags){
flags.registerOptional('T',THREADS_FLAG,Integer.class,INT,"number of threads (Default is the number of available cores)").setCategory(CommonFlagCategories.UTILITY);
}
| initialize flag to read number of threads. |
static final public Object deserialize(final byte[] b,final int off,final int len){
final ByteArrayInputStream bais=new ByteArrayInputStream(b,off,len);
try {
final ObjectInputStream ois=new ObjectInputStream(bais);
return ois.readObject();
}
catch ( Exception ex) {
throw new RuntimeException("off="... | De-serialize an object using the Java serialization mechanisms. |
private <ElementType extends Element>Iterator<? extends ElementType> elements(BiFunction<OrientGraph,Object[],Iterator<ElementType>> getElementsByIds,TriFunction<OrientGraph,OIndex<Object>,Iterator<Object>,Stream<? extends ElementType>> getElementsByIndex,Function<OrientGraph,Iterator<ElementType>> getAllElements){
f... | Gets an iterator over those vertices/edges that have the specific IDs wanted, or those that have indexed properties with the wanted values, or failing that by just getting all of the vertices or edges. |
public boolean createClient(String clientName,String orgValue,String orgName,String userClient,String userOrg,String phone,String phone2,String fax,String eMail,String taxID,String DUNS,String logoFile,int Country_ID){
log.info(clientName);
m_trx.start();
m_info=new StringBuffer();
String name=null;
String sq... | Create Client Info. - Client, Trees, Org, Role, User, User_Role |
@Override public void executeAction(Agent agent,Action action){
if (action instanceof QueenAction) {
QueenAction act=(QueenAction)action;
XYLocation loc=new XYLocation(act.getX(),act.getY());
if (act.getName() == QueenAction.PLACE_QUEEN) board.addQueenAt(loc);
else if (act.getName() == QueenActio... | Executes the provided action and returns null. |
public SearchRequest scroll(TimeValue keepAlive){
return scroll(new Scroll(keepAlive));
}
| If set, will enable scrolling of the search request for the specified timeout. |
public TaskList activateFullCopy(URI sourceURI,URI fullCopyURI) throws InternalException {
s_logger.info("START activate full copy {}",fullCopyURI);
Map<URI,BlockObject> resourceMap=BlockFullCopyUtils.verifySourceAndFullCopy(sourceURI,fullCopyURI,_uriInfo,_dbClient);
BlockObject fcSourceObj=resourceMap.get(source... | Manages the activation of the full copy with the passed URI for the source with the passed URI. For supported platforms, if the source is a volume and the volume is part of a consistency group, this method will also activate the corresponding full copies for all other volumes in the consistency group. |
@OnError public void onError(Session session,Throwable t){
callInternal("onError",session,t.getMessage());
logger.error(t.getMessage(),t);
}
| On error raised handler |
public boolean contains(char ch){
char[] thisBuf=buffer;
for (int i=0; i < this.size; i++) {
if (thisBuf[i] == ch) {
return true;
}
}
return false;
}
| Checks if the string builder contains the specified char. |
private void initKeyboardButtons(KeyboardView view){
mButtons=new ArrayList<>();
mButtons.add((KeyboardButtonView)view.findViewById(R.id.pin_code_button_0));
mButtons.add((KeyboardButtonView)view.findViewById(R.id.pin_code_button_1));
mButtons.add((KeyboardButtonView)view.findViewById(R.id.pin_code_button_2));
... | Init the keyboard buttons (onClickListener) |
protected AssociationRequest(AssociationSessionType type,DiffieHellmanSession dhSess){
if (DEBUG) _log.debug("Creating association request, type: " + type + "DH session: "+ dhSess);
if (type.isVersion2()) set("openid.ns",OPENID2_NS);
set("openid.mode",MODE_ASSOC);
set("openid.session_type",type.getSessionTy... | Constructs an AssociationRequest message with the specified association type and Diffie-Hellman session. |
public void testReceive_UnconnectedNull() throws Exception {
assertFalse(this.channel1.isConnected());
try {
this.channel1.receive(null);
fail("Should throw a NPE here.");
}
catch ( NullPointerException e) {
}
}
| Test method for 'DatagramChannelImpl.receive(ByteBuffer)' |
private void buildPieces(){
pieces=new Piece[pathArray.size()];
Paint paint=new Paint();
Matrix matrix=new Matrix();
Canvas canvas=new Canvas();
for (int i=0; i < pieces.length; i++) {
int shadow=Utils.nextInt(Utils.dp2px(2),Utils.dp2px(9));
Path path=pathArray.get(i);
RectF r=new RectF();
pat... | Build the final bitmap-pieces to draw in animation |
public synchronized void add(String k,String v){
grow();
keys[nkeys]=k;
values[nkeys]=v;
nkeys++;
}
| Adds a key value pair to the end of the header. Duplicates are allowed |
public ClusterJoinResponseMessage(ClusterJoinResponseMessage other){
__isset_bitfield=other.__isset_bitfield;
if (other.isSetHeader()) {
this.header=new AsyncMessageHeader(other.header);
}
this.newNodeId=other.newNodeId;
if (other.isSetNodeStore()) {
List<KeyedValues> __this__nodeStore=new ArrayList<K... | Performs a deep copy on <i>other</i>. |
public boolean isCanReport(){
Object oo=get_Value(COLUMNNAME_IsCanReport);
if (oo != null) {
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
| Get Can Report. |
@Override public void updateBinaryStream(int columnIndex,InputStream x,long length) throws SQLException {
try {
if (isDebugEnabled()) {
debugCode("updateBinaryStream(" + columnIndex + ", x, "+ length+ "L);");
}
checkClosed();
Value v=conn.createBlob(x,length);
update(columnIndex,v);
}
cat... | Updates a column in the current or insert row. |
public GenLOSDriver(ServerInterpreter server,String spaceName,LargeObjectSpace lospace,int blockSize,int threshold,boolean mainSpace){
super(server,spaceName,lospace,blockSize,threshold,mainSpace);
remsetStream=createRemsetStream();
resetData();
}
| Create a new driver for this collector |
public void populateUnmatchesFromMatches(){
this.unmatch.clear();
int previousMatchFinalIndex=0;
for ( DataSet.Bounds oneMatch : this.match) {
if (oneMatch.start > previousMatchFinalIndex) {
this.addUnmatchBounds(previousMatchFinalIndex,oneMatch.start);
}
previousMatchFinalIndex=oneMatch.end;
... | Creates fully annotated examples based on the provided matches (bounds) All chars are going to be annotated. |
public void timingEvent(float fraction){
alpha=fraction;
repaint();
}
| TimingTarget implementation: this method sets the alpha of our button to be equal to the current elapsed fraction of the animation |
public void rebind(String name,Object obj) throws NamingException {
rebind(nameParser.parse(name),obj);
}
| Rebinds object obj to String name. If there is existing binding it will be overwritten. |
public String formatCheckShareForExportCmd(String dataMover,List<VNXFileExport> exports,Map<String,String> userInfo,String netBios){
if (exports.isEmpty()) {
_log.debug("There is no entry to export");
return null;
}
String mountPoint=entryPathsDiffer(exports);
if (mountPoint == null) {
_log.debug("S... | Format check share for export cmd. |
@Override public void handleEvent(Event evt){
Element e=(Element)evt.getTarget();
if (SVGConstants.SVG_EVENT_MOUSEOVER.equals(evt.getType())) {
if (overclass != null) {
SVGUtil.addCSSClass(e,overclass);
}
if (outclass != null) {
SVGUtil.removeCSSClass(e,outclass);
}
}
if (SVGConstant... | Event handler |
public CameraCoordinateTransformer(boolean mirrorX,int displayOrientation,RectF previewRect){
if (!hasNonZeroArea(previewRect)) {
throw new IllegalArgumentException("previewRect");
}
mCameraToPreviewTransform=cameraToPreviewTransform(mirrorX,displayOrientation,previewRect);
mPreviewToCameraTransform=inverse... | Convert rectangles to / from camera coordinate and preview coordinate space. |
@SuppressWarnings({"HardCodedStringLiteral"}) public String toString(){
final String absolutePath=(file != null) ? file.getAbsolutePath() : "null";
return "File: " + absolutePath + "\nRepositoryFile: "+ rcsFileName+ "\nHead revision: "+ headRevision;
}
| Return a string representation of this object. Useful for debugging. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.