code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public void addAttributeCertificates(Store attrStore) throws CMSException {
certs.addAll(CMSUtils.getAttributeCertificatesFromStore(attrStore));
}
| Add the attribute certificates in attrStore to the certificate set to be included with the generated SignedData message. |
public static boolean isRFC1939Compatible(String uid){
if (uid == null) {
return false;
}
for (int i=0; i < uid.length(); i++) {
if ((uid.charAt(i) >= 0x21 && uid.charAt(i) <= 0x7E) == false) {
return false;
}
}
return true;
}
| Check whether POP3 UID is compatible with RFC1939 |
public boolean isPortOpen(){
return portOpen;
}
| Returns whether the target port is opened or not. |
public LabelView(Context context,AttributeSet attrs){
super(context,attrs);
initLabelView();
TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.LabelView);
CharSequence s=a.getString(R.styleable.LabelView_text);
if (s != null) {
setText(s.toString());
}
setTextColor(a.getColor(R.styleable.L... | Construct object, initializing with any attributes we understand from a layout file. These attributes are defined in SDK/assets/res/any/classes.xml. |
public synchronized void release(){
if (connection != null) {
connection.release();
connection=null;
readQueue.release();
readQueue=null;
}
}
| Terminate reader task and free all resources. Must be called following run(). |
@Nullable public StackTraceElement[] stackTraceElements(){
return stackTraceElements;
}
| User stack trace |
public <B>Source<B> as(Function<T,B> conversion,Function<B,T> backFunction){
return new Source<>(prngToValue.andThen(conversion),null,defaultAsString());
}
| Produces a Source of type B. The supplied backFunction will be used to allow shrinking of the produced values using the original strategy for type T. It is important that backFunction works for all values of T. |
public boolean isNull(){
return value.getValue() == null;
}
| Check if Value is null. |
private void loadAdminUsersId(String entidad) throws Exception {
DynamicTable tableInfo=new DynamicTable();
DynamicRows rowsInfo=new DynamicRows();
DynamicRow rowInfo=new DynamicRow();
UsersTable usrTbl=new UsersTable();
int counter;
BasicUserImpl user;
String qual;
DbConnection dbConn=new DbConnection(... | Obtiene los identificadores de los usuarios suceptibles de ser administradores del departamento. |
public void removeEventSourceListener(EventSourceListener listener){
LOG.entering(CLASS_NAME,"removeEventSourceListener",listener);
_getDelegate().removeEventSourceListener(listener);
}
| Removes the given EventSource listener from the listener list. |
public static boolean hasEmbeddedIPv4ClientAddress(Inet6Address ip){
return isCompatIPv4Address(ip) || is6to4Address(ip) || isTeredoAddress(ip);
}
| Examines the Inet6Address to determine if it is an IPv6 address of one of the specified address types that contain an embedded IPv4 address. <p>NOTE: ISATAP addresses are explicitly excluded from this method due to their trivial spoofability. With other transition addresses spoofing involves (at least) infection of one... |
public boolean isCellEditable(int row,int col){
switch (col) {
case ADDTOGROUPCOL:
return true;
default :
return false;
}
}
| This implementation can't edit the values yet |
public final int generateSecret(byte[] sharedSecret,int offset) throws IllegalStateException, ShortBufferException {
chooseFirstProvider();
return spi.engineGenerateSecret(sharedSecret,offset);
}
| Generates the shared secret, and places it into the buffer <code>sharedSecret</code>, beginning at <code>offset</code> inclusive. <p>If the <code>sharedSecret</code> buffer is too small to hold the result, a <code>ShortBufferException</code> is thrown. In this case, this call should be repeated with a larger output buf... |
public static boolean verify(int userId,int resourceId,ResourceType resourceType,OperationType operationType){
if (isAdmin(userId)) {
return true;
}
Resource userOwnedResource=resourceBiz.getResourceByUserAndResourceId(userId,resourceId,resourceType);
Resource groupOwnedResource=resourceBiz.getGroupResource... | Decide whether a user has permission to operate on specified resource |
public UserIdNotFoundException(String message,ReasonEnum reason,Throwable cause,Object[] params){
super(message,cause,params);
bean.setReason(reason);
setMessageKey(getMessageKey() + "." + reason.toString());
}
| Constructs a new exception with the given detail message, message parameters and cause, and appends the specified reason to the message key. |
public void testIndex() throws IOException {
Index index=Index.createIndex(indexDir.toString(),indexName);
NNInvertedIndex invidx=(NNInvertedIndex)index.getInvertedIndex();
assertEquals("" + NN,index.getProperties().get("nearest.neighbours"));
collection.reset();
collection.nextDocument();
QLFDocument<Quant... | test searching |
public Base64OutputStream(OutputStream out,int flags,boolean encode){
super(out);
this.flags=flags;
if (encode) {
coder=new Base64.Encoder(flags,null);
}
else {
coder=new Base64.Decoder(flags,null);
}
}
| Performs Base64 encoding or decoding on the data written to the stream, writing the encoded/decoded data to another OutputStream. |
protected void processConfDoc(Document doc){
Element rootElement=doc.getDocumentElement();
if ("true".equalsIgnoreCase(getAttrValue(rootElement,"use-query-string"))) setUseQueryString(true);
if ("true".equalsIgnoreCase(getAttrValue(rootElement,"use-context"))) {
log.debug("use-context set to true");
set... | Process dom document and populate Conf object. <p/> Note, protected so that is can be extended. |
public static int bkResultCode(Throwable throwable){
if (throwable instanceof BKException) {
return ((BKException)throwable).getCode();
}
return BKException.Code.UnexpectedConditionException;
}
| Return the bk exception return code for a <i>throwable</i>. |
public ParameterFlagGlobalConstraint(Parameter<? extends S> p,List<? extends ParameterConstraint<? super S>> c,Flag f,boolean flagConstraint){
param=p;
flag=f;
this.flagConstraint=flagConstraint;
cons=c;
}
| Constructs a global parameter constraint specifying that the testing of the parameter given for keeping the parameter constraints given is dependent on the status of the flag given. |
public boolean importPkcs12(){
return jrbPkcs12.isSelected();
}
| Has the user chosen to import from a PKCS #12 file? |
static public void showMethodWarning(String method){
showWarning(method + "() is not available with this renderer.");
}
| Display a warning that the specified method is simply unavailable. |
private static void createPattern(){
validIPV4Pattern=Pattern.compile(IPV4PATTERN,Pattern.CASE_INSENSITIVE);
validIPV6Pattern=Pattern.compile(IPV6PATTERN,Pattern.CASE_INSENSITIVE);
validEmailPattern=Pattern.compile(EMAILlPATTERN);
}
| Create Pattern to find email and IP address |
public void onFileChanged(Path file){
}
| Called for every file that was changed in the watched directory |
protected boolean comparePatterns(int[] pattern1,int[] pattern2){
int len=pattern1.length;
for (int i=0; i < len; i++) {
if (pattern1[i] != pattern2[i]) {
return false;
}
}
return true;
}
| compares two patterns |
public <T>ImmutableList<String> validate(T o,Class<?>... groups){
final Set<String> errors=Sets.newHashSet();
if (o == null) {
errors.add("request entity required");
}
else {
final Set<ConstraintViolation<T>> violations=factory.getValidator().validate(o,groups);
for ( ConstraintViolation<T> v : vi... | Validates the given object, and returns a list of error messages, if any. If the returned list is empty, the object is valid. |
protected void convertHomingShotToEntityTarget(){
ArtilleryAttackAction aaa=(ArtilleryAttackAction)waa;
final Coords tc=target.getPosition();
Targetable newTarget=null;
Vector<TagInfo> v=game.getTagInfo();
Vector<TagInfo> allowed=new Vector<TagInfo>();
for ( TagInfo ti : v) {
switch (ti.targetType) {
case ... | Find the tagged entity for this attack Each TAG will attract a number of shots up to its priority number (mode setting) When all the TAGs are used up, the shots fired are reset. So if you leave them all on 1-shot, then homing attacks will be evenly split, however many shots you fire. Priority setting is to allocate mor... |
public void insert(int offset,long[] values,int valOffset,int len){
if (offset == _pos) {
add(values,valOffset,len);
return;
}
ensureCapacity(_pos + len);
System.arraycopy(_data,offset,_data,offset + len,_pos - offset);
System.arraycopy(values,valOffset,_data,offset,len);
_pos+=len;
}
| Inserts a slice of the array of <tt>values</tt> into the list at <tt>offset</tt>. All values including and to the right of <tt>offset</tt> are shifted to the right. |
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,namesp... | Util method to write an attribute without the ns prefix |
private synchronized boolean canSubmit(long elapsedMs){
return !unsentRecords.isEmpty() && (flushRequested || elapsedMs >= lingerMs || unsentRecords.size() >= batchSize);
}
| Submission is possible when there are unsent records and: <ul> <li>flush is called, or</li> <li>the linger timeout passes, or</li> <li>there are sufficient records to fill a batch</li> </ul> |
public void testCertStore14() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException {
if (!initParams()) {
return;
}
CertStore certS;
for (int i=0; i < dValid.length; i++) {
certS=CertStore.getInstance(dValid[i],dParams,dProv);
assertEquals("Incorrect type",certS.getType(),dValid[i]);
... | Test for method <code>getInstance(String type, CertStoreParameters params, Provider provider)</code> Assertion: return CertStore object |
public void copyIntoArray(int fromStart,Object[] to,int toStart,int len){
System.arraycopy(objs,fromStart,to,toStart,len);
}
| Copies 'len' elements from the Bag into the provided array. The 'len' elements start at index 'fromStart' in the Bag, and are copied into the provided array starting at 'toStat'. |
public void assumePreconditionsSatisfied(){
for ( InputPort inputPort : getInputPorts().getAllPorts()) {
for ( Precondition precondition : inputPort.getAllPreconditions()) {
precondition.assumeSatisfied();
}
}
}
| Assumes that all preconditions are satisfied. This method is useful to query an operator for its output, given that it was wired correctly. |
MethodType methodType(){
return signatureType(basicTypeSignature());
}
| Return the method type corresponding to my basic type signature. |
@Override public void eUnset(int featureID){
switch (featureID) {
case UmplePackage.STATE_INTERNAL___COMMENT_1:
getComment_1().clear();
return;
case UmplePackage.STATE_INTERNAL___CHANGE_TYPE_1:
setChangeType_1(CHANGE_TYPE_1_EDEFAULT);
return;
case UmplePackage.STATE_INTERNAL___STATE_ENTITY_1:
getStateEntity_1().c... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public static LayoutData createHorizontallyEndAlignedLayoutData(int horizontalSpan){
return createLayoutData(Alignment.END,Alignment.CENTER,true,false,horizontalSpan,1);
}
| This is a shortcut method that will create a grid layout data object that will expand its cell as much as is can vertically and make the component occupy the whole area vertically and center it horizontally |
private void checkGpsAvailability(){
LocationManager service=(LocationManager)getSystemService(LOCATION_SERVICE);
boolean enabled=service.isProviderEnabled(LocationManager.GPS_PROVIDER);
if (!enabled) {
Intent intent=new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);
}
}
| check if GPS enabled and if not send user to the GSP settings |
synchronized public void saveContact(EaseUser user){
SQLiteDatabase db=dbHelper.getWritableDatabase();
ContentValues values=new ContentValues();
values.put(UserDao.COLUMN_NAME_ID,user.getUsername());
if (user.getNick() != null) values.put(UserDao.COLUMN_NAME_NICK,user.getNick());
if (user.getAvatar() != nul... | save a contact |
public int size(){
return SIZE;
}
| Return number of elements in collection. |
public LoginException(){
}
| Creates a new exception instance and initializes it with default values. |
public PISAAlgorithm(String name,Problem problem,Variation variation,Properties properties) throws IOException {
super(problem);
this.variation=variation;
TypedProperties typedProperties=new TypedProperties(properties);
String command=Settings.getPISACommand(name);
String configuration=Settings.getPISAConfigu... | Constructs an adapter for a PISA selector. |
public LeafNode(HNode node,SplitNode parentNode,String parentBranch){
m_theNode=node;
m_parentNode=parentNode;
m_parentBranch=parentBranch;
}
| Construct a leaf node with the given actual node, parent and parent branch |
public double empiricalHSICincompleteCholesky(TetradMatrix Gy,TetradMatrix Gx,int m){
int ky=Gy.columns();
int kx=Gx.columns();
TetradMatrix H=KernelUtils.constructH(m);
TetradMatrix Gcy=H.times(Gy);
TetradMatrix Gcx=H.times(Gx);
TetradMatrix Gcyt=Gcy.transpose();
TetradMatrix A=Gcyt.times(Gcx);
TetradM... | Empirical unconditional Hilbert-Schmidt Dependence Measure for X and Y using incomplete Cholesky decomposition to approximate Gram matrices |
protected boolean isConnectionOk(IoSession session){
SocketAddress remoteAddress=session.getRemoteAddress();
if (remoteAddress instanceof InetSocketAddress) {
InetSocketAddress addr=(InetSocketAddress)remoteAddress;
long now=System.currentTimeMillis();
lock.lock();
try {
if (clients.containsKe... | Method responsible for deciding if a connection is OK to continue |
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. |
protected boolean isPossibleToDequeueGroupFileTransfer(String chatId,Uri file,long size){
if (!isPossibleToDequeueFileTransfer(file,size)) {
return false;
}
if (!isPossibleToDequeueGroupChatMessagesAndGroupFileTransfers(chatId)) {
return false;
}
if (!mRcsSettings.getMyCapabilities().isFileTransferHtt... | Check if it is possible to dequeue group file transfer |
public ConsultaExcepcion(String message){
this(message,null);
}
| Construye un objeto de la clase. |
private void readObject(ObjectInputStream oos) throws IOException, ClassNotFoundException {
iInstant=(LocalDate)oos.readObject();
DateTimeFieldType type=(DateTimeFieldType)oos.readObject();
iField=type.getField(iInstant.getChronology());
}
| Reads the property from a safe serialization format. |
public void appendList(List<T> l){
if (l != null && l.size() > 0) {
this.list.addAll(l);
this.notifyDataSetChanged();
}
}
| Append the given items to the Adapter's list. |
public void paint(Graphics2D g){
g.setColor(val > 0 ? this.getForeground() : this.getBackground());
if (val >= 0) g.fillRect(width / 2,0,(int)(val * width / 2),height);
else g.fillRect(width / 2 + (int)(val * width / 2),0,(int)(-val * width / 2),height);
g.setColor(grey);
g.fillRect(width / 2 - 1,0,2,heigh... | Paints the component with the Graphics2D instance. This is used to paint our graphics manually. This is called once per refresh |
public static QueryExp between(ValueExp v1,ValueExp v2,ValueExp v3){
return new BetweenQueryExp(v1,v2,v3);
}
| Returns a query expression that represents the constraint that one value is between two other values. |
@Override protected void initViews(Bundle savedInstanceState){
}
| Initialize the view in the layout |
public String toString(){
String s="";
Enumeration names=getAttributeNames();
while (names.hasMoreElements()) {
Object key=names.nextElement();
Object value=getAttribute(key);
if (value instanceof AttributeSet) {
s=s + key + "=**AttributeSet** ";
}
else {
s=s + key + "="+ value+ " ";
... | Converts the attribute set to a String. |
List<CharsRef> applyAffix(char strippedWord[],int length,int affix,int prefixFlag,int recursionDepth,boolean prefix,boolean circumfix,boolean caseVariant) throws IOException {
affixReader.setPosition(8 * affix);
char flag=(char)(affixReader.readShort() & 0xffff);
affixReader.skipBytes(2);
int condition=(char)(a... | Applies the affix rule to the given word, producing a list of stems if any are found |
protected void computeTxFillLevel(){
if (isFullDuplex()) {
txInterruptFillLevel=tfc & TFC_TIL0_MASK;
}
else {
txInterruptFillLevel=tfc & TFC_TIL_MASK;
}
}
| Compute Tx FIFO Fill Level to generate interrupts Note: overridden in TxHSerialInterface |
private static int decode4to3(byte[] source,byte[] destination,int destOffset,byte[] decodabet){
if (source[0 + 2] == EQUALS_SIGN) {
int outBuff=((decodabet[source[0]] << 24) >>> 6) | ((decodabet[source[0 + 1]] << 24) >>> 12);
destination[destOffset]=(byte)(outBuff >>> 16);
return 1;
}
else if (sourc... | Decodes four bytes from array <var>source</var> and writes the resulting bytes (up to three of them) to <var>destination</var>. The source and destination arrays can be manipulated anywhere along their length by specifying <var>srcOffset</var> and <var>destOffset</var>. This method does not check to make sure your arra... |
public boolean isEmpty(){
return queue.isEmpty();
}
| Returns <code>true</code> if queue contains no elements. |
public Matrix4 avg(Matrix4[] t){
final float w=1.0f / t.length;
tmpVec.set(t[0].getScale(tmpUp).scl(w));
quat.set(t[0].getRotation(quat2).exp(w));
tmpForward.set(t[0].getTranslation(tmpUp).scl(w));
for (int i=1; i < t.length; i++) {
tmpVec.add(t[i].getScale(tmpUp).scl(w));
quat.mul(t[i].getRotation(qu... | Averages the given transforms and stores the result in this matrix. Translations and scales are lerped while rotations are slerped. Does not destroy the data contained in t. |
private String genBeanDescriptor(DocBeanInfo dbi){
String code="";
int beanflags=dbi.beanflags;
if ((beanflags & DocBeanInfo.EXPERT) != 0) code+=" sun.swing.BeanInfoUtils.EXPERT, Boolean.TRUE,\n";
if ((beanflags & DocBeanInfo.HIDDEN) != 0) code+=" sun.swing.BeanInfoUtils.HIDDEN, Boolean.T... | Generates a string for the BeanDescriptor |
public PcdRunner(DataWrapper dataWrapper,Parameters params){
super(dataWrapper,params,null);
}
| Constructs a wrapper for the given DataWrapper. The DataWrapper must contain a DataSet that is either a DataSet or a DataSet or a DataList containing either a DataSet or a DataSet as its selected model. |
@Override public boolean isFactoryForType(Object type){
return supportedTypes.contains(type) || super.isFactoryForType(type);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static void unbox(MethodVisitor mv,Class type){
if (type.isPrimitive() && type != Void.TYPE) {
String returnString="(Ljava/lang/Object;)" + BytecodeHelper.getTypeDescription(type);
mv.visitMethodInsn(INVOKESTATIC,DTT_CLASSNAME,type.getName() + "Unbox",returnString,false);
}
}
| Generates the bytecode to unbox the current value on the stack |
@Override public String toString(){
return "CUmodule[" + "nativePointer=0x" + Long.toHexString(getNativePointer()) + "]";
}
| Returns a String representation of this object. |
public static byte[] readData(final InputStream input) throws IOException {
final byte[] inputBuffer=new byte[BUFFER_LENGTH];
final ByteArrayOutputStream byteOutput=new ByteArrayOutputStream(BUFFER_LENGTH);
int bytesRead;
while ((bytesRead=input.read(inputBuffer)) != -1) {
byteOutput.write(inputBuffer,0,byt... | Reads all the data from the supplied InputStream into a byte array. |
static <T>ListIterator<T> cast(Iterator<T> iterator){
return (ListIterator<T>)iterator;
}
| Used to avoid http://bugs.sun.com/view_bug.do?bug_id=6558557 |
public void stop() throws Exception {
ldapServer.stop();
directoryService.shutdown();
}
| Stops LDAP server and the underlying directory service. |
public IterationObject(IterationObject parent){
this.id=parent.getId();
this.created=parent.getCreated();
this.status=parent.getStatus();
this.startTime=parent.getStartTime();
this.endTime=parent.getEndTime();
this.creatorId=parent.getCreatorId();
this.projectId=parent.getProjectId();
this.companyId=par... | This method was generated by MyBatis Generator. This method corresponds to the database table iteration |
@Override protected void onNotice(String sourceNick,String sourceLogin,String sourceHostname,String target,String notice){
Conversation conversation;
if (service.getSettings().showNoticeInServerWindow()) {
conversation=server.getConversation(ServerInfo.DEFAULT_NAME);
}
else {
conversation=server.getConve... | On Notice |
public static void studentLockerChanges(String[] lockers){
int start=0;
for (int s=1; s <= lockers.length; s++) {
for (int l=0; l < lockers.length; l+=s) {
if (isOpen(lockers[l])) lockers[l]="CLOSED";
else lockers[l]="OPEN";
}
start++;
}
}
| studentLockerChanges changes the string in each element from "CLOSED" to "OPEN" or Vice versa |
private static COperandTree generateTree(final OperandTree rawTree,final SQLProvider provider,final INaviModule module){
final ArrayList<COperandTreeNode> realNodes=new ArrayList<COperandTreeNode>();
final HashMap<COperandTreeNode,OperandTreeNode> realToRawMapping=new HashMap<COperandTreeNode,OperandTreeNode>();
... | Converts a raw operand tree into a proper operand tree. |
public void insert(int offset,double[] values){
insert(offset,values,0,values.length);
}
| Inserts the array of <tt>values</tt> into the list at <tt>offset</tt>. All values including and to the right of <tt>offset</tt> are shifted to the right. |
public static EntropyCalculatorDiscrete newInstance(int blocksize,int base){
return new BlockEntropyCalculatorDiscrete(blocksize,base);
}
| User was formerly forced to create new instances through this factory method. Retained for backwards compatibility. |
public CRemoveTagFromAllNodesAction(final JFrame parent,final ZyGraph graph,final CTag tag){
super("Remove Tag from all Nodes");
Preconditions.checkNotNull(parent,"IE01254: Parent argument can not be null");
Preconditions.checkNotNull(graph,"IE01255: Graph argument can not be null");
Preconditions.checkNotNull(... | Creates a new action object. |
protected void clearError(){
synchronized (lock) {
ioError=false;
}
}
| Sets the error state of the stream to false. |
public SecureShellAgent(final String host,final int port,final String user,final Path privateKeyFileAbsolutePath) throws AgentException {
try {
session=getSession(host,port,user);
jsch.addIdentity(privateKeyFileAbsolutePath.toString());
}
catch ( Exception e) {
String errorMessage=format("Can't connec... | Create ssh session object and try to connect to remote host by using auth key. |
public LZ3(){
super(30,2,21,23,1);
}
| Constructs the F3 problem with default parameters. |
public void testTypical(){
Instances result=useFilter();
assertEquals(m_Instances.numAttributes(),result.numAttributes());
assertEquals(m_Instances.numInstances(),result.numInstances());
Attribute mergedAtt=result.attribute(4);
assertTrue("Attribute 5 has all values merged in result",mergedAtt.value(0).equals... | Tests default setup. |
@SuppressWarnings("unchecked") private void processMethods(){
List<MethodNode> methodNodes=cn.methods;
for ( MethodNode mn : methodNodes) {
if ((mn.access & Opcodes.ACC_NATIVE) == Opcodes.ACC_NATIVE) continue;
if (DescriptorMapping.getInstance().isTransformedMethod(className,mn.name,mn.desc)) {
l... | Handle transformation of methods defined in this class |
public static Comparator<Long> longComparator(){
return LONG_COMPARATOR;
}
| Instance assessor for the <code>Comparator</code> for <code>Long</code>s. This is necessary because the <code>Long</code> class did not implement <code>Comparable</code> in Java 1.1.8. This is an instance because the <code>LongComparator</code> has no state, allowing a single instance to be used whenever a <code>Com... |
public void deinstall(JTextComponent c){
if (!(c instanceof RTextArea)) throw new IllegalArgumentException("c must be instance of RTextArea");
super.deinstall(c);
}
| Called when the UI is being removed from the interface of a JTextComponent. This is used to unregister any listeners that were attached. |
private int readNextWithEOF(boolean ignoreComments) throws CoreException {
int curr=0;
do {
try {
curr=fScanner.getNextToken();
}
catch ( InvalidInputException e) {
throw new CoreException(createError(LEXICAL_ERROR,e.getMessage(),e));
}
}
while (ignoreComments && isComment(curr));
r... | Reads the next token. |
private static UTF8StreamWriter utf8StreamWriter(){
SoftReference<UTF8StreamWriter> ref=utf8StreamWriter.get();
UTF8StreamWriter writer=(ref == null) ? null : ref.get();
if (writer == null) {
writer=new UTF8StreamWriter(1024 * 4);
utf8StreamWriter.set(new SoftReference<>(writer));
}
writer.reset();
... | If exists, reset and return, otherwise create, reset and return a writer. |
public SslToServiceAuth(){
requestFileName="getstate.query";
responseFile="getstate.answer";
}
| Constructs the test case. |
Entry kill(){
Entry entry;
for (int i=entries.size() - 1; i >= 0; i--) {
entry=entries.get(i);
if (!entry.dead) {
entry.dead=true;
return entry;
}
}
throw new IllegalStateException("There is no entry to kill");
}
| Kill the latest alive entry |
public GeneratorConfigurationItemProvider(AdapterFactory adapterFactory){
super(adapterFactory);
}
| This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc --> |
public void removeComponent(Component component){
components.removeValue(component,true);
}
| Removes a component. |
public void gcspyGatherData(int event,TreadmillDriver losDriver){
((LargeObjectSpace)space).getTreadmill().gcspyGatherData(event,losDriver);
}
| Gather data for GCSpy from the nursery |
@Override public boolean equals(Object o){
if (o instanceof DateTime) {
return this.value == ((DateTime)o).value;
}
else if (o instanceof Date) {
return this.value == ((Date)o).getTime();
}
else {
return false;
}
}
| Compares instance with DateTime or Date objects. Does not take the tzShift value into account. Therefore, two DateTime objects are equal independent to the time zone they refer to. Equals with a instance of java.util.Date is asymmetric. |
public void commit(boolean onSave){
String expression=this.expressionEvalInput.getDocument().get();
getModel().unsavedSetEvalExpression(expression);
super.commit(onSave);
}
| Save data back to model |
public static BufferedImage createCompatibleImage(BufferedImage image,int width,int height){
return getGraphicsConfiguration().createCompatibleImage(width,height,image.getTransparency());
}
| <p>Returns a new compatible image of the specified width and height, and the same transparency setting as the image specified as a parameter.</p> |
public void endDocument() throws SAXException {
if (documentHandler != null) documentHandler.endDocument();
}
| End document event. |
private void dumpNPC(PreparedStatement stmt,SpeakerNPC npc) throws SQLException {
stmt.setString(1,npc.getName());
stmt.setString(2,npc.getTitle());
stmt.setString(3,npc.get("class"));
stmt.setString(4,getOutfit(npc));
stmt.setInt(5,npc.getHP());
stmt.setInt(6,npc.getBaseHP());
stmt.setString(7,npc.getZon... | dumps the properties of the specified SpeakerNPC into the prepared statement as an operation in a batch. |
void release(){
imageLoader.cancelPendingRequests();
loading=new boolean[noxItems.size()];
}
| Cancels all the pending NoxItem downloads to the ImageLoader. |
public synchronized void flush() throws IOException {
checkNotClosed();
trimToSize();
journalWriter.flush();
}
| Force buffered operations to the filesystem. |
public static void beforeClass(){
Assert.assertTrue("Given spec file does not exist: " + specA,new File(specA).exists());
RCPTestSetupHelper.beforeClass();
}
| Pre flight checks (run once for each test _class_) |
public TungstenProperties loadPasswordsAsTungstenProperties() throws ServerRuntimeException {
this.passwordsProperties=SecurityHelper.loadPasswordsFromAuthenticationInfo(this.authenticationInfo);
return passwordsProperties;
}
| Passwords loaded from file as TungstenProperties. Example: getPasswordsAsTungstenProperties.get(username); |
public Vector3D addU(Vector3D a){
x+=a.x;
y+=a.y;
z+=a.z;
return (this);
}
| Add two Vector3Ds (modifies this Vector3D). |
static int applyMaskPenaltyRule4(ByteMatrix matrix){
int numDarkCells=0;
byte[][] array=matrix.getArray();
int width=matrix.getWidth();
int height=matrix.getHeight();
for (int y=0; y < height; y++) {
byte[] arrayY=array[y];
for (int x=0; x < width; x++) {
if (arrayY[x] == 1) {
numDarkCel... | Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance. |
public synchronized Object recover() throws IOException {
if (Debug) System.err.println("log.debug: recover()");
if (version == 0) return null;
Object snapshot;
String fname=versionName(snapshotPrefix);
File snapshotFile=new File(fname);
InputStream in=new BufferedInputStream(new FileInputStream(snapsho... | Returns an object which is the value recorded in the current snapshot. This snapshot is recovered by calling the client supplied callback "recover" and then subsequently invoking the "readUpdate" callback to apply any logged updates to the state. |
@Override public int eDerivedOperationID(int baseOperationID,Class<?> baseClass){
if (baseClass == ReferencingElement_IM.class) {
switch (baseOperationID) {
case ImPackage.REFERENCING_ELEMENT_IM___GET_ORIGINAL_TARGET_OF_REWIRED_TARGET:
return ImPackage.PARAMETERIZED_PROPERTY_ACCESS_EXPRESSION_IM___GET_ORIGINAL_... | <!-- begin-user-doc --> <!-- end-user-doc --> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.