idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
980,826
|
void freeLocationListeners() {<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, "freeLocationListeners");<NEW_LINE>if (locationListeners != null) {<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {<NEW_LINE>// Android Lint claims we need location permission for LocationManager.removeUpdates().<NEW_LINE>// also see<NEW_LINE>// http://stackoverflow.com/questions/32715189/location-manager-remove-updates-permission<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, "check for location permissions");<NEW_LINE>boolean has_coarse_location_permission = ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED;<NEW_LINE>boolean has_fine_location_permission = ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED;<NEW_LINE>if (MyDebug.LOG) {<NEW_LINE>Log.d(TAG, "has_coarse_location_permission? " + has_coarse_location_permission);<NEW_LINE>Log.d(TAG, "has_fine_location_permission? " + has_fine_location_permission);<NEW_LINE>}<NEW_LINE>// require at least one permission to be present<NEW_LINE>if (!has_coarse_location_permission && !has_fine_location_permission) {<NEW_LINE>if (MyDebug.LOG)<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < locationListeners.length; i++) {<NEW_LINE>locationManager.removeUpdates(locationListeners[i]);<NEW_LINE>locationListeners[i] = null;<NEW_LINE>}<NEW_LINE>locationListeners = null;<NEW_LINE>}<NEW_LINE>}
|
Log.d(TAG, "location permission not available");
|
1,189,484
|
public void onPreviewSizeChosen(final Size size, final int rotation) {<NEW_LINE>final float textSizePx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, TEXT_SIZE_DIP, getResources().getDisplayMetrics());<NEW_LINE>borderedText = new BorderedText(textSizePx);<NEW_LINE>borderedText.setTypeface(Typeface.MONOSPACE);<NEW_LINE>tracker = new MultiBoxTracker(this);<NEW_LINE>previewWidth = size.getWidth();<NEW_LINE>previewHeight = size.getHeight();<NEW_LINE>sensorOrientation = rotation - getScreenOrientation();<NEW_LINE>LOGGER.i("Camera orientation relative to screen canvas: %d", sensorOrientation);<NEW_LINE>LOGGER.<MASK><NEW_LINE>rgbFrameBitmap = Bitmap.createBitmap(previewWidth, previewHeight, Config.ARGB_8888);<NEW_LINE>recreateNetwork(getModel(), getDevice(), getNumThreads());<NEW_LINE>if (detector == null && autopilot == null) {<NEW_LINE>LOGGER.e("No network on preview!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>trackingOverlay = findViewById(R.id.tracking_overlay);<NEW_LINE>trackingOverlay.addCallback(new DrawCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void drawCallback(final Canvas canvas) {<NEW_LINE>tracker.draw(canvas);<NEW_LINE>if (isDebug()) {<NEW_LINE>tracker.drawDebug(canvas);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tracker.setFrameConfiguration(previewWidth, previewHeight, sensorOrientation);<NEW_LINE>}
|
i("Initializing at size %dx%d", previewWidth, previewHeight);
|
795,449
|
public ApiResponse<Void> testBodyWithQueryParamsWithHttpInfo(String query, User body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'query' is set<NEW_LINE>if (query == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling testBodyWithQueryParams");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/fake/body-with-query-params";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query));<NEW_LINE><MASK><NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false);<NEW_LINE>}
|
final String[] localVarAccepts = {};
|
351,457
|
public void removeAttribute(String name) {<NEW_LINE>synchronized (getSynchronizer()) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceEntry(this, "removeAttribute", name);<NEW_LINE>}<NEW_LINE>if (m_appDescriptor != null && m_appDescriptor.isJSR289Application()) {<NEW_LINE>// TODO this is temp if just to pass regression until it is fixed<NEW_LINE>checkIsSessionValid();<NEW_LINE>}<NEW_LINE>Set<String> attrMap = m_attributes;<NEW_LINE>if (attrMap == null || !attrMap.remove(name)) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceExit(this, "removeAttribute", name + " wasn't found. request ignored. " + this);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>EventsDispatcher.AppSessionAttributeBounding(this, name, m_appDescriptor, false);<NEW_LINE>Object attr = SessionRepository.getInstance(<MASK><NEW_LINE>if (attr == null) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceExit(this, "removeAttribute", name + " not removed, not found in SessionRepository " + this);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>sendAttributeNotification(name, LstNotificationType.APP_ATTRIBUTE_REMOVED);<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "removeAttribute", name + " calling to unbound, if attribute is a listener. " + attr);<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceExit(this, "removeAttribute", name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
).removeAttribute(this, name);
|
1,283,592
|
static String encodeValue(Object value) throws IOException {<NEW_LINE>ByteArrayOutputStream bos = new ByteArrayOutputStream();<NEW_LINE>try {<NEW_LINE>ObjectOutputStream oos = new ObjectOutputStream(bos);<NEW_LINE>oos.writeObject(value);<NEW_LINE>oos.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw (IOException) ExternalUtil.copyAnnotation(new IOException(), e);<NEW_LINE>}<NEW_LINE>byte[] bArray = bos.toByteArray();<NEW_LINE>StringBuffer strBuff = new <MASK><NEW_LINE>for (int i = 0; i < bArray.length; i++) {<NEW_LINE>if ((bArray[i] < 16) && (bArray[i] >= 0)) {<NEW_LINE>// NOI18N<NEW_LINE>strBuff.append("0");<NEW_LINE>}<NEW_LINE>strBuff.append(Integer.toHexString((bArray[i] < 0) ? (bArray[i] + 256) : bArray[i]));<NEW_LINE>}<NEW_LINE>return strBuff.toString();<NEW_LINE>}
|
StringBuffer(bArray.length * 2);
|
1,344,978
|
final ResetFpgaImageAttributeResult executeResetFpgaImageAttribute(ResetFpgaImageAttributeRequest resetFpgaImageAttributeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(resetFpgaImageAttributeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ResetFpgaImageAttributeRequest> request = null;<NEW_LINE>Response<ResetFpgaImageAttributeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ResetFpgaImageAttributeRequestMarshaller().marshall(super.beforeMarshalling(resetFpgaImageAttributeRequest));<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, "ResetFpgaImageAttribute");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ResetFpgaImageAttributeResult> responseHandler = new StaxResponseHandler<ResetFpgaImageAttributeResult>(new ResetFpgaImageAttributeResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
|
endClientExecution(awsRequestMetrics, request, response);
|
1,626,454
|
protected boolean beforeDelete() {<NEW_LINE>// Clean own index<NEW_LINE>MIndex.cleanUp(get_TrxName(), getAD_Client_ID(), <MASK><NEW_LINE>// Clean ElementIndex<NEW_LINE>MContainerElement[] theseElements = getAllElements();<NEW_LINE>if (theseElements != null) {<NEW_LINE>for (int i = 0; i < theseElements.length; i++) {<NEW_LINE>theseElements[i].delete(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>StringBuffer sb = new StringBuffer("DELETE FROM AD_TreeNodeCMC ").append(" WHERE Node_ID=").append(get_ID()).append(" AND AD_Tree_ID=").append(getAD_Tree_ID());<NEW_LINE>int no = DB.executeUpdate(sb.toString(), get_TrxName());<NEW_LINE>if (no > 0)<NEW_LINE>log.debug("#" + no + " - TreeType=CMC");<NEW_LINE>else<NEW_LINE>log.warn("#" + no + " - TreeType=CMC");<NEW_LINE>return no > 0;<NEW_LINE>}
|
get_Table_ID(), get_ID());
|
445,803
|
private static String detectDefaultWebBrowser() {<NEW_LINE>// XXX hotfix for #233047<NEW_LINE>// assert !EventQueue.isDispatchThread();<NEW_LINE>// #233145<NEW_LINE>if (!XDG_SETTINGS_AVAILABLE) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>OutputProcessorFactory outputProcessorFactory = new OutputProcessorFactory();<NEW_LINE>// NOI18N<NEW_LINE>ExternalProcessBuilder // NOI18N<NEW_LINE>processBuilder = // NOI18N<NEW_LINE>new ExternalProcessBuilder(XDG_SETTINGS_COMMAND).// NOI18N<NEW_LINE>addArgument(// NOI18N<NEW_LINE>"get").// NOI18N<NEW_LINE>addArgument("default-web-browser");<NEW_LINE>ExecutionDescriptor silentDescriptor = new ExecutionDescriptor().inputOutput(InputOutput.NULL).inputVisible(false).frontWindow(false).showProgress(false).outProcessorFactory(outputProcessorFactory);<NEW_LINE>// NOI18N<NEW_LINE>Future<Integer> // NOI18N<NEW_LINE>result = ExecutionService.newService(processBuilder, <MASK><NEW_LINE>try {<NEW_LINE>result.get(10, TimeUnit.SECONDS);<NEW_LINE>} catch (InterruptedException | ExecutionException | TimeoutException ex) {<NEW_LINE>LOGGER.log(Level.INFO, null, ex);<NEW_LINE>}<NEW_LINE>String output = outputProcessorFactory.getOutput();<NEW_LINE>if (output == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return output.toLowerCase(Locale.US);<NEW_LINE>}
|
silentDescriptor, "Detecting default web browser").run();
|
824,276
|
public static void main(String[] args) throws Exception {<NEW_LINE>TypeId<?> fibonacci = TypeId.get("Lcom/google/dexmaker/examples/Fibonacci;");<NEW_LINE>String fileName = "Fibonacci.generated";<NEW_LINE>DexMaker dexMaker = new DexMaker();<NEW_LINE>dexMaker.declare(fibonacci, fileName, Modifier.PUBLIC, TypeId.OBJECT);<NEW_LINE>MethodId<?, Integer> fib = fibonacci.getMethod(TypeId.INT, "fib", TypeId.INT);<NEW_LINE>Code code = dexMaker.declare(fib, Modifier.PUBLIC | Modifier.STATIC);<NEW_LINE>Local<Integer> i = code.getParameter(0, TypeId.INT);<NEW_LINE>Local<Integer> constant1 = code.newLocal(TypeId.INT);<NEW_LINE>Local<Integer> constant2 = code.newLocal(TypeId.INT);<NEW_LINE>Local<Integer> a = code.newLocal(TypeId.INT);<NEW_LINE>Local<Integer> b = code.newLocal(TypeId.INT);<NEW_LINE>Local<Integer> c = code.newLocal(TypeId.INT);<NEW_LINE>Local<Integer> d = code.newLocal(TypeId.INT);<NEW_LINE>Local<Integer> result = code.newLocal(TypeId.INT);<NEW_LINE>code.loadConstant(constant1, 1);<NEW_LINE><MASK><NEW_LINE>Label baseCase = new Label();<NEW_LINE>code.compare(Comparison.LT, baseCase, i, constant2);<NEW_LINE>code.op(BinaryOp.SUBTRACT, a, i, constant1);<NEW_LINE>code.op(BinaryOp.SUBTRACT, b, i, constant2);<NEW_LINE>code.invokeStatic(fib, c, a);<NEW_LINE>code.invokeStatic(fib, d, b);<NEW_LINE>code.op(BinaryOp.ADD, result, c, d);<NEW_LINE>code.returnValue(result);<NEW_LINE>code.mark(baseCase);<NEW_LINE>code.returnValue(i);<NEW_LINE>ClassLoader loader = dexMaker.generateAndLoad(FibonacciMaker.class.getClassLoader(), getDataDirectory());<NEW_LINE>Class<?> fibonacciClass = loader.loadClass("com.google.dexmaker.examples.Fibonacci");<NEW_LINE>Method fibMethod = fibonacciClass.getMethod("fib", int.class);<NEW_LINE>System.out.println(fibMethod.invoke(null, 8));<NEW_LINE>}
|
code.loadConstant(constant2, 2);
|
203,431
|
public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>waitForFlush_result result = new waitForFlush_result();<NEW_LINE>if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) {<NEW_LINE>result.sec = (org.apache.accumulo.core<MASK><NEW_LINE>result.setSecIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException) {<NEW_LINE>result.tope = (org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException) e;<NEW_LINE>result.setTopeIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) {<NEW_LINE>result.tnase = (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) e;<NEW_LINE>result.setTnaseIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>}
|
.clientImpl.thrift.ThriftSecurityException) e;
|
466,524
|
public static ListDepartmentsResponse unmarshall(ListDepartmentsResponse listDepartmentsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDepartmentsResponse.setRequestId(_ctx.stringValue("ListDepartmentsResponse.RequestId"));<NEW_LINE>listDepartmentsResponse.setCode(_ctx.stringValue("ListDepartmentsResponse.Code"));<NEW_LINE>listDepartmentsResponse.setMessage(_ctx.stringValue("ListDepartmentsResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalElements(_ctx.longValue("ListDepartmentsResponse.Data.TotalElements"));<NEW_LINE>data.setTotalPages(_ctx.integerValue("ListDepartmentsResponse.Data.TotalPages"));<NEW_LINE>List<ItemsItem> items = new ArrayList<ItemsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDepartmentsResponse.Data.Items.Length"); i++) {<NEW_LINE>ItemsItem itemsItem = new ItemsItem();<NEW_LINE>itemsItem.setCreatedAt(_ctx.stringValue("ListDepartmentsResponse.Data.Items[" + i + "].CreatedAt"));<NEW_LINE>itemsItem.setDescription(_ctx.stringValue("ListDepartmentsResponse.Data.Items[" + i + "].Description"));<NEW_LINE>itemsItem.setId(_ctx.stringValue("ListDepartmentsResponse.Data.Items[" + i + "].Id"));<NEW_LINE>itemsItem.setName(_ctx.stringValue<MASK><NEW_LINE>itemsItem.setUpdatedAt(_ctx.stringValue("ListDepartmentsResponse.Data.Items[" + i + "].UpdatedAt"));<NEW_LINE>List<AdministratorsItem> administrators = new ArrayList<AdministratorsItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListDepartmentsResponse.Data.Items[" + i + "].Administrators.Length"); j++) {<NEW_LINE>AdministratorsItem administratorsItem = new AdministratorsItem();<NEW_LINE>administratorsItem.setId(_ctx.stringValue("ListDepartmentsResponse.Data.Items[" + i + "].Administrators[" + j + "].Id"));<NEW_LINE>administratorsItem.setName(_ctx.stringValue("ListDepartmentsResponse.Data.Items[" + i + "].Administrators[" + j + "].Name"));<NEW_LINE>administrators.add(administratorsItem);<NEW_LINE>}<NEW_LINE>itemsItem.setAdministrators(administrators);<NEW_LINE>items.add(itemsItem);<NEW_LINE>}<NEW_LINE>data.setItems(items);<NEW_LINE>listDepartmentsResponse.setData(data);<NEW_LINE>return listDepartmentsResponse;<NEW_LINE>}
|
("ListDepartmentsResponse.Data.Items[" + i + "].Name"));
|
150,463
|
protected void configureGraphicalViewer() {<NEW_LINE>super.configureGraphicalViewer();<NEW_LINE>DiagramEditorContextMenuProvider provider = new DiagramEditorContextMenuProvider(this, getDiagramGraphicalViewer());<NEW_LINE>getDiagramGraphicalViewer().setContextMenu(provider);<NEW_LINE>getSite().registerContextMenu(ActionIds.<MASK><NEW_LINE>// Custom code begin<NEW_LINE>// Allow Enter key to open a figure's sub-diagram as with GMF 2.2.2 it has been found<NEW_LINE>// to be cumbersome to double-click on the figure.<NEW_LINE>org.eclipse.gmf.runtime.diagram.ui.internal.actions.OpenAction action = new org.eclipse.gmf.runtime.diagram.ui.internal.actions.OpenAction(((org.eclipse.ui.IWorkbenchPart) this).getSite().getPage());<NEW_LINE>action.init();<NEW_LINE>org.eclipse.gef.ui.actions.ActionRegistry registry = getActionRegistry();<NEW_LINE>registry.registerAction(action);<NEW_LINE>getSelectionActions().add(action.getId());<NEW_LINE>getKeyHandler().put(org.eclipse.gef.KeyStroke.getPressed(org.eclipse.swt.SWT.CR, '\r', 0), action);<NEW_LINE>getKeyHandler().put(org.eclipse.gef.KeyStroke.getPressed(org.eclipse.swt.SWT.CR, org.eclipse.swt.SWT.KEYPAD_CR, 0), action);<NEW_LINE>// Custom code end<NEW_LINE>// Custom code begin<NEW_LINE>org.eclipse.ui.IWorkbenchPage page = getSite().getPage();<NEW_LINE>org.eclipse.ui.IPartListener2 listener = new com.ociweb.gmf.part.SaveOnDeactivationListener(this, ID, OpenDDSDiagramEditorPlugin.getInstance());<NEW_LINE>page.addPartListener(listener);<NEW_LINE>// Custom code end<NEW_LINE>}
|
DIAGRAM_EDITOR_CONTEXT_MENU, provider, getDiagramGraphicalViewer());
|
427,088
|
public ExponentialHistogramAccumulation diff(ExponentialHistogramAccumulation previousCumulative, ExponentialHistogramAccumulation currentCumulative) {<NEW_LINE>double sum = currentCumulative.getSum<MASK><NEW_LINE>long zeroCount = currentCumulative.getZeroCount() - previousCumulative.getZeroCount();<NEW_LINE>DoubleExponentialHistogramBuckets posBuckets = DoubleExponentialHistogramBuckets.diff(currentCumulative.getPositiveBuckets(), previousCumulative.getPositiveBuckets());<NEW_LINE>DoubleExponentialHistogramBuckets negBuckets = DoubleExponentialHistogramBuckets.diff(currentCumulative.getNegativeBuckets(), previousCumulative.getNegativeBuckets());<NEW_LINE>// resolve possible scale difference due to merge<NEW_LINE>int commonScale = Math.min(posBuckets.getScale(), negBuckets.getScale());<NEW_LINE>posBuckets.downscale(posBuckets.getScale() - commonScale);<NEW_LINE>negBuckets.downscale(negBuckets.getScale() - commonScale);<NEW_LINE>return ExponentialHistogramAccumulation.create(posBuckets.getScale(), sum, posBuckets, negBuckets, zeroCount, currentCumulative.getExemplars());<NEW_LINE>}
|
() - previousCumulative.getSum();
|
379,201
|
public BlockPositionIterator collidableBlocksIterator(BoundingBox box) {<NEW_LINE>Vector3d position = Vector3d.from(box.getMiddleX(), box.getMiddleY() - (box.getSizeY() / 2), box.getMiddleZ());<NEW_LINE>// Expand volume by 1 in each direction to include moving blocks<NEW_LINE>double pistonExpand = session.getPistonCache().getPistons().isEmpty() ? 0 : 1;<NEW_LINE>// Loop through all blocks that could collide<NEW_LINE>int minCollisionX = (int) Math.floor(position.getX() - ((box.getSizeX() / 2) + COLLISION_TOLERANCE + pistonExpand));<NEW_LINE>int maxCollisionX = (int) Math.floor(position.getX() + (box.getSizeX() / 2) + COLLISION_TOLERANCE + pistonExpand);<NEW_LINE>// Y extends 0.5 blocks down because of fence hitboxes<NEW_LINE>int minCollisionY = (int) Math.floor(position.getY() - 0.5 - COLLISION_TOLERANCE - pistonExpand / 2.0);<NEW_LINE>int maxCollisionY = (int) Math.floor(position.getY() + box.getSizeY() + pistonExpand);<NEW_LINE>int minCollisionZ = (int) Math.floor(position.getZ() - ((box.getSizeZ() / 2) + COLLISION_TOLERANCE + pistonExpand));<NEW_LINE>int maxCollisionZ = (int) Math.floor(position.getZ() + (box.getSizeZ() <MASK><NEW_LINE>return new BlockPositionIterator(minCollisionX, minCollisionY, minCollisionZ, maxCollisionX, maxCollisionY, maxCollisionZ);<NEW_LINE>}
|
/ 2) + COLLISION_TOLERANCE + pistonExpand);
|
1,512,520
|
public static void main(String[] args) throws Exception {<NEW_LINE>WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();<NEW_LINE>MainDocumentPart wordDocumentPart = wordMLPackage.getMainDocumentPart();<NEW_LINE>// Get vbaProject.bin, and attach it to wordDocumentPart<NEW_LINE>java.io.InputStream is = new java.io.FileInputStream(System.getProperty("user.dir") + "/vbaProject.bin");<NEW_LINE>org.docx4j.openpackaging.parts.WordprocessingML.VbaProjectBinaryPart vbaProject = new org.docx4j.openpackaging<MASK><NEW_LINE>vbaProject.setBinaryData(is);<NEW_LINE>wordDocumentPart.addTargetPart(vbaProject);<NEW_LINE>// Get /word/vbaData.xml, and attach it to vbaProject<NEW_LINE>org.docx4j.openpackaging.parts.WordprocessingML.VbaDataPart vbaData = new org.docx4j.openpackaging.parts.WordprocessingML.VbaDataPart();<NEW_LINE>java.io.InputStream is2 = new java.io.FileInputStream(System.getProperty("user.dir") + "/vbaData.xml");<NEW_LINE>vbaData.unmarshal(is2);<NEW_LINE>// vbaData.setDocument( is2 );<NEW_LINE>vbaProject.addTargetPart(vbaData);<NEW_LINE>// Change the Word document's content type!<NEW_LINE>wordDocumentPart.setContentType(new org.docx4j.openpackaging.contenttype.ContentType(org.docx4j.openpackaging.contenttype.ContentTypes.WORDPROCESSINGML_DOCUMENT_MACROENABLED));<NEW_LINE>// .. but that's a dumb setter right now :(<NEW_LINE>org.docx4j.openpackaging.contenttype.ContentTypeManager ctm = wordMLPackage.getContentTypeManager();<NEW_LINE>org.docx4j.openpackaging.parts.PartName partName = wordDocumentPart.getPartName();<NEW_LINE>ctm.removeContentType(partName);<NEW_LINE>ctm.addOverrideContentType(new java.net.URI("/word/document.xml"), org.docx4j.openpackaging.contenttype.ContentTypes.WORDPROCESSINGML_DOCUMENT_MACROENABLED);<NEW_LINE>// Save it<NEW_LINE>String filename = System.getProperty("user.dir") + "/OUT_MacroAdd.docm";<NEW_LINE>wordMLPackage.save(new java.io.File(filename));<NEW_LINE>System.out.println("Saved " + filename);<NEW_LINE>}
|
.parts.WordprocessingML.VbaProjectBinaryPart();
|
330,796
|
public Change createChange(IProgressMonitor pm) throws CoreException {<NEW_LINE>final Map<String, String> arguments = new HashMap<>();<NEW_LINE>String project = null;<NEW_LINE>IJavaProject javaProject = fField.getJavaProject();<NEW_LINE>if (javaProject != null) {<NEW_LINE>project = javaProject.getElementName();<NEW_LINE>}<NEW_LINE>int flags = JavaRefactoringDescriptor.JAR_MIGRATION | JavaRefactoringDescriptor.JAR_REFACTORING | RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE;<NEW_LINE>final IType declaring = fField.getDeclaringType();<NEW_LINE>try {<NEW_LINE>if (declaring.isAnonymous() || declaring.isLocal()) {<NEW_LINE>flags |= JavaRefactoringDescriptor.JAR_SOURCE_ATTACHMENT;<NEW_LINE>}<NEW_LINE>} catch (JavaModelException exception) {<NEW_LINE>JavaLanguageServerPlugin.log(exception);<NEW_LINE>}<NEW_LINE>final String description = Messages.format(RefactoringCoreMessages.SelfEncapsulateField_descriptor_description_short, BasicElementLabels.getJavaElementName(fField.getElementName()));<NEW_LINE>final String header = Messages.format(RefactoringCoreMessages.SelfEncapsulateFieldRefactoring_descriptor_description, new String[] { JavaElementLabels.getElementLabel(fField, JavaElementLabels.ALL_FULLY_QUALIFIED), JavaElementLabels.getElementLabel(declaring, JavaElementLabels.ALL_FULLY_QUALIFIED) });<NEW_LINE>final JDTRefactoringDescriptorComment comment = new JDTRefactoringDescriptorComment(project, this, header);<NEW_LINE>comment.addSetting(Messages.format(RefactoringCoreMessages.SelfEncapsulateField_original_pattern, JavaElementLabels.getElementLabel(fField, JavaElementLabels.ALL_FULLY_QUALIFIED)));<NEW_LINE>comment.addSetting(Messages.format(RefactoringCoreMessages.SelfEncapsulateField_getter_pattern, BasicElementLabels.getJavaElementName(fGetterName)));<NEW_LINE>comment.addSetting(Messages.format(RefactoringCoreMessages.SelfEncapsulateField_setter_pattern, BasicElementLabels.getJavaElementName(fSetterName)));<NEW_LINE>String visibility = JdtFlags.getVisibilityString(fVisibility);<NEW_LINE>if ("".equals(visibility)) {<NEW_LINE>visibility = RefactoringCoreMessages.SelfEncapsulateField_default_visibility;<NEW_LINE>}<NEW_LINE>comment.addSetting(Messages.format(RefactoringCoreMessages.SelfEncapsulateField_visibility_pattern, visibility));<NEW_LINE>if (fEncapsulateDeclaringClass) {<NEW_LINE>comment.addSetting(RefactoringCoreMessages.SelfEncapsulateField_use_accessors);<NEW_LINE>} else {<NEW_LINE>comment.addSetting(RefactoringCoreMessages.SelfEncapsulateField_do_not_use_accessors);<NEW_LINE>}<NEW_LINE>if (fGenerateJavadoc) {<NEW_LINE>comment.addSetting(RefactoringCoreMessages.SelfEncapsulateField_generate_comments);<NEW_LINE>}<NEW_LINE>final EncapsulateFieldDescriptor descriptor = RefactoringSignatureDescriptorFactory.createEncapsulateFieldDescriptor(project, description, comment.asString(), arguments, flags);<NEW_LINE>arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT, JavaRefactoringDescriptorUtil<MASK><NEW_LINE>arguments.put(ATTRIBUTE_VISIBILITY, Integer.valueOf(fVisibility).toString());<NEW_LINE>arguments.put(ATTRIBUTE_INSERTION, Integer.valueOf(fInsertionIndex).toString());<NEW_LINE>arguments.put(ATTRIBUTE_SETTER, fSetterName);<NEW_LINE>arguments.put(ATTRIBUTE_GETTER, fGetterName);<NEW_LINE>arguments.put(ATTRIBUTE_COMMENTS, Boolean.valueOf(fGenerateJavadoc).toString());<NEW_LINE>arguments.put(ATTRIBUTE_DECLARING, Boolean.valueOf(fEncapsulateDeclaringClass).toString());<NEW_LINE>final DynamicValidationRefactoringChange result = new DynamicValidationRefactoringChange(descriptor, getName());<NEW_LINE>TextChange[] changes = fChangeManager.getAllChanges();<NEW_LINE>pm.beginTask(NO_NAME, changes.length);<NEW_LINE>pm.setTaskName(RefactoringCoreMessages.SelfEncapsulateField_create_changes);<NEW_LINE>for (int i = 0; i < changes.length; i++) {<NEW_LINE>result.add(changes[i]);<NEW_LINE>pm.worked(1);<NEW_LINE>}<NEW_LINE>pm.done();<NEW_LINE>return result;<NEW_LINE>}
|
.elementToHandle(project, fField));
|
1,791,686
|
private Object executeScriptEngine(MHRConcept concept, MRule rule, String columnType) {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>Object result = null;<NEW_LINE>try {<NEW_LINE>String text = "";<NEW_LINE>if (rule.getScript() != null) {<NEW_LINE>text = rule.getScript().trim().replaceAll("\\bget", "process.get").replace(".process.get", ".get");<NEW_LINE>}<NEW_LINE>final String script = s_scriptImport.toString() + Env.NL + text;<NEW_LINE>ScriptEngine engine = rule.getScriptEngine();<NEW_LINE>final ScriptContext context = new SimpleScriptContext();<NEW_LINE>scriptCtx.entrySet().stream().forEach(entry -> context.setAttribute(entry.getKey(), entry.getValue(), ScriptContext.ENGINE_SCOPE));<NEW_LINE>context.setAttribute("description", "", ScriptContext.ENGINE_SCOPE);<NEW_LINE>// Yamel Senih Add DefValue to another Types<NEW_LINE>Object defaultValue = 0.0;<NEW_LINE>if (MHRAttribute.COLUMNTYPE_Date.equals(columnType) || MHRAttribute.COLUMNTYPE_Text.equals(columnType)) {<NEW_LINE>defaultValue = null;<NEW_LINE>}<NEW_LINE>context.setAttribute(<MASK><NEW_LINE>result = engine.eval(script, context);<NEW_LINE>if (result != null && "@Error@".equals(result.toString())) {<NEW_LINE>throw new AdempiereException("@AD_Rule_ID@ @HR_Concept_ID@ " + concept.getValue() + "" + concept.getName() + " @@Error@ " + result);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>description = context.getAttribute("description");<NEW_LINE>long elapsed = System.currentTimeMillis() - startTime;<NEW_LINE>logger.info("ScriptResult -> Concept Name " + concept.getName() + " = " + result + " Time elapsed: " + TimeUtil.formatElapsed(elapsed));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AdempiereException(e.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
"result", defaultValue, ScriptContext.ENGINE_SCOPE);
|
1,526,386
|
public Response findPermissonsOn(@PathParam("dvo") String dvo) {<NEW_LINE>try {<NEW_LINE>DvObject dvObj = findDvo(dvo);<NEW_LINE>if (dvObj == null) {<NEW_LINE>return notFound("DvObject " + dvo + " not found");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>User aUser = findUserOrDie();<NEW_LINE>JsonObjectBuilder bld = Json.createObjectBuilder();<NEW_LINE>bld.add("user", aUser.getIdentifier());<NEW_LINE>bld.add("permissions", json(permissionSvc.permissionsFor(createDataverseRequest(aUser), dvObj)));<NEW_LINE>return ok(bld);<NEW_LINE>} catch (WrappedResponse wr) {<NEW_LINE>return wr.getResponse();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.log(Level.SEVERE, "Error while testing permissions", e);<NEW_LINE>return error(Response.Status.<MASK><NEW_LINE>}<NEW_LINE>}
|
INTERNAL_SERVER_ERROR, e.getMessage());
|
1,183,514
|
public RelWriter explainTermsForDisplay(RelWriter pw) {<NEW_LINE>pw.item(RelDrdsWriter.REL_NAME, explainNodeName());<NEW_LINE>if (isUpdate()) {<NEW_LINE>pw.item("TYPE", "UPDATE");<NEW_LINE>StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>for (int i = 0; i < getUpdateColumnList().size(); i++) {<NEW_LINE>stringBuilder.append(getTargetTableNames().get(i));<NEW_LINE>stringBuilder.append(".");<NEW_LINE>stringBuilder.append(getUpdateColumnList().get(i));<NEW_LINE>stringBuilder.append("=");<NEW_LINE>stringBuilder.append(getSourceExpressionList().get(i));<NEW_LINE>if (i < getUpdateColumnList().size() - 1) {<NEW_LINE>stringBuilder.append(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pw.item("SET", stringBuilder.toString());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>pw.item("TABLES", getTargetTables().stream().map(t -> String.join(".", t.getQualifiedName())).collect(Collectors.joining(", ")));<NEW_LINE>}<NEW_LINE>return pw;<NEW_LINE>}
|
pw.item("TYPE", "DELETE");
|
411,729
|
// Actions -- Menu selections<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>JMenuItem source = (JMenuItem<MASK><NEW_LINE>if (source.getText().equals(NbBundle.getMessage(QueryBuilder.class, "PARSE_QUERY"))) {<NEW_LINE>// NOI18N<NEW_LINE>String currentQuery = this.getText();<NEW_LINE>if ((currentQuery != null) && (currentQuery.trim().length() != 0)) {<NEW_LINE>QueryBuilder.showBusyCursor(true);<NEW_LINE>_queryBuilder.populate(currentQuery, true);<NEW_LINE>QueryBuilder.showBusyCursor(false);<NEW_LINE>}<NEW_LINE>} else if (source.getText().equals(NbBundle.getMessage(QueryBuilder.class, "RUN_QUERY"))) {<NEW_LINE>// NOI18N<NEW_LINE>String currentQuery = this.getText();<NEW_LINE>// if query is changed then parse it first<NEW_LINE>if ((currentQuery != null) && (currentQuery.trim().length() != 0)) {<NEW_LINE>// if query matches last good one, no need to parse<NEW_LINE>if (!(currentQuery.trim().equals(_lastGoodQuery))) {<NEW_LINE>QueryBuilder.showBusyCursor(true);<NEW_LINE>// run the query even if there is a parse error<NEW_LINE>// as this may be query not correctly parsed by the parser<NEW_LINE>// but still it may be a valid query which the user<NEW_LINE>// may want to run. See 6254361<NEW_LINE>_queryBuilder.populate(this.getText(), true);<NEW_LINE>QueryBuilder.showBusyCursor(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Execute the query<NEW_LINE>_queryBuilder.executeQuery(this.getText());<NEW_LINE>}<NEW_LINE>}
|
) (e.getSource());
|
379,882
|
public Set instantiate() throws IOException {<NEW_LINE>WebFragmentXmlWizardPanel1 panel = (WebFragmentXmlWizardPanel1) panels[0];<NEW_LINE>FileObject dir = panel.getSelectedLocation();<NEW_LINE>WebModule wm = panel.getWebModule();<NEW_LINE>// for Java Library projects, we suppose that the lastest JavaEE is used<NEW_LINE>Profile profile = wm != null ? wm.getJ2eeProfile() : Profile.JAVA_EE_7_FULL;<NEW_LINE>if (dir != null) {<NEW_LINE>try {<NEW_LINE>dir = Utils.createDirs(dir, new String[] { META_INF });<NEW_LINE>FileObject dd = DDHelper.createWebFragmentXml(profile, dir);<NEW_LINE>if (dd != null) {<NEW_LINE>DataObject dObj = DataObject.find(dd);<NEW_LINE>return Collections.singleton(dObj);<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger("global").log(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.EMPTY_SET;<NEW_LINE>}
|
Level.INFO, "Creation of web-fragment.xml failed", ioe);
|
182,128
|
public void run(RegressionEnvironment env) {<NEW_LINE>if (TEST_MVEL) {<NEW_LINE>tryParseMVEL(env, "\n\t 10 \n\n\t\t", Integer.class, 10);<NEW_LINE>tryParseMVEL(env, "10", Integer.class, 10);<NEW_LINE>tryParseMVEL(env, "5*5", Integer.class, 25);<NEW_LINE>tryParseMVEL(env, "\"abc\"", String.class, "abc");<NEW_LINE>tryParseMVEL(env, " \"abc\" ", String.class, "abc");<NEW_LINE>tryParseMVEL(env, "'def'", String.class, "def");<NEW_LINE>tryParseMVEL(env, " 'def' ", String.class, "def");<NEW_LINE>tryParseMVEL(env, " new String[] {'a'}", String[].class, new String[] { "a" });<NEW_LINE>}<NEW_LINE>tryParseJS(env, "\n\t 10.0 \n\n\t\t", Object.class, 10.0);<NEW_LINE>tryParseJS(env, "10.0", Object.class, 10.0);<NEW_LINE>tryParseJS(env, "5*5.0", Object.class, 25.0);<NEW_LINE>tryParseJS(env, "\"abc\"", Object.class, "abc");<NEW_LINE>tryParseJS(env, <MASK><NEW_LINE>tryParseJS(env, "'def'", Object.class, "def");<NEW_LINE>tryParseJS(env, " 'def' ", Object.class, "def");<NEW_LINE>}
|
" \"abc\" ", Object.class, "abc");
|
1,582,282
|
final GetTagsResult executeGetTags(GetTagsRequest getTagsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getTagsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetTagsRequest> request = null;<NEW_LINE>Response<GetTagsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetTagsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTagsRequest));<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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTags");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetTagsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTagsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
|
1,554,452
|
private I_EDI_Desadv retrieveOrCreateDesadv(@NonNull final I_C_Order order) {<NEW_LINE>I_EDI_Desadv desadv = desadvDAO.retrieveMatchingDesadvOrNull(order.getPOReference(), InterfaceWrapperHelper.getContextAware(order));<NEW_LINE>if (desadv == null) {<NEW_LINE>desadv = InterfaceWrapperHelper.newInstance(I_EDI_Desadv.class, order);<NEW_LINE>desadv.setPOReference(order.getPOReference());<NEW_LINE>desadv.setDeliveryViaRule(order.getDeliveryViaRule());<NEW_LINE>desadv.setC_BPartner_ID(order.getC_BPartner_ID());<NEW_LINE>desadv.setC_BPartner_Location_ID(order.getC_BPartner_Location_ID());<NEW_LINE>desadv.setDateOrdered(order.getDateOrdered());<NEW_LINE>desadv.setMovementDate(order.getDatePromised());<NEW_LINE>desadv.setC_Currency_ID(order.getC_Currency_ID());<NEW_LINE>// the DESADV recipient might need an explicitly set dropship/handover partner and location; even if it is the same as the buyer's one<NEW_LINE>desadv.setHandOver_Partner_ID(CoalesceUtil.firstGreaterThanZero(order.getHandOver_Partner_ID(), order.getC_BPartner_ID()));<NEW_LINE>desadv.setHandOver_Location_ID(CoalesceUtil.firstGreaterThanZero(order.getHandOver_Location_ID(), order.getC_BPartner_Location_ID()));<NEW_LINE>desadv.setDropShip_BPartner_ID(CoalesceUtil.firstGreaterThanZero(order.getDropShip_BPartner_ID()<MASK><NEW_LINE>desadv.setDropShip_Location_ID(CoalesceUtil.firstGreaterThanZero(order.getDropShip_Location_ID(), order.getC_BPartner_Location_ID()));<NEW_LINE>desadv.setBill_Location_ID(BPartnerLocationAndCaptureId.toBPartnerLocationRepoId(orderBL.getBillToLocationId(order)));<NEW_LINE>// note: the minimal acceptable fulfillment is currently set by a model interceptor<NEW_LINE>InterfaceWrapperHelper.save(desadv);<NEW_LINE>}<NEW_LINE>return desadv;<NEW_LINE>}
|
, order.getC_BPartner_ID()));
|
1,101,172
|
public Request<ListIdentityProvidersRequest> marshall(ListIdentityProvidersRequest listIdentityProvidersRequest) {<NEW_LINE>if (listIdentityProvidersRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListIdentityProvidersRequest)");<NEW_LINE>}<NEW_LINE>Request<ListIdentityProvidersRequest> request = new DefaultRequest<ListIdentityProvidersRequest>(listIdentityProvidersRequest, "AmazonCognitoIdentityProvider");<NEW_LINE>String target = "AWSCognitoIdentityProviderService.ListIdentityProviders";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (listIdentityProvidersRequest.getUserPoolId() != null) {<NEW_LINE>String userPoolId = listIdentityProvidersRequest.getUserPoolId();<NEW_LINE>jsonWriter.name("UserPoolId");<NEW_LINE>jsonWriter.value(userPoolId);<NEW_LINE>}<NEW_LINE>if (listIdentityProvidersRequest.getMaxResults() != null) {<NEW_LINE>Integer maxResults = listIdentityProvidersRequest.getMaxResults();<NEW_LINE>jsonWriter.name("MaxResults");<NEW_LINE>jsonWriter.value(maxResults);<NEW_LINE>}<NEW_LINE>if (listIdentityProvidersRequest.getNextToken() != null) {<NEW_LINE>String nextToken = listIdentityProvidersRequest.getNextToken();<NEW_LINE>jsonWriter.name("NextToken");<NEW_LINE>jsonWriter.value(nextToken);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
|
t.getMessage(), t);
|
1,105,038
|
protected String generateTypeTable(InitializrMetadata metadata, String linkHeader, boolean addTags) {<NEW_LINE>String[][] typeTable = new String[metadata.getTypes().getContent().size() + 1][];<NEW_LINE>if (addTags) {<NEW_LINE>typeTable[0] = new String[] { linkHeader, "Description", "Tags" };<NEW_LINE>} else {<NEW_LINE>typeTable[0] = new String[] { linkHeader, "Description" };<NEW_LINE>}<NEW_LINE>int i = 1;<NEW_LINE>for (Type type : metadata.getTypes().getContent().stream().sorted(Comparator.comparing(MetadataElement::getId)).collect(Collectors.toList())) {<NEW_LINE>String[] data = new String<MASK><NEW_LINE>data[0] = (type.isDefault() ? type.getId() + " *" : type.getId());<NEW_LINE>data[1] = (type.getDescription() != null) ? type.getDescription() : type.getName();<NEW_LINE>if (addTags) {<NEW_LINE>data[2] = buildTagRepresentation(type);<NEW_LINE>}<NEW_LINE>typeTable[i++] = data;<NEW_LINE>}<NEW_LINE>return TableGenerator.generate(typeTable, this.maxColumnWidth);<NEW_LINE>}
|
[typeTable[0].length];
|
1,460,688
|
private static void raw(PoloniexMarketDataServiceRaw dataService) throws IOException {<NEW_LINE>System.out.println("------------RAW------------");<NEW_LINE>System.out.println(dataService.getPoloniexCurrencyInfo());<NEW_LINE>System.out.println(poloniex.getExchangeSymbols());<NEW_LINE>System.out.<MASK><NEW_LINE>System.out.println(dataService.getPoloniexTicker(currencyPair));<NEW_LINE>System.out.println(dataService.getAllPoloniexDepths());<NEW_LINE>System.out.println(dataService.getAllPoloniexDepths(3));<NEW_LINE>System.out.println(dataService.getPoloniexDepth(currencyPair));<NEW_LINE>System.out.println(dataService.getPoloniexDepth(currencyPair, 3));<NEW_LINE>System.out.println(Arrays.asList(dataService.getPoloniexPublicTrades(currencyPair)));<NEW_LINE>long now = new Date().getTime() / 1000;<NEW_LINE>System.out.println(Arrays.asList(dataService.getPoloniexPublicTrades(currencyPair, now - 8 * 60 * 60, null)));<NEW_LINE>}
|
println(dataService.getAllPoloniexTickers());
|
1,738,053
|
public static GetTaobaoOrderResponse unmarshall(GetTaobaoOrderResponse getTaobaoOrderResponse, UnmarshallerContext context) {<NEW_LINE>getTaobaoOrderResponse.setRequestId(context.stringValue("GetTaobaoOrderResponse.RequestId"));<NEW_LINE>getTaobaoOrderResponse.setSuccess(context.booleanValue("GetTaobaoOrderResponse.Success"));<NEW_LINE>getTaobaoOrderResponse.setCode(context.stringValue("GetTaobaoOrderResponse.Code"));<NEW_LINE>getTaobaoOrderResponse.setMessage(context.stringValue("GetTaobaoOrderResponse.Message"));<NEW_LINE>getTaobaoOrderResponse.setHttpStatusCode(context.integerValue("GetTaobaoOrderResponse.HttpStatusCode"));<NEW_LINE>List<TaobaoOrder> orders = new ArrayList<TaobaoOrder>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetTaobaoOrderResponse.Orders.Length"); i++) {<NEW_LINE>TaobaoOrder taobaoOrder = new TaobaoOrder();<NEW_LINE>taobaoOrder.setId(context.longValue("GetTaobaoOrderResponse.Orders[" + i + "].id"));<NEW_LINE>taobaoOrder.setType(context.integerValue("GetTaobaoOrderResponse.Orders[" + i + "].type"));<NEW_LINE>taobaoOrder.setIncomingAccount(context.integerValue("GetTaobaoOrderResponse.Orders[" + i + "].incomingAccount"));<NEW_LINE>taobaoOrder.setOutcomingAccount(context.integerValue("GetTaobaoOrderResponse.Orders[" + i + "].outcomingAccount"));<NEW_LINE>taobaoOrder.setConsumedIncomingAccount(context.integerValue("GetTaobaoOrderResponse.Orders[" + i + "].consumedIncomingAccount"));<NEW_LINE>taobaoOrder.setConsumedOutcomingAccount(context.integerValue("GetTaobaoOrderResponse.Orders[" + i + "].consumedOutcomingAccount"));<NEW_LINE>taobaoOrder.setConfirmedAccount(context.integerValue("GetTaobaoOrderResponse.Orders[" + i + "].confirmedAccount"));<NEW_LINE>taobaoOrder.setLastCalculateTime(context.longValue("GetTaobaoOrderResponse.Orders[" + i + "].lastCalculateTime"));<NEW_LINE>taobaoOrder.setExpiresIn(context.longValue("GetTaobaoOrderResponse.Orders[" + i + "].expiresIn"));<NEW_LINE>taobaoOrder.setOrderRecordId(context.longValue("GetTaobaoOrderResponse.Orders[" + i + "].orderRecordId"));<NEW_LINE>taobaoOrder.setOrderId(context.longValue("GetTaobaoOrderResponse.Orders[" + i + "].OrderId"));<NEW_LINE>taobaoOrder.setParentOrderId(context.longValue("GetTaobaoOrderResponse.Orders[" + i + "].ParentOrderId"));<NEW_LINE>taobaoOrder.setPlanId(context.longValue("GetTaobaoOrderResponse.Orders[" + i + "].planId"));<NEW_LINE>taobaoOrder.setStartDate(context.longValue("GetTaobaoOrderResponse.Orders[" + i + "].startDate"));<NEW_LINE>taobaoOrder.setStatus(context.integerValue("GetTaobaoOrderResponse.Orders[" + i + "].status"));<NEW_LINE>taobaoOrder.setProdFee(context.floatValue("GetTaobaoOrderResponse.Orders[" + i + "].prodFee"));<NEW_LINE>taobaoOrder.setTaobaoNick(context.stringValue("GetTaobaoOrderResponse.Orders[" + i + "].taobaoNick"));<NEW_LINE>taobaoOrder.setTaobaoUid(context.longValue("GetTaobaoOrderResponse.Orders[" + i + "].TaobaoUid"));<NEW_LINE>taobaoOrder.setPayDate(context.longValue("GetTaobaoOrderResponse.Orders[" + i + "].payDate"));<NEW_LINE>taobaoOrder.setFactMoney(context.floatValue("GetTaobaoOrderResponse.Orders[" + i + "].factMoney"));<NEW_LINE>taobaoOrder.setArticleCode(context.stringValue("GetTaobaoOrderResponse.Orders[" + i + "].articleCode"));<NEW_LINE>taobaoOrder.setArticleItemCode(context.stringValue<MASK><NEW_LINE>orders.add(taobaoOrder);<NEW_LINE>}<NEW_LINE>getTaobaoOrderResponse.setOrders(orders);<NEW_LINE>return getTaobaoOrderResponse;<NEW_LINE>}
|
("GetTaobaoOrderResponse.Orders[" + i + "].articleItemCode"));
|
557,711
|
public final MLDataSet external2Memory() {<NEW_LINE>this.status.report(0, 0, "Importing to memory");<NEW_LINE>if (this.result == null) {<NEW_LINE>this.result = new BasicMLDataSet();<NEW_LINE>}<NEW_LINE>final double[] input = new double[<MASK><NEW_LINE>final double[] ideal = new double[this.codec.getIdealSize()];<NEW_LINE>final double[] significance = new double[1];<NEW_LINE>this.codec.prepareRead();<NEW_LINE>int currentRecord = 0;<NEW_LINE>int lastUpdate = 0;<NEW_LINE>while (this.codec.read(input, ideal, significance)) {<NEW_LINE>MLData a = null, b = null;<NEW_LINE>a = new BasicMLData(input);<NEW_LINE>if (this.codec.getIdealSize() > 0) {<NEW_LINE>b = new BasicMLData(ideal);<NEW_LINE>}<NEW_LINE>final MLDataPair pair = new BasicMLDataPair(a, b);<NEW_LINE>pair.setSignificance(significance[0]);<NEW_LINE>this.result.add(pair);<NEW_LINE>currentRecord++;<NEW_LINE>lastUpdate++;<NEW_LINE>if (lastUpdate >= 10000) {<NEW_LINE>lastUpdate = 0;<NEW_LINE>this.status.report(0, currentRecord, "Importing...");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.codec.close();<NEW_LINE>this.status.report(0, 0, "Done importing to memory");<NEW_LINE>return this.result;<NEW_LINE>}
|
this.codec.getInputSize()];
|
1,351,847
|
public static int mulAddTo(int[] x, int[] y, int[] zz) {<NEW_LINE>long y_0 = y[0] & M;<NEW_LINE>long y_1 = y[1] & M;<NEW_LINE>long y_2 = y[2] & M;<NEW_LINE>long <MASK><NEW_LINE>long zc = 0;<NEW_LINE>for (int i = 0; i < 4; ++i) {<NEW_LINE>long c = 0, x_i = x[i] & M;<NEW_LINE>c += x_i * y_0 + (zz[i + 0] & M);<NEW_LINE>zz[i + 0] = (int) c;<NEW_LINE>c >>>= 32;<NEW_LINE>c += x_i * y_1 + (zz[i + 1] & M);<NEW_LINE>zz[i + 1] = (int) c;<NEW_LINE>c >>>= 32;<NEW_LINE>c += x_i * y_2 + (zz[i + 2] & M);<NEW_LINE>zz[i + 2] = (int) c;<NEW_LINE>c >>>= 32;<NEW_LINE>c += x_i * y_3 + (zz[i + 3] & M);<NEW_LINE>zz[i + 3] = (int) c;<NEW_LINE>c >>>= 32;<NEW_LINE>zc += c + (zz[i + 4] & M);<NEW_LINE>zz[i + 4] = (int) zc;<NEW_LINE>zc >>>= 32;<NEW_LINE>}<NEW_LINE>return (int) zc;<NEW_LINE>}
|
y_3 = y[3] & M;
|
433,886
|
public void updateVolumeDiskChain(long volumeId, String path, String chainInfo, String updatedDataStoreUUID) {<NEW_LINE>VolumeVO vol = _volsDao.findById(volumeId);<NEW_LINE>boolean needUpdate = false;<NEW_LINE>// Volume path is not getting updated in the DB, need to find reason and fix the issue.<NEW_LINE>if (vol.getPath() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!vol.getPath().equalsIgnoreCase(path)) {<NEW_LINE>needUpdate = true;<NEW_LINE>}<NEW_LINE>if (chainInfo != null && (vol.getChainInfo() == null || !chainInfo.equalsIgnoreCase(vol.getChainInfo()))) {<NEW_LINE>needUpdate = true;<NEW_LINE>}<NEW_LINE>if (updatedDataStoreUUID != null) {<NEW_LINE>needUpdate = true;<NEW_LINE>}<NEW_LINE>if (needUpdate) {<NEW_LINE>s_logger.info("Update volume disk chain info. vol: " + vol.getId() + ", " + vol.getPath() + " -> " + path + ", " + vol.getChainInfo() + " -> " + chainInfo);<NEW_LINE>vol.setPath(path);<NEW_LINE>vol.setChainInfo(chainInfo);<NEW_LINE>if (updatedDataStoreUUID != null) {<NEW_LINE>StoragePoolVO <MASK><NEW_LINE>if (pool != null) {<NEW_LINE>vol.setPoolId(pool.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_volsDao.update(volumeId, vol);<NEW_LINE>}<NEW_LINE>}
|
pool = _storagePoolDao.findByUuid(updatedDataStoreUUID);
|
1,571,740
|
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>icon = new javax.swing.JLabel();<NEW_LINE>problemDescription = new javax.swing.JTextPane();<NEW_LINE>showDetails = new javax.swing.JButton();<NEW_LINE>setBorder(javax.swing.BorderFactory.createEmptyBorder(3, 3, 3, 3));<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>icon.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));<NEW_LINE>icon.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 6, 1, 6));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>add(icon, gridBagConstraints);<NEW_LINE>problemDescription.setEditable(false);<NEW_LINE>// NOI18N<NEW_LINE>problemDescription.setContentType("text/html");<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 1;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>add(problemDescription, gridBagConstraints);<NEW_LINE>showDetails.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>showDetailsActionPerformed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>gridBagConstraints = <MASK><NEW_LINE>gridBagConstraints.gridx = 2;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>add(showDetails, gridBagConstraints);<NEW_LINE>showDetails.getAccessibleContext().setAccessibleName(showDetails.getText());<NEW_LINE>showDetails.getAccessibleContext().setAccessibleDescription(showDetails.getText());<NEW_LINE>}
|
new java.awt.GridBagConstraints();
|
783,849
|
public static void main(String[] args) {<NEW_LINE>Exercise30_DynamicMedianFinding.DynamicMedianFindingHeap<Integer> dynamicMedianFindingHeap = new Exercise30_DynamicMedianFinding().new DynamicMedianFindingHeap<>();<NEW_LINE>dynamicMedianFindingHeap.insert(1);<NEW_LINE>dynamicMedianFindingHeap.insert(2);<NEW_LINE>dynamicMedianFindingHeap.insert(3);<NEW_LINE>dynamicMedianFindingHeap.insert(4);<NEW_LINE>dynamicMedianFindingHeap.insert(5);<NEW_LINE>dynamicMedianFindingHeap.insert(6);<NEW_LINE>dynamicMedianFindingHeap.insert(7);<NEW_LINE>StdOut.println("Median: " + dynamicMedianFindingHeap.findTheMedian() + " Expected: 4");<NEW_LINE>StdOut.println("Delete Median: " + dynamicMedianFindingHeap.deleteMedian() + " Expected: 4");<NEW_LINE>// When we have an even number of values, pick the left one<NEW_LINE>StdOut.println("Median: " + dynamicMedianFindingHeap.findTheMedian() + " Expected: 3");<NEW_LINE>dynamicMedianFindingHeap.deleteMedian();<NEW_LINE>dynamicMedianFindingHeap.insert(99);<NEW_LINE>dynamicMedianFindingHeap.insert(100);<NEW_LINE>StdOut.println("Median: " + <MASK><NEW_LINE>}
|
dynamicMedianFindingHeap.findTheMedian() + " Expected: 6");
|
619,854
|
public int readRawVarInt32() throws IOException {<NEW_LINE>byte tmp = nioBuffer.get();<NEW_LINE>if (tmp >= 0) {<NEW_LINE>return tmp;<NEW_LINE>}<NEW_LINE>int result = tmp & 0x7f;<NEW_LINE>if ((tmp = nioBuffer.get()) >= 0) {<NEW_LINE>result |= tmp << 7;<NEW_LINE>} else {<NEW_LINE>result |= (tmp & 0x7f) << 7;<NEW_LINE>if ((tmp = nioBuffer.get()) >= 0) {<NEW_LINE>result |= tmp << 14;<NEW_LINE>} else {<NEW_LINE>result |= (tmp & 0x7f) << 14;<NEW_LINE>if ((tmp = nioBuffer.get()) >= 0) {<NEW_LINE>result |= tmp << 21;<NEW_LINE>} else {<NEW_LINE>result |= (tmp & 0x7f) << 21;<NEW_LINE>result |= (tmp = <MASK><NEW_LINE>if (tmp < 0) {<NEW_LINE>// Discard upper 32 bits.<NEW_LINE>for (int i = 0; i < 5; i++) {<NEW_LINE>if (nioBuffer.get() >= 0) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw ProtocolException.malformedVarInt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
nioBuffer.get()) << 28;
|
467,535
|
public static HashMap<String, Object> convertV2TIMConversationResultToMap(V2TIMConversationResult info) {<NEW_LINE>HashMap<String, Object> rinfo = new HashMap<String, Object>();<NEW_LINE>rinfo.put("nextSeq", String.valueOf(info.getNextSeq()));<NEW_LINE>rinfo.put("isFinished", info.isFinished());<NEW_LINE>List<V2TIMConversation> list = info.getConversationList();<NEW_LINE>LinkedList<Object> clist <MASK><NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>V2TIMConversation item = list.get(i);<NEW_LINE>HashMap<String, Object> citem = CommonUtil.convertV2TIMConversationToMap(item);<NEW_LINE>clist.add(citem);<NEW_LINE>}<NEW_LINE>rinfo.put("conversationList", clist);<NEW_LINE>return rinfo;<NEW_LINE>}
|
= new LinkedList<Object>();
|
1,209,869
|
public void marshall(LoadBalancerTlsCertificate loadBalancerTlsCertificate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (loadBalancerTlsCertificate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSupportCode(), SUPPORTCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getLocation(), LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getLoadBalancerName(), LOADBALANCERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getIsAttached(), ISATTACHED_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getDomainName(), DOMAINNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getDomainValidationRecords(), DOMAINVALIDATIONRECORDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getFailureReason(), FAILUREREASON_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getIssuedAt(), ISSUEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getIssuer(), ISSUER_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getKeyAlgorithm(), KEYALGORITHM_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getNotAfter(), NOTAFTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getNotBefore(), NOTBEFORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getRenewalSummary(), RENEWALSUMMARY_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getRevocationReason(), REVOCATIONREASON_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getRevokedAt(), REVOKEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSerial(), SERIAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSignatureAlgorithm(), SIGNATUREALGORITHM_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSubject(), SUBJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSubjectAlternativeNames(), SUBJECTALTERNATIVENAMES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
loadBalancerTlsCertificate.getArn(), ARN_BINDING);
|
268,708
|
private static void configure(FleetControllerOptions options, FleetcontrollerConfig config) {<NEW_LINE>options.clusterName = config.cluster_name();<NEW_LINE>options.fleetControllerIndex = config.index();<NEW_LINE>options.fleetControllerCount = config.fleet_controller_count();<NEW_LINE>options.zooKeeperSessionTimeout = (int) (config.zookeeper_session_timeout() * 1000);<NEW_LINE>options.masterZooKeeperCooldownPeriod = (int) (config.master_zookeeper_cooldown_period() * 1000);<NEW_LINE>options.stateGatherCount = config.state_gather_count();<NEW_LINE>options.rpcPort = config.rpc_port();<NEW_LINE>options.httpPort = config.http_port();<NEW_LINE>options.maxTransitionTime.put(NodeType.STORAGE, config.storage_transition_time());<NEW_LINE>options.maxTransitionTime.put(NodeType.DISTRIBUTOR, config.distributor_transition_time());<NEW_LINE>options.maxInitProgressTime = config.init_progress_time();<NEW_LINE>options.statePollingFrequency = config.state_polling_frequency();<NEW_LINE>options.maxPrematureCrashes = config.max_premature_crashes();<NEW_LINE>options.stableStateTimePeriod = config.stable_state_time_period();<NEW_LINE>options.eventLogMaxSize = config.event_log_max_size();<NEW_LINE>options.eventNodeLogMaxSize = config.event_node_log_max_size();<NEW_LINE>options.minDistributorNodesUp = config.min_distributors_up_count();<NEW_LINE>options.minStorageNodesUp = config.min_storage_up_count();<NEW_LINE>options.minRatioOfDistributorNodesUp = config.min_distributor_up_ratio();<NEW_LINE>options.minRatioOfStorageNodesUp = config.min_storage_up_ratio();<NEW_LINE>options.cycleWaitTime = (int) (config.cycle_wait_time() * 1000);<NEW_LINE>options.minTimeBeforeFirstSystemStateBroadcast = (int) (config.min_time_before_first_system_state_broadcast() * 1000);<NEW_LINE>options.nodeStateRequestTimeoutMS = (int) (config.get_node_state_request_timeout() * 1000);<NEW_LINE>options.showLocalSystemStatesInEventLog = config.show_local_systemstates_in_event_log();<NEW_LINE>options.minTimeBetweenNewSystemStates = config.min_time_between_new_systemstates();<NEW_LINE>options.maxSlobrokDisconnectGracePeriod = (int) (config.max_slobrok_disconnect_grace_period() * 1000);<NEW_LINE>options.distributionBits = config.ideal_distribution_bits();<NEW_LINE>options.minNodeRatioPerGroup = config.min_node_ratio_per_group();<NEW_LINE>options.setMaxDeferredTaskVersionWaitTime(Duration.ofMillis((int) (config.max_deferred_task_version_wait_time_sec() * 1000)));<NEW_LINE>options.clusterHasGlobalDocumentTypes = config.cluster_has_global_document_types();<NEW_LINE>options.minMergeCompletionRatio = config.min_merge_completion_ratio();<NEW_LINE>options<MASK><NEW_LINE>options.clusterFeedBlockEnabled = config.enable_cluster_feed_block();<NEW_LINE>options.clusterFeedBlockLimit = Map.copyOf(config.cluster_feed_block_limit());<NEW_LINE>options.clusterFeedBlockNoiseLevel = config.cluster_feed_block_noise_level();<NEW_LINE>}
|
.enableTwoPhaseClusterStateActivation = config.enable_two_phase_cluster_state_transitions();
|
585,639
|
public void run() {<NEW_LINE>String appType = _analyticJob.getAppType().getName();<NEW_LINE>String analysisName = String.format("%s %s", appType, _analyticJob.getAppId());<NEW_LINE>long analysisStartTimeMillis = System.currentTimeMillis();<NEW_LINE>logger.info(String.format("Analyzing %s", analysisName));<NEW_LINE>long applicableFinishTime = -1;<NEW_LINE>long jobFinishTime = -1;<NEW_LINE>FinishTimeInfo finishTimeInfo = null;<NEW_LINE>try {<NEW_LINE>final AppResult result = _analyticJob.getAnalysis();<NEW_LINE>applicableFinishTime = getApplicableFinishTime(_analyticJob);<NEW_LINE>synchronized (_appsLock) {<NEW_LINE>finishTimeInfo = _appTypeToFinishTimeInfo.get(appType);<NEW_LINE>final BackfillInfo backfillInfo = getBackfillInfoForSave(finishTimeInfo, appType, applicableFinishTime);<NEW_LINE>jobFinishTime = result.finishTime;<NEW_LINE>// Execute as a transaction.<NEW_LINE>Ebean.execute(new TxRunnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>result.save();<NEW_LINE>if (backfillInfo != null) {<NEW_LINE>backfillInfo.save();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>_appToAnalyticJobMap.remove(_analyticJob.getAppId());<NEW_LINE>if (finishTimeInfo != null) {<NEW_LINE>updateFinishTimeInfo(finishTimeInfo, backfillInfo, result.finishTime);<NEW_LINE>removeFromFinishTimesMap(finishTimeInfo._appFinishTimesMap, applicableFinishTime);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long processingTime = System.currentTimeMillis() - analysisStartTimeMillis;<NEW_LINE>logger.info(String.format("Analysis of %s took %sms", analysisName, processingTime));<NEW_LINE>MetricsController.setJobProcessingTime(processingTime);<NEW_LINE>MetricsController.markProcessedJobs();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.info("Thread interrupted");<NEW_LINE>logger.info(e.getMessage());<NEW_LINE>logger.info(ExceptionUtils.getStackTrace(e));<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>logger.warn("Timed out while fetching data. Exception message is: " + e.getMessage());<NEW_LINE>jobFate(finishTimeInfo, appType, applicableFinishTime, jobFinishTime);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(String.format("Failed to analyze %s", analysisName), e);<NEW_LINE>jobFate(<MASK><NEW_LINE>}<NEW_LINE>}
|
finishTimeInfo, appType, applicableFinishTime, jobFinishTime);
|
1,846,821
|
void diffProperties(final StructrTypeDefinition other) throws FrameworkException {<NEW_LINE>final Map<String, StructrPropertyDefinition> databaseProperties = getMappedProperties();<NEW_LINE>final Map<String, StructrPropertyDefinition> structrProperties = other.getMappedProperties();<NEW_LINE>final Set<String> propertiesOnlyInDatabase = new TreeSet<>(databaseProperties.keySet());<NEW_LINE>final Set<String> propertiesOnlyInStructrSchema = new TreeSet<>(structrProperties.keySet());<NEW_LINE>final Set<String> bothPropertys = new TreeSet<>(databaseProperties.keySet());<NEW_LINE>propertiesOnlyInDatabase.removeAll(structrProperties.keySet());<NEW_LINE>propertiesOnlyInStructrSchema.<MASK><NEW_LINE>bothPropertys.retainAll(structrProperties.keySet());<NEW_LINE>// properties that exist in the database only<NEW_LINE>for (final String key : propertiesOnlyInDatabase) {<NEW_LINE>final StructrPropertyDefinition property = databaseProperties.get(key);<NEW_LINE>handleRemovedProperty(property);<NEW_LINE>}<NEW_LINE>// nothing to do for this set, these properties can simply be created without problems<NEW_LINE>// System.out.println(propertiesOnlyInStructrSchema);<NEW_LINE>// find detailed differences in the intersection of both schemas<NEW_LINE>for (final String name : bothPropertys) {<NEW_LINE>final StructrPropertyDefinition localProperty = databaseProperties.get(name);<NEW_LINE>final StructrPropertyDefinition otherProperty = structrProperties.get(name);<NEW_LINE>// compare properties in detail<NEW_LINE>localProperty.diff(otherProperty);<NEW_LINE>}<NEW_LINE>}
|
removeAll(databaseProperties.keySet());
|
537,463
|
protected double[] estimateBandwidths(final double alpha, final int p, DataSet data, final List<Vec> centroids, final List<Double> centroidDistCache, final DistanceMetric dm, ExecutorService threadpool) {<NEW_LINE>final double[] bandwidths = new double[centroids.size()];<NEW_LINE>final CountDownLatch latch = new CountDownLatch(centroids.size());<NEW_LINE>ParallelUtils.run(true, centroids.size(), (center) -> {<NEW_LINE>BoundedSortedList<Double> closestDistances = new BoundedSortedList<>(p);<NEW_LINE>for (int i = 0; i < centroids.size(); i++) if (i != center)<NEW_LINE>closestDistances.add(dm.dist(i, center, centroids, centroidDistCache));<NEW_LINE>OnLineStatistics stats = new OnLineStatistics();<NEW_LINE>for (double dist : <MASK><NEW_LINE>bandwidths[center] = stats.getMean() + alpha * stats.getStandardDeviation();<NEW_LINE>}, threadpool);<NEW_LINE>return bandwidths;<NEW_LINE>}
|
closestDistances) stats.add(dist);
|
1,401,381
|
private String invokeService(String action, String stage, String file, String payload) {<NEW_LINE>s_logger.debug("Invoking rolling maintenance service for stage: " + stage + " and file " + file + " with action: " + action);<NEW_LINE>final OutputInterpreter.AllLinesParser parser = new OutputInterpreter.AllLinesParser();<NEW_LINE>Script command <MASK><NEW_LINE>command.add(action);<NEW_LINE>String service = servicePrefix + "@" + generateInstanceName(stage, file, payload);<NEW_LINE>command.add(service);<NEW_LINE>String result = command.execute(parser);<NEW_LINE>int exitValue = command.getExitValue();<NEW_LINE>s_logger.trace("Execution: " + command.toString() + " - exit code: " + exitValue + ": " + result + (StringUtils.isNotBlank(parser.getLines()) ? parser.getLines() : ""));<NEW_LINE>return StringUtils.isBlank(result) ? parser.getLines().replace("\n", " ") : result;<NEW_LINE>}
|
= new Script("/bin/systemctl", s_logger);
|
1,243,946
|
static void overrideBlackList(List<String> originList, String overrideStr) {<NEW_LINE>List<String> adds <MASK><NEW_LINE>String[] overrideItems = StringUtils.splitWithCommaOrSemicolon(overrideStr);<NEW_LINE>for (String overrideItem : overrideItems) {<NEW_LINE>if (StringUtils.isNotBlank(overrideItem)) {<NEW_LINE>if (overrideItem.startsWith("!") || overrideItem.startsWith("-")) {<NEW_LINE>overrideItem = overrideItem.substring(1);<NEW_LINE>if ("*".equals(overrideItem) || "default".equals(overrideItem)) {<NEW_LINE>originList.clear();<NEW_LINE>} else {<NEW_LINE>originList.remove(overrideItem);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!originList.contains(overrideItem)) {<NEW_LINE>adds.add(overrideItem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (adds.size() > 0) {<NEW_LINE>originList.addAll(adds);<NEW_LINE>}<NEW_LINE>}
|
= new LinkedList<String>();
|
1,456,683
|
private void sendContinuedSystemInfoData(final String id) {<NEW_LINE>try {<NEW_LINE>final URL url = new URL("https://sysinfo.structr.com/structr/rest/SystemInfoDataUpdate");<NEW_LINE>final Map<String, Object> data = new LinkedHashMap<>();<NEW_LINE>final URLConnection con = url.openConnection();<NEW_LINE>final HttpURLConnection http = (HttpURLConnection) con;<NEW_LINE>final Gson gson = new GsonBuilder().create();<NEW_LINE>try (final Tx tx = StructrApp.getInstance().tx()) {<NEW_LINE>final DatabaseService db = Services<MASK><NEW_LINE>final CountResult cr = db.getNodeAndRelationshipCount();<NEW_LINE>data.put("users", cr.getUserCount());<NEW_LINE>data.put("nodes", cr.getNodeCount());<NEW_LINE>data.put("relationships", cr.getRelationshipCount());<NEW_LINE>tx.success();<NEW_LINE>}<NEW_LINE>data.put("now", System.currentTimeMillis());<NEW_LINE>data.put("uptime", ManagementFactory.getRuntimeMXBean().getUptime());<NEW_LINE>data.put("parentId", id);<NEW_LINE>http.setRequestProperty("ContentType", "application/json");<NEW_LINE>http.setReadTimeout(1000);<NEW_LINE>http.setConnectTimeout(1000);<NEW_LINE>http.setRequestMethod("POST");<NEW_LINE>http.setDoOutput(true);<NEW_LINE>http.setDoInput(true);<NEW_LINE>http.connect();<NEW_LINE>// write request body<NEW_LINE>try (final Writer writer = new OutputStreamWriter(http.getOutputStream())) {<NEW_LINE>gson.toJson(data, writer);<NEW_LINE>writer.flush();<NEW_LINE>}<NEW_LINE>final InputStream input = http.getInputStream();<NEW_LINE>if (input != null) {<NEW_LINE>// consume response<NEW_LINE>IOUtils.toString(input, "utf-8");<NEW_LINE>}<NEW_LINE>final InputStream error = http.getErrorStream();<NEW_LINE>if (error != null) {<NEW_LINE>// consume error stream<NEW_LINE>IOUtils.toString(error, "utf-8");<NEW_LINE>}<NEW_LINE>http.disconnect();<NEW_LINE>} catch (Throwable ignore) {<NEW_LINE>}<NEW_LINE>}
|
.getInstance().getDatabaseService();
|
1,592,774
|
protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite area = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite container = createComposite(area, new GridLayout(1, false));<NEW_LINE>container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));<NEW_LINE>SearchBox search = new SearchBox(container, "Filter activities...", true);<NEW_LINE>search.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));<NEW_LINE>loading = LoadablePanel.create(container, widgets, p -> createTreeForViewer(p, SWT.BORDER));<NEW_LINE>loading.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));<NEW_LINE>tree = Widgets.createTreeViewer(loading.getContents());<NEW_LINE>tree<MASK><NEW_LINE>labelProvider = new PackageLabelProvider(widgets.theme);<NEW_LINE>tree.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider));<NEW_LINE>// Sort by name.<NEW_LINE>tree.setComparator(new ViewerComparator());<NEW_LINE>tree.getTree().addListener(SWT.Selection, e -> {<NEW_LINE>selected = Action.getFor((TreeItem) e.item);<NEW_LINE>});<NEW_LINE>resources = new LocalResourceManager(JFaceResources.getResources(), tree.getTree());<NEW_LINE>update();<NEW_LINE>search.addListener(Events.Search, e -> {<NEW_LINE>if (e.text.isEmpty()) {<NEW_LINE>tree.resetFilters();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Pattern pattern = SearchBox.getPattern(e.text, (e.detail & Events.REGEX) != 0);<NEW_LINE>tree.setFilters(new ViewerFilter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean select(Viewer viewer, Object parentElement, Object element) {<NEW_LINE>return !(element instanceof PkgInfo.Package) || pattern.matcher(((PkgInfo.Package) element).getName()).find();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>return area;<NEW_LINE>}
|
.setContentProvider(new PackageContentProvider());
|
980,465
|
protected void createFieldEditors() {<NEW_LINE>if (Platform.getOS().equals(Platform.OS_MACOSX)) {<NEW_LINE>addField(new BooleanFieldEditor(ITLA2TeXPreferenceConstants.HAVE_OS_OPEN_PDF, "Have your OS open PDFs", getFieldEditorParent()));<NEW_LINE>} else {<NEW_LINE>addField(new BooleanFieldEditor(ITLA2TeXPreferenceConstants.EMBEDDED_VIEWER, "&Use built-in PDF viewer", getFieldEditorParent()));<NEW_LINE>}<NEW_LINE>// Preference to regenerate PDF upon spec save?<NEW_LINE>addField(new BooleanFieldEditor(ITLA2TeXPreferenceConstants.AUTO_REGENERATE, "&Regenerate pretty-printed PDF on spec save (takes effect once spec re-opened).", getFieldEditorParent()));<NEW_LINE>addField(new BooleanFieldEditor(ITLA2TeXPreferenceConstants.SHADE_COMMENTS, "&Shade comments", getFieldEditorParent()));<NEW_LINE>addField(new BooleanFieldEditor(ITLA2TeXPreferenceConstants.NO_PCAL_SHADE, "&Do not shade PlusCal code", getFieldEditorParent()));<NEW_LINE>addField(new BooleanFieldEditor(ITLA2TeXPreferenceConstants.NUMBER_LINES, "&Number lines", getFieldEditorParent()));<NEW_LINE>addField(new StringFieldEditor(ITLA2TeXPreferenceConstants.DOT_COMMAND<MASK><NEW_LINE>addField(new StringFieldEditor(ITLA2TeXPreferenceConstants.LATEX_COMMAND, "&Specify pdflatex command", getFieldEditorParent()));<NEW_LINE>addField(new DoubleFieldEditor(ITLA2TeXPreferenceConstants.GRAY_LEVEL, "&Specify gray level (between 0.0 and 1.0)", getFieldEditorParent(), 0, 1));<NEW_LINE>}
|
, "&Specify dot command", getFieldEditorParent()));
|
915,891
|
public void deleteIdentifier(DvObject dvObject) throws Exception {<NEW_LINE>String handle = getDvObjectHandle(dvObject);<NEW_LINE>String authHandle = getAuthenticationHandle(dvObject);<NEW_LINE>String adminCredFile = System.getProperty("dataverse.handlenet.admcredfile");<NEW_LINE>int handlenetIndex = System.getProperty("dataverse.handlenet.index") != null ? Integer.parseInt(System.getProperty("dataverse.handlenet.index")) : 300;<NEW_LINE>byte[] key = readKey(adminCredFile);<NEW_LINE>PrivateKey <MASK><NEW_LINE>HandleResolver resolver = new HandleResolver();<NEW_LINE>resolver.setSessionTracker(new ClientSessionTracker());<NEW_LINE>PublicKeyAuthenticationInfo auth = new PublicKeyAuthenticationInfo(Util.encodeString(authHandle), handlenetIndex, privkey);<NEW_LINE>DeleteHandleRequest req = new DeleteHandleRequest(Util.encodeString(handle), auth);<NEW_LINE>AbstractResponse response = null;<NEW_LINE>try {<NEW_LINE>response = resolver.processRequest(req);<NEW_LINE>} catch (HandleException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>if (response == null || response.responseCode != AbstractMessage.RC_SUCCESS) {<NEW_LINE>logger.fine("error deleting '" + handle + "': " + response);<NEW_LINE>} else {<NEW_LINE>logger.fine("deleted " + handle);<NEW_LINE>}<NEW_LINE>}
|
privkey = readPrivKey(key, adminCredFile);
|
1,639,355
|
public static List<Resource> findResourcesByExtension(File workingDir, String extension, List<String> paths) {<NEW_LINE>List<Resource> results = new ArrayList();<NEW_LINE>List<File> fileRoots = new ArrayList();<NEW_LINE>List<String> pathRoots = new ArrayList();<NEW_LINE>for (String path : paths) {<NEW_LINE>if (path.endsWith("." + extension)) {<NEW_LINE>results.add(getResource(workingDir, path));<NEW_LINE>} else if (path.startsWith(Resource.CLASSPATH_COLON)) {<NEW_LINE>pathRoots.add(removePrefix(path));<NEW_LINE>} else {<NEW_LINE>fileRoots.add(new File(removePrefix(path)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!fileRoots.isEmpty()) {<NEW_LINE>results.addAll(findFilesByExtension(workingDir, extension, fileRoots));<NEW_LINE>} else if (results.isEmpty() && !pathRoots.isEmpty()) {<NEW_LINE>String[] searchPaths = pathRoots.toArray(new String[pathRoots.size()]);<NEW_LINE>try (ScanResult scanResult = new ClassGraph().acceptPaths(searchPaths).scan(1)) {<NEW_LINE>ResourceList rl = scanResult.getResourcesWithExtension(extension);<NEW_LINE>rl.forEachByteArrayIgnoringIOException((res, bytes) -> {<NEW_LINE>URI uri = res.getURI();<NEW_LINE>if ("file".equals(uri.getScheme())) {<NEW_LINE>File file = Paths.<MASK><NEW_LINE>results.add(new FileResource(file, true, res.getPath()));<NEW_LINE>} else {<NEW_LINE>results.add(new JarResource(bytes, res.getPath(), uri));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
|
get(uri).toFile();
|
1,272,207
|
public Description matchMethod(MethodTree methodTree, VisitorState state) {<NEW_LINE>MethodSymbol methodSymbol = ASTHelpers.getSymbol(methodTree);<NEW_LINE>boolean isVarargs = methodSymbol.isVarArgs();<NEW_LINE>Set<MethodSymbol> superMethods = ASTHelpers.findSuperMethods(<MASK><NEW_LINE>// If there are no super methods, we're fine:<NEW_LINE>if (superMethods.isEmpty()) {<NEW_LINE>return Description.NO_MATCH;<NEW_LINE>}<NEW_LINE>Iterator<MethodSymbol> superMethodsIterator = superMethods.iterator();<NEW_LINE>boolean areSupersVarargs = superMethodsIterator.next().isVarArgs();<NEW_LINE>while (superMethodsIterator.hasNext()) {<NEW_LINE>if (areSupersVarargs != superMethodsIterator.next().isVarArgs()) {<NEW_LINE>// The super methods are inconsistent (some are varargs, some are not varargs). Then the<NEW_LINE>// current method is inconsistent with some of its supermethods, so report a match.<NEW_LINE>return describeMatch(methodTree);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// The current method is consistent with all of its supermethods:<NEW_LINE>if (isVarargs == areSupersVarargs) {<NEW_LINE>return Description.NO_MATCH;<NEW_LINE>}<NEW_LINE>// The current method is inconsistent with all of its supermethods, so flip the varargs-ness<NEW_LINE>// of the current method.<NEW_LINE>List<? extends VariableTree> parameterTree = methodTree.getParameters();<NEW_LINE>Tree paramType = parameterTree.get(parameterTree.size() - 1).getType();<NEW_LINE>CharSequence paramTypeSource = state.getSourceForNode(paramType);<NEW_LINE>if (paramTypeSource == null) {<NEW_LINE>// No fix if we don't have tree end positions.<NEW_LINE>return describeMatch(methodTree);<NEW_LINE>}<NEW_LINE>Description.Builder descriptionBuilder = buildDescription(methodTree);<NEW_LINE>if (isVarargs) {<NEW_LINE>descriptionBuilder.addFix(SuggestedFix.replace(paramType, "[]", paramTypeSource.length() - 3, 0));<NEW_LINE>} else {<NEW_LINE>// There may be a comment that includes a '[' character between the open and closed<NEW_LINE>// brackets of the array type. If so, we don't return a fix.<NEW_LINE>int arrayOpenIndex = paramTypeSource.length() - 2;<NEW_LINE>while (paramTypeSource.charAt(arrayOpenIndex) == ' ') {<NEW_LINE>arrayOpenIndex--;<NEW_LINE>}<NEW_LINE>if (paramTypeSource.charAt(arrayOpenIndex) == '[') {<NEW_LINE>descriptionBuilder.addFix(SuggestedFix.replace(paramType, "...", arrayOpenIndex, 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return descriptionBuilder.build();<NEW_LINE>}
|
methodSymbol, state.getTypes());
|
1,434,342
|
public synchronized boolean register(ResolvedDependency dependencyToResolve) {<NEW_LINE>SameResolvedDependencyInAllVersions allVersions = getAllVersions(dependencyToResolve.getName());<NEW_LINE>if (allVersions.noValidVersionExists()) {<NEW_LINE>LOGGER.debug("{} doesn't exit in registry, add it.", dependencyToResolve);<NEW_LINE>allVersions.add(dependencyToResolve);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>int compareResult = PackageComparator.INSTANCE.compare(dependencyToResolve, head.resolvedDependency);<NEW_LINE>if (currentDependencyEqualsLatestOne(compareResult)) {<NEW_LINE>LOGGER.debug("Same version of {} already exited in registry, increase reference count to {}", dependencyToResolve, head.referenceCount);<NEW_LINE>head.referenceCount++;<NEW_LINE>return false;<NEW_LINE>} else if (currentDependencyShouldReplaceExistedOnes(compareResult)) {<NEW_LINE>LOGGER.debug("{} is newer, replace the old version {} in registry", dependencyToResolve, head.resolvedDependency);<NEW_LINE>allVersions.onlyDecreaseDescendantsReferenceCount();<NEW_LINE>allVersions.add(dependencyToResolve);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("{} is older, do nothing.", dependencyToResolve);<NEW_LINE>allVersions.addEvictedDependency(dependencyToResolve);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
|
ResolvedDependencyWithReferenceCount head = allVersions.headOfValidVersions();
|
1,838,092
|
public boolean transform() {<NEW_LINE>System.out.println("[Stringer] [StringEncryptionTransformer] Starting");<NEW_LINE>int concat = concatStrings();<NEW_LINE>if (concat > 0)<NEW_LINE>System.out.<MASK><NEW_LINE>int count = count();<NEW_LINE>System.out.println("[Stringer] [StringEncryptionTransformer] Found " + count + " encrypted strings");<NEW_LINE>int decrypted = 0;<NEW_LINE>if (count > 0) {<NEW_LINE>decrypted = decrypt(count);<NEW_LINE>System.out.println("[Stringer] [StringEncryptionTransformer] Decrypted " + decrypted + " encrypted strings");<NEW_LINE>int cleanedup = cleanup();<NEW_LINE>System.out.println("[Stringer] [StringEncryptionTransformer] Removed " + cleanedup + " decryption classes");<NEW_LINE>}<NEW_LINE>System.out.println("[Stringer] [StringEncryptionTransformer] Done");<NEW_LINE>return decrypted > 0;<NEW_LINE>}
|
println("[Stringer] [StringEncryptionTransformer] Concatted " + concat + " strings");
|
491,220
|
final GetReplicationConfigurationResult executeGetReplicationConfiguration(GetReplicationConfigurationRequest getReplicationConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getReplicationConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetReplicationConfigurationRequest> request = null;<NEW_LINE>Response<GetReplicationConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetReplicationConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getReplicationConfigurationRequest));<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, "drs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetReplicationConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetReplicationConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetReplicationConfigurationResultJsonUnmarshaller());<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);
|
802,853
|
public static BlockEncodingBuffer createBlockEncodingBuffers(DecodedBlockNode decodedBlockNode, ArrayAllocator bufferAllocator, boolean isNested) {<NEW_LINE>requireNonNull(decodedBlockNode, "decodedBlockNode is null");<NEW_LINE>requireNonNull(bufferAllocator, "bufferAllocator is null");<NEW_LINE>// decodedBlock could be a block or ColumnarArray/Map/Row<NEW_LINE>Object decodedBlock = decodedBlockNode.getDecodedBlock();<NEW_LINE>// Skip the Dictionary/RLE block node. The mapping info is not needed when creating buffers.<NEW_LINE>// This is because the AbstractBlockEncodingBuffer is only created once, while position mapping for Dictionary/RLE blocks<NEW_LINE>// need to be done for every incoming block.<NEW_LINE>if (decodedBlock instanceof DictionaryBlock) {<NEW_LINE>decodedBlockNode = decodedBlockNode.getChildren().get(0);<NEW_LINE>decodedBlock = decodedBlockNode.getDecodedBlock();<NEW_LINE>} else if (decodedBlock instanceof RunLengthEncodedBlock) {<NEW_LINE>decodedBlockNode = decodedBlockNode.getChildren().get(0);<NEW_LINE>decodedBlock = decodedBlockNode.getDecodedBlock();<NEW_LINE>}<NEW_LINE>verify(!(decodedBlock instanceof DictionaryBlock), "Nested RLEs and dictionaries are not supported");<NEW_LINE>verify(!(decodedBlock instanceof RunLengthEncodedBlock), "Nested RLEs and dictionaries are not supported");<NEW_LINE>if (decodedBlock instanceof LongArrayBlock) {<NEW_LINE>return new LongArrayBlockEncodingBuffer(bufferAllocator, isNested);<NEW_LINE>}<NEW_LINE>if (decodedBlock instanceof Int128ArrayBlock) {<NEW_LINE>return new Int128ArrayBlockEncodingBuffer(bufferAllocator, isNested);<NEW_LINE>}<NEW_LINE>if (decodedBlock instanceof IntArrayBlock) {<NEW_LINE>return new IntArrayBlockEncodingBuffer(bufferAllocator, isNested);<NEW_LINE>}<NEW_LINE>if (decodedBlock instanceof ShortArrayBlock) {<NEW_LINE>return new ShortArrayBlockEncodingBuffer(bufferAllocator, isNested);<NEW_LINE>}<NEW_LINE>if (decodedBlock instanceof ByteArrayBlock) {<NEW_LINE>return new ByteArrayBlockEncodingBuffer(bufferAllocator, isNested);<NEW_LINE>}<NEW_LINE>if (decodedBlock instanceof VariableWidthBlock) {<NEW_LINE>return new VariableWidthBlockEncodingBuffer(bufferAllocator, isNested);<NEW_LINE>}<NEW_LINE>if (decodedBlock instanceof ColumnarArray) {<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>if (decodedBlock instanceof ColumnarMap) {<NEW_LINE>return new MapBlockEncodingBuffer(decodedBlockNode, bufferAllocator, isNested);<NEW_LINE>}<NEW_LINE>if (decodedBlock instanceof ColumnarRow) {<NEW_LINE>return new RowBlockEncodingBuffer(decodedBlockNode, bufferAllocator, isNested);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Unsupported encoding: " + decodedBlock.getClass().getSimpleName());<NEW_LINE>}
|
ArrayBlockEncodingBuffer(decodedBlockNode, bufferAllocator, isNested);
|
1,714,558
|
public Map<String, Object> queryTopNLongestRunningProcessInstance(User loginUser, long projectCode, int size, String startTime, String endTime) {<NEW_LINE>Project <MASK><NEW_LINE>// check user access for project<NEW_LINE>Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode);<NEW_LINE>if (result.get(Constants.STATUS) != Status.SUCCESS) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (0 > size) {<NEW_LINE>putMsg(result, Status.NEGTIVE_SIZE_NUMBER_ERROR, size);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (Objects.isNull(startTime)) {<NEW_LINE>putMsg(result, Status.DATA_IS_NULL, Constants.START_TIME);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>Date start = DateUtils.stringToDate(startTime);<NEW_LINE>if (Objects.isNull(endTime)) {<NEW_LINE>putMsg(result, Status.DATA_IS_NULL, Constants.END_TIME);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>Date end = DateUtils.stringToDate(endTime);<NEW_LINE>if (start == null || end == null) {<NEW_LINE>putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, Constants.START_END_DATE);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (start.getTime() > end.getTime()) {<NEW_LINE>putMsg(result, Status.START_TIME_BIGGER_THAN_END_TIME_ERROR, startTime, endTime);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>List<ProcessInstance> processInstances = processInstanceMapper.queryTopNProcessInstance(size, start, end, ExecutionStatus.SUCCESS, projectCode);<NEW_LINE>result.put(DATA_LIST, processInstances);<NEW_LINE>putMsg(result, Status.SUCCESS);<NEW_LINE>return result;<NEW_LINE>}
|
project = projectMapper.queryByCode(projectCode);
|
1,430,556
|
public boolean next() {<NEW_LINE>if (lastParsedPos == tail) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (mapIter != null) {<NEW_LINE>if (mapIter.hasNext()) {<NEW_LINE>Map.Entry<String, Any> entry = mapIter.next();<NEW_LINE>key = entry.getKey();<NEW_LINE>value = entry.getValue();<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>mapIter = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>iter.reset(data, lastParsedPos, tail);<NEW_LINE>key = CodegenAccess.readObjectFieldAsString(iter);<NEW_LINE>value = iter.readAny();<NEW_LINE>cache.put(key, value);<NEW_LINE>if (CodegenAccess.nextToken(iter) == ',') {<NEW_LINE>lastParsedPos = CodegenAccess.head(iter);<NEW_LINE>} else {<NEW_LINE>lastParsedPos = tail;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new JsonException(e);<NEW_LINE>} finally {<NEW_LINE>JsonIteratorPool.returnJsonIterator(iter);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
JsonIterator iter = JsonIteratorPool.borrowJsonIterator();
|
1,048,962
|
private void renameOldMasterPropsinZK(ServerContext context) {<NEW_LINE>// Rename all of the properties only set in ZooKeeper that start with "master." to rename and<NEW_LINE>// store them starting with "manager." instead.<NEW_LINE>var zooConfiguration = new ZooConfiguration(context, context.getZooCache(), new ConfigurationCopy());<NEW_LINE>zooConfiguration.getAllPropertiesWithPrefix(Property.MASTER_PREFIX).forEach((original, value) -> {<NEW_LINE>DeprecatedPropertyUtil.getReplacementName(original, (log, replacement) -> {<NEW_LINE>log.info("Automatically renaming deprecated property '{}' with its replacement '{}'" + " in ZooKeeper on upgrade.", original, replacement);<NEW_LINE>try {<NEW_LINE>// Set the property under the new name<NEW_LINE>SystemPropUtil.setSystemProperty(context, replacement, value);<NEW_LINE>SystemPropUtil.removePropWithoutDeprecationWarning(context, original);<NEW_LINE>} catch (KeeperException | InterruptedException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
|
throw new RuntimeException("Unable to upgrade system properties", e);
|
1,416,044
|
public void applicationMetaDataCreated(MetaDataEvent<ApplicationMetaData> event) throws MetaDataException {<NEW_LINE>String appName = event.getMetaData().getJ2EEName().getApplication();<NEW_LINE>try {<NEW_LINE>Collection<SecurityRole> securityRoles = event.getContainer().adapt(<MASK><NEW_LINE>if (!establishInitialTable(appName, securityRoles)) {<NEW_LINE>Tr.error(tc, "AUTHZ_TABLE_DUPLICATE_APP_NAME", appName);<NEW_LINE>throw new MetaDataException(TraceNLS.getFormattedMessage(this.getClass(), TraceConstants.MESSAGE_BUNDLE, "AUTHZ_TABLE_DUPLICATE_APP_NAME", new Object[] { appName }, "CWWKS9110E: Multiple applications have the name {0}. Security authorization policies requires that names be unique."));<NEW_LINE>}<NEW_LINE>defaultDelegationProvider = defaultDelegationProviderServiceRef.getService();<NEW_LINE>if (defaultDelegationProvider != null)<NEW_LINE>defaultDelegationProvider.createAppToSecurityRolesMapping(appName, securityRoles);<NEW_LINE>} catch (UnableToAdaptException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "There was a problem setting the security meta data for application " + appName + ".", e);<NEW_LINE>}<NEW_LINE>Tr.error(tc, "AUTHZ_TABLE_NOT_CREATED", appName);<NEW_LINE>}<NEW_LINE>}
|
SecurityRoles.class).getSecurityRoles();
|
1,409,872
|
public void onCurrentFirmwareResultUpdate(LwM2mClient client, Long code) {<NEW_LINE>log.debug("[{}] Current fw result: {}", client.getEndpoint(), code);<NEW_LINE>LwM2MClientFwOtaInfo fwInfo = getOrInitFwInfo(client);<NEW_LINE>FirmwareUpdateResult result = FirmwareUpdateResult.fromUpdateResultFwByCode(code.intValue());<NEW_LINE>Optional<OtaPackageUpdateStatus> status = toOtaPackageUpdateStatus(result);<NEW_LINE>if (FirmwareUpdateResult.INITIAL.equals(result) && OtaPackageUpdateStatus.UPDATING.equals(fwInfo.getStatus())) {<NEW_LINE>status = Optional.of(UPDATED);<NEW_LINE>fwInfo.setRetryAttempts(0);<NEW_LINE>fwInfo.setFailedPackageId(null);<NEW_LINE>}<NEW_LINE>status.ifPresent(otaStatus -> {<NEW_LINE>fwInfo.setStatus(otaStatus);<NEW_LINE>sendStateUpdateToTelemetry(client, fwInfo, otaStatus, "Firmware Update Result: " + result.name());<NEW_LINE>});<NEW_LINE>if (result.isAgain() && fwInfo.getRetryAttempts() <= 2) {<NEW_LINE>fwInfo.setRetryAttempts(<MASK><NEW_LINE>startFirmwareUpdateIfNeeded(client, fwInfo);<NEW_LINE>} else {<NEW_LINE>fwInfo.update(result);<NEW_LINE>}<NEW_LINE>update(fwInfo);<NEW_LINE>}
|
fwInfo.getRetryAttempts() + 1);
|
194,466
|
public void initAccessibility() {<NEW_LINE>this.getAccessibleContext().setAccessibleDescription(Util<MASK><NEW_LINE>nameField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_nameField2"));<NEW_LINE>typeCombo.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_typeCombo"));<NEW_LINE>internValueField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_internValueField"));<NEW_LINE>internValueField.selectAll();<NEW_LINE>externPublicField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_externPublicField"));<NEW_LINE>externSystemField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_externSystemField"));<NEW_LINE>unparsedPublicField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_unparsedPublicField"));<NEW_LINE>unparsedSystemField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_unparsedSystemField"));<NEW_LINE>unparsedNotationField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_unparsedNotationField"));<NEW_LINE>}
|
.THIS.getString("ACSD_TreeEntityDeclCustomizer"));
|
620,255
|
public static ListMomentsResponse unmarshall(ListMomentsResponse listMomentsResponse, UnmarshallerContext context) {<NEW_LINE>listMomentsResponse.setRequestId(context.stringValue("ListMomentsResponse.RequestId"));<NEW_LINE>listMomentsResponse.setCode(context.stringValue("ListMomentsResponse.Code"));<NEW_LINE>listMomentsResponse.setMessage<MASK><NEW_LINE>listMomentsResponse.setNextCursor(context.stringValue("ListMomentsResponse.NextCursor"));<NEW_LINE>listMomentsResponse.setTotalCount(context.integerValue("ListMomentsResponse.TotalCount"));<NEW_LINE>listMomentsResponse.setAction(context.stringValue("ListMomentsResponse.Action"));<NEW_LINE>List<Moment> moments = new ArrayList<Moment>();<NEW_LINE>for (int i = 0; i < context.lengthValue("ListMomentsResponse.Moments.Length"); i++) {<NEW_LINE>Moment moment = new Moment();<NEW_LINE>moment.setId(context.longValue("ListMomentsResponse.Moments[" + i + "].Id"));<NEW_LINE>moment.setIdStr(context.stringValue("ListMomentsResponse.Moments[" + i + "].IdStr"));<NEW_LINE>moment.setLocationName(context.stringValue("ListMomentsResponse.Moments[" + i + "].LocationName"));<NEW_LINE>moment.setPhotosCount(context.integerValue("ListMomentsResponse.Moments[" + i + "].PhotosCount"));<NEW_LINE>moment.setState(context.stringValue("ListMomentsResponse.Moments[" + i + "].State"));<NEW_LINE>moment.setTakenAt(context.longValue("ListMomentsResponse.Moments[" + i + "].TakenAt"));<NEW_LINE>moment.setCtime(context.longValue("ListMomentsResponse.Moments[" + i + "].Ctime"));<NEW_LINE>moment.setMtime(context.longValue("ListMomentsResponse.Moments[" + i + "].Mtime"));<NEW_LINE>moments.add(moment);<NEW_LINE>}<NEW_LINE>listMomentsResponse.setMoments(moments);<NEW_LINE>return listMomentsResponse;<NEW_LINE>}
|
(context.stringValue("ListMomentsResponse.Message"));
|
1,101,223
|
public void saveActionClass(final WorkflowActionClass actionClass) throws DotDataException, AlreadyExistException {<NEW_LINE>boolean isNew = true;<NEW_LINE>if (UtilMethods.isSet(actionClass.getId())) {<NEW_LINE>try {<NEW_LINE>final WorkflowActionClass test = this.findActionClass(actionClass.getId());<NEW_LINE>if (test != null) {<NEW_LINE>isNew = false;<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>Logger.debug(this.getClass(), e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>actionClass.setId(UUIDGenerator.generateUuid());<NEW_LINE>}<NEW_LINE>final DotConnect db = new DotConnect();<NEW_LINE>if (isNew) {<NEW_LINE>db.setSQL(sql.INSERT_ACTION_CLASS);<NEW_LINE>db.addParam(actionClass.getId());<NEW_LINE>db.addParam(actionClass.getActionId());<NEW_LINE>db.addParam(actionClass.getName());<NEW_LINE>db.addParam(actionClass.getOrder());<NEW_LINE>db.addParam(actionClass.getClazz());<NEW_LINE>db.loadResult();<NEW_LINE>} else {<NEW_LINE>db.setSQL(sql.UPDATE_ACTION_CLASS);<NEW_LINE>db.addParam(actionClass.getActionId());<NEW_LINE>db.addParam(actionClass.getName());<NEW_LINE>db.addParam(actionClass.getOrder());<NEW_LINE>db.addParam(actionClass.getClazz());<NEW_LINE>db.addParam(actionClass.getId());<NEW_LINE>db.loadResult();<NEW_LINE>}<NEW_LINE>// cache.remove(step);<NEW_LINE>// update workflowScheme mod date<NEW_LINE>final WorkflowAction action = <MASK><NEW_LINE>final WorkflowScheme scheme = findScheme(action.getSchemeId());<NEW_LINE>saveScheme(scheme);<NEW_LINE>cache.remove(action);<NEW_LINE>}
|
findAction(actionClass.getActionId());
|
610,122
|
private List<com.intellij.formatting.Block> buildCallChildChildren(@NotNull ASTNode child, @NotNull IElementType childElementType, @Nullable Wrap callWrap, @Nullable Alignment callAlignment) {<NEW_LINE>List<com.intellij.formatting.Block> blockList = new ArrayList<>();<NEW_LINE>if (childElementType == ACCESS_EXPRESSION) {<NEW_LINE>blockList.addAll(buildAccessExpressionChildren(child));<NEW_LINE>} else if (childElementType == IDENTIFIER) {<NEW_LINE>blockList.addAll(buildIdentifierChildren(child));<NEW_LINE>} else if (childElementType == MATCHED_PARENTHESES_ARGUMENTS) {<NEW_LINE>blockList.addAll(buildMatchedParenthesesArguments(child, callWrap, callAlignment));<NEW_LINE>} else if (childElementType == NO_PARENTHESES_ONE_ARGUMENT) {<NEW_LINE>blockList.addAll(buildNoParenthesesOneArgument(child, callWrap, callAlignment));<NEW_LINE>} else if (OPERATOR_RULE_TOKEN_SET.contains(childElementType)) {<NEW_LINE>blockList<MASK><NEW_LINE>} else {<NEW_LINE>blockList.add(buildChild(child));<NEW_LINE>}<NEW_LINE>return blockList;<NEW_LINE>}
|
.addAll(buildOperatorRuleChildren(child));
|
1,073,019
|
public void showPreviewForKey(Keyboard.Key key, CharSequence label, Point previewPosition) {<NEW_LINE>mPreviewIcon.setVisibility(View.GONE);<NEW_LINE>mPreviewText.setVisibility(View.VISIBLE);<NEW_LINE>mPreviewIcon.setImageDrawable(null);<NEW_LINE>mPreviewText.setTextColor(mPreviewPopupTheme.getPreviewKeyTextColor());<NEW_LINE>mPreviewText.setText(label);<NEW_LINE>if (label.length() > 1 && key.getCodesCount() < 2) {<NEW_LINE>mPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mPreviewPopupTheme.getPreviewLabelTextSize());<NEW_LINE>} else {<NEW_LINE>mPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mPreviewPopupTheme.getPreviewKeyTextSize());<NEW_LINE>}<NEW_LINE>mPreviewText.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(0<MASK><NEW_LINE>showPopup(key, mPreviewText.getMeasuredWidth(), mPreviewText.getMeasuredHeight(), previewPosition);<NEW_LINE>}
|
, View.MeasureSpec.UNSPECIFIED));
|
308,512
|
private boolean isLoadAboveBalanceLowerLimitAfterChange(Load load, Broker broker, ChangeType changeType) {<NEW_LINE>double utilizationDelta = load == null ? 0 : load.expectedUtilizationFor(resource());<NEW_LINE>double brokerBalanceLowerLimit = broker.capacityFor(resource()) * _balanceLowerThreshold;<NEW_LINE>double brokerUtilization = broker.load().expectedUtilizationFor(resource());<NEW_LINE>boolean isBrokerAboveLowerLimit = changeType == ADD ? brokerUtilization + utilizationDelta >= brokerBalanceLowerLimit : brokerUtilization - utilizationDelta >= brokerBalanceLowerLimit;<NEW_LINE>if (resource().isHostResource()) {<NEW_LINE>double hostBalanceLowerLimit = broker.host().capacityFor(resource()) * _balanceLowerThreshold;<NEW_LINE>double hostUtilization = broker.host().load(<MASK><NEW_LINE>boolean isHostAboveLowerLimit = changeType == ADD ? hostUtilization + utilizationDelta >= hostBalanceLowerLimit : hostUtilization - utilizationDelta >= hostBalanceLowerLimit;<NEW_LINE>// As long as either the host or the broker is above the limit, we claim the host resource utilization is<NEW_LINE>// above the limit. If the host is below limit, there must be at least one broker below limit. We should just<NEW_LINE>// bring more load to that broker.<NEW_LINE>return isHostAboveLowerLimit || isBrokerAboveLowerLimit;<NEW_LINE>} else {<NEW_LINE>return isBrokerAboveLowerLimit;<NEW_LINE>}<NEW_LINE>}
|
).expectedUtilizationFor(resource());
|
328,377
|
public void visitField(FieldNode node) {<NEW_LINE>// Do not write fields back which are manually added due to optimization<NEW_LINE>if (!node.getName().startsWith("$")) {<NEW_LINE>visitAnnotations(node);<NEW_LINE>preVisitStatement(node);<NEW_LINE>// properties are stored twice in ClassNode, visitOnlyOnce<NEW_LINE>// visitProperty does nothing<NEW_LINE>if (ASTWriterHelper.isProperty(node)) {<NEW_LINE>if (!node.isDynamicTyped()) {<NEW_LINE>if (node.isStatic()) {<NEW_LINE>groovyCode.append("static ");<NEW_LINE>}<NEW_LINE>printType(node.getOriginType());<NEW_LINE>} else {<NEW_LINE>groovyCode.append("def");<NEW_LINE>if (node.isStatic()) {<NEW_LINE>groovyCode.append(" static");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>groovyCode.append(" ");<NEW_LINE>} else {<NEW_LINE>groovyCode.append(ASTWriterHelper.getAccModifier(node.getModifiers(), ASTWriterHelper.MOD_FIELD));<NEW_LINE>if (!node.isDynamicTyped()) {<NEW_LINE><MASK><NEW_LINE>groovyCode.append(" ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>groovyCode.append(node.getName());<NEW_LINE>Expression init = node.getInitialExpression();<NEW_LINE>if (init != null) {<NEW_LINE>if (init.getLineNumber() != -1) {<NEW_LINE>groovyCode.append(" = ");<NEW_LINE>init.visit(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>postVisitStatement(node);<NEW_LINE>}<NEW_LINE>}
|
printType(node.getOriginType());
|
175,758
|
protected INDArray createWeightMatrix(NeuralNetConfiguration conf, INDArray weightView, boolean initializeParams) {<NEW_LINE>org.deeplearning4j.nn.conf.layers.Deconvolution2D layerConf = (org.deeplearning4j.nn.conf.layers.Deconvolution2D) conf.getLayer();<NEW_LINE>if (initializeParams) {<NEW_LINE>int[] kernel = layerConf.getKernelSize();<NEW_LINE>int[] stride = layerConf.getStride();<NEW_LINE>val inputDepth = layerConf.getNIn();<NEW_LINE>val outputDepth = layerConf.getNOut();<NEW_LINE>double fanIn = inputDepth * kernel[0] * kernel[1];<NEW_LINE>double fanOut = outputDepth * kernel[0] * kernel[1] / ((double) stride[0] * stride[1]);<NEW_LINE>val weightsShape = new long[] { inputDepth, outputDepth, kernel[<MASK><NEW_LINE>INDArray weights = layerConf.getWeightInitFn().init(fanIn, fanOut, weightsShape, 'c', weightView);<NEW_LINE>return weights;<NEW_LINE>} else {<NEW_LINE>int[] kernel = layerConf.getKernelSize();<NEW_LINE>INDArray weights = WeightInitUtil.reshapeWeights(new long[] { layerConf.getNIn(), layerConf.getNOut(), kernel[0], kernel[1] }, weightView, 'c');<NEW_LINE>return weights;<NEW_LINE>}<NEW_LINE>}
|
0], kernel[1] };
|
1,021,532
|
private FullTextQuery createQuery(boolean forCount) {<NEW_LINE>QueryMetadata metadata = queryMixin.getMetadata();<NEW_LINE>org.<MASK><NEW_LINE>if (metadata.getWhere() != null) {<NEW_LINE>query = serializer.toQuery(metadata.getWhere(), metadata);<NEW_LINE>} else {<NEW_LINE>query = new MatchAllDocsQuery();<NEW_LINE>}<NEW_LINE>FullTextQuery fullTextQuery = session.createFullTextQuery(query, path.getType());<NEW_LINE>// order<NEW_LINE>if (!metadata.getOrderBy().isEmpty() && !forCount) {<NEW_LINE>fullTextQuery.setSort(serializer.toSort(metadata.getOrderBy()));<NEW_LINE>}<NEW_LINE>// paging<NEW_LINE>QueryModifiers modifiers = metadata.getModifiers();<NEW_LINE>if (modifiers.isRestricting() && !forCount) {<NEW_LINE>Integer limit = modifiers.getLimitAsInteger();<NEW_LINE>Integer offset = modifiers.getOffsetAsInteger();<NEW_LINE>if (limit != null) {<NEW_LINE>fullTextQuery.setMaxResults(limit);<NEW_LINE>}<NEW_LINE>if (offset != null) {<NEW_LINE>fullTextQuery.setFirstResult(offset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return fullTextQuery;<NEW_LINE>}
|
apache.lucene.search.Query query;
|
249,053
|
private WorkflowTrace createHandshakeWorkflow(AliasedConnection connection) {<NEW_LINE>WorkflowTrace workflowTrace = this.createHelloWorkflow(connection);<NEW_LINE>List<ProtocolMessage> messages = new LinkedList<>();<NEW_LINE>if (config.getHighestProtocolVersion().isTLS13()) {<NEW_LINE>if (Objects.equals(config.getTls13BackwardsCompatibilityMode(), Boolean.TRUE) || connection.getLocalConnectionEndType() == ConnectionEndType.SERVER) {<NEW_LINE>ChangeCipherSpecMessage ccs = new ChangeCipherSpecMessage();<NEW_LINE>ccs.setRequired(false);<NEW_LINE>messages.add(ccs);<NEW_LINE>}<NEW_LINE>if (config.isClientAuthentication()) {<NEW_LINE>messages.add(new CertificateMessage(config));<NEW_LINE>messages.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (config.isClientAuthentication()) {<NEW_LINE>messages.add(new CertificateMessage(config));<NEW_LINE>addClientKeyExchangeMessage(messages);<NEW_LINE>messages.add(new CertificateVerifyMessage(config));<NEW_LINE>} else {<NEW_LINE>addClientKeyExchangeMessage(messages);<NEW_LINE>}<NEW_LINE>messages.add(new ChangeCipherSpecMessage(config));<NEW_LINE>}<NEW_LINE>messages.add(new FinishedMessage(config));<NEW_LINE>workflowTrace.addTlsAction(MessageActionFactory.createAction(config, connection, ConnectionEndType.CLIENT, messages));<NEW_LINE>if (!config.getHighestProtocolVersion().isTLS13()) {<NEW_LINE>workflowTrace.addTlsAction(MessageActionFactory.createAction(config, connection, ConnectionEndType.SERVER, new ChangeCipherSpecMessage(config), new FinishedMessage(config)));<NEW_LINE>}<NEW_LINE>return workflowTrace;<NEW_LINE>}
|
add(new CertificateVerifyMessage(config));
|
1,154,416
|
public AsyncFuture<DeleteSeries> deleteSeries(final DeleteSeries.Request request) {<NEW_LINE>final DateRange range = request.getRange();<NEW_LINE>final FindSeries.Request findIds = new FindSeries.Request(request.getFilter(), range, request.getLimit(), Features.DEFAULT);<NEW_LINE>return doto(c -> findSeriesIds(findIds).lazyTransform(ids -> {<NEW_LINE>final List<Callable<AsyncFuture<Void>>> deletes = new ArrayList<>();<NEW_LINE>for (final String id : ids.getIds()) {<NEW_LINE>deletes.add(() -> {<NEW_LINE>final List<DeleteRequest> requests = c.getIndex().delete(METADATA_TYPE, id);<NEW_LINE>return async.collectAndDiscard(requests.stream().map(deleteRequest -> {<NEW_LINE>final ResolvableFuture<DeleteResponse> future = async.future();<NEW_LINE>c.execute(deleteRequest, bind(future));<NEW_LINE>return future;<NEW_LINE>}).collect<MASK><NEW_LINE>});<NEW_LINE>}<NEW_LINE>return async.eventuallyCollect(deletes, newDeleteCollector(), deleteParallelism);<NEW_LINE>}));<NEW_LINE>}
|
(Collectors.toList()));
|
61,161
|
public ListenableFuture<?> execute(RenameTable statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, Session session, List<Expression> parameters, WarningCollector warningCollector) {<NEW_LINE>QualifiedObjectName tableName = createQualifiedObjectName(session, statement, statement.getSource());<NEW_LINE>Optional<TableHandle> tableHandle = metadata.getTableHandle(session, tableName);<NEW_LINE>if (!tableHandle.isPresent()) {<NEW_LINE>if (!statement.isExists()) {<NEW_LINE>throw new SemanticException(MISSING_TABLE, statement, "Table '%s' does not exist", tableName);<NEW_LINE>}<NEW_LINE>return immediateFuture(null);<NEW_LINE>}<NEW_LINE>Optional<ConnectorMaterializedViewDefinition> optionalMaterializedView = metadata.getMaterializedView(session, tableName);<NEW_LINE>if (optionalMaterializedView.isPresent()) {<NEW_LINE>if (!statement.isExists()) {<NEW_LINE>throw new SemanticException(NOT_SUPPORTED, statement, "'%s' is a materialized view, and rename is not supported", tableName);<NEW_LINE>}<NEW_LINE>return immediateFuture(null);<NEW_LINE>}<NEW_LINE>QualifiedObjectName target = createQualifiedObjectName(session, statement, statement.getTarget());<NEW_LINE>if (!metadata.getCatalogHandle(session, target.getCatalogName()).isPresent()) {<NEW_LINE>throw new SemanticException(MISSING_CATALOG, statement, <MASK><NEW_LINE>}<NEW_LINE>if (metadata.getTableHandle(session, target).isPresent()) {<NEW_LINE>throw new SemanticException(TABLE_ALREADY_EXISTS, statement, "Target table '%s' already exists", target);<NEW_LINE>}<NEW_LINE>if (!tableName.getCatalogName().equals(target.getCatalogName())) {<NEW_LINE>throw new SemanticException(NOT_SUPPORTED, statement, "Table rename across catalogs is not supported");<NEW_LINE>}<NEW_LINE>accessControl.checkCanRenameTable(session.getRequiredTransactionId(), session.getIdentity(), session.getAccessControlContext(), tableName, target);<NEW_LINE>metadata.renameTable(session, tableHandle.get(), target);<NEW_LINE>return immediateFuture(null);<NEW_LINE>}
|
"Target catalog '%s' does not exist", target.getCatalogName());
|
1,529,605
|
public static GetServiceListResponse unmarshall(GetServiceListResponse getServiceListResponse, UnmarshallerContext _ctx) {<NEW_LINE>getServiceListResponse.setRequestId(_ctx.stringValue("GetServiceListResponse.RequestId"));<NEW_LINE>getServiceListResponse.setHttpStatusCode(_ctx.integerValue("GetServiceListResponse.HttpStatusCode"));<NEW_LINE>getServiceListResponse.setMessage(_ctx.stringValue("GetServiceListResponse.Message"));<NEW_LINE>getServiceListResponse.setCode(_ctx.integerValue("GetServiceListResponse.Code"));<NEW_LINE>getServiceListResponse.setSuccess(_ctx.booleanValue("GetServiceListResponse.Success"));<NEW_LINE>List<MscServiceDetailResponse> data = new ArrayList<MscServiceDetailResponse>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetServiceListResponse.Data.Length"); i++) {<NEW_LINE>MscServiceDetailResponse mscServiceDetailResponse = new MscServiceDetailResponse();<NEW_LINE>mscServiceDetailResponse.setEdasAppName(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].EdasAppName"));<NEW_LINE>mscServiceDetailResponse.setDubboApplicationName(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].DubboApplicationName"));<NEW_LINE>mscServiceDetailResponse.setVersion(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].Version"));<NEW_LINE>mscServiceDetailResponse.setSpringApplicationName(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].SpringApplicationName"));<NEW_LINE>mscServiceDetailResponse.setRegistryType(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].RegistryType"));<NEW_LINE>mscServiceDetailResponse.setServiceType(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].ServiceType"));<NEW_LINE>mscServiceDetailResponse.setServiceName(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].ServiceName"));<NEW_LINE>mscServiceDetailResponse.setMetadata(_ctx.mapValue("GetServiceListResponse.Data[" + i + "].Metadata"));<NEW_LINE>mscServiceDetailResponse.setGroup(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].Group"));<NEW_LINE>List<Method> methods = new ArrayList<Method>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("GetServiceListResponse.Data[" + i + "].Methods.Length"); j++) {<NEW_LINE>Method method = new Method();<NEW_LINE>method.setName(_ctx.stringValue("GetServiceListResponse.Data[" + i <MASK><NEW_LINE>method.setMethodController(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].Methods[" + j + "].MethodController"));<NEW_LINE>method.setReturnType(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].Methods[" + j + "].ReturnType"));<NEW_LINE>List<String> paths = new ArrayList<String>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("GetServiceListResponse.Data[" + i + "].Methods[" + j + "].Paths.Length"); k++) {<NEW_LINE>paths.add(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].Methods[" + j + "].Paths[" + k + "]"));<NEW_LINE>}<NEW_LINE>method.setPaths(paths);<NEW_LINE>List<String> parameterTypes = new ArrayList<String>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("GetServiceListResponse.Data[" + i + "].Methods[" + j + "].ParameterTypes.Length"); k++) {<NEW_LINE>parameterTypes.add(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].Methods[" + j + "].ParameterTypes[" + k + "]"));<NEW_LINE>}<NEW_LINE>method.setParameterTypes(parameterTypes);<NEW_LINE>List<String> requestMethods = new ArrayList<String>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("GetServiceListResponse.Data[" + i + "].Methods[" + j + "].RequestMethods.Length"); k++) {<NEW_LINE>requestMethods.add(_ctx.stringValue("GetServiceListResponse.Data[" + i + "].Methods[" + j + "].RequestMethods[" + k + "]"));<NEW_LINE>}<NEW_LINE>method.setRequestMethods(requestMethods);<NEW_LINE>methods.add(method);<NEW_LINE>}<NEW_LINE>mscServiceDetailResponse.setMethods(methods);<NEW_LINE>data.add(mscServiceDetailResponse);<NEW_LINE>}<NEW_LINE>getServiceListResponse.setData(data);<NEW_LINE>return getServiceListResponse;<NEW_LINE>}
|
+ "].Methods[" + j + "].Name"));
|
998,872
|
public StartSigningJobParameter unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StartSigningJobParameter startSigningJobParameter = new StartSigningJobParameter();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("signingProfileParameter")) {<NEW_LINE>startSigningJobParameter.setSigningProfileParameter(SigningProfileParameterJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("signingProfileName")) {<NEW_LINE>startSigningJobParameter.setSigningProfileName(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("destination")) {<NEW_LINE>startSigningJobParameter.setDestination(DestinationJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return startSigningJobParameter;<NEW_LINE>}
|
().unmarshall(context));
|
1,578,952
|
final GetRoomResult executeGetRoom(GetRoomRequest getRoomRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRoomRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRoomRequest> request = null;<NEW_LINE>Response<GetRoomResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRoomRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRoomRequest));<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, "Alexa For Business");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRoom");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRoomResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRoomResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
invoke(request, responseHandler, executionContext);
|
1,032,621
|
// Notifications<NEW_LINE>void updateNotification() {<NEW_LINE>final int notifyMode;<NEW_LINE>if (isPlaying()) {<NEW_LINE>notifyMode = NotifyMode.FOREGROUND;<NEW_LINE>} else if (recentlyPlayed()) {<NEW_LINE>notifyMode = NotifyMode.BACKGROUND;<NEW_LINE>} else {<NEW_LINE>notifyMode = NotifyMode.NONE;<NEW_LINE>}<NEW_LINE>switch(notifyMode) {<NEW_LINE>case NotifyMode.FOREGROUND:<NEW_LINE>startForegroundImpl();<NEW_LINE>break;<NEW_LINE>case NotifyMode.BACKGROUND:<NEW_LINE>try {<NEW_LINE>if (queueManager.getCurrentSong() != null) {<NEW_LINE>notificationHelper.notify(this, playlistsRepository, songsRepository, queueManager.getCurrentSong(), isPlaying(), playbackManager.getMediaSessionToken(), settingsManager, favoritesPlaylistManager);<NEW_LINE>}<NEW_LINE>} catch (ConcurrentModificationException e) {<NEW_LINE>LogUtils.<MASK><NEW_LINE>}<NEW_LINE>stopForegroundImpl(false, false);<NEW_LINE>break;<NEW_LINE>case NotifyMode.NONE:<NEW_LINE>stopForegroundImpl(false, false);<NEW_LINE>notificationHelper.cancel();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
|
logException(TAG, "Exception while attempting to show notification", e);
|
1,415,984
|
private static <T> UnmodifiableIterator<List<T>> partitionImpl(final Iterator<T> iterator, final int size, final boolean pad) {<NEW_LINE>checkNotNull(iterator);<NEW_LINE>checkArgument(size > 0);<NEW_LINE>return new UnmodifiableIterator<List<T>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>return iterator.hasNext();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public List<T> next() {<NEW_LINE>if (!hasNext()) {<NEW_LINE>throw new NoSuchElementException();<NEW_LINE>}<NEW_LINE>Object[] array = new Object[size];<NEW_LINE>int count = 0;<NEW_LINE>for (; count < size && iterator.hasNext(); count++) {<NEW_LINE>array[count] = iterator.next();<NEW_LINE>}<NEW_LINE>for (int i = count; i < size; i++) {<NEW_LINE>// for GWT<NEW_LINE>array[i] = null;<NEW_LINE>}<NEW_LINE>// we only put Ts in it<NEW_LINE>@SuppressWarnings({ "unchecked", "rawtypes" })<NEW_LINE>List<T> list = Collections.unmodifiableList((List<T>) Arrays.asList(array));<NEW_LINE>return (pad || count == size) ? list : <MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
|
list.subList(0, count);
|
1,759,592
|
public static boolean performPatch(File patch, File file) throws MissingResourceException {<NEW_LINE>List<ContextualPatch.PatchReport> report = null;<NEW_LINE>try (ProgressHandle ph = ProgressHandle.createHandle(NbBundle.getMessage(PatchAction.class, "MSG_AplyingPatch", new Object[] { patch.getName() }))) {<NEW_LINE>ph.start();<NEW_LINE>ContextualPatch cp = ContextualPatch.create(patch, file);<NEW_LINE>try {<NEW_LINE>report = cp.patch(false, ph);<NEW_LINE>} catch (Exception ioex) {<NEW_LINE>ErrorManager.getDefault().annotate(ioex, NbBundle.getMessage(PatchAction.class, "EXC_PatchParsingFailed", ioex.getLocalizedMessage()));<NEW_LINE>ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ioex);<NEW_LINE>ErrorManager.getDefault().<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return displayPatchReport(report, patch);<NEW_LINE>}
|
notify(ErrorManager.USER, ioex);
|
351,213
|
final DescribePrefixListsResult executeDescribePrefixLists(DescribePrefixListsRequest describePrefixListsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePrefixListsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePrefixListsRequest> request = null;<NEW_LINE>Response<DescribePrefixListsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePrefixListsRequestMarshaller().marshall(super.beforeMarshalling(describePrefixListsRequest));<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, "DescribePrefixLists");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribePrefixListsResult> responseHandler = new StaxResponseHandler<DescribePrefixListsResult>(new DescribePrefixListsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
|
endClientExecution(awsRequestMetrics, request, response);
|
1,808,319
|
public static MAssetAddition createAsset(MProject project, MProduct product) {<NEW_LINE>MAssetAddition assetAddition = new MAssetAddition(project);<NEW_LINE>assetAddition.dump();<NEW_LINE><MASK><NEW_LINE>if (product != null) {<NEW_LINE>asset.setM_Product_ID(product.getM_Product_ID());<NEW_LINE>asset.setA_Asset_Group_ID(product.getA_Asset_Group_ID());<NEW_LINE>MAttributeSetInstance asi = MAttributeSetInstance.create(Env.getCtx(), product, null);<NEW_LINE>asset.setM_AttributeSetInstance_ID(asi.getM_AttributeSetInstance_ID());<NEW_LINE>}<NEW_LINE>asset.setName(product.getName().concat(project.getName()));<NEW_LINE>asset.setValue(product.getName().concat(project.getName()));<NEW_LINE>asset.saveEx();<NEW_LINE>asset.dump();<NEW_LINE>// Copy UseLife values from asset group to workfile<NEW_LINE>MAssetGroupAcct assetgrpacct = MAssetGroupAcct.forA_Asset_Group_ID(asset.getCtx(), asset.getA_Asset_Group_ID(), assetAddition.getPostingType(), null);<NEW_LINE>assetAddition.setDeltaUseLifeYears(assetgrpacct.getUseLifeYears());<NEW_LINE>assetAddition.setDeltaUseLifeYears_F(assetgrpacct.getUseLifeYears_F());<NEW_LINE>assetAddition.setA_Asset(asset);<NEW_LINE>assetAddition.saveEx();<NEW_LINE>// @win add<NEW_LINE>return assetAddition;<NEW_LINE>}
|
MAsset asset = assetAddition.createAsset();
|
132,155
|
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {<NEW_LINE>requestStateUpdate();<NEW_LINE>GlStateManager.color(1, 1, 1);<NEW_LINE>bindGuiTexture();<NEW_LINE>int sx = (width - xSize) / 2;<NEW_LINE>int sy = (height - ySize) / 2;<NEW_LINE>drawTexturedModalRect(sx, sy, 0, 0, xSize, ySize);<NEW_LINE>for (int i = 0; i < buttonList.size(); ++i) {<NEW_LINE>GuiButton guibutton = buttonList.get(i);<NEW_LINE>guibutton.drawButton(mc, 0, 0, par1);<NEW_LINE>}<NEW_LINE>int midX = sx + xSize / 2;<NEW_LINE>String str = Lang.GUI_CAPBANK_MAX_IO.get() + " " + LangPower.RFt(network.getMaxIO());<NEW_LINE>FontRenderer fr = getFontRenderer();<NEW_LINE>int swid = fr.getStringWidth(str);<NEW_LINE>int x = midX - swid / 2;<NEW_LINE>int y = guiTop + 5;<NEW_LINE>drawString(fr, str, x, y, -1);<NEW_LINE>str = Lang.GUI_CAPBANK_MAX_INPUT.get() + ":";<NEW_LINE>swid = fr.getStringWidth(str);<NEW_LINE>x = guiLeft + inputX - swid - 26;<NEW_LINE>y = guiTop + inputY + 2;<NEW_LINE>drawString(fr, str, x, y, -1);<NEW_LINE>str = Lang.GUI_CAPBANK_MAX_OUTPUT.get() + ":";<NEW_LINE>swid = fr.getStringWidth(str);<NEW_LINE>x <MASK><NEW_LINE>y = guiTop + outputY + 2;<NEW_LINE>drawString(fr, str, x, y, -1);<NEW_LINE>super.drawGuiContainerBackgroundLayer(par1, par2, par3);<NEW_LINE>}
|
= guiLeft + outputX - swid - 26;
|
901,153
|
private final void sumValues(List<MatchingDocs> matchingDocs) throws IOException {<NEW_LINE>// System.out.println("count matchingDocs=" + matchingDocs + " facetsField=" + facetsFieldName);<NEW_LINE>for (MatchingDocs hits : matchingDocs) {<NEW_LINE>BinaryDocValues dv = hits.context.reader().getBinaryDocValues(indexFieldName);<NEW_LINE>if (dv == null) {<NEW_LINE>// this reader does not have DocValues for the requested category list<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>DocIdSetIterator docs = hits.bits.iterator();<NEW_LINE>int doc;<NEW_LINE>while ((doc = docs.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {<NEW_LINE>if (dv.docID() < doc) {<NEW_LINE>dv.advance(doc);<NEW_LINE>}<NEW_LINE>if (dv.docID() == doc) {<NEW_LINE>final BytesRef bytesRef = dv.binaryValue();<NEW_LINE>byte[] bytes = bytesRef.bytes;<NEW_LINE>int end <MASK><NEW_LINE>int offset = bytesRef.offset;<NEW_LINE>while (offset < end) {<NEW_LINE>int ord = (int) BitUtil.VH_BE_INT.get(bytes, offset);<NEW_LINE>offset += 4;<NEW_LINE>float value = (float) BitUtil.VH_BE_FLOAT.get(bytes, offset);<NEW_LINE>offset += 4;<NEW_LINE>values[ord] += value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
= bytesRef.offset + bytesRef.length;
|
267,817
|
public Result editYb(UUID customerUUID, UUID configUUID) {<NEW_LINE>CustomerConfig existingConfig = customerConfigService.getOrBadRequest(customerUUID, configUUID);<NEW_LINE>if (existingConfig.getState().equals(ConfigState.QueuedForDeletion)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>CustomerConfig customerConfig = parseJson(CustomerConfig.class);<NEW_LINE>customerConfig.setConfigUUID(configUUID);<NEW_LINE>customerConfig.setCustomerUUID(customerUUID);<NEW_LINE>CustomerConfig unmaskedConfig = CommonUtils.unmaskObject(existingConfig, customerConfig);<NEW_LINE>customerConfigService.edit(unmaskedConfig);<NEW_LINE>auditService().createAuditEntryWithReqBody(ctx(), Audit.TargetType.CustomerConfig, Objects.toString(customerConfig.configUUID, null), Audit.ActionType.Update, request().body().asJson());<NEW_LINE>return PlatformResults.withData(unmaskedConfig);<NEW_LINE>}
|
throw new PlatformServiceException(BAD_REQUEST, "Cannot edit config as it is queued for deletion.");
|
79,786
|
private void init() {<NEW_LINE>// WARNING: called from ctor so must not be overridden (i.e. must be private or final)<NEW_LINE>setLayout(new BorderLayout());<NEW_LINE>setBorder(makeBorder());<NEW_LINE>add(makeTitlePanel(), BorderLayout.NORTH);<NEW_LINE>JPanel mainPanel = new JPanel(new MigLayout("fillx, wrap 3, insets 0", "[][fill,grow]"));<NEW_LINE>add(mainPanel, BorderLayout.CENTER);<NEW_LINE>mainPanel.add(useProperties, "span");<NEW_LINE>mainPanel.add(JMeterUtils<MASK><NEW_LINE>mainPanel.add(jndiICF, "span, growx");<NEW_LINE>mainPanel.add(JMeterUtils.labelFor(urlField, "jms_provider_url"));<NEW_LINE>mainPanel.add(urlField, "span, growx");<NEW_LINE>mainPanel.add(useAuth);<NEW_LINE>mainPanel.add(jmsUser);<NEW_LINE>mainPanel.add(jmsPwd);<NEW_LINE>mainPanel.add(JMeterUtils.labelFor(jndiConnFac, "jms_connection_factory"));<NEW_LINE>mainPanel.add(jndiConnFac, "span, growx");<NEW_LINE>mainPanel.add(JMeterUtils.labelFor(jmsDestination, "jms_topic"));<NEW_LINE>mainPanel.add(jmsDestination);<NEW_LINE>mainPanel.add(destSetup);<NEW_LINE>mainPanel.add(useNonPersistentDelivery);<NEW_LINE>mainPanel.add(expiration);<NEW_LINE>mainPanel.add(priority);<NEW_LINE>jmsPropertiesPanel = new JMSPropertiesPanel();<NEW_LINE>mainPanel.add(jmsPropertiesPanel, "span, growx");<NEW_LINE>mainPanel.add(msgChoice, "span");<NEW_LINE>fileEncoding = new JComboBox<String>(PublisherSampler.getSupportedEncodings());<NEW_LINE>fileEncoding.setEditable(true);<NEW_LINE>mainPanel.add(JMeterUtils.labelFor(fileEncoding, "content_encoding"));<NEW_LINE>mainPanel.add(fileEncoding, "span, growx");<NEW_LINE>mainPanel.add(configChoice, "span");<NEW_LINE>mainPanel.add(JMeterUtils.labelFor(textMessage, "jms_text_area"), "span");<NEW_LINE>mainPanel.add(JTextScrollPane.getInstance(textMessage), "span, growx");<NEW_LINE>mainPanel.add(messageFile, "span, growx");<NEW_LINE>mainPanel.add(randomFile, "span, growx");<NEW_LINE>mainPanel.add(JMeterUtils.labelFor(jmsErrorReconnectOnCodes, "jms_error_reconnect_on_codes"));<NEW_LINE>mainPanel.add(jmsErrorReconnectOnCodes, "span, growx");<NEW_LINE>mainPanel.add(JMeterUtils.labelFor(iterations, "jms_itertions"));<NEW_LINE>mainPanel.add(iterations, "span, growx");<NEW_LINE>useProperties.addChangeListener(this);<NEW_LINE>useAuth.addChangeListener(this);<NEW_LINE>configChoice.addChangeListener(this);<NEW_LINE>msgChoice.addChangeListener(this);<NEW_LINE>}
|
.labelFor(jndiICF, "jms_initial_context_factory"));
|
397,186
|
final SendProjectSessionActionResult executeSendProjectSessionAction(SendProjectSessionActionRequest sendProjectSessionActionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(sendProjectSessionActionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SendProjectSessionActionRequest> request = null;<NEW_LINE>Response<SendProjectSessionActionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SendProjectSessionActionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(sendProjectSessionActionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataBrew");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SendProjectSessionActionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SendProjectSessionActionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.OPERATION_NAME, "SendProjectSessionAction");
|
1,791,344
|
protected void initHistoryJobHandlers() {<NEW_LINE>if (isAsyncHistoryEnabled) {<NEW_LINE>historyJobHandlers = new HashMap<>();<NEW_LINE>List<HistoryJsonTransformer> allHistoryJsonTransformers = new ArrayList<>(initDefaultHistoryJsonTransformers());<NEW_LINE>if (customHistoryJsonTransformers != null) {<NEW_LINE>allHistoryJsonTransformers.addAll(customHistoryJsonTransformers);<NEW_LINE>}<NEW_LINE>AsyncHistoryJobHandler asyncHistoryJobHandler = new AsyncHistoryJobHandler(CmmnAsyncHistoryConstants.JOB_HANDLER_TYPE_DEFAULT_ASYNC_HISTORY);<NEW_LINE>allHistoryJsonTransformers.forEach(asyncHistoryJobHandler::addHistoryJsonTransformer);<NEW_LINE>asyncHistoryJobHandler.setAsyncHistoryJsonGroupingEnabled(isAsyncHistoryJsonGroupingEnabled);<NEW_LINE>historyJobHandlers.put(asyncHistoryJobHandler.getType(), asyncHistoryJobHandler);<NEW_LINE>AsyncHistoryJobZippedHandler asyncHistoryJobZippedHandler = new AsyncHistoryJobZippedHandler(CmmnAsyncHistoryConstants.JOB_HANDLER_TYPE_DEFAULT_ASYNC_HISTORY_ZIPPED);<NEW_LINE>allHistoryJsonTransformers.forEach(asyncHistoryJobZippedHandler::addHistoryJsonTransformer);<NEW_LINE>asyncHistoryJobZippedHandler.setAsyncHistoryJsonGroupingEnabled(isAsyncHistoryJsonGroupingEnabled);<NEW_LINE>historyJobHandlers.put(asyncHistoryJobZippedHandler.getType(), asyncHistoryJobZippedHandler);<NEW_LINE>if (getCustomHistoryJobHandlers() != null) {<NEW_LINE>for (HistoryJobHandler customJobHandler : getCustomHistoryJobHandlers()) {<NEW_LINE>historyJobHandlers.put(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
customJobHandler.getType(), customJobHandler);
|
1,120,244
|
public AddressSet flowConstants(final Program program, Address flowStart, AddressSetView flowSet, final SymbolicPropogator symEval, final TaskMonitor monitor) throws CancelledException {<NEW_LINE>// follow all flows building up context<NEW_LINE>// use context to fill out addresses on certain instructions<NEW_LINE>ContextEvaluator eval = new ConstantPropagationContextEvaluator(trustWriteMemOption) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean evaluateReference(VarnodeContext context, Instruction instr, int pcodeop, Address address, int size, RefType refType) {<NEW_LINE>AddressSpace space = address.getAddressSpace();<NEW_LINE>if (space.hasMappedRegisters()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>boolean isCodeSpace = address.getAddressSpace().<MASK><NEW_LINE>if (refType.isComputed() && refType.isFlow() && isCodeSpace) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return super.evaluateReference(context, instr, pcodeop, address, size, refType);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean evaluateDestination(VarnodeContext context, Instruction instruction) {<NEW_LINE>FlowType flowType = instruction.getFlowType();<NEW_LINE>if (!flowType.isFlow()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Reference[] refs = instruction.getReferencesFrom();<NEW_LINE>if (refs.length == 1 && refs[0].getReferenceType().isFlow()) {<NEW_LINE>writeContext(refs[0].getToAddress(), context);<NEW_LINE>Address dest = refs[0].getToAddress();<NEW_LINE>disassemblyPoints.addRange(dest, dest);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>private void writeContext(Address dest, VarnodeContext context) {<NEW_LINE>flowRegister(dest, context, bsrReg);<NEW_LINE>flowRegister(dest, context, statusReg);<NEW_LINE>flowRegister(dest, context, pclathReg);<NEW_LINE>flowRegister(dest, context, pclReg);<NEW_LINE>flowRegister(dest, context, wReg);<NEW_LINE>flowRegister(dest, context, rpStatusReg);<NEW_LINE>flowRegister(dest, context, irpStatusReg);<NEW_LINE>startNewBlock(program, dest);<NEW_LINE>}<NEW_LINE><NEW_LINE>private void flowRegister(Address dest, VarnodeContext context, Register reg) {<NEW_LINE>ProgramContext programContext = program.getProgramContext();<NEW_LINE>if (reg == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RegisterValue rValue = context.getRegisterValue(reg);<NEW_LINE>if (rValue == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>programContext.setRegisterValue(dest, dest, rValue);<NEW_LINE>} catch (ContextChangeException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>startNewBlock(program, flowStart);<NEW_LINE>AddressSet result = symEval.flowConstants(flowStart, flowSet, eval, true, monitor);<NEW_LINE>if (!disassemblyPoints.isEmpty()) {<NEW_LINE>AutoAnalysisManager mgr = AutoAnalysisManager.getAnalysisManager(program);<NEW_LINE>mgr.disassemble(disassemblyPoints);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
getName().equals(CODE_SPACE_NAME);
|
1,730,724
|
private ILogicExpression evaluatePartial(final ExpressionEvaluationContext ctx, final ILogicExpression expr) {<NEW_LINE>logger.trace("Partial evaluating {}", expr);<NEW_LINE>if (expr == null) {<NEW_LINE>throw new ExpressionEvaluationException("Cannot evaluate null expression");<NEW_LINE>} else if (expr.isConstant()) {<NEW_LINE>return expr;<NEW_LINE>} else if (expr instanceof LogicTuple) {<NEW_LINE>final LogicTuple tuple = (LogicTuple) expr;<NEW_LINE>final Object operand1 = tuple.getOperand1();<NEW_LINE>final String operand1Resolved = ctx.getValue(operand1);<NEW_LINE>@SuppressWarnings("StringEquality")<NEW_LINE>final boolean isOperand1Resolved = operand1Resolved != VALUE_NotFound;<NEW_LINE>final Object newOperand1 = isOperand1Resolved ? operand1Resolved : operand1;<NEW_LINE>final Object operand2 = tuple.getOperand2();<NEW_LINE>final String operand2Resolved = ctx.getValue(operand2);<NEW_LINE>@SuppressWarnings("StringEquality")<NEW_LINE>final boolean isOperand2Resolved = operand2Resolved != VALUE_NotFound;<NEW_LINE>final Object newOperand2 = isOperand2Resolved ? operand2Resolved : operand2;<NEW_LINE>if (isOperand1Resolved && isOperand2Resolved) {<NEW_LINE>final boolean result = evaluateLogicTuple(operand1Resolved, tuple.getOperator(), operand2Resolved);<NEW_LINE>return ConstantLogicExpression.of(result);<NEW_LINE>} else if (Objects.equals(operand1, operand1Resolved) && Objects.equals(operand2, operand2Resolved)) {<NEW_LINE>return tuple;<NEW_LINE>} else {<NEW_LINE>return LogicTuple.of(newOperand1, tuple.getOperator(), newOperand2);<NEW_LINE>}<NEW_LINE>} else if (expr instanceof LogicExpression) {<NEW_LINE>final LogicExpression logicExpr = (LogicExpression) expr;<NEW_LINE>final ILogicExpression leftExpression = logicExpr.getLeft();<NEW_LINE>final ILogicExpression newLeftExpression = evaluatePartial(ctx, leftExpression);<NEW_LINE>final ILogicExpression rightExpression = logicExpr.getRight();<NEW_LINE>final ILogicExpression <MASK><NEW_LINE>final String logicOperator = logicExpr.getOperator();<NEW_LINE>if (newLeftExpression.isConstant() && newRightExpression.isConstant()) {<NEW_LINE>final BooleanEvaluator logicExprEvaluator = getBooleanEvaluatorByOperator(logicOperator);<NEW_LINE>final boolean result = logicExprEvaluator.evaluateOrNull(newLeftExpression::constantValue, newRightExpression::constantValue);<NEW_LINE>return ConstantLogicExpression.of(result);<NEW_LINE>} else if (Objects.equals(leftExpression, newLeftExpression) && Objects.equals(rightExpression, newRightExpression)) {<NEW_LINE>return logicExpr;<NEW_LINE>} else {<NEW_LINE>return LogicExpression.of(newLeftExpression, logicOperator, newRightExpression);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new ExpressionEvaluationException("Unsupported ILogicExpression type: " + expr + " (class: " + expr.getClass() + ")");<NEW_LINE>}<NEW_LINE>}
|
newRightExpression = evaluatePartial(ctx, rightExpression);
|
476,289
|
public CompletableFuture<@Nullable Void> apply(String[] childIDs, final Function<TYPE, CompletableFuture<Void>> addedAction, final Function<String, TYPE> supplyNewChild, final Consumer<TYPE> removedCallback) {<NEW_LINE>Set<String> arrayValues = Stream.of(childIDs).collect(Collectors.toSet());<NEW_LINE>// Add all entries to the map, that are not in there yet.<NEW_LINE>final Map<String, TYPE> newSubnodes = arrayValues.stream().filter(entry -> !this.map.containsKey(entry)).collect(Collectors.toMap(k -> k, k -> <MASK><NEW_LINE>this.map.putAll(newSubnodes);<NEW_LINE>// Remove any entries that are not listed in the 'childIDs'.<NEW_LINE>this.map.entrySet().removeIf(entry -> {<NEW_LINE>if (!arrayValues.contains(entry.getKey())) {<NEW_LINE>removedCallback.accept(entry.getValue());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>});<NEW_LINE>// Apply the 'addedAction' function for all new entries.<NEW_LINE>return CompletableFuture.allOf(newSubnodes.values().stream().map(v -> addedAction.apply(v)).toArray(CompletableFuture[]::new));<NEW_LINE>}
|
supplyNewChild.apply(k)));
|
547,208
|
public ResultSet executeQuery() throws SQLException {<NEW_LINE>ResultSet result;<NEW_LINE>try {<NEW_LINE>if (statementsCacheable && !statements.isEmpty()) {<NEW_LINE>resetParameters();<NEW_LINE>return statements.iterator().next().executeQuery();<NEW_LINE>}<NEW_LINE>clearPrevious();<NEW_LINE>LogicSQL logicSQL = createLogicSQL();<NEW_LINE>trafficContext = getTrafficContext(logicSQL);<NEW_LINE>if (trafficContext.isMatchTraffic()) {<NEW_LINE>JDBCExecutionUnit executionUnit = createTrafficExecutionUnit(trafficContext, logicSQL);<NEW_LINE>return executor.getTrafficExecutor().execute(executionUnit, (statement, sql) -> ((PreparedStatement) statement).executeQuery());<NEW_LINE>}<NEW_LINE>// TODO move federation route logic to binder<NEW_LINE>executionContext = createExecutionContext(logicSQL);<NEW_LINE>if (executionContext.getRouteContext().isFederated()) {<NEW_LINE>return executeFederationQuery(logicSQL);<NEW_LINE>}<NEW_LINE>List<QueryResult> queryResults = executeQuery0();<NEW_LINE>MergedResult mergedResult = mergeQuery(queryResults);<NEW_LINE>result = new ShardingSphereResultSet(getShardingSphereResultSet(<MASK><NEW_LINE>} catch (SQLException ex) {<NEW_LINE>handleExceptionInTransaction(connection, metaDataContexts);<NEW_LINE>throw ex;<NEW_LINE>} finally {<NEW_LINE>clearBatch();<NEW_LINE>}<NEW_LINE>currentResultSet = result;<NEW_LINE>return result;<NEW_LINE>}
|
), mergedResult, this, executionContext);
|
1,627,911
|
private void writeInputSummary(StringEscapeUtils.Builder builder) throws IOException {<NEW_LINE>builder.append("<h2>Input</h2>");<NEW_LINE>JadxDecompiler jadx = mainWindow.getWrapper().getDecompiler();<NEW_LINE>builder.append("<h3>Files</h3>");<NEW_LINE>builder.append("<ul>");<NEW_LINE>for (File inputFile : jadx.getArgs().getInputFiles()) {<NEW_LINE>builder.append("<li>");<NEW_LINE>builder.escape(inputFile.<MASK><NEW_LINE>builder.append("</li>");<NEW_LINE>}<NEW_LINE>builder.append("</ul>");<NEW_LINE>List<ClassNode> classes = jadx.getRoot().getClasses(true);<NEW_LINE>List<String> codeSources = classes.stream().map(ClassNode::getInputFileName).distinct().sorted().collect(Collectors.toList());<NEW_LINE>codeSources.remove("synthetic");<NEW_LINE>int codeSourcesCount = codeSources.size();<NEW_LINE>builder.append("<h3>Code sources</h3>");<NEW_LINE>builder.append("<ul>");<NEW_LINE>if (codeSourcesCount != 1) {<NEW_LINE>builder.append("<li>Count: " + codeSourcesCount + "</li>");<NEW_LINE>}<NEW_LINE>// dex files list<NEW_LINE>codeSources.removeIf(f -> !f.endsWith(".dex"));<NEW_LINE>if (!codeSources.isEmpty()) {<NEW_LINE>for (String input : codeSources) {<NEW_LINE>builder.append("<li>");<NEW_LINE>builder.escape(input);<NEW_LINE>builder.append("</li>");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.append("</ul>");<NEW_LINE>int methodsCount = classes.stream().mapToInt(cls -> cls.getMethods().size()).sum();<NEW_LINE>int fieldsCount = classes.stream().mapToInt(cls -> cls.getFields().size()).sum();<NEW_LINE>int insnCount = classes.stream().flatMap(cls -> cls.getMethods().stream()).mapToInt(MethodNode::getInsnsCount).sum();<NEW_LINE>builder.append("<h3>Counts</h3>");<NEW_LINE>builder.append("<ul>");<NEW_LINE>builder.append("<li>Classes: " + classes.size() + "</li>");<NEW_LINE>builder.append("<li>Methods: " + methodsCount + "</li>");<NEW_LINE>builder.append("<li>Fields: " + fieldsCount + "</li>");<NEW_LINE>builder.append("<li>Instructions: " + insnCount + " (units)</li>");<NEW_LINE>builder.append("</ul>");<NEW_LINE>}
|
getCanonicalFile().getAbsolutePath());
|
378,043
|
final ListStreamsResult executeListStreams(ListStreamsRequest listStreamsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listStreamsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListStreamsRequest> request = null;<NEW_LINE>Response<ListStreamsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListStreamsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listStreamsRequest));<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, "ivs");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListStreamsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListStreamsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListStreams");
|
895,203
|
private static String cacheFromJava(String javaCipherSuite, boolean boringSSL) {<NEW_LINE>String converted = j2oTls13.get(javaCipherSuite);<NEW_LINE>if (converted != null) {<NEW_LINE>return boringSSL ? converted : javaCipherSuite;<NEW_LINE>}<NEW_LINE>String openSslCipherSuite = toOpenSslUncached(javaCipherSuite, boringSSL);<NEW_LINE>if (openSslCipherSuite == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Cache the mapping.<NEW_LINE>j2o.putIfAbsent(javaCipherSuite, openSslCipherSuite);<NEW_LINE>// Cache the reverse mapping after stripping the protocol prefix (TLS_ or SSL_)<NEW_LINE>final String javaCipherSuiteSuffix = javaCipherSuite.substring(4);<NEW_LINE>Map<String, String> p2j = new HashMap<MASK><NEW_LINE>p2j.put("", javaCipherSuiteSuffix);<NEW_LINE>p2j.put("SSL", "SSL_" + javaCipherSuiteSuffix);<NEW_LINE>p2j.put("TLS", "TLS_" + javaCipherSuiteSuffix);<NEW_LINE>o2j.put(openSslCipherSuite, p2j);<NEW_LINE>logger.debug("Cipher suite mapping: {} => {}", javaCipherSuite, openSslCipherSuite);<NEW_LINE>return openSslCipherSuite;<NEW_LINE>}
|
<String, String>(4);
|
1,809,269
|
final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "forecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
|
389,305
|
private Object convertValueIfNeeded(Object value) {<NEW_LINE>if (value instanceof CompositeData) {<NEW_LINE>final CompositeData data = (CompositeData) value;<NEW_LINE>final Map<String, Object> values = new TreeMap<>();<NEW_LINE>for (final String key : data.getCompositeType().keySet()) {<NEW_LINE>values.put(key, convertValueIfNeeded(data.get(key)));<NEW_LINE>}<NEW_LINE>return values;<NEW_LINE>} else if (value instanceof CompositeData[]) {<NEW_LINE>final List<Object> <MASK><NEW_LINE>for (final CompositeData data : (CompositeData[]) value) {<NEW_LINE>list.add(convertValueIfNeeded(data));<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} else if (value instanceof Object[]) {<NEW_LINE>return Arrays.asList((Object[]) value);<NEW_LINE>} else if (value instanceof TabularData) {<NEW_LINE>final TabularData tabularData = (TabularData) value;<NEW_LINE>return convertValueIfNeeded(tabularData.values());<NEW_LINE>} else if (value instanceof Collection) {<NEW_LINE>final List<Object> list = new ArrayList<>();<NEW_LINE>for (final Object data : (Collection<?>) value) {<NEW_LINE>list.add(convertValueIfNeeded(data));<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}<NEW_LINE>return convertJRockitValueIfNeeded(value);<NEW_LINE>}
|
list = new ArrayList<>();
|
1,537,093
|
private void export() {<NEW_LINE>if (out.getFluidAmount() <= 0)<NEW_LINE>return;<NEW_LINE>IBlockState state = <MASK><NEW_LINE>if (state == null || state.getBlock() != BuildCraftFactory.energyHeaterBlock)<NEW_LINE>return;<NEW_LINE>EnumFacing curFace = state.getValue(BlockBuildCraftBase.FACING_PROP);<NEW_LINE>EnumFacing exportDir = curFace.rotateYCCW();<NEW_LINE>TileEntity tile = worldObj.getTileEntity(getPos().offset(exportDir));<NEW_LINE>if (!(tile instanceof IPipeTile))<NEW_LINE>return;<NEW_LINE>if (!(tile instanceof IFluidHandler))<NEW_LINE>return;<NEW_LINE>IFluidHandler fluid = (IFluidHandler) tile;<NEW_LINE>if (!fluid.canFill(exportDir.getOpposite(), out.getFluidType()))<NEW_LINE>return;<NEW_LINE>FluidStack stack = out.drain(20, true);<NEW_LINE>int filled = fluid.fill(exportDir.getOpposite(), stack, true);<NEW_LINE>if (filled < stack.amount) {<NEW_LINE>FluidStack back = stack.copy();<NEW_LINE>back.amount -= filled;<NEW_LINE>out.fill(back, true);<NEW_LINE>}<NEW_LINE>}
|
worldObj.getBlockState(getPos());
|
1,651,332
|
public void initLayer(@NonNull final OsmandMapTileView view) {<NEW_LINE>this.view = view;<NEW_LINE>app = view.getApplication();<NEW_LINE>rm = app.getResourceManager();<NEW_LINE>osmandRegions = rm.getOsmandRegions();<NEW_LINE>helper = new LocalIndexHelper(app);<NEW_LINE>paintDownloaded = getPaint(view.getResources().getColor(R.color.region_uptodate));<NEW_LINE>paintSelected = getPaint(view.getResources().getColor(R.color.region_selected));<NEW_LINE>paintBackuped = getPaint(view.getResources().getColor(R.color.region_backuped));<NEW_LINE>textPaint = new TextPaint();<NEW_LINE>final WindowManager wmgr = (WindowManager) view.getApplication().getSystemService(Context.WINDOW_SERVICE);<NEW_LINE>DisplayMetrics dm = new DisplayMetrics();<NEW_LINE>wmgr.getDefaultDisplay().getMetrics(dm);<NEW_LINE>textPaint.setStrokeWidth(21 * dm.scaledDensity);<NEW_LINE>textPaint.setAntiAlias(true);<NEW_LINE>textPaint.<MASK><NEW_LINE>pathDownloaded = new Path();<NEW_LINE>pathSelected = new Path();<NEW_LINE>pathBackuped = new Path();<NEW_LINE>data = new MapLayerData<List<BinaryMapDataObject>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void layerOnPostExecute() {<NEW_LINE>view.refreshMap();<NEW_LINE>}<NEW_LINE><NEW_LINE>public boolean queriedBoxContains(final RotatedTileBox queriedData, final RotatedTileBox newBox) {<NEW_LINE>if (newBox.getZoom() < ZOOM_TO_SHOW_SELECTION) {<NEW_LINE>if (queriedData != null && queriedData.getZoom() < ZOOM_TO_SHOW_SELECTION) {<NEW_LINE>return queriedData.containsTileBox(newBox);<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<BinaryMapDataObject> queriedResults = getResults();<NEW_LINE>if (queriedData != null && queriedData.containsTileBox(newBox) && queriedData.getZoom() >= ZOOM_TO_SHOW_MAP_NAMES) {<NEW_LINE>if (queriedResults != null && (queriedResults.isEmpty() || Math.abs(queriedData.getZoom() - newBox.getZoom()) <= 1)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected List<BinaryMapDataObject> calculateResult(RotatedTileBox tileBox) {<NEW_LINE>return queryData(tileBox);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
|
setTextAlign(Paint.Align.CENTER);
|
863,146
|
public void readFromNBT(NBTTagCompound nbttagcompound) {<NEW_LINE>super.readFromNBT(nbttagcompound);<NEW_LINE>if (nbttagcompound.hasKey("box")) {<NEW_LINE>box.initialize(nbttagcompound.getCompoundTag("box"));<NEW_LINE>loadDefaultBoundaries = false;<NEW_LINE>} else if (nbttagcompound.hasKey("xSize")) {<NEW_LINE>// This is a legacy save, get old data<NEW_LINE>int xMin = nbttagcompound.getInteger("xMin");<NEW_LINE>int zMin = nbttagcompound.getInteger("zMin");<NEW_LINE>int xSize = nbttagcompound.getInteger("xSize");<NEW_LINE>int <MASK><NEW_LINE>int zSize = nbttagcompound.getInteger("zSize");<NEW_LINE>box.reset();<NEW_LINE>box.setMin(new BlockPos(xMin, pos.getY(), zMin));<NEW_LINE>box.setMax(new BlockPos(xMin + xSize - 1, pos.getY() + ySize - 1, zMin + zSize - 1));<NEW_LINE>loadDefaultBoundaries = false;<NEW_LINE>} else {<NEW_LINE>// This is a legacy save, compute boundaries<NEW_LINE>loadDefaultBoundaries = true;<NEW_LINE>}<NEW_LINE>int targetX = nbttagcompound.getInteger("targetX");<NEW_LINE>int targetY = nbttagcompound.getInteger("targetY");<NEW_LINE>int targetZ = nbttagcompound.getInteger("targetZ");<NEW_LINE>target = new BlockPos(targetX, targetY, targetZ);<NEW_LINE>double headPosX = nbttagcompound.getDouble("headPosX");<NEW_LINE>double headPosY = nbttagcompound.getDouble("headPosY");<NEW_LINE>double headPosZ = nbttagcompound.getDouble("headPosZ");<NEW_LINE>headPos = new Vec3d(headPosX, headPosY, headPosZ);<NEW_LINE>// The rest of load has to be done upon initialize.<NEW_LINE>initNBT = (NBTTagCompound) nbttagcompound.getCompoundTag("bpt").copy();<NEW_LINE>}
|
ySize = nbttagcompound.getInteger("ySize");
|
166,189
|
protected CompletableFuture<Void> loadAsynchronously(String streamSegmentName) {<NEW_LINE>if (store == null) {<NEW_LINE>return CompletableFuture.completedFuture(null);<NEW_LINE>}<NEW_LINE>if (pendingCacheLoads.add(streamSegmentName)) {<NEW_LINE>return store.getStreamSegmentInfo(streamSegmentName, TIMEOUT).thenAcceptAsync(prop -> {<NEW_LINE>long policyType = prop.getAttributes().getOrDefault(Attributes.SCALE_POLICY_TYPE, Long.MIN_VALUE);<NEW_LINE>long policyRate = prop.getAttributes().getOrDefault(Attributes.SCALE_POLICY_RATE, Long.MIN_VALUE);<NEW_LINE>if (policyType >= 0 && policyRate >= 0) {<NEW_LINE>val sa = SegmentAggregates.forPolicy(ScaleType.fromValue((byte) <MASK><NEW_LINE>cache.put(streamSegmentName, new SegmentWriteContext(streamSegmentName, sa));<NEW_LINE>}<NEW_LINE>pendingCacheLoads.remove(streamSegmentName);<NEW_LINE>}, executor);<NEW_LINE>}<NEW_LINE>return CompletableFuture.completedFuture(null);<NEW_LINE>}
|
policyType), (int) policyRate);
|
491,151
|
private void loadScript(final String hru, final int loadType) {<NEW_LINE>if (!isValid() || hasState(STATE_SCRIPT_LOADING) || isDestroy())<NEW_LINE>return;<NEW_LINE>addState(STATE_SCRIPT_LOADING);<NEW_LINE>if (hasState(STATE_HOT_RELOADING)) {<NEW_LINE>if (hotReloadGlobals == null) {<NEW_LINE>hotReloadGlobals = initGlobals(hotReloadLuaViewManager);<NEW_LINE>}<NEW_LINE>} else if (globals == null) {<NEW_LINE>globals = initGlobals(luaViewManager);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>ScriptInfo scriptInfo = new ScriptInfo(initData).withLoadType(loadType).withCallback(MLSInstance.this).whitHotReloadUrl(hru);<NEW_LINE>if (hasState(STATE_HOT_RELOADING)) {<NEW_LINE>scriptInfo.withGlobals(hotReloadGlobals);<NEW_LINE>} else {<NEW_LINE>scriptInfo.withGlobals(globals);<NEW_LINE>}<NEW_LINE>closePrinterOnce = false;<NEW_LINE>scriptReader.loadScriptImpl(scriptInfo);<NEW_LINE>}
|
GlobalStateUtils.onGlobalPrepared(initData.url);
|
1,624,350
|
public static GrayU8 dilate8(GrayU8 input, int numTimes, @Nullable GrayU8 output) {<NEW_LINE>output = InputSanityCheck.declareOrReshape(input, output);<NEW_LINE>if (BoofConcurrency.USE_CONCURRENT) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>ImplBinaryInnerOps.dilate8(input, output);<NEW_LINE>}<NEW_LINE>ImplBinaryBorderOps.dilate8(input, output);<NEW_LINE>if (numTimes > 1) {<NEW_LINE>GrayU8 tmp1 = new GrayU8(input.width, input.height);<NEW_LINE>GrayU8 tmp2 = output;<NEW_LINE>for (int i = 1; i < numTimes; i++) {<NEW_LINE>if (BoofConcurrency.USE_CONCURRENT) {<NEW_LINE>ImplBinaryInnerOps_MT.dilate8(tmp2, tmp1);<NEW_LINE>} else {<NEW_LINE>ImplBinaryInnerOps.dilate8(tmp2, tmp1);<NEW_LINE>}<NEW_LINE>ImplBinaryBorderOps.dilate8(tmp2, tmp1);<NEW_LINE>GrayU8 a = tmp1;<NEW_LINE>tmp1 = tmp2;<NEW_LINE>tmp2 = a;<NEW_LINE>}<NEW_LINE>if (tmp2 != output) {<NEW_LINE>output.setTo(tmp2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>}
|
ImplBinaryInnerOps_MT.dilate8(input, output);
|
457,991
|
private void fixSyncForDifferingDataTypes() {<NEW_LINE>boolean fixedSync = false;<NEW_LINE>List<DataType> dataTypes = dataTypeManager.getDataTypes(sourceArchive);<NEW_LINE>for (DataType dataType : dataTypes) {<NEW_LINE>DataTypeSyncInfo dataTypeSyncInfo = new DataTypeSyncInfo(dataType, sourceDTM);<NEW_LINE><MASK><NEW_LINE>DataTypeSyncState syncState = dataTypeSyncInfo.getSyncState();<NEW_LINE>if (syncState == DataTypeSyncState.IN_SYNC && dataTypeSyncInfo.hasChange()) {<NEW_LINE>Msg.info(getClass(), "Program data type '" + dataType.getPathName() + "' differs from its source data type '" + sourceDataType.getPathName() + "' and is being changed to not be in-sync!");<NEW_LINE>// Set timestamp so user must re-sync.<NEW_LINE>dataType.setLastChangeTimeInSourceArchive(0);<NEW_LINE>fixedSync = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fixedSync) {<NEW_LINE>// Set dirty flag so user must re-sync.<NEW_LINE>sourceArchive.setDirtyFlag(true);<NEW_LINE>// Set timestamp so user must re-sync.<NEW_LINE>sourceArchive.setLastSyncTime(0);<NEW_LINE>}<NEW_LINE>}
|
DataType sourceDataType = dataTypeSyncInfo.getSourceDataType();
|
21,158
|
protected void computeEnvironmentData(Object[][] environmentData) {<NEW_LINE>super.computeEnvironmentData(environmentData);<NEW_LINE>environmentData[1][0] = Bundle.RubyViews_Platform();<NEW_LINE>RubyHeapFragment fragment = (RubyHeapFragment) getContext().getFragment();<NEW_LINE>// NOI18N<NEW_LINE>RubyType gemPlatform = fragment.getType("Gem::Platform", null);<NEW_LINE>RubyObject platformO = gemPlatform == null || gemPlatform.getObjectsCount() == 0 ? null : gemPlatform.getObjectsIterator().next();<NEW_LINE>if (platformO != null) {<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>String osFV = variableValue(platformO, "@os", heap);<NEW_LINE>// NOI18N<NEW_LINE>String cpuFV = variableValue(platformO, "@cpu", heap);<NEW_LINE>if (osFV != null || cpuFV != null) {<NEW_LINE>String platform = osFV;<NEW_LINE>if (cpuFV != null) {<NEW_LINE>// NOI18N<NEW_LINE>if (platform != null)<NEW_LINE>platform += " ";<NEW_LINE>else<NEW_LINE>platform = "";<NEW_LINE>platform += cpuFV;<NEW_LINE>}<NEW_LINE>environmentData[1][1] = platform;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (environmentData[1][1] == null)<NEW_LINE>environmentData[1][1] = Bundle.RubyViews_Unknown();<NEW_LINE>}
|
Heap heap = fragment.getHeap();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.