idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
5,488 | public static void main(String[] args) throws IOException {<NEW_LINE>ClassicMp4ContainerSource classicMp4ContainerSource = null;<NEW_LINE>try {<NEW_LINE>classicMp4ContainerSource = new ClassicMp4ContainerSource(new URI("http://org.mp4parser.s3.amazonaws.com/examples/Cosmos%20Laundromat%20small%20faststart.mp4").<MASK><NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>List<StreamingTrack> streamingTracks = classicMp4ContainerSource.getTracks();<NEW_LINE>File f = new File("output.mp4");<NEW_LINE>FragmentedMp4Writer writer = new FragmentedMp4Writer(streamingTracks, new FileOutputStream(f).getChannel());<NEW_LINE>System.out.println("Reading and writing started.");<NEW_LINE>classicMp4ContainerSource.call();<NEW_LINE>writer.close();<NEW_LINE>System.err.println(f.getAbsolutePath());<NEW_LINE>} | toURL().openStream()); |
1,347,607 | private static boolean matches(String pattern, String str, Cache<String, Pattern> patternCache) {<NEW_LINE>if (pattern.length() == 0 || str.length() == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Common case: **<NEW_LINE>if (pattern.equals("**")) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Common case: *<NEW_LINE>if (pattern.equals("*")) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// If a filename starts with '.', this char must be matched explicitly.<NEW_LINE>if (str.charAt(0) == '.' && pattern.charAt(0) != '.') {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Common case: *.xyz<NEW_LINE>if (pattern.charAt(0) == '*' && pattern.lastIndexOf('*') == 0) {<NEW_LINE>return str.endsWith(pattern.substring(1));<NEW_LINE>}<NEW_LINE>// Common case: xyz*<NEW_LINE>int lastIndex = pattern.length() - 1;<NEW_LINE>// The first clause of this if statement is unnecessary, but is an<NEW_LINE>// optimization--charAt runs faster than indexOf.<NEW_LINE>if (pattern.charAt(lastIndex) == '*' && pattern.indexOf('*') == lastIndex) {<NEW_LINE>return str.startsWith(pattern<MASK><NEW_LINE>}<NEW_LINE>Pattern regex = patternCache == null ? null : patternCache.getIfPresent(pattern);<NEW_LINE>if (regex == null) {<NEW_LINE>regex = makePatternFromWildcard(pattern);<NEW_LINE>if (patternCache != null) {<NEW_LINE>patternCache.put(pattern, regex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return regex.matcher(str).matches();<NEW_LINE>} | .substring(0, lastIndex)); |
1,359,200 | /* (non-Javadoc)<NEW_LINE>* @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>// NOSONAR<NEW_LINE>String method = request<MASK><NEW_LINE>String path = request.getServletPath() + request.getPathInfo();<NEW_LINE>if (path == null || path.endsWith("/")) {<NEW_LINE>// serve folder listing<NEW_LINE>response.setStatus(HttpServletResponse.SC_OK);<NEW_LINE>response.getWriter().close();<NEW_LINE>} else {<NEW_LINE>// lookup the resource<NEW_LINE>URL url = this.findResource(path);<NEW_LINE>if (url != null && method.matches("GET|HEAD")) {<NEW_LINE>InputStream is = null;<NEW_LINE>try {<NEW_LINE>URLConnection conn = url.openConnection();<NEW_LINE>conn.connect();<NEW_LINE>is = conn.getInputStream();<NEW_LINE>this.prepareResponse(response, conn);<NEW_LINE>if ("GET".equals(method)) {<NEW_LINE>OutputStream os = response.getOutputStream();<NEW_LINE>IOUtils.copyLarge(is, os);<NEW_LINE>os.flush();<NEW_LINE>os.close();<NEW_LINE>}<NEW_LINE>response.setStatus(HttpServletResponse.SC_OK);<NEW_LINE>this.log("[200] " + request.getRequestURI());<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(is);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>response.setStatus(HttpServletResponse.SC_NOT_FOUND);<NEW_LINE>this.log("[404] " + request.getRequestURI());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getMethod().toUpperCase(); |
340,520 | protected void addChestSideInventory() {<NEW_LINE>if (tile == null || inv == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Level world = tile.getLevel();<NEW_LINE>if (world != null) {<NEW_LINE>// detect side inventory<NEW_LINE>BlockEntity inventoryTE = null;<NEW_LINE>Direction accessDir = null;<NEW_LINE>BlockPos pos = tile.getBlockPos();<NEW_LINE>horizontals: for (Direction dir : Direction.Plane.HORIZONTAL) {<NEW_LINE>// skip any tables in this multiblock<NEW_LINE>BlockPos neighbor = pos.relative(dir);<NEW_LINE>for (Pair<BlockPos, BlockState> tinkerPos : this.stationBlocks) {<NEW_LINE>if (tinkerPos.getLeft().equals(neighbor)) {<NEW_LINE>continue horizontals;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// fetch tile entity<NEW_LINE>BlockEntity te = world.getBlockEntity(neighbor);<NEW_LINE>if (te != null && isUsable(te, inv.player)) {<NEW_LINE>// try internal access first<NEW_LINE>if (hasItemHandler(te, null)) {<NEW_LINE>inventoryTE = te;<NEW_LINE>accessDir = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// try sided access next<NEW_LINE><MASK><NEW_LINE>if (hasItemHandler(te, side)) {<NEW_LINE>inventoryTE = te;<NEW_LINE>accessDir = side;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if we found something, add the side inventory<NEW_LINE>if (inventoryTE != null) {<NEW_LINE>int invSlots = inventoryTE.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, accessDir).orElse(EmptyItemHandler.INSTANCE).getSlots();<NEW_LINE>int columns = Mth.clamp((invSlots - 1) / 9 + 1, 3, 6);<NEW_LINE>this.addSubContainer(new SideInventoryContainer<>(TinkerTables.craftingStationContainer.get(), containerId, inv, inventoryTE, accessDir, -6 - 18 * 6, 8, columns), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Direction side = dir.getOpposite(); |
1,266,203 | public InstanceStorageInfo unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>InstanceStorageInfo instanceStorageInfo = new InstanceStorageInfo();<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 instanceStorageInfo;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("totalSizeInGB", targetDepth)) {<NEW_LINE>instanceStorageInfo.setTotalSizeInGB(LongStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("disks", targetDepth)) {<NEW_LINE>instanceStorageInfo.withDisks(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("disks/item", targetDepth)) {<NEW_LINE>instanceStorageInfo.withDisks(DiskInfoStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("nvmeSupport", targetDepth)) {<NEW_LINE>instanceStorageInfo.setNvmeSupport(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("encryptionSupport", targetDepth)) {<NEW_LINE>instanceStorageInfo.setEncryptionSupport(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return instanceStorageInfo;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | new ArrayList<DiskInfo>()); |
1,779,413 | private void runAssertionOnDelete(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>SupportVirtualDW window = registerTypeSetMapData(env, path);<NEW_LINE>// test no-criteria on-delete<NEW_LINE>env.compileDeploy("@name('s0') on SupportBean_ST0 delete from MyVDW vdw", path).addListener("s0");<NEW_LINE>assertIndexSpec(window.getLastRequestedLookup(), "", "");<NEW_LINE>env.sendEventBean(new SupportBean_ST0("E1", 0));<NEW_LINE>env.assertPropsNew("s0", "col1".split(","), new Object[] { "key1" });<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] {}, window.getLastAccessKeys());<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>// test single-criteria on-delete<NEW_LINE>env.compileDeploy("@name('s0') on SupportBean_ST0 st0 delete from MyVDW vdw where col1=st0.id"<MASK><NEW_LINE>assertIndexSpec(window.getLastRequestedLookup(), "col1=(String)", "");<NEW_LINE>env.sendEventBean(new SupportBean_ST0("E1", 0));<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { "E1" }, window.getLastAccessKeys());<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportBean_ST0("key1", 0));<NEW_LINE>env.assertPropsNew("s0", "col1".split(","), new Object[] { "key1" });<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { "key1" }, window.getLastAccessKeys());<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>// test multie-criteria on-delete<NEW_LINE>env.compileDeploy("@Name('s0') on SupportBeanRange r delete " + "from MyVDW vdw where col1=r.id and col2=r.key and col3 between r.rangeStart and r.rangeEnd", path).addListener("s0");<NEW_LINE>assertIndexSpec(window.getLastRequestedLookup(), "col1=(String)|col2=(String)", "col3[,](Integer)");<NEW_LINE>assertEquals("MyVDW", window.getLastRequestedLookup().getNamedWindowName());<NEW_LINE>assertNotNull(window.getLastRequestedLookup().getStatementId());<NEW_LINE>assertEquals("s0", window.getLastRequestedLookup().getStatementName());<NEW_LINE>assertEquals(1, window.getLastRequestedLookup().getStatementAnnotations().length);<NEW_LINE>assertFalse(window.getLastRequestedLookup().isFireAndForget());<NEW_LINE>env.sendEventBean(new SupportBeanRange("key1", "key2", 5, 10));<NEW_LINE>env.assertPropsNew("s0", "col1".split(","), new Object[] { "key1" });<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { "key1", "key2", new VirtualDataWindowKeyRange(5, 10) }, window.getLastAccessKeys());<NEW_LINE>env.undeployAll();<NEW_LINE>} | , path).addListener("s0"); |
562,031 | private boolean visit(FunctionCall call) {<NEW_LINE>if (!(call.getTarget() instanceof PropertyGet)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>PropertyGet propertyGet = (PropertyGet) call.getTarget();<NEW_LINE>MethodReference methodRef = getJavaMethodSelector(propertyGet.getTarget());<NEW_LINE>if (methodRef == null || !propertyGet.getProperty().getIdentifier().equals("invoke")) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>for (AstNode arg : call.getArguments()) {<NEW_LINE>arg.visit(this);<NEW_LINE>}<NEW_LINE>MethodReader method = classSource.resolve(methodRef);<NEW_LINE>if (method == null) {<NEW_LINE>diagnostics.error(location, "Java method not found: {{m0}}", methodRef);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int requiredParams = methodRef.parameterCount();<NEW_LINE>if (!method.hasModifier(ElementModifier.STATIC)) {<NEW_LINE>++requiredParams;<NEW_LINE>}<NEW_LINE>if (call.getArguments().size() != requiredParams) {<NEW_LINE>diagnostics.error(location, "Invalid number of arguments for method {{m0}}. Expected: " + requiredParams + ", encountered: " + call.getArguments().size(), methodRef);<NEW_LINE>}<NEW_LINE>MethodReference caller = createCallbackMethod(method);<NEW_LINE>MethodReference delegate = repository.methodMap.get(location.getMethod());<NEW_LINE>repository.callbackCallees.put(caller, methodRef);<NEW_LINE>repository.callbackMethods.computeIfAbsent(delegate, key -> new HashSet<><MASK><NEW_LINE>validateSignature(method);<NEW_LINE>StringLiteral newTarget = new StringLiteral();<NEW_LINE>newTarget.setValue("$$JSO$$_" + caller);<NEW_LINE>propertyGet.setTarget(newTarget);<NEW_LINE>return false;<NEW_LINE>} | ()).add(caller); |
168,562 | public void marshall(LicenseConfiguration licenseConfiguration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (licenseConfiguration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseConfigurationId(), LICENSECONFIGURATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseConfigurationArn(), LICENSECONFIGURATIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseCountingType(), LICENSECOUNTINGTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseRules(), LICENSERULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseCount(), LICENSECOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseCountHardLimit(), LICENSECOUNTHARDLIMIT_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getDisassociateWhenNotFound(), DISASSOCIATEWHENNOTFOUND_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getConsumedLicenses(), CONSUMEDLICENSES_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getOwnerAccountId(), OWNERACCOUNTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getConsumedLicenseSummaryList(), CONSUMEDLICENSESUMMARYLIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getProductInformationList(), PRODUCTINFORMATIONLIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getAutomatedDiscoveryInformation(), AUTOMATEDDISCOVERYINFORMATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | licenseConfiguration.getManagedResourceSummaryList(), MANAGEDRESOURCESUMMARYLIST_BINDING); |
591,618 | private void createSuperBlockCopies(Program program, BinaryReader reader, int groupSize, int numGroups, boolean is64Bit, boolean isSparseSuper, TaskMonitor monitor) throws Exception {<NEW_LINE>monitor.setMessage("Creating super block and group descriptor copies...");<NEW_LINE>monitor.setMaximum(numGroups);<NEW_LINE>for (int i = 1; i < numGroups; i++) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>if (isSparseSuper && (!isXpowerOfY(i, 3) && !isXpowerOfY(i, 5) && !isXpowerOfY(i, 7))) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int offset = groupSize * i;<NEW_LINE>Address address = toAddr(program, offset);<NEW_LINE>reader.setPointerIndex(offset);<NEW_LINE>Ext4SuperBlock superBlock = new Ext4SuperBlock(reader);<NEW_LINE>createData(program, address, superBlock.toDataType());<NEW_LINE>setPlateComment(program, address, "SuperBlock Copy 0x" + Integer.toHexString(i));<NEW_LINE>long groupDescOffset = (offset & 0xffffffffL) + blockSize;<NEW_LINE>Address groupDescAddress = toAddr(program, groupDescOffset);<NEW_LINE>reader.setPointerIndex(groupDescOffset);<NEW_LINE>for (int j = 0; j < numGroups; j++) {<NEW_LINE>Ext4GroupDescriptor groupDesc = new Ext4GroupDescriptor(reader, is64Bit);<NEW_LINE>DataType groupDescDataType = groupDesc.toDataType();<NEW_LINE>createData(program, groupDescAddress, groupDescDataType);<NEW_LINE>setPlateComment(program, groupDescAddress, "SuperBlock Copy 0x" + Integer.toHexString(i) + " Group 0x" <MASK><NEW_LINE>groupDescAddress = groupDescAddress.add(groupDescDataType.getLength());<NEW_LINE>}<NEW_LINE>monitor.incrementProgress(1);<NEW_LINE>}<NEW_LINE>} | + Integer.toHexString(j)); |
760,263 | protected void rrdToolCreateDatabase(RrdDef def) throws Exception {<NEW_LINE>List<String> commands = new ArrayList<>();<NEW_LINE>commands.add(this.binaryPath + "/rrdtool");<NEW_LINE>commands.add("create");<NEW_LINE>commands.add(this.outputFile.getCanonicalPath());<NEW_LINE>commands.add("-s");<NEW_LINE>commands.add(String.valueOf<MASK><NEW_LINE>for (DsDef dsdef : def.getDsDefs()) {<NEW_LINE>commands.add(getDsDefStr(dsdef));<NEW_LINE>}<NEW_LINE>for (ArcDef adef : def.getArcDefs()) {<NEW_LINE>commands.add(getRraStr(adef));<NEW_LINE>}<NEW_LINE>ProcessBuilder pb = new ProcessBuilder(commands);<NEW_LINE>Process process = pb.start();<NEW_LINE>try {<NEW_LINE>checkErrorStream(process);<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(process.getInputStream());<NEW_LINE>IOUtils.closeQuietly(process.getOutputStream());<NEW_LINE>IOUtils.closeQuietly(process.getErrorStream());<NEW_LINE>}<NEW_LINE>} | (def.getStep())); |
1,403,715 | /*<NEW_LINE>* Return meta data that stores some useful information about the transform index, stored as "_meta":<NEW_LINE>*<NEW_LINE>* {<NEW_LINE>* "created_by" : "transform",<NEW_LINE>* "_transform" : {<NEW_LINE>* "transform" : "id",<NEW_LINE>* "version" : {<NEW_LINE>* "created" : "8.0.0"<NEW_LINE>* },<NEW_LINE>* "creation_date_in_millis" : 1584025695202<NEW_LINE>* }<NEW_LINE>* }<NEW_LINE>*/<NEW_LINE>private static Map<String, Object> createMetadata(String id, Clock clock) {<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>metadata.put(TransformField.CREATED_BY, TransformField.TRANSFORM_SIGNATURE);<NEW_LINE>Map<String, Object> transformMetadata = new HashMap<>();<NEW_LINE>transformMetadata.put(TransformField.CREATION_DATE_MILLIS, clock.millis());<NEW_LINE>transformMetadata.put(TransformField.VERSION.getPreferredName(), Map.of(TransformField.CREATED, Version.CURRENT.toString()));<NEW_LINE>transformMetadata.put(TransformField.TRANSFORM, id);<NEW_LINE>metadata.put(TransformField.META_FIELDNAME, transformMetadata);<NEW_LINE>return metadata;<NEW_LINE>} | metadata = new HashMap<>(); |
1,402,596 | private static long hashLen33to64(byte[] byteArray) {<NEW_LINE>int len = byteArray.length;<NEW_LINE>long mul = k2 + len * 2L;<NEW_LINE>long a = fetch64(byteArray, 0) * k2;<NEW_LINE>long b = fetch64(byteArray, 8);<NEW_LINE>long c = fetch64(byteArray, len - 24);<NEW_LINE>long d = fetch64(byteArray, len - 32);<NEW_LINE>long e = fetch64(byteArray, 16) * k2;<NEW_LINE>long f = fetch64(byteArray, 24) * 9;<NEW_LINE>long g = fetch64(byteArray, len - 8);<NEW_LINE>long h = fetch64(byteArray, len - 16) * mul;<NEW_LINE>long u = rotate64(a + g, 43) + (rotate64(b, 30) + c) * 9;<NEW_LINE>long v = ((a + g) ^ d) + f + 1;<NEW_LINE>long w = Long.reverseBytes((u + v) * mul) + h;<NEW_LINE>long x = rotate64(<MASK><NEW_LINE>long y = (Long.reverseBytes((v + w) * mul) + g) * mul;<NEW_LINE>long z = e + f + c;<NEW_LINE>a = Long.reverseBytes((x + z) * mul + y) + b;<NEW_LINE>b = shiftMix((z + a) * mul + d + h) * mul;<NEW_LINE>return b + x;<NEW_LINE>} | e + f, 42) + c; |
451,463 | public void sendNoWait(MqttWireMessage message, MqttToken token) throws MqttException {<NEW_LINE>final String methodName = "sendNoWait";<NEW_LINE>if (isConnected() || (!isConnected() && message instanceof MqttConnect) || (isDisconnecting() && message instanceof MqttDisconnect)) {<NEW_LINE>if (disconnectedMessageBuffer != null && disconnectedMessageBuffer.getMessageCount() != 0) {<NEW_LINE>// @TRACE 507=Client Connected, Offline Buffer available, but not empty. Adding message to buffer. message={0}<NEW_LINE>log.fine(CLASS_NAME, methodName, "507", new Object[] { message.getKey() });<NEW_LINE>if (disconnectedMessageBuffer.isPersistBuffer()) {<NEW_LINE>this.clientState.persistBufferedMessage(message);<NEW_LINE>}<NEW_LINE>disconnectedMessageBuffer.putMessage(message, token);<NEW_LINE>} else {<NEW_LINE>this.internalSend(message, token);<NEW_LINE>}<NEW_LINE>} else if (disconnectedMessageBuffer != null) {<NEW_LINE>// @TRACE 508=Offline Buffer available. Adding message to buffer. message={0}<NEW_LINE>log.fine(CLASS_NAME, methodName, "508", new Object[] { message.getKey() });<NEW_LINE>if (disconnectedMessageBuffer.isPersistBuffer()) {<NEW_LINE>this.clientState.persistBufferedMessage(message);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// @TRACE 208=failed: not connected<NEW_LINE>log.fine(CLASS_NAME, methodName, "208");<NEW_LINE>throw ExceptionHelper.createMqttException(MqttException.REASON_CODE_CLIENT_NOT_CONNECTED);<NEW_LINE>}<NEW_LINE>} | disconnectedMessageBuffer.putMessage(message, token); |
979,171 | private void startStreamWithTask() {<NEW_LINE>GetLiveStreamURL.AsyncResponse callback = url -> {<NEW_LINE>try {<NEW_LINE>if (!url.isEmpty()) {<NEW_LINE>updateQualitySelections(url);<NEW_LINE>qualityURLs = url;<NEW_LINE>if (!isAudioOnlyModeEnabled()) {<NEW_LINE>startStreamWithQuality(new Settings(getContext()).getPrefStreamQuality());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>playbackFailed();<NEW_LINE>}<NEW_LINE>} catch (IllegalStateException | NullPointerException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>String[] types = getResources().getStringArray(R.array.PlayerType);<NEW_LINE>if (vodId == null) {<NEW_LINE>GetLiveStreamURL task = new GetLiveStreamURL(callback);<NEW_LINE>task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, mUserInfo.getLogin(), types<MASK><NEW_LINE>} else {<NEW_LINE>GetLiveStreamURL task = new GetVODStreamURL(callback);<NEW_LINE>task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, vodId, types[settings.getStreamPlayerType()]);<NEW_LINE>}<NEW_LINE>} | [settings.getStreamPlayerType()]); |
1,722,638 | private static int estimateGrid(ByteProcessor bp, int[] locs, int minSeparation, boolean doHorizontal) {<NEW_LINE>int nMaxima = locs.length;<NEW_LINE>int[] maxima = new int[nMaxima];<NEW_LINE>Arrays.fill(maxima, -1);<NEW_LINE>ImagePlus impTemp = new ImagePlus("Temp", bp);<NEW_LINE>impTemp.setRoi(new Roi(0, 0, bp.getWidth()<MASK><NEW_LINE>double[] prof = new ProfilePlot(impTemp, doHorizontal).getProfile();<NEW_LINE>// Find the top nMaxima peaks with sufficient separation<NEW_LINE>double tolerance = 0.0;<NEW_LINE>int[] peakLocs = MaximumFinder.findMaxima(prof, tolerance, false);<NEW_LINE>// int[] peakLocs = new int[nMaxima];<NEW_LINE>// if (peakLocs.length < nMaxima) {<NEW_LINE>// Arrays.sort(peakLocs);<NEW_LINE>// for (int i = 0; i < peakLocs.length; i++)<NEW_LINE>// locs[i] = peakLocs[i];<NEW_LINE>// return peakLocs.length;<NEW_LINE>// }<NEW_LINE>int n = 0;<NEW_LINE>for (int p : peakLocs) {<NEW_LINE>if (checkNewIndSeparated(maxima, p, n, minSeparation)) {<NEW_LINE>maxima[n] = p;<NEW_LINE>n++;<NEW_LINE>if (n == nMaxima)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Sort the maxima in ascending order now<NEW_LINE>Arrays.sort(maxima);<NEW_LINE>// Put in as many maxima as we have<NEW_LINE>int counter = 0;<NEW_LINE>for (int m : maxima) {<NEW_LINE>if (counter == nMaxima)<NEW_LINE>break;<NEW_LINE>if (m < 0)<NEW_LINE>continue;<NEW_LINE>locs[counter] = m;<NEW_LINE>counter++;<NEW_LINE>}<NEW_LINE>return counter;<NEW_LINE>} | , bp.getHeight())); |
1,480,922 | private TransportStop readTransportRouteStop(int[] dx, int[] dy, long did, TIntObjectHashMap<String> stringTable, int filePointer) throws IOException {<NEW_LINE>TransportStop dataObject = new TransportStop();<NEW_LINE>dataObject.setFileOffset(codedIS.getTotalBytesRead());<NEW_LINE>dataObject.setReferencesToRoutes(new int[] { filePointer });<NEW_LINE>boolean end = false;<NEW_LINE>while (!end) {<NEW_LINE><MASK><NEW_LINE>int tag = WireFormat.getTagFieldNumber(t);<NEW_LINE>switch(tag) {<NEW_LINE>case 0:<NEW_LINE>end = true;<NEW_LINE>break;<NEW_LINE>case OsmandOdb.TransportRouteStop.NAME_EN_FIELD_NUMBER:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>dataObject.setEnName(regStr(stringTable));<NEW_LINE>break;<NEW_LINE>case OsmandOdb.TransportRouteStop.NAME_FIELD_NUMBER:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>dataObject.setName(regStr(stringTable));<NEW_LINE>break;<NEW_LINE>case OsmandOdb.TransportRouteStop.ID_FIELD_NUMBER:<NEW_LINE>did += codedIS.readSInt64();<NEW_LINE>break;<NEW_LINE>case OsmandOdb.TransportRouteStop.DX_FIELD_NUMBER:<NEW_LINE>dx[0] += codedIS.readSInt32();<NEW_LINE>break;<NEW_LINE>case OsmandOdb.TransportRouteStop.DY_FIELD_NUMBER:<NEW_LINE>dy[0] += codedIS.readSInt32();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>skipUnknownField(t);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dataObject.setId(did);<NEW_LINE>dataObject.setLocation(BinaryMapIndexReader.TRANSPORT_STOP_ZOOM, dx[0], dy[0]);<NEW_LINE>return dataObject;<NEW_LINE>} | int t = codedIS.readTag(); |
71,736 | public void finish() {<NEW_LINE>if (mIsCancelled) {<NEW_LINE>setResult(RESULT_CANCELED);<NEW_LINE>} else {<NEW_LINE>RadioGroup group = findViewById(R.id.radioProfiles);<NEW_LINE>int selectedId = group.getCheckedRadioButtonId();<NEW_LINE>RadioButton radioButton = findViewById(selectedId);<NEW_LINE>// int id = Integer.parseInt(radioButton.getHint().toString());<NEW_LINE>String action = radioButton.getText().toString();<NEW_LINE>final Intent resultIntent = new Intent();<NEW_LINE>if (!G.isProfileMigrated()) {<NEW_LINE>int <MASK><NEW_LINE>resultIntent.putExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE, PluginBundleManager.generateBundle(getApplicationContext(), idx + "::" + action));<NEW_LINE>} else {<NEW_LINE>int idx = group.indexOfChild(radioButton);<NEW_LINE>resultIntent.putExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE, PluginBundleManager.generateBundle(getApplicationContext(), idx + "::" + action));<NEW_LINE>}<NEW_LINE>resultIntent.putExtra(com.twofortyfouram.locale.Intent.EXTRA_STRING_BLURB, action);<NEW_LINE>setResult(RESULT_OK, resultIntent);<NEW_LINE>}<NEW_LINE>super.finish();<NEW_LINE>} | idx = group.indexOfChild(radioButton); |
947,911 | final DeleteDatasetResult executeDeleteDataset(DeleteDatasetRequest deleteDatasetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDatasetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteDatasetRequest> request = null;<NEW_LINE>Response<DeleteDatasetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDatasetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDatasetRequest));<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, "LookoutEquipment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDataset");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDatasetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDatasetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,820,890 | protected void writeOptionalAttributes(TagWriter tagWriter) throws JspException {<NEW_LINE>tagWriter.writeOptionalAttributeValue(CLASS_ATTRIBUTE, resolveCssClass());<NEW_LINE>tagWriter.writeOptionalAttributeValue(STYLE_ATTRIBUTE, ObjectUtils.getDisplayString(evaluate("cssStyle", getCssStyle())));<NEW_LINE>writeOptionalAttribute(<MASK><NEW_LINE>writeOptionalAttribute(tagWriter, TITLE_ATTRIBUTE, getTitle());<NEW_LINE>writeOptionalAttribute(tagWriter, DIR_ATTRIBUTE, getDir());<NEW_LINE>writeOptionalAttribute(tagWriter, TABINDEX_ATTRIBUTE, getTabindex());<NEW_LINE>writeOptionalAttribute(tagWriter, ONCLICK_ATTRIBUTE, getOnclick());<NEW_LINE>writeOptionalAttribute(tagWriter, ONDBLCLICK_ATTRIBUTE, getOndblclick());<NEW_LINE>writeOptionalAttribute(tagWriter, ONMOUSEDOWN_ATTRIBUTE, getOnmousedown());<NEW_LINE>writeOptionalAttribute(tagWriter, ONMOUSEUP_ATTRIBUTE, getOnmouseup());<NEW_LINE>writeOptionalAttribute(tagWriter, ONMOUSEOVER_ATTRIBUTE, getOnmouseover());<NEW_LINE>writeOptionalAttribute(tagWriter, ONMOUSEMOVE_ATTRIBUTE, getOnmousemove());<NEW_LINE>writeOptionalAttribute(tagWriter, ONMOUSEOUT_ATTRIBUTE, getOnmouseout());<NEW_LINE>writeOptionalAttribute(tagWriter, ONKEYPRESS_ATTRIBUTE, getOnkeypress());<NEW_LINE>writeOptionalAttribute(tagWriter, ONKEYUP_ATTRIBUTE, getOnkeyup());<NEW_LINE>writeOptionalAttribute(tagWriter, ONKEYDOWN_ATTRIBUTE, getOnkeydown());<NEW_LINE>if (!CollectionUtils.isEmpty(this.dynamicAttributes)) {<NEW_LINE>for (Map.Entry<String, Object> entry : this.dynamicAttributes.entrySet()) {<NEW_LINE>tagWriter.writeOptionalAttributeValue(entry.getKey(), getDisplayString(entry.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | tagWriter, LANG_ATTRIBUTE, getLang()); |
1,424,878 | private SQLQueryAdapter create() {<NEW_LINE>ExpectedErrors errors = ExpectedErrors.from("does not support the create option", "doesn't have this option", "is not supported for this operation", "Data truncation", "Specified key was too long");<NEW_LINE>errors.add("Data truncated for functional index ");<NEW_LINE>sb.append("ALTER TABLE ");<NEW_LINE>OceanBaseTable table = schema.getRandomTable();<NEW_LINE>sb.append(table.getName());<NEW_LINE>sb.append(" ");<NEW_LINE>List<Action> list = new ArrayList<>(Arrays.asList(Action.values()));<NEW_LINE>selectedActions = Randomly.subset(list);<NEW_LINE>int i = 0;<NEW_LINE>for (Action a : selectedActions) {<NEW_LINE>if (i++ != 0) {<NEW_LINE>sb.append(", ");<NEW_LINE>}<NEW_LINE>switch(a) {<NEW_LINE>case COMPRESSION:<NEW_LINE>sb.append("COMPRESSION ");<NEW_LINE>sb.append("'");<NEW_LINE>sb.append(Randomly.fromOptions("ZLIB_1.0", "LZ4_1.0", "NONE"));<NEW_LINE>sb.append("'");<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Action a : selectedActions) {<NEW_LINE>for (String error : a.potentialErrors) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SQLQueryAdapter(sb.<MASK><NEW_LINE>} | toString(), errors, couldAffectSchema); |
1,455,693 | /*<NEW_LINE>* Updates particle life and processes particle affectors<NEW_LINE>* */<NEW_LINE>private void updateParticles(final ParticleEmitterComponent particleSystem, final float delta) {<NEW_LINE>updateLifeRemaining(particleSystem.particlePool, delta);<NEW_LINE>particleSystem.affectorFunctionMap.forEach((component, affector) -> affector.beforeUpdates<MASK><NEW_LINE>for (int i = 0; i < particleSystem.particlePool.livingParticles(); i++) {<NEW_LINE>particleSystem.particlePool.loadTemporaryDataFrom(i, ParticleDataMask.ALL.toInt());<NEW_LINE>particleSystem.affectorFunctionMap.forEach((component, affector) -> affector.update(component, particleSystem.particlePool.temporaryParticleData, random, delta));<NEW_LINE>particleSystem.particlePool.storeTemporaryDataAt(i, ParticleDataMask.ALL.toInt());<NEW_LINE>}<NEW_LINE>} | (component, random, delta)); |
1,728,596 | private void submitTask(long beId, TRoutineLoadTask tTask) throws LoadException {<NEW_LINE>Backend backend = Catalog.getCurrentSystemInfo().getBackend(beId);<NEW_LINE>if (backend == null) {<NEW_LINE>throw new LoadException("failed to send tasks to backend " + beId + " because not exist");<NEW_LINE>}<NEW_LINE>TNetworkAddress address = new TNetworkAddress(backend.getHost(), backend.getBePort());<NEW_LINE>boolean ok = false;<NEW_LINE>BackendService.Client client = null;<NEW_LINE>try {<NEW_LINE>client = ClientPool.backendPool.borrowObject(address);<NEW_LINE>TStatus tStatus = client.submit_routine_load_task(Lists.newArrayList(tTask));<NEW_LINE>ok = true;<NEW_LINE>if (tStatus.getStatus_code() != TStatusCode.OK) {<NEW_LINE>throw new LoadException("failed to submit task. error code: " + tStatus.getStatus_code() + ", msg: " + (tStatus.getError_msgsSize() > 0 ? tStatus.getError_msgs().get(0) : "NaN"));<NEW_LINE>}<NEW_LINE>LOG.debug("send routine load task {} to BE: {}", DebugUtil.printId(tTask.id), beId);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new LoadException("failed to send task: " + e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>if (ok) {<NEW_LINE>ClientPool.backendPool.returnObject(address, client);<NEW_LINE>} else {<NEW_LINE>ClientPool.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | backendPool.invalidateObject(address, client); |
1,298,079 | public static void main(String[] args) throws IOException {<NEW_LINE>if (args.length < 2) {<NEW_LINE>System.out.println("H264 Text Embed");<NEW_LINE>System.out.println("Syntax: <in> <out>");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SeekableByteChannel sink = null;<NEW_LINE>SeekableByteChannel source = null;<NEW_LINE>try {<NEW_LINE>source = readableChannel(new File(args[0]));<NEW_LINE>sink = writableChannel(new File(args[1]));<NEW_LINE>MP4Demuxer demux = MP4Demuxer.createMP4Demuxer(source);<NEW_LINE>MP4Muxer muxer = MP4Muxer.createMP4Muxer(sink, Brand.MOV);<NEW_LINE>EmbedTranscoder transcoder = new EmbedTranscoder();<NEW_LINE>DemuxerTrack inTrack = demux.getVideoTrack();<NEW_LINE>DemuxerTrackMeta meta = inTrack.getMeta();<NEW_LINE>VideoCodecMeta videoCodecMeta = meta.getVideoCodecMeta();<NEW_LINE>MuxerTrack outTrack = muxer.addVideoTrack(<MASK><NEW_LINE>ByteBuffer _out = ByteBuffer.allocate(videoCodecMeta.getSize().getWidth() * videoCodecMeta.getSize().getHeight() * 6);<NEW_LINE>Packet inFrame;<NEW_LINE>int totalFrames = (int) meta.getTotalFrames();<NEW_LINE>for (int i = 0; (inFrame = inTrack.nextFrame()) != null; i++) {<NEW_LINE>ByteBuffer data = inFrame.getData();<NEW_LINE>_out.clear();<NEW_LINE>ByteBuffer result = transcoder.transcode(H264Utils.splitFrame(data), _out);<NEW_LINE>outTrack.addFrame(MP4Packet.createMP4PacketWithData((MP4Packet) inFrame, result));<NEW_LINE>if (i % 100 == 0)<NEW_LINE>System.out.println((i * 100 / totalFrames) + "%");<NEW_LINE>}<NEW_LINE>muxer.finish();<NEW_LINE>} finally {<NEW_LINE>if (sink != null)<NEW_LINE>sink.close();<NEW_LINE>if (source != null)<NEW_LINE>source.close();<NEW_LINE>}<NEW_LINE>} | meta.getCodec(), videoCodecMeta); |
417,965 | public void addIndexes(int maxIndex, int[] dictionaryIndexes, int indexCount) {<NEW_LINE>if (indexCount == 0 && indexRetainedBytes > 0) {<NEW_LINE>// Ignore empty segment, since there are other segments present.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkState(maxIndex >= lastMaxIndex, "LastMax is greater than the current max");<NEW_LINE>lastMaxIndex = maxIndex;<NEW_LINE>if (maxIndex <= Byte.MAX_VALUE) {<NEW_LINE>byte[] byteIndexes = new byte[indexCount];<NEW_LINE>for (int i = 0; i < indexCount; i++) {<NEW_LINE>byteIndexes[i] = (byte) dictionaryIndexes[i];<NEW_LINE>}<NEW_LINE>appendByteIndexes(byteIndexes);<NEW_LINE>} else if (maxIndex <= Short.MAX_VALUE) {<NEW_LINE>short[<MASK><NEW_LINE>for (int i = 0; i < indexCount; i++) {<NEW_LINE>shortIndexes[i] = (short) dictionaryIndexes[i];<NEW_LINE>}<NEW_LINE>appendShortIndexes(shortIndexes);<NEW_LINE>} else {<NEW_LINE>int[] intIndexes = Arrays.copyOf(dictionaryIndexes, indexCount);<NEW_LINE>appendIntegerIndexes(intIndexes);<NEW_LINE>}<NEW_LINE>} | ] shortIndexes = new short[indexCount]; |
540,008 | public void onChildDrawOver(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {<NEW_LINE>super.onChildDrawOver(c, recyclerView, viewHolder, <MASK><NEW_LINE>if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE && !isViewCreateByAdapter(viewHolder)) {<NEW_LINE>View itemView = viewHolder.itemView;<NEW_LINE>c.save();<NEW_LINE>if (dX > 0) {<NEW_LINE>c.clipRect(itemView.getLeft(), itemView.getTop(), itemView.getLeft() + dX, itemView.getBottom());<NEW_LINE>c.translate(itemView.getLeft(), itemView.getTop());<NEW_LINE>} else {<NEW_LINE>c.clipRect(itemView.getRight() + dX, itemView.getTop(), itemView.getRight(), itemView.getBottom());<NEW_LINE>c.translate(itemView.getRight() + dX, itemView.getTop());<NEW_LINE>}<NEW_LINE>if (mDraggableModule != null) {<NEW_LINE>mDraggableModule.onItemSwiping(c, viewHolder, dX, dY, isCurrentlyActive);<NEW_LINE>}<NEW_LINE>c.restore();<NEW_LINE>}<NEW_LINE>} | dX, dY, actionState, isCurrentlyActive); |
312,799 | public boolean remove(final Connection connection, final boolean removeFromSessionCache) {<NEW_LINE>boolean removed;<NEW_LINE>SessionId sessionId = connection.getEstablishedSessionIdentifier();<NEW_LINE>synchronized (this) {<NEW_LINE>removed = connections.remove(connection.getConnectionId(), connection) == connection;<NEW_LINE>if (removed) {<NEW_LINE>if (connection.isExecuting()) {<NEW_LINE>List<Runnable> pendings = connection.getExecutor().shutdownNow();<NEW_LINE>if (LOGGER.isTraceEnabled()) {<NEW_LINE>LOGGER.trace("{}connection: remove {} (size {}, left jobs: {})", tag, connection, connections.size(), pendings.size(), new Throwable("connection removed!"));<NEW_LINE>} else if (pendings.isEmpty()) {<NEW_LINE>LOGGER.debug("{}connection: remove {} (size {})", tag, connection, connections.size());<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("{}connection: remove {} (size {}, left jobs: {})", tag, connection, connections.size(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (LOGGER.isTraceEnabled()) {<NEW_LINE>LOGGER.trace("{}connection: remove {} (size {})", tag, connection, connections.size(), new Throwable("connection removed!"));<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("{}connection: remove {} (size {})", tag, connection, connections.size());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>connection.startByClientHello(null);<NEW_LINE>removeByAddressConnections(connection);<NEW_LINE>removeByEstablishedSessions(sessionId, connection);<NEW_LINE>ConnectionListener listener = connectionListener;<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onConnectionRemoved(connection);<NEW_LINE>}<NEW_LINE>// destroy keys.<NEW_LINE>SecretUtil.destroy(connection.getDtlsContext());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (removeFromSessionCache) {<NEW_LINE>removeSessionFromStore(sessionId);<NEW_LINE>}<NEW_LINE>return removed;<NEW_LINE>} | ), pendings.size()); |
1,483,927 | private void extractValues(GraphicFactory graphicFactory, String elementName, XmlPullParser pullParser) throws XmlPullParserException {<NEW_LINE>for (int i = 0; i < pullParser.getAttributeCount(); ++i) {<NEW_LINE>String name = pullParser.getAttributeName(i);<NEW_LINE>String value = pullParser.getAttributeValue(i);<NEW_LINE>if (XMLNS.equals(name)) {<NEW_LINE>continue;<NEW_LINE>} else if (XMLNS_XSI.equals(name)) {<NEW_LINE>continue;<NEW_LINE>} else if (XSI_SCHEMALOCATION.equals(name)) {<NEW_LINE>continue;<NEW_LINE>} else if (VERSION.equals(name)) {<NEW_LINE>this.version = Integer.valueOf(XmlUtils<MASK><NEW_LINE>} else if (MAP_BACKGROUND.equals(name)) {<NEW_LINE>this.mapBackground = XmlUtils.getColor(graphicFactory, value, displayModel.getThemeCallback(), null);<NEW_LINE>} else if (MAP_BACKGROUND_OUTSIDE.equals(name)) {<NEW_LINE>this.mapBackgroundOutside = XmlUtils.getColor(graphicFactory, value, displayModel.getThemeCallback(), null);<NEW_LINE>this.hasBackgroundOutside = true;<NEW_LINE>} else if (BASE_STROKE_WIDTH.equals(name)) {<NEW_LINE>this.baseStrokeWidth = XmlUtils.parseNonNegativeFloat(name, value);<NEW_LINE>} else if (BASE_TEXT_SIZE.equals(name)) {<NEW_LINE>this.baseTextSize = XmlUtils.parseNonNegativeFloat(name, value);<NEW_LINE>} else {<NEW_LINE>throw XmlUtils.createXmlPullParserException(elementName, name, value, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>validate(elementName);<NEW_LINE>} | .parseNonNegativeInteger(name, value)); |
308,090 | public FullHttpRequest toFullHttpRequest() {<NEW_LINE>ByteBuf buffer = Unpooled.buffer();<NEW_LINE>MessageContent content = getContent();<NEW_LINE>if (content != null) {<NEW_LINE>buffer.writeBytes(content.getContent());<NEW_LINE>}<NEW_LINE>QueryStringEncoder encoder = new QueryStringEncoder(uri);<NEW_LINE>for (Map.Entry<String, String[]> entry : queries.entrySet()) {<NEW_LINE>String[] values = entry.getValue();<NEW_LINE>for (String value : values) {<NEW_LINE>encoder.addParam(entry.getKey(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.valueOf(getVersion().text()), io.netty.handler.codec.http.HttpMethod.valueOf(method.name()), encoder.toString(), buffer);<NEW_LINE>for (Map.Entry<String, String[]> entry : getHeaders().entrySet()) {<NEW_LINE><MASK><NEW_LINE>for (String value : entry.getValue()) {<NEW_LINE>request.headers().add(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | String key = entry.getKey(); |
1,619,084 | public void onSearchSuccess(Comic comic) {<NEW_LINE>hideProgressBar();<NEW_LINE>mResultAdapter.add(comic);<NEW_LINE>if (App.getPreferenceManager().getBoolean(PreferenceManager.PREF_OTHER_FIREBASE_EVENT, true)) {<NEW_LINE>Bundle bundle = new Bundle();<NEW_LINE>bundle.putString(FirebaseAnalytics.Param.CHARACTER, getIntent().getStringExtra(Extra.EXTRA_KEYWORD));<NEW_LINE>bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "bySearch");<NEW_LINE>bundle.putString(FirebaseAnalytics.Param.CONTENT, comic.getTitle());<NEW_LINE>bundle.putInt(FirebaseAnalytics.Param.<MASK><NEW_LINE>bundle.putBoolean(FirebaseAnalytics.Param.SUCCESS, true);<NEW_LINE>FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);<NEW_LINE>mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SEARCH, bundle);<NEW_LINE>}<NEW_LINE>} | SOURCE, comic.getSource()); |
180,436 | public GetDocumentAnalysisResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetDocumentAnalysisResult getDocumentAnalysisResult = new GetDocumentAnalysisResult();<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("DocumentMetadata")) {<NEW_LINE>getDocumentAnalysisResult.setDocumentMetadata(DocumentMetadataJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("JobStatus")) {<NEW_LINE>getDocumentAnalysisResult.setJobStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("NextToken")) {<NEW_LINE>getDocumentAnalysisResult.setNextToken(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("Blocks")) {<NEW_LINE>getDocumentAnalysisResult.setBlocks(new ListUnmarshaller<Block>(BlockJsonUnmarshaller.getInstance(<MASK><NEW_LINE>} else if (name.equals("Warnings")) {<NEW_LINE>getDocumentAnalysisResult.setWarnings(new ListUnmarshaller<Warning>(WarningJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else if (name.equals("StatusMessage")) {<NEW_LINE>getDocumentAnalysisResult.setStatusMessage(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("AnalyzeDocumentModelVersion")) {<NEW_LINE>getDocumentAnalysisResult.setAnalyzeDocumentModelVersion(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return getDocumentAnalysisResult;<NEW_LINE>} | )).unmarshall(context)); |
688,886 | private void headerSubElements(Element element, ParserContext parserContext, final BeanDefinitionBuilder builder) {<NEW_LINE>List<Element> subElements;<NEW_LINE>subElements = DomUtils.getChildElementsByTagName(element, "header");<NEW_LINE>if (!CollectionUtils.isEmpty(subElements)) {<NEW_LINE>ManagedMap<String, Object> expressions = new ManagedMap<String, Object>();<NEW_LINE>ManagedMap<String, Object> nullResultHeaderExpressions = new ManagedMap<String, Object>();<NEW_LINE>for (Element subElement : subElements) {<NEW_LINE>String name = subElement.getAttribute("name");<NEW_LINE>String nullResultHeaderExpression = subElement.getAttribute("null-result-expression");<NEW_LINE>String valueElementValue = subElement.getAttribute("value");<NEW_LINE>String expressionElementValue = subElement.getAttribute(EXPRESSION_ATTRIBUTE);<NEW_LINE>boolean hasAttributeValue = StringUtils.hasText(valueElementValue);<NEW_LINE>boolean hasAttributeExpression = StringUtils.hasText(expressionElementValue);<NEW_LINE>boolean hasAttributeNullResultExpression = StringUtils.hasText(nullResultHeaderExpression);<NEW_LINE>if (hasAttributeValue && hasAttributeExpression) {<NEW_LINE>parserContext.getReaderContext().error("Only one of '" + "value" + "' or '" + EXPRESSION_ATTRIBUTE + "' is allowed", subElement);<NEW_LINE>}<NEW_LINE>if (!hasAttributeValue && !hasAttributeExpression && !hasAttributeNullResultExpression) {<NEW_LINE>parserContext.getReaderContext().error("One of 'value' or 'expression' or 'null-result-expression' is required", subElement);<NEW_LINE>}<NEW_LINE>headerExpression(parserContext, expressions, nullResultHeaderExpressions, subElement, name, valueElementValue, hasAttributeValue, hasAttributeExpression, hasAttributeNullResultExpression);<NEW_LINE>}<NEW_LINE>if (expressions.size() > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (nullResultHeaderExpressions.size() > 0) {<NEW_LINE>builder.addPropertyValue("nullResultHeaderExpressions", nullResultHeaderExpressions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | builder.addPropertyValue("headerExpressions", expressions); |
1,716,800 | protected void activate(ComponentContext context) {<NEW_LINE>Dictionary<String, ?> props = context.getProperties();<NEW_LINE>final <MASK><NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "activate", props);<NEW_LINE>String contextSvcName = (String) props.get(JNDI_NAME);<NEW_LINE>if (contextSvcName == null)<NEW_LINE>contextSvcName = (String) props.get(CONFIG_ID);<NEW_LINE>if (!"file".equals(props.get("config.source"))) {<NEW_LINE>// execution properties for ContextServiceDefinition<NEW_LINE>execProps = new TreeMap<String, String>();<NEW_LINE>execProps.put(WSContextService.DEFAULT_CONTEXT, WSContextService.UNCONFIGURED_CONTEXT_TYPES);<NEW_LINE>String contextToSkip = (String) props.get("context.unchanged");<NEW_LINE>if (contextToSkip != null)<NEW_LINE>execProps.put(WSContextService.SKIP_CONTEXT_PROVIDERS, contextToSkip);<NEW_LINE>}<NEW_LINE>lock.writeLock().lock();<NEW_LINE>try {<NEW_LINE>componentContext = context;<NEW_LINE>properties = props;<NEW_LINE>name = contextSvcName;<NEW_LINE>} finally {<NEW_LINE>lock.writeLock().unlock();<NEW_LINE>}<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "activate");<NEW_LINE>} | boolean trace = TraceComponent.isAnyTracingEnabled(); |
1,151,446 | public Beneficiario toBeneficiario(Emissor emissor) {<NEW_LINE>Endereco endereco = Endereco.novoEndereco().comLogradouro(emissor.getEndereco());<NEW_LINE>return // BB<NEW_LINE>Beneficiario.novoBeneficiario().comAgencia(emissor.getAgencia()).comDigitoAgencia(emissor.getDigitoAgencia()).comCarteira(emissor.getCarteira()).comCodigoBeneficiario(emissor.getContaCorrente()).comDigitoCodigoBeneficiario(emissor.getDigitoContaCorrente()).comDigitoNossoNumero(emissor.getDigitoNossoNumero()).comEndereco(endereco).comNomeBeneficiario(emissor.getCedente()).comNossoNumero(emissor.getNossoNumero()).// BB<NEW_LINE><MASK><NEW_LINE>} | comNumeroConvenio(emissor.getNumeroConvenio()); |
919,511 | synchronized boolean addKeyValuePair(@NonNull final K key, @NonNull final V value) {<NEW_LINE>int size = 0;<NEW_LINE>int indexToAdd = -1;<NEW_LINE>boolean hasValue = false;<NEW_LINE>for (int index = 0; index < keysValues.length; index += 2) {<NEW_LINE>final Object keysValue = keysValues[index];<NEW_LINE>if (keysValue == null) {<NEW_LINE>indexToAdd = index;<NEW_LINE>}<NEW_LINE>if (keysValue == key) {<NEW_LINE>size++;<NEW_LINE>if (keysValues[index + 1] == value) {<NEW_LINE>indexToAdd = index;<NEW_LINE>hasValue = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (indexToAdd == -1) {<NEW_LINE>indexToAdd = keysValues.length;<NEW_LINE>keysValues = Arrays.copyOf(keysValues, indexToAdd < 2 ? 2 : indexToAdd * 2);<NEW_LINE>}<NEW_LINE>if (!hasValue) {<NEW_LINE>keysValues[indexToAdd] = key;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return size == 0;<NEW_LINE>} | keysValues[indexToAdd + 1] = value; |
1,501,101 | boolean reconnect() {<NEW_LINE>boolean flag = false;<NEW_LINE>for (int i = 1; i <= Config.RETRY_NUM; i++) {<NEW_LINE>try {<NEW_LINE>if (transport != null) {<NEW_LINE>transport.close();<NEW_LINE>openTransport();<NEW_LINE>if (Config.rpcThriftCompressionEnable) {<NEW_LINE>setClient(new TSIService.Client(new TCompactProtocol(transport)));<NEW_LINE>} else {<NEW_LINE>setClient(new TSIService.Client(new TBinaryProtocol(transport)));<NEW_LINE>}<NEW_LINE>openSession();<NEW_LINE>setClient(RpcUtils.newSynchronizedClient(getClient()));<NEW_LINE>flag = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(Config.RETRY_INTERVAL_MS);<NEW_LINE>} catch (InterruptedException e1) {<NEW_LINE>logger.error("reconnect is interrupted.", e1);<NEW_LINE>Thread<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return flag;<NEW_LINE>} | .currentThread().interrupt(); |
909,243 | private static MobileDoc createPage(MobileSessionCtx wsc, WWindowStatus ws, String formName, String fieldName, String fieldValue, String locationValue) {<NEW_LINE>// plain<NEW_LINE>MobileDoc <MASK><NEW_LINE>body body = doc.getBody();<NEW_LINE>log.info("Location-createpage: " + locationValue);<NEW_LINE>// Info<NEW_LINE>StringBuffer sb = new StringBuffer("FieldUpdate - ").append(FIELD_FORM).append("=").append(formName).append(", ").append(FIELD_NAME).append("=").append(fieldName).append(", ").append(FIELD_VALUE).append("=").append(fieldValue).append(LOCATION_VALUE).append("=").append(locationValue);<NEW_LINE>body.addElement(new p().addElement(sb.toString()));<NEW_LINE>// Called manually - do nothing<NEW_LINE>if (formName == null || fieldName == null)<NEW_LINE>;<NEW_LINE>else //<NEW_LINE>if (formName.equals("Login2") && fieldName.equals(WLogin.P_ROLE))<NEW_LINE>reply_Login2_Role(body, wsc, formName, fieldValue, locationValue);<NEW_LINE>else //<NEW_LINE>if (formName.equals("Login2") && fieldName.equals(WLogin.P_CLIENT))<NEW_LINE>reply_Login2_Client(body, wsc, formName, fieldValue, locationValue);<NEW_LINE>else //<NEW_LINE>if (formName.equals("Login2") && fieldName.equals(WLogin.P_ORG))<NEW_LINE>reply_Login2_Org(body, wsc, ws, formName, fieldValue, locationValue);<NEW_LINE>//<NEW_LINE>return doc;<NEW_LINE>} | doc = MobileDoc.create(true); |
1,443,585 | final ListDelegatedServicesForAccountResult executeListDelegatedServicesForAccount(ListDelegatedServicesForAccountRequest listDelegatedServicesForAccountRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDelegatedServicesForAccountRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDelegatedServicesForAccountRequest> request = null;<NEW_LINE>Response<ListDelegatedServicesForAccountResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListDelegatedServicesForAccountRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDelegatedServicesForAccountRequest));<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, "Organizations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDelegatedServicesForAccount");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDelegatedServicesForAccountResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDelegatedServicesForAccountResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
353,864 | public void apply(Skeleton skeleton, float lastTime, float time, @Null Array<Event> events, float alpha, MixBlend blend, MixDirection direction) {<NEW_LINE>Bone bone = skeleton.bones.get(boneIndex);<NEW_LINE>if (!bone.active)<NEW_LINE>return;<NEW_LINE>float[] frames = this.frames;<NEW_LINE>if (time < frames[0]) {<NEW_LINE>// Time is before first frame.<NEW_LINE>switch(blend) {<NEW_LINE>case setup:<NEW_LINE>bone.shearX = bone.data.shearX;<NEW_LINE>return;<NEW_LINE>case first:<NEW_LINE>bone.shearX += (bone.data.<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float x = getCurveValue(time);<NEW_LINE>switch(blend) {<NEW_LINE>case setup:<NEW_LINE>bone.shearX = bone.data.shearX + x * alpha;<NEW_LINE>break;<NEW_LINE>case first:<NEW_LINE>case replace:<NEW_LINE>bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;<NEW_LINE>break;<NEW_LINE>case add:<NEW_LINE>bone.shearX += x * alpha;<NEW_LINE>}<NEW_LINE>} | shearX - bone.shearX) * alpha; |
1,084,512 | public void checkSharedDates(Budget budget) throws AxelorException {<NEW_LINE>if (budget.getBudgetLineList() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<BudgetLine> budgetLineList = budget.getBudgetLineList();<NEW_LINE>for (int i = 0; i < budgetLineList.size() - 1; i++) {<NEW_LINE>BudgetLine budgetLineA = budgetLineList.get(i);<NEW_LINE>LocalDate fromDateA = budgetLineA.getFromDate();<NEW_LINE>LocalDate toDateA = budgetLineA.getToDate();<NEW_LINE>for (int j = i + 1; j < budgetLineList.size(); j++) {<NEW_LINE>BudgetLine budgetLineB = budgetLineList.get(j);<NEW_LINE>LocalDate fromDateB = budgetLineB.getFromDate();<NEW_LINE>LocalDate toDateB = budgetLineB.getToDate();<NEW_LINE>if (fromDateA.equals(fromDateB) || toDateA.equals(toDateB)) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get("Two or more budget lines share dates"));<NEW_LINE>}<NEW_LINE>if (fromDateA.isBefore(fromDateB) && (!toDateA.isBefore(fromDateB))) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY<MASK><NEW_LINE>}<NEW_LINE>if (fromDateA.isAfter(fromDateB) && (!fromDateA.isAfter(toDateB))) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get("Two or more budget lines share dates"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , I18n.get("Two or more budget lines share dates")); |
1,217,531 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>browserLabel = new JLabel();<NEW_LINE>browserComboBox = createBrowserComboBox();<NEW_LINE>reloadOnSaveCheckBox = new JCheckBox();<NEW_LINE>reloadInfoLabel = new JLabel();<NEW_LINE>// NOI18N<NEW_LINE>Mnemonics.setLocalizedText(browserLabel, NbBundle.getMessage(CustomizerBrowser.class, "CustomizerBrowser.browserLabel.text"));<NEW_LINE>// NOI18N<NEW_LINE>Mnemonics.setLocalizedText(reloadOnSaveCheckBox, NbBundle.getMessage<MASK><NEW_LINE>// NOI18N<NEW_LINE>Mnemonics.setLocalizedText(reloadInfoLabel, NbBundle.getMessage(CustomizerBrowser.class, "CustomizerBrowser.reloadInfoLabel.text"));<NEW_LINE>GroupLayout layout = new GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(browserLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(browserComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addGroup(layout.createSequentialGroup().addGap(12, 12, 12).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGap(21, 21, 21).addComponent(reloadInfoLabel)).addComponent(reloadOnSaveCheckBox))));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(browserLabel).addComponent(browserComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(reloadOnSaveCheckBox).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(reloadInfoLabel).addGap(0, 0, Short.MAX_VALUE)));<NEW_LINE>} | (CustomizerBrowser.class, "CustomizerBrowser.reloadOnSaveCheckBox.text")); |
554,262 | public void run() {<NEW_LINE>ConfigurationPanel.this.removeAll();<NEW_LINE>ConfigurationPanel.this.setLayout(new BorderLayout());<NEW_LINE>try {<NEW_LINE>ConfigurationPanel.this.add(callable.call(), BorderLayout.CENTER);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Exceptions.<MASK><NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>ConfigurationPanel.this.invalidate();<NEW_LINE>ConfigurationPanel.this.revalidate();<NEW_LINE>ConfigurationPanel.this.repaint();<NEW_LINE>if (featureInfo != null && !featureInfo.isEnabled()) {<NEW_LINE>if (featureInfo.isPresent()) {<NEW_LINE>msg = NbBundle.getMessage(ConfigurationPanel.class, "MSG_EnableFailed");<NEW_LINE>} else {<NEW_LINE>msg = NbBundle.getMessage(ConfigurationPanel.class, "MSG_DownloadFailed");<NEW_LINE>}<NEW_LINE>progressMonitor.onError(msg);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>activateButton.setEnabled(true);<NEW_LINE>progressPanel.removeAll();<NEW_LINE>progressPanel.revalidate();<NEW_LINE>progressPanel.repaint();<NEW_LINE>} | attachSeverity(ex, Level.INFO); |
1,577,368 | private void parsePaths(JsonObject json) {<NEW_LINE>String runfilesPrefix = null;<NEW_LINE>List<String> alternativePrefixes = new ArrayList<>();<NEW_LINE>VirtualFile base = baseUrlFile.getValue();<NEW_LINE>if (base != null) {<NEW_LINE>Path baseUrlPath = VfsUtil.virtualToIoFile(base).toPath();<NEW_LINE>BuildSystemName buildSystem = Blaze.getBuildSystemName(project);<NEW_LINE>File workspaceRoot = WorkspaceRoot.fromProject(project).directory();<NEW_LINE>File blazeBin = new File(workspaceRoot, BlazeInfo.blazeBinKey(buildSystem));<NEW_LINE>File blazeGenfiles = new File(workspaceRoot, BlazeInfo.blazeGenfilesKey(buildSystem));<NEW_LINE>// modules are resolved in this order<NEW_LINE>alternativePrefixes.add(baseUrlPath.relativize(workspaceRoot.toPath()).toString());<NEW_LINE>alternativePrefixes.add(baseUrlPath.relativize(blazeBin.toPath()).toString());<NEW_LINE>alternativePrefixes.add(baseUrlPath.relativize(blazeGenfiles.toPath<MASK><NEW_LINE>FileOperationProvider fOps = FileOperationProvider.getInstance();<NEW_LINE>if (fOps.isSymbolicLink(blazeBin)) {<NEW_LINE>try {<NEW_LINE>alternativePrefixes.add(baseUrlPath.relativize(fOps.readSymbolicLink(blazeBin).toPath()).toString());<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.warn(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fOps.isSymbolicLink(blazeGenfiles)) {<NEW_LINE>try {<NEW_LINE>alternativePrefixes.add(baseUrlPath.relativize(fOps.readSymbolicLink(blazeGenfiles).toPath()).toString());<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.warn(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>runfilesPrefix = "./" + label.targetName() + ".runfiles/" + workspaceRoot.getName();<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, JsonElement> entry : json.entrySet()) {<NEW_LINE>String name = entry.getKey();<NEW_LINE>List<String> mappings = new ArrayList<>();<NEW_LINE>for (JsonElement path : entry.getValue().getAsJsonArray()) {<NEW_LINE>String pathString = path.getAsString();<NEW_LINE>if (pathString.startsWith(workspaceRelativePathPrefix)) {<NEW_LINE>pathString = workspaceRelativePathReplacement + pathString.substring(workspaceRelativePathPrefix.length());<NEW_LINE>}<NEW_LINE>mappings.add(pathString);<NEW_LINE>}<NEW_LINE>paths.add(new PathSubstitution(name, mappings, alternativePrefixes, runfilesPrefix));<NEW_LINE>}<NEW_LINE>} | ()).toString()); |
88,357 | public static CraftingStatus create(IncrementalUpdateHelper changes, CraftingCpuLogic logic) {<NEW_LINE>boolean full = changes.isFullUpdate();<NEW_LINE>ImmutableList.Builder<CraftingStatusEntry> newEntries = ImmutableList.builder();<NEW_LINE>for (var what : changes) {<NEW_LINE>long storedCount = logic.getStored(what);<NEW_LINE>long <MASK><NEW_LINE>long pendingCount = logic.getPendingOutputs(what);<NEW_LINE>var sentStack = what;<NEW_LINE>if (!full && changes.getSerial(what) != null) {<NEW_LINE>// The item was already sent to the client, so we can skip the item stack<NEW_LINE>sentStack = null;<NEW_LINE>}<NEW_LINE>var entry = new CraftingStatusEntry(changes.getOrAssignSerial(what), sentStack, storedCount, activeCount, pendingCount);<NEW_LINE>newEntries.add(entry);<NEW_LINE>if (entry.isDeleted()) {<NEW_LINE>changes.removeSerial(what);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long elapsedTime = logic.getElapsedTimeTracker().getElapsedTime();<NEW_LINE>long remainingItems = logic.getElapsedTimeTracker().getRemainingItemCount();<NEW_LINE>long startItems = logic.getElapsedTimeTracker().getStartItemCount();<NEW_LINE>return new CraftingStatus(full, elapsedTime, remainingItems, startItems, newEntries.build());<NEW_LINE>} | activeCount = logic.getWaitingFor(what); |
1,159,349 | public void putAll(Map<? extends K, ? extends V> map) {<NEW_LINE>if (map instanceof UnifiedMapWithHashingStrategy<?, ?>) {<NEW_LINE>this.copyMap((UnifiedMapWithHashingStrategy<MASK><NEW_LINE>} else if (map instanceof UnsortedMapIterable) {<NEW_LINE>MapIterable<K, V> mapIterable = (MapIterable<K, V>) map;<NEW_LINE>mapIterable.forEachKeyValue(new Procedure2<K, V>() {<NEW_LINE><NEW_LINE>public void value(K key, V value) {<NEW_LINE>UnifiedMapWithHashingStrategy.this.put(key, value);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>Iterator<? extends Entry<? extends K, ? extends V>> iterator = this.getEntrySetFrom(map).iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Entry<? extends K, ? extends V> entry = iterator.next();<NEW_LINE>this.put(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | <K, V>) map); |
1,726,236 | // Parsing loaded plugin<NEW_LINE>public AbstractTableInfo parseWithTableType(int tableType, CreateTableParser.SqlParserResult parserResult, String localPluginRoot, String pluginLoadMode) throws Exception {<NEW_LINE>AbstractTableParser absTableParser = null;<NEW_LINE>Map<String, Object> props = parserResult.getPropMap();<NEW_LINE>String type = MathUtil.getString(props.get(TYPE_KEY));<NEW_LINE>if (Strings.isNullOrEmpty(type)) {<NEW_LINE>throw new RuntimeException("create table statement requires property of type");<NEW_LINE>}<NEW_LINE>if (tableType == ETableType.SOURCE.getType()) {<NEW_LINE>boolean isSideTable = checkIsSideTable(parserResult.getFieldsInfoStr());<NEW_LINE>if (!isSideTable) {<NEW_LINE>absTableParser = sourceTableInfoMap.get(type);<NEW_LINE>if (absTableParser == null) {<NEW_LINE>absTableParser = StreamSourceFactory.getSqlParser(type, localPluginRoot, pluginLoadMode);<NEW_LINE>sourceTableInfoMap.put(type, absTableParser);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>absTableParser = sideTableInfoMap.get(type);<NEW_LINE>if (absTableParser == null) {<NEW_LINE>String cacheType = MathUtil.getString(props.get(AbstractSideTableInfo.CACHE_KEY));<NEW_LINE>absTableParser = StreamSideFactory.getSqlParser(type, localPluginRoot, cacheType, pluginLoadMode);<NEW_LINE>sideTableInfoMap.put(type + cacheType, absTableParser);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (tableType == ETableType.SINK.getType()) {<NEW_LINE>absTableParser = targetTableInfoMap.get(type);<NEW_LINE>if (absTableParser == null) {<NEW_LINE>absTableParser = StreamSinkFactory.getSqlParser(type, localPluginRoot, pluginLoadMode);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (absTableParser == null) {<NEW_LINE>throw new RuntimeException(String.format("not support %s type of table", type));<NEW_LINE>}<NEW_LINE>Map<String, Object> prop = Maps.newHashMap();<NEW_LINE>// Shield case<NEW_LINE>parserResult.getPropMap().forEach((key, val) -> prop.put(key.toLowerCase(), val));<NEW_LINE>return absTableParser.getTableInfo(parserResult.getTableName(), parserResult.getFieldsInfoStr(), prop);<NEW_LINE>} | targetTableInfoMap.put(type, absTableParser); |
1,692,724 | public CurrentPerformanceRiskRatings unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CurrentPerformanceRiskRatings currentPerformanceRiskRatings = new CurrentPerformanceRiskRatings();<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("high", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>currentPerformanceRiskRatings.setHigh(context.getUnmarshaller(Long.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("medium", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>currentPerformanceRiskRatings.setMedium(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("low", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>currentPerformanceRiskRatings.setLow(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("veryLow", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>currentPerformanceRiskRatings.setVeryLow(context.getUnmarshaller(Long.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 currentPerformanceRiskRatings;<NEW_LINE>} | class).unmarshall(context)); |
290,741 | final DescribeLoggingStatusResult executeDescribeLoggingStatus(DescribeLoggingStatusRequest describeLoggingStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeLoggingStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeLoggingStatusRequest> request = null;<NEW_LINE>Response<DescribeLoggingStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeLoggingStatusRequestMarshaller().marshall(super.beforeMarshalling(describeLoggingStatusRequest));<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, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLoggingStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeLoggingStatusResult> responseHandler = new StaxResponseHandler<DescribeLoggingStatusResult>(new DescribeLoggingStatusResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
796,921 | private void reassignEarlyHolders8(Context context) {<NEW_LINE>ReflectUtil.field(Attr.instance(context), RESOLVE_FIELD).set(this);<NEW_LINE>ReflectUtil.field(DeferredAttr.instance(context), RESOLVE_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Check.instance(context), RESOLVE_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Infer.instance(context), RESOLVE_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Flow.instance(context), RESOLVE_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Lower.instance(context), RESOLVE_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Gen.instance(context), RESOLVE_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Annotate.instance(context), RESOLVE_FIELD).set(this);<NEW_LINE>ReflectUtil.field(JavacTrees.instance(context), "resolve").set(this);<NEW_LINE>ReflectUtil.field(TransTypes.instance(context)<MASK><NEW_LINE>} | , "resolve").set(this); |
147,823 | public void executeEvent(WorkflowExecuteThread workflowExecuteThread) {<NEW_LINE>if (!workflowExecuteThread.isStart() || workflowExecuteThread.eventSize() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (multiThreadFilterMap.containsKey(workflowExecuteThread.getKey())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>multiThreadFilterMap.put(workflowExecuteThread.getKey(), workflowExecuteThread);<NEW_LINE>int processInstanceId = workflowExecuteThread.getProcessInstance().getId();<NEW_LINE>ListenableFuture future = this.submitListenable(workflowExecuteThread::handleEvents);<NEW_LINE>future.addCallback(new ListenableFutureCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Throwable ex) {<NEW_LINE>logger.<MASK><NEW_LINE>multiThreadFilterMap.remove(workflowExecuteThread.getKey());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(Object result) {<NEW_LINE>// if an exception occurs, first, the error message cannot be printed in the log;<NEW_LINE>// secondly, the `multiThreadFilterMap` cannot be remove the `workflowExecuteThread`, resulting in the state of process instance cannot be changed and memory leak<NEW_LINE>try {<NEW_LINE>if (workflowExecuteThread.workFlowFinish()) {<NEW_LINE>stateWheelExecuteThread.removeProcess4TimeoutCheck(workflowExecuteThread.getProcessInstance());<NEW_LINE>processInstanceExecCacheManager.removeByProcessInstanceId(processInstanceId);<NEW_LINE>notifyProcessChanged(workflowExecuteThread.getProcessInstance());<NEW_LINE>logger.info("process instance {} finished.", processInstanceId);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("handle events {} success, but notify changed error", processInstanceId, e);<NEW_LINE>}<NEW_LINE>multiThreadFilterMap.remove(workflowExecuteThread.getKey());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | error("handle events {} failed", processInstanceId, ex); |
1,644,925 | private void updateCloseButton() {<NEW_LINE>// Do not continue if proxy was released.<NEW_LINE>if (this.proxy == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Fetch the search view.<NEW_LINE>SearchView searchView = getSearchView();<NEW_LINE>if (searchView == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Fetch close button from the search view.<NEW_LINE>View view = searchView.<MASK><NEW_LINE>if (!(view instanceof ImageView)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ImageView imageView = (ImageView) view;<NEW_LINE>// Store a reference to close button's image, if not done already.<NEW_LINE>if (this.closeButtonDrawable == null) {<NEW_LINE>this.closeButtonDrawable = imageView.getDrawable();<NEW_LINE>}<NEW_LINE>// Show/hide the close button by adding/removing its image. (There is no other way to do this.)<NEW_LINE>boolean isShown = TiConvert.toBoolean(this.proxy.getProperty(TiC.PROPERTY_SHOW_CANCEL), false);<NEW_LINE>if (isShown) {<NEW_LINE>imageView.setImageDrawable(this.closeButtonDrawable);<NEW_LINE>} else {<NEW_LINE>imageView.setImageDrawable(null);<NEW_LINE>}<NEW_LINE>imageView.setEnabled(isShown);<NEW_LINE>} | findViewById(R.id.search_close_btn); |
314,593 | final ListResourcesResult executeListResources(ListResourcesRequest listResourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listResourcesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListResourcesRequest> request = null;<NEW_LINE>Response<ListResourcesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListResourcesRequestProtocolMarshaller(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, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListResources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListResourcesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListResourcesResultJsonUnmarshaller());<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(listResourcesRequest)); |
1,747,151 | public boolean eventOccurred(UISWTViewEvent event) {<NEW_LINE>switch(event.getType()) {<NEW_LINE>case UISWTViewEvent.TYPE_CREATE:<NEW_LINE>swtView = (UISWTView) event.getData();<NEW_LINE>if (swtView.getInitialDataSource() instanceof Number) {<NEW_LINE>dht_type = ((Number) swtView.getInitialDataSource()).intValue();<NEW_LINE>id = String.valueOf(dht_type);<NEW_LINE>}<NEW_LINE>swtView.setTitle(MessageText<MASK><NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_DESTROY:<NEW_LINE>delete();<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_INITIALIZE:<NEW_LINE>initialize((Composite) event.getData());<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_LANGUAGEUPDATE:<NEW_LINE>Messages.updateLanguageForControl(getComposite());<NEW_LINE>if (swtView != null) {<NEW_LINE>swtView.setTitle(MessageText.getString(getTitleID()));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_DATASOURCE_CHANGED:<NEW_LINE>if (event.getData() instanceof Number) {<NEW_LINE>dht_type = ((Number) event.getData()).intValue();<NEW_LINE>id = String.valueOf(dht_type);<NEW_LINE>if (swtView != null) {<NEW_LINE>swtView.setTitle(MessageText.getString(getTitleID()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_FOCUSGAINED:<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_REFRESH:<NEW_LINE>refresh();<NEW_LINE>break;<NEW_LINE>case StatsView.EVENT_PERIODIC_UPDATE:<NEW_LINE>periodicUpdate();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .getString(getTitleID())); |
223,290 | public static EdgesContainer create(PageItemNode parent, List<PageItemNode> pins) {<NEW_LINE>List<Edge> rightEdges = new LinkedList<>();<NEW_LINE>List<Edge> leftEdges = new LinkedList<>();<NEW_LINE>List<Edge> bottomEdges = new LinkedList<>();<NEW_LINE>List<Edge> topEdges = new LinkedList<>();<NEW_LINE>Point[] parentPoints = parent.getPageItem().getArea().getPoints();<NEW_LINE>rightEdges.add(new Edge(parent, parentPoints[1], parentPoints[2], true));<NEW_LINE>leftEdges.add(new Edge(parent, parentPoints[0], parentPoints[3], true));<NEW_LINE>topEdges.add(new Edge(parent, parentPoints[0], parentPoints[1], true));<NEW_LINE>bottomEdges.add(new Edge(parent, parentPoints[3], parentPoints[2], true));<NEW_LINE>for (PageItemNode pin : pins) {<NEW_LINE>Point[] p = pin.getPageItem().getArea().getPoints();<NEW_LINE>rightEdges.add(new Edge(pin, p[0], p[3], true));<NEW_LINE>leftEdges.add(new Edge(pin, p[1], p[2], true));<NEW_LINE>topEdges.add(new Edge(pin, p[3], <MASK><NEW_LINE>bottomEdges.add(new Edge(pin, p[0], p[1], true));<NEW_LINE>}<NEW_LINE>return new EdgesContainer(rightEdges, leftEdges, bottomEdges, topEdges);<NEW_LINE>} | p[2], true)); |
210,221 | public void marshall(DataReplicationInfo dataReplicationInfo, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (dataReplicationInfo == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(dataReplicationInfo.getDataReplicationError(), DATAREPLICATIONERROR_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataReplicationInfo.getDataReplicationInitiation(), DATAREPLICATIONINITIATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataReplicationInfo.getDataReplicationState(), DATAREPLICATIONSTATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataReplicationInfo.getEtaDateTime(), ETADATETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(dataReplicationInfo.getReplicatedDisks(), REPLICATEDDISKS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | dataReplicationInfo.getLagDuration(), LAGDURATION_BINDING); |
1,184,115 | public void openURL(String url) throws NullPointerException {<NEW_LINE>CustomTabsIntent.Builder <MASK><NEW_LINE>builder.setStartAnimations(context, R.anim.slide_in_right, R.anim.slide_out_left);<NEW_LINE>builder.setExitAnimations(context, R.anim.slide_in_left, R.anim.slide_out_right);<NEW_LINE>CustomTabsIntent customTabsIntent = builder.build();<NEW_LINE>if (CustomTabsHelper.isChromeCustomTabsSupported(context)) {<NEW_LINE>customTabsIntent.launchUrl(context.getCurrentActivity(), Uri.parse(url));<NEW_LINE>} else {<NEW_LINE>// open in browser<NEW_LINE>Intent i = new Intent(Intent.ACTION_VIEW);<NEW_LINE>i.setData(Uri.parse(url));<NEW_LINE>// ensure browser is present<NEW_LINE>final List<ResolveInfo> customTabsApps = context.getPackageManager().queryIntentActivities(i, 0);<NEW_LINE>if (customTabsApps.size() > 0) {<NEW_LINE>i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>context.startActivity(i);<NEW_LINE>} else {<NEW_LINE>// no browser<NEW_LINE>Toast.makeText(getReactApplicationContext(), R.string.no_browser_found, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | builder = new CustomTabsIntent.Builder(); |
1,142,285 | public boolean openForm(int AD_Form_ID) {<NEW_LINE>Properties ctx = Env.getCtx();<NEW_LINE>//<NEW_LINE>String name = null;<NEW_LINE>String className = null;<NEW_LINE>String sql = "SELECT Name, Description, ClassName, Help FROM AD_Form WHERE AD_Form_ID=?";<NEW_LINE>boolean trl = !Env.isBaseLanguage(ctx, "AD_Form");<NEW_LINE>if (trl)<NEW_LINE>sql = "SELECT t.Name, t.Description, f.ClassName, t.Help " + "FROM AD_Form f INNER JOIN AD_Form_Trl t" + " ON (f.AD_Form_ID=t.AD_Form_ID AND AD_Language=?)" + "WHERE f.AD_Form_ID=?";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>if (trl) {<NEW_LINE>pstmt.setString(1, Env.getAD_Language(ctx));<NEW_LINE>pstmt.setInt(2, AD_Form_ID);<NEW_LINE>} else<NEW_LINE>pstmt.setInt(1, AD_Form_ID);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>name = rs.getString(1);<NEW_LINE>m_Description = rs.getString(2);<NEW_LINE>className = rs.getString(3);<NEW_LINE>m_Help = rs.getString(4);<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>if (className == null)<NEW_LINE>return false;<NEW_LINE>//<NEW_LINE>return <MASK><NEW_LINE>} | openForm(AD_Form_ID, className, name); |
1,582,829 | private List createHandlesForUserBendpoints() {<NEW_LINE>List list = new ArrayList();<NEW_LINE>ConnectionEditPart connEP = (ConnectionEditPart) getHost();<NEW_LINE>PointList points = getConnection().getPoints();<NEW_LINE>List bendPoints = (List<MASK><NEW_LINE>int bendPointIndex = 0;<NEW_LINE>Point currBendPoint = null;<NEW_LINE>if (bendPoints == null)<NEW_LINE>bendPoints = NULL_CONSTRAINT;<NEW_LINE>else if (!bendPoints.isEmpty())<NEW_LINE>currBendPoint = ((Bendpoint) bendPoints.get(0)).getLocation();<NEW_LINE>for (int i = 0; i < points.size() - 1; i++) {<NEW_LINE>// Put a create handle on the middle of every segment<NEW_LINE>list.add(new BendpointCreationHandle(connEP, bendPointIndex, i));<NEW_LINE>// If the current user bendpoint matches a bend location, show a<NEW_LINE>// move handle<NEW_LINE>if (i < points.size() - 1 && bendPointIndex < bendPoints.size() && currBendPoint != null && currBendPoint.equals(points.getPoint(i + 1))) {<NEW_LINE>list.add(new BendpointMoveHandle(connEP, bendPointIndex, i + 1));<NEW_LINE>// Go to the next user bendpoint<NEW_LINE>bendPointIndex++;<NEW_LINE>if (bendPointIndex < bendPoints.size())<NEW_LINE>currBendPoint = ((Bendpoint) bendPoints.get(bendPointIndex)).getLocation();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | ) getConnection().getRoutingConstraint(); |
244,722 | public void testFlowableRxInvoker_postIbmReceiveTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>long timeout = messageTimeout;<NEW_LINE>if (isZOS()) {<NEW_LINE>timeout = zTimeout;<NEW_LINE>}<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE><MASK><NEW_LINE>cb.property("com.ibm.ws.jaxrs.client.receive.timeout", TIMEOUT);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(FlowableRxInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/post/" + SLEEP);<NEW_LINE>Builder builder = t.request();<NEW_LINE>Flowable<Response> flowable = builder.rx(FlowableRxInvoker.class).post(Entity.xml(Long.toString(SLEEP)));<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>final Holder<Response> holder = new Holder<Response>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>flowable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>}, throwable -> {<NEW_LINE>if (throwable.getMessage().contains("SocketTimeoutException")) {<NEW_LINE>// OnError<NEW_LINE>ret.append("Timeout as expected");<NEW_LINE>} else {<NEW_LINE>ret.append("throwable");<NEW_LINE>throwable.printStackTrace();<NEW_LINE>}<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, // OnCompleted<NEW_LINE>() -> ret.append("OnCompleted"));<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(timeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testFlowableRxInvoker_postIbmReceiveTimeout: Response took too long. Waited " + timeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>long elapsed = System.currentTimeMillis() - startTime;<NEW_LINE>System.out.println("testFlowableRxInvoker_postIbmReceiveTimeout with TIMEOUT " + TIMEOUT + " OnError elapsed time " + elapsed);<NEW_LINE>c.close();<NEW_LINE>} | ClientBuilder cb = ClientBuilder.newBuilder(); |
1,445,641 | public static void testParameterTypes() {<NEW_LINE>JsBiFunction tIntegerJsBiFunction <MASK><NEW_LINE>JsBiFunction doubleDoubleJsBiFunction = new DoubleDoubleJsBiFunction();<NEW_LINE>callInterfaceRaw(tIntegerJsBiFunction, "a", 1);<NEW_LINE>callInterfaceRaw(doubleDoubleJsBiFunction, 1.1, 1.1);<NEW_LINE>callInterfaceParameterized(tIntegerJsBiFunction, "a");<NEW_LINE>callInterfaceUnparameterized(tIntegerJsBiFunction, "a", 1);<NEW_LINE>callInterfaceUnparameterized(doubleDoubleJsBiFunction, 1.1, 1.1);<NEW_LINE>callImplementorRaw(new TIntegerJsBiFunction<Double>(), 1.1, 1);<NEW_LINE>callImplementorParameterized(new TIntegerJsBiFunction<String>(), "");<NEW_LINE>tIntegerJsBiFunction.apply("a", 1);<NEW_LINE>doubleDoubleJsBiFunction.apply(1.1, 1.1);<NEW_LINE>callOnFunction(new DoubleDoubleJsBiFunction());<NEW_LINE>} | = new TIntegerJsBiFunction<String>(); |
1,595,769 | private void editFontSize() {<NEW_LINE>MaterialDialog.Builder builder = DialogUtils.getInstance().createCustomDialogWithoutContent(<MASK><NEW_LINE>MaterialDialog dialog = builder.customView(R.layout.dialog_font_size, true).onPositive((dialog1, which) -> {<NEW_LINE>final EditText fontInput = dialog1.getCustomView().findViewById(R.id.fontInput);<NEW_LINE>try {<NEW_LINE>int check = Integer.parseInt(String.valueOf(fontInput.getText()));<NEW_LINE>if (check > 1000 || check < 0) {<NEW_LINE>StringUtils.getInstance().showSnackbar(mActivity, R.string.invalid_entry);<NEW_LINE>} else {<NEW_LINE>StringUtils.getInstance().showSnackbar(mActivity, R.string.font_size_changed);<NEW_LINE>SharedPreferences.Editor editor = mSharedPreferences.edit();<NEW_LINE>editor.putInt(Constants.DEFAULT_FONT_SIZE_TEXT, check);<NEW_LINE>editor.apply();<NEW_LINE>showSettingsOptions();<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>StringUtils.getInstance().showSnackbar(mActivity, R.string.invalid_entry);<NEW_LINE>}<NEW_LINE>}).build();<NEW_LINE>View customView = dialog.getCustomView();<NEW_LINE>customView.findViewById(R.id.cbSetFontDefault).setVisibility(View.GONE);<NEW_LINE>dialog.show();<NEW_LINE>} | mActivity, R.string.font_size_edit); |
355,827 | public CapacitySpecificationSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CapacitySpecificationSummary capacitySpecificationSummary = new CapacitySpecificationSummary();<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("throughputMode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>capacitySpecificationSummary.setThroughputMode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("readCapacityUnits", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>capacitySpecificationSummary.setReadCapacityUnits(context.getUnmarshaller(Long.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("writeCapacityUnits", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>capacitySpecificationSummary.setWriteCapacityUnits(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("lastUpdateToPayPerRequestTimestamp", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>capacitySpecificationSummary.setLastUpdateToPayPerRequestTimestamp(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 capacitySpecificationSummary;<NEW_LINE>} | class).unmarshall(context)); |
554,619 | protected void configureHttpProtocol(final ServiceLocator habitat, final NetworkListener networkListener, final Http http, final FilterChainBuilder filterChainBuilder, boolean secure) {<NEW_LINE>transactionTimeoutMillis = Long.parseLong(http.getRequestTimeoutSeconds()) * 1000;<NEW_LINE>filterChainBuilder.add(new IdleTimeoutFilter(obtainDelayedExecutor(), getTimeoutSeconds(http), TimeUnit.SECONDS));<NEW_LINE>final org.glassfish.grizzly.http.HttpServerFilter httpServerFilter = createHttpServerCodecFilter(http);<NEW_LINE>httpServerFilter.setRemoveHandledContentEncodingHeaders(true);<NEW_LINE>final Set<ContentEncoding> contentEncodings = configureContentEncodings(http);<NEW_LINE>for (ContentEncoding contentEncoding : contentEncodings) {<NEW_LINE>httpServerFilter.addContentEncoding(contentEncoding);<NEW_LINE>}<NEW_LINE>// httpServerFilter.getMonitoringConfig().addProbes(<NEW_LINE>// serverConfig.getMonitoringConfig().getHttpConfig().getProbes());<NEW_LINE>filterChainBuilder.add(httpServerFilter);<NEW_LINE>final FileCache fileCache = configureHttpFileCache(http.getFileCache());<NEW_LINE>fileCache.initialize(obtainDelayedExecutor());<NEW_LINE>final FileCacheFilter fileCacheFilter = new FileCacheFilter(fileCache);<NEW_LINE>// fileCache.getMonitoringConfig().addProbes(<NEW_LINE>// serverConfig.getMonitoringConfig().getFileCacheConfig().getProbes());<NEW_LINE>filterChainBuilder.add(fileCacheFilter);<NEW_LINE>configureHSTSSupport(habitat, http.getParent(<MASK><NEW_LINE>final HttpServerFilter webServerFilter = new HttpServerFilter(getHttpServerFilterConfiguration(http), obtainDelayedExecutor());<NEW_LINE>final HttpHandler httpHandler = getHttpHandler();<NEW_LINE>httpHandler.setAllowEncodedSlash(GrizzlyConfig.toBoolean(http.getEncodedSlashEnabled()));<NEW_LINE>webServerFilter.setHttpHandler(httpHandler);<NEW_LINE>// webServerFilter.getMonitoringConfig().addProbes(<NEW_LINE>// serverConfig.getMonitoringConfig().getWebServerConfig().getProbes());<NEW_LINE>filterChainBuilder.add(webServerFilter);<NEW_LINE>configureHttp2Support(habitat, networkListener, http, filterChainBuilder, secure);<NEW_LINE>// TODO: evaluate comet/websocket support over SPDY.<NEW_LINE>configureCometSupport(habitat, networkListener, http, filterChainBuilder);<NEW_LINE>configureWebSocketSupport(habitat, networkListener, http, filterChainBuilder);<NEW_LINE>configureAjpSupport(habitat, networkListener, http, filterChainBuilder);<NEW_LINE>} | ).getSsl(), filterChainBuilder); |
1,366,897 | private boolean tryImplicitReceiver(final Expression origin, final Expression message, final Expression arguments, final MethodCallerMultiAdapter adapter, final boolean safe, final boolean spreadSafe) {<NEW_LINE>Object implicitReceiver = origin.getNodeMetaData(StaticTypesMarker.IMPLICIT_RECEIVER);<NEW_LINE>if (implicitReceiver == null && origin instanceof MethodCallExpression) {<NEW_LINE>implicitReceiver = ((MethodCallExpression) origin).getObjectExpression().getNodeMetaData(StaticTypesMarker.IMPLICIT_RECEIVER);<NEW_LINE>}<NEW_LINE>if (implicitReceiver != null) {<NEW_LINE>String[] path = ((String) implicitReceiver).split("\\.");<NEW_LINE>// GROOVY-6021<NEW_LINE>PropertyExpression pexp = propX(varX("this", ClassHelper.CLOSURE_TYPE), path[0]);<NEW_LINE>pexp.setImplicitThis(true);<NEW_LINE>for (int i = 1, n = path.length; i < n; i += 1) {<NEW_LINE>pexp.putNodeMetaData(StaticTypesMarker.INFERRED_TYPE, ClassHelper.CLOSURE_TYPE);<NEW_LINE>pexp = propX(pexp, path[i]);<NEW_LINE>}<NEW_LINE>pexp.<MASK><NEW_LINE>origin.removeNodeMetaData(StaticTypesMarker.IMPLICIT_RECEIVER);<NEW_LINE>if (origin instanceof PropertyExpression) {<NEW_LINE>PropertyExpression rewritten = propX(pexp, ((PropertyExpression) origin).getProperty(), ((PropertyExpression) origin).isSafe());<NEW_LINE>rewritten.setSpreadSafe(((PropertyExpression) origin).isSpreadSafe());<NEW_LINE>rewritten.visit(controller.getAcg());<NEW_LINE>rewritten.putNodeMetaData(StaticTypesMarker.INFERRED_TYPE, origin.getNodeMetaData(StaticTypesMarker.INFERRED_TYPE));<NEW_LINE>} else {<NEW_LINE>makeCall(origin, pexp, message, arguments, adapter, safe, spreadSafe, false);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | putNodeMetaData(StaticTypesMarker.IMPLICIT_RECEIVER, implicitReceiver); |
460,406 | public static MutableRoaringBitmap or(final MutableRoaringBitmap x1, final MutableRoaringBitmap x2) {<NEW_LINE>final MutableRoaringBitmap answer = new MutableRoaringBitmap();<NEW_LINE>int pos1 = 0, pos2 = 0;<NEW_LINE>final int length1 = x1.highLowContainer.size(), length2 = x2.highLowContainer.size();<NEW_LINE>main: if (pos1 < length1 && pos2 < length2) {<NEW_LINE>char s1 = x1.highLowContainer.getKeyAtIndex(pos1);<NEW_LINE>char s2 = x2.highLowContainer.getKeyAtIndex(pos2);<NEW_LINE>while (true) {<NEW_LINE>if (s1 == s2) {<NEW_LINE>answer.getMappeableRoaringArray().append(s1, x1.highLowContainer.getContainerAtIndex(pos1).or(x2.highLowContainer.getContainerAtIndex(pos2)));<NEW_LINE>pos1++;<NEW_LINE>pos2++;<NEW_LINE>if ((pos1 == length1) || (pos2 == length2)) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>s1 = <MASK><NEW_LINE>s2 = x2.highLowContainer.getKeyAtIndex(pos2);<NEW_LINE>} else if (s1 < s2) {<NEW_LINE>answer.getMappeableRoaringArray().appendCopy(x1.highLowContainer.getKeyAtIndex(pos1), x1.highLowContainer.getContainerAtIndex(pos1));<NEW_LINE>pos1++;<NEW_LINE>if (pos1 == length1) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>s1 = x1.highLowContainer.getKeyAtIndex(pos1);<NEW_LINE>} else {<NEW_LINE>// s1 > s2<NEW_LINE>answer.getMappeableRoaringArray().appendCopy(x2.highLowContainer.getKeyAtIndex(pos2), x2.highLowContainer.getContainerAtIndex(pos2));<NEW_LINE>pos2++;<NEW_LINE>if (pos2 == length2) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>s2 = x2.highLowContainer.getKeyAtIndex(pos2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pos1 == length1) {<NEW_LINE>answer.getMappeableRoaringArray().appendCopy(x2.highLowContainer, pos2, length2);<NEW_LINE>} else if (pos2 == length2) {<NEW_LINE>answer.getMappeableRoaringArray().appendCopy(x1.highLowContainer, pos1, length1);<NEW_LINE>}<NEW_LINE>return answer;<NEW_LINE>} | x1.highLowContainer.getKeyAtIndex(pos1); |
1,490,426 | private void genWorkerReceiveIns(BIRTerminator.WorkerReceive ins, int localVarOffset) {<NEW_LINE>this.mv.visitVarInsn(ALOAD, localVarOffset);<NEW_LINE>if (!ins.isSameStrand) {<NEW_LINE>this.mv.visitFieldInsn(GETFIELD, STRAND_CLASS, "parent", GET_STRAND);<NEW_LINE>}<NEW_LINE>this.mv.visitFieldInsn(GETFIELD, STRAND_CLASS, "wdChannels", GET_WD_CHANNELS);<NEW_LINE>this.mv.visitLdcInsn(ins.workerName.value);<NEW_LINE>this.mv.visitMethodInsn(INVOKEVIRTUAL, WD_CHANNELS, "getWorkerDataChannel", GET_WORKER_DATA_CHANNEL, false);<NEW_LINE>this.mv.visitVarInsn(ALOAD, localVarOffset);<NEW_LINE>this.mv.visitMethodInsn(INVOKEVIRTUAL, WORKER_DATA_CHANNEL, "tryTakeData", TRY_TAKE_DATA, false);<NEW_LINE>BIRNode.BIRVariableDcl tempVar = new BIRNode.BIRVariableDcl(symbolTable.anyType, new Name("wrkMsg"), VarScope.FUNCTION, VarKind.ARG);<NEW_LINE>int wrkResultIndex = this.getJVMIndexOfVarRef(tempVar);<NEW_LINE>this.mv.visitVarInsn(ASTORE, wrkResultIndex);<NEW_LINE>Label jumpAfterReceive = new Label();<NEW_LINE>this.mv.visitVarInsn(ALOAD, wrkResultIndex);<NEW_LINE>this.mv.visitJumpInsn(IFNULL, jumpAfterReceive);<NEW_LINE>Label withinReceiveSuccess = new Label();<NEW_LINE>this.mv.visitLabel(withinReceiveSuccess);<NEW_LINE>this.mv.visitVarInsn(ALOAD, wrkResultIndex);<NEW_LINE>jvmCastGen.addUnboxInsn(this.mv, ins.lhsOp.variableDcl.type);<NEW_LINE>this.storeToVar(ins.lhsOp.variableDcl);<NEW_LINE><MASK><NEW_LINE>} | this.mv.visitLabel(jumpAfterReceive); |
644,424 | private void processStrayInvite(ServerTransaction serverTransaction) {<NEW_LINE>logger.info("got an INVITE for a dead dialog. Rejecting");<NEW_LINE>Request inviteRequest = serverTransaction.getRequest();<NEW_LINE>// Send 481 Call/Transaction Does Not exist<NEW_LINE>Response noSuchCall = null;<NEW_LINE>try {<NEW_LINE>noSuchCall = messageFactory.<MASK><NEW_LINE>} catch (ParseException ex) {<NEW_LINE>logger.error("Error while trying to send a response to an INVITE", ex);<NEW_LINE>}<NEW_LINE>if (noSuchCall != null) {<NEW_LINE>try {<NEW_LINE>serverTransaction.sendResponse(noSuchCall);<NEW_LINE>if (logger.isDebugEnabled())<NEW_LINE>logger.debug("sent response " + noSuchCall);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.error("Failed to reject a stray INVITE with a 481, " + "exception was:\n", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// there's really nothing else for us to do here.<NEW_LINE>} | createResponse(Response.CALL_OR_TRANSACTION_DOES_NOT_EXIST, inviteRequest); |
1,119,033 | void collectAndAggregateAccountStorageStats(Map<Long, Map<Short, Map<Short, ContainerStorageStats>>> hostStorageStatsMap, PartitionId partitionId, List<PartitionId> unreachablePartitions) {<NEW_LINE>Store store = storageManager.getStore(partitionId, false);<NEW_LINE>if (store == null) {<NEW_LINE>unreachablePartitions.add(partitionId);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>long fetchAndAggregatePerStoreStartTimeMs = time.milliseconds();<NEW_LINE>StoreStats storeStats = store.getStoreStats();<NEW_LINE>Map<Short, Map<Short, ContainerStorageStats>> containerStatsMap = storeStats.getContainerStorageStats(time.milliseconds(), publishExcludeAccountIds);<NEW_LINE>hostStorageStatsMap.put(partitionId.getId(), containerStatsMap);<NEW_LINE>metrics.fetchAndAggregateTimePerStoreMs.update(<MASK><NEW_LINE>// update delete tombstone stats<NEW_LINE>updateDeleteTombstoneStats(storeStats);<NEW_LINE>} catch (StoreException e) {<NEW_LINE>unreachablePartitions.add(partitionId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | time.milliseconds() - fetchAndAggregatePerStoreStartTimeMs); |
1,111,772 | public void onEnable() {<NEW_LINE>GeyserLocale.init(this);<NEW_LINE>if (!configDir.exists())<NEW_LINE>configDir.mkdirs();<NEW_LINE>File configFile;<NEW_LINE>try {<NEW_LINE>configFile = FileUtils.fileOrCopiedFromResource(new File(configDir, "config.yml"), "config.yml", (file) -> file.replaceAll("generateduuid", UUID.randomUUID().toString()), this);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.error<MASK><NEW_LINE>ex.printStackTrace();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.geyserConfig = FileUtils.loadConfig(configFile, GeyserSpongeConfiguration.class);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.warn(GeyserLocale.getLocaleStringLog("geyser.config.failed"));<NEW_LINE>ex.printStackTrace();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Sponge.getServer().getBoundAddress().isPresent()) {<NEW_LINE>InetSocketAddress javaAddr = Sponge.getServer().getBoundAddress().get();<NEW_LINE>// Don't change the ip if its listening on all interfaces<NEW_LINE>// By default this should be 127.0.0.1 but may need to be changed in some circumstances<NEW_LINE>if (this.geyserConfig.getRemote().getAddress().equalsIgnoreCase("auto")) {<NEW_LINE>this.geyserConfig.setAutoconfiguredRemote(true);<NEW_LINE>geyserConfig.getRemote().setPort(javaAddr.getPort());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (geyserConfig.getBedrock().isCloneRemotePort()) {<NEW_LINE>geyserConfig.getBedrock().setPort(geyserConfig.getRemote().getPort());<NEW_LINE>}<NEW_LINE>this.geyserLogger = new GeyserSpongeLogger(logger, geyserConfig.isDebugMode());<NEW_LINE>GeyserConfiguration.checkGeyserConfiguration(geyserConfig, geyserLogger);<NEW_LINE>this.geyser = GeyserImpl.start(PlatformType.SPONGE, this);<NEW_LINE>if (geyserConfig.isLegacyPingPassthrough()) {<NEW_LINE>this.geyserSpongePingPassthrough = GeyserLegacyPingPassthrough.init(geyser);<NEW_LINE>} else {<NEW_LINE>this.geyserSpongePingPassthrough = new GeyserSpongePingPassthrough();<NEW_LINE>}<NEW_LINE>this.geyserCommandManager = new GeyserSpongeCommandManager(Sponge.getCommandManager(), geyser);<NEW_LINE>Sponge.getCommandManager().register(this, new GeyserSpongeCommandExecutor(geyser), "geyser");<NEW_LINE>} | (GeyserLocale.getLocaleStringLog("geyser.config.failed")); |
1,035,866 | public static /*<NEW_LINE>int MXImperativeInvokeEx(Pointer creator, int num_inputs, PointerByReference inputs,<NEW_LINE>IntBuffer num_outputs, PointerByReference outputs, int num_params,<NEW_LINE>String param_keys[], String param_vals[],<NEW_LINE>PointerByReference out_stypes);<NEW_LINE><NEW_LINE>int MXNDArraySyncCopyFromCPU(Pointer <MASK><NEW_LINE><NEW_LINE>int MXNDArraySyncCopyFromNDArray(Pointer handle_dst, Pointer handle_src, int i);<NEW_LINE><NEW_LINE>int MXNDArraySyncCheckFormat(Pointer handle, byte full_check);<NEW_LINE><NEW_LINE><NEW_LINE>int MXNDArrayReshape(Pointer handle, int ndim, IntBuffer dims, PointerByReference out);<NEW_LINE><NEW_LINE>int MXNDArrayReshape64(Pointer handle, int ndim, LongBuffer dims, byte reverse,<NEW_LINE>PointerByReference out);<NEW_LINE><NEW_LINE>int MXNDArrayGetData(Pointer handle, PointerByReference out_pdata);<NEW_LINE><NEW_LINE>int MXNDArrayToDLPack(Pointer handle, PointerByReference out_dlpack);<NEW_LINE><NEW_LINE>int MXNDArrayFromDLPack(Pointer dlpack, PointerByReference out_handle);<NEW_LINE><NEW_LINE>int MXNDArrayCallDLPackDeleter(Pointer dlpack);<NEW_LINE><NEW_LINE>int MXNDArrayGetDType(Pointer handle, IntBuffer out_dtype);<NEW_LINE><NEW_LINE>int MXNDArrayGetAuxType(Pointer handle, int i, IntBuffer out_type);<NEW_LINE><NEW_LINE>int MXNDArrayGetAuxNDArray(Pointer handle, int i, PointerByReference out);<NEW_LINE><NEW_LINE>int MXNDArrayGetDataNDArray(Pointer handle, PointerByReference out);<NEW_LINE><NEW_LINE>int MXNDArrayGetContext(Pointer handle, IntBuffer out_dev_type, IntBuffer out_dev_id);<NEW_LINE>*/<NEW_LINE>Pointer detachGradient(Pointer handle) {<NEW_LINE>PointerByReference ref = REFS.acquire();<NEW_LINE>checkCall(LIB.MXNDArrayDetach(handle, ref));<NEW_LINE>Pointer pointer = ref.getValue();<NEW_LINE>REFS.recycle(ref);<NEW_LINE>return pointer;<NEW_LINE>} | handle, Pointer data, NativeSize size); |
806,011 | public BaseFont awtToPdf(Font awtFont) {<NEW_LINE>ourLogger.debug("Searching for BaseFont for awtFont={} charset={} cache={}", awtFont, charset, myFontCache);<NEW_LINE>if (myFontCache.containsKey(awtFont)) {<NEW_LINE>ourLogger.debug("Found in cache.");<NEW_LINE>return myFontCache.get(awtFont);<NEW_LINE>}<NEW_LINE>String family = awtFont.getFamily().toLowerCase();<NEW_LINE>Function<String, BaseFont> f = myMap_Family_ItextFont.get(family);<NEW_LINE>ourLogger.debug("Searching for supplier: family={} size={}", family, awtFont.getSize());<NEW_LINE>if (f != null) {<NEW_LINE>BaseFont result = f.apply(charset);<NEW_LINE>if (result == null) {<NEW_LINE>ourLogger.warn("... failed to find the base font for family={} charset={}", family, charset);<NEW_LINE>} else {<NEW_LINE>ourLogger.debug("... created BaseFont: {}", getInfo(result));<NEW_LINE>myFontCache.put(awtFont, result);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>family = family.replace(' ', '_');<NEW_LINE>if (myProperties.containsKey("font." + family)) {<NEW_LINE>family = String.valueOf(myProperties<MASK><NEW_LINE>}<NEW_LINE>ourLogger.debug("Searching for substitution. Family={}", family);<NEW_LINE>FontSubstitution substitution = substitutions.getSubstitution(family);<NEW_LINE>if (substitution != null) {<NEW_LINE>family = substitution.getSubstitutionFamily();<NEW_LINE>}<NEW_LINE>f = myMap_Family_ItextFont.get(family);<NEW_LINE>ourLogger.debug("substitution family={} supplier={}", family, f);<NEW_LINE>if (f != null) {<NEW_LINE>BaseFont result = f.apply(charset);<NEW_LINE>ourLogger.debug("created base font={}", result);<NEW_LINE>myFontCache.put(awtFont, result);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>BaseFont result = getFallbackFont(charset);<NEW_LINE>ourLogger.debug("so, trying fallback font={}", result);<NEW_LINE>if (result == null) {<NEW_LINE>ourLogger.error("Can't find a PDF font corresponding to AWT font with family={}. " + "Also tried substitution family={} and fallback font. Charset={}", awtFont.getFamily(), family, charset);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | .get("font." + family)); |
504,347 | private List<Throwable> validateInterceptorBindingTarget(AnnotationInstance binding, AnnotationTarget target) {<NEW_LINE>List<Throwable> throwables = new ArrayList<>();<NEW_LINE>switch(target.kind()) {<NEW_LINE>case CLASS:<NEW_LINE>ClassInfo classInfo = target.asClass();<NEW_LINE>if (!INTERCEPTORS.contains(classInfo.name())) {<NEW_LINE>throwables.add(new ClassTargetException(classInfo.name(), binding.name()));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case METHOD:<NEW_LINE>MethodInfo methodInfo = target.asMethod();<NEW_LINE>if (Modifier.isPrivate(methodInfo.flags())) {<NEW_LINE>throwables.add(new PrivateMethodTargetException(methodInfo, binding.name()));<NEW_LINE>}<NEW_LINE>if (CACHE_RESULT.equals(binding.name())) {<NEW_LINE>if (methodInfo.returnType().kind() == Type.Kind.VOID) {<NEW_LINE>throwables.add(new VoidReturnTypeTargetException(methodInfo));<NEW_LINE>} else if (MULTI.equals(methodInfo.returnType().name())) {<NEW_LINE>LOGGER.warnf("@CacheResult is not currently supported on a method returning %s [class=%s, method=%s]", MULTI, methodInfo.declaringClass().name(), methodInfo.name());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// This should never be thrown.<NEW_LINE>throw new DeploymentException(<MASK><NEW_LINE>}<NEW_LINE>return throwables;<NEW_LINE>} | "Unexpected cache interceptor binding target: " + target.kind()); |
1,326,682 | final DeleteBucketAccessKeyResult executeDeleteBucketAccessKey(DeleteBucketAccessKeyRequest deleteBucketAccessKeyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBucketAccessKeyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBucketAccessKeyRequest> request = null;<NEW_LINE>Response<DeleteBucketAccessKeyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBucketAccessKeyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBucketAccessKeyRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBucketAccessKey");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBucketAccessKeyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBucketAccessKeyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail"); |
1,024,374 | public MHRMovement saveMovement() {<NEW_LINE>MHRConcept concept = MHRConcept.getById(Env.getCtx(), getConceptId(), null);<NEW_LINE>MHRMovement movement = new MHRMovement(Env.getCtx(), movementId, null);<NEW_LINE>I_HR_Period payrollPeriod = getPayrollProcess().getHR_Period();<NEW_LINE>movement.setSeqNo(concept.getSeqNo());<NEW_LINE>Optional.ofNullable(getDescription()).ifPresent(description -> movement.setDescription((description.toString())));<NEW_LINE>movement.setHR_Process_ID(getPayrollProcess().getHR_Process_ID());<NEW_LINE>Optional.ofNullable(payrollPeriod).ifPresent(period -> movement.setPeriodNo(period.getPeriodNo()));<NEW_LINE>movement.setC_BPartner_ID(getPartnerId());<NEW_LINE><MASK><NEW_LINE>movement.setHR_Concept_Category_ID(concept.getHR_Concept_Category_ID());<NEW_LINE>if (concept.getColumnType().equals(X_HR_Concept.COLUMNTYPE_Quantity)) {<NEW_LINE>// Quantity<NEW_LINE>Optional.ofNullable(getQuantity()).ifPresent(qty -> movement.setQty((BigDecimal) qty));<NEW_LINE>} else if (concept.getColumnType().equals(X_HR_Concept.COLUMNTYPE_Amount)) {<NEW_LINE>// Amount<NEW_LINE>Optional.ofNullable(getAmount()).ifPresent(amount -> movement.setAmount((BigDecimal) amount));<NEW_LINE>}<NEW_LINE>movement.setTextMsg(getText());<NEW_LINE>movement.setServiceDate(getServiceDate());<NEW_LINE>movement.setValidFrom(getValidFrom());<NEW_LINE>movement.setValidTo(getValidTo());<NEW_LINE>MHREmployee employee = MHREmployee.getActiveEmployee(Env.getCtx(), movement.getC_BPartner_ID(), null);<NEW_LINE>if (employee != null) {<NEW_LINE>MHRPayroll payroll = MHRPayroll.getById(Env.getCtx(), payrollProcess.getHR_Payroll_ID(), null);<NEW_LINE>movement.setAD_Org_ID(employee.getAD_Org_ID());<NEW_LINE>movement.setHR_Department_ID(employee.getHR_Department_ID());<NEW_LINE>movement.setHR_Job_ID(employee.getHR_Job_ID());<NEW_LINE>movement.setHR_SkillType_ID(employee.getHR_SkillType_ID());<NEW_LINE>movement.setC_Activity_ID(employee.getC_Activity_ID() > 0 ? employee.getC_Activity_ID() : employee.getHR_Department().getC_Activity_ID());<NEW_LINE>movement.setHR_Payroll_ID(payrollProcess.getHR_Payroll_ID());<NEW_LINE>movement.setHR_Contract_ID(payroll.getHR_Contract_ID());<NEW_LINE>movement.setHR_Employee_ID(employee.getHR_Employee_ID());<NEW_LINE>movement.setHR_EmployeeType_ID(employee.getHR_EmployeeType_ID());<NEW_LINE>}<NEW_LINE>movement.setIsManual(true);<NEW_LINE>movement.saveEx();<NEW_LINE>// check if user saved an empty record and delete it<NEW_LINE>if ((movement.getAmount() == null || movement.getAmount().equals(Env.ZERO)) && (movement.getQty() == null || movement.getQty().equals(Env.ZERO)) && (movement.getServiceDate() == null) && (movement.getTextMsg() == null || Util.isEmpty(movement.getTextMsg()))) {<NEW_LINE>movement.deleteEx(false);<NEW_LINE>}<NEW_LINE>// Duplicate movement when is saved on first<NEW_LINE>movementId = movement.getHR_Movement_ID();<NEW_LINE>return movement;<NEW_LINE>} | movement.setHR_Concept_ID(getConceptId()); |
1,341,033 | protected Control createDetailsContents(Composite composite) {<NEW_LINE>Composite group = new Composite(composite, SWT.NONE);<NEW_LINE>group.setLayout(new GridLayout(1, true));<NEW_LINE>group.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>Composite previewFrame = new Composite(group, SWT.BORDER);<NEW_LINE>GridData gd = new GridData(GridData.FILL_BOTH);<NEW_LINE>gd.heightHint = 250;<NEW_LINE>previewFrame.setLayoutData(gd);<NEW_LINE>previewFrame.setLayout(new FillLayout());<NEW_LINE>UIServiceSQL serviceSQL = DBWorkbench.getService(UIServiceSQL.class);<NEW_LINE>if (serviceSQL != null) {<NEW_LINE>try {<NEW_LINE>sqlPanel = serviceSQL.createSQLPanel(viewer.getSite(), previewFrame, viewer, UINavigatorMessages.editors_entity_dialog_preview_title, true, "");<NEW_LINE>} catch (Exception e) {<NEW_LINE>DBWorkbench.getPlatformUI().<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>populateSQL();<NEW_LINE>return previewFrame;<NEW_LINE>} | showError("Can't create SQL panel", "Error creating SQL panel", e); |
121,806 | public void add(final Transfer transfer, final TransferBackgroundAction action) {<NEW_LINE>if (collection.size() > preferences.getInteger("queue.size.warn")) {<NEW_LINE>final NSAlert alert = // title<NEW_LINE>NSAlert.// title<NEW_LINE>alert(// message<NEW_LINE>TransferToolbarFactory.TransferToolbarItem.cleanup.label(), // defaultbutton<NEW_LINE>LocaleFactory.localizedString("Remove completed transfers from list."), // alternate button<NEW_LINE>TransferToolbarFactory.TransferToolbarItem.cleanup.label(), // other button<NEW_LINE>LocaleFactory<MASK><NEW_LINE>alert.setShowsSuppressionButton(true);<NEW_LINE>alert.suppressionButton().setTitle(LocaleFactory.localizedString("Don't ask again", "Configuration"));<NEW_LINE>this.alert(alert, new SheetCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void callback(int returncode) {<NEW_LINE>if (alert.suppressionButton().state() == NSCell.NSOnState) {<NEW_LINE>// Never show again.<NEW_LINE>preferences.setProperty("queue.size.warn", Integer.MAX_VALUE);<NEW_LINE>}<NEW_LINE>if (returncode == DEFAULT_OPTION) {<NEW_LINE>clearButtonClicked(null);<NEW_LINE>}<NEW_LINE>add(transfer);<NEW_LINE>background(action);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>this.add(transfer);<NEW_LINE>this.background(action);<NEW_LINE>}<NEW_LINE>} | .localizedString("Cancel"), null); |
1,210,580 | public boolean isObsolete() throws JdiProxyException {<NEW_LINE>checkValid();<NEW_LINE>if (myIsObsolete != ThreeState.UNSURE) {<NEW_LINE>return myIsObsolete.toBoolean();<NEW_LINE>}<NEW_LINE>InvalidStackFrameException error = null;<NEW_LINE>for (int attempt = 0; attempt < 2; attempt++) {<NEW_LINE>try {<NEW_LINE>Method method = getMethod(location());<NEW_LINE>boolean isObsolete = (getVirtualMachine().canRedefineClasses() && (method == null || method.isObsolete()));<NEW_LINE>myIsObsolete = ThreeState.fromBoolean(isObsolete);<NEW_LINE>return isObsolete;<NEW_LINE>} catch (InvalidStackFrameException e) {<NEW_LINE>error = e;<NEW_LINE>clearCaches();<NEW_LINE>} catch (InternalException e) {<NEW_LINE>if (e.errorCode() == JvmtiError.INVALID_METHODID) {<NEW_LINE>myIsObsolete = ThreeState.YES;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new JdiProxyException(<MASK><NEW_LINE>} | error.getMessage(), error); |
930,353 | protected NDList forwardInternal(ParameterStore parameterStore, NDList inputs, boolean training, PairList<String, Object> params) {<NEW_LINE>// TODO refactor the forward to not take ParameterStore<NEW_LINE>if (isTrain != training) {<NEW_LINE>isTrain = training;<NEW_LINE>if (isTrain) {<NEW_LINE>JniUtils.enableTrainingMode(this);<NEW_LINE>} else {<NEW_LINE>JniUtils.enableInferenceMode(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (first) {<NEW_LINE>synchronized (PtSymbolBlock.class) {<NEW_LINE>if (first) {<NEW_LINE>inputDescriptions = new PairList<>();<NEW_LINE>outputDescriptions = new PairList<>();<NEW_LINE>for (NDArray array : inputs) {<NEW_LINE>inputDescriptions.add(array.getName(), array.getShape());<NEW_LINE>}<NEW_LINE>NDList outputs = IValueUtils.forward(this, inputs, training);<NEW_LINE>for (NDArray array : outputs) {<NEW_LINE>outputDescriptions.add(array.getName(<MASK><NEW_LINE>}<NEW_LINE>first = false;<NEW_LINE>return outputs;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return IValueUtils.forward(this, inputs, training);<NEW_LINE>} | ), array.getShape()); |
1,265,360 | private void loadLessThan32IntoYMMOrdered(CompilationResultBuilder crb, AMD64MacroAssembler asm, DataSection.Data xmmTailShuffleMask, Register arr, Register lengthTail, Register tmp, Register vecArray, Register vecTmp1, Register vecTmp2) {<NEW_LINE>// array is between 16 and 31 bytes long, load it into a YMM register via two XMM loads<NEW_LINE>movdqu(asm, XMM, vecTmp1, new AMD64Address(arr));<NEW_LINE>movdqu(asm, XMM, vecArray, new AMD64Address(arr, lengthTail, scale, -XMM.getBytes()));<NEW_LINE>asm.leaq(tmp, (AMD64Address) crb.recordDataSectionReference(xmmTailShuffleMask));<NEW_LINE>asm.negq(lengthTail);<NEW_LINE>// load shuffle mask into a tmp vector, because pshufb doesn't support misaligned<NEW_LINE>// memory parameters<NEW_LINE>movdqu(asm, XMM, vecTmp2, new AMD64Address(tmp, lengthTail, scale, XMM<MASK><NEW_LINE>// shuffle the tail vector such that its content effectively gets right-shifted by<NEW_LINE>// 16 - lengthTail bytes<NEW_LINE>pshufb(asm, XMM, vecArray, vecTmp2);<NEW_LINE>AMD64Assembler.VexRVMIOp.VPERM2I128.emit(asm, vectorSize, vecArray, vecArray, vecTmp1, 0x02);<NEW_LINE>} | .getBytes() * 2)); |
1,365,959 | public BuiltInScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, FunctionAndTypeManager functionAndTypeManager) {<NEW_LINE>DistinctType type = (DistinctType) boundVariables.getTypeVariable("T");<NEW_LINE>if (!type.isOrderable()) {<NEW_LINE>throw new PrestoException(INVALID_ARGUMENTS, format("Type %s does not allow ordering"<MASK><NEW_LINE>}<NEW_LINE>Type baseType = type.getBaseType();<NEW_LINE>FunctionHandle functionHandle = functionAndTypeManager.resolveOperator(BETWEEN, fromTypes(baseType, baseType, baseType));<NEW_LINE>return new BuiltInScalarFunctionImplementation(false, ImmutableList.of(valueTypeArgumentProperty(RETURN_NULL_ON_NULL), valueTypeArgumentProperty(RETURN_NULL_ON_NULL), valueTypeArgumentProperty(RETURN_NULL_ON_NULL)), functionAndTypeManager.getJavaScalarFunctionImplementation(functionHandle).getMethodHandle(), Optional.empty());<NEW_LINE>} | , type.getDisplayName())); |
715,670 | public static ServiceSet fromConfig(MDBConfig mdbConfig, MDBArtifactStoreConfig mdbArtifactStoreConfig) throws IOException {<NEW_LINE>var set = new ServiceSet();<NEW_LINE>set.uac = UAC.FromConfig(mdbConfig);<NEW_LINE>set.authService = MDBAuthServiceUtils.FromConfig(mdbConfig, set.uac);<NEW_LINE>set.mdbRoleService = MDBRoleServiceUtils.FromConfig(mdbConfig, set.authService, set.uac);<NEW_LINE>// Initialize App.java singleton instance<NEW_LINE>set.app = App.getInstance();<NEW_LINE>set.app.mdbConfig = mdbConfig;<NEW_LINE>if (mdbArtifactStoreConfig.isEnabled()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>System.getProperties().put(SCAN_PACKAGES, "dummyPackageName");<NEW_LINE>SpringApplication.run(App.class);<NEW_LINE>}<NEW_LINE>return set;<NEW_LINE>} | set.artifactStoreService = initializeArtifactStore(mdbArtifactStoreConfig); |
245,915 | protected synchronized void initChannelFactory(Class<?> type, ChannelFactory factory, Map<Object, Object> properties) throws ChannelFactoryException {<NEW_LINE>// if no properties were provided, then we must retrieve them from<NEW_LINE>// channelFactoriesProperties using the factory type as the key; if<NEW_LINE>// the properties were provided, make sure that they are in<NEW_LINE>// channelFactoriesProperties for potential future use<NEW_LINE>//<NEW_LINE>ChannelFactoryDataImpl cfd = findOrCreateChannelFactoryData(type);<NEW_LINE>cfd.setChannelFactory(factory);<NEW_LINE>if (properties != null) {<NEW_LINE>cfd.setProperties(properties);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>factory.init(cfd);<NEW_LINE>} catch (ChannelFactoryException ce) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Factory " + factory + " threw ChannelFactoryException " + ce.getMessage());<NEW_LINE>}<NEW_LINE>throw ce;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>FFDCFilter.processException(e, getClass().getName() + ".initChannelFactory", "770", this, new Object[] { factory });<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Factory " + factory + <MASK><NEW_LINE>}<NEW_LINE>throw new ChannelFactoryException(e);<NEW_LINE>}<NEW_LINE>} | " threw non-ChannelFactoryException " + e.getMessage()); |
1,801,668 | public void decorateWithCastForReturn(AExpression userExpressionNode, AStatement parent, SemanticScope semanticScope, ScriptClassInfo scriptClassInfo) {<NEW_LINE>Location location = userExpressionNode.getLocation();<NEW_LINE>Class<?> valueType = semanticScope.getDecoration(userExpressionNode, Decorations.ValueType.class).valueType();<NEW_LINE>Class<?> targetType = semanticScope.getDecoration(userExpressionNode, TargetType.class).targetType();<NEW_LINE>PainlessCast painlessCast;<NEW_LINE>if (valueType == def.class) {<NEW_LINE>if (scriptClassInfo.defConverter != null) {<NEW_LINE>semanticScope.putDecoration(parent, new Decorations.Converter(scriptClassInfo.defConverter));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (LocalFunction converter : scriptClassInfo.converters) {<NEW_LINE>try {<NEW_LINE>painlessCast = AnalyzerCaster.getLegalCast(location, valueType, converter.getTypeParameters().get(0), false, true);<NEW_LINE>if (painlessCast != null) {<NEW_LINE>semanticScope.putDecoration(userExpressionNode, new ExpressionPainlessCast(painlessCast));<NEW_LINE>}<NEW_LINE>semanticScope.putDecoration(parent, new Decorations.Converter(converter));<NEW_LINE>return;<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>// Do nothing, we're checking all converters<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean isExplicitCast = semanticScope.getCondition(userExpressionNode, Decorations.Explicit.class);<NEW_LINE>boolean isInternalCast = semanticScope.getCondition(userExpressionNode, Internal.class);<NEW_LINE>painlessCast = AnalyzerCaster.getLegalCast(location, <MASK><NEW_LINE>if (painlessCast != null) {<NEW_LINE>semanticScope.putDecoration(userExpressionNode, new ExpressionPainlessCast(painlessCast));<NEW_LINE>}<NEW_LINE>} | valueType, targetType, isExplicitCast, isInternalCast); |
1,148,250 | private void addPosItems(Map<Long, List<String>> posIds, long pos, String menuName, String actionName) {<NEW_LINE>for (long i = -10; i <= 10; i++) {<NEW_LINE>String title = String.valueOf(i);<NEW_LINE>switch((int) i) {<NEW_LINE>case -10:<NEW_LINE>title += " (further in front)";<NEW_LINE>break;<NEW_LINE>case 0:<NEW_LINE>title += " (Default)";<NEW_LINE>break;<NEW_LINE>case 10:<NEW_LINE>title += " (further in back)";<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (i != 0 && posIds.containsKey(i)) {<NEW_LINE>List<String> <MASK><NEW_LINE>title += " / " + StringUtil.shortenTo(StringUtil.join(ids, ", "), 30);<NEW_LINE>}<NEW_LINE>addRadioItem(actionName + i, title, actionName, menuName);<NEW_LINE>}<NEW_LINE>JMenuItem tabsPosItem = getItem(actionName + pos);<NEW_LINE>if (tabsPosItem != null) {<NEW_LINE>tabsPosItem.setSelected(true);<NEW_LINE>}<NEW_LINE>} | ids = posIds.get(i); |
1,582,282 | final GetTagsResult executeGetTags(GetTagsRequest getTagsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getTagsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetTagsRequest> request = null;<NEW_LINE>Response<GetTagsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetTagsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTagsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTags");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetTagsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTagsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
722,455 | void checkOperationChains(List<OperationChain> opChains) throws Exception {<NEW_LINE>Map<PartitionId, Integer> <MASK><NEW_LINE>double blobsPut = 0;<NEW_LINE>for (OperationChain opChain : opChains) {<NEW_LINE>if (!opChain.latch.await(AWAIT_TIMEOUT, TimeUnit.SECONDS)) {<NEW_LINE>Assert.fail("Timeout waiting for operation chain " + opChain.chainId + " to finish and it is stuck at " + opChain.opIndex + "the op:" + opChain.currentOpType + " the blob id: " + opChain.blobId);<NEW_LINE>}<NEW_LINE>synchronized (opChain.testFutures) {<NEW_LINE>for (TestFuture testFuture : opChain.testFutures) {<NEW_LINE>testFuture.check();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Assert.assertEquals("opChain stopped in the middle.", 0, opChain.operations.size());<NEW_LINE>if (opChain.blobId != null) {<NEW_LINE>blobsPut++;<NEW_LINE>PartitionId partitionId = new BlobId(opChain.blobId, clusterMap).getPartition();<NEW_LINE>int count = partitionCount.getOrDefault(partitionId, 0);<NEW_LINE>partitionCount.put(partitionId, count + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | partitionCount = new HashMap<>(); |
1,280,764 | private static CodegenExpression makeDeepSupertypes(Set<EventType> deepSuperTypes, CodegenMethodScope parent, ModuleEventTypeInitializeSymbol symbols, CodegenClassScope classScope) {<NEW_LINE>if (deepSuperTypes == null || deepSuperTypes.isEmpty()) {<NEW_LINE>return staticMethod(Collections.class, "emptySet");<NEW_LINE>}<NEW_LINE>if (deepSuperTypes.size() == 1) {<NEW_LINE>return staticMethod(Collections.class, "singleton", EventTypeUtility.resolveTypeCodegen(deepSuperTypes.iterator().next(), symbols.getAddInitSvc(parent)));<NEW_LINE>}<NEW_LINE>CodegenMethod method = parent.makeChild(EPTypePremade.SET.getEPType(<MASK><NEW_LINE>method.getBlock().declareVar(EPTypePremade.SET.getEPType(), "dst", newInstance(EPTypePremade.LINKEDHASHSET.getEPType(), constant(CollectionUtil.capacityHashMap(deepSuperTypes.size()))));<NEW_LINE>for (EventType eventType : deepSuperTypes) {<NEW_LINE>method.getBlock().exprDotMethod(ref("dst"), "add", EventTypeUtility.resolveTypeCodegen(eventType, symbols.getAddInitSvc(method)));<NEW_LINE>}<NEW_LINE>method.getBlock().methodReturn(ref("dst"));<NEW_LINE>return localMethod(method);<NEW_LINE>} | ), CompilerHelperModuleProvider.class, classScope); |
685,241 | public void remove(final String iPoolName) {<NEW_LINE>lock();<NEW_LINE>try {<NEW_LINE>final OReentrantResourcePool<String, DB> pool = pools.remove(iPoolName);<NEW_LINE>if (pool != null) {<NEW_LINE>for (DB db : pool.getResources()) {<NEW_LINE>final OStorage stg = db.getStorage();<NEW_LINE>if (stg != null && stg.getStatus() == OStorage.STATUS.OPEN)<NEW_LINE>try {<NEW_LINE>OLogManager.instance().debug(this, "Closing pooled database '%s'...", db.getName());<NEW_LINE>db.activateOnCurrentThread();<NEW_LINE>((ODatabasePooled) db).forceClose();<NEW_LINE>OLogManager.instance().debug(this, "OK", db.getName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>OLogManager.instance().debug(this, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>pool.close();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>unlock();<NEW_LINE>}<NEW_LINE>} | "Error: %d", e.toString()); |
128,612 | public CodegenMethod make(CodegenMethodScope parent, CodegenClassScope classScope) {<NEW_LINE>int size = filterTypes.size() + arrayEventTypes.size();<NEW_LINE>CodegenMethod method = parent.makeChild(EventBean.EPTYPEARRAY, this.getClass(), classScope).addParam(MatchedEventMap.EPTYPE, "mem");<NEW_LINE>if (size == 0 || (streamsUsedCanNull != null && streamsUsedCanNull.isEmpty())) {<NEW_LINE>method.getBlock().methodReturn(publicConstValue(CollectionUtil.class, "EVENTBEANARRAY_EMPTY"));<NEW_LINE>return method;<NEW_LINE>}<NEW_LINE>int sizeArray = baseStreamIndexOne ? size + 1 : size;<NEW_LINE>method.getBlock().declareVar(EventBean.EPTYPEARRAY, "events", newArrayByLength(EventBean.EPTYPE, constant(sizeArray))).declareVar(EPTypePremade.OBJECTARRAY.getEPType(), "buf", exprDotMethod(ref("mem"), "getMatchingEvents"));<NEW_LINE>int count = 0;<NEW_LINE>for (Map.Entry<String, Pair<EventType, String>> entry : filterTypes.entrySet()) {<NEW_LINE>int indexTag = findTag(<MASK><NEW_LINE>int indexStream = baseStreamIndexOne ? count + 1 : count;<NEW_LINE>if (streamsUsedCanNull == null || streamsUsedCanNull.contains(indexStream)) {<NEW_LINE>method.getBlock().assignArrayElement(ref("events"), constant(indexStream), cast(EventBean.EPTYPE, arrayAtIndex(ref("buf"), constant(indexTag))));<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Pair<EventType, String>> entry : arrayEventTypes.entrySet()) {<NEW_LINE>int indexTag = findTag(allTags, entry.getKey());<NEW_LINE>int indexStream = baseStreamIndexOne ? count + 1 : count;<NEW_LINE>if (streamsUsedCanNull == null || streamsUsedCanNull.contains(indexStream)) {<NEW_LINE>method.getBlock().declareVar(EventBean.EPTYPEARRAY, "arr" + count, cast(EventBean.EPTYPEARRAY, arrayAtIndex(ref("buf"), constant(indexTag)))).declareVar(EPTypePremade.MAP.getEPType(), "map" + count, staticMethod(Collections.class, "singletonMap", constant(entry.getKey()), ref("arr" + count))).assignArrayElement(ref("events"), constant(indexStream), newInstance(MapEventBean.EPTYPE, ref("map" + count), constantNull()));<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>method.getBlock().methodReturn(ref("events"));<NEW_LINE>return method;<NEW_LINE>} | allTags, entry.getKey()); |
728,654 | final DeleteRouteResponseResult executeDeleteRouteResponse(DeleteRouteResponseRequest deleteRouteResponseRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteRouteResponseRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteRouteResponseRequest> request = null;<NEW_LINE>Response<DeleteRouteResponseResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteRouteResponseRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteRouteResponseRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteRouteResponse");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteRouteResponseResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteRouteResponseResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "ApiGatewayV2"); |
413,027 | private Throwable enrichError(final Throwable t) {<NEW_LINE>Throwable throwable;<NEW_LINE>CloseEvent closeReason;<NEW_LINE>if (t instanceof AbortedFirstWriteException) {<NEW_LINE>if ((closeReason = this.closeReason) != null) {<NEW_LINE>throwable = new RetryableClosedChannelException(wrapWithCloseReason(closeReason, t.getCause()));<NEW_LINE>} else if (t.getCause() instanceof RetryableException) {<NEW_LINE>// Unwrap additional layer of RetryableException if the cause is already retryable<NEW_LINE>throwable = t.getCause();<NEW_LINE>} else if (t.getCause() instanceof ClosedChannelException) {<NEW_LINE>throwable = new RetryableClosedChannelException((<MASK><NEW_LINE>} else {<NEW_LINE>throwable = t;<NEW_LINE>}<NEW_LINE>} else if (t instanceof RetryableClosedChannelException) {<NEW_LINE>throwable = t;<NEW_LINE>} else {<NEW_LINE>if ((closeReason = this.closeReason) != null) {<NEW_LINE>throwable = wrapWithCloseReason(closeReason, t);<NEW_LINE>} else {<NEW_LINE>throwable = enrichProtocolError.apply(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>transportError.onSuccess(throwable);<NEW_LINE>return throwable;<NEW_LINE>} | ClosedChannelException) t.getCause()); |
809,421 | public void authorizeSubscriptions(@NotNull final ChannelHandlerContext ctx, @NotNull final SUBSCRIBE msg) {<NEW_LINE>final String clientId = ctx.channel().attr(ChannelAttributes.CLIENT_CONNECTION).get().getClientId();<NEW_LINE>if (clientId == null || !ctx.channel().isActive()) {<NEW_LINE>// no more processing needed<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!authorizers.areAuthorizersAvailable()) {<NEW_LINE>incomingSubscribeService.processSubscribe(ctx, msg, false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Map<String, AuthorizerProvider> providerMap = authorizers.getAuthorizerProviderMap();<NEW_LINE>if (providerMap.isEmpty()) {<NEW_LINE>incomingSubscribeService.processSubscribe(ctx, msg, false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ClientAuthorizers clientAuthorizers = getClientAuthorizers(ctx);<NEW_LINE>final List<ListenableFuture<SubscriptionAuthorizerOutputImpl>> listenableFutures = new ArrayList<>();<NEW_LINE>final AuthorizerProviderInput authorizerProviderInput = new AuthorizerProviderInputImpl(ctx.<MASK><NEW_LINE>// every topic gets its own task per authorizer<NEW_LINE>for (final Topic topic : msg.getTopics()) {<NEW_LINE>final SubscriptionAuthorizerInputImpl input = new SubscriptionAuthorizerInputImpl(UserPropertiesImpl.of(msg.getUserProperties().asList()), topic, ctx.channel(), clientId);<NEW_LINE>final SubscriptionAuthorizerOutputImpl output = new SubscriptionAuthorizerOutputImpl(asyncer);<NEW_LINE>final SettableFuture<SubscriptionAuthorizerOutputImpl> topicProcessedFuture = SettableFuture.create();<NEW_LINE>listenableFutures.add(topicProcessedFuture);<NEW_LINE>final SubscriptionAuthorizerContext context = new SubscriptionAuthorizerContext(clientId, output, topicProcessedFuture, providerMap.size());<NEW_LINE>for (final Map.Entry<String, AuthorizerProvider> entry : providerMap.entrySet()) {<NEW_LINE>final SubscriptionAuthorizerTask task = new SubscriptionAuthorizerTask(entry.getValue(), entry.getKey(), authorizerProviderInput, clientAuthorizers);<NEW_LINE>pluginTaskExecutorService.handlePluginInOutTaskExecution(context, input, output, task);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final AllTopicsProcessedTask allTopicsProcessedTask = new AllTopicsProcessedTask(msg, listenableFutures, ctx, mqttServerDisconnector, incomingSubscribeService);<NEW_LINE>Futures.whenAllComplete(listenableFutures).run(allTopicsProcessedTask, MoreExecutors.directExecutor());<NEW_LINE>} | channel(), serverInformation, clientId); |
1,350,020 | public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {<NEW_LINE>FieldsType ft = cit.getFields();<NEW_LINE>if (ft == null) {<NEW_LINE>ft = new FieldsType();<NEW_LINE>cit.setFields(ft);<NEW_LINE>}<NEW_LINE>final List<FieldInfoType<MASK><NEW_LINE>final FieldInfoType fit = new FieldInfoType();<NEW_LINE>fieldList.add(fit);<NEW_LINE>// Field Name<NEW_LINE>fit.setName(name);<NEW_LINE>if (desc != null) {<NEW_LINE>// Field Type<NEW_LINE>Type type = Type.getType(desc);<NEW_LINE>fit.setType(AsmHelper.normalizeClassName(type.getClassName()));<NEW_LINE>}<NEW_LINE>// Field Modifiers<NEW_LINE>ModifiersType modTypes = new ModifiersType();<NEW_LINE>modTypes.getModifier().addAll(AsmHelper.resolveAsmOpcode(AsmHelper.RoleFilter.FIELD, (access)));<NEW_LINE>fit.setModifiers(modTypes);<NEW_LINE>fit.setIsSynthetic((access & Opcodes.ACC_SYNTHETIC) != 0);<NEW_LINE>return new CAFieldVisitor(fit);<NEW_LINE>} | > fieldList = ft.getField(); |
1,837,277 | public boolean isBetween(Object valueUncast, Object lowerUncast, Object upperUncast) {<NEW_LINE>if ((valueUncast == null) || (lowerUncast == null) || ((upperUncast == null))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>BigDecimal value = numberCoercerValue<MASK><NEW_LINE>BigDecimal lower = numberCoercerLower.coerceBoxedBigDec((Number) lowerUncast);<NEW_LINE>BigDecimal upper = numberCoercerUpper.coerceBoxedBigDec((Number) upperUncast);<NEW_LINE>if (lower.compareTo(upper) > 0) {<NEW_LINE>BigDecimal temp = upper;<NEW_LINE>upper = lower;<NEW_LINE>lower = temp;<NEW_LINE>}<NEW_LINE>int valueComparedLower = value.compareTo(lower);<NEW_LINE>if (valueComparedLower > 0) {<NEW_LINE>int valueComparedUpper = value.compareTo(upper);<NEW_LINE>if (valueComparedUpper < 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return isHighIncluded && valueComparedUpper == 0;<NEW_LINE>}<NEW_LINE>if (isLowIncluded && valueComparedLower == 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .coerceBoxedBigDec((Number) valueUncast); |
1,676,970 | public void prepareData(CodeGenContext context) throws Exception {<NEW_LINE>List<String> exceptions = new ArrayList<>();<NEW_LINE>CSharpCodeGenContext ctx = (CSharpCodeGenContext) context;<NEW_LINE>try {<NEW_LINE>LoggerManager.getInstance().info(String.format("Begin to prepare csharp table data for project %s"<MASK><NEW_LINE>new CSharpDataPreparerOfTableViewSpProcessor().process(ctx);<NEW_LINE>LoggerManager.getInstance().info(String.format("Prepare csharp table data for project %s completed.", ctx.getProjectId()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LoggerManager.getInstance().error(e);<NEW_LINE>exceptions.add(e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>LoggerManager.getInstance().info(String.format("Begin to prepare csharp sqlbuilder data for project %s", ctx.getProjectId()));<NEW_LINE>new CSharpDataPreparerOfSqlBuilderProcessor().process(ctx);<NEW_LINE>LoggerManager.getInstance().info(String.format("Prepare csharp sqlbuilder data for project %s completed.", ctx.getProjectId()));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LoggerManager.getInstance().error(e);<NEW_LINE>exceptions.add(e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>LoggerManager.getInstance().info(String.format("Begin to prepare csharp freesql data for project %s", ctx.getProjectId()));<NEW_LINE>new CSharpDataPreparerOfFreeSqlProcessor().process(ctx);<NEW_LINE>LoggerManager.getInstance().info(String.format("Prepare csharp freesql data for project %s completed.", ctx.getProjectId()));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LoggerManager.getInstance().error(e);<NEW_LINE>exceptions.add(e.getMessage());<NEW_LINE>}<NEW_LINE>if (exceptions.size() > 0) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (String exception : exceptions) {<NEW_LINE>sb.append(exception);<NEW_LINE>}<NEW_LINE>throw new RuntimeException(sb.toString());<NEW_LINE>}<NEW_LINE>} | , ctx.getProjectId())); |
1,186,933 | private AckEvent drillbitUnregistered(DrillbitEndpoint dbe) {<NEW_LINE>String key = toKey(dbe);<NEW_LINE>DrillbitTracker tracker = registry.get(key);<NEW_LINE>assert tracker != null;<NEW_LINE>if (tracker == null) {<NEW_LINE>// Something is terribly wrong.<NEW_LINE>// Have seen this when a user kills the Drillbit just after it starts. Evidently, the<NEW_LINE>// Drillbit registers with ZK just before it is killed, but before DoY hears about<NEW_LINE>// the registration.<NEW_LINE>LOG.error("Internal error - Unexpected drillbit unregistration: " + key);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (tracker.state == DrillbitTracker.State.UNMANAGED) {<NEW_LINE>// Unmanaged drillbit<NEW_LINE>assert tracker.task == null;<NEW_LINE>LOG.info("Unmanaged drillbit unregistered: " + key);<NEW_LINE>registry.remove(key);<NEW_LINE>registryHandler.releaseHost(dbe.getAddress());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>LOG.info("Drillbit unregistered: " + key + ", task: " + <MASK><NEW_LINE>tracker.becomeUnregistered();<NEW_LINE>return new AckEvent(tracker.task, dbe);<NEW_LINE>} | tracker.task.toString()); |
154,959 | // submit the map/reduce job.<NEW_LINE>public int run(final String[] args) throws Exception {<NEW_LINE>if (args.length != 4) {<NEW_LINE>return printUsage();<NEW_LINE>}<NEW_LINE>int ret_val = 0;<NEW_LINE>nreducers = Integer.parseInt(args[0]);<NEW_LINE>Path y_path = new Path(args[1]);<NEW_LINE>Path x_path = new Path(args[2]);<NEW_LINE>double param_a = Double.parseDouble(args[3]);<NEW_LINE>System.out.println("\n-----===[PEGASUS: A Peta-Scale Graph Mining System]===-----\n");<NEW_LINE>System.out.println("[PEGASUS] Computing SaxpyTextoutput. y_path=" + y_path.getName() + ", x_path=" + x_path.getName() + ", a=" + param_a + "\n");<NEW_LINE>final FileSystem fs = FileSystem.get(getConf());<NEW_LINE>Path saxpy_output = new Path("saxpy_output");<NEW_LINE>if (y_path.getName().equals("saxpy_output")) {<NEW_LINE>System.out.println("saxpy(): output path name is same as the input path name: changing the output path name to saxpy_output1");<NEW_LINE>saxpy_output = new Path("saxpy_output1");<NEW_LINE>ret_val = 1;<NEW_LINE>}<NEW_LINE>fs.delete(saxpy_output);<NEW_LINE>JobClient.runJob(configSaxpyTextoutput(y_path, x_path, saxpy_output, param_a));<NEW_LINE>System.out.println("\n[PEGASUS] SaxpyTextoutput computed. Output is saved in HDFS " + <MASK><NEW_LINE>return ret_val;<NEW_LINE>// return value : 1 (output path is saxpy_output1)<NEW_LINE>// 0 (output path is saxpy_output)<NEW_LINE>} | saxpy_output.getName() + "\n"); |
1,271,474 | public void updateWorklogWithNewRemainingEstimate(java.lang.String in0, com.atlassian.jira.rpc.soap.beans.RemoteWorklog in1, java.lang.String in2) throws java.rmi.RemoteException, com.atlassian.jira.rpc.exception.RemotePermissionException, com.atlassian.jira.rpc.exception.RemoteValidationException, com.atlassian.jira.rpc.exception.RemoteException {<NEW_LINE>if (super.cachedEndpoint == null) {<NEW_LINE>throw new org.apache.axis.NoEndPointException();<NEW_LINE>}<NEW_LINE>org.apache.axis.<MASK><NEW_LINE>_call.setOperation(_operations[81]);<NEW_LINE>_call.setUseSOAPAction(true);<NEW_LINE>_call.setSOAPActionURI("");<NEW_LINE>_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);<NEW_LINE>_call.setOperationName(new javax.xml.namespace.QName("http://soap.rpc.jira.atlassian.com", "updateWorklogWithNewRemainingEstimate"));<NEW_LINE>setRequestHeaders(_call);<NEW_LINE>setAttachments(_call);<NEW_LINE>try {<NEW_LINE>java.lang.Object _resp = _call.invoke(new java.lang.Object[] { in0, in1, in2 });<NEW_LINE>if (_resp instanceof java.rmi.RemoteException) {<NEW_LINE>throw (java.rmi.RemoteException) _resp;<NEW_LINE>}<NEW_LINE>extractAttachments(_call);<NEW_LINE>} catch (org.apache.axis.AxisFault axisFaultException) {<NEW_LINE>if (axisFaultException.detail != null) {<NEW_LINE>if (axisFaultException.detail instanceof java.rmi.RemoteException) {<NEW_LINE>throw (java.rmi.RemoteException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>if (axisFaultException.detail instanceof com.atlassian.jira.rpc.exception.RemotePermissionException) {<NEW_LINE>throw (com.atlassian.jira.rpc.exception.RemotePermissionException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>if (axisFaultException.detail instanceof com.atlassian.jira.rpc.exception.RemoteValidationException) {<NEW_LINE>throw (com.atlassian.jira.rpc.exception.RemoteValidationException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>if (axisFaultException.detail instanceof com.atlassian.jira.rpc.exception.RemoteException) {<NEW_LINE>throw (com.atlassian.jira.rpc.exception.RemoteException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw axisFaultException;<NEW_LINE>}<NEW_LINE>} | client.Call _call = createCall(); |
1,156,693 | private void checkStructure() {<NEW_LINE>if (mScene == null) {<NEW_LINE>Log.e(TAG, "CHECK: motion scene not set! set \"app:layoutDescription=\"@xml/file\"");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkStructure(mScene.getStartId(), mScene.getConstraintSet(mScene.getStartId()));<NEW_LINE>SparseIntArray startToEnd = new SparseIntArray();<NEW_LINE>SparseIntArray endToStart = new SparseIntArray();<NEW_LINE>for (MotionScene.Transition definedTransition : mScene.getDefinedTransitions()) {<NEW_LINE>if (definedTransition == mScene.mCurrentTransition) {<NEW_LINE>Log.v(TAG, "CHECK: CURRENT");<NEW_LINE>}<NEW_LINE>checkStructure(definedTransition);<NEW_LINE>int startId = definedTransition.getStartConstraintSetId();<NEW_LINE>int endId = definedTransition.getEndConstraintSetId();<NEW_LINE>String startString = Debug.getName(getContext(), startId);<NEW_LINE>String endString = Debug.getName(getContext(), endId);<NEW_LINE>if (startToEnd.get(startId) == endId) {<NEW_LINE>Log.e(TAG, "CHECK: two transitions with the same start and end " + startString + "->" + endString);<NEW_LINE>}<NEW_LINE>if (endToStart.get(endId) == startId) {<NEW_LINE>Log.e(TAG, <MASK><NEW_LINE>}<NEW_LINE>startToEnd.put(startId, endId);<NEW_LINE>endToStart.put(endId, startId);<NEW_LINE>if (mScene.getConstraintSet(startId) == null) {<NEW_LINE>Log.e(TAG, " no such constraintSetStart " + startString);<NEW_LINE>}<NEW_LINE>if (mScene.getConstraintSet(endId) == null) {<NEW_LINE>Log.e(TAG, " no such constraintSetEnd " + startString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "CHECK: you can't have reverse transitions" + startString + "->" + endString); |
152,493 | public ValidationResult<TransactionInvalidReason> validateForSender(final Transaction transaction, final Account sender, final TransactionValidationParams validationParams) {<NEW_LINE>Wei senderBalance = Account.DEFAULT_BALANCE;<NEW_LINE>long senderNonce = Account.DEFAULT_NONCE;<NEW_LINE>Hash codeHash = Hash.EMPTY;<NEW_LINE>if (sender != null) {<NEW_LINE>senderBalance = sender.getBalance();<NEW_LINE>senderNonce = sender.getNonce();<NEW_LINE>if (sender.getCodeHash() != null)<NEW_LINE>codeHash = sender.getCodeHash();<NEW_LINE>}<NEW_LINE>if (transaction.getUpfrontCost().compareTo(senderBalance) > 0) {<NEW_LINE>return ValidationResult.invalid(TransactionInvalidReason.UPFRONT_COST_EXCEEDS_BALANCE, String.format("transaction up-front cost %s exceeds transaction sender account balance %s", transaction.getUpfrontCost(), senderBalance));<NEW_LINE>}<NEW_LINE>if (transaction.getNonce() < senderNonce) {<NEW_LINE>return ValidationResult.invalid(TransactionInvalidReason.NONCE_TOO_LOW, String.format("transaction nonce %s below sender account nonce %s", transaction.getNonce(), senderNonce));<NEW_LINE>}<NEW_LINE>if (!validationParams.isAllowFutureNonce() && senderNonce != transaction.getNonce()) {<NEW_LINE>return ValidationResult.invalid(TransactionInvalidReason.INCORRECT_NONCE, String.format("transaction nonce %s does not match sender account nonce %s.", transaction.getNonce(), senderNonce));<NEW_LINE>}<NEW_LINE>if (!validationParams.isAllowContractAddressAsSender() && !codeHash.equals(Hash.EMPTY)) {<NEW_LINE>return ValidationResult.invalid(TransactionInvalidReason.TX_SENDER_NOT_AUTHORIZED, String.format("Sender %s has deployed code and so is not authorized to send transactions", transaction.getSender()));<NEW_LINE>}<NEW_LINE>if (!isSenderAllowed(transaction, validationParams)) {<NEW_LINE>return ValidationResult.invalid(TransactionInvalidReason.TX_SENDER_NOT_AUTHORIZED, String.format("Sender %s is not on the Account Allowlist"<MASK><NEW_LINE>}<NEW_LINE>return ValidationResult.valid();<NEW_LINE>} | , transaction.getSender())); |
945,817 | protected void subscribeActual(Subscriber<? super T> s) {<NEW_LINE>Publisher<T>[] array = sources;<NEW_LINE>int n;<NEW_LINE>if (array == null) {<NEW_LINE>array = new Publisher[8];<NEW_LINE>n = 0;<NEW_LINE>try {<NEW_LINE>for (Publisher<T> p : sourcesIterable) {<NEW_LINE>if (n == array.length) {<NEW_LINE>array = Arrays.copyOf(array, n << 1);<NEW_LINE>}<NEW_LINE>array[n++] = <MASK><NEW_LINE>}<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>Exceptions.throwIfFatal(ex);<NEW_LINE>EmptySubscription.error(ex, s);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>n = array.length;<NEW_LINE>}<NEW_LINE>if (n == 0) {<NEW_LINE>EmptySubscription.complete(s);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (n == 1) {<NEW_LINE>array[0].subscribe(s);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BasicMergeSubscription<T> parent = new BasicMergeSubscription<>(s, comparator, n, prefetch, delayErrors);<NEW_LINE>s.onSubscribe(parent);<NEW_LINE>parent.subscribe(array, n);<NEW_LINE>} | Objects.requireNonNull(p, "a source is null"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.