idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,200,206 | boolean finishCommit(@Nonnull final Document document, @Nonnull List<? extends BooleanRunnable> finishProcessors, @Nonnull List<? extends BooleanRunnable> reparseInjectedProcessors, final boolean synchronously, @Nonnull final Object reason) {<NEW_LINE>assert <MASK><NEW_LINE>ApplicationManager.getApplication().assertIsDispatchThread();<NEW_LINE>final boolean[] ok = { true };<NEW_LINE>Runnable runnable = new DocumentRunnable(document, myProject) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>ok[0] = finishCommitInWriteAction(document, finishProcessors, reparseInjectedProcessors, synchronously, false);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (synchronously) {<NEW_LINE>runnable.run();<NEW_LINE>} else {<NEW_LINE>ApplicationManager.getApplication().runWriteAction(runnable);<NEW_LINE>}<NEW_LINE>if (ok[0]) {<NEW_LINE>// run after commit actions outside write action<NEW_LINE>runAfterCommitActions(document);<NEW_LINE>if (DebugUtil.DO_EXPENSIVE_CHECKS && !ApplicationInfoImpl.isInPerformanceTest()) {<NEW_LINE>checkAllElementsValid(document, reason);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ok[0];<NEW_LINE>} | !myProject.isDisposed() : "Already disposed"; |
376,632 | public void benchmarkByteBuddyWithPrefix(Blackhole blackHole) {<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(booleanValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(byteValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(shortValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(intValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(charValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(intValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(longValue));<NEW_LINE>blackHole.consume<MASK><NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(doubleValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(stringValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(booleanValue, booleanValue, booleanValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(byteValue, byteValue, byteValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(shortValue, shortValue, shortValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(intValue, intValue, intValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(charValue, charValue, charValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(intValue, intValue, intValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(longValue, longValue, longValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(floatValue, floatValue, floatValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(doubleValue, doubleValue, doubleValue));<NEW_LINE>blackHole.consume(byteBuddyWithPrefixInstance.method(stringValue, stringValue, stringValue));<NEW_LINE>} | (byteBuddyWithPrefixInstance.method(floatValue)); |
289,137 | final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,257,813 | public void releasePodIp(Long id) throws CloudRuntimeException {<NEW_LINE>// Verify input parameters<NEW_LINE>DataCenterIpAddressVO ipVO = _privateIPAddressDao.findById(id);<NEW_LINE>if (ipVO == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (ipVO.getTakenAt() == null) {<NEW_LINE>s_logger.debug("Ip Address with id= " + id + " is not allocated, so do nothing.");<NEW_LINE>throw new CloudRuntimeException("Ip Address with id= " + id + " is not allocated, so do nothing.");<NEW_LINE>}<NEW_LINE>// Verify permission<NEW_LINE>DataCenter zone = _entityMgr.findById(DataCenter.class, ipVO.getDataCenterId());<NEW_LINE>Account caller = CallContext.current().getCallingAccount();<NEW_LINE>if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getId())) {<NEW_LINE>throw new CloudRuntimeException(generateErrorMessageForOperationOnDisabledZone("release Pod IP", zone));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>_privateIPAddressDao.releasePodIpAddress(id);<NEW_LINE>} catch (Exception e) {<NEW_LINE>new CloudRuntimeException(e.getMessage());<NEW_LINE>}<NEW_LINE>} | throw new CloudRuntimeException("Unable to find ip address by id:" + id); |
978,985 | private void test(String path) throws Exception {<NEW_LINE>Response response = client.target(URI_CONTEXT_ROOT).path(path).request(MediaType.APPLICATION_JSON_TYPE).get();<NEW_LINE>assertEquals(200, response.getStatus());<NEW_LINE>System.out.println("Headers:");<NEW_LINE>System.out.println(response.getHeaders());<NEW_LINE>Set<Link> links = response.getLinks();<NEW_LINE>assertEquals(3, links.size());<NEW_LINE><MASK><NEW_LINE>for (Link link : links) {<NEW_LINE>System.out.println(link);<NEW_LINE>if (link.toString().contains("first")) {<NEW_LINE>assertThat(link.toString(), allOf(startsWith("<http://test>;"), endsWith("rel=\"first\"")));<NEW_LINE>} else if (link.toString().contains("next")) {<NEW_LINE>assertThat(link.toString(), allOf(startsWith("<http://test>;"), endsWith("rel=\"next\"")));<NEW_LINE>} else if (link.toString().contains("last")) {<NEW_LINE>assertThat(link.toString(), allOf(startsWith("<http://test>;"), endsWith("rel=\"last\"")));<NEW_LINE>} else {<NEW_LINE>fail("invalid link returned");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assertThat(response.getLink("first").toString(), allOf(startsWith("<http://test>;"), endsWith("rel=\"first\"")));<NEW_LINE>assertThat(response.getLink("next").toString(), allOf(startsWith("<http://test>;"), endsWith("rel=\"next\"")));<NEW_LINE>assertThat(response.getLink("last").toString(), allOf(startsWith("<http://test>;"), endsWith("rel=\"last\"")));<NEW_LINE>} | System.out.println("Links:"); |
1,290,508 | public FieldInitializers filter(FieldInitializers fieldsToWrite) {<NEW_LINE>// Create a map to filter with.<NEW_LINE>final SortedSetMultimap<ResourceType, String> symbolsToWrite = MultimapBuilder.enumKeys(ResourceType.class)<MASK><NEW_LINE>for (Map.Entry<ResourceType, Collection<FieldInitializer>> entry : fieldsToWrite.initializers.entrySet()) {<NEW_LINE>for (FieldInitializer initializer : entry.getValue()) {<NEW_LINE>symbolsToWrite.put(entry.getKey(), initializer.getFieldName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Multimap<ResourceType, FieldInitializer> initializersToWrite = MultimapBuilder.enumKeys(ResourceType.class).arrayListValues().build();<NEW_LINE>for (Map.Entry<ResourceType, Collection<String>> entry : symbolsToWrite.asMap().entrySet()) {<NEW_LINE>// Resource type may be missing if resource overriding eliminates resources at the binary<NEW_LINE>// level, which were originally present at the library level.<NEW_LINE>for (FieldInitializer field : initializers.getOrDefault(entry.getKey(), ImmutableList.of())) {<NEW_LINE>if (entry.getValue().contains(field.getFieldName())) {<NEW_LINE>initializersToWrite.put(entry.getKey(), field);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return copyOf(initializersToWrite.asMap());<NEW_LINE>} | .treeSetValues().build(); |
1,192,605 | public static FObject fromJSON(X x, JSONObject json) throws JSONException {<NEW_LINE>String modelName = json.optString("model_", null);<NEW_LINE>if (modelName == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FObject o;<NEW_LINE>try {<NEW_LINE>o = (FObject) x.newInstance(modelName);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>Log.e(LOG_TAG, "Unrecognized model_: \"" + modelName + "\"", e);<NEW_LINE>return null;<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>Log.e(LOG_TAG, <MASK><NEW_LINE>return null;<NEW_LINE>} catch (InstantiationException e) {<NEW_LINE>Log.e(LOG_TAG, "Exception in constructor for \"" + modelName + "\"", e.getCause());<NEW_LINE>return null;<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>Log.e(LOG_TAG, "JSON Object is not descended from FObject - can't happen?", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Iterator<String> it = json.keys();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>String key = it.next();<NEW_LINE>if (key.equals("model_"))<NEW_LINE>continue;<NEW_LINE>o.model().getProperty(key).set(o, json.get(key));<NEW_LINE>}<NEW_LINE>return o;<NEW_LINE>} | "Could not find accessible constructor for \"" + modelName + "\"", e); |
490,379 | protected void calculateOffsets() {<NEW_LINE>super.calculateOffsets();<NEW_LINE>if (!this.text.equals(lastText)) {<NEW_LINE>this.lastText = text;<NEW_LINE>BitmapFont font = style.font;<NEW_LINE>float maxWidthLine = this.getWidth() - (style.background != null ? style.background.getLeftWidth() + style.background.getRightWidth() : 0);<NEW_LINE>linesBreak.clear();<NEW_LINE>int lineStart = 0;<NEW_LINE>int lastSpace = 0;<NEW_LINE>char lastCharacter;<NEW_LINE>Pool<GlyphLayout> layoutPool = Pools.get(GlyphLayout.class);<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < text.length(); i++) {<NEW_LINE>lastCharacter = text.charAt(i);<NEW_LINE>if (lastCharacter == ENTER_DESKTOP || lastCharacter == ENTER_ANDROID) {<NEW_LINE>linesBreak.add(lineStart);<NEW_LINE>linesBreak.add(i);<NEW_LINE>lineStart = i + 1;<NEW_LINE>} else {<NEW_LINE>lastSpace = (continueCursor(i, 0) ? lastSpace : i);<NEW_LINE>layout.setText(font, text.subSequence(lineStart, i + 1));<NEW_LINE>if (layout.width > maxWidthLine && softwrap) {<NEW_LINE>if (lineStart >= lastSpace) {<NEW_LINE>lastSpace = i - 1;<NEW_LINE>}<NEW_LINE>linesBreak.add(lineStart);<NEW_LINE>linesBreak.add(lastSpace + 1);<NEW_LINE>lineStart = lastSpace + 1;<NEW_LINE>lastSpace = lineStart;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>layoutPool.free(layout);<NEW_LINE>// Add last line<NEW_LINE>if (lineStart < text.length()) {<NEW_LINE>linesBreak.add(lineStart);<NEW_LINE>linesBreak.add(text.length());<NEW_LINE>}<NEW_LINE>showCursor();<NEW_LINE>}<NEW_LINE>} | GlyphLayout layout = layoutPool.obtain(); |
641,049 | private void copyMappingXML() {<NEW_LINE>boolean writeableStorage = true;<NEW_LINE>String rawResourceName = null;<NEW_LINE>try {<NEW_LINE>rawResourceName = Environment.getExternalStorageDirectory() + "/Android/data/" + RhodesActivity.safeGetInstance<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.E(TAG, e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int resourceId = RhoExtManager.getResourceId("raw", "keycodemapping");<NEW_LINE>File resourceFile = new File(rawResourceName);<NEW_LINE>boolean fileExists = resourceFile.exists();<NEW_LINE>if (!fileExists && writeableStorage) {<NEW_LINE>try {<NEW_LINE>File f = new File(resourceFile.getParentFile().getAbsolutePath() + "/");<NEW_LINE>boolean suc = f.mkdirs();<NEW_LINE>resourceFile.createNewFile();<NEW_LINE>FileChannel writer = new FileOutputStream(resourceFile, false).getChannel();<NEW_LINE>ReadableByteChannel channel = Channels.newChannel(RhodesActivity.safeGetInstance().getResources().openRawResource(resourceId));<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(1024);<NEW_LINE>while (channel.read(buffer) > 0) {<NEW_LINE>buffer.flip();<NEW_LINE>writer.write(buffer);<NEW_LINE>buffer.clear();<NEW_LINE>}<NEW_LINE>writer.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>resourceFile.delete();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.E(TAG, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>}<NEW_LINE>} | ().getPackageName() + "/keycodemapping.xml"; |
1,241,785 | protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite container = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite tableArea = new Composite(container, SWT.NONE);<NEW_LINE>GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 300).applyTo(tableArea);<NEW_LINE>TableColumnLayout layout = new TableColumnLayout();<NEW_LINE>tableArea.setLayout(layout);<NEW_LINE>tableViewer = new TableViewer(tableArea, SWT.BORDER | SWT.MULTI);<NEW_LINE>CopyPasteSupport.enableFor(tableViewer);<NEW_LINE>final Table table = tableViewer.getTable();<NEW_LINE>table.setHeaderVisible(false);<NEW_LINE>table.setLinesVisible(false);<NEW_LINE>TableViewerColumn column = new TableViewerColumn(tableViewer, SWT.None);<NEW_LINE>layout.setColumnData(column.getColumn(), new ColumnWeightData(100));<NEW_LINE>tableViewer.setLabelProvider(new LabelProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Image getImage(Object element) {<NEW_LINE>return Images.TEXT.image();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tableViewer.setContentProvider(ArrayContentProvider.getInstance());<NEW_LINE>tableViewer.setInput(periods);<NEW_LINE>tableViewer.getTable().addKeyListener(KeyListener.keyReleasedAdapter(e -> {<NEW_LINE>if (e.character == SWT.BS || e.character == SWT.DEL)<NEW_LINE>deleteSelectedItems();<NEW_LINE>}));<NEW_LINE>setupDnD();<NEW_LINE>new ContextMenu(tableViewer.getTable(), this::fillContextMenu).hook();<NEW_LINE>Label info = new <MASK><NEW_LINE>info.setText(TextUtil.tooltip(Messages.LabelReportingPeriodEditTooltip));<NEW_LINE>return container;<NEW_LINE>} | Label(container, SWT.NONE); |
1,478,491 | public void marshal(Path samplesRoot, Path imagesRoot) {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>{<NEW_LINE>// Samples<NEW_LINE>final Path folderPath = samplesRoot.resolve(descriptor.getName());<NEW_LINE>Files.createDirectories(folderPath);<NEW_LINE>final Path samplesPath = folderPath.resolve(SAMPLES_FILE_NAME);<NEW_LINE>Jaxb.marshal(new SampleList(this), samplesPath, getJaxbContext());<NEW_LINE>logger.info("Stored {}", samplesPath);<NEW_LINE>// Tribes<NEW_LINE>if (!getTribes().isEmpty()) {<NEW_LINE>final Path tribesPath = folderPath.resolve(SampleSheet.TRIBES_FILE_NAME);<NEW_LINE>new TribeList(this).marshal(tribesPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Binary<NEW_LINE>if ((image != null) && !imageSaved) {<NEW_LINE>final Path folderPath = imagesRoot.resolve(descriptor.getName());<NEW_LINE>Files.createDirectories(folderPath);<NEW_LINE>final Path imagePath = folderPath.resolve(IMAGE_FILE_NAME);<NEW_LINE>Jaxb.marshal(image, imagePath, getJaxbContext());<NEW_LINE>imageSaved = true;<NEW_LINE>logger.info("Stored {}", imagePath);<NEW_LINE>}<NEW_LINE>} catch (IOException | JAXBException | XMLStreamException ex) {<NEW_LINE>logger.error("Error marshalling " + this + " " + ex, ex);<NEW_LINE>}<NEW_LINE>} | logger.debug("Marshalling {}", this); |
451,404 | public OceanBaseExpression generateConstant() {<NEW_LINE>ConstantType[] values;<NEW_LINE>if (state.usesPQS()) {<NEW_LINE>values = ConstantType.valuesPQS();<NEW_LINE>} else {<NEW_LINE>values = ConstantType.values();<NEW_LINE>}<NEW_LINE>OceanBaseConstant constant;<NEW_LINE>switch(Randomly.fromOptions(values)) {<NEW_LINE>case INT:<NEW_LINE>return OceanBaseConstant.createIntConstant((int) state.<MASK><NEW_LINE>case NULL:<NEW_LINE>return OceanBaseConstant.createNullConstant();<NEW_LINE>case STRING:<NEW_LINE>String string = state.getRandomly().getString().replace("\\", "").replace("\n", "").replace("\t", "");<NEW_LINE>constant = OceanBaseConstant.createStringConstant(string);<NEW_LINE>return constant;<NEW_LINE>case DOUBLE:<NEW_LINE>double val = state.getRandomly().getDouble();<NEW_LINE>constant = new OceanBaseDoubleConstant(val);<NEW_LINE>return constant;<NEW_LINE>default:<NEW_LINE>throw new AssertionError();<NEW_LINE>}<NEW_LINE>} | getRandomly().getInteger()); |
655,885 | public static void convert(InterleavedS64 input, InterleavedI16 output) {<NEW_LINE>if (input.isSubimage() || output.isSubimage()) {<NEW_LINE>final int N = input.width * input.getNumBands();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, input.height, y -> {<NEW_LINE>for (int y = 0; y < input.height; y++) {<NEW_LINE>int indexSrc = input.getIndex(0, y);<NEW_LINE>int indexDst = <MASK><NEW_LINE>for (int x = 0; x < N; x++) {<NEW_LINE>output.data[indexDst++] = (short) (input.data[indexSrc++]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>final int N = input.width * input.height * input.getNumBands();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(0,N,(i0,i1)->{<NEW_LINE>int i0 = 0, i1 = N;<NEW_LINE>for (int i = i0; i < i1; i++) {<NEW_LINE>output.data[i] = (short) (input.data[i]);<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>}<NEW_LINE>} | output.getIndex(0, y); |
1,383,668 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String eplStatement = "@public create context StartThenTwoSeconds start StartContextEvent end after 2 seconds";<NEW_LINE>env.compileDeploy(eplStatement, path);<NEW_LINE>String aggStatement = "@name('select') context StartThenTwoSeconds " + "select account, count(*) as totalCount " + "from PayloadEvent " + "group by account " + "output snapshot when terminated";<NEW_LINE>env.compileDeploy(aggStatement, path);<NEW_LINE>env.statement("select").addListener(new UpdateListener() {<NEW_LINE><NEW_LINE>public void update(EventBean[] newEvents, EventBean[] oldEvents, EPStatement statement, EPRuntime runtime) {<NEW_LINE>// no action, still listening to make sure select-clause evaluates<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// start context<NEW_LINE>env.sendEventBean(new StartContextEvent());<NEW_LINE>// start threads<NEW_LINE>List<Thread> threads = new ArrayList<Thread>();<NEW_LINE>List<MyRunnable> runnables <MASK><NEW_LINE>for (int i = 0; i < 8; i++) {<NEW_LINE>MyRunnable myRunnable = new MyRunnable(env.runtime());<NEW_LINE>runnables.add(myRunnable);<NEW_LINE>Thread thread = new Thread(myRunnable, this.getClass().getSimpleName() + "-Thread" + i);<NEW_LINE>thread.start();<NEW_LINE>threads.add(thread);<NEW_LINE>}<NEW_LINE>// join<NEW_LINE>for (Thread thread : threads) {<NEW_LINE>threadJoin(thread);<NEW_LINE>}<NEW_LINE>// assert<NEW_LINE>for (MyRunnable runnable : runnables) {<NEW_LINE>assertNull(runnable.exception);<NEW_LINE>}<NEW_LINE>env.undeployAll();<NEW_LINE>} | = new ArrayList<MyRunnable>(); |
348,724 | public static boolean swapCaseMultiByteComplex(Encoding enc, CodeRange originalCodeRange, RopeBuilder builder, int caseMappingOptions, Node node) {<NEW_LINE>byte[] buf = new byte[CASE_MAP_BUFFER_SIZE];<NEW_LINE>final IntHolder flagP = new IntHolder();<NEW_LINE>flagP.value = caseMappingOptions | Config.CASE_UPCASE | Config.CASE_DOWNCASE;<NEW_LINE>boolean modified = false;<NEW_LINE>int s = 0;<NEW_LINE>byte[] bytes = builder.getUnsafeBytes();<NEW_LINE>while (s < bytes.length) {<NEW_LINE>int c = codePoint(enc, originalCodeRange, bytes, <MASK><NEW_LINE>if (enc.isUpper(c) || enc.isLower(c)) {<NEW_LINE>s += caseMapChar(c, enc, bytes, s, builder, flagP, buf);<NEW_LINE>modified = true;<NEW_LINE>if (bytes != builder.getUnsafeBytes()) {<NEW_LINE>bytes = builder.getUnsafeBytes();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>s += codeLength(enc, c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return modified;<NEW_LINE>} | s, bytes.length, node); |
825,837 | public static GetInstanceListResponse unmarshall(GetInstanceListResponse getInstanceListResponse, UnmarshallerContext _ctx) {<NEW_LINE>getInstanceListResponse.setRequestId(_ctx.stringValue("GetInstanceListResponse.RequestId"));<NEW_LINE>getInstanceListResponse.setTotalCount(_ctx.integerValue("GetInstanceListResponse.TotalCount"));<NEW_LINE>getInstanceListResponse.setMessage(_ctx.stringValue("GetInstanceListResponse.Message"));<NEW_LINE>getInstanceListResponse.setPageSize(_ctx.integerValue("GetInstanceListResponse.PageSize"));<NEW_LINE>getInstanceListResponse.setPageNumber(_ctx.integerValue("GetInstanceListResponse.PageNumber"));<NEW_LINE>getInstanceListResponse.setHttpStatusCode(_ctx.integerValue("GetInstanceListResponse.HttpStatusCode"));<NEW_LINE>getInstanceListResponse.setCode(_ctx.stringValue("GetInstanceListResponse.Code"));<NEW_LINE>getInstanceListResponse.setSuccess(_ctx.booleanValue("GetInstanceListResponse.Success"));<NEW_LINE>List<CommodityInstancesItem> commodityInstances = new ArrayList<CommodityInstancesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetInstanceListResponse.CommodityInstances.Length"); i++) {<NEW_LINE>CommodityInstancesItem commodityInstancesItem = new CommodityInstancesItem();<NEW_LINE>commodityInstancesItem.setInstanceId(_ctx.stringValue("GetInstanceListResponse.CommodityInstances[" + i + "].InstanceId"));<NEW_LINE>commodityInstancesItem.setName(_ctx.stringValue<MASK><NEW_LINE>commodityInstances.add(commodityInstancesItem);<NEW_LINE>}<NEW_LINE>getInstanceListResponse.setCommodityInstances(commodityInstances);<NEW_LINE>return getInstanceListResponse;<NEW_LINE>} | ("GetInstanceListResponse.CommodityInstances[" + i + "].Name")); |
707,186 | protected boolean registerProvider(DataStoreProvider provider) {<NEW_LINE>Map<String, Object> copyParams = new HashMap<String, Object>();<NEW_LINE>String providerName = provider.getName();<NEW_LINE>if (providerMap.get(providerName) != null) {<NEW_LINE>s_logger.debug("Did not register data store provider, provider name: " + providerName + " is not unique");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>s_logger.debug("registering data store provider:" + provider.getName());<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>boolean registrationResult = provider.configure(copyParams);<NEW_LINE>if (!registrationResult) {<NEW_LINE>providerMap.remove(providerName);<NEW_LINE>s_logger.debug("Failed to register data store provider: " + providerName);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<DataStoreProviderType> types = provider.getTypes();<NEW_LINE>if (types.contains(DataStoreProviderType.PRIMARY)) {<NEW_LINE>primaryDataStoreProviderMgr.registerDriver(provider.getName(), (PrimaryDataStoreDriver) provider.getDataStoreDriver());<NEW_LINE>primaryDataStoreProviderMgr.registerHostListener(provider.getName(), provider.getHostListener());<NEW_LINE>} else if (types.contains(DataStoreProviderType.IMAGE)) {<NEW_LINE>imageStoreProviderMgr.registerDriver(provider.getName(), (ImageStoreDriver) provider.getDataStoreDriver());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.debug("configure provider failed", e);<NEW_LINE>providerMap.remove(providerName);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | providerMap.put(providerName, provider); |
1,723,539 | public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {<NEW_LINE>super.configure(name, params);<NEW_LINE>Map<String, String> configs = _configDao.getConfiguration(params);<NEW_LINE>if (params != null) {<NEW_LINE>mergeConfigs(configs, params);<NEW_LINE>}<NEW_LINE>senderAddress = configs.get(<MASK><NEW_LINE>_lockAccountEnforcement = BooleanUtils.toBoolean(configs.get(QuotaConfig.QuotaEnableEnforcement.key()));<NEW_LINE>String smtpUsername = configs.get(QuotaConfig.QuotaSmtpUser.key());<NEW_LINE>String namespace = "quota.usage.smtp";<NEW_LINE>configs.put(String.format("%s.debug", namespace), String.valueOf(_smtpDebug));<NEW_LINE>configs.put(String.format("%s.username", namespace), smtpUsername);<NEW_LINE>mailSender = new SMTPMailSender(configs, namespace);<NEW_LINE>return true;<NEW_LINE>} | QuotaConfig.QuotaSmtpSender.key()); |
1,811,199 | public View createView() {<NEW_LINE>final View view = inflateLayout(R.layout.cache_filter_generic_string);<NEW_LINE>this.binding = CacheFilterGenericStringBinding.bind(view);<NEW_LINE>selectSpinner.<MASK><NEW_LINE>selectSpinner.setValues(Arrays.asList(StringFilter.StringFilterType.values())).setDisplayMapper(StringFilter.StringFilterType::toUserDisplayableString).setChangeListener(sft -> {<NEW_LINE>final boolean textEnabled = sft != StringFilter.StringFilterType.IS_NOT_PRESENT && sft != StringFilter.StringFilterType.IS_PRESENT;<NEW_LINE>binding.searchtext.setVisibility(textEnabled ? VISIBLE : GONE);<NEW_LINE>binding.matchCase.setVisibility(textEnabled ? VISIBLE : GONE);<NEW_LINE>}, true).set(StringFilter.getDefaultFilterType());<NEW_LINE>this.binding.itemInfo.setOnClickListener(d -> SimpleDialog.of(getActivity()).setMessage(R.string.cache_filter_stringfilter_info).show());<NEW_LINE>// initialize autocomplete,<NEW_LINE>if (this.autoTextCompleteFunction != null) {<NEW_LINE>final AutoCompleteTextView actv = (AutoCompleteTextView) binding.searchtext.getEditText();<NEW_LINE>final AutoCompleteAdapter adapter = new AutoCompleteAdapter(getActivity(), android.R.layout.simple_dropdown_item_1line, this.autoTextCompleteFunction);<NEW_LINE>actv.setAdapter(adapter);<NEW_LINE>}<NEW_LINE>return view;<NEW_LINE>} | setTextView(this.binding.select); |
1,705,275 | private ScopeStore createScopeWrapper(StoreFactory storeFactory) {<NEW_LINE>return new ScopeStore() {<NEW_LINE><NEW_LINE>ScopeStore delegate = storeFactory.getScopeStore();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Scope create(ResourceServer resourceServer, String name) {<NEW_LINE>return delegate.create(resourceServer, name);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Scope create(ResourceServer resourceServer, String id, String name) {<NEW_LINE>return delegate.create(resourceServer, id, name);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void delete(String id) {<NEW_LINE>Scope scope = findById(null, id);<NEW_LINE>PermissionTicketStore ticketStore = AuthorizationProvider.this<MASK><NEW_LINE>List<PermissionTicket> permissions = ticketStore.findByScope(scope.getResourceServer(), scope);<NEW_LINE>for (PermissionTicket permission : permissions) {<NEW_LINE>ticketStore.delete(permission.getId());<NEW_LINE>}<NEW_LINE>delegate.delete(id);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Scope findById(ResourceServer resourceServer, String id) {<NEW_LINE>return delegate.findById(resourceServer, id);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Scope findByName(ResourceServer resourceServer, String name) {<NEW_LINE>return delegate.findByName(resourceServer, name);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public List<Scope> findByResourceServer(ResourceServer resourceServer) {<NEW_LINE>return delegate.findByResourceServer(resourceServer);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public List<Scope> findByResourceServer(ResourceServer resourceServer, Map<Scope.FilterOption, String[]> attributes, Integer firstResult, Integer maxResults) {<NEW_LINE>return delegate.findByResourceServer(resourceServer, attributes, firstResult, maxResults);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | .getStoreFactory().getPermissionTicketStore(); |
766,073 | private TreeMap<String, TreeSet<Model>> buildMap() {<NEW_LINE>final Spec currentSpec = ToolboxHandle.getCurrentSpec();<NEW_LINE>if (currentSpec == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final TreeMap<String, TreeSet<Model>> projectModelMap = new TreeMap<>();<NEW_LINE>try {<NEW_LINE>final IWorkspace iws = ResourcesPlugin.getWorkspace();<NEW_LINE>final IWorkspaceRoot root = iws.getRoot();<NEW_LINE>final IProject[] projects = root.getProjects();<NEW_LINE>for (final IProject project : projects) {<NEW_LINE>if (!specProject.equals(project)) {<NEW_LINE>projectModelMap.put(project.getName(), new TreeSet<>(MODEL_SORTER));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String currentProjectName = specProject.getName();<NEW_LINE>final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();<NEW_LINE>final ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType(TLCModelLaunchDelegate.LAUNCH_CONFIGURATION_TYPE);<NEW_LINE>final ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(launchConfigurationType);<NEW_LINE>for (final ILaunchConfiguration launchConfiguration : launchConfigurations) {<NEW_LINE>final String projectName = launchConfiguration.getAttribute(IConfigurationConstants.SPEC_NAME, "-l!D!q_-l!D!q_-l!D!q_");<NEW_LINE>if (!projectName.equals(currentProjectName)) {<NEW_LINE>final TreeSet<Model> models = projectModelMap.get(projectName);<NEW_LINE>if (models != null) {<NEW_LINE>final Model model = launchConfiguration.getAdapter(Model.class);<NEW_LINE>if (!model.isSnapshot()) {<NEW_LINE>models.add(model);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>TLCUIActivator.getDefault().logError("Could not generate model map for [" + projectName + "]!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final CoreException e) {<NEW_LINE>TLCUIActivator.getDefault().logError("Building foreign model map.", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return projectModelMap;<NEW_LINE>} | IProject specProject = currentSpec.getProject(); |
232,373 | public void copy(SaveTestPlanRequest request) {<NEW_LINE>checkQuota(request, true);<NEW_LINE>// copy test<NEW_LINE>LoadTestWithBLOBs copy = loadTestMapper.selectByPrimaryKey(request.getId());<NEW_LINE>String copyName = copy.getName() + " Copy";<NEW_LINE>if (StringUtils.length(copyName) > 30) {<NEW_LINE>MSException.throwException(Translator.get("load_test_name_length"));<NEW_LINE>}<NEW_LINE>copy.setId(UUID.randomUUID().toString());<NEW_LINE>copy.setName(copyName);<NEW_LINE>copy.setCreateTime(System.currentTimeMillis());<NEW_LINE>copy.setUpdateTime(System.currentTimeMillis());<NEW_LINE>copy.setStatus(<MASK><NEW_LINE>copy.setUserId(Objects.requireNonNull(SessionUtils.getUser()).getId());<NEW_LINE>copy.setCreateUser(Objects.requireNonNull(SessionUtils.getUser()).getId());<NEW_LINE>copy.setNum(getNextNum(copy.getProjectId()));<NEW_LINE>copy.setRefId(copy.getId());<NEW_LINE>copy.setLatest(true);<NEW_LINE>loadTestMapper.insert(copy);<NEW_LINE>// copy test file<NEW_LINE>copyLoadTestFiles(request.getId(), copy.getId());<NEW_LINE>request.setId(copy.getId());<NEW_LINE>} | APITestStatus.Saved.name()); |
976,603 | private ClientBroker.RegisterRequestC2B createBrokerRegisterRequest(Partition partition) {<NEW_LINE>ClientBroker.RegisterRequestC2B.Builder builder = ClientBroker.RegisterRequestC2B.newBuilder();<NEW_LINE>builder.setClientId(consumerId);<NEW_LINE>builder.setGroupName(this.consumerConfig.getConsumerGroup());<NEW_LINE>builder.setOpType(RpcConstants.MSG_OPTYPE_REGISTER);<NEW_LINE>builder.setTopicName(partition.getTopic());<NEW_LINE>builder.<MASK><NEW_LINE>builder.setQryPriorityId(rmtDataCache.getQryPriorityId());<NEW_LINE>builder.setReadStatus(getGroupInitReadStatus(rmtDataCache.bookPartition(partition.getPartitionKey())));<NEW_LINE>TopicProcessor topicProcessor = this.consumeSubInfo.getTopicProcessor(partition.getTopic());<NEW_LINE>if (topicProcessor != null && topicProcessor.getFilterConds() != null) {<NEW_LINE>builder.addAllFilterCondStr(topicProcessor.getFilterConds());<NEW_LINE>}<NEW_LINE>if (this.isFirst.get() && consumeSubInfo.isRequireBound() && consumeSubInfo.getIsNotAllocated()) {<NEW_LINE>Long currOffset = consumeSubInfo.getAssignedPartOffset(partition.getPartitionKey());<NEW_LINE>if (currOffset != null && currOffset >= 0) {<NEW_LINE>builder.setCurrOffset(currOffset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.setAuthInfo(genBrokerAuthenticInfo(partition.getBrokerId(), false));<NEW_LINE>return builder.build();<NEW_LINE>} | setPartitionId(partition.getPartitionId()); |
941,150 | final ListBotRecommendationsResult executeListBotRecommendations(ListBotRecommendationsRequest listBotRecommendationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listBotRecommendationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListBotRecommendationsRequest> request = null;<NEW_LINE>Response<ListBotRecommendationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListBotRecommendationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listBotRecommendationsRequest));<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, "Lex Models V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListBotRecommendations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListBotRecommendationsResult>> 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 ListBotRecommendationsResultJsonUnmarshaller()); |
671,076 | private void mountLogin() {<NEW_LINE>// force a post if otherwise<NEW_LINE>login.method(HttpMethod.POST).order(order - 1).handler(ctx -> {<NEW_LINE>try {<NEW_LINE>// might throw runtime exception if there's no json or is bad formed<NEW_LINE>final JsonObject webauthnLogin = ctx.body().asJsonObject();<NEW_LINE>final Session session = ctx.session();<NEW_LINE>if (webauthnLogin == null || !containsRequiredString(webauthnLogin, "name")) {<NEW_LINE>ctx.fail(400, new IllegalArgumentException("Request missing 'name' field"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// input basic validation is OK<NEW_LINE>if (session == null) {<NEW_LINE>ctx.fail(500, new IllegalStateException("No session or session handler is missing."));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String username = webauthnLogin.getString("name");<NEW_LINE>// STEP 18 Generate assertion<NEW_LINE>authProvider.getCredentialsOptions(username, generateServerGetAssertion -> {<NEW_LINE>if (generateServerGetAssertion.failed()) {<NEW_LINE>ctx.fail(generateServerGetAssertion.cause());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JsonObject getAssertion = generateServerGetAssertion.result();<NEW_LINE>session.put("challenge", getAssertion.getString("challenge")).put("username", username);<NEW_LINE>ok(ctx, getAssertion);<NEW_LINE>});<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE><MASK><NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>ctx.fail(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ctx.fail(400, e); |
1,053,222 | private void createFilterToolBarUI(JToolBar toolbar, FiltersDescriptor filtersDesc) {<NEW_LINE>toolbar.removeAll();<NEW_LINE>// create toggle buttons<NEW_LINE>int filterCount = filtersDesc.getFilterCount();<NEW_LINE>ArrayList<JToggleButton> toggles = new ArrayList<JToggleButton>(filterCount);<NEW_LINE>JToggleButton toggleButton = null;<NEW_LINE>for (int i = 0; i < filterCount; i++) {<NEW_LINE>toggleButton = createToggle(filtersDesc, i);<NEW_LINE>toggles.add(toggleButton);<NEW_LINE>}<NEW_LINE>// add toggle buttons<NEW_LINE>for (int i = 0; i < toggles.size(); i++) {<NEW_LINE>JToggleButton curToggle = toggles.get(i);<NEW_LINE>curToggle.addActionListener(new ToggleButtonActionListener(i));<NEW_LINE>toolbar.add(curToggle);<NEW_LINE>if (i != toggles.size() - 1) {<NEW_LINE>toolbar.addSeparator(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | new Dimension(3, 0)); |
1,727,102 | private static void selectMediaType(Fragment fragment, @NonNull String type, @Nullable String[] extraMimeType, int requestCode) {<NEW_LINE>final Intent intent = new Intent();<NEW_LINE>intent.setType(type);<NEW_LINE>if (extraMimeType != null) {<NEW_LINE>intent.putExtra(Intent.EXTRA_MIME_TYPES, extraMimeType);<NEW_LINE>}<NEW_LINE>intent.setAction(Intent.ACTION_OPEN_DOCUMENT);<NEW_LINE>try {<NEW_LINE>fragment.startActivityForResult(intent, requestCode);<NEW_LINE>return;<NEW_LINE>} catch (ActivityNotFoundException anfe) {<NEW_LINE>Log.w(TAG, "couldn't complete ACTION_OPEN_DOCUMENT, no activity found. falling back.");<NEW_LINE>}<NEW_LINE>intent.setAction(Intent.ACTION_GET_CONTENT);<NEW_LINE>try {<NEW_LINE>fragment.startActivityForResult(intent, requestCode);<NEW_LINE>} catch (ActivityNotFoundException anfe) {<NEW_LINE>Log.w(TAG, "couldn't complete ACTION_GET_CONTENT intent, no activity found. falling back.");<NEW_LINE>Toast.makeText(fragment.requireContext(), R.string.AttachmentManager_cant_open_media_selection, <MASK><NEW_LINE>}<NEW_LINE>} | Toast.LENGTH_LONG).show(); |
175,410 | private void trimRead(final ReadData read, final int templateIndex) {<NEW_LINE>byte[] bases = read.getBases();<NEW_LINE>byte[<MASK><NEW_LINE>if (trimmingQuality != null) {<NEW_LINE>int index = TrimmingUtil.findQualityTrimPoint(quals, trimmingQuality);<NEW_LINE>// Trim to a minimum of MIN_TRIMMED_LENGTH<NEW_LINE>if (index < MIN_TRIMMED_LENGTH) {<NEW_LINE>index = MIN_TRIMMED_LENGTH;<NEW_LINE>}<NEW_LINE>quals = Arrays.copyOfRange(quals, 0, index);<NEW_LINE>bases = Arrays.copyOfRange(bases, 0, index);<NEW_LINE>}<NEW_LINE>if (adapterMarker != null) {<NEW_LINE>Tuple<AdapterPair, Integer> adapterPairAndIndex = adapterMarker.findAdapterPairAndIndexForSingleRead(bases, templateIndex);<NEW_LINE>if (adapterPairAndIndex != null) {<NEW_LINE>int index = adapterPairAndIndex.b;<NEW_LINE>// Trim to a minimum of MIN_TRIMMED_LENGTH<NEW_LINE>if (index < MIN_TRIMMED_LENGTH) {<NEW_LINE>index = MIN_TRIMMED_LENGTH;<NEW_LINE>}<NEW_LINE>quals = Arrays.copyOfRange(quals, 0, index);<NEW_LINE>bases = Arrays.copyOfRange(bases, 0, index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>read.setBases(bases);<NEW_LINE>read.setQualities(quals);<NEW_LINE>} | ] quals = read.getQualities(); |
670,863 | public static DeleteModelResponse unmarshall(DeleteModelResponse deleteModelResponse, UnmarshallerContext _ctx) {<NEW_LINE>deleteModelResponse.setRequestId(_ctx.stringValue("DeleteModelResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setAppId(_ctx.stringValue("DeleteModelResponse.Data.AppId"));<NEW_LINE>data.setContent(_ctx.mapValue("DeleteModelResponse.Data.Content"));<NEW_LINE>data.setCreateTime(_ctx.stringValue("DeleteModelResponse.Data.CreateTime"));<NEW_LINE>data.setDescription(_ctx.stringValue("DeleteModelResponse.Data.Description"));<NEW_LINE>data.setId(_ctx.stringValue("DeleteModelResponse.Data.Id"));<NEW_LINE>data.setLinkModelId(_ctx.stringValue("DeleteModelResponse.Data.LinkModelId"));<NEW_LINE>data.setLinkModuleId(_ctx.stringValue("DeleteModelResponse.Data.LinkModuleId"));<NEW_LINE>data.setLinked(_ctx.booleanValue("DeleteModelResponse.Data.Linked"));<NEW_LINE>data.setModelId(_ctx.stringValue("DeleteModelResponse.Data.ModelId"));<NEW_LINE>data.setModifiedTime(_ctx.stringValue("DeleteModelResponse.Data.ModifiedTime"));<NEW_LINE>data.setModuleId(_ctx.stringValue("DeleteModelResponse.Data.ModuleId"));<NEW_LINE>data.setModelName(_ctx.stringValue("DeleteModelResponse.Data.ModelName"));<NEW_LINE>data.setProps<MASK><NEW_LINE>data.setRevision(_ctx.integerValue("DeleteModelResponse.Data.Revision"));<NEW_LINE>data.setSchemaVersion(_ctx.stringValue("DeleteModelResponse.Data.SchemaVersion"));<NEW_LINE>data.setModelStatus(_ctx.stringValue("DeleteModelResponse.Data.ModelStatus"));<NEW_LINE>data.setSubType(_ctx.stringValue("DeleteModelResponse.Data.SubType"));<NEW_LINE>data.setModelType(_ctx.stringValue("DeleteModelResponse.Data.ModelType"));<NEW_LINE>data.setVisibility(_ctx.stringValue("DeleteModelResponse.Data.Visibility"));<NEW_LINE>List<Map<Object, Object>> attributes = _ctx.listMapValue("DeleteModelResponse.Data.Attributes");<NEW_LINE>data.setAttributes(attributes);<NEW_LINE>deleteModelResponse.setData(data);<NEW_LINE>return deleteModelResponse;<NEW_LINE>} | (_ctx.mapValue("DeleteModelResponse.Data.Props")); |
559,583 | public void validate(final Processor<FullData, FullData> processor, final ProcessingReport report, final MessageBundle bundle, final FullData data) throws ProcessingException {<NEW_LINE>final JsonNode instance = data.getInstance().getNode();<NEW_LINE>final NodeType type = NodeType.getNodeType(instance);<NEW_LINE>final boolean primitiveOK = types.contains(type);<NEW_LINE>if (primitiveOK)<NEW_LINE>return;<NEW_LINE>final ObjectNode fullReport = FACTORY.objectNode();<NEW_LINE>final SchemaTree tree = data.getSchema();<NEW_LINE>final JsonPointer schemaPointer = tree.getPointer();<NEW_LINE>ListProcessingReport subReport;<NEW_LINE>JsonPointer ptr;<NEW_LINE>FullData newData;<NEW_LINE>int nrSuccess = 0;<NEW_LINE>for (final int index : schemas) {<NEW_LINE>subReport = new ListProcessingReport(report.getLogLevel(), LogLevel.FATAL);<NEW_LINE>ptr = schemaPointer.append(JsonPointer.of(keyword, index));<NEW_LINE>newData = data.withSchema(tree.setPointer(ptr));<NEW_LINE>processor.process(subReport, newData);<NEW_LINE>fullReport.set(ptr.toString(), subReport.asJson());<NEW_LINE>if (subReport.isSuccess())<NEW_LINE>nrSuccess++;<NEW_LINE>}<NEW_LINE>if (nrSuccess >= 1)<NEW_LINE>return;<NEW_LINE>if (!types.isEmpty())<NEW_LINE>report.error(newMsg(data, bundle, "err.common.typeNoMatch").putArgument("found", type).putArgument("expected", toArrayNode(types)));<NEW_LINE>if (!schemas.isEmpty())<NEW_LINE>report.error(newMsg(data, bundle, "err.common.schema.noMatch").putArgument("nrSchemas", schemas.size())<MASK><NEW_LINE>} | .put("reports", fullReport)); |
667,668 | public Builder mergeFrom(emu.grasscutter.net.proto.EntityAiSyncNotifyOuterClass.EntityAiSyncNotify other) {<NEW_LINE>if (other == emu.grasscutter.net.proto.EntityAiSyncNotifyOuterClass.EntityAiSyncNotify.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (infoListBuilder_ == null) {<NEW_LINE>if (!other.infoList_.isEmpty()) {<NEW_LINE>if (infoList_.isEmpty()) {<NEW_LINE>infoList_ = other.infoList_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureInfoListIsMutable();<NEW_LINE>infoList_.addAll(other.infoList_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.infoList_.isEmpty()) {<NEW_LINE>if (infoListBuilder_.isEmpty()) {<NEW_LINE>infoListBuilder_.dispose();<NEW_LINE>infoListBuilder_ = null;<NEW_LINE>infoList_ = other.infoList_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>infoListBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getInfoListFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>infoListBuilder_.addAllMessages(other.infoList_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!other.localAvatarAlertedMonsterList_.isEmpty()) {<NEW_LINE>if (localAvatarAlertedMonsterList_.isEmpty()) {<NEW_LINE>localAvatarAlertedMonsterList_ = other.localAvatarAlertedMonsterList_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>} else {<NEW_LINE>ensureLocalAvatarAlertedMonsterListIsMutable();<NEW_LINE>localAvatarAlertedMonsterList_.addAll(other.localAvatarAlertedMonsterList_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>} | this.mergeUnknownFields(other.unknownFields); |
3,266 | public ChangeInfo unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ChangeInfo changeInfo = new ChangeInfo();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return changeInfo;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Id", targetDepth)) {<NEW_LINE>changeInfo.setId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>changeInfo.setStatus(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("SubmittedAt", targetDepth)) {<NEW_LINE>changeInfo.setSubmittedAt(DateStaxUnmarshallerFactory.getInstance(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Comment", targetDepth)) {<NEW_LINE>changeInfo.setComment(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return changeInfo;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "iso8601").unmarshall(context)); |
1,619,514 | private void updateWhenTextView(View view) {<NEW_LINE><MASK><NEW_LINE>// Set the date and repeats (if any)<NEW_LINE>String localTimezone = Utils.getTimeZone(mActivity, mTZUpdater);<NEW_LINE>String displayedDatetime = Utils.getDisplayedDatetime(mStartMillis, mEndMillis, System.currentTimeMillis(), localTimezone, mAllDay, context);<NEW_LINE>String displayedTimezone = null;<NEW_LINE>if (!mAllDay) {<NEW_LINE>displayedTimezone = Utils.getDisplayedTimezone(mStartMillis, localTimezone, mEventCursor.getString(EVENT_INDEX_EVENT_TIMEZONE));<NEW_LINE>}<NEW_LINE>// Display the datetime. Make the timezone (if any) transparent.<NEW_LINE>if (displayedTimezone == null) {<NEW_LINE>setTextCommon(view, R.id.when_datetime, displayedDatetime);<NEW_LINE>} else {<NEW_LINE>int timezoneIndex = displayedDatetime.length();<NEW_LINE>displayedDatetime += " " + displayedTimezone;<NEW_LINE>SpannableStringBuilder sb = new SpannableStringBuilder(displayedDatetime);<NEW_LINE>ForegroundColorSpan transparentColorSpan = new ForegroundColorSpan(Utils.getAdaptiveTextColor(context, context.getResources().getColor(R.color.event_info_headline_transparent_color), mCurrentColor));<NEW_LINE>sb.setSpan(transparentColorSpan, timezoneIndex, displayedDatetime.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);<NEW_LINE>setTextCommon(view, R.id.when_datetime, sb);<NEW_LINE>}<NEW_LINE>} | Context context = view.getContext(); |
710,533 | public void contentsChanged(@Nonnull VirtualFileEvent event) {<NEW_LINE>if (event.getRequestor() != null || !isMy(event)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>E scheme = findSchemeFor(event.<MASK><NEW_LINE>T oldCurrentScheme = null;<NEW_LINE>if (scheme != null) {<NEW_LINE>oldCurrentScheme = getCurrentScheme();<NEW_LINE>// noinspection unchecked<NEW_LINE>removeScheme((T) scheme);<NEW_LINE>myProcessor.onSchemeDeleted(scheme);<NEW_LINE>}<NEW_LINE>E readScheme = readSchemeFromFile(event.getFile(), true, false);<NEW_LINE>if (readScheme != null) {<NEW_LINE>myProcessor.initScheme(readScheme);<NEW_LINE>myProcessor.onSchemeAdded(readScheme);<NEW_LINE>T newCurrentScheme = getCurrentScheme();<NEW_LINE>if (oldCurrentScheme != null && newCurrentScheme == null) {<NEW_LINE>setCurrentSchemeName(readScheme.getName());<NEW_LINE>newCurrentScheme = getCurrentScheme();<NEW_LINE>}<NEW_LINE>if (oldCurrentScheme != newCurrentScheme) {<NEW_LINE>myProcessor.onCurrentSchemeChanged((E) oldCurrentScheme);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getFile().getName()); |
1,428,677 | private MergingReceiverGeneratorBase createMerger() {<NEW_LINE>stats.startSetup();<NEW_LINE>final CodeGenerator<MergingReceiverGeneratorBase> cg = CodeGenerator.get(MergingReceiverGeneratorBase.TEMPLATE_DEFINITION, context.getOptions());<NEW_LINE>cg.plainJavaCapable(true);<NEW_LINE>// Uncomment out this line to debug the generated code.<NEW_LINE>// cg.saveCodeForDebugging(true);<NEW_LINE>final ClassGenerator<MergingReceiverGeneratorBase> g = cg.getRoot();<NEW_LINE>ExpandableHyperContainer batch = null;<NEW_LINE>boolean first = true;<NEW_LINE>for (final RecordBatchLoader loader : batchLoaders) {<NEW_LINE>if (first) {<NEW_LINE>batch = new ExpandableHyperContainer(loader);<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>batch.addBatch(loader);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>generateComparisons(g, batch);<NEW_LINE>g.setMappingSet(COPIER_MAPPING_SET);<NEW_LINE>CopyUtil.<MASK><NEW_LINE>g.setMappingSet(MAIN_MAPPING);<NEW_LINE>final MergingReceiverGeneratorBase merger = context.getImplementationClass(cg);<NEW_LINE>merger.doSetup(context, batch, container);<NEW_LINE>return merger;<NEW_LINE>} catch (SchemaChangeException e) {<NEW_LINE>throw schemaChangeException(e, logger);<NEW_LINE>} finally {<NEW_LINE>stats.stopSetup();<NEW_LINE>}<NEW_LINE>} | generateCopies(g, batch, true); |
672,290 | private static Cipher createCipher(int opmode, char[] password, byte[] salt, byte[] iv) throws GeneralSecurityException {<NEW_LINE>PBEKeySpec keySpec = new PBEKeySpec(<MASK><NEW_LINE>SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(KDF_ALGO);<NEW_LINE>SecretKey secretKey;<NEW_LINE>try {<NEW_LINE>secretKey = keyFactory.generateSecret(keySpec);<NEW_LINE>} catch (Error e) {<NEW_LINE>// Security Providers might throw a subclass of Error in FIPS 140 mode, if some prerequisite like<NEW_LINE>// salt, iv, or password length is not met. We catch this because we don't want the JVM to exit.<NEW_LINE>throw new GeneralSecurityException("Error generating an encryption key from the provided password", e);<NEW_LINE>}<NEW_LINE>SecretKeySpec secret = new SecretKeySpec(secretKey.getEncoded(), CIPHER_ALGO);<NEW_LINE>GCMParameterSpec spec = new GCMParameterSpec(GCM_TAG_BITS, iv);<NEW_LINE>Cipher cipher = Cipher.getInstance(CIPHER_ALGO + "/" + CIPHER_MODE + "/" + CIPHER_PADDING);<NEW_LINE>cipher.init(opmode, secret, spec);<NEW_LINE>cipher.updateAAD(salt);<NEW_LINE>return cipher;<NEW_LINE>} | password, salt, KDF_ITERS, CIPHER_KEY_BITS); |
837,056 | private void bind(SpanEventBo spanEvent, TSpanEvent tSpanEvent) {<NEW_LINE>spanEvent.setSequence(tSpanEvent.getSequence());<NEW_LINE>spanEvent.setStartElapsed(tSpanEvent.getStartElapsed());<NEW_LINE>spanEvent.setEndElapsed(tSpanEvent.getEndElapsed());<NEW_LINE>spanEvent.setRpc(tSpanEvent.getRpc());<NEW_LINE>spanEvent.setServiceType(tSpanEvent.getServiceType());<NEW_LINE>spanEvent.<MASK><NEW_LINE>spanEvent.setEndPoint(tSpanEvent.getEndPoint());<NEW_LINE>spanEvent.setApiId(tSpanEvent.getApiId());<NEW_LINE>if (tSpanEvent.isSetDepth()) {<NEW_LINE>spanEvent.setDepth(tSpanEvent.getDepth());<NEW_LINE>}<NEW_LINE>if (tSpanEvent.isSetNextSpanId()) {<NEW_LINE>spanEvent.setNextSpanId(tSpanEvent.getNextSpanId());<NEW_LINE>}<NEW_LINE>List<AnnotationBo> annotationList = buildAnnotationList(tSpanEvent.getAnnotations());<NEW_LINE>spanEvent.setAnnotationBoList(annotationList);<NEW_LINE>final TIntStringValue exceptionInfo = tSpanEvent.getExceptionInfo();<NEW_LINE>if (exceptionInfo != null) {<NEW_LINE>spanEvent.setExceptionInfo(exceptionInfo.getIntValue(), exceptionInfo.getStringValue());<NEW_LINE>}<NEW_LINE>if (tSpanEvent.isSetNextAsyncId()) {<NEW_LINE>spanEvent.setNextAsyncId(tSpanEvent.getNextAsyncId());<NEW_LINE>}<NEW_LINE>// async id<NEW_LINE>// if (localAsyncId == null) {<NEW_LINE>// if (tSpanEvent.isSetAsyncId()) {<NEW_LINE>// spanEvent.setAsyncId(tSpanEvent.getAsyncId());<NEW_LINE>// }<NEW_LINE>// if (tSpanEvent.isSetAsyncSequence()) {<NEW_LINE>// spanEvent.setAsyncSequence(tSpanEvent.getAsyncSequence());<NEW_LINE>// }<NEW_LINE>// } else {<NEW_LINE>// spanEvent.setAsyncId(localAsyncId.getAsyncId());<NEW_LINE>// spanEvent.setAsyncSequence((short) localAsyncId.getSequence());<NEW_LINE>// }<NEW_LINE>} | setDestinationId(tSpanEvent.getDestinationId()); |
490,521 | public static ArrayList<ReminderEntry> readRemindersFromBundle(Bundle bundle) {<NEW_LINE>ArrayList<ReminderEntry> reminders = null;<NEW_LINE>ArrayList<Integer> reminderMinutes = bundle.getIntegerArrayList(EventInfoFragment.BUNDLE_KEY_REMINDER_MINUTES);<NEW_LINE>ArrayList<Integer> reminderMethods = bundle.getIntegerArrayList(EventInfoFragment.BUNDLE_KEY_REMINDER_METHODS);<NEW_LINE>if (reminderMinutes == null || reminderMethods == null) {<NEW_LINE>if (reminderMinutes != null || reminderMethods != null) {<NEW_LINE>String nullList = (reminderMinutes == null ? "reminderMinutes" : "reminderMethods");<NEW_LINE>Log.d(TAG, String.format("Error resolving reminders: %s was null", nullList));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int numReminders = reminderMinutes.size();<NEW_LINE>if (numReminders == reminderMethods.size()) {<NEW_LINE>// Only if the size of the reminder minutes we've read in is<NEW_LINE>// the same as the size of the reminder methods. Otherwise,<NEW_LINE>// something went wrong with bundling them.<NEW_LINE>reminders = new ArrayList<ReminderEntry>(numReminders);<NEW_LINE>for (int reminder_i = 0; reminder_i < numReminders; reminder_i++) {<NEW_LINE>int minutes = reminderMinutes.get(reminder_i);<NEW_LINE>int method = reminderMethods.get(reminder_i);<NEW_LINE>reminders.add(ReminderEntry.valueOf(minutes, method));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.d(TAG, String.format("Error resolving reminders." + " Found %d reminderMinutes, but %d reminderMethods.", numReminders<MASK><NEW_LINE>}<NEW_LINE>return reminders;<NEW_LINE>} | , reminderMethods.size())); |
1,733,912 | private static int treeSync(final TSDB tsdb) throws Exception {<NEW_LINE>final long start_time = System.currentTimeMillis() / 1000;<NEW_LINE>final long <MASK><NEW_LINE>// now figure out how many IDs to divy up between the workers<NEW_LINE>final int workers = Runtime.getRuntime().availableProcessors() * 2;<NEW_LINE>final double quotient = (double) max_id / (double) workers;<NEW_LINE>long index = 1;<NEW_LINE>LOG.info("Max metric ID is [" + max_id + "]");<NEW_LINE>LOG.info("Spooling up [" + workers + "] worker threads");<NEW_LINE>final Thread[] threads = new Thread[workers];<NEW_LINE>for (int i = 0; i < workers; i++) {<NEW_LINE>threads[i] = new TreeSync(tsdb, index, quotient, i);<NEW_LINE>threads[i].setName("TreeSync # " + i);<NEW_LINE>threads[i].start();<NEW_LINE>index += quotient;<NEW_LINE>if (index < max_id) {<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// wait till we're all done<NEW_LINE>for (int i = 0; i < workers; i++) {<NEW_LINE>threads[i].join();<NEW_LINE>LOG.info("[" + i + "] Finished");<NEW_LINE>}<NEW_LINE>// make sure buffered data is flushed to storage before exiting<NEW_LINE>tsdb.flush().joinUninterruptibly();<NEW_LINE>final long duration = (System.currentTimeMillis() / 1000) - start_time;<NEW_LINE>LOG.info("Completed meta data synchronization in [" + duration + "] seconds");<NEW_LINE>return 0;<NEW_LINE>} | max_id = CliUtils.getMaxMetricID(tsdb); |
714,353 | public void marshall(LaunchProfileInitializationActiveDirectory launchProfileInitializationActiveDirectory, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (launchProfileInitializationActiveDirectory == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(launchProfileInitializationActiveDirectory.getComputerAttributes(), COMPUTERATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(launchProfileInitializationActiveDirectory.getDirectoryId(), DIRECTORYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(launchProfileInitializationActiveDirectory.getDnsIpAddresses(), DNSIPADDRESSES_BINDING);<NEW_LINE>protocolMarshaller.marshall(launchProfileInitializationActiveDirectory.getOrganizationalUnitDistinguishedName(), ORGANIZATIONALUNITDISTINGUISHEDNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(launchProfileInitializationActiveDirectory.getStudioComponentId(), STUDIOCOMPONENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(launchProfileInitializationActiveDirectory.getStudioComponentName(), STUDIOCOMPONENTNAME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | launchProfileInitializationActiveDirectory.getDirectoryName(), DIRECTORYNAME_BINDING); |
623,417 | public MutableBooleanCollection select(BooleanPredicate predicate) {<NEW_LINE>MutableBooleanList result = BooleanLists.mutable.empty();<NEW_LINE>if (this.getSentinelValues() != null) {<NEW_LINE>if (this.getSentinelValues().containsZeroKey && predicate.accept(this.getSentinelValues().zeroValue)) {<NEW_LINE>result.add(this.getSentinelValues().zeroValue);<NEW_LINE>}<NEW_LINE>if (this.getSentinelValues().containsOneKey && predicate.accept(this.getSentinelValues().oneValue)) {<NEW_LINE>result.add(this.getSentinelValues().oneValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < this.getTableSize(); i++) {<NEW_LINE>if (this.isNonSentinelAtIndex(i) && predicate.accept(this.getValueAtIndex(i))) {<NEW_LINE>result.add<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (this.getValueAtIndex(i)); |
436,943 | public void deleteAcl(ObjectIdentity objectIdentity, boolean deleteChildren) throws ChildrenExistException {<NEW_LINE>Assert.notNull(objectIdentity, "Object Identity required");<NEW_LINE>Assert.notNull(objectIdentity.getIdentifier(), "Object Identity doesn't provide an identifier");<NEW_LINE>if (deleteChildren) {<NEW_LINE>List<ObjectIdentity> children = findChildren(objectIdentity);<NEW_LINE>if (children != null) {<NEW_LINE>for (ObjectIdentity child : children) {<NEW_LINE>deleteAcl(child, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!this.foreignKeysInDatabase) {<NEW_LINE>// We need to perform a manual verification for what a FK would normally<NEW_LINE>// do. We generally don't do this, in the interests of deadlock management<NEW_LINE>List<ObjectIdentity> children = findChildren(objectIdentity);<NEW_LINE>if (children != null) {<NEW_LINE>throw new ChildrenExistException("Cannot delete '" + objectIdentity + "' (has " + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Long oidPrimaryKey = retrieveObjectIdentityPrimaryKey(objectIdentity);<NEW_LINE>// Delete this ACL's ACEs in the acl_entry table<NEW_LINE>deleteEntries(oidPrimaryKey);<NEW_LINE>// Delete this ACL's acl_object_identity row<NEW_LINE>deleteObjectIdentity(oidPrimaryKey);<NEW_LINE>// Clear the cache<NEW_LINE>this.aclCache.evictFromCache(objectIdentity);<NEW_LINE>} | children.size() + " children)"); |
311,845 | final ListPlacementsResult executeListPlacements(ListPlacementsRequest listPlacementsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPlacementsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPlacementsRequest> request = null;<NEW_LINE>Response<ListPlacementsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPlacementsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPlacementsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT 1Click Projects");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPlacements");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPlacementsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPlacementsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,457,899 | static TableMetadata createTableMetadata() {<NEW_LINE>ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder();<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_INTERFACE, Schema.INTERFACE, "Interface", true, false));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_IP, Schema.IP, "Ip", true, false));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.LONG, "Area", true, false));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_REMOTE_INTERFACE, Schema.INTERFACE, "Remote Interface", false, true));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_REMOTE_VRF, Schema.STRING, "Remote VRF", false, true));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_REMOTE_IP, Schema.IP<MASK><NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_REMOTE_AREA, Schema.LONG, "Remote Area", false, true));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_SESSION_STATUS, Schema.STRING, "Status of the OSPF session", false, true));<NEW_LINE>return new TableMetadata(columnBuilder.build(), "Display OSPF sessions");<NEW_LINE>} | , "Remote IP", false, true)); |
1,740,908 | public void run(RegressionEnvironment env) {<NEW_LINE>String text = "@name('s0') select irstream symbol, price from SupportMarketDataBean#firstunique(symbol) order by symbol";<NEW_LINE>if (optionalAnnotation != null) {<NEW_LINE>text = optionalAnnotation + text;<NEW_LINE>}<NEW_LINE>env.compileDeployAddListenerMileZero(text, "s0");<NEW_LINE>env.sendEventBean(makeMarketDataEvent("S1", 100));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "symbol", "S1" }, { "price", 100.0 } }, null);<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("S2", 5));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "symbol", "S2" }, { "price", 5.0 } }, null);<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("S1", 101));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(3);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("S1", 102));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>// test iterator<NEW_LINE>env.assertPropsPerRowIterator("s0", new String[] { "price" }, new Object[][] { { 100.0 }, { 5.0 } });<NEW_LINE>env.milestone(4);<NEW_LINE>env.sendEventBean<MASK><NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "symbol", "S3" }, { "price", 6.0 } }, null);<NEW_LINE>env.undeployAll();<NEW_LINE>} | (makeMarketDataEvent("S3", 6)); |
1,438,109 | private YamlConfiguration initConfig() {<NEW_LINE>if (!configFile.exists()) {<NEW_LINE>mcMMO.p.getLogger().info("[config] User config file not found, copying a default config to disk: " + fileName);<NEW_LINE>mcMMO.p.saveResource(fileName, false);<NEW_LINE>}<NEW_LINE>mcMMO.p.getLogger().info("[config] Loading config from disk: " + fileName);<NEW_LINE>YamlConfiguration config = new YamlConfiguration();<NEW_LINE>config.options().indent(4);<NEW_LINE>try {<NEW_LINE>config.options().parseComments(true);<NEW_LINE>} catch (NoSuchMethodError e) {<NEW_LINE>// e.printStackTrace();<NEW_LINE>// mcMMO.p.getLogger().severe("Your Spigot/CraftBukkit API is out of date, update your server software!");<NEW_LINE>}<NEW_LINE>config.<MASK><NEW_LINE>try {<NEW_LINE>config.load(configFile);<NEW_LINE>} catch (IOException | InvalidConfigurationException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return config;<NEW_LINE>} | options().copyDefaults(true); |
1,759,609 | public static List<INaviView> loadMixedgraphs(final AbstractSQLProvider provider, final CProject project, final CTagManager viewTagManager, final CTagManager nodeTagManager) throws CouldntLoadDataException {<NEW_LINE><MASK><NEW_LINE>final String query = "SELECT * FROM load_module_mixed_graph(?)";<NEW_LINE>try {<NEW_LINE>final CConnection connection = provider.getConnection();<NEW_LINE>final PreparedStatement statement = connection.getConnection().prepareStatement(query);<NEW_LINE>statement.setInt(1, project.getConfiguration().getId());<NEW_LINE>final ResultSet resultSet = statement.executeQuery();<NEW_LINE>final Map<Integer, Set<CTag>> tags = loadTags(connection, project, viewTagManager);<NEW_LINE>return new ArrayList<INaviView>(processQueryResults(resultSet, project, tags, nodeTagManager, provider, new ArrayList<CView>(), ViewType.NonNative, GraphType.MIXED_GRAPH));<NEW_LINE>} catch (final SQLException exception) {<NEW_LINE>throw new CouldntLoadDataException(exception);<NEW_LINE>}<NEW_LINE>} | checkArguments(provider, project, viewTagManager); |
760,512 | public static CheckSpendParams decode(long ctx, byte[] data, byte[] sigHashValue) throws ZksnarkException {<NEW_LINE>byte[] cv = new byte[32];<NEW_LINE>byte[<MASK><NEW_LINE>byte[] nullifier = new byte[32];<NEW_LINE>byte[] rk = new byte[32];<NEW_LINE>byte[] zkproof = new byte[192];<NEW_LINE>byte[] spendAuthSig = new byte[64];<NEW_LINE>System.arraycopy(data, 0, cv, 0, 32);<NEW_LINE>System.arraycopy(data, 32, anchor, 0, 32);<NEW_LINE>System.arraycopy(data, 64, nullifier, 0, 32);<NEW_LINE>System.arraycopy(data, 96, rk, 0, 32);<NEW_LINE>System.arraycopy(data, 128, zkproof, 0, 192);<NEW_LINE>System.arraycopy(data, 320, spendAuthSig, 0, 64);<NEW_LINE>return new CheckSpendParams(ctx, cv, anchor, nullifier, rk, zkproof, spendAuthSig, sigHashValue);<NEW_LINE>} | ] anchor = new byte[32]; |
1,362,468 | private void analyzePartsRecursively(TypeMirror target, Map<String, PartKind> parts, Set<TypeMirror> usedTypes) {<NEW_LINE>String typeName = typeWithoutAnnotations(target.toString());<NEW_LINE>if (typeSupport.isSupported(typeName)) {<NEW_LINE>usedTypes.add(target);<NEW_LINE>if (isRawType(target)) {<NEW_LINE>parts.<MASK><NEW_LINE>} else {<NEW_LINE>parts.put(typeName, PartKind.OTHER);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(target.getKind()) {<NEW_LINE>case ARRAY:<NEW_LINE>ArrayType at = (ArrayType) target;<NEW_LINE>analyzePartsRecursively(at.getComponentType(), parts, usedTypes);<NEW_LINE>break;<NEW_LINE>case DECLARED:<NEW_LINE>DeclaredType declaredType = (DeclaredType) target;<NEW_LINE>List<? extends TypeMirror> typeArguments = declaredType.getTypeArguments();<NEW_LINE>String rawTypeName = declaredType.asElement().toString();<NEW_LINE>usedTypes.add(declaredType.asElement().asType());<NEW_LINE>StructInfo struct = structs.get(rawTypeName);<NEW_LINE>boolean knownAndValidStruct = struct != null && (struct.type != ObjectType.CLASS || struct.hasAnnotation() || !struct.attributes.isEmpty() || !struct.implementations.isEmpty() || struct.hasKnownConversion());<NEW_LINE>if (knownAndValidStruct || typeSupport.isSupported(rawTypeName)) {<NEW_LINE>if (isRawType(target)) {<NEW_LINE>parts.put(rawTypeName, PartKind.RAW_TYPE);<NEW_LINE>} else {<NEW_LINE>parts.put(rawTypeName, PartKind.OTHER);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>parts.put(rawTypeName, PartKind.UNKNOWN);<NEW_LINE>}<NEW_LINE>for (TypeMirror typeArgument : typeArguments) {<NEW_LINE>analyzePartsRecursively(typeArgument, parts, usedTypes);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case TYPEVAR:<NEW_LINE>usedTypes.add(target);<NEW_LINE>parts.put(typeName, PartKind.TYPE_VARIABLE);<NEW_LINE>break;<NEW_LINE>case WILDCARD:<NEW_LINE>WildcardType wt = (WildcardType) target;<NEW_LINE>analyzePartsRecursively(wt.getExtendsBound(), parts, usedTypes);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>usedTypes.add(target);<NEW_LINE>parts.put(typeName, PartKind.UNKNOWN);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | put(typeName, PartKind.RAW_TYPE); |
1,300,506 | public static ListNVRDeviceResponse unmarshall(ListNVRDeviceResponse listNVRDeviceResponse, UnmarshallerContext _ctx) {<NEW_LINE>listNVRDeviceResponse.setRequestId(_ctx.stringValue("ListNVRDeviceResponse.RequestId"));<NEW_LINE>listNVRDeviceResponse.setSuccess(_ctx.booleanValue("ListNVRDeviceResponse.Success"));<NEW_LINE>listNVRDeviceResponse.setTotal<MASK><NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListNVRDeviceResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setDeviceCode(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].DeviceCode"));<NEW_LINE>dataItem.setDeviceName(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].DeviceName"));<NEW_LINE>dataItem.setDeviceType(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].DeviceType"));<NEW_LINE>dataItem.setDatasourceType(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].DatasourceType"));<NEW_LINE>dataItem.setDeviceStatus(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].DeviceStatus"));<NEW_LINE>dataItem.setStreamStatus(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].StreamStatus"));<NEW_LINE>dataItem.setComptureStatus(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].ComptureStatus"));<NEW_LINE>dataItem.setRegionName(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].RegionName"));<NEW_LINE>dataItem.setProjectName(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].ProjectName"));<NEW_LINE>dataItem.setRegistrationTime(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].RegistrationTime"));<NEW_LINE>dataItem.setAccessQuota(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].AccessQuota"));<NEW_LINE>dataItem.setChannel(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].Channel"));<NEW_LINE>dataItem.setDeviceSn(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].DeviceSn"));<NEW_LINE>dataItem.setType(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].Type"));<NEW_LINE>dataItem.setCorpId(_ctx.stringValue("ListNVRDeviceResponse.Data[" + i + "].CorpId"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>listNVRDeviceResponse.setData(data);<NEW_LINE>return listNVRDeviceResponse;<NEW_LINE>} | (_ctx.stringValue("ListNVRDeviceResponse.Total")); |
846,798 | private Long countExpiredTaskTaskCompleted(Business business, DateRange dateRange, String applicationId, String processId, String activityId, List<String> units, String person) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer(<MASK><NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Long> cq = cb.createQuery(Long.class);<NEW_LINE>Root<TaskCompleted> root = cq.from(TaskCompleted.class);<NEW_LINE>Predicate p = cb.between(root.get(TaskCompleted_.expireTime), dateRange.getStart(), dateRange.getEnd());<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.expired), true));<NEW_LINE>if (!StringUtils.equals(applicationId, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.application), applicationId));<NEW_LINE>}<NEW_LINE>if (!StringUtils.equals(processId, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.process), processId));<NEW_LINE>}<NEW_LINE>if (!StringUtils.equals(activityId, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.activity), activityId));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(units)) {<NEW_LINE>p = cb.and(p, root.get(TaskCompleted_.unit).in(units));<NEW_LINE>}<NEW_LINE>if (!StringUtils.equals(person, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.person), person));<NEW_LINE>}<NEW_LINE>cq.select(cb.count(root)).where(p);<NEW_LINE>return em.createQuery(cq).getSingleResult();<NEW_LINE>} | ).get(TaskCompleted.class); |
1,447,222 | private void renderAuras(Graphics2D g, PlayerView view) {<NEW_LINE>// Setup<NEW_LINE>timer.start("auras-1");<NEW_LINE>Graphics2D newG = (Graphics2D) g.create();<NEW_LINE>if (!view.isGMView() && visibleScreenArea != null) {<NEW_LINE>Area clip = new Area(g.getClip());<NEW_LINE>clip.intersect(visibleScreenArea);<NEW_LINE>newG.setClip(clip);<NEW_LINE>}<NEW_LINE>SwingUtil.useAntiAliasing(newG);<NEW_LINE>timer.stop("auras-1");<NEW_LINE>timer.start("auras-2");<NEW_LINE>AffineTransform af = g.getTransform();<NEW_LINE>af.translate(getViewOffsetX(), getViewOffsetY());<NEW_LINE>af.scale(getScale(), getScale());<NEW_LINE>newG.setTransform(af);<NEW_LINE>newG.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, AppPreferences.getAuraOverlayOpacity() / 255.0f));<NEW_LINE>timer.stop("auras-2");<NEW_LINE>if (renderedAuraMap == null) {<NEW_LINE>// Organize<NEW_LINE>Map<Paint, List<Area>> colorMap = new HashMap<Paint<MASK><NEW_LINE>timer.start("auras-4");<NEW_LINE>Color paintColor = new Color(255, 255, 255, 150);<NEW_LINE>for (DrawableLight light : zoneView.getLights(LightSource.Type.AURA)) {<NEW_LINE>Paint paint = light.getPaint() != null ? light.getPaint().getPaint() : paintColor;<NEW_LINE>List<Area> list = colorMap.get(paint);<NEW_LINE>if (list == null) {<NEW_LINE>list = new LinkedList<Area>();<NEW_LINE>list.add(new Area(light.getArea()));<NEW_LINE>colorMap.put(paint, list);<NEW_LINE>} else {<NEW_LINE>list.get(0).add(new Area(light.getArea()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>renderedAuraMap = new LinkedHashMap<Paint, Area>();<NEW_LINE>for (Entry<Paint, List<Area>> entry : colorMap.entrySet()) {<NEW_LINE>renderedAuraMap.put(entry.getKey(), entry.getValue().get(0));<NEW_LINE>}<NEW_LINE>timer.stop("auras-4");<NEW_LINE>}<NEW_LINE>// Draw<NEW_LINE>timer.start("auras-5");<NEW_LINE>for (Entry<Paint, Area> entry : renderedAuraMap.entrySet()) {<NEW_LINE>newG.setPaint(entry.getKey());<NEW_LINE>newG.fill(entry.getValue());<NEW_LINE>}<NEW_LINE>timer.stop("auras-5");<NEW_LINE>newG.dispose();<NEW_LINE>} | , List<Area>>(); |
675,751 | public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>String[] fields = new String[] { "symbol", "sumPrice" };<NEW_LINE>String epl = "@name('s0') select symbol, sum(price) as sumPrice from " + "SupportMarketDataBean#length(10) as one, " + "SupportBeanString#length(100) as two " + "where one.symbol = two.theString " + "group by symbol " + "order by symbol";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBeanString("CAT"));<NEW_LINE>env.sendEventBean(new SupportBeanString("IBM"));<NEW_LINE>env.sendEventBean(new SupportBeanString("CMU"));<NEW_LINE>env.sendEventBean(new SupportBeanString("KGB"));<NEW_LINE>env.sendEventBean(new SupportBeanString("DOG"));<NEW_LINE>sendEvent(env, "CAT", 50);<NEW_LINE>sendEvent(env, "IBM", 49);<NEW_LINE>sendEvent(env, "CAT", 15);<NEW_LINE>sendEvent(env, "IBM", 100);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "CAT", 65d }, { "IBM", 149d } });<NEW_LINE><MASK><NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "CAT", 65d }, { "IBM", 149d }, { "KGB", 75d } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | sendEvent(env, "KGB", 75); |
1,373,082 | private JComponent createComponent(String filterName) {<NEW_LINE>final JPanel panel = <MASK><NEW_LINE>Border paddingBorder = BorderFactory.createEmptyBorder(1, 5, 1, 5);<NEW_LINE>Border outsideBorder = BorderFactory.createBevelBorder(BevelBorder.LOWERED);<NEW_LINE>panel.setBorder(BorderFactory.createCompoundBorder(outsideBorder, paddingBorder));<NEW_LINE>DefaultFormatterFactory factory = new DefaultFormatterFactory(new DefaultFormatter());<NEW_LINE>textField = new FilterFormattedTextField(factory, defaultValue);<NEW_LINE>// for debugging<NEW_LINE>textField.setName(filterName + " Field");<NEW_LINE>textField.setColumns(20);<NEW_LINE>textField.setMinimumSize(textField.getPreferredSize());<NEW_LINE>// we handle updates in real time, so ignore focus events, which trigger excess filtering<NEW_LINE>textField.disableFocusEventProcessing();<NEW_LINE>JLabel label = new GDLabel(filterName + ": ");<NEW_LINE>panel.add(label, BorderLayout.WEST);<NEW_LINE>panel.add(textField, BorderLayout.CENTER);<NEW_LINE>StatusLabel nameFieldStatusLabel = new StatusLabel(textField, defaultValue);<NEW_LINE>textField.addFilterStatusListener(nameFieldStatusLabel);<NEW_LINE>textField.addFilterStatusListener(status -> fireStatusChanged(status));<NEW_LINE>final JLayeredPane layeredPane = new JLayeredPane();<NEW_LINE>layeredPane.add(panel, BASE_COMPONENT_LAYER);<NEW_LINE>layeredPane.add(nameFieldStatusLabel, HOVER_COMPONENT_LAYER);<NEW_LINE>layeredPane.setPreferredSize(panel.getPreferredSize());<NEW_LINE>layeredPane.addComponentListener(new ComponentAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentResized(java.awt.event.ComponentEvent e) {<NEW_LINE>Dimension preferredSize = layeredPane.getSize();<NEW_LINE>panel.setBounds(0, 0, preferredSize.width, preferredSize.height);<NEW_LINE>panel.validate();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return layeredPane;<NEW_LINE>} | new JPanel(new BorderLayout()); |
690,524 | private Expr parseExpr(String s) throws QueryParseException {<NEW_LINE>try {<NEW_LINE>ARQParser parser = new ARQParser(new StringReader("SELECT " + s));<NEW_LINE>parser.setQuery(new Query());<NEW_LINE>parser.getQuery().setPrefixMapping(query.getPrefixMapping());<NEW_LINE>parser.SelectClause();<NEW_LINE>Query q = parser.getQuery();<NEW_LINE>VarExprList vel = q.getProject();<NEW_LINE>return vel.getExprs().values().iterator().next();<NEW_LINE>} catch (ParseException ex) {<NEW_LINE>throw new QueryParseException(ex.getMessage(), ex.currentToken.<MASK><NEW_LINE>} catch (TokenMgrError tErr) {<NEW_LINE>throw new QueryParseException(tErr.getMessage(), -1, -1);<NEW_LINE>} catch (Error err) {<NEW_LINE>// The token stream can throw java.lang.Error's<NEW_LINE>String tmp = err.getMessage();<NEW_LINE>if (tmp == null)<NEW_LINE>throw new QueryParseException(err, -1, -1);<NEW_LINE>throw new QueryParseException(tmp, -1, -1);<NEW_LINE>}<NEW_LINE>} | beginLine, ex.currentToken.beginLine); |
364,976 | public ListDatasetLabelsResult listDatasetLabels(ListDatasetLabelsRequest listDatasetLabelsRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDatasetLabelsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListDatasetLabelsRequest> request = null;<NEW_LINE>Response<ListDatasetLabelsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDatasetLabelsRequestMarshaller().marshall(listDatasetLabelsRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListDatasetLabelsResult, JsonUnmarshallerContext> unmarshaller = new ListDatasetLabelsResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListDatasetLabelsResult> responseHandler = new JsonResponseHandler<ListDatasetLabelsResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
971,628 | public static void render(List<List<Point2D_I32>> contours, boolean loops, Color color, double stroke, double scale, Graphics2D g2) {<NEW_LINE>BoofSwingUtil.antialiasing(g2);<NEW_LINE>Line2D.Double <MASK><NEW_LINE>g2.setStroke(new BasicStroke(Math.max(1, (float) (stroke * scale))));<NEW_LINE>g2.setColor(color);<NEW_LINE>for (List<Point2D_I32> c : contours) {<NEW_LINE>if (loops)<NEW_LINE>renderLoop(scale, g2, l, c);<NEW_LINE>else<NEW_LINE>renderLine(scale, g2, l, c);<NEW_LINE>}<NEW_LINE>if (scale > 4) {<NEW_LINE>Color before = g2.getColor();<NEW_LINE>g2.setStroke(new BasicStroke(1));<NEW_LINE>g2.setColor(Color.LIGHT_GRAY);<NEW_LINE>for (List<Point2D_I32> c : contours) {<NEW_LINE>if (loops)<NEW_LINE>renderLoop(scale, g2, l, c);<NEW_LINE>else<NEW_LINE>renderLine(scale, g2, l, c);<NEW_LINE>}<NEW_LINE>g2.setColor(before);<NEW_LINE>}<NEW_LINE>} | l = new Line2D.Double(); |
1,590,787 | public List<SuppressionRule> parseSuppressionRules(InputStream inputStream, SuppressionRuleFilter filter) throws SuppressionParseException, SAXException {<NEW_LINE>try (InputStream schemaStream13 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_3);<NEW_LINE>InputStream schemaStream12 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_2);<NEW_LINE>InputStream schemaStream11 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_1);<NEW_LINE>InputStream schemaStream10 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_0)) {<NEW_LINE>final BOMInputStream bomStream = new BOMInputStream(inputStream);<NEW_LINE>final ByteOrderMark bom = bomStream.getBOM();<NEW_LINE>final String defaultEncoding = StandardCharsets.UTF_8.name();<NEW_LINE>final String charsetName = bom == null ? defaultEncoding : bom.getCharsetName();<NEW_LINE>final SuppressionHandler handler = new SuppressionHandler(filter);<NEW_LINE>final SAXParser saxParser = XmlUtils.buildSecureSaxParser(schemaStream13, schemaStream12, schemaStream11, schemaStream10);<NEW_LINE>final XMLReader xmlReader = saxParser.getXMLReader();<NEW_LINE>xmlReader.setErrorHandler(new SuppressionErrorHandler());<NEW_LINE>xmlReader.setContentHandler(handler);<NEW_LINE>xmlReader<MASK><NEW_LINE>try (Reader reader = new InputStreamReader(bomStream, charsetName)) {<NEW_LINE>final InputSource in = new InputSource(reader);<NEW_LINE>xmlReader.parse(in);<NEW_LINE>return handler.getSuppressionRules();<NEW_LINE>}<NEW_LINE>} catch (ParserConfigurationException | FileNotFoundException ex) {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>} catch (SAXException ex) {<NEW_LINE>if (ex.getMessage().contains("Cannot find the declaration of element 'suppressions'.")) {<NEW_LINE>throw ex;<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>}<NEW_LINE>} | .setEntityResolver(new ClassloaderResolver()); |
161,583 | public BackgroundException map(final IOException e, final StringBuilder buffer, final DisconnectReason reason) {<NEW_LINE>final String failure = buffer.toString();<NEW_LINE>if (DisconnectReason.HOST_KEY_NOT_VERIFIABLE.equals(reason)) {<NEW_LINE>log.warn(String.format("Failure verifying host key. %s", failure));<NEW_LINE>// Host key dismissed by user<NEW_LINE>return new ConnectionCanceledException(e);<NEW_LINE>}<NEW_LINE>if (DisconnectReason.PROTOCOL_ERROR.equals(reason)) {<NEW_LINE>// Too many authentication failures<NEW_LINE>return new InteroperabilityException(failure, e);<NEW_LINE>}<NEW_LINE>if (DisconnectReason.ILLEGAL_USER_NAME.equals(reason)) {<NEW_LINE>return new LoginFailureException(failure, e);<NEW_LINE>}<NEW_LINE>if (DisconnectReason.NO_MORE_AUTH_METHODS_AVAILABLE.equals(reason)) {<NEW_LINE>return new LoginFailureException(failure, e);<NEW_LINE>}<NEW_LINE>if (DisconnectReason.PROTOCOL_VERSION_NOT_SUPPORTED.equals(reason)) {<NEW_LINE>return new InteroperabilityException(failure, e);<NEW_LINE>}<NEW_LINE>if (e instanceof TransportException) {<NEW_LINE>return new ConnectionRefusedException(<MASK><NEW_LINE>}<NEW_LINE>return this.wrap(e, buffer);<NEW_LINE>} | buffer.toString(), e); |
689,569 | private void updateMessageStateInfo() {<NEW_LINE>MessageState messageState = model.getMessageStateProperty().get();<NEW_LINE>textFieldWithIcon.setText(Res.get("message.state." + messageState.name()));<NEW_LINE>Label iconLabel = textFieldWithIcon.getIconLabel();<NEW_LINE>switch(messageState) {<NEW_LINE>case UNDEFINED:<NEW_LINE>textFieldWithIcon.setIcon(AwesomeIcon.QUESTION);<NEW_LINE>iconLabel.getStyleClass().add("trade-msg-state-undefined");<NEW_LINE>break;<NEW_LINE>case SENT:<NEW_LINE>textFieldWithIcon.setIcon(AwesomeIcon.ARROW_RIGHT);<NEW_LINE>iconLabel.getStyleClass().add("trade-msg-state-sent");<NEW_LINE>break;<NEW_LINE>case ARRIVED:<NEW_LINE>textFieldWithIcon.setIcon(AwesomeIcon.OK);<NEW_LINE>iconLabel.getStyleClass().add("trade-msg-state-arrived");<NEW_LINE>break;<NEW_LINE>case STORED_IN_MAILBOX:<NEW_LINE>textFieldWithIcon.setIcon(AwesomeIcon.ENVELOPE_ALT);<NEW_LINE>iconLabel.<MASK><NEW_LINE>break;<NEW_LINE>case ACKNOWLEDGED:<NEW_LINE>textFieldWithIcon.setIcon(AwesomeIcon.OK_SIGN);<NEW_LINE>iconLabel.getStyleClass().add("trade-msg-state-stored");<NEW_LINE>break;<NEW_LINE>case FAILED:<NEW_LINE>textFieldWithIcon.setIcon(AwesomeIcon.EXCLAMATION_SIGN);<NEW_LINE>iconLabel.getStyleClass().add("trade-msg-state-acknowledged");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | getStyleClass().add("trade-msg-state-stored"); |
842,548 | public static ExecuteScriptResponse unmarshall(ExecuteScriptResponse executeScriptResponse, UnmarshallerContext _ctx) {<NEW_LINE>executeScriptResponse.setRequestId(_ctx.stringValue("ExecuteScriptResponse.RequestId"));<NEW_LINE>executeScriptResponse.setErrorCode(_ctx.stringValue("ExecuteScriptResponse.ErrorCode"));<NEW_LINE>executeScriptResponse.setErrorMessage(_ctx.stringValue("ExecuteScriptResponse.ErrorMessage"));<NEW_LINE>executeScriptResponse.setSuccess(_ctx.booleanValue("ExecuteScriptResponse.Success"));<NEW_LINE>List<Result> results = new ArrayList<Result>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ExecuteScriptResponse.Results.Length"); i++) {<NEW_LINE>Result result = new Result();<NEW_LINE>result.setSuccess(_ctx.booleanValue("ExecuteScriptResponse.Results[" + i + "].Success"));<NEW_LINE>result.setMessage(_ctx.stringValue<MASK><NEW_LINE>result.setRowCount(_ctx.longValue("ExecuteScriptResponse.Results[" + i + "].RowCount"));<NEW_LINE>List<String> columnNames = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ExecuteScriptResponse.Results[" + i + "].ColumnNames.Length"); j++) {<NEW_LINE>columnNames.add(_ctx.stringValue("ExecuteScriptResponse.Results[" + i + "].ColumnNames[" + j + "]"));<NEW_LINE>}<NEW_LINE>result.setColumnNames(columnNames);<NEW_LINE>List<Map<Object, Object>> rows = _ctx.listMapValue("ExecuteScriptResponse.Results[" + i + "].Rows");<NEW_LINE>result.setRows(rows);<NEW_LINE>results.add(result);<NEW_LINE>}<NEW_LINE>executeScriptResponse.setResults(results);<NEW_LINE>return executeScriptResponse;<NEW_LINE>} | ("ExecuteScriptResponse.Results[" + i + "].Message")); |
692,622 | final GetHostedConfigurationVersionResult executeGetHostedConfigurationVersion(GetHostedConfigurationVersionRequest getHostedConfigurationVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getHostedConfigurationVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetHostedConfigurationVersionRequest> request = null;<NEW_LINE>Response<GetHostedConfigurationVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetHostedConfigurationVersionRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "AppConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetHostedConfigurationVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetHostedConfigurationVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(false).withHasStreamingSuccessResponse(false), new GetHostedConfigurationVersionResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(getHostedConfigurationVersionRequest)); |
1,350,887 | public void initFactories() {<NEW_LINE>factories.put(JetSubmitJobCodec.REQUEST_MESSAGE_TYPE, toFactory(JetSubmitJobMessageTask::new));<NEW_LINE>factories.put(JetTerminateJobCodec.REQUEST_MESSAGE_TYPE, toFactory(JetTerminateJobMessageTask::new));<NEW_LINE>factories.put(JetGetJobStatusCodec.REQUEST_MESSAGE_TYPE, toFactory(JetGetJobStatusMessageTask::new));<NEW_LINE>factories.put(JetGetJobSuspensionCauseCodec.REQUEST_MESSAGE_TYPE<MASK><NEW_LINE>factories.put(JetGetJobMetricsCodec.REQUEST_MESSAGE_TYPE, toFactory(JetGetJobMetricsMessageTask::new));<NEW_LINE>factories.put(JetGetJobIdsCodec.REQUEST_MESSAGE_TYPE, toFactory(JetGetJobIdsMessageTask::new));<NEW_LINE>factories.put(JetJoinSubmittedJobCodec.REQUEST_MESSAGE_TYPE, toFactory(JetJoinSubmittedJobMessageTask::new));<NEW_LINE>factories.put(JetGetJobIdsByNameCodec.REQUEST_MESSAGE_TYPE, toFactory(JetGetJobIdsByNameMessageTask::new));<NEW_LINE>factories.put(JetGetJobSubmissionTimeCodec.REQUEST_MESSAGE_TYPE, toFactory(JetGetJobSubmissionTimeMessageTask::new));<NEW_LINE>factories.put(JetGetJobConfigCodec.REQUEST_MESSAGE_TYPE, toFactory(JetGetJobConfigMessageTask::new));<NEW_LINE>factories.put(JetResumeJobCodec.REQUEST_MESSAGE_TYPE, toFactory(JetResumeJobMessageTask::new));<NEW_LINE>factories.put(JetExportSnapshotCodec.REQUEST_MESSAGE_TYPE, toFactory(JetExportSnapshotMessageTask::new));<NEW_LINE>factories.put(JetGetJobSummaryListCodec.REQUEST_MESSAGE_TYPE, toFactory(JetGetJobSummaryListMessageTask::new));<NEW_LINE>factories.put(JetExistsDistributedObjectCodec.REQUEST_MESSAGE_TYPE, toFactory(JetExistsDistributedObjectMessageTask::new));<NEW_LINE>} | , toFactory(JetGetJobSuspensionCauseMessageTask::new)); |
1,247,533 | void solveColorMixing(final TimeStep step) {<NEW_LINE>// mixes color between contacting particles<NEW_LINE>m_colorBuffer.data = requestParticleBuffer(ParticleColor.class, m_colorBuffer.data);<NEW_LINE>int colorMixing256 = <MASK><NEW_LINE>for (int k = 0; k < m_contactCount; k++) {<NEW_LINE>final ParticleContact contact = m_contactBuffer[k];<NEW_LINE>int a = contact.indexA;<NEW_LINE>int b = contact.indexB;<NEW_LINE>if ((m_flagsBuffer.data[a] & m_flagsBuffer.data[b] & ParticleType.b2_colorMixingParticle) != 0) {<NEW_LINE>ParticleColor colorA = m_colorBuffer.data[a];<NEW_LINE>ParticleColor colorB = m_colorBuffer.data[b];<NEW_LINE>int dr = (colorMixing256 * ((colorB.r & 0xFF) - (colorA.r & 0xFF))) >> 8;<NEW_LINE>int dg = (colorMixing256 * ((colorB.g & 0xFF) - (colorA.g & 0xFF))) >> 8;<NEW_LINE>int db = (colorMixing256 * ((colorB.b & 0xFF) - (colorA.b & 0xFF))) >> 8;<NEW_LINE>int da = (colorMixing256 * ((colorB.a & 0xFF) - (colorA.a & 0xFF))) >> 8;<NEW_LINE>colorA.r += dr;<NEW_LINE>colorA.g += dg;<NEW_LINE>colorA.b += db;<NEW_LINE>colorA.a += da;<NEW_LINE>colorB.r -= dr;<NEW_LINE>colorB.g -= dg;<NEW_LINE>colorB.b -= db;<NEW_LINE>colorB.a -= da;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (int) (256 * m_colorMixingStrength); |
1,331,191 | static StateListDrawable bootstrapDropDownArrow(Context context, int width, int height, ExpandDirection expandDirection, boolean outline, BootstrapBrand brand) {<NEW_LINE>StateListDrawable stateListDrawable = new StateListDrawable();<NEW_LINE>int defaultColor = outline ? brand.defaultFill(context) : brand.defaultTextColor(context);<NEW_LINE>int activeColor = outline ? ColorUtils.resolveColor(android.R.color.white, context) : brand.activeTextColor(context);<NEW_LINE>int disabledColor = outline ? brand.disabledFill(context) : brand.disabledTextColor(context);<NEW_LINE>if (Build.VERSION.SDK_INT >= 14) {<NEW_LINE>stateListDrawable.addState(new int[] { android.R.attr.state_hovered }, createArrowIcon(context, width, height, activeColor, expandDirection));<NEW_LINE>}<NEW_LINE>stateListDrawable.addState(new int[] { android.R.attr.state_activated }, createArrowIcon(context, width, height, activeColor, expandDirection));<NEW_LINE>stateListDrawable.addState(new int[] { android.R.attr.state_focused }, createArrowIcon(context, width<MASK><NEW_LINE>stateListDrawable.addState(new int[] { android.R.attr.state_pressed }, createArrowIcon(context, width, height, activeColor, expandDirection));<NEW_LINE>stateListDrawable.addState(new int[] { android.R.attr.state_selected }, createArrowIcon(context, width, height, activeColor, expandDirection));<NEW_LINE>stateListDrawable.addState(new int[] { -android.R.attr.state_enabled }, createArrowIcon(context, width, height, disabledColor, expandDirection));<NEW_LINE>stateListDrawable.addState(new int[] {}, createArrowIcon(context, width, height, defaultColor, expandDirection));<NEW_LINE>return stateListDrawable;<NEW_LINE>} | , height, activeColor, expandDirection)); |
503,484 | public static ClientMessage encodeRequest(java.lang.String name, com.hazelcast.internal.serialization.Data key, com.hazelcast.internal.serialization.Data value, @Nullable com.hazelcast.internal.serialization.Data expiryPolicy, int completionId) {<NEW_LINE>ClientMessage clientMessage = ClientMessage.createForEncode();<NEW_LINE>clientMessage.setRetryable(false);<NEW_LINE>clientMessage.setOperationName("Cache.PutIfAbsent");<NEW_LINE>ClientMessage.Frame initialFrame = new ClientMessage.Frame(new byte[REQUEST_INITIAL_FRAME_SIZE], UNFRAGMENTED_MESSAGE);<NEW_LINE>encodeInt(initialFrame.content, TYPE_FIELD_OFFSET, REQUEST_MESSAGE_TYPE);<NEW_LINE>encodeInt(initialFrame.content, PARTITION_ID_FIELD_OFFSET, -1);<NEW_LINE>encodeInt(initialFrame.content, REQUEST_COMPLETION_ID_FIELD_OFFSET, completionId);<NEW_LINE>clientMessage.add(initialFrame);<NEW_LINE>StringCodec.encode(clientMessage, name);<NEW_LINE>DataCodec.encode(clientMessage, key);<NEW_LINE><MASK><NEW_LINE>CodecUtil.encodeNullable(clientMessage, expiryPolicy, DataCodec::encode);<NEW_LINE>return clientMessage;<NEW_LINE>} | DataCodec.encode(clientMessage, value); |
1,684,975 | private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {<NEW_LINE>if (compat) {<NEW_LINE>// Read an object serialized in the old serial form<NEW_LINE>//<NEW_LINE>ObjectInputStream.GetField fields = in.readFields();<NEW_LINE>typeName = (String) fields.get("myTypeName", null);<NEW_LINE>if (fields.defaulted("myTypeName")) {<NEW_LINE>throw new NullPointerException("myTypeName");<NEW_LINE>}<NEW_LINE>roleName2InfoMap = cast(fields.get("myRoleName2InfoMap", null));<NEW_LINE>if (fields.defaulted("myRoleName2InfoMap")) {<NEW_LINE>throw new NullPointerException("myRoleName2InfoMap");<NEW_LINE>}<NEW_LINE>isInRelationService = <MASK><NEW_LINE>if (fields.defaulted("myIsInRelServFlg")) {<NEW_LINE>throw new NullPointerException("myIsInRelServFlg");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Read an object serialized in the new serial form<NEW_LINE>//<NEW_LINE>in.defaultReadObject();<NEW_LINE>}<NEW_LINE>} | fields.get("myIsInRelServFlg", false); |
709,195 | public void addShardingExpr(Pair<String, String> table, String columnName, Object value) {<NEW_LINE>if (alwaysFalse) {<NEW_LINE>if (DTRACE_LOGGER.isTraceEnabled()) {<NEW_LINE>DTRACE_LOGGER.trace("this RouteCalculateUnit is always false, ignore " + changeValueToColumnRoute(value));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, ColumnRoute> tableColumnsMap = tablesAndConditions.get(table);<NEW_LINE>if (value == null) {<NEW_LINE>// where a=null<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (tableColumnsMap == null) {<NEW_LINE>tableColumnsMap = new LinkedHashMap<>();<NEW_LINE>tablesAndConditions.put(table, tableColumnsMap);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>ColumnRoute columnValue = tableColumnsMap.get(upperColName);<NEW_LINE>if (columnValue == null) {<NEW_LINE>columnValue = changeValueToColumnRoute(value);<NEW_LINE>if (columnValue.isAlwaysFalse()) {<NEW_LINE>markAlwaysFalse(columnValue);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>tableColumnsMap.put(upperColName, columnValue);<NEW_LINE>} else {<NEW_LINE>ColumnRoute newColumnValue = changeValueToColumnRoute(value);<NEW_LINE>if (newColumnValue.isAlwaysFalse()) {<NEW_LINE>markAlwaysFalse(columnValue);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>columnValue = mergeColumnRoute(columnValue, newColumnValue);<NEW_LINE>if (columnValue.isAlwaysFalse()) {<NEW_LINE>markAlwaysFalse(columnValue);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>tableColumnsMap.put(upperColName, columnValue);<NEW_LINE>}<NEW_LINE>} | String upperColName = columnName.toUpperCase(); |
1,755,352 | final UpdateGroupResult executeUpdateGroup(UpdateGroupRequest updateGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateGroupRequest> request = null;<NEW_LINE>Response<UpdateGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateGroupRequest));<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, "Greengrass");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateGroupResult>> 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 UpdateGroupResultJsonUnmarshaller()); |
290,179 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.grpc.service.DeviceManagementGrpc.DeviceManagementImplBase#<NEW_LINE>* listDeviceGroupElements(com.sitewhere.grpc.service.<NEW_LINE>* GListDeviceGroupElementsRequest, io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void listDeviceGroupElements(GListDeviceGroupElementsRequest request, StreamObserver<GListDeviceGroupElementsResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, DeviceManagementGrpc.getListDeviceGroupElementsMethod());<NEW_LINE>ISearchResults<? extends IDeviceGroupElement> apiResult = getDeviceManagement().listDeviceGroupElements(CommonModelConverter.asApiUuid(request.getGroupId()), CommonModelConverter.asApiSearchCriteria(request.getCriteria().getPaging()));<NEW_LINE>GListDeviceGroupElementsResponse.Builder response = GListDeviceGroupElementsResponse.newBuilder();<NEW_LINE>GDeviceGroupElementsSearchResults.Builder results = GDeviceGroupElementsSearchResults.newBuilder();<NEW_LINE>for (IDeviceGroupElement apiElement : apiResult.getResults()) {<NEW_LINE>results.addElements<MASK><NEW_LINE>}<NEW_LINE>results.setCount(apiResult.getNumResults());<NEW_LINE>response.setResults(results.build());<NEW_LINE>responseObserver.onNext(response.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(DeviceManagementGrpc.getListDeviceGroupElementsMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.handleServerMethodExit(DeviceManagementGrpc.getListDeviceGroupElementsMethod());<NEW_LINE>}<NEW_LINE>} | (DeviceModelConverter.asGrpcDeviceGroupElement(apiElement)); |
954,691 | public static <TSource, TResult> Enumerable<TResult> selectMany(final Enumerable<TSource> source, final Function2<TSource, Integer, Enumerable<TResult>> selector) {<NEW_LINE>return new AbstractEnumerable<TResult>() {<NEW_LINE><NEW_LINE>public Enumerator<TResult> enumerator() {<NEW_LINE>return new Enumerator<TResult>() {<NEW_LINE><NEW_LINE>int index = -1;<NEW_LINE><NEW_LINE>Enumerator<TSource<MASK><NEW_LINE><NEW_LINE>Enumerator<TResult> resultEnumerator = Linq4j.emptyEnumerator();<NEW_LINE><NEW_LINE>public TResult current() {<NEW_LINE>return resultEnumerator.current();<NEW_LINE>}<NEW_LINE><NEW_LINE>public boolean moveNext() {<NEW_LINE>for (; ; ) {<NEW_LINE>if (resultEnumerator.moveNext()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!sourceEnumerator.moveNext()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>index += 1;<NEW_LINE>resultEnumerator = selector.apply(sourceEnumerator.current(), index).enumerator();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>public void reset() {<NEW_LINE>sourceEnumerator.reset();<NEW_LINE>resultEnumerator = Linq4j.emptyEnumerator();<NEW_LINE>}<NEW_LINE><NEW_LINE>public void close() {<NEW_LINE>sourceEnumerator.close();<NEW_LINE>resultEnumerator.close();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | > sourceEnumerator = source.enumerator(); |
401,429 | private synchronized IMqttAsyncClient checkConnection() throws MqttException {<NEW_LINE>if (this.client != null && !this.client.isConnected()) {<NEW_LINE>this.client.setCallback(null);<NEW_LINE>this.client.close();<NEW_LINE>this.client = null;<NEW_LINE>}<NEW_LINE>if (this.client == null) {<NEW_LINE>try {<NEW_LINE>MqttConnectOptions connectionOptions = this.clientFactory.getConnectionOptions();<NEW_LINE>Assert.state(this.getUrl() != null || connectionOptions.getServerURIs() != null, "If no 'url' provided, connectionOptions.getServerURIs() must not be null");<NEW_LINE>this.client = this.clientFactory.getAsyncClientInstance(this.getUrl(), this.getClientId());<NEW_LINE>incrementClientInstance();<NEW_LINE>this.client.setCallback(this);<NEW_LINE>this.client.connect(connectionOptions).waitForCompletion(getCompletionTimeout());<NEW_LINE>logger.debug("Client connected");<NEW_LINE>} catch (MqttException e) {<NEW_LINE>if (this.client != null) {<NEW_LINE>this.client.close();<NEW_LINE>this.client = null;<NEW_LINE>}<NEW_LINE>ApplicationEventPublisher applicationEventPublisher = getApplicationEventPublisher();<NEW_LINE>if (applicationEventPublisher != null) {<NEW_LINE>applicationEventPublisher.publishEvent(new MqttConnectionFailedEvent(this, e));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this.client;<NEW_LINE>} | throw new MessagingException("Failed to connect", e); |
1,705,963 | private void updatePhones(String contactId, Contact contact) throws Exception {<NEW_LINE>String[] phones = { Phonebook.PB_MOBILE_NUMBER, Phonebook.PB_HOME_NUMBER, Phonebook.PB_BUSINESS_NUMBER };<NEW_LINE>int[] types = { Phone.TYPE_MOBILE, Phone.TYPE_HOME, Phone.TYPE_WORK };<NEW_LINE>for (int i = 0; i < phones.length; ++i) {<NEW_LINE>String value = contact.getField(phones[i]);<NEW_LINE>if (value == null || value.length() == 0)<NEW_LINE>continue;<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>values.put(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);<NEW_LINE>values.put(Phone.NUMBER, value);<NEW_LINE>values.put(Phone<MASK><NEW_LINE>saveData(contactId, values, Phone.TYPE + "=?", new String[] { String.valueOf(types[i]) });<NEW_LINE>}<NEW_LINE>} | .TYPE, types[i]); |
331,957 | public ValueHandler createKeyValueHandler(Object keys) {<NEW_LINE>if (keys == null) {<NEW_LINE>throw new ClusterJUserException(local.message("ERR_Key_Must_Not_Be_Null"<MASK><NEW_LINE>}<NEW_LINE>Object[] keyValues = new Object[numberOfFields];<NEW_LINE>// check the cardinality of the keys with the number of key fields<NEW_LINE>if (numberOfIdFields == 1) {<NEW_LINE>Class<?> keyType = idFieldHandlers[0].getType();<NEW_LINE>DomainFieldHandler fmd = idFieldHandlers[0];<NEW_LINE>checkKeyType(fmd.getName(), keyType, keys);<NEW_LINE>int keyFieldNumber = fmd.getFieldNumber();<NEW_LINE>keyValues[keyFieldNumber] = keys;<NEW_LINE>} else {<NEW_LINE>if (!(keys.getClass().isArray())) {<NEW_LINE>throw new ClusterJUserException(local.message("ERR_Key_Must_Be_An_Object_Array", numberOfIdFields));<NEW_LINE>}<NEW_LINE>Object[] keyObjects = (Object[]) keys;<NEW_LINE>for (int i = 0; i < numberOfIdFields; ++i) {<NEW_LINE>DomainFieldHandler fmd = idFieldHandlers[i];<NEW_LINE>int index = fmd.getFieldNumber();<NEW_LINE>Object keyObject = keyObjects[i];<NEW_LINE>Class<?> keyType = fmd.getType();<NEW_LINE>checkKeyType(fmd.getName(), keyType, keyObject);<NEW_LINE>keyValues[index] = keyObjects[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new KeyValueHandlerImpl(keyValues);<NEW_LINE>} | , getName(), "unknown")); |
1,083,852 | private void updateCompatibleScreens(Document doc, Element manifestElement) {<NEW_LINE>Element compatibleScreensElem = XmlHelper.getOrCreateElement(doc, manifestElement, ELEM_COMPATIBLE_SCREENS);<NEW_LINE>// read those screen elements that were already defined in the Manifest<NEW_LINE>NodeList manifestScreenElems = compatibleScreensElem.getElementsByTagName(ELEM_SCREEN);<NEW_LINE>int numManifestScreens = manifestScreenElems.getLength();<NEW_LINE>ArrayList<CompatibleScreen> manifestScreens = new ArrayList<CompatibleScreen>(numManifestScreens);<NEW_LINE>for (int i = 0; i < numManifestScreens; i++) {<NEW_LINE>Element screenElem = (Element) manifestScreenElems.item(i);<NEW_LINE>CompatibleScreen screen = new CompatibleScreen();<NEW_LINE>screen.setScreenDensity(screenElem.getAttribute(ATTR_SCREEN_DENSITY));<NEW_LINE>screen.setScreenSize(screenElem.getAttribute(ATTR_SCREEN_SIZE));<NEW_LINE>manifestScreens.add(screen);<NEW_LINE>getLog(<MASK><NEW_LINE>}<NEW_LINE>// remove all child nodes, since we'll rebuild the element<NEW_LINE>XmlHelper.removeDirectChildren(compatibleScreensElem);<NEW_LINE>for (CompatibleScreen screen : parsedCompatibleScreens) {<NEW_LINE>getLog().debug("Found POM compatible-screen: " + screen);<NEW_LINE>}<NEW_LINE>// merge those screens defined in the POM, overriding any matching screens<NEW_LINE>// already defined in the Manifest<NEW_LINE>HashSet<CompatibleScreen> mergedScreens = new HashSet<CompatibleScreen>();<NEW_LINE>mergedScreens.addAll(manifestScreens);<NEW_LINE>mergedScreens.addAll(parsedCompatibleScreens);<NEW_LINE>for (CompatibleScreen screen : mergedScreens) {<NEW_LINE>getLog().debug("Using compatible-screen: " + screen);<NEW_LINE>Element screenElem = doc.createElement(ELEM_SCREEN);<NEW_LINE>screenElem.setAttribute(ATTR_SCREEN_SIZE, screen.getScreenSize());<NEW_LINE>screenElem.setAttribute(ATTR_SCREEN_DENSITY, screen.getScreenDensity());<NEW_LINE>compatibleScreensElem.appendChild(screenElem);<NEW_LINE>}<NEW_LINE>} | ).debug("Found Manifest compatible-screen: " + screen); |
1,374,608 | public int display(Collection<ConfigurationKey<?>> keys, boolean verbose, Collection<String> argsPaths, boolean explicitKeys, boolean notMentioned) throws Exception {<NEW_LINE>TreeMap<URI, Set<String>> sharedDirectories = findSharedDirectories(argsPaths);<NEW_LINE>if (sharedDirectories == null)<NEW_LINE>return 1;<NEW_LINE>Set<String> none = sharedDirectories.remove(NO_CONFIG);<NEW_LINE>if (none != null) {<NEW_LINE>if (none.size() == 1) {<NEW_LINE>out.printf("No 'lombok.config' found for '%s'.%n", none.iterator().next());<NEW_LINE>} else {<NEW_LINE>out.println("No 'lombok.config' found for: ");<NEW_LINE>for (String path : none) out.printf("- %s%n", path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final List<String> problems = new ArrayList<String>();<NEW_LINE>ConfigurationProblemReporter reporter = new ConfigurationProblemReporter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void report(String sourceDescription, String problem, int lineNumber, CharSequence line) {<NEW_LINE>problems.add(String.format("%s: %s (%s:%d)", problem<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>FileSystemSourceCache cache = new FileSystemSourceCache();<NEW_LINE>ConfigurationParser parser = new ConfigurationParser(reporter);<NEW_LINE>boolean first = true;<NEW_LINE>for (Entry<URI, Set<String>> entry : sharedDirectories.entrySet()) {<NEW_LINE>if (!first) {<NEW_LINE>out.printf("%n%n");<NEW_LINE>}<NEW_LINE>Set<String> paths = entry.getValue();<NEW_LINE>if (paths.size() == 1) {<NEW_LINE>if (!(argsPaths.size() == 1))<NEW_LINE>out.printf("Configuration for '%s'.%n%n", paths.iterator().next());<NEW_LINE>} else {<NEW_LINE>out.printf("Configuration for:%n");<NEW_LINE>for (String path : paths) out.printf("- %s%n", path);<NEW_LINE>out.println();<NEW_LINE>}<NEW_LINE>URI directory = entry.getKey();<NEW_LINE>ConfigurationResolver resolver = new BubblingConfigurationResolver(cache.forUri(directory), cache.fileToSource(parser));<NEW_LINE>Map<ConfigurationKey<?>, ? extends Collection<String>> traces = trace(keys, directory, notMentioned);<NEW_LINE>boolean printed = false;<NEW_LINE>for (ConfigurationKey<?> key : keys) {<NEW_LINE>Object value = resolver.resolve(key);<NEW_LINE>Collection<String> modifications = traces.get(key);<NEW_LINE>if (!modifications.isEmpty() || explicitKeys) {<NEW_LINE>if (printed && verbose)<NEW_LINE>out.println();<NEW_LINE>printValue(key, value, verbose, modifications);<NEW_LINE>printed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!printed)<NEW_LINE>out.println("<default>");<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>if (!problems.isEmpty()) {<NEW_LINE>err.printf("Problems in the configuration files:%n");<NEW_LINE>for (String problem : problems) err.printf("- %s%n", problem);<NEW_LINE>return 2;<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | , line, sourceDescription, lineNumber)); |
711,056 | public static void main(String[] args) {<NEW_LINE>final String USAGE = "\n" + "Usage: " + " <pathSource> <pathTarget>\n\n" + "Where:\n" + " pathSource - the path to the source image (for example, C:\\AWS\\pic1.png). \n " + " pathTarget - the path to the target image (for example, C:\\AWS\\pic2.png). \n\n";<NEW_LINE>if (args.length != 2) {<NEW_LINE><MASK><NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>Float similarityThreshold = 70F;<NEW_LINE>String sourceImage = args[0];<NEW_LINE>String targetImage = args[1];<NEW_LINE>Region region = Region.US_EAST_1;<NEW_LINE>RekognitionClient rekClient = RekognitionClient.builder().region(region).build();<NEW_LINE>compareTwoFaces(rekClient, similarityThreshold, sourceImage, targetImage);<NEW_LINE>rekClient.close();<NEW_LINE>} | System.out.println(USAGE); |
1,391,235 | public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>// WUtil.debug(new String("In do Post"),"");<NEW_LINE>HttpSession sess = request.getSession();<NEW_LINE>WebSessionCtx wsc = WebSessionCtx.get(request);<NEW_LINE>Properties ctx = wsc.ctx;<NEW_LINE>if (ctx == null) {<NEW_LINE>WebUtil.createTimeoutPage(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// String loginInfo = (String)sess.getAttribute(WEnv.SA_LOGININFO);<NEW_LINE>// get session attributes<NEW_LINE>MWorkflow wf = (MWorkflow) sess.getAttribute(WORKFLOW);<NEW_LINE>MWFNode[] nodes = (MWFNode[]) sess.getAttribute(NODES);<NEW_LINE>ArrayList nodes_ID = (ArrayList) sess.getAttribute(NODES_ID);<NEW_LINE>int[][] imageMap = (int[][]) sess.getAttribute(IMAGE_MAP);<NEW_LINE>int activeNode = ((Integer) sess.getAttribute(ACTIVE_NODE)).intValue();<NEW_LINE>// execute commnad<NEW_LINE>String m_command = request.getParameter(M_Command);<NEW_LINE>int j_command = WebUtil.getParameterAsInt(request, J_Command);<NEW_LINE>// WUtil.debug(m_command,"m_command");<NEW_LINE>// WUtil.debug(""+j_command,"j_command");<NEW_LINE>executeCommand(m_command, j_command, wf, activeNode, nodes, nodes_ID, sess);<NEW_LINE>// get updated session attributes<NEW_LINE>wf = (MWorkflow) sess.getAttribute(WORKFLOW);<NEW_LINE>nodes = (MWFNode[]) sess.getAttribute(NODES);<NEW_LINE>nodes_ID = (ArrayList) sess.getAttribute(NODES_ID);<NEW_LINE>imageMap = (int[][]) sess.getAttribute(IMAGE_MAP);<NEW_LINE>activeNode = ((Integer) sess.getAttribute(ACTIVE_NODE)).intValue();<NEW_LINE>// create layout<NEW_LINE>WebDoc doc = preparePage("loginInfo");<NEW_LINE>doc = createLayout(doc, wf, activeNode, nodes, nodes_ID, imageMap);<NEW_LINE>WebUtil.createResponse(request, response, this, null, doc, false);<NEW_LINE>} | request, response, this, null); |
948,072 | public QueryRunner<SegmentAnalysis> mergeResults(final QueryRunner<SegmentAnalysis> runner) {<NEW_LINE>return new BySegmentSkippingQueryRunner<SegmentAnalysis>(runner) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Sequence<SegmentAnalysis> doRun(QueryRunner<SegmentAnalysis> baseRunner, QueryPlus<SegmentAnalysis> queryPlus, ResponseContext context) {<NEW_LINE>SegmentMetadataQuery updatedQuery = ((SegmentMetadataQuery) queryPlus.getQuery()).withFinalizedAnalysisTypes(config);<NEW_LINE>QueryPlus<SegmentAnalysis> updatedQueryPlus = queryPlus.withQuery(updatedQuery);<NEW_LINE>return new MappedSequence<>(CombiningSequence.create(baseRunner.run(updatedQueryPlus, context), makeOrdering(updatedQuery), createMergeFn(<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>private Ordering<SegmentAnalysis> makeOrdering(SegmentMetadataQuery query) {<NEW_LINE>return (Ordering<SegmentAnalysis>) SegmentMetadataQueryQueryToolChest.this.createResultComparator(query);<NEW_LINE>}<NEW_LINE><NEW_LINE>private BinaryOperator<SegmentAnalysis> createMergeFn(final SegmentMetadataQuery inQ) {<NEW_LINE>return SegmentMetadataQueryQueryToolChest.this.createMergeFn(inQ);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | updatedQuery)), MERGE_TRANSFORM_FN::apply); |
71,119 | private JPanel initializeInnerFrame(Genre genreToEdit) {<NEW_LINE>JPanel innerPanel = new JPanel();<NEW_LINE>GridBagLayout gridBagLayout = new GridBagLayout();<NEW_LINE>gridBagLayout.columnWeights = new double[] { 0.0, 1.0 };<NEW_LINE>innerPanel.setLayout(gridBagLayout);<NEW_LINE>JLabel lblGenre = new JLabel("Genre :");<NEW_LINE>GridBagConstraints gbc_lblGenre = new GridBagConstraints();<NEW_LINE>gbc_lblGenre.insets = new Insets(0, 0, 0, 5);<NEW_LINE>gbc_lblGenre.anchor = GridBagConstraints.EAST;<NEW_LINE>gbc_lblGenre.gridx = 0;<NEW_LINE>gbc_lblGenre.gridy = 0;<NEW_LINE><MASK><NEW_LINE>textFieldGenre = new JTextField();<NEW_LINE>if (genreToEdit != null && genreToEdit.getGenre().length() > 0)<NEW_LINE>textFieldGenre.setText(genreToEdit.getGenre());<NEW_LINE>GridBagConstraints gbc_textField = new GridBagConstraints();<NEW_LINE>gbc_textField.fill = GridBagConstraints.HORIZONTAL;<NEW_LINE>gbc_textField.gridx = 1;<NEW_LINE>gbc_textField.gridy = 0;<NEW_LINE>innerPanel.add(textFieldGenre, gbc_textField);<NEW_LINE>textFieldGenre.setColumns(10);<NEW_LINE>return innerPanel;<NEW_LINE>} | innerPanel.add(lblGenre, gbc_lblGenre); |
282,939 | Path apply(Upgrade upgrade) throws IOException {<NEW_LINE>String buildFileContents = new String(Files.readAllBytes(this.buildFile), StandardCharsets.UTF_8);<NEW_LINE>Matcher matcher = Pattern.compile("library\\(\"" + upgrade.getLibrary().getName() + "\", \"(.+)\"\\)").matcher(buildFileContents);<NEW_LINE>if (!matcher.find()) {<NEW_LINE>matcher = Pattern.compile("library\\(\"" + upgrade.getLibrary().getName() + "\"\\) \\{\\s+version\\(\"(.+)\"\\)", Pattern.MULTILINE).matcher(buildFileContents);<NEW_LINE>if (!matcher.find()) {<NEW_LINE>throw new IllegalStateException("Failed to find definition for library '" + upgrade.getLibrary().getName() + "' in bom '" + this.buildFile + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String version = matcher.group(1);<NEW_LINE>if (version.startsWith("${") && version.endsWith("}")) {<NEW_LINE>updateGradleProperties(upgrade, version);<NEW_LINE>return this.gradleProperties;<NEW_LINE>} else {<NEW_LINE>updateBuildFile(upgrade, buildFileContents, matcher.start(1)<MASK><NEW_LINE>return this.buildFile;<NEW_LINE>}<NEW_LINE>} | , matcher.end(1)); |
1,012,370 | private RexNode convertIdentifier(Blackboard bb, SqlIdentifier identifier) {<NEW_LINE>// first check for reserved identifiers like CURRENT_USER<NEW_LINE>final SqlCall call = bb.getValidator().makeNullaryCall(identifier);<NEW_LINE>if (call != null) {<NEW_LINE>return bb.convertExpression(call);<NEW_LINE>}<NEW_LINE>String pv = null;<NEW_LINE>if (bb.isPatternVarRef && identifier.names.size() > 1) {<NEW_LINE>pv = identifier.names.get(0);<NEW_LINE>}<NEW_LINE>final SqlQualified qualified;<NEW_LINE>if (bb.scope != null) {<NEW_LINE>qualified = bb.scope.fullyQualify(identifier);<NEW_LINE>} else {<NEW_LINE>qualified = SqlQualified.create(<MASK><NEW_LINE>}<NEW_LINE>final Pair<RexNode, Map<String, Integer>> e0 = bb.lookupExp(qualified);<NEW_LINE>RexNode e = e0.left;<NEW_LINE>for (String name : qualified.suffix()) {<NEW_LINE>if (e == e0.left && e0.right != null) {<NEW_LINE>int i = e0.right.get(name);<NEW_LINE>e = rexBuilder.makeFieldAccess(e, i);<NEW_LINE>} else {<NEW_LINE>// name already fully-qualified<NEW_LINE>final boolean caseSensitive = true;<NEW_LINE>if (identifier.isStar() && bb.scope instanceof MatchRecognizeScope) {<NEW_LINE>e = rexBuilder.makeFieldAccess(e, 0);<NEW_LINE>} else {<NEW_LINE>e = rexBuilder.makeFieldAccess(e, name, caseSensitive);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e instanceof RexInputRef) {<NEW_LINE>// adjust the type to account for nulls introduced by outer joins<NEW_LINE>e = adjustInputRef(bb, (RexInputRef) e);<NEW_LINE>if (pv != null) {<NEW_LINE>e = RexPatternFieldRef.of(pv, (RexInputRef) e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e0.left instanceof RexCorrelVariable) {<NEW_LINE>assert e instanceof RexFieldAccess;<NEW_LINE>final RexNode prev = bb.mapCorrelateToRex.put(((RexCorrelVariable) e0.left).id, (RexFieldAccess) e);<NEW_LINE>assert prev == null;<NEW_LINE>}<NEW_LINE>return e;<NEW_LINE>} | null, 1, null, identifier); |
1,177,844 | protected Value[] createNativeABICallerSaveRegisters(@SuppressWarnings("unused") GraalHotSpotVMConfig config, RegisterConfig regConfig) {<NEW_LINE>List<Register> callerSave = new ArrayList<>(regConfig.getAllocatableRegisters().asList());<NEW_LINE>// Removing callee-saved registers.<NEW_LINE>callerSave.remove(AArch64.v8);<NEW_LINE>callerSave.remove(AArch64.v9);<NEW_LINE>callerSave.remove(AArch64.v10);<NEW_LINE><MASK><NEW_LINE>callerSave.remove(AArch64.v12);<NEW_LINE>callerSave.remove(AArch64.v13);<NEW_LINE>callerSave.remove(AArch64.v14);<NEW_LINE>callerSave.remove(AArch64.v15);<NEW_LINE>Value[] nativeABICallerSaveRegisters = new Value[callerSave.size()];<NEW_LINE>for (int i = 0; i < callerSave.size(); i++) {<NEW_LINE>nativeABICallerSaveRegisters[i] = callerSave.get(i).asValue();<NEW_LINE>}<NEW_LINE>return nativeABICallerSaveRegisters;<NEW_LINE>} | callerSave.remove(AArch64.v11); |
587,786 | final UpdateEndpointResult executeUpdateEndpoint(UpdateEndpointRequest updateEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateEndpointRequest> request = null;<NEW_LINE>Response<UpdateEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateEndpointRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateEndpointRequest));<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, "Pinpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateEndpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateEndpointResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateEndpointResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
586,993 | /*<NEW_LINE>Calculates the distance between two coordinates in meters<NEW_LINE>*/<NEW_LINE>public static double distance(double lat1, double lat2, double lon1, double lon2) {<NEW_LINE>// Radius of the earth<NEW_LINE>final int R = 6371;<NEW_LINE>double latDistance = <MASK><NEW_LINE>double lonDistance = Math.toRadians(lon2 - lon1);<NEW_LINE>double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);<NEW_LINE>double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));<NEW_LINE>// convert to meters<NEW_LINE>double distance = R * c * 1000;<NEW_LINE>distance = Math.pow(distance, 2);<NEW_LINE>return Math.sqrt(distance);<NEW_LINE>} | Math.toRadians(lat2 - lat1); |
160,794 | public void updateDeptConfigs(Integer deptId, String[] configs) {<NEW_LINE>if (CommonUtils.notEmpty(deptId)) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<SysDeptConfig> list = (List<SysDeptConfig>) getPage(deptId, null, null, null).getList();<NEW_LINE>for (SysDeptConfig deptConfig : list) {<NEW_LINE>if (ArrayUtils.contains(configs, deptConfig.getId().getConfig())) {<NEW_LINE>configs = ArrayUtils.removeElement(configs, deptConfig.<MASK><NEW_LINE>} else {<NEW_LINE>delete(deptConfig.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (CommonUtils.notEmpty(configs)) {<NEW_LINE>for (String config : configs) {<NEW_LINE>save(new SysDeptConfig(new SysDeptConfigId(deptId, config)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getId().getConfig()); |
1,289,494 | public ScheduledAutoTuneDetails unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ScheduledAutoTuneDetails scheduledAutoTuneDetails = new ScheduledAutoTuneDetails();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Date", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>scheduledAutoTuneDetails.setDate(DateJsonUnmarshallerFactory.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("ActionType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>scheduledAutoTuneDetails.setActionType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Action", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>scheduledAutoTuneDetails.setAction(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Severity", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>scheduledAutoTuneDetails.setSeverity(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return scheduledAutoTuneDetails;<NEW_LINE>} | "unixTimestamp").unmarshall(context)); |
1,686,397 | private void mapResourceFileToTargetClassFiles(JCTree.JCClassDecl tree) {<NEW_LINE>if (tree.sym == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Name qualifiedName = tree.sym.getQualifiedName();<NEW_LINE>if (qualifiedName == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JavaFileObject sourcefile = tree.sym.sourcefile;<NEW_LINE>if (!(sourcefile instanceof GeneratedJavaStubFileObject)) {<NEW_LINE>// not a Manifold generated type<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<File, Set<String>> typesCompiledByFile = new HashMap<>();<NEW_LINE>Set<IFile> resourceFiles = ((GeneratedJavaStubFileObject) sourcefile).getResourceFiles();<NEW_LINE>for (IFile ifile : resourceFiles) {<NEW_LINE>File file;<NEW_LINE>try {<NEW_LINE>while (ifile instanceof IFileFragment) {<NEW_LINE>ifile = ((IFileFragment) ifile).getEnclosingFile();<NEW_LINE>}<NEW_LINE>file = ifile.toJavaFile();<NEW_LINE>} catch (Exception e) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Set<String> <MASK><NEW_LINE>if (types == null) {<NEW_LINE>typesCompiledByFile.put(file, types = new ConcurrentHashSet<>());<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>make$name(tree.sym, sb);<NEW_LINE>types.add(sb.toString());<NEW_LINE>}<NEW_LINE>mapResourceFileToTargetClassFiles(typesCompiledByFile);<NEW_LINE>} | types = typesCompiledByFile.get(file); |
1,152,920 | final PutDomainPermissionsPolicyResult executePutDomainPermissionsPolicy(PutDomainPermissionsPolicyRequest putDomainPermissionsPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putDomainPermissionsPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutDomainPermissionsPolicyRequest> request = null;<NEW_LINE>Response<PutDomainPermissionsPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutDomainPermissionsPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putDomainPermissionsPolicyRequest));<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, "codeartifact");<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<PutDomainPermissionsPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutDomainPermissionsPolicyResultJsonUnmarshaller());<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, "PutDomainPermissionsPolicy"); |
507,777 | public Future<Object> scheduleFixedBroadcast(final Object o, long waitFor, long period, TimeUnit t) {<NEW_LINE>if (destroyed.get()) {<NEW_LINE>logger.debug(<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>start();<NEW_LINE>if (period == 0 || t == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final Object msg = filter(o);<NEW_LINE>if (msg == null)<NEW_LINE>return null;<NEW_LINE>final BroadcasterFuture<Object> f = new BroadcasterFuture<Object>(msg);<NEW_LINE>return (Future<Object>) bc.getScheduledExecutorService().scheduleWithFixedDelay(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (Callable.class.isAssignableFrom(o.getClass())) {<NEW_LINE>try {<NEW_LINE>Object r = Callable.class.cast(o).call();<NEW_LINE>final Object msg = filter(r);<NEW_LINE>if (msg != null) {<NEW_LINE>Deliver deliver = new Deliver(msg, f, r);<NEW_LINE>push(deliver);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Object msg = filter(o);<NEW_LINE>final Deliver e = new Deliver(msg, f, o);<NEW_LINE>push(e);<NEW_LINE>}<NEW_LINE>}, waitFor, period, t);<NEW_LINE>} | DESTROYED, getID(), "scheduleFixedBroadcast(final Object o, long waitFor, long period, TimeUnit t)"); |
880,347 | public static boolean onScroll(double delta) {<NEW_LINE>Minecraft mc = Minecraft.getInstance();<NEW_LINE>HitResult objectMouseOver = mc.hitResult;<NEW_LINE>if (!(objectMouseOver instanceof BlockHitResult))<NEW_LINE>return false;<NEW_LINE>BlockHitResult result = (BlockHitResult) objectMouseOver;<NEW_LINE>ClientLevel world = mc.level;<NEW_LINE>BlockPos blockPos = result.getBlockPos();<NEW_LINE>ScrollValueBehaviour scrolling = TileEntityBehaviour.get(world, blockPos, ScrollValueBehaviour.TYPE);<NEW_LINE>if (scrolling == null)<NEW_LINE>return false;<NEW_LINE>if (!scrolling.isActive())<NEW_LINE>return false;<NEW_LINE>if (!mc.player.mayBuild())<NEW_LINE>return false;<NEW_LINE>if (scrolling.needsWrench && !AllItems.WRENCH.isIn(mc.player.getMainHandItem()))<NEW_LINE>return false;<NEW_LINE>passiveScrollDirection = (float) -delta;<NEW_LINE>wrenchCog.bump(3, -delta * 10);<NEW_LINE>int prev = scrolling.scrollableValue;<NEW_LINE>if (scrolling.slotPositioning instanceof Sided)<NEW_LINE>((Sided) scrolling.slotPositioning).fromSide(result.getDirection());<NEW_LINE>if (!scrolling.testHit(objectMouseOver.getLocation()))<NEW_LINE>return false;<NEW_LINE>if (scrolling instanceof BulkScrollValueBehaviour && AllKeys.ctrlDown()) {<NEW_LINE>BulkScrollValueBehaviour bulkScrolling = (BulkScrollValueBehaviour) scrolling;<NEW_LINE>for (SmartTileEntity te : bulkScrolling.getBulk()) {<NEW_LINE>ScrollValueBehaviour other = te.getBehaviour(ScrollValueBehaviour.TYPE);<NEW_LINE>if (other != null)<NEW_LINE>applyTo(delta, other);<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>applyTo(delta, scrolling);<NEW_LINE>if (prev != scrolling.scrollableValue) {<NEW_LINE>float pitch = (scrolling.scrollableValue - scrolling.min) / (float) (scrolling.max - scrolling.min);<NEW_LINE>pitch = Mth.<MASK><NEW_LINE>AllSoundEvents.SCROLL_VALUE.play(world, mc.player, blockPos, 1, pitch);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | lerp(pitch, 1.5f, 2f); |
1,646,349 | public void run() {<NEW_LINE>// Sleep until we have reached the timeout<NEW_LINE>boolean allTerminated = isTerminated();<NEW_LINE>long timeoutNano = TimeUnit.SECONDS.toNanos(timeout);<NEW_LINE>while (!stopped && ((System.nanoTime() - startTime) < timeoutNano)) {<NEW_LINE>allTerminated = isTerminated();<NEW_LINE>if (allTerminated) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// There's little we can do here<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long timeElapsed = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - startTime);<NEW_LINE>// If things have not stopped on their own account, we force<NEW_LINE>// them to<NEW_LINE>if (!stopped && !allTerminated) {<NEW_LINE>logger.warn("Timeout reached, stopping the solvers...");<NEW_LINE>if (results != null) {<NEW_LINE>results.addException("Timeout reached");<NEW_LINE>}<NEW_LINE>TimeoutReason reason <MASK><NEW_LINE>for (IMemoryBoundedSolver solver : solvers.keySet()) {<NEW_LINE>solver.forceTerminate(reason);<NEW_LINE>}<NEW_LINE>if (terminationCallback != null) {<NEW_LINE>terminationCallback.onSolversTerminated();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info("FlowDroid timeout watcher terminated");<NEW_LINE>} | = new TimeoutReason(timeElapsed, timeout); |
1,443,988 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>log("onCreate.");<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// Create the client used to sign in.<NEW_LINE>mGoogleSignInClient = GoogleSignIn.getClient(this, // Since we are using SavedGames, we need to add the SCOPE_APPFOLDER to access Google Drive.<NEW_LINE>new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN).requestScopes(Drive<MASK><NEW_LINE>for (int id : LEVEL_BUTTON_IDS) {<NEW_LINE>findViewById(id).setOnClickListener(this);<NEW_LINE>}<NEW_LINE>findViewById(R.id.button_next_world).setOnClickListener(this);<NEW_LINE>findViewById(R.id.button_prev_world).setOnClickListener(this);<NEW_LINE>findViewById(R.id.button_sign_in).setOnClickListener(this);<NEW_LINE>findViewById(R.id.button_sign_out).setOnClickListener(this);<NEW_LINE>((RatingBar) findViewById(R.id.gameplay_rating)).setOnRatingBarChangeListener(this);<NEW_LINE>mSaveGame = new SaveGame();<NEW_LINE>updateUi();<NEW_LINE>checkPlaceholderIds();<NEW_LINE>} | .SCOPE_APPFOLDER).build()); |
1,800,837 | public static String xpathInjectImageRelId(WordprocessingMLPackage wmlPackage, JaxbXmlPart sourcePart, Map<String, CustomXmlDataStoragePart> customXmlDataStorageParts, String storeItemId, String xpath, String prefixMappings) {<NEW_LINE>// TODO: remove any images in package which are no longer used.<NEW_LINE>// Needs to be done once after BindingHandler has been done<NEW_LINE>// for all parts for which it is to be called (eg mdp, header parts etc).<NEW_LINE>CustomXmlDataStoragePart part = customXmlDataStorageParts.get(storeItemId.toLowerCase());<NEW_LINE>if (part == null) {<NEW_LINE>log.error("Couldn't locate part by storeItemId " + storeItemId);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String xpResult = part.getData().xpathGetString(xpath, prefixMappings);<NEW_LINE>log.debug(xpath + <MASK><NEW_LINE>// Base64 decode it<NEW_LINE>byte[] bytes = Base64.decodeBase64(xpResult.getBytes("UTF8"));<NEW_LINE>// Create image part and add it<NEW_LINE>BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(wmlPackage, sourcePart, bytes);<NEW_LINE>// In certain circumstances, save it immediately<NEW_LINE>if (wmlPackage.getTargetPartStore() != null && wmlPackage.getTargetPartStore() instanceof UnzippedPartStore) {<NEW_LINE>log.debug("incrementally saving " + imagePart.getPartName().getName());<NEW_LINE>((UnzippedPartStore) wmlPackage.getTargetPartStore()).saveBinaryPart(imagePart);<NEW_LINE>// remove it from memory<NEW_LINE>ByteBuffer bb = null;<NEW_LINE>// new byte[0]);<NEW_LINE>imagePart.setBinaryData(bb);<NEW_LINE>// this might help as well<NEW_LINE>imagePart.setImageInfo(null);<NEW_LINE>}<NEW_LINE>return imagePart.getRelLast().getId();<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | " yielded result length" + xpResult.length()); |
691,766 | private JPanel createButtonsPanel() {<NEW_LINE>final JButton openFileButton = new JButton(new FileSelectionAction());<NEW_LINE>openFileButton.setName("openFileButton");<NEW_LINE>openFileButton.setMnemonic(KeyEvent.VK_O);<NEW_LINE>openFileButton.setText("Open File");<NEW_LINE>reloadAction.setEnabled(false);<NEW_LINE>final JButton reloadFileButton = new JButton(reloadAction);<NEW_LINE>reloadFileButton.setMnemonic(KeyEvent.VK_R);<NEW_LINE>reloadFileButton.setText("Reload File");<NEW_LINE>final JComboBox<ParseMode> modesCombobox = new JComboBox<>(ParseMode.values());<NEW_LINE>modesCombobox.setName("modesCombobox");<NEW_LINE>modesCombobox.setSelectedIndex(0);<NEW_LINE>modesCombobox.addActionListener(event -> {<NEW_LINE>model.setParseMode((ParseMode) modesCombobox.getSelectedItem());<NEW_LINE>reloadAction.actionPerformed(null);<NEW_LINE>});<NEW_LINE>final JLabel modesLabel = new JLabel("Modes:", SwingConstants.RIGHT);<NEW_LINE>final int leftIndentation = 10;<NEW_LINE>modesLabel.setBorder(BorderFactory.createEmptyBorder(0, leftIndentation, 0, 0));<NEW_LINE><MASK><NEW_LINE>buttonPanel.setLayout(new GridLayout(1, 2));<NEW_LINE>buttonPanel.add(openFileButton);<NEW_LINE>buttonPanel.add(reloadFileButton);<NEW_LINE>final JPanel modesPanel = new JPanel();<NEW_LINE>modesPanel.add(modesLabel);<NEW_LINE>modesPanel.add(modesCombobox);<NEW_LINE>final JPanel mainPanel = new JPanel();<NEW_LINE>mainPanel.setLayout(new BorderLayout());<NEW_LINE>mainPanel.add(buttonPanel);<NEW_LINE>mainPanel.add(modesPanel, BorderLayout.LINE_END);<NEW_LINE>return mainPanel;<NEW_LINE>} | final JPanel buttonPanel = new JPanel(); |
1,354,380 | public void fetchNativeAppStart(Promise promise) {<NEW_LINE>final AppStartState appStartInstance = AppStartState.getInstance();<NEW_LINE>final Date appStartTime = appStartInstance.getAppStartTime();<NEW_LINE>final Boolean isColdStart = appStartInstance.isColdStart();<NEW_LINE>if (appStartTime == null) {<NEW_LINE>logger.warning("App start won't be sent due to missing appStartTime.");<NEW_LINE>promise.resolve(null);<NEW_LINE>} else if (isColdStart == null) {<NEW_LINE>logger.warning("App start won't be sent due to missing isColdStart.");<NEW_LINE>promise.resolve(null);<NEW_LINE>} else {<NEW_LINE>final double appStartTimestamp = (double) appStartTime.getTime();<NEW_LINE>WritableMap appStart = Arguments.createMap();<NEW_LINE>appStart.putDouble("appStartTime", appStartTimestamp);<NEW_LINE><MASK><NEW_LINE>appStart.putBoolean("didFetchAppStart", didFetchAppStart);<NEW_LINE>promise.resolve(appStart);<NEW_LINE>}<NEW_LINE>// This is always set to true, as we would only allow an app start fetch to only<NEW_LINE>// happen once in the case of a JS bundle reload, we do not want it to be<NEW_LINE>// instrumented again.<NEW_LINE>didFetchAppStart = true;<NEW_LINE>} | appStart.putBoolean("isColdStart", isColdStart); |
1,445,669 | public static void vertical(Kernel1D_S32 kernel, GrayU16 src, GrayI16 dst, int divisor, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>workspaces = BoofMiscOps.checkDeclare(workspaces, DogArray_I32::new);<NEW_LINE>// CONCURRENT_REMOVE_LINE<NEW_LINE>final DogArray_I32 work = workspaces.grow();<NEW_LINE>final short[] dataSrc = src.data;<NEW_LINE>final short[] dataDst = dst.data;<NEW_LINE>final int[] dataKer = kernel.data;<NEW_LINE>final int offset = kernel.getOffset();<NEW_LINE>final int kernelWidth = kernel.getWidth();<NEW_LINE>final int halfDivisor = divisor / 2;<NEW_LINE>// WTF integer division is slower than converting to a float??<NEW_LINE>final double divisionHack = 1.0 / divisor;<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int yEnd = imgHeight - (kernelWidth - offset - 1);<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(offset, yEnd, workspaces, (work, y0, y1)->{<NEW_LINE>final int y0 = offset, y1 = yEnd;<NEW_LINE>int[] totalRow = BoofMiscOps.checkDeclare(work, imgWidth, true);<NEW_LINE>for (int y = y0; y < y1; y++) {<NEW_LINE>for (int k = 0; k < kernelWidth; k++) {<NEW_LINE>final int kernelValue = dataKer[k];<NEW_LINE>int indexSrc = src.startIndex + (y - offset + k) * src.stride;<NEW_LINE>for (int i = 0; i < imgWidth; i++) {<NEW_LINE>totalRow[i] += ((dataSrc[indexSrc++] & 0xFFFF) * kernelValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>for (int i = 0; i < imgWidth; i++) {<NEW_LINE>dataDst[indexDst++] = (short) ((totalRow[i] + halfDivisor) * divisionHack);<NEW_LINE>}<NEW_LINE>Arrays.fill(<MASK><NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>} | totalRow, 0, imgWidth, 0); |
1,649,043 | public void marshall(RuleGroupsNamespaceDescription ruleGroupsNamespaceDescription, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (ruleGroupsNamespaceDescription == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(ruleGroupsNamespaceDescription.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(ruleGroupsNamespaceDescription.getData(), DATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupsNamespaceDescription.getModifiedAt(), MODIFIEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupsNamespaceDescription.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupsNamespaceDescription.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupsNamespaceDescription.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | ruleGroupsNamespaceDescription.getCreatedAt(), CREATEDAT_BINDING); |
660,098 | public boolean isMatch(String s, String p) {<NEW_LINE>boolean[][] match = new boolean[s.length() + 1][p.length() + 1];<NEW_LINE>match[s.length()][p.length()] = true;<NEW_LINE>for (int i = p.length() - 1; i >= 0; i--) {<NEW_LINE>if (p.charAt(i) != '*') {<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>match[s.length<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = s.length() - 1; i >= 0; i--) {<NEW_LINE>for (int j = p.length() - 1; j >= 0; j--) {<NEW_LINE>if (s.charAt(i) == p.charAt(j) || p.charAt(j) == '?') {<NEW_LINE>match[i][j] = match[i + 1][j + 1];<NEW_LINE>} else if (p.charAt(j) == '*') {<NEW_LINE>match[i][j] = match[i + 1][j] || match[i][j + 1];<NEW_LINE>} else {<NEW_LINE>match[i][j] = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return match[0][0];<NEW_LINE>} | ()][i] = true; |
723,310 | public GetFindingsPublicationConfigurationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetFindingsPublicationConfigurationResult getFindingsPublicationConfigurationResult = new GetFindingsPublicationConfigurationResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getFindingsPublicationConfigurationResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("securityHubConfiguration", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getFindingsPublicationConfigurationResult.setSecurityHubConfiguration(SecurityHubConfigurationJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getFindingsPublicationConfigurationResult;<NEW_LINE>} | ().unmarshall(context)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.