code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
---|---|
private int[] toIntArray(String input){
int[] result={};
if (input.length() > 0) {
String beforeSplit=input.replaceAll("\\[|\\]|\\s","");
String[] split=beforeSplit.split("\\,");
result=new int[split.length];
for (int i=0; i < split.length; i++) {
result[i]=Integer.parseInt(split[i]);
}
}
return result;
}
| convert result of Arrays.toString(int[]) back into int[] |
public static DelimiterType serializableInstance(){
return DelimiterType.TAB;
}
| Generates a simple exemplar of this class to test serialization. |
public static ColumnName parse(String defaultSchema,String s){
String[] parts=Strings.parseQualifiedName(s,3);
return new ColumnName(parts[0].isEmpty() ? defaultSchema : parts[0],parts[1],parts[2]);
}
| Parse a qualified string (e.g. test.foo.id) into a ColumnName. |
@NotNull @ObjectiveCName("doSignupWithName:withSex:withTransaction:") public Promise<AuthRes> doSignup(String name,Sex sex,String transactionHash){
return modules.getAuthModule().doSignup(name,sex,transactionHash);
}
| Signing Up |
public WriteException(WriteRequest request){
super();
this.requests=asRequestList(request);
}
| Creates a new exception. |
public GenericObjectEditorDialog(Frame owner,String title){
super(owner,title);
}
| Creates a modeless dialog with the specified title and with the specified owner frame. |
public RgbFilterEditor(){
panel.setLayout(layout);
panel.setBorder(new CompoundBorder(new TitledBorder("RGB Filter Editor"),new EmptyBorder(BORDER_SPACING,BORDER_SPACING,BORDER_SPACING,BORDER_SPACING)));
JLabel redLabel=new JLabel("Red");
JLabel greenLabel=new JLabel("Green");
JLabel blueLabel=new JLabel("Blue");
JLabel lowerLabel=new JLabel("Output Lower Bound");
JLabel upperLabel=new JLabel("Output Upper Bound");
add(redLabel,red);
add(greenLabel,green);
add(blueLabel,blue);
add(lowerLabel,lower);
add(upperLabel,upper);
}
| Creates a new instance. |
public static int UTF8toUTF16(byte[] utf8,int offset,int length,char[] out){
int out_offset=0;
final int limit=offset + length;
while (offset < limit) {
int b=utf8[offset++] & 0xff;
if (b < 0xc0) {
assert b < 0x80;
out[out_offset++]=(char)b;
}
else if (b < 0xe0) {
out[out_offset++]=(char)(((b & 0x1f) << 6) + (utf8[offset++] & 0x3f));
}
else if (b < 0xf0) {
out[out_offset++]=(char)(((b & 0xf) << 12) + ((utf8[offset] & 0x3f) << 6) + (utf8[offset + 1] & 0x3f));
offset+=2;
}
else {
assert b < 0xf8 : "b = 0x" + Integer.toHexString(b);
int ch=((b & 0x7) << 18) + ((utf8[offset] & 0x3f) << 12) + ((utf8[offset + 1] & 0x3f) << 6)+ (utf8[offset + 2] & 0x3f);
offset+=3;
if (ch < UNI_MAX_BMP) {
out[out_offset++]=(char)ch;
}
else {
int chHalf=ch - 0x0010000;
out[out_offset++]=(char)((chHalf >> 10) + 0xD800);
out[out_offset++]=(char)((chHalf & HALF_MASK) + 0xDC00);
}
}
}
return out_offset;
}
| Interprets the given byte array as UTF-8 and converts to UTF-16. It is the responsibility of the caller to make sure that the destination array is large enough. <p> NOTE: Full characters are read, even if this reads past the length passed (and can result in an ArrayOutOfBoundsException if invalid UTF-8 is passed). Explicit checks for valid UTF-8 are not performed. |
public XPathExtractor registerNamespace(String prefix,String url){
this.namespaces.add(Namespace.getNamespace(prefix,url));
return this;
}
| register xml namespace |
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){
switch (featureID) {
case GamlPackage.TYPE_INFO__FIRST:
return getFirst();
case GamlPackage.TYPE_INFO__SECOND:
return getSecond();
}
return super.eGet(featureID,resolve,coreType);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter,java.lang.String namespace) throws javax.xml.stream.XMLStreamException {
java.lang.String prefix=xmlWriter.getPrefix(namespace);
if (prefix == null) {
prefix=generatePrefix(namespace);
while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) {
prefix=org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
}
xmlWriter.writeNamespace(prefix,namespace);
xmlWriter.setPrefix(prefix,namespace);
}
return prefix;
}
| Register a namespace prefix |
private void waitForTopicAssignmentsToComplete() throws InterruptException {
while (!_zkUtils.getPartitionsBeingReassigned().isEmpty()) {
try {
LOG.debug("Waiting for current partition assignment to be complete.");
Thread.sleep(1000);
}
catch ( InterruptedException e) {
throw new IllegalStateException(e);
}
}
}
| Wait for all topic assignments to complete. |
@POST @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("/{id}/quota-directories") @CheckPermission(roles={Role.TENANT_ADMIN},acls={ACL.OWN,ACL.ALL}) public TaskResourceRep createQuotaDirectory(@PathParam("id") URI id,QuotaDirectoryCreateParam param) throws InternalException {
_log.info("FileService::createQtree Request recieved {}",id);
String origQtreeName=param.getQuotaDirName();
ArgValidator.checkQuotaDirName(origQtreeName,"name");
ArgValidator.checkFieldMaximum(param.getSoftLimit(),100,"softLimit");
ArgValidator.checkFieldMaximum(param.getNotificationLimit(),100,"notificationLimit");
if (param.getSoftLimit() != 0L) {
ArgValidator.checkFieldMinimum(param.getSoftGrace(),1L,"softGrace");
}
checkForDuplicateName(origQtreeName,QuotaDirectory.class,id,"parent",_dbClient);
String task=UUID.randomUUID().toString();
ArgValidator.checkFieldUriType(id,FileShare.class,"id");
if (param.getSecurityStyle() != null) {
ArgValidator.checkFieldValueFromEnum(param.getSecurityStyle(),"security_style",EnumSet.allOf(QuotaDirectory.SecurityStyles.class));
}
FileShare fs=queryResource(id);
ArgValidator.checkEntity(fs,id,isIdEmbeddedInURL(id));
QuotaDirectory quotaDirectory=new QuotaDirectory();
quotaDirectory.setId(URIUtil.createId(QuotaDirectory.class));
quotaDirectory.setParent(new NamedURI(id,origQtreeName));
quotaDirectory.setLabel(origQtreeName);
quotaDirectory.setOpStatus(new OpStatusMap());
quotaDirectory.setProject(new NamedURI(fs.getProject().getURI(),origQtreeName));
quotaDirectory.setTenant(new NamedURI(fs.getTenant().getURI(),origQtreeName));
quotaDirectory.setSoftLimit(param.getSoftLimit() != 0 ? param.getSoftLimit() : fs.getSoftLimit() != null ? fs.getSoftLimit().intValue() : 0);
quotaDirectory.setSoftGrace(param.getSoftGrace() != 0 ? param.getSoftGrace() : fs.getSoftGracePeriod() != null ? fs.getSoftGracePeriod() : 0);
quotaDirectory.setNotificationLimit(param.getNotificationLimit() != 0 ? param.getNotificationLimit() : fs.getNotificationLimit() != null ? fs.getNotificationLimit().intValue() : 0);
String convertedName=origQtreeName.replaceAll("[^\\dA-Za-z_]","");
_log.info("FileService::QuotaDirectory Original name {} and converted name {}",origQtreeName,convertedName);
quotaDirectory.setName(convertedName);
if (param.getOpLock() != null) {
quotaDirectory.setOpLock(param.getOpLock());
}
else {
quotaDirectory.setOpLock(true);
}
if (param.getSecurityStyle() != null) {
quotaDirectory.setSecurityStyle(param.getSecurityStyle());
}
else {
quotaDirectory.setSecurityStyle(SecurityStyles.parent.toString());
}
if (param.getSize() != null) {
Long quotaSize=SizeUtil.translateSize(param.getSize());
ArgValidator.checkFieldMaximum(quotaSize,fs.getCapacity(),SizeUtil.SIZE_B,"size",true);
quotaDirectory.setSize(quotaSize);
}
else {
quotaDirectory.setSize((long)0);
}
fs.setOpStatus(new OpStatusMap());
Operation op=new Operation();
op.setResourceType(ResourceOperationTypeEnum.CREATE_FILE_SYSTEM_QUOTA_DIR);
quotaDirectory.getOpStatus().createTaskStatus(task,op);
fs.getOpStatus().createTaskStatus(task,op);
_dbClient.createObject(quotaDirectory);
_dbClient.persistObject(fs);
FileShareQuotaDirectory qt=new FileShareQuotaDirectory(quotaDirectory);
StorageSystem device=_dbClient.queryObject(StorageSystem.class,fs.getStorageDevice());
FileController controller=getController(FileController.class,device.getSystemType());
try {
controller.createQuotaDirectory(device.getId(),qt,fs.getId(),task);
}
catch ( InternalException e) {
quotaDirectory.setInactive(true);
_dbClient.persistObject(quotaDirectory);
throw e;
}
auditOp(OperationTypeEnum.CREATE_FILE_SYSTEM_QUOTA_DIR,true,AuditLogManager.AUDITOP_BEGIN,quotaDirectory.getLabel(),quotaDirectory.getId().toString(),fs.getId().toString());
fs=_dbClient.queryObject(FileShare.class,id);
_log.debug("FileService::QuotaDirectory Before sending response, FS ID : {}, Taks : {} ; Status {}",fs.getOpStatus().get(task),fs.getOpStatus().get(task).getStatus());
return toTask(quotaDirectory,task,op);
}
| Create Quota directory for a file system <p> NOTE: This is an asynchronous operation. |
public static void copyProperties(Properties from,Properties to){
Enumeration<Object> keys=from.keys();
while (keys.hasMoreElements()) {
String key=(String)keys.nextElement();
to.put(key,from.getProperty(key));
}
}
| Copy the contents from one properties object to another. |
private int digitCount(String text,int position,int amount){
int limit=Math.min(text.length() - position,amount);
amount=0;
for (; limit > 0; limit--) {
char c=text.charAt(position + amount);
if (c < '0' || c > '9') {
break;
}
amount++;
}
return amount;
}
| Returns actual amount of digits to parse, but no more than original 'amount' parameter. |
public void postActionNotification(NotificationOptions options){
NotificationCompat.Builder builder=new NotificationCompat.Builder(this);
builder.setSmallIcon(options.getSmallIconResourceId());
builder.setContentTitle(options.getTitle());
builder.setContentText(options.getContent());
builder.setDefaults(options.getNotificationDefaults());
builder.setPriority(options.getNotificationPriority());
builder.setVibrate(options.getVibratePattern());
if (options.getActions() != null) {
for ( NotificationCompat.Action action : options.getActions()) {
builder.addAction(action);
}
}
NotificationManagerCompat notificationManager=NotificationManagerCompat.from(this);
notificationManager.notify(options.getNotificationId(),builder.build());
}
| Builds and posts a notification from a set of options. |
public CPFCNPJTextWatcher(EventoDeValidacao callbackErros){
setEventoDeValidacao(callbackErros);
}
| TODO Javadoc pendente |
AgentRoster(Connection connection,String workgroupJID){
this.connection=connection;
this.workgroupJID=workgroupJID;
entries=new ArrayList<String>();
listeners=new ArrayList<AgentRosterListener>();
presenceMap=new HashMap<String,Map<String,Presence>>();
PacketFilter rosterFilter=new PacketTypeFilter(AgentStatusRequest.class);
connection.addPacketListener(new AgentStatusListener(),rosterFilter);
connection.addPacketListener(new PresencePacketListener(),new PacketTypeFilter(Presence.class));
AgentStatusRequest request=new AgentStatusRequest();
request.setTo(workgroupJID);
connection.sendPacket(request);
}
| Constructs a new AgentRoster. |
private String columnInfoMySQL(ArrayList<Column> columns){
if (columns != null && columns.size() > 0) {
StringBuffer sb=new StringBuffer();
if (checkColumnNames || checkColumnTypes) {
for (int i=0; i < columns.size(); i++) {
if (i > 0) sb.append(',');
if (checkColumnNames) sb.append(columns.get(i).getName());
if (checkColumnNames && checkColumnTypes) sb.append(" ");
if (checkColumnTypes) sb.append(columns.get(i).getType());
}
}
return sb.toString();
}
else {
return null;
}
}
| Constructs a comma-separated list of column names (if checkColumnNames) and their corresponding types (java.sql.Types) (if checkColumnTypes). |
public void fireMapViewEvent(MapViewEvent e){
for ( MapViewEventListener listener : eventListeners) listener.eventHappened(e);
}
| Informs all interested listener about view events such as mouse events and data changes. |
@Override public void configureZone(final StendhalRPZone zone,final Map<String,String> attributes){
buildentwife(zone);
}
| Configure a zone. |
private void processSpecies(final RoundEnvironment env){
final List<? extends Element> species=sortElements(env,species.class);
for ( final Element e : species) {
final species spec=e.getAnnotation(species.class);
final StringBuilder sb=new StringBuilder();
sb.append(SPECIES_PREFIX);
sb.append(spec.name()).append(SEP);
sb.append(rawNameOf(e));
for ( final String s : spec.skills()) {
sb.append(SEP).append(s);
}
final doc[] docs=spec.doc();
doc doc;
if (docs.length == 0) {
doc=e.getAnnotation(doc.class);
}
else {
doc=docs[0];
}
if (doc == null) {
emitWarning("GAML: species '" + spec.name() + "' is not documented",e);
}
gp.put(sb.toString(),"");
}
}
| Format : prefix 0.name 1.class 2.[skill$] |
private static long xlongBinomial(long n,long k){
return Math.round(binomial(n,k));
}
| Equivalent to <tt>Math.round(binomial(n,k))</tt>. |
public static void main(final String[] args){
DOMTestCase.doMain(hc_characterdatadeletedataexceedslength.class,args);
}
| Runs this test from the command line. |
public void paintComponent(Graphics graphics){
int x;
int y;
measure();
Dimension d=this.getSize();
y=lineAscent + (d.height - (numLines * lineHeight)) / 2;
Toolkit tk=Toolkit.getDefaultToolkit();
Map desktopHints=(Map)(tk.getDesktopProperty("awt.font.desktophints"));
Graphics2D g2d=(Graphics2D)graphics;
if (desktopHints != null) {
g2d.addRenderingHints(desktopHints);
}
for (int i=0; i < numLines; i++) {
y+=lineHeight;
switch (alignment) {
case LEFT:
x=marginWidth;
break;
case CENTER:
x=(d.width - lineWidth[i]) / 2;
break;
case RIGHT:
x=d.width - marginWidth - lineWidth[i];
break;
default :
x=(d.width - lineWidth[i]) / 2;
}
graphics.drawString(line.elementAt(i),x,y - lineDescent);
}
}
| This method draws the label. |
public static void performAndWaitForWindowChange(SWTBot bot,Runnable runnable){
SWTBotShell shell=bot.activeShell();
runnable.run();
waitUntilShellIsNotActive(bot,shell);
}
| Simple wrapper to block for actions that either open or close a window. |
public boolean isDefaultNamespaceDefined(){
return this.defaultNamespace != null;
}
| Check if the default namespace has been set. |
public void removeLayoutComponent(Component comp){
invalidateLayout(comp.getParent());
}
| Removes the specified component from the layout. Used by this class to know when to invalidate layout. |
public boolean offer(E e,long timeout,TimeUnit unit) throws InterruptedException {
if (e == null) throw new NullPointerException();
long nanos=unit.toNanos(timeout);
int c=-1;
final ReentrantLock putLock=this.putLock;
final AtomicInteger count=this.count;
putLock.lockInterruptibly();
try {
while (count.get() >= capacity) {
if (nanos <= 0) return false;
nanos=notFull.awaitNanos(nanos);
}
enqueue(e);
c=count.getAndIncrement();
if (c + 1 < capacity) notFull.signal();
}
finally {
putLock.unlock();
}
if (c == 0) signalNotEmpty();
return true;
}
| Inserts the specified element at the tail of this queue, waiting if necessary up to the specified wait time for space to become available. |
protected void parseFontFaceRule(){
try {
documentHandler.startFontFace();
if (current != LexicalUnits.LEFT_CURLY_BRACE) {
reportError("left.curly.brace");
}
else {
nextIgnoreSpaces();
try {
parseStyleDeclaration(true);
}
catch ( CSSParseException e) {
reportError(e);
}
}
}
finally {
documentHandler.endFontFace();
}
}
| Parses a font-face rule. |
private Optional<String> processResponse(long start,int maxRecords,BatchMaker batchMaker) throws StageException {
Optional<String> newSourceOffset=Optional.absent();
int status=response.getStatus();
if (status < 200 || status >= 300) {
lastRequestCompletedTime=System.currentTimeMillis();
String reason=response.getStatusInfo().getReasonPhrase();
String respString=response.readEntity(String.class);
response.close();
response=null;
errorRecordHandler.onError(Errors.HTTP_01,status,reason + " : " + respString);
return newSourceOffset;
}
if (conf.pagination.mode == PaginationMode.LINK_HEADER) {
next=response.getLink("next");
if (next == null) {
haveMorePages=false;
}
}
if (response.hasEntity()) {
newSourceOffset=Optional.of(parseResponse(start,maxRecords,batchMaker));
}
return newSourceOffset;
}
| Verifies that the response was a successful one and has data and continues to parse the response. |
private CachedCRL findCrlInDB(String key) throws SQLException {
Connection c=null;
PreparedStatement s=null;
ResultSet rs=null;
try {
c=getDataSource().getConnection();
s=c.prepareStatement(sqlFindQuery);
s.setString(1,key);
rs=s.executeQuery();
if (rs.next()) {
CachedCRL cached=new CachedCRL();
cached.setKey(rs.getString(sqlFindQueryId));
cached.setCrl(rs.getBytes(sqlFindQueryData));
return cached;
}
}
finally {
closeQuietly(c,s,rs);
}
return null;
}
| Get the cached CRL from the datasource |
public void paint(Graphics a,JComponent b){
for (int i=0; i < uis.size(); i++) {
((ComponentUI)(uis.elementAt(i))).paint(a,b);
}
}
| Invokes the <code>paint</code> method on each UI handled by this object. |
public void start(){
if (runner == null) {
runner=new Thread(this,"Runner");
runner.start();
}
}
| we're starting the thread |
private static boolean relationExists(Organization customer,Organization supplier){
boolean result=false;
List<OrganizationReference> supplierOrgReferences=customer.getSourcesForType(OrganizationReferenceType.getOrgRefTypeForSourceRoles(supplier.getGrantedRoleTypes()));
for ( OrganizationReference orgRef : supplierOrgReferences) {
if (orgRef.getSource() == supplier) {
result=true;
break;
}
}
return result;
}
| Checks if the supplier-customer-relation exists between the supplier and the customer organization |
public boolean isOracle(){
return false;
}
| Is Oracle DB |
public static String toString(URL url) throws IOException {
return toString(url,null);
}
| Gets the contents at the given URL. |
public void addPart(String name,String hashMethod,byte[] data){
parts.add(new MessagePart(name,hashMethod,data));
}
| Adds new hash to be verified. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
@RequestMapping(value="/application/{applicationName}/rows/{nbRows}",method=RequestMethod.GET) public @ResponseBody List<Message> listMessagesForApplication(@PathVariable final String applicationName,@PathVariable final Integer nbRows) throws ServiceException, CheckException {
if (logger.isDebugEnabled()) {
logger.debug("--CALL LIST APPLICATION ACTIONS--");
logger.debug("applicationName = " + applicationName);
logger.debug("nbRows = " + nbRows);
}
User user=authentificationUtils.getAuthentificatedUser();
String applicationNameLocal=applicationName.replaceAll("[^a-z]","");
return messageService.listByApp(user,applicationNameLocal,nbRows);
}
| Retourne tous les messages d'un utilisateur pour une application |
private void validateCertPath(CertPath certPath,Collection<Object> crlCollection,CertStore certStore,AlternativeOCSP altOCSP) throws CertificateRevocationCheckException, IdmCertificateRevokedException {
setupOCSPOptions(certPath,altOCSP);
PKIXParameters params=createPKIXParameters(crlCollection);
if (null != certStore) {
params.addCertStore(certStore);
}
CertPathValidator certPathValidator;
try {
certPathValidator=CertPathValidator.getInstance("PKIX");
}
catch ( NoSuchAlgorithmException e) {
throw new CertificateRevocationCheckException("Error getting PKIX validator instance:" + e.getMessage(),e);
}
try {
String pkiParam=params.toString();
logger.trace("**Certificate Path Validation Parameters trust anchors **\n" + params.getTrustAnchors().toString() + "\n");
logger.trace("**Certificate Path Validation Parameters **\n" + pkiParam + "\n");
CertPathValidatorResult result=certPathValidator.validate(certPath,params);
logger.trace("**Certificate Path Validation Result **\n" + result.toString() + "\n");
}
catch ( CertPathValidatorException e) {
if (e.getReason() == CertPathValidatorException.BasicReason.REVOKED) {
throw new IdmCertificateRevokedException("CRL shows certificate status as revoked");
}
else if (e.getReason() == CertPathValidatorException.BasicReason.UNDETERMINED_REVOCATION_STATUS) {
throw new CertRevocationStatusUnknownException("CRL checking could not determine certificate status.");
}
throw new CertificateRevocationCheckException("Certificate path validation failed:" + e.getMessage(),e);
}
catch ( InvalidAlgorithmParameterException e) {
throw new CertificateRevocationCheckException("Certificate validation parameters invalid, could not validate certificate path:" + e.getMessage(),e);
}
}
| Validate the certificate path using a provided OCSP responder configuration. |
private List<OBlock> makeRange(){
if (log.isDebugEnabled()) {
log.debug("Make range for \"" + _trainName + "\"");
}
_headRange=new ArrayList<OBlock>();
_tailRange=new ArrayList<OBlock>();
_lostRange=new ArrayList<OBlock>();
OBlock headBlock=getHeadBlock();
OBlock tailBlock=getTailBlock();
if (_headPortal == null) {
List<Portal> list=headBlock.getPortals();
Iterator<Portal> iter=list.iterator();
while (iter.hasNext()) {
OBlock b=iter.next().getOpposingBlock(headBlock);
addtoHeadRange(b);
}
}
else {
List<OPath> pathList=_headPortal.getPathsWithinBlock(headBlock);
Iterator<OPath> iter=pathList.iterator();
while (iter.hasNext()) {
OPath path=iter.next();
Portal p=path.getToPortal();
OBlock b=null;
if (p != null && !_headPortal.equals(p)) {
b=p.getOpposingBlock(headBlock);
}
else {
p=path.getFromPortal();
if (p != null && !_headPortal.equals(p)) {
b=p.getOpposingBlock(headBlock);
}
}
addtoHeadRange(b);
}
pathList=_tailPortal.getPathsWithinBlock(tailBlock);
iter=pathList.iterator();
while (iter.hasNext()) {
OPath path=iter.next();
Portal p=path.getToPortal();
OBlock b=null;
if (p != null && !_tailPortal.equals(p)) {
b=p.getOpposingBlock(tailBlock);
}
else {
p=path.getFromPortal();
if (p != null && !_tailPortal.equals(p)) {
b=p.getOpposingBlock(tailBlock);
}
}
addtoTailRange(b);
}
}
_time=System.currentTimeMillis();
if (log.isDebugEnabled()) {
log.debug(" _headRange.size()= " + _headRange.size());
log.debug(" _tailRange.size()= " + _tailRange.size());
log.debug(" _lostRange.size()= " + _lostRange.size());
log.debug(" _occupies.size()= " + _occupies.size());
}
return getRange();
}
| Build array of blocks reachable from head and tail portals |
public void testNewCharsetsConfiguration() throws Exception {
Properties props=new Properties();
props.setProperty("useUnicode","true");
props.setProperty("characterEncoding","EUC_KR");
getConnectionWithProps(props).close();
props=new Properties();
props.setProperty("useUnicode","true");
props.setProperty("characterEncoding","KOI8_R");
getConnectionWithProps(props).close();
}
| These two charsets have different names depending on version of MySQL server. |
public Boolean isActive(){
return active;
}
| Gets the value of the active property. |
public static void send(InternalDistributedMember recipient,int processorId,DM dm,ReplyException re,boolean moved){
Assert.assertTrue(recipient != null,"MoveBucketReplyMessage NULL recipient");
MoveBucketReplyMessage m=new MoveBucketReplyMessage(processorId,re,moved);
m.setRecipient(recipient);
dm.putOutgoing(m);
}
| Send a reply |
private void dispatchDefaultCallbackStoredResults(){
if (defaultCallbackStoredResults.size() == 0 || jsDefaultCallback == null) {
return;
}
for ( PluginResult result : defaultCallbackStoredResults) {
sendMessageToDefaultCallback(result);
}
defaultCallbackStoredResults.clear();
}
| Dispatch stored events for the default callback. |
public ResultVariables executeScript() throws DMLException {
for ( Entry<String,Data> e : _inVarReuse.entrySet()) _vars.put(e.getKey(),e.getValue());
ExecutionContext ec=ExecutionContextFactory.createContext(_prog);
ec.setVariables(_vars);
_prog.execute(ec);
Collection<String> tmpVars=new ArrayList<String>(_vars.keySet());
for ( String var : tmpVars) if (!_outVarnames.contains(var)) _vars.remove(var);
ResultVariables rvars=new ResultVariables();
for ( String ovar : _outVarnames) if (_vars.keySet().contains(ovar)) rvars.addResult(ovar,_vars.get(ovar));
return rvars;
}
| Executes the prepared script over the bound inputs, creating the result variables according to bound and registered outputs. |
public void enableRowScaling(boolean enable){
mRowScaleEnabled=enable;
if (mRowsFragment != null) {
mRowsFragment.enableRowScaling(mRowScaleEnabled);
}
}
| Enables scaling of rows when headers are present. By default enabled to increase density. |
protected static QueryPlan build(QueryGraph queryGraph,EventType[] typesPerStream,HistoricalViewableDesc historicalViewableDesc,DependencyGraph dependencyGraph,HistoricalStreamIndexList[] historicalStreamIndexLists,boolean hasForceNestedIter,String[][][] indexedStreamsUniqueProps,TableMetadata[] tablesPerStream){
if (log.isDebugEnabled()) {
log.debug(".build queryGraph=" + queryGraph);
}
int numStreams=queryGraph.getNumStreams();
QueryPlanIndex[] indexSpecs=QueryPlanIndexBuilder.buildIndexSpec(queryGraph,typesPerStream,indexedStreamsUniqueProps);
if (log.isDebugEnabled()) {
log.debug(".build Index build completed, indexes=" + QueryPlanIndex.print(indexSpecs));
}
if (historicalViewableDesc.isHasHistorical()) {
for (int i=0; i < historicalViewableDesc.getHistorical().length; i++) {
if (historicalViewableDesc.getHistorical()[i]) {
indexSpecs[i]=null;
}
}
}
QueryPlanNode[] planNodeSpecs=new QueryPlanNode[numStreams];
int worstDepth=Integer.MAX_VALUE;
for (int streamNo=0; streamNo < numStreams; streamNo++) {
if ((historicalViewableDesc.getHistorical()[streamNo]) && (dependencyGraph.hasDependency(streamNo))) {
planNodeSpecs[streamNo]=new QueryPlanNodeNoOp();
continue;
}
BestChainResult bestChainResult=computeBestPath(streamNo,queryGraph,dependencyGraph);
int[] bestChain=bestChainResult.getChain();
if (log.isDebugEnabled()) {
log.debug(".build For stream " + streamNo + " bestChain="+ Arrays.toString(bestChain));
}
if (bestChainResult.depth < worstDepth) {
worstDepth=bestChainResult.depth;
}
planNodeSpecs[streamNo]=createStreamPlan(streamNo,bestChain,queryGraph,indexSpecs,typesPerStream,historicalViewableDesc.getHistorical(),historicalStreamIndexLists,tablesPerStream);
if (log.isDebugEnabled()) {
log.debug(".build spec=" + planNodeSpecs[streamNo]);
}
}
if ((worstDepth < numStreams - 1) && (!hasForceNestedIter)) {
return null;
}
return new QueryPlan(indexSpecs,planNodeSpecs);
}
| Build a query plan based on the stream property relationships indicated in queryGraph. |
public void cleanInprogressJobMap(){
taskManager.cleanInprogressJobMap();
}
| Clean inprogress job map. |
public void keybindingHelp(){
insertAtCursor(buildKeybindingInfo());
}
| Generate a key bindings list for all keymaps. |
protected void bootstrap(){
if (isBgBoot) moveTaskToBack(true);
if (!handleStartUp()) return;
handleWaitForAdBlock();
if (isUpdateCheckAllowed() && (!alreadyCheckedUpdate)) checkUpdate.start();
if (getBrowserStorage().isAdBlockEnabled()) AdBlockManager.initAdBlock();
if (!isBgBoot) fastReloadComponents();
}
| Whole initialization is done here |
public static boolean equal(File file1,File file2) throws IOException {
checkNotNull(file1);
checkNotNull(file2);
if (file1 == file2 || file1.equals(file2)) {
return true;
}
long len1=file1.length();
long len2=file2.length();
if (len1 != 0 && len2 != 0 && len1 != len2) {
return false;
}
return asByteSource(file1).contentEquals(asByteSource(file2));
}
| Returns true if the files contains the same bytes. |
public final void testGetEncoded01() throws IOException {
byte[] encoding=getDerEncoding();
PolicyQualifierInfo i=new PolicyQualifierInfo(encoding);
byte[] encodingRet=i.getEncoded();
assertTrue(Arrays.equals(encoding,encodingRet));
}
| Test #1 for <code>getEncoded()</code> method Assertion: Returns the ASN.1 DER encoded form of this <code>PolicyQualifierInfo</code> |
private void addNeuronGroup(NeuronGroup neuronGroup){
List<NeuronNode> neuronNodes=new ArrayList<NeuronNode>();
for ( Neuron neuron : neuronGroup.getNeuronList()) {
addNeuron(neuron);
neuronNodes.add((NeuronNode)objectNodeMap.get(neuron));
}
NeuronGroupNode neuronGroupNode=createNeuronGroupNode(neuronGroup);
for ( NeuronNode node : neuronNodes) {
neuronGroupNode.addNeuronNode(node);
}
canvas.getLayer().addChild(neuronGroupNode);
objectNodeMap.put(neuronGroup,neuronGroupNode);
}
| Add a neuron group representation to the canvas. |
public static void swapRow(Matrix A,int j,int k){
swapCol(A,j,k,0,A.cols());
}
| Swaps the columns <tt>j</tt> and <tt>k</tt> in the given matrix. |
public void addCheckBoxListener(ChangeListener listener){
listenerList.add(ChangeListener.class,listener);
}
| Register a listener for this checkbox. |
ChannelQueue(final String name) throws IllegalArgumentException {
super(name);
this.subChannels=Collections.synchronizedList(new LinkedList<Channel>());
new Thread(new RoundRobin(),"" + name + " - Round-Robin Thread").start();
}
| Build a default channel queue. |
public void addRosterEntry(RemoteRosterEntry remoteRosterEntry){
synchronized (remoteRosterEntries) {
remoteRosterEntries.add(remoteRosterEntry);
}
}
| Adds a remote roster entry to the packet. |
private String booleanToString(Boolean input){
if (input == null) {
return null;
}
else {
return input.toString();
}
}
| Converts the input to a string with special missing value handling. |
public static Location create(LocationPK locationId){
return new Location(locationId);
}
| Create a new Location with the business key. |
public static IMultiPoint[] randomPoints(int n,int d,int scale){
IMultiPoint points[]=new IMultiPoint[n];
for (int i=0; i < n; i++) {
StringBuilder sb=new StringBuilder();
for (int j=0; j < d; j++) {
sb.append(rGen.nextDouble() * scale);
if (j < d - 1) {
sb.append(",");
}
}
points[i]=new Hyperpoint(sb.toString());
}
return points;
}
| Generate array of n d-dimensional points whose coordinates are values in the range 0 .. scale |
protected final void firePropertyChange(String propertyName,double oldValue,double newValue){
firePropertyChange(propertyName,Double.valueOf(oldValue),Double.valueOf(newValue));
}
| Support for reporting bound property changes for integer properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners. |
public synchronized PooledConnection findReplacementTarget(ServerLocation currentServer){
final long now=System.nanoTime();
for (Iterator it=this.allConnections.iterator(); it.hasNext(); ) {
PooledConnection pc=(PooledConnection)it.next();
if (currentServer.equals(pc.getServer())) {
if (!pc.shouldDestroy() && pc.remainingLife(now,lifetimeTimeoutNanos) <= 0) {
removeFromEndpointMap(pc);
return pc;
}
}
}
return null;
}
| Returns a pooled connection that can have its underlying cnx to currentServer replaced by a new connection. |
public boolean isRevocationEnabled(){
return revocationEnabled;
}
| Returns whether the default revocation checking mechanism of the underlying service provider is used. |
void revisitNode(final Node n,final AStarNodeData data,final RouterPriorityQueue<Node> pendingNodes,final double time,final double cost,final double expectedRemainingCost,final Link outLink){
pendingNodes.remove(n);
data.visit(outLink,cost,time,getIterationId());
data.setExpectedRemainingCost(expectedRemainingCost);
pendingNodes.add(n,getPriority(data));
}
| Changes the position of the given Node n in the pendingNodes queue and updates its time and cost information. |
@DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:20.563 -0500",hash_original_method="923CC6809D53E2778E41D61552555A7F",hash_generated_method="E511BCC1AF273F27C4175DD9CE608F04") protected MessageProcessor createMessageProcessor(InetAddress ipAddress,int port,String transport) throws java.io.IOException {
if (transport.equalsIgnoreCase("udp")) {
UDPMessageProcessor udpMessageProcessor=new UDPMessageProcessor(ipAddress,this,port);
this.addMessageProcessor(udpMessageProcessor);
this.udpFlag=true;
return udpMessageProcessor;
}
else if (transport.equalsIgnoreCase("tcp")) {
TCPMessageProcessor tcpMessageProcessor=new TCPMessageProcessor(ipAddress,this,port);
this.addMessageProcessor(tcpMessageProcessor);
return tcpMessageProcessor;
}
else if (transport.equalsIgnoreCase("tls")) {
TLSMessageProcessor tlsMessageProcessor=new TLSMessageProcessor(ipAddress,this,port);
this.addMessageProcessor(tlsMessageProcessor);
return tlsMessageProcessor;
}
else if (transport.equalsIgnoreCase("sctp")) {
try {
Class<?> mpc=ClassLoader.getSystemClassLoader().loadClass("gov.nist.javax.sip.stack.sctp.SCTPMessageProcessor");
MessageProcessor mp=(MessageProcessor)mpc.newInstance();
mp.initialize(ipAddress,port,this);
this.addMessageProcessor(mp);
return mp;
}
catch ( ClassNotFoundException e) {
throw new IllegalArgumentException("SCTP not supported (needs Java 7 and SCTP jar in classpath)");
}
catch ( InstantiationException ie) {
throw new IllegalArgumentException("Error initializing SCTP",ie);
}
catch ( IllegalAccessException ie) {
throw new IllegalArgumentException("Error initializing SCTP",ie);
}
}
else {
throw new IllegalArgumentException("bad transport");
}
}
| Creates the equivalent of a JAIN listening point and attaches to the stack. |
public void write(AnnotationsWriter writer) throws IOException {
writer.constValueIndex(getValue());
}
| Writes the value. |
public static String toString(URI uri) throws IOException {
return toString(uri,Charset.defaultCharset());
}
| Gets the contents at the given URI. |
public BooleanContainer(){
on=false;
}
| Creates a instance which is turned off. |
public void createSubUsageScenario02() throws Exception {
long usageStartTime=DateTimeHandling.calculateMillis("2012-12-01 00:00:00") - DateTimeHandling.daysToMillis(20.5);
BillingIntegrationTestBase.setDateFactoryInstance(usageStartTime);
VOServiceDetails serviceDetails=serviceSetup.createPublishAndActivateMarketableService(basicSetup.getSupplierAdminKey(),"SCENARIO02_PERUNIT_MONTH",TestService.EXAMPLE,TestPriceModel.EXAMPLE_PERUNIT_MONTH_ROLES,technicalService,supplierMarketplace);
setCutOffDay(basicSetup.getSupplierAdminKey(),1);
VORoleDefinition role=VOServiceFactory.getRole(serviceDetails,"ADMIN");
container.login(basicSetup.getCustomerAdminKey(),ROLE_ORGANIZATION_ADMIN);
VOSubscriptionDetails subDetails=subscrSetup.subscribeToService("SCENARIO02_PERUNIT_MONTH",serviceDetails,basicSetup.getCustomerUser2(),role);
long usageEndTime=DateTimeHandling.calculateMillis("2012-12-01 00:00:00") - DateTimeHandling.daysToMillis(5);
BillingIntegrationTestBase.setDateFactoryInstance(usageEndTime);
subscrSetup.unsubscribeToService(subDetails.getSubscriptionId());
resetCutOffDay(basicSetup.getSupplierAdminKey());
BillingIntegrationTestBase.updateSubscriptionListForTests("SCENARIO02_PERUNIT_MONTH",subDetails);
}
| Creates the subscription test data for the scenario before the billing period start time. Usage started before the billing period and ended before the billing period. usage started before Billing Period Start Time usage ended before Billing Period Start Time |
public static byte[] encodeBitmapAsPNG(Bitmap bitmap,boolean color,int numColors,boolean allowTransparent){
int bits;
if (!color && numColors != 2) throw new IllegalArgumentException("must have 2 colors for black and white");
if (numColors < 2) throw new IllegalArgumentException("minimum 2 colors");
else if (numColors == 2) bits=1;
else if (numColors <= 4) bits=2;
else if (numColors <= 16) bits=4;
else if (numColors <= 64) bits=8;
else throw new IllegalArgumentException("maximum 64 colors");
SimpleImageEncoder encoder=new SimpleImageEncoder();
int[] pixels=new int[bitmap.getWidth() * bitmap.getHeight()];
bitmap.getPixels(pixels,0,bitmap.getWidth(),0,0,bitmap.getWidth(),bitmap.getHeight());
encoder.optimizePalette(pixels,numColors,allowTransparent);
return encoder.encodeIndexedPNG(pixels,bitmap.getWidth(),bitmap.getHeight(),color,bits);
}
| Encode an Android bitmap as an indexed PNG using Pebble Time colors. param: bitmap param: color Whether the image is color (true) or black-and-white param: numColors Should be 2, 4, 16, or 64. Using 16 colors is typically the best tradeoff. Must be 2 if B&W. param: allowTransparent Allow fully transparent pixels return: Array of bytes in PNG format |
public Swagger2MarkupConfigBuilder withSeparatedOperations(){
config.separatedOperationsEnabled=true;
return this;
}
| In addition to the Paths file, also create separate operation files for each operation. |
public CaseInsensitiveHashSet(String[] a,float f){
super(a,f,CaseInsensitiveHashingStrategy.INSTANCE);
}
| Creates a new hash set copying the elements of an array. |
public static char[] toCharArray(Character[] array){
char[] result=new char[array.length];
for (int i=0; i < array.length; i++) {
result[i]=array[i];
}
return result;
}
| Coverts given chars array to array of chars. |
public void assertPositionsSkipping(int docFreq,PostingsEnum leftDocs,PostingsEnum rightDocs) throws Exception {
if (leftDocs == null || rightDocs == null) {
assertNull(leftDocs);
assertNull(rightDocs);
return;
}
int docid=-1;
int averageGap=MAXDOC / (1 + docFreq);
int skipInterval=16;
while (true) {
if (random().nextBoolean()) {
docid=leftDocs.nextDoc();
assertEquals(docid,rightDocs.nextDoc());
}
else {
int skip=docid + (int)Math.ceil(Math.abs(skipInterval + random().nextGaussian() * averageGap));
docid=leftDocs.advance(skip);
assertEquals(docid,rightDocs.advance(skip));
}
if (docid == DocIdSetIterator.NO_MORE_DOCS) {
return;
}
int freq=leftDocs.freq();
assertEquals(freq,rightDocs.freq());
for (int i=0; i < freq; i++) {
assertEquals(leftDocs.nextPosition(),rightDocs.nextPosition());
}
}
}
| checks advancing docs + positions |
public void test_bytesProduced(){
int[] pos={0,1,1000,Integer.MAX_VALUE,(Integer.MAX_VALUE - 1)};
SSLEngineResult.Status[] enS=SSLEngineResult.Status.values();
SSLEngineResult.HandshakeStatus[] enHS=SSLEngineResult.HandshakeStatus.values();
for (int i=0; i < enS.length; i++) {
for (int j=0; j < enHS.length; j++) {
for (int n=0; n < pos.length; n++) {
for (int l=0; l < pos.length; ++l) {
SSLEngineResult res=new SSLEngineResult(enS[i],enHS[j],pos[n],pos[l]);
assertEquals("Incorrect bytesProduced",pos[l],res.bytesProduced());
}
}
}
}
}
| Test for <code>bytesProduced()</code> method |
public ThymeleafTemplateEngine(String prefix,String suffix){
TemplateResolver defaultTemplateResolver=createDefaultTemplateResolver(prefix,suffix);
initialize(defaultTemplateResolver);
}
| Constructs a thymeleaf template engine with specified prefix and suffix |
public void computeMinMaxAtts(){
m_minX=Double.MAX_VALUE;
m_minY=Double.MAX_VALUE;
m_maxX=Double.MIN_VALUE;
m_maxY=Double.MIN_VALUE;
boolean allPointsLessThanOne=true;
if (m_trainingData.numInstances() == 0) {
m_minX=m_minY=0.0;
m_maxX=m_maxY=1.0;
}
else {
for (int i=0; i < m_trainingData.numInstances(); i++) {
Instance inst=m_trainingData.instance(i);
double x=inst.value(m_xAttribute);
double y=inst.value(m_yAttribute);
if (!Utils.isMissingValue(x) && !Utils.isMissingValue(y)) {
if (x < m_minX) {
m_minX=x;
}
if (x > m_maxX) {
m_maxX=x;
}
if (y < m_minY) {
m_minY=y;
}
if (y > m_maxY) {
m_maxY=y;
}
if (x > 1.0 || y > 1.0) {
allPointsLessThanOne=false;
}
}
}
}
if (m_minX == m_maxX) {
m_minX=0;
}
if (m_minY == m_maxY) {
m_minY=0;
}
if (m_minX == Double.MAX_VALUE) {
m_minX=0;
}
if (m_minY == Double.MAX_VALUE) {
m_minY=0;
}
if (m_maxX == Double.MIN_VALUE) {
m_maxX=1;
}
if (m_maxY == Double.MIN_VALUE) {
m_maxY=1;
}
if (allPointsLessThanOne) {
m_maxX=m_maxY=1.0;
}
m_rangeX=(m_maxX - m_minX);
m_rangeY=(m_maxY - m_minY);
m_pixWidth=m_rangeX / m_panelWidth;
m_pixHeight=m_rangeY / m_panelHeight;
}
| Set up the bounds of our graphic based by finding the smallest reasonable area in the instance space to surround our data points. |
public static boolean isBase64(final byte octet){
return octet == PAD_DEFAULT || (octet >= 0 && octet < DECODE_TABLE.length && DECODE_TABLE[octet] != -1);
}
| Returns whether or not the <code>octet</code> is in the base 64 alphabet. |
public Debug(String filename,int size,int numFiles){
super();
m_Log=newLog(filename,size,numFiles);
}
| logs the output |
public int compareTo(Tag tag){
int keyResult;
keyResult=this.key.compareTo(tag.key);
if (keyResult != 0) {
return keyResult;
}
return this.value.compareTo(tag.value);
}
| Compares this tag to the specified tag. The tag comparison is based on a comparison of key and value in that order. |
@Timeout public void handleTimer(@SuppressWarnings("unused") Timer timer){
if (logFile != null) {
handleOnChange(logFile);
}
}
| Handles the timer event. |
public void remove(int index){
entries.remove(index);
}
| Removes the entry at the specified position in the table. |
public static boolean isValidId(long id){
if (id >= MIN_VALID_ID && id <= MAX_VALID_ID) return true;
return false;
}
| Returns true if an ID is a valid WAMP ID and false if not. |
public boolean headerHasBeenSent(){
return this.headerSent;
}
| Return true if the header for this message has already been sent. |
public void characters(String s) throws IOException {
characters(s,false);
}
| Emits character data subject to XML escaping. |
public void tag(String tag,String[] names,String[] values,int nattr){
tag(tag,names,values,nattr,true);
}
| Print a closed tag with attributes. The tag will be followed by a newline. |
public static String toNTriplesString(IRI uri){
return "<" + escapeString(uri.toString()) + ">";
}
| Creates an N-Triples string for the supplied URI. |
public void configure(){
setCommandStationType(getOptionState(option2Name));
setTurnoutHandling(getOptionState(option3Name));
UhlenbrockPacketizer packets=new UhlenbrockPacketizer();
packets.connectPort(this);
this.getSystemConnectionMemo().setLnTrafficController(packets);
this.getSystemConnectionMemo().configureCommandStation(commandStationType,mTurnoutNoRetry,mTurnoutExtraSpace);
this.getSystemConnectionMemo().configureManagers();
packets.startThreads();
}
| Set up all of the other objects to operate with a LocoBuffer connected to this port. |
public EventException(Throwable throwable){
cause=throwable;
}
| Constructs a new EventException based on the given Exception |
@Override public void flush() throws java.io.IOException {
flushBase64();
super.flush();
}
| Flushes the stream (and the enclosing streams). |
private boolean confirmUsersDeletion(Context uiSharedContext){
if (getExtensionUserManagement() != null) {
if (getExtensionUserManagement().getSharedContextUsers(uiSharedContext).size() > 0) {
int choice=JOptionPane.showConfirmDialog(this,Constant.messages.getString("authentication.dialog.confirmChange.label"),Constant.messages.getString("authentication.dialog.confirmChange.title"),JOptionPane.OK_CANCEL_OPTION);
if (choice == JOptionPane.CANCEL_OPTION) {
return false;
}
}
}
return true;
}
| Make sure the user acknowledges the Users corresponding to this context will be deleted. |
public static int[] toArray(List<Integer> list){
if (list == null) {
return null;
}
int length=list.size();
int[] intArray=new int[length];
for (int i=0; i < length; i++) {
intArray[i]=list.get(i);
}
return intArray;
}
| Converts a list of integers to a primitive array. |
@POST @Consumes(MediaType.APPLICATION_JSON) @RequiresRole(role=Role.ADMINISTRATOR) public void addCertificate(CertificateDTO certificate){
try {
Certificate cert=certificate.getX509Certificate();
getIDMClient().addCertificate(tenant,cert,CertificateType.STS_TRUST_CERT);
}
catch ( NoSuchTenantException e) {
log.debug("Failed to add certificate to tenant '{}'",tenant,e);
throw new NotFoundException(sm.getString("ec.404"),e);
}
catch ( CertificateException|InvalidArgumentException|DuplicateCertificateException e) {
log.warn("Failed to add certificate to tenant '{}' due to a client side error",tenant,e);
throw new BadRequestException(sm.getString("res.cert.add.failed",tenant),e);
}
catch ( Exception e) {
log.error("Failed to add certificate to tenant '{}' due to a server side error",tenant,e);
throw new InternalServerErrorException(sm.getString("ec.500"),e);
}
}
| Add a certificate to a tenant's certificate store. |
public boolean checkError(){
if (out != null) {
flush();
}
if (out instanceof java.io.PrintWriter) {
PrintWriter pw=(PrintWriter)out;
return pw.checkError();
}
else if (psOut != null) {
return psOut.checkError();
}
return trouble;
}
| Flushes the stream if it's not closed and checks its error state. |
public boolean isCertificateIPsCorrect(X509Certificate cert) throws IllegalArgumentException {
valuesHolder.loadIPsAndNames();
Set<InetAddress> foundIPs=new HashSet<InetAddress>();
try {
for ( List<?> element : cert.getSubjectAlternativeNames()) {
int OID=((Integer)element.get(0)).intValue();
String name;
if (OID == SUBJECT_ALT_NAME_IP_ADDRESS) {
name=(String)element.get(1);
log.debug("got the following ip from the cert: " + name);
foundIPs.add(InetAddress.getByName(name.trim()));
}
else if (OID != SUBJECT_ALT_NAME_DNS_NAME) {
throw new IllegalArgumentException("cert is not self generated");
}
}
}
catch ( CertificateParsingException e) {
throw new IllegalArgumentException("cert is not self generated");
}
catch ( UnknownHostException e) {
throw new IllegalArgumentException("cert has illegal ip values");
}
return valuesHolder.getAddresses().equals(foundIPs);
}
| Checks if the specified certificate's IPs match the cluste's IPs |
@Override public Object singleLineText(final FormObject form){
final boolean[] flags=form.getFieldFlags();
final boolean[] characteristics=form.getCharacteristics();
String aptext=readAPimagesForText(form);
if (aptext != null && aptext.contains("&#")) {
aptext=Strip.stripXML(aptext,true).toString();
}
if (aptext != null && !aptext.equals(form.getTextStreamValue(PdfDictionary.V))) {
form.setTextStreamValue(PdfDictionary.V,aptext);
}
final JComponent retComp;
if (((flags != null) && (flags[FormObject.READONLY_ID])) || (characteristics != null && characteristics[9])) {
if (form.isXFAObject()) {
final JTextField newTextfield=new JTextField(form.getTextString());
setupTextFeatures(newTextfield,form);
setToolTip(form,newTextfield);
newTextfield.setEditable(false);
retComp=newTextfield;
}
else {
final JTextField newTextfield=new JTextField(form.getTextString());
setupTextFeatures(newTextfield,form);
setToolTip(form,newTextfield);
newTextfield.setEditable(false);
retComp=newTextfield;
}
}
else {
final JTextField newTextfield=new JTextField(form.getTextString());
setupTextFeatures(newTextfield,form);
setToolTip(form,newTextfield);
retComp=newTextfield;
}
setupUniversalFeatures(retComp,form);
return retComp;
}
| setup and return the single line text field specified in the FormObject |
private boolean isTrackControllerShown(){
return trackListActivity.findViewById(R.id.track_controler_container).isShown();
}
| Returns true if the track controller is shown. |
public int remove(String key){
int avStart=0;
for (int i=0; avStart < mData.length; i++) {
int avLen=mData[avStart];
if (key.length() <= avLen && (key.length() == avLen || mData[avStart + key.length() + 1] == mSeperator)) {
String s=new String(mData,avStart + 1,key.length());
if (0 == key.compareToIgnoreCase(s)) {
byte[] oldBytes=mData;
mData=new byte[oldBytes.length - avLen - 1];
System.arraycopy(oldBytes,0,mData,0,avStart);
System.arraycopy(oldBytes,avStart + avLen + 1,mData,avStart,oldBytes.length - avStart - avLen- 1);
return i;
}
}
avStart+=(0xFF & (avLen + 1));
}
return -1;
}
| Remove a key/value pair. If found, returns the index or -1 if not found |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.