idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,020,255
public void loadKeyboard(final EditorInfo editorInfo, final SettingsValues settingsValues, final int currentAutoCapsState, final int currentRecapitalizeState) {<NEW_LINE>final KeyboardLayoutSet.Builder builder = new KeyboardLayoutSet.Builder(mThemeContext, editorInfo);<NEW_LINE>final Resources res = mThemeContext.getResources();<NEW_LINE>final int keyboardWidth = ResourceUtils.getKeyboardWidth(res, settingsValues);<NEW_LINE>final int keyboardHeight = ResourceUtils.getKeyboardHeight(res, settingsValues);<NEW_LINE>builder.setKeyboardGeometry(keyboardWidth, keyboardHeight);<NEW_LINE>builder.setSubtype(mRichImm.getCurrentSubtype());<NEW_LINE>builder.setVoiceInputKeyEnabled(settingsValues.mShowsVoiceInputKey);<NEW_LINE>builder.setNumberRowEnabled(settingsValues.mShowsNumberRow);<NEW_LINE>builder.setLanguageSwitchKeyEnabled(mLatinIME.shouldShowLanguageSwitchKey());<NEW_LINE>builder.setEmojiKeyEnabled(settingsValues.mShowsEmojiKey);<NEW_LINE>builder.setSplitLayoutEnabledByUser(ProductionFlags.IS_SPLIT_KEYBOARD_SUPPORTED && settingsValues.mIsSplitKeyboardEnabled);<NEW_LINE>final boolean oneHandedModeEnabled = settingsValues.mOneHandedModeEnabled;<NEW_LINE>builder.setOneHandedModeEnabled(oneHandedModeEnabled);<NEW_LINE>mKeyboardLayoutSet = builder.build();<NEW_LINE>try {<NEW_LINE>mState.<MASK><NEW_LINE>mKeyboardTextsSet.setLocale(mRichImm.getCurrentSubtypeLocale(), mThemeContext);<NEW_LINE>} catch (KeyboardLayoutSetException e) {<NEW_LINE>Log.w(TAG, "loading keyboard failed: " + e.mKeyboardId, e.getCause());<NEW_LINE>}<NEW_LINE>}
onLoadKeyboard(currentAutoCapsState, currentRecapitalizeState, oneHandedModeEnabled);
540,923
/* * TASKS */<NEW_LINE>private void startFloorPlanTask() {<NEW_LINE>try {<NEW_LINE>final BuildingModel b = mAnyplaceCache.getSelectedBuilding();<NEW_LINE>if (b == null) {<NEW_LINE>Toast.makeText(getBaseContext(), "You haven't selected both building and floor...!", Toast.LENGTH_SHORT).show();<NEW_LINE>setResult(RESULT_CANCELED);<NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final FloorModel f = b.getLoadedFloors().get(selectedFloorIndex);<NEW_LINE>final FetchFloorPlanTask fetchFloorPlanTask = new FetchFloorPlanTask(this, b.buid, f.floor_number);<NEW_LINE>fetchFloorPlanTask.setCallbackInterface(new FetchFloorPlanTask.Callback() {<NEW_LINE><NEW_LINE>private ProgressDialog dialog;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(String result, File floor_plan_file) {<NEW_LINE>if (dialog != null)<NEW_LINE>dialog.dismiss();<NEW_LINE>Intent returnIntent = new Intent();<NEW_LINE>returnIntent.putExtra("bmodel", mAnyplaceCache.getSelectedBuildingIndex());<NEW_LINE>returnIntent.putExtra("fmodel", selectedFloorIndex);<NEW_LINE>returnIntent.putExtra(<MASK><NEW_LINE>returnIntent.putExtra("message", result);<NEW_LINE>setResult(RESULT_OK, returnIntent);<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onErrorOrCancel(String result) {<NEW_LINE>if (dialog != null)<NEW_LINE>dialog.dismiss();<NEW_LINE>Toast.makeText(getBaseContext(), result, Toast.LENGTH_SHORT).show();<NEW_LINE>Intent returnIntent = new Intent();<NEW_LINE>returnIntent.putExtra("message", result);<NEW_LINE>setResult(RESULT_CANCELED);<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPrepareLongExecute() {<NEW_LINE>dialog = new ProgressDialog(SelectBuildingActivity.this);<NEW_LINE>dialog.setIndeterminate(true);<NEW_LINE>dialog.setTitle("Downloading floor plan");<NEW_LINE>dialog.setMessage("Please be patient...");<NEW_LINE>dialog.setCancelable(true);<NEW_LINE>dialog.setCanceledOnTouchOutside(false);<NEW_LINE>dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCancel(DialogInterface dialog) {<NEW_LINE>fetchFloorPlanTask.cancel(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dialog.show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fetchFloorPlanTask.execute();<NEW_LINE>} catch (IndexOutOfBoundsException e) {<NEW_LINE>Toast.makeText(getBaseContext(), "You haven't selected both building and floor...!", Toast.LENGTH_SHORT).show();<NEW_LINE>setResult(RESULT_CANCELED);<NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
"floor_plan_path", floor_plan_file.getAbsolutePath());
1,666,688
public void replaceBlock(@Sender EntityRef sender, @CommandParam("blockName") String uri, @CommandParam(value = "maxDistance", required = false) Integer maxDistanceParam) {<NEW_LINE>int maxDistance = maxDistanceParam != null ? maxDistanceParam : 12;<NEW_LINE>EntityRef playerEntity = sender.getComponent(ClientComponent.class).character;<NEW_LINE>EntityRef gazeEntity = GazeAuthoritySystem.getGazeEntityForCharacter(playerEntity);<NEW_LINE>LocationComponent gazeLocation = gazeEntity.getComponent(LocationComponent.class);<NEW_LINE>Set<ResourceUrn> matchingUris = Assets.resolveAssetUri(uri, BlockFamilyDefinition.class);<NEW_LINE>targetSystem.updateTarget(gazeLocation.getWorldPosition(new Vector3f()), gazeLocation.getWorldDirection(new Vector3f()), maxDistance);<NEW_LINE>EntityRef target = targetSystem.getTarget();<NEW_LINE>BlockComponent targetLocation = <MASK><NEW_LINE>if (matchingUris.size() == 1) {<NEW_LINE>Optional<BlockFamilyDefinition> def = Assets.get(matchingUris.iterator().next(), BlockFamilyDefinition.class);<NEW_LINE>if (def.isPresent()) {<NEW_LINE>BlockFamily blockFamily = blockManager.getBlockFamily(uri);<NEW_LINE>Block block = blockManager.getBlock(blockFamily.getURI());<NEW_LINE>world.setBlock(targetLocation.getPosition(), block);<NEW_LINE>} else if (matchingUris.size() > 1) {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("Non-unique shape name, possible matches: ");<NEW_LINE>Iterator<ResourceUrn> shapeUris = sortItems(matchingUris).iterator();<NEW_LINE>while (shapeUris.hasNext()) {<NEW_LINE>builder.append(shapeUris.next().toString());<NEW_LINE>if (shapeUris.hasNext()) {<NEW_LINE>builder.append(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
target.getComponent(BlockComponent.class);
398,169
private String request(String request) {<NEW_LINE>String result = null;<NEW_LINE>try {<NEW_LINE>URL url = new URL("http://" + fibaroAddress.getIp() + ":" + fibaroAddress.getPort() + request);<NEW_LINE>HttpURLConnection connection = (HttpURLConnection) url.openConnection();<NEW_LINE>connection.setRequestMethod("GET");<NEW_LINE>connection.setRequestProperty("Authorization", fibaroAuth);<NEW_LINE>connection.setRequestProperty("Content-Type", "application/json;charset=utf-8");<NEW_LINE>connection.connect();<NEW_LINE>BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>String line;<NEW_LINE>while ((line = br.readLine()) != null) {<NEW_LINE>buffer.append(line).append("\n");<NEW_LINE>}<NEW_LINE>br.close();<NEW_LINE>result = buffer.toString();<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
warn("Error while get getJson: {} ", request, e);
452,620
public static float distance(int mx, int my, int x, int y, int width, int height) {<NEW_LINE>if (inside(mx, my, x, y, width, height)) {<NEW_LINE>return 0;<NEW_LINE>} else {<NEW_LINE>if (mx > x && mx < x + width) {<NEW_LINE>return Math.min(Math.abs(my - y), Math.abs(my <MASK><NEW_LINE>} else if (my > y && my < y + height) {<NEW_LINE>return Math.min(Math.abs(mx - x), Math.abs(mx - (x + width)));<NEW_LINE>} else if (mx <= x && my <= y) {<NEW_LINE>float dx = mx - x;<NEW_LINE>float dy = my - y;<NEW_LINE>return (float) Math.hypot(dx, dy);<NEW_LINE>} else if (mx <= x && my >= y + height) {<NEW_LINE>float dx = mx - x;<NEW_LINE>float dy = my - (y + height);<NEW_LINE>return (float) Math.hypot(dx, dy);<NEW_LINE>} else if (mx >= x + width && my <= y) {<NEW_LINE>float dx = mx - (x + width);<NEW_LINE>float dy = my - y;<NEW_LINE>return (float) Math.hypot(dx, dy);<NEW_LINE>} else if (mx >= x + width && my >= y + height) {<NEW_LINE>float dx = mx - (x + width);<NEW_LINE>float dy = my - (y + height);<NEW_LINE>return (float) Math.hypot(dx, dy);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
- (y + height)));
961,986
protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewHolder holder) {<NEW_LINE>String prefId = preference.getKey();<NEW_LINE>if (HISTORY_INFO.equals(prefId)) {<NEW_LINE>TextView title = holder.itemView.findViewById(android.R.id.title);<NEW_LINE>AndroidUtils.setTextSecondaryColor(app, title, isNightMode());<NEW_LINE>} else if (CLEAR_ALL_HISTORY.equals(prefId)) {<NEW_LINE>TextView title = holder.itemView.findViewById(android.R.id.title);<NEW_LINE>title.setTextColor(ContextCompat.getColor(app<MASK><NEW_LINE>} else if (ACTIONS.equals(prefId)) {<NEW_LINE>TextView title = holder.itemView.findViewById(android.R.id.title);<NEW_LINE>title.setTypeface(FontCache.getFont(app, getString(R.string.font_roboto_medium)));<NEW_LINE>}<NEW_LINE>super.onBindPreferenceViewHolder(preference, holder);<NEW_LINE>}
, R.color.color_osm_edit_delete));
1,403,174
public ListArtifactsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListArtifactsResult listArtifactsResult = new ListArtifactsResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listArtifactsResult;<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("ArtifactSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listArtifactsResult.setArtifactSummaries(new ListUnmarshaller<ArtifactSummary>(ArtifactSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listArtifactsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listArtifactsResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
601,138
public TestStepConfig createNewTestStep(WsdlOperation operation, StringToStringMap values) {<NEW_LINE>String name;<NEW_LINE>name = values.get(STEP_NAME);<NEW_LINE>String requestContent = operation.createRequest(values.getBoolean(CREATE_OPTIONAL_ELEMENTS_IN_REQUEST));<NEW_LINE>RequestStepConfig requestStepConfig = RequestStepConfig.Factory.newInstance();<NEW_LINE>requestStepConfig.setInterface(operation.getInterface().getName());<NEW_LINE>requestStepConfig.setOperation(operation.getName());<NEW_LINE>WsdlRequestConfig testRequestConfig = requestStepConfig.addNewRequest();<NEW_LINE>testRequestConfig.setName(name);<NEW_LINE>testRequestConfig.setEncoding("UTF-8");<NEW_LINE>String[] endpoints = operation.getInterface().getEndpoints();<NEW_LINE>if (endpoints.length > 0) {<NEW_LINE>testRequestConfig.setEndpoint(endpoints[0]);<NEW_LINE>}<NEW_LINE>testRequestConfig.addNewRequest().setStringValue(requestContent);<NEW_LINE>if (values.getBoolean(ADD_SOAP_RESPONSE_ASSERTION)) {<NEW_LINE>TestAssertionConfig assertionConfig = testRequestConfig.addNewAssertion();<NEW_LINE>assertionConfig.setType(SoapResponseAssertion.ID);<NEW_LINE>}<NEW_LINE>if (values.getBoolean(ADD_SCHEMA_ASSERTION)) {<NEW_LINE>TestAssertionConfig assertionConfig = testRequestConfig.addNewAssertion();<NEW_LINE>assertionConfig.setType(SchemaComplianceAssertion.ID);<NEW_LINE>}<NEW_LINE>if (values.getBoolean(ADD_SOAP_FAULT_ASSERTION)) {<NEW_LINE>TestAssertionConfig assertionConfig = testRequestConfig.addNewAssertion();<NEW_LINE>assertionConfig.setType(NotSoapFaultAssertion.ID);<NEW_LINE>}<NEW_LINE>TestStepConfig testStep <MASK><NEW_LINE>testStep.setType(REQUEST_TYPE);<NEW_LINE>testStep.setConfig(requestStepConfig);<NEW_LINE>testStep.setName(name);<NEW_LINE>return testStep;<NEW_LINE>}
= TestStepConfig.Factory.newInstance();
1,133,795
protected Dimension calcPreferredSize() {<NEW_LINE>calcPreferredSizeDepth++;<NEW_LINE>boolean restoreBounds = false;<NEW_LINE>if (safeArea && getWidth() > 0 && getHeight() > 0 && calcPreferredSizeDepth == 1) {<NEW_LINE>// If this container is marked as a safe area<NEW_LINE>// then we may need to add padding to make it *safe*<NEW_LINE>Container parent = getParent();<NEW_LINE>if (parent == null || !parent.isSafeAreaInternal(true)) {<NEW_LINE>// For efficiency, we check if the parent is a safe area.<NEW_LINE>// If so, we don't need to worry because it has already<NEW_LINE>// added appropriate padding.<NEW_LINE>if (calcTmpInsets == null) {<NEW_LINE>calcTmpInsets = new TmpInsets();<NEW_LINE>}<NEW_LINE>Style s = getStyle();<NEW_LINE>calcTmpInsets.set(s);<NEW_LINE>restoreBounds = snapToSafeAreaInternal();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Dimension d = layout.getPreferredSize(this);<NEW_LINE>Style style = getStyle();<NEW_LINE>if (style.getBorder() != null && d.getWidth() != 0 && d.getHeight() != 0) {<NEW_LINE>d.setWidth(Math.max(style.getBorder().getMinimumWidth(), d.getWidth()));<NEW_LINE>d.setHeight(Math.max(style.getBorder().getMinimumHeight(), d.getHeight()));<NEW_LINE>}<NEW_LINE>if (UIManager.getInstance().getLookAndFeel().isBackgroundImageDetermineSize() && style.getBgImage() != null) {<NEW_LINE>d.setWidth(Math.max(style.getBgImage().getWidth(), d.getWidth()));<NEW_LINE>d.setHeight(Math.max(style.getBgImage().getHeight(), d.getHeight()));<NEW_LINE>}<NEW_LINE>if (restoreBounds && calcTmpInsets != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>calcPreferredSizeDepth--;<NEW_LINE>return d;<NEW_LINE>}
calcTmpInsets.restore(getStyle());
753,978
public void readFromFile(java.io.File configurationFile) {<NEW_LINE>try {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>if (configurationFile.getName().endsWith(".xml")) {<NEW_LINE>properties.loadFromXML(new FileInputStream(configurationFile));<NEW_LINE>} else {<NEW_LINE>properties.load(new FileInputStream(configurationFile));<NEW_LINE>}<NEW_LINE>Enumeration keys = properties.propertyNames();<NEW_LINE>while (keys.hasMoreElements()) {<NEW_LINE>java.lang.String key = (java.lang.String) keys.nextElement();<NEW_LINE>java.lang.String[] values = properties.getProperty(key).split("\\s+");<NEW_LINE>@Var<NEW_LINE>boolean foundValue = false;<NEW_LINE>for (int i = 0; i < options.size(); i++) {<NEW_LINE>CommandOption option = (CommandOption) options.get(i);<NEW_LINE>if (option.name.equals(key)) {<NEW_LINE>foundValue = true;<NEW_LINE><MASK><NEW_LINE>option.invoked = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Unable to process configuration file: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
option.parseArg(values, 0);
468,846
protected CommunicationChannel connect() {<NEW_LINE>logger.<MASK><NEW_LINE>try {<NEW_LINE>CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(this.port);<NEW_LINE>SerialPort serialPort = portIdentifier.open("org.openhab.binding.satel", 2000);<NEW_LINE>serialPort.setSerialPortParams(19200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);<NEW_LINE>serialPort.enableReceiveTimeout(this.getTimeout());<NEW_LINE>// RXTX serial port library causes high CPU load<NEW_LINE>// Start event listener, which will just sleep and slow down event<NEW_LINE>// loop<NEW_LINE>serialPort.addEventListener(new SerialPortEventListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void serialEvent(SerialPortEvent ev) {<NEW_LINE>try {<NEW_LINE>logger.trace("RXTX library CPU load workaround, sleep forever");<NEW_LINE>Thread.sleep(Long.MAX_VALUE);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>serialPort.notifyOnDataAvailable(true);<NEW_LINE>logger.info("INT-RS module connected successfuly");<NEW_LINE>return new SerialCommunicationChannel(serialPort);<NEW_LINE>} catch (NoSuchPortException e) {<NEW_LINE>logger.error("Port {} does not exist", this.port);<NEW_LINE>} catch (PortInUseException e) {<NEW_LINE>logger.error("Port {} in use.", this.port);<NEW_LINE>} catch (UnsupportedCommOperationException e) {<NEW_LINE>logger.error("Unsupported comm operation on port {}.", this.port);<NEW_LINE>} catch (TooManyListenersException e) {<NEW_LINE>logger.error("Too many listeners on port {}.", this.port);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
info("Connecting to INT-RS module at {}", this.port);
380,241
private void packAndShow() {<NEW_LINE>boolean openMaximized = Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED);<NEW_LINE>//<NEW_LINE>// Set window position<NEW_LINE>{<NEW_LINE>Point windowLocation = Ini.getWindowLocation(0);<NEW_LINE>if (windowLocation == null) {<NEW_LINE>windowLocation = new Point(0, 0);<NEW_LINE>}<NEW_LINE>// Make sure the position is not out of the screen<NEW_LINE>if (windowLocation.x < 0 || windowLocation.y < 0) {<NEW_LINE>windowLocation = new Point(windowLocation.x < 0 ? 0 : windowLocation.x, windowLocation.y < <MASK><NEW_LINE>}<NEW_LINE>this.setLocation(windowLocation);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Set window dimension<NEW_LINE>{<NEW_LINE>Dimension windowSize = Ini.getWindowDimension(0);<NEW_LINE>AEnv.setMaximumSizeAsScreenSize(this);<NEW_LINE>if (windowSize == null || windowSize.width <= 0 || windowSize.height <= 0) {<NEW_LINE>this.setPreferredSize(this.getMaximumSize());<NEW_LINE>openMaximized = true;<NEW_LINE>} else {<NEW_LINE>this.setPreferredSize(windowSize);<NEW_LINE>}<NEW_LINE>this.pack();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Show the window<NEW_LINE>this.setVisible(true);<NEW_LINE>if (openMaximized) {<NEW_LINE>this.setExtendedState(Frame.MAXIMIZED_BOTH);<NEW_LINE>} else {<NEW_LINE>this.setState(Frame.NORMAL);<NEW_LINE>}<NEW_LINE>}
0 ? 0 : windowLocation.y);
1,172,650
final DeleteArchiveResult executeDeleteArchive(DeleteArchiveRequest deleteArchiveRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteArchiveRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteArchiveRequest> request = null;<NEW_LINE>Response<DeleteArchiveResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteArchiveRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteArchiveRequest));<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, "EventBridge");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteArchive");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteArchiveResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteArchiveResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
71,357
public static void main(String[] argv) {<NEW_LINE>if (argv.length < 3)<NEW_LINE>printHelp();<NEW_LINE>matchUriAppVhost = Boolean.getBoolean("com.ibm.ws.pluginmerge.match.appname");<NEW_LINE>PluginMergeToolImpl toolInstance = new PluginMergeToolImpl();<NEW_LINE>try {<NEW_LINE>System.out.println("Merging:");<NEW_LINE>toolInstance.loadData(argv);<NEW_LINE>} catch (SAXException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>System.out.println(NO_MERGE_ERR);<NEW_LINE>System.exit(2);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>System.out.println(NO_MERGE_ERR);<NEW_LINE>System.exit(3);<NEW_LINE>} catch (ParserConfigurationException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>System.out.println(NO_MERGE_ERR);<NEW_LINE>System.exit(3);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (precedence)<NEW_LINE>toolInstance.pMerge();<NEW_LINE>else<NEW_LINE>toolInstance.lfMerge();<NEW_LINE>toolInstance.printMergedCopy(argv[argv.length - 1]);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>System.out.println(NO_MERGE_ERR);<NEW_LINE>System.exit(4);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>System.out.println(NO_MERGE_ERR);<NEW_LINE>System.exit(5);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
System.out.println("Merge Complete");
1,700,525
protected void paintComponent(Graphics g) {<NEW_LINE>if (g instanceof Graphics2D) {<NEW_LINE>int side = getWidth();<NEW_LINE>Point2D.Float center = new Point2D.Float(halfSide, halfSide);<NEW_LINE>Color redFull = new Color(<MASK><NEW_LINE>Color redTrans = new Color(255, 0, 0, 0);<NEW_LINE>float radius = halfSide;<NEW_LINE>float[] dist = { 0.0f, 1.0f };<NEW_LINE>Color[] colorsRed = { redFull, redTrans };<NEW_LINE>Color[] colorsBlack = { Color.BLACK, Color.WHITE };<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE>g2d.setPaint(new RadialGradientPaint(center, radius, dist, colorsRed));<NEW_LINE>g2d.fillRect(0, 0, side, side);<NEW_LINE>g2d.setPaint(new RadialGradientPaint(center, radius, dist, colorsBlack));<NEW_LINE>g2d.fillRect((int) halfSide - 1, 0, 2, side);<NEW_LINE>g2d.fillRect(0, (int) halfSide - 1, side, 2);<NEW_LINE>}<NEW_LINE>}
255, 0, 0, 150);
1,391,131
/*<NEW_LINE>* testBMTNoCommit()<NEW_LINE>*<NEW_LINE>* send a message to MDB BMTBeanNoCommit<NEW_LINE>*/<NEW_LINE>public void testBMTNoCommit() throws Exception {<NEW_LINE>FATMDBHelper.emptyQueue(qcfName, testResultQueueName);<NEW_LINE>FATMDBHelper.putQueueMessage("Request test results", qcfName, bmtNoCommitRequestQueueName);<NEW_LINE>svLogger.info("Message sent to MDB BMTBeanNoCommit.");<NEW_LINE>String results = (String) FATMDBHelper.getQueueMessage(qcfName, testResultQueueName);<NEW_LINE>if (results == null) {<NEW_LINE>fail("Reply is an empty vector. No test results are collected.");<NEW_LINE>}<NEW_LINE>if (results.equals("")) {<NEW_LINE>fail("No worthwhile results were returned.");<NEW_LINE>}<NEW_LINE>if (results.contains("FAIL")) {<NEW_LINE>svLogger.info(results);<NEW_LINE>fail("Reply contained FAIL keyword. Look at client log for full result text.");<NEW_LINE>}<NEW_LINE>FATMDBHelper.emptyQueue(qcfName, bmtNoCommitRequestQueueName);<NEW_LINE>svLogger.info("checking data for BMTTxNoCommit ...");<NEW_LINE>svLogger.info("Test Point: BMTTxNoCommit getIntValue: " + BMTBeanNoCommit.noCommitBean.getIntValue());<NEW_LINE>assertTrue("BMTTxNoCommit", (BMTBeanNoCommit.noCommitBean<MASK><NEW_LINE>svLogger.info("done");<NEW_LINE>}
.getIntValue() == 0));
1,850,609
public Optional<Integer> nextTermDoc() {<NEW_LINE>if (penum == null) {<NEW_LINE>// postings enum is not initialized<NEW_LINE>log.warning("Postings enum un-positioned for field: " + curField);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (penum.nextDoc() == PostingsEnum.NO_MORE_DOCS) {<NEW_LINE>// end of the iterator<NEW_LINE>resetPostingsIterator();<NEW_LINE>log.info("Reached the end of the postings iterator for term: " + BytesRefUtils.decode(tenum.term<MASK><NEW_LINE>return Optional.empty();<NEW_LINE>} else {<NEW_LINE>return Optional.of(penum.docID());<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>resetPostingsIterator();<NEW_LINE>throw new LukeException(String.format(Locale.ENGLISH, "Term docs not available for field: %s.", curField), e);<NEW_LINE>}<NEW_LINE>}
()) + " in field: " + curField);
570,246
public static DescribeBackupTasksResponse unmarshall(DescribeBackupTasksResponse describeBackupTasksResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupTasksResponse.setRequestId(_ctx.stringValue("DescribeBackupTasksResponse.RequestId"));<NEW_LINE>describeBackupTasksResponse.setInstanceId(_ctx.stringValue("DescribeBackupTasksResponse.InstanceId"));<NEW_LINE>List<BackupJob> backupJobs = new ArrayList<BackupJob>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupTasksResponse.BackupJobs.Length"); i++) {<NEW_LINE>BackupJob backupJob = new BackupJob();<NEW_LINE>backupJob.setStartTime(_ctx.stringValue("DescribeBackupTasksResponse.BackupJobs[" + i + "].StartTime"));<NEW_LINE>backupJob.setProcess(_ctx.stringValue("DescribeBackupTasksResponse.BackupJobs[" + i + "].Process"));<NEW_LINE>backupJob.setJobMode(_ctx.stringValue("DescribeBackupTasksResponse.BackupJobs[" + i + "].JobMode"));<NEW_LINE>backupJob.setBackupJobID(_ctx.integerValue<MASK><NEW_LINE>backupJob.setBackupProgressStatus(_ctx.stringValue("DescribeBackupTasksResponse.BackupJobs[" + i + "].BackupProgressStatus"));<NEW_LINE>backupJob.setNodeId(_ctx.stringValue("DescribeBackupTasksResponse.BackupJobs[" + i + "].NodeId"));<NEW_LINE>backupJob.setTaskAction(_ctx.stringValue("DescribeBackupTasksResponse.BackupJobs[" + i + "].TaskAction"));<NEW_LINE>backupJobs.add(backupJob);<NEW_LINE>}<NEW_LINE>describeBackupTasksResponse.setBackupJobs(backupJobs);<NEW_LINE>return describeBackupTasksResponse;<NEW_LINE>}
("DescribeBackupTasksResponse.BackupJobs[" + i + "].BackupJobID"));
73,376
public void encode(SceneStructureMetric structure, double[] output) {<NEW_LINE>int index = 0;<NEW_LINE>for (int i = 0; i < structure.points.size; i++) {<NEW_LINE>SceneStructureCommon.Point p = structure.points.data[i];<NEW_LINE>output[index++] = p.coordinate[0];<NEW_LINE>output[index++] = p.coordinate[1];<NEW_LINE>output[index++] = p.coordinate[2];<NEW_LINE>if (structure.isHomogenous())<NEW_LINE>output[index++] = p.coordinate[3];<NEW_LINE>}<NEW_LINE>for (int rigidIndex = 0; rigidIndex < structure.rigids.size; rigidIndex++) {<NEW_LINE>SceneStructureMetric.Rigid rigid = structure.rigids.data[rigidIndex];<NEW_LINE>// Decode the rigid body transform from object to world<NEW_LINE>if (rigid.known)<NEW_LINE>continue;<NEW_LINE>rotation.getParameters(rigid.object_to_world.R, output, index);<NEW_LINE>index += rotation.getParameterLength();<NEW_LINE>output[index++] = rigid.object_to_world.T.x;<NEW_LINE>output[index++] = rigid.object_to_world.T.y;<NEW_LINE>output[index++] <MASK><NEW_LINE>}<NEW_LINE>for (int motionIndex = 0; motionIndex < structure.motions.size; motionIndex++) {<NEW_LINE>SceneStructureMetric.Motion motion = structure.motions.data[motionIndex];<NEW_LINE>// Decode the rigid body transform from world to view<NEW_LINE>if (motion.known)<NEW_LINE>continue;<NEW_LINE>rotation.getParameters(motion.motion.R, output, index);<NEW_LINE>index += rotation.getParameterLength();<NEW_LINE>output[index++] = motion.motion.T.x;<NEW_LINE>output[index++] = motion.motion.T.y;<NEW_LINE>output[index++] = motion.motion.T.z;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < structure.cameras.size; i++) {<NEW_LINE>SceneStructureCommon.Camera camera = structure.cameras.data[i];<NEW_LINE>if (camera.known)<NEW_LINE>continue;<NEW_LINE>camera.model.getIntrinsic(output, index);<NEW_LINE>index += camera.model.getIntrinsicCount();<NEW_LINE>}<NEW_LINE>}
= rigid.object_to_world.T.z;
1,834,129
public static INDArray reshape5dTo2d(@NonNull Convolution3D.DataFormat format, INDArray in, LayerWorkspaceMgr workspaceMgr, ArrayType type) {<NEW_LINE>Preconditions.checkState(in.rank() == 5, "Invalid input: expect NDArray with rank 5, got rank %ndRank with shape %ndShape", in, in);<NEW_LINE>// Reshape: from either [n,c,d,h,w] to [n*d*h*w,c] (NCDHW format)<NEW_LINE>// or reshape from [n,d,h,w,c] to [n*d*h*w,c] (NDHWC format)<NEW_LINE>if (format != Convolution3D.DataFormat.NDHWC) {<NEW_LINE>in = in.permute(0, 2, 3, 4, 1);<NEW_LINE>}<NEW_LINE>if (in.ordering() != 'c' || !Shape.hasDefaultStridesForShape(in))<NEW_LINE>in = workspaceMgr.dup(type, in, 'c');<NEW_LINE>return workspaceMgr.leverageTo(type, in.reshape('c', in.size(0) * in.size(1) * in.size(2) * in.size(3), <MASK><NEW_LINE>}
in.size(4)));
1,268,851
public void marshall(UpdateTableRequest updateTableRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateTableRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getAttributeDefinitions(), ATTRIBUTEDEFINITIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getBillingMode(), BILLINGMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getProvisionedThroughput(), PROVISIONEDTHROUGHPUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getGlobalSecondaryIndexUpdates(), GLOBALSECONDARYINDEXUPDATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getStreamSpecification(), STREAMSPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getSSESpecification(), SSESPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getReplicaUpdates(), REPLICAUPDATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getTableClass(), TABLECLASS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updateTableRequest.getTableName(), TABLENAME_BINDING);
1,014,792
private void highlightSelected(final Graphics2D g, final NodeView selected, final PaintingMode[] paintedModes) {<NEW_LINE>final java.awt.Shape highlightClip;<NEW_LINE>if (MapView.drawsRectangleForSelection)<NEW_LINE>highlightClip = getRoundRectangleAround(selected, 4, 15);<NEW_LINE>else<NEW_LINE>highlightClip = getRoundRectangleAround(selected, 4, 2);<NEW_LINE>final java.awt.Shape oldClip = g.getClip();<NEW_LINE>final <MASK><NEW_LINE>try {<NEW_LINE>g.setClip(highlightClip);<NEW_LINE>if (oldClipBounds != null)<NEW_LINE>g.clipRect(oldClipBounds.x, oldClipBounds.y, oldClipBounds.width, oldClipBounds.height);<NEW_LINE>final Rectangle clipBounds = highlightClip.getBounds();<NEW_LINE>final Color color = g.getColor();<NEW_LINE>g.setColor(getBackground());<NEW_LINE>g.fillRect(clipBounds.x, clipBounds.y, clipBounds.width, clipBounds.height);<NEW_LINE>g.setColor(color);<NEW_LINE>paintChildren(g, paintedModes);<NEW_LINE>} finally {<NEW_LINE>g.setClip(oldClip);<NEW_LINE>}<NEW_LINE>}
Rectangle oldClipBounds = g.getClipBounds();
1,729,878
public CostCategoryRule unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CostCategoryRule costCategoryRule = new CostCategoryRule();<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>if (context.testExpression("Value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>costCategoryRule.setValue(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Rule", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>costCategoryRule.setRule(ExpressionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("InheritedValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>costCategoryRule.setInheritedValue(CostCategoryInheritedValueDimensionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>costCategoryRule.setType(context.getUnmarshaller(String.<MASK><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 costCategoryRule;<NEW_LINE>}
class).unmarshall(context));
599,284
private PsiMethod createStaticConstructor(PsiClass psiClass, @PsiModifier.ModifierConstant String methodModifier, String staticName, boolean useJavaDefaults, Collection<PsiField> params, PsiAnnotation psiAnnotation) {<NEW_LINE>LombokLightMethodBuilder methodBuilder = new LombokLightMethodBuilder(psiClass.getManager(), staticName).withContainingClass(psiClass).withNavigationElement(psiAnnotation).withModifier(methodModifier).withModifier(PsiModifier.STATIC);<NEW_LINE>PsiSubstitutor substitutor = PsiSubstitutor.EMPTY;<NEW_LINE>if (psiClass.hasTypeParameters()) {<NEW_LINE>final PsiTypeParameter[] classTypeParameters = psiClass.getTypeParameters();<NEW_LINE>// need to create new type parameters<NEW_LINE>for (int index = 0; index < classTypeParameters.length; index++) {<NEW_LINE><MASK><NEW_LINE>final LightTypeParameterBuilder methodTypeParameter = createTypeParameter(methodBuilder, index, classTypeParameter);<NEW_LINE>methodBuilder.withTypeParameter(methodTypeParameter);<NEW_LINE>substitutor = substitutor.put(classTypeParameter, PsiSubstitutor.EMPTY.substitute(methodTypeParameter));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final PsiElementFactory factory = JavaPsiFacade.getElementFactory(psiClass.getProject());<NEW_LINE>final PsiType returnType = factory.createType(psiClass, substitutor);<NEW_LINE>methodBuilder.withMethodReturnType(returnType);<NEW_LINE>if (!useJavaDefaults) {<NEW_LINE>for (PsiField param : params) {<NEW_LINE>final String parameterName = StringUtil.notNullize(param.getName());<NEW_LINE>final PsiType parameterType = substitutor.substitute(param.getType());<NEW_LINE>final LombokLightParameter parameter = new LombokLightParameter(parameterName, parameterType, methodBuilder);<NEW_LINE>methodBuilder.withParameter(parameter);<NEW_LINE>copyCopyableAnnotations(param, parameter.getModifierList(), LombokUtils.BASE_COPYABLE_ANNOTATIONS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String codeBlockText = createStaticCodeBlockText(returnType, useJavaDefaults, methodBuilder.getParameterList());<NEW_LINE>methodBuilder.withBody(PsiMethodUtil.createCodeBlockFromText(codeBlockText, methodBuilder));<NEW_LINE>return methodBuilder;<NEW_LINE>}
final PsiTypeParameter classTypeParameter = classTypeParameters[index];
1,817,848
public static AuthenticatedUser load(Map<String, ByteBuffer> customPayload) {<NEW_LINE>ByteBuffer token = customPayload.get(TOKEN);<NEW_LINE>ByteBuffer roleName = customPayload.get(ROLE);<NEW_LINE>ByteBuffer isFromExternalAuth = customPayload.get(EXTERNAL);<NEW_LINE>if (token == null || roleName == null) {<NEW_LINE>throw new IllegalStateException("token and roleName must be provided");<NEW_LINE>}<NEW_LINE>ImmutableMap.Builder<String, String> map = ImmutableMap.builder();<NEW_LINE>for (Entry<String, ByteBuffer> e : customPayload.entrySet()) {<NEW_LINE><MASK><NEW_LINE>if (key.startsWith(CUSTOM_PAYLOAD_NAME_PREFIX)) {<NEW_LINE>String name = key.substring(CUSTOM_PAYLOAD_NAME_PREFIX.length());<NEW_LINE>String value = StandardCharsets.UTF_8.decode(e.getValue()).toString();<NEW_LINE>map.put(name, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return AuthenticatedUser.of(StandardCharsets.UTF_8.decode(roleName).toString(), StandardCharsets.UTF_8.decode(token).toString(), (isFromExternalAuth != null), map.build());<NEW_LINE>}
String key = e.getKey();
536,372
private void createNewTableEntry(String tableName, ADDataElement data2, Vector<String> keyColumnNames2, Vector<Column> columns) throws SQLException {<NEW_LINE>String insertStatement = "INSERT INTO " + tableName + "(";<NEW_LINE>for (int i = 0; i < columns.size(); i++) {<NEW_LINE>if (i != 0) {<NEW_LINE>insertStatement += ",";<NEW_LINE>}<NEW_LINE>insertStatement += columns.get(i).getColumnName();<NEW_LINE>}<NEW_LINE>insertStatement += ")values(";<NEW_LINE>for (int i = 0; i < columns.size(); i++) {<NEW_LINE>if (i != 0) {<NEW_LINE>insertStatement += ",";<NEW_LINE>}<NEW_LINE>// get the column (type/name) for the actual dataelement<NEW_LINE>String type = columns.get(i).getDataType();<NEW_LINE>String columnName = columns.get(i).getColumnName();<NEW_LINE>int precision = columns.get(i).getDataPrecision();<NEW_LINE>int scale = columns.get(i).getDataScale();<NEW_LINE>if (data2.getValueForColumn(columnName) == null) {<NEW_LINE>insertStatement += "null";<NEW_LINE>} else {<NEW_LINE>if (type.equals("BLOB")) {<NEW_LINE>// I'm not shure but I think just do it with ''<NEW_LINE>insertStatement += "'" + data2.getValueForColumn(columnName).replaceAll("'", "''") + "'";<NEW_LINE>} else if (type.equals("RAW")) {<NEW_LINE>// I don't know.... //TODO<NEW_LINE>} else if (type.equals("CLOB")) {<NEW_LINE>insertStatement += "'" + data2.getValueForColumn(columnName).replaceAll("'", "''") + "'";<NEW_LINE>} else if (type.equals("CHAR") || type.equals("NCHAR") || type.equals("NVARCHAR2") || type.equals("VARCHAR2")) {<NEW_LINE>insertStatement += "'" + data2.getValueForColumn(columnName).replaceAll("'", "''") + "'";<NEW_LINE>} else if (type.equals("DATE")) {<NEW_LINE>String <MASK><NEW_LINE>if (date.indexOf(' ') != -1) {<NEW_LINE>date = date.substring(0, date.indexOf(' '));<NEW_LINE>}<NEW_LINE>insertStatement += "to_date('" + date + "','" + TIME_FORMAT + "')";<NEW_LINE>} else if (type.equals("NUMBER")) {<NEW_LINE>if (scale == 0) {<NEW_LINE>insertStatement += data2.getValueForColumn(columnName);<NEW_LINE>} else {<NEW_LINE>insertStatement += data2.getValueForColumn(columnName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>insertStatement += ");";<NEW_LINE>m_newTableEntry.add(insertStatement);<NEW_LINE>}
date = data2.getValueForColumn(columnName);
1,209,799
public void incrementHeadSequenceNumber(ConcurrentSubList.Link link) throws ObjectManagerException {<NEW_LINE>if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())<NEW_LINE>trace.entry(this, cclass, "incrementheadSequenceNumber", new Object[] { link });<NEW_LINE>if (link.next == null) {<NEW_LINE>// This subList is now empty.<NEW_LINE>// Look at another list next time.<NEW_LINE>headSequenceNumber++;<NEW_LINE>} else {<NEW_LINE>// Still more links in this subList.<NEW_LINE>ConcurrentSubList.Link nextLink = (ConcurrentSubList.Link) link.next.getManagedObject();<NEW_LINE>// If insertion into the body of the list has taken place,<NEW_LINE>// then a sequenceNumber will have been duplicated.<NEW_LINE>if (nextLink.sequenceNumber != headSequenceNumber)<NEW_LINE>headSequenceNumber++;<NEW_LINE>}<NEW_LINE>// if( firstLink.next == null).<NEW_LINE>if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())<NEW_LINE>trace.exit(this, cclass, "incrementHeadSequenceNumber", new Object[] <MASK><NEW_LINE>}
{ new Long(headSequenceNumber) });
991,316
private AuthenticationResult processPasswordMessage(final ChannelHandlerContext context, final PostgreSQLPacketPayload payload) {<NEW_LINE>char messageType = (char) payload.readInt1();<NEW_LINE>if (PostgreSQLMessagePacketType.PASSWORD_MESSAGE.getValue() != messageType) {<NEW_LINE>throw new PostgreSQLProtocolViolationException("password", Character.toString(messageType));<NEW_LINE>}<NEW_LINE>PostgreSQLPasswordMessagePacket passwordMessagePacket = new PostgreSQLPasswordMessagePacket(payload);<NEW_LINE>PostgreSQLLoginResult loginResult = authenticationHandler.login(currentAuthResult.getUsername(), currentAuthResult.getDatabase(), md5Salt, passwordMessagePacket);<NEW_LINE>if (PostgreSQLErrorCode.SUCCESSFUL_COMPLETION != loginResult.getErrorCode()) {<NEW_LINE>throw new PostgreSQLAuthenticationException(loginResult.getErrorCode(), loginResult.getErrorMessage());<NEW_LINE>}<NEW_LINE>// TODO implement PostgreSQLServerInfo like MySQLServerInfo<NEW_LINE>context.write(new PostgreSQLAuthenticationOKPacket());<NEW_LINE>context.write(new PostgreSQLParameterStatusPacket("server_version", PostgreSQLServerInfo.getServerVersion()));<NEW_LINE>context.write(new PostgreSQLParameterStatusPacket("client_encoding", clientEncoding));<NEW_LINE>context.write(new PostgreSQLParameterStatusPacket("server_encoding", "UTF8"));<NEW_LINE>context.write(<MASK><NEW_LINE>context.writeAndFlush(PostgreSQLReadyForQueryPacket.NOT_IN_TRANSACTION);<NEW_LINE>return AuthenticationResultBuilder.finished(currentAuthResult.getUsername(), "", currentAuthResult.getDatabase());<NEW_LINE>}
new PostgreSQLParameterStatusPacket("integer_datetimes", "on"));
244,487
public void showURL(URL url) {<NEW_LINE>String urls = url.toString();<NEW_LINE>if (urls.startsWith("file://instance/")) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>urls = urls.substring("file://instance/".length());<NEW_LINE>// NOI18N<NEW_LINE>String[] id = urls.split("/");<NEW_LINE>JavaClass c = heapFragmentWalker.getHeapFragment().getJavaClassByName(id[0]);<NEW_LINE>if (c != null) {<NEW_LINE>List<Instance> instances = c.getInstances();<NEW_LINE>Instance i = null;<NEW_LINE>int instanceNumber = Integer.parseInt(id[1]);<NEW_LINE>if (instanceNumber <= instances.size())<NEW_LINE>i = instances.get(instanceNumber - 1);<NEW_LINE>if (i != null) {<NEW_LINE>heapFragmentWalker.<MASK><NEW_LINE>} else {<NEW_LINE>ProfilerDialogs.displayError(Bundle.AnalysisController_CannotResolveInstanceMsg(id[1], c.getName()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ProfilerDialogs.displayError(Bundle.AnalysisController_CannotResolveClassMsg(id[0]));<NEW_LINE>}<NEW_LINE>} else if (urls.startsWith("file://class/")) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>urls = urls.substring("file://class/".length());<NEW_LINE>JavaClass c = heapFragmentWalker.getHeapFragment().getJavaClassByName(urls);<NEW_LINE>if (c != null) {<NEW_LINE>heapFragmentWalker.getClassesController().showClass(c);<NEW_LINE>} else {<NEW_LINE>ProfilerDialogs.displayError(Bundle.AnalysisController_CannotResolveClassMsg(urls));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getClassesController().showInstance(i);
1,691,634
protected boolean canHandle(Network network, Service service) {<NEW_LINE>s_logger.debug("Checking if NiciraNvpElement can handle service " + service.getName() + <MASK><NEW_LINE>if (network.getBroadcastDomainType() != BroadcastDomainType.Lswitch) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!networkModel.isProviderForNetwork(getProvider(), network.getId())) {<NEW_LINE>s_logger.debug("NiciraNvpElement is not a provider for network " + network.getDisplayText());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!ntwkSrvcDao.canProviderSupportServiceInNetwork(network.getId(), service, Network.Provider.NiciraNvp)) {<NEW_LINE>s_logger.debug("NiciraNvpElement can't provide the " + service.getName() + " service on network " + network.getDisplayText());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
" on network " + network.getDisplayText());
1,110,609
private synchronized void doAddUninitializedPanes() {<NEW_LINE>for (AbstractProjectViewPane pane : myUninitializedPanes) {<NEW_LINE>doAddPane(pane);<NEW_LINE>}<NEW_LINE>final Content[] contents = getContentManager().getContents();<NEW_LINE>for (int i = 1; i < contents.length; i++) {<NEW_LINE>Content content = contents[i];<NEW_LINE>Content <MASK><NEW_LINE>if (!StringUtil.equals(content.getUserData(ID_KEY), prev.getUserData(ID_KEY)) && prev.getUserData(SUB_ID_KEY) != null && content.getSeparator() == null) {<NEW_LINE>content.setSeparator("");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String selectID = null;<NEW_LINE>String selectSubID = null;<NEW_LINE>// try to find saved selected view...<NEW_LINE>for (Content content : contents) {<NEW_LINE>final String id = content.getUserData(ID_KEY);<NEW_LINE>final String subId = content.getUserData(SUB_ID_KEY);<NEW_LINE>if (id != null && id.equals(mySavedPaneId) && StringUtil.equals(subId, mySavedPaneSubId)) {<NEW_LINE>selectID = id;<NEW_LINE>selectSubID = subId;<NEW_LINE>mySavedPaneId = null;<NEW_LINE>mySavedPaneSubId = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// saved view not found (plugin disabled, ID changed etc.) - select first available view...<NEW_LINE>if (selectID == null && contents.length > 0 && myCurrentViewId == null) {<NEW_LINE>Content content = contents[0];<NEW_LINE>selectID = content.getUserData(ID_KEY);<NEW_LINE>selectSubID = content.getUserData(SUB_ID_KEY);<NEW_LINE>}<NEW_LINE>if (selectID != null) {<NEW_LINE>changeView(selectID, selectSubID);<NEW_LINE>}<NEW_LINE>myUninitializedPanes.clear();<NEW_LINE>}
prev = contents[i - 1];
886,729
public void refreshSharesFromDB() {<NEW_LINE>ShareeListAdapter adapter = (ShareeListAdapter) binding.sharesList.getAdapter();<NEW_LINE>if (adapter == null) {<NEW_LINE>DisplayUtils.showSnackMessage(getView(), getString(R.string.could_not_retrieve_shares));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>adapter.getShares().clear();<NEW_LINE>// to show share with users/groups info<NEW_LINE>List<OCShare> shares = fileDataStorageManager.getSharesWithForAFile(file.getRemotePath(<MASK><NEW_LINE>adapter.addShares(shares);<NEW_LINE>if (FileDetailSharingFragmentHelper.isPublicShareDisabled(capabilities) || !file.canReshare()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get public share<NEW_LINE>List<OCShare> publicShares = fileDataStorageManager.getSharesByPathAndType(file.getRemotePath(), ShareType.PUBLIC_LINK, "");<NEW_LINE>if (publicShares.isEmpty() && containsNoNewPublicShare(adapter.getShares())) {<NEW_LINE>final OCShare ocShare = new OCShare();<NEW_LINE>ocShare.setShareType(ShareType.NEW_PUBLIC_LINK);<NEW_LINE>publicShares.add(ocShare);<NEW_LINE>} else {<NEW_LINE>adapter.removeNewPublicShare();<NEW_LINE>}<NEW_LINE>adapter.addShares(publicShares);<NEW_LINE>}
), user.getAccountName());
1,005,629
public void verify() throws ActionException {<NEW_LINE>EditTextElementData colValData = getEditTextElementData();<NEW_LINE>Locale locale = (Locale) getReportContext().getParameterValue(JRParameter.REPORT_LOCALE);<NEW_LINE>if (locale == null) {<NEW_LINE>locale = Locale.getDefault();<NEW_LINE>}<NEW_LINE>if (colValData.getFontSize() != null) {<NEW_LINE>try {<NEW_LINE>NumberFormat numberFormat = NumberFormat.getNumberInstance(locale);<NEW_LINE>ParsePosition pp = new ParsePosition(0);<NEW_LINE>Number formattedNumber = numberFormat.parse(colValData.getFontSize(), pp);<NEW_LINE>if (formattedNumber != null && pp.getIndex() == colValData.getFontSize().length()) {<NEW_LINE>colValData.setFloatFontSize(formattedNumber.floatValue());<NEW_LINE>} else {<NEW_LINE>errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.edit.values.invalid.font.size", colValData.getFontSize());<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>errors.addAndThrow(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>JRDesignTextElement textField = getTargetTextElement();<NEW_LINE>if (textField instanceof JRDesignTextField && TableUtil.hasSingleChunkExpression((JRDesignTextField) textField)) {<NEW_LINE>JRDesignDatasetRun datasetRun = (JRDesignDatasetRun) table.getDatasetRun();<NEW_LINE>String datasetName = datasetRun.getDatasetName();<NEW_LINE>JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext());<NEW_LINE>JasperDesign jasperDesign = cache.getJasperDesign(targetUri);<NEW_LINE>JRDesignDataset dataset = (JRDesignDataset) jasperDesign.getDatasetMap().get(datasetName);<NEW_LINE>String textFieldName = ((JRDesignTextField) textField).getExpression().getChunks()[0].getText();<NEW_LINE>FilterTypesEnum filterType = null;<NEW_LINE>for (JRField field : dataset.getFields()) {<NEW_LINE>if (textFieldName.equals(field.getName())) {<NEW_LINE>filterType = HeaderToolbarElementUtils.getFilterType(field.getValueClass());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (filterType != null) {<NEW_LINE>if (filterType.equals(FilterTypesEnum.DATE)) {<NEW_LINE>try {<NEW_LINE>formatFactory.createDateFormat(colValData.getFormatPattern(), locale, null);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.edit.column.values.invalid.date.pattern", new Object[] { colValData.getFormatPattern() });<NEW_LINE>}<NEW_LINE>} else if (filterType.equals(FilterTypesEnum.NUMERIC)) {<NEW_LINE>try {<NEW_LINE>formatFactory.createNumberFormat(colValData.getFormatPattern(), locale);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>errors.addAndThrow("net.sf.jasperreports.components.headertoolbar.actions.edit.column.values.invalid.number.pattern", new Object[] { colValData.getFormatPattern() });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"net.sf.jasperreports.components.headertoolbar.actions.edit.values.invalid.font.size", colValData.getFontSize());
1,758,161
public static ParserRuleContext parse(BatfishCombinedParser<?, ?> parser, BatfishLogger logger, GrammarSettings settings) {<NEW_LINE>ParserRuleContext tree;<NEW_LINE>try {<NEW_LINE>tree = parser.parse();<NEW_LINE>} catch (BatfishException e) {<NEW_LINE>throw new ParserBatfishException("Parser error", e);<NEW_LINE>}<NEW_LINE>List<String<MASK><NEW_LINE>int numErrors = errors.size();<NEW_LINE>if (numErrors > 0) {<NEW_LINE>throw new ParserBatfishException("Parser error(s)", errors);<NEW_LINE>} else if (!settings.getPrintParseTree()) {<NEW_LINE>logger.info("OK\n");<NEW_LINE>} else {<NEW_LINE>logger.info("OK, PRINTING PARSE TREE:\n");<NEW_LINE>logger.info(ParseTreePrettyPrinter.print(tree, parser, settings.getPrintParseTreeLineNums()) + "\n\n");<NEW_LINE>}<NEW_LINE>return tree;<NEW_LINE>}
> errors = parser.getErrors();
1,128,964
protected VirtualizerStore store(JRVirtualizationContext context, boolean create) {<NEW_LINE>VirtualizerStore store;<NEW_LINE>synchronized (contextStores) {<NEW_LINE>store = contextStores.get(context);<NEW_LINE>}<NEW_LINE>if (store != null || !create) {<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace(<MASK><NEW_LINE>}<NEW_LINE>return store;<NEW_LINE>}<NEW_LINE>// the context should be locked at this moment<NEW_LINE>store = storeFactory.createStore(context);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("created " + store + " for " + context);<NEW_LINE>}<NEW_LINE>// TODO lucianc<NEW_LINE>// do we need to keep a weak reference to the context, and dispose the store when the reference is cleared?<NEW_LINE>// not doing that for now, assuming that store objects are disposed when garbage collected.<NEW_LINE>synchronized (contextStores) {<NEW_LINE>contextStores.put(context, store);<NEW_LINE>}<NEW_LINE>return store;<NEW_LINE>}
"found " + store + " for " + context);
1,481,272
public void run(RegressionEnvironment env) {<NEW_LINE>// Bean<NEW_LINE>Consumer<String[]> bean = array -> {<NEW_LINE>env.sendEventBean(new LocalEvent(array));<NEW_LINE>};<NEW_LINE>String beanepl = "@public @buseventtype create schema LocalEvent as " + LocalEvent.class.getName() + ";\n";<NEW_LINE>runAssertion(env, beanepl, bean);<NEW_LINE>// Map<NEW_LINE>Consumer<String[]> map = array -> {<NEW_LINE>env.sendEventMap(Collections.singletonMap("array", array), "LocalEvent");<NEW_LINE>};<NEW_LINE>String mapepl = "@public @buseventtype create schema LocalEvent(array string[]);\n";<NEW_LINE>runAssertion(env, mapepl, map);<NEW_LINE>// Object-array<NEW_LINE>Consumer<String[]> oa = array -> {<NEW_LINE>env.sendEventObjectArray(new Object[] { array }, "LocalEvent");<NEW_LINE>};<NEW_LINE>String oaepl = "@public @buseventtype create objectarray schema LocalEvent(array string[]);\n";<NEW_LINE>runAssertion(env, oaepl, oa);<NEW_LINE>// Json<NEW_LINE>Consumer<String[]> json = array -> {<NEW_LINE>if (array == null) {<NEW_LINE>env.sendEventJson(new JsonObject().add("array", Json.NULL).toString(), "LocalEvent");<NEW_LINE>} else {<NEW_LINE>JsonObject event = new JsonObject();<NEW_LINE>JsonArray jsonarray = new JsonArray();<NEW_LINE>event.add("array", jsonarray);<NEW_LINE>for (String string : array) {<NEW_LINE>jsonarray.add(string);<NEW_LINE>}<NEW_LINE>env.sendEventJson(event.toString(), "LocalEvent");<NEW_LINE>}<NEW_LINE>};<NEW_LINE>runAssertion(env, "@public @buseventtype create json schema LocalEvent(array string[]);\n", json);<NEW_LINE>// Json-Class-Provided<NEW_LINE>runAssertion(env, "@JsonSchema(className='" + MyLocalJsonProvided.class.getName() + "') @public @buseventtype create json schema LocalEvent();\n", json);<NEW_LINE>// Avro<NEW_LINE>Consumer<String[]> avro = array -> {<NEW_LINE>Schema schema = env.runtimeAvroSchemaByDeployment("schema", "LocalEvent");<NEW_LINE>GenericData.Record event = new GenericData.Record(schema);<NEW_LINE>event.put("array", array == null ? Collections.emptyList() <MASK><NEW_LINE>env.sendEventAvro(event, "LocalEvent");<NEW_LINE>};<NEW_LINE>runAssertion(env, "@name('schema') @public @buseventtype create avro schema LocalEvent(array string[]);\n", avro);<NEW_LINE>}
: Arrays.asList(array));
1,584,801
public static DescribePropertyCronDetailResponse unmarshall(DescribePropertyCronDetailResponse describePropertyCronDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePropertyCronDetailResponse.setRequestId(_ctx.stringValue("DescribePropertyCronDetailResponse.RequestId"));<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setCount(_ctx.integerValue("DescribePropertyCronDetailResponse.PageInfo.Count"));<NEW_LINE>pageInfo.setPageSize(_ctx.integerValue("DescribePropertyCronDetailResponse.PageInfo.PageSize"));<NEW_LINE>pageInfo.setTotalCount(_ctx.integerValue("DescribePropertyCronDetailResponse.PageInfo.TotalCount"));<NEW_LINE>pageInfo.setCurrentPage(_ctx.integerValue("DescribePropertyCronDetailResponse.PageInfo.CurrentPage"));<NEW_LINE>describePropertyCronDetailResponse.setPageInfo(pageInfo);<NEW_LINE>List<PropertyCron> propertys <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePropertyCronDetailResponse.Propertys.Length"); i++) {<NEW_LINE>PropertyCron propertyCron = new PropertyCron();<NEW_LINE>propertyCron.setInstanceName(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].InstanceName"));<NEW_LINE>propertyCron.setIp(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Ip"));<NEW_LINE>propertyCron.setCreate(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Create"));<NEW_LINE>propertyCron.setCreateTimestamp(_ctx.longValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].CreateTimestamp"));<NEW_LINE>propertyCron.setUuid(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Uuid"));<NEW_LINE>propertyCron.setInstanceId(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].InstanceId"));<NEW_LINE>propertyCron.setIntranetIp(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].IntranetIp"));<NEW_LINE>propertyCron.setInternetIp(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].InternetIp"));<NEW_LINE>propertyCron.setPeriod(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Period"));<NEW_LINE>propertyCron.setSource(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Source"));<NEW_LINE>propertyCron.setCmd(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Cmd"));<NEW_LINE>propertyCron.setUser(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].User"));<NEW_LINE>propertyCron.setMd5(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Md5"));<NEW_LINE>propertys.add(propertyCron);<NEW_LINE>}<NEW_LINE>describePropertyCronDetailResponse.setPropertys(propertys);<NEW_LINE>return describePropertyCronDetailResponse;<NEW_LINE>}
= new ArrayList<PropertyCron>();
396,933
public void failoverMaster(String masterHost) {<NEW_LINE>if (StringUtils.isEmpty(masterHost)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Date serverStartupTime = getServerStartupTime(NodeType.MASTER, masterHost);<NEW_LINE>List<Server> workerServers = registryClient.getServerList(NodeType.WORKER);<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>List<ProcessInstance> needFailoverProcessInstanceList = processService.queryNeedFailoverProcessInstances(masterHost);<NEW_LINE>logger.info("start master[{}] failover, process list size:{}", masterHost, needFailoverProcessInstanceList.size());<NEW_LINE>for (ProcessInstance processInstance : needFailoverProcessInstanceList) {<NEW_LINE>if (Constants.NULL.equals(processInstance.getHost())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<TaskInstance> validTaskInstanceList = processService.<MASK><NEW_LINE>for (TaskInstance taskInstance : validTaskInstanceList) {<NEW_LINE>if (Constants.NULL.equals(taskInstance.getHost())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (taskInstance.getState().typeIsFinished()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!checkTaskInstanceNeedFailover(workerServers, taskInstance)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>logger.info("failover task instance id: {}, process instance id: {}", taskInstance.getId(), taskInstance.getProcessInstanceId());<NEW_LINE>failoverTaskInstance(processInstance, taskInstance);<NEW_LINE>}<NEW_LINE>if (serverStartupTime != null && processInstance.getRestartTime() != null && processInstance.getRestartTime().after(serverStartupTime)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>logger.info("failover process instance id: {}", processInstance.getId());<NEW_LINE>// updateProcessInstance host is null and insert into command<NEW_LINE>processService.processNeedFailoverProcessInstances(processInstance);<NEW_LINE>}<NEW_LINE>logger.info("master[{}] failover end, useTime:{}ms", masterHost, System.currentTimeMillis() - startTime);<NEW_LINE>}
findValidTaskListByProcessId(processInstance.getId());
824,057
private void initDb() {<NEW_LINE>System.out.println("****** Inserting more sample data in the table: Employees ******");<NEW_LINE>String[] sqlStatements = { "insert into employees(first_name, last_name) values('Donald','Trump')", "insert into employees(first_name, last_name) values('Barack','Obama')" };<NEW_LINE>Arrays.asList(sqlStatements).stream().forEach(sql -> {<NEW_LINE><MASK><NEW_LINE>jdbcTemplate.execute(sql);<NEW_LINE>});<NEW_LINE>System.out.println(String.format("****** Fetching from table: %s ******", "Employees"));<NEW_LINE>jdbcTemplate.query("select id,first_name,last_name from employees", new RowMapper<Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object mapRow(ResultSet rs, int i) throws SQLException {<NEW_LINE>System.out.println(String.format("id:%s,first_name:%s,last_name:%s", rs.getString("id"), rs.getString("first_name"), rs.getString("last_name")));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
System.out.println(sql);
163,742
void createWorkScene(SceneWorkingGraph src, SceneWorkingGraph dst) {<NEW_LINE>BoofMiscOps.checkTrue(!commonViews.isEmpty());<NEW_LINE>// Local copy of the 'src' scene<NEW_LINE>workScene.setTo(src);<NEW_LINE>// All views and cameras that are in 'src' will be modified<NEW_LINE>knownViews.resetResize(workScene.<MASK><NEW_LINE>knownCameras.resetResize(workScene.listCameras.size(), false);<NEW_LINE>// Copy cameras from 'dst' into the workScene<NEW_LINE>copyDstCamerasIntoWork(dst);<NEW_LINE>// Change the scene's coordinate system and scale factor to match 'dst'<NEW_LINE>for (int i = 0; i < workScene.listViews.size(); i++) {<NEW_LINE>convertNewViewCoordinateSystem(workScene.listViews.get(i));<NEW_LINE>}<NEW_LINE>// Go through the common views and copy the state from 'dst' into it. This includes the inlier<NEW_LINE>// sets from 'dst'. As needed, views in 'dst' will be added to the scene buy they will be "known"<NEW_LINE>for (int i = 0; i < commonViews.size; i++) {<NEW_LINE>SceneWorkingGraph.View viewDst = commonViews.get(i).dst;<NEW_LINE>SceneWorkingGraph.View wview = workScene.lookupView(viewDst.pview.id);<NEW_LINE>// Force the common views to match 'dst'<NEW_LINE>wview.world_to_view.setTo(viewDst.world_to_view);<NEW_LINE>// Add inliers from 'dst'<NEW_LINE>DogArray<SceneWorkingGraph.InlierInfo> inliersDst = commonViews.get(i).dst.inliers;<NEW_LINE>// Copy over the inlier information so that features can be triangulated<NEW_LINE>for (int infoIdx = 0; infoIdx < inliersDst.size; infoIdx++) {<NEW_LINE>SceneWorkingGraph.InlierInfo orig = inliersDst.get(infoIdx);<NEW_LINE>SceneWorkingGraph.InlierInfo copy = wview.inliers.grow();<NEW_LINE>copy.setTo(orig);<NEW_LINE>addViewsButNoInliers(dst, orig.views, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
listViews.size(), false);
279,307
public CommandResult process(CommandSource source, String arguments) {<NEW_LINE>CommandSender commandSender = new SpongeCommandSender(source);<NEW_LINE>GeyserSession session = getGeyserSession(commandSender);<NEW_LINE>String[] args = arguments.split(" ");<NEW_LINE>if (args.length > 0) {<NEW_LINE>GeyserCommand command = getCommand(args[0]);<NEW_LINE>if (command != null) {<NEW_LINE>if (!source.hasPermission(command.getPermission())) {<NEW_LINE>// Not ideal to use log here but we dont get a session<NEW_LINE>source.sendMessage(Text.of(ChatColor.RED + GeyserLocale.getLocaleStringLog("geyser.bootstrap.command.permission_fail")));<NEW_LINE>return CommandResult.success();<NEW_LINE>}<NEW_LINE>if (command.isBedrockOnly() && session == null) {<NEW_LINE>source.sendMessage(Text.of(ChatColor.RED + GeyserLocale.getLocaleStringLog("geyser.bootstrap.command.bedrock_only")));<NEW_LINE>return CommandResult.success();<NEW_LINE>}<NEW_LINE>getCommand(args[0]).execute(session, commandSender, args.length > 1 ? Arrays.copyOfRange(args, 1, args.length) : new String[0]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>getCommand("help").execute(session, <MASK><NEW_LINE>}<NEW_LINE>return CommandResult.success();<NEW_LINE>}
commandSender, new String[0]);
78,805
public void update(final DatabaseInfo databaseInfo) {<NEW_LINE>log.debug("Start: Database update using direct sql for {}", databaseInfo.getName());<NEW_LINE>final long start = registry.clock().wallTime();<NEW_LINE>try {<NEW_LINE>final Long databaseId = getDatabaseId(databaseInfo.getName());<NEW_LINE>final DatabaseInfo existingDatabaseInfo = getDatabaseById(databaseId, databaseInfo.getName());<NEW_LINE>final Map<String, String> newMetadata = databaseInfo.getMetadata() == null ? Maps.newHashMap() : databaseInfo.getMetadata();<NEW_LINE>final MapDifference<String, String> diff = Maps.difference(existingDatabaseInfo.getMetadata(), newMetadata);<NEW_LINE>insertDatabaseParams(databaseId, diff.entriesOnlyOnRight());<NEW_LINE>final Map<String, String> updateParams = diff.entriesDiffering().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, s -> s.getValue().rightValue()));<NEW_LINE>updateDatabaseParams(databaseId, updateParams);<NEW_LINE>final String uri = Strings.isNullOrEmpty(databaseInfo.getUri()) ? existingDatabaseInfo.getUri() : databaseInfo.getUri();<NEW_LINE>final String newOwner = getOwner(databaseInfo.getAudit());<NEW_LINE>final String owner = Strings.isNullOrEmpty(newOwner) ? newOwner : existingDatabaseInfo.getAudit().getCreatedBy();<NEW_LINE>jdbcTemplate.update(SQL.UPDATE_DATABASE, new SqlParameterValue(Types.VARCHAR, uri), new SqlParameterValue(Types.VARCHAR, owner), new SqlParameterValue<MASK><NEW_LINE>} finally {<NEW_LINE>this.fastServiceMetric.recordTimer(HiveMetrics.TagAlterDatabase.getMetricName(), registry.clock().wallTime() - start);<NEW_LINE>log.debug("End: Database update using direct sql for {}", databaseInfo.getName());<NEW_LINE>}<NEW_LINE>}
(Types.BIGINT, databaseId));
563,391
public static void main(String... args) {<NEW_LINE>// Clear saved state for new calls.<NEW_LINE>tree = TreeMultimap.create();<NEW_LINE>astLookup = Sets.newHashSet();<NEW_LINE>ClassPath cp = null;<NEW_LINE>try {<NEW_LINE>cp = ClassPath.from(ClassLoader.getSystemClassLoader());<NEW_LINE>} catch (IOException e) {<NEW_LINE>ErrorUtil.error(e.getMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>for (ClassInfo c : cp.getTopLevelClasses("org.eclipse.jdt.core.dom")) {<NEW_LINE>astLookup.<MASK><NEW_LINE>}<NEW_LINE>for (ClassInfo ci : cp.getTopLevelClasses("com.google.devtools.j2objc.ast")) {<NEW_LINE>// Ignore package-info and JUnit tests.<NEW_LINE>if (ci.getSimpleName().equals("package-info") || TestCase.class.isAssignableFrom(ci.load())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>walkSuperclassHierarchy(ci.load());<NEW_LINE>}<NEW_LINE>// Print hierarchy descending from Object.<NEW_LINE>printClassHierarchy("Object", "");<NEW_LINE>}
add(c.getSimpleName());
331,361
private void processOldEntry(RobotsTxtEntry robotsTxt4Host, DigestURL robotsURL, BEncodedHeap robotsTable) {<NEW_LINE>// no robots.txt available, make an entry to prevent that the robots loading is done twice<NEW_LINE>if (robotsTxt4Host == null) {<NEW_LINE>// generate artificial entry<NEW_LINE>robotsTxt4Host = new RobotsTxtEntry(robotsURL, new ArrayList<String>(), new ArrayList<String>(), new Date(), new Date(), null, null, Integer<MASK><NEW_LINE>} else {<NEW_LINE>robotsTxt4Host.setLoadedDate(new Date());<NEW_LINE>}<NEW_LINE>// store the data into the robots DB<NEW_LINE>final int sz = robotsTable.size();<NEW_LINE>this.addEntry(robotsTxt4Host);<NEW_LINE>if (robotsTable.size() <= sz) {<NEW_LINE>log.severe("new entry in robots.txt table failed, resetting database");<NEW_LINE>try {<NEW_LINE>this.clear();<NEW_LINE>} catch (final IOException e) {<NEW_LINE>}<NEW_LINE>this.addEntry(robotsTxt4Host);<NEW_LINE>}<NEW_LINE>}
.valueOf(0), null);
1,560,440
private static HttpHeaders buildHeaders(ApiResource.RequestMethod method, RequestOptions options) throws AuthenticationException {<NEW_LINE>Map<String, List<String>> headerMap = new HashMap<String, List<String>>();<NEW_LINE>// Accept<NEW_LINE>headerMap.put("Accept", Arrays.asList("application/json"));<NEW_LINE>// Accept-Charset<NEW_LINE>headerMap.put("Accept-Charset", Arrays.asList(ApiResource.CHARSET.name()));<NEW_LINE>// Authorization<NEW_LINE>String apiKey = options.getApiKey();<NEW_LINE>if (apiKey == null) {<NEW_LINE>throw new AuthenticationException("No API key provided. Set your API key using `Stripe.apiKey = \"<API-KEY>\"`. You can " + "generate API keys from the Stripe Dashboard. See " + "https://stripe.com/docs/api/authentication for details or contact support at " + "https://support.stripe.com/email if you have any questions.", null, null, 0);<NEW_LINE>} else if (apiKey.isEmpty()) {<NEW_LINE>throw new AuthenticationException("Your API key is invalid, as it is an empty string. You can double-check your API key " + "from the Stripe Dashboard. See " + "https://stripe.com/docs/api/authentication for details or contact support at " + "https://support.stripe.com/email if you have any questions.", null, null, 0);<NEW_LINE>} else if (StringUtils.containsWhitespace(apiKey)) {<NEW_LINE>throw new AuthenticationException("Your API key is invalid, as it contains whitespace. You can double-check your API key " + "from the Stripe Dashboard. See " + "https://stripe.com/docs/api/authentication for details or contact support at " + <MASK><NEW_LINE>}<NEW_LINE>headerMap.put("Authorization", Arrays.asList(String.format("Bearer %s", apiKey)));<NEW_LINE>// Stripe-Version<NEW_LINE>if (options.getStripeVersionOverride() != null) {<NEW_LINE>headerMap.put("Stripe-Version", Arrays.asList(options.getStripeVersionOverride()));<NEW_LINE>} else if (options.getStripeVersion() != null) {<NEW_LINE>headerMap.put("Stripe-Version", Arrays.asList(options.getStripeVersion()));<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Either `stripeVersion` or `stripeVersionOverride` value must be set.");<NEW_LINE>}<NEW_LINE>// Stripe-Account<NEW_LINE>if (options.getStripeAccount() != null) {<NEW_LINE>headerMap.put("Stripe-Account", Arrays.asList(options.getStripeAccount()));<NEW_LINE>}<NEW_LINE>// Idempotency-Key<NEW_LINE>if (options.getIdempotencyKey() != null) {<NEW_LINE>headerMap.put("Idempotency-Key", Arrays.asList(options.getIdempotencyKey()));<NEW_LINE>} else if (method == ApiResource.RequestMethod.POST) {<NEW_LINE>headerMap.put("Idempotency-Key", Arrays.asList(UUID.randomUUID().toString()));<NEW_LINE>}<NEW_LINE>return HttpHeaders.of(headerMap);<NEW_LINE>}
"https://support.stripe.com/email if you have any questions.", null, null, 0);
553,534
protected void updateLocalizationDefinition(BaseLocalizationDefinition destinationLocalizationDefinition, TransactionCommon transaction) throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "updateLocalizationDefinition", new Object[] { destinationLocalizationDefinition, transaction });<NEW_LINE>// TODO close all consumer sessions?<NEW_LINE>if (isPubSub())<NEW_LINE>_pubSubRealization.updateLocalisationDefinition((LocalizationDefinition) destinationLocalizationDefinition);<NEW_LINE>else {<NEW_LINE>if (destinationLocalizationDefinition instanceof LocalizationDefinition) {<NEW_LINE>// this is an update of the existing PM localization<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>SIResourceException e = new SIResourceException(new UnsupportedOperationException());<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "updateLocalizationDefinition", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// update TRM if necessary<NEW_LINE>getLocalisationManager().updateTrmAdvertisements();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "updateLocalizationDefinition");<NEW_LINE>}
_ptoPRealization.updateLocalisationDefinition(destinationLocalizationDefinition, transaction);
32,170
private static void assertEventProps(RegressionEnvironment env, EventBean eventBean, String currSymbol, String prev0Symbol, Double prev0Price, String prev1Symbol, Double prev1Price, String prev2Symbol, Double prev2Price, String prevTail0Symbol, Double prevTail0Price, String prevTail1Symbol, Double prevTail1Price, Long prevCount, Object[] prevWindow) {<NEW_LINE>assertEquals(currSymbol, eventBean.get("currSymbol"));<NEW_LINE>assertEquals(prev0Symbol, eventBean.get("prev0Symbol"));<NEW_LINE>assertEquals(prev0Price, eventBean.get("prev0Price"));<NEW_LINE>assertEquals(prev1Symbol, eventBean.get("prev1Symbol"));<NEW_LINE>assertEquals(prev1Price, eventBean.get("prev1Price"));<NEW_LINE>assertEquals(prev2Symbol, eventBean.get("prev2Symbol"));<NEW_LINE>assertEquals(prev2Price, eventBean.get("prev2Price"));<NEW_LINE>assertEquals(prevTail0Symbol, eventBean.get("prevTail0Symbol"));<NEW_LINE>assertEquals(prevTail0Price, eventBean.get("prevTail0Price"));<NEW_LINE>assertEquals(prevTail1Symbol<MASK><NEW_LINE>assertEquals(prevTail1Price, eventBean.get("prevTail1Price"));<NEW_LINE>assertEquals(prevCount, eventBean.get("prevCountPrice"));<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder((Object[]) eventBean.get("prevWindowPrice"), prevWindow);<NEW_LINE>env.listenerReset("s0");<NEW_LINE>}
, eventBean.get("prevTail1Symbol"));
311,833
protected boolean writeAICCall(ConstructorCallExpression call) {<NEW_LINE>if (!call.isUsingAnonymousInnerClass())<NEW_LINE>return false;<NEW_LINE>ConstructorNode cn = call.getType().getDeclaredConstructors().get(0);<NEW_LINE>OperandStack os = controller.getOperandStack();<NEW_LINE>String ownerDescriptor = prepareConstructorCall(cn);<NEW_LINE>List<Expression> args = makeArgumentList(call.getArguments()).getExpressions();<NEW_LINE>Parameter[] params = cn.getParameters();<NEW_LINE>// if a this appears as parameter here, then it should be<NEW_LINE>// not static, unless we are in a static method. But since<NEW_LINE>// ACG#visitVariableExpression does the opposite for this case, we<NEW_LINE>// push here an explicit this. This should not have any negative effect<NEW_LINE>// sine visiting a method call or property with implicit this will push<NEW_LINE>// a new value for this again.<NEW_LINE>controller.getCompileStack().pushImplicitThis(true);<NEW_LINE>for (int i = 0; i < params.length; i++) {<NEW_LINE>Parameter p = params[i];<NEW_LINE>Expression arg = args.get(i);<NEW_LINE>if (arg instanceof VariableExpression) {<NEW_LINE>VariableExpression var = (VariableExpression) arg;<NEW_LINE>loadVariableWithReference(var);<NEW_LINE>} else {<NEW_LINE>arg.visit(controller.getAcg());<NEW_LINE>}<NEW_LINE>os.<MASK><NEW_LINE>}<NEW_LINE>controller.getCompileStack().popImplicitThis();<NEW_LINE>finnishConstructorCall(cn, ownerDescriptor, args.size());<NEW_LINE>return true;<NEW_LINE>}
doGroovyCast(p.getType());
701,646
private void syncRegistrarContacts(Registrar registrar) {<NEW_LINE>String groupKey = "";<NEW_LINE>try {<NEW_LINE>Set<RegistrarContact> registrarContacts = registrar.getContacts();<NEW_LINE>long totalAdded = 0;<NEW_LINE>long totalRemoved = 0;<NEW_LINE>for (final RegistrarContact.Type type : RegistrarContact.Type.values()) {<NEW_LINE>groupKey = getGroupEmailAddressForContactType(registrar.getRegistrarId(), type, gSuiteDomainName);<NEW_LINE>Set<String> currentMembers = groupsConnection.getMembersOfGroup(groupKey);<NEW_LINE>Set<String> desiredMembers = registrarContacts.stream().filter(contact -> contact.getTypes().contains(type)).map(RegistrarContact::getEmailAddress).collect(toImmutableSet());<NEW_LINE>for (String email : Sets.difference(desiredMembers, currentMembers)) {<NEW_LINE>groupsConnection.addMemberToGroup(groupKey, email, Role.MEMBER);<NEW_LINE>totalAdded++;<NEW_LINE>}<NEW_LINE>for (String email : Sets.difference(currentMembers, desiredMembers)) {<NEW_LINE>groupsConnection.removeMemberFromGroup(groupKey, email);<NEW_LINE>totalRemoved++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.atInfo().log("Successfully synced contacts for registrar %s: added %d and removed %d.", registrar.<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>// Package up exception and re-throw with attached additional relevant info.<NEW_LINE>String msg = String.format("Couldn't sync contacts for registrar %s to group %s", registrar.getRegistrarId(), groupKey);<NEW_LINE>throw new RuntimeException(msg, e);<NEW_LINE>}<NEW_LINE>}
getRegistrarId(), totalAdded, totalRemoved);
1,358,317
protected ExtensionElement parseExtensionElement(XMLStreamReader xtr) throws Exception {<NEW_LINE>ExtensionElement extensionElement = new ExtensionElement();<NEW_LINE>extensionElement.setName(xtr.getLocalName());<NEW_LINE>if (StringUtils.isNotEmpty(xtr.getNamespaceURI())) {<NEW_LINE>extensionElement.setNamespace(xtr.getNamespaceURI());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(xtr.getPrefix())) {<NEW_LINE>extensionElement.setNamespacePrefix(xtr.getPrefix());<NEW_LINE>}<NEW_LINE>BpmnXMLUtil.addCustomAttributes(xtr, extensionElement, defaultElementAttributes);<NEW_LINE>boolean readyWithExtensionElement = false;<NEW_LINE>while (!readyWithExtensionElement && xtr.hasNext()) {<NEW_LINE>xtr.next();<NEW_LINE>if (xtr.isCharacters() || XMLStreamReader.CDATA == xtr.getEventType()) {<NEW_LINE>if (StringUtils.isNotEmpty(xtr.getText().trim())) {<NEW_LINE>extensionElement.setElementText(xtr.<MASK><NEW_LINE>}<NEW_LINE>} else if (xtr.isStartElement()) {<NEW_LINE>ExtensionElement childExtensionElement = parseExtensionElement(xtr);<NEW_LINE>extensionElement.addChildElement(childExtensionElement);<NEW_LINE>} else if (xtr.isEndElement() && extensionElement.getName().equalsIgnoreCase(xtr.getLocalName())) {<NEW_LINE>readyWithExtensionElement = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return extensionElement;<NEW_LINE>}
getText().trim());
1,079,685
private boolean initWorkbenchWindows() {<NEW_LINE>String sql <MASK><NEW_LINE>try {<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, AD_Workbench_ID);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>int AD_Window_ID = rs.getInt(1);<NEW_LINE>int AD_Form_ID = rs.getInt(2);<NEW_LINE>int AD_Process_ID = rs.getInt(3);<NEW_LINE>int AD_Task_ID = rs.getInt(4);<NEW_LINE>//<NEW_LINE>if (AD_Window_ID > 0) {<NEW_LINE>m_windows.add(new WBWindow(TYPE_WINDOW, AD_Window_ID));<NEW_LINE>} else if (AD_Form_ID > 0) {<NEW_LINE>m_windows.add(new WBWindow(TYPE_FORM, AD_Form_ID));<NEW_LINE>} else if (AD_Process_ID > 0) {<NEW_LINE>m_windows.add(new WBWindow(TYPE_PROCESS, AD_Process_ID));<NEW_LINE>} else if (AD_Task_ID > 0) {<NEW_LINE>m_windows.add(new WBWindow(TYPE_TASK, AD_Task_ID));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.error(sql, e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
= "SELECT AD_Window_ID, AD_Form_ID, AD_Process_ID, AD_Task_ID " + "FROM AD_WorkbenchWindow " + "WHERE AD_Workbench_ID=? AND IsActive='Y'" + "ORDER BY SeqNo";
1,255,146
protected int matchLevelForDeclarations(ConstructorDeclaration constructor) {<NEW_LINE>// constructor name is stored in selector field<NEW_LINE>if (this.pattern.declaringSimpleName != null && !matchesName(this.pattern.declaringSimpleName, constructor.selector))<NEW_LINE>return IMPOSSIBLE_MATCH;<NEW_LINE>if (this.pattern.parameterSimpleNames != null) {<NEW_LINE>int length = this.pattern.parameterSimpleNames.length;<NEW_LINE>Argument[] args = constructor.arguments;<NEW_LINE>int argsLength = args == null ? 0 : args.length;<NEW_LINE>if (length != argsLength)<NEW_LINE>return IMPOSSIBLE_MATCH;<NEW_LINE>}<NEW_LINE>// Verify type arguments (do not reject if pattern has no argument as it can be an erasure match)<NEW_LINE>if (this.pattern.hasConstructorArguments()) {<NEW_LINE>if (constructor.typeParameters == null || constructor.typeParameters.length != this.pattern.constructorArguments.length)<NEW_LINE>return IMPOSSIBLE_MATCH;<NEW_LINE>}<NEW_LINE>return this<MASK><NEW_LINE>}
.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH;
1,525,725
private static List<TimedEvent> updateInMemoryState(Project project, BlazeContext parentContext, ProjectViewSet projectViewSet, BlazeProjectData blazeProjectData, SyncMode syncMode) {<NEW_LINE>List<TimedEvent> timedEvents = new ArrayList<>();<NEW_LINE>Scope.push(parentContext, context -> {<NEW_LINE>context.push(new TimingScope("UpdateInMemoryState", EventType.Other).addScopeListener((events, duration) -> timedEvents.addAll(events)));<NEW_LINE>context.output(new StatusOutput("Updating in-memory state..."));<NEW_LINE>Module workspaceModule = ModuleFinder.getInstance(project<MASK><NEW_LINE>for (BlazeSyncPlugin blazeSyncPlugin : BlazeSyncPlugin.EP_NAME.getExtensions()) {<NEW_LINE>blazeSyncPlugin.updateInMemoryState(project, context, WorkspaceRoot.fromProject(project), projectViewSet, blazeProjectData, workspaceModule, syncMode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return timedEvents;<NEW_LINE>}
).findModuleByName(BlazeDataStorage.WORKSPACE_MODULE_NAME);
1,854,104
public static APIAddBackendServerToServerGroupMsg __example__() {<NEW_LINE>APIAddBackendServerToServerGroupMsg msg = new APIAddBackendServerToServerGroupMsg();<NEW_LINE>Map<String, String> vmnicMap = new HashMap<String, String>() {<NEW_LINE><NEW_LINE>{<NEW_LINE><MASK><NEW_LINE>put("weight", "20");<NEW_LINE>}<NEW_LINE>};<NEW_LINE>List<Map<String, String>> vmnicList = new ArrayList<>();<NEW_LINE>vmnicList.add(vmnicMap);<NEW_LINE>Map<String, String> serverMap = new HashMap<String, String>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>put("ipAddress", "192.168.2.1");<NEW_LINE>put("weight", "20");<NEW_LINE>}<NEW_LINE>};<NEW_LINE>List<Map<String, String>> serverList = new ArrayList<>();<NEW_LINE>serverList.add(serverMap);<NEW_LINE>msg.setVmNics(vmnicList);<NEW_LINE>msg.setServers(serverList);<NEW_LINE>msg.setServerGroupUuid(uuid());<NEW_LINE>return msg;<NEW_LINE>}
put("uuid", uuid());
324,061
public void propagate(InstanceState state) {<NEW_LINE>PinAttributes attrs = (PinAttributes) state.getAttributeSet();<NEW_LINE>PinState q = getState(state);<NEW_LINE>if (attrs.type == EndData.OUTPUT_ONLY) {<NEW_LINE>Value found = state.getPortValue(0);<NEW_LINE>q.intendedValue = found;<NEW_LINE>q.foundValue = found;<NEW_LINE>state.setPort(0, Value.createUnknown(attrs.width), 1);<NEW_LINE>} else {<NEW_LINE>Value <MASK><NEW_LINE>Value toSend = q.intendedValue;<NEW_LINE>Object pull = attrs.pull;<NEW_LINE>Value pullTo = null;<NEW_LINE>if (pull == PULL_DOWN) {<NEW_LINE>pullTo = Value.FALSE;<NEW_LINE>} else if (pull == PULL_UP) {<NEW_LINE>pullTo = Value.TRUE;<NEW_LINE>} else if (!attrs.threeState && !state.isCircuitRoot()) {<NEW_LINE>pullTo = Value.FALSE;<NEW_LINE>}<NEW_LINE>if (pullTo != null) {<NEW_LINE>toSend = pull2(toSend, attrs.width, pullTo);<NEW_LINE>if (state.isCircuitRoot()) {<NEW_LINE>q.intendedValue = toSend;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>q.foundValue = found;<NEW_LINE>if (!toSend.equals(found)) {<NEW_LINE>// ignore if no change<NEW_LINE>state.setPort(0, toSend, 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
found = state.getPortValue(0);
1,131,349
private void handleNewPhysicalPlan(InstanceControlMsg instanceControlMsg) {<NEW_LINE>PhysicalPlanHelper newHelper = instanceControlMsg.getNewPhysicalPlanHelper();<NEW_LINE>// Bind the MetricsCollector with topologyContext<NEW_LINE>newHelper.setTopologyContext(metricsCollector);<NEW_LINE>if (helper == null) {<NEW_LINE>helper = newHelper;<NEW_LINE>handleNewAssignment();<NEW_LINE>} else {<NEW_LINE>TopologyAPI.TopologyState oldTopologyState = helper.getTopologyState();<NEW_LINE>// Update the PhysicalPlanHelper<NEW_LINE>helper = newHelper;<NEW_LINE>instance.update(helper);<NEW_LINE>// Handle the state changing<NEW_LINE>if (!oldTopologyState.equals(helper.getTopologyState())) {<NEW_LINE>switch(helper.getTopologyState()) {<NEW_LINE>case RUNNING:<NEW_LINE>if (!isInstanceStarted) {<NEW_LINE>// Start the instance if it has not yet started<NEW_LINE>startInstanceIfNeeded();<NEW_LINE>}<NEW_LINE>instance.activate();<NEW_LINE>break;<NEW_LINE>case PAUSED:<NEW_LINE>instance.deactivate();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Unexpected TopologyState is updated for spout: " + helper.getTopologyState());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
LOG.info("Topology state remains the same in Executor: " + oldTopologyState);
816,398
private AdminSettings loadMailTemplates() throws Exception {<NEW_LINE>Map<String, Object> mailTemplates = new HashMap<>();<NEW_LINE>for (String templatesName : templatesNames) {<NEW_LINE>Template template = freemarkerConfig.getTemplate(templatesName);<NEW_LINE>if (template != null) {<NEW_LINE>String name = <MASK><NEW_LINE>Map<String, String> mailTemplate = getMailTemplateFromFile(template.toString());<NEW_LINE>if (mailTemplate != null) {<NEW_LINE>mailTemplates.put(name, mailTemplate);<NEW_LINE>} else {<NEW_LINE>log.error("Can't load mail template from file {}", template.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AdminSettings adminSettings = new AdminSettings();<NEW_LINE>adminSettings.setId(new AdminSettingsId(Uuids.timeBased()));<NEW_LINE>adminSettings.setKey("mailTemplates");<NEW_LINE>adminSettings.setJsonValue(mapper.convertValue(mailTemplates, JsonNode.class));<NEW_LINE>return adminSettings;<NEW_LINE>}
validateName(template.getName());
206,107
synchronized protected void initialize(ChannelFramework framework) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled())<NEW_LINE>c_logger.<MASK><NEW_LINE>if (_channelInitialized == false) {<NEW_LINE>try {<NEW_LINE>if (c_logger.isTraceDebugEnabled())<NEW_LINE>c_logger.traceDebug("SipResolverUdpTransport: initialize: getChannelFramewor()");<NEW_LINE>framework.addChannel(CHAINNAME, framework.lookupFactory("UDPChannel"), null, 10);<NEW_LINE>String[] channelNameList = { CHAINNAME };<NEW_LINE>framework.addChain(CHAINNAME, FlowType.OUTBOUND, channelNameList);<NEW_LINE>_framework = framework;<NEW_LINE>_writeState = WRITE_STATE_DISCONNECTED;<NEW_LINE>_readState = READ_STATE_DISCONNECTED;<NEW_LINE>reConnectAllowed = true;<NEW_LINE>VirtualConnectionFactory vcf = _framework.getOutboundVCFactory(CHAINNAME);<NEW_LINE>_outboundVirtualContext = (OutboundVirtualConnection) vcf.createConnection();<NEW_LINE>_reader = ((UDPContext) _outboundVirtualContext.getChannelAccessor()).getReadInterface();<NEW_LINE>_writer = ((UDPContext) _outboundVirtualContext.getChannelAccessor()).getWriteInterface();<NEW_LINE>} catch (ChannelException e) {<NEW_LINE>if (c_logger.isWarnEnabled()) {<NEW_LINE>c_logger.warn("Udp Resolver channel exception during init: " + e.getMessage());<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} catch (ChainException e1) {<NEW_LINE>if (c_logger.isWarnEnabled())<NEW_LINE>c_logger.warn("Udp Resolver channel exception during init: " + e1.getMessage());<NEW_LINE>}<NEW_LINE>_channelInitialized = true;<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceEntryExitEnabled())<NEW_LINE>c_logger.traceExit(this, "SipResolverUdpTransport: initialize()");<NEW_LINE>}
traceEntry(this, "SipResolverUdpTransport: initialize() _channelInitialized:" + _channelInitialized);
667,511
private boolean isNCXDefined(Document doc) {<NEW_LINE>boolean isNCXdefined = false;<NEW_LINE>NodeList spineList = doc.getElementsByTagName("spine");<NEW_LINE>if (spineList.getLength() > 0) {<NEW_LINE>for (int i = 0; i < spineList.getLength(); i++) {<NEW_LINE>NamedNodeMap attrs = spineList.<MASK><NEW_LINE>Node n = attrs.getNamedItem("toc");<NEW_LINE>if (n != null) {<NEW_LINE>String tocID = n.getNodeValue();<NEW_LINE>NodeList manifestList = doc.getElementsByTagName("manifest");<NEW_LINE>for (int m = 0; m < manifestList.getLength(); m++) {<NEW_LINE>Node manifestNode = manifestList.item(m);<NEW_LINE>NodeList itemNodes = manifestNode.getChildNodes();<NEW_LINE>for (int it = 0; it < itemNodes.getLength(); it++) {<NEW_LINE>NamedNodeMap itemNodeAttributes = itemNodes.item(it).getAttributes();<NEW_LINE>if (itemNodeAttributes != null) {<NEW_LINE>String manifestNodeID = itemNodeAttributes.getNamedItem("id").getNodeValue();<NEW_LINE>if (manifestNodeID != null && manifestNodeID.compareToIgnoreCase(tocID) == 0 && itemNodeAttributes.getNamedItem("href").getNodeValue() != null) {<NEW_LINE>isNCXdefined = true;<NEW_LINE>this.ncxDoc = itemNodeAttributes.getNamedItem("href").getNodeValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isNCXdefined;<NEW_LINE>}
item(i).getAttributes();
703,880
public void readTeamBlocks(DataInput stream) throws IOException {<NEW_LINE>int teamc = stream.readInt();<NEW_LINE>for (int i = 0; i < teamc; i++) {<NEW_LINE>Team team = Team.get(stream.readInt());<NEW_LINE>TeamData data = team.data();<NEW_LINE><MASK><NEW_LINE>data.blocks.clear();<NEW_LINE>data.blocks.ensureCapacity(Math.min(blocks, 1000));<NEW_LINE>var reads = Reads.get(stream);<NEW_LINE>var set = new IntSet();<NEW_LINE>for (int j = 0; j < blocks; j++) {<NEW_LINE>short x = stream.readShort(), y = stream.readShort(), rot = stream.readShort(), bid = stream.readShort();<NEW_LINE>var obj = TypeIO.readObject(reads);<NEW_LINE>// cannot have two in the same position<NEW_LINE>if (set.add(Point2.pack(x, y))) {<NEW_LINE>data.blocks.addLast(new BlockPlan(x, y, rot, content.block(bid).id, obj));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int blocks = stream.readInt();
776,260
public void doRun() {<NEW_LINE>UsbRequest request = connection.requestWait();<NEW_LINE>if (request != null && request.getEndpoint().getType() == UsbConstants.USB_ENDPOINT_XFER_BULK && request.getEndpoint().getDirection() == UsbConstants.USB_DIR_IN) {<NEW_LINE>byte[] data = serialBuffer.getDataReceived();<NEW_LINE>// FTDI devices reserves two first bytes of an IN endpoint with info about<NEW_LINE>// modem and Line.<NEW_LINE>if (isFTDIDevice()) {<NEW_LINE>// Check the Modem status<NEW_LINE>((FTDISerialDevice) usbSerialDevice).ftdiUtilities.checkModemStatus(data);<NEW_LINE>serialBuffer.clearReadBuffer();<NEW_LINE>if (data.length > 2) {<NEW_LINE>data = FTDISerialDevice.adaptArray(data);<NEW_LINE>onReceivedData(data);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Clear buffer, execute the callback<NEW_LINE>serialBuffer.clearReadBuffer();<NEW_LINE>onReceivedData(data);<NEW_LINE>}<NEW_LINE>// Queue a new request<NEW_LINE>requestIN.queue(serialBuffer.<MASK><NEW_LINE>}<NEW_LINE>}
getReadBuffer(), SerialBuffer.DEFAULT_READ_BUFFER_SIZE);
1,808,203
static <K, A, E> MapDifference<K, A, E> create(Map<? extends K, ? extends A> actual, Map<? extends K, ? extends E> expected, boolean allowUnexpected, ValueTester<? super A, ? super E> valueTester) {<NEW_LINE>Map<K, A> unexpected = new LinkedHashMap<>(actual);<NEW_LINE>Map<K, E> missing = new LinkedHashMap<>();<NEW_LINE>Map<K, ValueDifference<A, E>> wrongValues = new LinkedHashMap<>();<NEW_LINE>for (Map.Entry<? extends K, ? extends E> expectedEntry : expected.entrySet()) {<NEW_LINE>K expectedKey = expectedEntry.getKey();<NEW_LINE><MASK><NEW_LINE>if (actual.containsKey(expectedKey)) {<NEW_LINE>A actualValue = unexpected.remove(expectedKey);<NEW_LINE>if (!valueTester.test(actualValue, expectedValue)) {<NEW_LINE>wrongValues.put(expectedKey, new ValueDifference<>(actualValue, expectedValue));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>missing.put(expectedKey, expectedValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (allowUnexpected) {<NEW_LINE>unexpected.clear();<NEW_LINE>}<NEW_LINE>return new MapDifference<>(missing, unexpected, wrongValues, Sets.union(actual.keySet(), expected.keySet()));<NEW_LINE>}
E expectedValue = expectedEntry.getValue();
95,831
public void tint(Color tint) {<NEW_LINE>float newTint = tint.toFloatBits();<NEW_LINE>if (currentTint == newTint)<NEW_LINE>return;<NEW_LINE>currentTint = newTint;<NEW_LINE>float[<MASK><NEW_LINE>Color tempColor = BitmapFontCache.tempColor;<NEW_LINE>int[] tempGlyphCount = this.tempGlyphCount;<NEW_LINE>Arrays.fill(tempGlyphCount, 0);<NEW_LINE>for (int i = 0, n = layouts.size; i < n; i++) {<NEW_LINE>GlyphLayout layout = layouts.get(i);<NEW_LINE>IntArray colors = layout.colors;<NEW_LINE>int colorsIndex = 0, nextColorGlyphIndex = 0, glyphIndex = 0;<NEW_LINE>float lastColorFloatBits = 0;<NEW_LINE>for (int ii = 0, nn = layout.runs.size; ii < nn; ii++) {<NEW_LINE>GlyphRun run = layout.runs.get(ii);<NEW_LINE>Object[] glyphs = run.glyphs.items;<NEW_LINE>for (int iii = 0, nnn = run.glyphs.size; iii < nnn; iii++) {<NEW_LINE>if (glyphIndex++ == nextColorGlyphIndex) {<NEW_LINE>Color.abgr8888ToColor(tempColor, colors.get(++colorsIndex));<NEW_LINE>lastColorFloatBits = tempColor.mul(tint).toFloatBits();<NEW_LINE>nextColorGlyphIndex = ++colorsIndex < colors.size ? colors.get(colorsIndex) : -1;<NEW_LINE>}<NEW_LINE>int page = ((Glyph) glyphs[iii]).page;<NEW_LINE>int offset = tempGlyphCount[page] * 20 + 2;<NEW_LINE>tempGlyphCount[page]++;<NEW_LINE>float[] vertices = pageVertices[page];<NEW_LINE>vertices[offset] = lastColorFloatBits;<NEW_LINE>vertices[offset + 5] = lastColorFloatBits;<NEW_LINE>vertices[offset + 10] = lastColorFloatBits;<NEW_LINE>vertices[offset + 15] = lastColorFloatBits;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
][] pageVertices = this.pageVertices;
1,380,097
final DescribeVpcEndpointServicesResult executeDescribeVpcEndpointServices(DescribeVpcEndpointServicesRequest describeVpcEndpointServicesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeVpcEndpointServicesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeVpcEndpointServicesRequest> request = null;<NEW_LINE>Response<DescribeVpcEndpointServicesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeVpcEndpointServicesRequestMarshaller().marshall(super.beforeMarshalling(describeVpcEndpointServicesRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeVpcEndpointServices");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeVpcEndpointServicesResult> responseHandler = new StaxResponseHandler<DescribeVpcEndpointServicesResult>(new DescribeVpcEndpointServicesResultStaxUnmarshaller());<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);
396,908
private void validateExistingSink(final KsqlStructuredDataOutputNode outputNode) {<NEW_LINE>final SourceName name = outputNode.getSinkName().get();<NEW_LINE>final DataSource existing = engineContext.getMetaStore().getSource(name);<NEW_LINE>if (existing == null) {<NEW_LINE>throw new KsqlException(String<MASK><NEW_LINE>}<NEW_LINE>if (existing.getDataSourceType() != outputNode.getNodeOutputType()) {<NEW_LINE>throw new KsqlException(String.format("Incompatible data sink and query result. Data sink" + " (%s) type is %s but select query result is %s.", name.text(), existing.getDataSourceType(), outputNode.getNodeOutputType()));<NEW_LINE>}<NEW_LINE>final LogicalSchema resultSchema = outputNode.getSchema();<NEW_LINE>final LogicalSchema existingSchema = existing.getSchema();<NEW_LINE>if (!resultSchema.compatibleSchema(existingSchema)) {<NEW_LINE>throw new KsqlException("Incompatible schema between results and sink." + System.lineSeparator() + "Result schema is " + resultSchema + System.lineSeparator() + "Sink schema is " + existingSchema);<NEW_LINE>}<NEW_LINE>}
.format("%s does not exist.", outputNode));
1,504,141
public Project findProjectByConnectionIdOrJdbcUrl(UUID connectionId, String jdbcUrl) throws LiquibaseHubException {<NEW_LINE>final AtomicReference<UUID> organizationId = new AtomicReference<>(<MASK><NEW_LINE>String searchParam = null;<NEW_LINE>if (connectionId != null) {<NEW_LINE>searchParam = "connections.id:\"" + connectionId.toString() + "\"";<NEW_LINE>} else if (jdbcUrl != null) {<NEW_LINE>searchParam = "connections.jdbcUrl:\"" + jdbcUrl + "\"";<NEW_LINE>} else {<NEW_LINE>throw new LiquibaseHubException("connectionId or jdbcUrl should be specified");<NEW_LINE>}<NEW_LINE>Map<String, String> parameters = new LinkedHashMap<>();<NEW_LINE>parameters.put("search", searchParam);<NEW_LINE>final Map<String, List<Map>> response = http.doGet("/api/v1/organizations/" + organizationId.toString() + "/projects", parameters, Map.class);<NEW_LINE>List<Project> returnList = transformProjectResponseToList(response);<NEW_LINE>if (returnList.size() > 1) {<NEW_LINE>Scope.getCurrentScope().getLog(getClass()).warning(String.format("JDBC URL: %s was associated with multiple projects.", jdbcUrl));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (returnList.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return returnList.get(0);<NEW_LINE>}
getOrganization().getId());
675,447
protected MemoryBlock createInitializedBlock(MemoryLoadable loadable, boolean isOverlay, String name, Address start, long fileOffset, long dataLength, String comment, boolean r, boolean w, boolean x, TaskMonitor monitor) throws IOException, AddressOverflowException, CancelledException {<NEW_LINE>long revisedLength = checkBlockLimit(name, dataLength, true);<NEW_LINE>if (isDiscardableFillerSegment(loadable, name, start, fileOffset, dataLength)) {<NEW_LINE>Msg.debug(this, "Discarding " + dataLength + "-byte alignment/filler " + name + " at " + start);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// TODO: MemoryBlockUtil poorly and inconsistently handles duplicate name errors (can throw RuntimeException).<NEW_LINE>// Are we immune from such errors? If not, how should they be handled?<NEW_LINE>if (start.isNonLoadedMemoryAddress()) {<NEW_LINE>r = false;<NEW_LINE>w = false;<NEW_LINE>x = false;<NEW_LINE>}<NEW_LINE>// Msg.debug(this,<NEW_LINE>// "Loading block " + name + " at " + start + " from file offset " + fileOffset);<NEW_LINE>long endOffset = fileOffset + revisedLength - 1;<NEW_LINE>if (endOffset >= fileBytes.getSize()) {<NEW_LINE>revisedLength = fileBytes.getSize() - fileOffset;<NEW_LINE>log("Truncating block load for " + name + " which exceeds file length");<NEW_LINE>}<NEW_LINE>String blockComment = comment;<NEW_LINE>if (dataLength != revisedLength) {<NEW_LINE>blockComment += " (section truncated)";<NEW_LINE>}<NEW_LINE>MemoryBlock block = null;<NEW_LINE>try {<NEW_LINE>if (elf.getLoadAdapter().hasFilteredLoadInputStream(this, loadable, start)) {<NEW_LINE>// block is unable to map directly to file bytes - load from input stream<NEW_LINE>try (InputStream dataInput = getInitializedBlockInputStream(loadable, start, fileOffset, revisedLength)) {<NEW_LINE>block = MemoryBlockUtils.createInitializedBlock(program, isOverlay, name, start, dataInput, revisedLength, blockComment, BLOCK_SOURCE_NAME, r, w, x, log, monitor);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// create block using direct mapping to file bytes<NEW_LINE>block = MemoryBlockUtils.createInitializedBlock(program, isOverlay, name, start, fileBytes, fileOffset, revisedLength, blockComment, BLOCK_SOURCE_NAME, r, w, x, log);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (block == null) {<NEW_LINE>Address end = start.addNoWrap(revisedLength - 1);<NEW_LINE>log("Unexpected ELF memory bock load conflict when creating '" + name + "' at " + start.toString(true) + "-" <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return block;<NEW_LINE>}
+ end.toString(true));
1,788,902
public void handle(TabCompleteResponse tabCompleteResponse) throws Exception {<NEW_LINE>List<String> commands = tabCompleteResponse.getCommands();<NEW_LINE>if (commands == null) {<NEW_LINE>commands = Lists.transform(tabCompleteResponse.getSuggestions().getList(), new Function<Suggestion, String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String apply(Suggestion input) {<NEW_LINE>return input.getText();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>TabCompleteResponseEvent tabCompleteResponseEvent = new TabCompleteResponseEvent(server, con, new ArrayList<>(commands));<NEW_LINE>if (!bungee.getPluginManager().callEvent(tabCompleteResponseEvent).isCancelled()) {<NEW_LINE>// Take action only if modified<NEW_LINE>if (!commands.equals(tabCompleteResponseEvent.getSuggestions())) {<NEW_LINE>if (tabCompleteResponse.getCommands() != null) {<NEW_LINE>// Classic style<NEW_LINE>tabCompleteResponse.setCommands(tabCompleteResponseEvent.getSuggestions());<NEW_LINE>} else {<NEW_LINE>// Brigadier style<NEW_LINE>final StringRange range = tabCompleteResponse.getSuggestions().getRange();<NEW_LINE>tabCompleteResponse.setSuggestions(new Suggestions(range, Lists.transform(tabCompleteResponseEvent.getSuggestions(), new Function<String, Suggestion>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Suggestion apply(String input) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>})));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>con.unsafe().sendPacket(tabCompleteResponse);<NEW_LINE>}<NEW_LINE>throw CancelSendSignal.INSTANCE;<NEW_LINE>}
return new Suggestion(range, input);
475,092
public void marshall(CreateTrailRequest createTrailRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createTrailRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getS3BucketName(), S3BUCKETNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getS3KeyPrefix(), S3KEYPREFIX_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getSnsTopicName(), SNSTOPICNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getIncludeGlobalServiceEvents(), INCLUDEGLOBALSERVICEEVENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getIsMultiRegionTrail(), ISMULTIREGIONTRAIL_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getEnableLogFileValidation(), ENABLELOGFILEVALIDATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getCloudWatchLogsLogGroupArn(), CLOUDWATCHLOGSLOGGROUPARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getCloudWatchLogsRoleArn(), CLOUDWATCHLOGSROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getKmsKeyId(), KMSKEYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getIsOrganizationTrail(), ISORGANIZATIONTRAIL_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTrailRequest.getTagsList(), TAGSLIST_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
146,516
private Mono<Response<IntegrationAccountInner>> regenerateAccessKeyWithResponseAsync(String resourceGroupName, String integrationAccountName, RegenerateActionParameter regenerateAccessKey, 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>if (integrationAccountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter integrationAccountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (regenerateAccessKey == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter regenerateAccessKey is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>regenerateAccessKey.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.regenerateAccessKey(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, integrationAccountName, this.client.getApiVersion(), regenerateAccessKey, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
342,833
public void removeWithTimestamp(@NotNull final String client, final int bucketIndex) {<NEW_LINE>ThreadPreConditions.startsWith(SINGLE_WRITER_THREAD_PREFIX);<NEW_LINE>final Bucket bucket = buckets[bucketIndex];<NEW_LINE>bucket.getEnvironment().executeInTransaction(txn -> {<NEW_LINE>final ByteIterable value = bucket.getStore().get(txn, bytesToByteIterable(<MASK><NEW_LINE>if (value != null) {<NEW_LINE>final ClientSession clientSession = serializer.deserializeValue(byteIterableToBytes(value));<NEW_LINE>if (persistent(clientSession) || clientSession.isConnected()) {<NEW_LINE>sessionsCount.decrementAndGet();<NEW_LINE>}<NEW_LINE>if (clientSession.getWillPublish() != null) {<NEW_LINE>txn.setCommitHook(new RemoveWillReference(clientSession.getWillPublish()));<NEW_LINE>}<NEW_LINE>bucket.getStore().delete(txn, bytesToByteIterable(serializer.serializeKey(client)));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
serializer.serializeKey(client)));
952,818
public List<HistoricExternalTaskLogDto> queryHistoricExternalTaskLogs(HistoricExternalTaskLogQueryDto queryDto, Integer firstResult, Integer maxResults) {<NEW_LINE>queryDto.setObjectMapper(objectMapper);<NEW_LINE>HistoricExternalTaskLogQuery query = queryDto.toQuery(processEngine);<NEW_LINE>List<HistoricExternalTaskLog> matchingHistoricExternalTaskLogs;<NEW_LINE>if (firstResult != null || maxResults != null) {<NEW_LINE>matchingHistoricExternalTaskLogs = executePaginatedQuery(query, firstResult, maxResults);<NEW_LINE>} else {<NEW_LINE>matchingHistoricExternalTaskLogs = query.list();<NEW_LINE>}<NEW_LINE>List<HistoricExternalTaskLogDto> results = new ArrayList<HistoricExternalTaskLogDto>();<NEW_LINE>for (HistoricExternalTaskLog historicExternalTaskLog : matchingHistoricExternalTaskLogs) {<NEW_LINE>HistoricExternalTaskLogDto <MASK><NEW_LINE>results.add(result);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
result = HistoricExternalTaskLogDto.fromHistoricExternalTaskLog(historicExternalTaskLog);
1,168,283
@UiThread<NEW_LINE>private static Constructor<? extends Unbinder> findBindingConstructorForClass(Class<?> cls) {<NEW_LINE>Constructor<? extends Unbinder> bindingCtor = BINDINGS.get(cls);<NEW_LINE>if (bindingCtor != null || BINDINGS.containsKey(cls)) {<NEW_LINE>if (debug)<NEW_LINE>Log.d(TAG, "HIT: Cached in binding map.");<NEW_LINE>return bindingCtor;<NEW_LINE>}<NEW_LINE>String clsName = cls.getName();<NEW_LINE>if (clsName.startsWith("android.") || clsName.startsWith("java.") || clsName.startsWith("androidx.")) {<NEW_LINE>if (debug)<NEW_LINE>Log.d(TAG, "MISS: Reached framework class. Abandoning search.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Class<?> bindingClass = cls.getClassLoader().loadClass(clsName + "_ViewBinding");<NEW_LINE>// noinspection unchecked<NEW_LINE>bindingCtor = (Constructor<? extends Unbinder>) bindingClass.<MASK><NEW_LINE>if (debug)<NEW_LINE>Log.d(TAG, "HIT: Loaded binding class and constructor.");<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>if (debug)<NEW_LINE>Log.d(TAG, "Not found. Trying superclass " + cls.getSuperclass().getName());<NEW_LINE>bindingCtor = findBindingConstructorForClass(cls.getSuperclass());<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new RuntimeException("Unable to find binding constructor for " + clsName, e);<NEW_LINE>}<NEW_LINE>BINDINGS.put(cls, bindingCtor);<NEW_LINE>return bindingCtor;<NEW_LINE>}
getConstructor(cls, View.class);
1,247,592
private void testJMSProducerSendMessage_NotWriteableTopic_SecOff(TopicConnectionFactory topicConnectionFactory) throws JMSException, TestException {<NEW_LINE>try (JMSContext jmsContext = topicConnectionFactory.createContext()) {<NEW_LINE>JMSProducer jmsProducer = jmsContext.createProducer();<NEW_LINE>JMSConsumer jmsConsumer = jmsContext.createConsumer(topic1);<NEW_LINE>StreamMessage sentMessage = jmsContext.createStreamMessage();<NEW_LINE>sentMessage.writeString(methodName() + " 1 at " + new Date());<NEW_LINE>sentMessage.reset();<NEW_LINE>try {<NEW_LINE>sentMessage.writeString(methodName() + " 2 at " + new Date());<NEW_LINE>throw new TestException("Write to a read only message after reset() without throwing MessageNotWriteableException" + " sent(1):" + sentMessage);<NEW_LINE>} catch (MessageNotWriteableException ex) {<NEW_LINE>// Expected<NEW_LINE>}<NEW_LINE>jmsProducer.send(topic1, sentMessage);<NEW_LINE>StreamMessage receivedMessage = (StreamMessage) jmsConsumer.receive(30000);<NEW_LINE>jmsProducer.setProperty("Role", "Tester");<NEW_LINE>try {<NEW_LINE>jmsProducer.send(topic1, receivedMessage);<NEW_LINE>throw new <MASK><NEW_LINE>} catch (MessageNotWriteableRuntimeException ex) {<NEW_LINE>// Expected<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
TestException("Sent a read only message after modifying a property without throwing MessageNotWriteableRuntimeException" + " sent(2):" + receivedMessage);
400,698
protected String compute() {<NEW_LINE>String baseUrl = this.baseUrl.getValue();<NEW_LINE>if (baseUrl == null) {<NEW_LINE>baseUrl = "";<NEW_LINE>} else {<NEW_LINE>baseUrl = baseUrl.trim();<NEW_LINE>}<NEW_LINE>SimpleUriBuilder builder = new SimpleUriBuilder(baseUrl);<NEW_LINE>for (FieldModel<String> f : inputs) {<NEW_LINE><MASK><NEW_LINE>if (paramValue != null) {<NEW_LINE>builder.addParameter(f.getName(), paramValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (FieldModel<RadioInfo> f : radioInputs) {<NEW_LINE>RadioInfo radio = f.getValue();<NEW_LINE>if (radio != null) {<NEW_LINE>String paramValue = radio.getUrlParamValue();<NEW_LINE>if (paramValue != null) {<NEW_LINE>builder.addParameter(f.getName(), paramValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (MultiSelectionFieldModel<IdAble> mf : multiInputs) {<NEW_LINE>String name = mf.getName();<NEW_LINE>for (IdAble selectedValue : mf.getCurrentSelection()) {<NEW_LINE>// Note that it is possible for values to be selected and disabled at the same time<NEW_LINE>// (i.e. a checkbox can be checked and 'greyed' out at the same time)<NEW_LINE>// We must therefore check enablement before adding a selection to the URI.<NEW_LINE>if (mf.getEnablement(selectedValue).getValue()) {<NEW_LINE>builder.addParameter(name, selectedValue.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>}
String paramValue = f.getValue();
687,838
public boolean isConference(Call call) {<NEW_LINE>// If we're the focus of the conference.<NEW_LINE>if (call.isConferenceFocus())<NEW_LINE>return true;<NEW_LINE>// If one of our peers is a conference focus, we're in a<NEW_LINE>// conference call.<NEW_LINE>Iterator<? extends CallPeer<MASK><NEW_LINE>while (callPeers.hasNext()) {<NEW_LINE>CallPeer callPeer = callPeers.next();<NEW_LINE>if (callPeer.isConferenceFocus())<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// the call can have two peers at the same time and there is no one<NEW_LINE>// is conference focus. This is situation when some one has made an<NEW_LINE>// attended transfer and has transfered us. We have one call with two<NEW_LINE>// peers the one we are talking to and the one we have been transfered<NEW_LINE>// to. And the first one is been hanguped and so the call passes through<NEW_LINE>// conference call fo a moment and than go again to one to one call.<NEW_LINE>return call.getCallPeerCount() > 1;<NEW_LINE>}
> callPeers = call.getCallPeers();
1,408,500
// prepare<NEW_LINE>protected String doIt() throws Exception {<NEW_LINE>X_AD_HouseKeeping houseKeeping = new X_AD_HouseKeeping(getCtx(), p_AD_HouseKeeping_ID, get_TrxName());<NEW_LINE>int tableID = houseKeeping.getAD_Table_ID();<NEW_LINE>MTable table = new MTable(getCtx(), tableID, get_TrxName());<NEW_LINE>String tableName = table.getTableName();<NEW_LINE>String whereClause = houseKeeping.getWhereClause();<NEW_LINE>int noins = 0;<NEW_LINE>int noexp = 0;<NEW_LINE>int nodel = 0;<NEW_LINE>if (houseKeeping.isSaveInHistoric()) {<NEW_LINE>String sql = "INSERT INTO hst_" + tableName + " SELECT * FROM " + tableName;<NEW_LINE>if (whereClause != null && whereClause.length() > 0)<NEW_LINE>sql = sql + " WHERE " + whereClause;<NEW_LINE>noins = DB.<MASK><NEW_LINE>if (noins == -1)<NEW_LINE>throw new AdempiereSystemError("Cannot insert into hst_" + tableName);<NEW_LINE>addLog("@Inserted@ " + noins);<NEW_LINE>}<NEW_LINE>// saveInHistoric<NEW_LINE>Date date = new Date();<NEW_LINE>if (houseKeeping.isExportXMLBackup()) {<NEW_LINE>String pathFile = houseKeeping.getBackupFolder();<NEW_LINE>SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");<NEW_LINE>String dateString = dateFormat.format(date);<NEW_LINE>FileWriter file = new FileWriter(pathFile + File.separator + tableName + dateString + ".xml");<NEW_LINE>String sql = "SELECT * FROM " + tableName;<NEW_LINE>if (whereClause != null && whereClause.length() > 0)<NEW_LINE>sql = sql + " WHERE " + whereClause;<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>StringBuilder linexml = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, get_TrxName());<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>GenericPO po = new GenericPO(tableName, getCtx(), rs, get_TrxName());<NEW_LINE>linexml = po.get_xmlString(linexml);<NEW_LINE>noexp++;<NEW_LINE>}<NEW_LINE>if (linexml != null)<NEW_LINE>file.write(linexml.toString());<NEW_LINE>file.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>pstmt = null;<NEW_LINE>rs = null;<NEW_LINE>}<NEW_LINE>addLog("@Exported@ " + noexp);<NEW_LINE>}<NEW_LINE>// XmlExport<NEW_LINE>String sql = "DELETE FROM " + tableName;<NEW_LINE>if (whereClause != null && whereClause.length() > 0)<NEW_LINE>sql = sql + " WHERE " + whereClause;<NEW_LINE>nodel = DB.executeUpdate(sql, get_TrxName());<NEW_LINE>if (nodel == -1)<NEW_LINE>throw new AdempiereSystemError("Cannot delete from " + tableName);<NEW_LINE>Timestamp time = new Timestamp(date.getTime());<NEW_LINE>houseKeeping.setLastRun(time);<NEW_LINE>houseKeeping.setLastDeleted(nodel);<NEW_LINE>houseKeeping.saveEx();<NEW_LINE>addLog("@Deleted@ " + nodel);<NEW_LINE>String msg = Msg.translate(getCtx(), tableName + "_ID") + " #" + nodel;<NEW_LINE>return msg;<NEW_LINE>}
executeUpdate(sql, get_TrxName());
800,868
final Run executeStartWorkflowExecution(StartWorkflowExecutionRequest startWorkflowExecutionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startWorkflowExecutionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartWorkflowExecutionRequest> request = null;<NEW_LINE>Response<Run> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartWorkflowExecutionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startWorkflowExecutionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SWF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartWorkflowExecution");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<Run>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RunJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
354,145
private Map<String, Object> doUnflatten(Map<String, Object> source) {<NEW_LINE>Map<String, Object> result = new LinkedHashMap<>();<NEW_LINE>Set<String> treatSeperate = new LinkedHashSet<>();<NEW_LINE>for (Entry<String, Object> entry : source.entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>String[] args = key.split("\\.");<NEW_LINE>if (args.length == 1 && !args[0].contains("[")) {<NEW_LINE>result.put(entry.getKey(), entry.getValue());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (args.length == 1 && args[0].contains("[")) {<NEW_LINE>String prunedKey = args[0].substring(0, args[0].indexOf('['));<NEW_LINE>if (result.containsKey(prunedKey)) {<NEW_LINE>appendValueToTypedList(args[0], entry.getValue(), (List<Object>) result.get(prunedKey));<NEW_LINE>} else {<NEW_LINE>result.put(prunedKey, createTypedListWithValue(entry.getValue()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>treatSeperate.add(key.substring(0, key.indexOf('.')));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String partial : treatSeperate) {<NEW_LINE>Map<String, Object> newSource = new LinkedHashMap<>();<NEW_LINE>for (Entry<String, Object> entry : source.entrySet()) {<NEW_LINE>if (entry.getKey().startsWith(partial)) {<NEW_LINE>newSource.put(entry.getKey().substring(partial.length() + 1), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (partial.endsWith("]")) {<NEW_LINE>String prunedKey = partial.substring(0, partial.indexOf('['));<NEW_LINE>if (result.containsKey(prunedKey)) {<NEW_LINE>appendValueToTypedList(partial, doUnflatten(newSource), (List<Object>) result.get(prunedKey));<NEW_LINE>} else {<NEW_LINE>result.put(prunedKey, createTypedListWithValue(doUnflatten(newSource)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result.put<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(partial, doUnflatten(newSource));
1,344,374
public Optional<ServiceBindingConfigSource> convert(List<ServiceBinding> serviceBindings) {<NEW_LINE>Optional<ServiceBinding> matchingByType = ServiceBinding.singleMatchingByType("kafka", serviceBindings);<NEW_LINE>if (!matchingByType.isPresent()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Map<String, String> properties = new HashMap<>();<NEW_LINE><MASK><NEW_LINE>String bootstrapServers = binding.getProperties().get("bootstrapServers");<NEW_LINE>if (bootstrapServers == null) {<NEW_LINE>bootstrapServers = binding.getProperties().get("bootstrap-servers");<NEW_LINE>}<NEW_LINE>if (bootstrapServers != null) {<NEW_LINE>properties.put("kafka.bootstrap.servers", bootstrapServers);<NEW_LINE>}<NEW_LINE>String securityProtocol = binding.getProperties().get("securityProtocol");<NEW_LINE>if (securityProtocol != null) {<NEW_LINE>properties.put("kafka.security.protocol", securityProtocol);<NEW_LINE>}<NEW_LINE>String saslMechanism = binding.getProperties().get("saslMechanism");<NEW_LINE>if (saslMechanism != null) {<NEW_LINE>properties.put("kafka.sasl.mechanism", saslMechanism);<NEW_LINE>}<NEW_LINE>String user = binding.getProperties().get("user");<NEW_LINE>String password = binding.getProperties().get("password");<NEW_LINE>if ((user != null) && (password != null)) {<NEW_LINE>if ("PLAIN".equals(saslMechanism)) {<NEW_LINE>properties.put("kafka.sasl.jaas.config", String.format("org.apache.kafka.common.security.plain.PlainLoginModule required username='%s' password='%s';", user, password));<NEW_LINE>}<NEW_LINE>if ("SCRAM-SHA-512".equals(saslMechanism) || "SCRAM-SHA-256".equals(saslMechanism)) {<NEW_LINE>properties.put("kafka.sasl.jaas.config", String.format("org.apache.kafka.common.security.scram.ScramLoginModule required username='%s' password='%s';", user, password));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.of(new ServiceBindingConfigSource("kafka-k8s-service-binding-source", properties));<NEW_LINE>}
ServiceBinding binding = matchingByType.get();
526,679
public void addRecipes(Consumer<FinishedRecipe> consumer) {<NEW_LINE>String basePath = "combining/";<NEW_LINE>addCombinerDyeRecipes(consumer, basePath + "dye/");<NEW_LINE><MASK><NEW_LINE>addCombinerWaxingRecipes(consumer, basePath + "wax/");<NEW_LINE>// Gravel<NEW_LINE>CombinerRecipeBuilder.combining(IngredientCreatorAccess.item().from(Items.FLINT), IngredientCreatorAccess.item().from(Tags.Items.COBBLESTONE_NORMAL), new ItemStack(Blocks.GRAVEL)).build(consumer, Mekanism.rl(basePath + "gravel"));<NEW_LINE>// Obsidian<NEW_LINE>CombinerRecipeBuilder.combining(IngredientCreatorAccess.item().from(MekanismTags.Items.DUSTS_OBSIDIAN, 4), IngredientCreatorAccess.item().from(Tags.Items.COBBLESTONE_DEEPSLATE), new ItemStack(Blocks.OBSIDIAN)).build(consumer, Mekanism.rl(basePath + "obsidian"));<NEW_LINE>// Rooted Dirt<NEW_LINE>CombinerRecipeBuilder.combining(IngredientCreatorAccess.item().from(Items.HANGING_ROOTS, 3), IngredientCreatorAccess.item().from(Blocks.DIRT), new ItemStack(Blocks.ROOTED_DIRT)).build(consumer, Mekanism.rl(basePath + "rooted_dirt"));<NEW_LINE>}
addCombinerGlowRecipes(consumer, basePath + "glow/");
440,598
public void process(final TProtocol inProt, final TProtocol outProt) throws TException {<NEW_LINE>TTransport trans = inProt.getTransport();<NEW_LINE>if (!(trans instanceof TSaslServerTransport)) {<NEW_LINE>throw new TException("Unexpected non-SASL transport " + trans.getClass() + ": " + trans);<NEW_LINE>}<NEW_LINE>TSaslServerTransport saslTrans = (TSaslServerTransport) trans;<NEW_LINE>SaslServer saslServer = saslTrans.getSaslServer();<NEW_LINE>String endUser = saslServer.getAuthorizationID();<NEW_LINE>SaslMechanism mechanism;<NEW_LINE>try {<NEW_LINE>mechanism = SaslMechanism.get(saslServer.getMechanismName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Failed to process RPC with SASL mechanism {}", saslServer.getMechanismName());<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>switch(mechanism) {<NEW_LINE>case GSSAPI:<NEW_LINE>UserGroupInformation clientUgi = UserGroupInformation.createProxyUser(endUser, loginUser);<NEW_LINE>final String remoteUser = clientUgi.getUserName();<NEW_LINE>try {<NEW_LINE>// Set the principal in the ThreadLocal for access to get authorizations<NEW_LINE>rpcPrincipal.set(remoteUser);<NEW_LINE>wrapped.process(inProt, outProt);<NEW_LINE>} finally {<NEW_LINE>// Unset the principal after we're done using it just to be sure that it's not incorrectly<NEW_LINE>// used in the same thread down the line.<NEW_LINE>rpcPrincipal.set(null);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case DIGEST_MD5:<NEW_LINE>// The CallbackHandler, after deserializing the TokenIdentifier in the name, has already<NEW_LINE>// updated<NEW_LINE>// the rpcPrincipal for us. We don't need to do it again here.<NEW_LINE>try {<NEW_LINE>rpcMechanism.set(mechanism);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>// Unset the mechanism after we're done using it just to be sure that it's not incorrectly<NEW_LINE>// used in the same thread down the line.<NEW_LINE>rpcMechanism.set(null);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Cannot process SASL mechanism " + mechanism);<NEW_LINE>}<NEW_LINE>}
wrapped.process(inProt, outProt);
810,852
private void handleMembershipChange(ClusterMembershipEvent event) {<NEW_LINE>if (event.type() == ClusterMembershipEvent.Type.MEMBER_ADDED) {<NEW_LINE>bootstrap(event.subject());<NEW_LINE>} else if (event.type() == ClusterMembershipEvent.Type.MEMBER_REMOVED) {<NEW_LINE>threadContext.execute(() -> {<NEW_LINE>PartitionGroupMembership systemGroup = this.systemGroup;<NEW_LINE>if (systemGroup != null && systemGroup.members().contains(event.subject().id())) {<NEW_LINE>Set<MemberId> newMembers = Sets.newHashSet(systemGroup.members());<NEW_LINE>newMembers.remove(event.subject().id());<NEW_LINE>PartitionGroupMembership newMembership = new PartitionGroupMembership(systemGroup.group(), systemGroup.config(), ImmutableSet.copyOf(newMembers), true);<NEW_LINE>this.systemGroup = newMembership;<NEW_LINE>post(new PartitionGroupMembershipEvent(MEMBERS_CHANGED, newMembership));<NEW_LINE>}<NEW_LINE>groups.values().forEach(group -> {<NEW_LINE>if (group.members().contains(event.subject().id())) {<NEW_LINE>Set<MemberId> newMembers = Sets.newHashSet(group.members());<NEW_LINE>newMembers.remove(event.subject().id());<NEW_LINE>PartitionGroupMembership newMembership = new PartitionGroupMembership(group.group(), group.config(), ImmutableSet.copyOf(newMembers), false);<NEW_LINE>groups.put(<MASK><NEW_LINE>post(new PartitionGroupMembershipEvent(MEMBERS_CHANGED, newMembership));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
group.group(), newMembership);
1,131,486
private void loadNode146() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_CurrentKeepAliveCount, new QualifiedName(0, "CurrentKeepAliveCount"), new LocalizedText("en", "CurrentKeepAliveCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_CurrentKeepAliveCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_CurrentKeepAliveCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_CurrentKeepAliveCount, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
1,777,388
protected void scoreCensus(int disparityRange, final boolean leftToRight) {<NEW_LINE>final int[] scores = leftToRight ? scoreLtoR : scoreRtoL;<NEW_LINE>final int[] dataLeft = censusLeft.data;<NEW_LINE>final int[] dataRight = censusRight.data;<NEW_LINE>for (int d = 0; d < disparityRange; d++) {<NEW_LINE>int total = 0;<NEW_LINE>for (int y = 0; y < blockHeight; y++) {<NEW_LINE>int idxLeft = (y + sampleRadiusY) * censusLeft.stride + sampleRadiusX;<NEW_LINE>int idxRight = (y + sampleRadiusY) * censusRight.stride + sampleRadiusX + d;<NEW_LINE>for (int x = 0; x < blockWidth; x++) {<NEW_LINE>final int a = dataLeft[idxLeft++];<NEW_LINE>final int b = dataRight[idxRight++];<NEW_LINE>total += DescriptorDistance.hamming(a ^ b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int index = leftToRight <MASK><NEW_LINE>scores[index] = total;<NEW_LINE>}<NEW_LINE>}
? disparityRange - d - 1 : d;
817,967
static PGPSignature generateSubkeyBindingSignature(PGPSignatureGenerator sGen, Date creationTime, PGPPublicKey masterPublicKey, PGPPrivateKey masterPrivateKey, PGPSignatureGenerator subSigGen, PGPPrivateKey subPrivateKey, PGPPublicKey pKey, int flags, long expiry) throws IOException, PGPException, SignatureException {<NEW_LINE>PGPSignatureSubpacketGenerator unhashedPacketsGen = new PGPSignatureSubpacketGenerator();<NEW_LINE>// If this key can sign, we need a primary key binding signature<NEW_LINE>if ((flags & KeyFlags.SIGN_DATA) > 0) {<NEW_LINE>// cross-certify signing keys<NEW_LINE>PGPSignatureSubpacketGenerator subHashedPacketsGen = new PGPSignatureSubpacketGenerator();<NEW_LINE>subHashedPacketsGen.setSignatureCreationTime(false, creationTime);<NEW_LINE>subSigGen.init(PGPSignature.PRIMARYKEY_BINDING, subPrivateKey);<NEW_LINE>subSigGen.setHashedSubpackets(subHashedPacketsGen.generate());<NEW_LINE>PGPSignature certification = subSigGen.generateCertification(masterPublicKey, pKey);<NEW_LINE>unhashedPacketsGen.setEmbeddedSignature(true, certification);<NEW_LINE>}<NEW_LINE>PGPSignatureSubpacketGenerator hashedPacketsGen;<NEW_LINE>{<NEW_LINE>hashedPacketsGen = new PGPSignatureSubpacketGenerator();<NEW_LINE>hashedPacketsGen.setSignatureCreationTime(true, creationTime);<NEW_LINE>hashedPacketsGen.setKeyFlags(true, flags);<NEW_LINE>if (expiry > 0) {<NEW_LINE>hashedPacketsGen.setKeyExpirationTime(true, expiry - pKey.getCreationTime().getTime() / 1000);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sGen.init(PGPSignature.SUBKEY_BINDING, masterPrivateKey);<NEW_LINE>sGen.<MASK><NEW_LINE>sGen.setUnhashedSubpackets(unhashedPacketsGen.generate());<NEW_LINE>return sGen.generateCertification(masterPublicKey, pKey);<NEW_LINE>}
setHashedSubpackets(hashedPacketsGen.generate());
413,225
private void coldStartServer() {<NEW_LINE>Future<Result> startFuture = server.start(new String[] { "--clean" });<NEW_LINE>try {<NEW_LINE>result = startFuture.get(SERVER_START_TIMEOUT, SERVER_START_TIMEOUT_UNIT);<NEW_LINE>dumpResult("Starting a server", result);<NEW_LINE>Assert.assertTrue("Result of first start attempt should be successful", result.successful());<NEW_LINE>Assert.assertEquals("Should have an OK return code", ReturnCode.OK.getValue(), result.getReturnCode());<NEW_LINE>} catch (AssertionFailedError e) {<NEW_LINE>failures.add(e);<NEW_LINE>Log.error(c, CURRENT_METHOD_NAME, e);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>failures.add(new AssertionFailedError("Start operation did not complete normally: " + e));<NEW_LINE>Log.error(c, CURRENT_METHOD_NAME, e);<NEW_LINE>startFuture.cancel(true);<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>failures.add(<MASK><NEW_LINE>Log.error(c, CURRENT_METHOD_NAME, e);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>failures.add(new AssertionFailedError("The start operation did not complete within the timeout"));<NEW_LINE>Log.error(c, CURRENT_METHOD_NAME, e);<NEW_LINE>// Dumping stack here because otherwise we don't have much information on why this timed out.<NEW_LINE>Thread.dumpStack();<NEW_LINE>}<NEW_LINE>// server should be started<NEW_LINE>checkServerRunning(true);<NEW_LINE>}
new AssertionFailedError("Start operation could not be queued: " + e));
273,490
public void init(final int sleepListenerMillisConfig) {<NEW_LINE>sleepListenerMillis = sleepListenerMillisConfig;<NEW_LINE>Configuration configuration;<NEW_LINE>// EsperHA enablement - if available<NEW_LINE>try {<NEW_LINE>Class configurationHAClass = Class.forName("com.espertech.esperha.client.ConfigurationHA");<NEW_LINE>configuration = (Configuration) configurationHAClass.newInstance();<NEW_LINE>System.out.println("=== EsperHA is available, using ConfigurationHA ===");<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>configuration = new Configuration();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>System.err.println("Could not properly determine if EsperHA is available, default to Esper");<NEW_LINE>t.printStackTrace();<NEW_LINE>configuration = new Configuration();<NEW_LINE>}<NEW_LINE>configuration.getCommon().<MASK><NEW_LINE>// EsperJMX enablement - if available<NEW_LINE>try {<NEW_LINE>Class.forName("com.espertech.esper.jmx.client.EsperJMXPlugin");<NEW_LINE>// will use platform mbean - should enable platform mbean connector in startup command line<NEW_LINE>configuration.getRuntime().// will use platform mbean - should enable platform mbean connector in startup command line<NEW_LINE>addPluginLoader(// will use platform mbean - should enable platform mbean connector in startup command line<NEW_LINE>"EsperJMX", // will use platform mbean - should enable platform mbean connector in startup command line<NEW_LINE>"com.espertech.esper.jmx.client.EsperJMXPlugin", null);<NEW_LINE>System.out.println("=== EsperJMX is available, using platform mbean ===");<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>}<NEW_LINE>runtime = EPRuntimeProvider.getRuntime("benchmark", configuration);<NEW_LINE>updateListener = new MyUpdateListener();<NEW_LINE>subscriber = new MySubscriber();<NEW_LINE>}
addEventType("Market", MarketData.class);
237,522
// FIXME <REFACTOR> <S><NEW_LINE>@Override<NEW_LINE>public void allocate(Object objectReference, long batchSize) {<NEW_LINE>long newBufferSize = 0;<NEW_LINE>if (batchSize > 0) {<NEW_LINE>newBufferSize = sizeOfBatch(batchSize);<NEW_LINE>}<NEW_LINE>if ((batchSize > 0) && (bufferOffset != -1) && (newBufferSize < bytesToAllocate)) {<NEW_LINE>bytesToAllocate = newBufferSize;<NEW_LINE>}<NEW_LINE>if (bufferOffset == -1) {<NEW_LINE>final T hostArray = cast(objectReference);<NEW_LINE>if (batchSize <= 0) {<NEW_LINE>bytesToAllocate = sizeOf(hostArray);<NEW_LINE>} else {<NEW_LINE>bytesToAllocate = sizeOfBatch(batchSize);<NEW_LINE>}<NEW_LINE>if (bytesToAllocate <= 0) {<NEW_LINE>throw new TornadoMemoryException("[ERROR] Bytes Allocated <= 0: " + bytesToAllocate);<NEW_LINE>}<NEW_LINE>bufferOffset = deviceContext.getMemoryManager().tryAllocate(bytesToAllocate, arrayHeaderSize, getAlignment());<NEW_LINE>if (Tornado.FULL_DEBUG) {<NEW_LINE>info("allocated: array kind=%s, size=%s, length offset=%d, header size=%d, bo=0x%x", kind.getJavaName(), humanReadableByteCount(bytesToAllocate, true), arrayLengthOffset, arrayHeaderSize, bufferOffset);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
info("allocated: %s", toString());
1,065,292
protected static void extractEnumerations(CoreMap s, List<Mention> mentions, Set<IntPair> mentionSpanSet, Set<IntPair> namedEntitySpanSet) {<NEW_LINE>List<CoreLabel> sent = s.get(CoreAnnotations.TokensAnnotation.class);<NEW_LINE>Tree tree = s.get(TreeCoreAnnotations.TreeAnnotation.class);<NEW_LINE>SemanticGraph basicDependency = s.get(SemanticGraphCoreAnnotations.BasicDependenciesAnnotation.class);<NEW_LINE>SemanticGraph enhancedDependency = s.get(SemanticGraphCoreAnnotations.EnhancedDependenciesAnnotation.class);<NEW_LINE>if (enhancedDependency == null) {<NEW_LINE>enhancedDependency = s.get(SemanticGraphCoreAnnotations.BasicDependenciesAnnotation.class);<NEW_LINE>}<NEW_LINE>TregexPattern tgrepPattern = enumerationsMentionPattern;<NEW_LINE>TregexMatcher matcher = tgrepPattern.matcher(tree);<NEW_LINE>Map<IntPair, Tree> spanToMentionSubTree = Generics.newHashMap();<NEW_LINE>while (matcher.find()) {<NEW_LINE>matcher.getMatch();<NEW_LINE>Tree m1 = matcher.getNode("m1");<NEW_LINE>Tree m2 = matcher.getNode("m2");<NEW_LINE>List<Tree> mLeaves = m1.getLeaves();<NEW_LINE>int beginIdx = ((CoreLabel) mLeaves.get(0).label()).get(CoreAnnotations.IndexAnnotation.class) - 1;<NEW_LINE>int endIdx = ((CoreLabel) mLeaves.get(mLeaves.size() - 1).label()).get(CoreAnnotations.IndexAnnotation.class);<NEW_LINE>spanToMentionSubTree.put(new IntPair(beginIdx, endIdx), m1);<NEW_LINE>mLeaves = m2.getLeaves();<NEW_LINE>beginIdx = ((CoreLabel) mLeaves.get(0).label()).get(CoreAnnotations.IndexAnnotation.class) - 1;<NEW_LINE>endIdx = ((CoreLabel) mLeaves.get(mLeaves.size() - 1).label()).get(CoreAnnotations.IndexAnnotation.class);<NEW_LINE>spanToMentionSubTree.put(new IntPair<MASK><NEW_LINE>}<NEW_LINE>for (Map.Entry<IntPair, Tree> spanMention : spanToMentionSubTree.entrySet()) {<NEW_LINE>IntPair span = spanMention.getKey();<NEW_LINE>if (!mentionSpanSet.contains(span) && !insideNE(span, namedEntitySpanSet)) {<NEW_LINE>int dummyMentionId = -1;<NEW_LINE>Mention m = new Mention(dummyMentionId, span.get(0), span.get(1), sent, basicDependency, enhancedDependency, new ArrayList<>(sent.subList(span.get(0), span.get(1))), spanMention.getValue());<NEW_LINE>mentions.add(m);<NEW_LINE>mentionSpanSet.add(span);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(beginIdx, endIdx), m2);
924,908
public UpdateNetworkConfigurationInput unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateNetworkConfigurationInput updateNetworkConfigurationInput = new UpdateNetworkConfigurationInput();<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("SecurityGroupIds", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateNetworkConfigurationInput.setSecurityGroupIds(new ListUnmarshaller<String>(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 updateNetworkConfigurationInput;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,211,010
public CloudWatchLogsConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CloudWatchLogsConfiguration cloudWatchLogsConfiguration = new CloudWatchLogsConfiguration();<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("Enabled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cloudWatchLogsConfiguration.setEnabled(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("LogStreams", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cloudWatchLogsConfiguration.setLogStreams(new ListUnmarshaller<CloudWatchLogsLogStream>(CloudWatchLogsLogStreamJsonUnmarshaller.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 cloudWatchLogsConfiguration;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,697,528
private void buildNOCMorNOCS(String string) {<NEW_LINE>if (string == null) {<NEW_LINE>buffer.writeShort(0xffff);<NEW_LINE>// write2Bytes(0xffff);<NEW_LINE>} else {<NEW_LINE>if (Typdef.typdef.isCcsidMbcSet()) {<NEW_LINE>byte[] sqlBytes = string.getBytes(Typdef.typdef.getCcsidMbcEncoding());<NEW_LINE>buffer.writeByte(0x00);<NEW_LINE>// write1Byte(0x00);<NEW_LINE>buffer.writeInt(sqlBytes.length);<NEW_LINE>// write4Bytes(sqlBytes.length);<NEW_LINE>buffer.writeBytes(sqlBytes);<NEW_LINE>// writeBytes(sqlBytes, sqlBytes.length);<NEW_LINE>buffer.writeByte(0xff);<NEW_LINE>// write1Byte(0xff);<NEW_LINE>} else {<NEW_LINE>byte[] sqlBytes = string.getBytes(<MASK><NEW_LINE>buffer.writeByte(0xff);<NEW_LINE>buffer.writeByte(0x00);<NEW_LINE>// write1Byte(0xff);<NEW_LINE>// write1Byte(0x00);<NEW_LINE>buffer.writeInt(sqlBytes.length);<NEW_LINE>// write4Bytes(sqlBytes.length);<NEW_LINE>buffer.writeBytes(sqlBytes);<NEW_LINE>// writeBytes(sqlBytes, sqlBytes.length);<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Typdef.typdef.getCcsidSbcEncoding());
134,795
public void marshall(CreateInferenceSchedulerRequest createInferenceSchedulerRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createInferenceSchedulerRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createInferenceSchedulerRequest.getModelName(), MODELNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInferenceSchedulerRequest.getInferenceSchedulerName(), INFERENCESCHEDULERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInferenceSchedulerRequest.getDataDelayOffsetInMinutes(), DATADELAYOFFSETINMINUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInferenceSchedulerRequest.getDataUploadFrequency(), DATAUPLOADFREQUENCY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInferenceSchedulerRequest.getDataInputConfiguration(), DATAINPUTCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInferenceSchedulerRequest.getDataOutputConfiguration(), DATAOUTPUTCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInferenceSchedulerRequest.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInferenceSchedulerRequest.getServerSideKmsKeyId(), SERVERSIDEKMSKEYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInferenceSchedulerRequest.getClientToken(), CLIENTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createInferenceSchedulerRequest.getTags(), TAGS_BINDING);
104,679
private void copyRemoteFolderToLocalFolder(File localFolder, File remoteBaseFolder) throws SharedConfigurationException {<NEW_LINE>logger.log(Level.INFO, "Downloading {0} from {1}", new Object[] { localFolder.getAbsolutePath(), remoteBaseFolder.getAbsolutePath() });<NEW_LINE>// Clean out the local folder regardless of whether the remote version exists. leave the<NEW_LINE>// folder in place since Autopsy expects it to exist.<NEW_LINE>if (localFolder.exists()) {<NEW_LINE>try {<NEW_LINE>FileUtils.cleanDirectory(localFolder);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.log(Level.SEVERE, <MASK><NEW_LINE>throw new SharedConfigurationException(String.format("Failed to delete files from local folder {0}", localFolder.getAbsolutePath()), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>File remoteSubFolder = new File(remoteBaseFolder, localFolder.getName());<NEW_LINE>if (!remoteSubFolder.exists()) {<NEW_LINE>logger.log(Level.INFO, "{0} does not exist", remoteSubFolder.getAbsolutePath());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>FileUtils.copyDirectory(remoteSubFolder, localFolder);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new SharedConfigurationException(String.format("Failed to copy %s from %s", localFolder, remoteBaseFolder.getAbsolutePath()), ex);<NEW_LINE>}<NEW_LINE>}
"Failed to delete files from local folder {0}", localFolder.getAbsolutePath());
1,597,991
protected NDList forwardInternal(ParameterStore ps, NDList inputs, boolean training, PairList<String, Object> params) {<NEW_LINE>// (B, S, E)<NEW_LINE>NDArray sequenceOutput = inputs.get(0);<NEW_LINE>// (B, I)<NEW_LINE>NDArray maskedIndices = inputs.get(1);<NEW_LINE>// (D, E)<NEW_LINE>NDArray embeddingTable = inputs.get(2);<NEW_LINE>try (NDManager scope = NDManager.subManagerOf(sequenceOutput)) {<NEW_LINE>scope.tempAttachAll(sequenceOutput, maskedIndices);<NEW_LINE>// (B * I, E)<NEW_LINE>NDArray gatheredTokens = gatherFromIndices(sequenceOutput, maskedIndices);<NEW_LINE>NDArray projectedTokens = hiddenActivation.apply(// (B * I, E)<NEW_LINE>sequenceProjection.forward(ps, new NDList(gatheredTokens), training).head());<NEW_LINE>NDArray normalizedTokens = // (B * I, E)<NEW_LINE>sequenceNorm.forward(ps, new NDList(projectedTokens), training).head();<NEW_LINE>// raw logits for each position to correspond to an entry in the embedding table<NEW_LINE>NDArray embeddingTransposed = embeddingTable.transpose();<NEW_LINE>embeddingTransposed.attach(gatheredTokens.getManager());<NEW_LINE>// (B * I, D)<NEW_LINE>NDArray logits = normalizedTokens.dot(embeddingTransposed);<NEW_LINE>// we add an offset for each dictionary entry<NEW_LINE>NDArray logitsWithBias = logits.add(// (B * I, D)<NEW_LINE>ps.// (B * I, D)<NEW_LINE>getValue(// (B * I, D)<NEW_LINE>dictionaryBias, // (B * I, D)<NEW_LINE>logits.getDevice(), training));<NEW_LINE>// now we apply log Softmax to get proper log probabilities<NEW_LINE>// (B * I, D)<NEW_LINE>NDArray <MASK><NEW_LINE>return scope.ret(new NDList(logProbs));<NEW_LINE>}<NEW_LINE>}
logProbs = logitsWithBias.logSoftmax(1);
1,784,146
public void initialize(@Nullable View view) {<NEW_LINE>Objects.requireNonNull(view);<NEW_LINE>mRoomsView = view.<MASK><NEW_LINE>mRoomsView.setChangeListener(() -> onChangeCounterValue(Statistics.EventParam.ROOMS, mRoomsView.getCurrentValue()));<NEW_LINE>mAdultsView = view.findViewById(R.id.adults);<NEW_LINE>mAdultsView.setChangeListener(() -> onChangeCounterValue(Statistics.EventParam.ADULTS, mAdultsView.getCurrentValue()));<NEW_LINE>mChildrenView = view.findViewById(R.id.children);<NEW_LINE>mChildrenView.setChangeListener(() -> onChangeCounterValue(Statistics.EventParam.CHILDREN, mChildrenView.getCurrentValue()));<NEW_LINE>mInfantsView = view.findViewById(R.id.infants);<NEW_LINE>mInfantsView.setChangeListener(() -> onChangeCounterValue(Statistics.EventParam.INFANTS, mInfantsView.getCurrentValue()));<NEW_LINE>}
findViewById(R.id.rooms);
840,190
final SetPlatformApplicationAttributesResult executeSetPlatformApplicationAttributes(SetPlatformApplicationAttributesRequest setPlatformApplicationAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setPlatformApplicationAttributesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetPlatformApplicationAttributesRequest> request = null;<NEW_LINE>Response<SetPlatformApplicationAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SetPlatformApplicationAttributesRequestMarshaller().marshall(super.beforeMarshalling(setPlatformApplicationAttributesRequest));<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, "SNS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetPlatformApplicationAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<SetPlatformApplicationAttributesResult> responseHandler = new StaxResponseHandler<SetPlatformApplicationAttributesResult>(new SetPlatformApplicationAttributesResultStaxUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
339,463
public void marshall(RuleGroupResponse ruleGroupResponse, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (ruleGroupResponse == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getRuleGroupArn(), RULEGROUPARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getRuleGroupName(), RULEGROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getRuleGroupId(), RULEGROUPID_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getCapacity(), CAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getRuleGroupStatus(), RULEGROUPSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getNumberOfAssociations(), NUMBEROFASSOCIATIONS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
ruleGroupResponse.getConsumedCapacity(), CONSUMEDCAPACITY_BINDING);
445,181
public void marshalConfigToProperties() {<NEW_LINE>if (DEBUG_LOGGING) {<NEW_LINE>logger.debug("marshalConfigToProperties({})", profileName);<NEW_LINE>}<NEW_LINE>loadedProps.put(KEY_LAST_PROFILE, profileName);<NEW_LINE>putProperty(loadedProps, KEY_SOURCE_LOCATIONS, StringUtil.listToText(sourceLocations, S_COMMA));<NEW_LINE>putProperty(loadedProps, KEY_CLASS_LOCATIONS, StringUtil.listToText(classLocations, S_COMMA));<NEW_LINE>putProperty(loadedProps, KEY_LAST_SANDBOX_EDITOR_PANES, StringUtil.listToText(editorPanes, S_COMMA));<NEW_LINE>putProperty(loadedProps, KEY_SHOW_JIT_ONLY_MEMBERS, Boolean.toString(showOnlyCompiledMembers));<NEW_LINE>putProperty(loadedProps, KEY_SHOW_JIT_ONLY_CLASSES, Boolean.toString(showOnlyCompiledClasses));<NEW_LINE>putProperty(loadedProps, KEY_SHOW_HIDE_INTERFACES, Boolean.toString(hideInterfaces));<NEW_LINE>putProperty(loadedProps, KEY_SHOW_NOTHING_MOUNTED, Boolean.toString(showNothingMounted));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_INTEL_MODE, Boolean.toString(intelMode));<NEW_LINE>putProperty(loadedProps, KEY_TRIVIEW_TRILINK_MOUSE_FOLLOW<MASK><NEW_LINE>putProperty(loadedProps, KEY_TRIVIEW_LOCAL_ASM_LABELS, Boolean.toString(localAsmLabels));<NEW_LINE>saveTieredCompilationMode();<NEW_LINE>saveCompressedOopsMode();<NEW_LINE>saveBackgroundCompilationMode();<NEW_LINE>saveOnStackReplacementMode();<NEW_LINE>if (lastLogDir != null) {<NEW_LINE>putProperty(loadedProps, KEY_LAST_LOG_DIR, lastLogDir);<NEW_LINE>}<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_FREQ_INLINE_SIZE, Integer.toString(freqInlineSize));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_MAX_INLINE_SIZE, Integer.toString(maxInlineSize));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_PRINT_ASSEMBLY, Boolean.toString(printAssembly));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_DISABLE_INLINING, Boolean.toString(disableInlining));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_COMPILER_THRESHOLD, Integer.toString(compileThreshold));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_EXTRA_VM_SWITCHES, extraVMSwitches);<NEW_LINE>putProperty(loadedProps, KEY_NO_PROMPT_HSDIS, Boolean.toString(noPromptHsdis));<NEW_LINE>}
, Boolean.toString(mouseFollow));