code
stringlengths
10
174k
nl
stringlengths
3
129k
public static double MSEmaxFitness(GEPIndividual ind){ return 1000.0; }
The max value for this type of fitness is always 1000.
private Token scanToken(){ Token token=_token; if (token != null) { _token=null; return token; } int sign=1; int ch; for (ch=read(); Character.isWhitespace((char)ch); ch=read()) { } switch (ch) { case -1: return Token.EOF; case '(': return Token.LPAREN; case ')': return Token.RPAREN; case ',': return Token.COMMA; case '*': return Token.STAR; case '-': return Token.MINUS; case '+': return Token.PLUS; case '/': return Token.DIV; case '%': return Token.MOD; case '.': return Token.DOT; case '?': return Token.QUESTION_MARK; case '=': return Token.EQ; case '<': if ((ch=read()) == '=') return Token.LE; else if (ch == '>') return Token.NE; else { unread(ch); return Token.LT; } case '>': if ((ch=read()) == '=') return Token.GE; else { unread(ch); return Token.GT; } } if (Character.isJavaIdentifierStart((char)ch) || ch == ':') { CharBuffer cb=_cb; cb.clear(); for (; ch > 0 && isIdentifierPart((char)ch); ch=read()) { cb.append((char)ch); } unread(ch); _lexeme=cb.toString(); String lower=_lexeme.toLowerCase(Locale.ENGLISH); token=_reserved.get(lower); if (token != null) return token; else return Token.IDENTIFIER; } else if (ch >= '0' && ch <= '9') { CharBuffer cb=_cb; cb.clear(); Token type=Token.INTEGER; if (sign < 0) cb.append('-'); for (; ch >= '0' && ch <= '9'; ch=read()) cb.append((char)ch); if (ch == '.') { type=Token.DOUBLE; cb.append('.'); for (ch=read(); ch >= '0' && ch <= '9'; ch=read()) cb.append((char)ch); } if (ch == 'e' || ch == 'E') { type=Token.DOUBLE; cb.append('e'); if ((ch=read()) == '+' || ch == '-') { cb.append((char)ch); ch=read(); } if (!(ch >= '0' && ch <= '9')) throw error(L.l("exponent needs digits at {0}",charName(ch))); for (; ch >= '0' && ch <= '9'; ch=read()) cb.append((char)ch); } if (ch == 'F' || ch == 'D') type=Token.DOUBLE; else if (ch == 'L') { type=Token.LONG; } else unread(ch); _lexeme=cb.toString(); return type; } else if (ch == '\'') { CharBuffer cb=_cb; cb.clear(); for (ch=read(); ch >= 0; ch=read()) { if (ch == '\'') { if ((ch=read()) == '\'') cb.append('\''); else { unread(ch); break; } } else if (ch == '\\') { ch=read(); if (ch >= 0) cb.append(ch); } else cb.append((char)ch); } _lexeme=cb.toString(); return Token.STRING; } else if (ch == '#') { while ((ch=read()) >= 0 && ch != '\n' && ch != '\r') { } return scanToken(); } throw error(L.l("unexpected char at {0} ({1})","" + (char)ch,String.valueOf(ch))); }
Scan the next token. If the lexeme is a string, its string representation is in "lexeme".
@Override public String toString(){ String s="(" + this.getX() + ", "+ this.getY()+ ", "+ this.getZ()+ ")"; if (_isTunnel) { s+="(tunnel)"; } return (s); }
toString() Output a string representation (x,y,z)
@Override public void process(Map<K,V> tuple){ for ( Map.Entry<K,V> e : tuple.entrySet()) { processTuple(e.getKey()); } }
Calls super.processTuple(tuple) for each key in the HashMap
public AbViewInfo(View view,int width,int height){ super(); this.view=view; this.width=width; this.height=height; }
Instantiates a new ab view info.
public void reschedule(long delay,TimeUnit unit){ boolean needQueue=true; SingletonTaskWorker stw=null; synchronized (context) { if (context.taskRunning || context.taskShouldRun) { if (context.taskRunning) { if (delay > 0) { long now=System.nanoTime(); long then=now + TimeUnit.NANOSECONDS.convert(delay,unit); context.waitingTask.nextschedule=then; } else { context.waitingTask.nextschedule=0; } needQueue=false; } else { context.waitingTask.canceled=true; context.waitingTask=null; } } context.taskShouldRun=true; if (needQueue) { stw=context.waitingTask=new SingletonTaskWorker(this); } } if (needQueue) { if (delay <= 0) ses.execute(stw); else ses.schedule(stw,delay,unit); } }
Schedule the task to run if there's not already a task scheduled If there is such a task waiting that has not already started, it cancel that task and reschedule it to run at the given time. If the task is already started, it will cause the task to be rescheduled once it completes to run after delay from the time of reschedule.
protected Options addOptions(Options options){ options.addOption("b","beans",true,"Beans to start during initialization"); options.addOption("c","config",true,"Configuration URL or file path"); options.addOption("cv","configversion",true,"Version of configuration"); options.addOption("n","name",true,"Name of application"); options.addOption("p","port",true,"Monitoring port"); options.addOption("z","zone",true,"URL or path of dns zone content"); options.addOption("nd","nodns",false,"Not a network application"); options.addOption("wqz","workqueuesz",true,"work queue size"); options.addOption("wt","workerthreads",true,"worker threads"); return options; }
Adds options specific to this application. It may be overridden for custom application specific option configuration.
private void zzScanError(int errorCode){ String message; try { message=ZZ_ERROR_MSG[errorCode]; } catch ( ArrayIndexOutOfBoundsException e) { message=ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; } throw new Error(message); }
Reports an error that occured while scanning. In a wellformed scanner (no or only correct usage of yypushback(int) and a match-all fallback rule) this method will only be called with things that "Can't Possibly Happen". If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty scanner etc.). Usual syntax/scanner level error handling should be done in error fallback rules.
@Override public String toString(){ StringBuffer sb=new StringBuffer("MWMRule[").append(get_ID()).append("-").append(getName()).append("]"); return sb.toString(); }
String representation
public void markAsConsumedFromInterface(N4MemberDeclaration element){ tag(Tag.consumedFromInterface,element); }
Marks given member as being consumed from an interface.
public void initialize(SignalStrength ss,int timingAdvance){ mSignalStrength=ss.getLteSignalStrenght(); mRsrp=ss.getLteRsrp(); mRsrq=ss.getLteRsrq(); mRssnr=ss.getLteRssnr(); mCqi=ss.getLteCqi(); mTimingAdvance=timingAdvance; }
Initialize from the SignalStrength structure.
public Bundler putStringArray(String key,String[] value){ bundle.putStringArray(key,value); return this; }
Inserts a String array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
public long time(int i){ long offset=0; for (int j=indices.length - 1; j >= 0; j--) { if (i >= indices[j]) { offset=offsets[j]; break; } } return offset + rtimes[i]; }
Returns the time stamp for index i
public void afterReceivingFromServer(EventID eventId){ }
Invoked after sending an instantiator message to server
public void removeDesignations(Object entity,URI... types) throws RepositoryException { assert types != null && types.length > 0; boolean autoCommit=isAutoCommit(); if (autoCommit) { setAutoCommit(false); } try { Resource resource=findResource(entity); for ( URI type : types) { this.types.removeTypeStatement(resource,type); } if (autoCommit) { setAutoCommit(true); } cachedObjects.remove(resource); } finally { if (autoCommit && !isAutoCommit()) { rollback(); setAutoCommit(true); } } }
Explicitly removes the types from the entity.
public void onResetMap(View view){ if (!checkReady()) { return; } mMap.clear(); addMarkersToMap(); }
Called when the Reset button is clicked.
public final void yybegin(int newState){ zzLexicalState=newState; }
Enters a new lexical state
public void toggleClickability(View view){ if (mGroundOverlayRotated != null) { mGroundOverlayRotated.setClickable(((CheckBox)view).isChecked()); } }
Toggles the clickability of the smaller, rotated overlay based on the state of the View that triggered this call. This callback is defined on the CheckBox in the layout for this Activity.
public static void main(final String[] args){ DOMTestCase.doMain(nodedocumentnodevalue.class,args); }
Runs this test from the command line.
HeapOperand<Object>[] replaceDefs(Instruction s,BasicBlock b){ if (s.operator() == PHI) { HeapOperand<Object> oldDef=(HeapOperand)Phi.getResult(s); int number=getNextHeapVariableNumber(oldDef.getHeapType()); HeapOperand<Object>[] newH=new HeapOperand[1]; newH[0]=new HeapOperand<Object>(new HeapVariable<Object>(oldDef.getHeapType(),number,ir)); newH[0].setInstruction(s); Phi.setResult(s,newH[0]); newH[0].getHeapVariable().registerDef(b); if (DEBUG) System.out.println("New heap def " + newH[0] + " for "+ s); HeapKey<Object> key=new HeapKey<Object>(number,oldDef.getHeapType()); heapVariables.put(key,newH[0].getHeapVariable()); return newH; } else { HeapOperand<Object>[] oldH=defs.get(s); HeapOperand<Object>[] newH=new HeapOperand[oldH.length]; for (int i=0; i < oldH.length; i++) { int number=getNextHeapVariableNumber(oldH[i].getHeapType()); newH[i]=new HeapOperand<Object>(new HeapVariable<Object>(oldH[i].getHeapType(),number,ir)); newH[i].setInstruction(s); newH[i].getHeapVariable().registerDef(b); if (DEBUG) System.out.println("New heap def " + newH[i] + " for "+ s); HeapKey<Object> key=new HeapKey<Object>(number,oldH[i].getHeapType()); heapVariables.put(key,newH[i].getHeapVariable()); } defs.put(s,newH); return newH; } }
Replace all heap variables that an instruction defs with new heap variables. Each new heap variable has the same type as the old one, but a new number. Essentially, this function introduces new names required for translation into SSA form. This instruction will be the single static definition for each new heap variable.
public ParameterMap newParams(){ return new ParameterMap(); }
Convenience method creates a new ParameterMap to hold query params
public void mouseMoved(MouseEvent e){ }
Mouse Moved
public OutputNode push(OutputNode value){ active.add(value); add(value); return value; }
This method is used to add an <code>OutputNode</code> to the top of the stack. This is used when an element is written to the XML document, and allows the writer to determine if a child node can be created from a given output node.
public static String escapeString(final String str){ final StringBuilder result=new StringBuilder(3 * str.length()); for (int i=0; i < str.length(); i++) { char c=str.charAt(i); if (c < NON_PRINTABLE_CHARS.length) { result.append(NON_PRINTABLE_CHARS[c]); } else if (c == '\\') { result.append("\\\\"); } else { result.append(c); } } return result.toString(); }
Escapes the input string so that all non-printable characters (0x00-0x1f) are represented as a hex escape (\x00, \x01, ...) or as a C-style escape sequence (\a, \b, \t, \n, \v, \f, or \r). Backslashes in the input string are doubled (\\).
public EaseInOut(){ }
Easing equation function for a circular (sqrt(1-t^2)) easing in/out: acceleration until halfway, then deceleration.
public NSDate(Date d){ if (d == null) throw new IllegalArgumentException("Date cannot be null"); date=d; }
Creates a NSDate from a Java Date
public void onLoad(ClassPool pool,String classname){ }
Does nothing. This is a method declared in javassist.Translator.
public void testHashCode(){ XYBoxAnnotation a1=new XYBoxAnnotation(1.0,2.0,3.0,4.0,new BasicStroke(1.2f),Color.red,Color.blue); XYBoxAnnotation a2=new XYBoxAnnotation(1.0,2.0,3.0,4.0,new BasicStroke(1.2f),Color.red,Color.blue); assertTrue(a1.equals(a2)); int h1=a1.hashCode(); int h2=a2.hashCode(); assertEquals(h1,h2); }
Two objects that are equal are required to return the same hashCode.
private void checkAttributePresence(Elements elements,TestSolutionHandler testSolutionHandler){ if (elements.isEmpty()) { testSolutionHandler.addTestSolution(TestSolution.NOT_APPLICABLE); return; } TestSolution testSolution=TestSolution.PASSED; for ( Element el : elements) { if (!el.hasAttr(attributeName)) { testSolution=setTestSolution(testSolution,getFailureSolution()); createSourceCodeRemark(getFailureSolution(),el,getFailureMsgCode()); } else { testSolution=setTestSolution(testSolution,getSuccessSolution()); createSourceCodeRemark(getSuccessSolution(),el,getSuccessMsgCode()); } } testSolutionHandler.addTestSolution(testSolution); }
This methods checks whether a given attribute is present for a set of elements
public static JFrame showForcePanel(ForceSimulator fsim){ JFrame frame=new JFrame("prefuse Force Simulator"); frame.setContentPane(new JForcePanel(fsim)); frame.pack(); frame.setVisible(true); return frame; }
Create and displays a new window showing a configuration panel for the given ForceSimulator.
@NonNull public IntroductionBuilder withSlides(@NonNull @Size(min=1) List<Slide> slides){ if (slides.isEmpty()) { throw new IntroductionConfigurationException(EXCEPTION_SLIDE_AMOUNT_MESSAGE); } this.slides.addAll(new ArrayList<>(slides)); return this; }
The Slides to display.
private String findAlias(String varName){ if (aliases == null) return varName; String alias=aliases.get(varName); if (alias == null) { return varName; } return alias; }
Checks to see if the given variable name is used as an alias, and if so, returns the variable name for which it is used as an alias.
public void clear(){ elements=0; }
Removes all of the elements from this set.
private String generateTemplateIdSQLStatement(boolean tableExists){ StringBuffer output=new StringBuffer(); output.append("CREATE TABLE IF NOT EXISTS " + GeneratorConstants.TABLE_TPLID_TPLNAME + " ("+ "templateId INTEGER NOT NULL AUTO_INCREMENT,"+ "templateName MEDIUMTEXT NOT NULL, "+ "PRIMARY KEY(templateId)); \r\n"); if (!tableExists) { output.append("CREATE INDEX tplIdx ON " + GeneratorConstants.TABLE_TPLID_TPLNAME + "(templateId);"); output.append("\r\n"); } return output.toString(); }
Generate sql statement for table template id -> template name
protected void appendDetail(StringBuffer buffer,String fieldName,char[] array){ buffer.append(arrayStart); for (int i=0; i < array.length; i++) { if (i > 0) { buffer.append(arraySeparator); } appendDetail(buffer,fieldName,array[i]); } buffer.append(arrayEnd); }
<p>Append to the <code>toString</code> the detail of a <code>char</code> array.</p>
private CHighlightLayers(){ }
You are not supposed to instantiate this class.
@Override public boolean hasCustomSpawnLocation(){ return false; }
True if the spawn location for this space object is not the default one assigned to it
public Map<Integer,Double> compute(long... dataset){ return computeInPlace(longsToDoubles(dataset)); }
Computes the quantile values of the given dataset.
public static void configItem(String name,String value){ openMinorTag("conf"); attribute("name",name); attribute("value",value); closeMinorTag(); }
Output a "config" entity, with a given name and <code>String</code>value.
public String scriptLang(){ return scriptLang; }
The type of the indexed document.
@Override public synchronized void doDeleteChild(BaseSolrResource endpoint,String childId){ String key=getIgnoreCase() ? childId.toLowerCase(Locale.ROOT) : childId; if (!managedWords.contains(key)) throw new SolrException(ErrorCode.NOT_FOUND,String.format(Locale.ROOT,"%s not found in %s",childId,getResourceId())); managedWords.remove(key); storeManagedData(managedWords); log.info("Removed word: {}",key); }
Deletes words managed by this resource.
private void handleSetTexture(int id){ mTextureId=id; }
Sets the texture name that SurfaceTexture will use when frames are received.
static void runMobsimDefault(Scenario sc,EventsManager ev,int iteration,OutputDirectoryHierarchy controlerIO){ QSim qSim=new QSim(sc,ev); ActivityEngine activityEngine=new ActivityEngine(ev,qSim.getAgentCounter()); qSim.addMobsimEngine(activityEngine); qSim.addActivityHandler(activityEngine); QNetsimEngine netsimEngine=new QNetsimEngine(qSim); qSim.addMobsimEngine(netsimEngine); qSim.addDepartureHandler(netsimEngine.getDepartureHandler()); TeleportationEngine teleportationEngine=new TeleportationEngine(sc,ev); qSim.addMobsimEngine(teleportationEngine); AgentFactory agentFactory=new DefaultAgentFactory(qSim); PopulationAgentSource agentSource=new PopulationAgentSource(sc.getPopulation(),agentFactory,qSim); qSim.addAgentSource(agentSource); if (sc.getConfig().controler().getWriteSnapshotsInterval() != 0 && iteration % sc.getConfig().controler().getWriteSnapshotsInterval() == 0) { SnapshotWriterManager manager=new SnapshotWriterManager(sc.getConfig()); String fileName=controlerIO.getIterationFilename(iteration,"otfvis.mvi"); SnapshotWriter snapshotWriter=new OTFFileWriter(sc,fileName); manager.addSnapshotWriter(snapshotWriter); qSim.addQueueSimulationListeners(manager); } qSim.run(); }
Convenience method to have a default implementation of the mobsim. It is deliberately non-configurable. It makes no promises about what it does, nor about stability over time. May be used as a starting point for own variants.
@Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application){ return application.sources(DatabaseService.class); }
Initializes this application when running in a servlet container (e.g. Tomcat)
public void updateGestorValoracion(String[] valoraciones,String idGestor){ StringBuffer qual=new StringBuffer("WHERE ").append(DBUtils.generateORTokens(CAMPO_ID,valoraciones)); Map fieldsToUpdate=Collections.singletonMap(CAMPO_IDUSRGESTORSERIE,idGestor); updateFields(qual.toString(),fieldsToUpdate,TABLE_NAME); }
Actualiza el gestor de un conjunto de valoraciones
private static PartitionedRegion isPartitionedCheck(final Region<?,?> r){ if (!isPartitionedRegion(r)) { throw new IllegalArgumentException(LocalizedStrings.PartitionManager_REGION_0_IS_NOT_A_PARTITIONED_REGION.toLocalizedString(r.getFullPath())); } return (PartitionedRegion)r; }
Test a Region to see if it is a partitioned Region
@Override public boolean isActive(){ return amIActive; }
Used by the Whitebox GUI to tell if this plugin is still running.
public T caseSimpleScope(SimpleScope object){ return null; }
Returns the result of interpreting the object as an instance of '<em>Simple Scope</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
public static String indent(String text,int steps){ switch (steps) { case 0: return text; case 1: return indent(text); default : return indent(indent(text,steps - 1)); } }
Indents a variable number of levels level after each new-line-character as defined by <code>nl()</code>.
public Bag removeObjectsAtLocation(final int x,final int y,final int z){ return removeObjectsAtLocation(new Int3D(x,y,z)); }
Removes all the objects stored at the given location and returns them as a Bag (which you are free to modify).
BillingRun executeBilling(BillingSubscriptionChunk billingSubscriptionChunk,Set<Long> failedSubscriptions){ BillingRun result=new BillingRun(billingSubscriptionChunk.getBillingPeriodStart(),billingSubscriptionChunk.getBillingPeriodEnd()); for ( BillingInput billingInput : billingSubscriptionChunk.getBillingInputList()) { Long subscriptionKey=Long.valueOf(billingInput.getSubscriptionKey()); if (!failedSubscriptions.contains(subscriptionKey)) { try { BillingResult bill=revenueCalculator.performBillingRunForSubscription(billingInput); if (!Strings.isEmpty(bill.getResultXML())) { result.addBillingResult(bill); } } catch ( Exception e) { failedSubscriptions.add(subscriptionKey); result.setSuccessful(false); logBillingRunFailed(e,billingInput); } } } return result; }
Execute the billing calculation for a chunk of subscriptions in a given billing period. Dont't perform the calculation for subscriptions, where a billing calculation failed.
public Vector3d normalize(){ double invLength=1.0 / length(); x*=invLength; y*=invLength; z*=invLength; return this; }
Normalize this vector.
public boolean isRange(){ return m_vo.IsRange; }
Selection column in range based or not
public static ParsedOperation parseOperation(QueryLanguage ql,String operation,String baseURI) throws MalformedQueryException { ParsedOperation parsedOperation=null; QueryParser parser=createParser(ql); if (QueryLanguage.SPARQL.equals(ql)) { String strippedOperation=removeSPARQLQueryProlog(operation).toUpperCase(); if (strippedOperation.startsWith("SELECT") || strippedOperation.startsWith("CONSTRUCT") || strippedOperation.startsWith("DESCRIBE")|| strippedOperation.startsWith("ASK")) { parsedOperation=parser.parseQuery(operation,baseURI); } else { parsedOperation=parser.parseUpdate(operation,baseURI); } } else { parsedOperation=parser.parseQuery(operation,baseURI); } return parsedOperation; }
Parses the supplied operation into a query model.
public int append(final int lhs,final int rhs,final String fieldName){ int comparison=((lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0)); fieldComparisons.setAt(fieldName).value(comparison); return comparison; }
Appends to the <code>fieldComparisons</code> the comparison of two <code>int</code>s.
public ConnectionRequest(String url,boolean post){ this(url); setPost(post); }
Construct a connection request to a url
void startEdit(){ assert (verifyArity()); int oc=ownedCount(); assert (!inTrans()); flags|=F_TRANS; Name[] oldNames=names; Name[] ownBuffer=(oc == 2 ? originalNames : null); assert (ownBuffer != oldNames); if (ownBuffer != null && ownBuffer.length >= length) { names=copyNamesInto(ownBuffer); } else { final int SLOP=2; names=Arrays.copyOf(oldNames,Math.max(length + SLOP,oldNames.length)); if (oc < 2) ++flags; assert (ownedCount() == oc + 1); } originalNames=oldNames; assert (originalNames != names); firstChange=length; assert (inTrans()); }
Create a private, writable copy of names. Preserve the original copy, for reference.
private void assignUnitMatrix(int n){ numRows=n; numColumns=n; length=(n + 31) >>> 5; matrix=new int[numRows][length]; for (int i=0; i < numRows; i++) { for (int j=0; j < length; j++) { matrix[i][j]=0; } } for (int i=0; i < numRows; i++) { int rest=i & 0x1f; matrix[i][i >>> 5]=1 << rest; } }
Create the mxn unit matrix.
public void emitop2(int op,int od){ emitop(op); if (!alive) return; emit2(od); switch (op) { case getstatic: state.push(((Symbol)(pool.pool[od])).erasure(types)); break; case putstatic: state.pop(((Symbol)(pool.pool[od])).erasure(types)); break; case new_: Symbol sym; if (pool.pool[od] instanceof UniqueType) { sym=((UniqueType)(pool.pool[od])).type.tsym; } else { sym=(Symbol)(pool.pool[od]); } state.push(uninitializedObject(sym.erasure(types),cp - 3)); break; case sipush: state.push(syms.intType); break; case if_acmp_null: case if_acmp_nonnull: case ifeq: case ifne: case iflt: case ifge: case ifgt: case ifle: state.pop(1); break; case if_icmpeq: case if_icmpne: case if_icmplt: case if_icmpge: case if_icmpgt: case if_icmple: case if_acmpeq: case if_acmpne: state.pop(2); break; case goto_: markDead(); break; case putfield: state.pop(((Symbol)(pool.pool[od])).erasure(types)); state.pop(1); break; case getfield: state.pop(1); state.push(((Symbol)(pool.pool[od])).erasure(types)); break; case checkcast: { state.pop(1); Object o=pool.pool[od]; Type t=(o instanceof Symbol) ? ((Symbol)o).erasure(types) : types.erasure((((UniqueType)o).type)); state.push(t); break; } case ldc2w: state.push(typeForPool(pool.pool[od])); break; case instanceof_: state.pop(1); state.push(syms.intType); break; case ldc2: state.push(typeForPool(pool.pool[od])); break; case jsr: break; default : throw new AssertionError(mnem(op)); } }
Emit an opcode with a two-byte operand field.
protected boolean assertChildIndex(final int index){ if (index < 0 || index > nchildren) throw new IndexOutOfBoundsException("index=" + index + ", nchildren="+ nchildren); return true; }
Bounds check.
public void testInputWaitInterruption() throws Exception { File f=this.initFile("testInputWaitInterruption"); FileOutputStream fos=new FileOutputStream(f); @SuppressWarnings("resource") DataOutputStream dos=new DataOutputStream(fos); dos.writeShort(13); dos.flush(); logger.info("Starting read thread interruption"); CountDownLatch latch=new CountDownLatch(1); SampleInputReader reader=new SampleInputReader(f,100,latch); Thread readerThread=new Thread(reader); readerThread.start(); try { assertTrue("Waiting for reader thread to become ready",latch.await(5,TimeUnit.SECONDS)); Thread.sleep(75); readerThread.interrupt(); reader.assertOK("[single run]"); } finally { reader.cancel(); readerThread.join(1000); } }
Confirm that if we interrupt waiting for input an InterruptedException is returned. This is important because underlying Java NIO routines may turn an interrupt into a ClosedByInterruptException, which subclasses from IOException.
public boolean isVisited(String uri){ if (uri == null) return false; uri=resolveURI(uri); return history.contains(uri); }
Returns true if the link has been visited by the user in this session. Visit tracking is not persisted.
public static void doEntryOps(){ try { LogWriterUtils.getLogWriter().info("Putting entries..."); Cache cacheClient=GemFireCacheImpl.getInstance(); Region r1=cacheClient.getRegion(Region.SEPARATOR + REGION_NAME1); Region r2=cacheClient.getRegion(Region.SEPARATOR + REGION_NAME2); Region r3=cacheClient.getRegion(Region.SEPARATOR + REGION_NAME3); r1.put("key-1","11"); r2.put("key-1","11"); r3.put("key-1","11"); r1.put("key-1","22"); r2.put("key-1","22"); r3.put("key-1","22"); r1.invalidate("key-1"); r2.invalidate("key-1"); r3.invalidate("key-1"); r1.destroy("key-1"); r2.destroy("key-1"); r3.destroy("key-1"); } catch ( Exception ex) { ex.printStackTrace(); Assert.fail("failed while region doing ops",ex); } }
Do 2 puts, 1 invalidate and 1 destroy for a key "key-1"
public void initializeMethodAccessor(MethodBinding accessedMethod,boolean isSuperAccess,ReferenceBinding receiverType){ this.targetMethod=accessedMethod; this.modifiers=ClassFileConstants.AccDefault | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic; this.tagBits|=(TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); SourceTypeBinding declaringSourceType=(SourceTypeBinding)receiverType; SyntheticMethodBinding[] knownAccessMethods=declaringSourceType.syntheticMethods(); int methodId=knownAccessMethods == null ? 0 : knownAccessMethods.length; this.index=methodId; this.selector=CharOperation.concat(TypeConstants.SYNTHETIC_ACCESS_METHOD_PREFIX,String.valueOf(methodId).toCharArray()); this.returnType=accessedMethod.returnType; this.purpose=isSuperAccess ? SyntheticMethodBinding.SuperMethodAccess : SyntheticMethodBinding.MethodAccess; if (accessedMethod.isStatic()) { this.parameters=accessedMethod.parameters; } else { this.parameters=new TypeBinding[accessedMethod.parameters.length + 1]; this.parameters[0]=declaringSourceType; System.arraycopy(accessedMethod.parameters,0,this.parameters,1,accessedMethod.parameters.length); } this.thrownExceptions=accessedMethod.thrownExceptions; this.declaringClass=declaringSourceType; boolean needRename; do { check: { needRename=false; MethodBinding[] methods=declaringSourceType.methods(); for (int i=0, length=methods.length; i < length; i++) { if (CharOperation.equals(this.selector,methods[i].selector) && areParameterErasuresEqual(methods[i])) { needRename=true; break check; } } if (knownAccessMethods != null) { for (int i=0, length=knownAccessMethods.length; i < length; i++) { if (knownAccessMethods[i] == null) continue; if (CharOperation.equals(this.selector,knownAccessMethods[i].selector) && areParameterErasuresEqual(knownAccessMethods[i])) { needRename=true; break check; } } } } if (needRename) { setSelector(CharOperation.concat(TypeConstants.SYNTHETIC_ACCESS_METHOD_PREFIX,String.valueOf(++methodId).toCharArray())); } } while (needRename); AbstractMethodDeclaration[] methodDecls=declaringSourceType.scope.referenceContext.methods; if (methodDecls != null) { for (int i=0, length=methodDecls.length; i < length; i++) { if (methodDecls[i].binding == accessedMethod) { this.sourceStart=methodDecls[i].sourceStart; return; } } } }
An method accessor is a method with an access$N selector, where N is incremented in case of collisions.
public void unregisterResources(){ if (myContext != null && registerReceiver) { synchronized (MqttAndroidClient.this) { myContext.unregisterReceiver(this); registerReceiver=false; } if (bindedService) { try { myContext.unbindService(serviceConnection); bindedService=false; } catch ( IllegalArgumentException e) { } } } }
Unregister receiver which receives intent from MqttService avoids IntentReceiver leaks.
public void move(double timeIncrement){ double possibleMovement; double distance; double dx, dy; if (!isMovementActive() || SimClock.getTime() < this.nextTimeToMove) { return; } if (this.destination == null) { if (!setNextWaypoint()) { return; } } possibleMovement=timeIncrement * speed; distance=this.location.distance(this.destination); while (possibleMovement >= distance) { this.location.setLocation(this.destination); possibleMovement-=distance; if (!setNextWaypoint()) { return; } distance=this.location.distance(this.destination); } dx=(possibleMovement / distance) * (this.destination.getX() - this.location.getX()); dy=(possibleMovement / distance) * (this.destination.getY() - this.location.getY()); this.location.translate(dx,dy); }
Moves the node towards the next waypoint or waits if it is not time to move yet
@Override protected void onNewIntent(Intent intent){ super.onNewIntent(intent); if (this.appView != null) this.appView.onNewIntent(intent); }
Called when the activity receives a new intent
public Object doLogin(final String authuri,final String username,final String password,final int portNumber) throws VNXFilePluginException { PostMethod postMethod=null; try { _logger.debug("doLogin " + authuri + ":"+ username+ ":"+ portNumber); Protocol protocol=_protocol.getProtocol(portNumber); Protocol.registerProtocol("https",protocol); _logger.info("Querying the url {}",authuri); postMethod=new PostMethod(authuri); postMethod.addParameter("user",username); postMethod.addParameter("password",password); postMethod.addParameter("Login","Login"); postMethod.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); postMethod.getParams().setVersion(HttpVersion.HTTP_1_1); setTimeoutValues(); Level origLevel=LogManager.getRootLogger().getLevel(); LogManager.getRootLogger().setLevel(Level.INFO); final int response=_client.executeMethod(postMethod); LogManager.getRootLogger().setLevel(origLevel); _logger.debug("connection timeout set {}",_client.getParams().getParameter("http.connection.timeout")); if (response != HttpStatus.SC_OK) { _logger.error("Invalid response received from XML API Server while getting cookie information. " + "HTTP Error code: {}",response); throw new VNXFilePluginException("Invalid response recieved from XML API Server while getting cookie information.",VNXFilePluginException.ERRORCODE_INVALID_RESPONSE); } } catch ( final IOException ioEx) { _logger.error("IOException occurred while sending the Login request due to {}",ioEx.getMessage()); throw new VNXFilePluginException("IOException occurred while sending Login the request.",ioEx.getCause()); } catch ( final Exception ex) { _logger.error("Exception occurred while sending the Login request due to {}",ex.getMessage()); throw new VNXFilePluginException("Exception occurred while sending the Login request.",ex.getCause()); } return postMethod; }
doLogin is responsible to connect the XML API Server which is running on ControlStation and gets the session information.
public BubbleChartSeriesAttributes(ChartGenerator generator,String name,int index,double[][] values,SeriesChangeListener stoppable){ super(generator,name,index,stoppable); setValues(values); super.setSeriesName(name); }
Produces a BubbleChartSeriesAttributes object with the given generator, series name, series index, and desire to display margin options.
public boolean isDistinct(){ return distinct; }
This method was generated by MyBatis Generator. This method corresponds to the database table collection
public DependencyPathNgrams(String dependencyViewName,int ngramSize){ this.dependencyViewName=dependencyViewName; this.ngramSize=ngramSize; }
Extracting ngram features along the dependency path
private void updateProgress(String progressLabel,int progress){ if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) { myHost.updateProgress(progressLabel,progress); } previousProgress=progress; previousProgressLabel=progressLabel; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
public ActionPresentationData(@NotNull String text,String description,Icon icon){ myText=text; myDescription=description; myIcon=icon; }
Creates an action presentation with the specified text, description and icon.
private static int parsePolicyFromMessage(String message){ if (message == null || !message.startsWith("policy=")) { return 0; } int spaceIndex=message.indexOf(' '); if (spaceIndex == -1) { return 0; } String policyString=message.substring(7,spaceIndex); try { return Integer.valueOf(policyString).intValue(); } catch ( NumberFormatException e) { return 0; } }
Parses the BlockGuard policy mask out from the Exception's getMessage() String value. Kinda gross, but least invasive. :/ Input is of the following forms: "policy=137 violation=64" "policy=137 violation=64 msg=Arbitrary text" Returns 0 on failure, which is a valid policy, but not a valid policy during a violation (else there must've been some policy in effect to violate).
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:33:12.318 -0500",hash_original_method="9D75E2E2AB8D83EF2AA67EF8FE72195D",hash_generated_method="66F94E328ECD4F0B65EDA58A2030DF2D") public boolean documentHasImages(){ return getTaintBoolean(); }
Return true if the document has images.
public JpaRepositoryTransition(JpaRepositoryState source,JpaRepositoryState target,String event){ this(null,source,target,event); }
Instantiates a new jpa repository transition.
public AuthScope(final String host,int port,final String realm){ this(host,port,realm,ANY_SCHEME); }
Creates a new credentials scope for the given <tt>host</tt>, <tt>port</tt>, <tt>realm</tt>, and any authentication scheme.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:21.190 -0500",hash_original_method="17E369F2319E43AC424DA68053015181",hash_generated_method="2CD6AE535FF35BFAB0DB87222EE51702") public void split(){ if (!needsSplitting()) { return; } Node parent=getParentNode(); String[] parts=getData().split("\\]\\]>"); parent.insertBefore(new CDATASectionImpl(document,parts[0] + "]]"),this); for (int p=1; p < parts.length - 1; p++) { parent.insertBefore(new CDATASectionImpl(document,">" + parts[p] + "]]"),this); } setData(">" + parts[parts.length - 1]); }
Splits this CDATA node into parts that do not contain a "]]>" sequence. Any newly created nodes will be inserted before this node.
@Override public synchronized void startHandshake() throws IOException { synchronized (handshakeLock) { checkOpen(); if (!handshakeStarted) { handshakeStarted=true; } else { return; } } final int seedLengthInBytes=NativeCrypto.RAND_SEED_LENGTH_IN_BYTES; final SecureRandom secureRandom=sslParameters.getSecureRandomMember(); if (secureRandom == null) { NativeCrypto.RAND_load_file("/dev/urandom",seedLengthInBytes); } else { NativeCrypto.RAND_seed(secureRandom.generateSeed(seedLengthInBytes)); } final boolean client=sslParameters.getUseClientMode(); final long sslCtxNativePointer=(client) ? sslParameters.getClientSessionContext().sslCtxNativePointer : sslParameters.getServerSessionContext().sslCtxNativePointer; this.sslNativePointer=0; boolean exception=true; try { sslNativePointer=NativeCrypto.SSL_new(sslCtxNativePointer); guard.open("close"); if (npnProtocols != null) { NativeCrypto.SSL_CTX_enable_npn(sslCtxNativePointer); } if (client && alpnProtocols != null) { NativeCrypto.SSL_CTX_set_alpn_protos(sslCtxNativePointer,alpnProtocols); } if (!client) { Set<String> keyTypes=new HashSet<String>(); for ( String enabledCipherSuite : enabledCipherSuites) { if (enabledCipherSuite.equals(NativeCrypto.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) { continue; } String keyType=CipherSuite.getByName(enabledCipherSuite).getServerKeyType(); if (keyType != null) { keyTypes.add(keyType); } } for ( String keyType : keyTypes) { try { setCertificate(sslParameters.getKeyManager().chooseServerAlias(keyType,null,this)); } catch ( CertificateEncodingException e) { throw new IOException(e); } } } NativeCrypto.setEnabledProtocols(sslNativePointer,enabledProtocols); NativeCrypto.setEnabledCipherSuites(sslNativePointer,enabledCipherSuites); if (useSessionTickets) { NativeCrypto.SSL_clear_options(sslNativePointer,NativeCrypto.SSL_OP_NO_TICKET); } if (hostname != null) { NativeCrypto.SSL_set_tlsext_host_name(sslNativePointer,hostname); } boolean enableSessionCreation=sslParameters.getEnableSessionCreation(); if (!enableSessionCreation) { NativeCrypto.SSL_set_session_creation_enabled(sslNativePointer,enableSessionCreation); } AbstractSessionContext sessionContext; OpenSSLSessionImpl sessionToReuse; if (client) { ClientSessionContext clientSessionContext=sslParameters.getClientSessionContext(); sessionContext=clientSessionContext; sessionToReuse=getCachedClientSession(clientSessionContext); if (sessionToReuse != null) { NativeCrypto.SSL_set_session(sslNativePointer,sessionToReuse.sslSessionNativePointer); } } else { sessionContext=sslParameters.getServerSessionContext(); sessionToReuse=null; } if (client) { } else { boolean certRequested; if (sslParameters.getNeedClientAuth()) { NativeCrypto.SSL_set_verify(sslNativePointer,NativeCrypto.SSL_VERIFY_PEER | NativeCrypto.SSL_VERIFY_FAIL_IF_NO_PEER_CERT); certRequested=true; } else if (sslParameters.getWantClientAuth()) { NativeCrypto.SSL_set_verify(sslNativePointer,NativeCrypto.SSL_VERIFY_PEER); certRequested=true; } else { certRequested=false; } if (certRequested) { X509TrustManager trustManager=sslParameters.getTrustManager(); X509Certificate[] issuers=trustManager.getAcceptedIssuers(); if (issuers != null && issuers.length != 0) { byte[][] issuersBytes; try { issuersBytes=encodeIssuerX509Principals(issuers); } catch ( CertificateEncodingException e) { throw new IOException("Problem encoding principals",e); } NativeCrypto.SSL_set_client_CA_list(sslNativePointer,issuersBytes); } } } int savedReadTimeoutMilliseconds=getSoTimeout(); int savedWriteTimeoutMilliseconds=getSoWriteTimeout(); if (handshakeTimeoutMilliseconds >= 0) { setSoTimeout(handshakeTimeoutMilliseconds); setSoWriteTimeout(handshakeTimeoutMilliseconds); } if (channelIdEnabled) { if (client) { if (channelIdPrivateKey == null) { throw new SSLHandshakeException("Invalid TLS channel ID key specified"); } NativeCrypto.SSL_set1_tls_channel_id(sslNativePointer,channelIdPrivateKey.getPkeyContext()); } else { NativeCrypto.SSL_enable_tls_channel_id(sslNativePointer); } } long sslSessionNativePointer; try { sslSessionNativePointer=NativeCrypto.SSL_do_handshake(sslNativePointer,socket.getFileDescriptor$(),this,getSoTimeout(),client,npnProtocols,client ? null : alpnProtocols); } catch ( CertificateException e) { SSLHandshakeException wrapper=new SSLHandshakeException(e.getMessage()); wrapper.initCause(e); throw wrapper; } byte[] sessionId=NativeCrypto.SSL_SESSION_session_id(sslSessionNativePointer); if (sessionToReuse != null && Arrays.equals(sessionToReuse.getId(),sessionId)) { this.sslSession=sessionToReuse; sslSession.lastAccessedTime=System.currentTimeMillis(); NativeCrypto.SSL_SESSION_free(sslSessionNativePointer); } else { if (!enableSessionCreation) { throw new IllegalStateException("SSL Session may not be created"); } X509Certificate[] localCertificates=createCertChain(NativeCrypto.SSL_get_certificate(sslNativePointer)); X509Certificate[] peerCertificates=createCertChain(NativeCrypto.SSL_get_peer_cert_chain(sslNativePointer)); this.sslSession=new OpenSSLSessionImpl(sslSessionNativePointer,localCertificates,peerCertificates,getPeerHostName(),getPeerPort(),sessionContext); if (handshakeCompleted) { sessionContext.putSession(sslSession); } } if (handshakeTimeoutMilliseconds >= 0) { setSoTimeout(savedReadTimeoutMilliseconds); setSoWriteTimeout(savedWriteTimeoutMilliseconds); } if (handshakeCompleted) { notifyHandshakeCompletedListeners(); } exception=false; } catch ( SSLProtocolException e) { throw new SSLHandshakeException(e); } finally { if (exception) { close(); } } }
Starts a TLS/SSL handshake on this connection using some native methods from the OpenSSL library. It can negotiate new encryption keys, change cipher suites, or initiate a new session. The certificate chain is verified if the correspondent property in java.Security is set. All listeners are notified at the end of the TLS/SSL handshake.
public void compact(){ if (isCompact) { return; } for (int plane=0; plane < PLANECOUNT; plane++) { if (!planeTouched[plane]) { continue; } int limitCompacted=0; int iBlockStart=0; short iUntouched=-1; for (int i=0; i < indices[plane].length; ++i, iBlockStart+=BLOCKCOUNT) { indices[plane][i]=-1; if (!blockTouched[plane][i] && iUntouched != -1) { indices[plane][i]=iUntouched; } else { int jBlockStart=limitCompacted * BLOCKCOUNT; if (i > limitCompacted) { System.arraycopy(values[plane],iBlockStart,values[plane],jBlockStart,BLOCKCOUNT); } if (!blockTouched[plane][i]) { iUntouched=(short)jBlockStart; } indices[plane][i]=(short)jBlockStart; limitCompacted++; } } int newSize=limitCompacted * BLOCKCOUNT; int[] result=new int[newSize]; System.arraycopy(values[plane],0,result,0,newSize); values[plane]=result; blockTouched[plane]=null; } isCompact=true; }
Compact the array.
public final static float distance_to_endpoint(int x1,int y1,int x2,int y2,int x,int y){ return (float)Math.min(distance(x1,y1,x,y),distance(x2,y2,x,y)); }
Distance to closest endpoint. <p>
public GPathResult parse(final Reader in) throws IOException, SAXException { return parse(new InputSource(in)); }
Parse the content of the specified reader into a GPathResult Object. Note that using this method will not provide the parser with any URI for which to find DTDs etc. It is up to you to close the Reader after parsing is complete (if required).
public Builder noTransform(){ this.noTransform=true; return this; }
Don't accept a transformed response.
public void startScan(SiteNode startNode){ Target target=new Target(startNode); target.setRecurse(true); this.startScan(target,null,null); }
Start scan.
public Builder withTimeout(long timeout,TimeUnit unit){ LettuceAssert.notNull(unit,"TimeUnit must not be null"); LettuceAssert.isTrue(timeout >= 0,"Timeout must be greater or equal 0"); disqueURI.setTimeout(timeout); disqueURI.setUnit(unit); return this; }
Adds timeout.
public VcpcAltRunner(GraphWrapper graphWrapper,Parameters params,KnowledgeBoxModel knowledgeBoxModel){ super(graphWrapper.getGraph(),params,knowledgeBoxModel); }
Constucts a wrapper for the given EdgeListGraph.
public Tokenizer(CharSequence text){ this.text=text; matcher=WHITESPACE.matcher(text); skipWhitespace(); nextToken(); }
Construct a tokenizer that parses tokens from the given text.
public String randomString(int len){ StringBuilder buff=new StringBuilder(); for (int i=0; i < len; i++) { String from=(i % 2 == 0) ? "bdfghklmnpqrst" : "aeiou"; buff.append(from.charAt(getInt(from.length()))); } return buff.toString(); }
Get a random string with the given length.
public static boolean add(ImageFetchable src){ final FetcherInfo info=FetcherInfo.getFetcherInfo(); synchronized (info.waitList) { if (!info.waitList.contains(src)) { info.waitList.addElement(src); if (info.numWaiting == 0 && info.numFetchers < info.fetchers.length) { createFetchers(info); } if (info.numFetchers > 0) { info.waitList.notify(); } else { info.waitList.removeElement(src); return false; } } } return true; }
Adds an ImageFetchable to the queue of items to fetch. Instantiates a new ImageFetcher if it's reasonable to do so. If there is no available fetcher to process an ImageFetchable, then reports failure to caller.
private void relax(Integer node){ double timeNow=times.get(node); int to; double timeTo; for ( ScheduleEntry se : oracle.getConnected(node,timeNow)) { to=se.getTo(); if (visited.contains(to)) { continue; } timeTo=se.getTime() + se.getDuration(); if (timeTo < times.get(to)) { prevHops.put(to,se); setTime(to,timeTo); } } }
Relaxes the neighbors of a node (updates the shortest distances).
public boolean parseAlignments(){ return false; }
Pfam-A parsing does not require the alignments.
public ScaleTypeDrawable(Drawable drawable,ScaleType scaleType){ super(Preconditions.checkNotNull(drawable)); mScaleType=scaleType; }
Creates a new ScaleType drawable with given underlying drawable and scale type.
public Component add(Component comp){ add(comp,new DockConstraint()); return comp; }
We need to handle adding the component specially. If it is the background, do one thing. Otherwise wrap it up...
public static void deleteContents(File dir) throws IOException { File[] files=dir.listFiles(); if (files != null) { for ( File file : files) { if (file.isDirectory()) { deleteContents(file); } file.delete(); } } }
Do not use. Use createTemporaryDirectory instead. Used by frameworks/base unit tests to clean up a temporary directory. Deliberately ignores errors, on the assumption that test cleanup is only supposed to be best-effort.
public static void main(final String[] args){ DOMTestCase.doMain(hc_documentcreatecomment.class,args); }
Runs this test from the command line.
public static boolean equals(final TypeRepresentation first,final TypeRepresentation second){ if (!first.equals(second)) return false; final boolean firstCollection=first instanceof TypeRepresentation.CollectionTypeRepresentation; final boolean secondCollection=second instanceof TypeRepresentation.CollectionTypeRepresentation; if (firstCollection ^ secondCollection) return false; if (firstCollection) return ((TypeRepresentation.CollectionTypeRepresentation)first).contentEquals(((TypeRepresentation.CollectionTypeRepresentation)second).getRepresentation()); final boolean firstEnum=first instanceof TypeRepresentation.EnumTypeRepresentation; final boolean secondEnum=second instanceof TypeRepresentation.EnumTypeRepresentation; if (firstEnum ^ secondEnum) return false; if (firstEnum) { final TypeRepresentation.EnumTypeRepresentation firstEnumRep=(TypeRepresentation.EnumTypeRepresentation)first; final TypeRepresentation.EnumTypeRepresentation secondEnumRep=(TypeRepresentation.EnumTypeRepresentation)second; return firstEnumRep.getEnumValues().equals(secondEnumRep.getEnumValues()) && firstEnumRep.getComponentType().equals(secondEnumRep.getComponentType()); } return ((TypeRepresentation.ConcreteTypeRepresentation)first).contentEquals(((TypeRepresentation.ConcreteTypeRepresentation)second).getProperties()); }
Checks if the first representation fully equals to the second, i.e. the identifier has to be the same as well as the contained element (for collections) or the properties (for concrete types).
@Nullable public static String dateToStringUTC(@Nullable Date date,@NonNull DateFormat df){ if (date == null) { return null; } else { df.setTimeZone(UTC); return dateToString(date,df); } }
Converts a Date object to a string representation in UTC
private BlockConsistencyGroup queryConsistencyGroup(final URI consistencyGroupUri){ ArgValidator.checkFieldNotNull(consistencyGroupUri,"consistency_group"); ArgValidator.checkUri(consistencyGroupUri); final BlockConsistencyGroup consistencyGroup=_dbClient.queryObject(BlockConsistencyGroup.class,consistencyGroupUri); ArgValidator.checkEntity(consistencyGroup,consistencyGroupUri,isIdEmbeddedInURL(consistencyGroupUri)); return consistencyGroup; }
Gets and verifies the consistency group passed in the request.
public CtClass[] mayThrow(){ return super.mayThrow(); }
Returns the list of exceptions that the expression may throw. This list includes both the exceptions that the try-catch statements including the expression can catch and the exceptions that the throws declaration allows the method to throw.
public Object runSafely(Catbert.FastStack stack) throws Exception { String s=getString(stack); if (s == null) s=""; stack.getUIMgrSafe().put("default_subpic_language",s); return null; }
Sets the name of the preferred default language when selecting which subpicture stream to playback. The values for this should be obtained from GetSubpicAudioLanguageOptions, the value of null or the empty string is also allowed to indicate no subtitle track should be selected by default.