idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
712,508 | public ViewHolderShareContacts onCreateViewHolder(ViewGroup parent, int viewType) {<NEW_LINE>LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);<NEW_LINE>Display display = ((Activity) mContext).getWindowManager().getDefaultDisplay();<NEW_LINE>DisplayMetrics outMetrics = new DisplayMetrics();<NEW_LINE>display.getMetrics(outMetrics);<NEW_LINE>View rowView = inflater.inflate(R.layout.item_contact_share, parent, false);<NEW_LINE>ViewHolderShareContacts holder = new ViewHolderShareContacts(rowView);<NEW_LINE>holder.itemProgress = rowView.findViewById(R.id.item_progress);<NEW_LINE>holder.itemHeader = rowView.findViewById(R.id.header);<NEW_LINE>holder.textHeader = rowView.findViewById(R.id.text_header);<NEW_LINE>holder.itemLayout = rowView.findViewById(R.id.item_content);<NEW_LINE>holder.contactNameTextView = rowView.findViewById(R.id.contact_name);<NEW_LINE>if (!isScreenInPortrait(mContext)) {<NEW_LINE>float width = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, MAX_WIDTH_CONTACT_NAME_LAND, mContext.getResources().getDisplayMetrics());<NEW_LINE>holder.contactNameTextView.setMaxWidthEmojis((int) width);<NEW_LINE>} else {<NEW_LINE>float width = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, MAX_WIDTH_CONTACT_NAME_PORT, mContext.getResources().getDisplayMetrics());<NEW_LINE>holder.contactNameTextView.setMaxWidthEmojis((int) width);<NEW_LINE>}<NEW_LINE>holder.emailTextView = rowView.findViewById(R.id.contact_mail);<NEW_LINE>holder.avatar = rowView.findViewById(R.id.contact_avatar);<NEW_LINE>holder.verifiedIcon = rowView.<MASK><NEW_LINE>holder.contactStateIcon = rowView.findViewById(R.id.contact_state);<NEW_LINE>return holder;<NEW_LINE>} | findViewById(R.id.verified_icon); |
1,267,161 | private void handleFcmp(int opcode) {<NEW_LINE>Item it = pop();<NEW_LINE>Item it2 = pop();<NEW_LINE>if ((it.getConstant() != null) && it2.getConstant() != null) {<NEW_LINE>float f = constantToFloat(it);<NEW_LINE>float f2 = constantToFloat(it2);<NEW_LINE>if (Float.isNaN(f) || Float.isNaN(f2)) {<NEW_LINE>if (opcode == FCMPG) {<NEW_LINE>push(new Item("I", Integer.valueOf(1)));<NEW_LINE>} else {<NEW_LINE>push(new Item("I", Integer.valueOf(-1)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (f2 < f) {<NEW_LINE>push(new Item("I", Integer.valueOf(-1)));<NEW_LINE>} else if (f2 > f) {<NEW_LINE>push(new Item("I", Integer.valueOf(1)));<NEW_LINE>} else {<NEW_LINE>push(new Item("I", <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>push(new Item("I"));<NEW_LINE>}<NEW_LINE>} | Integer.valueOf(0))); |
1,381,709 | private String buildTestRunProperties(ScriptLocation script, AbstractLanguageHandler handler, Properties systemProperty, GrinderProperties properties) {<NEW_LINE>PropertyBuilder builder = new PropertyBuilder(properties, script.getDirectory(), isSecurityEnabled(properties), properties.getProperty(GRINDER_PROP_SECURITY_LEVEL, GRINDER_SECURITY_LEVEL_NORMAL), properties.getProperty(GRINDER_PROP_ETC_HOSTS), NetworkUtils.getLocalHostName(), m_agentConfig.getAgentProperties().getPropertyBoolean(PROP_AGENT_SERVER_MODE), m_agentConfig.getAgentProperties().getPropertyBoolean(PROP_AGENT_LIMIT_XMX), m_agentConfig.getAgentProperties().getPropertyBoolean(PROP_AGENT_ENABLE_LOCAL_DNS), m_agentConfig.getAgentProperties().getProperty(PROP_AGENT_JAVA_OPT));<NEW_LINE><MASK><NEW_LINE>properties.setProperty(GRINDER_PROP_JVM_CLASSPATH, buildClassPath(systemProperty, properties, handler, builder));<NEW_LINE>m_logger.info("grinder properties {}", properties);<NEW_LINE>m_logger.info("jvm arguments {}", jvmArguments);<NEW_LINE>// To be safe...<NEW_LINE>if (properties.containsKey("grinder.duration") && !properties.containsKey("grinder.runs")) {<NEW_LINE>properties.setInt("grinder.runs", 0);<NEW_LINE>}<NEW_LINE>return jvmArguments;<NEW_LINE>} | String jvmArguments = builder.buildJVMArgument(); |
340,421 | private Position decodeObd(Channel channel, SocketAddress remoteAddress, String sentence) {<NEW_LINE>Parser parser = new Parser(PATTERN_OBD, sentence);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>getLastLocation(position, parser.nextDateTime());<NEW_LINE>position.set(Position.KEY_ODOMETER, parser.nextInt(0));<NEW_LINE>// instant fuel consumption<NEW_LINE>parser.nextDouble(0);<NEW_LINE>position.set(Position.KEY_FUEL_CONSUMPTION, parser.nextDouble(0));<NEW_LINE>if (parser.hasNext()) {<NEW_LINE>position.set(Position.KEY_HOURS, UnitsConverter.msFromHours(parser.nextInt()));<NEW_LINE>}<NEW_LINE>position.set(Position.KEY_OBD_SPEED, parser.nextInt(0));<NEW_LINE>position.set(Position.KEY_ENGINE_LOAD, parser.next());<NEW_LINE>position.set(Position.KEY_COOLANT_TEMP, parser.nextInt());<NEW_LINE>position.set(Position.<MASK><NEW_LINE>position.set(Position.KEY_RPM, parser.nextInt(0));<NEW_LINE>position.set(Position.KEY_BATTERY, parser.nextDouble(0));<NEW_LINE>position.set(Position.KEY_DTCS, parser.next().replace(',', ' ').trim());<NEW_LINE>return position;<NEW_LINE>} | KEY_THROTTLE, parser.next()); |
922,250 | public static Object create(Node node, Frame frame) {<NEW_LINE>RootNode root = node.getRootNode();<NEW_LINE>PythonLocalScope localScope = <MASK><NEW_LINE>Object[] scopes;<NEW_LINE>if (frame != null) {<NEW_LINE>PythonObject globals = PArguments.getGlobalsSafe(frame);<NEW_LINE>Frame generatorFrame = PArguments.getGeneratorFrameSafe(frame);<NEW_LINE>Object globalsScope = null;<NEW_LINE>if (globals != null) {<NEW_LINE>globalsScope = new PythonMapScope(new Object[] { scopeFromObject(globals) }, new String[] { "globals()" });<NEW_LINE>}<NEW_LINE>if (globals != null && generatorFrame != null) {<NEW_LINE>scopes = new Object[] { localScope, globalsScope, PythonLocalScope.createLocalScope(root, generatorFrame) };<NEW_LINE>} else if (globals != null) {<NEW_LINE>scopes = new Object[] { localScope, globalsScope };<NEW_LINE>} else if (generatorFrame != null) {<NEW_LINE>scopes = new Object[] { localScope, PythonLocalScope.createLocalScope(root, generatorFrame) };<NEW_LINE>} else {<NEW_LINE>return localScope;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return localScope;<NEW_LINE>}<NEW_LINE>return new PythonScopes(scopes, 0);<NEW_LINE>} | PythonLocalScope.createLocalScope(root, frame); |
829,652 | private boolean makeFileUploadRequest(Log log, String action, String target) throws DaemonException {<NEW_LINE>try {<NEW_LINE>// Initialise the HTTP client<NEW_LINE>initialise();<NEW_LINE>// Make request<NEW_LINE>HttpPost httppost = new HttpPost(buildWebUIUrl(RPC_URL_DISPATCH + action + RPC_URL_DISPATCH2 + RPC_URL_AID));<NEW_LINE>File upload = new File(URI.create(target));<NEW_LINE>Part[] parts = { new FilePart("upload_files[]", upload) };<NEW_LINE>httppost.setEntity(new MultipartEntity(parts, httppost.getParams()));<NEW_LINE>HttpResponse response = httpclient.execute(httppost);<NEW_LINE>// Read response (a successful action always returned '1')<NEW_LINE>InputStream instream = response.getEntity().getContent();<NEW_LINE>String result = HttpHelper.convertStreamToString(instream);<NEW_LINE>instream.close();<NEW_LINE>if (result.equals("1")) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>throw new DaemonException(ExceptionType.UnexpectedResponse, "Action response was not 1 but " + result);<NEW_LINE>}<NEW_LINE>} catch (DaemonException e) {<NEW_LINE>log.d(LOG_NAME, action + " request error: " + e.toString());<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.d(LOG_NAME, "Error: " + e.toString());<NEW_LINE>throw new DaemonException(ExceptionType.<MASK><NEW_LINE>}<NEW_LINE>} | ConnectionError, e.toString()); |
1,618,174 | BLangStatementExpression desugar(BLangQueryAction queryAction, SymbolEnv env) {<NEW_LINE>containsCheckExpr = false;<NEW_LINE>HashSet<BType> prevCheckedErrorList = this.checkedErrorList;<NEW_LINE>this.checkedErrorList = new HashSet<>();<NEW_LINE>List<BLangNode<MASK><NEW_LINE>Location pos = clauses.get(0).pos;<NEW_LINE>BType returnType = symTable.errorOrNilType;<NEW_LINE>if (queryAction.returnsWithinDoClause) {<NEW_LINE>BInvokableSymbol invokableSymbol = env.enclInvokable.symbol;<NEW_LINE>returnType = ((BInvokableType) invokableSymbol.type).retType;<NEW_LINE>}<NEW_LINE>BLangBlockStmt queryBlock = ASTBuilderUtil.createBlockStmt(pos);<NEW_LINE>BLangVariableReference streamRef = buildStream(clauses, returnType, env, queryBlock);<NEW_LINE>BLangVariableReference result = getStreamFunctionVariableRef(queryBlock, QUERY_CONSUME_STREAM_FUNCTION, returnType, Lists.of(streamRef), pos);<NEW_LINE>BLangStatementExpression stmtExpr;<NEW_LINE>if (!containsCheckExpr && queryAction.returnsWithinDoClause) {<NEW_LINE>BLangReturn returnStmt = ASTBuilderUtil.createReturnStmt(pos, result);<NEW_LINE>BLangBlockStmt ifBody = ASTBuilderUtil.createBlockStmt(pos);<NEW_LINE>ifBody.stmts.add(returnStmt);<NEW_LINE>BLangTypeTestExpr nilTypeTestExpr = desugar.createTypeCheckExpr(pos, result, desugar.getNillTypeNode());<NEW_LINE>nilTypeTestExpr.setBType(symTable.booleanType);<NEW_LINE>BLangGroupExpr nilCheckGroupExpr = new BLangGroupExpr();<NEW_LINE>nilCheckGroupExpr.setBType(symTable.booleanType);<NEW_LINE>// !($streamElement$ is ()))<NEW_LINE>nilCheckGroupExpr.expression = desugar.createNotBinaryExpression(pos, nilTypeTestExpr);<NEW_LINE>BLangIf ifStatement = ASTBuilderUtil.createIfStmt(pos, queryBlock);<NEW_LINE>ifStatement.expr = nilCheckGroupExpr;<NEW_LINE>ifStatement.body = ifBody;<NEW_LINE>}<NEW_LINE>stmtExpr = ASTBuilderUtil.createStatementExpression(queryBlock, addTypeConversionExpr(result, returnType));<NEW_LINE>stmtExpr.setBType(returnType);<NEW_LINE>this.checkedErrorList = prevCheckedErrorList;<NEW_LINE>return stmtExpr;<NEW_LINE>} | > clauses = queryAction.getQueryClauses(); |
1,228,815 | public void takePicture(final Rect previewRect) {<NEW_LINE>if (!camera.isPresent() || camera.get().getParameters() == null) {<NEW_LINE>Log.w(TAG, "camera not in capture-ready state");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>camera.get().setOneShotPreviewCallback(new Camera.PreviewCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPreviewFrame(byte[] data, final Camera camera) {<NEW_LINE>final int rotation = getCameraPictureOrientation();<NEW_LINE>final Size previewSize = camera.getParameters().getPreviewSize();<NEW_LINE>final Rect croppingRect = getCroppedRect(previewSize, previewRect, rotation);<NEW_LINE>Log.i(TAG, "previewSize: " + previewSize.<MASK><NEW_LINE>Log.i(TAG, "data bytes: " + data.length);<NEW_LINE>Log.i(TAG, "previewFormat: " + camera.getParameters().getPreviewFormat());<NEW_LINE>Log.i(TAG, "croppingRect: " + croppingRect.toString());<NEW_LINE>Log.i(TAG, "rotation: " + rotation);<NEW_LINE>new CaptureTask(previewSize, rotation, croppingRect).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, data);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | width + "x" + previewSize.height); |
1,136,159 | private void onConfigExport() {<NEW_LINE>FileDialog dialog = new FileDialog(getControl().getShell(), SWT.SAVE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String proposal = TextUtil.sanitizeFilename(<MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>dialog.setFileName(proposal + ".json");<NEW_LINE>dialog.setOverwrite(true);<NEW_LINE>String fileName = dialog.open();<NEW_LINE>if (fileName == null)<NEW_LINE>return;<NEW_LINE>File file = new File(fileName);<NEW_LINE>try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8)) {<NEW_LINE>CSVConfig config = new CSVConfig();<NEW_LINE>config.setLabel(currentConfigLabel != null ? currentConfigLabel : file.getName());<NEW_LINE>config.readFrom(importer);<NEW_LINE>JSONValue.writeJSONString(config.toJSON(), writer);<NEW_LINE>} catch (IOException e) {<NEW_LINE>PortfolioPlugin.log(e);<NEW_LINE>MessageDialog.openError(getControl().getShell(), Messages.ExportWizardErrorExporting, e.getMessage());<NEW_LINE>}<NEW_LINE>} | currentConfigLabel != null ? currentConfigLabel : "csv-config"); |
1,761,579 | public void postConstruct() {<NEW_LINE>ejbContainer = serverConfig.getExtensionByType(EjbContainer.class);<NEW_LINE>ClassLoader ejbImplClassLoader = EjbContainerUtilImpl.class.getClassLoader();<NEW_LINE>if (callFlowAgent == null) {<NEW_LINE>callFlowAgent = (Agent) Proxy.newProxyInstance(ejbImplClassLoader, new Class[] { Agent.class }, new InvocationHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object invoke(Object proxy, Method m, Object[] args) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>defaultThreadPoolExecutor = createThreadPoolExecutor(DEFAULT_THREAD_POOL_NAME);<NEW_LINE>// avoid starting JDK timer in application class loader. The life of _timer<NEW_LINE>// field is longer than deployed apps, and any reference to app class loader<NEW_LINE>// in JDK timer thread will cause class loader leak. Issue 17468<NEW_LINE>ClassLoader originalClassLoader = null;<NEW_LINE>try {<NEW_LINE>originalClassLoader = Utility.setContextClassLoader(ejbImplClassLoader);<NEW_LINE>_timer = AccessController.doPrivileged((PrivilegedAction<Timer>) () -> <MASK><NEW_LINE>} finally {<NEW_LINE>if (originalClassLoader != null) {<NEW_LINE>Utility.setContextClassLoader(originalClassLoader);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EJBObjectOutputStreamHandler.setJavaEEIOUtils(javaEEIOUtils);<NEW_LINE>javaEEIOUtils.addGlassFishOutputStreamHandler(new EJBObjectOutputStreamHandler());<NEW_LINE>javaEEIOUtils.addGlassFishInputStreamHandler(new EJBObjectInputStreamHandler());<NEW_LINE>_me = this;<NEW_LINE>} | new Timer("EJB Container Timer", true)); |
69,076 | public PlanFragment visitPhysicalHudiScan(OptExpression optExpression, ExecPlan context) {<NEW_LINE>PhysicalHudiScanOperator node = (PhysicalHudiScanOperator) optExpression.getOp();<NEW_LINE>ScanOperatorPredicates predicates = node.getScanOperatorPredicates();<NEW_LINE>Table referenceTable = node.getTable();<NEW_LINE>context.getDescTbl().addReferencedTable(referenceTable);<NEW_LINE>TupleDescriptor tupleDescriptor = context.getDescTbl().createTupleDescriptor();<NEW_LINE>tupleDescriptor.setTable(referenceTable);<NEW_LINE>prepareContextSlots(node, context, tupleDescriptor);<NEW_LINE>HudiScanNode hudiScanNode = new HudiScanNode(context.getNextNodeId(), tupleDescriptor, "HudiScanNode");<NEW_LINE>hudiScanNode.computeStatistics(optExpression.getStatistics());<NEW_LINE>try {<NEW_LINE>HDFSScanNodePredicates scanNodePredicates = hudiScanNode.getPredictsExpr();<NEW_LINE>scanNodePredicates.setSelectedPartitionIds(predicates.getSelectedPartitionIds());<NEW_LINE>scanNodePredicates.setIdToPartitionKey(predicates.getIdToPartitionKey());<NEW_LINE>hudiScanNode.setupScanRangeLocations(context.getDescTbl());<NEW_LINE>prepareCommonExpr(scanNodePredicates, predicates, context);<NEW_LINE>prepareMinMaxExpr(scanNodePredicates, predicates, context);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Hudi scan node get scan range locations failed : " + e);<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new StarRocksPlannerException(e.getMessage(), INTERNAL_ERROR);<NEW_LINE>}<NEW_LINE>hudiScanNode.setLimit(node.getLimit());<NEW_LINE>tupleDescriptor.computeMemLayout();<NEW_LINE>context.<MASK><NEW_LINE>PlanFragment fragment = new PlanFragment(context.getNextFragmentId(), hudiScanNode, DataPartition.RANDOM);<NEW_LINE>context.getFragments().add(fragment);<NEW_LINE>return fragment;<NEW_LINE>} | getScanNodes().add(hudiScanNode); |
1,092,903 | // updateStep<NEW_LINE>@POST<NEW_LINE>@Path("/steps")<NEW_LINE>@JSONP<NEW_LINE>@NoCache<NEW_LINE>@Produces({ MediaType.APPLICATION_JSON, "application/javascript" })<NEW_LINE>public final Response addStep(@Context final HttpServletRequest request, @Context final HttpServletResponse response, final WorkflowStepAddForm newStepForm) {<NEW_LINE>String schemeId = null;<NEW_LINE>try {<NEW_LINE>DotPreconditions.notNull(newStepForm, "Expected Request body was empty.");<NEW_LINE>schemeId = newStepForm.getSchemeId();<NEW_LINE>final InitDataObject initDataObject = this.webResource.init(null, request, response, true, null);<NEW_LINE>Logger.debug(this, "updating step for scheme with schemeId: " + schemeId);<NEW_LINE>final WorkflowStep step = this.workflowHelper.addStep(newStepForm, initDataObject.getUser());<NEW_LINE>return Response.ok(new ResponseEntityView<MASK><NEW_LINE>} catch (final Exception e) {<NEW_LINE>Logger.error(this.getClass(), "Exception on addStep, schemeId: " + schemeId + ", exception message: " + e.getMessage(), e);<NEW_LINE>return ResponseUtil.mapExceptionResponse(e);<NEW_LINE>}<NEW_LINE>} | (step)).build(); |
1,074,660 | private String generateFieldSupplierErrorMessage(Callable<T> supplier) {<NEW_LINE>final FieldSupplierBuilder fieldSupplier = WhiteboxImpl.getInternalState(supplier, "this$0");<NEW_LINE>final Class<? extends Annotation> expectedAnnotation = fieldSupplier.getExpectedAnnotation();<NEW_LINE>final String expectedFieldName = fieldSupplier.getExpectedFieldName();<NEW_LINE>final Class<?<MASK><NEW_LINE>final Object object = fieldSupplier.getObject();<NEW_LINE>final Class<?> objectClass = object instanceof Class ? (Class<?>) object : object.getClass();<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>if (expectedFieldName == null) {<NEW_LINE>builder.append("Field in ");<NEW_LINE>builder.append(object.getClass().getName());<NEW_LINE>if (expectedAnnotation != null) {<NEW_LINE>builder.append(" annotated with ");<NEW_LINE>builder.append(expectedAnnotation.getName());<NEW_LINE>builder.append(" and");<NEW_LINE>}<NEW_LINE>builder.append(" of type ");<NEW_LINE>builder.append(expectedFieldType);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>final Field declaredField = objectClass.getDeclaredField(expectedFieldName);<NEW_LINE>builder.append("Field ");<NEW_LINE>builder.append(declaredField);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Internal error", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>} | > expectedFieldType = fieldSupplier.getExpectedFieldType(); |
148,619 | private static void simulateLookUpBufferAddress(LevelZeroContext context, LevelZeroDevice device) {<NEW_LINE>LevelZeroCommandQueue commandQueue = LevelZeroUtils.createCommandQueue(device, context);<NEW_LINE>LevelZeroCommandList commandList = LevelZeroUtils.createCommandList(device, context, commandQueue.getCommandQueueDescription().getOrdinal());<NEW_LINE>final int elements = 1;<NEW_LINE>final int bufferSize = elements * 8;<NEW_LINE>ZeDeviceMemAllocDesc deviceMemAllocDesc = new ZeDeviceMemAllocDesc();<NEW_LINE>deviceMemAllocDesc.setFlags(ZeDeviceMemAllocFlags.ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED);<NEW_LINE>deviceMemAllocDesc.setOrdinal(0);<NEW_LINE>long[] output = new long[elements];<NEW_LINE>deviceHeapBuffer = new LevelZeroByteBuffer();<NEW_LINE>int result = context.zeMemAllocDevice(context.getDefaultContextPtr(), deviceMemAllocDesc, DEVICE_HEAP_SIZE, 1, device.getDeviceHandlerPtr(), deviceHeapBuffer);<NEW_LINE>LevelZeroUtils.errorLog("zeMemAllocDevice", result);<NEW_LINE>LevelZeroKernel levelZeroKernel = LevelZeroUtils.compileSPIRVKernel(device, context, "lookUp", "/tmp/lookUpBufferAddress.spv");<NEW_LINE>LevelZeroUtils.dispatchLookUpBuffer(commandList, commandQueue, levelZeroKernel, deviceHeapBuffer, output, bufferSize);<NEW_LINE>result = commandList.zeCommandListReset(commandList.getCommandListHandlerPtr());<NEW_LINE>errorLog("zeCommandListReset", result);<NEW_LINE>// Run 2nd Kernel: Execute-Copy<NEW_LINE>ByteBuffer stack = ByteBuffer.allocate(32);<NEW_LINE>stack.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>stack.putLong(777);<NEW_LINE>stack.putLong(888);<NEW_LINE>stack.putLong(999);<NEW_LINE>stack.putLong(output[0] + 80L);<NEW_LINE>// Copy Host -> Device<NEW_LINE>result = commandList.zeCommandListAppendMemoryCopyWithOffset(commandList.getCommandListHandlerPtr(), deviceHeapBuffer, stack.array(), stack.position(), 0, 0, null, 0, null);<NEW_LINE>LevelZeroUtils.errorLog("zeCommandListAppendMemoryCopyWithOffset", result);<NEW_LINE>result = commandList.zeCommandListAppendBarrier(commandList.getCommandListHandlerPtr(), null, 0, null);<NEW_LINE>LevelZeroUtils.errorLog("zeCommandListAppendBarrier", result);<NEW_LINE>LevelZeroKernel kernelCopy = LevelZeroUtils.compileSPIRVKernel(<MASK><NEW_LINE>long[] output2 = new long[128];<NEW_LINE>dispatchCopyKernel(commandList, commandQueue, kernelCopy, output2, 128 * Sizeof.LONG.getNumBytes(), stack);<NEW_LINE>// Free resources<NEW_LINE>errorLog("zeMemFree", result);<NEW_LINE>result = context.zeMemFree(context.getDefaultContextPtr(), deviceHeapBuffer);<NEW_LINE>errorLog("zeMemFree", result);<NEW_LINE>result = context.zeCommandListDestroy(commandList.getCommandListHandler());<NEW_LINE>errorLog("zeCommandListDestroy", result);<NEW_LINE>result = context.zeCommandQueueDestroy(commandQueue.getCommandQueueHandle());<NEW_LINE>errorLog("zeCommandQueueDestroy", result);<NEW_LINE>} | device, context, "copyTest", "/tmp/example.spv"); |
116,962 | protected void initListeners() {<NEW_LINE>super.initListeners();<NEW_LINE><MASK><NEW_LINE>binding.detailTitleRootLayout.setOnLongClickListener(this);<NEW_LINE>binding.detailUploaderRootLayout.setOnClickListener(this);<NEW_LINE>binding.detailUploaderRootLayout.setOnLongClickListener(this);<NEW_LINE>binding.detailThumbnailRootLayout.setOnClickListener(this);<NEW_LINE>binding.detailControlsBackground.setOnClickListener(this);<NEW_LINE>binding.detailControlsBackground.setOnLongClickListener(this);<NEW_LINE>binding.detailControlsPopup.setOnClickListener(this);<NEW_LINE>binding.detailControlsPopup.setOnLongClickListener(this);<NEW_LINE>binding.detailControlsPlaylistAppend.setOnClickListener(this);<NEW_LINE>binding.detailControlsDownload.setOnClickListener(this);<NEW_LINE>binding.detailControlsDownload.setOnLongClickListener(this);<NEW_LINE>binding.detailControlsShare.setOnClickListener(this);<NEW_LINE>binding.detailControlsOpenInBrowser.setOnClickListener(this);<NEW_LINE>binding.detailControlsPlayWithKodi.setOnClickListener(this);<NEW_LINE>if (DEBUG) {<NEW_LINE>binding.detailControlsCrashThePlayer.setOnClickListener(v -> VideoDetailPlayerCrasher.onCrashThePlayer(this.getContext(), this.player, getLayoutInflater()));<NEW_LINE>}<NEW_LINE>binding.overlayThumbnail.setOnClickListener(this);<NEW_LINE>binding.overlayThumbnail.setOnLongClickListener(this);<NEW_LINE>binding.overlayMetadataLayout.setOnClickListener(this);<NEW_LINE>binding.overlayMetadataLayout.setOnLongClickListener(this);<NEW_LINE>binding.overlayButtonsLayout.setOnClickListener(this);<NEW_LINE>binding.overlayCloseButton.setOnClickListener(this);<NEW_LINE>binding.overlayPlayPauseButton.setOnClickListener(this);<NEW_LINE>binding.detailControlsBackground.setOnTouchListener(getOnControlsTouchListener());<NEW_LINE>binding.detailControlsPopup.setOnTouchListener(getOnControlsTouchListener());<NEW_LINE>binding.appBarLayout.addOnOffsetChangedListener((layout, verticalOffset) -> {<NEW_LINE>// prevent useless updates to tab layout visibility if nothing changed<NEW_LINE>if (verticalOffset != lastAppBarVerticalOffset) {<NEW_LINE>lastAppBarVerticalOffset = verticalOffset;<NEW_LINE>// the view was scrolled<NEW_LINE>updateTabLayoutVisibility();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>setupBottomPlayer();<NEW_LINE>if (!playerHolder.isBound()) {<NEW_LINE>setHeightThumbnail();<NEW_LINE>} else {<NEW_LINE>playerHolder.startService(false, this);<NEW_LINE>}<NEW_LINE>} | binding.detailTitleRootLayout.setOnClickListener(this); |
506,131 | public void randomDisplayTick(@Nonnull IBlockState state, @Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull Random rand) {<NEW_LINE>if (rand.nextFloat() < .5f) {<NEW_LINE>final EnumFacing face = NNList.FACING.get(rand.nextInt(NNList.FACING.size()));<NEW_LINE>final BlockPos neighborPos = pos.offset(face);<NEW_LINE>final IBlockState neighborState = worldIn.getBlockState(neighborPos);<NEW_LINE>if (!neighborState.isFullCube()) {<NEW_LINE>double xd = face.getFrontOffsetX() == 0 ? rand.nextDouble() : face.getFrontOffsetX() < 0 ? -0.05 : 1.05;<NEW_LINE>double yd = face.getFrontOffsetY() == 0 ? rand.nextDouble() : face.getFrontOffsetY(<MASK><NEW_LINE>double zd = face.getFrontOffsetZ() == 0 ? rand.nextDouble() : face.getFrontOffsetZ() < 0 ? -0.05 : 1.05;<NEW_LINE>double x = pos.getX() + xd;<NEW_LINE>double y = pos.getY() + yd;<NEW_LINE>double z = pos.getZ() + zd;<NEW_LINE>int col = COLORS[rand.nextInt(COLORS.length)];<NEW_LINE>worldIn.spawnParticle(EnumParticleTypes.REDSTONE, x, y, z, (col >> 16 & 255) / 255d, (col >> 8 & 255) / 255d, (col & 255) / 255d);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ) < 0 ? -0.05 : 1.05; |
421,936 | protected void fillCoolBar(ICoolBarManager coolBarManager) {<NEW_LINE>IToolBarManager toolBarFile = new ToolBarManager(SWT.FLAT);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>coolBarManager.add(new ToolBarContributionItem(toolBarFile, "toolbar_file"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>toolBarFile.add(new GroupMarker("start"));<NEW_LINE>toolBarFile.add(fActionOpenModel);<NEW_LINE>toolBarFile.add(fActionSave);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>toolBarFile.add(new GroupMarker("end"));<NEW_LINE>IToolBarManager toolBarEdit = new ToolBarManager(SWT.FLAT);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>coolBarManager.add(new ToolBarContributionItem(toolBarEdit, "toolbar_edit"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>toolBarEdit.add(new GroupMarker("start"));<NEW_LINE>toolBarEdit.add(fActionUndo);<NEW_LINE>toolBarEdit.add(fActionRedo);<NEW_LINE>toolBarEdit.add(new Separator());<NEW_LINE>toolBarEdit.add(fActionCut);<NEW_LINE>toolBarEdit.add(fActionCopy);<NEW_LINE>toolBarEdit.add(fActionPaste);<NEW_LINE>toolBarEdit.add(fActionDelete);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>toolBarEdit.add(new GroupMarker("end"));<NEW_LINE>IToolBarManager toolBarViews = new ToolBarManager(SWT.FLAT);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>coolBarManager.add(new ToolBarContributionItem(toolBarViews, "toolbar_views"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>toolBarViews.add(new GroupMarker("start"));<NEW_LINE>toolBarViews.add(fShowModelsView);<NEW_LINE>toolBarViews.add(fShowPropertiesView);<NEW_LINE>toolBarViews.add(fShowOutlineView);<NEW_LINE>toolBarViews.add(fShowNavigatorView);<NEW_LINE>toolBarViews.add(fShowPaletteView);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>toolBarViews.<MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>toolBarViews.add(new GroupMarker("end"));<NEW_LINE>toolBarViews.add(new Separator());<NEW_LINE>IToolBarManager toolBarTools = new ToolBarManager(SWT.FLAT);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>coolBarManager.add(new ToolBarContributionItem(toolBarTools, "toolbar_tools"));<NEW_LINE>} | add(new GroupMarker("append")); |
872,620 | public static final CompactJobInfo toCompactJobInfo(final MantisJobMetadataView view) {<NEW_LINE>MantisJobMetadata jm = view.getJobMetadata();<NEW_LINE>int workers = 0;<NEW_LINE>double totCPUs = 0.0;<NEW_LINE>double totMem = 0.0;<NEW_LINE>Map<String, Integer> stSmry = new HashMap<>();<NEW_LINE>for (MantisStageMetadata s : view.getStageMetadataList()) {<NEW_LINE>workers += s.getNumWorkers();<NEW_LINE>totCPUs += s.getNumWorkers() * s.getMachineDefinition().getCpuCores();<NEW_LINE>totMem += s.getNumWorkers() * s.getMachineDefinition().getMemoryMB();<NEW_LINE>}<NEW_LINE>for (MantisWorkerMetadata w : view.getWorkerMetadataList()) {<NEW_LINE>final Integer prevVal = stSmry.get(<MASK><NEW_LINE>if (prevVal == null) {<NEW_LINE>stSmry.put(w.getState() + "", 1);<NEW_LINE>} else {<NEW_LINE>stSmry.put(w.getState() + "", prevVal + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new CompactJobInfo(jm.getJobId(), (jm.getJarUrl() != null) ? jm.getJarUrl().toString() : "", jm.getSubmittedAt(), jm.getUser(), jm.getState(), jm.getSla() != null ? jm.getSla().getDurationType() : MantisJobDurationType.Transient, jm.getNumStages(), workers, totCPUs, totMem, stSmry, jm.getLabels());<NEW_LINE>} | w.getState() + ""); |
1,352,914 | // **********************************************************************<NEW_LINE>// Annotation values: other methods (e.g., testing and transforming)<NEW_LINE>// **********************************************************************<NEW_LINE>@EqualsMethod<NEW_LINE>public static boolean sameElementValues(AnnotationMirror am1, AnnotationMirror am2) {<NEW_LINE>if (am1 == am2) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Map<? extends ExecutableElement, ? extends AnnotationValue<MASK><NEW_LINE>Map<? extends ExecutableElement, ? extends AnnotationValue> vals2 = am2.getElementValues();<NEW_LINE>for (ExecutableElement meth : ElementFilter.methodsIn(am1.getAnnotationType().asElement().getEnclosedElements())) {<NEW_LINE>AnnotationValue aval1 = vals1.get(meth);<NEW_LINE>AnnotationValue aval2 = vals2.get(meth);<NEW_LINE>// optimization via equality test<NEW_LINE>@SuppressWarnings("interning:not.interned")<NEW_LINE>boolean identical = aval1 == aval2;<NEW_LINE>if (identical) {<NEW_LINE>// Handles when both aval1 and aval2 are null, and maybe other cases too.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (aval1 == null) {<NEW_LINE>aval1 = meth.getDefaultValue();<NEW_LINE>}<NEW_LINE>if (aval2 == null) {<NEW_LINE>aval2 = meth.getDefaultValue();<NEW_LINE>}<NEW_LINE>if (!sameAnnotationValue(aval1, aval2)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | > vals1 = am1.getElementValues(); |
1,774,310 | public void handleOutboundSuback(@NotNull final ChannelHandlerContext ctx, @NotNull final SUBACK suback, @NotNull final ChannelPromise promise) {<NEW_LINE>final Channel channel = ctx.channel();<NEW_LINE>final ClientConnection clientConnection = channel.attr(ChannelAttributes.CLIENT_CONNECTION).get();<NEW_LINE>final String clientId = clientConnection.getClientId();<NEW_LINE>if (clientId == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ClientContextImpl clientContext = clientConnection.getExtensionClientContext();<NEW_LINE>if (clientContext == null) {<NEW_LINE>ctx.write(suback, promise);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<SubackOutboundInterceptor> interceptors = clientContext.getSubackOutboundInterceptors();<NEW_LINE>if (interceptors.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ClientInformation clientInfo = ExtensionInformationUtil.getAndSetClientInformation(channel, clientId);<NEW_LINE>final ConnectionInformation connectionInfo = ExtensionInformationUtil.getAndSetConnectionInformation(channel);<NEW_LINE>final SubackPacketImpl packet = new SubackPacketImpl(suback);<NEW_LINE>final SubackOutboundInputImpl input = new SubackOutboundInputImpl(clientInfo, connectionInfo, packet);<NEW_LINE>final ExtensionParameterHolder<SubackOutboundInputImpl> inputHolder = new ExtensionParameterHolder<>(input);<NEW_LINE>final ModifiableSubackPacketImpl modifiablePacket = new ModifiableSubackPacketImpl(packet, configurationService);<NEW_LINE>final SubackOutboundOutputImpl output = new SubackOutboundOutputImpl(asyncer, modifiablePacket);<NEW_LINE>final ExtensionParameterHolder<SubackOutboundOutputImpl> outputHolder = new ExtensionParameterHolder<>(output);<NEW_LINE>final SubAckOutboundInterceptorContext context = new SubAckOutboundInterceptorContext(clientId, interceptors.size(), ctx, promise, inputHolder, outputHolder);<NEW_LINE>for (final SubackOutboundInterceptor interceptor : interceptors) {<NEW_LINE>final HiveMQExtension extension = hiveMQExtensions.getExtensionForClassloader(interceptor.getClass().getClassLoader());<NEW_LINE>if (extension == null) {<NEW_LINE>context.finishInterceptor();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final SubackOutboundInterceptorTask task = new SubackOutboundInterceptorTask(interceptor, extension.getId());<NEW_LINE>executorService.handlePluginInOutTaskExecution(context, inputHolder, outputHolder, task);<NEW_LINE>}<NEW_LINE>} | ctx.write(suback, promise); |
834,124 | private void addDependent(Entry entry, DataType subType) {<NEW_LINE>// subtype might be null, but don't expect entry to be null, but error?<NEW_LINE>if ((entry == null) || (subType == null)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (subType instanceof BitFieldDataType) {<NEW_LINE>subType = ((BitFieldDataType) subType).getBaseDataType();<NEW_LINE>}<NEW_LINE>Entry subEntry = createEntry(subType);<NEW_LINE>if (!doneSet.contains(subEntry)) {<NEW_LINE>procSet.add(subEntry);<NEW_LINE>}<NEW_LINE>if (entry.dataType instanceof Pointer) {<NEW_LINE>// avoid cycles with structures/composites<NEW_LINE>if (subType instanceof Composite) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<Entry> dependents = whoDependsOnMe.get(subEntry);<NEW_LINE>if (dependents == null) {<NEW_LINE>dependents = new HashSet<>();<NEW_LINE>whoDependsOnMe.put(subEntry, dependents);<NEW_LINE>}<NEW_LINE>// ignores duplicates<NEW_LINE>dependents.add(entry);<NEW_LINE>Set<Entry> support = whoIDependOn.get(entry);<NEW_LINE>if (support == null) {<NEW_LINE><MASK><NEW_LINE>whoIDependOn.put(entry, support);<NEW_LINE>}<NEW_LINE>// ignores duplicates<NEW_LINE>support.add(subEntry);<NEW_LINE>} | support = new HashSet<>(); |
1,691,487 | public long nextId(String prefixName, FrontendService frontendService) throws SQLNonTransientException {<NEW_LINE>// System.out.println(instanceId);<NEW_LINE>while (!ready) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(50);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOGGER.info("Unexpected thread interruption!");<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (time >= deadline) {<NEW_LINE>throw new SQLNonTransientException("Global sequence has reach to max limit and can generate duplicate sequences.");<NEW_LINE>}<NEW_LINE>Long lastTimestamp = threadLastTime.get();<NEW_LINE>if (lastTimestamp == null) {<NEW_LINE>if (time >= startTimeMilliseconds) {<NEW_LINE>threadLastTime.set(time);<NEW_LINE>lastTimestamp = time;<NEW_LINE>} else {<NEW_LINE>lastTimestamp = startTimeMilliseconds;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lastTimestamp > time) {<NEW_LINE>throw new SQLNonTransientException("Clock moved backwards. Refusing to generate id for " + (lastTimestamp - time) + " milliseconds");<NEW_LINE>}<NEW_LINE>if (threadInc.get() == null) {<NEW_LINE>threadInc.set(0L);<NEW_LINE>}<NEW_LINE>if (threadID.get() == null) {<NEW_LINE>threadID.set(getNextThreadID());<NEW_LINE>}<NEW_LINE>long a = threadInc.get();<NEW_LINE>long maxIncrement = 1L << incrementBits;<NEW_LINE>if ((a + 1L) >= maxIncrement) {<NEW_LINE>if (threadLastTime.get() == time) {<NEW_LINE>time = blockUntilNextMillis(time);<NEW_LINE>}<NEW_LINE>threadInc.set(0L);<NEW_LINE>} else {<NEW_LINE>threadInc.set(a + 1L);<NEW_LINE>}<NEW_LINE>threadLastTime.set(time);<NEW_LINE>long maxThreadId = 1L << threadIdBits;<NEW_LINE>long threadIdShift = instanceIdShift + instanceIdBits;<NEW_LINE>long timestampMask = (1L << timestampBits) - 1L;<NEW_LINE>return (((threadID.get() % maxThreadId) << threadIdShift)) | (instanceId << instanceIdShift) | (a << incrementShift) | ((time - startTimeMilliseconds) & timestampMask);<NEW_LINE>} | long time = System.currentTimeMillis(); |
297,552 | public static void main(String[] args) {<NEW_LINE>Exercise35_RandomQueue exercise35_randomQueue = new Exercise35_RandomQueue();<NEW_LINE>RandomQueue<Card> randomQueue = <MASK><NEW_LINE>fillQueueWithBridgeHandsCards(randomQueue);<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>int count = 0;<NEW_LINE>StdOut.println("Hand " + (i + 1));<NEW_LINE>while (count < 13) {<NEW_LINE>StdOut.println(randomQueue.dequeue());<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>StdOut.println();<NEW_LINE>}<NEW_LINE>Card sample = randomQueue.sample();<NEW_LINE>StdOut.println("Size before sample: " + randomQueue.size + " Expected: 26");<NEW_LINE>StdOut.println("Random item: " + sample);<NEW_LINE>StdOut.println("Size after sample: " + randomQueue.size + " Expected: 26");<NEW_LINE>} | exercise35_randomQueue.new RandomQueue<>(); |
1,542,930 | protected void replaceText(final JTextComponent component, final String text, final int offset, final int len) {<NEW_LINE>final BaseDocument doc = (BaseDocument) component.getDocument();<NEW_LINE>doc.runAtomic(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>// we cannot rely on the stored one - see #181711. Performance suffers a little.<NEW_LINE>TokenHierarchy tokenHierarchy = TokenHierarchy.get(doc);<NEW_LINE>tokenSequence = tokenHierarchy.tokenSequence();<NEW_LINE>String insertingText = getInsertingText(component, offset, text, len);<NEW_LINE>if (len > 0)<NEW_LINE>doc.remove(offset, len);<NEW_LINE>doc.insertString(offset, insertingText, null);<NEW_LINE>// fix for issue #186916<NEW_LINE>if ((!text.isEmpty()) && (!insertingText.isEmpty())) {<NEW_LINE>tokenHierarchy = TokenHierarchy.get(doc);<NEW_LINE>tokenSequence = tokenHierarchy.tokenSequence();<NEW_LINE>tokenSequence.move(offset);<NEW_LINE>tokenSequence.movePrevious();<NEW_LINE>Token token = tokenSequence.token();<NEW_LINE>if (CompletionUtil.isTagLastChar(token)) {<NEW_LINE>int caretPos = component.getCaretPosition<MASK><NEW_LINE>if (caretPos > -1)<NEW_LINE>component.setCaretPosition(caretPos);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>_logger.log(Level.WARNING, e.getMessage() == null ? e.getClass().getName() : e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>reindent(component);<NEW_LINE>} | () - text.length(); |
816,678 | private File chooseFile() {<NEW_LINE>FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell(), SWT.SAVE);<NEW_LINE>dialog.setText(Messages.ExportAsImagePage_7);<NEW_LINE>File file = new File(fFileTextField.getText());<NEW_LINE>dialog.setFileName(file.getName());<NEW_LINE>// Set filter extensions according to provider<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String extensions = "*.";<NEW_LINE>Iterator<String> iter = fSelectedProvider.getExtensions().iterator();<NEW_LINE>extensions += iter.next();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>extensions <MASK><NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>dialog.setFilterExtensions(new String[] { extensions, "*.*" });<NEW_LINE>// Does nothing on macOS 10.15+. On Windows will work after Eclipse 4.21<NEW_LINE>dialog.setOverwrite(false);<NEW_LINE>String path = dialog.open();<NEW_LINE>if (path == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new File(path);<NEW_LINE>} | += ";*." + iter.next(); |
860,240 | private void pretifyJson(String pathToJson) throws ReportException {<NEW_LINE>LOGGER.debug("pretify json: {}", pathToJson);<NEW_LINE>final String outputPath = pathToJson + ".pretty";<NEW_LINE>final <MASK><NEW_LINE>final File out = new File(outputPath);<NEW_LINE>final JsonFactory factory = new JsonFactory();<NEW_LINE>try (InputStream is = new FileInputStream(in);<NEW_LINE>OutputStream os = new FileOutputStream(out)) {<NEW_LINE>final JsonParser parser = factory.createParser(is);<NEW_LINE>final JsonGenerator generator = factory.createGenerator(os);<NEW_LINE>generator.useDefaultPrettyPrinter();<NEW_LINE>while (parser.nextToken() != null) {<NEW_LINE>generator.copyCurrentEvent(parser);<NEW_LINE>}<NEW_LINE>generator.flush();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.debug("Malformed JSON?", ex);<NEW_LINE>throw new ReportException("Unable to generate json report", ex);<NEW_LINE>}<NEW_LINE>if (out.isFile() && in.isFile() && in.delete()) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>org.apache.commons.io.FileUtils.moveFile(out, in);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.error("Unable to generate pretty report, caused by: {}", ex.getMessage());<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>LOGGER.error("Unable to generate pretty report, caused by: {}", ex.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | File in = new File(pathToJson); |
1,021,398 | protected void removeDownload(final Download download, final boolean remove_data) {<NEW_LINE>monitored_downloads.remove(download);<NEW_LINE>if (download.getState() == Download.ST_STOPPED) {<NEW_LINE>try {<NEW_LINE>download.remove(false, remove_data);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>log.logAlert("Automatic removal of download '" + download.getName() + "' failed", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>download.addListener(new DownloadListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stateChanged(Download download, int old_state, int new_state) {<NEW_LINE>log.log(download.getTorrent(), LoggerChannel.<MASK><NEW_LINE>if (new_state == Download.ST_STOPPED) {<NEW_LINE>try {<NEW_LINE>download.remove(false, remove_data);<NEW_LINE>String msg = plugin_interface.getUtilities().getLocaleUtilities().getLocalisedMessageText("download.removerules.removed.ok", new String[] { download.getName() });<NEW_LINE>if (download.getFlag(Download.FLAG_LOW_NOISE)) {<NEW_LINE>log.log(download.getTorrent(), LoggerChannel.LT_INFORMATION, msg);<NEW_LINE>} else {<NEW_LINE>log.logAlert(LoggerChannel.LT_INFORMATION, msg);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>log.logAlert("Automatic removal of download '" + download.getName() + "' failed", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void positionChanged(Download download, int oldPosition, int newPosition) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>download.stop();<NEW_LINE>} catch (DownloadException e) {<NEW_LINE>log.logAlert("Automatic removal of download '" + download.getName() + "' failed", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | LT_INFORMATION, "download state changed to '" + new_state + "'"); |
460,207 | public AnnotationExtractRule create(Env env, Map<String, Object> attributes) {<NEW_LINE>AnnotationExtractRule r = super.create(env, attributes);<NEW_LINE>if (r.annotationField == null) {<NEW_LINE>r.annotationField = r.tokensAnnotationField;<NEW_LINE>}<NEW_LINE>if (r.ruleType == null) {<NEW_LINE>r.ruleType = TOKEN_PATTERN_RULE_TYPE;<NEW_LINE>}<NEW_LINE>// SequencePattern.PatternExpr expr = (SequencePattern.PatternExpr) attributes.get("pattern");<NEW_LINE>TokenSequencePattern expr = (TokenSequencePattern) Expressions.asObject(env, attributes.get("pattern"));<NEW_LINE>Expression action = Expressions.asExpression(env, attributes.get("action"));<NEW_LINE>Expression result = Expressions.asExpression(env, attributes.get("result"));<NEW_LINE>updateExtractRule(r, <MASK><NEW_LINE>return r;<NEW_LINE>} | env, expr, action, result); |
1,692,333 | private static SequenceQuery<AbstractInsnNode> countingLoopWithoutWriteConditionAtEnd() {<NEW_LINE>final Slot<Integer> counterVariable = Slot.create(Integer.class);<NEW_LINE>final Slot<LabelNode> loopStart = Slot.create(LabelNode.class);<NEW_LINE>final Slot<LabelNode> loopEnd = <MASK><NEW_LINE>return // is it really important that we read the counter?<NEW_LINE>QueryStart.any(AbstractInsnNode.class).then(anIntegerConstant()).then(anIStore(counterVariable.write()).and(debug("counter"))).then(isA(LabelNode.class)).then(gotoLabel(loopEnd.write())).then(aLabelNode(loopStart.write()).and(debug("loop start"))).zeroOrMore(doesNotBreakLoop(counterVariable)).then(labelNode(loopEnd.read()).and(debug("loop end"))).// is it really important that we read the counter?<NEW_LINE>then(anILoadOf(counterVariable.read()).and(debug("read"))).zeroOrMore(doesNotBreakLoop(counterVariable)).then(jumpsTo(loopStart.read()).and(debug("jump"))).zeroOrMore(QueryStart.match(anyInstruction()));<NEW_LINE>} | Slot.create(LabelNode.class); |
501,050 | private int parsePackageTable(ResTable_Package packageTable, byte[] data, int offset) throws IOException {<NEW_LINE>packageTable.id = readUInt32(data, offset);<NEW_LINE>offset += 4;<NEW_LINE>// Read the package name, zero-terminated string<NEW_LINE>StringBuilder bld = new StringBuilder();<NEW_LINE>for (int i = 0; i < 128; i++) {<NEW_LINE>int curChar = readUInt16(data, offset);<NEW_LINE>bld.append((char) curChar);<NEW_LINE>offset += 2;<NEW_LINE>}<NEW_LINE>packageTable.name = bld.toString().trim();<NEW_LINE>packageTable.typeStrings = readUInt32(data, offset);<NEW_LINE>offset += 4;<NEW_LINE>packageTable.lastPublicType = readUInt32(data, offset);<NEW_LINE>offset += 4;<NEW_LINE>packageTable.keyStrings = readUInt32(data, offset);<NEW_LINE>offset += 4;<NEW_LINE>packageTable.<MASK><NEW_LINE>offset += 4;<NEW_LINE>return offset;<NEW_LINE>} | lastPublicKey = readUInt32(data, offset); |
345,722 | static Tuple<SortedMap<String, Object>, SortedMap<String, FieldStats>> guessMappingsAndCalculateFieldStats(List<String> explanation, List<Map<String, ?>> sampleRecords, TimeoutChecker timeoutChecker) {<NEW_LINE>SortedMap<String, Object> mappings = new TreeMap<>();<NEW_LINE>SortedMap<String, FieldStats> fieldStats = new TreeMap<>();<NEW_LINE>Set<String> uniqueFieldNames = sampleRecords.stream().flatMap(record -> record.keySet().stream()).collect(Collectors.toSet());<NEW_LINE>for (String fieldName : uniqueFieldNames) {<NEW_LINE>List<Object> fieldValues = sampleRecords.stream().map(record -> record.get(fieldName)).filter(fieldValue -> fieldValue != null).collect(Collectors.toList());<NEW_LINE>Tuple<Map<String, String>, FieldStats> mappingAndFieldStats = guessMappingAndCalculateFieldStats(<MASK><NEW_LINE>if (mappingAndFieldStats != null) {<NEW_LINE>if (mappingAndFieldStats.v1() != null) {<NEW_LINE>mappings.put(fieldName, mappingAndFieldStats.v1());<NEW_LINE>}<NEW_LINE>if (mappingAndFieldStats.v2() != null) {<NEW_LINE>fieldStats.put(fieldName, mappingAndFieldStats.v2());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Tuple<>(mappings, fieldStats);<NEW_LINE>} | explanation, fieldName, fieldValues, timeoutChecker); |
412,617 | protected Object encodeParameterValue(ICommandParameter parameter, IDeviceCommandInvocation invocation) throws SiteWhereException {<NEW_LINE>String value = invocation.getParameterValues().get(parameter.getName());<NEW_LINE>try {<NEW_LINE>switch(parameter.getType()) {<NEW_LINE>case String:<NEW_LINE>{<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>case Bool:<NEW_LINE>{<NEW_LINE>return Boolean.parseBoolean(value);<NEW_LINE>}<NEW_LINE>case Bytes:<NEW_LINE>{<NEW_LINE>return value.getBytes();<NEW_LINE>}<NEW_LINE>case Double:<NEW_LINE>{<NEW_LINE>return Double.parseDouble(value);<NEW_LINE>}<NEW_LINE>case Float:<NEW_LINE>{<NEW_LINE>return Float.parseFloat(value);<NEW_LINE>}<NEW_LINE>case Fixed32:<NEW_LINE>case Fixed64:<NEW_LINE>case Int32:<NEW_LINE>case Int64:<NEW_LINE>case SFixed32:<NEW_LINE>case SFixed64:<NEW_LINE>case SInt32:<NEW_LINE>case SInt64:<NEW_LINE>case UInt32:<NEW_LINE>case UInt64:<NEW_LINE>{<NEW_LINE>return Integer.parseInt(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>throw new SiteWhereException("Parameter type could not be encoded: " + parameter.getType());<NEW_LINE>} | throw new SiteWhereException("Error converting command parameter.", e); |
1,097,589 | protected void convertElementToJson(ObjectNode elementNode, ObjectNode propertiesNode, ActivityProcessor processor, BaseElement baseElement, CmmnModel cmmnModel, CmmnJsonConverterContext converterContext) {<NEW_LINE>DecisionTask decisionTask = (DecisionTask) ((PlanItem) baseElement).getPlanItemDefinition();<NEW_LINE>if (StringUtils.isNotEmpty(decisionTask.getDecisionRef())) {<NEW_LINE>ObjectNode decisionReferenceNode = objectMapper.createObjectNode();<NEW_LINE>decisionReferenceNode.put("key", decisionTask.getDecisionRef());<NEW_LINE><MASK><NEW_LINE>Map<String, String> modelInfo = converterContext.getDecisionTableModelInfoForDecisionTableModelKey(decisionTask.getDecisionRef());<NEW_LINE>if (modelInfo != null) {<NEW_LINE>decisionReferenceNode.put("id", modelInfo.get("id"));<NEW_LINE>decisionReferenceNode.put("name", modelInfo.get("name"));<NEW_LINE>decisionReferenceNode.put("key", modelInfo.get("key"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (FieldExtension fieldExtension : decisionTask.getFieldExtensions()) {<NEW_LINE>if (PROPERTY_DECISIONTABLE_THROW_ERROR_NO_HITS_KEY.equals(fieldExtension.getFieldName())) {<NEW_LINE>propertiesNode.put(PROPERTY_DECISIONTABLE_THROW_ERROR_NO_HITS, Boolean.parseBoolean(fieldExtension.getStringValue()));<NEW_LINE>}<NEW_LINE>if (PROPERTY_DECISIONTABLE_FALLBACK_TO_DEFAULT_TENANT_KEY.equals(fieldExtension.getFieldName())) {<NEW_LINE>propertiesNode.put(PROPERTY_DECISIONTABLE_FALLBACK_TO_DEFAULT_TENANT, Boolean.parseBoolean(fieldExtension.getStringValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ListenerConverterUtil.convertLifecycleListenersToJson(objectMapper, propertiesNode, decisionTask);<NEW_LINE>} | propertiesNode.set(PROPERTY_DECISIONTABLE_REFERENCE, decisionReferenceNode); |
402,792 | private static Map<String, double[]> loadEmbeddingsFromFile(String filename) throws IOException {<NEW_LINE>Map<String, double[]> embeddings = new HashMap<>();<NEW_LINE>BufferedReader br = new BufferedReader(new FileReader(filename));<NEW_LINE>int readLines = 0;<NEW_LINE>String line = br.readLine();<NEW_LINE>while ((line = br.readLine()) != null) {<NEW_LINE>String[] parts = line.split(" ");<NEW_LINE>if (parts.length == 302) {<NEW_LINE>String token = parts[0];<NEW_LINE>double[] embedding = new double[300];<NEW_LINE>for (int i = 1; i < parts.length - 1; i++) {<NEW_LINE>embedding[i - 1] = Double.parseDouble(parts[i]);<NEW_LINE>}<NEW_LINE>embeddings.put(token, embedding);<NEW_LINE>}<NEW_LINE>readLines++;<NEW_LINE>if (readLines % 10000 == 0) {<NEW_LINE>log.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return embeddings;<NEW_LINE>} | info("Read " + readLines + " lines"); |
285,310 | public void computeModuleUpdates(IClasspathEntry entry) throws JavaModelException {<NEW_LINE>for (IClasspathAttribute attribute : entry.getExtraAttributes()) {<NEW_LINE>String attributeName = attribute.getName();<NEW_LINE>// the attributes considered here may have multiple values separated by ':'<NEW_LINE>String values = attribute.getValue();<NEW_LINE>if (attributeName.equals(IClasspathAttribute.ADD_EXPORTS)) {<NEW_LINE>for (String value : values.split(":")) {<NEW_LINE>// format: <source-module>/<package>=<target-module>(,<target-module>)* //$NON-NLS-1$<NEW_LINE>int <MASK><NEW_LINE>int equals = value.indexOf('=');<NEW_LINE>if (slash != -1 && equals != -1) {<NEW_LINE>String modName = value.substring(0, slash);<NEW_LINE>char[] packName = value.substring(slash + 1, equals).toCharArray();<NEW_LINE>char[][] targets = CharOperation.splitOn(',', value.substring(equals + 1).toCharArray());<NEW_LINE>addModuleUpdate(modName, new IUpdatableModule.AddExports(packName, targets), UpdateKind.PACKAGE);<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Util.log(IStatus.WARNING, "Invalid argument to add-exports: " + value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (attributeName.equals(IClasspathAttribute.ADD_READS)) {<NEW_LINE>for (String value : values.split(":")) {<NEW_LINE>// format: <source-module>=<target-module> //$NON-NLS-1$<NEW_LINE>int equals = value.indexOf('=');<NEW_LINE>if (equals != -1) {<NEW_LINE>String srcMod = value.substring(0, equals);<NEW_LINE>char[] targetMod = value.substring(equals + 1).toCharArray();<NEW_LINE>addModuleUpdate(srcMod, new IUpdatableModule.AddReads(targetMod), UpdateKind.MODULE);<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Util.log(IStatus.WARNING, "Invalid argument to add-reads: " + value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (attributeName.equals(IClasspathAttribute.MODULE_MAIN_CLASS)) {<NEW_LINE>IModuleDescription module = this.javaProoject.getModuleDescription();<NEW_LINE>if (module == null)<NEW_LINE>throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST));<NEW_LINE>addModuleUpdate(module.getElementName(), m -> m.setMainClassName(values.toCharArray()), UpdateKind.MODULE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | slash = value.indexOf('/'); |
607,161 | public Map<Sha256Hash, Long> lookupStreamIdsByHash(Transaction t, final Set<Sha256Hash> hashes) {<NEW_LINE>if (hashes.isEmpty()) {<NEW_LINE>return ImmutableMap.of();<NEW_LINE>}<NEW_LINE>SnapshotsStreamHashAidxTable idx = tables.getSnapshotsStreamHashAidxTable(t);<NEW_LINE>Set<SnapshotsStreamHashAidxTable.SnapshotsStreamHashAidxRow> rows = getHashIndexRowsForHashes(hashes);<NEW_LINE>Multimap<SnapshotsStreamHashAidxTable.SnapshotsStreamHashAidxRow, SnapshotsStreamHashAidxTable.SnapshotsStreamHashAidxColumnValue> m = idx.getRowsMultimap(rows);<NEW_LINE>Map<Long, Sha256Hash> hashForStreams = new HashMap<>();<NEW_LINE>for (SnapshotsStreamHashAidxTable.SnapshotsStreamHashAidxRow r : m.keySet()) {<NEW_LINE>for (SnapshotsStreamHashAidxTable.SnapshotsStreamHashAidxColumnValue v : m.get(r)) {<NEW_LINE>Long streamId = v.getColumnName().getStreamId();<NEW_LINE>Sha256Hash hash = r.getHash();<NEW_LINE>if (hashForStreams.containsKey(streamId)) {<NEW_LINE>AssertUtils.assertAndLog(log, hashForStreams.get(streamId).equals(hash), "(BUG) Stream ID has 2 different hashes: " + streamId);<NEW_LINE>}<NEW_LINE>hashForStreams.put(streamId, hash);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<Long, StreamMetadata> metadata = getMetadata(t, hashForStreams.keySet());<NEW_LINE>Map<Sha256Hash, Long> <MASK><NEW_LINE>for (Map.Entry<Long, StreamMetadata> e : metadata.entrySet()) {<NEW_LINE>if (e.getValue().getStatus() != Status.STORED) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Sha256Hash hash = hashForStreams.get(e.getKey());<NEW_LINE>ret.put(hash, e.getKey());<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | ret = new HashMap<>(); |
831,473 | private static Bitmap blur(Bitmap bitmap, Context context, float blurRadius) {<NEW_LINE>Point previewSize = scaleKeepingAspectRatio(new Point(bitmap.getWidth(), bitmap.getHeight()), PREVIEW_DIMENSION_LIMIT);<NEW_LINE>Point blurSize = scaleKeepingAspectRatio(new Point(previewSize.x / 2, previewSize.y / 2), MAX_BLUR_DIMENSION);<NEW_LINE>Bitmap small = BitmapUtil.createScaledBitmap(bitmap, blurSize.x, blurSize.y);<NEW_LINE>Log.d(TAG, "Bitmap: " + bitmap.getWidth() + "x" + bitmap.getHeight() + ", Blur: " + blurSize.x + "x" + blurSize.y);<NEW_LINE>RenderScript rs = RenderScript.create(context);<NEW_LINE>Allocation input = Allocation.createFromBitmap(rs, small);<NEW_LINE>Allocation output = Allocation.createTyped(rs, input.getType());<NEW_LINE>ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));<NEW_LINE>script.setRadius(blurRadius);<NEW_LINE>script.setInput(input);<NEW_LINE>script.forEach(output);<NEW_LINE>Bitmap blurred = Bitmap.createBitmap(small.getWidth(), small.getHeight(<MASK><NEW_LINE>output.copyTo(blurred);<NEW_LINE>return blurred;<NEW_LINE>} | ), small.getConfig()); |
331,873 | public static void main(String[] args) {<NEW_LINE>final String USAGE = "\n" + "Usage: " + " <bucket> <video> <topicArn> <roleArn>\n\n" + "Where:\n" + " bucket - the name of the bucket in which the video is located (for example, (for example, myBucket). \n\n" + " video - the name of video (for example, people.mp4). \n\n" + " topicArn - the ARN of the Amazon Simple Notification Service (Amazon SNS) topic. \n\n" + " roleArn - the ARN of the AWS Identity and Access Management (IAM) role to use. \n\n";<NEW_LINE>if (args.length != 4) {<NEW_LINE>System.out.println(USAGE);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String bucket = args[0];<NEW_LINE>String video = args[1];<NEW_LINE>String topicArn = args[2];<NEW_LINE>String roleArn = args[3];<NEW_LINE>Region region = Region.US_EAST_1;<NEW_LINE>RekognitionClient rekClient = RekognitionClient.builder().<MASK><NEW_LINE>NotificationChannel channel = NotificationChannel.builder().snsTopicArn(topicArn).roleArn(roleArn).build();<NEW_LINE>StartCelebrityDetection(rekClient, channel, bucket, video);<NEW_LINE>GetCelebrityDetectionResults(rekClient);<NEW_LINE>System.out.println("This example is done!");<NEW_LINE>rekClient.close();<NEW_LINE>} | region(region).build(); |
354,431 | final GetAppResult executeGetApp(GetAppRequest getAppRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAppRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetAppRequest> request = null;<NEW_LINE>Response<GetAppResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAppRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getAppRequest));<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, "Amplify");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetApp");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetAppResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>} | false), new GetAppResultJsonUnmarshaller()); |
162,952 | public static DescribeDcdnDomainLogResponse unmarshall(DescribeDcdnDomainLogResponse describeDcdnDomainLogResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDcdnDomainLogResponse.setRequestId(_ctx.stringValue("DescribeDcdnDomainLogResponse.RequestId"));<NEW_LINE>describeDcdnDomainLogResponse.setDomainName<MASK><NEW_LINE>List<DomainLogDetail> domainLogDetails = new ArrayList<DomainLogDetail>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDcdnDomainLogResponse.DomainLogDetails.Length"); i++) {<NEW_LINE>DomainLogDetail domainLogDetail = new DomainLogDetail();<NEW_LINE>domainLogDetail.setLogCount(_ctx.longValue("DescribeDcdnDomainLogResponse.DomainLogDetails[" + i + "].LogCount"));<NEW_LINE>PageInfos pageInfos = new PageInfos();<NEW_LINE>pageInfos.setPageIndex(_ctx.longValue("DescribeDcdnDomainLogResponse.DomainLogDetails[" + i + "].PageInfos.PageIndex"));<NEW_LINE>pageInfos.setPageSize(_ctx.longValue("DescribeDcdnDomainLogResponse.DomainLogDetails[" + i + "].PageInfos.PageSize"));<NEW_LINE>pageInfos.setTotal(_ctx.longValue("DescribeDcdnDomainLogResponse.DomainLogDetails[" + i + "].PageInfos.Total"));<NEW_LINE>domainLogDetail.setPageInfos(pageInfos);<NEW_LINE>List<LogInfoDetail> logInfos = new ArrayList<LogInfoDetail>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDcdnDomainLogResponse.DomainLogDetails[" + i + "].LogInfos.Length"); j++) {<NEW_LINE>LogInfoDetail logInfoDetail = new LogInfoDetail();<NEW_LINE>logInfoDetail.setLogName(_ctx.stringValue("DescribeDcdnDomainLogResponse.DomainLogDetails[" + i + "].LogInfos[" + j + "].LogName"));<NEW_LINE>logInfoDetail.setLogPath(_ctx.stringValue("DescribeDcdnDomainLogResponse.DomainLogDetails[" + i + "].LogInfos[" + j + "].LogPath"));<NEW_LINE>logInfoDetail.setLogSize(_ctx.longValue("DescribeDcdnDomainLogResponse.DomainLogDetails[" + i + "].LogInfos[" + j + "].LogSize"));<NEW_LINE>logInfoDetail.setStartTime(_ctx.stringValue("DescribeDcdnDomainLogResponse.DomainLogDetails[" + i + "].LogInfos[" + j + "].StartTime"));<NEW_LINE>logInfoDetail.setEndTime(_ctx.stringValue("DescribeDcdnDomainLogResponse.DomainLogDetails[" + i + "].LogInfos[" + j + "].EndTime"));<NEW_LINE>logInfos.add(logInfoDetail);<NEW_LINE>}<NEW_LINE>domainLogDetail.setLogInfos(logInfos);<NEW_LINE>domainLogDetails.add(domainLogDetail);<NEW_LINE>}<NEW_LINE>describeDcdnDomainLogResponse.setDomainLogDetails(domainLogDetails);<NEW_LINE>return describeDcdnDomainLogResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeDcdnDomainLogResponse.DomainName")); |
1,682,133 | public PlatformToolProvider select(NativeLanguage sourceLanguage, NativePlatformInternal targetMachine) {<NEW_LINE>PlatformToolProvider toolProvider = getProviderForPlatform(targetMachine);<NEW_LINE>switch(sourceLanguage) {<NEW_LINE>case CPP:<NEW_LINE>if (toolProvider instanceof UnsupportedPlatformToolProvider) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>ToolSearchResult cppCompiler = toolProvider.locateTool(ToolType.CPP_COMPILER);<NEW_LINE>if (cppCompiler.isAvailable()) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>// No C++ compiler, complain about it<NEW_LINE>return new UnavailablePlatformToolProvider(targetMachine.getOperatingSystem(), cppCompiler);<NEW_LINE>case ANY:<NEW_LINE>if (toolProvider instanceof UnsupportedPlatformToolProvider) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>ToolSearchResult cCompiler = toolProvider.locateTool(ToolType.C_COMPILER);<NEW_LINE>if (cCompiler.isAvailable()) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>ToolSearchResult compiler = <MASK><NEW_LINE>if (compiler.isAvailable()) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>compiler = toolProvider.locateTool(ToolType.OBJECTIVEC_COMPILER);<NEW_LINE>if (compiler.isAvailable()) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>compiler = toolProvider.locateTool(ToolType.OBJECTIVECPP_COMPILER);<NEW_LINE>if (compiler.isAvailable()) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>// No compilers available, complain about the missing C compiler<NEW_LINE>return new UnavailablePlatformToolProvider(targetMachine.getOperatingSystem(), cCompiler);<NEW_LINE>default:<NEW_LINE>return new UnsupportedPlatformToolProvider(targetMachine.getOperatingSystem(), String.format("Don't know how to compile language %s.", sourceLanguage));<NEW_LINE>}<NEW_LINE>} | toolProvider.locateTool(ToolType.CPP_COMPILER); |
1,317,417 | public void drawScreen(int par1, int par2, float par3) {<NEW_LINE>drawDefaultBackground();<NEW_LINE>int scale = fontRenderer.getUnicodeFlag() ? 1 : 2;<NEW_LINE>for (EnumFacing dir : EnumFacing.VALUES) {<NEW_LINE>if (stacks.containsKey(dir)) {<NEW_LINE>ItemStack stack = stacks.get(dir);<NEW_LINE><MASK><NEW_LINE>int textWidth = fontRenderer.getStringWidth(blockName) / scale;<NEW_LINE>Point p = textPositions.get(dir);<NEW_LINE>GL11.glPushMatrix();<NEW_LINE>GL11.glScalef(1f / scale, 1f / scale, 1f / scale);<NEW_LINE>drawString(fontRenderer, blockName, scale * (p.x + BUTTON_WIDTH / 2 - textWidth / 2), scale * p.y, ColorUtil.getARGB(Color.gray));<NEW_LINE>GL11.glPopMatrix();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.drawScreen(par1, par2, par3);<NEW_LINE>String txt = "Select Connection to Adjust";<NEW_LINE>int x = width / 2 - (fontRenderer.getStringWidth(txt) / 2);<NEW_LINE>int y = height / 2 - BUTTON_HEIGHT * 3 - 5;<NEW_LINE>drawString(fontRenderer, txt, x, y, ColorUtil.getARGB(Color.white));<NEW_LINE>if (Minecraft.getMinecraft().player.getName().contains("direwolf20") && ((EnderIO.proxy.getTickCount() / 16) & 1) == 1) {<NEW_LINE>txt = "You can also right-click the connector directly";<NEW_LINE>x = width / 2 - (fontRenderer.getStringWidth(txt) / 2);<NEW_LINE>y = (int) (height / 2 + BUTTON_HEIGHT * 2.75 - 5);<NEW_LINE>drawString(fontRenderer, txt, x, y, ColorUtil.getARGB(Color.white));<NEW_LINE>}<NEW_LINE>RenderHelper.enableGUIStandardItemLighting();<NEW_LINE>GlStateManager.disableLighting();<NEW_LINE>GlStateManager.enableRescaleNormal();<NEW_LINE>GlStateManager.enableColorMaterial();<NEW_LINE>GlStateManager.enableLighting();<NEW_LINE>for (EnumFacing dir : EnumFacing.VALUES) {<NEW_LINE>if (stacks.containsKey(dir)) {<NEW_LINE>ItemStack stack = stacks.get(dir);<NEW_LINE>Point p = stackPositions.get(dir);<NEW_LINE>if (stack != null) {<NEW_LINE>itemRender.renderItemAndEffectIntoGUI(stack, p.x, p.y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String blockName = stack.getDisplayName(); |
1,817,425 | public void handleToken(String token) throws UserIdentityException {<NEW_LINE>System.out.println("token is : " + token.toString());<NEW_LINE>JSONObject jobj = null;<NEW_LINE>try {<NEW_LINE>jobj = JSONObject.parse(token);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new UserIdentityException("cannot parse the token string", e.getCause());<NEW_LINE>}<NEW_LINE>if (jobj != null) {<NEW_LINE>if ((jobj.get("active")) != null && ((Boolean) jobj.get("active")) == true) {<NEW_LINE>userName = "spi_resolved_user";<NEW_LINE>realm = resolverId + "_realm";<NEW_LINE>uniqueId = "user:" + resolverId + "_realm/" + userName;<NEW_LINE>groups = new ArrayList<String>();<NEW_LINE>groups.add("Employee");<NEW_LINE>groups.add(resolverId + "_group");<NEW_LINE>} else if (jobj.get("active") == null) {<NEW_LINE>if (jobj.get("at_hash") != null) {<NEW_LINE>userName = "spi_resolved_user_for_rp";<NEW_LINE>realm = "spi_resolved_realm_for_rp";<NEW_LINE>uniqueId = "user:" + realm + userName;<NEW_LINE>groups <MASK><NEW_LINE>groups.add("Employee");<NEW_LINE>} else {<NEW_LINE>// this can happen if the validation method is userInfo<NEW_LINE>//<NEW_LINE>userName = "";<NEW_LINE>realm = "";<NEW_LINE>uniqueId = "";<NEW_LINE>groups = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UserIdentityException("Cannot process the supplied token string!");<NEW_LINE>// userName = "";<NEW_LINE>// realm = "";<NEW_LINE>// uniqueId = "";<NEW_LINE>// groups = null;<NEW_LINE>}<NEW_LINE>} | = new ArrayList<String>(); |
1,827,249 | private void showInfoAfterWebAuthnApiCreate(RegistrationData response) {<NEW_LINE>AttestedCredentialData attestedCredentialData = response.getAttestationObject().getAuthenticatorData().getAttestedCredentialData();<NEW_LINE>AttestationStatement attestationStatement = response.getAttestationObject().getAttestationStatement();<NEW_LINE>Set<AuthenticatorTransport> transports = response.getTransports();<NEW_LINE>logger.debugv("createad key's algorithm = {0}", String.valueOf(attestedCredentialData.getCOSEKey().getAlgorithm().getValue()));<NEW_LINE>logger.debugv("aaguid = {0}", attestedCredentialData.getAaguid().toString());<NEW_LINE>logger.debugv(<MASK><NEW_LINE>if (CollectionUtil.isNotEmpty(transports)) {<NEW_LINE>logger.debugv("transports = [{0}]", transports.stream().map(AuthenticatorTransport::getValue).collect(Collectors.joining(",")));<NEW_LINE>}<NEW_LINE>} | "attestation format = {0}", attestationStatement.getFormat()); |
1,046,032 | public void marshall(ConnectorMetadata connectorMetadata, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (connectorMetadata == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getAmplitude(), AMPLITUDE_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getDatadog(), DATADOG_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getDynatrace(), DYNATRACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getGoogleAnalytics(), GOOGLEANALYTICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getInforNexus(), INFORNEXUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getMarketo(), MARKETO_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getRedshift(), REDSHIFT_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getS3(), S3_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getSalesforce(), SALESFORCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getSingular(), SINGULAR_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getSlack(), SLACK_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getSnowflake(), SNOWFLAKE_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getTrendmicro(), TRENDMICRO_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getVeeva(), VEEVA_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getZendesk(), ZENDESK_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getEventBridge(), EVENTBRIDGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getUpsolver(), UPSOLVER_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getCustomerProfiles(), CUSTOMERPROFILES_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getHoneycode(), HONEYCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorMetadata.getSAPOData(), SAPODATA_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | connectorMetadata.getServiceNow(), SERVICENOW_BINDING); |
699,559 | /*<NEW_LINE>* Called by webcontainer to do session cleanup, once per webapp per request.<NEW_LINE>* If multiple apps are involved due to forwards/includes, multiple<NEW_LINE>* sessionPostInvoke<NEW_LINE>* calls are all made at then end of the request. We do NOT call<NEW_LINE>* sessionPostInvoke<NEW_LINE>* immediately when a dispatch ends. Therefore, some of this processing - such<NEW_LINE>* as<NEW_LINE>* calling unlockSession or setting the crossover threadlocal to null - may be<NEW_LINE>* done<NEW_LINE>* multiple times. This is ok.<NEW_LINE>*/<NEW_LINE>public void sessionPostInvoke(HttpSession sess) {<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {<NEW_LINE>LoggingUtil.SESSION_LOGGER_CORE.entering<MASK><NEW_LINE>}<NEW_LINE>SessionData s = (SessionData) sess;<NEW_LINE>if (_smc.getAllowSerializedSessionAccess()) {<NEW_LINE>unlockSession(sess);<NEW_LINE>}<NEW_LINE>if (s != null) {<NEW_LINE>synchronized (s) {<NEW_LINE>SessionAffinityContext sac = null;<NEW_LINE>_coreHttpSessionManager.releaseSession(s.getISession(), sac);<NEW_LINE>if (_coreHttpAppSessionManager != null) {<NEW_LINE>// try and get the Application Session in memory ... if it is there,<NEW_LINE>// make sure you update the backend via releaseSession<NEW_LINE>ISession iSess = (ISession) _coreHttpAppSessionManager.getIStore().getFromMemory(s.getId());<NEW_LINE>if (iSess != null) {<NEW_LINE>// iSess.decrementRefCount();<NEW_LINE>_coreHttpAppSessionManager.releaseSession(iSess, sac);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (_smc.isDebugSessionCrossover()) {<NEW_LINE>currentThreadSacHashtable.set(null);<NEW_LINE>}<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {<NEW_LINE>LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[SESSION_POST_INVOKE]);<NEW_LINE>}<NEW_LINE>} | (methodClassName, methodNames[SESSION_POST_INVOKE]); |
622,680 | public List<User> listUser(Org org) throws Exception {<NEW_LINE>String address = Config.zhengwuDingding().getOapiAddress() + "/org/member/get?access_token=" + this.accessToken + "&orgNumber=" + org.getOrgNumber();<NEW_LINE>UserListResp resp = HttpConnection.getAsObject(address, null, UserListResp.class);<NEW_LINE>if (resp.getRetCode() != 0) {<NEW_LINE>throw new ExceptionListUser(resp.getRetCode(), resp.getRetMessage());<NEW_LINE>}<NEW_LINE>List<User> <MASK><NEW_LINE>next: for (User o : resp.getRetData()) {<NEW_LINE>for (User u : users) {<NEW_LINE>if (StringUtils.equals(o.getUserId(), u.getUserId())) {<NEW_LINE>os.add(u);<NEW_LINE>continue next;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>User user = this.detailUser(o);<NEW_LINE>users.add(user);<NEW_LINE>os.add(user);<NEW_LINE>}<NEW_LINE>return os;<NEW_LINE>} | os = new ArrayList<>(); |
516,991 | private Result clusterOperate(List<RedisNode> redisNodeList, ClusterHandler clusterHandler) {<NEW_LINE>if (!verifyRedisNodeList(redisNodeList)) {<NEW_LINE>return Result.failResult();<NEW_LINE>}<NEW_LINE>Integer clusterId = redisNodeList.get(0).getClusterId();<NEW_LINE>Cluster cluster = getCluster(clusterId);<NEW_LINE>StringBuffer messageBuffer = new StringBuffer();<NEW_LINE>redisNodeList.forEach(redisNode -> {<NEW_LINE>try {<NEW_LINE>String[] nodeArr = SignUtil.splitByCommas(cluster.getNodes());<NEW_LINE>String node = RedisUtil.getNodeString(redisNode);<NEW_LINE>if (nodeArr.length > 1) {<NEW_LINE>StringBuilder newNodes = new StringBuilder();<NEW_LINE>for (String nodeItem : nodeArr) {<NEW_LINE>if (!Objects.equals(node, nodeItem) && !Strings.isNullOrEmpty(nodeItem)) {<NEW_LINE>newNodes.append(nodeItem).append(SignUtil.COMMAS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cluster.setNodes(newNodes.toString());<NEW_LINE>clusterService.updateNodes(cluster);<NEW_LINE>}<NEW_LINE>boolean handleResult = clusterHandler.handle(cluster, redisNode);<NEW_LINE>if (!handleResult) {<NEW_LINE>messageBuffer.append(redisNode.getHost() + ":" + redisNode.getPort() + " operation failed.\n");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>String message = messageBuffer.toString();<NEW_LINE>return Strings.isNullOrEmpty(message) ? Result.successResult() : Result.failResult().setMessage(message);<NEW_LINE>} | logger.error("Operation failed.", e); |
983,055 | private void stochasticEnsure(double[] x, double[] v, int batchSize) {<NEW_LINE>if (lastXBatch == null) {<NEW_LINE>lastXBatch = new double[domainDimension()];<NEW_LINE>log.info("Setting previous position (x).");<NEW_LINE>}<NEW_LINE>if (lastVBatch == null) {<NEW_LINE>lastVBatch = new double[domainDimension()];<NEW_LINE>log.info("Setting previous gain (v)");<NEW_LINE>}<NEW_LINE>if (derivative == null) {<NEW_LINE>derivative = new double[domainDimension()];<NEW_LINE>log.info("Setting Derivative.");<NEW_LINE>}<NEW_LINE>if (HdotV == null) {<NEW_LINE>HdotV = new double[domainDimension()];<NEW_LINE>log.info("Setting HdotV.");<NEW_LINE>}<NEW_LINE>if (lastBatch == null) {<NEW_LINE>lastBatch = new int[batchSize];<NEW_LINE>log.info("Setting last batch");<NEW_LINE>}<NEW_LINE>// If we want to recalculate using the previous batch<NEW_LINE>if (recalculatePrevBatch && batchSize == lastBatch.length) {<NEW_LINE>thisBatch = lastBatch;<NEW_LINE>} else {<NEW_LINE>if (returnPreviousValues) {<NEW_LINE>returnPreviousValues = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If we dont know there are new values, and we havnt asked to recalculate then compare<NEW_LINE>// to avoid needing to recalculate<NEW_LINE>if (!hasNewVals && lastElement != curElement) {<NEW_LINE>if ((lastBatchSize == batchSize) && Arrays.equals(x, lastXBatch) && Arrays.equals(v, lastVBatch) && Arrays.equals(thisBatch, lastBatch)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getBatch(batchSize);<NEW_LINE>}<NEW_LINE>copy(lastXBatch, x);<NEW_LINE>if (lastBatch.length != batchSize) {<NEW_LINE>lastBatch = new int[batchSize];<NEW_LINE>}<NEW_LINE>System.arraycopy(thisBatch, 0, <MASK><NEW_LINE>if (v != null) {<NEW_LINE>copy(lastVBatch, v);<NEW_LINE>}<NEW_LINE>lastBatchSize = batchSize;<NEW_LINE>calculateStochastic(x, v, thisBatch);<NEW_LINE>// This is used to make the function evaluation equal the true function in expectation.<NEW_LINE>if (scaleUp) {<NEW_LINE>double ratio = ((double) this.dataDimension()) / ((double) batchSize);<NEW_LINE>for (int i = 0; i < x.length; i++) {<NEW_LINE>derivative[i] = derivative[i] * ratio;<NEW_LINE>}<NEW_LINE>value = ratio * value;<NEW_LINE>}<NEW_LINE>incrementBatch(batchSize);<NEW_LINE>lastElement = curElement;<NEW_LINE>} | lastBatch, 0, thisBatch.length); |
684,105 | public Type merge(Type other, Scene cm) {<NEW_LINE>if (UnknownType.v().equals(other) || this.equals(other)) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>if (!(other instanceof RefType)) {<NEW_LINE>throw new RuntimeException("illegal type merge: " + this + " and " + other);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// Return least common superclass<NEW_LINE>final ModuleScene cmMod = (ModuleScene) cm;<NEW_LINE>final SootClass javalangObject = cm.getObjectType().getSootClass();<NEW_LINE>LinkedList<SootClass> thisHierarchy = new LinkedList<>();<NEW_LINE>LinkedList<SootClass> otherHierarchy = new LinkedList<>();<NEW_LINE>// Build thisHierarchy<NEW_LINE>for (SootClass sc = cmMod.getSootClass(getClassName(), Optional.fromNullable(this.moduleName)); ; ) {<NEW_LINE>thisHierarchy.addFirst(sc);<NEW_LINE>if (sc == javalangObject) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>sc = sc.hasSuperclass() <MASK><NEW_LINE>}<NEW_LINE>// Build otherHierarchy<NEW_LINE>for (SootClass sc = cmMod.getSootClass(((RefType) other).getClassName(), Optional.fromNullable(this.moduleName)); ; ) {<NEW_LINE>otherHierarchy.addFirst(sc);<NEW_LINE>if (sc == javalangObject) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>sc = sc.hasSuperclass() ? sc.getSuperclass() : javalangObject;<NEW_LINE>}<NEW_LINE>// Find least common superclass<NEW_LINE>{<NEW_LINE>SootClass commonClass = null;<NEW_LINE>while (!otherHierarchy.isEmpty() && !thisHierarchy.isEmpty() && otherHierarchy.getFirst() == thisHierarchy.getFirst()) {<NEW_LINE>commonClass = otherHierarchy.removeFirst();<NEW_LINE>thisHierarchy.removeFirst();<NEW_LINE>}<NEW_LINE>if (commonClass == null) {<NEW_LINE>throw new RuntimeException("Could not find a common superclass for " + this + " and " + other);<NEW_LINE>}<NEW_LINE>return commonClass.getType();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ? sc.getSuperclass() : javalangObject; |
640,512 | public List<MethodBinding> checkAndAddSyntheticRecordOverrideMethods(MethodBinding[] methodBindings, List<MethodBinding> implicitMethods) {<NEW_LINE>if (!hasMethodWithNumArgs(TypeConstants.TOSTRING, 0)) {<NEW_LINE>MethodBinding m = addSyntheticRecordOverrideMethod(TypeConstants.TOSTRING, implicitMethods.size());<NEW_LINE>implicitMethods.add(m);<NEW_LINE>}<NEW_LINE>if (!hasMethodWithNumArgs(TypeConstants.HASHCODE, 0)) {<NEW_LINE>MethodBinding m = addSyntheticRecordOverrideMethod(TypeConstants.<MASK><NEW_LINE>implicitMethods.add(m);<NEW_LINE>}<NEW_LINE>boolean isEqualsPresent = Arrays.stream(methodBindings).filter(m -> CharOperation.equals(TypeConstants.EQUALS, m.selector)).anyMatch(m -> m.parameters != null && m.parameters.length == 1 && m.parameters[0].equals(this.scope.getJavaLangObject()));<NEW_LINE>if (!isEqualsPresent) {<NEW_LINE>MethodBinding m = addSyntheticRecordOverrideMethod(TypeConstants.EQUALS, implicitMethods.size());<NEW_LINE>implicitMethods.add(m);<NEW_LINE>}<NEW_LINE>if (this.isRecordDeclaration && getImplicitCanonicalConstructor() == -1) {<NEW_LINE>MethodBinding explicitCanon = null;<NEW_LINE>for (MethodBinding m : methodBindings) {<NEW_LINE>if (m.isCompactConstructor() || (m.tagBits & TagBits.IsCanonicalConstructor) != 0) {<NEW_LINE>explicitCanon = m;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (explicitCanon == null) {<NEW_LINE>implicitMethods.add(addSyntheticRecordCanonicalConstructor());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return implicitMethods;<NEW_LINE>} | HASHCODE, implicitMethods.size()); |
1,554,320 | private void handleFailingChecks(DomainRouterVO router, List<String> failingChecks) {<NEW_LINE>if (failingChecks == null || failingChecks.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String alertMessage = String.format("Health checks failed: %d failing checks on router %s / %s", failingChecks.size(), router.getName(), router.getUuid());<NEW_LINE>_alertMgr.sendAlert(AlertType.ALERT_TYPE_DOMAIN_ROUTER, router.getDataCenterId(), router.<MASK><NEW_LINE>s_logger.warn(alertMessage + ". Checking failed health checks to see if router needs recreate");<NEW_LINE>String checkFailsToRecreateVr = RouterHealthChecksFailuresToRecreateVr.valueIn(router.getDataCenterId());<NEW_LINE>StringBuilder failingChecksEvent = new StringBuilder();<NEW_LINE>boolean recreateRouter = false;<NEW_LINE>for (int i = 0; i < failingChecks.size(); i++) {<NEW_LINE>String failedCheck = failingChecks.get(i);<NEW_LINE>if (i == 0) {<NEW_LINE>failingChecksEvent.append("Router ").append(router.getName()).append(" / ").append(router.getUuid()).append(" has failing checks: ");<NEW_LINE>}<NEW_LINE>failingChecksEvent.append(failedCheck);<NEW_LINE>if (i < failingChecks.size() - 1) {<NEW_LINE>failingChecksEvent.append(", ");<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(checkFailsToRecreateVr) && checkFailsToRecreateVr.contains(failedCheck)) {<NEW_LINE>recreateRouter = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ActionEventUtils.onActionEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, Domain.ROOT_DOMAIN, EventTypes.EVENT_ROUTER_HEALTH_CHECKS, failingChecksEvent.toString());<NEW_LINE>if (recreateRouter) {<NEW_LINE>s_logger.warn("Health Check Alert: Found failing checks in " + RouterHealthChecksFailuresToRecreateVrCK + ", attempting recreating router.");<NEW_LINE>recreateRouter(router.getId());<NEW_LINE>}<NEW_LINE>} | getPodIdToDeployIn(), alertMessage, alertMessage); |
1,804,606 | protected StructureElement parseStructureElement(JsonObject object, boolean parsingMethods) throws CommonException {<NEW_LINE>String name = helper.getString(object, "name");<NEW_LINE>String posString = helper.getString(object, "pos");<NEW_LINE>SourceFileLocation elementSourceFileLoc = SourceFileLocation.parseSourceRange(posString, ':');<NEW_LINE>SourceRange nameSourceRange;<NEW_LINE>SourceRange sourceRange;<NEW_LINE>if (!isSourceElementLocation(elementSourceFileLoc.getFileLocation())) {<NEW_LINE>sourceRange = nameSourceRange = null;<NEW_LINE>} else {<NEW_LINE>sourceRange = nameSourceRange = elementSourceFileLoc.parseSourceRangeFrom1BasedIndex(sourceLinesInfo);<NEW_LINE>}<NEW_LINE>String type = helper.getOptionalString(object, "type");<NEW_LINE>String kindString = helper.getOptionalString(object, "kind");<NEW_LINE>StructureElementKind elementKind;<NEW_LINE>if (parsingMethods) {<NEW_LINE>elementKind = StructureElementKind.METHOD;<NEW_LINE>} else {<NEW_LINE>if (kindString == null) {<NEW_LINE>throw new CommonException("No `kind` field for element: " + name);<NEW_LINE>}<NEW_LINE>elementKind = parseKind(kindString, type);<NEW_LINE>}<NEW_LINE>if (elementKind == STRUCT || elementKind == StructureElementKind.INTERFACE) {<NEW_LINE>type = null;<NEW_LINE>} else if (elementKind == StructureElementKind.METHOD) {<NEW_LINE>if (name.startsWith("method ")) {<NEW_LINE>name = name.substring("method ".length());<NEW_LINE>if (name.startsWith("(")) {<NEW_LINE>String fullName = StringUtil.segmentAfterMatch(name, ")");<NEW_LINE>if (fullName != null) {<NEW_LINE>fullName = fullName.trim();<NEW_LINE>int idLength = parseIdentifierStart(fullName);<NEW_LINE>if (idLength > 0) {<NEW_LINE>name = fullName.substring(0, idLength);<NEW_LINE>type = "func" + fullName.substring(idLength);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (name.length() == 0) {<NEW_LINE>throw new CommonException("No name provided");<NEW_LINE>}<NEW_LINE>EProtection protection = EProtection.PUBLIC;<NEW_LINE>if (!parsingMethods && Character.isLowerCase(name.charAt(0))) {<NEW_LINE>protection = EProtection.PRIVATE;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>JsonArray methods = helper.getOptionalArray(object, "methods");<NEW_LINE>Indexable<StructureElement> children = parseElements(methods, true);<NEW_LINE>if (!isSourceElementLocation(elementSourceFileLoc.getFileLocation())) {<NEW_LINE>// Fix source range to children range.<NEW_LINE>if (children.size() == 0) {<NEW_LINE>// Shouldn't even happen<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>nameSourceRange = null;<NEW_LINE>int startPos = children.get(0).getSourceRange().getStartPos();<NEW_LINE>int endPos = children.get(children.size() - 1).getSourceRange().getEndPos();<NEW_LINE>sourceRange = SourceRange.srStartToEnd(startPos, endPos);<NEW_LINE>}<NEW_LINE>return new StructureElement(name, nameSourceRange, sourceRange, elementKind, elementAttributes, type, children);<NEW_LINE>} | ElementAttributes elementAttributes = new ElementAttributes(protection); |
500,469 | final QueryResult executeQuery(QueryRequest queryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(queryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<QueryRequest> request = null;<NEW_LINE>Response<QueryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new QueryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(queryRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "Query");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<QueryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new QueryResultJsonUnmarshaller());<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.SERVICE_ID, "kendra"); |
1,377,869 | private static double scaleAndRegularize(Map<String, SimpleMatrix> derivatives, Map<String, SimpleMatrix> currentMatrices, double scale, double regCost, boolean activeMatricesOnly, boolean dropBiasColumn) {<NEW_LINE>// the regularization cost<NEW_LINE>double cost = 0.0;<NEW_LINE>for (Map.Entry<String, SimpleMatrix> entry : currentMatrices.entrySet()) {<NEW_LINE>SimpleMatrix D = derivatives.get(entry.getKey());<NEW_LINE>if (activeMatricesOnly && D == null) {<NEW_LINE>// Fill in an emptpy matrix so the length of theta can match.<NEW_LINE>// TODO: might want to allow for sparse parameter vectors<NEW_LINE>derivatives.put(entry.getKey(), new SimpleMatrix(entry.getValue().numRows(), entry.getValue().numCols()));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>SimpleMatrix regMatrix = entry.getValue();<NEW_LINE>if (dropBiasColumn) {<NEW_LINE>regMatrix = new SimpleMatrix(regMatrix);<NEW_LINE>regMatrix.insertIntoThis(0, regMatrix.numCols() - 1, new SimpleMatrix(regMatrix.numRows(), 1));<NEW_LINE>}<NEW_LINE>D = D.scale(scale).plus(regMatrix.scale(regCost));<NEW_LINE>derivatives.put(<MASK><NEW_LINE>cost += regMatrix.elementMult(regMatrix).elementSum() * regCost / 2.0;<NEW_LINE>}<NEW_LINE>return cost;<NEW_LINE>} | entry.getKey(), D); |
1,229,172 | public void marshall(Ec2InstanceAttributes ec2InstanceAttributes, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (ec2InstanceAttributes == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(ec2InstanceAttributes.getEc2KeyName(), EC2KEYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(ec2InstanceAttributes.getEc2SubnetId(), EC2SUBNETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(ec2InstanceAttributes.getRequestedEc2SubnetIds(), REQUESTEDEC2SUBNETIDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(ec2InstanceAttributes.getEc2AvailabilityZone(), EC2AVAILABILITYZONE_BINDING);<NEW_LINE>protocolMarshaller.marshall(ec2InstanceAttributes.getRequestedEc2AvailabilityZones(), REQUESTEDEC2AVAILABILITYZONES_BINDING);<NEW_LINE>protocolMarshaller.marshall(ec2InstanceAttributes.getIamInstanceProfile(), IAMINSTANCEPROFILE_BINDING);<NEW_LINE>protocolMarshaller.marshall(ec2InstanceAttributes.getEmrManagedMasterSecurityGroup(), EMRMANAGEDMASTERSECURITYGROUP_BINDING);<NEW_LINE>protocolMarshaller.marshall(ec2InstanceAttributes.getEmrManagedSlaveSecurityGroup(), EMRMANAGEDSLAVESECURITYGROUP_BINDING);<NEW_LINE>protocolMarshaller.marshall(ec2InstanceAttributes.getServiceAccessSecurityGroup(), SERVICEACCESSSECURITYGROUP_BINDING);<NEW_LINE>protocolMarshaller.marshall(ec2InstanceAttributes.getAdditionalMasterSecurityGroups(), ADDITIONALMASTERSECURITYGROUPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(ec2InstanceAttributes.getAdditionalSlaveSecurityGroups(), ADDITIONALSLAVESECURITYGROUPS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
1,249,733 | private void checkForPrice(final I_C_OLCand olCand, final ProductId packingMaterialProductId) {<NEW_LINE>final PricingSystemId pricingSystemId = PricingSystemId.ofRepoIdOrNull(olCand.getM_PricingSystem_ID());<NEW_LINE>final IOLCandEffectiveValuesBL olCandEffectiveValuesBL = Services.get(IOLCandEffectiveValuesBL.class);<NEW_LINE>final LocalDate datePromisedEffective = TimeUtil.asLocalDate(olCandEffectiveValuesBL.getDatePromised_Effective(olCand));<NEW_LINE>final BPartnerLocationAndCaptureId billBPLocationId = olCandEffectiveValuesBL.getBillLocationAndCaptureEffectiveId(olCand);<NEW_LINE>final PriceListId plId = Services.get(IPriceListDAO.class).retrievePriceListIdByPricingSyst(pricingSystemId, billBPLocationId, SOTrx.SALES);<NEW_LINE>if (plId == null) {<NEW_LINE>throw new AdempiereException("@PriceList@ @NotFound@: @M_PricingSystem@ " + pricingSystemId + ", @Bill_Location@ " + billBPLocationId);<NEW_LINE>}<NEW_LINE>final IPricingBL pricingBL = <MASK><NEW_LINE>final IEditablePricingContext pricingCtx = pricingBL.createPricingContext();<NEW_LINE>pricingCtx.setBPartnerId(BPartnerId.ofRepoIdOrNull(olCand.getBill_BPartner_ID()));<NEW_LINE>pricingCtx.setSOTrx(SOTrx.SALES);<NEW_LINE>// we don't care for the actual quantity we just want to verify that there is a price<NEW_LINE>pricingCtx.setQty(BigDecimal.ONE);<NEW_LINE>pricingCtx.setPricingSystemId(pricingSystemId);<NEW_LINE>pricingCtx.setPriceListId(plId);<NEW_LINE>pricingCtx.setProductId(packingMaterialProductId);<NEW_LINE>pricingCtx.setPriceDate(datePromisedEffective);<NEW_LINE>pricingCtx.setCurrencyId(CurrencyId.ofRepoId(olCand.getC_Currency_ID()));<NEW_LINE>pricingCtx.setFailIfNotCalculated();<NEW_LINE>Services.get(IPricingBL.class).calculatePrice(pricingCtx);<NEW_LINE>} | Services.get(IPricingBL.class); |
1,521,849 | public ClassReader readClass(InputStream stream, String name) throws IOException {<NEW_LINE>VarDataInput input = new VarDataInput(stream);<NEW_LINE>CachedClassReader cls = new CachedClassReader();<NEW_LINE>cls.name = name;<NEW_LINE>cls.level = accessLevels[input.readUnsigned()];<NEW_LINE>cls.modifiers = unpackModifiers(input.readUnsigned());<NEW_LINE>int parentIndex = input.readUnsigned();<NEW_LINE>cls.parent = parentIndex > 0 ? referenceCache.getCached(symbolTable.at(parentIndex - 1)) : null;<NEW_LINE>int ownerIndex = input.readUnsigned();<NEW_LINE>cls.owner = ownerIndex > 0 ? referenceCache.getCached(symbolTable.at<MASK><NEW_LINE>int declaringClassIndex = input.readUnsigned();<NEW_LINE>cls.declaringClass = declaringClassIndex > 0 ? referenceCache.getCached(symbolTable.at(declaringClassIndex - 1)) : null;<NEW_LINE>int simpleNameIndex = input.readUnsigned();<NEW_LINE>cls.simpleName = simpleNameIndex > 0 ? referenceCache.getCached(symbolTable.at(simpleNameIndex - 1)) : null;<NEW_LINE>int ifaceCount = input.readUnsigned();<NEW_LINE>Set<String> interfaces = new LinkedHashSet<>();<NEW_LINE>for (int i = 0; i < ifaceCount; ++i) {<NEW_LINE>interfaces.add(referenceCache.getCached(symbolTable.at(input.readUnsigned())));<NEW_LINE>}<NEW_LINE>cls.interfaces = Collections.unmodifiableSet(interfaces);<NEW_LINE>cls.annotations = annotationIO.readAnnotations(input);<NEW_LINE>Map<String, CachedField> fields = new LinkedHashMap<>();<NEW_LINE>int fieldCount = input.readUnsigned();<NEW_LINE>for (int i = 0; i < fieldCount; ++i) {<NEW_LINE>CachedField field = readField(name, input);<NEW_LINE>fields.put(field.name, field);<NEW_LINE>}<NEW_LINE>cls.fields = fields;<NEW_LINE>Map<MethodDescriptor, CachedMethod> methods = new LinkedHashMap<>();<NEW_LINE>int methodCount = input.readUnsigned();<NEW_LINE>for (int i = 0; i < methodCount; ++i) {<NEW_LINE>CachedMethod method = readMethod(cls.name, input);<NEW_LINE>methods.put(method.reference.getDescriptor(), method);<NEW_LINE>}<NEW_LINE>cls.methods = methods;<NEW_LINE>return cls;<NEW_LINE>} | (ownerIndex - 1)) : null; |
1,380,774 | public byte[] marshall(CreateUdfApplicationRequest request) {<NEW_LINE>StringBuffer xmlBody = new StringBuffer();<NEW_LINE>UdfApplicationConfiguration config = request.getUdfApplicationConfiguration();<NEW_LINE>xmlBody.append("<CreateUDFApplicationConfiguration>");<NEW_LINE>xmlBody.append("<ImageVersion>" + config.getImageVersion() + "</ImageVersion>");<NEW_LINE>xmlBody.append("<InstanceNum>" + config.getInstanceNum() + "</InstanceNum>");<NEW_LINE>xmlBody.append("<Flavor>");<NEW_LINE>xmlBody.append("<InstanceType>" + config.getFlavor().getInstanceType() + "</InstanceType>");<NEW_LINE>xmlBody.append("</Flavor>");<NEW_LINE>xmlBody.append("</CreateUDFApplicationConfiguration>");<NEW_LINE>byte[] rawData = null;<NEW_LINE>try {<NEW_LINE>rawData = xmlBody.toString().getBytes(DEFAULT_CHARSET_NAME);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new ClientException("Unsupported encoding " + <MASK><NEW_LINE>}<NEW_LINE>return rawData;<NEW_LINE>} | e.getMessage(), e); |
1,675,753 | private static ServerGroup parseStatus(String json) {<NEW_LINE>Slime slime = SlimeUtils.jsonToSlime(json);<NEW_LINE>Cursor root = slime.get();<NEW_LINE>List<ServerGroup.Server> servers = new ArrayList<>();<NEW_LINE>Cursor serversObject = root.field("servers");<NEW_LINE>Cursor <MASK><NEW_LINE>// TODO(mpolden): Remove after 2022-03-01<NEW_LINE>Cursor serverArray = serversObject.field("server");<NEW_LINE>Cursor array = streamArray.valid() ? streamArray : serverArray;<NEW_LINE>array.traverse((ArrayTraverser) (idx, inspector) -> {<NEW_LINE>String upstreamName = inspector.field("upstream").asString();<NEW_LINE>String hostPort = inspector.field("name").asString();<NEW_LINE>boolean up = "up".equals(inspector.field("status").asString());<NEW_LINE>servers.add(new ServerGroup.Server(upstreamName, hostPort, up));<NEW_LINE>});<NEW_LINE>return new ServerGroup(servers);<NEW_LINE>} | streamArray = serversObject.field("stream"); |
1,366,430 | public static void appendStackTraceStats(final File rootPath, final StringBuilder buffer, final List<Map<Thread, StackTraceElement[]>> stackTraces, final boolean plain) {<NEW_LINE>// collect single dumps<NEW_LINE>final Map<String, Integer> dumps = new HashMap<String, Integer>();<NEW_LINE>ThreadDump x;<NEW_LINE>for (final Map<Thread, StackTraceElement[]> trace : stackTraces) {<NEW_LINE>x = new ThreadDump(rootPath, trace, plain, Thread.State.RUNNABLE);<NEW_LINE>for (final Map.Entry<StackTrace, List<String>> e : x.entrySet()) {<NEW_LINE>if (multiDumpFilterPattern.matcher(e.getKey().text).matches())<NEW_LINE>continue;<NEW_LINE>Integer c = dumps.get(e.getKey().text);<NEW_LINE>if (c == null)<NEW_LINE>dumps.put(e.getKey().text, Integer.valueOf(1));<NEW_LINE>else {<NEW_LINE>c = Integer.valueOf(c.intValue() + 1);<NEW_LINE>dumps.put(e.getKey().text, c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// write dumps<NEW_LINE>while (!dumps.isEmpty()) {<NEW_LINE>final Map.Entry<String, Integer> e = removeMax(dumps);<NEW_LINE>bufferappend(buffer, plain, "Occurrences: " + e.getValue());<NEW_LINE>bufferappend(buffer, plain, e.getKey());<NEW_LINE>bufferappend(buffer, plain, " ");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | bufferappend(buffer, plain, " "); |
991,024 | private void firePostInvocation(HttpServletResponse httpResponse, Packet pipeResponse, Packet pipeRequest, JAXWSEndpointImpl endpointTracer, SOAPMessageContextImpl soapMessageContext) {<NEW_LINE>if (seiModel instanceof SOAPSEIModel) {<NEW_LINE>SOAPSEIModel soapSEIModel = (SOAPSEIModel) seiModel;<NEW_LINE>Globals.get(MonitorFilter.class).filterResponse(pipeRequest, pipeResponse, new MonitorContextImpl(soapSEIModel.getDatabinding().deserializeRequest(pipeRequest), soapSEIModel, wsdlModel, ownerEndpoint, endpoint));<NEW_LINE>}<NEW_LINE>// Make the response packet available in the MessageContext<NEW_LINE>soapMessageContext.setPacket(pipeResponse);<NEW_LINE>try {<NEW_LINE>// Invoke processRequest on global and local listeners<NEW_LINE>endpointTracer.processResponse(soapMessageContext);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// temporary - need to send back SOAP fault message<NEW_LINE>}<NEW_LINE>String messageTraceId = (String) soapMessageContext.get(MESSAGE_ID);<NEW_LINE>if (messageTraceId != null) {<NEW_LINE>wsMonitor.postProcessResponse(<MASK><NEW_LINE>}<NEW_LINE>} | messageTraceId, new HttpResponseInfoImpl(httpResponse)); |
1,789,506 | public RestartRequirement onApply(UserPrefs rPrefs) {<NEW_LINE>RestartRequirement restartRequirement = super.onApply(rPrefs);<NEW_LINE>if (dirty_) {<NEW_LINE>JsArrayString panes = JsArrayString<MASK><NEW_LINE>panes.push(leftTop_.getValue(leftTop_.getSelectedIndex()));<NEW_LINE>panes.push(leftBottom_.getValue(leftBottom_.getSelectedIndex()));<NEW_LINE>panes.push(rightTop_.getValue(rightTop_.getSelectedIndex()));<NEW_LINE>panes.push(rightBottom_.getValue(rightBottom_.getSelectedIndex()));<NEW_LINE>JsArrayString tabSet1 = JsArrayString.createArray().cast();<NEW_LINE>for (String tab : tabSet1ModuleList_.getValue()) tabSet1.push(tab);<NEW_LINE>JsArrayString tabSet2 = JsArrayString.createArray().cast();<NEW_LINE>for (String tab : tabSet2ModuleList_.getValue()) tabSet2.push(tab);<NEW_LINE>JsArrayString hiddenTabSet = JsArrayString.createArray().cast();<NEW_LINE>for (String tab : hiddenTabSetModuleList_.getValue()) hiddenTabSet.push(tab);<NEW_LINE>// Determine implicit preference for console top/bottom location<NEW_LINE>// This needs to be saved so that when the user executes the<NEW_LINE>// Console on Left/Right commands we know whether to position<NEW_LINE>// the Console on the Top or Bottom<NEW_LINE>PaneConfig prevConfig = userPrefs_.panes().getGlobalValue().cast();<NEW_LINE>boolean consoleLeftOnTop = prevConfig.getConsoleLeftOnTop();<NEW_LINE>boolean consoleRightOnTop = prevConfig.getConsoleRightOnTop();<NEW_LINE>final String kConsole = "Console";<NEW_LINE>if (panes.get(0).equals(kConsole))<NEW_LINE>consoleLeftOnTop = true;<NEW_LINE>else if (panes.get(1).equals(kConsole))<NEW_LINE>consoleLeftOnTop = false;<NEW_LINE>else if (panes.get(2).equals(kConsole))<NEW_LINE>consoleRightOnTop = true;<NEW_LINE>else if (panes.get(3).equals(kConsole))<NEW_LINE>consoleRightOnTop = false;<NEW_LINE>if (displayColumnCount_ != additionalColumnCount_)<NEW_LINE>additionalColumnCount_ = paneManager_.syncAdditionalColumnCount(displayColumnCount_, true);<NEW_LINE>userPrefs_.panes().setGlobalValue(PaneConfig.create(panes, tabSet1, tabSet2, hiddenTabSet, consoleLeftOnTop, consoleRightOnTop, additionalColumnCount_));<NEW_LINE>dirty_ = false;<NEW_LINE>}<NEW_LINE>return restartRequirement;<NEW_LINE>} | .createArray().cast(); |
476,055 | public static ListRecycleBinJobsResponse unmarshall(ListRecycleBinJobsResponse listRecycleBinJobsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRecycleBinJobsResponse.setRequestId(_ctx.stringValue("ListRecycleBinJobsResponse.RequestId"));<NEW_LINE>listRecycleBinJobsResponse.setTotalCount(_ctx.longValue("ListRecycleBinJobsResponse.TotalCount"));<NEW_LINE>listRecycleBinJobsResponse.setPageNumber(_ctx.longValue("ListRecycleBinJobsResponse.PageNumber"));<NEW_LINE>listRecycleBinJobsResponse.setPageSize(_ctx.longValue("ListRecycleBinJobsResponse.PageSize"));<NEW_LINE>List<Job> jobs = new ArrayList<Job>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRecycleBinJobsResponse.Jobs.Length"); i++) {<NEW_LINE>Job job = new Job();<NEW_LINE>job.setId(_ctx.stringValue("ListRecycleBinJobsResponse.Jobs[" + i + "].Id"));<NEW_LINE>job.setType(_ctx.stringValue("ListRecycleBinJobsResponse.Jobs[" + i + "].Type"));<NEW_LINE>job.setFileId(_ctx.stringValue("ListRecycleBinJobsResponse.Jobs[" + i + "].FileId"));<NEW_LINE>job.setStatus(_ctx.stringValue<MASK><NEW_LINE>job.setErrorCode(_ctx.stringValue("ListRecycleBinJobsResponse.Jobs[" + i + "].ErrorCode"));<NEW_LINE>job.setProgress(_ctx.stringValue("ListRecycleBinJobsResponse.Jobs[" + i + "].Progress"));<NEW_LINE>job.setCreateTime(_ctx.stringValue("ListRecycleBinJobsResponse.Jobs[" + i + "].CreateTime"));<NEW_LINE>job.setFileName(_ctx.stringValue("ListRecycleBinJobsResponse.Jobs[" + i + "].FileName"));<NEW_LINE>job.setErrorMessage(_ctx.stringValue("ListRecycleBinJobsResponse.Jobs[" + i + "].ErrorMessage"));<NEW_LINE>jobs.add(job);<NEW_LINE>}<NEW_LINE>listRecycleBinJobsResponse.setJobs(jobs);<NEW_LINE>return listRecycleBinJobsResponse;<NEW_LINE>} | ("ListRecycleBinJobsResponse.Jobs[" + i + "].Status")); |
1,796,792 | public static DescribeDcdnDomainHttpCodeDataResponse unmarshall(DescribeDcdnDomainHttpCodeDataResponse describeDcdnDomainHttpCodeDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDcdnDomainHttpCodeDataResponse.setRequestId(_ctx.stringValue("DescribeDcdnDomainHttpCodeDataResponse.RequestId"));<NEW_LINE>describeDcdnDomainHttpCodeDataResponse.setDomainName(_ctx.stringValue("DescribeDcdnDomainHttpCodeDataResponse.DomainName"));<NEW_LINE>describeDcdnDomainHttpCodeDataResponse.setStartTime(_ctx.stringValue("DescribeDcdnDomainHttpCodeDataResponse.StartTime"));<NEW_LINE>describeDcdnDomainHttpCodeDataResponse.setEndTime(_ctx.stringValue("DescribeDcdnDomainHttpCodeDataResponse.EndTime"));<NEW_LINE>describeDcdnDomainHttpCodeDataResponse.setDataInterval(_ctx.stringValue("DescribeDcdnDomainHttpCodeDataResponse.DataInterval"));<NEW_LINE>List<DataModule> dataPerInterval = new ArrayList<DataModule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDcdnDomainHttpCodeDataResponse.DataPerInterval.Length"); i++) {<NEW_LINE>DataModule dataModule = new DataModule();<NEW_LINE>dataModule.setTimeStamp(_ctx.stringValue("DescribeDcdnDomainHttpCodeDataResponse.DataPerInterval[" + i + "].TimeStamp"));<NEW_LINE>List<HttpCodeDataModule> httpCodeDataPerInterval = new ArrayList<HttpCodeDataModule>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDcdnDomainHttpCodeDataResponse.DataPerInterval[" + i + "].HttpCodeDataPerInterval.Length"); j++) {<NEW_LINE>HttpCodeDataModule httpCodeDataModule = new HttpCodeDataModule();<NEW_LINE>httpCodeDataModule.setCode(_ctx.integerValue("DescribeDcdnDomainHttpCodeDataResponse.DataPerInterval[" + i <MASK><NEW_LINE>httpCodeDataModule.setProportion(_ctx.floatValue("DescribeDcdnDomainHttpCodeDataResponse.DataPerInterval[" + i + "].HttpCodeDataPerInterval[" + j + "].Proportion"));<NEW_LINE>httpCodeDataModule.setCount(_ctx.floatValue("DescribeDcdnDomainHttpCodeDataResponse.DataPerInterval[" + i + "].HttpCodeDataPerInterval[" + j + "].Count"));<NEW_LINE>httpCodeDataPerInterval.add(httpCodeDataModule);<NEW_LINE>}<NEW_LINE>dataModule.setHttpCodeDataPerInterval(httpCodeDataPerInterval);<NEW_LINE>dataPerInterval.add(dataModule);<NEW_LINE>}<NEW_LINE>describeDcdnDomainHttpCodeDataResponse.setDataPerInterval(dataPerInterval);<NEW_LINE>return describeDcdnDomainHttpCodeDataResponse;<NEW_LINE>} | + "].HttpCodeDataPerInterval[" + j + "].Code")); |
1,003,483 | private static String readLineOptimized(ByteBuf undecodedChunk, Charset charset) {<NEW_LINE>int readerIndex = undecodedChunk.readerIndex();<NEW_LINE>ByteBuf line = null;<NEW_LINE>try {<NEW_LINE>if (undecodedChunk.isReadable()) {<NEW_LINE>int posLfOrCrLf = HttpPostBodyUtil.findLineBreak(<MASK><NEW_LINE>if (posLfOrCrLf <= 0) {<NEW_LINE>throw new NotEnoughDataDecoderException();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>line = undecodedChunk.alloc().heapBuffer(posLfOrCrLf);<NEW_LINE>line.writeBytes(undecodedChunk, posLfOrCrLf);<NEW_LINE>byte nextByte = undecodedChunk.readByte();<NEW_LINE>if (nextByte == HttpConstants.CR) {<NEW_LINE>// force read next byte since LF is the following one<NEW_LINE>undecodedChunk.readByte();<NEW_LINE>}<NEW_LINE>return line.toString(charset);<NEW_LINE>} finally {<NEW_LINE>line.release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IndexOutOfBoundsException e) {<NEW_LINE>undecodedChunk.readerIndex(readerIndex);<NEW_LINE>throw new NotEnoughDataDecoderException(e);<NEW_LINE>}<NEW_LINE>undecodedChunk.readerIndex(readerIndex);<NEW_LINE>throw new NotEnoughDataDecoderException();<NEW_LINE>} | undecodedChunk, undecodedChunk.readerIndex()); |
1,233,152 | public void writeIndicesOptions(StreamOutput out) throws IOException {<NEW_LINE>EnumSet<Option> options = this.options;<NEW_LINE>// never write this out to a pre7.0 version<NEW_LINE>if (out.getVersion().before(Version.V_6_6_0) && options.contains(Option.IGNORE_THROTTLED)) {<NEW_LINE><MASK><NEW_LINE>options.remove(Option.IGNORE_THROTTLED);<NEW_LINE>}<NEW_LINE>if (out.getVersion().onOrAfter(Version.V_6_4_0)) {<NEW_LINE>out.writeEnumSet(options);<NEW_LINE>out.writeEnumSet(expandWildcards);<NEW_LINE>} else {<NEW_LINE>if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha2)) {<NEW_LINE>out.write(IndicesOptions.toByte(this));<NEW_LINE>} else {<NEW_LINE>// if we are talking to a node that doesn't support the newly added flag (ignoreAliases)<NEW_LINE>// flip to 0 all the bits starting from the 7th<NEW_LINE>out.write(IndicesOptions.toByte(this) & 0x3f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | options = EnumSet.copyOf(options); |
37,386 | public static List<LineParametric2D_F32> pruneSimilarLines(List<LineParametric2D_F32> lines, float[] intensity, float toleranceAngle, float toleranceDist, int imgWidth, int imgHeight) {<NEW_LINE>int[] indexSort = new int[intensity.length];<NEW_LINE>QuickSort_F32 sort = new QuickSort_F32();<NEW_LINE>sort.sort(intensity, 0, lines.size(), indexSort);<NEW_LINE>float[] theta = new float[lines.size()];<NEW_LINE>List<LineSegment2D_F32> segments = new ArrayList<>(lines.size());<NEW_LINE>for (int i = 0; i < lines.size(); i++) {<NEW_LINE>LineParametric2D_F32 l = lines.get(i);<NEW_LINE>theta[i] = UtilAngle.atanSafe(l.getSlopeY(), l.getSlopeX());<NEW_LINE>segments.add(convert(l, imgWidth, imgHeight));<NEW_LINE>}<NEW_LINE>for (int i = segments.size() - 1; i >= 0; i--) {<NEW_LINE>LineSegment2D_F32 a = segments.get(indexSort[i]);<NEW_LINE>if (a == null)<NEW_LINE>continue;<NEW_LINE>for (int j = i - 1; j >= 0; j--) {<NEW_LINE>LineSegment2D_F32 b = segments.get(indexSort[j]);<NEW_LINE>if (b == null)<NEW_LINE>continue;<NEW_LINE>if (UtilAngle.distHalf(theta[indexSort[i]], theta[indexSort[j]]) > toleranceAngle)<NEW_LINE>continue;<NEW_LINE>Point2D_F32 p = Intersection2D_F32.<MASK><NEW_LINE>if (p != null && p.x >= 0 && p.y >= 0 && p.x < imgWidth && p.y < imgHeight) {<NEW_LINE>segments.set(indexSort[j], null);<NEW_LINE>} else {<NEW_LINE>float distA = Distance2D_F32.distance(a, b.a);<NEW_LINE>float distB = Distance2D_F32.distance(a, b.b);<NEW_LINE>if (distA <= toleranceDist || distB < toleranceDist) {<NEW_LINE>segments.set(indexSort[j], null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<LineParametric2D_F32> ret = new ArrayList<>();<NEW_LINE>for (int i = 0; i < segments.size(); i++) {<NEW_LINE>if (segments.get(i) != null) {<NEW_LINE>ret.add(lines.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | intersection(a, b, null); |
1,763,319 | private OperatorNode<ExpressionOperator> readConjOrOp(ExpressionOperator op, Logical_OR_expressionContext node, Scope scope) {<NEW_LINE>List<Logical_AND_expressionContext> andExpressionList = node.logical_AND_expression();<NEW_LINE>List<OperatorNode<ExpressionOperator>> arguments = Lists.newArrayListWithExpectedSize(andExpressionList.size());<NEW_LINE>for (Logical_AND_expressionContext child : andExpressionList) {<NEW_LINE>List<Equality_expressionContext<MASK><NEW_LINE>if (equalities.size() == 1) {<NEW_LINE>arguments.add(convertExpr(equalities.get(0), scope));<NEW_LINE>} else {<NEW_LINE>List<OperatorNode<ExpressionOperator>> andArguments = Lists.newArrayListWithExpectedSize(equalities.size());<NEW_LINE>for (Equality_expressionContext subTreeChild : equalities) {<NEW_LINE>andArguments.add(convertExpr(subTreeChild, scope));<NEW_LINE>}<NEW_LINE>arguments.add(OperatorNode.create(ExpressionOperator.AND, andArguments));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return OperatorNode.create(op, arguments);<NEW_LINE>} | > equalities = child.equality_expression(); |
1,154,856 | public static SubscriptionInfo fromSubscription(Subscription subscription) {<NEW_LINE>SubscriptionInfo subscriptionInfo = new SubscriptionInfo();<NEW_LINE>subscriptionInfo.setInterfaceType(subscription.getInterfaceType());<NEW_LINE>subscriptionInfo.setNotifiedEventCount(subscription.getNotifiedEventCount().toString());<NEW_LINE>subscriptionInfo.setNotifyingEventCount(subscription.getNotifyingEventCount().toString());<NEW_LINE>subscriptionInfo.setNotifyTimeStamp(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(subscription.getNotifyTimeStamp()));<NEW_LINE>subscriptionInfo.setRemoteIp(subscription.getRemoteIp());<NEW_LINE>subscriptionInfo.setCreateTimeStamp(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(subscription.getCreateTimeStamp()));<NEW_LINE>subscriptionInfo.setGroupId(subscription.getGroupId());<NEW_LINE>// Arrays.toString will append plus "[]"<NEW_LINE>if (subscription.getTopics().length == 1) {<NEW_LINE>subscriptionInfo.setTopicName(subscription<MASK><NEW_LINE>} else {<NEW_LINE>subscriptionInfo.setTopicName(Arrays.toString(subscription.getTopics()));<NEW_LINE>}<NEW_LINE>subscriptionInfo.setSubscribeId(subscription.getUuid());<NEW_LINE>return subscriptionInfo;<NEW_LINE>} | .getTopics()[0]); |
1,558,259 | public String toXML(DataDictionary dataDictionary, boolean indent) {<NEW_LINE>try {<NEW_LINE>final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();<NEW_LINE>final Document document = factory.newDocumentBuilder().newDocument();<NEW_LINE>final Element message = document.createElement("message");<NEW_LINE>document.appendChild(message);<NEW_LINE>toXMLFields(message, "header", header, dataDictionary);<NEW_LINE>toXMLFields(message, "body", this, dataDictionary);<NEW_LINE>toXMLFields(message, "trailer", trailer, dataDictionary);<NEW_LINE>final DOMSource domSource = new DOMSource(document);<NEW_LINE>final ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>final StreamResult streamResult = new StreamResult(out);<NEW_LINE>final TransformerFactory tf = TransformerFactory.newInstance();<NEW_LINE>final Transformer serializer = tf.newTransformer();<NEW_LINE>serializer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");<NEW_LINE>if (indent) {<NEW_LINE>serializer.setOutputProperty(OutputKeys.INDENT, "yes");<NEW_LINE>serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");<NEW_LINE>} else {<NEW_LINE>serializer.<MASK><NEW_LINE>}<NEW_LINE>serializer.transform(domSource, streamResult);<NEW_LINE>return out.toString();<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | setOutputProperty(OutputKeys.INDENT, "no"); |
1,413,221 | private AstNode createNumericLiteral(int tt, boolean isProperty) {<NEW_LINE>String s = ts.getString();<NEW_LINE>if (this.inUseStrictDirective && ts.isNumericOldOctal()) {<NEW_LINE>if (compilerEnv.getLanguageVersion() >= Context.VERSION_ES6 || !isProperty) {<NEW_LINE>if (tt == Token.BIGINT) {<NEW_LINE>reportError("msg.no.old.octal.bigint");<NEW_LINE>} else {<NEW_LINE>reportError("msg.no.old.octal.strict");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (compilerEnv.getLanguageVersion() >= Context.VERSION_ES6 || !isProperty) {<NEW_LINE>if (ts.isNumericBinary()) {<NEW_LINE>s = "0b" + s;<NEW_LINE>} else if (ts.isNumericOldOctal()) {<NEW_LINE>s = "0" + s;<NEW_LINE>} else if (ts.isNumericOctal()) {<NEW_LINE>s = "0o" + s;<NEW_LINE>} else if (ts.isNumericHex()) {<NEW_LINE>s = "0x" + s;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tt == Token.BIGINT) {<NEW_LINE>return new BigIntLiteral(ts.tokenBeg, s + <MASK><NEW_LINE>} else {<NEW_LINE>return new NumberLiteral(ts.tokenBeg, s, ts.getNumber());<NEW_LINE>}<NEW_LINE>} | "n", ts.getBigInt()); |
219,250 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// authentication with an API key or named user is required to access basemaps and other<NEW_LINE>// location services<NEW_LINE>ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);<NEW_LINE>// get plane model from assets<NEW_LINE>copyFileFromAssetsToCache(getString(R.string.bristol_dae));<NEW_LINE>copyFileFromAssetsToCache(getString(R.string.bristol_png));<NEW_LINE>copyFileFromAssetsToCache(getString(R.string.logo_jpg));<NEW_LINE>mSceneView = findViewById(R.id.sceneView);<NEW_LINE>// create a scene and add a basemap to it<NEW_LINE>ArcGISScene scene = new ArcGISScene(BasemapStyle.ARCGIS_IMAGERY);<NEW_LINE>mSceneView.setScene(scene);<NEW_LINE>// add base surface for elevation data<NEW_LINE>Surface surface = new Surface();<NEW_LINE>surface.getElevationSources().add(new ArcGISTiledElevationSource(getString(R.string.world_elevation_service_3D)));<NEW_LINE>scene.setBaseSurface(surface);<NEW_LINE>// add a graphics overlay<NEW_LINE>GraphicsOverlay graphicsOverlay = new GraphicsOverlay();<NEW_LINE>graphicsOverlay.getSceneProperties().setSurfacePlacement(LayerSceneProperties.SurfacePlacement.RELATIVE);<NEW_LINE>mSceneView.getGraphicsOverlays().add(graphicsOverlay);<NEW_LINE>// set up the different symbols<NEW_LINE>SimpleMarkerSymbol circleSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, Color.RED, 10);<NEW_LINE>SimpleMarkerSceneSymbol coneSymbol = SimpleMarkerSceneSymbol.createCone(Color.RED, 3, 10);<NEW_LINE>coneSymbol.setPitch(-90);<NEW_LINE>coneSymbol.setAnchorPosition(SceneSymbol.AnchorPosition.CENTER);<NEW_LINE>String modelURI = getCacheDir() + File.separator + getString(R.string.bristol_dae);<NEW_LINE>ModelSceneSymbol modelSymbol = new ModelSceneSymbol(modelURI, 1.0);<NEW_LINE>modelSymbol.loadAsync();<NEW_LINE>// set up the distance composite symbol<NEW_LINE>DistanceCompositeSceneSymbol compositeSymbol = new DistanceCompositeSceneSymbol();<NEW_LINE>compositeSymbol.getRangeCollection().add(new DistanceCompositeSceneSymbol.Range(modelSymbol, 0, 100));<NEW_LINE>compositeSymbol.getRangeCollection().add(new DistanceCompositeSceneSymbol.Range<MASK><NEW_LINE>compositeSymbol.getRangeCollection().add(new DistanceCompositeSceneSymbol.Range(circleSymbol, 500, 0));<NEW_LINE>// create graphic<NEW_LINE>Point aircraftPosition = new Point(-2.708471, 56.096575, 5000, SpatialReferences.getWgs84());<NEW_LINE>Graphic aircraftGraphic = new Graphic(aircraftPosition, compositeSymbol);<NEW_LINE>// add graphic to graphics overlay<NEW_LINE>graphicsOverlay.getGraphics().add(aircraftGraphic);<NEW_LINE>// add an orbit camera controller to lock the camera to the graphic<NEW_LINE>OrbitGeoElementCameraController cameraController = new OrbitGeoElementCameraController(aircraftGraphic, 20);<NEW_LINE>cameraController.setCameraPitchOffset(80);<NEW_LINE>cameraController.setCameraHeadingOffset(-30);<NEW_LINE>mSceneView.setCameraController(cameraController);<NEW_LINE>} | (coneSymbol, 100, 500)); |
604,633 | public Request<ListTemplatesRequest> marshall(ListTemplatesRequest listTemplatesRequest) {<NEW_LINE>if (listTemplatesRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListTemplatesRequest)");<NEW_LINE>}<NEW_LINE>Request<ListTemplatesRequest> request = new DefaultRequest<ListTemplatesRequest>(listTemplatesRequest, "AmazonSimpleEmailService");<NEW_LINE>request.addParameter("Action", "ListTemplates");<NEW_LINE>request.addParameter("Version", "2010-12-01");<NEW_LINE>String prefix;<NEW_LINE>if (listTemplatesRequest.getNextToken() != null) {<NEW_LINE>prefix = "NextToken";<NEW_LINE>String nextToken = listTemplatesRequest.getNextToken();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(nextToken));<NEW_LINE>}<NEW_LINE>if (listTemplatesRequest.getMaxItems() != null) {<NEW_LINE>prefix = "MaxItems";<NEW_LINE>Integer maxItems = listTemplatesRequest.getMaxItems();<NEW_LINE>request.addParameter(prefix<MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | , StringUtils.fromInteger(maxItems)); |
873,561 | public Mono<Void> filter(@NonNull final ServerWebExchange exchange, @NonNull final WebFilterChain chain) {<NEW_LINE>MediaType mediaType = exchange.getRequest().getHeaders().getContentType();<NEW_LINE>if (MediaType.MULTIPART_FORM_DATA.isCompatibleWith(mediaType)) {<NEW_LINE>ServerRequest serverRequest = ServerRequest.create(exchange, messageReaders);<NEW_LINE>return serverRequest.bodyToMono(DataBuffer.class).flatMap(size -> {<NEW_LINE>if (size.capacity() > BYTES_PER_MB * fileMaxSize) {<NEW_LINE><MASK><NEW_LINE>response.setStatusCode(HttpStatus.BAD_REQUEST);<NEW_LINE>Object error = ShenyuResultWrap.error(exchange, ShenyuResultEnum.PAYLOAD_TOO_LARGE);<NEW_LINE>return WebFluxResultUtils.result(exchange, error);<NEW_LINE>}<NEW_LINE>BodyInserter<Mono<DataBuffer>, ReactiveHttpOutputMessage> bodyInsert = BodyInserters.fromPublisher(Mono.just(size), DataBuffer.class);<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>headers.putAll(exchange.getRequest().getHeaders());<NEW_LINE>headers.remove(HttpHeaders.CONTENT_LENGTH);<NEW_LINE>CachedBodyOutputMessage outputMessage = new CachedBodyOutputMessage(exchange, headers);<NEW_LINE>return bodyInsert.insert(outputMessage, new BodyInserterContext()).then(Mono.defer(() -> {<NEW_LINE>ServerHttpRequest decorator = decorate(exchange, outputMessage);<NEW_LINE>return chain.filter(exchange.mutate().request(decorator).build());<NEW_LINE>}));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return chain.filter(exchange);<NEW_LINE>} | ServerHttpResponse response = exchange.getResponse(); |
207,795 | ManagedChannelBuilder<?> newChannelBuilder(String target, ChannelCredentials creds) {<NEW_LINE>List<ManagedChannelProvider> providers = providers();<NEW_LINE>if (providers.isEmpty()) {<NEW_LINE>throw new ProviderNotFoundException("No functional channel service provider found. " + "Try adding a dependency on the grpc-okhttp, grpc-netty, or grpc-netty-shaded " + "artifact");<NEW_LINE>}<NEW_LINE>StringBuilder error = new StringBuilder();<NEW_LINE>for (ManagedChannelProvider provider : providers()) {<NEW_LINE>ManagedChannelProvider.NewChannelBuilderResult result = provider.newChannelBuilder(target, creds);<NEW_LINE>if (result.getChannelBuilder() != null) {<NEW_LINE>return result.getChannelBuilder();<NEW_LINE>}<NEW_LINE>error.append("; ");<NEW_LINE>error.append(provider.getClass().getName());<NEW_LINE>error.append(": ");<NEW_LINE>error.<MASK><NEW_LINE>}<NEW_LINE>throw new ProviderNotFoundException(error.substring(2));<NEW_LINE>} | append(result.getError()); |
9,506 | private Optional<List<Object[]>> onJdbc(String statement) {<NEW_LINE>String datasourceDs = null;<NEW_LINE>if (MetaClusterCurrent.exist(ReplicaSelectorManager.class)) {<NEW_LINE>ReplicaSelectorManager replicaSelectorManager = MetaClusterCurrent.wrapper(ReplicaSelectorManager.class);<NEW_LINE>datasourceDs = replicaSelectorManager.getDatasourceNameByReplicaName(MetadataManager.getPrototype(), true, null);<NEW_LINE>} else {<NEW_LINE>datasourceDs = "prototypeDs";<NEW_LINE>}<NEW_LINE>JdbcConnectionManager jdbcConnectionManager = MetaClusterCurrent.wrapper(JdbcConnectionManager.class);<NEW_LINE>Map<String, JdbcDataSource> datasourceInfo = jdbcConnectionManager.getDatasourceInfo();<NEW_LINE>if (datasourceInfo.containsKey(datasourceDs)) {<NEW_LINE>datasourceDs = null;<NEW_LINE>} else {<NEW_LINE>List<DatasourceConfig> configAsList = jdbcConnectionManager.getConfigAsList();<NEW_LINE>if (!configAsList.isEmpty()) {<NEW_LINE>datasourceDs = configAsList.get(0).getName();<NEW_LINE>} else {<NEW_LINE>datasourceDs = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (datasourceDs == null) {<NEW_LINE>datasourceDs = datasourceInfo.values().stream().filter(i -> i.isMySQLType()).map(i -> i.getName()).findFirst().orElse(null);<NEW_LINE>}<NEW_LINE>if (datasourceDs == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>try (DefaultConnection connection = jdbcConnectionManager.getConnection(datasourceDs)) {<NEW_LINE>Connection rawConnection = connection.getRawConnection();<NEW_LINE>Statement jdbcStatement1 = rawConnection.createStatement();<NEW_LINE>ResultSet resultSet = jdbcStatement1.executeQuery(statement);<NEW_LINE>int columnCount = resultSet<MASK><NEW_LINE>List<Object[]> res = new ArrayList<>();<NEW_LINE>while (resultSet.next()) {<NEW_LINE>Object[] objects = new Object[columnCount];<NEW_LINE>for (int i = 0; i < columnCount; i++) {<NEW_LINE>objects[i] = resultSet.getObject(i + 1);<NEW_LINE>}<NEW_LINE>res.add(objects);<NEW_LINE>}<NEW_LINE>return Optional.of(res);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("", e);<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>} | .getMetaData().getColumnCount(); |
1,346,404 | public void jacobian(double X, double Y, double Z, double[] inputX, double[] inputY, boolean computeIntrinsic, @Nullable double[] calibX, @Nullable double[] calibY) {<NEW_LINE>Z = -Z;<NEW_LINE>double normX = X / Z;<NEW_LINE>double normY = Y / Z;<NEW_LINE>double n2 = normX * normX + normY * normY;<NEW_LINE>double n2_X = 2 * normX / Z;<NEW_LINE>double n2_Y = 2 * normY / Z;<NEW_LINE>double n2_Z = -2 * n2 / Z;<NEW_LINE>double r = 1.0 + (k1 + k2 * n2) * n2;<NEW_LINE>double kk = k1 + 2 * k2 * n2;<NEW_LINE>double r_Z = n2_Z * kk;<NEW_LINE>// partial X<NEW_LINE>inputX[0] = (f / Z) * (r + 2 * normX * normX * kk);<NEW_LINE>inputY[0] = f * normY * n2_X * kk;<NEW_LINE>// partial Y<NEW_LINE>inputX[1] = f * normX * n2_Y * kk;<NEW_LINE>inputY[1] = (f / Z) * (r + 2 * normY * normY * kk);<NEW_LINE>// partial Z<NEW_LINE>// you have no idea how many hours I lost before I realized the mistake here<NEW_LINE>inputX[2] = f * normX * (r / Z - r_Z);<NEW_LINE>inputY[2] = f * normY * (r / Z - r_Z);<NEW_LINE>if (!computeIntrinsic || calibX == null || calibY == null)<NEW_LINE>return;<NEW_LINE>// partial f<NEW_LINE>calibX[0] = r * normX;<NEW_LINE>calibY[0] = r * normY;<NEW_LINE>// partial k1<NEW_LINE>calibX[1] = f * normX * n2;<NEW_LINE>calibY[1] = f * normY * n2;<NEW_LINE>// partial k2<NEW_LINE>calibX[2] <MASK><NEW_LINE>calibY[2] = f * normY * n2 * n2;<NEW_LINE>} | = f * normX * n2 * n2; |
1,814,614 | final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AuditManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
526,496 | public static void down(GrayU8 input, GrayI8 output) {<NEW_LINE>int maxY = input.height - input.height % 2;<NEW_LINE>int maxX = input.width - input.width % 2;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxY, 2, y -> {<NEW_LINE>for (int y = 0; y < maxY; y += 2) {<NEW_LINE>int indexOut = output.startIndex + (y / 2) * output.stride;<NEW_LINE>int indexIn0 = input.startIndex + y * input.stride;<NEW_LINE>int indexIn1 = indexIn0 + input.stride;<NEW_LINE>for (int x = 0; x < maxX; x += 2) {<NEW_LINE>int total = input.data[indexIn0++] & 0xFF;<NEW_LINE>total += input.data[indexIn0++] & 0xFF;<NEW_LINE>total += input.data[indexIn1++] & 0xFF;<NEW_LINE>total += input.data[indexIn1++] & 0xFF;<NEW_LINE>output.data[indexOut++] = (byte) ((total + 2) / 4);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>if (maxX != input.width) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxY, 2, y -> {<NEW_LINE>for (int y = 0; y < maxY; y += 2) {<NEW_LINE>int indexOut = output.startIndex + (y / 2) * output.stride + output.width - 1;<NEW_LINE>int indexIn0 = input.startIndex + y * input.stride + maxX;<NEW_LINE>int indexIn1 = indexIn0 + input.stride;<NEW_LINE>int total = input.data[indexIn0] & 0xFF;<NEW_LINE>total += <MASK><NEW_LINE>output.data[indexOut] = (byte) ((total + 1) / 2);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>if (maxY != input.height) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxX, 2, x -> {<NEW_LINE>for (int x = 0; x < maxX; x += 2) {<NEW_LINE>int indexOut = output.startIndex + (output.height - 1) * output.stride + x / 2;<NEW_LINE>int indexIn0 = input.startIndex + (input.height - 1) * input.stride + x;<NEW_LINE>int total = input.data[indexIn0++] & 0xFF;<NEW_LINE>total += input.data[indexIn0++] & 0xFF;<NEW_LINE>output.data[indexOut++] = (byte) ((total + 1) / 2);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>if (maxX != input.width && maxY != input.height) {<NEW_LINE>int indexOut = output.startIndex + (output.height - 1) * output.stride + output.width - 1;<NEW_LINE>int indexIn = input.startIndex + (input.height - 1) * input.stride + input.width - 1;<NEW_LINE>output.data[indexOut] = input.data[indexIn];<NEW_LINE>}<NEW_LINE>} | input.data[indexIn1] & 0xFF; |
1,075,450 | public void actionPerformed(ActionEvent e) {<NEW_LINE>if (e.getSource() instanceof JComponent) {<NEW_LINE>JPopupMenu p = new JPopupMenu();<NEW_LINE>OQLQueries.instance().populateSaveQuery(p, currentQuery, editor.getScript(), new OQLQueries.Handler() {<NEW_LINE><NEW_LINE>protected void querySelected(OQLSupport.Query query) {<NEW_LINE>currentQuery = query;<NEW_LINE>editor.clearChanged();<NEW_LINE>// NOI18N<NEW_LINE>Object <MASK><NEW_LINE>if (notifier instanceof Runnable)<NEW_LINE>((Runnable) notifier).run();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JComponent c = (JComponent) e.getSource();<NEW_LINE>if (p.getComponentCount() > 0) {<NEW_LINE>if (// NOI18N<NEW_LINE>c.getClientProperty("POPUP_LEFT") != null)<NEW_LINE>// NOI18N<NEW_LINE>p.show(c, c.getWidth() + 1, 0);<NEW_LINE>else<NEW_LINE>p.show(c, 0, c.getHeight() + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | notifier = saveAction.getValue("NOTIFIER"); |
1,675,171 | // Delete all old shard gen blobs that aren't referenced any longer as a result from moving to updated repository data<NEW_LINE>private void cleanupOldShardGens(RepositoryData existingRepositoryData, RepositoryData updatedRepositoryData, FinalizeSnapshotContext finalizeSnapshotContext) {<NEW_LINE>final Set<String> toDelete = new HashSet<>();<NEW_LINE>final int prefixPathLen = basePath().buildAsString().length();<NEW_LINE>updatedRepositoryData.shardGenerations().obsoleteShardGenerations(existingRepositoryData.shardGenerations()).forEach((indexId, gens) -> gens.forEach((shardId, oldGen) -> toDelete.add(shardContainer(indexId, shardId).path().buildAsString().substring(prefixPathLen) + INDEX_FILE_PREFIX + oldGen)));<NEW_LINE>for (Map.Entry<RepositoryShardId, Set<ShardGeneration>> obsoleteEntry : finalizeSnapshotContext.obsoleteShardGenerations().entrySet()) {<NEW_LINE>final String containerPath = shardContainer(obsoleteEntry.getKey().index(), obsoleteEntry.getKey().shardId()).path().buildAsString(<MASK><NEW_LINE>for (ShardGeneration shardGeneration : obsoleteEntry.getValue()) {<NEW_LINE>toDelete.add(containerPath + shardGeneration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>deleteFromContainer(blobContainer(), toDelete.iterator());<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Failed to clean up old shard generation blobs", e);<NEW_LINE>}<NEW_LINE>} | ).substring(prefixPathLen) + INDEX_FILE_PREFIX; |
532,765 | public static void createPngCanvasDataUrl(Diagram diagram, double scaling, DownloadPopupPanel receiver, DownloadType type) {<NEW_LINE>ThemeFactory.THEMES currentTheme = ThemeFactory.getActiveThemeEnum();<NEW_LINE>ThemeFactory.changeTheme(ThemeFactory.THEMES.LIGHT, null, false);<NEW_LINE>DrawCanvas pngCanvas = new DrawCanvas();<NEW_LINE>pngCanvas.setScaling(scaling);<NEW_LINE>// Calculate and set canvas width<NEW_LINE>Rectangle geRect = GridElementUtils.getGridElementsRectangle(diagram.getGridElements(), scaling);<NEW_LINE>geRect.addBorder(EXPORT_BORDER);<NEW_LINE>pngCanvas.clearAndSetSize(geRect.getWidth(), geRect.getHeight());<NEW_LINE>// Fill Canvas white<NEW_LINE>pngCanvas.getContext2d().setFillStyle(Converter.convert(ThemeFactory.getCurrentTheme().getColor(Theme.PredefinedColors.WHITE)));<NEW_LINE>pngCanvas.getContext2d().fillRect(0, 0, pngCanvas.getWidth(), pngCanvas.getHeight());<NEW_LINE>// Draw Elements on Canvas and translate their position<NEW_LINE>pngCanvas.getContext2d().translate(-geRect.getX(), -geRect.getY());<NEW_LINE>// use a new selector which has nothing selected<NEW_LINE>pngCanvas.draw(false, diagram.getGridElementsByLayerLowestToHighest(<MASK><NEW_LINE>ThemeFactory.changeTheme(currentTheme, null, true);<NEW_LINE>String dataUrl = pngCanvas.toDataUrl("image/png");<NEW_LINE>// to prevent that the scaling is displayed in the actual view since the same diagram items are referenced<NEW_LINE>pngCanvas.setScaling(1.0d);<NEW_LINE>receiver.onData(dataUrl, type);<NEW_LINE>} | ), new SelectorNew(diagram)); |
371,269 | public boolean visit(SQLOrderBy x) {<NEW_LINE><MASK><NEW_LINE>SQLSelectQueryBlock query = null;<NEW_LINE>if (x.getParent() instanceof SQLSelectQueryBlock) {<NEW_LINE>query = (SQLSelectQueryBlock) x.getParent();<NEW_LINE>}<NEW_LINE>if (query != null) {<NEW_LINE>for (SQLSelectOrderByItem item : x.getItems()) {<NEW_LINE>SQLExpr expr = item.getExpr();<NEW_LINE>if (expr instanceof SQLIntegerExpr) {<NEW_LINE>int intValue = ((SQLIntegerExpr) expr).getNumber().intValue() - 1;<NEW_LINE>if (intValue < query.getSelectList().size()) {<NEW_LINE>SQLExpr selectItemExpr = query.getSelectList().get(intValue).getExpr();<NEW_LINE>selectItemExpr.accept(orderByVisitor);<NEW_LINE>}<NEW_LINE>} else if (expr instanceof MySqlExpr) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>x.accept(orderByVisitor);<NEW_LINE>for (SQLSelectOrderByItem orderByItem : x.getItems()) {<NEW_LINE>statExpr(orderByItem.getExpr());<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | final SQLASTVisitor orderByVisitor = createOrderByVisitor(x); |
1,672,161 | public void onMatch(RelOptRuleCall call) {<NEW_LINE>assert matches(call);<NEW_LINE>final Join join = call.rel(0);<NEW_LINE>RelNode right = join.getRight();<NEW_LINE>final RelNode left = join.getLeft();<NEW_LINE>final int leftFieldCount = left.getRowType().getFieldCount();<NEW_LINE>final RelOptCluster cluster = join.getCluster();<NEW_LINE>final <MASK><NEW_LINE>final RelBuilder relBuilder = call.builder();<NEW_LINE>final CorrelationId correlationId = cluster.createCorrel();<NEW_LINE>final RexNode corrVar = rexBuilder.makeCorrel(left.getRowType(), correlationId);<NEW_LINE>final ImmutableBitSet.Builder requiredColumns = ImmutableBitSet.builder();<NEW_LINE>// Replace all references of left input with FieldAccess(corrVar, field)<NEW_LINE>final RexNode joinCondition = join.getCondition().accept(new RexShuttle() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public RexNode visitInputRef(RexInputRef input) {<NEW_LINE>int field = input.getIndex();<NEW_LINE>if (field >= leftFieldCount) {<NEW_LINE>return rexBuilder.makeInputRef(input.getType(), input.getIndex() - leftFieldCount);<NEW_LINE>}<NEW_LINE>requiredColumns.set(field);<NEW_LINE>return rexBuilder.makeFieldAccess(corrVar, field);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>relBuilder.push(right).filter(joinCondition);<NEW_LINE>RelNode newRel = LogicalCorrelate.create(left, relBuilder.build(), correlationId, requiredColumns.build(), join.getJoinType());<NEW_LINE>call.transformTo(newRel);<NEW_LINE>} | RexBuilder rexBuilder = cluster.getRexBuilder(); |
1,161,488 | final CreatePullRequestApprovalRuleResult executeCreatePullRequestApprovalRule(CreatePullRequestApprovalRuleRequest createPullRequestApprovalRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPullRequestApprovalRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePullRequestApprovalRuleRequest> request = null;<NEW_LINE>Response<CreatePullRequestApprovalRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePullRequestApprovalRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPullRequestApprovalRuleRequest));<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, "CodeCommit");<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<CreatePullRequestApprovalRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePullRequestApprovalRuleResultJsonUnmarshaller());<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, "CreatePullRequestApprovalRule"); |
1,168,702 | public BufferedImageFilterResult filter(BufferedImage source, BufferedImage destination, boolean modifySource) {<NEW_LINE>BufferedImage flag = getLanguageFlag(languageCode);<NEW_LINE>if (flag == null) {<NEW_LINE>return new BufferedImageFilterResult(source, false, true);<NEW_LINE>}<NEW_LINE>boolean sameInstance = true;<NEW_LINE>boolean nullSource = source == null;<NEW_LINE>// Use the flag image if the input is missing<NEW_LINE>if (source == null) {<NEW_LINE>source = flag;<NEW_LINE>sameInstance = false;<NEW_LINE>}<NEW_LINE>// Create new destination or reuse source according to modifySource<NEW_LINE>if (destination == null) {<NEW_LINE>if (modifySource) {<NEW_LINE>destination = source;<NEW_LINE>} else {<NEW_LINE>destination = createCompatibleDestImage(source, null);<NEW_LINE>sameInstance = false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>sameInstance = source == destination;<NEW_LINE>}<NEW_LINE>// Return the flag itself<NEW_LINE>if (nullSource && source == destination) {<NEW_LINE>return new BufferedImageFilterResult(flag, true, false);<NEW_LINE>}<NEW_LINE>int flagHorizontalResolution;<NEW_LINE>int flagVerticalResolution;<NEW_LINE>int flagHorizontalPosition;<NEW_LINE>int flagVerticalPosition;<NEW_LINE>if (nullSource) {<NEW_LINE>flagHorizontalResolution = source.getWidth();<NEW_LINE>flagVerticalResolution = source.getHeight();<NEW_LINE>flagHorizontalPosition = 0;<NEW_LINE>flagVerticalPosition = 0;<NEW_LINE>} else {<NEW_LINE>double scale = Math.min((double) source.getWidth() / flag.getWidth(), (double) source.getHeight() / flag.getHeight());<NEW_LINE>flagHorizontalResolution = (int) Math.round(flag.getWidth() * scale);<NEW_LINE>flagVerticalResolution = (int) Math.round(flag.getHeight() * scale);<NEW_LINE>flagHorizontalPosition = (source.getWidth() - flagHorizontalResolution) / 2;<NEW_LINE>flagVerticalPosition = (source.getHeight() - flagVerticalResolution) / 2;<NEW_LINE>}<NEW_LINE>Graphics2D g2d = source.createGraphics();<NEW_LINE>try {<NEW_LINE>if (hints != null) {<NEW_LINE>g2d.setRenderingHints(hints);<NEW_LINE>}<NEW_LINE>if (source != destination) {<NEW_LINE>g2d.drawImage(<MASK><NEW_LINE>}<NEW_LINE>g2d.drawImage(flag, flagHorizontalPosition, flagVerticalPosition, flagHorizontalResolution, flagVerticalResolution, null);<NEW_LINE>} finally {<NEW_LINE>g2d.dispose();<NEW_LINE>}<NEW_LINE>return new BufferedImageFilterResult(source, true, sameInstance);<NEW_LINE>} | source, 0, 0, null); |
272,665 | private void createStreamWithMessageHeaderV1(StoreKey key, BlobProperties blobProperties, ByteBuffer userMetadata, InputStream blobStream, long streamSize, BlobType blobType) throws MessageFormatException {<NEW_LINE>int headerSize = MessageFormatRecord.MessageHeader_Format_V1.getHeaderSize();<NEW_LINE>int blobPropertiesRecordSize = MessageFormatRecord.BlobProperties_Format_V1.getBlobPropertiesRecordSize(blobProperties);<NEW_LINE>int userMetadataSize = MessageFormatRecord.UserMetadata_Format_V1.getUserMetadataSize(userMetadata);<NEW_LINE>long blobSize = MessageFormatRecord.Blob_Format_V2.getBlobRecordSize(streamSize);<NEW_LINE>buffer = ByteBuffer.allocate(headerSize + key.sizeInBytes() + blobPropertiesRecordSize + userMetadataSize + (int) (blobSize - streamSize - MessageFormatRecord.Crc_Size));<NEW_LINE>MessageFormatRecord.MessageHeader_Format_V1.serializeHeader(buffer, blobPropertiesRecordSize + userMetadataSize + blobSize, headerSize + key.sizeInBytes(), MessageFormatRecord.Message_Header_Invalid_Relative_Offset, headerSize + key.sizeInBytes() + blobPropertiesRecordSize, headerSize + key.sizeInBytes() + blobPropertiesRecordSize + userMetadataSize);<NEW_LINE>buffer.put(key.toBytes());<NEW_LINE>MessageFormatRecord.BlobProperties_Format_V1.serializeBlobPropertiesRecord(buffer, blobProperties);<NEW_LINE>MessageFormatRecord.<MASK><NEW_LINE>int bufferBlobStart = buffer.position();<NEW_LINE>MessageFormatRecord.Blob_Format_V2.serializePartialBlobRecord(buffer, streamSize, blobType);<NEW_LINE>Crc32 crc = new Crc32();<NEW_LINE>crc.update(buffer.array(), bufferBlobStart, buffer.position() - bufferBlobStart);<NEW_LINE>stream = new CrcInputStream(crc, blobStream);<NEW_LINE>streamLength = streamSize;<NEW_LINE>messageLength = buffer.capacity() + streamLength + MessageFormatRecord.Crc_Size;<NEW_LINE>buffer.flip();<NEW_LINE>} | UserMetadata_Format_V1.serializeUserMetadataRecord(buffer, userMetadata); |
729,353 | private void processBindingsSheet(Element theBindingsSheet) {<NEW_LINE>NodeList tableList = theBindingsSheet.getElementsByTagName("Table");<NEW_LINE>Element table = (Element) tableList.item(0);<NEW_LINE>NodeList rows = table.getElementsByTagName("Row");<NEW_LINE>Element defRow = (Element) rows.item(0);<NEW_LINE>int colName = 0;<NEW_LINE>int colStrength = 0;<NEW_LINE>int colRef = 0;<NEW_LINE>for (int j = 0; j < 20; j++) {<NEW_LINE>String nextName = cellValue(defRow, j);<NEW_LINE>if (nextName == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>nextName = nextName.toLowerCase().trim().replace(".", "");<NEW_LINE>switch(nextName) {<NEW_LINE>case "name":<NEW_LINE>case "binding name":<NEW_LINE>colName = j;<NEW_LINE>break;<NEW_LINE>case "reference":<NEW_LINE>colRef = j;<NEW_LINE>break;<NEW_LINE>case "conformance":<NEW_LINE>colStrength = j;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int j = 1; j < rows.getLength(); j++) {<NEW_LINE>Element nextRow = (Element) rows.item(j);<NEW_LINE>String name = cellValue(nextRow, colName);<NEW_LINE>String strength = cellValue(nextRow, colStrength);<NEW_LINE>String <MASK><NEW_LINE>if (isNotBlank(name) && isNotBlank(strength)) {<NEW_LINE>myBindingStrengths.put(name, strength);<NEW_LINE>}<NEW_LINE>if (isNotBlank(name) && isNotBlank(ref)) {<NEW_LINE>if (ref.startsWith("#")) {<NEW_LINE>ref = "http://hl7.org/fhir/ValueSet/" + ref.substring(1);<NEW_LINE>} else if (!ref.startsWith("http")) {<NEW_LINE>ref = "http://hl7.org/fhir/ValueSet/" + ref;<NEW_LINE>}<NEW_LINE>myBindingRefs.put(name, ref);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ref = cellValue(nextRow, colRef); |
375,783 | void applyToBorder(GrayU8 input, GrayU8 output, int y0, int y1, int x0, int x1, ApplyHelper h) {<NEW_LINE>// top-left corner<NEW_LINE>h.computeHistogram(0, 0, input);<NEW_LINE>h.applyToBlock(0, 0, x0 + 1, y0 + 1, input, output);<NEW_LINE>// top-middle<NEW_LINE>for (int x = x0 + 1; x < x1; x++) {<NEW_LINE>h.updateHistogramX(x - x0, 0, input);<NEW_LINE>h.applyToBlock(x, 0, x + 1, y0, input, output);<NEW_LINE>}<NEW_LINE>// top-right<NEW_LINE>h.updateHistogramX(x1 - x0, 0, input);<NEW_LINE>h.applyToBlock(x1, 0, input.width, y0 + 1, input, output);<NEW_LINE>// middle-right<NEW_LINE>for (int y = y0 + 1; y < y1; y++) {<NEW_LINE>h.updateHistogramY(x1 - x0, y - y0, input);<NEW_LINE>h.applyToBlock(x1, y, input.width, y + 1, input, output);<NEW_LINE>}<NEW_LINE>// bottom-right<NEW_LINE>h.updateHistogramY(x1 - x0, y1 - y0, input);<NEW_LINE>h.applyToBlock(x1, y1, input.width, input.height, input, output);<NEW_LINE>// Start over in the top-left. Yes this step could be avoided...<NEW_LINE>// middle-left<NEW_LINE>h.<MASK><NEW_LINE>for (int y = y0 + 1; y < y1; y++) {<NEW_LINE>h.updateHistogramY(0, y - y0, input);<NEW_LINE>h.applyToBlock(0, y, x0, y + 1, input, output);<NEW_LINE>}<NEW_LINE>// bottom-left<NEW_LINE>h.updateHistogramY(0, y1 - y0, input);<NEW_LINE>h.applyToBlock(0, y1, x0 + 1, input.height, input, output);<NEW_LINE>// bottom-middle<NEW_LINE>for (int x = x0 + 1; x < x1; x++) {<NEW_LINE>h.updateHistogramX(x - x0, y1 - y0, input);<NEW_LINE>h.applyToBlock(x, y1, x + 1, input.height, input, output);<NEW_LINE>}<NEW_LINE>} | computeHistogram(0, 0, input); |
1,030,030 | public static void main(String[] args) {<NEW_LINE>String modelPath = "edu/stanford/nlp/models/srparser/englishSR.ser.gz";<NEW_LINE>String taggerPath = "edu/stanford/nlp/models/pos-tagger/english-left3words-distsim.tagger";<NEW_LINE>for (int argIndex = 0; argIndex < args.length; ) {<NEW_LINE>switch(args[argIndex]) {<NEW_LINE>case "-tagger":<NEW_LINE><MASK><NEW_LINE>argIndex += 2;<NEW_LINE>break;<NEW_LINE>case "-model":<NEW_LINE>modelPath = args[argIndex + 1];<NEW_LINE>argIndex += 2;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Unknown argument " + args[argIndex]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String text = "My dog likes to shake his stuffed chickadee toy.";<NEW_LINE>MaxentTagger tagger = new MaxentTagger(taggerPath);<NEW_LINE>ShiftReduceParser model = ShiftReduceParser.loadModel(modelPath);<NEW_LINE>DocumentPreprocessor tokenizer = new DocumentPreprocessor(new StringReader(text));<NEW_LINE>for (List<HasWord> sentence : tokenizer) {<NEW_LINE>List<TaggedWord> tagged = tagger.tagSentence(sentence);<NEW_LINE>Tree tree = model.apply(tagged);<NEW_LINE>log.info(tree);<NEW_LINE>}<NEW_LINE>} | taggerPath = args[argIndex + 1]; |
1,504,012 | public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context) {<NEW_LINE>try {<NEW_LINE>final boolean isMethodNotConstructor = context.getRequiredType().equals(Method.class);<NEW_LINE>reader.moveDown();<NEW_LINE>final String declaringClassName = reader.getValue();<NEW_LINE>final Class<?> declaringClass = (Class<?>) javaClassConverter.fromString(declaringClassName);<NEW_LINE>reader.moveUp();<NEW_LINE>String methodName = null;<NEW_LINE>if (isMethodNotConstructor) {<NEW_LINE>reader.moveDown();<NEW_LINE>methodName = reader.getValue();<NEW_LINE>reader.moveUp();<NEW_LINE>}<NEW_LINE>reader.moveDown();<NEW_LINE>final List<Class<?>> parameterTypeList = new ArrayList<>();<NEW_LINE>while (reader.hasMoreChildren()) {<NEW_LINE>reader.moveDown();<NEW_LINE>final <MASK><NEW_LINE>parameterTypeList.add((Class<?>) javaClassConverter.fromString(parameterTypeName));<NEW_LINE>reader.moveUp();<NEW_LINE>}<NEW_LINE>final Class<?>[] parameterTypes = parameterTypeList.toArray(new Class[parameterTypeList.size()]);<NEW_LINE>reader.moveUp();<NEW_LINE>if (isMethodNotConstructor) {<NEW_LINE>return declaringClass.getDeclaredMethod(methodName, parameterTypes);<NEW_LINE>} else {<NEW_LINE>return declaringClass.getDeclaredConstructor(parameterTypes);<NEW_LINE>}<NEW_LINE>} catch (final NoSuchMethodException e) {<NEW_LINE>throw new ConversionException(e);<NEW_LINE>}<NEW_LINE>} | String parameterTypeName = reader.getValue(); |
1,639,815 | public HttpResponse execute(HttpRequest req) throws UncheckedIOException {<NEW_LINE>try (Span span = newSpanAsChildOf(tracer, req, "protocol_converter")) {<NEW_LINE>Map<String, EventAttributeValue> attributeMap = new HashMap<>();<NEW_LINE>attributeMap.put(AttributeKey.HTTP_HANDLER_CLASS.getKey(), EventAttribute.setValue(getClass().getName()));<NEW_LINE>Command command = downstream.decode(req);<NEW_LINE>KIND.accept(<MASK><NEW_LINE>HTTP_REQUEST.accept(span, req);<NEW_LINE>HTTP_REQUEST_EVENT.accept(attributeMap, req);<NEW_LINE>SessionId sessionId = command.getSessionId();<NEW_LINE>SESSION_ID.accept(span, sessionId);<NEW_LINE>SESSION_ID_EVENT.accept(attributeMap, sessionId);<NEW_LINE>String commandName = command.getName();<NEW_LINE>span.setAttribute("command.name", commandName);<NEW_LINE>attributeMap.put("command.name", EventAttribute.setValue(commandName));<NEW_LINE>attributeMap.put("downstream.command.parameters", EventAttribute.setValue(command.getParameters().toString()));<NEW_LINE>// Massage the webelements<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, ?> parameters = (Map<String, ?>) converter.apply(command.getParameters());<NEW_LINE>command = new Command(command.getSessionId(), command.getName(), parameters);<NEW_LINE>attributeMap.put("upstream.command.parameters", EventAttribute.setValue(command.getParameters().toString()));<NEW_LINE>HttpRequest request = upstream.encode(command);<NEW_LINE>HttpTracing.inject(tracer, span, request);<NEW_LINE>HttpResponse res = makeRequest(request);<NEW_LINE>if (!res.isSuccessful()) {<NEW_LINE>span.setAttribute("error", true);<NEW_LINE>span.setStatus(Status.UNKNOWN);<NEW_LINE>}<NEW_LINE>HTTP_RESPONSE.accept(span, res);<NEW_LINE>HTTP_RESPONSE_EVENT.accept(attributeMap, res);<NEW_LINE>HttpResponse toReturn;<NEW_LINE>if (DriverCommand.NEW_SESSION.equals(command.getName()) && res.getStatus() == HTTP_OK) {<NEW_LINE>toReturn = newSessionConverter.apply(res);<NEW_LINE>} else {<NEW_LINE>Response decoded = upstreamResponse.decode(res);<NEW_LINE>toReturn = downstreamResponse.encode(HttpResponse::new, decoded);<NEW_LINE>}<NEW_LINE>res.getHeaderNames().forEach(name -> {<NEW_LINE>if (!IGNORED_REQ_HEADERS.contains(name)) {<NEW_LINE>res.getHeaders(name).forEach(value -> toReturn.addHeader(name, value));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>span.addEvent("Protocol conversion completed", attributeMap);<NEW_LINE>return toReturn;<NEW_LINE>}<NEW_LINE>} | span, Span.Kind.SERVER); |
1,481,443 | public void marshall(VideoDescription videoDescription, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (videoDescription == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(videoDescription.getCodecSettings(), CODECSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoDescription.getHeight(), HEIGHT_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoDescription.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoDescription.getRespondToAfd(), RESPONDTOAFD_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoDescription.getScalingBehavior(), SCALINGBEHAVIOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoDescription.getSharpness(), SHARPNESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | videoDescription.getWidth(), WIDTH_BINDING); |
757,220 | final UpdateDomainResult executeUpdateDomain(UpdateDomainRequest updateDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDomainRequest> request = null;<NEW_LINE>Response<UpdateDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDomainRequest));<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, "Voice ID");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDomain");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDomainResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
75,146 | public void run(RegressionEnvironment env) {<NEW_LINE>String statementText = "@name('s0') select price, min(price) as minPrice " + "from SupportMarketDataBean#time(30)" + "having price >= min(price) * (1.02)";<NEW_LINE>env.compileDeploy(statementText).addListener("s0");<NEW_LINE>Random random = new Random();<NEW_LINE>// Change to perform a long-running tests, each loop is 1 second<NEW_LINE>final int loopcount = 2;<NEW_LINE>int loopCount = 0;<NEW_LINE>while (true) {<NEW_LINE>log.info("Sending batch " + loopCount);<NEW_LINE>// send events<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>for (int i = 0; i < 5000; i++) {<NEW_LINE>double price = 50 + 49 * random.nextInt(100) / 100.0;<NEW_LINE>sendEvent(env, price);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// sleep remainder of 1 second<NEW_LINE>long delta = startTime - endTime;<NEW_LINE>if (delta < 950) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(950 - delta);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.listenerReset("s0");<NEW_LINE>loopCount++;<NEW_LINE>if (loopCount > loopcount) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.undeployAll();<NEW_LINE>} | long endTime = System.currentTimeMillis(); |
1,401,735 | public void configureMiniTable(IMiniTable miniTable) {<NEW_LINE>// 0<NEW_LINE>miniTable.addColumn("HR_Movement_ID");<NEW_LINE>// 1<NEW_LINE>miniTable.addColumn("AD_Org_ID");<NEW_LINE>// 2<NEW_LINE>miniTable.addColumn("HR_Concept_ID");<NEW_LINE>// 3<NEW_LINE>miniTable.addColumn("ValidFrom");<NEW_LINE>// 4<NEW_LINE>miniTable.addColumn("ColumnType");<NEW_LINE>// 5<NEW_LINE>miniTable.addColumn("Qty");<NEW_LINE>// 6<NEW_LINE>miniTable.addColumn("Amount");<NEW_LINE>// 7<NEW_LINE>miniTable.addColumn("ServiceDate");<NEW_LINE>// 8<NEW_LINE>miniTable.addColumn("TextMsg");<NEW_LINE>// 10<NEW_LINE>miniTable.addColumn("Description");<NEW_LINE>// set details<NEW_LINE>miniTable.setColumnClass(0, IDColumn.class, false, " ");<NEW_LINE>miniTable.setColumnClass(1, String.class, true, Msg.translate(Env.getCtx(), "AD_Org_ID"));<NEW_LINE>miniTable.setColumnClass(2, String.class, true, Msg.translate(Env.getCtx(), "HR_Concept_ID"));<NEW_LINE>miniTable.setColumnClass(3, Timestamp.class, true, Msg.translate(Env.getCtx(), "ValidFrom"));<NEW_LINE>miniTable.setColumnClass(4, String.class, true, Msg.translate(Env.getCtx(), "ColumnType"));<NEW_LINE>miniTable.setColumnClass(5, BigDecimal.class, true, Msg.translate(Env.getCtx(), "Qty"));<NEW_LINE>miniTable.setColumnClass(6, BigDecimal.class, true, Msg.translate(Env<MASK><NEW_LINE>miniTable.setColumnClass(7, Timestamp.class, true, Msg.translate(Env.getCtx(), "ServiceDate"));<NEW_LINE>miniTable.setColumnClass(8, String.class, true, Msg.translate(Env.getCtx(), "TextMsg"));<NEW_LINE>miniTable.setColumnClass(9, String.class, true, Msg.translate(Env.getCtx(), "Description"));<NEW_LINE>//<NEW_LINE>miniTable.autoSize();<NEW_LINE>} | .getCtx(), "Amount")); |
317,671 | protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>Parser parser = new Parser(PATTERN, (String) msg);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, <MASK><NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.setTime(parser.nextDateTime(Parser.DateTimeFormat.DMY_HMS));<NEW_LINE>position.setLatitude(parser.nextCoordinate());<NEW_LINE>position.setLongitude(parser.nextCoordinate());<NEW_LINE>position.setSpeed(parser.nextDouble());<NEW_LINE>position.setAltitude(parser.nextDouble());<NEW_LINE>position.setValid(parser.next().equals("A"));<NEW_LINE>position.set(Position.KEY_BATTERY, parser.nextDouble());<NEW_LINE>return position;<NEW_LINE>} | remoteAddress, parser.next()); |
666,169 | public static Path downloadAndInstallJdk(int version) {<NEW_LINE>Util.infoMsg("Downloading JDK " + version + ". Be patient, this can take several minutes...");<NEW_LINE>String url = getJDKUrl(version, Util.getOS().name(), Util.getArch().name(), Util.getVendor(), Util.getRelease());<NEW_LINE>Util.verboseMsg("Downloading " + url);<NEW_LINE>Path jdkDir = getJdkPath(version);<NEW_LINE>Path jdkTmpDir = jdkDir.getParent().resolve(jdkDir.getFileName().toString() + ".tmp");<NEW_LINE>Path jdkOldDir = jdkDir.getParent().resolve(jdkDir.getFileName(<MASK><NEW_LINE>Util.deletePath(jdkTmpDir, false);<NEW_LINE>Util.deletePath(jdkOldDir, false);<NEW_LINE>try {<NEW_LINE>Path jdkPkg = Util.downloadAndCacheFile(url);<NEW_LINE>Util.infoMsg("Installing JDK " + version + "...");<NEW_LINE>Util.verboseMsg("Unpacking to " + jdkDir.toString());<NEW_LINE>UnpackUtil.unpackJdk(jdkPkg, jdkTmpDir);<NEW_LINE>if (Files.isDirectory(jdkDir)) {<NEW_LINE>Files.move(jdkDir, jdkOldDir);<NEW_LINE>}<NEW_LINE>Files.move(jdkTmpDir, jdkDir);<NEW_LINE>Util.deletePath(jdkOldDir, false);<NEW_LINE>if (getDefaultJdk() < 0) {<NEW_LINE>setDefaultJdk(version);<NEW_LINE>}<NEW_LINE>return jdkDir;<NEW_LINE>} catch (Exception e) {<NEW_LINE>Util.deletePath(jdkTmpDir, true);<NEW_LINE>if (!Files.isDirectory(jdkDir) && Files.isDirectory(jdkOldDir)) {<NEW_LINE>try {<NEW_LINE>Files.move(jdkOldDir, jdkDir);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// Ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Util.errorMsg("Required Java version not possible to download or install. You can run with '--java " + JavaUtil.determineJavaVersion() + "' to force using the default installed Java.");<NEW_LINE>throw new ExitException(EXIT_UNEXPECTED_STATE, "Unable to download or install JDK version " + version, e);<NEW_LINE>}<NEW_LINE>} | ).toString() + ".old"); |
89,255 | private static INamespaceDefinitionResolver addResolverToCache(IProject project) {<NEW_LINE>synchronized (RESOLVER_CACHE) {<NEW_LINE>int nEntries = RESOLVER_CACHE.size();<NEW_LINE>if (nEntries >= CACHE_SIZE) {<NEW_LINE>// find obsolete entries or remove entry that was least recently accessed<NEW_LINE>ResolvlerCacheEntry oldest = null;<NEW_LINE>List<ResolvlerCacheEntry> obsoleteClassLoaders = new ArrayList<ResolvlerCacheEntry>(CACHE_SIZE);<NEW_LINE>for (int i = 0; i < nEntries; i++) {<NEW_LINE>ResolvlerCacheEntry entry = RESOLVER_CACHE.get(i);<NEW_LINE>IProject curr = entry.getProject();<NEW_LINE>if (!curr.exists() || !curr.isAccessible() || !curr.isOpen()) {<NEW_LINE>obsoleteClassLoaders.add(entry);<NEW_LINE>} else {<NEW_LINE>if (oldest == null || entry.getLastAccess() < oldest.getLastAccess()) {<NEW_LINE>oldest = entry;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!obsoleteClassLoaders.isEmpty()) {<NEW_LINE>for (int i = 0; i < obsoleteClassLoaders.size(); i++) {<NEW_LINE>removeResolverEntryFromCache<MASK><NEW_LINE>}<NEW_LINE>} else if (oldest != null) {<NEW_LINE>removeResolverEntryFromCache(oldest);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ResolvlerCacheEntry newEntry = new ResolvlerCacheEntry(project);<NEW_LINE>RESOLVER_CACHE.add(newEntry);<NEW_LINE>return newEntry.getResolver();<NEW_LINE>}<NEW_LINE>} | (obsoleteClassLoaders.get(i)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.