idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,188,848
private void loadWhiteList(Project p, List<String> list, Map<String, Boolean> map) {<NEW_LINE>// prevent circle reference<NEW_LINE>if (p == null || map.get(p.getId() + "") != null) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>map.put(p.<MASK><NEW_LINE>}<NEW_LINE>if (p != null) {<NEW_LINE>for (Module m : p.getModuleList()) {<NEW_LINE>for (Page page : m.getPageList()) {<NEW_LINE>for (Action a : page.getActionList()) {<NEW_LINE>list.add(a.getRequestUrlRel());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String relatedIds = p.getRelatedIds();<NEW_LINE>if (relatedIds != null && !relatedIds.isEmpty()) {<NEW_LINE>String[] relatedIdsArr = relatedIds.split(",");<NEW_LINE>for (String relatedId : relatedIdsArr) {<NEW_LINE>int rId = Integer.parseInt(relatedId);<NEW_LINE>Project rP = projectMgr.getProject(rId);<NEW_LINE>if (rP != null && rP.getId() > 0)<NEW_LINE>loadWhiteList(rP, list, map);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getId() + "", true);
1,489,698
private void processClassDataItem(DexHeader header, ClassDefItem item, TaskMonitor monitor, MessageLog log) throws DuplicateNameException, IOException, Exception {<NEW_LINE>if (item.getClassDataOffset() > 0) {<NEW_LINE>ClassDataItem classDataItem = item.getClassDataItem();<NEW_LINE>Address classDataAddress = baseAddress.add(DexUtil.adjustOffset(item.getClassDataOffset(), header));<NEW_LINE>DataType classDataDataType = classDataItem.toDataType();<NEW_LINE>try {<NEW_LINE>api.createData(classDataAddress, classDataDataType);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.appendMsg("Unable to create class data item at " + classDataAddress);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>fragmentManager.classDataAddressSet.add(classDataAddress, classDataAddress.add(classDataDataType<MASK><NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("Class: " + DexUtil.convertTypeIndexToString(header, item.getClassIndex()) + "\n\n");<NEW_LINE>builder.append("Static Fields: " + classDataItem.getStaticFieldsSize() + "\n");<NEW_LINE>builder.append("Instance Fields: " + classDataItem.getInstanceFieldsSize() + "\n");<NEW_LINE>builder.append("Direct Methods: " + classDataItem.getDirectMethodsSize() + "\n");<NEW_LINE>builder.append("Virtual Methods: " + classDataItem.getVirtualMethodsSize() + "\n");<NEW_LINE>processEncodedFields(header, classDataItem.getStaticFields(), monitor);<NEW_LINE>processEncodedFields(header, classDataItem.getInstancesFields(), monitor);<NEW_LINE>processEncodedMethods(header, item, classDataItem.getDirectMethods(), monitor);<NEW_LINE>processEncodedMethods(header, item, classDataItem.getVirtualMethods(), monitor);<NEW_LINE>api.setPlateComment(classDataAddress, builder.toString());<NEW_LINE>}<NEW_LINE>}
.getLength() - 1));
1,041,364
public TransformResources unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TransformResources transformResources = new TransformResources();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("InstanceType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>transformResources.setInstanceType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("InstanceCount", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>transformResources.setInstanceCount(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("VolumeKmsKeyId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>transformResources.setVolumeKmsKeyId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return transformResources;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
243,111
public static GsiMetaBean initTableMeta(GsiMetaManager gsiMetaManager, String schema, String tableName, EnumSet<IndexStatus> statusSet) {<NEW_LINE>final GsiMetaBean result = new GsiMetaBean();<NEW_LINE>final List<String> statuses = statusSet.stream().map(s -> String.valueOf(s.getValue())).collect(Collectors.toList());<NEW_LINE>final List<IndexRecord> allIndexRecords = gsiMetaManager.getIndexRecords(schema, tableName, statuses);<NEW_LINE>final List<IndexRecord> indexRecordsByIndexName = gsiMetaManager.getIndexRecordsByIndexName(schema, tableName);<NEW_LINE>String mainTableName = tableName;<NEW_LINE>if (GeneralUtil.isEmpty(allIndexRecords) && !GeneralUtil.isEmpty(indexRecordsByIndexName)) {<NEW_LINE>mainTableName = indexRecordsByIndexName.get(0).tableName;<NEW_LINE>}<NEW_LINE>allIndexRecords.addAll(indexRecordsByIndexName);<NEW_LINE>final Map<String, Map<String, GsiIndexMetaBean>> tmpTableIndexMap = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>final Builder<String, String> indexTableRelationBuilder = mergeIndexRecords(allIndexRecords, tmpTableIndexMap);<NEW_LINE>result.indexTableRelation = indexTableRelationBuilder.build();<NEW_LINE>if (GeneralUtil.isNotEmpty(tmpTableIndexMap)) {<NEW_LINE>final List<TableRecord> allTableRecords = gsiMetaManager.getTableRecords(schema, ImmutableList.copyOf(tmpTableIndexMap.get(mainTableName).keySet()));<NEW_LINE>final Builder<String, GsiTableMetaBean> <MASK><NEW_LINE>result.tableMeta = tableMetaBuilder.build();<NEW_LINE>} else {<NEW_LINE>result.tableMeta = ImmutableMap.of();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
tableMetaBuilder = mergeTableRecords(allTableRecords, tmpTableIndexMap);
480,571
final DescribeEventsResult executeDescribeEvents(DescribeEventsRequest describeEventsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeEventsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeEventsRequest> request = null;<NEW_LINE>Response<DescribeEventsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeEventsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeEventsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Database Migration Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeEvents");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeEventsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeEventsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
578,644
private void doAssert(Map<String, String> expected, PlaybackContext context) throws AssertionError {<NEW_LINE>final Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();<NEW_LINE>if (owner == null) {<NEW_LINE>throw new AssertionError("No component focused");<NEW_LINE>}<NEW_LINE>Component eachParent = owner;<NEW_LINE>final LinkedHashMap<String, String> actual = new LinkedHashMap<String, String>();<NEW_LINE>while (eachParent != null) {<NEW_LINE>if (eachParent instanceof Queryable) {<NEW_LINE>((Queryable) eachParent).putInfo(actual);<NEW_LINE>}<NEW_LINE>eachParent = eachParent.getParent();<NEW_LINE>}<NEW_LINE>Set testedKeys <MASK><NEW_LINE>for (String eachKey : expected.keySet()) {<NEW_LINE>testedKeys.add(eachKey);<NEW_LINE>final String actualValue = actual.get(eachKey);<NEW_LINE>final String expectedValue = expected.get(eachKey);<NEW_LINE>if (!expectedValue.equals(actualValue)) {<NEW_LINE>throw new AssertionError(eachKey + " expected: " + expectedValue + " but was: " + actualValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, String> untested = new HashMap<String, String>();<NEW_LINE>for (String eachKey : actual.keySet()) {<NEW_LINE>if (testedKeys.contains(eachKey))<NEW_LINE>continue;<NEW_LINE>untested.put(eachKey, actual.get(eachKey));<NEW_LINE>}<NEW_LINE>StringBuffer untestedText = new StringBuffer();<NEW_LINE>for (String each : untested.keySet()) {<NEW_LINE>if (untestedText.length() > 0) {<NEW_LINE>untestedText.append(",");<NEW_LINE>}<NEW_LINE>untestedText.append(each).append("=").append(untested.get(each));<NEW_LINE>}<NEW_LINE>context.message("Untested info: " + untestedText.toString(), getLine());<NEW_LINE>}
= new LinkedHashSet<String>();
261,295
private void updateDomainNetworkRef(Connection conn) {<NEW_LINE>List<PreparedStatement> pstmt2Close = new ArrayList<PreparedStatement>();<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>// update subdomain access field for existing domain specific networks<NEW_LINE>pstmt = conn.prepareStatement("select value from `cloud`.`configuration` where name='allow.subdomain.network.access'");<NEW_LINE>pstmt2Close.add(pstmt);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>boolean subdomainAccess = Boolean.valueOf(rs.getString(1));<NEW_LINE>pstmt = conn.prepareStatement("UPDATE `cloud`.`domain_network_ref` SET subdomain_access=?");<NEW_LINE>pstmt2Close.add(pstmt);<NEW_LINE><MASK><NEW_LINE>pstmt.executeUpdate();<NEW_LINE>s_logger.debug("Successfully updated subdomain_access field in network_domain table with value " + subdomainAccess);<NEW_LINE>}<NEW_LINE>// convert zone level 2.2.x networks to ROOT domain 3.0 access networks<NEW_LINE>pstmt = conn.prepareStatement("select id from `cloud`.`networks` where shared=true and is_domain_specific=false and traffic_type='Guest'");<NEW_LINE>pstmt2Close.add(pstmt);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>long networkId = rs.getLong(1);<NEW_LINE>pstmt = conn.prepareStatement("INSERT INTO `cloud`.`domain_network_ref` (domain_id, network_id, subdomain_access) VALUES (1, ?, 1)");<NEW_LINE>pstmt2Close.add(pstmt);<NEW_LINE>pstmt.setLong(1, networkId);<NEW_LINE>pstmt.executeUpdate();<NEW_LINE>s_logger.debug("Successfully converted zone specific network id=" + networkId + " to the ROOT domain level network with subdomain access set to true");<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new CloudRuntimeException("Unable to update domain network ref", e);<NEW_LINE>} finally {<NEW_LINE>TransactionLegacy.closePstmts(pstmt2Close);<NEW_LINE>}<NEW_LINE>}
pstmt.setBoolean(1, subdomainAccess);
513,677
private long rebuildRelationshipIndex(final String relType) {<NEW_LINE>if (relType == null) {<NEW_LINE>info("Relationship type not set, starting (re-)indexing all relationships");<NEW_LINE>} else {<NEW_LINE>info("Starting (re-)indexing all relationships of type {}", relType);<NEW_LINE>}<NEW_LINE>final long count = bulkGraphOperation(securityContext, getRelationshipQuery(relType, true), 1000, "RebuildRelIndex", new BulkGraphOperation<AbstractRelationship>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean handleGraphObject(final SecurityContext securityContext, final AbstractRelationship rel) {<NEW_LINE>rel.addToIndex();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleThrowable(final SecurityContext securityContext, final Throwable t, final AbstractRelationship rel) {<NEW_LINE>logger.warn("Unable to index relationship {}: {}", rel, t.getMessage());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleTransactionFailure(final SecurityContext securityContext, final Throwable t) {<NEW_LINE>logger.warn(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>info("Done with (re-)indexing {} relationships", count);<NEW_LINE>return count;<NEW_LINE>}
"Unable to index relationship: {}", t.getMessage());
755,596
private Elements.Builder convertBufferForTransmission() {<NEW_LINE>Elements.Builder bufferedElements = Elements.newBuilder();<NEW_LINE>for (Map.Entry<String, Receiver<?>> entry : outputDataReceivers.entrySet()) {<NEW_LINE>if (entry.getValue().getOutput().size() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ByteString bytes = entry.getValue().getOutput().toByteString();<NEW_LINE>bufferedElements.addDataBuilder().setInstructionId(processBundleRequestIdSupplier.get()).setTransformId(entry.getKey()).setData(bytes);<NEW_LINE>entry.getValue().resetOutput();<NEW_LINE>}<NEW_LINE>for (Map.Entry<TimerEndpoint, Receiver<?>> entry : outputTimersReceivers.entrySet()) {<NEW_LINE>if (entry.getValue().getOutput().size() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ByteString bytes = entry.getValue().getOutput().toByteString();<NEW_LINE>bufferedElements.addTimersBuilder().setInstructionId(processBundleRequestIdSupplier.get()).setTransformId(entry.getKey().pTransformId).setTimerFamilyId(entry.getKey()<MASK><NEW_LINE>entry.getValue().resetOutput();<NEW_LINE>}<NEW_LINE>bytesWrittenSinceFlush = 0L;<NEW_LINE>return bufferedElements;<NEW_LINE>}
.timerFamilyId).setTimers(bytes);
1,483,895
final GetRecommendationsResult executeGetRecommendations(GetRecommendationsRequest getRecommendationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRecommendationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRecommendationsRequest> request = null;<NEW_LINE>Response<GetRecommendationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRecommendationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRecommendationsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Personalize Runtime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRecommendations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRecommendationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRecommendationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,640,898
public void visit(BaseReader br) throws Exception {<NEW_LINE>// FIXME, make as assert here about no class cast exception<NEW_LINE>if (br instanceof BaseReader) {<NEW_LINE>WebModuleReader wRdr = (WebModuleReader) br;<NEW_LINE>_w.<MASK><NEW_LINE>String url = wRdr.getErrorUrl();<NEW_LINE>if ((url != null) && (!"".equals(url))) {<NEW_LINE>// XXX start of bug fix for 6171814<NEW_LINE>_c.createAttribute(Cluster.WEB_MODULE, "error-url", "ErrorUrl", AttrProp.CDATA, null, "");<NEW_LINE>// XXX end of bug fix for 6171814<NEW_LINE>_w.setErrorUrl(wRdr.getErrorUrl());<NEW_LINE>}<NEW_LINE>_w.setEnabled(Boolean.toString(wRdr.getLbEnabled()));<NEW_LINE>_w.setDisableTimeoutInMinutes(wRdr.getDisableTimeoutInMinutes());<NEW_LINE>IdempotentUrlPatternReader[] iRdrs = wRdr.getIdempotentUrlPattern();<NEW_LINE>if ((iRdrs != null) && (iRdrs.length > 0)) {<NEW_LINE>for (int i = 0; i < iRdrs.length; i++) {<NEW_LINE>iRdrs[i].accept(new IdempotentUrlPatternVisitor(_w, i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setContextRoot(wRdr.getContextRoot());
807,217
public UpdateClusterConfigResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateClusterConfigResult updateClusterConfigResult = new UpdateClusterConfigResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return updateClusterConfigResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("update", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateClusterConfigResult.setUpdate(UpdateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return updateClusterConfigResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
621,040
public Object extractValue(final InputRow inputRow, final String metricName) {<NEW_LINE>final Object object = inputRow.getRaw(metricName);<NEW_LINE>if (object instanceof String) {<NEW_LINE>// everything is a string during ingestion<NEW_LINE>String objectString = (String) object;<NEW_LINE>// Autodetection of the input format: empty string, number, or base64 encoded sketch<NEW_LINE>// A serialized DoublesSketch, as currently implemented, always has 0 in the first 6 bits.<NEW_LINE>// This corresponds to "A" in base64, so it is not a digit<NEW_LINE>final Double doubleValue;<NEW_LINE>if (objectString.isEmpty()) {<NEW_LINE>return DoublesSketchOperations.EMPTY_SKETCH;<NEW_LINE>} else if ((doubleValue = Doubles.tryParse(objectString)) != null) {<NEW_LINE>UpdateDoublesSketch sketch = DoublesSketch.builder().setK(MIN_K).build();<NEW_LINE>sketch.update(doubleValue);<NEW_LINE>return sketch;<NEW_LINE>}<NEW_LINE>} else if (object instanceof Number) {<NEW_LINE>// this is for reindexing<NEW_LINE>UpdateDoublesSketch sketch = DoublesSketch.builder().<MASK><NEW_LINE>sketch.update(((Number) object).doubleValue());<NEW_LINE>return sketch;<NEW_LINE>}<NEW_LINE>if (object == null || object instanceof DoublesSketch || object instanceof Memory) {<NEW_LINE>return object;<NEW_LINE>}<NEW_LINE>return DoublesSketchOperations.deserialize(object);<NEW_LINE>}
setK(MIN_K).build();
1,408,944
private void decryptAllPassword() {<NEW_LINE>new SQLBatch() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void scripts() {<NEW_LINE>for (Field field : encryptedFields) {<NEW_LINE>String className = field<MASK><NEW_LINE>List<String> uuids = sql(String.format("select uuid from %s", className)).list();<NEW_LINE>for (String uuid : uuids) {<NEW_LINE>String encryptedString = sql(String.format("select %s from %s where uuid = '%s'", field.getName(), className, uuid)).find();<NEW_LINE>try {<NEW_LINE>String decryptString = (String) rsa.decrypt1(encryptedString);<NEW_LINE>String sql = String.format("update %s set %s = :decrypted where uuid = :uuid", className, field.getName());<NEW_LINE>Query query = dbf.getEntityManager().createQuery(sql);<NEW_LINE>query.setParameter("decrypted", decryptString);<NEW_LINE>query.setParameter("uuid", uuid);<NEW_LINE>query.executeUpdate();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.debug(String.format("decrypt password error because : %s", e.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>}
.getDeclaringClass().getSimpleName();
1,116,014
public void addRandomMaskAndReplace(Feature feature, boolean isKeptFirst, boolean isKeptLast) {<NEW_LINE>if (feature == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int[] masks = new int[maxSeqLen];<NEW_LINE>Arrays.fill(masks, 1);<NEW_LINE>int[<MASK><NEW_LINE>Arrays.fill(replaces, 1);<NEW_LINE>int[] inputIds = feature.inputIds;<NEW_LINE>for (int i = 0; i < feature.seqLen; i++) {<NEW_LINE>double rand1 = Math.random();<NEW_LINE>if (rand1 < LOW_THRESHOLD) {<NEW_LINE>masks[i] = 0;<NEW_LINE>double rand2 = Math.random();<NEW_LINE>if (rand2 < MID_THRESHOLD) {<NEW_LINE>replaces[i] = FILL_NUM;<NEW_LINE>} else if (rand2 < HIGH_THRESHOLD) {<NEW_LINE>masks[i] = 1;<NEW_LINE>} else {<NEW_LINE>replaces[i] = (int) (Math.random() * VOCAB_SIZE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isKeptFirst) {<NEW_LINE>masks[i] = 1;<NEW_LINE>replaces[i] = 0;<NEW_LINE>}<NEW_LINE>if (isKeptLast) {<NEW_LINE>masks[feature.seqLen - 1] = 1;<NEW_LINE>replaces[feature.seqLen - 1] = 0;<NEW_LINE>}<NEW_LINE>inputIds[i] = inputIds[i] * masks[i] + replaces[i];<NEW_LINE>}<NEW_LINE>}
] replaces = new int[maxSeqLen];
301,454
public NType resolve(Scope s) throws Exception {<NEW_LINE>NType ft = resolveExpr(func, s);<NEW_LINE>List<NType> argTypes = new ArrayList<NType>();<NEW_LINE>for (NNode a : args) {<NEW_LINE>argTypes.add(resolveExpr(a, s));<NEW_LINE>}<NEW_LINE>resolveList(keywords, s);<NEW_LINE>resolveExpr(starargs, s);<NEW_LINE>resolveExpr(kwargs, s);<NEW_LINE>if (ft.isClassType()) {<NEW_LINE>// XXX: was new NInstanceType(ft)<NEW_LINE>return setType(ft);<NEW_LINE>}<NEW_LINE>if (ft.isFuncType()) {<NEW_LINE>return setType(ft.asFuncType().getReturnType().follow());<NEW_LINE>}<NEW_LINE>if (ft.isUnknownType()) {<NEW_LINE>NUnknownType to = new NUnknownType();<NEW_LINE><MASK><NEW_LINE>NUnionType.union(ft, at);<NEW_LINE>return setType(to);<NEW_LINE>}<NEW_LINE>addWarning("calling non-function " + ft);<NEW_LINE>return setType(new NUnknownType());<NEW_LINE>}
NFuncType at = new NFuncType(to);
336,527
public static // XML Bind supports only the first one.<NEW_LINE>Calendar parseDate(String value) {<NEW_LINE>// check for colon in the time offset<NEW_LINE>int timeZoneIndex = value.indexOf("T");<NEW_LINE>if (timeZoneIndex > 0) {<NEW_LINE>int sign = <MASK><NEW_LINE>if (sign < 0) {<NEW_LINE>sign = value.indexOf("-", timeZoneIndex);<NEW_LINE>}<NEW_LINE>// +4 means it's either hh:mm or hhmm<NEW_LINE>if (sign > 0) {<NEW_LINE>// +3 points to either : or m<NEW_LINE>int colonIndex = sign + 3;<NEW_LINE>// +hh - need to add :mm<NEW_LINE>if (colonIndex >= value.length()) {<NEW_LINE>value = value + ":00";<NEW_LINE>} else if (value.charAt(colonIndex) != ':') {<NEW_LINE>value = value.substring(0, colonIndex) + ":" + value.substring(colonIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return DatatypeConverter.parseDateTime(value);<NEW_LINE>}
value.indexOf("+", timeZoneIndex);
860,460
private Element loadRemotePolicy(String uri, String defName) {<NEW_LINE>ExtendedURIResolver resolver = new ExtendedURIResolver();<NEW_LINE>InputSource src = null;<NEW_LINE>try {<NEW_LINE>src = resolver.resolve(uri, "classpath:");<NEW_LINE>} catch (ConnectException | SocketTimeoutException e1) {<NEW_LINE>}<NEW_LINE>if (null == src) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>XMLStreamReader reader = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>Document doc = StaxUtils.read(reader);<NEW_LINE>uri = getPolicyId(doc.getDocumentElement());<NEW_LINE>if (StringUtils.isEmpty(uri)) {<NEW_LINE>uri = defName;<NEW_LINE>Attr att = doc.createAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, "wsu:" + PolicyConstants.WSU_ID_ATTR_NAME);<NEW_LINE>att.setNodeValue(defName);<NEW_LINE>doc.getDocumentElement().setAttributeNodeNS(att);<NEW_LINE>}<NEW_LINE>return doc.getDocumentElement();<NEW_LINE>} catch (XMLStreamException e) {<NEW_LINE>LOG.log(Level.WARNING, e.getMessage());<NEW_LINE>return null;<NEW_LINE>} finally {<NEW_LINE>StaxUtils.close(reader);<NEW_LINE>}<NEW_LINE>}
reader = StaxUtils.createXMLStreamReader(src);
459,074
public void collect(final IGangliaMetricsReporter reporter) {<NEW_LINE>// log.warn(statisticsCollector.getCounters().toString());<NEW_LINE>// Common base path which is NOT included in the generated metric name.<NEW_LINE>final String basePrefix = ICounterSet.pathSeparator + AbstractStatisticsCollector.fullyQualifiedHostName + ICounterSet.pathSeparator;<NEW_LINE>// Start at the "host" level.<NEW_LINE>final CounterSet counters = (CounterSet) statisticsCollector.getCounters().getPath(basePrefix);<NEW_LINE>@SuppressWarnings("rawtypes")<NEW_LINE>final Iterator<ICounter> itr = counters.getCounters(filter);<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>final ICounter<?> c = itr.next();<NEW_LINE>final Object value = c.getInstrument().getValue();<NEW_LINE>// The full path to the metric name.<NEW_LINE>final String path = c.getPath();<NEW_LINE>// Just the metric name.<NEW_LINE>final String metricName = GangliaMunge.munge(path.substring(basePrefix.length()).replace('/', '.'));<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
reporter.setMetric(metricName, value);
1,842,574
public TransferResult<CFValue, CFStore> visitMethodInvocation(MethodInvocationNode node, TransferInput<CFValue, CFStore> in) {<NEW_LINE>FormatterAnnotatedTypeFactory atypeFactory = (FormatterAnnotatedTypeFactory) analysis.getTypeFactory();<NEW_LINE>TransferResult<CFValue, CFStore> result = super.visitMethodInvocation(node, in);<NEW_LINE>FormatterTreeUtil tu = atypeFactory.treeUtil;<NEW_LINE>if (tu.isAsFormatCall(node, atypeFactory)) {<NEW_LINE>Result<ConversionCategory[]> cats = tu.asFormatCallCategories(node);<NEW_LINE>if (cats.value() == null) {<NEW_LINE>tu.failure(cats, "format.asformat.indirect.arguments");<NEW_LINE>} else {<NEW_LINE>AnnotationMirror anno = atypeFactory.treeUtil.categoriesToFormatAnnotation(cats.value());<NEW_LINE>CFValue newResultValue = analysis.createSingleAnnotationValue(anno, result.getResultValue().getUnderlyingType());<NEW_LINE>return new RegularTransferResult<>(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
newResultValue, result.getRegularStore());
369,445
public ProcessInstance handleCommand(Logger logger, String host, Command command) {<NEW_LINE>ProcessInstance processInstance = constructProcessInstance(command, host);<NEW_LINE>// cannot construct process instance, return null<NEW_LINE>if (processInstance == null) {<NEW_LINE><MASK><NEW_LINE>moveToErrorCommand(command, "process instance is null");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>processInstance.setCommandType(command.getCommandType());<NEW_LINE>processInstance.addHistoryCmd(command.getCommandType());<NEW_LINE>// if the processDefinition is serial<NEW_LINE>ProcessDefinition processDefinition = this.findProcessDefinition(processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion());<NEW_LINE>if (processDefinition.getExecutionType().typeIsSerial()) {<NEW_LINE>saveSerialProcess(processInstance, processDefinition);<NEW_LINE>if (processInstance.getState() != ExecutionStatus.SUBMITTED_SUCCESS) {<NEW_LINE>setSubProcessParam(processInstance);<NEW_LINE>deleteCommandWithCheck(command.getId());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>saveProcessInstance(processInstance);<NEW_LINE>}<NEW_LINE>setSubProcessParam(processInstance);<NEW_LINE>deleteCommandWithCheck(command.getId());<NEW_LINE>return processInstance;<NEW_LINE>}
logger.error("scan command, command parameter is error: {}", command);
248,429
private UserConsentModel toConsentModel(RealmModel realm, UserConsentEntity entity) {<NEW_LINE>if (entity == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StorageId clientStorageId = null;<NEW_LINE>if (entity.getClientId() == null) {<NEW_LINE>clientStorageId = new StorageId(entity.getClientStorageProvider(), entity.getExternalClientId());<NEW_LINE>} else {<NEW_LINE>clientStorageId = new StorageId(entity.getClientId());<NEW_LINE>}<NEW_LINE>ClientModel client = realm.getClientById(clientStorageId.getId());<NEW_LINE>if (client == null) {<NEW_LINE>throw new ModelException("Client with id " + <MASK><NEW_LINE>}<NEW_LINE>UserConsentModel model = new UserConsentModel(client);<NEW_LINE>model.setCreatedDate(entity.getCreatedDate());<NEW_LINE>model.setLastUpdatedDate(entity.getLastUpdatedDate());<NEW_LINE>Collection<UserConsentClientScopeEntity> grantedClientScopeEntities = entity.getGrantedClientScopes();<NEW_LINE>if (grantedClientScopeEntities != null) {<NEW_LINE>for (UserConsentClientScopeEntity grantedClientScope : grantedClientScopeEntities) {<NEW_LINE>ClientScopeModel grantedClientScopeModel = KeycloakModelUtils.findClientScopeById(realm, client, grantedClientScope.getScopeId());<NEW_LINE>if (grantedClientScopeModel != null) {<NEW_LINE>model.addGrantedClientScope(grantedClientScopeModel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>}
clientStorageId.getId() + " is not available");
1,806,295
public TbQueueRequestTemplate<TbProtoJsQueueMsg<RemoteJsRequest>, TbProtoQueueMsg<RemoteJsResponse>> createRemoteJsRequestTemplate() {<NEW_LINE>TbQueueProducer<TbProtoJsQueueMsg<RemoteJsRequest>> producer = new TbRabbitMqProducerTemplate<>(jsExecutorAdmin, rabbitMqSettings, jsInvokeSettings.getRequestTopic());<NEW_LINE>TbQueueConsumer<TbProtoQueueMsg<RemoteJsResponse>> consumer = new TbRabbitMqConsumerTemplate<>(jsExecutorAdmin, rabbitMqSettings, jsInvokeSettings.getResponseTopic() + "." + serviceInfoProvider.getServiceId(), msg -> {<NEW_LINE>RemoteJsResponse.Builder builder = RemoteJsResponse.newBuilder();<NEW_LINE>JsonFormat.parser().ignoringUnknownFields().merge(new String(msg.getData()<MASK><NEW_LINE>return new TbProtoQueueMsg<>(msg.getKey(), builder.build(), msg.getHeaders());<NEW_LINE>});<NEW_LINE>DefaultTbQueueRequestTemplate.DefaultTbQueueRequestTemplateBuilder<TbProtoJsQueueMsg<RemoteJsRequest>, TbProtoQueueMsg<RemoteJsResponse>> builder = DefaultTbQueueRequestTemplate.builder();<NEW_LINE>builder.queueAdmin(jsExecutorAdmin);<NEW_LINE>builder.requestTemplate(producer);<NEW_LINE>builder.responseTemplate(consumer);<NEW_LINE>builder.maxPendingRequests(jsInvokeSettings.getMaxPendingRequests());<NEW_LINE>builder.maxRequestTimeout(jsInvokeSettings.getMaxRequestsTimeout());<NEW_LINE>builder.pollInterval(jsInvokeSettings.getResponsePollInterval());<NEW_LINE>return builder.build();<NEW_LINE>}
, StandardCharsets.UTF_8), builder);
64,392
public boolean deserializer(KryoTupleDeserializer deserializer, boolean forceConsume) {<NEW_LINE>// LOG.debug("start Deserializer of task, {}", taskId);<NEW_LINE>boolean isIdling = true;<NEW_LINE>DisruptorQueue <MASK><NEW_LINE>if (!taskStatus.isShutdown()) {<NEW_LINE>if ((deserializeQueue.population() > 0 && exeQueue.pctFull() < 1.0) || forceConsume) {<NEW_LINE>try {<NEW_LINE>List<Object> objects = deserializeQueue.retreiveAvailableBatch();<NEW_LINE>for (Object object : objects) {<NEW_LINE>deserialize(deserializer, (byte[]) object, exeQueue);<NEW_LINE>}<NEW_LINE>isIdling = false;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOG.error("InterruptedException " + e.getCause());<NEW_LINE>return true;<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>return true;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (Utils.exceptionCauseIsInstanceOf(KryoException.class, e)) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} else if (!taskStatus.isShutdown()) {<NEW_LINE>LOG.error("Unknown exception ", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>task.unregisterDeserializeQueue();<NEW_LINE>}<NEW_LINE>return isIdling;<NEW_LINE>}
exeQueue = innerTaskTransfer.get(taskId);
1,230,182
private static Pair<List<TResultBatch>, Status> executeStmt(ConnectContext context, ExecPlan plan) throws Exception {<NEW_LINE>Coordinator coord = new Coordinator(context, plan.getFragments(), plan.getScanNodes(), plan.getDescTbl().toThrift());<NEW_LINE>QeProcessorImpl.INSTANCE.registerQuery(context.getExecutionId(), coord);<NEW_LINE>List<TResultBatch> sqlResult = Lists.newArrayList();<NEW_LINE>try {<NEW_LINE>coord.exec();<NEW_LINE>RowBatch batch;<NEW_LINE>do {<NEW_LINE>batch = coord.getNext();<NEW_LINE>if (batch.getBatch() != null) {<NEW_LINE>sqlResult.<MASK><NEW_LINE>}<NEW_LINE>} while (!batch.isEos());<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn(e);<NEW_LINE>} finally {<NEW_LINE>QeProcessorImpl.INSTANCE.unregisterQuery(context.getExecutionId());<NEW_LINE>}<NEW_LINE>return Pair.create(sqlResult, coord.getExecStatus());<NEW_LINE>}
add(batch.getBatch());
91,821
private static int printSourceNumber(String source, int offset, StringBuffer sb) {<NEW_LINE>double number = 0.0;<NEW_LINE>char type = source.charAt(offset);<NEW_LINE>++offset;<NEW_LINE>if (type == 'S') {<NEW_LINE>if (sb != null) {<NEW_LINE>number = source.charAt(offset);<NEW_LINE>}<NEW_LINE>++offset;<NEW_LINE>} else if (type == 'J' || type == 'D') {<NEW_LINE>if (sb != null) {<NEW_LINE>long lbits;<NEW_LINE>lbits = (long) source.charAt(offset) << 48;<NEW_LINE>lbits |= (long) source.charAt(offset + 1) << 32;<NEW_LINE>lbits |= (long) source.<MASK><NEW_LINE>lbits |= (long) source.charAt(offset + 3);<NEW_LINE>if (type == 'J') {<NEW_LINE>number = lbits;<NEW_LINE>} else {<NEW_LINE>number = Double.longBitsToDouble(lbits);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>offset += 4;<NEW_LINE>} else {<NEW_LINE>// Bad source<NEW_LINE>throw new RuntimeException();<NEW_LINE>}<NEW_LINE>if (sb != null) {<NEW_LINE>sb.append(ScriptRuntime.numberToString(number, 10));<NEW_LINE>}<NEW_LINE>return offset;<NEW_LINE>}
charAt(offset + 2) << 16;
1,316,434
private static void recursivelyAnalyzeSignatureRelatedType(NativeConfigurationRegistry registry, Class<?> clazz, Set<String> added) {<NEW_LINE>for (Field field : clazz.getDeclaredFields()) {<NEW_LINE>Set<Class<?>> fieldSignatureTypes = NativeConfigurationUtils.collectTypesInSignature(field);<NEW_LINE>for (Class<?> fieldSignatureType : fieldSignatureTypes) {<NEW_LINE><MASK><NEW_LINE>if (!ignore(name) && added.add(name)) {<NEW_LINE>// TODO we are not included the hierarchy of the target here, is that OK because we are using allPublic* ?<NEW_LINE>registry.reflection().forType(fieldSignatureType).withAccess(TypeAccess.DECLARED_CONSTRUCTORS, TypeAccess.PUBLIC_CONSTRUCTORS, TypeAccess.DECLARED_FIELDS, TypeAccess.PUBLIC_FIELDS, TypeAccess.DECLARED_METHODS, TypeAccess.PUBLIC_METHODS);<NEW_LINE>recursivelyAnalyzeSignatureRelatedType(registry, fieldSignatureType, added);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String name = fieldSignatureType.getName();
345,083
public boolean resolve() {<NEW_LINE>String[] options = { "File(Wsdl)", "Url(Wsdl)", "File(Wadl)", "Url(Wadl)", "Cancel" };<NEW_LINE>int choosed = JOptionPane.showOptionDialog(UISupport.getMainFrame(), "Choose source for new interface from ...", "New interface source", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.<MASK><NEW_LINE>switch(choosed) {<NEW_LINE>case 0:<NEW_LINE>loadWsdlFromFile();<NEW_LINE>resolved = update();<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>loadWsdlFromUrl();<NEW_LINE>resolved = update();<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>loadWadlFromFile();<NEW_LINE>resolved = update();<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>loadWadlFromUrl();<NEW_LINE>resolved = update();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>resolved = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return resolved;<NEW_LINE>}
QUESTION_MESSAGE, null, options, null);
753,557
private final void resize() {<NEW_LINE>final int newTableEntries = nextPrime((int) (tableEntries_ * growthFactor_));<NEW_LINE>final int newCapacityEntries = (int) (newTableEntries * LOAD_FACTOR);<NEW_LINE>final byte[] newKeysArr = new byte[newTableEntries * keySizeBytes_];<NEW_LINE>final long[] newArrOfHllArr = new long[newTableEntries * hllArrLongs_];<NEW_LINE>final double[] newInvPow2Sum1 = new double[newTableEntries];<NEW_LINE>final double[] newInvPow2Sum2 = new double[newTableEntries];<NEW_LINE>final double[] newHipEstAccum = new double[newTableEntries];<NEW_LINE>final byte[] newStateArr = new byte[(int) Math.ceil(newTableEntries / 8.0)];<NEW_LINE>for (int oldIndex = 0; oldIndex < tableEntries_; oldIndex++) {<NEW_LINE>if (isBitClear(stateArr_, oldIndex)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// extract an old key<NEW_LINE>final byte[] key = Arrays.copyOfRange(keysArr_, oldIndex * keySizeBytes_, <MASK><NEW_LINE>final int newIndex = findEmpty(key, newTableEntries, newStateArr);<NEW_LINE>// put key<NEW_LINE>System.arraycopy(key, 0, newKeysArr, newIndex * keySizeBytes_, keySizeBytes_);<NEW_LINE>// put the rest of the row<NEW_LINE>System.arraycopy(arrOfHllArr_, oldIndex * hllArrLongs_, newArrOfHllArr, newIndex * hllArrLongs_, hllArrLongs_);<NEW_LINE>newInvPow2Sum1[newIndex] = invPow2SumHiArr_[oldIndex];<NEW_LINE>newInvPow2Sum2[newIndex] = invPow2SumLoArr_[oldIndex];<NEW_LINE>newHipEstAccum[newIndex] = hipEstAccumArr_[oldIndex];<NEW_LINE>setBit(newStateArr, newIndex);<NEW_LINE>}<NEW_LINE>// restore into sketch<NEW_LINE>tableEntries_ = newTableEntries;<NEW_LINE>capacityEntries_ = newCapacityEntries;<NEW_LINE>// curCountEntries_, growthFactor_ unchanged<NEW_LINE>entrySizeBytes_ = updateEntrySizeBytes(tableEntries_, keySizeBytes_, hllArrLongs_);<NEW_LINE>keysArr_ = newKeysArr;<NEW_LINE>arrOfHllArr_ = newArrOfHllArr;<NEW_LINE>// init to k<NEW_LINE>invPow2SumHiArr_ = newInvPow2Sum1;<NEW_LINE>// init to 0<NEW_LINE>invPow2SumLoArr_ = newInvPow2Sum2;<NEW_LINE>// init to 0<NEW_LINE>hipEstAccumArr_ = newHipEstAccum;<NEW_LINE>stateArr_ = newStateArr;<NEW_LINE>}
(oldIndex + 1) * keySizeBytes_);
473,612
public List<Pair<String, String>> export(Node node, ProgressReporter progressReporter) {<NEW_LINE>final String name = (String) node.getProperty(SystemPropertyKeys.name.name());<NEW_LINE>final String query = (String) node.getProperty(SystemPropertyKeys.statement.name());<NEW_LINE>try {<NEW_LINE>final String selector = toCypherMap(JsonUtil.OBJECT_MAPPER.readValue((String) node.getProperty(SystemPropertyKeys.selector.name()), Map.class));<NEW_LINE>final String params = toCypherMap(JsonUtil.OBJECT_MAPPER.readValue((String) node.getProperty(SystemPropertyKeys.params.name()), Map.class));<NEW_LINE>String statement = String.format("CALL apoc.trigger.add('%s', '%s', %s, {params: %s});", name, query, selector, params);<NEW_LINE>if ((boolean) node.getProperty(SystemPropertyKeys.paused.name())) {<NEW_LINE>statement += String.format("\nCALL apoc.trigger.pause('%s');", name);<NEW_LINE>}<NEW_LINE>progressReporter.nextRow();<NEW_LINE>return List.of(Pair.of(getFileName(node, Type.Trigger.<MASK><NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
name()), statement));
828,761
public static ListDevopsProjectsResponse unmarshall(ListDevopsProjectsResponse listDevopsProjectsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDevopsProjectsResponse.setRequestId(_ctx.stringValue("ListDevopsProjectsResponse.RequestId"));<NEW_LINE>listDevopsProjectsResponse.setErrorMsg(_ctx.stringValue("ListDevopsProjectsResponse.ErrorMsg"));<NEW_LINE>listDevopsProjectsResponse.setSuccessful(_ctx.booleanValue("ListDevopsProjectsResponse.Successful"));<NEW_LINE>listDevopsProjectsResponse.setErrorCode(_ctx.stringValue("ListDevopsProjectsResponse.ErrorCode"));<NEW_LINE>Object object = new Object();<NEW_LINE>object.setNextPageToken(_ctx.stringValue("ListDevopsProjectsResponse.Object.NextPageToken"));<NEW_LINE>List<Project> result = new ArrayList<Project>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDevopsProjectsResponse.Object.Result.Length"); i++) {<NEW_LINE>Project project = new Project();<NEW_LINE>project.setLogo(_ctx.stringValue("ListDevopsProjectsResponse.Object.Result[" + i + "].Logo"));<NEW_LINE>project.setIsStar(_ctx.booleanValue("ListDevopsProjectsResponse.Object.Result[" + i + "].IsStar"));<NEW_LINE>project.setCreatorId(_ctx.stringValue("ListDevopsProjectsResponse.Object.Result[" + i + "].CreatorId"));<NEW_LINE>project.setMembersCount(_ctx.integerValue("ListDevopsProjectsResponse.Object.Result[" + i + "].MembersCount"));<NEW_LINE>project.setOrganizationId(_ctx.stringValue<MASK><NEW_LINE>project.setVisibility(_ctx.stringValue("ListDevopsProjectsResponse.Object.Result[" + i + "].Visibility"));<NEW_LINE>project.setIsTemplate(_ctx.booleanValue("ListDevopsProjectsResponse.Object.Result[" + i + "].IsTemplate"));<NEW_LINE>project.setDescription(_ctx.stringValue("ListDevopsProjectsResponse.Object.Result[" + i + "].Description"));<NEW_LINE>project.setUpdated(_ctx.stringValue("ListDevopsProjectsResponse.Object.Result[" + i + "].Updated"));<NEW_LINE>project.setCreated(_ctx.stringValue("ListDevopsProjectsResponse.Object.Result[" + i + "].Created"));<NEW_LINE>project.setIsArchived(_ctx.booleanValue("ListDevopsProjectsResponse.Object.Result[" + i + "].IsArchived"));<NEW_LINE>project.setName(_ctx.stringValue("ListDevopsProjectsResponse.Object.Result[" + i + "].Name"));<NEW_LINE>project.setIsPublic(_ctx.booleanValue("ListDevopsProjectsResponse.Object.Result[" + i + "].IsPublic"));<NEW_LINE>project.setTasksCount(_ctx.integerValue("ListDevopsProjectsResponse.Object.Result[" + i + "].TasksCount"));<NEW_LINE>project.setRoleId(_ctx.stringValue("ListDevopsProjectsResponse.Object.Result[" + i + "].RoleId"));<NEW_LINE>project.setId(_ctx.stringValue("ListDevopsProjectsResponse.Object.Result[" + i + "].Id"));<NEW_LINE>result.add(project);<NEW_LINE>}<NEW_LINE>object.setResult(result);<NEW_LINE>listDevopsProjectsResponse.setObject(object);<NEW_LINE>return listDevopsProjectsResponse;<NEW_LINE>}
("ListDevopsProjectsResponse.Object.Result[" + i + "].OrganizationId"));
827,829
private RexNode flattenComparison(RexBuilder rexBuilder, SqlOperator op, List<RexNode> exprs) {<NEW_LINE>final List<Pair<RexNode, String>> flattenedExps = Lists.newArrayList();<NEW_LINE>flattenProjections(this, exprs, null, "", flattenedExps);<NEW_LINE>int n = flattenedExps.size() / 2;<NEW_LINE>boolean negate = false;<NEW_LINE>if (op.getKind() == SqlKind.NOT_EQUALS) {<NEW_LINE>negate = true;<NEW_LINE>op = SqlStdOperatorTable.EQUALS;<NEW_LINE>}<NEW_LINE>if ((n > 1) && op.getKind() != SqlKind.EQUALS) {<NEW_LINE>throw Util.needToImplement("inequality comparison for row types");<NEW_LINE>}<NEW_LINE>RexNode conjunction = null;<NEW_LINE>for (int i = 0; i < n; ++i) {<NEW_LINE>RexNode comparison = rexBuilder.makeCall(op, flattenedExps.get(i).left, flattenedExps.get<MASK><NEW_LINE>if (conjunction == null) {<NEW_LINE>conjunction = comparison;<NEW_LINE>} else {<NEW_LINE>conjunction = rexBuilder.makeCall(SqlStdOperatorTable.AND, conjunction, comparison);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (negate) {<NEW_LINE>return rexBuilder.makeCall(SqlStdOperatorTable.NOT, conjunction);<NEW_LINE>} else {<NEW_LINE>return conjunction;<NEW_LINE>}<NEW_LINE>}
(i + n).left);
1,591,557
public StartBackupJobResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartBackupJobResult startBackupJobResult = new StartBackupJobResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return startBackupJobResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("BackupJobId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startBackupJobResult.setBackupJobId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RecoveryPointArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startBackupJobResult.setRecoveryPointArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CreationDate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startBackupJobResult.setCreationDate(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return startBackupJobResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
476,149
protected void translateCore(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>final IOperandTreeNode registerOperand1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode rootNode = instruction.getOperands().get(1).getRootNode();<NEW_LINE>final String registerNodeValue = (registerOperand1.getValue());<NEW_LINE>final OperandSize bt = OperandSize.BYTE;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>long baseOffset = (instruction.getAddress().toLong() * 0x100) + instructions.size();<NEW_LINE>final String tmpVal1 = environment.getNextVariableString();<NEW_LINE>final Pair<String, String> resultPair = AddressingModeTwoGenerator.generate(baseOffset, environment, instruction, instructions, rootNode);<NEW_LINE>final String tmpAddress = resultPair.first();<NEW_LINE>baseOffset = (instruction.getAddress().toLong() * 0x100) + instructions.size();<NEW_LINE>instructions.add(ReilHelpers.createLdm(baseOffset++, dw<MASK><NEW_LINE>Helpers.signExtend(baseOffset, environment, instruction, instructions, bt, tmpVal1, dw, registerNodeValue, 8);<NEW_LINE>}
, tmpAddress, bt, tmpVal1));
1,195,811
public static <T> ArrayList<VueRouter<T>> buildVueRouter(List<VueRouter<T>> routes) {<NEW_LINE>if (routes == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<VueRouter<T>> topRoutes = new ArrayList<>();<NEW_LINE>routes.forEach(route -> {<NEW_LINE><MASK><NEW_LINE>if (parentId == null || TOP_NODE_ID.equals(parentId)) {<NEW_LINE>topRoutes.add(route);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (VueRouter<T> parent : routes) {<NEW_LINE>String id = parent.getId();<NEW_LINE>if (id != null && id.equals(parentId)) {<NEW_LINE>if (parent.getChildren() == null) {<NEW_LINE>parent.initChildren();<NEW_LINE>}<NEW_LINE>parent.getChildren().add(route);<NEW_LINE>parent.setHasChildren(true);<NEW_LINE>route.setHasParent(true);<NEW_LINE>parent.setHasParent(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ArrayList<VueRouter<T>> list = new ArrayList<>();<NEW_LINE>VueRouter<T> root = new VueRouter<>();<NEW_LINE>root.setName("Root");<NEW_LINE>root.setComponent("BasicView");<NEW_LINE>root.setPath("/");<NEW_LINE>root.setChildren(topRoutes);<NEW_LINE>list.add(root);<NEW_LINE>return list;<NEW_LINE>}
String parentId = route.getParentId();
1,252,844
private static HandshakeData createDefaultSsl() {<NEW_LINE>try {<NEW_LINE>final KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");<NEW_LINE>keyPairGenerator.initialize(2048);<NEW_LINE>final KeyPair keyPair = keyPairGenerator.generateKeyPair();<NEW_LINE>// Generate self signed certificate<NEW_LINE>final X509Certificate[] chain = new X509Certificate[1];<NEW_LINE>// Select provider<NEW_LINE>Security<MASK><NEW_LINE>// Generate cert details<NEW_LINE>final long now = System.currentTimeMillis();<NEW_LINE>final Date startDate = new Date(System.currentTimeMillis());<NEW_LINE>final X500Name dnName = new X500Name("C=US; ST=CO; L=Denver; " + "O=Apache Traffic Control; OU=Apache Foundation; OU=Hosted by Traffic Control; " + "OU=CDNDefault; CN=" + DEFAULT_SSL_KEY);<NEW_LINE>final BigInteger certSerialNumber = new BigInteger(Long.toString(now));<NEW_LINE>final Calendar calendar = Calendar.getInstance();<NEW_LINE>calendar.setTime(startDate);<NEW_LINE>calendar.add(Calendar.YEAR, 3);<NEW_LINE>final Date endDate = calendar.getTime();<NEW_LINE>// Build certificate<NEW_LINE>final ContentSigner contentSigner = new JcaContentSignerBuilder("SHA1WithRSA").build(keyPair.getPrivate());<NEW_LINE>final JcaX509v3CertificateBuilder certBuilder = new JcaX509v3CertificateBuilder(dnName, certSerialNumber, startDate, endDate, dnName, keyPair.getPublic());<NEW_LINE>// Attach extensions<NEW_LINE>certBuilder.addExtension(Extension.basicConstraints, true, new BasicConstraints(true));<NEW_LINE>certBuilder.addExtension(Extension.keyUsage, true, new KeyUsage(KeyUsage.digitalSignature | KeyUsage.keyEncipherment | KeyUsage.keyCertSign));<NEW_LINE>certBuilder.addExtension(Extension.extendedKeyUsage, true, new ExtendedKeyUsage(new KeyPurposeId[] { KeyPurposeId.id_kp_clientAuth, KeyPurposeId.id_kp_serverAuth }));<NEW_LINE>// Generate final certificate<NEW_LINE>final X509CertificateHolder certHolder = certBuilder.build(contentSigner);<NEW_LINE>final JcaX509CertificateConverter converter = new JcaX509CertificateConverter();<NEW_LINE>converter.setProvider(new BouncyCastleProvider());<NEW_LINE>chain[0] = converter.getCertificate(certHolder);<NEW_LINE>return new HandshakeData(DEFAULT_SSL_KEY, DEFAULT_SSL_KEY, chain, keyPair.getPrivate());<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Could not generate the default certificate: " + e.getMessage(), e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
.addProvider(new BouncyCastleProvider());
1,457,308
public static void main(String[] args) {<NEW_LINE>Exercise3 exercise3 = new Exercise3();<NEW_LINE>Digraph digraph = new Digraph(5);<NEW_LINE>digraph.addEdge(0, 1);<NEW_LINE>digraph.addEdge(0, 2);<NEW_LINE>digraph.addEdge(0, 3);<NEW_LINE>digraph.addEdge(1, 2);<NEW_LINE>digraph.addEdge(1, 4);<NEW_LINE>digraph.addEdge(2, 3);<NEW_LINE>CopyDigraph copyDigraph = exercise3.new CopyDigraph(digraph);<NEW_LINE>StdOut.println(copyDigraph);<NEW_LINE>StdOut.println("Expected:\n" + "0: 3 2 1\n" + "1: 4 2\n" + "2: 3\n" + "3: \n" + "4: \n");<NEW_LINE>copyDigraph.addEdge(0, 4);<NEW_LINE>StdOut.println("Edges in original digraph: " + digraph.edges() + " Expected: 6");<NEW_LINE>StdOut.println("Edges in copy digraph: " + <MASK><NEW_LINE>}
copyDigraph.edges() + " Expected: 7");
860,609
private void showImportSuggestion(String[] list, int x, int y) {<NEW_LINE>if (frmImportSuggest != null) {<NEW_LINE>// frmImportSuggest.setVisible(false);<NEW_LINE>// frmImportSuggest = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JList<String> classList = new JList<>(list);<NEW_LINE>classList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);<NEW_LINE>frmImportSuggest = new JFrame();<NEW_LINE>frmImportSuggest.setUndecorated(true);<NEW_LINE>frmImportSuggest.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));<NEW_LINE>panel.setBackground(Color.WHITE);<NEW_LINE><MASK><NEW_LINE>panel.add(classList);<NEW_LINE>JLabel label = new JLabel("<html><div alight = \"left\"><font size = \"2\"><br>(Click to insert)</font></div></html>");<NEW_LINE>label.setBackground(Color.WHITE);<NEW_LINE>label.setHorizontalTextPosition(SwingConstants.LEFT);<NEW_LINE>panel.add(label);<NEW_LINE>panel.validate();<NEW_LINE>frmImportSuggest.getContentPane().add(panel);<NEW_LINE>frmImportSuggest.pack();<NEW_LINE>classList.addListSelectionListener(e -> {<NEW_LINE>if (classList.getSelectedValue() != null) {<NEW_LINE>try {<NEW_LINE>String t = classList.getSelectedValue().trim();<NEW_LINE>Messages.log(t);<NEW_LINE>int x1 = t.indexOf('(');<NEW_LINE>String impString = "import " + t.substring(x1 + 1, t.indexOf(')')) + ";\n";<NEW_LINE>int ct = getSketch().getCurrentCodeIndex();<NEW_LINE>getSketch().setCurrentCode(0);<NEW_LINE>getTextArea().getDocument().insertString(0, impString, null);<NEW_LINE>getSketch().setCurrentCode(ct);<NEW_LINE>} catch (BadLocationException ble) {<NEW_LINE>Messages.log("Failed to insert import");<NEW_LINE>ble.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>frmImportSuggest.setVisible(false);<NEW_LINE>frmImportSuggest.dispose();<NEW_LINE>frmImportSuggest = null;<NEW_LINE>});<NEW_LINE>frmImportSuggest.addWindowFocusListener(new WindowFocusListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void windowLostFocus(WindowEvent e) {<NEW_LINE>if (frmImportSuggest != null) {<NEW_LINE>frmImportSuggest.dispose();<NEW_LINE>frmImportSuggest = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void windowGainedFocus(WindowEvent e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>frmImportSuggest.setLocation(x, y);<NEW_LINE>frmImportSuggest.setBounds(x, y, 250, 100);<NEW_LINE>frmImportSuggest.pack();<NEW_LINE>frmImportSuggest.setVisible(true);<NEW_LINE>}
frmImportSuggest.setBackground(Color.WHITE);
5,018
void init() {<NEW_LINE>dbWriterThread = new Thread(() -> {<NEW_LINE>try {<NEW_LINE>while (!Thread.currentThread().isInterrupted()) {<NEW_LINE>synchronized (FastSyncManager.this) {<NEW_LINE>if (dbQueueSizeMonitor >= 0 && dbWriteQueue.size() <= dbQueueSizeMonitor) {<NEW_LINE>FastSyncManager.this.notifyAll();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TrieNodeRequest request = dbWriteQueue.take();<NEW_LINE>nodesInserted++;<NEW_LINE>request.storageHashes().forEach(hash -> stateSource.getNoJournalSource().put(hash, request.response));<NEW_LINE>if (nodesInserted % 1000 == 0) {<NEW_LINE>dbFlushManager.commit();<NEW_LINE>logger.debug(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Fatal FastSync error while writing data", e);<NEW_LINE>}<NEW_LINE>}, "FastSyncDBWriter");<NEW_LINE>dbWriterThread.start();<NEW_LINE>fastSyncThread = new Thread(() -> {<NEW_LINE>try {<NEW_LINE>main();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Fatal FastSync loop error", e);<NEW_LINE>}<NEW_LINE>}, "FastSyncLoop");<NEW_LINE>fastSyncThread.start();<NEW_LINE>}
"FastSyncDBWriter: commit: dbWriteQueue.size = " + dbWriteQueue.size());
1,267,760
private NarayanaConfiguration createDefaultConfiguration(final String instanceId, final String recoveryId) {<NEW_LINE>NarayanaConfiguration result = new NarayanaConfiguration();<NEW_LINE>result.getEntries().add(createEntry("CoordinatorEnvironmentBean.commitOnePhase", "YES"));<NEW_LINE>result.getEntries().add(createEntry("ObjectStoreEnvironmentBean.transactionSync", "NO"));<NEW_LINE>result.getEntries().add(createEntry("CoreEnvironmentBean.nodeIdentifier", instanceId));<NEW_LINE>result.getEntries().add(createEntry("JTAEnvironmentBean.xaRecoveryNodes", recoveryId));<NEW_LINE>result.getEntries().add(createEntry("JTAEnvironmentBean.xaResourceOrphanFilterClassNames", createXAResourceOrphanFilterClassNames()));<NEW_LINE>result.getEntries().add(createEntry("CoreEnvironmentBean.socketProcessIdPort", "0"));<NEW_LINE>result.getEntries().add(createEntry("RecoveryEnvironmentBean.recoveryModuleClassNames", getRecoveryModuleClassNames()));<NEW_LINE>result.getEntries().add(createEntry("RecoveryEnvironmentBean.expiryScannerClassNames", ExpiredTransactionStatusManagerScanner.class.getName()));<NEW_LINE>result.getEntries().add(createEntry("RecoveryEnvironmentBean.recoveryPort", "4712"));<NEW_LINE>result.getEntries().add(createEntry("RecoveryEnvironmentBean.recoveryAddress", ""));<NEW_LINE>result.getEntries().add(createEntry("RecoveryEnvironmentBean.transactionStatusManagerPort", "0"));<NEW_LINE>result.getEntries().add<MASK><NEW_LINE>result.getEntries().add(createEntry("RecoveryEnvironmentBean.recoveryListener", "NO"));<NEW_LINE>result.getEntries().add(createEntry("RecoveryEnvironmentBean.recoveryBackoffPeriod", "1"));<NEW_LINE>result.getEntries().add(createEntry("CoordinatorEnvironmentBean.defaultTimeout", "180"));<NEW_LINE>return result;<NEW_LINE>}
(createEntry("RecoveryEnvironmentBean.transactionStatusManagerAddress", ""));
1,184,719
public static DescribeRecommendInstanceTypeResponse unmarshall(DescribeRecommendInstanceTypeResponse describeRecommendInstanceTypeResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeRecommendInstanceTypeResponse.setRequestId(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.RequestId"));<NEW_LINE>List<RecommendInstanceType> data = new ArrayList<RecommendInstanceType>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRecommendInstanceTypeResponse.Data.Length"); i++) {<NEW_LINE>RecommendInstanceType recommendInstanceType = new RecommendInstanceType();<NEW_LINE>recommendInstanceType.setCommodityCode(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].CommodityCode"));<NEW_LINE>recommendInstanceType.setZoneId(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].ZoneId"));<NEW_LINE>recommendInstanceType.setPriority(_ctx.integerValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].Priority"));<NEW_LINE>recommendInstanceType.setNetworkType(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].NetworkType"));<NEW_LINE>recommendInstanceType.setScene(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].Scene"));<NEW_LINE>recommendInstanceType.setSpotStrategy(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].SpotStrategy"));<NEW_LINE>recommendInstanceType.setRegionId(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].RegionId"));<NEW_LINE>recommendInstanceType.setInstanceChargeType(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].InstanceChargeType"));<NEW_LINE>InstanceType instanceType = new InstanceType();<NEW_LINE>instanceType.setSupportIoOptimized(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].InstanceType.SupportIoOptimized"));<NEW_LINE>instanceType.setCores(_ctx.integerValue<MASK><NEW_LINE>instanceType.setMemory(_ctx.integerValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].InstanceType.Memory"));<NEW_LINE>instanceType.setInstanceType(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].InstanceType.InstanceType"));<NEW_LINE>instanceType.setInstanceTypeFamily(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].InstanceType.InstanceTypeFamily"));<NEW_LINE>instanceType.setGeneration(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].InstanceType.Generation"));<NEW_LINE>recommendInstanceType.setInstanceType(instanceType);<NEW_LINE>List<Zone> zones = new ArrayList<Zone>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].Zones.Length"); j++) {<NEW_LINE>Zone zone = new Zone();<NEW_LINE>zone.setZoneNo(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].Zones[" + j + "].ZoneNo"));<NEW_LINE>List<String> networkTypes = new ArrayList<String>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].Zones[" + j + "].NetworkTypes.Length"); k++) {<NEW_LINE>networkTypes.add(_ctx.stringValue("DescribeRecommendInstanceTypeResponse.Data[" + i + "].Zones[" + j + "].NetworkTypes[" + k + "]"));<NEW_LINE>}<NEW_LINE>zone.setNetworkTypes(networkTypes);<NEW_LINE>zones.add(zone);<NEW_LINE>}<NEW_LINE>recommendInstanceType.setZones(zones);<NEW_LINE>data.add(recommendInstanceType);<NEW_LINE>}<NEW_LINE>describeRecommendInstanceTypeResponse.setData(data);<NEW_LINE>return describeRecommendInstanceTypeResponse;<NEW_LINE>}
("DescribeRecommendInstanceTypeResponse.Data[" + i + "].InstanceType.Cores"));
1,460,140
public void preOpExecution(SameDiff sd, At at, SameDiffOp op, OpContext oc) {<NEW_LINE>if (op.getOp().isInPlace()) {<NEW_LINE>// Don't check inplace op<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (op.getOp() instanceof Op) {<NEW_LINE>Op o = (Op) op.getOp();<NEW_LINE>if (oc.getInputArray(0) == null) {<NEW_LINE>// No input op<NEW_LINE>return;<NEW_LINE>} else if (oc.getInputArray(1) == null) {<NEW_LINE>opInputsOrig = new INDArray[] { oc.getInputArray(0) };<NEW_LINE>opInputs = new INDArray[] { oc.getInputArray(0).dup() };<NEW_LINE>} else {<NEW_LINE>opInputsOrig = new INDArray[] { oc.getInputArray(0), oc.getInputArray(1) };<NEW_LINE>opInputs = new INDArray[] { oc.getInputArray(0).dup(), oc.getInputArray(1).dup() };<NEW_LINE>}<NEW_LINE>} else if (op.getOp() instanceof DynamicCustomOp) {<NEW_LINE>// ((DynamicCustomOp) op.getOp()).inputArguments();<NEW_LINE>List<INDArray> arr = oc.getInputArrays();<NEW_LINE>opInputs = new <MASK><NEW_LINE>opInputsOrig = new INDArray[arr.size()];<NEW_LINE>for (int i = 0; i < arr.size(); i++) {<NEW_LINE>opInputsOrig[i] = arr.get(i);<NEW_LINE>opInputs[i] = arr.get(i).dup();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unknown op type: " + op.getOp().getClass());<NEW_LINE>}<NEW_LINE>}
INDArray[arr.size()];
464,734
public static void vertical3(Kernel1D_S32 kernel, GrayS32 src, GrayS32 dst, int divisor, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>final int[] dataSrc = src.data;<NEW_LINE>final int[] dataDst = dst.data;<NEW_LINE>final int <MASK><NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int halfDivisor = divisor / 2;<NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc]) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>dataDst[indexDst++] = ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
k1 = kernel.data[0];
1,614,472
protected Item createRSSItem(final SyndEntry sEntry) {<NEW_LINE>final Item item = super.createRSSItem(sEntry);<NEW_LINE>final List<SyndPerson> authors = sEntry.getAuthors();<NEW_LINE>if (Lists.isNotEmpty(authors)) {<NEW_LINE>final SyndPerson author = authors.get(0);<NEW_LINE>item.setAuthor(author.getEmail());<NEW_LINE>}<NEW_LINE>Guid guid = null;<NEW_LINE>final String uri = sEntry.getUri();<NEW_LINE>final String link = sEntry.getLink();<NEW_LINE>if (uri != null) {<NEW_LINE>guid = new Guid();<NEW_LINE>guid.setPermaLink(false);<NEW_LINE>guid.setValue(uri);<NEW_LINE>} else if (link != null) {<NEW_LINE>guid = new Guid();<NEW_LINE>guid.setPermaLink(true);<NEW_LINE>guid.setValue(link);<NEW_LINE>}<NEW_LINE>item.setGuid(guid);<NEW_LINE>final SyndLink <MASK><NEW_LINE>if (comments != null && (comments.getType() == null || comments.getType().endsWith("html"))) {<NEW_LINE>item.setComments(comments.getHref());<NEW_LINE>}<NEW_LINE>return item;<NEW_LINE>}
comments = sEntry.findRelatedLink("comments");
188,668
public DLedgerEntry appendAsLeader(DLedgerEntry entry) {<NEW_LINE>PreConditions.check(memberState.<MASK><NEW_LINE>PreConditions.check(!isDiskFull, DLedgerResponseCode.DISK_FULL);<NEW_LINE>ByteBuffer dataBuffer = localEntryBuffer.get();<NEW_LINE>ByteBuffer indexBuffer = localIndexBuffer.get();<NEW_LINE>DLedgerEntryCoder.encode(entry, dataBuffer);<NEW_LINE>int entrySize = dataBuffer.remaining();<NEW_LINE>synchronized (memberState) {<NEW_LINE>PreConditions.check(memberState.isLeader(), DLedgerResponseCode.NOT_LEADER, null);<NEW_LINE>PreConditions.check(memberState.getTransferee() == null, DLedgerResponseCode.LEADER_TRANSFERRING, null);<NEW_LINE>long nextIndex = ledgerEndIndex + 1;<NEW_LINE>entry.setIndex(nextIndex);<NEW_LINE>entry.setTerm(memberState.currTerm());<NEW_LINE>entry.setMagic(CURRENT_MAGIC);<NEW_LINE>DLedgerEntryCoder.setIndexTerm(dataBuffer, nextIndex, memberState.currTerm(), CURRENT_MAGIC);<NEW_LINE>long prePos = dataFileList.preAppend(dataBuffer.remaining());<NEW_LINE>entry.setPos(prePos);<NEW_LINE>PreConditions.check(prePos != -1, DLedgerResponseCode.DISK_ERROR, null);<NEW_LINE>DLedgerEntryCoder.setPos(dataBuffer, prePos);<NEW_LINE>for (AppendHook writeHook : appendHooks) {<NEW_LINE>writeHook.doHook(entry, dataBuffer.slice(), DLedgerEntry.BODY_OFFSET);<NEW_LINE>}<NEW_LINE>long dataPos = dataFileList.append(dataBuffer.array(), 0, dataBuffer.remaining());<NEW_LINE>PreConditions.check(dataPos != -1, DLedgerResponseCode.DISK_ERROR, null);<NEW_LINE>PreConditions.check(dataPos == prePos, DLedgerResponseCode.DISK_ERROR, null);<NEW_LINE>DLedgerEntryCoder.encodeIndex(dataPos, entrySize, CURRENT_MAGIC, nextIndex, memberState.currTerm(), indexBuffer);<NEW_LINE>long indexPos = indexFileList.append(indexBuffer.array(), 0, indexBuffer.remaining(), false);<NEW_LINE>PreConditions.check(indexPos == entry.getIndex() * INDEX_UNIT_SIZE, DLedgerResponseCode.DISK_ERROR, null);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.info("[{}] Append as Leader {} {}", memberState.getSelfId(), entry.getIndex(), entry.getBody().length);<NEW_LINE>}<NEW_LINE>ledgerEndIndex++;<NEW_LINE>ledgerEndTerm = memberState.currTerm();<NEW_LINE>if (ledgerBeginIndex == -1) {<NEW_LINE>ledgerBeginIndex = ledgerEndIndex;<NEW_LINE>}<NEW_LINE>updateLedgerEndIndexAndTerm();<NEW_LINE>return entry;<NEW_LINE>}<NEW_LINE>}
isLeader(), DLedgerResponseCode.NOT_LEADER);
514,782
/*<NEW_LINE>Note that this will remove the properties from the list of attributes as it finds them.<NEW_LINE>*/<NEW_LINE>private void extractHttpHeaders(List<FileAttribute<?>> fileAttributes) {<NEW_LINE>BlobHttpHeaders headers = new BlobHttpHeaders();<NEW_LINE>for (Iterator<FileAttribute<?>> it = fileAttributes.iterator(); it.hasNext(); ) {<NEW_LINE>FileAttribute<?> attr = it.next();<NEW_LINE>boolean propertyFound = true;<NEW_LINE>switch(attr.name()) {<NEW_LINE>case AzureFileSystemProvider.CONTENT_TYPE:<NEW_LINE>headers.setContentType(attr.value().toString());<NEW_LINE>break;<NEW_LINE>case AzureFileSystemProvider.CONTENT_LANGUAGE:<NEW_LINE>headers.setContentLanguage(attr.value().toString());<NEW_LINE>break;<NEW_LINE>case AzureFileSystemProvider.CONTENT_DISPOSITION:<NEW_LINE>headers.setContentDisposition(attr.value().toString());<NEW_LINE>break;<NEW_LINE>case AzureFileSystemProvider.CONTENT_ENCODING:<NEW_LINE>headers.setContentEncoding(attr.value().toString());<NEW_LINE>break;<NEW_LINE>case AzureFileSystemProvider.CONTENT_MD5:<NEW_LINE>if ((attr.value() instanceof byte[])) {<NEW_LINE>headers.setContentMd5((byte[]) attr.value());<NEW_LINE>} else {<NEW_LINE>throw LoggingUtility.logError(LOGGER, new UnsupportedOperationException("Content-MD5 attribute must be a byte[]"));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case AzureFileSystemProvider.CACHE_CONTROL:<NEW_LINE>headers.setCacheControl(attr.<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>propertyFound = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (propertyFound) {<NEW_LINE>it.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.blobHeaders = headers;<NEW_LINE>}
value().toString());
323,495
protected Cursor doInBackground(Void... params) {<NEW_LINE>ActivityUtils utils = new ActivityUtils(getActivity());<NEW_LINE>update = utils.refreshActivity();<NEW_LINE>AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);<NEW_LINE>long now = new Date().getTime();<NEW_LINE>long alarm <MASK><NEW_LINE>PendingIntent pendingIntent = PendingIntent.getService(context, ACTIVITY_REFRESH_ID, new Intent(context, ActivityRefreshService.class), 0);<NEW_LINE>if (DrawerActivity.settings.activityRefresh != 0)<NEW_LINE>am.setRepeating(AlarmManager.RTC_WAKEUP, alarm, DrawerActivity.settings.activityRefresh, pendingIntent);<NEW_LINE>else<NEW_LINE>am.cancel(pendingIntent);<NEW_LINE>if (settings.syncSecondMentions) {<NEW_LINE>context.startService(new Intent(context, SecondActivityRefreshService.class));<NEW_LINE>}<NEW_LINE>return ActivityDataSource.getInstance(context).getCursor(currentAccount);<NEW_LINE>}
= now + DrawerActivity.settings.activityRefresh;
947,185
public void serialize(ByteBuf buf) {<NEW_LINE>super.serialize(buf);<NEW_LINE>IntFloatVectorStorage storage = split.getStorage();<NEW_LINE>if (storage instanceof IntFloatSparseVectorStorage) {<NEW_LINE>buf.writeInt(storage.size());<NEW_LINE>ObjectIterator<Int2FloatMap.Entry> iter = storage.entryIterator();<NEW_LINE>Int2FloatMap.Entry entry;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>entry = iter.next();<NEW_LINE>buf.writeInt(entry.getIntKey());<NEW_LINE>buf.<MASK><NEW_LINE>}<NEW_LINE>} else if (storage instanceof IntFloatSortedVectorStorage) {<NEW_LINE>buf.writeInt(storage.size());<NEW_LINE>int[] indices = storage.getIndices();<NEW_LINE>float[] values = storage.getValues();<NEW_LINE>for (int i = 0; i < indices.length; i++) {<NEW_LINE>buf.writeInt(indices[i]);<NEW_LINE>buf.writeFloat(values[i]);<NEW_LINE>}<NEW_LINE>} else if (storage instanceof IntFloatDenseVectorStorage) {<NEW_LINE>float[] values = storage.getValues();<NEW_LINE>int writeSize = values.length < maxItemNum ? values.length : maxItemNum;<NEW_LINE>buf.writeInt(writeSize);<NEW_LINE>for (int i = 0; i < writeSize; i++) {<NEW_LINE>buf.writeFloat(values[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("unsupport split for storage " + storage.getClass().getName());<NEW_LINE>}<NEW_LINE>}
writeFloat(entry.getFloatValue());
492,755
public Image generateImage(InputStream input) throws IOException {<NEW_LINE>try {<NEW_LINE>byte[] head = new byte[256];<NEW_LINE>input.read(head);<NEW_LINE>ByteArrayInputStream headByteStream = new ByteArrayInputStream(head);<NEW_LINE>Charset cs = getJavaCoreCodePage(headByteStream);<NEW_LINE>SequenceInputStream stream = new SequenceInputStream(headByteStream, input);<NEW_LINE>// Use default charset if none found<NEW_LINE>// Charset.defaultCharset is 5.0, so not usable for 1.4<NEW_LINE>Reader reader = cs != null ? new InputStreamReader(stream, cs) : new InputStreamReader(stream);<NEW_LINE>List frameworkSections = new DTFJComponentLoader().loadSections();<NEW_LINE>IParserController parserController = new ParserController(frameworkSections, fImageBuilderFactory);<NEW_LINE>parserController.addErrorListener(new IErrorListener() {<NEW_LINE><NEW_LINE>private Logger logger = <MASK><NEW_LINE><NEW_LINE>public void handleEvent(String msg) {<NEW_LINE>// map errors onto Level.FINE so that DTFJ is silent unless explicitly changed<NEW_LINE>logger.fine(msg);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>J9TagManager tagManager = J9TagManager.getCurrent();<NEW_LINE>return parserController.parse(fComponents.getScannerManager(reader, tagManager));<NEW_LINE>} catch (ParserException e) {<NEW_LINE>IOException e1 = new IOException("Error parsing Javacore");<NEW_LINE>e1.initCause(e);<NEW_LINE>throw e1;<NEW_LINE>}<NEW_LINE>}
Logger.getLogger(ImageFactory.DTFJ_LOGGER_NAME);
247,515
public boolean addItem(String key, String value, String comment) {<NEW_LINE>Element.ItemElem item = getItem(key);<NEW_LINE>if (item != null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// construct the new element<NEW_LINE>item = new Element.ItemElem(null, new Element.KeyElem(null, key), new Element.ValueElem(null, value), new Element<MASK><NEW_LINE>// find the position where to add it<NEW_LINE>try {<NEW_LINE>synchronized (getParentBundleStructure()) {<NEW_LINE>synchronized (getParent()) {<NEW_LINE>PositionBounds pos = getBounds();<NEW_LINE>PositionBounds itemBounds;<NEW_LINE>if (pos.getText().endsWith("\n")) {<NEW_LINE>itemBounds = pos.insertAfter(item.getDocumentString());<NEW_LINE>} else {<NEW_LINE>itemBounds = pos.insertAfter("\n").insertAfter(item.getDocumentString());<NEW_LINE>}<NEW_LINE>item.bounds = itemBounds;<NEW_LINE>// #17044 update in-memory model<NEW_LINE>item.setParent(this);<NEW_LINE>items.put(key, item);<NEW_LINE>structureChanged();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>return false;<NEW_LINE>} catch (BadLocationException ble) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
.CommentElem(null, comment));
1,699,486
private static void testEquals() {<NEW_LINE>// equals<NEW_LINE>assertTrue(B.equals(B));<NEW_LINE>assertTrue(B.equals(new Byte((byte) 1)));<NEW_LINE>assertTrue(D.equals(D));<NEW_LINE>assertTrue(D.equals(new Double(1.0)));<NEW_LINE>assertTrue(F.equals(F));<NEW_LINE>assertTrue(F.equals(new Float(1.0f)));<NEW_LINE>assertTrue(I.equals(I));<NEW_LINE>assertTrue(I.equals<MASK><NEW_LINE>assertTrue(L.equals(L));<NEW_LINE>assertTrue(L.equals(new Long(1L)));<NEW_LINE>assertTrue(S.equals(S));<NEW_LINE>assertTrue(S.equals(new Short((short) 1)));<NEW_LINE>assertFalse(L.equals(I));<NEW_LINE>assertFalse(B.equals(D));<NEW_LINE>assertFalse(B.equals(F));<NEW_LINE>assertFalse(B.equals(I));<NEW_LINE>assertFalse(B.equals(L));<NEW_LINE>assertFalse(B.equals(S));<NEW_LINE>assertFalse(D.equals(B));<NEW_LINE>assertFalse(D.equals(F));<NEW_LINE>assertFalse(D.equals(I));<NEW_LINE>assertFalse(D.equals(L));<NEW_LINE>assertFalse(D.equals(S));<NEW_LINE>assertTrue(C.equals(C));<NEW_LINE>assertTrue(C.equals(new Character('a')));<NEW_LINE>assertFalse(C.equals(new Character('b')));<NEW_LINE>assertTrue(BOOL.equals(BOOL));<NEW_LINE>assertTrue(BOOL.equals(new Boolean(true)));<NEW_LINE>assertFalse(BOOL.equals(new Boolean(false)));<NEW_LINE>}
(new Integer(1)));
1,122,627
private boolean placeTabs(int left, int right, Graphics2D g) {<NEW_LINE>Sketch sketch = editor.getSketch();<NEW_LINE>int x = left;<NEW_LINE>for (int i = 0; i < sketch.getCodeCount(); i++) {<NEW_LINE>SketchCode <MASK><NEW_LINE>Tab tab = tabs[i];<NEW_LINE>int state = (code == sketch.getCurrentCode()) ? SELECTED : UNSELECTED;<NEW_LINE>tab.left = x;<NEW_LINE>x += TEXT_MARGIN;<NEW_LINE>int drawWidth = tab.textVisible ? tab.textWidth : NO_TEXT_WIDTH;<NEW_LINE>x += drawWidth + TEXT_MARGIN;<NEW_LINE>tab.right = x;<NEW_LINE>if (g != null && tab.right < right) {<NEW_LINE>g.setColor(tabColor[state]);<NEW_LINE>drawTab(g, tab.left, tab.right, i == 0, false, state == SELECTED);<NEW_LINE>if (tab.textVisible) {<NEW_LINE>int textLeft = tab.left + ((tab.right - tab.left) - tab.textWidth) / 2;<NEW_LINE>g.setColor(textColor[state]);<NEW_LINE>int tabHeight = TAB_BOTTOM - TAB_TOP;<NEW_LINE>int baseline = TAB_TOP + (tabHeight + fontAscent) / 2;<NEW_LINE>g.drawString(tab.text, textLeft, baseline);<NEW_LINE>}<NEW_LINE>if (code.isModified()) {<NEW_LINE>g.setColor(modifiedColor);<NEW_LINE>g.drawLine(tab.right, TAB_TOP, tab.right, TAB_BOTTOM);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>x += TAB_BETWEEN;<NEW_LINE>}<NEW_LINE>return x <= right;<NEW_LINE>}
code = sketch.getCode(i);
152,240
protected Transferable createTransferable(JComponent component) {<NEW_LINE>JBIterable<Pair<FilteringTreeStructure.FilteringNode, PsiElement>> pairs = JBIterable.of(myTree.getSelectionPaths()).filterMap(TreeUtil::getLastUserObject).filter(FilteringTreeStructure.FilteringNode.class).filterMap(o -> o.getDelegate() instanceof PsiElement ? Pair.create(o, (PsiElement) o.getDelegate()<MASK><NEW_LINE>if (pairs.isEmpty())<NEW_LINE>return null;<NEW_LINE>Set<PsiElement> psiSelection = pairs.map(Functions.pairSecond()).toSet();<NEW_LINE>String text = StringUtil.join(pairs, pair -> {<NEW_LINE>PsiElement psi = pair.second;<NEW_LINE>String defaultPresentation = pair.first.getPresentation().getPresentableText();<NEW_LINE>if (psi == null)<NEW_LINE>return defaultPresentation;<NEW_LINE>for (PsiElement p = psi.getParent(); p != null; p = p.getParent()) {<NEW_LINE>if (psiSelection.contains(p))<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return ObjectUtils.chooseNotNull(psi.getText(), defaultPresentation);<NEW_LINE>}, "\n");<NEW_LINE>String htmlText = "<body>\n" + text + "\n</body>";<NEW_LINE>return new TextTransferable(XmlStringUtil.wrapInHtml(htmlText), text);<NEW_LINE>}
) : null).collect();
856,480
public void marshall(ScanRequest scanRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (scanRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(scanRequest.getTableName(), TABLENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getIndexName(), INDEXNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getAttributesToGet(), ATTRIBUTESTOGET_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getLimit(), LIMIT_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getSelect(), SELECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getScanFilter(), SCANFILTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getConditionalOperator(), CONDITIONALOPERATOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getExclusiveStartKey(), EXCLUSIVESTARTKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getReturnConsumedCapacity(), RETURNCONSUMEDCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getTotalSegments(), TOTALSEGMENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getSegment(), SEGMENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getProjectionExpression(), PROJECTIONEXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getFilterExpression(), FILTEREXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getExpressionAttributeNames(), EXPRESSIONATTRIBUTENAMES_BINDING);<NEW_LINE>protocolMarshaller.marshall(scanRequest.getExpressionAttributeValues(), EXPRESSIONATTRIBUTEVALUES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
scanRequest.getConsistentRead(), CONSISTENTREAD_BINDING);
1,287,192
public void runTimer(Timer timer) {<NEW_LINE>String serverConfigDir = System.getProperty("server.config.dir");<NEW_LINE>String wlpUserDir = System.getProperty("wlp.user.dir");<NEW_LINE>String serverName = serverConfigDir.substring(wlpUserDir.length() + "servers/".length(), serverConfigDir.length() - 1);<NEW_LINE>String timerName = timer.getInfo().toString();<NEW_LINE>if (FailoverTimersTestServlet.TIMERS_TO_FAIL.contains(timerName)) {<NEW_LINE>System.out.println("Timer " + timerName + " is not allowed to run on " + serverName);<NEW_LINE>throw new CompletionException("Intentionally failing timer " + timerName + " for testing purposes", null);<NEW_LINE>}<NEW_LINE>if (FailoverTimersTestServlet.TIMERS_TO_ROLL_BACK.contains(timerName)) {<NEW_LINE>throw new AssertionError("Auto rollback option is not supported for the TransactionAttributeType.NOT_SUPPORTED EJB");<NEW_LINE>}<NEW_LINE>System.out.println("Running timer " + timerName + " on " + serverName);<NEW_LINE>try (Connection con = ds.getConnection()) {<NEW_LINE>boolean found;<NEW_LINE>try {<NEW_LINE>PreparedStatement stmt = con.prepareStatement("UPDATE TIMERLOG SET SERVERNAME=?, COUNT=COUNT+1 WHERE TIMERNAME=?");<NEW_LINE>stmt.setString(1, serverName);<NEW_LINE>stmt.setString(2, timerName);<NEW_LINE>found = stmt.executeUpdate() == 1;<NEW_LINE>} catch (SQLException x) {<NEW_LINE>found = false;<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>// insert new entry<NEW_LINE>PreparedStatement stmt = con.prepareStatement("INSERT INTO TIMERLOG VALUES (?,?,?)");<NEW_LINE>stmt.setString(1, timerName);<NEW_LINE>stmt.setInt(2, 1);<NEW_LINE>stmt.setString(3, serverName);<NEW_LINE>stmt.executeUpdate();<NEW_LINE>}<NEW_LINE>} catch (SQLException x) {<NEW_LINE>System.out.println("Timer " + timerName + " failed.");<NEW_LINE><MASK><NEW_LINE>throw new RuntimeException(x);<NEW_LINE>}<NEW_LINE>}
x.printStackTrace(System.out);
1,783,768
public GraphHopperStorage createStorage(GHDirectory dir, GraphHopper gh) {<NEW_LINE>EncodingManager encodingManager = gh.getEncodingManager();<NEW_LINE>GraphExtension geTurnCosts = null;<NEW_LINE>ArrayList<GraphExtension> graphExtensions = new ArrayList<>();<NEW_LINE>if (encodingManager.needsTurnCostsSupport()) {<NEW_LINE>Path path = Paths.get(dir.getLocation(), "turn_costs");<NEW_LINE>File fileEdges = Paths.get(dir.getLocation(), "edges").toFile();<NEW_LINE>File fileTurnCosts = path.toFile();<NEW_LINE>// First we need to check if turncosts are available. This check is required when we introduce a new feature, but an existing graph does not have it yet.<NEW_LINE>if ((!hasGraph(gh) && !fileEdges.exists()) || (fileEdges.exists() && fileTurnCosts.exists()))<NEW_LINE>geTurnCosts = new TurnCostExtension();<NEW_LINE>}<NEW_LINE>if (graphStorageBuilders != null) {<NEW_LINE>List<GraphStorageBuilder> iterateGraphStorageBuilders = new ArrayList<>(graphStorageBuilders);<NEW_LINE>for (GraphStorageBuilder builder : iterateGraphStorageBuilders) {<NEW_LINE>try {<NEW_LINE>GraphExtension ext = builder.init(gh);<NEW_LINE>if (ext != null)<NEW_LINE>graphExtensions.add(ext);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>graphStorageBuilders.remove(builder);<NEW_LINE>LOGGER.error(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (geTurnCosts == null && graphExtensions.isEmpty())<NEW_LINE>graphExtension = new GraphExtension.NoOpExtension();<NEW_LINE>else if (geTurnCosts != null && !graphExtensions.isEmpty()) {<NEW_LINE>ArrayList<GraphExtension> seq = new ArrayList<>();<NEW_LINE>seq.add(geTurnCosts);<NEW_LINE>seq.addAll(graphExtensions);<NEW_LINE>graphExtension = getExtension(seq);<NEW_LINE>} else if (geTurnCosts != null) {<NEW_LINE>graphExtension = geTurnCosts;<NEW_LINE>} else {<NEW_LINE>graphExtension = getExtension(graphExtensions);<NEW_LINE>}<NEW_LINE>if (gh instanceof ORSGraphHopper) {<NEW_LINE>if (((ORSGraphHopper) gh).isCoreEnabled())<NEW_LINE>((ORSGraphHopper) gh).initCoreAlgoFactoryDecorator();<NEW_LINE>if (((ORSGraphHopper) gh).isCoreLMEnabled())<NEW_LINE>((<MASK><NEW_LINE>}<NEW_LINE>if (gh.getCHFactoryDecorator().isEnabled())<NEW_LINE>gh.initCHAlgoFactoryDecorator();<NEW_LINE>List<CHProfile> profiles = new ArrayList<>();<NEW_LINE>if (gh.isCHEnabled()) {<NEW_LINE>profiles.addAll(gh.getCHFactoryDecorator().getCHProfiles());<NEW_LINE>}<NEW_LINE>if (gh instanceof ORSGraphHopper && ((ORSGraphHopper) gh).isCoreEnabled()) {<NEW_LINE>profiles.addAll(((ORSGraphHopper) gh).getCoreFactoryDecorator().getCHProfiles());<NEW_LINE>}<NEW_LINE>if (!profiles.isEmpty())<NEW_LINE>return new GraphHopperStorage(profiles, dir, encodingManager, gh.hasElevation(), graphExtension);<NEW_LINE>else<NEW_LINE>return new GraphHopperStorage(dir, encodingManager, gh.hasElevation(), graphExtension);<NEW_LINE>}
ORSGraphHopper) gh).initCoreLMAlgoFactoryDecorator();
150,703
public RemotingCommand processRequest(Channel channel, RemotingCommand request) throws RemotingCommandException {<NEW_LINE>BizLogSendRequest requestBody = request.getBody();<NEW_LINE>List<BizLog<MASK><NEW_LINE>if (CollectionUtils.isNotEmpty(bizLogs)) {<NEW_LINE>for (BizLog bizLog : bizLogs) {<NEW_LINE>JobLogPo jobLogPo = new JobLogPo();<NEW_LINE>jobLogPo.setGmtCreated(SystemClock.now());<NEW_LINE>jobLogPo.setLogTime(bizLog.getLogTime());<NEW_LINE>jobLogPo.setTaskTrackerNodeGroup(bizLog.getTaskTrackerNodeGroup());<NEW_LINE>jobLogPo.setTaskTrackerIdentity(bizLog.getTaskTrackerIdentity());<NEW_LINE>jobLogPo.setJobId(bizLog.getJobId());<NEW_LINE>jobLogPo.setTaskId(bizLog.getTaskId());<NEW_LINE>jobLogPo.setRealTaskId(bizLog.getRealTaskId());<NEW_LINE>jobLogPo.setJobType(bizLog.getJobType());<NEW_LINE>jobLogPo.setMsg(bizLog.getMsg());<NEW_LINE>jobLogPo.setSuccess(true);<NEW_LINE>jobLogPo.setLevel(bizLog.getLevel());<NEW_LINE>jobLogPo.setLogType(LogType.BIZ);<NEW_LINE>appContext.getJobLogger().log(jobLogPo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return RemotingCommand.createResponseCommand(JobProtos.ResponseCode.BIZ_LOG_SEND_SUCCESS.code(), "");<NEW_LINE>}
> bizLogs = requestBody.getBizLogs();
1,637,979
final DescribeVaultResult executeDescribeVault(DescribeVaultRequest describeVaultRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeVaultRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeVaultRequest> request = null;<NEW_LINE>Response<DescribeVaultResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeVaultRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeVaultRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Glacier");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeVault");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeVaultResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeVaultResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,224,505
protected List<JCStatement> createJavaUtilSetMapInitialCapacitySwitchStatements(JavacTreeMaker maker, SingularData data, JavacNode builderType, boolean mapMode, String emptyCollectionMethod, String singletonCollectionMethod, String targetType, JavacNode source, String builderVariable) {<NEW_LINE>List<JCExpression> jceBlank = List.nil();<NEW_LINE>ListBuffer<JCCase> cases = new ListBuffer<JCCase>();<NEW_LINE>if (emptyCollectionMethod != null) {<NEW_LINE>// case 0: (empty); break;<NEW_LINE>JCStatement assignStat;<NEW_LINE>{<NEW_LINE>// pluralName = java.util.Collections.emptyCollectionMethod();<NEW_LINE>JCExpression invoke = maker.Apply(jceBlank, chainDots(builderType, "java", "util", "Collections", emptyCollectionMethod), jceBlank);<NEW_LINE>assignStat = maker.Exec(maker.Assign(maker.Ident(data.getPluralName()), invoke));<NEW_LINE>}<NEW_LINE>JCStatement breakStat = maker.Break(null);<NEW_LINE>JCCase emptyCase = maker.Case(maker.Literal(CTC_INT, 0), List.of(assignStat, breakStat));<NEW_LINE>cases.append(emptyCase);<NEW_LINE>}<NEW_LINE>if (singletonCollectionMethod != null) {<NEW_LINE>// case 1: (singleton); break;<NEW_LINE>JCStatement assignStat;<NEW_LINE>{<NEW_LINE>// !mapMode: pluralName = java.util.Collections.singletonCollectionMethod(this.pluralName.get(0));<NEW_LINE>// mapMode: pluralName = java.util.Collections.singletonCollectionMethod(this.pluralName$key.get(0), this.pluralName$value.get(0));<NEW_LINE>JCExpression zeroLiteral = maker.Literal(CTC_INT, 0);<NEW_LINE>JCExpression arg = maker.Apply(jceBlank, chainDots(builderType, builderVariable, data.getPluralName() + (mapMode ? "$key" : ""), "get"), List.of(zeroLiteral));<NEW_LINE>List<JCExpression> args;<NEW_LINE>if (mapMode) {<NEW_LINE>JCExpression zeroLiteralClone = maker.Literal(CTC_INT, 0);<NEW_LINE>JCExpression arg2 = maker.Apply(jceBlank, chainDots(builderType, builderVariable, data.getPluralName() + (mapMode ? "$value" : ""), "get"), List.of(zeroLiteralClone));<NEW_LINE>args = List.of(arg, arg2);<NEW_LINE>} else {<NEW_LINE>args = List.of(arg);<NEW_LINE>}<NEW_LINE>JCExpression invoke = maker.Apply(jceBlank, chainDots(builderType, "java", "util", "Collections", singletonCollectionMethod), args);<NEW_LINE>assignStat = maker.Exec(maker.Assign(maker.Ident(data.getPluralName()), invoke));<NEW_LINE>}<NEW_LINE>JCStatement breakStat = maker.Break(null);<NEW_LINE>JCCase singletonCase = maker.Case(maker.Literal(CTC_INT, 1), List<MASK><NEW_LINE>cases.append(singletonCase);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// default:<NEW_LINE>List<JCStatement> statements = createJavaUtilSimpleCreationAndFillStatements(maker, data, builderType, mapMode, false, true, emptyCollectionMethod == null, targetType, source, builderVariable);<NEW_LINE>JCCase defaultCase = maker.Case(null, statements);<NEW_LINE>cases.append(defaultCase);<NEW_LINE>}<NEW_LINE>JCStatement switchStat = maker.Switch(getSize(maker, builderType, mapMode ? builderType.toName(data.getPluralName() + "$key") : data.getPluralName(), true, false, builderVariable), cases.toList());<NEW_LINE>JCExpression localShadowerType = chainDotsString(builderType, data.getTargetFqn());<NEW_LINE>localShadowerType = addTypeArgs(mapMode ? 2 : 1, false, builderType, localShadowerType, data.getTypeArgs(), source);<NEW_LINE>JCStatement varDefStat = maker.VarDef(maker.Modifiers(0L), data.getPluralName(), localShadowerType, null);<NEW_LINE>return List.of(varDefStat, switchStat);<NEW_LINE>}
.of(assignStat, breakStat));
1,609,960
public IterableStream<PartitionEvent> receiveFromPartition(String partitionId, int maximumMessageCount, EventPosition startingPosition, Duration maximumWaitTime) {<NEW_LINE>if (Objects.isNull(maximumWaitTime)) {<NEW_LINE>throw LOGGER.logExceptionAsError(new NullPointerException("'maximumWaitTime' cannot be null."));<NEW_LINE>} else if (Objects.isNull(startingPosition)) {<NEW_LINE>throw LOGGER.logExceptionAsError(new NullPointerException("'startingPosition' cannot be null."));<NEW_LINE>} else if (Objects.isNull(partitionId)) {<NEW_LINE>throw LOGGER.<MASK><NEW_LINE>}<NEW_LINE>if (partitionId.isEmpty()) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException("'partitionId' cannot be empty."));<NEW_LINE>}<NEW_LINE>if (maximumMessageCount < 1) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException("'maximumMessageCount' cannot be less than 1."));<NEW_LINE>} else if (maximumWaitTime.isNegative() || maximumWaitTime.isZero()) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException("'maximumWaitTime' cannot be zero or less."));<NEW_LINE>}<NEW_LINE>final Flux<PartitionEvent> events = Flux.create(emitter -> {<NEW_LINE>queueWork(partitionId, maximumMessageCount, startingPosition, maximumWaitTime, defaultReceiveOptions, emitter);<NEW_LINE>});<NEW_LINE>return new IterableStream<>(events);<NEW_LINE>}
logExceptionAsError(new NullPointerException("'partitionId' cannot be null."));
1,616,907
private static // to separate the different tokens.<NEW_LINE>List<TokenizedString> preTokensToDelimitedTokens(List<PreTokenizedString> pretokens) {<NEW_LINE>List<TokenizedString> tokens = new ArrayList<>();<NEW_LINE>int size = pretokens.size();<NEW_LINE>int i = 0;<NEW_LINE>while (i < size) {<NEW_LINE>StringBuilder chars = new StringBuilder(pretokens.get(i).getString());<NEW_LINE>PreToken pt = pretokens.<MASK><NEW_LINE>switch(pt) {<NEW_LINE>case ALPHA_PLUS:<NEW_LINE>// combine everything up to the next delimiter into a single alphanumeric token<NEW_LINE>int next = i + 1;<NEW_LINE>while (next < size && pretokens.get(next).getToken() != PreToken.DELIMITER) {<NEW_LINE>chars.append(pretokens.get(next).getString());<NEW_LINE>next++;<NEW_LINE>}<NEW_LINE>i = next - 1;<NEW_LINE>tokens.add(new TokenizedString(chars.toString(), Token.ALNUM_PLUS));<NEW_LINE>break;<NEW_LINE>case DELIMITER:<NEW_LINE>tokens.add(new TokenizedString(chars.toString(), Token.DELIMITER));<NEW_LINE>break;<NEW_LINE>case DIGIT_PLUS:<NEW_LINE>tokens.add(new TokenizedString(chars.toString(), Token.DIGIT_PLUS));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new BatfishException("Unknown pretoken " + pt);<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return tokens;<NEW_LINE>}
get(i).getToken();
1,627,911
private void writeInputSummary(StringEscapeUtils.Builder builder) throws IOException {<NEW_LINE>builder.append("<h2>Input</h2>");<NEW_LINE>JadxDecompiler jadx = mainWindow.getWrapper().getDecompiler();<NEW_LINE>builder.append("<h3>Files</h3>");<NEW_LINE>builder.append("<ul>");<NEW_LINE>for (File inputFile : jadx.getArgs().getInputFiles()) {<NEW_LINE>builder.append("<li>");<NEW_LINE>builder.escape(inputFile.getCanonicalFile().getAbsolutePath());<NEW_LINE>builder.append("</li>");<NEW_LINE>}<NEW_LINE>builder.append("</ul>");<NEW_LINE>List<ClassNode> classes = jadx.<MASK><NEW_LINE>List<String> codeSources = classes.stream().map(ClassNode::getInputFileName).distinct().sorted().collect(Collectors.toList());<NEW_LINE>codeSources.remove("synthetic");<NEW_LINE>int codeSourcesCount = codeSources.size();<NEW_LINE>builder.append("<h3>Code sources</h3>");<NEW_LINE>builder.append("<ul>");<NEW_LINE>if (codeSourcesCount != 1) {<NEW_LINE>builder.append("<li>Count: " + codeSourcesCount + "</li>");<NEW_LINE>}<NEW_LINE>// dex files list<NEW_LINE>codeSources.removeIf(f -> !f.endsWith(".dex"));<NEW_LINE>if (!codeSources.isEmpty()) {<NEW_LINE>for (String input : codeSources) {<NEW_LINE>builder.append("<li>");<NEW_LINE>builder.escape(input);<NEW_LINE>builder.append("</li>");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.append("</ul>");<NEW_LINE>int methodsCount = classes.stream().mapToInt(cls -> cls.getMethods().size()).sum();<NEW_LINE>int fieldsCount = classes.stream().mapToInt(cls -> cls.getFields().size()).sum();<NEW_LINE>int insnCount = classes.stream().flatMap(cls -> cls.getMethods().stream()).mapToInt(MethodNode::getInsnsCount).sum();<NEW_LINE>builder.append("<h3>Counts</h3>");<NEW_LINE>builder.append("<ul>");<NEW_LINE>builder.append("<li>Classes: " + classes.size() + "</li>");<NEW_LINE>builder.append("<li>Methods: " + methodsCount + "</li>");<NEW_LINE>builder.append("<li>Fields: " + fieldsCount + "</li>");<NEW_LINE>builder.append("<li>Instructions: " + insnCount + " (units)</li>");<NEW_LINE>builder.append("</ul>");<NEW_LINE>}
getRoot().getClasses(true);
322,585
private boolean createAllocation(int C_Currency_ID, String description, Timestamp dateAcct, BigDecimal Amount, BigDecimal DiscountAmt, BigDecimal WriteOffAmt, BigDecimal OverUnderAmt, int C_BPartner_ID, int C_Payment_ID, int C_Invoice_ID, int AD_Org_ID) {<NEW_LINE>// Process old Allocation<NEW_LINE>if (m_allocation != null && m_allocation.getC_Currency_ID() != C_Currency_ID)<NEW_LINE>processAllocation();<NEW_LINE>// New Allocation<NEW_LINE>if (m_allocation == null) {<NEW_LINE>m_allocation = new // automatic<NEW_LINE>// automatic<NEW_LINE>MAllocationHdr(// automatic<NEW_LINE>getCtx(), // automatic<NEW_LINE>false, dateAcct, C_Currency_ID, "Auto " + description, get_TrxName());<NEW_LINE>m_allocation.setAD_Org_ID(AD_Org_ID);<NEW_LINE>if (!m_allocation.save())<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// New Allocation Line<NEW_LINE>MAllocationLine aLine = new MAllocationLine(m_allocation, <MASK><NEW_LINE>aLine.setC_BPartner_ID(C_BPartner_ID);<NEW_LINE>aLine.setC_Payment_ID(C_Payment_ID);<NEW_LINE>aLine.setC_Invoice_ID(C_Invoice_ID);<NEW_LINE>return aLine.save();<NEW_LINE>}
Amount, DiscountAmt, WriteOffAmt, OverUnderAmt);
1,741,648
private RemoteDeduplicateView createMvpView(View view) {<NEW_LINE>final TextView addressText = view.findViewById(R.id.select_key_item_name);<NEW_LINE>return new RemoteDeduplicateView() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void finish() {<NEW_LINE>FragmentActivity activity = getActivity();<NEW_LINE>if (activity == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Intent passthroughData = activity.getIntent(<MASK><NEW_LINE>activity.setResult(RESULT_OK, passthroughData);<NEW_LINE>activity.finish();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void finishAsCancelled() {<NEW_LINE>FragmentActivity activity = getActivity();<NEW_LINE>if (activity == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>activity.setResult(RESULT_CANCELED);<NEW_LINE>activity.finish();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void showNoSelectionError() {<NEW_LINE>Toast.makeText(getContext(), "No key selected!", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setAddressText(String text) {<NEW_LINE>addressText.setText(text);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setKeyListAdapter(Adapter adapter) {<NEW_LINE>keyChoiceList.setAdapter(adapter);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
).getParcelableExtra(RemoteSecurityTokenOperationActivity.EXTRA_DATA);
1,826,072
private static JSFunctionData createResolveElementFunctionImpl(JSContext context) {<NEW_LINE>class PromiseAllResolveElementRootNode extends JavaScriptRootNode implements AsyncHandlerRootNode {<NEW_LINE><NEW_LINE>@Child<NEW_LINE>private JavaScriptNode <MASK><NEW_LINE><NEW_LINE>@Child<NEW_LINE>private PropertyGetNode getArgs = PropertyGetNode.createGetHidden(RESOLVE_ELEMENT_ARGS_KEY, context);<NEW_LINE><NEW_LINE>@Child<NEW_LINE>private JSFunctionCallNode callResolve = JSFunctionCallNode.createCall();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object execute(VirtualFrame frame) {<NEW_LINE>JSDynamicObject functionObject = JSFrameUtil.getFunctionObject(frame);<NEW_LINE>ResolveElementArgs args = (ResolveElementArgs) getArgs.getValue(functionObject);<NEW_LINE>if (args.alreadyCalled) {<NEW_LINE>return Undefined.instance;<NEW_LINE>}<NEW_LINE>args.alreadyCalled = true;<NEW_LINE>Object value = valueNode.execute(frame);<NEW_LINE>args.values.set(args.index, value);<NEW_LINE>args.remainingElements.value--;<NEW_LINE>if (args.remainingElements.value == 0) {<NEW_LINE>JSDynamicObject valuesArray = JSArray.createConstantObjectArray(context, getRealm(), args.values.toArray());<NEW_LINE>return callResolve.executeCall(JSArguments.createOneArg(Undefined.instance, args.capability.getResolve(), valuesArray));<NEW_LINE>}<NEW_LINE>return Undefined.instance;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public AsyncStackTraceInfo getAsyncStackTraceInfo(JSFunctionObject handlerFunction) {<NEW_LINE>assert JSFunction.isJSFunction(handlerFunction) && ((RootCallTarget) JSFunction.getFunctionData(handlerFunction).getCallTarget()).getRootNode() == this;<NEW_LINE>ResolveElementArgs resolveArgs = (ResolveElementArgs) JSObjectUtil.getHiddenProperty(handlerFunction, PerformPromiseAllNode.RESOLVE_ELEMENT_ARGS_KEY);<NEW_LINE>int promiseIndex = resolveArgs.index;<NEW_LINE>JSRealm realm = JSFunction.getRealm(handlerFunction);<NEW_LINE>TruffleStackTraceElement asyncStackTraceElement = createPromiseAllStackTraceElement(promiseIndex, realm);<NEW_LINE>JSDynamicObject resultPromise = resolveArgs.capability.getPromise();<NEW_LINE>return new AsyncStackTraceInfo(resultPromise, asyncStackTraceElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return JSFunctionData.createCallOnly(context, new PromiseAllResolveElementRootNode().getCallTarget(), 1, Strings.EMPTY_STRING);<NEW_LINE>}
valueNode = AccessIndexedArgumentNode.create(0);
199,235
final CreateTrustResult executeCreateTrust(CreateTrustRequest createTrustRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTrustRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTrustRequest> request = null;<NEW_LINE>Response<CreateTrustResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTrustRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTrustRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Directory Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTrust");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateTrustResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTrustResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
406,012
public static boolean performDumbAwareUpdate(boolean isInModalContext, @Nonnull AnAction action, @Nonnull AnActionEvent e, boolean beforeActionPerformed) {<NEW_LINE>final Presentation presentation = e.getPresentation();<NEW_LINE>final Boolean wasEnabledBefore = (Boolean) presentation.getClientProperty(WAS_ENABLED_BEFORE_DUMB);<NEW_LINE>final boolean dumbMode = <MASK><NEW_LINE>if (wasEnabledBefore != null && !dumbMode) {<NEW_LINE>presentation.putClientProperty(WAS_ENABLED_BEFORE_DUMB, null);<NEW_LINE>presentation.setEnabled(wasEnabledBefore.booleanValue());<NEW_LINE>presentation.setVisible(true);<NEW_LINE>}<NEW_LINE>final boolean enabledBeforeUpdate = presentation.isEnabled();<NEW_LINE>final boolean notAllowed = dumbMode && !action.isDumbAware() || (Registry.is("actionSystem.honor.modal.context") && isInModalContext && !action.isEnabledInModalContext());<NEW_LINE>if (insidePerformDumbAwareUpdate++ == 0) {<NEW_LINE>ActionPauses.STAT.started();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>boolean enabled = checkModuleExtensions(action, e);<NEW_LINE>// FIXME [VISTALL] hack<NEW_LINE>if (enabled && action instanceof ActionGroup) {<NEW_LINE>presentation.setEnabledAndVisible(true);<NEW_LINE>} else if (!enabled) {<NEW_LINE>presentation.setEnabledAndVisible(enabled);<NEW_LINE>}<NEW_LINE>if (beforeActionPerformed) {<NEW_LINE>action.beforeActionPerformedUpdate(e);<NEW_LINE>} else {<NEW_LINE>action.update(e);<NEW_LINE>}<NEW_LINE>presentation.putClientProperty(WOULD_BE_ENABLED_IF_NOT_DUMB_MODE, notAllowed && presentation.isEnabled());<NEW_LINE>presentation.putClientProperty(WOULD_BE_VISIBLE_IF_NOT_DUMB_MODE, notAllowed && presentation.isVisible());<NEW_LINE>} catch (IndexNotReadyException e1) {<NEW_LINE>if (notAllowed) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>throw e1;<NEW_LINE>} finally {<NEW_LINE>if (--insidePerformDumbAwareUpdate == 0) {<NEW_LINE>ActionPauses.STAT.finished(presentation.getText() + " action update (" + action.getClass() + ")");<NEW_LINE>}<NEW_LINE>if (notAllowed) {<NEW_LINE>if (wasEnabledBefore == null) {<NEW_LINE>presentation.putClientProperty(WAS_ENABLED_BEFORE_DUMB, enabledBeforeUpdate);<NEW_LINE>}<NEW_LINE>presentation.setEnabled(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
isDumbMode(e.getProject());
1,267,664
public void generate(JDialog parent, File circuitFile, TruthTable table, ExpressionListenerStore expressions) throws Exception {<NEW_LINE>ModelAnalyserInfo mai = table.getModelAnalyzerInfo();<NEW_LINE>if (mai == null) {<NEW_LINE>JOptionPane.showMessageDialog(parent, new LineBreaker().toHTML().breakLines(Lang.get("msg_circuitIsRequired")), Lang.get("msg_warning"), JOptionPane.WARNING_MESSAGE);<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>ArrayList<String> pinsWithoutNumber = mai.getPinsWithoutNumber();<NEW_LINE>if (!pinsWithoutNumber.isEmpty()) {<NEW_LINE>int res = JOptionPane.showConfirmDialog(parent, new LineBreaker().toHTML().breakLines(Lang.get("msg_thereAreMissingPinNumbers", pinsWithoutNumber)), Lang.get("msg_warning"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);<NEW_LINE>if (res != JOptionPane.OK_OPTION)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (circuitFile == null)<NEW_LINE>circuitFile = new File("circuit." + suffix);<NEW_LINE>else<NEW_LINE>circuitFile = SaveAsHelper.checkSuffix(circuitFile, suffix);<NEW_LINE>JFileChooser fileChooser = new MyFileChooser();<NEW_LINE>fileChooser.setFileFilter(new FileNameExtensionFilter("JEDEC", suffix));<NEW_LINE>fileChooser.setSelectedFile(circuitFile);<NEW_LINE>if (fileChooser.showSaveDialog(parent) == JFileChooser.APPROVE_OPTION) {<NEW_LINE>ExpressionToFileExporter expressionExporter = factory.create();<NEW_LINE>expressionExporter.getPinMapping().addAll(mai.getPins());<NEW_LINE>expressionExporter.getPinMapping().setClockPin(mai.getClockPinInt());<NEW_LINE>new BuilderExpressionCreator(expressionExporter.getBuilder(), ExpressionModifier<MASK><NEW_LINE>expressionExporter.export(SaveAsHelper.checkSuffix(fileChooser.getSelectedFile(), suffix));<NEW_LINE>}<NEW_LINE>}
.IDENTITY).create(expressions);
1,664,777
final ListConfigurationSetsResult executeListConfigurationSets(ListConfigurationSetsRequest listConfigurationSetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listConfigurationSetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListConfigurationSetsRequest> request = null;<NEW_LINE>Response<ListConfigurationSetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListConfigurationSetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listConfigurationSetsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Pinpoint Email");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListConfigurationSets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListConfigurationSetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListConfigurationSetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,571,973
// FIXME: <TODO> Events are still pending<NEW_LINE>@Override<NEW_LINE>public int enqueueWriteBuffer(int deviceIndex, long bufferId, long offset, long bytes, byte[] value, long hostOffset, int[] waitEvents, ProfilerTransfer profilerTransfer) {<NEW_LINE>SPIRVLevelZeroCommandQueue spirvCommandQueue = commandQueues.get(deviceIndex);<NEW_LINE>LevelZeroCommandList commandList = spirvCommandQueue.getCommandList();<NEW_LINE>if (profilerTransfer != null) {<NEW_LINE>registerTimeStamp(commandList, profilerTransfer.getStart(), profilerTransfer.getStop());<NEW_LINE>}<NEW_LINE>int result = commandList.zeCommandListAppendMemoryCopyWithOffset(commandList.getCommandListHandlerPtr(), deviceBuffer, value, bytes, offset, <MASK><NEW_LINE>LevelZeroUtils.errorLog("zeCommandListAppendMemoryCopyWithOffset", result);<NEW_LINE>enqueueBarrier(deviceIndex);<NEW_LINE>if (profilerTransfer != null) {<NEW_LINE>appendTimeStamp(profilerTransfer.getStop());<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
hostOffset, null, 0, null);
740,678
public void onClick(View v) {<NEW_LINE>ViewHolderChatList holder = (ViewHolderChatList) v.getTag();<NEW_LINE>switch(v.getId()) {<NEW_LINE>case R.id.recent_chat_list_three_dots:<NEW_LINE>{<NEW_LINE>int currentPosition = holder.getAdapterPosition();<NEW_LINE>logDebug("Current position: " + currentPosition);<NEW_LINE>MegaChatListItem c = (MegaChatListItem) getItem(currentPosition);<NEW_LINE>if (context instanceof ManagerActivity) {<NEW_LINE>if (multipleSelect) {<NEW_LINE>((RecentChatsFragment) fragment).itemClick(currentPosition);<NEW_LINE>} else {<NEW_LINE>((ManagerActivity) context).showChatPanel(c);<NEW_LINE>}<NEW_LINE>} else if (context instanceof ArchivedChatsActivity) {<NEW_LINE>if (multipleSelect) {<NEW_LINE>((RecentChatsFragment) fragment).itemClick(currentPosition);<NEW_LINE>} else {<NEW_LINE>((ArchivedChatsActivity) context).showChatPanel(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case R.id.recent_chat_list_item_layout:<NEW_LINE>{<NEW_LINE>logDebug("Click layout!");<NEW_LINE>int currentPosition = holder.getAdapterPosition();<NEW_LINE>logDebug("Current position: " + currentPosition);<NEW_LINE>MegaChatListItem c = (MegaChatListItem) getItem(currentPosition);<NEW_LINE>if (context instanceof ManagerActivity) {<NEW_LINE>((RecentChatsFragment<MASK><NEW_LINE>} else if (context instanceof ChatExplorerActivity || context instanceof FileExplorerActivity) {<NEW_LINE>((ChatExplorerFragment) fragment).itemClick(currentPosition);<NEW_LINE>} else if (context instanceof ArchivedChatsActivity) {<NEW_LINE>((RecentChatsFragment) fragment).itemClick(currentPosition);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case R.id.archived_chat_option_text:<NEW_LINE>{<NEW_LINE>logDebug("Show archived chats");<NEW_LINE>Intent archivedChatsIntent = new Intent(context, ArchivedChatsActivity.class);<NEW_LINE>context.startActivity(archivedChatsIntent);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) fragment).itemClick(currentPosition);
463,866
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see<NEW_LINE>* com.aptana.editor.js.parsing.ast.JSTreeWalker#visit(com.aptana.editor.js.parsing.ast.JSBinaryBooleanOperatorNode<NEW_LINE>* )<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void visit(JSBinaryBooleanOperatorNode node) {<NEW_LINE>// Wrap the node with a generic expression node to handle new-lines.<NEW_LINE>FormatterJSExpressionWrapperNode wrapperNode = new FormatterJSExpressionWrapperNode(document, node, hasSingleCommentBefore(node.getStartingOffset()));<NEW_LINE>int startingOffset = node.getStartingOffset();<NEW_LINE>wrapperNode.setBegin(createTextNode(document, startingOffset, node.getStartingOffset()));<NEW_LINE>push(wrapperNode);<NEW_LINE>visitLeftRightExpression(node, (JSNode) node.getLeftHandSide(), (JSNode) node.getRightHandSide(), node.getOperator().value.toString());<NEW_LINE>if (node.getSemicolonIncluded()) {<NEW_LINE>findAndPushPunctuationNode(TypePunctuation.SEMICOLON, node.<MASK><NEW_LINE>}<NEW_LINE>checkedPop(wrapperNode, -1);<NEW_LINE>IFormatterContainerNode topNode = peek();<NEW_LINE>int endingOffset = topNode.getEndOffset();<NEW_LINE>wrapperNode.setEnd(createTextNode(document, endingOffset, endingOffset));<NEW_LINE>}
getEndingOffset(), false, true);
15,726
public static DescribeAccountsResponse unmarshall(DescribeAccountsResponse describeAccountsResponse, UnmarshallerContext context) {<NEW_LINE>describeAccountsResponse.setRequestId(context.stringValue("DescribeAccountsResponse.RequestId"));<NEW_LINE>describeAccountsResponse.setPageSize(context.integerValue("DescribeAccountsResponse.PageSize"));<NEW_LINE>describeAccountsResponse.setCurrentPage(context.integerValue("DescribeAccountsResponse.CurrentPage"));<NEW_LINE>describeAccountsResponse.setTotalCount(context.integerValue("DescribeAccountsResponse.TotalCount"));<NEW_LINE>List<Account> items = new ArrayList<Account>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeAccountsResponse.Items.Length"); i++) {<NEW_LINE>Account account = new Account();<NEW_LINE>account.setId(context.longValue("DescribeAccountsResponse.Items[" + i + "].Id"));<NEW_LINE>account.setUserId(context.longValue("DescribeAccountsResponse.Items[" + i + "].UserId"));<NEW_LINE>account.setFirstLevelDepartId(context.longValue("DescribeAccountsResponse.Items[" + i + "].FirstLevelDepartId"));<NEW_LINE>account.setLoginName(context.stringValue<MASK><NEW_LINE>account.setFullName(context.stringValue("DescribeAccountsResponse.Items[" + i + "].FullName"));<NEW_LINE>account.setCellphoneNum(context.stringValue("DescribeAccountsResponse.Items[" + i + "].CellphoneNum"));<NEW_LINE>account.setTelephoneNum(context.stringValue("DescribeAccountsResponse.Items[" + i + "].TelephoneNum"));<NEW_LINE>account.setEmail(context.stringValue("DescribeAccountsResponse.Items[" + i + "].Email"));<NEW_LINE>account.setActiveStatus(context.stringValue("DescribeAccountsResponse.Items[" + i + "].ActiveStatus"));<NEW_LINE>account.setDeleteStatus(context.stringValue("DescribeAccountsResponse.Items[" + i + "].DeleteStatus"));<NEW_LINE>account.setDataInstance(context.stringValue("DescribeAccountsResponse.Items[" + i + "].DataInstance"));<NEW_LINE>account.setCreateTime(context.longValue("DescribeAccountsResponse.Items[" + i + "].CreateTime"));<NEW_LINE>account.setLoginDataTime(context.longValue("DescribeAccountsResponse.Items[" + i + "].LoginDataTime"));<NEW_LINE>account.setLoginPolicyName(context.stringValue("DescribeAccountsResponse.Items[" + i + "].LoginPolicyName"));<NEW_LINE>account.setFirstLevelDepartName(context.stringValue("DescribeAccountsResponse.Items[" + i + "].FirstLevelDepartName"));<NEW_LINE>account.setRoleNames(context.stringValue("DescribeAccountsResponse.Items[" + i + "].RoleNames"));<NEW_LINE>account.setInstanceName(context.stringValue("DescribeAccountsResponse.Items[" + i + "].InstanceName"));<NEW_LINE>account.setAliUid(context.longValue("DescribeAccountsResponse.Items[" + i + "].AliUid"));<NEW_LINE>account.setAccountTypeId(context.longValue("DescribeAccountsResponse.Items[" + i + "].AccountTypeId"));<NEW_LINE>EventCount eventCount = new EventCount();<NEW_LINE>Total total = new Total();<NEW_LINE>total.setTotalCount(context.longValue("DescribeAccountsResponse.Items[" + i + "].EventCount.Total.TotalCount"));<NEW_LINE>total.setUndealCount(context.longValue("DescribeAccountsResponse.Items[" + i + "].EventCount.Total.UndealCount"));<NEW_LINE>total.setConfirmCount(context.longValue("DescribeAccountsResponse.Items[" + i + "].EventCount.Total.ConfirmCount"));<NEW_LINE>total.setExcludeCount(context.longValue("DescribeAccountsResponse.Items[" + i + "].EventCount.Total.ExcludeCount"));<NEW_LINE>eventCount.setTotal(total);<NEW_LINE>account.setEventCount(eventCount);<NEW_LINE>items.add(account);<NEW_LINE>}<NEW_LINE>describeAccountsResponse.setItems(items);<NEW_LINE>return describeAccountsResponse;<NEW_LINE>}
("DescribeAccountsResponse.Items[" + i + "].LoginName"));
509,912
public void render(EffectContainer e) {<NEW_LINE>if (tex == null)<NEW_LINE>tex = Core.atlas.find(region);<NEW_LINE>float realRotation = (useRotation ? e.rotation : baseRotation);<NEW_LINE>float rawfin = e.fin();<NEW_LINE>float fin = e.fin(interp);<NEW_LINE>float rad = sizeInterp.apply(sizeFrom, sizeTo, rawfin) * 2;<NEW_LINE>float ox = e.x + Angles.trnsx(realRotation, offsetX, offsetY), oy = e.y + Angles.trnsy(realRotation, offsetX, offsetY);<NEW_LINE>Draw.color(colorFrom, colorTo, fin);<NEW_LINE>Color lightColor = this.lightColor == null ? Draw.getColor() : this.lightColor;<NEW_LINE>if (line) {<NEW_LINE>Lines.stroke(sizeInterp.apply(strokeFrom, strokeTo, rawfin));<NEW_LINE>float len = sizeInterp.apply(lenFrom, lenTo, rawfin);<NEW_LINE>rand.setSeed(e.id);<NEW_LINE>for (int i = 0; i < particles; i++) {<NEW_LINE>float l = length * fin + baseLength;<NEW_LINE>rv.trns(realRotation + rand.range(cone), !randLength ? l : rand.random(l));<NEW_LINE>float x = rv.x, y = rv.y;<NEW_LINE>Lines.lineAngle(ox + x, oy + y, Mathf.angle(x, y), len);<NEW_LINE>Drawf.light(ox + x, oy + y, len * lightScl, lightColor, lightOpacity * Draw.getColor().a);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>rand.setSeed(e.id);<NEW_LINE>for (int i = 0; i < particles; i++) {<NEW_LINE>float l = length * fin + baseLength;<NEW_LINE>rv.trns(realRotation + rand.range(cone), !randLength ? l <MASK><NEW_LINE>float x = rv.x, y = rv.y;<NEW_LINE>Draw.rect(tex, ox + x, oy + y, rad, rad, realRotation + offset + e.time * spin);<NEW_LINE>Drawf.light(ox + x, oy + y, rad * lightScl, lightColor, lightOpacity * Draw.getColor().a);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
: rand.random(l));
624,633
private static void createTable(String tableName, long readCapacityUnits, long writeCapacityUnits, String partitionKeyName, String partitionKeyType, String sortKeyName, String sortKeyType) {<NEW_LINE>try {<NEW_LINE>System.out.println("Creating table " + tableName);<NEW_LINE>List<KeySchemaElement> keySchema = new ArrayList<KeySchemaElement>();<NEW_LINE>// Partition<NEW_LINE>keySchema.add(new KeySchemaElement().withAttributeName(partitionKeyName).withKeyType(KeyType.HASH));<NEW_LINE>// key<NEW_LINE>List<AttributeDefinition> attributeDefinitions = new ArrayList<AttributeDefinition>();<NEW_LINE>attributeDefinitions.add(new AttributeDefinition().withAttributeName(partitionKeyName).withAttributeType(partitionKeyType));<NEW_LINE>if (sortKeyName != null) {<NEW_LINE>// Sort<NEW_LINE>keySchema.add(new KeySchemaElement().withAttributeName(sortKeyName).withKeyType(KeyType.RANGE));<NEW_LINE>// key<NEW_LINE>attributeDefinitions.add(new AttributeDefinition().withAttributeName(<MASK><NEW_LINE>}<NEW_LINE>Table table = dynamoDB.createTable(tableName, keySchema, attributeDefinitions, new ProvisionedThroughput().withReadCapacityUnits(readCapacityUnits).withWriteCapacityUnits(writeCapacityUnits));<NEW_LINE>System.out.println("Waiting for " + tableName + " to be created...this may take a while...");<NEW_LINE>table.waitForActive();<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Failed to create table " + tableName);<NEW_LINE>e.printStackTrace(System.err);<NEW_LINE>}<NEW_LINE>}
sortKeyName).withAttributeType(sortKeyType));
1,129,458
private Object overrride(Set<ShortcutAction> conflictingActions, Collection<ShortcutAction> sameScope) {<NEW_LINE>StringBuffer conflictingActionList = new StringBuffer();<NEW_LINE>for (ShortcutAction sa : conflictingActions) {<NEW_LINE>// NOI18N<NEW_LINE>conflictingActionList.append("<li>'").append(sa.getDisplayName<MASK><NEW_LINE>}<NEW_LINE>JPanel innerPane = new JPanel();<NEW_LINE>innerPane.add(new JLabel(// NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>ButtonCellEditor.class, // NOI18N<NEW_LINE>sameScope.isEmpty() ? "Override_Shortcut2" : "Override_Shortcut", conflictingActionList)));<NEW_LINE>DialogDescriptor descriptor = new // NOI18N<NEW_LINE>DialogDescriptor(// NOI18N<NEW_LINE>innerPane, // NOI18N<NEW_LINE>NbBundle.getMessage(ButtonCellEditor.class, "Conflicting_Shortcut_Dialog"), // NOI18N<NEW_LINE>true, // NOI18N<NEW_LINE>sameScope.isEmpty() ? DialogDescriptor.YES_NO_CANCEL_OPTION : DialogDescriptor.YES_NO_OPTION, // NOI18N<NEW_LINE>null, null);<NEW_LINE>DialogDisplayer.getDefault().notify(descriptor);<NEW_LINE>Object o = descriptor.getValue();<NEW_LINE>if (!sameScope.isEmpty() && o == DialogDescriptor.NO_OPTION) {<NEW_LINE>return DialogDescriptor.CANCEL_OPTION;<NEW_LINE>} else {<NEW_LINE>return o;<NEW_LINE>}<NEW_LINE>}
()).append("'</li>");
1,240,085
public void dibStretchBlt(byte[] image, int dx, int dy, int dw, int dh, int sx, int sy, int sw, int sh, long rop) {<NEW_LINE>byte[] record = new byte[26 + (image.length + image.length % 2)];<NEW_LINE>int pos = 0;<NEW_LINE>pos = setUint32(record, pos, record.length / 2);<NEW_LINE>pos = setUint16(record, pos, RECORD_DIB_STRETCH_BLT);<NEW_LINE>pos = setUint32(record, pos, rop);<NEW_LINE>pos = setInt16(record, pos, sh);<NEW_LINE>pos = setInt16(record, pos, sw);<NEW_LINE>pos = setInt16(record, pos, sy);<NEW_LINE>pos = setInt16(record, pos, sx);<NEW_LINE>pos = setInt16(record, pos, dw);<NEW_LINE>pos = setInt16(record, pos, dh);<NEW_LINE>pos = <MASK><NEW_LINE>pos = setInt16(record, pos, dx);<NEW_LINE>pos = setBytes(record, pos, image);<NEW_LINE>if (image.length % 2 == 1)<NEW_LINE>pos = setByte(record, pos, 0);<NEW_LINE>records.add(record);<NEW_LINE>}
setInt16(record, pos, dy);
634,056
private void init(JLabel label, String[] columns, TableSorter sorter) {<NEW_LINE>tableModel = new PropertiesTableModel(columns);<NEW_LINE>tableModel.addTableModelListener(this);<NEW_LINE>if (sorter == null) {<NEW_LINE>sorter = new TableSorter(tableModel);<NEW_LINE>}<NEW_LINE>this.sorter = sorter;<NEW_LINE>table <MASK><NEW_LINE>table.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(PropertiesTable.class, "tableProperties.AccessibleContext.accessibleName"));<NEW_LINE>table.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PropertiesTable.class, "tableProperties.AccessibleContext.accessibleDescription"));<NEW_LINE>table.getTableHeader().setReorderingAllowed(false);<NEW_LINE>TableCellRenderer cellRenderer = new PropertiesTableCellRenderer();<NEW_LINE>table.setDefaultRenderer(String.class, cellRenderer);<NEW_LINE>table.setRowHeight(// NOI18N<NEW_LINE>Math.// NOI18N<NEW_LINE>max(// NOI18N<NEW_LINE>table.getRowHeight(), cellRenderer.getTableCellRendererComponent(table, "abc", true, true, 0, 0).getPreferredSize().height + 2));<NEW_LINE>// table.setDefaultEditor(CommitOptions.class, new CommitOptionsCellEditor());<NEW_LINE>table.getTableHeader().setReorderingAllowed(true);<NEW_LINE>table.setRowHeight(table.getRowHeight());<NEW_LINE>table.addAncestorListener(this);<NEW_LINE>component = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);<NEW_LINE>component.setPreferredSize(new Dimension(340, 150));<NEW_LINE>// NOI18N<NEW_LINE>table.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(PropertiesTable.class, "ACSD_PropertiesTable"));<NEW_LINE>label.setLabelFor(table);<NEW_LINE>setColumns(columns);<NEW_LINE>}
= new SortedTable(this.sorter);
1,483,751
private static OFActionSetVlanPcp decode_set_vlan_priority(String actionToDecode, OFVersion version) {<NEW_LINE>Matcher n = Pattern.compile("((?:0x)?\\d+)").matcher(actionToDecode);<NEW_LINE>if (n.matches()) {<NEW_LINE>if (n.group(1) != null) {<NEW_LINE>try {<NEW_LINE>OFActionSetVlanPcp a = OFFactories.getFactory(version).actions().buildSetVlanPcp().setVlanPcp(VlanPcp.of(ParseUtils.parseHexOrDecByte(n.group(1)))).build();<NEW_LINE>log.debug("action {}", a);<NEW_LINE>return a;<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>log.debug("Invalid VLAN priority in: {} (error ignored)", actionToDecode);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
log.debug("Invalid action: '{}'", actionToDecode);
1,553,504
synchronized void purgeCache(CachePopulator populator) throws IOException {<NEW_LINE>// Note on implementation<NEW_LINE>// The purge works by scanning the query index and creating a new query cache populated<NEW_LINE>// for each query in the index. When the scan is complete, the old query cache is swapped<NEW_LINE>// for the new, allowing it to be garbage-collected.<NEW_LINE>// In order to not drop cached queries that have been added while a purge is ongoing,<NEW_LINE>// we use a ReadWriteLock to guard the creation and removal of an register log. Commits take<NEW_LINE>// the read lock. If the register log has been created, then a purge is ongoing, and queries<NEW_LINE>// are added to the register log within the read lock guard.<NEW_LINE>// The purge takes the write lock when creating the register log, and then when swapping out<NEW_LINE>// the old query cache. Within the second write lock guard, the contents of the register log<NEW_LINE>// are added to the new query cache, and the register log itself is removed.<NEW_LINE>final ConcurrentMap<String, QueryCacheEntry> newCache = new ConcurrentHashMap<>();<NEW_LINE>purgeLock.writeLock().lock();<NEW_LINE>try {<NEW_LINE>purgeCache = new ConcurrentHashMap<>();<NEW_LINE>} finally {<NEW_LINE>purgeLock.writeLock().unlock();<NEW_LINE>}<NEW_LINE>populator.populateCacheWithIndex(newCache);<NEW_LINE>purgeLock<MASK><NEW_LINE>try {<NEW_LINE>newCache.putAll(purgeCache);<NEW_LINE>purgeCache = null;<NEW_LINE>queries = newCache;<NEW_LINE>} finally {<NEW_LINE>purgeLock.writeLock().unlock();<NEW_LINE>}<NEW_LINE>}
.writeLock().lock();
1,455,165
protected void validateRequestParameters(@RequestBody EventInstanceCreateRequest request) {<NEW_LINE>if (request.getEventDefinitionId() == null && request.getEventDefinitionKey() == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("Either eventDefinitionId or eventDefinitionKey is required.");<NEW_LINE>}<NEW_LINE>int paramsSet = ((request.getEventDefinitionId() != null) ? 1 : 0) + ((request.getEventDefinitionKey() <MASK><NEW_LINE>if (paramsSet > 1) {<NEW_LINE>throw new FlowableIllegalArgumentException("Only one of eventDefinitionId or eventDefinitionKey should be set.");<NEW_LINE>}<NEW_LINE>if (request.getChannelDefinitionId() == null && request.getChannelDefinitionKey() == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("Either channelDefinitionId or channelDefinitionKey is required.");<NEW_LINE>}<NEW_LINE>paramsSet = ((request.getChannelDefinitionId() != null) ? 1 : 0) + ((request.getChannelDefinitionKey() != null) ? 1 : 0);<NEW_LINE>if (paramsSet > 1) {<NEW_LINE>throw new FlowableIllegalArgumentException("Only one of eventDefinitionId or eventDefinitionKey should be set.");<NEW_LINE>}<NEW_LINE>}
!= null) ? 1 : 0);
1,512,914
public static CompLongLongVector mergeSparseLongCompVector(LongIndexGetParam param, List<PartitionGetResult> partResults) {<NEW_LINE>Map<PartitionKey, PartitionGetResult> partKeyToResultMap = mapPartKeyToResult(partResults);<NEW_LINE>List<PartitionKey> partKeys = getSortedPartKeys(param.matrixId, param.getRowId());<NEW_LINE>MatrixMeta meta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(param.matrixId);<NEW_LINE><MASK><NEW_LINE>long subDim = meta.getBlockColNum();<NEW_LINE>int size = partKeys.size();<NEW_LINE>LongLongVector[] splitVecs = new LongLongVector[size];<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (param.getPartKeyToIndexesMap().containsKey(partKeys.get(i))) {<NEW_LINE>long[] values = ((IndexPartGetLongResult) partKeyToResultMap.get(partKeys.get(i))).getValues();<NEW_LINE>long[] indices = param.getPartKeyToIndexesMap().get(partKeys.get(i));<NEW_LINE>transformIndices(indices, partKeys.get(i));<NEW_LINE>splitVecs[i] = VFactory.sparseLongKeyLongVector(subDim, indices, values);<NEW_LINE>} else {<NEW_LINE>splitVecs[i] = VFactory.sparseLongKeyLongVector(subDim, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CompLongLongVector vector = VFactory.compLongLongVector(dim, splitVecs, subDim);<NEW_LINE>vector.setMatrixId(param.getMatrixId());<NEW_LINE>vector.setRowId(param.getRowId());<NEW_LINE>return vector;<NEW_LINE>}
long dim = meta.getColNum();
924,483
public InstanceStatusEvent unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>InstanceStatusEvent instanceStatusEvent = new InstanceStatusEvent();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return instanceStatusEvent;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("code", targetDepth)) {<NEW_LINE>instanceStatusEvent.setCode(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("description", targetDepth)) {<NEW_LINE>instanceStatusEvent.setDescription(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("notBefore", targetDepth)) {<NEW_LINE>instanceStatusEvent.setNotBefore(DateStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("notAfter", targetDepth)) {<NEW_LINE>instanceStatusEvent.setNotAfter(DateStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return instanceStatusEvent;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,218,722
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl = "@public create window MyWindow#length(2) as SupportBean;\n" + "insert into MyWindow select * from SupportBean;\n" + "@public create table varaggNWFAF (total sum(int));\n" + "into table varaggNWFAF select sum(intPrimitive) as total from MyWindow;\n";<NEW_LINE>env.compileDeploy(epl, path);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 10));<NEW_LINE>EPFireAndForgetQueryResult resultSelect = env.compileExecuteFAF("select varaggNWFAF.total as c0 from MyWindow", path);<NEW_LINE>assertEquals(10, resultSelect.getArray()[0].get("c0"));<NEW_LINE>EPFireAndForgetQueryResult resultDelete = env.compileExecuteFAF("delete from MyWindow where varaggNWFAF.total = intPrimitive", path);<NEW_LINE>assertEquals(1, resultDelete.getArray().length);<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 20));<NEW_LINE>EPFireAndForgetQueryResult resultUpdate = env.compileExecuteFAF("update MyWindow set doublePrimitive = 100 where varaggNWFAF.total = intPrimitive", path);<NEW_LINE>assertEquals(100d, resultUpdate.getArray()[<MASK><NEW_LINE>EPFireAndForgetQueryResult resultInsert = env.compileExecuteFAF("insert into MyWindow (theString, intPrimitive) values ('A', varaggNWFAF.total)", path);<NEW_LINE>EPAssertionUtil.assertProps(resultInsert.getArray()[0], "theString,intPrimitive".split(","), new Object[] { "A", 20 });<NEW_LINE>env.undeployAll();<NEW_LINE>}
0].get("doublePrimitive"));
349,438
final ListAppInstanceAdminsResult executeListAppInstanceAdmins(ListAppInstanceAdminsRequest listAppInstanceAdminsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAppInstanceAdminsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAppInstanceAdminsRequest> request = null;<NEW_LINE>Response<ListAppInstanceAdminsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAppInstanceAdminsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAppInstanceAdminsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Chime SDK Identity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAppInstanceAdmins");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAppInstanceAdminsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAppInstanceAdminsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
108,996
public TemplateAlias unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TemplateAlias templateAlias = new TemplateAlias();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AliasName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>templateAlias.setAliasName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>templateAlias.setArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TemplateVersionNumber", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>templateAlias.setTemplateVersionNumber(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return templateAlias;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
980,350
private static void handleLegacy(String name, String className, ConfigurationCommon configuration, Element xmldomElement) {<NEW_LINE>// Class name is required for legacy classes<NEW_LINE>if (className == null) {<NEW_LINE>throw new ConfigurationException("Required class name not supplied for legacy type definition");<NEW_LINE>}<NEW_LINE>String accessorStyle = getRequiredAttribute(xmldomElement, "accessor-style");<NEW_LINE>String propertyResolution = getRequiredAttribute(xmldomElement, "property-resolution-style");<NEW_LINE>String <MASK><NEW_LINE>String copyMethod = getOptionalAttribute(xmldomElement, "copy-method");<NEW_LINE>String startTimestampProp = getOptionalAttribute(xmldomElement, "start-timestamp-property-name");<NEW_LINE>String endTimestampProp = getOptionalAttribute(xmldomElement, "end-timestamp-property-name");<NEW_LINE>ConfigurationCommonEventTypeBean legacyDesc = new ConfigurationCommonEventTypeBean();<NEW_LINE>if (accessorStyle != null) {<NEW_LINE>legacyDesc.setAccessorStyle(AccessorStyle.valueOf(accessorStyle.toUpperCase(Locale.ENGLISH)));<NEW_LINE>}<NEW_LINE>if (propertyResolution != null) {<NEW_LINE>legacyDesc.setPropertyResolutionStyle(PropertyResolutionStyle.valueOf(propertyResolution.toUpperCase(Locale.ENGLISH)));<NEW_LINE>}<NEW_LINE>legacyDesc.setFactoryMethod(factoryMethod);<NEW_LINE>legacyDesc.setCopyMethod(copyMethod);<NEW_LINE>legacyDesc.setStartTimestampPropertyName(startTimestampProp);<NEW_LINE>legacyDesc.setEndTimestampPropertyName(endTimestampProp);<NEW_LINE>configuration.addEventType(name, className, legacyDesc);<NEW_LINE>DOMElementIterator propertyNodeIterator = new DOMElementIterator(xmldomElement.getChildNodes());<NEW_LINE>while (propertyNodeIterator.hasNext()) {<NEW_LINE>Element propertyElement = propertyNodeIterator.next();<NEW_LINE>if (propertyElement.getNodeName().equals("method-property")) {<NEW_LINE>String nameProperty = getRequiredAttribute(propertyElement, "name");<NEW_LINE>String method = getRequiredAttribute(propertyElement, "accessor-method");<NEW_LINE>legacyDesc.addMethodProperty(nameProperty, method);<NEW_LINE>} else if (propertyElement.getNodeName().equals("field-property")) {<NEW_LINE>String nameProperty = getRequiredAttribute(propertyElement, "name");<NEW_LINE>String field = getRequiredAttribute(propertyElement, "accessor-field");<NEW_LINE>legacyDesc.addFieldProperty(nameProperty, field);<NEW_LINE>} else {<NEW_LINE>throw new ConfigurationException("Invalid node " + propertyElement.getNodeName() + " encountered while parsing legacy type definition");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
factoryMethod = getOptionalAttribute(xmldomElement, "factory-method");
1,104,929
protected double maintain() {<NEW_LINE>if (!nodeRepository().nodes().isWorking())<NEW_LINE>return 0.0;<NEW_LINE>// Don't need to maintain spare capacity in dynamically provisioned zones; can provision more on demand.<NEW_LINE>if (nodeRepository().zone().getCloud().dynamicProvisioning())<NEW_LINE>return 1.0;<NEW_LINE>NodeList allNodes = nodeRepository().nodes().list();<NEW_LINE>CapacityChecker capacityChecker = new CapacityChecker(allNodes);<NEW_LINE>List<Node> overcommittedHosts = capacityChecker.findOvercommittedHosts();<NEW_LINE>metric.set("overcommittedHosts", overcommittedHosts.size(), null);<NEW_LINE>retireOvercommitedHosts(allNodes, overcommittedHosts);<NEW_LINE>boolean success = true;<NEW_LINE>Optional<CapacityChecker.HostFailurePath> failurePath = capacityChecker.worstCaseHostLossLeadingToFailure();<NEW_LINE>if (failurePath.isPresent()) {<NEW_LINE>int spareHostCapacity = failurePath.get().hostsCausingFailure.size() - 1;<NEW_LINE>if (spareHostCapacity == 0) {<NEW_LINE>List<Move> mitigation = findMitigation(failurePath.get());<NEW_LINE>if (execute(mitigation, failurePath.get())) {<NEW_LINE>// We succeeded or are in the process of taking a step to mitigate.<NEW_LINE>// Report with the assumption this will eventually succeed to avoid alerting before we're stuck<NEW_LINE>spareHostCapacity++;<NEW_LINE>} else {<NEW_LINE>success = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>metric.<MASK><NEW_LINE>}<NEW_LINE>return success ? 1.0 : 0.0;<NEW_LINE>}
set("spareHostCapacity", spareHostCapacity, null);
721,304
// Interrupt timed invokeAll while it is waiting for a queue position in order to submit one of the tasks.<NEW_LINE>// All of the tasks that previously started should be canceled when invokeAll returns and finish stopping in a timely manner.<NEW_LINE>@Test<NEW_LINE>public void testInvokeAllTimedInterruptWaitForEnqueue() throws Exception {<NEW_LINE>PolicyExecutor executor = provider.create("testInvokeAllTimedInterruptWaitForEnqueue").expedite(1).maxConcurrency(1).maxQueueSize(1).maxWaitForEnqueue(TimeUnit.MINUTES.toMillis(8));<NEW_LINE>// wait for any 1 task to begin<NEW_LINE>CountDownLatch beginLatch = new CountDownLatch(1);<NEW_LINE>CountDownLatch blocker = new CountDownLatch(1);<NEW_LINE>Vector<CountDownTask> tasks = new Vector<CountDownTask>();<NEW_LINE>tasks.add(new CountDownTask(beginLatch, blocker, TimeUnit.MINUTES.toNanos(4)));<NEW_LINE>tasks.add(new CountDownTask(beginLatch, blocker, TimeUnit.MINUTES.toNanos(5)));<NEW_LINE>tasks.add(new CountDownTask(beginLatch, blocker, TimeUnit.MINUTES.toNanos(6)));<NEW_LINE>// Interrupt the current thread only after one of the tasks that we will invoke has started,<NEW_LINE>Future<?> interrupterFuture = testThreads.submit(new InterrupterTask(Thread.currentThread(), beginLatch, TIMEOUT_NS * 3, TimeUnit.NANOSECONDS));<NEW_LINE>try {<NEW_LINE>fail("Should have been interrupted. Instead: " + executor.invokeAll(tasks, 9, TimeUnit.MINUTES));<NEW_LINE>} catch (InterruptedException x) {<NEW_LINE>}<NEW_LINE>// pass<NEW_LINE>// Ensure the tasks all stop in a timely manner (some won't ever have started)<NEW_LINE>boolean stopped = false;<NEW_LINE>for (long start = System.nanoTime(); !stopped && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(200)) stopped = tasks.get(0).executionThreads.isEmpty() && tasks.get(1).executionThreads.isEmpty() && tasks.get(2).executionThreads.isEmpty();<NEW_LINE>assertTrue(stopped);<NEW_LINE>interrupterFuture.<MASK><NEW_LINE>List<Runnable> canceledFromQueue = executor.shutdownNow();<NEW_LINE>assertEquals(0, canceledFromQueue.size());<NEW_LINE>}
get(TIMEOUT_NS, TimeUnit.NANOSECONDS);
1,062,098
private Optional<UsbSerialDeviceInformation> createUsbSerialDeviceInformation(ServiceInfo serviceInfo) {<NEW_LINE>String provider = serviceInfo.getPropertyString(PROPERTY_PROVIDER);<NEW_LINE>String deviceType = serviceInfo.getPropertyString(PROPERTY_DEVICE_TYPE);<NEW_LINE>String gensioStack = serviceInfo.getPropertyString(PROPERTY_GENSIO_STACK);<NEW_LINE>// Check ser2net specific properties when present<NEW_LINE>if (SER2NET.equals(provider) && (deviceType != null && !SERIALUSB.equals(deviceType)) || (gensioStack != null && !TELNET_RFC2217_TCP.equals(gensioStack))) {<NEW_LINE>logger.debug("Skipping creation of UsbSerialDeviceInformation based on {}", serviceInfo);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int vendorId = Integer.parseInt(serviceInfo.getPropertyString(PROPERTY_VENDOR_ID), 16);<NEW_LINE>int productId = Integer.parseInt(serviceInfo.getPropertyString(PROPERTY_PRODUCT_ID), 16);<NEW_LINE>String <MASK><NEW_LINE>String manufacturer = serviceInfo.getPropertyString(PROPERTY_MANUFACTURER);<NEW_LINE>String product = serviceInfo.getPropertyString(PROPERTY_PRODUCT);<NEW_LINE>int interfaceNumber = Integer.parseInt(serviceInfo.getPropertyString(PROPERTY_INTERFACE_NUMBER), 16);<NEW_LINE>String interfaceDescription = serviceInfo.getPropertyString(PROPERTY_INTERFACE);<NEW_LINE>String serialPortName = String.format(SERIAL_PORT_NAME_FORMAT, serviceInfo.getHostAddresses()[0], serviceInfo.getPort());<NEW_LINE>UsbSerialDeviceInformation deviceInfo = new UsbSerialDeviceInformation(vendorId, productId, serialNumber, manufacturer, product, interfaceNumber, interfaceDescription, serialPortName);<NEW_LINE>logger.debug("Created {} based on {}", deviceInfo, serviceInfo);<NEW_LINE>return Optional.of(deviceInfo);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>logger.debug("Failed to create UsbSerialDeviceInformation based on {}", serviceInfo, e);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}
serialNumber = serviceInfo.getPropertyString(PROPERTY_SERIAL_NUMBER);
551,693
public static Optional<RDotTxtEntry> parse(String rDotTxtLine) {<NEW_LINE>Matcher matcher = TEXT_SYMBOLS_LINE.matcher(rDotTxtLine);<NEW_LINE>if (!matcher.matches()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>CustomDrawableType customType = CustomDrawableType.NONE;<NEW_LINE>IdType idType = IdType.from(matcher.group(1));<NEW_LINE>RType type = RType.valueOf(matcher.group(2).toUpperCase());<NEW_LINE>String name = matcher.group(3);<NEW_LINE>String idValue = matcher.group(4);<NEW_LINE>String custom = matcher.group(5);<NEW_LINE>if (custom != null && custom.length() > 0) {<NEW_LINE>// Remove the leading space.<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (CUSTOM_DRAWABLE_IDENTIFIER.equals(custom)) {<NEW_LINE>customType = CustomDrawableType.CUSTOM;<NEW_LINE>} else if (GRAYSCALE_IMAGE_IDENTIFIER.equals(custom)) {<NEW_LINE>customType = CustomDrawableType.GRAYSCALE_IMAGE;<NEW_LINE>}<NEW_LINE>return Optional.of(new RDotTxtEntry(idType, type, name, idValue, customType));<NEW_LINE>}
custom = custom.substring(1);
1,606,791
public void run(String... args) throws Exception {<NEW_LINE>{<NEW_LINE>System.out.println("refresh index");<NEW_LINE>repository.deleteAll();<NEW_LINE>operations.indexOps(Conference.class).delete();<NEW_LINE>operations.indexOps(Conference.class).create();<NEW_LINE>}<NEW_LINE>{<NEW_LINE>System.out.println("\n--- REPOSITORY ---");<NEW_LINE>// Save data sample<NEW_LINE>repository.save(Conference.builder().date("2014-11-06").name("Spring eXchange 2014 - London").keywords(Arrays.asList("java", "spring")).location(new GeoPoint(51.500152D, -0.126236D)).build());<NEW_LINE>repository.save(Conference.builder().date("2014-12-07").name("Scala eXchange 2014 - London").keywords(Arrays.asList("scala", "play", "java")).location(new GeoPoint(51.500152D, -0.126236D)).build());<NEW_LINE>repository.save(Conference.builder().date("2014-11-20").name("Elasticsearch 2014 - Berlin").keywords(Arrays.asList("java", "elasticsearch", "kibana")).location(new GeoPoint(52.5234051D, 13.4113999)).build());<NEW_LINE>repository.save(Conference.builder().date("2014-11-12").name("AWS London 2014").keywords(Arrays.asList("cloud", "aws")).location(new GeoPoint(51.500152D, -0.126236D)).build());<NEW_LINE>repository.save(Conference.builder().date("2014-10-04").name("JDD14 - Cracow").keywords(Arrays.asList("java", "spring")).location(new GeoPoint(50.0646501D, 19.9449799)).build());<NEW_LINE>System.out.println("repository.count(): " + repository.count());<NEW_LINE>}<NEW_LINE>{<NEW_LINE><MASK><NEW_LINE>SearchPage<Conference> searchPage = repository.findBySomeCustomImplementation("eXchange", PageRequest.of(0, 10));<NEW_LINE>System.out.println("custom implementation finder.size(): " + searchPage.getSearchHits().getTotalHits());<NEW_LINE>}<NEW_LINE>String expectedDate = "2014-10-29";<NEW_LINE>String expectedWord = "java";<NEW_LINE>CriteriaQuery query = new CriteriaQuery(new Criteria("keywords").contains(expectedWord).and(new Criteria("date").greaterThanEqual(expectedDate)));<NEW_LINE>{<NEW_LINE>System.out.println("\n--- TEMPLATE FIND ---");<NEW_LINE>SearchHits<Conference> result = operations.search(query, Conference.class, IndexCoordinates.of("conference-index"));<NEW_LINE>System.out.println("result.size(): " + result.getSearchHits().size());<NEW_LINE>}<NEW_LINE>{<NEW_LINE>System.out.println("\n--- REPOSITORY FINDER ---");<NEW_LINE>List<Conference> result = repository.findByKeywordsContaining("spring");<NEW_LINE>System.out.println("result.size(): " + result.size());<NEW_LINE>}<NEW_LINE>{<NEW_LINE>System.out.println("\n--- REACTIVE TEMPLATE ---");<NEW_LINE>System.out.println("reactiveTemplate.count(): " + reactiveOps.count(Query.findAll(), Conference.class, IndexCoordinates.of("conference-index")).block());<NEW_LINE>}<NEW_LINE>{<NEW_LINE>System.out.println("\n--- REACTIVE REPOSITORY ---");<NEW_LINE>System.out.println("reactiveRepository.count(): " + reactiveRepository.count().block());<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// does currently not work in SD ES - wrong reactor-netty dependency<NEW_LINE>// System.out.println("\n--- REACTIVE REPOSITORY FINDER ---");<NEW_LINE>// System.out.println("result.size(): " + reactiveRepository.findByKeywordsContaining("spring").collectList().block().size());<NEW_LINE>}<NEW_LINE>System.out.println("DONE");<NEW_LINE>}
System.out.println("\n--- CUSTOM REPOSITORY ---");
92,034
public static LineSkewResult findLineSkewPoint(Line line, Vec3d start, Vec3d direction) {<NEW_LINE>double ia = 0, ib = 1;<NEW_LINE><MASK><NEW_LINE>double id = 0.5;<NEW_LINE>Vec3d va, vb;<NEW_LINE>Vec3d best = null;<NEW_LINE>for (int i = 0; i < 10; i++) {<NEW_LINE>Vec3d a = line.interpolate(ia);<NEW_LINE>Vec3d b = line.interpolate(ib);<NEW_LINE>va = closestPointOnLineToPoint(a, start, direction);<NEW_LINE>vb = closestPointOnLineToPoint(b, start, direction);<NEW_LINE>da = a.squareDistanceTo(va);<NEW_LINE>db = b.squareDistanceTo(vb);<NEW_LINE>if (da < db) {<NEW_LINE>// We work out the square root at the end to get the actual distance<NEW_LINE>best = a;<NEW_LINE>ib -= id;<NEW_LINE>} else /* if (db < da) */<NEW_LINE>{<NEW_LINE>// We work out the square root at the end to get the actual distance<NEW_LINE>best = b;<NEW_LINE>ia += id;<NEW_LINE>}<NEW_LINE>id /= 2.0;<NEW_LINE>}<NEW_LINE>return new LineSkewResult(best, Math.sqrt(Math.min(da, db)));<NEW_LINE>}
double da = 0, db = 0;
915,089
public static void main(String[] args) {<NEW_LINE>int gamesWon = 0;<NEW_LINE>// Intro text<NEW_LINE>System.out.println("\n\n Bagels");<NEW_LINE>System.out.println("Creative Computing Morristown, New Jersey");<NEW_LINE>System.out.println("\n\n");<NEW_LINE>System.out.print("Would you like the rules (Yes or No)? ");<NEW_LINE>// Need instructions?<NEW_LINE>Scanner scan <MASK><NEW_LINE>String s = scan.nextLine();<NEW_LINE>if (s.length() == 0 || s.toUpperCase().charAt(0) != 'N') {<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("I am thinking of a three-digit number. Try to guess");<NEW_LINE>System.out.println("my number and I will give you clues as follows:");<NEW_LINE>System.out.println(" PICO - One digit correct but in the wrong position");<NEW_LINE>System.out.println(" FERMI - One digit correct and in the right position");<NEW_LINE>System.out.println(" BAGELS - No digits correct");<NEW_LINE>}<NEW_LINE>// Loop for playing multiple games<NEW_LINE>boolean stillPlaying = true;<NEW_LINE>while (stillPlaying) {<NEW_LINE>// Set up a new game<NEW_LINE>BagelGame game = new BagelGame();<NEW_LINE>System.out.println("\nO.K. I have a number in mind.");<NEW_LINE>// Loop guess and responsses until game is over<NEW_LINE>while (!game.isOver()) {<NEW_LINE>String guess = getValidGuess(game);<NEW_LINE>String response = game.makeGuess(guess);<NEW_LINE>// Don't print a response if the game is won<NEW_LINE>if (!game.isWon()) {<NEW_LINE>System.out.println(response);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Game is over. But did we win or lose?<NEW_LINE>if (game.isWon()) {<NEW_LINE>System.out.println("You got it!!!\n");<NEW_LINE>gamesWon++;<NEW_LINE>} else {<NEW_LINE>System.out.println("Oh well");<NEW_LINE>System.out.print("That's " + BagelGame.MAX_GUESSES + " guesses. ");<NEW_LINE>System.out.println("My number was " + game.getSecretAsString());<NEW_LINE>}<NEW_LINE>stillPlaying = getReplayResponse();<NEW_LINE>}<NEW_LINE>// Print goodbye message<NEW_LINE>if (gamesWon > 0) {<NEW_LINE>System.out.println("\nA " + gamesWon + " point Bagels buff!!");<NEW_LINE>}<NEW_LINE>System.out.println("Hope you had fun. Bye.\n");<NEW_LINE>}
= new Scanner(System.in);
394,056
protected StreamingDistribution createStreamingDistribution(final Path container, final Distribution distribution) throws BackgroundException {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Create new %s distribution", distribution));<NEW_LINE>}<NEW_LINE>final AmazonCloudFront client = this.client(container);<NEW_LINE>final URI origin = this.getOrigin(container, distribution.getMethod());<NEW_LINE>final String originId = String.format("%s-%s", preferences.getProperty("application.name"), new AlphanumericRandomStringService().random());<NEW_LINE>final StreamingDistributionConfig config = new StreamingDistributionConfig(new AlphanumericRandomStringService().random(), new S3Origin(origin.getHost(), StringUtils.EMPTY), distribution.isEnabled()).withComment(originId).withTrustedSigners(new TrustedSigners().withEnabled(false).withQuantity(0)).withAliases(new Aliases().withItems(distribution.getCNAMEs()).withQuantity(distribution.getCNAMEs().length));<NEW_LINE>// Make bucket name fully qualified<NEW_LINE>final String loggingTarget = ServiceUtils.generateS3HostnameForBucket(distribution.getLoggingContainer(), false, new S3Protocol().getDefaultHostname());<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Set logging target for %s to %s", distribution, loggingTarget));<NEW_LINE>}<NEW_LINE>config.setLogging(new StreamingLoggingConfig().withEnabled(distribution.isLogging()).withBucket(loggingTarget).withPrefix(new HostPreferences(session.getHost()).getProperty("cloudfront.logging.prefix")));<NEW_LINE>return client.createStreamingDistribution(new CreateStreamingDistributionRequest<MASK><NEW_LINE>}
(config)).getStreamingDistribution();
1,243,341
final DescribeGroupResult executeDescribeGroup(DescribeGroupRequest describeGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeGroupRequest> request = null;<NEW_LINE>Response<DescribeGroupResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
87,737
void initializeAssetBundles() throws WebAppException {<NEW_LINE>// The initial asset bundle consists of the assets bundled with the app<NEW_LINE>AssetBundle initialAssetBundle = new AssetBundle(resourceApi, applicationDirectoryUri);<NEW_LINE>Log.d(LOG_TAG, "Initial bundle loaded " + initialAssetBundle.getVersion());<NEW_LINE>// Downloaded versions are stored in /data/data/<app>/files/meteor<NEW_LINE>File versionsDirectory = new File(cordova.getActivity().getFilesDir(), "meteor");<NEW_LINE>// If the last seen initial version is different from the currently bundled<NEW_LINE>// version, we delete the versions directory and unset lastDownloadedVersion<NEW_LINE>// and blacklistedVersions<NEW_LINE>if (!initialAssetBundle.getVersion().equals(configuration.getLastSeenInitialVersion())) {<NEW_LINE>Log.d(LOG_TAG, "Detected new bundled version, removing versions directory if it exists");<NEW_LINE>if (versionsDirectory.exists()) {<NEW_LINE>if (!IOUtils.deleteRecursively(versionsDirectory)) {<NEW_LINE>Log.w(LOG_TAG, "Could not remove versions directory");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>configuration.reset();<NEW_LINE>}<NEW_LINE>// We keep track of the last seen initial version (see above)<NEW_LINE>configuration.setLastSeenInitialVersion(initialAssetBundle.getVersion());<NEW_LINE>// If the versions directory does not exist, we create it<NEW_LINE>if (!versionsDirectory.exists()) {<NEW_LINE>if (!versionsDirectory.mkdirs()) {<NEW_LINE>Log.e(LOG_TAG, "Could not create versions directory");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assetBundleManager = new AssetBundleManager(resourceApi, configuration, initialAssetBundle, versionsDirectory);<NEW_LINE>assetBundleManager.setCallback(WebAppLocalServer.this);<NEW_LINE><MASK><NEW_LINE>if (lastDownloadedVersion != null) {<NEW_LINE>currentAssetBundle = assetBundleManager.downloadedAssetBundleWithVersion(lastDownloadedVersion);<NEW_LINE>if (currentAssetBundle == null) {<NEW_LINE>currentAssetBundle = initialAssetBundle;<NEW_LINE>} else if (configuration.getLastKnownGoodVersion() == null || !configuration.getLastKnownGoodVersion().equals(lastDownloadedVersion)) {<NEW_LINE>startStartupTimer();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>currentAssetBundle = initialAssetBundle;<NEW_LINE>}<NEW_LINE>pendingAssetBundle = null;<NEW_LINE>}
String lastDownloadedVersion = configuration.getLastDownloadedVersion();
1,374,171
public void check(UserDetails user) {<NEW_LINE>if (!user.isAccountNonLocked()) {<NEW_LINE>this.logger.debug("Failed to authenticate since user account is locked");<NEW_LINE>throw new LockedException(this.messages.getMessage("AccountStatusUserDetailsChecker.locked", "User account is locked"));<NEW_LINE>}<NEW_LINE>if (!user.isEnabled()) {<NEW_LINE>this.logger.debug("Failed to authenticate since user account is disabled");<NEW_LINE>throw new DisabledException(this.messages.getMessage("AccountStatusUserDetailsChecker.disabled", "User is disabled"));<NEW_LINE>}<NEW_LINE>if (!user.isAccountNonExpired()) {<NEW_LINE>this.logger.debug("Failed to authenticate since user account is expired");<NEW_LINE>throw new AccountExpiredException(this.messages<MASK><NEW_LINE>}<NEW_LINE>if (!user.isCredentialsNonExpired()) {<NEW_LINE>this.logger.debug("Failed to authenticate since user account credentials have expired");<NEW_LINE>throw new CredentialsExpiredException(this.messages.getMessage("AccountStatusUserDetailsChecker.credentialsExpired", "User credentials have expired"));<NEW_LINE>}<NEW_LINE>}
.getMessage("AccountStatusUserDetailsChecker.expired", "User account has expired"));
1,500,238
public final <T> Lookup.Result<T> lookup(Lookup.Template<T> template) {<NEW_LINE>beforeLookupResult(template);<NEW_LINE>for (; ; ) {<NEW_LINE>AbstractLookup.ISE toRun = null;<NEW_LINE>AbstractLookup.Storage<MASK><NEW_LINE>try {<NEW_LINE>Lookup.Result<T> prev = t.findResult(template);<NEW_LINE>if (prev != null) {<NEW_LINE>return prev;<NEW_LINE>}<NEW_LINE>R<T> r = new R<T>();<NEW_LINE>ReferenceToResult<T> newRef = new ReferenceToResult<T>(r, this, template);<NEW_LINE>newRef.next = t.registerReferenceToResult(newRef);<NEW_LINE>return r;<NEW_LINE>} catch (AbstractLookup.ISE ex) {<NEW_LINE>toRun = ex;<NEW_LINE>} finally {<NEW_LINE>exitStorage();<NEW_LINE>}<NEW_LINE>toRun.recover(this);<NEW_LINE>// and try again<NEW_LINE>}<NEW_LINE>}
<?> t = enterStorage();
182,416
public void configure(final BufferedImage origLeft, final BufferedImage origRight, StereoParameters param) {<NEW_LINE>this.param = param;<NEW_LINE>// distorted images<NEW_LINE>distLeft = ConvertBufferedImage.convertFromPlanar(origLeft, null, true, GrayF32.class);<NEW_LINE>distRight = ConvertBufferedImage.convertFromPlanar(origRight, null, true, GrayF32.class);<NEW_LINE>// storage for undistorted + rectified images<NEW_LINE>rectLeft = new Planar<>(GrayF32.class, distLeft.getWidth(), distLeft.getHeight(), distLeft.getNumBands());<NEW_LINE>rectRight = new Planar<>(GrayF32.class, distRight.getWidth(), distRight.getHeight(), distRight.getNumBands());<NEW_LINE>// Compute rectification<NEW_LINE>RectifyCalibrated rectifyAlg = RectifyImageOps.createCalibrated();<NEW_LINE>Se3_F64 leftToRight = param.getRightToLeft().invert(null);<NEW_LINE>// original camera calibration matrices<NEW_LINE>DMatrixRMaj K1 = PerspectiveOps.pinholeToMatrix(param.getLeft(), (DMatrixRMaj) null);<NEW_LINE>DMatrixRMaj K2 = PerspectiveOps.pinholeToMatrix(param.getRight(), (DMatrixRMaj) null);<NEW_LINE>rectifyAlg.process(K1, new Se3_F64(), K2, leftToRight);<NEW_LINE>// rectification matrix for each image<NEW_LINE>DMatrixRMaj rect1 = rectifyAlg.getUndistToRectPixels1();<NEW_LINE>DMatrixRMaj rect2 = rectifyAlg.getUndistToRectPixels2();<NEW_LINE>DMatrixRMaj rectK = rectifyAlg.getCalibrationMatrix();<NEW_LINE>// show results and draw a horizontal line where the user clicks to see rectification easier<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>gui.reset();<NEW_LINE>gui.addItem(new RectifiedPairPanel(true, origLeft, origRight), "Original");<NEW_LINE>});<NEW_LINE>// add different types of adjustments<NEW_LINE>addRectified("No Adjustment", rect1, rect2);<NEW_LINE>RectifyImageOps.allInsideLeft(param.left, rect1, rect2, rectK, null);<NEW_LINE>addRectified("All Inside", rect1, rect2);<NEW_LINE>RectifyImageOps.fullViewLeft(param.left, <MASK><NEW_LINE>addRectified("Full View", rect1, rect2);<NEW_LINE>hasProcessed = true;<NEW_LINE>}
rect1, rect2, rectK, null);