idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,379,232
private static PitchTarget[] computePitchTargets(Document acoustparams) {<NEW_LINE>ArrayList<PitchTarget> targets = new ArrayList<PitchTarget>();<NEW_LINE>String PHONE = "ph";<NEW_LINE>String A_PHONE_DURATION = "d";<NEW_LINE>String A_F0 = "f0";<NEW_LINE>String BOUNDARY = "boundary";<NEW_LINE>String A_BOUNDARY_DURATION = "duration";<NEW_LINE>NodeIterator it = DomUtils.<MASK><NEW_LINE>Element e = null;<NEW_LINE>double startTime = 0;<NEW_LINE>double endTime = 0;<NEW_LINE>double duration = 0;<NEW_LINE>while ((e = (Element) it.nextNode()) != null) {<NEW_LINE>startTime = /* previous */<NEW_LINE>endTime;<NEW_LINE>if (e.getTagName().equals(PHONE)) {<NEW_LINE>duration = 0.001 * Double.parseDouble(e.getAttribute(A_PHONE_DURATION));<NEW_LINE>endTime = startTime + duration;<NEW_LINE>} else {<NEW_LINE>// BOUNDARY<NEW_LINE>duration = 0.001 * Double.parseDouble(e.getAttribute(A_BOUNDARY_DURATION));<NEW_LINE>endTime = startTime + duration;<NEW_LINE>// no f0 targets for boundaries<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>assert e.getTagName().equals(PHONE);<NEW_LINE>assert startTime < endTime : "for phone '" + e.getAttribute("p") + "', startTime " + startTime + " is not less than endTime " + endTime;<NEW_LINE>String f0String = e.getAttribute(A_F0).trim();<NEW_LINE>if (f0String.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int[] localF0Targets = StringUtils.parseIntPairs(f0String);<NEW_LINE>for (int i = 0, len = localF0Targets.length / 2; i < len; i++) {<NEW_LINE>int percent = localF0Targets[2 * i];<NEW_LINE>int hertz = localF0Targets[2 * i + 1];<NEW_LINE>double time = startTime + 0.01 * percent * (endTime - startTime);<NEW_LINE>targets.add(new PitchTarget(time, hertz));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return targets.toArray(new PitchTarget[0]);<NEW_LINE>}
createNodeIterator(acoustparams, PHONE, BOUNDARY);
686,513
private boolean startDownloadRpc(FileReferenceDownload fileReferenceDownload, int retryCount, Connection connection) {<NEW_LINE>Request request = createRequest(fileReferenceDownload);<NEW_LINE>Duration rpcTimeout = rpcTimeout(retryCount);<NEW_LINE>connection.invokeSync(request, rpcTimeout.getSeconds());<NEW_LINE>Level logLevel = (retryCount > 3 ? Level.INFO : Level.FINE);<NEW_LINE><MASK><NEW_LINE>if (validateResponse(request)) {<NEW_LINE>log.log(Level.FINE, () -> "Request callback, OK. Req: " + request + "\nSpec: " + connection);<NEW_LINE>if (request.returnValues().get(0).asInt32() == 0) {<NEW_LINE>log.log(Level.FINE, () -> "Found " + fileReference + " available at " + connection.getAddress());<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>log.log(logLevel, fileReference + " not found at " + connection.getAddress());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.log(logLevel, "Downloading " + fileReference + " from " + connection.getAddress() + " failed:" + " error code " + request.errorCode() + " (" + request.errorMessage() + ")." + " (retry " + retryCount + ", rpc timeout " + rpcTimeout + ")");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
FileReference fileReference = fileReferenceDownload.fileReference();
405,141
private void drawTileCoordinates(TilePosition tilePosition, Canvas canvas) {<NEW_LINE>Tile tile = tilePosition.tile;<NEW_LINE>if (drawSimple) {<NEW_LINE>stringBuilder.setLength(0);<NEW_LINE>stringBuilder.append(tile.zoomLevel).append(" / ").append(tile.tileX).append(" / ").append(tile.tileY);<NEW_LINE>String text = stringBuilder.toString();<NEW_LINE>int x = (int) (tilePosition.point.x + (tile.tileSize - this.paintBack.getTextWidth(text)) / 2);<NEW_LINE>int y = (int) (tilePosition.point.y + (tile.tileSize + this.paintBack.getTextHeight(text)) / 2);<NEW_LINE>canvas.drawText(text, x, y, this.paintBack);<NEW_LINE>canvas.drawText(text, x, y, this.paintFront);<NEW_LINE>} else {<NEW_LINE>int x = (int) (tilePosition.point.x + 8 * displayModel.getScaleFactor());<NEW_LINE>int y = (int) (tilePosition.point.y + 24 * displayModel.getScaleFactor());<NEW_LINE>stringBuilder.setLength(0);<NEW_LINE>stringBuilder.append("X: ");<NEW_LINE>stringBuilder.append(tile.tileX);<NEW_LINE>String text = stringBuilder.toString();<NEW_LINE>canvas.drawText(text, x, y, this.paintBack);<NEW_LINE>canvas.drawText(text, <MASK><NEW_LINE>stringBuilder.setLength(0);<NEW_LINE>stringBuilder.append("Y: ");<NEW_LINE>stringBuilder.append(tile.tileY);<NEW_LINE>text = stringBuilder.toString();<NEW_LINE>canvas.drawText(text, x, (int) (y + 24 * displayModel.getScaleFactor()), this.paintBack);<NEW_LINE>canvas.drawText(text, x, (int) (y + 24 * displayModel.getScaleFactor()), this.paintFront);<NEW_LINE>stringBuilder.setLength(0);<NEW_LINE>stringBuilder.append("Z: ");<NEW_LINE>stringBuilder.append(tile.zoomLevel);<NEW_LINE>text = stringBuilder.toString();<NEW_LINE>canvas.drawText(text, x, (int) (y + 48 * displayModel.getScaleFactor()), this.paintBack);<NEW_LINE>canvas.drawText(text, x, (int) (y + 48 * displayModel.getScaleFactor()), this.paintFront);<NEW_LINE>}<NEW_LINE>}
x, y, this.paintFront);
900,678
public TrainingData unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TrainingData trainingData = new TrainingData();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Assets", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>trainingData.setAssets(new ListUnmarshaller<Asset>(AssetJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return trainingData;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
260,451
public void onMessage(jakarta.jms.Message jmsMessage, Session session) throws JMSException {<NEW_LINE>Message<?> requestMessage;<NEW_LINE>try {<NEW_LINE>final Object result;<NEW_LINE>if (this.extractRequestPayload) {<NEW_LINE>result = this.messageConverter.fromMessage(jmsMessage);<NEW_LINE>this.logger.debug(() -> "converted JMS Message [" + <MASK><NEW_LINE>} else {<NEW_LINE>result = jmsMessage;<NEW_LINE>}<NEW_LINE>Map<String, Object> headers = this.headerMapper.toHeaders(jmsMessage);<NEW_LINE>requestMessage = (result instanceof Message<?>) ? this.messageBuilderFactory.fromMessage((Message<?>) result).copyHeaders(headers).build() : this.messageBuilderFactory.withPayload(result).copyHeaders(headers).build();<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>MessageChannel errorChannel = this.gatewayDelegate.getErrorChannel();<NEW_LINE>if (errorChannel == null) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>this.gatewayDelegate.getMessagingTemplate().send(errorChannel, this.gatewayDelegate.buildErrorMessage(new MessagingException("Inbound conversion failed for: " + jmsMessage, e)));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!this.expectReply) {<NEW_LINE>this.gatewayDelegate.send(requestMessage);<NEW_LINE>} else {<NEW_LINE>Message<?> replyMessage = this.gatewayDelegate.sendAndReceiveMessage(requestMessage);<NEW_LINE>if (replyMessage != null) {<NEW_LINE>Destination destination = getReplyDestination(jmsMessage, session);<NEW_LINE>this.logger.debug(() -> "Reply destination: " + destination);<NEW_LINE>// convert SI Message to JMS Message<NEW_LINE>final Object replyResult;<NEW_LINE>if (this.extractReplyPayload) {<NEW_LINE>replyResult = replyMessage.getPayload();<NEW_LINE>} else {<NEW_LINE>replyResult = replyMessage;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>jakarta.jms.Message jmsReply = this.messageConverter.toMessage(replyResult, session);<NEW_LINE>// map SI Message Headers to JMS Message Properties/Headers<NEW_LINE>this.headerMapper.fromHeaders(replyMessage.getHeaders(), jmsReply);<NEW_LINE>copyCorrelationIdFromRequestToReply(jmsMessage, jmsReply);<NEW_LINE>sendReply(jmsReply, destination, session);<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>this.logger.error(ex, () -> "Failed to generate JMS Reply Message from: " + replyResult);<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.logger.debug("expected a reply but none was received");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
jmsMessage + "] to integration Message payload [" + result + "]");
1,187,080
public static boolean walkOffsetsFromPointer(Pointer baseAddress, NonmovableArray<Byte> referenceMapEncoding, long referenceMapIndex, ObjectReferenceVisitor visitor, Object holderObject) {<NEW_LINE>assert ReferenceMapIndex.denotesValidReferenceMap(referenceMapIndex);<NEW_LINE>assert referenceMapEncoding.isNonNull();<NEW_LINE>if (Continuation.isSupported() && referenceMapIndex == ReferenceMapIndex.STORED_CONTINUATION) {<NEW_LINE>return StoredContinuationImpl.walkStoredContinuationFromPointer(baseAddress, null, visitor, holderObject);<NEW_LINE>}<NEW_LINE>Pointer position = NonmovableByteArrayReader.pointerTo(referenceMapEncoding, referenceMapIndex);<NEW_LINE>int entryCount = TypedMemoryReader.getS4(position);<NEW_LINE>position = position.add(4);<NEW_LINE>int referenceSize = ConfigurationValues.getObjectLayout().getReferenceSize();<NEW_LINE>boolean compressed = ReferenceAccess.singleton().haveCompressedReferences();<NEW_LINE>assert entryCount >= 0;<NEW_LINE>UnsignedWord sizeOfEntries = WordFactory.unsigned(InstanceReferenceMapEncoder.MAP_ENTRY_SIZE).multiply(entryCount);<NEW_LINE>Pointer end = position.add(sizeOfEntries);<NEW_LINE>while (position.belowThan(end)) {<NEW_LINE>int offset = TypedMemoryReader.getS4(position);<NEW_LINE>position = position.add(4);<NEW_LINE>long count = TypedMemoryReader.getU4(position);<NEW_LINE>position = position.add(4);<NEW_LINE>Pointer objRef = baseAddress.add(offset);<NEW_LINE>for (int c = 0; c < count; c++) {<NEW_LINE>final boolean visitResult = visitor.visitObjectReferenceInline(<MASK><NEW_LINE>if (!visitResult) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>objRef = objRef.add(referenceSize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
objRef, 0, compressed, holderObject);
1,460,484
private void initModels(final NetworkModel model) {<NEW_LINE>liveModel = model.isLive();<NEW_LINE>networkMonitoringSupported = true;<NEW_LINE>// NOI18N<NEW_LINE>panelName = NbBundle.getMessage(NetworkViewComponent.class, "LBL_Network");<NEW_LINE>if (networkMonitoringSupported) {<NEW_LINE>// NOI18N<NEW_LINE>String READ_RATE = NbBundle.getMessage(NetworkViewComponent.class, "LBL_Read_rate");<NEW_LINE>// NOI18N<NEW_LINE>String READ_RATE_LEG = NbBundle.getMessage(NetworkViewComponent.class, "LBL_Read_rate_leg");<NEW_LINE>// NOI18N<NEW_LINE>String WRITE_RATE = NbBundle.getMessage(NetworkViewComponent.class, "LBL_Write_rate");<NEW_LINE>// NOI18N<NEW_LINE>String WRITE_RATE_LEG = NbBundle.getMessage(NetworkViewComponent.class, "LBL_Write_rate_leg");<NEW_LINE>SimpleXYChartDescriptor chartDescriptor = SimpleXYChartDescriptor.bitsPerSec(10 * 1024 * 1024, false, model.getChartCache());<NEW_LINE><MASK><NEW_LINE>chartDescriptor.setDetailsItems(new String[] { READ_RATE, WRITE_RATE });<NEW_LINE>chartSupport = ChartFactory.createSimpleXYChart(chartDescriptor);<NEW_LINE>chartSupport.setZoomingEnabled(!liveModel);<NEW_LINE>model.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>public void stateChanged(ChangeEvent e) {<NEW_LINE>refresh(model);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
chartDescriptor.addLineItems(READ_RATE_LEG, WRITE_RATE_LEG);
1,607,400
public static QueryReadableResourcesListByUserIdResponse unmarshall(QueryReadableResourcesListByUserIdResponse queryReadableResourcesListByUserIdResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryReadableResourcesListByUserIdResponse.setRequestId(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.RequestId"));<NEW_LINE>queryReadableResourcesListByUserIdResponse.setSuccess(_ctx.booleanValue("QueryReadableResourcesListByUserIdResponse.Success"));<NEW_LINE>List<Data> result = new ArrayList<Data>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryReadableResourcesListByUserIdResponse.Result.Length"); i++) {<NEW_LINE>Data data = new Data();<NEW_LINE>data.setStatus(_ctx.integerValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].Status"));<NEW_LINE>data.setThirdPartAuthFlag(_ctx.integerValue<MASK><NEW_LINE>data.setWorksId(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].WorksId"));<NEW_LINE>data.setCreateTime(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].CreateTime"));<NEW_LINE>data.setWorkType(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].WorkType"));<NEW_LINE>data.setOwnerName(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].OwnerName"));<NEW_LINE>data.setWorkspaceName(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].WorkspaceName"));<NEW_LINE>data.setOwnerId(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].OwnerId"));<NEW_LINE>data.setModifyName(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].ModifyName"));<NEW_LINE>data.setWorkspaceId(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].WorkspaceId"));<NEW_LINE>data.setSecurityLevel(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].SecurityLevel"));<NEW_LINE>data.setDescription(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].Description"));<NEW_LINE>data.setWorkName(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].WorkName"));<NEW_LINE>data.setModifyTime(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].ModifyTime"));<NEW_LINE>Directory directory = new Directory();<NEW_LINE>directory.setPathId(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].Directory.PathId"));<NEW_LINE>directory.setPathName(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].Directory.PathName"));<NEW_LINE>directory.setName(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].Directory.Name"));<NEW_LINE>directory.setId(_ctx.stringValue("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].Directory.Id"));<NEW_LINE>data.setDirectory(directory);<NEW_LINE>result.add(data);<NEW_LINE>}<NEW_LINE>queryReadableResourcesListByUserIdResponse.setResult(result);<NEW_LINE>return queryReadableResourcesListByUserIdResponse;<NEW_LINE>}
("QueryReadableResourcesListByUserIdResponse.Result[" + i + "].ThirdPartAuthFlag"));
368,678
public <T> void registerInjectionTarget(javax.enterprise.inject.spi.InjectionTarget<T> injectionTarget, AnnotatedType<T> annotatedType) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(tc, "registerInjectionTarget", new Object[] { injectionTarget, Util.identity(annotatedType) });<NEW_LINE>}<NEW_LINE>Class<?<MASK><NEW_LINE>WebSphereBeanDeploymentArchive wbda = deployment.getBeanDeploymentArchiveFromClass(declaringClass);<NEW_LINE>// If it's not an application class we don't need to validate it<NEW_LINE>if (wbda != null) {<NEW_LINE>CDIArchive cdiArchive = wbda.getArchive();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Injection Target Annotations: " + annotatedType.getAnnotations());<NEW_LINE>}<NEW_LINE>// We don't need to worry about constructors because constructors cannot be a producer.<NEW_LINE>for (Annotated annotated : annotatedType.getFields()) {<NEW_LINE>validateAnnotatedMember(annotated, annotatedType.getJavaClass(), cdiArchive);<NEW_LINE>}<NEW_LINE>for (AnnotatedMethod<?> annotatedMethod : annotatedType.getMethods()) {<NEW_LINE>validateAnnotatedMethod(annotatedMethod, declaringClass, cdiArchive);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(tc, "registerInjectionTarget");<NEW_LINE>}<NEW_LINE>}
> declaringClass = annotatedType.getJavaClass();
1,373,381
public void applyChanges() {<NEW_LINE>boolean fire;<NEW_LINE>synchronized (this) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.fine("applyChanges");<NEW_LINE>pf.applyChanges();<NEW_LINE>// Make sure that completions settings that are only accessible for<NEW_LINE>// 'all languages' are not overriden by particular languages (mime types)<NEW_LINE>for (String mimeType : EditorSettings.getDefault().getAllMimeTypes()) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.fine("Cleaning up '" + mimeType + "' preferences");<NEW_LINE>Preferences prefs = MimeLookup.getLookup(mimeType).lookup(Preferences.class);<NEW_LINE>// NOI18N<NEW_LINE>prefs.remove(SimpleValueNames.COMPLETION_PAIR_CHARACTERS);<NEW_LINE>prefs.remove(SimpleValueNames.COMPLETION_AUTO_POPUP);<NEW_LINE>prefs.remove(SimpleValueNames.JAVADOC_AUTO_POPUP);<NEW_LINE>prefs.remove(SimpleValueNames.JAVADOC_POPUP_NEXT_TO_CC);<NEW_LINE>prefs.remove(SimpleValueNames.SHOW_DEPRECATED_MEMBERS);<NEW_LINE><MASK><NEW_LINE>prefs.remove(SimpleValueNames.COMPLETION_CASE_SENSITIVE);<NEW_LINE>}<NEW_LINE>pf.destroy();<NEW_LINE>pf = null;<NEW_LINE>panel.setSelector(null);<NEW_LINE>selector = null;<NEW_LINE>fire = changed;<NEW_LINE>changed = false;<NEW_LINE>}<NEW_LINE>if (fire) {<NEW_LINE>pcs.firePropertyChange(PROP_CHANGED, true, false);<NEW_LINE>}<NEW_LINE>}
prefs.remove(SimpleValueNames.COMPLETION_INSTANT_SUBSTITUTION);
272,310
public void layoutContainer(Container parent) {<NEW_LINE>Insets insets = datePicker.getInsets();<NEW_LINE>int x = insets.left;<NEW_LINE>int y = insets.top;<NEW_LINE>int width = datePicker.getWidth() - insets.left - insets.right;<NEW_LINE>int height = datePicker.getHeight() <MASK><NEW_LINE>int popupButtonWidth = popupButton != null ? height : 0;<NEW_LINE>boolean ltr = datePicker.getComponentOrientation().isLeftToRight();<NEW_LINE>Rectangle r = new Rectangle(x + (ltr ? 0 : popupButtonWidth), y, width - popupButtonWidth, height);<NEW_LINE>r = FlatUIUtils.subtractInsets(r, UIScale.scale(padding));<NEW_LINE>datePicker.getEditor().setBounds(r);<NEW_LINE>if (popupButton != null)<NEW_LINE>popupButton.setBounds(x + (ltr ? width - popupButtonWidth : 0), y, popupButtonWidth, height);<NEW_LINE>}
- insets.top - insets.bottom;
990,012
/* Build call for throttlingPoliciesAdvancedPolicyIdGet */<NEW_LINE>private com.squareup.okhttp.Call throttlingPoliciesAdvancedPolicyIdGetCall(String policyId, String ifNoneMatch, String ifModifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/throttling/policies/advanced/{policyId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "policyId" + "\\}", apiClient.escapeString(policyId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (ifNoneMatch != null)<NEW_LINE>localVarHeaderParams.put("If-None-Match", apiClient.parameterToString(ifNoneMatch));<NEW_LINE>if (ifModifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Modified-Since", apiClient.parameterToString(ifModifiedSince));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String <MASK><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, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
352,742
private void format() {<NEW_LINE>String inputText = input.getText().trim();<NEW_LINE>if (inputText.isEmpty()) {<NEW_LINE>output.setBackground(Color.LIGHT_GRAY);<NEW_LINE>output.setText("");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String outputText;<NEW_LINE>if (!radioDoc.isSelected()) {<NEW_LINE>outputText = radioConst.isSelected() ? formatConstants(inputText, prefix.getText()) : formatFunctions(inputText, prefix.getText(), prefixTypes.isSelected());<NEW_LINE>// Try to automatically detect the input type<NEW_LINE>if (outputText.isEmpty()) {<NEW_LINE>outputText = radioConst.isSelected() ? formatFunctions(inputText, prefix.getText(), prefixTypes.isSelected()) : formatConstants(inputText, prefix.getText());<NEW_LINE>// Got it, flip the selection<NEW_LINE>if (!outputText.isEmpty()) {<NEW_LINE>(radioConst.isSelected() ? radioFunc : radioConst).setSelected(true);<NEW_LINE>} else {<NEW_LINE>outputText = formatDocumentation(inputText);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>outputText = formatDocumentation(inputText);<NEW_LINE>}<NEW_LINE>output.setBackground(Color.WHITE);<NEW_LINE>output.setText(outputText);<NEW_LINE>// Copy output to clipboard<NEW_LINE>// final StringSelection copyData = new StringSelection(outputText);<NEW_LINE>// Toolkit.getDefaultToolkit().getSystemClipboard().setContents(copyData, copyData);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>StringWriter writer = new StringWriter();<NEW_LINE>e.printStackTrace(new PrintWriter(writer));<NEW_LINE><MASK><NEW_LINE>output.setText("** ERROR **\n\n" + writer.toString());<NEW_LINE>}<NEW_LINE>}
output.setBackground(Color.ORANGE);
591,188
static KeyPair parseKeyPair(String pemData) {<NEW_LINE>Matcher m = PEM_DATA.matcher(pemData.trim());<NEW_LINE>if (!m.matches()) {<NEW_LINE>throw new IllegalArgumentException("String is not PEM encoded data");<NEW_LINE>}<NEW_LINE>String type = m.group(1);<NEW_LINE>final byte[] content = b64Decode(utf8Encode(<MASK><NEW_LINE>PublicKey publicKey;<NEW_LINE>PrivateKey privateKey = null;<NEW_LINE>try {<NEW_LINE>KeyFactory fact = KeyFactory.getInstance("RSA");<NEW_LINE>if (type.equals("RSA PRIVATE KEY")) {<NEW_LINE>ASN1Sequence seq = ASN1Sequence.getInstance(content);<NEW_LINE>if (seq.size() != 9) {<NEW_LINE>throw new IllegalArgumentException("Invalid RSA Private Key ASN1 sequence.");<NEW_LINE>}<NEW_LINE>org.bouncycastle.asn1.pkcs.RSAPrivateKey key = org.bouncycastle.asn1.pkcs.RSAPrivateKey.getInstance(seq);<NEW_LINE>RSAPublicKeySpec pubSpec = new RSAPublicKeySpec(key.getModulus(), key.getPublicExponent());<NEW_LINE>RSAPrivateCrtKeySpec privSpec = new RSAPrivateCrtKeySpec(key.getModulus(), key.getPublicExponent(), key.getPrivateExponent(), key.getPrime1(), key.getPrime2(), key.getExponent1(), key.getExponent2(), key.getCoefficient());<NEW_LINE>publicKey = fact.generatePublic(pubSpec);<NEW_LINE>privateKey = fact.generatePrivate(privSpec);<NEW_LINE>} else if (type.equals("PUBLIC KEY")) {<NEW_LINE>KeySpec keySpec = new X509EncodedKeySpec(content);<NEW_LINE>publicKey = fact.generatePublic(keySpec);<NEW_LINE>} else if (type.equals("RSA PUBLIC KEY")) {<NEW_LINE>ASN1Sequence seq = ASN1Sequence.getInstance(content);<NEW_LINE>org.bouncycastle.asn1.pkcs.RSAPublicKey key = org.bouncycastle.asn1.pkcs.RSAPublicKey.getInstance(seq);<NEW_LINE>RSAPublicKeySpec pubSpec = new RSAPublicKeySpec(key.getModulus(), key.getPublicExponent());<NEW_LINE>publicKey = fact.generatePublic(pubSpec);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(type + " is not a supported format");<NEW_LINE>}<NEW_LINE>return new KeyPair(publicKey, privateKey);<NEW_LINE>} catch (InvalidKeySpecException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>}
m.group(2)));
477,878
/*<NEW_LINE>* BeanDefinitionRegistries are called early in application startup, before BeanFactoryPostProcessors. This means that<NEW_LINE>* PropertyResourceConfigurers will not have been loaded and any property substitution of this class' properties will<NEW_LINE>* fail. To avoid this, find any PropertyResourceConfigurers defined in the context and run them on this class' bean<NEW_LINE>* definition. Then update the values.<NEW_LINE>*/<NEW_LINE>private void processPropertyPlaceHolders() {<NEW_LINE>Map<String, PropertyResourceConfigurer> prcs = applicationContext.getBeansOfType(PropertyResourceConfigurer.class, false, false);<NEW_LINE>if (!prcs.isEmpty() && applicationContext instanceof ConfigurableApplicationContext) {<NEW_LINE>BeanDefinition mapperScannerBean = ((ConfigurableApplicationContext) applicationContext).getBeanFactory().getBeanDefinition(beanName);<NEW_LINE>// PropertyResourceConfigurer does not expose any methods to explicitly perform<NEW_LINE>// property placeholder substitution. Instead, create a BeanFactory that just<NEW_LINE>// contains this mapper scanner and post process the factory.<NEW_LINE>DefaultListableBeanFactory factory = new DefaultListableBeanFactory();<NEW_LINE>factory.registerBeanDefinition(beanName, mapperScannerBean);<NEW_LINE>for (PropertyResourceConfigurer prc : prcs.values()) {<NEW_LINE>prc.postProcessBeanFactory(factory);<NEW_LINE>}<NEW_LINE>PropertyValues values = mapperScannerBean.getPropertyValues();<NEW_LINE>this.basePackage = getPropertyValue("basePackage", values);<NEW_LINE>this.sqlSessionFactoryBeanName = getPropertyValue("sqlSessionFactoryBeanName", values);<NEW_LINE>this.sqlSessionTemplateBeanName = getPropertyValue("sqlSessionTemplateBeanName", values);<NEW_LINE>this.lazyInitialization = getPropertyValue("lazyInitialization", values);<NEW_LINE>this.defaultScope = getPropertyValue("defaultScope", values);<NEW_LINE>}<NEW_LINE>this.basePackage = Optional.ofNullable(this.basePackage).map(getEnvironment()::resolvePlaceholders).orElse(null);<NEW_LINE>this.sqlSessionFactoryBeanName = Optional.ofNullable(this.sqlSessionFactoryBeanName).map(getEnvironment()<MASK><NEW_LINE>this.sqlSessionTemplateBeanName = Optional.ofNullable(this.sqlSessionTemplateBeanName).map(getEnvironment()::resolvePlaceholders).orElse(null);<NEW_LINE>this.lazyInitialization = Optional.ofNullable(this.lazyInitialization).map(getEnvironment()::resolvePlaceholders).orElse(null);<NEW_LINE>this.defaultScope = Optional.ofNullable(this.defaultScope).map(getEnvironment()::resolvePlaceholders).orElse(null);<NEW_LINE>}
::resolvePlaceholders).orElse(null);
14,550
protected Answer execute(UnregisterNicCommand cmd) {<NEW_LINE>if (_guestTrafficInfo == null) {<NEW_LINE>return new Answer(cmd, false, "No Guest Traffic Info found, unable to determine where to clean up");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (_guestTrafficInfo.getVirtualSwitchType() != VirtualSwitchType.StandardVirtualSwitch) {<NEW_LINE>// For now we only need to cleanup the nvp specific portgroups<NEW_LINE>// on the standard switches<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>s_logger.debug("Cleaning up portgroup " + cmd.getNicUuid() + " on switch " + _guestTrafficInfo.getVirtualSwitchName());<NEW_LINE>VmwareContext context = getServiceContext();<NEW_LINE>VmwareHypervisorHost host = getHyperHost(context);<NEW_LINE>ManagedObjectReference clusterMO = host.getHyperHostCluster();<NEW_LINE>// Get a list of all the hosts in this cluster<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<ManagedObjectReference> hosts = (List<ManagedObjectReference>) context.getVimClient().getDynamicProperty(clusterMO, "host");<NEW_LINE>if (hosts == null) {<NEW_LINE>return new Answer(cmd, false, "No hosts in cluster, which is pretty weird");<NEW_LINE>}<NEW_LINE>for (ManagedObjectReference hostMOR : hosts) {<NEW_LINE>HostMO hostMo = new HostMO(context, hostMOR);<NEW_LINE>hostMo.deletePortGroup(cmd.getNicUuid().toString());<NEW_LINE>s_logger.debug("Removed portgroup " + cmd.getNicUuid() + " from host " + hostMo.getHostName());<NEW_LINE>}<NEW_LINE>return new Answer(cmd, true, "Unregistered resources for NIC " + cmd.getNicUuid());<NEW_LINE>} catch (Exception e) {<NEW_LINE>return new Answer(cmd, false, createLogMessageException(e, cmd));<NEW_LINE>}<NEW_LINE>}
Answer(cmd, true, "Nothing to do");
1,752,110
public static void usage() {<NEW_LINE>System.out.println("Usage: run_synthea [options] [state [city]]");<NEW_LINE>System.out.println("Options: [-s seed] [-cs clinicianSeed] [-p populationSize]");<NEW_LINE>System.out.println(" [-r referenceDate as YYYYMMDD]");<NEW_LINE>System.out.println(" [-e endDate as YYYYMMDD]");<NEW_LINE>System.out.println(" [-g gender] [-a minAge-maxAge]");<NEW_LINE><MASK><NEW_LINE>System.out.println(" [-m moduleFileWildcardList]");<NEW_LINE>System.out.println(" [-c localConfigFilePath]");<NEW_LINE>System.out.println(" [-d localModulesDirPath]");<NEW_LINE>System.out.println(" [-i initialPopulationSnapshotPath]");<NEW_LINE>System.out.println(" [-u updatedPopulationSnapshotPath]");<NEW_LINE>System.out.println(" [-t updateTimePeriodInDays]");<NEW_LINE>System.out.println(" [-f fixedRecordPath]");<NEW_LINE>System.out.println(" [-k keepMatchingPatientsPath]");<NEW_LINE>System.out.println(" [--config* value]");<NEW_LINE>System.out.println(" * any setting from src/main/resources/synthea.properties");<NEW_LINE>System.out.println("Examples:");<NEW_LINE>System.out.println("run_synthea Massachusetts");<NEW_LINE>System.out.println("run_synthea Alaska Juneau");<NEW_LINE>System.out.println("run_synthea -s 12345");<NEW_LINE>System.out.println("run_synthea -p 1000");<NEW_LINE>System.out.println("run_synthea -s 987 Washington Seattle");<NEW_LINE>System.out.println("run_synthea -s 21 -p 100 Utah \"Salt Lake City\"");<NEW_LINE>System.out.println("run_synthea -g M -a 60-65");<NEW_LINE>System.out.println("run_synthea -p 10 --exporter.fhir.export true");<NEW_LINE>System.out.println("run_synthea -m moduleFilename" + File.pathSeparator + "anotherModule" + File.pathSeparator + "module*");<NEW_LINE>System.out.println("run_synthea --exporter.baseDirectory \"./output_tx/\" Texas");<NEW_LINE>}
System.out.println(" [-o overflowPopulation]");
908,686
public ValueEmitter castToInteger(IntegerSubtype subtype) {<NEW_LINE>switch(subtype) {<NEW_LINE>case BYTE:<NEW_LINE>if (type != ValueType.BYTE) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SHORT:<NEW_LINE>if (type != ValueType.SHORT) {<NEW_LINE>throw new EmitException("Can't cast non-short value: " + type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case CHAR:<NEW_LINE>if (type != ValueType.CHARACTER) {<NEW_LINE>throw new EmitException("Can't cast non-char value: " + type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>CastIntegerInstruction insn = new CastIntegerInstruction(subtype, CastIntegerDirection.FROM_INTEGER);<NEW_LINE>insn.setValue(variable);<NEW_LINE>ValueEmitter result = pe.newVar(ValueType.INTEGER);<NEW_LINE>insn.setReceiver(result.getVariable());<NEW_LINE>pe.addInstruction(insn);<NEW_LINE>return result;<NEW_LINE>}
throw new EmitException("Can't cast non-byte value: " + type);
484,207
public void serialize(ByteBuf buf) {<NEW_LINE>super.serialize(buf);<NEW_LINE>long startCol = splitContext.getPartKey().getStartCol();<NEW_LINE>if (isUseIntKey()) {<NEW_LINE>if (splitContext.isEnableFilter()) {<NEW_LINE>int filterValue = <MASK><NEW_LINE>int position = buf.writerIndex();<NEW_LINE>buf.writeInt(0);<NEW_LINE>int needUpdateItemNum = 0;<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>if (Math.abs(values[i]) > filterValue) {<NEW_LINE>buf.writeInt((int) (offsets[i] - startCol));<NEW_LINE>buf.writeInt(values[i]);<NEW_LINE>needUpdateItemNum++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buf.setInt(position, needUpdateItemNum);<NEW_LINE>} else {<NEW_LINE>buf.writeInt(end - start);<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>buf.writeInt((int) (offsets[i] - startCol));<NEW_LINE>buf.writeInt(values[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (splitContext.isEnableFilter()) {<NEW_LINE>int filterValue = (int) splitContext.getFilterThreshold();<NEW_LINE>int position = buf.writerIndex();<NEW_LINE>buf.writeInt(0);<NEW_LINE>int needUpdateItemNum = 0;<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>if (Math.abs(values[i]) > filterValue) {<NEW_LINE>buf.writeLong(offsets[i] - startCol);<NEW_LINE>buf.writeInt(values[i]);<NEW_LINE>needUpdateItemNum++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buf.setInt(position, needUpdateItemNum);<NEW_LINE>} else {<NEW_LINE>buf.writeInt(end - start);<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>buf.writeLong(offsets[i] - startCol);<NEW_LINE>buf.writeInt(values[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(int) splitContext.getFilterThreshold();
1,452,897
public ShaderNodeDefinition findDefinition(Statement statement) throws IOException {<NEW_LINE>final String[] defLine = statement.getLine().split(":");<NEW_LINE>if (defLine.length != 3) {<NEW_LINE>throw new MatParseException("Can't find shader node definition for: ", statement);<NEW_LINE>}<NEW_LINE>final Map<String, ShaderNodeDefinition> nodeDefinitions = getNodeDefinitions();<NEW_LINE>final String definitionName = defLine[1].trim();<NEW_LINE>final String definitionPath = defLine[2].trim();<NEW_LINE>final String fullName = definitionName + ":" + definitionPath;<NEW_LINE>ShaderNodeDefinition def = nodeDefinitions.get(fullName);<NEW_LINE>if (def != null) {<NEW_LINE>return def;<NEW_LINE>}<NEW_LINE>List<ShaderNodeDefinition> defs;<NEW_LINE>try {<NEW_LINE>defs = assetManager.loadAsset(new ShaderNodeDefinitionKey(definitionPath));<NEW_LINE>} catch (final AssetNotFoundException e) {<NEW_LINE>throw new MatParseException("Couldn't find " + definitionPath, statement, e);<NEW_LINE>}<NEW_LINE>for (final ShaderNodeDefinition definition : defs) {<NEW_LINE>if (definitionName.equals(definition.getName())) {<NEW_LINE>def = definition;<NEW_LINE>}<NEW_LINE>final String key = definition.getName() + ":" + definitionPath;<NEW_LINE>if (!(nodeDefinitions.containsKey(key))) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (def == null) {<NEW_LINE>throw new MatParseException(definitionName + " is not a declared as Shader Node Definition", statement);<NEW_LINE>}<NEW_LINE>return def;<NEW_LINE>}
nodeDefinitions.put(key, definition);
1,075,772
public Result search(Query query, Execution execution) {<NEW_LINE>query.trace("CacheControlSearcher: Running version $Revision$", false, 6);<NEW_LINE>Result result = execution.search(query);<NEW_LINE>query = result.getQuery();<NEW_LINE>if (result.getHeaders(true) == null) {<NEW_LINE>query.trace("CacheControlSearcher: No HTTP header map available - skipping searcher.", false, 5);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>// If you specify no-cache, no further cache control headers make sense<NEW_LINE>if (query.properties().getBoolean(cachecontrolNocache, false) || query.getNoCache()) {<NEW_LINE>result.getHeaders(true).put(CACHE_CONTROL_HEADER, "no-cache");<NEW_LINE>query.trace("CacheControlSearcher: Added no-cache header", false, 4);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>// Handle max-age header<NEW_LINE>int maxage = query.properties().getInteger(cachecontrolMaxage, -1);<NEW_LINE>if (maxage > 0) {<NEW_LINE>result.getHeaders(true).put(CACHE_CONTROL_HEADER, "max-age=" + maxage);<NEW_LINE>query.trace(<MASK><NEW_LINE>}<NEW_LINE>// Handle stale-while-revalidate header<NEW_LINE>int staleage = query.properties().getInteger(cachecontrolStaleage, -1);<NEW_LINE>if (staleage > 0) {<NEW_LINE>result.getHeaders(true).put(CACHE_CONTROL_HEADER, "stale-while-revalidate=" + staleage);<NEW_LINE>query.trace("CacheControlSearcher: Set stale-while-revalidate header to " + staleage, false, 4);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
"CacheControlSearcher: Set max-age header to " + maxage, false, 4);
376,842
void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) throws AddressOverflowException, CancelledException {<NEW_LINE>lock.acquire();<NEW_LINE>try {<NEW_LINE>Address rangeEnd = fromAddr.addNoWrap(length - 1);<NEW_LINE>AddressSet addrSet = new AddressSet(fromAddr, rangeEnd);<NEW_LINE>ArrayList<FragmentHolder> list = new ArrayList<>();<NEW_LINE>AddressRangeIterator rangeIter = fragMap.getAddressRanges(fromAddr, rangeEnd);<NEW_LINE>while (rangeIter.hasNext() && !addrSet.isEmpty()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE><MASK><NEW_LINE>Field field = fragMap.getValue(range.getMinAddress());<NEW_LINE>try {<NEW_LINE>FragmentDB frag = getFragmentDB(field.getLongValue());<NEW_LINE>AddressSet intersection = addrSet.intersect(frag);<NEW_LINE>AddressRangeIterator fragRangeIter = intersection.getAddressRanges();<NEW_LINE>while (fragRangeIter.hasNext() && !monitor.isCancelled()) {<NEW_LINE>AddressRange fragRange = fragRangeIter.next();<NEW_LINE>Address startAddr = fragRange.getMinAddress();<NEW_LINE>Address endAddr = fragRange.getMaxAddress();<NEW_LINE>long offset = startAddr.subtract(fromAddr);<NEW_LINE>startAddr = toAddr.add(offset);<NEW_LINE>offset = endAddr.subtract(fromAddr);<NEW_LINE>endAddr = toAddr.add(offset);<NEW_LINE>AddressRange newRange = new AddressRangeImpl(startAddr, endAddr);<NEW_LINE>frag.removeRange(fragRange);<NEW_LINE>list.add(new FragmentHolder(frag, newRange));<NEW_LINE>}<NEW_LINE>addrSet = addrSet.subtract(intersection);<NEW_LINE>} catch (IOException e) {<NEW_LINE>errHandler.dbError(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>monitor.checkCanceled();<NEW_LINE>fragMap.clearRange(fromAddr, rangeEnd);<NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>FragmentHolder fh = list.get(i);<NEW_LINE>fragMap.paintRange(fh.range.getMinAddress(), fh.range.getMaxAddress(), new LongField(fh.frag.getKey()));<NEW_LINE>fh.frag.addRange(fh.range);<NEW_LINE>}<NEW_LINE>treeMgr.updateTreeRecord(record);<NEW_LINE>// generate an event...<NEW_LINE>getProgram().programTreeChanged(treeID, ChangeManager.DOCR_FRAGMENT_MOVED, null, new AddressRangeImpl(fromAddr, rangeEnd), new AddressRangeImpl(toAddr, toAddr.addNoWrap(length - 1)));<NEW_LINE>} finally {<NEW_LINE>lock.release();<NEW_LINE>}<NEW_LINE>}
AddressRange range = rangeIter.next();
459,077
public int compare(Content c1, Content c2) {<NEW_LINE>if (!(c1 instanceof Xml.Tag) || !(c2 instanceof Xml.Tag)) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>Xml.Tag <MASK><NEW_LINE>Xml.Tag t2 = (Xml.Tag) c2;<NEW_LINE>int i1 = existingIndices.getOrDefault(t1, -1);<NEW_LINE>int i2 = existingIndices.getOrDefault(t2, -1);<NEW_LINE>if (i1 == -1) {<NEW_LINE>if (i2 == -1) {<NEW_LINE>return canonicalOrdering.indexOf(t1.getName()) - canonicalOrdering.indexOf(t2.getName());<NEW_LINE>} else {<NEW_LINE>// trying to place a new t1<NEW_LINE>for (int i = 0; i < canonicalOrdering.indexOf(t2.getName()); i++) {<NEW_LINE>if (canonicalOrdering.get(i).equals(t1.getName())) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (i2 == -1) {<NEW_LINE>// trying to place a new t2<NEW_LINE>for (int i = 0; i < canonicalOrdering.indexOf(t1.getName()); i++) {<NEW_LINE>if (canonicalOrdering.get(i).equals(t2.getName())) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>} else {<NEW_LINE>return i1 - i2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
t1 = (Xml.Tag) c1;
1,363,860
/* Build call for throttlingPoliciesSubscriptionGet */<NEW_LINE>private com.squareup.okhttp.Call throttlingPoliciesSubscriptionGetCall(String accept, String ifNoneMatch, String ifModifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/throttling/policies/subscription".replaceAll("\\{format\\}", "json");<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (accept != null)<NEW_LINE>localVarHeaderParams.put("Accept", apiClient.parameterToString(accept));<NEW_LINE>if (ifNoneMatch != null)<NEW_LINE>localVarHeaderParams.put("If-None-Match", apiClient.parameterToString(ifNoneMatch));<NEW_LINE>if (ifModifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Modified-Since", apiClient.parameterToString(ifModifiedSince));<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[] <MASK><NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
localVarAuthNames = new String[] {};
903,932
private void build_Bindings(AugmentedStmt swAs, Object index, AugmentedStmt target) {<NEW_LINE>AugmentedStmt tSucc = (AugmentedStmt) target.bsuccs.get(0);<NEW_LINE>if (targetSet.add(tSucc)) {<NEW_LINE>targetList.addLast(tSucc);<NEW_LINE>}<NEW_LINE>index2target.put(index, target);<NEW_LINE>TreeSet indices = null;<NEW_LINE>if ((indices = (TreeSet) tSucc2indexSet.get(tSucc)) == null) {<NEW_LINE>indices = new TreeSet(new IndexComparator());<NEW_LINE>tSucc2indexSet.put(tSucc, indices);<NEW_LINE>tSucc2target.put(tSucc, target);<NEW_LINE>tSucc2Body.put(tSucc, find_SubBody(swAs, target));<NEW_LINE>tSuccList.add(tSucc);<NEW_LINE>} else {<NEW_LINE>junkBody.add(target);<NEW_LINE>// break all edges between the junk body and any of it's successors<NEW_LINE>Iterator sit = target.bsuccs.iterator();<NEW_LINE>while (sit.hasNext()) {<NEW_LINE>((AugmentedStmt) sit.next()).bpreds.remove(target);<NEW_LINE>}<NEW_LINE>sit <MASK><NEW_LINE>while (sit.hasNext()) {<NEW_LINE>((AugmentedStmt) sit.next()).cpreds.remove(target);<NEW_LINE>}<NEW_LINE>target.bsuccs.clear();<NEW_LINE>target.csuccs.clear();<NEW_LINE>}<NEW_LINE>indices.add(index);<NEW_LINE>}
= target.csuccs.iterator();
1,755,481
private List<CacheKeyTO> splitReturnValueOnly(CacheDeleteMagicKey cacheDeleteKey, Object retVal, String keyExpression, String hfieldExpression) throws Exception {<NEW_LINE>if (null == retVal) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>List<CacheKeyTO> list;<NEW_LINE>if (retVal.getClass().isArray()) {<NEW_LINE>Object[] newValues = (Object[]) retVal;<NEW_LINE>list = new ArrayList<>(newValues.length);<NEW_LINE>for (Object value : newValues) {<NEW_LINE>if (!cacheHandler.getScriptParser().isCanDelete(cacheDeleteKey, arguments, value)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>list.add(this.cacheHandler.getCacheKey(target, methodName, arguments, keyExpression, hfieldExpression, value, true));<NEW_LINE>}<NEW_LINE>} else if (retVal instanceof Collection) {<NEW_LINE>Collection<Object> newValues = (Collection<Object>) retVal;<NEW_LINE>list = new ArrayList<>(newValues.size());<NEW_LINE>for (Object value : newValues) {<NEW_LINE>if (!cacheHandler.getScriptParser().isCanDelete(cacheDeleteKey, arguments, value)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>list.add(this.cacheHandler.getCacheKey(target, methodName, arguments, keyExpression<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
, hfieldExpression, value, true));
1,267,559
public PageInfo<InlongStreamInfo> listAll(InlongStreamPageRequest request) {<NEW_LINE>LOGGER.debug("begin to list full inlong stream page by {}", request);<NEW_LINE>Preconditions.checkNotNull(request, "request is empty");<NEW_LINE>String groupId = request.getInlongGroupId();<NEW_LINE>Preconditions.checkNotNull(groupId, ErrorCodeEnum.GROUP_ID_IS_EMPTY.getMessage());<NEW_LINE>InlongGroupEntity groupEntity = groupMapper.selectByGroupId(groupId);<NEW_LINE>Preconditions.checkNotNull(groupEntity, "inlong group not found by groupId=" + groupId);<NEW_LINE>// the person in charge of the inlong group has the authority of all inlong streams,<NEW_LINE>// so do not filter by in charge person<NEW_LINE>PageHelper.startPage(request.getPageNum(), request.getPageSize());<NEW_LINE>Page<InlongStreamEntity> page = (Page<InlongStreamEntity>) streamMapper.selectByCondition(request);<NEW_LINE>List<InlongStreamInfo> streamInfoList = CommonBeanUtils.<MASK><NEW_LINE>// Convert and encapsulate the paged results<NEW_LINE>for (InlongStreamInfo streamInfo : streamInfoList) {<NEW_LINE>// Set the field information of the inlong stream<NEW_LINE>String streamId = streamInfo.getInlongStreamId();<NEW_LINE>List<StreamField> streamFields = getStreamFields(groupId, streamId);<NEW_LINE>streamInfo.setFieldList(streamFields);<NEW_LINE>List<InlongStreamExtInfo> streamExtInfos = CommonBeanUtils.copyListProperties(streamExtMapper.selectByRelatedId(groupId, streamId), InlongStreamExtInfo::new);<NEW_LINE>streamInfo.setExtList(streamExtInfos);<NEW_LINE>// query all valid stream sources<NEW_LINE>List<StreamSource> sourceList = sourceService.listSource(groupId, streamId);<NEW_LINE>streamInfo.setSourceList(sourceList);<NEW_LINE>// query all valid stream sinks and its extended info, field info<NEW_LINE>List<StreamSink> sinkList = sinkService.listSink(groupId, streamId);<NEW_LINE>streamInfo.setSinkList(sinkList);<NEW_LINE>}<NEW_LINE>PageInfo<InlongStreamInfo> pageInfo = new PageInfo<>(streamInfoList);<NEW_LINE>pageInfo.setTotal(pageInfo.getTotal());<NEW_LINE>LOGGER.debug("success to list full inlong stream info by {}", request);<NEW_LINE>return pageInfo;<NEW_LINE>}
copyListProperties(page, InlongStreamInfo::new);
1,356,637
private double determineInputFieldValue(final InputField field, final int index) {<NEW_LINE>double result = 0;<NEW_LINE>if (field instanceof InputFieldCSVText) {<NEW_LINE><MASK><NEW_LINE>final ReadCSV csv = this.csvMap.get(field);<NEW_LINE>String v = csv.get(fieldCSV.getOffset());<NEW_LINE>if (!fieldCSV.getMappings().containsKey(v)) {<NEW_LINE>throw new NormalizationError("Undefined class value: " + v);<NEW_LINE>} else {<NEW_LINE>result = fieldCSV.getMappings().get(v);<NEW_LINE>}<NEW_LINE>} else if (field instanceof InputFieldCSV) {<NEW_LINE>final InputFieldCSV fieldCSV = (InputFieldCSV) field;<NEW_LINE>final ReadCSV csv = this.csvMap.get(field);<NEW_LINE>result = csv.getDouble(fieldCSV.getOffset());<NEW_LINE>} else if (field instanceof InputFieldMLDataSet) {<NEW_LINE>final InputFieldMLDataSet neuralField = (InputFieldMLDataSet) field;<NEW_LINE>final MLDataFieldHolder holder = this.dataSetFieldMap.get(field);<NEW_LINE>final MLDataPair pair = holder.getPair();<NEW_LINE>int offset = neuralField.getOffset();<NEW_LINE>if (offset < pair.getInput().size()) {<NEW_LINE>result = pair.getInput().getData(offset);<NEW_LINE>} else {<NEW_LINE>offset -= pair.getInput().size();<NEW_LINE>result = pair.getIdeal().getData(offset);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result = field.getValue(index);<NEW_LINE>}<NEW_LINE>field.setCurrentValue(result);<NEW_LINE>return result;<NEW_LINE>}
final InputFieldCSVText fieldCSV = (InputFieldCSVText) field;
1,627,757
private Mono<Response<Void>> deleteCertificateWithResponseAsync(String resourceGroupName, String certificateOrderName, String name, 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 (certificateOrderName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.deleteCertificate(this.client.getEndpoint(), resourceGroupName, certificateOrderName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
329,428
final // Use JmxHeartbeat.scheduleImmediately(JmxApplication) from any other code!<NEW_LINE>boolean tryConnect() {<NEW_LINE>synchronized (connectionLock) {<NEW_LINE>if (isConnected())<NEW_LINE>return true;<NEW_LINE>try {<NEW_LINE>ProxyClient newClient = new ProxyClient(this);<NEW_LINE>newClient.connect();<NEW_LINE>if (newClient.getConnectionState() == ConnectionState.CONNECTED) {<NEW_LINE>client = newClient;<NEW_LINE>setStateImpl(Stateful.STATE_AVAILABLE);<NEW_LINE><MASK><NEW_LINE>jvm = JvmFactory.getJVMFor(this);<NEW_LINE>modelListener = new PropertyChangeListener() {<NEW_LINE><NEW_LINE>public void propertyChange(PropertyChangeEvent evt) {<NEW_LINE>if (evt.getNewValue() != ConnectionState.CONNECTED) {<NEW_LINE>synchronized (connectionLock) {<NEW_LINE>setStateImpl(Stateful.STATE_UNAVAILABLE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>jmxModel.addPropertyChangeListener(modelListener);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.FINE, "ProxyClient.connect", ex);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
jmxModel = JmxModelFactory.getJmxModelFor(this);
132,076
public PersistentTasksCustomMetadata.Assignment selectNode(Collection<DiscoveryNode> candidateNodes) {<NEW_LINE>if (MlMetadata.getMlMetadata(clusterState).isUpgradeMode()) {<NEW_LINE>return AWAITING_UPGRADE;<NEW_LINE>}<NEW_LINE>if (MlMetadata.getMlMetadata(clusterState).isResetMode()) {<NEW_LINE>return RESET_IN_PROGRESS;<NEW_LINE>}<NEW_LINE>AssignmentFailure assignmentFailure = checkAssignment();<NEW_LINE>if (assignmentFailure == null) {<NEW_LINE><MASK><NEW_LINE>if (jobNode == null) {<NEW_LINE>return AWAITING_JOB_ASSIGNMENT;<NEW_LINE>}<NEW_LINE>// During node shutdown the datafeed will have been unassigned but the job will still be gracefully persisting state.<NEW_LINE>// During this time the datafeed will be trying to select the job's node, but we must disallow this. Instead the<NEW_LINE>// datafeed must remain in limbo until the job has finished persisting state and can move to a different node.<NEW_LINE>// Nodes that are shutting down will have been excluded from the candidate nodes.<NEW_LINE>if (candidateNodes.stream().anyMatch(candidateNode -> candidateNode.getId().equals(jobNode)) == false) {<NEW_LINE>return AWAITING_JOB_RELOCATION;<NEW_LINE>}<NEW_LINE>return new PersistentTasksCustomMetadata.Assignment(jobNode, "");<NEW_LINE>}<NEW_LINE>LOGGER.debug(assignmentFailure.reason);<NEW_LINE>assert assignmentFailure.reason.isEmpty() == false;<NEW_LINE>return new PersistentTasksCustomMetadata.Assignment(null, assignmentFailure.reason);<NEW_LINE>}
String jobNode = jobTask.getExecutorNode();
196,584
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see org.openhab.binding.digitalSTROM2.internal.client.job.SensorJob#execute(org.openhab.binding.digitalSTROM2.<NEW_LINE>* internal.client.DigitalSTROMAPI, java.lang.String)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void execute(DigitalSTROMAPI digitalSTROM, String token) {<NEW_LINE>int sensorValue = digitalSTROM.getDeviceSensorValue(token, this.device.getDSID(), null, this.sensorIndex);<NEW_LINE>logger.info(this.device.getName() + " DeviceSensorValue : " + this.sensorIndex + " " + this.sensorIndex.ordinal() + " " + this.sensorIndex.getIndex() + " " + sensorValue + ", DSID: " + this.device.getDSID().getValue());<NEW_LINE>switch(this.sensorIndex) {<NEW_LINE>case TEMPERATURE_INDOORS:<NEW_LINE>this.device.setTemperatureSensorValue(sensorValue);<NEW_LINE>break;<NEW_LINE>case RELATIVE_HUMIDITY_INDOORS:<NEW_LINE>this.device.setHumiditySensorValue(sensorValue);<NEW_LINE>break;<NEW_LINE>case TEMPERATURE_OUTDOORS:<NEW_LINE>this.device.setTemperatureSensorValue(sensorValue);<NEW_LINE>break;<NEW_LINE>case RELATIVE_HUMIDITY_OUTDOORS:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
this.device.setTemperatureSensorValue(sensorValue);
100,803
public boolean isRuntimeInvisible() {<NEW_LINE>final TypeBinding annotationBinding = this.resolvedType;<NEW_LINE>if (annotationBinding == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// could be forward reference<NEW_LINE>long metaTagBits = annotationBinding.getAnnotationTagBits();<NEW_LINE>// we need to filter out only "pure" type use and type parameter annotations, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=392119<NEW_LINE>if ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) != 0) {<NEW_LINE>if ((metaTagBits & TagBits.SE7AnnotationTargetMASK) == 0) {<NEW_LINE>// not a hybrid target.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)<NEW_LINE>// by default the retention is CLASS<NEW_LINE>return true;<NEW_LINE>return (metaTagBits & <MASK><NEW_LINE>}
TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention;
739,000
private void indeterminateChanged() {<NEW_LINE>boolean show = indeterminateButton.isSelected();<NEW_LINE>// show/hide indeterminate checkboxes<NEW_LINE>for (Component c : getComponents()) {<NEW_LINE>if ((c instanceof TestStateCheckBox && ((TestStateCheckBox) c).isStateIndeterminate()) || c instanceof FlatTriStateCheckBox || (c instanceof JLabel && ((JLabel) c).getText().startsWith("ind")))<NEW_LINE>c.setVisible(show);<NEW_LINE>}<NEW_LINE>// update layout<NEW_LINE>MigLayout layout = (MigLayout) getLayout();<NEW_LINE>Object columnCons = layout.getColumnConstraints();<NEW_LINE>AC ac = (columnCons instanceof String) ? ConstraintParser.parseColumnConstraints((String) columnCons) : (AC) columnCons;<NEW_LINE>DimConstraint[] constaints = ac.getConstaints();<NEW_LINE>constaints[3].setSizeGroup(show ? "1" : null);<NEW_LINE>constaints[6].setSizeGroup(show ? "2" : null);<NEW_LINE>BoundSize gap = show ? null : ConstraintParser.<MASK><NEW_LINE>constaints[3].setGapBefore(gap);<NEW_LINE>constaints[6].setGapBefore(gap);<NEW_LINE>layout.setColumnConstraints(ac);<NEW_LINE>preview.revalidate();<NEW_LINE>revalidate();<NEW_LINE>repaint();<NEW_LINE>FlatThemeFileEditor.putPrefsBoolean(preview.state, KEY_SHOW_INDETERMINATE, show, true);<NEW_LINE>}
parseBoundSize("0", true, true);
51,453
public Result<Void> delete(final Iterable<com.google.cloud.datastore.Key> keys) {<NEW_LINE>for (com.google.cloud.datastore.Key key : keys) deferrer.undefer(ofy.getOptions(), Key.create(key));<NEW_LINE>final Future<Void> fut = datastore.delete(keys);<NEW_LINE>final Result<Void> adapted <MASK><NEW_LINE>final Result<Void> result = new ResultWrapper<Void, Void>(adapted) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Void wrap(final Void orig) {<NEW_LINE>for (com.google.cloud.datastore.Key key : keys) session.addValue(Key.create(key), null);<NEW_LINE>return orig;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (ofy.getTransaction() != null)<NEW_LINE>((PrivateAsyncTransaction) ofy.getTransaction()).enlist(result);<NEW_LINE>return result;<NEW_LINE>}
= new ResultAdapter<>(fut);
571,983
public CurrencyParameterSensitivities parameterSensitivity(PointSensitivities pointSensitivities) {<NEW_LINE>CurrencyParameterSensitivities sens = CurrencyParameterSensitivities.empty();<NEW_LINE>for (PointSensitivity point : pointSensitivities.getSensitivities()) {<NEW_LINE>if (point instanceof RepoCurveZeroRateSensitivity) {<NEW_LINE>RepoCurveZeroRateSensitivity pt = (RepoCurveZeroRateSensitivity) point;<NEW_LINE>RepoCurveDiscountFactors factors = repoCurveDiscountFactors(pt.getRepoGroup(<MASK><NEW_LINE>sens = sens.combinedWith(factors.parameterSensitivity(pt));<NEW_LINE>} else if (point instanceof IssuerCurveZeroRateSensitivity) {<NEW_LINE>IssuerCurveZeroRateSensitivity pt = (IssuerCurveZeroRateSensitivity) point;<NEW_LINE>IssuerCurveDiscountFactors factors = issuerCurveDiscountFactors(pt.getLegalEntityGroup(), pt.getCurveCurrency());<NEW_LINE>sens = sens.combinedWith(factors.parameterSensitivity(pt));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sens;<NEW_LINE>}
), pt.getCurveCurrency());
1,848,439
public void doVibrate(int id, int effect, int strength, int oneShot) {<NEW_LINE>Vibrator vibrator = null;<NEW_LINE>int repeat = 0;<NEW_LINE>long[] pattern = { 0, 16 };<NEW_LINE>int[] strengths = { 0, strength };<NEW_LINE>if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {<NEW_LINE>if (id == -1)<NEW_LINE>vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);<NEW_LINE>else {<NEW_LINE>InputDevice <MASK><NEW_LINE>if (dev != null)<NEW_LINE>vibrator = dev.getVibrator();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (vibrator == null)<NEW_LINE>return;<NEW_LINE>if (strength == 0) {<NEW_LINE>vibrator.cancel();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (oneShot > 0)<NEW_LINE>repeat = -1;<NEW_LINE>else<NEW_LINE>pattern[1] = 1000;<NEW_LINE>if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {<NEW_LINE>if (id >= 0)<NEW_LINE>Log.i("RetroActivity", "Vibrate id " + id + ": strength " + strength);<NEW_LINE>vibrator.vibrate(VibrationEffect.createWaveform(pattern, strengths, repeat), new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_GAME).setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION).build());<NEW_LINE>} else {<NEW_LINE>vibrator.vibrate(pattern, repeat);<NEW_LINE>}<NEW_LINE>}
dev = InputDevice.getDevice(id);
134,962
public int appendRecord(final int recordVersion, final byte[] record, final int requestedPosition, final Set<Integer> bookedRecordPositions) {<NEW_LINE>int freePosition = getIntValue(FREE_POSITION_OFFSET);<NEW_LINE>final int indexesLength = getIntValue(PAGE_INDEXES_LENGTH_OFFSET);<NEW_LINE>final int lastEntryIndexPosition = PAGE_INDEXES_OFFSET + indexesLength * INDEX_ITEM_SIZE;<NEW_LINE>int entrySize = record.length + 3 * OIntegerSerializer.INT_SIZE;<NEW_LINE>int freeListHeader = getIntValue(FREELIST_HEADER_OFFSET);<NEW_LINE>if (!checkSpace(entrySize)) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>if (freePosition - entrySize < lastEntryIndexPosition + INDEX_ITEM_SIZE) {<NEW_LINE>doDefragmentation();<NEW_LINE>}<NEW_LINE>freePosition = getIntValue(FREE_POSITION_OFFSET);<NEW_LINE>freePosition -= entrySize;<NEW_LINE>int entryIndex;<NEW_LINE>boolean allocatedFromFreeList;<NEW_LINE>if (requestedPosition < 0) {<NEW_LINE>final ORawPair<Integer, Boolean> entry = findFirstEmptySlot(recordVersion, freePosition, <MASK><NEW_LINE>entryIndex = entry.first;<NEW_LINE>allocatedFromFreeList = entry.second;<NEW_LINE>} else {<NEW_LINE>allocatedFromFreeList = insertIntoRequestedSlot(recordVersion, freePosition, entrySize, requestedPosition, freeListHeader);<NEW_LINE>entryIndex = requestedPosition;<NEW_LINE>}<NEW_LINE>int entryPosition = freePosition;<NEW_LINE>setIntValue(entryPosition, entrySize);<NEW_LINE>entryPosition += OIntegerSerializer.INT_SIZE;<NEW_LINE>setIntValue(entryPosition, entryIndex);<NEW_LINE>entryPosition += OIntegerSerializer.INT_SIZE;<NEW_LINE>setIntValue(entryPosition, record.length);<NEW_LINE>entryPosition += OIntegerSerializer.INT_SIZE;<NEW_LINE>setBinaryValue(entryPosition, record);<NEW_LINE>setIntValue(FREE_POSITION_OFFSET, freePosition);<NEW_LINE>incrementEntriesCount();<NEW_LINE>if (entryIndex >= 0) {<NEW_LINE>addPageOperation(new VersionPageAppendRecordPO(recordVersion, record, requestedPosition, entryIndex, allocatedFromFreeList));<NEW_LINE>}<NEW_LINE>return entryIndex;<NEW_LINE>}
indexesLength, entrySize, freeListHeader, bookedRecordPositions);
173,698
public static DescribeDBInstancesByPerformanceResponse unmarshall(DescribeDBInstancesByPerformanceResponse describeDBInstancesByPerformanceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDBInstancesByPerformanceResponse.setRequestId(_ctx.stringValue("DescribeDBInstancesByPerformanceResponse.RequestId"));<NEW_LINE>describeDBInstancesByPerformanceResponse.setPageNumber(_ctx.integerValue("DescribeDBInstancesByPerformanceResponse.PageNumber"));<NEW_LINE>describeDBInstancesByPerformanceResponse.setTotalRecordCount(_ctx.integerValue("DescribeDBInstancesByPerformanceResponse.TotalRecordCount"));<NEW_LINE>describeDBInstancesByPerformanceResponse.setPageRecordCount(_ctx.integerValue("DescribeDBInstancesByPerformanceResponse.PageRecordCount"));<NEW_LINE>List<DBInstancePerformance> items = new ArrayList<DBInstancePerformance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDBInstancesByPerformanceResponse.Items.Length"); i++) {<NEW_LINE>DBInstancePerformance dBInstancePerformance = new DBInstancePerformance();<NEW_LINE>dBInstancePerformance.setCPUUsage(_ctx.stringValue("DescribeDBInstancesByPerformanceResponse.Items[" + i + "].CPUUsage"));<NEW_LINE>dBInstancePerformance.setIOPSUsage(_ctx.stringValue("DescribeDBInstancesByPerformanceResponse.Items[" + i + "].IOPSUsage"));<NEW_LINE>dBInstancePerformance.setDiskUsage(_ctx.stringValue("DescribeDBInstancesByPerformanceResponse.Items[" + i + "].DiskUsage"));<NEW_LINE>dBInstancePerformance.setSessionUsage(_ctx.stringValue<MASK><NEW_LINE>dBInstancePerformance.setDBInstanceId(_ctx.stringValue("DescribeDBInstancesByPerformanceResponse.Items[" + i + "].DBInstanceId"));<NEW_LINE>dBInstancePerformance.setDBInstanceDescription(_ctx.stringValue("DescribeDBInstancesByPerformanceResponse.Items[" + i + "].DBInstanceDescription"));<NEW_LINE>items.add(dBInstancePerformance);<NEW_LINE>}<NEW_LINE>describeDBInstancesByPerformanceResponse.setItems(items);<NEW_LINE>return describeDBInstancesByPerformanceResponse;<NEW_LINE>}
("DescribeDBInstancesByPerformanceResponse.Items[" + i + "].SessionUsage"));
1,151,540
public AccountQuota unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>AccountQuota accountQuota = new AccountQuota();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 3;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return accountQuota;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("AccountQuotaName", targetDepth)) {<NEW_LINE>accountQuota.setAccountQuotaName(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Used", targetDepth)) {<NEW_LINE>accountQuota.setUsed(LongStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Max", targetDepth)) {<NEW_LINE>accountQuota.setMax(LongStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return accountQuota;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
1,081,282
private Mono<PagedResponse<LogzMonitorResourceInner>> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == 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>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName 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.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
20,446
public void copyTo(CharBuffer target) throws CudaException {<NEW_LINE>final int fromIndex = target.position();<NEW_LINE>final <MASK><NEW_LINE>lengthCheck(toIndex - fromIndex, 1);<NEW_LINE>if (target.isDirect()) {<NEW_LINE>// <br/><NEW_LINE>// <br/><NEW_LINE>copyToHostDirect(// <br/><NEW_LINE>deviceId, getAddress(), target, (long) fromIndex << 1, (long) toIndex << 1);<NEW_LINE>} else if (target.hasArray()) {<NEW_LINE>final int offset = target.arrayOffset();<NEW_LINE>copyTo(target.array(), fromIndex + offset, toIndex + offset);<NEW_LINE>} else {<NEW_LINE>final long byteCount = (long) (toIndex - fromIndex) << 1;<NEW_LINE>final int chunkSize = chunkBytes(byteCount);<NEW_LINE>final // <br/><NEW_LINE>CharBuffer // <br/><NEW_LINE>tmp = allocateDirectBuffer(chunkSize).order(DeviceOrder).asCharBuffer();<NEW_LINE>try {<NEW_LINE>for (long start = 0; start < byteCount; start += chunkSize) {<NEW_LINE>final int chunk = (int) Math.min(byteCount - start, chunkSize);<NEW_LINE>tmp.position(0).limit(chunk >> 1);<NEW_LINE>// <br/><NEW_LINE>// <br/><NEW_LINE>copyToHostDirect(// <br/><NEW_LINE>deviceId, getAddress() + start, tmp, 0, chunk);<NEW_LINE>target.put(tmp);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>freeDirectBuffer(tmp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>target.position(toIndex);<NEW_LINE>}
int toIndex = target.limit();
1,267,344
private void initData() {<NEW_LINE>a <MASK><NEW_LINE>b = new ImageFloat4(numElementsX, numElementsY);<NEW_LINE>c = new ImageFloat4(numElementsX, numElementsY);<NEW_LINE>Random r = new Random();<NEW_LINE>for (int j = 0; j < numElementsY; j++) {<NEW_LINE>for (int i = 0; i < numElementsX; i++) {<NEW_LINE>float[] ra = new float[4];<NEW_LINE>IntStream.range(0, ra.length).forEach(x -> ra[x] = r.nextFloat());<NEW_LINE>float[] rb = new float[4];<NEW_LINE>IntStream.range(0, rb.length).forEach(x -> rb[x] = r.nextFloat());<NEW_LINE>a.set(i, j, new Float4(ra));<NEW_LINE>b.set(i, j, new Float4(rb));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new ImageFloat4(numElementsX, numElementsY);
437,283
public DecryptResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DecryptResult decryptResult = new DecryptResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return decryptResult;<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("KeyId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>decryptResult.setKeyId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Plaintext", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>decryptResult.setPlaintext(context.getUnmarshaller(java.nio.ByteBuffer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("EncryptionAlgorithm", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>decryptResult.setEncryptionAlgorithm(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 decryptResult;<NEW_LINE>}
class).unmarshall(context));
1,686,065
private void createClearDialog(final QuestionWidget qw) {<NEW_LINE>alertDialog = new MaterialAlertDialogBuilder(this).create();<NEW_LINE>alertDialog.setTitle(getString(R.string.clear_answer_ask));<NEW_LINE>String question = qw<MASK><NEW_LINE>if (question == null) {<NEW_LINE>question = "";<NEW_LINE>}<NEW_LINE>if (question.length() > 50) {<NEW_LINE>question = question.substring(0, 50) + "...";<NEW_LINE>}<NEW_LINE>alertDialog.setMessage(getString(R.string.clearanswer_confirm, question));<NEW_LINE>DialogInterface.OnClickListener quitListener = new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int i) {<NEW_LINE>switch(i) {<NEW_LINE>case // yes<NEW_LINE>BUTTON_POSITIVE:<NEW_LINE>clearAnswer(qw);<NEW_LINE>saveAnswersForCurrentScreen(DO_NOT_EVALUATE_CONSTRAINTS);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>alertDialog.setCancelable(false);<NEW_LINE>alertDialog.setButton(BUTTON_POSITIVE, getString(R.string.discard_answer), quitListener);<NEW_LINE>alertDialog.setButton(BUTTON_NEGATIVE, getString(R.string.clear_answer_no), quitListener);<NEW_LINE>alertDialog.show();<NEW_LINE>}
.getFormEntryPrompt().getLongText();
234,574
public ExceptionMappersBuildItem scanForExceptionMappers(CombinedIndexBuildItem combinedIndexBuildItem, ApplicationResultBuildItem applicationResultBuildItem, BuildProducer<AdditionalBeanBuildItem> additionalBeanBuildItemBuildProducer, BuildProducer<ReflectiveClassBuildItem> reflectiveClassBuildItemBuildProducer, List<ExceptionMapperBuildItem> mappers, List<UnwrappedExceptionBuildItem> unwrappedExceptions, Capabilities capabilities) {<NEW_LINE>AdditionalBeanBuildItem.Builder beanBuilder = AdditionalBeanBuildItem.builder().setUnremovable();<NEW_LINE>ExceptionMapping exceptions = ResteasyReactiveExceptionMappingScanner.scanForExceptionMappers(combinedIndexBuildItem.getComputingIndex(), applicationResultBuildItem.getResult());<NEW_LINE>exceptions.addBlockingProblem(BlockingOperationNotAllowedException.class);<NEW_LINE>exceptions.addBlockingProblem(BlockingNotAllowedException.class);<NEW_LINE>for (UnwrappedExceptionBuildItem bi : unwrappedExceptions) {<NEW_LINE>exceptions.addUnwrappedException(bi.getThrowableClass().getName());<NEW_LINE>}<NEW_LINE>if (capabilities.isPresent(Capability.HIBERNATE_REACTIVE)) {<NEW_LINE>exceptions.addNonBlockingProblem(new ExceptionMapping.ExceptionTypeAndMessageContainsPredicate(IllegalStateException.class, "HR000068"));<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, ResourceExceptionMapper<? extends Throwable>> i : exceptions.getMappers().entrySet()) {<NEW_LINE>beanBuilder.addBeanClass(i.getValue().getClassName());<NEW_LINE>}<NEW_LINE>for (ExceptionMapperBuildItem additionalExceptionMapper : mappers) {<NEW_LINE>if (additionalExceptionMapper.isRegisterAsBean()) {<NEW_LINE>beanBuilder.addBeanClass(additionalExceptionMapper.getClassName());<NEW_LINE>} else {<NEW_LINE>reflectiveClassBuildItemBuildProducer.produce(new ReflectiveClassBuildItem(true, false, false, additionalExceptionMapper.getClassName()));<NEW_LINE>}<NEW_LINE>int priority = Priorities.USER;<NEW_LINE>if (additionalExceptionMapper.getPriority() != null) {<NEW_LINE>priority = additionalExceptionMapper.getPriority();<NEW_LINE>}<NEW_LINE>ResourceExceptionMapper<Throwable> <MASK><NEW_LINE>mapper.setPriority(priority);<NEW_LINE>mapper.setClassName(additionalExceptionMapper.getClassName());<NEW_LINE>exceptions.addExceptionMapper(additionalExceptionMapper.getHandledExceptionName(), mapper);<NEW_LINE>}<NEW_LINE>additionalBeanBuildItemBuildProducer.produce(beanBuilder.build());<NEW_LINE>return new ExceptionMappersBuildItem(exceptions);<NEW_LINE>}
mapper = new ResourceExceptionMapper<>();
1,567,534
public static <T extends @Nullable Object> BloomFilter<T> readFrom(InputStream in, Funnel<? super T> funnel) throws IOException {<NEW_LINE>checkNotNull(in, "InputStream");<NEW_LINE>checkNotNull(funnel, "Funnel");<NEW_LINE>int strategyOrdinal = -1;<NEW_LINE>int numHashFunctions = -1;<NEW_LINE>int dataLength = -1;<NEW_LINE>try {<NEW_LINE>DataInputStream din = new DataInputStream(in);<NEW_LINE>// currently this assumes there is no negative ordinal; will have to be updated if we<NEW_LINE>// add non-stateless strategies (for which we've reserved negative ordinals; see<NEW_LINE>// Strategy.ordinal()).<NEW_LINE>strategyOrdinal = din.readByte();<NEW_LINE>numHashFunctions = UnsignedBytes.toInt(din.readByte());<NEW_LINE>dataLength = din.readInt();<NEW_LINE>Strategy strategy = BloomFilterStrategies.values()[strategyOrdinal];<NEW_LINE>LockFreeBitArray dataArray = new LockFreeBitArray(LongMath.checkedMultiply(dataLength, 64L));<NEW_LINE>for (int i = 0; i < dataLength; i++) {<NEW_LINE>dataArray.putData(i, din.readLong());<NEW_LINE>}<NEW_LINE>return new BloomFilter<T>(<MASK><NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>String message = "Unable to deserialize BloomFilter from InputStream." + " strategyOrdinal: " + strategyOrdinal + " numHashFunctions: " + numHashFunctions + " dataLength: " + dataLength;<NEW_LINE>throw new IOException(message, e);<NEW_LINE>}<NEW_LINE>}
dataArray, numHashFunctions, funnel, strategy);
984,440
public static void handle(String stmt, ManagerConnection c) {<NEW_LINE>ByteBuffer buffer = c.allocate();<NEW_LINE>// write header<NEW_LINE>buffer = header.write(buffer, c, true);<NEW_LINE>// write fields<NEW_LINE>for (FieldPacket field : fields) {<NEW_LINE>buffer = field.write(buffer, c, true);<NEW_LINE>}<NEW_LINE>// write eof<NEW_LINE>buffer = eof.write(buffer, c, true);<NEW_LINE>// write rows<NEW_LINE>byte packetId = eof.packetId;<NEW_LINE>PackageBufINf bufInf = null;<NEW_LINE>// show log key=warn limit=0,30<NEW_LINE>Map<String, String> condPairMap = getCondPair(stmt);<NEW_LINE>if (condPairMap.isEmpty()) {<NEW_LINE>bufInf = <MASK><NEW_LINE>} else {<NEW_LINE>String logFile = condPairMap.get("file");<NEW_LINE>if (logFile == null) {<NEW_LINE>logFile = DEFAULT_LOGFILE;<NEW_LINE>}<NEW_LINE>String limitStr = condPairMap.get("limit");<NEW_LINE>limitStr = (limitStr != null) ? limitStr : "0," + 100000;<NEW_LINE>String[] limtArry = limitStr.split("\\s|,");<NEW_LINE>int start = Integer.parseInt(limtArry[0]);<NEW_LINE>int page = Integer.parseInt(limtArry[1]);<NEW_LINE>int end = Integer.valueOf(start + page);<NEW_LINE>String key = condPairMap.get("key");<NEW_LINE>String regex = condPairMap.get("regex");<NEW_LINE>bufInf = showLogRange(c, buffer, packetId, key, regex, start, end, logFile);<NEW_LINE>}<NEW_LINE>packetId = bufInf.packetId;<NEW_LINE>buffer = bufInf.buffer;<NEW_LINE>EOFPacket lastEof = new EOFPacket();<NEW_LINE>lastEof.packetId = ++packetId;<NEW_LINE>buffer = lastEof.write(buffer, c, true);<NEW_LINE>// write buffer<NEW_LINE>c.write(buffer);<NEW_LINE>}
showLogSum(c, buffer, packetId);
419,393
public void handleEvent(@NonNull final PPOrderChangedEvent event) {<NEW_LINE>final List<Candidate> candidatesToUpdate = candidateRepositoryRetrieval.retrieveCandidatesForPPOrderId(event.getPpOrderId());<NEW_LINE>Check.errorIf(candidatesToUpdate.isEmpty(), "No Candidates found for PP_Order_ID={}", event.getPpOrderId());<NEW_LINE>final List<Candidate> updatedCandidatesToPersist = new ArrayList<>();<NEW_LINE>//<NEW_LINE>// Header candidate (supply)<NEW_LINE>final Candidate headerCandidate;<NEW_LINE>{<NEW_LINE>final Candidate headerCandidateToUpdate = extractHeaderCandidate(candidatesToUpdate);<NEW_LINE><MASK><NEW_LINE>updatedCandidatesToPersist.add(headerCandidate);<NEW_LINE>}<NEW_LINE>final ProductionDetail headerProductionDetail = ProductionDetail.cast(headerCandidate.getBusinessCaseDetail());<NEW_LINE>final DemandDetail headerDemandDetail = headerCandidate.getDemandDetail();<NEW_LINE>//<NEW_LINE>// Line candidates (demands, supplies)<NEW_LINE>if (event.isJustCompleted()) {<NEW_LINE>Loggables.withLogger(logger, Level.DEBUG).addLog("PPOrder was just completed; create the demand and supply candidates for ppOrder lines");<NEW_LINE>// only the ppOrder's header supply product can be picked directly because only there we might know the shipment schedule ID<NEW_LINE>PPOrderLineCandidatesCreateCommand.builder().candidateChangeService(candidateChangeService).candidateRepositoryRetrieval(candidateRepositoryRetrieval).ppOrder(event.getPpOrderAfterChanges()).headerDemandDetail(headerDemandDetail).groupId(headerCandidate.getGroupId()).headerCandidateSeqNo(headerCandidate.getSeqNo()).advised(headerProductionDetail.getAdvised()).// only the ppOrder's header supply product can be picked directly because only there we might know the shipment schedule ID<NEW_LINE>pickDirectlyIfFeasible(Flag.FALSE_DONT_UPDATE).create();<NEW_LINE>} else {<NEW_LINE>updatedCandidatesToPersist.addAll(processPPOrderLinesChanges(candidatesToUpdate, event.getNewDocStatus(), event.getPpOrderLineChanges()));<NEW_LINE>// TODO: handle delete and creation of new lines<NEW_LINE>}<NEW_LINE>updatedCandidatesToPersist.forEach(candidateChangeService::onCandidateNewOrChange);<NEW_LINE>}
headerCandidate = processPPOrderChange(headerCandidateToUpdate, event);
1,791,344
protected void initHistoryJobHandlers() {<NEW_LINE>if (isAsyncHistoryEnabled) {<NEW_LINE>historyJobHandlers = new HashMap<>();<NEW_LINE>List<HistoryJsonTransformer> allHistoryJsonTransformers = new ArrayList<>(initDefaultHistoryJsonTransformers());<NEW_LINE>if (customHistoryJsonTransformers != null) {<NEW_LINE>allHistoryJsonTransformers.addAll(customHistoryJsonTransformers);<NEW_LINE>}<NEW_LINE>AsyncHistoryJobHandler asyncHistoryJobHandler <MASK><NEW_LINE>allHistoryJsonTransformers.forEach(asyncHistoryJobHandler::addHistoryJsonTransformer);<NEW_LINE>asyncHistoryJobHandler.setAsyncHistoryJsonGroupingEnabled(isAsyncHistoryJsonGroupingEnabled);<NEW_LINE>historyJobHandlers.put(asyncHistoryJobHandler.getType(), asyncHistoryJobHandler);<NEW_LINE>AsyncHistoryJobZippedHandler asyncHistoryJobZippedHandler = new AsyncHistoryJobZippedHandler(CmmnAsyncHistoryConstants.JOB_HANDLER_TYPE_DEFAULT_ASYNC_HISTORY_ZIPPED);<NEW_LINE>allHistoryJsonTransformers.forEach(asyncHistoryJobZippedHandler::addHistoryJsonTransformer);<NEW_LINE>asyncHistoryJobZippedHandler.setAsyncHistoryJsonGroupingEnabled(isAsyncHistoryJsonGroupingEnabled);<NEW_LINE>historyJobHandlers.put(asyncHistoryJobZippedHandler.getType(), asyncHistoryJobZippedHandler);<NEW_LINE>if (getCustomHistoryJobHandlers() != null) {<NEW_LINE>for (HistoryJobHandler customJobHandler : getCustomHistoryJobHandlers()) {<NEW_LINE>historyJobHandlers.put(customJobHandler.getType(), customJobHandler);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new AsyncHistoryJobHandler(CmmnAsyncHistoryConstants.JOB_HANDLER_TYPE_DEFAULT_ASYNC_HISTORY);
123,449
public SOAPMessage invoke(SOAPMessage request) {<NEW_LINE>SOAPMessage response = null;<NEW_LINE>try {<NEW_LINE>System.out.println("Incoming Client Request as a SOAPMessage:");<NEW_LINE>request.writeTo(System.out);<NEW_LINE>String hdrText = request.getSOAPHeader().getTextContent();<NEW_LINE>System.out.println("Incoming SOAP Header:" + hdrText);<NEW_LINE>StringReader respMsg = new StringReader("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Body xmlns=\"http://sha2sig.wssecfvt.test/types\"><provider>This is WSSECFVT SHA384 Web Service.</provider></soapenv:Body></soapenv:Envelope>");<NEW_LINE>Source src = new StreamSource(respMsg);<NEW_LINE>MessageFactory factory = MessageFactory.newInstance();<NEW_LINE>response = factory.createMessage();<NEW_LINE>response.<MASK><NEW_LINE>response.saveChanges();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
getSOAPPart().setContent(src);
446,332
public void init(Project project, XBreakpointManager breakpointManager, @Nonnull XBreakpointBase breakpoint, @Nullable XDebuggerEditorsProvider debuggerEditorsProvider) {<NEW_LINE>init(project, breakpointManager, breakpoint);<NEW_LINE>if (debuggerEditorsProvider != null) {<NEW_LINE>ActionListener listener = new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(final ActionEvent e) {<NEW_LINE>onCheckboxChanged();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>myLogExpressionComboBox = new XDebuggerExpressionComboBox(project, debuggerEditorsProvider, LOG_EXPRESSION_HISTORY_ID, myBreakpoint.getSourcePosition(), true);<NEW_LINE><MASK><NEW_LINE>myLogExpressionPanel.add(logExpressionComponent, BorderLayout.CENTER);<NEW_LINE>myLogExpressionComboBox.setEnabled(false);<NEW_LINE>myTemporaryCheckBox.setVisible(breakpoint instanceof XLineBreakpoint);<NEW_LINE>myLogExpressionCheckBox.addActionListener(listener);<NEW_LINE>DebuggerUIUtil.focusEditorOnCheck(myLogExpressionCheckBox, myLogExpressionComboBox.getEditorComponent());<NEW_LINE>} else {<NEW_LINE>myExpressionPanel.getParent().remove(myExpressionPanel);<NEW_LINE>}<NEW_LINE>}
JComponent logExpressionComponent = myLogExpressionComboBox.getComponent();
378,553
private List<Phone> parseIntoPhones() throws Exception {<NEW_LINE>// initialize List of Phones (note that initial size is not final!):<NEW_LINE>phones = new ArrayList<Phone>(units.size() / 2);<NEW_LINE>// iterate over the units:<NEW_LINE>int u = 0;<NEW_LINE>while (u < units.size()) {<NEW_LINE>// get unit...<NEW_LINE>SelectedUnit unit = units.get(u);<NEW_LINE>// ...and its target as a HalfPhoneTarget, so that we can...<NEW_LINE>HalfPhoneTarget target = <MASK><NEW_LINE>// ...query its position in the phone:<NEW_LINE>if (target.isLeftHalf()) {<NEW_LINE>// if this is the left half of a phone...<NEW_LINE>if (u < units.size() - 1) {<NEW_LINE>// ...and there is a next unit in the list...<NEW_LINE>SelectedUnit nextUnit = units.get(u + 1);<NEW_LINE>HalfPhoneTarget nextTarget = (HalfPhoneTarget) nextUnit.getTarget();<NEW_LINE>if (nextTarget.isRightHalf()) {<NEW_LINE>// ...and the next unit's target is the right half of the phone, add the phone:<NEW_LINE>phones.add(new Phone(unit, nextUnit, sampleRate));<NEW_LINE>u++;<NEW_LINE>} else {<NEW_LINE>// otherwise, add a degenerate phone with no right halfphone:<NEW_LINE>phones.add(new Phone(unit, null, sampleRate));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// otherwise, add a degenerate phone with no right halfphone:<NEW_LINE>phones.add(new Phone(unit, null, sampleRate));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// otherwise, add a degenerate phone with no left halfphone:<NEW_LINE>phones.add(new Phone(null, unit, sampleRate));<NEW_LINE>}<NEW_LINE>u++;<NEW_LINE>}<NEW_LINE>// make sure we've seen all the units:<NEW_LINE>assert u == units.size();<NEW_LINE>// assign target F0 values to Phones:<NEW_LINE>insertTargetF0Values();<NEW_LINE>return phones;<NEW_LINE>}
(HalfPhoneTarget) unit.getTarget();
1,359,514
public static QueryClusterDetailResponse unmarshall(QueryClusterDetailResponse queryClusterDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryClusterDetailResponse.setRequestId(_ctx.stringValue("QueryClusterDetailResponse.RequestId"));<NEW_LINE>queryClusterDetailResponse.setMessage(_ctx.stringValue("QueryClusterDetailResponse.Message"));<NEW_LINE>queryClusterDetailResponse.setErrorCode(_ctx.stringValue("QueryClusterDetailResponse.ErrorCode"));<NEW_LINE>queryClusterDetailResponse.setSuccess(_ctx.booleanValue("QueryClusterDetailResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setVpcId(_ctx.stringValue("QueryClusterDetailResponse.Data.VpcId"));<NEW_LINE>data.setCreateTime(_ctx.stringValue("QueryClusterDetailResponse.Data.CreateTime"));<NEW_LINE>data.setIntranetAddress(_ctx.stringValue("QueryClusterDetailResponse.Data.IntranetAddress"));<NEW_LINE>data.setDiskType(_ctx.stringValue("QueryClusterDetailResponse.Data.DiskType"));<NEW_LINE>data.setPubNetworkFlow(_ctx.stringValue("QueryClusterDetailResponse.Data.PubNetworkFlow"));<NEW_LINE>data.setDiskCapacity(_ctx.longValue("QueryClusterDetailResponse.Data.DiskCapacity"));<NEW_LINE>data.setMemoryCapacity(_ctx.longValue("QueryClusterDetailResponse.Data.MemoryCapacity"));<NEW_LINE>data.setClusterAliasName(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterAliasName"));<NEW_LINE>data.setInstanceCount(_ctx.integerValue("QueryClusterDetailResponse.Data.InstanceCount"));<NEW_LINE>data.setIntranetPort(_ctx.stringValue("QueryClusterDetailResponse.Data.IntranetPort"));<NEW_LINE>data.setClusterId(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterId"));<NEW_LINE>data.setIntranetDomain(_ctx.stringValue("QueryClusterDetailResponse.Data.IntranetDomain"));<NEW_LINE>data.setInternetDomain(_ctx.stringValue("QueryClusterDetailResponse.Data.InternetDomain"));<NEW_LINE>data.setPayInfo(_ctx.stringValue("QueryClusterDetailResponse.Data.PayInfo"));<NEW_LINE>data.setInternetAddress(_ctx.stringValue("QueryClusterDetailResponse.Data.InternetAddress"));<NEW_LINE>data.setInstanceId(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceId"));<NEW_LINE>data.setAclEntryList(_ctx.stringValue("QueryClusterDetailResponse.Data.AclEntryList"));<NEW_LINE>data.setHealthStatus(_ctx.stringValue("QueryClusterDetailResponse.Data.HealthStatus"));<NEW_LINE>data.setInitCostTime(_ctx.longValue("QueryClusterDetailResponse.Data.InitCostTime"));<NEW_LINE>data.setRegionId(_ctx.stringValue("QueryClusterDetailResponse.Data.RegionId"));<NEW_LINE>data.setAclId(_ctx.stringValue("QueryClusterDetailResponse.Data.AclId"));<NEW_LINE>data.setCpu(_ctx.integerValue("QueryClusterDetailResponse.Data.Cpu"));<NEW_LINE>data.setClusterType(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterType"));<NEW_LINE>data.setClusterName(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterName"));<NEW_LINE>data.setInitStatus(_ctx.stringValue("QueryClusterDetailResponse.Data.InitStatus"));<NEW_LINE>data.setInternetPort(_ctx.stringValue("QueryClusterDetailResponse.Data.InternetPort"));<NEW_LINE>data.setAppVersion(_ctx.stringValue("QueryClusterDetailResponse.Data.AppVersion"));<NEW_LINE>data.setNetType(_ctx.stringValue("QueryClusterDetailResponse.Data.NetType"));<NEW_LINE>data.setClusterVersion(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterVersion"));<NEW_LINE>data.setClusterSpecification(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterSpecification"));<NEW_LINE>data.setVSwitchId(_ctx.stringValue("QueryClusterDetailResponse.Data.VSwitchId"));<NEW_LINE>data.setConnectionType(_ctx.stringValue("QueryClusterDetailResponse.Data.ConnectionType"));<NEW_LINE>data.setMseVersion(_ctx.stringValue("QueryClusterDetailResponse.Data.MseVersion"));<NEW_LINE>data.setChargeType(_ctx.stringValue("QueryClusterDetailResponse.Data.ChargeType"));<NEW_LINE>List<InstanceModel> instanceModels = new ArrayList<InstanceModel>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryClusterDetailResponse.Data.InstanceModels.Length"); i++) {<NEW_LINE>InstanceModel instanceModel = new InstanceModel();<NEW_LINE>instanceModel.setPodName(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].PodName"));<NEW_LINE>instanceModel.setSingleTunnelVip(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].SingleTunnelVip"));<NEW_LINE>instanceModel.setInternetIp(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].InternetIp"));<NEW_LINE>instanceModel.setIp(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].Ip"));<NEW_LINE>instanceModel.setRole(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].Role"));<NEW_LINE>instanceModel.setHealthStatus(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].HealthStatus"));<NEW_LINE>instanceModel.setCreationTimestamp(_ctx.stringValue<MASK><NEW_LINE>instanceModels.add(instanceModel);<NEW_LINE>}<NEW_LINE>data.setInstanceModels(instanceModels);<NEW_LINE>queryClusterDetailResponse.setData(data);<NEW_LINE>return queryClusterDetailResponse;<NEW_LINE>}
("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].CreationTimestamp"));
830,006
// TODO: Use one of the new text classes, like /help ?<NEW_LINE>private void warpList(final CommandSource sender, final String[] args, final IUser user) throws Exception {<NEW_LINE>final IWarps warps = ess.getWarps();<NEW_LINE>final List<String> warpNameList = getAvailableWarpsFor(user);<NEW_LINE>if (warpNameList.isEmpty()) {<NEW_LINE>throw new Exception(tl("noWarpsDefined"));<NEW_LINE>}<NEW_LINE>int page = 1;<NEW_LINE>if (args.length > 0 && NumberUtil.isInt(args[0])) {<NEW_LINE>page = Integer.parseInt(args[0]);<NEW_LINE>}<NEW_LINE>final int maxPages = (int) Math.ceil(warpNameList.size() / (double) WARPS_PER_PAGE);<NEW_LINE>if (page > maxPages) {<NEW_LINE>page = maxPages;<NEW_LINE>}<NEW_LINE>final int warpPage = (page - 1) * WARPS_PER_PAGE;<NEW_LINE>final String warpList = StringUtil.joinList(warpNameList.subList(warpPage, warpPage + Math.min(warpNameList.size() - warpPage, WARPS_PER_PAGE)));<NEW_LINE>if (warpNameList.size() > WARPS_PER_PAGE) {<NEW_LINE>sender.sendMessage(tl("warpsCount", warpNameList.size(), page, maxPages));<NEW_LINE>sender.sendMessage<MASK><NEW_LINE>} else {<NEW_LINE>sender.sendMessage(tl("warps", warpList));<NEW_LINE>}<NEW_LINE>}
(tl("warpList", warpList));
1,037,383
public void configure(final Socket socket) throws IOException {<NEW_LINE>if (preferences.getInteger("connection.buffer.receive") > 0) {<NEW_LINE>socket.setReceiveBufferSize(preferences.getInteger("connection.buffer.receive"));<NEW_LINE>}<NEW_LINE>if (preferences.getInteger("connection.buffer.send") > 0) {<NEW_LINE>socket.setSendBufferSize(preferences.getInteger("connection.buffer.send"));<NEW_LINE>}<NEW_LINE>final int timeout = ConnectionTimeoutFactory.get<MASK><NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Set timeout to %dms for socket %s", timeout, socket));<NEW_LINE>}<NEW_LINE>socket.setSoTimeout(timeout);<NEW_LINE>if (preferences.getBoolean("connection.socket.linger")) {<NEW_LINE>// The setting only affects socket close. Make sure closing SSL socket does not hang because close_notify cannot be sent.<NEW_LINE>socket.setSoLinger(true, timeout);<NEW_LINE>}<NEW_LINE>if (preferences.getBoolean("connection.socket.keepalive")) {<NEW_LINE>socket.setKeepAlive(true);<NEW_LINE>}<NEW_LINE>}
().getTimeout() * 1000;
5,133
public LibSvmSinkStreamOp sinkFrom(StreamOperator<?> in) {<NEW_LINE>final String vectorCol = getVectorCol();<NEW_LINE>final String labelCol = getLabelCol();<NEW_LINE>final int vectorColIdx = TableUtil.findColIndexWithAssertAndHint(in.getColNames(), vectorCol);<NEW_LINE>final int labelColIdx = TableUtil.findColIndexWithAssertAndHint(in.getColNames(), labelCol);<NEW_LINE>final int startIndex = getParams(<MASK><NEW_LINE>DataStream<Row> outputRows = in.getDataStream().map(new MapFunction<Row, Row>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 8548456443314432148L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Row map(Row value) throws Exception {<NEW_LINE>return Row.of(LibSvmSinkBatchOp.formatLibSvm(value.getField(labelColIdx), value.getField(vectorColIdx), startIndex));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>StreamOperator<?> outputStreamOp = StreamOperator.fromTable(DataStreamConversionUtil.toTable(getMLEnvironmentId(), outputRows, new String[] { "f" }, new TypeInformation[] { Types.STRING })).setMLEnvironmentId(getMLEnvironmentId());<NEW_LINE>CsvSinkStreamOp sink = new CsvSinkStreamOp().setMLEnvironmentId(getMLEnvironmentId()).setFilePath(getFilePath()).setQuoteChar(null).setOverwriteSink(getOverwriteSink()).setFieldDelimiter(" ");<NEW_LINE>outputStreamOp.link(sink);<NEW_LINE>return this;<NEW_LINE>}
).get(LibSvmSinkParams.START_INDEX);
1,538,879
public QopConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>QopConfiguration qopConfiguration = new QopConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("RpcProtection", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>qopConfiguration.setRpcProtection(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DataTransferProtection", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>qopConfiguration.setDataTransferProtection(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 qopConfiguration;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
185,358
public ModifyVpcPeeringConnectionOptionsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ModifyVpcPeeringConnectionOptionsResult modifyVpcPeeringConnectionOptionsResult = new ModifyVpcPeeringConnectionOptionsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return modifyVpcPeeringConnectionOptionsResult;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("requesterPeeringConnectionOptions", targetDepth)) {<NEW_LINE>modifyVpcPeeringConnectionOptionsResult.setRequesterPeeringConnectionOptions(PeeringConnectionOptionsStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("accepterPeeringConnectionOptions", targetDepth)) {<NEW_LINE>modifyVpcPeeringConnectionOptionsResult.setAccepterPeeringConnectionOptions(PeeringConnectionOptionsStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return modifyVpcPeeringConnectionOptionsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
381,069
public com.amazonaws.services.cloud9.model.LimitExceededException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.cloud9.model.LimitExceededException limitExceededException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 limitExceededException;<NEW_LINE>}
cloud9.model.LimitExceededException(null);
1,349,355
public ViewLayout build() {<NEW_LINE>final WindowId windowIdEffective = getWindowIdEffective();<NEW_LINE>final ViewProfileId profileIdEffective = !ViewProfileId.isNull(<MASK><NEW_LINE>final ImmutableList<DocumentFilterDescriptor> filtersEffective = ImmutableList.copyOf(filters != null ? filters : from.getFilters());<NEW_LINE>final String allowNewCaptionEffective = allowNewCaption != null ? allowNewCaption : from.allowNewCaption;<NEW_LINE>final boolean hasTreeSupportEffective = hasTreeSupport != null ? hasTreeSupport : from.hasTreeSupport;<NEW_LINE>final boolean treeCollapsibleEffective = treeCollapsible != null ? treeCollapsible : from.treeCollapsible;<NEW_LINE>final int treeExpandedDepthEffective = treeExpandedDepth != null ? treeExpandedDepth : from.treeExpandedDepth;<NEW_LINE>final boolean geoLocationSupportEffective = geoLocationSupport != null ? geoLocationSupport : from.geoLocationSupport;<NEW_LINE>final ImmutableList<DocumentLayoutElementDescriptor> elementsEffective = elements != null ? ImmutableList.copyOf(elements) : from.elements;<NEW_LINE>final DocumentQueryOrderByList defaultOrderBysEffective = DocumentQueryOrderByList.ofList(defaultOrderBys);<NEW_LINE>// If there will be no change then return this<NEW_LINE>if (Objects.equals(from.windowId, windowIdEffective) && Objects.equals(from.profileId, profileIdEffective) && Objects.equals(from.filters, filtersEffective) && Objects.equals(from.allowNewCaption, allowNewCaptionEffective) && from.hasTreeSupport == hasTreeSupportEffective && from.treeCollapsible == treeCollapsibleEffective && from.treeExpandedDepth == treeExpandedDepthEffective && Objects.equals(from.elements, elementsEffective) && DocumentQueryOrderByList.equals(from.defaultOrderBys, defaultOrderBysEffective) && Objects.equals(from.geoLocationSupport, geoLocationSupportEffective)) {<NEW_LINE>return from;<NEW_LINE>}<NEW_LINE>return new ViewLayout(from, windowIdEffective, profileIdEffective, filtersEffective, defaultOrderBysEffective, allowNewCaptionEffective, hasTreeSupportEffective, treeCollapsibleEffective, treeExpandedDepthEffective, geoLocationSupportEffective, elementsEffective);<NEW_LINE>}
profileId) ? profileId : from.profileId;
587,100
private synchronized void doParse(Element element, ParserContext parserContext) {<NEW_LINE>String[] basePackages = StringUtils.tokenizeToStringArray(element.getAttribute("base-package"), ",; \t\n");<NEW_LINE>AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(parserContext, element);<NEW_LINE>if (!parserContext.getRegistry().containsBeanDefinition(CacheAdvisor.CACHE_ADVISOR_BEAN_NAME)) {<NEW_LINE>Object eleSource = parserContext.extractSource(element);<NEW_LINE>RootBeanDefinition configMapDef = new RootBeanDefinition(ConfigMap.class);<NEW_LINE>configMapDef.setSource(eleSource);<NEW_LINE>configMapDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);<NEW_LINE>String configMapName = parserContext.getReaderContext().registerWithGeneratedName(configMapDef);<NEW_LINE>RootBeanDefinition interceptorDef = new RootBeanDefinition(JetCacheInterceptor.class);<NEW_LINE>interceptorDef.setSource(eleSource);<NEW_LINE>interceptorDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);<NEW_LINE>interceptorDef.getPropertyValues().addPropertyValue(new PropertyValue("cacheConfigMap", new RuntimeBeanReference(configMapName)));<NEW_LINE>String interceptorName = parserContext.<MASK><NEW_LINE>RootBeanDefinition advisorDef = new RootBeanDefinition(CacheAdvisor.class);<NEW_LINE>advisorDef.setSource(eleSource);<NEW_LINE>advisorDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);<NEW_LINE>advisorDef.getPropertyValues().addPropertyValue(new PropertyValue("adviceBeanName", interceptorName));<NEW_LINE>advisorDef.getPropertyValues().addPropertyValue(new PropertyValue("cacheConfigMap", new RuntimeBeanReference(configMapName)));<NEW_LINE>advisorDef.getPropertyValues().addPropertyValue(new PropertyValue("basePackages", basePackages));<NEW_LINE>parserContext.getRegistry().registerBeanDefinition(CacheAdvisor.CACHE_ADVISOR_BEAN_NAME, advisorDef);<NEW_LINE>CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(), eleSource);<NEW_LINE>compositeDef.addNestedComponent(new BeanComponentDefinition(configMapDef, configMapName));<NEW_LINE>compositeDef.addNestedComponent(new BeanComponentDefinition(interceptorDef, interceptorName));<NEW_LINE>compositeDef.addNestedComponent(new BeanComponentDefinition(advisorDef, CacheAdvisor.CACHE_ADVISOR_BEAN_NAME));<NEW_LINE>parserContext.registerComponent(compositeDef);<NEW_LINE>}<NEW_LINE>}
getReaderContext().registerWithGeneratedName(interceptorDef);
768,748
private void validate(APIAttachSecurityGroupToL3NetworkMsg msg) {<NEW_LINE>SimpleQuery<SecurityGroupL3NetworkRefVO> q = dbf.createQuery(SecurityGroupL3NetworkRefVO.class);<NEW_LINE>q.add(SecurityGroupL3NetworkRefVO_.l3NetworkUuid, Op.EQ, msg.getL3NetworkUuid());<NEW_LINE>q.add(SecurityGroupL3NetworkRefVO_.securityGroupUuid, Op.EQ, msg.getSecurityGroupUuid());<NEW_LINE>if (q.isExists()) {<NEW_LINE>throw new ApiMessageInterceptionException(operr("security group[uuid:%s] has attached to l3Network[uuid:%s], can't attach again", msg.getSecurityGroupUuid()<MASK><NEW_LINE>}<NEW_LINE>SimpleQuery<NetworkServiceL3NetworkRefVO> nq = dbf.createQuery(NetworkServiceL3NetworkRefVO.class);<NEW_LINE>nq.add(NetworkServiceL3NetworkRefVO_.l3NetworkUuid, Op.EQ, msg.getL3NetworkUuid());<NEW_LINE>nq.add(NetworkServiceL3NetworkRefVO_.networkServiceType, Op.EQ, SecurityGroupConstant.SECURITY_GROUP_NETWORK_SERVICE_TYPE);<NEW_LINE>if (!nq.isExists()) {<NEW_LINE>throw new ApiMessageInterceptionException(argerr("the L3 network[uuid:%s] doesn't have the network service type[%s] enabled", msg.getL3NetworkUuid(), SecurityGroupConstant.SECURITY_GROUP_NETWORK_SERVICE_TYPE));<NEW_LINE>}<NEW_LINE>}
, msg.getL3NetworkUuid()));
415,531
public void fill() throws JRException {<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>File sourceFile = new File("build/reports/AlterDesignReport.jasper");<NEW_LINE>System.err.println(" : " + sourceFile.getAbsolutePath());<NEW_LINE>JasperReport jasperReport = (JasperReport) JRLoader.loadObject(sourceFile);<NEW_LINE>JRRectangle rectangle = (JRRectangle) jasperReport.getTitle().getElementByKey("first.rectangle");<NEW_LINE>rectangle.setForecolor(new Color((int) (16000000 * Math.random())));<NEW_LINE>rectangle.setBackcolor(new Color((int) (16000000 * Math.random())));<NEW_LINE>rectangle = (JRRectangle) jasperReport.getTitle().getElementByKey("second.rectangle");<NEW_LINE>rectangle.setForecolor(new Color((int) (16000000 * Math.random())));<NEW_LINE>rectangle.setBackcolor(new Color((int) (16000000 * <MASK><NEW_LINE>rectangle = (JRRectangle) jasperReport.getTitle().getElementByKey("third.rectangle");<NEW_LINE>rectangle.setForecolor(new Color((int) (16000000 * Math.random())));<NEW_LINE>rectangle.setBackcolor(new Color((int) (16000000 * Math.random())));<NEW_LINE>JRStyle style = jasperReport.getStyles()[0];<NEW_LINE>style.setFontSize(16f);<NEW_LINE>style.setItalic(Boolean.TRUE);<NEW_LINE>JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null, (JRDataSource) null);<NEW_LINE>File destFile = new File(sourceFile.getParent(), jasperReport.getName() + ".jrprint");<NEW_LINE>JRSaver.saveObject(jasperPrint, destFile);<NEW_LINE>System.err.println("Filling time : " + (System.currentTimeMillis() - start));<NEW_LINE>}
Math.random())));
852,088
//<NEW_LINE>public void testJMSProviderMBean(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();<NEW_LINE>String queryText = "WebSphere:j2eeType=JMSResource," + "name=JMS-2.0Provider," + "J2EEServer=JMSMBeanServer";<NEW_LINE>ObjectName queryObject = new ObjectName(queryText);<NEW_LINE>System.out.println("Query [ " + queryObject + " ]");<NEW_LINE>Set<ObjectName> objectNames = mbeanServer.queryNames(queryObject, null);<NEW_LINE><MASK><NEW_LINE>if (objectNames.isEmpty()) {<NEW_LINE>System.out.println(" ** NONE **");<NEW_LINE>} else {<NEW_LINE>for (ObjectName objectName : objectNames) {<NEW_LINE>System.out.println(" [ " + objectName + " ]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!objectNames.contains(queryObject)) {<NEW_LINE>throw new Exception("Failed to retrieve JMSProvider MBean [ " + queryText + " ]");<NEW_LINE>}<NEW_LINE>}
System.out.println("Results:");
1,791,917
private void showChart() {<NEW_LINE>List<XYChart> charts = new ArrayList<>();<NEW_LINE>CategoryChart chart = new CategoryChartBuilder().width(800).height(600).title("Consistency of hashing algorithm").xAxisTitle("Distribution of requests on test ring").yAxisTitle("Number of requests").build();<NEW_LINE>chart.getStyler().setPlotGridVerticalLinesVisible(false);<NEW_LINE>chart.getStyler().setStacked(true);<NEW_LINE>for (String server : _servers) {<NEW_LINE>List<Integer> yData = new ArrayList<>();<NEW_LINE>_servers.forEach(orig -> yData.add(_consistencyTracker.getOrDefault(orig, new HashMap<>()).getOrDefault(server, new AtomicInteger(0<MASK><NEW_LINE>chart.addSeries(server, _servers, yData);<NEW_LINE>}<NEW_LINE>charts.add(getCIRChart(_testRingCIRTracker, "CIR changes over time on test ring"));<NEW_LINE>charts.add(getCIRChart(_consistentRingCIRTracker, "CIR changes over time on consistent hash ring"));<NEW_LINE>new SwingWrapper<>(chart).displayChart();<NEW_LINE>new SwingWrapper<>(charts).displayChartMatrix();<NEW_LINE>}
)).get()));
1,632,066
final ListIdentityPoolsResult executeListIdentityPools(ListIdentityPoolsRequest listIdentityPoolsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listIdentityPoolsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListIdentityPoolsRequest> request = null;<NEW_LINE>Response<ListIdentityPoolsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListIdentityPoolsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listIdentityPoolsRequest));<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, "Cognito Identity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListIdentityPools");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListIdentityPoolsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListIdentityPoolsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
162,425
protected void encodeStepStatus(FacesContext context, Wizard wizard) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String currentStep = wizard.getStep();<NEW_LINE>boolean currentFound = false;<NEW_LINE>writer.startElement("ul", null);<NEW_LINE>writer.writeAttribute("class", Wizard.STEP_STATUS_CLASS, null);<NEW_LINE>for (UIComponent child : wizard.getChildren()) {<NEW_LINE>if (child instanceof Tab && child.isRendered()) {<NEW_LINE>Tab tab = (Tab) child;<NEW_LINE>String title = tab.getTitle();<NEW_LINE>UIComponent titleFacet = tab.getFacet("title");<NEW_LINE>boolean active = (!currentFound) && (currentStep == null || tab.getId().equals(currentStep));<NEW_LINE>String titleStyleClass = active ? Wizard.ACTIVE_STEP_CLASS : Wizard.STEP_CLASS;<NEW_LINE>if (tab.getTitleStyleClass() != null) {<NEW_LINE>titleStyleClass = titleStyleClass + " " + tab.getTitleStyleClass();<NEW_LINE>}<NEW_LINE>if (active) {<NEW_LINE>currentFound = true;<NEW_LINE>}<NEW_LINE>writer.startElement("li", null);<NEW_LINE>writer.writeAttribute("class", titleStyleClass, null);<NEW_LINE>if (tab.getTitleStyle() != null) {<NEW_LINE>writer.writeAttribute("style", tab.getTitleStyle(), null);<NEW_LINE>}<NEW_LINE>if (tab.getTitletip() != null) {<NEW_LINE>writer.writeAttribute("title", tab.getTitletip(), null);<NEW_LINE>}<NEW_LINE>if (ComponentUtils.shouldRenderFacet(titleFacet)) {<NEW_LINE>titleFacet.encodeAll(context);<NEW_LINE>} else if (title != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>writer.endElement("li");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.endElement("ul");<NEW_LINE>}
writer.writeText(title, null);
248,625
final ListBillingGroupCostReportsResult executeListBillingGroupCostReports(ListBillingGroupCostReportsRequest listBillingGroupCostReportsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listBillingGroupCostReportsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListBillingGroupCostReportsRequest> request = null;<NEW_LINE>Response<ListBillingGroupCostReportsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListBillingGroupCostReportsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listBillingGroupCostReportsRequest));<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, "billingconductor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListBillingGroupCostReports");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListBillingGroupCostReportsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListBillingGroupCostReportsResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,030,050
private static void tryAssertion56(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[] { "sum(price)" };<NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsRem(1200, 0, new Object[][] { { 25d }, { 34d } }, new Object[][] { { null }, { 25d } });<NEW_LINE>expected.addResultInsRem(2200, 0, new Object[][] { { 58d }, { 59d }, { 85d } }, new Object[][] { { 34d }, { 58d }, { 59d } });<NEW_LINE>expected.addResultInsRem(3200, 0, new Object[][] { { 85d } }, new Object[]<MASK><NEW_LINE>expected.addResultInsRem(4200, 0, new Object[][] { { 87d } }, new Object[][] { { 85d } });<NEW_LINE>expected.addResultInsRem(5200, 0, new Object[][] { { 109d }, { 112d } }, new Object[][] { { 87d }, { 109d } });<NEW_LINE>expected.addResultInsRem(6200, 0, new Object[][] { { 87d }, { 88d } }, new Object[][] { { 112d }, { 87d } });<NEW_LINE>expected.addResultInsRem(7200, 0, new Object[][] { { 79d }, { 54d } }, new Object[][] { { 88d }, { 79d } });<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>}
[] { { 85d } });
1,409,161
private boolean isClass(String result) {<NEW_LINE>if (result == null || result.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// if it's the class we're compiling, then of course it's a class<NEW_LINE>if (result.equals(targetName)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>InputStream is = null;<NEW_LINE>try {<NEW_LINE>// if this is a class we've already compiled, it's a class<NEW_LINE><MASK><NEW_LINE>if (is == null) {<NEW_LINE>// use our normal class loader now...<NEW_LINE>String resourceName = result.replace('.', '/') + ".class";<NEW_LINE>is = parentClassLoader.getResourceAsStream(resourceName);<NEW_LINE>if (is == null && !result.contains(".")) {<NEW_LINE>// we couldn't find the class, and it has no package; is it a core class?<NEW_LINE>is = parentClassLoader.getResourceAsStream("java/lang/" + resourceName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return is != null;<NEW_LINE>} finally {<NEW_LINE>if (is != null) {<NEW_LINE>try {<NEW_LINE>is.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
is = loader.getResourceAsStream(result);
1,733,698
public static void refreshReferTables(Item f) {<NEW_LINE>if (!(f instanceof ItemFunc || f instanceof ItemSum))<NEW_LINE>return;<NEW_LINE>HashSet<PlanNode> rtables = f.getReferTables();<NEW_LINE>rtables.clear();<NEW_LINE>for (int index = 0; index < f.getArgCount(); index++) {<NEW_LINE>Item arg = f.arguments().get(index);<NEW_LINE>rtables.addAll(arg.getReferTables());<NEW_LINE>// refresh exist sel is null<NEW_LINE>f.setWithIsNull(f.isWithIsNull() || arg.isWithIsNull());<NEW_LINE>// refresh exist agg<NEW_LINE>f.setWithSumFunc(f.isWithSumFunc() || arg.isWithSumFunc());<NEW_LINE>f.setWithSubQuery(f.isWithSubQuery() || arg.isWithSubQuery());<NEW_LINE>f.setWithUnValAble(f.isWithUnValAble(<MASK><NEW_LINE>}<NEW_LINE>}
) || arg.isWithUnValAble());
1,441,642
private boolean reconnect() {<NEW_LINE>boolean connectedSuccess = false;<NEW_LINE>Random random = new Random();<NEW_LINE>for (int i = 1; i <= Config.RETRY_NUM; i++) {<NEW_LINE>if (transport != null) {<NEW_LINE>transport.close();<NEW_LINE>int currHostIndex = random.nextInt(endPointList.size());<NEW_LINE>int tryHostNum = 0;<NEW_LINE>for (int j = currHostIndex; j < endPointList.size(); j++) {<NEW_LINE>if (tryHostNum == endPointList.size()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>session.defaultEndPoint = endPointList.get(j);<NEW_LINE>this.<MASK><NEW_LINE>if (j == endPointList.size() - 1) {<NEW_LINE>j = -1;<NEW_LINE>}<NEW_LINE>tryHostNum++;<NEW_LINE>try {<NEW_LINE>init(endPoint);<NEW_LINE>connectedSuccess = true;<NEW_LINE>} catch (IoTDBConnectionException e) {<NEW_LINE>logger.error("The current node may have been down {},try next node", endPoint);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (connectedSuccess) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return connectedSuccess;<NEW_LINE>}
endPoint = endPointList.get(j);
1,700,952
private void registerAggregation(AggregationSpec spec, ValuesSourceRegistry.Builder builder) {<NEW_LINE>namedXContents.add(new NamedXContentRegistry.Entry(BaseAggregationBuilder.class, spec.getName(), (p, c) -> {<NEW_LINE>String name = (String) c;<NEW_LINE>return spec.getParser(<MASK><NEW_LINE>}));<NEW_LINE>namedWriteables.add(new NamedWriteableRegistry.Entry(AggregationBuilder.class, spec.getName().getPreferredName(), spec.getReader()));<NEW_LINE>for (Map.Entry<String, Writeable.Reader<? extends InternalAggregation>> t : spec.getResultReaders().entrySet()) {<NEW_LINE>String writeableName = t.getKey();<NEW_LINE>Writeable.Reader<? extends InternalAggregation> internalReader = t.getValue();<NEW_LINE>namedWriteables.add(new NamedWriteableRegistry.Entry(InternalAggregation.class, writeableName, internalReader));<NEW_LINE>}<NEW_LINE>Consumer<ValuesSourceRegistry.Builder> register = spec.getAggregatorRegistrar();<NEW_LINE>if (register != null) {<NEW_LINE>register.accept(builder);<NEW_LINE>} else {<NEW_LINE>// Register is typically handling usage registration, but for the older aggregations that don't use register, we<NEW_LINE>// have to register usage explicitly here.<NEW_LINE>builder.registerUsage(spec.getName().getPreferredName());<NEW_LINE>}<NEW_LINE>}
).parse(p, name);
1,052,527
public static int findLongestSubstring(String str) {<NEW_LINE>// Maintains count of each alphabet<NEW_LINE>int[] charCount = new int[52];<NEW_LINE>// Variable len stores length of longest valid substring, while start and end<NEW_LINE>// are limits of the current window (substring) being considered<NEW_LINE>int len = 0, start = 0;<NEW_LINE>for (int end = 0; end < str.length(); ) {<NEW_LINE>char ch = str.charAt(end);<NEW_LINE>if (// Lower-case letter<NEW_LINE>ch >= 'a' && ch <= 'z')<NEW_LINE>charCount[ch - 'a']++;<NEW_LINE>else<NEW_LINE>// Upper-case letter<NEW_LINE>charCount[ch - 'A' + 26]++;<NEW_LINE>end++;<NEW_LINE>if (isDistinct(charCount)) {<NEW_LINE>len = Math.max(len, end - start);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// If there are repeating characters, we shorten substring by removing<NEW_LINE>// characters from start, till we get a distinct substring.<NEW_LINE>while (!isDistinct(charCount)) {<NEW_LINE>ch = str.charAt(start);<NEW_LINE>if (ch >= 'a' && ch <= 'z')<NEW_LINE>charCount[ch - 'a']--;<NEW_LINE>else<NEW_LINE>charCount<MASK><NEW_LINE>start++;<NEW_LINE>}<NEW_LINE>len = Math.max(len, end - start);<NEW_LINE>}<NEW_LINE>return len;<NEW_LINE>}
[ch - 'A' + 26]--;
33,651
public void visit(BLangTernaryExpr ternaryExpr) {<NEW_LINE>BLangSimpleVariableDef resultVarDef = createVarDef("$ternary_result$", ternaryExpr.getBType(), null, ternaryExpr.pos);<NEW_LINE>BLangBlockStmt thenBody = ASTBuilderUtil.createBlockStmt(ternaryExpr.pos);<NEW_LINE>BLangBlockStmt elseBody = ASTBuilderUtil.createBlockStmt(ternaryExpr.pos);<NEW_LINE>// Create then assignment<NEW_LINE>BLangSimpleVarRef thenResultVarRef = ASTBuilderUtil.createVariableRef(ternaryExpr.pos, resultVarDef.var.symbol);<NEW_LINE>BLangAssignment thenAssignment = ASTBuilderUtil.createAssignmentStmt(ternaryExpr.pos, thenResultVarRef, ternaryExpr.thenExpr);<NEW_LINE>thenBody.addStatement(thenAssignment);<NEW_LINE>// Create else assignment<NEW_LINE>BLangSimpleVarRef elseResultVarRef = ASTBuilderUtil.createVariableRef(ternaryExpr.<MASK><NEW_LINE>BLangAssignment elseAssignment = ASTBuilderUtil.createAssignmentStmt(ternaryExpr.pos, elseResultVarRef, ternaryExpr.elseExpr);<NEW_LINE>elseBody.addStatement(elseAssignment);<NEW_LINE>// Then make it a expression-statement, with expression being the $result$<NEW_LINE>BLangSimpleVarRef resultVarRef = ASTBuilderUtil.createVariableRef(ternaryExpr.pos, resultVarDef.var.symbol);<NEW_LINE>BLangIf ifElse = ASTBuilderUtil.createIfElseStmt(ternaryExpr.pos, ternaryExpr.expr, thenBody, elseBody);<NEW_LINE>BLangBlockStmt blockStmt = ASTBuilderUtil.createBlockStmt(ternaryExpr.pos, Lists.of(resultVarDef, ifElse));<NEW_LINE>BLangStatementExpression stmtExpr = createStatementExpression(blockStmt, resultVarRef);<NEW_LINE>stmtExpr.setBType(ternaryExpr.getBType());<NEW_LINE>result = rewriteExpr(stmtExpr);<NEW_LINE>}
pos, resultVarDef.var.symbol);
444,361
public E relaxedPoll() {<NEW_LINE>final long[] sBuffer = sequenceBuffer;<NEW_LINE>final long mask = this.mask;<NEW_LINE>long cIndex;<NEW_LINE>long seqOffset;<NEW_LINE>long seq;<NEW_LINE>long expectedSeq;<NEW_LINE>do {<NEW_LINE>cIndex = lvConsumerIndex();<NEW_LINE>seqOffset = calcCircularLongElementOffset(cIndex, mask);<NEW_LINE>seq = lvLongElement(sBuffer, seqOffset);<NEW_LINE>expectedSeq = cIndex + 1;<NEW_LINE>if (seq < expectedSeq) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} while (// another consumer beat us to it<NEW_LINE>// failed the CAS<NEW_LINE>seq > expectedSeq || !casConsumerIndex(cIndex, cIndex + 1));<NEW_LINE>final long offset = calcCircularRefElementOffset(cIndex, mask);<NEW_LINE>final E <MASK><NEW_LINE>spRefElement(buffer, offset, null);<NEW_LINE>soLongElement(sBuffer, seqOffset, cIndex + mask + 1);<NEW_LINE>return e;<NEW_LINE>}
e = lpRefElement(buffer, offset);
758,431
public Object decodeFrame(ByteBuf frame) {<NEW_LINE>byte b0 = frame.readByte();<NEW_LINE><MASK><NEW_LINE>if (ProtocolConstants.MAGIC_CODE_BYTES[0] != b0 || ProtocolConstants.MAGIC_CODE_BYTES[1] != b1) {<NEW_LINE>throw new IllegalArgumentException("Unknown magic code: " + b0 + ", " + b1);<NEW_LINE>}<NEW_LINE>byte version = frame.readByte();<NEW_LINE>// TODO check version compatible here<NEW_LINE>int fullLength = frame.readInt();<NEW_LINE>short headLength = frame.readShort();<NEW_LINE>byte messageType = frame.readByte();<NEW_LINE>byte codecType = frame.readByte();<NEW_LINE>byte compressorType = frame.readByte();<NEW_LINE>int requestId = frame.readInt();<NEW_LINE>RpcMessage rpcMessage = new RpcMessage();<NEW_LINE>rpcMessage.setCodec(codecType);<NEW_LINE>rpcMessage.setId(requestId);<NEW_LINE>rpcMessage.setCompressor(compressorType);<NEW_LINE>rpcMessage.setMessageType(messageType);<NEW_LINE>// direct read head with zero-copy<NEW_LINE>int headMapLength = headLength - ProtocolConstants.V1_HEAD_LENGTH;<NEW_LINE>if (headMapLength > 0) {<NEW_LINE>Map<String, String> map = HeadMapSerializer.getInstance().decode(frame, headMapLength);<NEW_LINE>rpcMessage.getHeadMap().putAll(map);<NEW_LINE>}<NEW_LINE>// read body<NEW_LINE>if (messageType == ProtocolConstants.MSGTYPE_HEARTBEAT_REQUEST) {<NEW_LINE>rpcMessage.setBody(HeartbeatMessage.PING);<NEW_LINE>} else if (messageType == ProtocolConstants.MSGTYPE_HEARTBEAT_RESPONSE) {<NEW_LINE>rpcMessage.setBody(HeartbeatMessage.PONG);<NEW_LINE>} else {<NEW_LINE>int bodyLength = fullLength - headLength;<NEW_LINE>if (bodyLength > 0) {<NEW_LINE>byte[] bs = new byte[bodyLength];<NEW_LINE>frame.readBytes(bs);<NEW_LINE>Compressor compressor = CompressorFactory.getCompressor(compressorType);<NEW_LINE>bs = compressor.decompress(bs);<NEW_LINE>Serializer serializer = SerializerServiceLoader.load(SerializerType.getByCode(rpcMessage.getCodec()));<NEW_LINE>rpcMessage.setBody(serializer.deserialize(bs));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rpcMessage;<NEW_LINE>}
byte b1 = frame.readByte();
1,153,744
final UpdateChannelResult executeUpdateChannel(UpdateChannelRequest updateChannelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateChannelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateChannelRequest> request = null;<NEW_LINE>Response<UpdateChannelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateChannelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateChannelRequest));<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, "MediaTailor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateChannel");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateChannelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateChannelResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
326,233
public String update(Request request, Response response) {<NEW_LINE>final String <MASK><NEW_LINE>final SecurityAuthConfig existingAuthConfig = fetchEntityFromConfig(securityAuthConfigId);<NEW_LINE>final SecurityAuthConfig newAuthConfig = buildEntityFromRequestBody(request);<NEW_LINE>HttpLocalizedOperationResult result = new HttpLocalizedOperationResult();<NEW_LINE>if (isRenameAttempt(securityAuthConfigId, newAuthConfig.getId())) {<NEW_LINE>throw haltBecauseRenameOfEntityIsNotSupported(getEntityType().getEntityNameLowerCase());<NEW_LINE>}<NEW_LINE>if (isPutRequestStale(request, existingAuthConfig)) {<NEW_LINE>throw haltBecauseEtagDoesNotMatch(getEntityType().getEntityNameLowerCase(), existingAuthConfig.getId());<NEW_LINE>}<NEW_LINE>newAuthConfig.setId(securityAuthConfigId);<NEW_LINE>securityAuthConfigService.update(currentUsername(), etagFor(existingAuthConfig), newAuthConfig, result);<NEW_LINE>return handleCreateOrUpdateResponse(request, response, newAuthConfig, result);<NEW_LINE>}
securityAuthConfigId = request.params("id");
1,024,230
private static void save(String table, Person person, SQLiteDatabase database) {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>values.put(<MASK><NEW_LINE>values.put("local_blog_id", person.getLocalTableBlogId());<NEW_LINE>values.put("display_name", person.getDisplayName());<NEW_LINE>values.put("avatar_url", person.getAvatarUrl());<NEW_LINE>switch(table) {<NEW_LINE>case TEAM_TABLE:<NEW_LINE>values.put("user_name", person.getUsername());<NEW_LINE>if (person.getRole() != null) {<NEW_LINE>values.put("role", person.getRole());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FOLLOWERS_TABLE:<NEW_LINE>values.put("user_name", person.getUsername());<NEW_LINE>values.put("subscribed", person.getSubscribed());<NEW_LINE>break;<NEW_LINE>case EMAIL_FOLLOWERS_TABLE:<NEW_LINE>values.put("subscribed", person.getSubscribed());<NEW_LINE>break;<NEW_LINE>case VIEWERS_TABLE:<NEW_LINE>values.put("user_name", person.getUsername());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>database.insertWithOnConflict(table, null, values, SQLiteDatabase.CONFLICT_REPLACE);<NEW_LINE>}
"person_id", person.getPersonID());
1,794,099
private static String parseSoapMethodName(InputStream stream, String charEncoding) {<NEW_LINE>try {<NEW_LINE>// newInstance() et pas newFactory() pour java 1.5 (issue 367)<NEW_LINE>final XMLInputFactory factory = XMLInputFactory.newInstance();<NEW_LINE>// disable DTDs entirely for that factory<NEW_LINE>factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);<NEW_LINE>// disable external entities<NEW_LINE>factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);<NEW_LINE>final XMLStreamReader xmlReader;<NEW_LINE>if (charEncoding != null) {<NEW_LINE>xmlReader = factory.createXMLStreamReader(stream, charEncoding);<NEW_LINE>} else {<NEW_LINE>xmlReader = factory.createXMLStreamReader(stream);<NEW_LINE>}<NEW_LINE>// best-effort parsing<NEW_LINE>// start document, go to first tag<NEW_LINE>xmlReader.nextTag();<NEW_LINE>// expect first tag to be "Envelope"<NEW_LINE>if (!"Envelope".equals(xmlReader.getLocalName())) {<NEW_LINE>LOG.debug("Unexpected first tag of SOAP request: '" + xmlReader.getLocalName() + "' (expected 'Envelope')");<NEW_LINE>// failed<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// scan for body tag<NEW_LINE>if (!scanForChildTag(xmlReader, "Body")) {<NEW_LINE>LOG.debug("Unable to find SOAP 'Body' tag");<NEW_LINE>// failed<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>xmlReader.nextTag();<NEW_LINE>// tag is method name<NEW_LINE>return "." + xmlReader.getLocalName();<NEW_LINE>} catch (final XMLStreamException e) {<NEW_LINE><MASK><NEW_LINE>// failed<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
LOG.debug("Unable to parse SOAP request", e);
72,580
public boolean onSingleTap(PointF point, RotatedTileBox tileBox) {<NEW_LINE>MapActivity mapActivity = getMapActivity();<NEW_LINE>if (mapActivity == null || menu == null || mInChangeMarkerPositionMode || mInGpxDetailsMode || mapActivity.getGpsFilterFragment() != null || mapActivity.getDownloadTilesFragment() != null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (pressedContextMarker(tileBox, point.x, point.y)) {<NEW_LINE>hideVisibleMenues();<NEW_LINE>menu.show();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (selectOnMap != null) {<NEW_LINE>LatLon latlon = tileBox.getLatLonFromPixel(point.x, point.y);<NEW_LINE>menu.init(latlon, null, null);<NEW_LINE>CallbackWithObject<LatLon> cb = selectOnMap;<NEW_LINE>cb.processResult(latlon);<NEW_LINE>selectOnMap = null;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!disableSingleTap()) {<NEW_LINE>boolean res = showContextMenu(point, tileBox, false);<NEW_LINE>if (res) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean processed = hideVisibleMenues();<NEW_LINE>processed |= menu.onSingleTapOnMap();<NEW_LINE>if (!processed && MapRouteInfoMenu.chooseRoutesVisible) {<NEW_LINE>WeakReference<ChooseRouteFragment> chooseRouteFragmentRef = mapActivity.getMapRouteInfoMenu().findChooseRouteFragment();<NEW_LINE>if (chooseRouteFragmentRef != null) {<NEW_LINE>ChooseRouteFragment chooseRouteFragment = chooseRouteFragmentRef.get();<NEW_LINE>if (chooseRouteFragment != null) {<NEW_LINE>chooseRouteFragment.dismiss();<NEW_LINE>processed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!processed) {<NEW_LINE>MapControlsLayer mapControlsLayer = getApplication().getOsmandMap()<MASK><NEW_LINE>if (mapControlsLayer != null && (!mapControlsLayer.isMapControlsVisible() || getApplication().getSettings().MAP_EMPTY_STATE_ALLOWED.get())) {<NEW_LINE>mapControlsLayer.switchMapControlsVisibility(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.getMapLayers().getMapControlsLayer();
459,783
public void handle(String stmt, ManagerService service) {<NEW_LINE>MySqlUpdateStatement update;<NEW_LINE>try {<NEW_LINE>update = (MySqlUpdateStatement) DruidUtil.parseMultiSQL(stmt);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("manager parser insert failed", e);<NEW_LINE>service.writeErrMessage("42000", "You have an error in your SQL syntax", ErrorCode.ER_PARSE_ERROR);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ManagerWritableTable <MASK><NEW_LINE>if (null == managerTable) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LinkedHashMap<String, String> values;<NEW_LINE>try {<NEW_LINE>values = getUpdateValues(managerTable, update.getItems());<NEW_LINE>} catch (SQLException e) {<NEW_LINE>service.writeErrMessage(StringUtil.isEmpty(e.getSQLState()) ? "HY000" : e.getSQLState(), e.getMessage(), e.getErrorCode());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PacketResult packetResult = new PacketResult();<NEW_LINE>if (ClusterConfig.getInstance().isClusterEnable()) {<NEW_LINE>updateWithCluster(service, update, managerTable, values, packetResult);<NEW_LINE>} else {<NEW_LINE>generalUpdate(service, update, managerTable, values, packetResult);<NEW_LINE>}<NEW_LINE>writePacket(packetResult.isSuccess(), packetResult.getRowSize(), service, packetResult.getErrorMsg());<NEW_LINE>}
managerTable = getWritableTable(update, service);
178,033
private <T extends Trait> void addOperationSecurity(Context<T> context, OperationObject.Builder builder, OperationShape shape, OpenApiMapper plugin) {<NEW_LINE>ServiceShape service = context.getService();<NEW_LINE>ServiceIndex serviceIndex = ServiceIndex.of(context.getModel());<NEW_LINE>Map<ShapeId, Trait> serviceSchemes = serviceIndex.getEffectiveAuthSchemes(service);<NEW_LINE>Map<ShapeId, Trait> operationSchemes = serviceIndex.getEffectiveAuthSchemes(service, shape);<NEW_LINE>// If the operation explicitly removes authentication, ensure that "security" is set to an empty<NEW_LINE>// list as opposed to simply being unset as unset will result in the operation inheriting global<NEW_LINE>// configuration.<NEW_LINE>if (shape.getTrait(AuthTrait.class).map(trait -> trait.getValueSet().isEmpty()).orElse(false)) {<NEW_LINE>builder.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Add a security requirement for the operation if it differs from the service.<NEW_LINE>if (!operationSchemes.equals(serviceSchemes)) {<NEW_LINE>Collection<Class<? extends Trait>> authSchemeClasses = getTraitMapTypes(operationSchemes);<NEW_LINE>// Find all the converters with matching types of auth traits on the service.<NEW_LINE>Collection<SecuritySchemeConverter<? extends Trait>> converters = findMatchingConverters(context, authSchemeClasses);<NEW_LINE>for (SecuritySchemeConverter<? extends Trait> converter : converters) {<NEW_LINE>List<String> result = createSecurityRequirements(context, converter, service);<NEW_LINE>String openApiAuthName = converter.getOpenApiAuthSchemeName();<NEW_LINE>Map<String, List<String>> authMap = MapUtils.of(openApiAuthName, result);<NEW_LINE>Map<String, List<String>> requirement = plugin.updateSecurity(context, shape, converter, authMap);<NEW_LINE>if (requirement != null) {<NEW_LINE>builder.addSecurity(requirement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
security(Collections.emptyList());
105,648
private void mergeProperties(PersistenceUnitInfo puInfo, ApplicationMetadata appMetadata, String persistenceUnit) {<NEW_LINE>PersistenceUnitMetadata metadata = appMetadata.getPersistenceUnitMetadata(persistenceUnit);<NEW_LINE>metadata.<MASK><NEW_LINE>metadata.getClasses().addAll(puInfo.getManagedClassNames());<NEW_LINE>metadata.setExcludeUnlistedClasses(puInfo.excludeUnlistedClasses());<NEW_LINE>metadata.getProperties().putAll(puInfo.getProperties());<NEW_LINE>if (puInfo.getPersistenceProviderClassName() == null || PROVIDER_IMPLEMENTATION_NAME.equalsIgnoreCase(puInfo.getPersistenceProviderClassName())) {<NEW_LINE>metadata.setProvider(puInfo.getPersistenceProviderClassName());<NEW_LINE>} else {<NEW_LINE>throw new PersistenceUnitConfigurationException("Invalid persistence provider : " + puInfo.getPersistenceProviderClassName() + ", persistence provider must be " + PROVIDER_IMPLEMENTATION_NAME + ".");<NEW_LINE>}<NEW_LINE>metadata.getPackages().addAll(puInfo.getMappingFileNames());<NEW_LINE>for (URL url : puInfo.getJarFileUrls()) {<NEW_LINE>metadata.addJarFile(url.getPath());<NEW_LINE>}<NEW_LINE>}
setTransactionType(puInfo.getTransactionType());
51,184
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {<NEW_LINE>// _setupAgentPath = Script.findScript(getPatchPath(),<NEW_LINE>// "setup_agent.sh");<NEW_LINE>_kvmPrivateNic = _configDao.getValue(<MASK><NEW_LINE>if (_kvmPrivateNic == null) {<NEW_LINE>_kvmPrivateNic = "cloudbr0";<NEW_LINE>}<NEW_LINE>_kvmPublicNic = _configDao.getValue(Config.KvmPublicNetwork.key());<NEW_LINE>if (_kvmPublicNic == null) {<NEW_LINE>_kvmPublicNic = _kvmPrivateNic;<NEW_LINE>}<NEW_LINE>_kvmGuestNic = _configDao.getValue(Config.KvmGuestNetwork.key());<NEW_LINE>if (_kvmGuestNic == null) {<NEW_LINE>_kvmGuestNic = _kvmPrivateNic;<NEW_LINE>}<NEW_LINE>agentMgr.registerForHostEvents(this, true, false, false);<NEW_LINE>_resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);<NEW_LINE>return true;<NEW_LINE>}
Config.KvmPrivateNetwork.key());
810,501
public CompletableFuture<Void> iterateAllClients(@NotNull final IterationCallback<SessionInformation> callback, @NotNull final Executor callbackExecutor) {<NEW_LINE>Preconditions.checkNotNull(callback, "Callback cannot be null");<NEW_LINE>Preconditions.checkNotNull(callbackExecutor, "Callback executor cannot be null");<NEW_LINE>if (pluginServiceRateLimitService.rateLimitExceeded()) {<NEW_LINE>return CompletableFuture.failedFuture(PluginServiceRateLimitService.RATE_LIMIT_EXCEEDED_EXCEPTION);<NEW_LINE>}<NEW_LINE>final FetchCallback<SessionInformation> fetchCallback = new AllClientsFetchCallback(clientSessionPersistence);<NEW_LINE>final AsyncIterator<SessionInformation> asyncIterator = asyncIteratorFactory.createIterator(fetchCallback, new AllItemsItemCallback<MASK><NEW_LINE>asyncIterator.fetchAndIterate();<NEW_LINE>final SettableFuture<Void> settableFuture = SettableFuture.create();<NEW_LINE>asyncIterator.getFinishedFuture().whenComplete((aVoid, throwable) -> {<NEW_LINE>if (throwable != null) {<NEW_LINE>settableFuture.setException(throwable);<NEW_LINE>} else {<NEW_LINE>settableFuture.set(null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return ListenableFutureConverter.toCompletable(settableFuture, managedExtensionExecutorService);<NEW_LINE>}
<>(callbackExecutor, callback));
1,791,556
public static void validateColumnLimits(String schemaName, String logicalTableName, SqlAlterTable sqlAlterTable) {<NEW_LINE>final List<SqlAlterSpecification> alterItems = sqlAlterTable.getAlters();<NEW_LINE>final List<String> addedColumns = LogicalAlterTable.getAlteredColumns(sqlAlterTable, SqlAlterTable.ColumnOpt.ADD);<NEW_LINE>// Check column count.<NEW_LINE>if (addedColumns != null && addedColumns.size() > 0) {<NEW_LINE>LimitValidator.validateColumnCount(addedColumns.size(), schemaName, logicalTableName);<NEW_LINE>}<NEW_LINE>if (alterItems != null && alterItems.size() > 0) {<NEW_LINE>for (SqlAlterSpecification alterItem : alterItems) {<NEW_LINE>if (alterItem instanceof SqlModifyColumn) {<NEW_LINE>// Check new column comment only.<NEW_LINE>SqlModifyColumn modifyColumn = (SqlModifyColumn) alterItem;<NEW_LINE>String columnName = modifyColumn.getColName().getLastName();<NEW_LINE>SqlLiteral newColumnComment = modifyColumn.getColDef().getComment();<NEW_LINE>if (newColumnComment != null) {<NEW_LINE>LimitValidator.validateColumnComment(columnName, newColumnComment.toValue());<NEW_LINE>}<NEW_LINE>} else if (alterItem instanceof SqlChangeColumn) {<NEW_LINE>SqlChangeColumn changeColumn = (SqlChangeColumn) alterItem;<NEW_LINE>// Check new column name.<NEW_LINE>String newColumnName = changeColumn.getNewName().getLastName();<NEW_LINE>LimitValidator.validateColumnNameLength(newColumnName);<NEW_LINE>// Check new column comment.<NEW_LINE>SqlLiteral newColumnComment = changeColumn<MASK><NEW_LINE>if (newColumnComment != null) {<NEW_LINE>LimitValidator.validateColumnComment(newColumnName, newColumnComment.toValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getColDef().getComment();
776,390
public static ImprovedOutputStream encoder(OutputStream output, PGPPublicKey encryptionKey, @Nullable OutputStream lengthOutput) {<NEW_LINE>// We use a Closer to handle the stream .close, to make sure it's done correctly.<NEW_LINE>Closer closer = Closer.create();<NEW_LINE>OutputStream encryptionLayer = closer.register(openEncryptor(output, GHOSTRYDE_USE_INTEGRITY_PACKET, ImmutableList.of(encryptionKey)));<NEW_LINE>OutputStream kompressor = closer<MASK><NEW_LINE>OutputStream fileLayer = closer.register(openPgpFileWriter(kompressor, INNER_FILENAME, INNER_MODIFICATION_TIME));<NEW_LINE>return new ImprovedOutputStream("GhostrydeEncoder", fileLayer) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClose() throws IOException {<NEW_LINE>// Close all the streams we opened<NEW_LINE>closer.close();<NEW_LINE>// Optionally also output the size of the encoded data - which is needed for the RyDE<NEW_LINE>// encoding.<NEW_LINE>if (lengthOutput != null) {<NEW_LINE>lengthOutput.write(Long.toString(getBytesWritten()).getBytes(US_ASCII));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
.register(openCompressor(encryptionLayer));
150,677
public void init() throws SQLException {<NEW_LINE>//<NEW_LINE>InformationStorage informationStorage = this.appContext.getInstance(InformationStorage.class);<NEW_LINE>JdbcTemplate jdbcTemplate = null;<NEW_LINE>if (informationStorage != null) {<NEW_LINE>jdbcTemplate = new JdbcTemplate(Objects.requireNonNull(informationStorage.getDataSource(), "informationStorage dataSource is null."));<NEW_LINE>} else {<NEW_LINE>jdbcTemplate = this.appContext.getInstance(JdbcTemplate.class);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (jdbcTemplate == null) {<NEW_LINE>throw new IllegalStateException("jdbcTemplate is not init.");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>Settings settings = this.appContext.getInstance(Settings.class);<NEW_LINE>String dbType = settings.getString("hasor.dataway.settings.dal_db_type");<NEW_LINE>if (StringUtils.isBlank(dbType)) {<NEW_LINE>dbType = jdbcTemplate.execute((ConnectionCallback<String>) con -> {<NEW_LINE>String jdbcUrl = con.getMetaData().getURL();<NEW_LINE>String jdbcDriverName = con.getMetaData().getDriverName();<NEW_LINE>return <MASK><NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (dbType == null) {<NEW_LINE>logger.warn("dataway dbType unknown.");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>String tablePrefix = settings.getString("hasor.dataway.settings.dal_db_table_prefix");<NEW_LINE>tablePrefix = StringUtils.isBlank(tablePrefix) ? "" : tablePrefix;<NEW_LINE>this.infoDal = new InterfaceInfoDal(jdbcTemplate, dbType, tablePrefix + "interface_info");<NEW_LINE>this.releaseDal = new InterfaceReleaseDal(jdbcTemplate, dbType, tablePrefix + "interface_release");<NEW_LINE>//<NEW_LINE>logger.info("dataway dbType is {} ,table names = {}, {}", dbType, this.infoDal.getTableName(), this.releaseDal.getTableName());<NEW_LINE>}
JdbcUtils.getDbType(jdbcUrl, jdbcDriverName);
1,779,861
public static Slime toSlime(List<Notification> notifications) {<NEW_LINE>Slime slime = new Slime();<NEW_LINE>Cursor notificationsArray = slime.<MASK><NEW_LINE>for (Notification notification : notifications) {<NEW_LINE>Cursor notificationObject = notificationsArray.addObject();<NEW_LINE>notificationObject.setLong(atFieldName, notification.at().toEpochMilli());<NEW_LINE>notificationObject.setString(typeField, asString(notification.type()));<NEW_LINE>notificationObject.setString(levelField, asString(notification.level()));<NEW_LINE>Cursor messagesArray = notificationObject.setArray(messagesField);<NEW_LINE>notification.messages().forEach(messagesArray::addString);<NEW_LINE>notification.source().application().ifPresent(application -> notificationObject.setString(applicationField, application.value()));<NEW_LINE>notification.source().instance().ifPresent(instance -> notificationObject.setString(instanceField, instance.value()));<NEW_LINE>notification.source().zoneId().ifPresent(zoneId -> notificationObject.setString(zoneField, zoneId.value()));<NEW_LINE>notification.source().clusterId().ifPresent(clusterId -> notificationObject.setString(clusterIdField, clusterId.value()));<NEW_LINE>notification.source().jobType().ifPresent(jobType -> notificationObject.setString(jobTypeField, jobType.jobName()));<NEW_LINE>notification.source().runNumber().ifPresent(runNumber -> notificationObject.setLong(runNumberField, runNumber));<NEW_LINE>}<NEW_LINE>return slime;<NEW_LINE>}
setObject().setArray(notificationsFieldName);
1,801,809
private static // Make an instance record.<NEW_LINE>PropertyFunctionInstance magicProperty(Context context, Triple pfTriple, BasicPattern triples) {<NEW_LINE>List<Triple> listTriples = new ArrayList<>();<NEW_LINE>GNode sGNode = new GNode(triples, pfTriple.getSubject());<NEW_LINE>GNode oGNode = new GNode(triples, pfTriple.getObject());<NEW_LINE>List<Node> sList = null;<NEW_LINE>List<Node> oList = null;<NEW_LINE>if (GraphList.isListNode(sGNode)) {<NEW_LINE>sList = GraphList.members(sGNode);<NEW_LINE>GraphList.allTriples(sGNode, listTriples);<NEW_LINE>}<NEW_LINE>if (GraphList.isListNode(oGNode)) {<NEW_LINE>oList = GraphList.members(oGNode);<NEW_LINE>GraphList.allTriples(oGNode, listTriples);<NEW_LINE>}<NEW_LINE>PropFuncArg subjArgs = new PropFuncArg(sList, pfTriple.getSubject());<NEW_LINE>PropFuncArg objArgs = new PropFuncArg(oList, pfTriple.getObject());<NEW_LINE>// Confuses single arg with a list of one.<NEW_LINE>PropertyFunctionInstance pfi = new PropertyFunctionInstance(subjArgs, pfTriple.getPredicate(), objArgs);<NEW_LINE>triples.<MASK><NEW_LINE>return pfi;<NEW_LINE>}
getList().removeAll(listTriples);
1,589,127
public void reduce(final IntWritable key, final Iterator<Text> values, OutputCollector<IntWritable, Text> output, final Reporter reporter) throws IOException {<NEW_LINE>int i;<NEW_LINE>float vector_val = 0;<NEW_LINE>ArrayList<Integer> to_nodes_list = new ArrayList<Integer>();<NEW_LINE>ArrayList<Float> to_val_list = new ArrayList<Float>();<NEW_LINE>// save vector<NEW_LINE>ArrayList<VectorElem<Double>> vectorArr = null;<NEW_LINE>// save blocks<NEW_LINE>ArrayList<ArrayList<BlockElem<Double>>> blockArr = new ArrayList<ArrayList<BlockElem<Double>>>();<NEW_LINE>// save block rows(integer)<NEW_LINE>ArrayList<Integer> blockRowArr = new ArrayList<Integer>();<NEW_LINE>while (values.hasNext()) {<NEW_LINE>// vector: key=BLOCKID, value= (IN-BLOCK-INDEX VALUE)s<NEW_LINE>// matrix: key=BLOCK-COL BLOCK-ROW, value=(IN-BLOCK-COL IN-BLOCK-ROW VALUE)s<NEW_LINE>String line_text = values.next().toString();<NEW_LINE>final String[] line = line_text.split("\t");<NEW_LINE>if (line.length == 1) {<NEW_LINE>// vector : VALUE<NEW_LINE>vectorArr = GIMV.parseVectorVal(line_text.substring<MASK><NEW_LINE>} else {<NEW_LINE>// edge : ROWID VALUE<NEW_LINE>blockArr.add(GIMV.parseBlockVal(line[1], Double.class));<NEW_LINE>int block_row = Integer.parseInt(line[0]);<NEW_LINE>blockRowArr.add(block_row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int blockCount = blockArr.size();<NEW_LINE>if (// missing vector or block.<NEW_LINE>vectorArr == null || blockCount == 0)<NEW_LINE>return;<NEW_LINE>// output 'self' block to check convergence<NEW_LINE>Text self_output = GIMV.formatVectorElemOutput("s", vectorArr);<NEW_LINE>output.collect(key, self_output);<NEW_LINE>// For every matrix block, join it with vector and output partial results<NEW_LINE>Iterator<ArrayList<BlockElem<Double>>> blockArrIter = blockArr.iterator();<NEW_LINE>Iterator<Integer> blockRowIter = blockRowArr.iterator();<NEW_LINE>while (blockArrIter.hasNext()) {<NEW_LINE>ArrayList<BlockElem<Double>> cur_block = blockArrIter.next();<NEW_LINE>int cur_block_row = blockRowIter.next();<NEW_LINE>// multiply cur_block and vectorArr.<NEW_LINE>ArrayList<VectorElem<Double>> cur_mult_result = GIMV.multBlockVector(cur_block, vectorArr, block_width);<NEW_LINE>String cur_block_output = "o";<NEW_LINE>if (cur_mult_result != null && cur_mult_result.size() > 0) {<NEW_LINE>Iterator<VectorElem<Double>> cur_mult_result_iter = cur_mult_result.iterator();<NEW_LINE>while (cur_mult_result_iter.hasNext()) {<NEW_LINE>VectorElem elem = cur_mult_result_iter.next();<NEW_LINE>if (cur_block_output != "o")<NEW_LINE>cur_block_output += " ";<NEW_LINE>cur_block_output += ("" + elem.row + " " + elem.val);<NEW_LINE>}<NEW_LINE>// output the partial result of multiplication.<NEW_LINE>output.collect(new IntWritable(cur_block_row), new Text(cur_block_output));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(1), Double.class);
44,649
private static void calculate_incomplete_rooms_with_empty_neighbours(ObstacleExpansionRoom p_room, AutorouteEngine p_autoroute_engine) {<NEW_LINE>TileShape room_shape = p_room.get_shape();<NEW_LINE>if (!(room_shape instanceof IntBox)) {<NEW_LINE>FRLogger.warn("SortedOrthoganelRoomNeighbours.calculate_incomplete_rooms_with_empty_neighbours: IntBox expected for room_shape");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IntBox room_box = (IntBox) room_shape;<NEW_LINE>IntBox bounding_box = p_autoroute_engine.board.get_bounding_box();<NEW_LINE>for (int i = 0; i < 4; ++i) {<NEW_LINE>IntBox new_room_box;<NEW_LINE>if (i == 0) {<NEW_LINE>new_room_box = new IntBox(bounding_box.ll.x, bounding_box.ll.y, bounding_box.ur.x, room_box.ll.y);<NEW_LINE>} else if (i == 1) {<NEW_LINE>new_room_box = new IntBox(room_box.ur.x, bounding_box.ll.y, bounding_box.ur.x, bounding_box.ur.y);<NEW_LINE>} else if (i == 2) {<NEW_LINE>new_room_box = new IntBox(bounding_box.ll.x, room_box.ur.y, bounding_box.ur.x, bounding_box.ur.y);<NEW_LINE>} else if (i == 3) {<NEW_LINE>new_room_box = new IntBox(bounding_box.ll.x, bounding_box.ll.y, room_box.ll.x, bounding_box.ur.y);<NEW_LINE>} else {<NEW_LINE>FRLogger.warn("SortedOrthoganelRoomNeighbours.calculate_incomplete_rooms_with_empty_neighbours: illegal index i");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IntBox <MASK><NEW_LINE>FreeSpaceExpansionRoom new_room = p_autoroute_engine.add_incomplete_expansion_room(new_room_box, p_room.get_layer(), new_contained_box);<NEW_LINE>ExpansionDoor new_door = new ExpansionDoor(p_room, new_room, 1);<NEW_LINE>p_room.add_door(new_door);<NEW_LINE>new_room.add_door(new_door);<NEW_LINE>}<NEW_LINE>}
new_contained_box = room_box.intersection(new_room_box);
325,261
public net.osmand.binary.OsmandOdb.OsmAndRoutingIndex buildPartial() {<NEW_LINE>net.osmand.binary.OsmandOdb.OsmAndRoutingIndex result = new net.osmand.binary.OsmandOdb.OsmAndRoutingIndex(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.name_ = name_;<NEW_LINE>if (rulesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>rules_ = java.util.Collections.unmodifiableList(rules_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.rules_ = rules_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>if (rootBoxesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>rootBoxes_ = java.util.Collections.unmodifiableList(rootBoxes_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000004);<NEW_LINE>}<NEW_LINE>result.rootBoxes_ = rootBoxes_;<NEW_LINE>} else {<NEW_LINE>result.rootBoxes_ = rootBoxesBuilder_.build();<NEW_LINE>}<NEW_LINE>if (basemapBoxesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>basemapBoxes_ = java.util.Collections.unmodifiableList(basemapBoxes_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>}<NEW_LINE>result.basemapBoxes_ = basemapBoxes_;<NEW_LINE>} else {<NEW_LINE>result.basemapBoxes_ = basemapBoxesBuilder_.build();<NEW_LINE>}<NEW_LINE>if (blocksBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>blocks_ = java.util.Collections.unmodifiableList(blocks_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000010);<NEW_LINE>}<NEW_LINE>result.blocks_ = blocks_;<NEW_LINE>} else {<NEW_LINE>result.blocks_ = blocksBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
.rules_ = rulesBuilder_.build();
333,217
/*<NEW_LINE>* @return an object to work with<NEW_LINE>* @exception IOException an I/O error occured<NEW_LINE>* @exception ClassNotFoundException the class has not been found<NEW_LINE>*/<NEW_LINE>public Object instanceCreate() throws java.io.IOException, ClassNotFoundException {<NEW_LINE>try {<NEW_LINE>if (isSerialized()) {<NEW_LINE>// create from ser file<NEW_LINE>BufferedInputStream bis = new BufferedInputStream(instanceOrigin(<MASK><NEW_LINE>org.openide.util.io.NbObjectInputStream nbis = new org.openide.util.io.NbObjectInputStream(bis);<NEW_LINE>Object o = nbis.readObject();<NEW_LINE>nbis.close();<NEW_LINE>return o;<NEW_LINE>} else {<NEW_LINE>Class<?> c = instanceClass();<NEW_LINE>if (SharedClassObject.class.isAssignableFrom(c)) {<NEW_LINE>// special support<NEW_LINE>return SharedClassObject.findObject(c.asSubclass(SharedClassObject.class), true);<NEW_LINE>} else {<NEW_LINE>// create new instance<NEW_LINE>Constructor<?> init = c.getDeclaredConstructor();<NEW_LINE>init.setAccessible(true);<NEW_LINE>return init.newInstance((Object[]) null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// [PENDING] annotate with localized message<NEW_LINE>Exceptions.attachLocalizedMessage(ex, instanceName());<NEW_LINE>throw ex;<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (Exception e) {<NEW_LINE>// turn other throwables into class not found ex.<NEW_LINE>// NOI18N<NEW_LINE>throw new ClassNotFoundException("Cannot instantiate " + instanceName() + " for " + entry.getFile(), e);<NEW_LINE>} catch (LinkageError e) {<NEW_LINE>// NOI18N<NEW_LINE>throw new ClassNotFoundException("Cannot instantiate " + instanceName() + " for " + entry.getFile(), e);<NEW_LINE>}<NEW_LINE>}
).getInputStream(), 1024);
137,924
public void addGhostslots(NNList<GhostSlot> ghostSlots) {<NEW_LINE>NNList<ItemStack> empties = new NNList<>();<NEW_LINE>NNList<ItemStack> fulls = new NNList<>();<NEW_LINE>getValidPair(ItemHelper.getValidItems()).apply(new Callback<Triple<ItemStack, ItemStack, Integer>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void apply(@Nonnull Triple<ItemStack, ItemStack, Integer> e) {<NEW_LINE>empties.<MASK><NEW_LINE>fulls.add(e.getMiddle());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// JEI will cause initGui to be re-run after closing the recipe view, causing duplicate ghost<NEW_LINE>ghostSlots.removeAllByClass(GhostBackgroundItemSlot.class);<NEW_LINE>// slots<NEW_LINE>final GhostBackgroundItemSlot ghost0 = new GhostBackgroundItemSlot(empties, getSlotFromInventory(0));<NEW_LINE>ghost0.setDisplayStdOverlay(true);<NEW_LINE>ghostSlots.add(ghost0);<NEW_LINE>final GhostBackgroundItemSlot ghost1 = new GhostBackgroundItemSlot(fulls, getSlotFromInventory(1));<NEW_LINE>ghost1.setDisplayStdOverlay(true);<NEW_LINE>ghostSlots.add(ghost1);<NEW_LINE>}
add(e.getLeft());
1,358,814
public void onError(Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TBase msg;<NEW_LINE>getSupervisorWorkers_result result = new getSupervisorWorkers_result();<NEW_LINE>if (e instanceof NotAliveException) {<NEW_LINE>result.e = (NotAliveException) e;<NEW_LINE>result.set_e_isSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else {<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TBase) new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>return;<NEW_LINE>} catch (Exception ex) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>fb.close();<NEW_LINE>}
LOGGER.error("Exception writing to internal frame buffer", ex);
63,230
public static void main(String[] args) {<NEW_LINE>Exercise29 exercise29 = new Exercise29();<NEW_LINE>Graph graphWithSimpleCycle = new Graph(4);<NEW_LINE><MASK><NEW_LINE>graphWithSimpleCycle.addEdge(1, 2);<NEW_LINE>graphWithSimpleCycle.addEdge(2, 3);<NEW_LINE>graphWithSimpleCycle.addEdge(3, 0);<NEW_LINE>CycleThatDoesNotCountParallelEdgesOrSelfLoops cycle1 = exercise29.new CycleThatDoesNotCountParallelEdgesOrSelfLoops(graphWithSimpleCycle);<NEW_LINE>StdOut.println("Has cycle (simple cycle): " + cycle1.hasCycle() + " Expected: true");<NEW_LINE>Graph graphWithParallelEdges = new Graph(4);<NEW_LINE>graphWithParallelEdges.addEdge(0, 1);<NEW_LINE>graphWithParallelEdges.addEdge(1, 2);<NEW_LINE>graphWithParallelEdges.addEdge(2, 1);<NEW_LINE>graphWithParallelEdges.addEdge(2, 3);<NEW_LINE>CycleThatDoesNotCountParallelEdgesOrSelfLoops cycle2 = exercise29.new CycleThatDoesNotCountParallelEdgesOrSelfLoops(graphWithParallelEdges);<NEW_LINE>StdOut.println("Has cycle (graph with parallel edges): " + cycle2.hasCycle() + " Expected: false");<NEW_LINE>Graph graphWithSelfLoop = new Graph(4);<NEW_LINE>graphWithSelfLoop.addEdge(0, 1);<NEW_LINE>graphWithSelfLoop.addEdge(1, 2);<NEW_LINE>graphWithSelfLoop.addEdge(2, 3);<NEW_LINE>graphWithSelfLoop.addEdge(3, 3);<NEW_LINE>CycleThatDoesNotCountParallelEdgesOrSelfLoops cycle3 = exercise29.new CycleThatDoesNotCountParallelEdgesOrSelfLoops(graphWithSelfLoop);<NEW_LINE>StdOut.println("Has cycle (graph with self-loop): " + cycle3.hasCycle() + " Expected: false");<NEW_LINE>}
graphWithSimpleCycle.addEdge(0, 1);