idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,096,806
private ClspMethod readMethod(DataInputStream in, ClassInfo clsInfo) throws IOException {<NEW_LINE>String name = readString(in);<NEW_LINE>List<ArgType> argTypes = readArgTypesList(in);<NEW_LINE>ArgType retType = readArgType(in);<NEW_LINE>List<ArgType> genericArgTypes = readArgTypesList(in);<NEW_LINE>if (genericArgTypes.isEmpty() || Objects.equals(genericArgTypes, argTypes)) {<NEW_LINE>genericArgTypes = argTypes;<NEW_LINE>}<NEW_LINE>ArgType genericRetType = readArgType(in);<NEW_LINE>if (Objects.equals(genericRetType, retType)) {<NEW_LINE>genericRetType = retType;<NEW_LINE>}<NEW_LINE>List<<MASK><NEW_LINE>int accFlags = in.readInt();<NEW_LINE>List<ArgType> throwList = readArgTypesList(in);<NEW_LINE>MethodInfo methodInfo = MethodInfo.fromDetails(root, clsInfo, name, argTypes, retType);<NEW_LINE>return new ClspMethod(methodInfo, genericArgTypes, genericRetType, typeParameters, throwList, accFlags);<NEW_LINE>}
ArgType> typeParameters = readArgTypesList(in);
1,678,881
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select theString.* as s0, intPrimitive as a, theString.* as s1, intPrimitive as b from SupportBean#length(3) as theString";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>EventType type = statement.getEventType();<NEW_LINE>assertEquals(4, type.getPropertyNames().length);<NEW_LINE>assertEquals(Map.class, type.getUnderlyingType());<NEW_LINE>assertEquals(Integer.class, type.getPropertyType("a"));<NEW_LINE>assertEquals(Integer.class, type.getPropertyType("b"));<NEW_LINE>assertEquals(SupportBean.class, type.getPropertyType("s0"));<NEW_LINE>assertEquals(SupportBean.class, type.getPropertyType("s1"));<NEW_LINE>});<NEW_LINE>Object theEvent = <MASK><NEW_LINE>String[] fields = new String[] { "s0", "s1", "a", "b" };<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { theEvent, theEvent, 12, 12 });<NEW_LINE>env.undeployAll();<NEW_LINE>}
sendBeanEvent(env, "E1", 12);
920,340
public static String[] packagLog(byte[] data, String charset) {<NEW_LINE>String type, content = null;<NEW_LINE>String[] arr = new String[2];<NEW_LINE>arr[0] = (type = MySQLPacket.TO_STRING.get(data[4])) == null ? "UNKNOWN" : type;<NEW_LINE>arr[1] = null;<NEW_LINE>try {<NEW_LINE>switch(data[4]) {<NEW_LINE>case MySQLPacket.COM_STMT_RESET:<NEW_LINE>case MySQLPacket.COM_STMT_CLOSE:<NEW_LINE>case MySQLPacket.COM_RESET_CONNECTION:<NEW_LINE>case MySQLPacket.COM_CHANGE_USER:<NEW_LINE>case MySQLPacket.COM_PING:<NEW_LINE>case MySQLPacket.COM_HEARTBEAT:<NEW_LINE>case MySQLPacket.COM_QUIT:<NEW_LINE>case MySQLPacket.COM_STMT_SEND_LONG_DATA:<NEW_LINE>case MySQLPacket.COM_PROCESS_KILL:<NEW_LINE>case MySQLPacket.COM_STMT_EXECUTE:<NEW_LINE>// case MySQLPacket.COM_SET_OPTION:<NEW_LINE>break;<NEW_LINE>case MySQLPacket.COM_QUERY:<NEW_LINE>case MySQLPacket.COM_INIT_DB:<NEW_LINE>case MySQLPacket.COM_STMT_PREPARE:<NEW_LINE>MySQLMessage mm = new MySQLMessage(data);<NEW_LINE>mm.position(5);<NEW_LINE>content = mm.readString(charset);<NEW_LINE>break;<NEW_LINE>case MySQLPacket.COM_FIELD_LIST:<NEW_LINE><MASK><NEW_LINE>mm2.position(5);<NEW_LINE>content = mm2.readStringWithNull();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>arr[1] = content;<NEW_LINE>return arr;<NEW_LINE>}
MySQLMessage mm2 = new MySQLMessage(data);
1,242,083
public IArchimateModel createNewModel() throws IOException {<NEW_LINE>File file = getTempModelFile();<NEW_LINE>if (file == null || !file.exists()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>IArchimateModel model = IEditorModelManager.INSTANCE.openModel(file);<NEW_LINE>if (model != null) {<NEW_LINE>// New name<NEW_LINE>// $NON-NLS-1$<NEW_LINE>model.setName(Messages.NewArchimateModelFromTemplateWizard_1 + " " + model.getName());<NEW_LINE>// Set latest model version (need to do this in case we immediately save as Template)<NEW_LINE><MASK><NEW_LINE>// Set file to null<NEW_LINE>model.setFile(null);<NEW_LINE>// New IDs<NEW_LINE>UUIDFactory.generateNewIDs(model);<NEW_LINE>// Edit in-place in Tree<NEW_LINE>UIRequestManager.INSTANCE.fireRequestAsync(new TreeEditElementRequest(this, model));<NEW_LINE>}<NEW_LINE>file.delete();<NEW_LINE>return model;<NEW_LINE>}
model.setVersion(ModelVersion.VERSION);
20,220
public void doFormat(int depth, Hints formatOption, FormatWriter writer) throws IOException {<NEW_LINE>this.parent.doFormat(depth, formatOption, writer);<NEW_LINE>if (this.parent instanceof EnterRouteVariable) {<NEW_LINE>RouteType routeType = ((EnterRouteVariable) parent).getRouteType();<NEW_LINE>SpecialType specialType = ((EnterRouteVariable) parent).getSpecialType();<NEW_LINE>if (specialType == null) {<NEW_LINE>specialType = EnterRouteVariable.SpecialType.Special_A;<NEW_LINE>}<NEW_LINE>writer.<MASK><NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (subType == SubType.String) {<NEW_LINE>String newValue = subValue.getValue().replace(String.valueOf(quoteChar), "\\" + quoteChar);<NEW_LINE>writer.write("[" + quoteChar + newValue + quoteChar + "]");<NEW_LINE>} else if (subType == SubType.Integer) {<NEW_LINE>writer.write("[" + subValue.getValue() + "]");<NEW_LINE>} else {<NEW_LINE>writer.write("[");<NEW_LINE>Variable varExp = this.exprValue;<NEW_LINE>while (true) {<NEW_LINE>if (varExp instanceof PrivilegeExpression) {<NEW_LINE>varExp = ((PrivilegeExpression) varExp).getExpression();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (varExp instanceof AtomExpression) {<NEW_LINE>varExp = ((AtomExpression) varExp).getVariableExpression();<NEW_LINE>}<NEW_LINE>if (varExp instanceof EnterRouteVariable) {<NEW_LINE>writer.write(((EnterRouteVariable) varExp).getSpecialType().getCode());<NEW_LINE>} else {<NEW_LINE>varExp.doFormat(depth, formatOption, writer);<NEW_LINE>}<NEW_LINE>writer.write("]");<NEW_LINE>}<NEW_LINE>}
write(specialType.getCode());
1,528,843
public Object visit(ASTConstructorDeclaration node, Object data) {<NEW_LINE>if (!(getCurrentEvalPackage() instanceof NullEvalPackage)) {<NEW_LINE>// only evaluate if we have an eval package for this class<NEW_LINE>List<MethodInvocation> calledMethodsOfConstructor = new ArrayList<>();<NEW_LINE>ConstructorHolder ch = new ConstructorHolder(node);<NEW_LINE>addCalledMethodsOfNode(node, calledMethodsOfConstructor, getCurrentEvalPackage().className);<NEW_LINE>if (!node.isPrivate()) {<NEW_LINE>// these calledMethods are what we will evaluate for being<NEW_LINE>// called badly<NEW_LINE>getCurrentEvalPackage(<MASK><NEW_LINE>// these called private constructors are what we will evaluate<NEW_LINE>// for being called badly<NEW_LINE>// we add all constructors invoked by non-private constructors<NEW_LINE>// but we are only interested in the private ones. We just can't<NEW_LINE>// tell the difference here<NEW_LINE>ASTExplicitConstructorInvocation eci = ch.getASTExplicitConstructorInvocation();<NEW_LINE>if (eci != null && eci.isThis()) {<NEW_LINE>getCurrentEvalPackage().calledConstructors.add(ch.getCalledConstructor());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// add all private constructors to list for later evaluation on<NEW_LINE>// if they are safe to call from another constructor<NEW_LINE>// store this constructorHolder for later evaluation<NEW_LINE>getCurrentEvalPackage().allPrivateConstructorsOfClass.put(ch, calledMethodsOfConstructor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.visit(node, data);<NEW_LINE>}
).calledMethods.addAll(calledMethodsOfConstructor);
35,103
public static BulkUpdateRequest fromJSON(JsonReader jsonReader) {<NEW_LINE>JsonReader operations = jsonReader.readJsonObject("operations");<NEW_LINE>List<String> usersToAdd = new ArrayList<>();<NEW_LINE>List<String> <MASK><NEW_LINE>List<String> rolesToAdd = new ArrayList<>();<NEW_LINE>List<String> rolesToRemove = new ArrayList<>();<NEW_LINE>operations.optJsonObject("users").ifPresent(reader -> {<NEW_LINE>usersToAdd.addAll(reader.readStringArrayIfPresent("add").orElse(emptyList()));<NEW_LINE>usersToRemove.addAll(reader.readStringArrayIfPresent("remove").orElse(emptyList()));<NEW_LINE>});<NEW_LINE>operations.optJsonObject("roles").ifPresent(reader -> {<NEW_LINE>rolesToAdd.addAll(reader.readStringArrayIfPresent("add").orElse(emptyList()));<NEW_LINE>rolesToRemove.addAll(reader.readStringArrayIfPresent("remove").orElse(emptyList()));<NEW_LINE>});<NEW_LINE>return new BulkUpdateRequest(usersToAdd, usersToRemove, rolesToAdd, rolesToRemove);<NEW_LINE>}
usersToRemove = new ArrayList<>();
1,728,785
public synchronized SystemInfo execute() {<NEW_LINE>SystemInfo systemInfo = new SystemInfo();<NEW_LINE>systemInfo.setCollectTime(System.currentTimeMillis());<NEW_LINE>try {<NEW_LINE>BandWidth networkUsage = getNetworkUsage();<NEW_LINE>BandWidth bandWidth = networkUsage.adjust(prev.getBandWidth());<NEW_LINE>systemInfo.setBandWidth(bandWidth);<NEW_LINE>systemInfo.setCpuUsedPercentage(getCpuUsedPercentage());<NEW_LINE>systemInfo.setTotalMemory(getTotalMemory() / 1024L);<NEW_LINE>systemInfo.setFreeMemory(getAvailableMemory() / 1024L);<NEW_LINE>systemInfo.setSystem(isWindows() ? SystemInfo.System.WINDOW : SystemInfo.System.LINUX);<NEW_LINE>systemInfo.setCustomValues(getCustomMonitorData());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOGGER.error(<MASK><NEW_LINE>LOGGER.debug("Error trace is ", e);<NEW_LINE>}<NEW_LINE>prev = systemInfo;<NEW_LINE>return systemInfo;<NEW_LINE>}
"Error while getting system perf data: {}", e.getMessage());
779,409
public <A> SimpleGaussianContinuousUncertainObject newFeatureVector(Random rand, A array, NumberArrayAdapter<?, A> adapter) {<NEW_LINE>final int dim = adapter.size(array);<NEW_LINE>double[] min = new double[dim], max = new double[dim];<NEW_LINE>if (symmetric) {<NEW_LINE>for (int i = 0; i < dim; ++i) {<NEW_LINE>double v = adapter.getDouble(array, i);<NEW_LINE>double width = rand.nextDouble() <MASK><NEW_LINE>min[i] = v - width;<NEW_LINE>max[i] = v + width;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < dim; ++i) {<NEW_LINE>// Choose standard deviation<NEW_LINE>final double s = rand.nextDouble() * (maxDev - minDev) + minDev;<NEW_LINE>// Assume our center is off by a standard deviation of s.<NEW_LINE>double v = adapter.getDouble(array, i) + rand.nextGaussian() * s;<NEW_LINE>min[i] = v - s;<NEW_LINE>max[i] = v + s;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SimpleGaussianContinuousUncertainObject(new HyperBoundingBox(min, max));<NEW_LINE>}
* (maxDev - minDev) + minDev;
808,811
final GetControlResult executeGetControl(GetControlRequest getControlRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getControlRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetControlRequest> request = null;<NEW_LINE>Response<GetControlResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetControlRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getControlRequest));<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, "AuditManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetControl");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetControlResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetControlResultJsonUnmarshaller());<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);
787,071
public void deleteQueueForStream(InlongGroupInfo groupInfo, InlongStreamInfo streamInfo, String operator) {<NEW_LINE>Preconditions.checkNotNull(groupInfo, "inlong group info cannot be null");<NEW_LINE>Preconditions.checkNotNull(streamInfo, "inlong stream info cannot be null");<NEW_LINE>String groupId = streamInfo.getInlongGroupId();<NEW_LINE>String streamId = streamInfo.getInlongStreamId();<NEW_LINE>log.info("begin to delete pulsar resource for groupId={} streamId={}", groupId, streamId);<NEW_LINE>try {<NEW_LINE>ClusterInfo clusterInfo = clusterService.getOne(groupInfo.getInlongClusterTag(), null, ClusterType.PULSAR);<NEW_LINE>this.deletePulsarTopic(groupInfo, (PulsarClusterInfo) clusterInfo, streamInfo.getMqResource());<NEW_LINE>log.info("success to delete pulsar topic for groupId={}, streamId={}", groupId, streamId);<NEW_LINE>} catch (Exception e) {<NEW_LINE>String msg = String.format("failed to delete pulsar topic for groupId=%s, streamId=%s", groupId, streamId);<NEW_LINE>log.error(msg, e);<NEW_LINE>throw new WorkflowListenerException(msg);<NEW_LINE>}<NEW_LINE>log.<MASK><NEW_LINE>}
info("success to delete pulsar resource for groupId={}, streamId={}", groupId, streamId);
1,604,034
public void marshall(EventsBatch eventsBatch, AwsJsonWriter jsonWriter) throws Exception {<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (eventsBatch.getEndpoint() != null) {<NEW_LINE>PublicEndpoint endpoint = eventsBatch.getEndpoint();<NEW_LINE>jsonWriter.name("Endpoint");<NEW_LINE>PublicEndpointJsonMarshaller.getInstance().marshall(endpoint, jsonWriter);<NEW_LINE>}<NEW_LINE>if (eventsBatch.getEvents() != null) {<NEW_LINE>java.util.Map<String, Event> events = eventsBatch.getEvents();<NEW_LINE>jsonWriter.name("Events");<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>for (java.util.Map.Entry<String, Event> eventsEntry : events.entrySet()) {<NEW_LINE>Event eventsValue = eventsEntry.getValue();<NEW_LINE>if (eventsValue != null) {<NEW_LINE>jsonWriter.name(eventsEntry.getKey());<NEW_LINE>EventJsonMarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>}
).marshall(eventsValue, jsonWriter);
270,205
/* Build call for throttlingPoliciesApplicationPolicyIdPut */<NEW_LINE>private com.squareup.okhttp.Call throttlingPoliciesApplicationPolicyIdPutCall(String policyId, ApplicationThrottlePolicy body, String contentType, String ifMatch, String ifUnmodifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/throttling/policies/application/{policyId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "policyId" + "\\}", apiClient.escapeString(policyId.toString()));<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (contentType != null)<NEW_LINE>localVarHeaderParams.put("Content-Type", apiClient.parameterToString(contentType));<NEW_LINE>if (ifMatch != null)<NEW_LINE>localVarHeaderParams.put("If-Match", apiClient.parameterToString(ifMatch));<NEW_LINE>if (ifUnmodifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Unmodified-Since", apiClient.parameterToString(ifUnmodifiedSince));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
= new ArrayList<Pair>();
862,807
public RelWriter explainTermsForDisplay(RelWriter pw) {<NEW_LINE>pw.item(RelDrdsWriter.REL_NAME, "SortWindow");<NEW_LINE>int inputFieldCount = getInput().getRowType().getFieldCount();<NEW_LINE>for (Ord<RelDataTypeField> field : Ord.zip(getInput().getRowType().getFieldList())) {<NEW_LINE>String fieldName = getRowType().getFieldList().get(field.i).getName();<NEW_LINE>if (fieldName == null) {<NEW_LINE>fieldName = "field#" + field.i;<NEW_LINE>}<NEW_LINE>pw.item(fieldName, field.e.getName());<NEW_LINE>}<NEW_LINE>for (Ord<Group> window : Ord.zip(groups)) {<NEW_LINE>for (int i = 0; i < window.getValue().aggCalls.size(); i++) {<NEW_LINE>RexWinAggCall rexWinAggCall = window.getValue().aggCalls.get(i);<NEW_LINE>String fieldName = "f" + (i + inputFieldCount) + "w" + window.i + "$o" + i;<NEW_LINE>pw.item(fieldName, "window#" + window.i + rexWinAggCall.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringBuffer windowInfo = new StringBuffer();<NEW_LINE>for (Ord<Group> window : Ord.zip(groups)) {<NEW_LINE>windowInfo.append("window#" + window.i).append("=").append(window.e.toString()).append(",");<NEW_LINE>}<NEW_LINE>pw.item("Reference Windows", windowInfo.toString().substring(0, windowInfo.length() - 1));<NEW_LINE>pw.itemIf("constants", constants.toString(), constants != null && <MASK><NEW_LINE>return pw;<NEW_LINE>}
constants.size() > 0);
114,543
public void uncaughtException(Thread thread, final Throwable arg1) {<NEW_LINE>Log.e("AndroidRuntime", getErrorInfo(arg1));<NEW_LINE>new Thread() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>super.run();<NEW_LINE>Looper.prepare();<NEW_LINE>String errorinfo = getErrorInfo(arg1);<NEW_LINE>String[] ss = errorinfo.split("\n\t");<NEW_LINE>String headstring = ss[0] + "\n\t" + ss[1] + "\n\t" + ss[2];<NEW_LINE>if (headstring.length() > 255) {<NEW_LINE>headstring = headstring.substring(0, 255) + "\n\t";<NEW_LINE>} else {<NEW_LINE>headstring = headstring + "\n\t";<NEW_LINE>}<NEW_LINE>stacktrace = headstring + errorinfo;<NEW_LINE>activities = CommonUtil.getActivityName(context);<NEW_LINE>time = DeviceInfo.getDeviceTime();<NEW_LINE>appkey = AppInfo.getAppKey(context);<NEW_LINE>os_version = DeviceInfo.getOsVersion();<NEW_LINE>JSONObject errorInfo = getErrorInfoJSONString(context);<NEW_LINE>CobubLog.i(UmsConstants.LOG_TAG, MyCrashHandler.class, errorinfo);<NEW_LINE>CommonUtil.saveInfoToFile("errorInfo", errorInfo, context);<NEW_LINE>android.os.Process.killProcess(android.<MASK><NEW_LINE>Looper.loop();<NEW_LINE>}<NEW_LINE>}.start();<NEW_LINE>}
os.Process.myPid());
633,977
void updateHub(Graph graph, double[] newValues, double[] authValues, boolean isDirected, Map<Node, Integer> indices) {<NEW_LINE>double norm = 0;<NEW_LINE>for (Node p : indices.keySet()) {<NEW_LINE>double hub = 0;<NEW_LINE>EdgeIterable edge_iter;<NEW_LINE>if (isDirected) {<NEW_LINE>edge_iter = ((DirectedGraph<MASK><NEW_LINE>} else {<NEW_LINE>edge_iter = graph.getEdges(p);<NEW_LINE>}<NEW_LINE>for (Edge edge : edge_iter) {<NEW_LINE>if (!edge.isSelfLoop()) {<NEW_LINE>Node r = graph.getOpposite(p, edge);<NEW_LINE>hub += authValues[indices.get(r)];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newValues[indices.get(p)] = hub;<NEW_LINE>norm += hub * hub;<NEW_LINE>if (isCanceled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>norm = Math.sqrt(norm);<NEW_LINE>if (norm > 0) {<NEW_LINE>for (int i = 0; i < newValues.length; i++) {<NEW_LINE>newValues[i] = newValues[i] / norm;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) graph).getOutEdges(p);
1,150,869
public void alert(Anomaly anomaly, boolean autoFixTriggered, long selfHealingStartTime, AnomalyType anomalyType) {<NEW_LINE>super.alert(anomaly, autoFixTriggered, selfHealingStartTime, anomalyType);<NEW_LINE>if (_msTeamsWebhook == null) {<NEW_LINE>LOG.warn("MSTeams webhook is null, can't send MSTeams self healing notification");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, String> facts = new HashMap<>(Map.of("Anomaly type", anomalyType.toString(), "Anomaly", anomaly.toString(), "Self Healing enabled", Boolean.toString(_selfHealingEnabled.get(anomalyType)), "Auto fix triggered", Boolean.toString(autoFixTriggered)));<NEW_LINE>if (_selfHealingEnabled.get(anomalyType)) {<NEW_LINE>facts.put<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>sendMSTeamsMessage(new MSTeamsMessage(facts), _msTeamsWebhook);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.warn("ERROR sending alert to MSTeams", e);<NEW_LINE>}<NEW_LINE>}
("Self Healing start time", utcDateFor(selfHealingStartTime));
794,267
public int encryptData(byte[] buff, int start, int len) throws ZipException {<NEW_LINE>if (finished) {<NEW_LINE>// A non 16 byte block has already been passed to encrypter<NEW_LINE>// non 16 byte block should be the last block of compressed data in AES encryption<NEW_LINE>// any more encryption will lead to corruption of data<NEW_LINE>throw new ZipException("AES Encrypter is in finished state (A non 16 byte block has already been passed to encrypter)");<NEW_LINE>}<NEW_LINE>if (len % 16 != 0) {<NEW_LINE>this.finished = true;<NEW_LINE>}<NEW_LINE>for (int j = start; j < (start + len); j += AES_BLOCK_SIZE) {<NEW_LINE>loopCount = (j + AES_BLOCK_SIZE <= (start + len)) ? AES_BLOCK_SIZE : ((start + len) - j);<NEW_LINE>prepareBuffAESIVBytes(iv, nonce);<NEW_LINE>aesEngine.processBlock(iv, counterBlock);<NEW_LINE>for (int k = 0; k < loopCount; k++) {<NEW_LINE>buff[j + k] = (byte) (buff[j + k] ^ counterBlock[k]);<NEW_LINE>}<NEW_LINE>mac.<MASK><NEW_LINE>nonce++;<NEW_LINE>}<NEW_LINE>return len;<NEW_LINE>}
update(buff, j, loopCount);
1,350,618
private int sendRedirects(final ArrayList<ClusterSession> redirectSessions, final long nowNs) {<NEW_LINE>int workCount = 0;<NEW_LINE>for (int lastIndex = redirectSessions.size() - 1, i = lastIndex; i >= 0; i--) {<NEW_LINE>final ClusterSession session = redirectSessions.get(i);<NEW_LINE>final EventCode eventCode = EventCode.REDIRECT;<NEW_LINE>final <MASK><NEW_LINE>if ((session.isResponsePublicationConnected(aeron, nowNs) && egressPublisher.sendEvent(session, leadershipTermId, leaderId, eventCode, ingressEndpoints)) || (session.state() != INIT && nowNs > (session.timeOfLastActivityNs() + sessionTimeoutNs)) || session.state() == INVALID) {<NEW_LINE>ArrayListUtil.fastUnorderedRemove(redirectSessions, i, lastIndex--);<NEW_LINE>session.close(aeron, ctx.countedErrorHandler());<NEW_LINE>workCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return workCount;<NEW_LINE>}
int leaderId = leaderMember.id();
116,962
protected void initListeners() {<NEW_LINE>super.initListeners();<NEW_LINE>binding.detailTitleRootLayout.setOnClickListener(this);<NEW_LINE>binding.detailTitleRootLayout.setOnLongClickListener(this);<NEW_LINE>binding.detailUploaderRootLayout.setOnClickListener(this);<NEW_LINE>binding.detailUploaderRootLayout.setOnLongClickListener(this);<NEW_LINE>binding.detailThumbnailRootLayout.setOnClickListener(this);<NEW_LINE>binding.detailControlsBackground.setOnClickListener(this);<NEW_LINE>binding.detailControlsBackground.setOnLongClickListener(this);<NEW_LINE>binding.detailControlsPopup.setOnClickListener(this);<NEW_LINE>binding.detailControlsPopup.setOnLongClickListener(this);<NEW_LINE>binding.detailControlsPlaylistAppend.setOnClickListener(this);<NEW_LINE>binding.detailControlsDownload.setOnClickListener(this);<NEW_LINE>binding.detailControlsDownload.setOnLongClickListener(this);<NEW_LINE>binding.detailControlsShare.setOnClickListener(this);<NEW_LINE>binding.detailControlsOpenInBrowser.setOnClickListener(this);<NEW_LINE>binding.detailControlsPlayWithKodi.setOnClickListener(this);<NEW_LINE>if (DEBUG) {<NEW_LINE>binding.detailControlsCrashThePlayer.setOnClickListener(v -> VideoDetailPlayerCrasher.onCrashThePlayer(this.getContext(), this.player, getLayoutInflater()));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>binding.overlayThumbnail.setOnLongClickListener(this);<NEW_LINE>binding.overlayMetadataLayout.setOnClickListener(this);<NEW_LINE>binding.overlayMetadataLayout.setOnLongClickListener(this);<NEW_LINE>binding.overlayButtonsLayout.setOnClickListener(this);<NEW_LINE>binding.overlayCloseButton.setOnClickListener(this);<NEW_LINE>binding.overlayPlayPauseButton.setOnClickListener(this);<NEW_LINE>binding.detailControlsBackground.setOnTouchListener(getOnControlsTouchListener());<NEW_LINE>binding.detailControlsPopup.setOnTouchListener(getOnControlsTouchListener());<NEW_LINE>binding.appBarLayout.addOnOffsetChangedListener((layout, verticalOffset) -> {<NEW_LINE>// prevent useless updates to tab layout visibility if nothing changed<NEW_LINE>if (verticalOffset != lastAppBarVerticalOffset) {<NEW_LINE>lastAppBarVerticalOffset = verticalOffset;<NEW_LINE>// the view was scrolled<NEW_LINE>updateTabLayoutVisibility();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>setupBottomPlayer();<NEW_LINE>if (!playerHolder.isBound()) {<NEW_LINE>setHeightThumbnail();<NEW_LINE>} else {<NEW_LINE>playerHolder.startService(false, this);<NEW_LINE>}<NEW_LINE>}
binding.overlayThumbnail.setOnClickListener(this);
434,107
public static void main(String[] args) throws IOException {<NEW_LINE>// Model converters will be loaded based on naming convention.<NEW_LINE>// Previously it would be loaded through ServiceLoader.load,<NEW_LINE>// which is still an option if dsljson.configuration name is specified.<NEW_LINE>// DSL-JSON loads all services registered into META-INF/services<NEW_LINE>// and falls back to naming based convention of package._NAME_DslJsonConfiguration if not found<NEW_LINE>// Annotation processor will run by default and generate descriptions for JSON encoding/decoding<NEW_LINE>// To include Jackson annotations dsljson.jackson=true must be passed to annotation processor<NEW_LINE>// When conversion is not fully supported by compiler Settings.basicSetup() can be enabled to support runtime analysis<NEW_LINE>// for features not registered by annotation processor. Currently it is enabled due to use of Set and Vector<NEW_LINE>DslJson<Object> dslJson = new DslJson<>(Settings.basicSetup());<NEW_LINE>Model instance = new Model();<NEW_LINE>instance.string = "Hello World!";<NEW_LINE>instance.integers = Arrays.asList(1, 2, 3);<NEW_LINE>instance.decimals = new HashSet<>(Arrays.asList(BigDecimal.ONE, BigDecimal.ZERO));<NEW_LINE>instance.uuids = new UUID[] { new UUID(1L, 2L), new UUID(3L, 4L) };<NEW_LINE>instance.longs = new Vector<>(Arrays.asList(1L, 2L));<NEW_LINE>instance.inheritance = new Model.ParentClass();<NEW_LINE>instance.inheritance.a = 5;<NEW_LINE>instance.inheritance.b = 6;<NEW_LINE>instance.iface = new Model.WithCustomCtor(5, 6);<NEW_LINE>instance.person = new <MASK><NEW_LINE>instance.states = Arrays.asList(Model.State.HI, Model.State.LOW);<NEW_LINE>instance.jsonObject = new Model.JsonObjectReference(43, "abcd");<NEW_LINE>instance.jsonObjects = Collections.singletonList(new Model.JsonObjectReference(34, "dcba"));<NEW_LINE>instance.intList = new ArrayList<>(Arrays.asList(123, 456));<NEW_LINE>instance.map = new HashMap<>();<NEW_LINE>instance.map.put("abc", 678);<NEW_LINE>instance.map.put("array", new int[] { 2, 4, 8 });<NEW_LINE>instance.factories = Arrays.asList(null, Model.ViaFactory.create("me", 2), Model.ViaFactory.create("you", 3), null);<NEW_LINE>instance.builder = PersonBuilder.builder().firstName("first").lastName("last").age(42).build();<NEW_LINE>ByteArrayOutputStream os = new ByteArrayOutputStream();<NEW_LINE>dslJson.serialize(instance, os);<NEW_LINE>System.out.println(os);<NEW_LINE>ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());<NEW_LINE>// deserialization using Stream API<NEW_LINE>Model deser = dslJson.deserialize(Model.class, is);<NEW_LINE>System.out.println(deser.string);<NEW_LINE>}
ImmutablePerson("first name", "last name", 35);
1,208,378
private void init(Hashtable toCopy) {<NEW_LINE>type = (String) toCopy.get("type");<NEW_LINE>attribution = (String) toCopy.get("attribution");<NEW_LINE>message = (String) toCopy.get("message");<NEW_LINE>linkUrl = (String) toCopy.get("link");<NEW_LINE>linkDescription = (String) toCopy.get("description");<NEW_LINE>Hashtable cmnts = (Hashtable) toCopy.get("comments");<NEW_LINE>if (cmnts != null) {<NEW_LINE>commentsCount = (String) cmnts.get("count");<NEW_LINE>}<NEW_LINE>Hashtable f = (Hashtable) toCopy.get("from");<NEW_LINE>if (f != null) {<NEW_LINE>from.copy(f);<NEW_LINE>}<NEW_LINE>Hashtable toUsers = (Hashtable) toCopy.get("to");<NEW_LINE>if (toUsers != null) {<NEW_LINE>Vector toUsersArray = (Vector) toUsers.get("data");<NEW_LINE>if (toUsersArray != null) {<NEW_LINE>to = new Vector();<NEW_LINE>for (int i = 0; i < toUsersArray.size(); i++) {<NEW_LINE>Hashtable u = (Hashtable) toUsersArray.elementAt(i);<NEW_LINE>User toUser = new User();<NEW_LINE>toUser.copy(u);<NEW_LINE>to.addElement(toUser);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>created_time = (String) toCopy.get("created_time");<NEW_LINE>picture = (String) toCopy.get("picture");<NEW_LINE>Object <MASK><NEW_LINE>if (likesObj != null) {<NEW_LINE>if (likesObj instanceof Hashtable) {<NEW_LINE>likes = (String) ((Hashtable) likesObj).get("count");<NEW_LINE>} else {<NEW_LINE>likes = likesObj.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
likesObj = toCopy.get("likes");
1,574,311
protected boolean handleResourceRequest(HttpServletResponse theResponse, ServletRequestDetails theRequestDetails, String requestPath) throws IOException {<NEW_LINE>if (requestPath.equals("/swagger-ui/") || requestPath.equals("/swagger-ui/index.html")) {<NEW_LINE>serveSwaggerUiHtml(theRequestDetails, theResponse);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>String resourceClasspath = myResourcePathToClasspath.get(requestPath);<NEW_LINE>if (resourceClasspath != null) {<NEW_LINE>theResponse.setStatus(200);<NEW_LINE>String extension = requestPath.substring(requestPath.lastIndexOf('.'));<NEW_LINE>String contentType = myExtensionToContentType.get(extension);<NEW_LINE>assert contentType != null;<NEW_LINE>theResponse.setContentType(contentType);<NEW_LINE>try (InputStream resource = ClasspathUtil.loadResourceAsStream(resourceClasspath)) {<NEW_LINE>IOUtils.copy(resource, theResponse.getOutputStream());<NEW_LINE>theResponse.getOutputStream().close();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>String resourcePath = requestPath.<MASK><NEW_LINE>try (InputStream resource = ClasspathUtil.loadResourceAsStream("/META-INF/resources/webjars/swagger-ui/" + mySwaggerUiVersion + "/" + resourcePath)) {<NEW_LINE>if (resourcePath.endsWith(".js") || resourcePath.endsWith(".map")) {<NEW_LINE>theResponse.setContentType("application/javascript");<NEW_LINE>theResponse.setStatus(200);<NEW_LINE>IOUtils.copy(resource, theResponse.getOutputStream());<NEW_LINE>theResponse.getOutputStream().close();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (resourcePath.endsWith(".css")) {<NEW_LINE>theResponse.setContentType("text/css");<NEW_LINE>theResponse.setStatus(200);<NEW_LINE>IOUtils.copy(resource, theResponse.getOutputStream());<NEW_LINE>theResponse.getOutputStream().close();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (resourcePath.endsWith(".html")) {<NEW_LINE>theResponse.setContentType(Constants.CT_HTML);<NEW_LINE>theResponse.setStatus(200);<NEW_LINE>IOUtils.copy(resource, theResponse.getOutputStream());<NEW_LINE>theResponse.getOutputStream().close();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
substring("/swagger-ui/".length());
1,375,435
private void exportTemplateAccounts(XmlSerializer xmlSerializer, Collection<Account> accountList) throws IOException {<NEW_LINE>for (Account account : accountList) {<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_ACCOUNT);<NEW_LINE>xmlSerializer.attribute(null, GncXmlHelper.ATTR_KEY_VERSION, GncXmlHelper.BOOK_VERSION);<NEW_LINE>// account name<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_ACCT_NAME);<NEW_LINE>xmlSerializer.text(account.getName());<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_ACCT_NAME);<NEW_LINE>// account guid<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_ACCT_ID);<NEW_LINE>xmlSerializer.attribute(null, GncXmlHelper.ATTR_KEY_TYPE, GncXmlHelper.ATTR_VALUE_GUID);<NEW_LINE>xmlSerializer.text(account.getUID());<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_ACCT_ID);<NEW_LINE>// account type<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_ACCT_TYPE);<NEW_LINE>xmlSerializer.text(account.getAccountType().name());<NEW_LINE>xmlSerializer.<MASK><NEW_LINE>// commodity<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_ACCT_COMMODITY);<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_COMMODITY_SPACE);<NEW_LINE>xmlSerializer.text("template");<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_COMMODITY_SPACE);<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_COMMODITY_ID);<NEW_LINE>String acctCurrencyCode = "template";<NEW_LINE>xmlSerializer.text(acctCurrencyCode);<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_COMMODITY_ID);<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_ACCT_COMMODITY);<NEW_LINE>// commodity scu<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_COMMODITY_SCU);<NEW_LINE>xmlSerializer.text("1");<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_COMMODITY_SCU);<NEW_LINE>if (account.getAccountType() != AccountType.ROOT && mRootTemplateAccount != null) {<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_PARENT_UID);<NEW_LINE>xmlSerializer.attribute(null, GncXmlHelper.ATTR_KEY_TYPE, GncXmlHelper.ATTR_VALUE_GUID);<NEW_LINE>xmlSerializer.text(mRootTemplateAccount.getUID());<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_PARENT_UID);<NEW_LINE>}<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_ACCOUNT);<NEW_LINE>}<NEW_LINE>}
endTag(null, GncXmlHelper.TAG_ACCT_TYPE);
1,675,249
private // wayne 10<NEW_LINE>void rangeLookupCSV(String[] args) {<NEW_LINE>String filePath = Constants.FILES_PATH + args[0];<NEW_LINE>In in = new In(filePath);<NEW_LINE>int keyField = Integer.parseInt(args[1]);<NEW_LINE>int valueField = Integer<MASK><NEW_LINE>RedBlackBST<String, String> symbolTable = new RedBlackBST<>();<NEW_LINE>while (in.hasNextLine()) {<NEW_LINE>String line = in.readLine();<NEW_LINE>String[] tokens = line.split(",");<NEW_LINE>String key = tokens[keyField];<NEW_LINE>String value = tokens[valueField];<NEW_LINE>symbolTable.put(key, value);<NEW_LINE>}<NEW_LINE>while (!StdIn.isEmpty()) {<NEW_LINE>String queryKey1 = StdIn.readString();<NEW_LINE>String queryKey2 = StdIn.readString();<NEW_LINE>for (String key : symbolTable.keys(queryKey1, queryKey2)) {<NEW_LINE>StdOut.println(key + " " + symbolTable.get(key));<NEW_LINE>}<NEW_LINE>StdOut.println();<NEW_LINE>}<NEW_LINE>}
.parseInt(args[2]);
375,791
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create window MyWindowVS#keepall as select * from VarStream", path);<NEW_LINE>env.compileDeploy("@name('window') @public create window MyWindowVSTwo#keepall as MyWindowVS", path);<NEW_LINE>env.compileDeploy("insert into VarStream select * from SupportBean_A", path);<NEW_LINE>env.compileDeploy("insert into VarStream select * from SupportBean_B", path);<NEW_LINE>env.compileDeploy("insert into MyWindowVSTwo select * from VarStream", path);<NEW_LINE>env.<MASK><NEW_LINE>env.sendEventBean(new SupportBean_B("B1"));<NEW_LINE>env.assertIterator("window", iterator -> {<NEW_LINE>EventBean[] events = EPAssertionUtil.iteratorToArray(iterator);<NEW_LINE>assertEquals("A1", events[0].get("id?"));<NEW_LINE>});<NEW_LINE>env.assertPropsPerRowIterator("window", "id?".split(","), new Object[][] { { "A1" }, { "B1" } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
sendEventBean(new SupportBean_A("A1"));
1,077,533
public InlineResponse200 leaderboardGetName() throws TimeoutException, ExecutionException, InterruptedException, ApiException {<NEW_LINE>Object postBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/leaderboard/name";<NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams <MASK><NEW_LINE>// header params<NEW_LINE>Map<String, String> headerParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> formParams = new HashMap<String, String>();<NEW_LINE>String[] contentTypes = { "application/json", "application/x-www-form-urlencoded" };<NEW_LINE>String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";<NEW_LINE>if (contentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE>HttpEntity httpEntity = localVarBuilder.build();<NEW_LINE>postBody = httpEntity;<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>String[] authNames = new String[] { "apiExpires", "apiKey", "apiSignature" };<NEW_LINE>try {<NEW_LINE>String localVarResponse = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);<NEW_LINE>if (localVarResponse != null) {<NEW_LINE>return (InlineResponse200) ApiInvoker.deserialize(localVarResponse, "", InlineResponse200.class);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>if (ex.getCause() instanceof VolleyError) {<NEW_LINE>VolleyError volleyError = (VolleyError) ex.getCause();<NEW_LINE>if (volleyError.networkResponse != null) {<NEW_LINE>throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>} catch (TimeoutException ex) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}
= new ArrayList<Pair>();
292,880
public <T2, R1, R2, R3, R> Maybe<Active<W, R>> forEach4(final Function<? super T, ? extends Higher<W, R1>> value1, final BiFunction<? super T, ? super R1, ? extends Higher<W, R2>> value2, final Function3<? super T, ? super R1, ? super R2, ? extends Higher<W, R3>> value3, final Function4<? super T, ? super R1, ? super R2, ? super R3, Boolean> filterFunction, final Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction) {<NEW_LINE>if (!def1.monadZero().isPresent())<NEW_LINE>return Maybe.nothing();<NEW_LINE>MonadZero<W> mZero = def1.<MASK><NEW_LINE>return Maybe.just(of(Comprehensions.of(mZero).forEach4(this.single, value1, value2, value3, filterFunction, yieldingFunction), def1));<NEW_LINE>}
monadZero().orElse(null);
1,315,190
private PulsarSerializationSchema<RowData> createPulsarSerializer(SerializationSchema<RowData> keySerialization, SerializationSchema<RowData> valueSerialization) {<NEW_LINE>final List<LogicalType> physicalChildren = physicalDataType.getLogicalType().getChildren();<NEW_LINE>final RowData.FieldGetter[] keyFieldGetters = Arrays.stream(keyProjection).mapToObj(targetField -> RowData.createFieldGetter(physicalChildren.get(targetField), targetField)).toArray(RowData.FieldGetter[]::new);<NEW_LINE>final RowData.FieldGetter[] valueFieldGetters = Arrays.stream(valueProjection).mapToObj(targetField -> RowData.createFieldGetter(physicalChildren.get(targetField), targetField)).toArray(RowData.FieldGetter[]::new);<NEW_LINE>// determine the positions of metadata in the consumed row<NEW_LINE>final int[] metadataPositions = Stream.of(WritableMetadata.values()).mapToInt(m -> {<NEW_LINE>final int pos = metadataKeys.indexOf(m.key);<NEW_LINE>if (pos < 0) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return physicalChildren.size() + pos;<NEW_LINE>}).toArray();<NEW_LINE>// check if metadata is used at all<NEW_LINE>final boolean hasMetadata = metadataKeys.size() > 0;<NEW_LINE>final long delayMilliseconds = Optional.ofNullable(this.properties.getProperty(PulsarOptions.SEND_DELAY_MILLISECONDS, "0")).filter(StringUtils::isNumeric).map(Long::valueOf).orElse(0L);<NEW_LINE>return new DynamicPulsarSerializationSchema(keySerialization, valueSerialization, keyFieldGetters, valueFieldGetters, hasMetadata, metadataPositions, upsertMode, DataTypeUtils.projectRow(physicalDataType<MASK><NEW_LINE>}
, valueProjection), formatType, delayMilliseconds);
835,427
protected void insertSetContextCalls(InstructionGroup group, int localVarIx) {<NEW_LINE>InsnList instructions = group.getInstructions();<NEW_LINE>for (InstructionGraphNode node : group.getNodes()) {<NEW_LINE>if (node.isCallOnContextAware()) {<NEW_LINE>AbstractInsnNode insn = node.getInstruction();<NEW_LINE>if (node.getPredecessors().size() > 1) {<NEW_LINE>// store the target of the call in a new local variable<NEW_LINE>AbstractInsnNode loadTarget = node.getPredecessors().get(0).getInstruction();<NEW_LINE>instructions.insert(loadTarget, new VarInsnNode(ASTORE, ++localVarIx));<NEW_LINE>// the DUP is inserted BEFORE the ASTORE<NEW_LINE>instructions.insert(loadTarget, new InsnNode(DUP));<NEW_LINE>// immediately before the call get the target from the local var and set the context on it<NEW_LINE>instructions.insertBefore(insn, <MASK><NEW_LINE>} else {<NEW_LINE>// if we have only one predecessor the call does not take any parameters and we can<NEW_LINE>// skip the storing and loading of the invocation target<NEW_LINE>instructions.insertBefore(insn, new InsnNode(DUP));<NEW_LINE>}<NEW_LINE>instructions.insertBefore(insn, new VarInsnNode(ALOAD, 1));<NEW_LINE>instructions.insertBefore(insn, new MethodInsnNode(INVOKEINTERFACE, Types.CONTEXT_AWARE.getInternalName(), "setContext", "(" + Types.CONTEXT_DESC + ")V", true));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new VarInsnNode(ALOAD, localVarIx));
752,690
public boolean performOk() {<NEW_LINE>TextProxy.service.setLimit(CastUtil.cint(service.getText()));<NEW_LINE>TextProxy.sql.setLimit(CastUtil.cint(sql.getText()));<NEW_LINE>TextProxy.method.setLimit(CastUtil.cint(method.getText()));<NEW_LINE>TextProxy.error.setLimit(CastUtil.cint(error.getText()));<NEW_LINE>TextProxy.apicall.setLimit(CastUtil.cint<MASK><NEW_LINE>TextProxy.object.setLimit(CastUtil.cint(object.getText()));<NEW_LINE>TextProxy.referer.setLimit(CastUtil.cint(referer.getText()));<NEW_LINE>TextProxy.userAgent.setLimit(CastUtil.cint(userAgent.getText()));<NEW_LINE>TextProxy.group.setLimit(CastUtil.cint(group.getText()));<NEW_LINE>TextProxy.sql_tables.setLimit(CastUtil.cint(sql_tables.getText()));<NEW_LINE>return true;<NEW_LINE>}
(subcall.getText()));
719,872
void vex3(Instruction instruction) {<NEW_LINE>if ((((state_zs_flags & StateFlags.HAS_REX) | state_zs_mandatoryPrefix) & invalidCheckMask) != 0)<NEW_LINE>setInvalidInstruction();<NEW_LINE>state_zs_flags &= ~StateFlags.W;<NEW_LINE>int b2 = readByte();<NEW_LINE>state_zs_flags |= b2 & 0x80;<NEW_LINE>state_vectorLength = (b2 >>> 2) & 1;<NEW_LINE>state_zs_mandatoryPrefix = (byte) (b2 & 3);<NEW_LINE>b2 = (~<MASK><NEW_LINE>state_vvvv_invalidCheck = b2;<NEW_LINE>state_vvvv = b2 & reg15Mask;<NEW_LINE>int b1 = state_modrm;<NEW_LINE>int b1x = ~b1 & maskE0;<NEW_LINE>state_zs_extraRegisterBase = (b1x >>> 4) & 8;<NEW_LINE>state_zs_extraIndexRegisterBase = (b1x >>> 3) & 8;<NEW_LINE>state_zs_extraBaseRegisterBase = (b1x >>> 2) & 8;<NEW_LINE>OpCodeHandler[] handlers;<NEW_LINE>int b = readByte();<NEW_LINE>int table = b1 & 0x1F;<NEW_LINE>if (table == 1)<NEW_LINE>handlers = handlers_VEX_0F;<NEW_LINE>else if (table == 2)<NEW_LINE>handlers = handlers_VEX_0F38;<NEW_LINE>else if (table == 3)<NEW_LINE>handlers = handlers_VEX_0F3A;<NEW_LINE>else if (table == 0)<NEW_LINE>handlers = handlers_VEX_MAP0;<NEW_LINE>else {<NEW_LINE>setInvalidInstruction();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>decodeTable(handlers[b], instruction);<NEW_LINE>}
b2 >>> 3) & 0x0F;
982,905
public void onSensorChanged(SensorEvent event) {<NEW_LINE>// Attention : sensor produces a lot of events & can hang the system<NEW_LINE>if (inUpdateValue) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>if (!sensorRegistered) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>inUpdateValue = true;<NEW_LINE>try {<NEW_LINE>float val = 0;<NEW_LINE>switch(event.sensor.getType()) {<NEW_LINE>case Sensor.TYPE_ACCELEROMETER:<NEW_LINE>System.arraycopy(event.values, 0, mGravs, 0, 3);<NEW_LINE>break;<NEW_LINE>case Sensor.TYPE_MAGNETIC_FIELD:<NEW_LINE>System.arraycopy(event.values, 0, mGeoMags, 0, 3);<NEW_LINE>break;<NEW_LINE>case Sensor.TYPE_ORIENTATION:<NEW_LINE>case Sensor.TYPE_ROTATION_VECTOR:<NEW_LINE>val = event.values[0];<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>OsmandSettings settings = app.getSettings();<NEW_LINE>if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER || event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) {<NEW_LINE>boolean success = SensorManager.getRotationMatrix(mRotationM, null, mGravs, mGeoMags);<NEW_LINE>if (!success) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float[] orientation = SensorManager.getOrientation(<MASK><NEW_LINE>val = (float) Math.toDegrees(orientation[0]);<NEW_LINE>} else if (event.sensor.getType() == Sensor.TYPE_ROTATION_VECTOR) {<NEW_LINE>SensorManager.getRotationMatrixFromVector(mRotationM, event.values);<NEW_LINE>float[] orientation = SensorManager.getOrientation(mRotationM, new float[3]);<NEW_LINE>val = (float) Math.toDegrees(orientation[0]);<NEW_LINE>}<NEW_LINE>val = calcScreenOrientationCorrection(val);<NEW_LINE>val = calcGeoMagneticCorrection(val);<NEW_LINE>float valRad = (float) (val / 180f * Math.PI);<NEW_LINE>lastValSin = (float) Math.sin(valRad);<NEW_LINE>lastValCos = (float) Math.cos(valRad);<NEW_LINE>// lastHeadingCalcTime = System.currentTimeMillis();<NEW_LINE>boolean filter = settings.USE_KALMAN_FILTER_FOR_COMPASS.get();<NEW_LINE>if (filter) {<NEW_LINE>filterCompassValue();<NEW_LINE>} else {<NEW_LINE>avgValSin = lastValSin;<NEW_LINE>avgValCos = lastValCos;<NEW_LINE>}<NEW_LINE>heading = getAngle(avgValSin, avgValCos);<NEW_LINE>updateCompassVal();<NEW_LINE>} finally {<NEW_LINE>inUpdateValue = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
mRotationM, new float[3]);
1,704,574
public void paintChart(Graphics g) {<NEW_LINE>synchronized (ChartModelBase.STATIC_MUTEX) {<NEW_LINE>// GanttGraphicArea.super.paintComponent(g);<NEW_LINE>ChartModel model = myChartModel;<NEW_LINE>model.setBottomUnitWidth(getViewState().getBottomUnitWidth());<NEW_LINE>var rowHeight = Math.max(model.calculateRowHeight(), myTaskTableConnector.getMinRowHeight().getValue());<NEW_LINE>myTaskTableConnector.getRowHeight().setValue(rowHeight);<NEW_LINE>model.setRowHeight((int) Math.ceil(rowHeight));<NEW_LINE>model.setTopTimeUnit(getViewState().getTopTimeUnit());<NEW_LINE>model.setBottomTimeUnit(getViewState().getBottomTimeUnit());<NEW_LINE>List<Task<MASK><NEW_LINE>model.setVisibleTasks(visibleTasks);<NEW_LINE>myChartModel.setTimelineTasks(getUIFacade().getCurrentTaskView().getTimelineTasks());<NEW_LINE>model.paint(g);<NEW_LINE>if (getActiveInteraction() != null) {<NEW_LINE>getActiveInteraction().paint(g);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> visibleTasks = myTaskTableConnector.getVisibleTasks();
1,078,769
public AclSubject createFrom(final Subject subject) {<NEW_LINE>if (null == subject) {<NEW_LINE>throw new NullPointerException("subject is null");<NEW_LINE>}<NEW_LINE>Set<? extends Principal> userPrincipals = subject.getPrincipals(userType);<NEW_LINE>final String username;<NEW_LINE>if (userPrincipals.size() > 0) {<NEW_LINE>Principal usernamep = userPrincipals.iterator().next();<NEW_LINE>username = usernamep.getName();<NEW_LINE>} else {<NEW_LINE>username = null;<NEW_LINE>}<NEW_LINE>Set<? extends Principal> groupPrincipals = subject.getPrincipals(groupType);<NEW_LINE>final Set<String> groupNames = new HashSet<>();<NEW_LINE>if (groupPrincipals.size() > 0) {<NEW_LINE>for (Principal groupPrincipal : groupPrincipals) {<NEW_LINE>groupNames.add(groupPrincipal.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<? extends Principal> <MASK><NEW_LINE>final String urnNames;<NEW_LINE>if (urnsPrincipals.size() > 0) {<NEW_LINE>Principal urnName = urnsPrincipals.iterator().next();<NEW_LINE>urnNames = urnName.getName();<NEW_LINE>} else {<NEW_LINE>urnNames = null;<NEW_LINE>}<NEW_LINE>return new AclSubject() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getUsername() {<NEW_LINE>return username;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Set<String> getGroups() {<NEW_LINE>return groupNames;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getUrn() {<NEW_LINE>return urnNames;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
urnsPrincipals = subject.getPrincipals(urnType);
1,468,577
private void loadNode979() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_AddReferencesCount, new QualifiedName(0, "AddReferencesCount"), new LocalizedText("en", "AddReferencesCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.ServiceCounterDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_AddReferencesCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_AddReferencesCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_AddReferencesCount, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics.expanded(), false));<NEW_LINE><MASK><NEW_LINE>}
this.nodeManager.addNode(node);
257,099
CompletableFuture<PTable<ByteBuf, ByteBuf>> refreshRangeSpaces(HashStreamRanges newRanges) {<NEW_LINE>// compare the ranges to see if it requires an update<NEW_LINE><MASK><NEW_LINE>if (null != oldRanges && oldRanges.getMaxRangeId() >= newRanges.getMaxRangeId()) {<NEW_LINE>log.info("No new stream ranges found for stream {}.", streamName);<NEW_LINE>return FutureUtils.value(this);<NEW_LINE>}<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info("Updated the active ranges to {}", newRanges);<NEW_LINE>}<NEW_LINE>rangeRouter.setRanges(newRanges);<NEW_LINE>// add new ranges<NEW_LINE>Set<Long> activeRanges = Sets.newHashSetWithExpectedSize(newRanges.getRanges().size());<NEW_LINE>newRanges.getRanges().forEach((rk, range) -> {<NEW_LINE>activeRanges.add(range.getRangeId());<NEW_LINE>if (tableRanges.containsKey(range.getRangeId())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PTable<ByteBuf, ByteBuf> tableRange = trFactory.openTableRange(props, range, executor, opFactory, resultFactory, kvFactory);<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info("Create table range client for range {}", range.getRangeId());<NEW_LINE>}<NEW_LINE>this.tableRanges.put(range.getRangeId(), tableRange);<NEW_LINE>});<NEW_LINE>// remove old ranges<NEW_LINE>Iterator<Entry<Long, PTable<ByteBuf, ByteBuf>>> rsIter = tableRanges.entrySet().iterator();<NEW_LINE>while (rsIter.hasNext()) {<NEW_LINE>Map.Entry<Long, PTable<ByteBuf, ByteBuf>> entry = rsIter.next();<NEW_LINE>Long rid = entry.getKey();<NEW_LINE>if (activeRanges.contains(rid)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>rsIter.remove();<NEW_LINE>PTable oldRangeSpace = entry.getValue();<NEW_LINE>oldRangeSpace.close();<NEW_LINE>}<NEW_LINE>return FutureUtils.value(this);<NEW_LINE>}
HashStreamRanges oldRanges = rangeRouter.getRanges();
900,613
public void collectViewUpdates(JavaOnlyMap propsMap) {<NEW_LINE>for (Map.Entry<String, Integer> entry : mPropMapping.entrySet()) {<NEW_LINE>@Nullable<NEW_LINE>AnimatedNode node = mNativeAnimatedNodesManager.<MASK><NEW_LINE>if (node == null) {<NEW_LINE>throw new IllegalArgumentException("Mapped style node does not exists");<NEW_LINE>} else if (node instanceof TransformAnimatedNode) {<NEW_LINE>((TransformAnimatedNode) node).collectViewUpdates(propsMap);<NEW_LINE>} else if (node instanceof ValueAnimatedNode) {<NEW_LINE>propsMap.putDouble(entry.getKey(), ((ValueAnimatedNode) node).getValue());<NEW_LINE>} else if (node instanceof ColorAnimatedNode) {<NEW_LINE>propsMap.putInt(entry.getKey(), ((ColorAnimatedNode) node).getColor());<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported type of node used in property node " + node.getClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getNodeById(entry.getValue());
1,436,321
public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException {<NEW_LINE>SSLEngine engine;<NEW_LINE>SocketAddress remote = (SocketAddress) context.get(ClientConnector.REMOTE_SOCKET_ADDRESS_CONTEXT_KEY);<NEW_LINE>if (remote instanceof InetSocketAddress) {<NEW_LINE>InetSocketAddress inetRemote = (InetSocketAddress) remote;<NEW_LINE>String host = inetRemote.getHostString();<NEW_LINE>int port = inetRemote.getPort();<NEW_LINE>engine = sslContextFactory instanceof SslEngineFactory ? ((SslEngineFactory) sslContextFactory).newSslEngine(host, port, context) : sslContextFactory.newSSLEngine(host, port);<NEW_LINE>} else {<NEW_LINE>engine = sslContextFactory.newSSLEngine();<NEW_LINE>}<NEW_LINE>engine.setUseClientMode(true);<NEW_LINE><MASK><NEW_LINE>SslConnection sslConnection = newSslConnection(byteBufferPool, executor, endPoint, engine);<NEW_LINE>EndPoint appEndPoint = sslConnection.getDecryptedEndPoint();<NEW_LINE>appEndPoint.setConnection(connectionFactory.newConnection(appEndPoint, context));<NEW_LINE>sslConnection.addHandshakeListener(new HTTPSHandshakeListener(context));<NEW_LINE>customize(sslConnection, context);<NEW_LINE>return sslConnection;<NEW_LINE>}
context.put(SSL_ENGINE_CONTEXT_KEY, engine);
629,842
public PurchaseOrder purchaseOrderLineProcess(Invoice invoice, InvoiceLine invoiceLine) throws AxelorException {<NEW_LINE><MASK><NEW_LINE>if (purchaseOrderLine == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>PurchaseOrder purchaseOrder = purchaseOrderLine.getPurchaseOrder();<NEW_LINE>BigDecimal invoicedAmountToAdd = invoiceLine.getExTaxTotal();<NEW_LINE>// If is it a refund invoice, so we negate the amount invoiced<NEW_LINE>if (InvoiceToolService.isRefund(invoiceLine.getInvoice())) {<NEW_LINE>invoicedAmountToAdd = invoicedAmountToAdd.negate();<NEW_LINE>}<NEW_LINE>// Update invoiced amount on purchase order line<NEW_LINE>if (!invoice.getCurrency().equals(purchaseOrder.getCurrency()) && purchaseOrderLine.getCompanyExTaxTotal().compareTo(BigDecimal.ZERO) != 0) {<NEW_LINE>// If the purchase order currency is different from the invoice currency, use company currency<NEW_LINE>// to calculate a rate. This rate will be applied to purchase order line<NEW_LINE>BigDecimal currentCompanyInvoicedAmount = invoiceLine.getCompanyExTaxTotal();<NEW_LINE>BigDecimal rate = currentCompanyInvoicedAmount.divide(purchaseOrderLine.getCompanyExTaxTotal(), 4, RoundingMode.HALF_UP);<NEW_LINE>invoicedAmountToAdd = rate.multiply(purchaseOrderLine.getExTaxTotal());<NEW_LINE>}<NEW_LINE>purchaseOrderLine.setAmountInvoiced(purchaseOrderLine.getAmountInvoiced().subtract(invoicedAmountToAdd));<NEW_LINE>return purchaseOrder;<NEW_LINE>}
PurchaseOrderLine purchaseOrderLine = invoiceLine.getPurchaseOrderLine();
1,411,739
public NicIpConfigurationImpl primaryIPConfiguration() {<NEW_LINE>NicIpConfigurationImpl primaryIPConfig = null;<NEW_LINE>if (this.nicIPConfigurations.size() == 0) {<NEW_LINE>// If no primary IP config found yet, then create one automatically, otherwise the NIC is in a bad state<NEW_LINE>primaryIPConfig = prepareNewNicIPConfiguration("primary");<NEW_LINE>primaryIPConfig.<MASK><NEW_LINE>withIPConfiguration(primaryIPConfig);<NEW_LINE>} else if (this.nicIPConfigurations.size() == 1) {<NEW_LINE>// If there is only one IP config, assume it is primary, regardless of the Primary flag<NEW_LINE>primaryIPConfig = (NicIpConfigurationImpl) this.nicIPConfigurations.values().iterator().next();<NEW_LINE>} else {<NEW_LINE>// If multiple IP configs, then find the one marked as primary<NEW_LINE>for (NicIpConfiguration ipConfig : this.nicIPConfigurations.values()) {<NEW_LINE>if (ipConfig.isPrimary()) {<NEW_LINE>primaryIPConfig = (NicIpConfigurationImpl) ipConfig;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Return the found primary IP config, including null, if no primary IP config can be identified<NEW_LINE>// in which case the NIC is in a bad state anyway<NEW_LINE>return primaryIPConfig;<NEW_LINE>}
innerModel().withPrimary(true);
103,830
public void visitSerializableProperties(final Object object, final JavaBeanProvider.Visitor visitor) {<NEW_LINE>final PropertyDescriptor[] propertyDescriptors = getSerializableProperties(object);<NEW_LINE>for (final PropertyDescriptor property : propertyDescriptors) {<NEW_LINE>ErrorWritingException ex = null;<NEW_LINE>try {<NEW_LINE>final Method readMethod = property.getReadMethod();<NEW_LINE>final String name = property.getName();<NEW_LINE>final Class<?> definedIn = readMethod.getDeclaringClass();<NEW_LINE>if (visitor.shouldVisit(name, definedIn)) {<NEW_LINE>final Object value = readMethod.invoke(object);<NEW_LINE>visitor.visit(name, property.getPropertyType(), definedIn, value);<NEW_LINE>}<NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>ex = new ConversionException("Cannot get property", e);<NEW_LINE>} catch (final IllegalAccessException e) {<NEW_LINE>ex = new ObjectAccessException("Cannot access property", e);<NEW_LINE>} catch (final InvocationTargetException e) {<NEW_LINE>ex = new ConversionException(<MASK><NEW_LINE>}<NEW_LINE>if (ex != null) {<NEW_LINE>ex.add("property", object.getClass() + "." + property.getName());<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Cannot get property", e.getTargetException());
1,000,114
public void addDebugTask(String qid, List<String> docIds, JsonNode jsonQuery) {<NEW_LINE>if (debugTasks.containsKey(qid))<NEW_LINE>throw new IllegalArgumentException("existed qid");<NEW_LINE>debugTasks.put(qid, pool.submit(() -> {<NEW_LINE>List<FeatureExtractor> localExtractors = new ArrayList<>();<NEW_LINE>for (FeatureExtractor e : extractors) {<NEW_LINE>localExtractors.add(e.clone());<NEW_LINE>}<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>DocumentContext documentContext = new DocumentContext(reader, searcher, fieldsToLoad);<NEW_LINE>QueryContext queryContext = new QueryContext(qid, qfieldsToLoad, jsonQuery);<NEW_LINE>List<debugOutput> result = new ArrayList<>();<NEW_LINE>for (String docId : docIds) {<NEW_LINE>Query q = new TermQuery(new Term(IndexArgs.ID, docId));<NEW_LINE>TopDocs topDocs = searcher.search(q, 1);<NEW_LINE>if (topDocs.totalHits.value == 0) {<NEW_LINE>throw new IOException(String.format("Document Id %s expected but not found in index", docId));<NEW_LINE>}<NEW_LINE>ScoreDoc hit = topDocs.scoreDocs[0];<NEW_LINE>documentContext.updateDoc(docId, hit.doc);<NEW_LINE>List<Float> features = new ArrayList<>();<NEW_LINE>List<Long> time = new ArrayList<>();<NEW_LINE>for (int i = 0; i < localExtractors.size(); i++) {<NEW_LINE>time.add(0L);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < localExtractors.size(); i++) {<NEW_LINE>long start = System.nanoTime();<NEW_LINE>float extractedFeature = localExtractors.get(i).extract(documentContext, queryContext);<NEW_LINE>assert extractedFeature == extractedFeature;<NEW_LINE>features.add(extractedFeature);<NEW_LINE>long end = System.nanoTime();<NEW_LINE>time.set(i, time.get(i) + end - start);<NEW_LINE>}<NEW_LINE>result.add(new debugOutput<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}));<NEW_LINE>}
(docId, features, time));
1,205,360
public SyncQueueVO queue(final String syncObjType, final long syncObjId, final String itemType, final long itemId, final long queueSizeLimit) {<NEW_LINE>try {<NEW_LINE>return Transaction.execute(new TransactionCallback<SyncQueueVO>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public SyncQueueVO doInTransaction(TransactionStatus status) {<NEW_LINE>_syncQueueDao.ensureQueue(syncObjType, syncObjId);<NEW_LINE>SyncQueueVO queueVO = <MASK><NEW_LINE>if (queueVO == null)<NEW_LINE>throw new CloudRuntimeException("Unable to queue item into DB, DB is full?");<NEW_LINE>queueVO.setQueueSizeLimit(queueSizeLimit);<NEW_LINE>_syncQueueDao.update(queueVO.getId(), queueVO);<NEW_LINE>Date dt = DateUtil.currentGMTTime();<NEW_LINE>SyncQueueItemVO item = new SyncQueueItemVO();<NEW_LINE>item.setQueueId(queueVO.getId());<NEW_LINE>item.setContentType(itemType);<NEW_LINE>item.setContentId(itemId);<NEW_LINE>item.setCreated(dt);<NEW_LINE>_syncQueueItemDao.persist(item);<NEW_LINE>return queueVO;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.error("Unexpected exception: ", e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
_syncQueueDao.find(syncObjType, syncObjId);
1,508,165
public static TakeBreakResponse unmarshall(TakeBreakResponse takeBreakResponse, UnmarshallerContext _ctx) {<NEW_LINE>takeBreakResponse.setRequestId(_ctx.stringValue("TakeBreakResponse.RequestId"));<NEW_LINE>takeBreakResponse.setCode<MASK><NEW_LINE>takeBreakResponse.setHttpStatusCode(_ctx.integerValue("TakeBreakResponse.HttpStatusCode"));<NEW_LINE>takeBreakResponse.setMessage(_ctx.stringValue("TakeBreakResponse.Message"));<NEW_LINE>List<String> params = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("TakeBreakResponse.Params.Length"); i++) {<NEW_LINE>params.add(_ctx.stringValue("TakeBreakResponse.Params[" + i + "]"));<NEW_LINE>}<NEW_LINE>takeBreakResponse.setParams(params);<NEW_LINE>Data data = new Data();<NEW_LINE>data.setExtension(_ctx.stringValue("TakeBreakResponse.Data.Extension"));<NEW_LINE>data.setHeartbeat(_ctx.longValue("TakeBreakResponse.Data.Heartbeat"));<NEW_LINE>data.setWorkMode(_ctx.stringValue("TakeBreakResponse.Data.WorkMode"));<NEW_LINE>data.setDeviceId(_ctx.stringValue("TakeBreakResponse.Data.DeviceId"));<NEW_LINE>data.setUserId(_ctx.stringValue("TakeBreakResponse.Data.UserId"));<NEW_LINE>data.setReserved(_ctx.longValue("TakeBreakResponse.Data.Reserved"));<NEW_LINE>data.setBreakCode(_ctx.stringValue("TakeBreakResponse.Data.BreakCode"));<NEW_LINE>data.setInstanceId(_ctx.stringValue("TakeBreakResponse.Data.InstanceId"));<NEW_LINE>data.setOutboundScenario(_ctx.booleanValue("TakeBreakResponse.Data.OutboundScenario"));<NEW_LINE>data.setMobile(_ctx.stringValue("TakeBreakResponse.Data.Mobile"));<NEW_LINE>data.setJobId(_ctx.stringValue("TakeBreakResponse.Data.JobId"));<NEW_LINE>data.setUserState(_ctx.stringValue("TakeBreakResponse.Data.UserState"));<NEW_LINE>List<String> signedSkillGroupIdList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("TakeBreakResponse.Data.SignedSkillGroupIdList.Length"); i++) {<NEW_LINE>signedSkillGroupIdList.add(_ctx.stringValue("TakeBreakResponse.Data.SignedSkillGroupIdList[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setSignedSkillGroupIdList(signedSkillGroupIdList);<NEW_LINE>takeBreakResponse.setData(data);<NEW_LINE>return takeBreakResponse;<NEW_LINE>}
(_ctx.stringValue("TakeBreakResponse.Code"));
1,678,548
private void listenForInitSessionEventsToReactNative(ReactApplicationContext reactContext) {<NEW_LINE>mInitSessionFinishedEventReceiver = new BroadcastReceiver() {<NEW_LINE><NEW_LINE>RNBranchModule mBranchModule;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceive(Context context, Intent intent) {<NEW_LINE>final boolean hasError = (initSessionResult.has("error") && !initSessionResult.isNull("error"));<NEW_LINE>final String eventName = hasError ? RN_INIT_SESSION_ERROR_EVENT : RN_INIT_SESSION_SUCCESS_EVENT;<NEW_LINE>mBranchModule.sendRNEvent(eventName, convertJsonToMap(initSessionResult));<NEW_LINE>}<NEW_LINE><NEW_LINE>private BroadcastReceiver init(RNBranchModule branchModule) {<NEW_LINE>mBranchModule = branchModule;<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>}.init(this);<NEW_LINE>LocalBroadcastManager.getInstance(reactContext).registerReceiver(<MASK><NEW_LINE>mInitSessionStartedEventReceiver = new BroadcastReceiver() {<NEW_LINE><NEW_LINE>RNBranchModule mBranchModule;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceive(Context context, Intent intent) {<NEW_LINE>Uri uri = intent.getParcelableExtra(NATIVE_INIT_SESSION_STARTED_EVENT_URI);<NEW_LINE>WritableMap payload = new WritableNativeMap();<NEW_LINE>if (uri != null) {<NEW_LINE>payload.putString(NATIVE_INIT_SESSION_STARTED_EVENT_URI, uri.toString());<NEW_LINE>} else {<NEW_LINE>payload.putNull(NATIVE_INIT_SESSION_STARTED_EVENT_URI);<NEW_LINE>}<NEW_LINE>mBranchModule.sendRNEvent(RN_INIT_SESSION_START_EVENT, payload);<NEW_LINE>}<NEW_LINE><NEW_LINE>private BroadcastReceiver init(RNBranchModule branchModule) {<NEW_LINE>mBranchModule = branchModule;<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>}.init(this);<NEW_LINE>LocalBroadcastManager.getInstance(reactContext).registerReceiver(mInitSessionStartedEventReceiver, new IntentFilter(NATIVE_INIT_SESSION_STARTED_EVENT));<NEW_LINE>}
mInitSessionFinishedEventReceiver, new IntentFilter(NATIVE_INIT_SESSION_FINISHED_EVENT));
639,385
private void createMethodMemoryBlocks(Program program, ByteProvider provider, ClassFileJava classFile, TaskMonitor monitor) {<NEW_LINE>AbstractConstantPoolInfoJava[] constantPool = classFile.getConstantPool();<NEW_LINE>MethodInfoJava[] methods = classFile.getMethods();<NEW_LINE>monitor.setMessage("Processing Methods...");<NEW_LINE>monitor.setProgress(0);<NEW_LINE>monitor.setMaximum(methods.length);<NEW_LINE>Address start = toAddr(program, CODE_OFFSET);<NEW_LINE>try {<NEW_LINE>// program.setImageBase(start, true);<NEW_LINE>// for (MethodInfoJava method : methods) {<NEW_LINE>for (int i = 0, max = methods.length; i < max; ++i) {<NEW_LINE>MethodInfoJava method = methods[i];<NEW_LINE>monitor.incrementProgress(1);<NEW_LINE>CodeAttribute code = method.getCodeAttribute();<NEW_LINE>if (code == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int length = code.getCodeLength();<NEW_LINE>long offset = code.getCodeOffset();<NEW_LINE>Memory memory = program.getMemory();<NEW_LINE>int nameIndex = method.getNameIndex();<NEW_LINE>int descriptorIndex = method.getDescriptorIndex();<NEW_LINE>ConstantPoolUtf8Info methodNameInfo = (ConstantPoolUtf8Info) constantPool[nameIndex];<NEW_LINE>ConstantPoolUtf8Info methodDescriptorInfo = (ConstantPoolUtf8Info) constantPool[descriptorIndex];<NEW_LINE>String methodName = methodNameInfo.getString() + methodDescriptorInfo.getString();<NEW_LINE>MemoryBlock memoryBlock = memory.createInitializedBlock(methodName, start, provider.getInputStream(offset), length, monitor, false);<NEW_LINE>Address methodIndexAddress = JavaClassUtil.toLookupAddress(program, i);<NEW_LINE>program.getMemory().setInt(methodIndexAddress, (int) start.getOffset());<NEW_LINE>program.getListing().createData(methodIndexAddress, PointerDataType.dataType);<NEW_LINE>setAlignmentInfo(program, new AddressSet(memoryBlock.getStart(), memoryBlock.getEnd()));<NEW_LINE>start = start.add(length + 1);<NEW_LINE>while (start.getOffset() % 4 != 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e1) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e1.printStackTrace();<NEW_LINE>}<NEW_LINE>}
start = start.add(1);
1,423,010
public static List<String> tokenize(String source, String separator) {<NEW_LINE>if (separator.length() == 1) {<NEW_LINE>// slightly faster<NEW_LINE>return tokenize(source<MASK><NEW_LINE>}<NEW_LINE>ArrayList<String> tokenized = new ArrayList<String>();<NEW_LINE>int len = source.length();<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>for (int iter = 0; iter < len; iter++) {<NEW_LINE>char current = source.charAt(iter);<NEW_LINE>if (separator.indexOf(current) > -1) {<NEW_LINE>if (buf.length() > 0) {<NEW_LINE>tokenized.add(buf.toString());<NEW_LINE>buf = new StringBuilder();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>buf.append(current);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (buf.length() > 0) {<NEW_LINE>tokenized.add(buf.toString());<NEW_LINE>}<NEW_LINE>return tokenized;<NEW_LINE>}
, separator.charAt(0));
1,673,350
private String generateIntFieldAccessor(int fieldNum) {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>String fieldName = substituteInvalidChars(objectSchema.getFieldName(fieldNum));<NEW_LINE>builder.append(" public int get").append(uppercase(fieldName)).append("(int ordinal) {\n");<NEW_LINE>builder.append(" if(fieldIndex[" + fieldNum + "] == -1)\n");<NEW_LINE>builder.append(" return missingDataHandler().handleInt(\"").append(objectSchema.getName()).append("\", ordinal, \"").append(fieldName).append("\");\n");<NEW_LINE>builder.append(" return getTypeDataAccess().readInt(ordinal, fieldIndex[" + fieldNum + "]);\n");<NEW_LINE>builder.append(" }\n\n");<NEW_LINE>builder.append(" public Integer get").append(uppercase(<MASK><NEW_LINE>builder.append(" int i;\n");<NEW_LINE>builder.append(" if(fieldIndex[" + fieldNum + "] == -1) {\n");<NEW_LINE>builder.append(" i = missingDataHandler().handleInt(\"").append(objectSchema.getName()).append("\", ordinal, \"").append(fieldName).append("\");\n");<NEW_LINE>builder.append(" } else {\n");<NEW_LINE>builder.append(" boxedFieldAccessSampler.recordFieldAccess(fieldIndex[" + fieldNum + "]);\n");<NEW_LINE>builder.append(" i = getTypeDataAccess().readInt(ordinal, fieldIndex[" + fieldNum + "]);\n");<NEW_LINE>builder.append(" }\n");<NEW_LINE>builder.append(" if(i == Integer.MIN_VALUE)\n");<NEW_LINE>builder.append(" return null;\n");<NEW_LINE>builder.append(" return Integer.valueOf(i);\n");<NEW_LINE>builder.append(" }\n\n");<NEW_LINE>return builder.toString();<NEW_LINE>}
fieldName)).append("Boxed(int ordinal) {\n");
382,266
private RollingUpdateOp rollingUpdateTimedoutError(final RollingUpdateOpFactory opFactory, final String host, final JobId jobId, final TaskStatus taskStatus) {<NEW_LINE>final List<TaskStatus.State> previousJobStates = getPreviousJobStates(jobId, host, 10);<NEW_LINE>final String baseError = "timed out waiting for job " + jobId + " to reach state RUNNING ";<NEW_LINE>final String stateInfo = String.format("(terminal job state %s, previous states: %s)", taskStatus.getState(), Joiner.on("->").join(previousJobStates));<NEW_LINE>final Map<String, Object> metadata = Maps.newHashMap();<NEW_LINE>metadata.put("jobState", taskStatus.getState());<NEW_LINE>metadata.put("previousJobStates", previousJobStates);<NEW_LINE>metadata.put("throttleState", taskStatus.getThrottled());<NEW_LINE>if (taskStatus.getThrottled().equals(ThrottleState.IMAGE_MISSING)) {<NEW_LINE>return opFactory.error(baseError + "due to missing Docker image " + stateInfo, host, RollingUpdateError.IMAGE_MISSING, metadata);<NEW_LINE>}<NEW_LINE>if (taskStatus.getThrottled().equals(ThrottleState.IMAGE_PULL_FAILED)) {<NEW_LINE>return opFactory.error(baseError + "due to failure pulling Docker image " + stateInfo, host, RollingUpdateError.IMAGE_PULL_FAILED, metadata);<NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(taskStatus.getContainerError())) {<NEW_LINE>return opFactory.error(baseError + stateInfo + " container error: " + taskStatus.getContainerError(), <MASK><NEW_LINE>}<NEW_LINE>return opFactory.error(baseError + stateInfo, host, RollingUpdateError.TIMED_OUT_WAITING_FOR_JOB_TO_REACH_RUNNING, metadata);<NEW_LINE>}
host, RollingUpdateError.TIMED_OUT_WAITING_FOR_JOB_TO_REACH_RUNNING, metadata);
1,051,972
private boolean createKeymapCopyIfNeeded() {<NEW_LINE>if (mySelectedKeymap.canModify())<NEW_LINE>return true;<NEW_LINE>final KeymapImpl selectedKeymap = getSelectedKeymap();<NEW_LINE>if (selectedKeymap == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>KeymapImpl newKeymap = selectedKeymap.deriveKeymap();<NEW_LINE>String newKeymapName = KeyMapBundle.message("new.keymap.name", selectedKeymap.getPresentableName());<NEW_LINE>if (!tryNewKeymapName(newKeymapName)) {<NEW_LINE>for (int i = 0; ; i++) {<NEW_LINE>newKeymapName = KeyMapBundle.message("new.indexed.keymap.name", selectedKeymap.getPresentableName(), i);<NEW_LINE>if (tryNewKeymapName(newKeymapName)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newKeymap.setName(newKeymapName);<NEW_LINE>newKeymap.setCanModify(true);<NEW_LINE>final int indexOf = myKeymapListModel.getIndexOf(selectedKeymap);<NEW_LINE>if (indexOf >= 0) {<NEW_LINE>myKeymapListModel.<MASK><NEW_LINE>} else {<NEW_LINE>myKeymapListModel.addElement(newKeymap);<NEW_LINE>}<NEW_LINE>myKeymapList.setSelectedItem(newKeymap);<NEW_LINE>processCurrentKeymapChanged(getCurrentQuickListIds());<NEW_LINE>return true;<NEW_LINE>}
insertElementAt(newKeymap, indexOf + 1);
1,765,040
public SofaTracerSpan cloneInstance() {<NEW_LINE>SofaTracerSpanContext spanContext = this.sofaTracerSpanContext.cloneInstance();<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>tags.putAll(this.tagsWithBool);<NEW_LINE>tags.putAll(this.tagsWithStr);<NEW_LINE>tags.putAll(this.tagsWithNumber);<NEW_LINE>SofaTracerSpan cloneSpan = new SofaTracerSpan(this.sofaTracer, this.startTime, this.spanReferences, this.operationName, spanContext, tags);<NEW_LINE>if (this.logs != null && this.logs.size() > 0) {<NEW_LINE>for (LogData logData : this.logs) {<NEW_LINE>cloneSpan.log(logData);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cloneSpan.setEndTime(this.endTime);<NEW_LINE>cloneSpan.setLogType(this.logType);<NEW_LINE>cloneSpan.setParentSofaTracerSpan(this.parentSofaTracerSpan);<NEW_LINE>return cloneSpan;<NEW_LINE>}
tags = new HashMap<>();
923,943
public static Object unmarshalString(String str, JAXBContext jc) throws JAXBException {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Unmarshalling '" + str + "'");<NEW_LINE>// log.debug("using context '" + jc.getClass().getName() + "'"); // which JAXB implementation?<NEW_LINE>}<NEW_LINE>// Uncomment the following if you are being screwed by a byte order marker<NEW_LINE>str = str.trim().replaceFirst("^([\\W]+)<", "<");<NEW_LINE>Unmarshaller u = jc.createUnmarshaller();<NEW_LINE>JaxbValidationEventHandler eventHandler = new JaxbValidationEventHandler();<NEW_LINE>u.setEventHandler(eventHandler);<NEW_LINE>Document document = null;<NEW_LINE>try {<NEW_LINE>// StreamSource(Reader reader) is vulnerable to XXE<NEW_LINE>// so use a dom doc instead.<NEW_LINE>// Here it has come from a string, so it hopefully isn't huge.<NEW_LINE>// And at least we can re-use it in the McPreprocessor case<NEW_LINE>// (compare XMLStreamReader, which we'd have to recreate<NEW_LINE>// xif.createXMLStreamReader(is) )<NEW_LINE>DocumentBuilder db = XmlUtils.getNewDocumentBuilder();<NEW_LINE>try (InputStream is = IOUtils.toInputStream(str, "UTF-8")) {<NEW_LINE>document = db.parse(is);<NEW_LINE>}<NEW_LINE>return u.unmarshal(document);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UnmarshalException(e);<NEW_LINE>} catch (NumberFormatException ue) {<NEW_LINE>// invoke mc-preprocessor<NEW_LINE>return handleUnmarshalException(<MASK><NEW_LINE>} catch (UnmarshalException ue) {<NEW_LINE>return handleUnmarshalException(jc, eventHandler, document, ue);<NEW_LINE>} catch (SAXException e) {<NEW_LINE>throw new UnmarshalException(e);<NEW_LINE>}<NEW_LINE>}
jc, eventHandler, document, ue);
236,861
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create window MyWindowMerge#keepall as (p0 string, p1 string)", path);<NEW_LINE>env.compileExecuteFAFNoResult("insert into MyWindowMerge select 'a' as p0, 'b' as p1", path);<NEW_LINE>env.compileDeploy("on SupportBean_S0 merge MyWindowMerge as `order` when matched then update set `order`.p1 = `order`.p0", path);<NEW_LINE>env.compileDeploy("on SupportBean_S1 update MyWindowMerge as `order` set p0 = 'x'", path);<NEW_LINE>assertFAF(env, path, "MyWindowMerge", "a", "b");<NEW_LINE>env.sendEventBean(new SupportBean_S0(1));<NEW_LINE>assertFAF(env, path, "MyWindowMerge", "a", "a");<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean_S1(1, "x"));<NEW_LINE>assertFAF(env, path, "MyWindowMerge", "x", "a");<NEW_LINE>env.compileDeploy("@name('s0') on SupportBean select `order`.p0 as c0 from MyWindowMerge as `order`", path).addListener("s0");<NEW_LINE>env<MASK><NEW_LINE>env.assertEqualsNew("s0", "c0", "x");<NEW_LINE>env.undeployAll();<NEW_LINE>}
.sendEventBean(new SupportBean());
988,361
private static CommandLine parseArgs(String[] args) {<NEW_LINE>Options options = new Options();<NEW_LINE>Option telemetryAllFrom = new Option("telemetryFrom", "telemetryFrom", true, "telemetry source file");<NEW_LINE>telemetryAllFrom.setRequired(true);<NEW_LINE>options.addOption(telemetryAllFrom);<NEW_LINE>Option latestTsOutOpt = new Option("latestOut", "latestTelemetryOut", true, "latest telemetry save dir");<NEW_LINE>latestTsOutOpt.setRequired(false);<NEW_LINE>options.addOption(latestTsOutOpt);<NEW_LINE>Option tsOutOpt = new Option("tsOut", "telemetryOut", true, "sstable save dir");<NEW_LINE>tsOutOpt.setRequired(false);<NEW_LINE>options.addOption(tsOutOpt);<NEW_LINE>Option partitionOutOpt = new Option(<MASK><NEW_LINE>partitionOutOpt.setRequired(false);<NEW_LINE>options.addOption(partitionOutOpt);<NEW_LINE>Option castOpt = new Option("castEnable", "castEnable", true, "cast String to Double if possible");<NEW_LINE>castOpt.setRequired(true);<NEW_LINE>options.addOption(castOpt);<NEW_LINE>Option relatedOpt = new Option("relatedEntities", "relatedEntities", true, "related entities source file path");<NEW_LINE>relatedOpt.setRequired(true);<NEW_LINE>options.addOption(relatedOpt);<NEW_LINE>HelpFormatter formatter = new HelpFormatter();<NEW_LINE>CommandLineParser parser = new BasicParser();<NEW_LINE>try {<NEW_LINE>return parser.parse(options, args);<NEW_LINE>} catch (ParseException e) {<NEW_LINE>System.out.println(e.getMessage());<NEW_LINE>formatter.printHelp("utility-name", options);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
"partitionsOut", "partitionsOut", true, "partitions save dir");
1,162,515
private Mono<Response<RemediationInner>> createOrUpdateAtSubscriptionWithResponseAsync(String remediationName, RemediationInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (remediationName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter remediationName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-10-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.createOrUpdateAtSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(), remediationName, apiVersion, parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
1,695,976
private static String serializeHistogram(QuantileDigest digest) {<NEW_LINE>int buckets = 100;<NEW_LINE>long min = digest.getMin();<NEW_LINE>long max = digest.getMax();<NEW_LINE>long bucketSize = (max - min + buckets) / buckets;<NEW_LINE>ImmutableList.Builder<Long> boundaryBuilder = ImmutableList.builder();<NEW_LINE>for (int i = 1; i < buckets + 1; ++i) {<NEW_LINE>boundaryBuilder.add(min + bucketSize * i);<NEW_LINE>}<NEW_LINE>ImmutableList<Long> boundaries = boundaryBuilder.build();<NEW_LINE>List<QuantileDigest.Bucket> <MASK><NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>// add bogus bucket (fb303 ui ignores the first one, for whatever reason)<NEW_LINE>builder.append("-1:0:0,");<NEW_LINE>for (int i = 0; i < boundaries.size(); ++i) {<NEW_LINE>long lowBoundary = min;<NEW_LINE>if (i > 0) {<NEW_LINE>lowBoundary = boundaries.get(i - 1);<NEW_LINE>}<NEW_LINE>builder.append(lowBoundary).append(':').append(Math.round(counts.get(i).getCount())).append(':').append(Math.round(counts.get(i).getMean())).append(',');<NEW_LINE>}<NEW_LINE>// add a final bucket so that fb303 ui shows the max value<NEW_LINE>builder.append(max);<NEW_LINE>builder.append(":0:0");<NEW_LINE>return builder.toString();<NEW_LINE>}
counts = digest.getHistogram(boundaries);
1,001,806
private // So, request without user-agent and Pulsar-CPP-vX (X < 1.21) must be rejected<NEW_LINE>void validateClientVersion() {<NEW_LINE>if (!pulsar().getConfiguration().isClientLibraryVersionCheckEnabled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String <MASK><NEW_LINE>if (StringUtils.isBlank(userAgent)) {<NEW_LINE>throw new RestException(Status.METHOD_NOT_ALLOWED, "Client lib is not compatible to" + " access partitioned metadata: version in user-agent is not present");<NEW_LINE>}<NEW_LINE>// Version < 1.20 for cpp-client is not allowed<NEW_LINE>if (userAgent.contains(DEPRECATED_CLIENT_VERSION_PREFIX)) {<NEW_LINE>try {<NEW_LINE>// Version < 1.20 for cpp-client is not allowed<NEW_LINE>String[] tokens = userAgent.split(DEPRECATED_CLIENT_VERSION_PREFIX);<NEW_LINE>String[] splits = tokens.length > 1 ? tokens[1].split("-")[0].trim().split("\\.") : null;<NEW_LINE>if (splits != null && splits.length > 1) {<NEW_LINE>if (LEAST_SUPPORTED_CLIENT_VERSION_PREFIX.getMajorVersion() > Integer.parseInt(splits[0]) || LEAST_SUPPORTED_CLIENT_VERSION_PREFIX.getMinorVersion() > Integer.parseInt(splits[1])) {<NEW_LINE>throw new RestException(Status.METHOD_NOT_ALLOWED, "Client lib is not compatible to access partitioned metadata: version " + userAgent + " is not supported");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RestException re) {<NEW_LINE>throw re;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn("[{}] Failed to parse version {} ", clientAppId(), userAgent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}
userAgent = httpRequest.getHeader("User-Agent");
1,373,671
public void run(RegressionEnvironment env) {<NEW_LINE>// test for ESPER-185<NEW_LINE>String[] fields = "mycount".split(",");<NEW_LINE>String epl = "@name('s0') select irstream count(price) as mycount " + "from SupportMarketDataBean#length(5) " + "group by symbol, price";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE><MASK><NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { 1L }, new Object[] { 0L });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { 1L } });<NEW_LINE>sendEvent(env, SYMBOL_DELL, 11);<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { 1L }, new Object[] { 0L });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { 1L }, { 1L } });<NEW_LINE>env.milestone(0);<NEW_LINE>sendEvent(env, SYMBOL_DELL, 10);<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { 2L }, new Object[] { 1L });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { 2L }, { 1L } });<NEW_LINE>sendEvent(env, SYMBOL_IBM, 10);<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { 1L }, new Object[] { 0L });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { 2L }, { 1L }, { 1L } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
sendEvent(env, SYMBOL_DELL, 10);
1,647,391
private String createQuery() {<NEW_LINE>Calendar prevDayQuery = (Calendar) prevDay.clone();<NEW_LINE>// NON-NLS<NEW_LINE>String // NON-NLS<NEW_LINE>query = // NON-NLS<NEW_LINE>"(dir_type = " + TskData.TSK_FS_NAME_TYPE_ENUM.REG.getValue() + ")" + " AND (known IS NULL OR known != 1) AND (";<NEW_LINE>long lowerLimit = prevDayQuery.getTimeInMillis() / 1000;<NEW_LINE>prevDayQuery.<MASK><NEW_LINE>prevDayQuery.add(Calendar.MILLISECOND, -1);<NEW_LINE>long upperLimit = prevDayQuery.getTimeInMillis() / 1000;<NEW_LINE>// NON-NLS<NEW_LINE>query += "(crtime BETWEEN " + lowerLimit + " AND " + upperLimit + ") OR ";<NEW_LINE>// NON-NLS<NEW_LINE>query += "(ctime BETWEEN " + lowerLimit + " AND " + upperLimit + ") OR ";<NEW_LINE>// query += "(atime BETWEEN " + lowerLimit + " AND " + upperLimit + ") OR ";<NEW_LINE>// NON-NLS<NEW_LINE>query += "(mtime BETWEEN " + lowerLimit + " AND " + upperLimit + "))";<NEW_LINE>// query += " LIMIT " + MAX_OBJECTS;<NEW_LINE>return query;<NEW_LINE>}
add(Calendar.DATE, 1);
1,137,628
public void unlock() {<NEW_LINE>final byte[] internalKey = getInternalKey();<NEW_LINE>final Acquirer acquirer = getAcquirer();<NEW_LINE>try {<NEW_LINE>final Owner owner = this.rheaKVStore.releaseLockWith(internalKey, acquirer).get();<NEW_LINE>updateOwner(owner);<NEW_LINE>if (!owner.isSameAcquirer(acquirer)) {<NEW_LINE>final String message = String.format("an invalid acquirer [%s] trying to unlock, the real owner is [%s]", acquirer, owner);<NEW_LINE>throw new InvalidLockAcquirerException(message);<NEW_LINE>}<NEW_LINE>if (owner.getAcquires() <= 0) {<NEW_LINE>tryCancelScheduling();<NEW_LINE>}<NEW_LINE>} catch (final InvalidLockAcquirerException e) {<NEW_LINE>LOG.error("Fail to unlock, {}."<MASK><NEW_LINE>ThrowUtil.throwException(e);<NEW_LINE>} catch (final Throwable t) {<NEW_LINE>LOG.error("Fail to unlock: {}, will cancel scheduling, {}.", acquirer, StackTraceUtil.stackTrace(t));<NEW_LINE>tryCancelScheduling();<NEW_LINE>ThrowUtil.throwException(t);<NEW_LINE>}<NEW_LINE>}
, StackTraceUtil.stackTrace(e));
500,163
private void load() throws FileNotFoundException {<NEW_LINE>if (files == null && subdirs == null) {<NEW_LINE>if (!directory.exists() || !directory.isDirectory()) {<NEW_LINE>files = new ArrayList<File>();<NEW_LINE>subdirs = new ArrayList<Directory>();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File[] listFiles = directory.listFiles(fileFilter);<NEW_LINE>if (listFiles == null)<NEW_LINE>throw new FileNotFoundException("Invalid directory name: '" + directory.getPath() + "'");<NEW_LINE>files = List.of(listFiles);<NEW_LINE>File[] subdirList = directory.listFiles(DIRECTORY_FILTER);<NEW_LINE>subdirs <MASK><NEW_LINE>for (File file : subdirList) {<NEW_LINE>Directory newDir = newDirectory(file, fileFilter);<NEW_LINE>newDir.parent = this;<NEW_LINE>subdirs.add(newDir);<NEW_LINE>}<NEW_LINE>subdirs.sort((d1, d2) -> {<NEW_LINE>// Lets sort by directories first, then Hero Lab Portfolios, then finally PDF's<NEW_LINE>String name1 = d1.getPath().getName();<NEW_LINE>String name2 = d2.getPath().getName();<NEW_LINE>if (d1.isDir() && d2.isDir()) {<NEW_LINE>return String.CASE_INSENSITIVE_ORDER.compare(name1, name2);<NEW_LINE>} else if (!d1.isDir() && !d2.isDir()) {<NEW_LINE>if ((d1.isPDF() && d2.isPDF()) || (d1.isHeroLabPortfolio() && d2.isHeroLabPortfolio())) {<NEW_LINE>return String.CASE_INSENSITIVE_ORDER.compare(name1, name2);<NEW_LINE>} else if (d1.isPDF()) {<NEW_LINE>return 1;<NEW_LINE>} else {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>} else if (d1.isDir()) {<NEW_LINE>return -1;<NEW_LINE>} else {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>subdirs = Collections.unmodifiableList(subdirs);<NEW_LINE>}<NEW_LINE>}
= new ArrayList<Directory>();
1,633,987
private void activateWindow(PlumberAPIParams params) {<NEW_LINE>WindowEx win = satelliteManager_.getSatelliteWindowObject(PlumberAPISatellite.NAME);<NEW_LINE>boolean isRefresh = win != null && (params == null || (params_ != null && StringUtil.equals(params.getPath(), params_.getPath())));<NEW_LINE>boolean isChrome = !Desktop.isDesktop() && BrowseCap.isChrome();<NEW_LINE>if (params != null)<NEW_LINE>params_ = params;<NEW_LINE>if (win == null || (!isRefresh && !isChrome)) {<NEW_LINE>int width = 910;<NEW_LINE>// If there's no window yet, or we're switching APIs in a browser<NEW_LINE>// other than Chrome, do a normal open<NEW_LINE>satelliteManager_.openSatellite(PlumberAPISatellite.NAME, params_, new Size(width, 1100));<NEW_LINE>} else if (isChrome) {<NEW_LINE>// we have a window and we're Chrome, so force a close and reopen<NEW_LINE>satelliteManager_.forceReopenSatellite(<MASK><NEW_LINE>} else {<NEW_LINE>satelliteManager_.activateSatelliteWindow(PlumberAPISatellite.NAME);<NEW_LINE>}<NEW_LINE>}
PlumberAPISatellite.NAME, params_, true);
973,608
private void mergeFromField(final Map.Entry<T, Object> entry) {<NEW_LINE>final T descriptor = entry.getKey();<NEW_LINE>Object otherValue = entry.getValue();<NEW_LINE>if (otherValue instanceof LazyField) {<NEW_LINE>otherValue = ((LazyField) otherValue).getValue();<NEW_LINE>}<NEW_LINE>if (descriptor.isRepeated()) {<NEW_LINE>Object value = getField(descriptor);<NEW_LINE>if (value == null) {<NEW_LINE>value = new ArrayList<>();<NEW_LINE>}<NEW_LINE>for (Object element : (List) otherValue) {<NEW_LINE>((List) value).add(cloneIfMutable(element));<NEW_LINE>}<NEW_LINE>fields.put(descriptor, value);<NEW_LINE>} else if (descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE) {<NEW_LINE>Object value = getField(descriptor);<NEW_LINE>if (value == null) {<NEW_LINE>fields.put(descriptor, cloneIfMutable(otherValue));<NEW_LINE>} else {<NEW_LINE>// Merge the messages.<NEW_LINE>value = descriptor.internalMergeFrom(((MessageLite) value).toBuilder(), (MessageLite) otherValue).build();<NEW_LINE>fields.put(descriptor, value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>fields.put<MASK><NEW_LINE>}<NEW_LINE>}
(descriptor, cloneIfMutable(otherValue));
1,239,912
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see freeplane.extensions.NodeHook#invoke(freeplane.modes.MindMapNode,<NEW_LINE>* java.util.List)<NEW_LINE>*/<NEW_LINE>public void actionPerformed(final ActionEvent e) {<NEW_LINE>final NodeModel selectedNode = Controller.getCurrentModeController().getMapController().getSelectedNode();<NEW_LINE>if (selectedNode == null)<NEW_LINE>return;<NEW_LINE>Collection<NodeModel> unmodifyable = Controller.getCurrentModeController().getMapController().getSelectedNodes();<NEW_LINE>final List<NodeModel> selectedNodes = new ArrayList<NodeModel>(unmodifyable.size());<NEW_LINE>selectedNodes.addAll(unmodifyable);<NEW_LINE>Controller.getCurrentModeController().getMapController().sortNodesByDepth(selectedNodes);<NEW_LINE>if (selectedNode.isRoot()) {<NEW_LINE>UITools.errorMessage(TextUtils.getText("cannot_add_parent_to_root"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final NodeModel newNode = moveToNewParent(selectedNode, selectedNodes);<NEW_LINE>if (newNode == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Controller.getCurrentController().getSelection().selectAsTheOnlyOneSelected(newNode);<NEW_LINE>Controller.getCurrentController().getViewController().invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>((MTextController) TextController.getController()).edit(newNode, <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
selectedNode, true, false, false);
314,023
public BufferedImage filter(final BufferedImage src, BufferedImage dst) {<NEW_LINE>final int width = src.getWidth();<NEW_LINE>final int height = src.getHeight();<NEW_LINE>final int type = src.getType();<NEW_LINE>final WritableRaster srcRaster = src.getRaster();<NEW_LINE>if (dst == null) {<NEW_LINE>dst = createCompatibleDestImage(src, null);<NEW_LINE>}<NEW_LINE>final WritableRaster dstRaster = dst.getRaster();<NEW_LINE>setDimensions(width, height);<NEW_LINE>final int[] inPixels = new int[width];<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>// We try to avoid calling getRGB on images as it causes them to become un-managed, causing horrible performance problems.<NEW_LINE>if (type == BufferedImage.TYPE_INT_ARGB) {<NEW_LINE>srcRaster.getDataElements(0, y, width, 1, inPixels);<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>inPixels[x] = filterRGB(x, y, inPixels[x]);<NEW_LINE>}<NEW_LINE>dstRaster.setDataElements(0, y, width, 1, inPixels);<NEW_LINE>} else {<NEW_LINE>src.getRGB(0, y, width, 1, inPixels, 0, width);<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>inPixels[x] = filterRGB(x<MASK><NEW_LINE>}<NEW_LINE>dst.setRGB(0, y, width, 1, inPixels, 0, width);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dst;<NEW_LINE>}
, y, inPixels[x]);
621,923
public void start() {<NEW_LINE>// init position file. If file is not exists, create it<NEW_LINE>String rootMetaPath = this.getConfigManager().<MASK><NEW_LINE>IOHelper.createFolder(rootMetaPath);<NEW_LINE>positionFilePath = rootMetaPath + File.separator + POSITION_FILE;<NEW_LINE>taskFilePath = rootMetaPath + File.separator + TASK_FILE;<NEW_LINE>initFiles(new String[] { positionFilePath, taskFilePath });<NEW_LINE>// register CollectNodeOperAction<NEW_LINE>IActionEngine engine = this.getActionEngineMgr().getActionEngine("NodeOperActionEngine");<NEW_LINE>new CollectNodeOperAction("collectdata", feature, engine);<NEW_LINE>// init DataCollector<NEW_LINE>dc = new DataCollector(DataCollector.class.getName(), feature);<NEW_LINE>List<CollectTask> tasks = loadTasks();<NEW_LINE>dc.init(tasks);<NEW_LINE>dc.loadPositions(IOHelper.readTxtFile(positionFilePath, "UTF-8"));<NEW_LINE>// start data scaner<NEW_LINE>long scanInterval = DataConvertHelper.toLong(getConfigManager().getFeatureConfiguration(feature, "interval"), 3000L);<NEW_LINE>FileScanScheduler scanner = new FileScanScheduler(FileScanScheduler.class.getName(), feature);<NEW_LINE>getTimerWorkManager().scheduleWork(FileScanScheduler.class.getName(), scanner, 0, scanInterval);<NEW_LINE>// write position file scheduler<NEW_LINE>long writePosDelay = DataConvertHelper.toLong(getConfigManager().getFeatureConfiguration(feature, "writeposdelay"), 5000L);<NEW_LINE>long writePosInterval = DataConvertHelper.toLong(getConfigManager().getFeatureConfiguration(feature, "writeposinterval"), 3000L);<NEW_LINE>PositionPersistence position = new PositionPersistence(PositionPersistence.class.getName(), feature);<NEW_LINE>getTimerWorkManager().scheduleWork(PositionPersistence.class.getName(), position, writePosDelay, writePosInterval);<NEW_LINE>// check idle file scheduler<NEW_LINE>long idleCheckerDelay = DataConvertHelper.toLong(getConfigManager().getFeatureConfiguration(feature, "idlecheckerdelay"), 120000L);<NEW_LINE>long idleCheckerInterval = DataConvertHelper.toLong(getConfigManager().getFeatureConfiguration(feature, "idlecheckerinterval"), 5000L);<NEW_LINE>IdleFileChecker idleChecker = new IdleFileChecker(IdleFileChecker.class.getName(), feature);<NEW_LINE>getTimerWorkManager().scheduleWork(IdleFileChecker.class.getName(), idleChecker, idleCheckerDelay, idleCheckerInterval);<NEW_LINE>log.info(this, "CollectDataAgent Started. Config: interval=" + scanInterval);<NEW_LINE>}
getContext(IConfigurationManager.METADATAPATH) + "collectdata";
231,275
public Regressor convertToOutput(Tensor tensor, ImmutableOutputInfo<Regressor> outputIDInfo) {<NEW_LINE>FloatNdArray predictions = getBatchPredictions(tensor, outputIDInfo.size());<NEW_LINE>long[] shape = predictions.shape().asArray();<NEW_LINE>if (shape[0] != 1) {<NEW_LINE>throw new IllegalArgumentException("Supplied tensor has too many results, found " + shape[0]);<NEW_LINE>} else if (shape[1] != outputIDInfo.size()) {<NEW_LINE>throw new IllegalArgumentException("Supplied tensor has an incorrect number of dimensions, shape[1] = " + shape[1] + ", expected " + outputIDInfo.size());<NEW_LINE>}<NEW_LINE>String[] names = new String[outputIDInfo.size()];<NEW_LINE>double[] values = new double[outputIDInfo.size()];<NEW_LINE>// Note this inserts in an ordering which is not necessarily the natural one,<NEW_LINE>// but the Regressor constructor sorts it to maintain the natural ordering.<NEW_LINE>// The names and the values still line up, so this code is valid.<NEW_LINE>for (Pair<Integer, Regressor> p : outputIDInfo) {<NEW_LINE>int id = p.getA();<NEW_LINE>names[id] = p.getB().getNames()[0];<NEW_LINE>values[id] = predictions.getFloat(0, id);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
return new Regressor(names, values);
699,992
private TruffleNode parseNode(StringLineReader slr) {<NEW_LINE>String className = slr.nextLine();<NEW_LINE>String description = slr.nextLine();<NEW_LINE>String sourceURI;<NEW_LINE>int l1, c1, l2, c2;<NEW_LINE>String ss = slr.nextLine();<NEW_LINE>if (ss.isEmpty()) {<NEW_LINE>sourceURI = null;<NEW_LINE>l1 = c1 = l2 = c2 = -1;<NEW_LINE>} else {<NEW_LINE>sourceURI = ss;<NEW_LINE>ss = slr.nextLine();<NEW_LINE>int i1 = 0;<NEW_LINE>int i2 = ss.indexOf(':');<NEW_LINE>l1 = Integer.parseInt(ss.substring(i1, i2));<NEW_LINE>i1 = i2 + 1;<NEW_LINE>i2 = ss.indexOf('-');<NEW_LINE>c1 = Integer.parseInt(ss.substring(i1, i2));<NEW_LINE>i1 = i2 + 1;<NEW_LINE>i2 = <MASK><NEW_LINE>l2 = Integer.parseInt(ss.substring(i1, i2));<NEW_LINE>i1 = i2 + 1;<NEW_LINE>i2 = ss.length();<NEW_LINE>c2 = Integer.parseInt(ss.substring(i1, i2));<NEW_LINE>}<NEW_LINE>String tags = slr.nextLine();<NEW_LINE>int numCh = Integer.parseInt(slr.nextLine());<NEW_LINE>TruffleNode node = new TruffleNode(className, description, sourceURI, l1, c1, l2, c2, tags, numCh);<NEW_LINE>for (int i = 0; i < numCh; i++) {<NEW_LINE>node.setChild(i, parseNode(slr));<NEW_LINE>}<NEW_LINE>return node;<NEW_LINE>}
ss.indexOf(':', i1);
1,810,648
private void loadNode538() {<NEW_LINE>SessionSecurityDiagnosticsArrayTypeNode node = new SessionSecurityDiagnosticsArrayTypeNode(this.context, Identifiers.SessionsDiagnosticsSummaryType_SessionSecurityDiagnosticsArray, new QualifiedName(0, "SessionSecurityDiagnosticsArray"), new LocalizedText("en", "SessionSecurityDiagnosticsArray"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.SessionSecurityDiagnosticsDataType, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_SessionSecurityDiagnosticsArray, Identifiers.HasTypeDefinition, Identifiers.SessionSecurityDiagnosticsArrayType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_SessionSecurityDiagnosticsArray, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_SessionSecurityDiagnosticsArray, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType.expanded(), false));<NEW_LINE><MASK><NEW_LINE>}
this.nodeManager.addNode(node);
1,742,340
public static ProgressDialogDescriptor createProgressDialog(String title, ProgressHandle handle, ActionListener cancelationListener) {<NEW_LINE>assert SwingUtilities.isEventDispatchThread();<NEW_LINE>Component <MASK><NEW_LINE>JLabel label = ProgressHandleFactory.createDetailLabelComponent(handle);<NEW_LINE>JPanel panel = new JPanel(new GridBagLayout());<NEW_LINE>panel.setPreferredSize(new java.awt.Dimension(450, 50));<NEW_LINE>GridBagConstraints constraintsLabel = new GridBagConstraints();<NEW_LINE>constraintsLabel.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>constraintsLabel.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>constraintsLabel.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>constraintsLabel.weightx = 1.0;<NEW_LINE>constraintsLabel.insets = new java.awt.Insets(8, 8, 0, 8);<NEW_LINE>constraintsLabel.gridx = 0;<NEW_LINE>constraintsLabel.gridy = 0;<NEW_LINE>panel.add(label, constraintsLabel);<NEW_LINE>GridBagConstraints constraintsProgress = new java.awt.GridBagConstraints();<NEW_LINE>constraintsProgress.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>constraintsProgress.gridheight = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>constraintsProgress.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>constraintsProgress.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>constraintsProgress.weightx = 1.0;<NEW_LINE>constraintsProgress.insets = new java.awt.Insets(6, 8, 8, 8);<NEW_LINE>constraintsProgress.gridx = 0;<NEW_LINE>constraintsProgress.gridy = 1;<NEW_LINE>panel.add(progress, constraintsProgress);<NEW_LINE>JButton cancel = new JButton(NbBundle.getMessage(ProgressSupport.class, "LBL_Cancel"));<NEW_LINE>ProgressDialogDescriptor descriptor = new ProgressDialogDescriptor(panel, title, true, new JButton[] { cancel }, cancel, DialogDescriptor.DEFAULT_ALIGN, null, cancelationListener);<NEW_LINE>return descriptor;<NEW_LINE>}
progress = ProgressHandleFactory.createProgressComponent(handle);
1,832,487
public okhttp3.Call apisApiIdSdksLanguageGetCall(String apiId, String language, String xWSO2Tenant, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/{apiId}/sdks/{language}".replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())).replaceAll("\\{" + "language" + "\\}", localVarApiClient.escapeString(language.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (xWSO2Tenant != null) {<NEW_LINE>localVarHeaderParams.put("X-WSO2-Tenant", localVarApiClient.parameterToString(xWSO2Tenant));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/zip", "application/json" };<NEW_LINE>final String <MASK><NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
295,785
protected void read(FileAccessor fa, DirectByteBuffer buffer, long position) throws FMFileManagerException {<NEW_LINE>int original_limit = buffer.limit(SS);<NEW_LINE>try {<NEW_LINE>int len = original_limit - buffer.position(SS);<NEW_LINE>// System.out.println( "compact: read - " + position + "/" + len );<NEW_LINE>// deal with any read access to the first piece<NEW_LINE>if (position < first_piece_start + first_piece_length) {<NEW_LINE>int available = (int) (first_piece_start + first_piece_length - position);<NEW_LINE>if (available >= len) {<NEW_LINE>// all they require is in the first piece<NEW_LINE>// System.out.println( " all in first piece" );<NEW_LINE>delegate.read(fa, new DirectByteBuffer[] { buffer }, position);<NEW_LINE>position += len;<NEW_LINE>len = 0;<NEW_LINE>} else {<NEW_LINE>// read goes past end of first piece<NEW_LINE>// System.out.println( " part in first piece" );<NEW_LINE>buffer.limit(SS, buffer.position(SS) + available);<NEW_LINE>delegate.read(fa, new DirectByteBuffer[] { buffer }, position);<NEW_LINE><MASK><NEW_LINE>position += available;<NEW_LINE>len -= available;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (len == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// position is at start of gap between start and end - work out how much,<NEW_LINE>// if any, space has been requested<NEW_LINE>long space = last_piece_start - position;<NEW_LINE>if (space > 0) {<NEW_LINE>if (space >= len) {<NEW_LINE>// all they require is space<NEW_LINE>// System.out.println( " all in space" );<NEW_LINE>buffer.position(SS, original_limit);<NEW_LINE>position += len;<NEW_LINE>len = 0;<NEW_LINE>} else {<NEW_LINE>// read goes past end of space<NEW_LINE>// System.out.println( " part in space" );<NEW_LINE>buffer.position(SS, buffer.position(SS) + (int) space);<NEW_LINE>position += space;<NEW_LINE>len -= space;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (len == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// lastly read from last piece<NEW_LINE>// System.out.println( " some in last piece" );<NEW_LINE>delegate.read(fa, new DirectByteBuffer[] { buffer }, (position - last_piece_start) + first_piece_length);<NEW_LINE>} finally {<NEW_LINE>buffer.limit(SS, original_limit);<NEW_LINE>}<NEW_LINE>}
buffer.limit(SS, original_limit);
1,567,973
public void intern(@Nonnull ClassDef classDef) {<NEW_LINE>PoolClassDef poolClassDef = new PoolClassDef(classDef);<NEW_LINE>PoolClassDef prev = internedItems.put(poolClassDef.getType(), poolClassDef);<NEW_LINE>if (prev != null) {<NEW_LINE>throw new ExceptionWithContext("Class %s has already been interned", poolClassDef.getType());<NEW_LINE>}<NEW_LINE>dexPool.typeSection.intern(poolClassDef.getType());<NEW_LINE>dexPool.typeSection.internNullable(poolClassDef.getSuperclass());<NEW_LINE>dexPool.typeListSection.intern(poolClassDef.getInterfaces());<NEW_LINE>dexPool.stringSection.internNullable(poolClassDef.getSourceFile());<NEW_LINE>HashSet<String> fields = new HashSet<String>();<NEW_LINE>for (Field field : poolClassDef.getFields()) {<NEW_LINE>String fieldDescriptor = DexFormatter.INSTANCE.getShortFieldDescriptor(field);<NEW_LINE>if (!fields.add(fieldDescriptor)) {<NEW_LINE>throw new ExceptionWithContext("Multiple definitions for field %s->%s", poolClassDef.getType(), fieldDescriptor);<NEW_LINE>}<NEW_LINE>dexPool.fieldSection.intern(field);<NEW_LINE>EncodedValue initialValue = field.getInitialValue();<NEW_LINE>if (initialValue != null) {<NEW_LINE>dexPool.internEncodedValue(initialValue);<NEW_LINE>}<NEW_LINE>dexPool.annotationSetSection.intern(field.getAnnotations());<NEW_LINE>ArrayEncodedValue staticInitializers = getStaticInitializers(poolClassDef);<NEW_LINE>if (staticInitializers != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>HashSet<String> methods = new HashSet<String>();<NEW_LINE>for (PoolMethod method : poolClassDef.getMethods()) {<NEW_LINE>String methodDescriptor = DexFormatter.INSTANCE.getShortMethodDescriptor(method);<NEW_LINE>if (!methods.add(methodDescriptor)) {<NEW_LINE>throw new ExceptionWithContext("Multiple definitions for method %s->%s", poolClassDef.getType(), methodDescriptor);<NEW_LINE>}<NEW_LINE>dexPool.methodSection.intern(method);<NEW_LINE>internCode(method);<NEW_LINE>internDebug(method);<NEW_LINE>dexPool.annotationSetSection.intern(method.getAnnotations());<NEW_LINE>for (MethodParameter parameter : method.getParameters()) {<NEW_LINE>dexPool.annotationSetSection.intern(parameter.getAnnotations());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dexPool.annotationSetSection.intern(poolClassDef.getAnnotations());<NEW_LINE>}
dexPool.encodedArraySection.intern(staticInitializers);
1,638,743
private Eh107CacheManager createCacheManager(URI uri, Configuration config, Properties properties) {<NEW_LINE>Collection<ServiceCreationConfiguration<?, ?><MASK><NEW_LINE>Jsr107Service jsr107Service = new DefaultJsr107Service(ServiceUtils.findSingletonAmongst(Jsr107Configuration.class, serviceCreationConfigurations));<NEW_LINE>Eh107CacheLoaderWriterProvider cacheLoaderWriterFactory = new Eh107CacheLoaderWriterProvider();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>DefaultSerializationProviderConfiguration serializerConfiguration = new DefaultSerializationProviderConfiguration().addSerializerFor(Object.class, (Class) PlainJavaSerializer.class);<NEW_LINE>UnaryOperator<ServiceLocator.DependencySet> customization = dependencies -> {<NEW_LINE>ServiceLocator.DependencySet d = dependencies.with(jsr107Service).with(cacheLoaderWriterFactory);<NEW_LINE>if (ServiceUtils.findSingletonAmongst(DefaultSerializationProviderConfiguration.class, serviceCreationConfigurations) == null) {<NEW_LINE>d = d.with(serializerConfiguration);<NEW_LINE>}<NEW_LINE>return d;<NEW_LINE>};<NEW_LINE>org.ehcache.CacheManager ehcacheManager = new EhcacheManager(config, customization, !jsr107Service.jsr107CompliantAtomics());<NEW_LINE>ehcacheManager.init();<NEW_LINE>return new Eh107CacheManager(this, ehcacheManager, jsr107Service, properties, config.getClassLoader(), uri, new ConfigurationMerger(config, jsr107Service, cacheLoaderWriterFactory));<NEW_LINE>}
> serviceCreationConfigurations = config.getServiceCreationConfigurations();
354,718
static Long nextEvent_start(ContentResolver contentResolver, long calendar_id) {<NEW_LINE>final String[] EVENT_PROJECTION = new String[] { // 0<NEW_LINE>// 1<NEW_LINE>CalendarContract.Events._ID, // 2<NEW_LINE>CalendarContract.Events.DTSTART, CalendarContract.Events.DTEND };<NEW_LINE>Calendar calendar = Calendar.getInstance();<NEW_LINE><MASK><NEW_LINE>Uri uri = CalendarContract.Events.CONTENT_URI;<NEW_LINE>String selection = "((" + CalendarContract.Events.CALENDAR_ID + " = ?)" + " AND (" + CalendarContract.Events.DTSTART + " > ?)" + ")";<NEW_LINE>String[] selectionArgs = new String[] { String.valueOf(calendar_id), String.valueOf(current_time) };<NEW_LINE>Cursor cur = contentResolver.query(uri, EVENT_PROJECTION, selection, selectionArgs, CalendarContract.Events.DTSTART + " ASC");<NEW_LINE>if (cur == null)<NEW_LINE>return null;<NEW_LINE>Long res;<NEW_LINE>if (cur.moveToNext())<NEW_LINE>res = cur.getLong(1);<NEW_LINE>else<NEW_LINE>res = null;<NEW_LINE>cur.close();<NEW_LINE>return res;<NEW_LINE>}
long current_time = calendar.getTimeInMillis();
1,629,760
public void handleRequest(HttpServerExchange exchange) throws Exception {<NEW_LINE>var request = MongoRequest.of(exchange);<NEW_LINE>var response = MongoResponse.of(exchange);<NEW_LINE>if (request.isInError()) {<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>UUID sid;<NEW_LINE>try {<NEW_LINE>sid = UUID.fromString(request.getSid());<NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>response.setInError(HttpStatus.SC_NOT_ACCEPTABLE, "Invalid session id");<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var cs = TxnClientSessionFactory.<MASK><NEW_LINE>if (cs.getTxnServerStatus().getTxnId() != request.getTxnId() || cs.getTxnServerStatus().getStatus() != Txn.TransactionStatus.IN) {<NEW_LINE>response.setInError(HttpStatus.SC_NOT_ACCEPTABLE, "The given transaction is not in-progress");<NEW_LINE>} else {<NEW_LINE>cs.setMessageSentInCurrentTransaction(true);<NEW_LINE>cs.abortTransaction();<NEW_LINE>response.setContentTypeAsJson();<NEW_LINE>response.setStatusCode(HttpStatus.SC_NO_CONTENT);<NEW_LINE>}<NEW_LINE>next(exchange);<NEW_LINE>}
getInstance().getTxnClientSession(sid);
1,721,853
List<Tag> readTags(Tag[] tagsArray, byte numberOfTags) {<NEW_LINE>List<Tag> tags = new ArrayList<>();<NEW_LINE>tagIds.clear();<NEW_LINE>int maxTag = tagsArray.length;<NEW_LINE>for (byte tagIndex = numberOfTags; tagIndex != 0; --tagIndex) {<NEW_LINE>int tagId = readUnsignedInt();<NEW_LINE>if (tagId < 0 || tagId >= maxTag) {<NEW_LINE>LOGGER.warning("invalid tag ID: " + tagId);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>tagIds.add(tagId);<NEW_LINE>}<NEW_LINE>for (int tagId : tagIds) {<NEW_LINE>Tag tag = tagsArray[tagId];<NEW_LINE>// Decode variable values of tags<NEW_LINE>if (tag.value.length() == 2 && tag.value.charAt(0) == '%') {<NEW_LINE>String value = tag.value;<NEW_LINE>if (value.charAt(1) == 'b') {<NEW_LINE>value = <MASK><NEW_LINE>} else if (value.charAt(1) == 'i') {<NEW_LINE>if (tag.key.contains(":colour")) {<NEW_LINE>value = "#" + Integer.toHexString(readInt());<NEW_LINE>} else {<NEW_LINE>value = String.valueOf(readInt());<NEW_LINE>}<NEW_LINE>} else if (value.charAt(1) == 'f') {<NEW_LINE>value = String.valueOf(readFloat());<NEW_LINE>} else if (value.charAt(1) == 'h') {<NEW_LINE>value = String.valueOf(readShort());<NEW_LINE>} else if (value.charAt(1) == 's') {<NEW_LINE>value = readUTF8EncodedString();<NEW_LINE>}<NEW_LINE>tag = new Tag(tag.key, value);<NEW_LINE>}<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>return tags;<NEW_LINE>}
String.valueOf(readByte());
1,263,552
protected void write(ClassWriter classWriter, MethodWriter methodWriter, WriteScope writeScope) {<NEW_LINE>methodWriter.writeStatementOffset(getLocation());<NEW_LINE>Variable variable = writeScope.defineVariable(variableType, variableName);<NEW_LINE>Variable array = writeScope.defineInternalVariable(arrayType, arrayName);<NEW_LINE>Variable index = <MASK><NEW_LINE>getConditionNode().write(classWriter, methodWriter, writeScope);<NEW_LINE>methodWriter.visitVarInsn(array.getAsmType().getOpcode(Opcodes.ISTORE), array.getSlot());<NEW_LINE>methodWriter.push(-1);<NEW_LINE>methodWriter.visitVarInsn(index.getAsmType().getOpcode(Opcodes.ISTORE), index.getSlot());<NEW_LINE>Label begin = new Label();<NEW_LINE>Label end = new Label();<NEW_LINE>methodWriter.mark(begin);<NEW_LINE>methodWriter.visitIincInsn(index.getSlot(), 1);<NEW_LINE>methodWriter.visitVarInsn(index.getAsmType().getOpcode(Opcodes.ILOAD), index.getSlot());<NEW_LINE>methodWriter.visitVarInsn(array.getAsmType().getOpcode(Opcodes.ILOAD), array.getSlot());<NEW_LINE>methodWriter.arrayLength();<NEW_LINE>methodWriter.ifICmp(MethodWriter.GE, end);<NEW_LINE>methodWriter.visitVarInsn(array.getAsmType().getOpcode(Opcodes.ILOAD), array.getSlot());<NEW_LINE>methodWriter.visitVarInsn(index.getAsmType().getOpcode(Opcodes.ILOAD), index.getSlot());<NEW_LINE>methodWriter.arrayLoad(MethodWriter.getType(indexedType));<NEW_LINE>methodWriter.writeCast(cast);<NEW_LINE>methodWriter.visitVarInsn(variable.getAsmType().getOpcode(Opcodes.ISTORE), variable.getSlot());<NEW_LINE>Variable loop = writeScope.getInternalVariable("loop");<NEW_LINE>if (loop != null) {<NEW_LINE>methodWriter.writeLoopCounter(loop.getSlot(), getLocation());<NEW_LINE>}<NEW_LINE>getBlockNode().continueLabel = begin;<NEW_LINE>getBlockNode().breakLabel = end;<NEW_LINE>getBlockNode().write(classWriter, methodWriter, writeScope);<NEW_LINE>methodWriter.goTo(begin);<NEW_LINE>methodWriter.mark(end);<NEW_LINE>}
writeScope.defineInternalVariable(indexType, indexName);
869,264
protected Proxy validateProxyConfigFields() {<NEW_LINE>boolean isConfigValid = true;<NEW_LINE>int proxyTypeId = ((RadioGroup) mProxyConfigDialog.findViewById(R.id.proxy_type)).getCheckedRadioButtonId();<NEW_LINE>if (proxyTypeId == -1) {<NEW_LINE>isConfigValid = false;<NEW_LINE>appendStatusMessage(R.string.proxy_type_invalid);<NEW_LINE>mProxyConfigDialog.findViewById(R.id.proxy_type_http).requestFocus();<NEW_LINE>}<NEW_LINE>String proxyHost = ((EditText) mProxyConfigDialog.findViewById(R.id.proxy_host)).getText().toString();<NEW_LINE>if (proxyHost.isEmpty()) {<NEW_LINE>isConfigValid = false;<NEW_LINE>appendStatusMessage(R.string.proxy_host_invalid);<NEW_LINE>}<NEW_LINE>String proxyPortString = ((EditText) mProxyConfigDialog.findViewById(R.id.proxy_port)).getText().toString();<NEW_LINE>int proxyPort = proxyPortString.isEmpty() ? 0 : Integer.parseInt(proxyPortString);<NEW_LINE>if (proxyPort <= 0) {<NEW_LINE>isConfigValid = false;<NEW_LINE>appendStatusMessage(R.string.proxy_port_invalid);<NEW_LINE>}<NEW_LINE>String proxyUser = ((EditText) mProxyConfigDialog.findViewById(R.id.proxy_username)).getText().toString();<NEW_LINE>String proxyPassword = ((EditText) mProxyConfigDialog.findViewById(R.id.proxy_password)).getText().toString();<NEW_LINE>if (proxyUser.isEmpty() != proxyPassword.isEmpty()) {<NEW_LINE>isConfigValid = false;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (!isConfigValid) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Proxy.Type proxyType = proxyTypeId == R.id.proxy_type_http ? Proxy.Type.HTTP : Proxy.Type.SOCKS;<NEW_LINE>return new Proxy(proxyType, PasswdInetSocketAddress.createUnresolved(proxyHost, proxyPort, proxyUser, proxyPassword));<NEW_LINE>}
appendStatusMessage(R.string.proxy_credentials_invalid);
1,455,190
private Predicate toFilterPredicate(EffectivePerson effectivePerson, Business business, Wi wi) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Draft.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Draft> cq = cb.createQuery(Draft.class);<NEW_LINE>Root<Draft> root = cq.from(Draft.class);<NEW_LINE>Predicate p = cb.equal(root.get(Draft_.person), effectivePerson.getDistinguishedName());<NEW_LINE>if (ListTools.isNotEmpty(wi.getApplicationList())) {<NEW_LINE>p = cb.and(p, root.get(Draft_.application).in(wi.getApplicationList()));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getProcessList())) {<NEW_LINE>if (BooleanUtils.isFalse(wi.getRelateEditionProcess())) {<NEW_LINE>p = cb.and(p, root.get(Draft_.process).in(wi.getProcessList()));<NEW_LINE>} else {<NEW_LINE>p = cb.and(p, root.get(Draft_.process).in(business.process().listEditionProcess(wi.getProcessList())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (DateTools.isDateTimeOrDate(wi.getStartTime())) {<NEW_LINE>p = cb.and(p, cb.greaterThan(root.get(Draft_.createTime), DateTools.parse(<MASK><NEW_LINE>}<NEW_LINE>if (DateTools.isDateTimeOrDate(wi.getEndTime())) {<NEW_LINE>p = cb.and(p, cb.lessThan(root.get(Draft_.createTime), DateTools.parse(wi.getEndTime())));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getCreatorUnitList())) {<NEW_LINE>p = cb.and(p, root.get(Draft_.unit).in(wi.getCreatorUnitList()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNoneBlank(wi.getTitle())) {<NEW_LINE>String key = StringTools.escapeSqlLikeKey(wi.getTitle());<NEW_LINE>p = cb.and(p, cb.like(root.get(Draft_.title), "%" + key + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>}<NEW_LINE>return p;<NEW_LINE>}
wi.getStartTime())));
1,077,682
protected SchemaRegistryClient client() {<NEW_LINE>if (null == this.client) {<NEW_LINE>Map<String, String> config = new HashMap<>();<NEW_LINE>if (configs != null && !configs.isEmpty()) {<NEW_LINE>config.putAll(configs);<NEW_LINE>}<NEW_LINE>if (userInfoConfig != null) {<NEW_LINE>// Note that BASIC_AUTH_CREDENTIALS_SOURCE is not configurable as the plugin only supports<NEW_LINE>// a single schema registry URL, so there is no additional utility of the URL source.<NEW_LINE>config.<MASK><NEW_LINE>config.put(SchemaRegistryClientConfig.USER_INFO_CONFIG, userInfoConfig);<NEW_LINE>}<NEW_LINE>List<SchemaProvider> providers = schemaProviders != null && !schemaProviders.isEmpty() ? schemaProviders() : MojoUtils.defaultSchemaProviders();<NEW_LINE>this.client = new CachedSchemaRegistryClient(this.schemaRegistryUrls, 1000, providers, config, httpHeaders);<NEW_LINE>}<NEW_LINE>return this.client;<NEW_LINE>}
put(SchemaRegistryClientConfig.BASIC_AUTH_CREDENTIALS_SOURCE, "USER_INFO");
1,161,216
public void init(IExportDialogAdapter adapter, Composite container, IFigure figure) {<NEW_LINE>setFigure(figure);<NEW_LINE>container.setLayout(new GridLayout(8, false));<NEW_LINE>container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>fSetViewboxButton = new Button(container, SWT.CHECK);<NEW_LINE>fSetViewboxButton.setText(Messages.SVGExportProvider_0);<NEW_LINE>GridData gd = new GridData();<NEW_LINE>gd.horizontalSpan = 8;<NEW_LINE>fSetViewboxButton.setLayoutData(gd);<NEW_LINE>fSetViewboxButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>updateControls();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int min = -10000;<NEW_LINE>int max = 10000;<NEW_LINE>Label label = new Label(container, SWT.NONE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>label.setText(" " + Messages.SVGExportProvider_2);<NEW_LINE>fSpinner1 = new Spinner(container, SWT.BORDER);<NEW_LINE>fSpinner1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>fSpinner1.setMinimum(min);<NEW_LINE>fSpinner1.setMaximum(max);<NEW_LINE>label = new Label(container, SWT.NONE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>label.setText(" " + Messages.SVGExportProvider_3);<NEW_LINE>fSpinner2 = new Spinner(container, SWT.BORDER);<NEW_LINE>fSpinner2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>fSpinner2.setMinimum(min);<NEW_LINE>fSpinner2.setMaximum(max);<NEW_LINE>label = new Label(container, SWT.NONE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>label.setText(" " + Messages.SVGExportProvider_4);<NEW_LINE>fSpinner3 = new Spinner(container, SWT.BORDER);<NEW_LINE>fSpinner3.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>fSpinner3.setMaximum(max);<NEW_LINE>label = new Label(container, SWT.NONE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>label.setText(" " + Messages.SVGExportProvider_5);<NEW_LINE>fSpinner4 = new Spinner(container, SWT.BORDER);<NEW_LINE>fSpinner4.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>fSpinner4.setMaximum(max);<NEW_LINE>loadPreferences();<NEW_LINE>// Set viewBox width and height to the image size<NEW_LINE><MASK><NEW_LINE>fSpinner4.setSelection(viewPortBounds.height);<NEW_LINE>}
fSpinner3.setSelection(viewPortBounds.width);
727,256
FloatBuffer mergeSortIn(final FloatBuffer bufIn) {<NEW_LINE>if (!sorted_ || !bufIn.isSorted()) {<NEW_LINE>throw new SketchesArgumentException("Both buffers must be sorted.");<NEW_LINE>}<NEW_LINE>// may be larger than its item count.<NEW_LINE>final float[] arrIn = bufIn.getArray();<NEW_LINE>final int bufInLen = bufIn.getCount();<NEW_LINE>ensureSpace(bufInLen);<NEW_LINE>final int totLen = count_ + bufInLen;<NEW_LINE>if (spaceAtBottom_) {<NEW_LINE>// scan up, insert at bottom<NEW_LINE>final int tgtStart = capacity_ - totLen;<NEW_LINE>int i = capacity_ - count_;<NEW_LINE>int j = bufIn.capacity_ - bufIn.count_;<NEW_LINE>for (int k = tgtStart; k < capacity_; k++) {<NEW_LINE>if (i < capacity_ && j < bufIn.capacity_) {<NEW_LINE>// both valid<NEW_LINE>arr_[k] = arr_[i] <= arrIn[j] ? arr_[i++] : arrIn[j++];<NEW_LINE>} else if (i < capacity_) {<NEW_LINE>// i is valid<NEW_LINE>arr_[k] = arr_[i++];<NEW_LINE>} else if (j < bufIn.capacity_) {<NEW_LINE>// j is valid<NEW_LINE>arr_[k] = arrIn[j++];<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// scan down, insert at top<NEW_LINE>int i = count_ - 1;<NEW_LINE>int j = bufInLen - 1;<NEW_LINE>for (int k = totLen; k-- > 0; ) {<NEW_LINE>if (i >= 0 && j >= 0) {<NEW_LINE>// both valid<NEW_LINE>arr_[k] = arr_[i] >= arrIn[j] ? arr_[i--] : arrIn[j--];<NEW_LINE>} else if (i >= 0) {<NEW_LINE>// i is valid<NEW_LINE>arr_[k] = arr_[i--];<NEW_LINE>} else if (j >= 0) {<NEW_LINE>// j is valid<NEW_LINE>arr_[<MASK><NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>count_ += bufInLen;<NEW_LINE>sorted_ = true;<NEW_LINE>return this;<NEW_LINE>}
k] = arrIn[j--];
1,621,643
public OsStats osStats() {<NEW_LINE>final long uptime = -1L;<NEW_LINE>final double systemLoadAverage = ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();<NEW_LINE>final double[] loadAverage = systemLoadAverage < 0.0d ? new double[0] : new double[] { systemLoadAverage };<NEW_LINE>final Processor processor = Processor.create("Unknown", "Unknown", -1, -1, -1, -1, -1L, (short) -1, (short) -1, (short) -1, (short) -1);<NEW_LINE>final Memory memory = Memory.create(-1L, -1L, (short) -1, -1L, (short) -1, -1L, -1L);<NEW_LINE>final Swap swap = Swap.create(-<MASK><NEW_LINE>return OsStats.create(loadAverage, uptime, processor, memory, swap);<NEW_LINE>}
1L, -1L, -1L);
735,572
private boolean areSinglesFoundInData(AuditData auditResults, SearchPatternsSingleton searchPatterns) throws Exception {<NEW_LINE>String thisMethod = "areSinglesFoundInData";<NEW_LINE>boolean searchedOnce = false;<NEW_LINE>String firstSearchedSequenceNum, lastSearchedSequenceNum = "notSet";<NEW_LINE>for (String auditEntry : auditResults.read()) {<NEW_LINE>JSONObject jsonRecord = JSONObject.parse(auditEntry);<NEW_LINE>if (!searchedOnce) {<NEW_LINE>searchedOnce = true;<NEW_LINE>firstSearchedSequenceNum = jsonRecord.get("eventSequenceNumber").toString();<NEW_LINE>Log.info(<MASK><NEW_LINE>}<NEW_LINE>lastSearchedSequenceNum = jsonRecord.get("eventSequenceNumber").toString();<NEW_LINE>// check for any of the search patterns in the set of searchPatterns within JSON audit record<NEW_LINE>if (searchPatterns.matchedAny(jsonRecord)) {<NEW_LINE>Log.info(logClass, thisMethod, "\n Audit Expected: No match should be found for pattern:" + searchPatterns.mostRecentlyMatchedPattern() + "\n Audit Result: Pattern matched in audit log at eventSequenceNumber " + jsonRecord.get("eventSequenceNumber").toString());<NEW_LINE>Log.info(logClass, thisMethod, "----- Stopped searching audit log at eventSequenceNumber: " + lastSearchedSequenceNum);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.info(logClass, thisMethod, "----- Stopped searching audit log at eventSequenceNumber: " + lastSearchedSequenceNum);<NEW_LINE>return false;<NEW_LINE>}
logClass, thisMethod, "----- Started searching audit log at eventSequenceNumber: " + firstSearchedSequenceNum);
307,751
private void migrateFunds(Keccak256 rskTxHash, Wallet retiringFederationWallet, Address activeFederationAddress, List<UTXO> availableUTXOs) throws IOException {<NEW_LINE>ReleaseTransactionSet releaseTransactionSet = provider.getReleaseTransactionSet();<NEW_LINE>Pair<BtcTransaction, List<UTXO>> <MASK><NEW_LINE>BtcTransaction btcTx = createResult.getLeft();<NEW_LINE>List<UTXO> selectedUTXOs = createResult.getRight();<NEW_LINE>// Add the TX to the release set<NEW_LINE>if (activations.isActive(ConsensusRule.RSKIP146)) {<NEW_LINE>Coin amountMigrated = selectedUTXOs.stream().map(UTXO::getValue).reduce(Coin.ZERO, Coin::add);<NEW_LINE>releaseTransactionSet.add(btcTx, rskExecutionBlock.getNumber(), rskTxHash);<NEW_LINE>// Log the Release request<NEW_LINE>eventLogger.logReleaseBtcRequested(rskTxHash.getBytes(), btcTx, amountMigrated);<NEW_LINE>} else {<NEW_LINE>releaseTransactionSet.add(btcTx, rskExecutionBlock.getNumber());<NEW_LINE>}<NEW_LINE>// Mark UTXOs as spent<NEW_LINE>availableUTXOs.removeIf(utxo -> selectedUTXOs.stream().anyMatch(selectedUtxo -> utxo.getHash().equals(selectedUtxo.getHash()) && utxo.getIndex() == selectedUtxo.getIndex()));<NEW_LINE>}
createResult = createMigrationTransaction(retiringFederationWallet, activeFederationAddress);
1,763,737
protected void init() {<NEW_LINE>myRoot = new Wrapper();<NEW_LINE>OnePixelSplitter splitter <MASK><NEW_LINE>myRoot.setContent(splitter);<NEW_LINE>myDescriptionPanel = new PluginDescriptionPanel();<NEW_LINE>splitter.setSecondComponent(myDescriptionPanel.getPanel());<NEW_LINE>myTablePanel = new JPanel(new BorderLayout());<NEW_LINE>splitter.setFirstComponent(myTablePanel);<NEW_LINE>PluginTable table = createTable();<NEW_LINE>myPluginTable = table;<NEW_LINE>installTableActions();<NEW_LINE>myTablePanel.add(ScrollPaneFactory.createScrollPane(table, true), BorderLayout.CENTER);<NEW_LINE>final JPanel header = new JPanel(new BorderLayout()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void paintComponent(Graphics g) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>g.setColor(UIUtil.getPanelBackground());<NEW_LINE>g.fillRect(0, 0, getWidth(), getHeight());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>header.setBorder(new CustomLineBorder(0, 0, JBUI.scale(1), 0));<NEW_LINE>LabelPopup sortLabel = new LabelPopup(LocalizeValue.localizeTODO("Sort by:"), labelPopup -> createSortersGroup());<NEW_LINE>header.add(myFilter, BorderLayout.CENTER);<NEW_LINE>JPanel rightHelpPanel = new JPanel(new HorizontalLayout(JBUI.scale(5)));<NEW_LINE>rightHelpPanel.add(sortLabel);<NEW_LINE>addCustomFilters(rightHelpPanel::add);<NEW_LINE>BorderLayoutPanel botton = new BorderLayoutPanel();<NEW_LINE>botton.setBorder(new CustomLineBorder(JBUI.scale(1), 0, 0, 0));<NEW_LINE>header.add(botton.addToRight(rightHelpPanel), BorderLayout.SOUTH);<NEW_LINE>myTablePanel.add(header, BorderLayout.NORTH);<NEW_LINE>final TableModelListener modelListener = e -> {<NEW_LINE>String text = "name";<NEW_LINE>if (myPluginsModel.isSortByStatus()) {<NEW_LINE>text = "status";<NEW_LINE>} else if (myPluginsModel.isSortByRating()) {<NEW_LINE>text = "rating";<NEW_LINE>} else if (myPluginsModel.isSortByDownloads()) {<NEW_LINE>text = "downloads";<NEW_LINE>} else if (myPluginsModel.isSortByUpdated()) {<NEW_LINE>text = "updated";<NEW_LINE>}<NEW_LINE>sortLabel.setPrefixedText(LocalizeValue.of(text));<NEW_LINE>};<NEW_LINE>myPluginTable.getModel().addTableModelListener(modelListener);<NEW_LINE>modelListener.tableChanged(null);<NEW_LINE>}
= new OnePixelSplitter(false, 0.5f);
279,772
private void doDrop(@Nonnull TreePath target, PsiElement[] sources) {<NEW_LINE><MASK><NEW_LINE>if (targetElement == null)<NEW_LINE>return;<NEW_LINE>if (DumbService.isDumb(myProject)) {<NEW_LINE>Messages.showMessageDialog(myProject, "Copy refactoring is not available while indexing is in progress", "Indexing", null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final PsiDirectory psiDirectory;<NEW_LINE>if (targetElement instanceof PsiDirectoryContainer) {<NEW_LINE>final PsiDirectoryContainer directoryContainer = (PsiDirectoryContainer) targetElement;<NEW_LINE>final PsiDirectory[] psiDirectories = directoryContainer.getDirectories();<NEW_LINE>psiDirectory = psiDirectories.length != 0 ? psiDirectories[0] : null;<NEW_LINE>} else if (targetElement instanceof PsiDirectory) {<NEW_LINE>psiDirectory = (PsiDirectory) targetElement;<NEW_LINE>} else {<NEW_LINE>final PsiFile containingFile = targetElement.getContainingFile();<NEW_LINE>LOG.assertTrue(containingFile != null, targetElement);<NEW_LINE>psiDirectory = containingFile.getContainingDirectory();<NEW_LINE>}<NEW_LINE>TransactionGuard.getInstance().submitTransactionAndWait(() -> CopyHandler.doCopy(sources, psiDirectory));<NEW_LINE>}
final PsiElement targetElement = getPsiElement(target);
1,314,825
// Method to create files from directories/files tree in destination<NEW_LINE>private void createFiles(TreeNode node, String namespace, String pod, String container, String srcPath, Path destination) throws IOException, ApiException {<NEW_LINE>if (node == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (TreeNode childNode : node.getChildren()) {<NEW_LINE>if (!childNode.isDir) {<NEW_LINE>// Create file which is under 'node'<NEW_LINE>String filePath = genericPathBuilder(destination.toString(), childNode.name);<NEW_LINE>File f = new File(filePath);<NEW_LINE>if (!f.createNewFile()) {<NEW_LINE>throw new IOException("Failed to create file: " + f);<NEW_LINE>}<NEW_LINE>String modifiedSrcPath = <MASK><NEW_LINE>try (InputStream is = copyFileFromPod(namespace, pod, modifiedSrcPath);<NEW_LINE>OutputStream fs = new FileOutputStream(f)) {<NEW_LINE>Streams.copy(is, fs);<NEW_LINE>fs.flush();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String newSrcPath = genericPathBuilder(srcPath, childNode.name);<NEW_LINE>// TODO: Change this once the method genericPathBuilder is changed to varargs<NEW_LINE>Path newDestination = Paths.get(destination.toString(), childNode.name);<NEW_LINE>createFiles(childNode, namespace, pod, container, newSrcPath, newDestination);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
genericPathBuilder(srcPath, childNode.name);
418,006
public List<AdbMySqlTable> findTable(String schemaName, String[] tableName) throws SQLException {<NEW_LINE>List<<MASK><NEW_LINE>if (tableList.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>String queryString;<NEW_LINE>Object[] queryArgs;<NEW_LINE>if (StringUtils.isBlank(schemaName)) {<NEW_LINE>queryString = TABLE + " where TABLE_NAME in " + buildWhereIn(tableList);<NEW_LINE>queryArgs = tableList.toArray();<NEW_LINE>} else {<NEW_LINE>queryString = TABLE + " where TABLE_SCHEMA = ? and TABLE_NAME in " + buildWhereIn(tableList);<NEW_LINE>ArrayList<String> args = new ArrayList<>(tableList);<NEW_LINE>args.add(0, schemaName);<NEW_LINE>queryArgs = args.toArray();<NEW_LINE>}<NEW_LINE>try (Connection conn = this.connectSupplier.eGet()) {<NEW_LINE>List<Map<String, Object>> mapList = new JdbcTemplate(conn).queryForList(queryString, queryArgs);<NEW_LINE>if (mapList == null) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>return mapList.stream().map(this::convertTable).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>}
String> tableList = stringArray2List(tableName);
922,559
public ListBotsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListBotsResult listBotsResult = new ListBotsResult();<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 listBotsResult;<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("botSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listBotsResult.setBotSummaries(new ListUnmarshaller<BotSummary>(BotSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listBotsResult.setNextToken(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 listBotsResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
384,920
// Perform preflight checks on the given node.<NEW_LINE>public String performPreflightCheck(Cluster cluster, NodeDetails currentNode, @Nullable UUID rootCA, @Nullable UUID clientRootCA) {<NEW_LINE>if (cluster.userIntent.providerType != com.yugabyte.yw.commissioner.Common.CloudType.onprem) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>NodeTaskParams preflightTaskParams = new NodeTaskParams();<NEW_LINE>UserIntent userIntent = cluster.userIntent;<NEW_LINE>preflightTaskParams.nodeName = currentNode.nodeName;<NEW_LINE>preflightTaskParams.deviceInfo = userIntent.deviceInfo;<NEW_LINE>preflightTaskParams.azUuid = currentNode.azUuid;<NEW_LINE>preflightTaskParams<MASK><NEW_LINE>preflightTaskParams.rootCA = rootCA;<NEW_LINE>preflightTaskParams.clientRootCA = clientRootCA;<NEW_LINE>UniverseTaskParams.CommunicationPorts.exportToCommunicationPorts(preflightTaskParams.communicationPorts, currentNode);<NEW_LINE>preflightTaskParams.extraDependencies.installNodeExporter = taskParams().extraDependencies.installNodeExporter;<NEW_LINE>// Create the process to fetch information about the node from the cloud provider.<NEW_LINE>NodeManager nodeManager = Play.current().injector().instanceOf(NodeManager.class);<NEW_LINE>log.info("Running preflight checks for node {}.", preflightTaskParams.nodeName);<NEW_LINE>ShellResponse response = nodeManager.nodeCommand(NodeManager.NodeCommandType.Precheck, preflightTaskParams);<NEW_LINE>if (response.code == 0) {<NEW_LINE>JsonNode responseJson = Json.parse(response.message);<NEW_LINE>for (JsonNode nodeContent : responseJson) {<NEW_LINE>if (!nodeContent.isBoolean() || !nodeContent.asBoolean()) {<NEW_LINE>String errString = "Failed preflight checks for node " + preflightTaskParams.nodeName + ":\n" + response.message;<NEW_LINE>log.error(errString);<NEW_LINE>return response.message;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
.universeUUID = taskParams().universeUUID;
925,014
void initializeInstrument(Object polyglotInstrument, String instrumentClassName, Supplier<? extends Object> instrumentSupplier) {<NEW_LINE>if (TRACE) {<NEW_LINE>trace("Initialize instrument class %s %n", instrumentClassName);<NEW_LINE>}<NEW_LINE>Env env = new Env(polyglotInstrument, out, err, in, messageInterceptor);<NEW_LINE>TruffleInstrument instrument = (TruffleInstrument) instrumentSupplier.get();<NEW_LINE>if (instrument.contextLocals == null) {<NEW_LINE>instrument.contextLocals = Collections.emptyList();<NEW_LINE>} else {<NEW_LINE>instrument.contextLocals = Collections.unmodifiableList(instrument.contextLocals);<NEW_LINE>}<NEW_LINE>ENGINE.initializeInstrumentContextLocal(instrument.contextLocals, polyglotInstrument);<NEW_LINE>if (instrument.contextThreadLocals == null) {<NEW_LINE>instrument.contextThreadLocals = Collections.emptyList();<NEW_LINE>} else {<NEW_LINE>instrument.contextThreadLocals = Collections.unmodifiableList(instrument.contextThreadLocals);<NEW_LINE>}<NEW_LINE>ENGINE.initializeInstrumentContextThreadLocal(instrument.contextThreadLocals, polyglotInstrument);<NEW_LINE>try {<NEW_LINE>env.instrumenter = new InstrumentClientInstrumenter(env, instrumentClassName);<NEW_LINE>env.instrumenter.instrument = instrument;<NEW_LINE>} catch (Exception e) {<NEW_LINE>failInstrumentInitialization(env, String.format("Failed to create new instrumenter class %s", instrumentClassName), e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (TRACE) {<NEW_LINE>trace("Initialized instrument %s class %s %n", <MASK><NEW_LINE>}<NEW_LINE>addInstrumenter(polyglotInstrument, env.instrumenter);<NEW_LINE>}
env.instrumenter.instrument, instrumentClassName);
1,444,782
private // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>setFocusable(false);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor <MASK><NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 0);<NEW_LINE>add(propertyCombo, gridBagConstraints);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 1;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 12);<NEW_LINE>add(relationCombo, gridBagConstraints);<NEW_LINE>emptyPanel.setOpaque(false);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);<NEW_LINE>add(emptyPanel, gridBagConstraints);<NEW_LINE>}
= java.awt.GridBagConstraints.NORTHWEST;
720,304
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "DataBrew");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<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.OPERATION_NAME, "TagResource");
611,966
private Mono<PagedResponse<DatabaseInner>> listByClusterSinglePageAsync(String resourceGroupName, String clusterName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (clusterName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByCluster(this.client.getEndpoint(), resourceGroupName, clusterName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));<NEW_LINE>}
error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
593,608
private void handle(final DetachPrimaryStorageFromClusterMsg msg) {<NEW_LINE>final DetachPrimaryStorageFromClusterReply reply = new DetachPrimaryStorageFromClusterReply();<NEW_LINE>thdf.chainSubmit(new ChainTask(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getSyncSignature() {<NEW_LINE>return getSyncId();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(final SyncTaskChain chain) {<NEW_LINE>extpEmitter.beforeDetach(self, msg.getClusterUuid());<NEW_LINE>detachHook(msg.getClusterUuid(), new Completion(msg, chain) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE><MASK><NEW_LINE>extpEmitter.afterDetach(self, msg.getClusterUuid());<NEW_LINE>logger.debug(String.format("successfully detached primary storage[name: %s, uuid:%s]", self.getName(), self.getUuid()));<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>extpEmitter.failToDetach(self, msg.getClusterUuid());<NEW_LINE>logger.warn(errorCode.toString());<NEW_LINE>reply.setError(err(PrimaryStorageErrors.DETACH_ERROR, errorCode, errorCode.getDetails()));<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getName() {<NEW_LINE>return String.format("detach-primary-storage-%s-from-%s", self.getUuid(), msg.getClusterUuid());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
self = dbf.reload(self);
709,631
static Class<?>[] extractTypeParameters(ParameterizedType genericType) {<NEW_LINE>ParameterizedType parameterizedType = genericType;<NEW_LINE>// e.g. ? extends Number<NEW_LINE>Type[] paramTypes = parameterizedType.getActualTypeArguments();<NEW_LINE>Class<?>[] result = new Class<?>[paramTypes.length];<NEW_LINE>for (int i = 0; i < paramTypes.length; i++) {<NEW_LINE>if (// e.g. Long<NEW_LINE>// e.g. Long<NEW_LINE>paramTypes[i] instanceof Class) {<NEW_LINE>result[i] = (Class<?>) paramTypes[i];<NEW_LINE>continue;<NEW_LINE>} else if (paramTypes[i] instanceof WildcardType) {<NEW_LINE>// e.g. ? extends Number<NEW_LINE>WildcardType wildcardType = (WildcardType) paramTypes[i];<NEW_LINE>// e.g. []<NEW_LINE>Type[] lower = wildcardType.getLowerBounds();<NEW_LINE>if (lower.length > 0 && lower[0] instanceof Class) {<NEW_LINE>result[i] = (Class<?>) lower[0];<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// e.g. Number<NEW_LINE>Type[] upper = wildcardType.getUpperBounds();<NEW_LINE>if (upper.length > 0 && upper[0] instanceof Class) {<NEW_LINE>result[i] = (Class<?>) upper[0];<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (paramTypes[i] instanceof GenericArrayType) {<NEW_LINE>GenericArrayType gat <MASK><NEW_LINE>if (char.class.equals(gat.getGenericComponentType())) {<NEW_LINE>result[i] = char[].class;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// too convoluted generic type, giving up<NEW_LINE>Arrays.fill(result, String.class);<NEW_LINE>// too convoluted generic type, giving up<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>// we inferred all types from ParameterizedType<NEW_LINE>return result;<NEW_LINE>}
= (GenericArrayType) paramTypes[i];
755,937
final DescribeDatasetResult executeDescribeDataset(DescribeDatasetRequest describeDatasetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDatasetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDatasetRequest> request = null;<NEW_LINE>Response<DescribeDatasetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDatasetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDatasetRequest));<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, "LookoutVision");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDataset");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDatasetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDatasetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);