idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,660,750
private boolean authenticationWasSuccessful(final HttpServletRequest request, final HttpServletResponse response) throws IOException {<NEW_LINE>final String origin = URIUtil.getName(String.valueOf(request.getRequestURL()));<NEW_LINE>final String code = request.getParameter("code");<NEW_LINE>final String idToken = request.getParameter("id_token");<NEW_LINE>final String accessToken = request.getParameter("access_token");<NEW_LINE>final String signedRequest = request.getParameter("signed_request");<NEW_LINE>final String redirectUrl = request.getRequestURL().toString();<NEW_LINE>final ExternalOAuthCodeToken codeToken = new ExternalOAuthCodeToken(code, origin, redirectUrl, idToken, accessToken, signedRequest, new UaaAuthenticationDetails(request));<NEW_LINE>try {<NEW_LINE>final Authentication <MASK><NEW_LINE>SecurityContextHolder.getContext().setAuthentication(authentication);<NEW_LINE>ofNullable(successHandler).ifPresent(handler -> handler.setSavedAccountOptionCookie(request, response, authentication));<NEW_LINE>// TODO: :eyes_narrowed:<NEW_LINE>// should be an instance of AuthenticationException<NEW_LINE>// but can we trust it?<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.error("ExternalOAuth Authentication exception", ex);<NEW_LINE>String message = ex.getMessage();<NEW_LINE>if (!hasText(message)) {<NEW_LINE>message = ex.getClass().getSimpleName();<NEW_LINE>}<NEW_LINE>final String errorMessage = String.format("There was an error when authenticating against the external identity provider: %s", message);<NEW_LINE>request.getSession().setAttribute("oauth_error", errorMessage);<NEW_LINE>response.sendRedirect(request.getContextPath() + "/oauth_error");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
authentication = externalOAuthAuthenticationManager.authenticate(codeToken);
732,324
public boolean cloneVeeamJob(final Job parentJob, final String clonedJobName) {<NEW_LINE>LOG.debug("Trying to clone veeam job: " + parentJob.getUid() + " with backup uuid: " + clonedJobName);<NEW_LINE>try {<NEW_LINE>final Ref repositoryRef = listBackupRepository(parentJob.getBackupServerId(), parentJob.getName());<NEW_LINE>if (repositoryRef == null) {<NEW_LINE>throw new CloudRuntimeException(String.format("Failed to clone backup job because couldn't find any " + "repository associated with backup job [id: %s, uid: %s, backupServerId: %s, name: %s].", parentJob.getId(), parentJob.getUid(), parentJob.getBackupServerId(), parentJob.getName()));<NEW_LINE>}<NEW_LINE>final BackupJobCloneInfo cloneInfo = new BackupJobCloneInfo();<NEW_LINE>cloneInfo.setJobName(clonedJobName);<NEW_LINE>cloneInfo.setFolderName(clonedJobName);<NEW_LINE>cloneInfo.setRepositoryUid(repositoryRef.getUid());<NEW_LINE>final <MASK><NEW_LINE>final HttpResponse response = post(String.format("/jobs/%s?action=clone", parentJob.getId()), cloneSpec);<NEW_LINE>return checkTaskStatus(response);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOG.warn("Exception caught while trying to clone Veeam job:", e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
JobCloneSpec cloneSpec = new JobCloneSpec(cloneInfo);
1,739,281
public static void logCert(@NonNull X509Certificate x509Certificate, CharSequence charSequence) throws CertificateEncodingException {<NEW_LINE>int bitLength;<NEW_LINE>Principal subjectDN = x509Certificate.getSubjectDN();<NEW_LINE>Log.i(TAG, charSequence + " - Unique distinguished name: " + subjectDN);<NEW_LINE>logEncoded(charSequence, x509Certificate.getEncoded());<NEW_LINE>PublicKey publicKey = x509Certificate.getPublicKey();<NEW_LINE>if (publicKey instanceof RSAKey) {<NEW_LINE>bitLength = ((RSAKey) publicKey)<MASK><NEW_LINE>} else if (publicKey instanceof ECKey) {<NEW_LINE>bitLength = ((ECKey) publicKey).getParams().getOrder().bitLength();<NEW_LINE>} else if (publicKey instanceof DSAKey) {<NEW_LINE>DSAParams params = ((DSAKey) publicKey).getParams();<NEW_LINE>if (params != null) {<NEW_LINE>bitLength = params.getP().bitLength();<NEW_LINE>} else<NEW_LINE>bitLength = -1;<NEW_LINE>} else {<NEW_LINE>bitLength = -1;<NEW_LINE>}<NEW_LINE>Log.i(TAG, charSequence + " - key size: " + (bitLength != -1 ? String.valueOf(bitLength) : "Unknown"));<NEW_LINE>String algorithm = publicKey.getAlgorithm();<NEW_LINE>Log.i(TAG, charSequence + " - key algorithm: " + algorithm);<NEW_LINE>logEncoded(charSequence, publicKey.getEncoded());<NEW_LINE>}
.getModulus().bitLength();
1,841,051
// TODO always validate on construction, then make this method private<NEW_LINE>public Candidate validateNonStockCandidate() {<NEW_LINE>switch(type) {<NEW_LINE>case DEMAND:<NEW_LINE>case STOCK_UP:<NEW_LINE>Check.errorIf(businessCaseDetail == null, "If type={}, then the given businessCaseDetail may not be null; this={}", type, this);<NEW_LINE>break;<NEW_LINE>// supply candidates can be created without businessCaseDetail if the request was made but no response from the planner came in yet<NEW_LINE>case SUPPLY:<NEW_LINE>case INVENTORY_UP:<NEW_LINE>case INVENTORY_DOWN:<NEW_LINE>break;<NEW_LINE>case UNEXPECTED_INCREASE:<NEW_LINE>case UNEXPECTED_DECREASE:<NEW_LINE>Check.errorIf(transactionDetails == null || transactionDetails.isEmpty(), "If type={}, then the given transactionDetails may not be null or empty; this={}", type, this);<NEW_LINE>break;<NEW_LINE>case ATTRIBUTES_CHANGED_FROM:<NEW_LINE>case ATTRIBUTES_CHANGED_TO:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>Check.errorIf(true, "Unexpected candidateType={}; this={}", type, this);<NEW_LINE>}<NEW_LINE>for (final TransactionDetail transactionDetail : transactionDetails) {<NEW_LINE>Check.errorIf(!transactionDetail.isComplete(), "Every element from the given parameter transactionDetails needs to have iscomplete==true; transactionDetail={}; this={}", transactionDetail, this);<NEW_LINE>}<NEW_LINE>Check.errorIf((businessCase == null) != (businessCaseDetail == null), <MASK><NEW_LINE>Check.errorIf(businessCase != null && !businessCase.getDetailClass().isAssignableFrom(businessCaseDetail.getClass()), "The given paramters businessCase and businessCaseDetail don't match; businessCase={}; businessCaseDetail={}; this={}", businessCase, businessCaseDetail, this);<NEW_LINE>return this;<NEW_LINE>}
"The given paramters businessCase and businessCaseDetail need to be both null or both not-null; businessCase={}; businessCaseDetail={}; this={}", businessCase, businessCaseDetail, this);
1,165,658
private static void transcodePicture(ByteBuffer inBuf, ByteBuffer outBuf, FrameHeader fh) {<NEW_LINE>PictureHeader ph = ProresDecoder.readPictureHeader(inBuf);<NEW_LINE>ProresEncoder.writePictureHeader(ph.log2SliceMbWidth, ph.sliceSizes.length, outBuf);<NEW_LINE>ByteBuffer fork = outBuf.duplicate();<NEW_LINE>outBuf.position(outBuf.position() + (ph.sliceSizes.length << 1));<NEW_LINE>int mbWidth = (fh.width + 15) >> 4;<NEW_LINE><MASK><NEW_LINE>int mbX = 0;<NEW_LINE>for (int i = 0; i < ph.sliceSizes.length; i++) {<NEW_LINE>while (mbWidth - mbX < sliceMbCount) sliceMbCount >>= 1;<NEW_LINE>int savedPoint = outBuf.position();<NEW_LINE>transcodeSlice(inBuf, outBuf, sliceMbCount, ph.sliceSizes[i], fh);<NEW_LINE>fork.putShort((short) (outBuf.position() - savedPoint));<NEW_LINE>mbX += sliceMbCount;<NEW_LINE>if (mbX == mbWidth) {<NEW_LINE>sliceMbCount = 1 << ph.log2SliceMbWidth;<NEW_LINE>mbX = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int sliceMbCount = 1 << ph.log2SliceMbWidth;
1,569,144
public static int deserializeInt(final JsonReader reader) throws IOException {<NEW_LINE>if (reader.last() == '"') {<NEW_LINE>final int position = reader.getCurrentIndex();<NEW_LINE>final char[] buf = reader.readSimpleQuote();<NEW_LINE>try {<NEW_LINE>return parseNumberGeneric(buf, reader.getCurrentIndex() - position - 1, <MASK><NEW_LINE>} catch (ArithmeticException ignore) {<NEW_LINE>throw reader.newParseErrorAt("Integer overflow detected", reader.getCurrentIndex() - position);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int start = reader.scanNumber();<NEW_LINE>final int end = reader.getCurrentIndex();<NEW_LINE>final byte[] buf = reader.buffer;<NEW_LINE>final byte ch = buf[start];<NEW_LINE>if (ch == '-') {<NEW_LINE>if (end > start + 2 && buf[start + 1] == '0' && buf[start + 2] >= '0' && buf[start + 2] <= '9') {<NEW_LINE>numberException(reader, start, end, "Leading zero is not allowed");<NEW_LINE>}<NEW_LINE>return parseNegativeInt(buf, reader, start, end);<NEW_LINE>} else {<NEW_LINE>if (ch == '0' && end > start + 1 && buf[start + 1] >= '0' && buf[start + 1] <= '9') {<NEW_LINE>numberException(reader, start, end, "Leading zero is not allowed");<NEW_LINE>}<NEW_LINE>return parsePositiveInt(buf, reader, start, end, 0);<NEW_LINE>}<NEW_LINE>}
reader, true).intValueExact();
398,031
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException {<NEW_LINE>String[] configParts = bindingConfig.trim().split(":");<NEW_LINE>if (configParts.length != 2) {<NEW_LINE>throw new BindingConfigParseException("Omnilink configuration must contain of two parts separated by a ':'");<NEW_LINE>}<NEW_LINE>OmniLinkItemType type = OmniLinkItemType.getOmniLinkItemType(configParts[0]);<NEW_LINE>if (type == null) {<NEW_LINE>throw new BindingConfigParseException("Unknown item type " + configParts[0]);<NEW_LINE>}<NEW_LINE>int number = Integer.parseInt(configParts[1]);<NEW_LINE>OmniLinkBindingConfig config = new OmniLinkBindingConfig(type, number);<NEW_LINE>logger.debug(" Adding item {} {}", new Object[] { config.getObjectType()<MASK><NEW_LINE>addBindingConfig(item, config);<NEW_LINE>super.processBindingConfiguration(context, item, bindingConfig);<NEW_LINE>}
, config.getNumber() });
1,783,718
public void writeAdditionalFiles(GoSettings settings, Model model, SymbolProvider symbolProvider, GoDelegator goDelegator) {<NEW_LINE>ServiceTrait serviceTrait = settings.getService(model).expectTrait(ServiceTrait.class);<NEW_LINE>String serviceId = serviceTrait.getSdkId().replace("-", "").replace(" ", "").toLowerCase();<NEW_LINE>goDelegator.useShapeWriter(settings.getService(model), writer -> {<NEW_LINE>writer.openBlock("func $L(stack $P) error {", "}", MIDDLEWARE_RESOLVER, SymbolUtils.createPointableSymbolBuilder("Stack", SmithyGoDependency.SMITHY_MIDDLEWARE).build(), () -> {<NEW_LINE>writer.write("return $T($T, $S, $T)(stack)", SymbolUtils.createValueSymbolBuilder("AddSDKAgentKeyValue", AwsGoDependency.AWS_MIDDLEWARE).build(), SymbolUtils.createValueSymbolBuilder("APIMetadata", AwsGoDependency.AWS_MIDDLEWARE).build(), serviceId, SymbolUtils.createValueSymbolBuilder<MASK><NEW_LINE>});<NEW_LINE>writer.write("");<NEW_LINE>});<NEW_LINE>}
("goModuleVersion").build());
133,327
private void readFile() throws IOException {<NEW_LINE>// clear all data first, if file is gone so are all creds<NEW_LINE>credentials.clear();<NEW_LINE>tags.clear();<NEW_LINE>if (!credFile.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(credFile), StandardCharsets.UTF_8))) {<NEW_LINE>String str;<NEW_LINE>while ((str = in.readLine()) != null) {<NEW_LINE>str = str.trim();<NEW_LINE>if (StringUtils.isEmpty(str) || str.startsWith("#")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String[] s = str.split("\\s*=\\s*", 2);<NEW_LINE>if (s.length < 2) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String[] s1 = s[0].split("\\.", 2);<NEW_LINE>String[] s2 = s[1].split(",", 2);<NEW_LINE>if (s2.length < 2) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// s2[0] == usr s2[1] == pwd s1[0] == owner s1[1] == tag<NEW_LINE>String tag = "";<NEW_LINE>if (s1.length > 1) {<NEW_LINE>// there is a tag here<NEW_LINE>tag = s1[1];<NEW_LINE>// we have a reverse map here for owner+user -> tags<NEW_LINE>MultiKey tkey = new MultiKey(s1[0], s2[0]);<NEW_LINE>tags.put(tkey, tag);<NEW_LINE>}<NEW_LINE>MultiKey key = new MultiKey(s1[0], tag);<NEW_LINE>Credential val = new Credential();<NEW_LINE><MASK><NEW_LINE>val.password = s2[1];<NEW_LINE>ArrayList<Credential> old = credentials.get(key);<NEW_LINE>if (old == null) {<NEW_LINE>old = new ArrayList<>();<NEW_LINE>}<NEW_LINE>old.add(val);<NEW_LINE>credentials.put(key, old);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
val.username = s2[0];
500,533
public void startup() throws Exception {<NEW_LINE>super.startup();<NEW_LINE>// TODO: pronunciation model tree and feature definition should be voice-specific<NEW_LINE>// get featureDefinition used for trees - just to tell the tree that the<NEW_LINE>// features are discrete<NEW_LINE>String fdFilename = null;<NEW_LINE>if (getLocale() != null) {<NEW_LINE>fdFilename = MaryProperties.getFilename(MaryProperties.localePrefix<MASK><NEW_LINE>}<NEW_LINE>if (fdFilename != null) {<NEW_LINE>File fdFile = new File(fdFilename);<NEW_LINE>// reader for file, readweights = false<NEW_LINE>featDef = new FeatureDefinition(new BufferedReader(new FileReader(fdFile)), false);<NEW_LINE>// get path where the prediction trees lie<NEW_LINE>File treePath = new File(MaryProperties.needFilename(MaryProperties.localePrefix(getLocale()) + ".pronunciation.treepath"));<NEW_LINE>// valid predicion tree files are named prediction_<phone_symbol>.tree<NEW_LINE>Pattern treeFilePattern = Pattern.compile("^prediction_(.*)\\.tree$");<NEW_LINE>// initialize the map that contains the trees<NEW_LINE>this.treeMap = new HashMap<String, StringPredictionTree>();<NEW_LINE>// iterate through potential prediction tree files<NEW_LINE>File[] fileArray = treePath.listFiles();<NEW_LINE>for (int fileIndex = 0; fileIndex < fileArray.length; fileIndex++) {<NEW_LINE>File f = fileArray[fileIndex];<NEW_LINE>// is file name valid?<NEW_LINE>Matcher filePatternMatcher = treeFilePattern.matcher(f.getName());<NEW_LINE>if (filePatternMatcher.matches()) {<NEW_LINE>// phone of file name is a group in the regex<NEW_LINE>String phoneId = filePatternMatcher.group(1);<NEW_LINE>// construct tree from file and map phone to it<NEW_LINE>StringPredictionTree predictionTree = new StringPredictionTree(new BufferedReader(new FileReader(f)), featDef);<NEW_LINE>// back mapping from short id<NEW_LINE>int index = this.featDef.getFeatureIndex("phone");<NEW_LINE>this.treeMap.put(this.featDef.getFeatureValueAsString(index, Short.parseShort(phoneId)), predictionTree);<NEW_LINE>// logger.debug("Read in tree for " + PhoneNameConverter.normForm2phone(phone));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.debug("Reading in feature definition and decision trees finished.");<NEW_LINE>// TODO: change property name to german.pronunciation.featuremanager/features<NEW_LINE>String managerClass = MaryProperties.needProperty(MaryProperties.localePrefix(getLocale()) + ".pronunciation.targetfeaturelister.featuremanager");<NEW_LINE>FeatureProcessorManager manager = (FeatureProcessorManager) Class.forName(managerClass).getDeclaredConstructor().newInstance();<NEW_LINE>String features = MaryProperties.needProperty(MaryProperties.localePrefix(getLocale()) + ".pronunciation.targetfeaturelister.features");<NEW_LINE>this.featureComputer = new TargetFeatureComputer(manager, features);<NEW_LINE>}<NEW_LINE>logger.debug("Building feature computer finished.");<NEW_LINE>}
(getLocale()) + ".pronunciation.featuredefinition");
1,081,549
public static void main(String[] args) {<NEW_LINE>String calibDir = UtilIO.pathExample("calibration/mono/Sony_DSC-HX5V_Chess/");<NEW_LINE>String imageDir = UtilIO.pathExample("structure/");<NEW_LINE>// load calibration parameters from the previously calibrated camera<NEW_LINE>CameraPinholeBrown param = CalibrationIO.load(new File(calibDir, "intrinsic.yaml"));<NEW_LINE>// Specify a transform that has no lens distortion that you wish to re-render the image as having<NEW_LINE>CameraPinhole desired = new CameraPinhole(param);<NEW_LINE>// load images and convert the image into a color BoofCV format<NEW_LINE>BufferedImage orig = UtilImageIO.loadImage(imageDir, "dist_cyto_01.jpg");<NEW_LINE>Planar<GrayF32> distortedImg = ConvertBufferedImage.convertFromPlanar(orig, null, true, GrayF32.class);<NEW_LINE>int numBands = distortedImg.getNumBands();<NEW_LINE>// create new transforms which optimize view area in different ways.<NEW_LINE>// EXPAND makes sure there are no black outside of image pixels inside the image<NEW_LINE>// FULL_VIEW will include the entire original image<NEW_LINE>// The border is VALUE, which defaults to black, just so you can see it<NEW_LINE>ImageDistort allInside = LensDistortionOps.changeCameraModel(AdjustmentType.EXPAND, BorderType.ZERO, param, desired, null, ImageType.pl(numBands, GrayF32.class));<NEW_LINE>ImageDistort fullView = LensDistortionOps.changeCameraModel(AdjustmentType.FULL_VIEW, BorderType.ZERO, param, desired, null, ImageType.pl(numBands, GrayF32.class));<NEW_LINE>// NOTE: After lens distortion has been removed the intrinsic parameters is changed. If you pass<NEW_LINE>// in a set of IntrinsicParameters to the 4th variable it will save it there.<NEW_LINE>// NOTE: Type information was stripped from ImageDistort simply because it becomes too verbose with it here.<NEW_LINE>// Would be nice if this verbosity issue was addressed by the Java language.<NEW_LINE>// render and display the different types of views in a window<NEW_LINE>displayResults(<MASK><NEW_LINE>}
orig, distortedImg, allInside, fullView);
731,296
public boolean result(final Object iRecord) {<NEW_LINE>final ONetworkProtocolBinary protocol = ((ONetworkProtocolBinary) connection.getProtocol());<NEW_LINE>if (empty.compareAndSet(true, false))<NEW_LINE>try {<NEW_LINE>protocol.channel.writeByte(OChannelBinaryProtocol.RESPONSE_STATUS_OK);<NEW_LINE>protocol.channel.writeInt(protocol.clientTxId);<NEW_LINE>protocol.okSent = true;<NEW_LINE>if (connection != null && Boolean.TRUE.equals(connection.getTokenBased()) && connection.getToken() != null && protocol.requestType != OChannelBinaryProtocol.REQUEST_CONNECT && protocol.requestType != OChannelBinaryProtocol.REQUEST_DB_OPEN) {<NEW_LINE>// TODO: Check if the token is expiring and if it is send a new token<NEW_LINE>byte[] renewedToken = protocol.getServer().getTokenHandler().renewIfNeeded(connection.getToken());<NEW_LINE>protocol.channel.writeBytes(renewedToken);<NEW_LINE>}<NEW_LINE>} catch (IOException ignored) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fetchRecord(iRecord, new ORemoteFetchListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void sendRecord(ORecord iLinked) {<NEW_LINE>if (!alreadySent.contains(iLinked.getIdentity())) {<NEW_LINE>alreadySent.add(iLinked.getIdentity());<NEW_LINE>try {<NEW_LINE>// CACHE IT ON THE CLIENT<NEW_LINE>protocol.channel.writeByte((byte) 2);<NEW_LINE>protocol.writeIdentifiable(protocol.channel, connection, iLinked);<NEW_LINE>} catch (IOException e) {<NEW_LINE>OLogManager.instance().<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>alreadySent.add(((OIdentifiable) iRecord).getIdentity());<NEW_LINE>// ONE MORE RECORD<NEW_LINE>protocol.channel.writeByte((byte) 1);<NEW_LINE>protocol.writeIdentifiable(protocol.channel, connection, ((OIdentifiable) iRecord).getRecord());<NEW_LINE>protocol.channel.flush();<NEW_LINE>} catch (IOException e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
error(this, "Cannot write against channel", e);
1,549,243
private Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync(String resourceGroupName, String serviceName, String serviceRegistryName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serviceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serviceRegistryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serviceRegistryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serviceName, serviceRegistryName, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
1,828,763
private void createDefaultTreeActions() {<NEW_LINE>final EditableTreeModel model = (EditableTreeModel) myTree.getModel();<NEW_LINE>myAddAction = button -> {<NEW_LINE>final TreePath path = myTree.getSelectionPath();<NEW_LINE>final DefaultMutableTreeNode selected = path == null ? (DefaultMutableTreeNode) myTree.getModel().getRoot() : (DefaultMutableTreeNode) path.getLastPathComponent();<NEW_LINE>final Object selectedNode = selected.getUserObject();<NEW_LINE>myTree.stopEditing();<NEW_LINE>Object element;<NEW_LINE>if (model instanceof DefaultTreeModel && myProducer != null) {<NEW_LINE>element = myProducer.createElement();<NEW_LINE>if (element == null)<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>element = null;<NEW_LINE>}<NEW_LINE>DefaultMutableTreeNode parent = selected;<NEW_LINE>if ((selectedNode instanceof SimpleNode && ((SimpleNode) selectedNode).isAlwaysLeaf()) || !selected.getAllowsChildren()) {<NEW_LINE>parent = (DefaultMutableTreeNode) selected.getParent();<NEW_LINE>}<NEW_LINE>if (parent != null) {<NEW_LINE>parent.insert(new DefaultMutableTreeNode(element<MASK><NEW_LINE>}<NEW_LINE>final TreePath createdPath = model.addNode(new TreePath(parent.getPath()));<NEW_LINE>if (path != null) {<NEW_LINE>TreeUtil.selectPath(myTree, createdPath);<NEW_LINE>IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(myTree);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>myRemoveAction = button -> {<NEW_LINE>myTree.stopEditing();<NEW_LINE>final TreePath path = myTree.getSelectionPath();<NEW_LINE>model.removeNode(path);<NEW_LINE>};<NEW_LINE>}
), parent.getChildCount());
685,081
private static void processTestCase(GeneralTestEventsProcessor processor, BlazeTestEventsHandler eventsHandler, Label label, @Nullable Kind kind, TestSuite parent, TestCase test) {<NEW_LINE>if (test.name == null || !wasRun(test) || isCancelled(test)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String displayName = eventsHandler.testDisplayName(label, kind, test.name);<NEW_LINE>String locationUrl = eventsHandler.testLocationUrl(label, kind, parent.name, test.name, test.classname);<NEW_LINE>processor.onTestStarted(new TestStartedEvent(displayName, locationUrl));<NEW_LINE>if (test.sysOut != null) {<NEW_LINE>processor.onTestOutput(new TestOutputEvent(displayName<MASK><NEW_LINE>}<NEW_LINE>if (test.sysErr != null) {<NEW_LINE>processor.onTestOutput(new TestOutputEvent(displayName, test.sysErr, true));<NEW_LINE>}<NEW_LINE>if (isIgnored(test)) {<NEW_LINE>ErrorOrFailureOrSkipped err = test.skipped != null ? test.skipped : NO_ERROR;<NEW_LINE>String message = err.message == null ? "" : err.message;<NEW_LINE>processor.onTestIgnored(new TestIgnoredEvent(displayName, message, BlazeXmlSchema.getErrorContent(err)));<NEW_LINE>} else if (isFailed(test)) {<NEW_LINE>List<ErrorOrFailureOrSkipped> errors = !test.failures.isEmpty() ? test.failures : !test.errors.isEmpty() ? test.errors : ImmutableList.of(NO_ERROR);<NEW_LINE>for (ErrorOrFailureOrSkipped err : errors) {<NEW_LINE>processor.onTestFailure(getTestFailedEvent(displayName, err, parseTimeMillis(test.time)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>processor.onTestFinished(new TestFinishedEvent(displayName, parseTimeMillis(test.time)));<NEW_LINE>}
, test.sysOut, true));
1,714,182
public static CreateNatGatewayResponse unmarshall(CreateNatGatewayResponse createNatGatewayResponse, UnmarshallerContext _ctx) {<NEW_LINE>createNatGatewayResponse.setRequestId(_ctx.stringValue("CreateNatGatewayResponse.RequestId"));<NEW_LINE>createNatGatewayResponse.setNatGatewayId<MASK><NEW_LINE>List<String> forwardTableIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateNatGatewayResponse.ForwardTableIds.Length"); i++) {<NEW_LINE>forwardTableIds.add(_ctx.stringValue("CreateNatGatewayResponse.ForwardTableIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>createNatGatewayResponse.setForwardTableIds(forwardTableIds);<NEW_LINE>List<String> bandwidthPackageIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateNatGatewayResponse.BandwidthPackageIds.Length"); i++) {<NEW_LINE>bandwidthPackageIds.add(_ctx.stringValue("CreateNatGatewayResponse.BandwidthPackageIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>createNatGatewayResponse.setBandwidthPackageIds(bandwidthPackageIds);<NEW_LINE>return createNatGatewayResponse;<NEW_LINE>}
(_ctx.stringValue("CreateNatGatewayResponse.NatGatewayId"));
939,728
public void checkForHeaderPost(View view) {<NEW_LINE>ANRequest.PostRequestBuilder postRequestBuilder = AndroidNetworking.post(ApiEndPoint.BASE_URL + ApiEndPoint.CHECK_FOR_HEADER);<NEW_LINE>postRequestBuilder.addHeaders("token", "1234");<NEW_LINE>ANRequest anRequest = postRequestBuilder.setTag(this).setPriority(Priority.LOW).setExecutor(Executors.newSingleThreadExecutor()).build();<NEW_LINE>anRequest.setAnalyticsListener(new AnalyticsListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceived(long timeTakenInMillis, long bytesSent, long bytesReceived, boolean isFromCache) {<NEW_LINE>Log.d(TAG, " timeTakenInMillis : " + timeTakenInMillis);<NEW_LINE>Log.<MASK><NEW_LINE>Log.d(TAG, " bytesReceived : " + bytesReceived);<NEW_LINE>Log.d(TAG, " isFromCache : " + isFromCache);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>anRequest.getAsJSONObject(new JSONObjectRequestListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(JSONObject response) {<NEW_LINE>Log.d(TAG, "onResponse object : " + response.toString());<NEW_LINE>Log.d(TAG, "onResponse isMainThread : " + String.valueOf(Looper.myLooper() == Looper.getMainLooper()));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(ANError error) {<NEW_LINE>if (error.getErrorCode() != 0) {<NEW_LINE>// received ANError from server<NEW_LINE>// error.getErrorCode() - the ANError code from server<NEW_LINE>// error.getErrorBody() - the ANError body from server<NEW_LINE>// error.getErrorDetail() - just a ANError detail<NEW_LINE>Log.d(TAG, "onError errorCode : " + error.getErrorCode());<NEW_LINE>Log.d(TAG, "onError errorBody : " + error.getErrorBody());<NEW_LINE>Log.d(TAG, "onError errorDetail : " + error.getErrorDetail());<NEW_LINE>} else {<NEW_LINE>// error.getErrorDetail() : connectionError, parseError, requestCancelledError<NEW_LINE>Log.d(TAG, "onError errorDetail : " + error.getErrorDetail());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
d(TAG, " bytesSent : " + bytesSent);
1,318,581
private static int parseType(byte[] buf, int pp, int pt) {<NEW_LINE>int p = pp + pt;<NEW_LINE>int chunkType = readLe16(buf, p);<NEW_LINE>int headerSize = readLe16(buf, p + 2);<NEW_LINE>int chunkSize = readLe32(buf, p + 4);<NEW_LINE>if (chunkType != RES_TABLE_TYPE_TYPE) {<NEW_LINE>throw new IllegalArgumentException("Excepted RES_TABLE_TYPE_TYPE, got " <MASK><NEW_LINE>}<NEW_LINE>int typeId = buf[p + 8];<NEW_LINE>int flags = buf[p + 9];<NEW_LINE>int entryCount = readLe32(buf, p + 12);<NEW_LINE>int entriesStart = readLe32(buf, p + 16);<NEW_LINE>System.out.printf("TypeId %d has %d entries with flag %x.\n", typeId, entryCount, flags);<NEW_LINE>int cfgSize = readLe32(buf, p + 20);<NEW_LINE>int entryOffStart = p + 20 + cfgSize;<NEW_LINE>for (int i = 0; i < entryCount; i++) {<NEW_LINE>int off = readLe32(buf, entryOffStart + 4 * i);<NEW_LINE>if (off != -1) {<NEW_LINE>System.out.printf("Type %d entry %d has entry offset at %d\n", typeId, i, off);<NEW_LINE>int entrySize = readLe16(buf, p + entriesStart + off);<NEW_LINE>int entryFlags = readLe16(buf, p + entriesStart + off + 2);<NEW_LINE>int keyIndex = readLe32(buf, p + entriesStart + off + 4);<NEW_LINE>int dataSize = readLe16(buf, p + entriesStart + off + 8);<NEW_LINE>byte type = buf[p + entriesStart + off + 11];<NEW_LINE>int dataValue = readLe16(buf, p + entriesStart + off + 12);<NEW_LINE>nop();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return chunkSize;<NEW_LINE>}
+ Integer.toHexString(chunkType));
1,463,976
protected void performOperation(final ShardIterator shardIt, final ShardRouting shard, final int shardIndex) {<NEW_LINE>if (shard == null) {<NEW_LINE>// no more active shards... (we should not really get here, just safety)<NEW_LINE>onOperation(null, shardIt, shardIndex, new NoShardAvailableActionException(shardIt.shardId()));<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>final ShardRequest shardRequest = newShardRequest(shardIt.size(), shard, request);<NEW_LINE>shardRequest.setParentTask(clusterService.localNode().getId(), task.getId());<NEW_LINE>DiscoveryNode node = nodes.<MASK><NEW_LINE>if (node == null) {<NEW_LINE>// no node connected, act as failure<NEW_LINE>onOperation(shard, shardIt, shardIndex, new NoShardAvailableActionException(shardIt.shardId()));<NEW_LINE>} else {<NEW_LINE>sendShardRequest(node, shardRequest, ActionListener.wrap(r -> onOperation(shard, shardIndex, r), e -> onOperation(shard, shardIt, shardIndex, e)));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>onOperation(shard, shardIt, shardIndex, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
get(shard.currentNodeId());
286,441
public void marshall(Delegation delegation, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (delegation == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(delegation.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(delegation.getAssessmentName(), ASSESSMENTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(delegation.getAssessmentId(), ASSESSMENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(delegation.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(delegation.getRoleType(), ROLETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(delegation.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(delegation.getLastUpdated(), LASTUPDATED_BINDING);<NEW_LINE>protocolMarshaller.marshall(delegation.getControlSetId(), CONTROLSETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(delegation.getComment(), COMMENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(delegation.getCreatedBy(), CREATEDBY_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
delegation.getRoleArn(), ROLEARN_BINDING);
1,670,353
private org.apache.http.cookie.Cookie convert(Cookie in) {<NEW_LINE>BasicClientCookie out = new BasicClientCookie(in.getName(), in.getValue());<NEW_LINE>String domainStr = null;<NEW_LINE>if (StringUtils.isEmpty(in.getDomain())) {<NEW_LINE>String urlStr = context.item().engine.get().getLocation();<NEW_LINE>try {<NEW_LINE>URL url = new URL(urlStr);<NEW_LINE>domainStr = url.getHost();<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>Matcher matcher = domain.matcher(urlStr);<NEW_LINE>if (matcher.matches()) {<NEW_LINE>domainStr = matcher.group(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.setDomain(domainStr == null ? <MASK><NEW_LINE>out.setAttribute("domain", "." + out.getDomain());<NEW_LINE>if (in.getExpiry() != null) {<NEW_LINE>out.setExpiryDate(in.getExpiry());<NEW_LINE>DateFormat cookieDf = new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss zzz");<NEW_LINE>cookieDf.setTimeZone(TimeZone.getTimeZone("GMT"));<NEW_LINE>out.setAttribute("expires", cookieDf.format(in.getExpiry()));<NEW_LINE>}<NEW_LINE>out.setPath(in.getPath());<NEW_LINE>out.setAttribute("path", in.getPath());<NEW_LINE>out.setSecure(in.isSecure());<NEW_LINE>if (in.isSecure()) {<NEW_LINE>out.setAttribute("secure", null);<NEW_LINE>}<NEW_LINE>out.setValue(in.getValue());<NEW_LINE>out.setVersion(0);<NEW_LINE>if (in.isHttpOnly()) {<NEW_LINE>out.setAttribute("httponly", null);<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>}
in.getDomain() : domainStr);
41,718
private static Bitmap fetchBitmap(String url) throws IOException {<NEW_LINE>OkHttpClient client = ServiceFactory.getImageHttpClient();<NEW_LINE>okhttp3.Request request = new okhttp3.Request.Builder().url(url).build();<NEW_LINE>byte[] data;<NEW_LINE>try (okhttp3.Response response = client.newCall(request).execute()) {<NEW_LINE>if (!response.isSuccessful()) {<NEW_LINE>throw new IOException("HTTP failure code " + response.code());<NEW_LINE>}<NEW_LINE>data = response.body().bytes();<NEW_LINE>}<NEW_LINE>BitmapFactory.Options options = new BitmapFactory.Options();<NEW_LINE>options.inJustDecodeBounds = true;<NEW_LINE>BitmapFactory.decodeByteArray(data, <MASK><NEW_LINE>options.inJustDecodeBounds = false;<NEW_LINE>final int widthRatio = options.outWidth / sMaxImageSizePx;<NEW_LINE>final int heightRatio = options.outHeight / sMaxImageSizePx;<NEW_LINE>options.inSampleSize = Math.min(heightRatio, widthRatio);<NEW_LINE>Bitmap unscaled = BitmapFactory.decodeByteArray(data, 0, data.length, options);<NEW_LINE>if (unscaled == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// We'll scale the image to the desired density<NEW_LINE>unscaled.setDensity(0);<NEW_LINE>float widthScale = (float) sMaxImageSizePx / (float) unscaled.getWidth();<NEW_LINE>float heightScale = (float) sMaxImageSizePx / (float) unscaled.getHeight();<NEW_LINE>float scaleFactor = Math.min(1, Math.min(widthScale, heightScale));<NEW_LINE>Bitmap scaled = Bitmap.createScaledBitmap(unscaled, (int) (scaleFactor * unscaled.getWidth()), (int) (scaleFactor * unscaled.getHeight()), true);<NEW_LINE>if (scaled != unscaled) {<NEW_LINE>unscaled.recycle();<NEW_LINE>}<NEW_LINE>return scaled;<NEW_LINE>}
0, data.length, options);
483,111
public static // programming given the insertionCost, deletionCost and substitutionCost, O(nm)<NEW_LINE>int micahEditDistance(String a, String b, int insertionCost, int deletionCost, int substitutionCost) {<NEW_LINE>final int AL = a.length(), BL = b.length();<NEW_LINE>int[][] arr = new int[AL + 1][BL + 1];<NEW_LINE>for (int i = 0; i <= AL; i++) {<NEW_LINE>for (int j = (i == 0 ? 1 : 0); j <= BL; j++) {<NEW_LINE>int min = Integer.MAX_VALUE;<NEW_LINE>// Substitution<NEW_LINE>if (i > 0 && j > 0)<NEW_LINE>min = arr[i - 1][j - 1] + (a.charAt(i - 1) == b.charAt(j <MASK><NEW_LINE>// Deletion<NEW_LINE>if (i > 0)<NEW_LINE>min = Math.min(min, arr[i - 1][j] + deletionCost);<NEW_LINE>// Insertion<NEW_LINE>if (j > 0)<NEW_LINE>min = Math.min(min, arr[i][j - 1] + insertionCost);<NEW_LINE>arr[i][j] = min;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return arr[AL][BL];<NEW_LINE>}
- 1) ? 0 : substitutionCost);
85,068
public EntityRecognizerEvaluationMetrics unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE><MASK><NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>EntityRecognizerEvaluationMetrics entityRecognizerEvaluationMetrics = new EntityRecognizerEvaluationMetrics();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("Precision")) {<NEW_LINE>entityRecognizerEvaluationMetrics.setPrecision(DoubleJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("Recall")) {<NEW_LINE>entityRecognizerEvaluationMetrics.setRecall(DoubleJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("F1Score")) {<NEW_LINE>entityRecognizerEvaluationMetrics.setF1Score(DoubleJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return entityRecognizerEvaluationMetrics;<NEW_LINE>}
AwsJsonReader reader = context.getReader();
945,817
protected void subscribeActual(Subscriber<? super T> s) {<NEW_LINE>Publisher<MASK><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++] = Objects.requireNonNull(p, "a source is null");<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>}
<T>[] array = sources;
1,412,349
final PutIntegrationResult executePutIntegration(PutIntegrationRequest putIntegrationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putIntegrationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutIntegrationRequest> request = null;<NEW_LINE>Response<PutIntegrationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutIntegrationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putIntegrationRequest));<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, "PutIntegration");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutIntegrationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutIntegrationResultJsonUnmarshaller());<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);
1,716,173
public static boolean deployV2Contract(FiscoConfig fiscoConfig) throws BrokerException {<NEW_LINE>BcosSDK sdk = Web3SDKConnector.buidBcosSDK(fiscoConfig);<NEW_LINE>Map<Integer, Client> groups = new HashMap<>();<NEW_LINE>// 1 is always exist<NEW_LINE>Integer defaultGroup = <MASK><NEW_LINE>Client defaultClient = Web3SDKConnector.initClient(sdk, defaultGroup, fiscoConfig);<NEW_LINE>groups.put(defaultGroup, defaultClient);<NEW_LINE>List<String> groupIds = Web3SDKConnector.listGroupId(defaultClient);<NEW_LINE>groupIds.remove(WeEvent.DEFAULT_GROUP_ID);<NEW_LINE>for (String groupId : groupIds) {<NEW_LINE>Integer gid = Integer.parseInt(groupId);<NEW_LINE>Client client = Web3SDKConnector.initClient(sdk, Integer.parseInt(groupId), fiscoConfig);<NEW_LINE>groups.put(gid, client);<NEW_LINE>}<NEW_LINE>log.info("all group in nodes: {}", groups.keySet());<NEW_LINE>// deploy topic control contract for every group<NEW_LINE>Map<Integer, List<EchoAddress>> echoAddresses = new HashMap<>();<NEW_LINE>for (Map.Entry<Integer, Client> e : groups.entrySet()) {<NEW_LINE>List<EchoAddress> groupAddress = new ArrayList<>();<NEW_LINE>if (!dealOneGroup(e.getKey(), e.getValue(), groupAddress)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>echoAddresses.put(e.getKey(), groupAddress);<NEW_LINE>}<NEW_LINE>System.out.println(nowTime() + " topic control address in every group:");<NEW_LINE>for (Map.Entry<Integer, List<EchoAddress>> e : echoAddresses.entrySet()) {<NEW_LINE>System.out.println("topic control address in group: " + e.getKey());<NEW_LINE>for (EchoAddress address : e.getValue()) {<NEW_LINE>System.out.println("\t" + address.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
Integer.parseInt(WeEvent.DEFAULT_GROUP_ID);
1,602,137
public ASTToken read(Cookie cookie, CharInput input, Language language) {<NEW_LINE>if (input.eof())<NEW_LINE>return null;<NEW_LINE>int originalIndex = input.getIndex();<NEW_LINE>Pattern pattern = stateToPattern.get(cookie.getState());<NEW_LINE>if (pattern == null)<NEW_LINE>return null;<NEW_LINE>TokenType tokenType = (TokenType) pattern.read(input);<NEW_LINE>if (tokenType == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Feature tokenProperties = tokenType.getProperties();<NEW_LINE>cookie.setProperties(tokenProperties);<NEW_LINE><MASK><NEW_LINE>int state = -1;<NEW_LINE>if (endState != null)<NEW_LINE>state = getState(endState);<NEW_LINE>cookie.setState(state);<NEW_LINE>ASTToken token = ASTToken.create(language, tokenType.getTypeID(), input.getString(originalIndex, input.getIndex()), originalIndex);<NEW_LINE>if (tokenProperties != null && tokenProperties.getType("call") != Type.NOT_SET) {<NEW_LINE>input.setIndex(originalIndex);<NEW_LINE>Object[] r = (Object[]) tokenProperties.getValue("call", new Object[] { input });<NEW_LINE>if (r == null)<NEW_LINE>throw new NullPointerException("Method " + tokenProperties.getMethodName("call") + " returns null!\n");<NEW_LINE>token = (ASTToken) r[0];<NEW_LINE>if (r[1] != null)<NEW_LINE>cookie.setState(getState((String) r[1]));<NEW_LINE>}<NEW_LINE>return token;<NEW_LINE>}
String endState = tokenType.getEndState();
1,699,279
private void validateUnionValue(TomlNode tomlValue, String variableName, BUnionType unionType) {<NEW_LINE>visitedNodes.add(tomlValue);<NEW_LINE>Object balValue = Utils.getBalValueFromToml(tomlValue, visitedNodes, unionType, invalidTomlLines, variableName);<NEW_LINE>List<Type> convertibleTypes = new ArrayList<>();<NEW_LINE>for (Type type : unionType.getMemberTypes()) {<NEW_LINE>if (TypeChecker.checkIsLikeType(balValue, type, false)) {<NEW_LINE>convertibleTypes.add(type);<NEW_LINE>if (convertibleTypes.size() > 1) {<NEW_LINE>invalidTomlLines.add(tomlValue.<MASK><NEW_LINE>throw new ConfigException(CONFIG_UNION_VALUE_AMBIGUOUS_TARGET, getLineRange(tomlValue), variableName, decodeIdentifier(unionType.toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (convertibleTypes.isEmpty()) {<NEW_LINE>throwTypeIncompatibleError(tomlValue, variableName, unionType);<NEW_LINE>}<NEW_LINE>Type type = convertibleTypes.get(0);<NEW_LINE>if (isSimpleType(type.getTag()) || isXMLType(type)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (type.getTag() == TypeTags.FINITE_TYPE_TAG) {<NEW_LINE>if (((BFiniteType) type).valueSpace.contains(balValue)) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>throwTypeIncompatibleError(tomlValue, variableName, type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>visitedNodes.add(tomlValue);<NEW_LINE>validateStructuredValue(tomlValue, variableName, type);<NEW_LINE>}
location().lineRange());
140,156
public void openPanel(ContentManager contentManager, String tabName, DevToolsUrl devToolsUrl, Runnable onBrowserUnavailable) {<NEW_LINE>// If the browser failed to start during setup, run unavailable callback.<NEW_LINE>if (browser == null) {<NEW_LINE>onBrowserUnavailable.run();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Multiple LoadFinished events can occur, but we only need to add content the first time.<NEW_LINE>final AtomicBoolean contentLoaded = new AtomicBoolean(false);<NEW_LINE>try {<NEW_LINE>browser.navigation().loadUrl(devToolsUrl.getUrlString());<NEW_LINE>} catch (Exception ex) {<NEW_LINE>devToolsUrlFuture.completeExceptionally(ex);<NEW_LINE>onBrowserUnavailable.run();<NEW_LINE>LOG.info(ex);<NEW_LINE>FlutterInitializer.getAnalytics().sendExpectedException("jxbrowser-load", ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>devToolsUrlFuture.complete(devToolsUrl);<NEW_LINE>browser.navigation().on(LoadFinished.class, event -> {<NEW_LINE>if (!contentLoaded.compareAndSet(false, true)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ApplicationManager.getApplication().invokeLater(() -> {<NEW_LINE>if (contentManager.isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>contentManager.removeAllContents(false);<NEW_LINE>final Content content = contentManager.getFactory().createContent(null, tabName, false);<NEW_LINE>// Creating Swing component for rendering web content<NEW_LINE>// loaded in the given Browser instance.<NEW_LINE>final BrowserView view = BrowserView.newInstance(browser);<NEW_LINE>view.setPreferredSize(new Dimension(contentManager.getComponent().getWidth(), contentManager.getComponent().getHeight()));<NEW_LINE>// DevTools may show a confirm dialog to use a fallback version.<NEW_LINE>browser.set(ConfirmCallback.class, new DefaultConfirmCallback(view));<NEW_LINE>browser.set(AlertCallback.class, new DefaultAlertCallback(view));<NEW_LINE>content.setComponent(view);<NEW_LINE>content.putUserData(ToolWindow.SHOW_CONTENT_ICON, Boolean.TRUE);<NEW_LINE>// TODO(helin24): Use differentiated icons for each tab and copy from devtools toolbar.<NEW_LINE><MASK><NEW_LINE>contentManager.addContent(content);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
content.setIcon(FlutterIcons.Phone);
1,551,600
private void checkSubscriptionForStuff(Subscription sub) {<NEW_LINE>if (sub.isSearchTemplate()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (sub.isSubscribed() && sub.getAddType() != Subscription.ADD_TYPE_IMPORT) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Engine engine = sub.getEngine();<NEW_LINE>if (engine instanceof RSSEngine) {<NEW_LINE>RSSEngine re = (RSSEngine) engine;<NEW_LINE>String url_str = re.getSearchUrl(true);<NEW_LINE>URL url = new URL(url_str);<NEW_LINE>String prot = url.getProtocol();<NEW_LINE>if (prot.equals("azplug")) {<NEW_LINE>String q = url.getQuery();<NEW_LINE>Map<String, String> args = UrlUtils.decodeArgs(q);<NEW_LINE>String id = args.get("id");<NEW_LINE>if (id.equals("azbuddy")) {<NEW_LINE>String arg = args.get("arg");<NEW_LINE>String[] bits = <MASK><NEW_LINE>String chat_protocol = bits[0];<NEW_LINE>if (chat_protocol.startsWith("chat")) {<NEW_LINE>Map<String, String> chat_args = UrlUtils.decodeArgs(bits[1]);<NEW_LINE>String chat_key = chat_args.get("");<NEW_LINE>int pos = chat_key.toLowerCase(Locale.US).indexOf("website[pk=");<NEW_LINE>if (pos != -1) {<NEW_LINE>Map<String, String> cb_data = new HashMap<>();<NEW_LINE>cb_data.put("subname", sub.getName());<NEW_LINE>cb_data.put("subid", sub.getID());<NEW_LINE>LocalActivityManager.addLocalActivity("Website:" + sub.getID(), "rss", MessageText.getString("subs.activity.website.found", new String[] { sub.getName() }), new String[] { MessageText.getString("subscriptions.listwindow.subscribe") }, ActivityCallback.class, cb_data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// ignore, nothing to see!<NEW_LINE>}<NEW_LINE>}
arg.split(":", 2);
1,202,804
protected FlatProfileContainer generateFlatProfile() {<NEW_LINE>preGenerateFlatProfile();<NEW_LINE>PrestimeCPUCCTNode[] children = (PrestimeCPUCCTNode[]) rootNode.getChildren();<NEW_LINE>if (children != null)<NEW_LINE>for (int i = 0; i < children.length; i++) {<NEW_LINE>CPUCCTContainer childContainer = children[i].getContainer();<NEW_LINE>childContainer.timePerMethodId0 = this.timePerMethodId0;<NEW_LINE>childContainer.timePerMethodId1 = this.timePerMethodId1;<NEW_LINE>childContainer.totalTimePerMethodId0 = this.totalTimePerMethodId0;<NEW_LINE>childContainer.totalTimePerMethodId1 = this.totalTimePerMethodId1;<NEW_LINE>childContainer.invPerMethodId = this.invPerMethodId;<NEW_LINE>childContainer.methodsOnStack = new HashSet();<NEW_LINE>childContainer.addFlatProfTimeForNode(0);<NEW_LINE>childContainer.timePerMethodId0 = childContainer.timePerMethodId1 = null;<NEW_LINE>childContainer<MASK><NEW_LINE>childContainer.invPerMethodId = null;<NEW_LINE>childContainer.methodsOnStack = null;<NEW_LINE>}<NEW_LINE>return postGenerateFlatProfile();<NEW_LINE>}
.totalTimePerMethodId0 = childContainer.totalTimePerMethodId1 = null;
1,514,839
private Element addRow(Level level, String msg) {<NEW_LINE>int sinceReset = VDebugWindow.getMillisSinceReset();<NEW_LINE>int sinceStart = VDebugWindow.getMillisSinceStart();<NEW_LINE>Element row = DOM.createDiv();<NEW_LINE>row.addClassName(VDebugWindow.STYLENAME + "-row");<NEW_LINE>row.<MASK><NEW_LINE>String inner = "<span class='" + VDebugWindow.STYLENAME + "-" + "'></span><span class='" + VDebugWindow.STYLENAME + "-time' title='" + VDebugWindow.getTimingTooltip(sinceStart, sinceReset) + "'>" + sinceReset + "ms</span><span class='" + VDebugWindow.STYLENAME + "-message'>" + msg + "</span>";<NEW_LINE>row.setInnerHTML(inner);<NEW_LINE>contentElement.appendChild(row);<NEW_LINE>applyLimit();<NEW_LINE>maybeScroll();<NEW_LINE>return row;<NEW_LINE>}
addClassName(level.getName());
1,334,278
public void createMenuItems(Bundle savedInstanceState) {<NEW_LINE>Context ctx = getContext();<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>currentDirectory = savedInstanceState.getParcelable(CURRENT_DIRECTORY);<NEW_LINE>newDirectory = savedInstanceState.getParcelable(NEW_DIRECTORY);<NEW_LINE>}<NEW_LINE>if (ctx == null || currentDirectory == null || newDirectory == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>items.add(new TitleItem(getString(R.string.change_osmand_data_folder_question)));<NEW_LINE>int textColorPrimary = ColorUtilities.getPrimaryTextColorId(nightMode);<NEW_LINE>int activeColor = ColorUtilities.getActiveColorId(nightMode);<NEW_LINE>CharSequence desc = null;<NEW_LINE>File currentStorageFile = new File(currentDirectory.getDirectory());<NEW_LINE>if ((!FileUtils.isWritable(currentStorageFile))) {<NEW_LINE>desc = String.format(getString(R.string.android_19_location_disabled), currentStorageFile.getAbsoluteFile());<NEW_LINE>} else {<NEW_LINE>String from = currentDirectory.getKey().equals(MANUALLY_SPECIFIED) ? currentDirectory.getDirectory() : currentDirectory.getTitle();<NEW_LINE>String to = newDirectory.getKey().equals(MANUALLY_SPECIFIED) ? newDirectory.getDirectory<MASK><NEW_LINE>String fullDescription = String.format(getString(R.string.change_data_storage_full_description), from, to);<NEW_LINE>SpannableStringBuilder coloredDescription = new SpannableStringBuilder(fullDescription);<NEW_LINE>int startIndexFrom = fullDescription.indexOf(from);<NEW_LINE>int endIndexFrom = startIndexFrom + from.length();<NEW_LINE>int startIndexTo = fullDescription.indexOf(to);<NEW_LINE>int endIndexTo = startIndexTo + to.length();<NEW_LINE>coloredDescription.setSpan(new ForegroundColorSpan(ContextCompat.getColor(ctx, activeColor)), startIndexFrom, endIndexFrom, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>coloredDescription.setSpan(new ForegroundColorSpan(ContextCompat.getColor(ctx, activeColor)), startIndexTo, endIndexTo, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>desc = coloredDescription;<NEW_LINE>}<NEW_LINE>BottomSheetItemWithDescription description = (BottomSheetItemWithDescription) new BottomSheetItemWithDescription.Builder().setDescription(desc).setDescriptionColorId(textColorPrimary).setLayoutId(R.layout.bottom_sheet_item_description_long).create();<NEW_LINE>items.add(description);<NEW_LINE>// buttons<NEW_LINE>View mainView = View.inflate(ctx, R.layout.bottom_sheet_change_data_storage, null);<NEW_LINE>View btnDontMoveView = mainView.findViewById(R.id.btnDontMove);<NEW_LINE>btnDontMoveView.setOnClickListener(v -> positiveButtonsClick(false));<NEW_LINE>UiUtilities.setupDialogButton(nightMode, btnDontMoveView, DialogButtonType.SECONDARY, getString(R.string.dont_move_maps), currentDirectory.getSelectedIconResId());<NEW_LINE>View btnMoveView = mainView.findViewById(R.id.btnMove);<NEW_LINE>btnMoveView.setOnClickListener(v -> positiveButtonsClick(true));<NEW_LINE>UiUtilities.setupDialogButton(nightMode, btnMoveView, DialogButtonType.PRIMARY, getString(R.string.move_maps_to_new_destination), R.drawable.ic_action_folder_move);<NEW_LINE>View btnCloseView = mainView.findViewById(R.id.btnClose);<NEW_LINE>btnCloseView.setOnClickListener(v -> dismiss());<NEW_LINE>UiUtilities.setupDialogButton(nightMode, btnCloseView, DialogButtonType.SECONDARY, getString(R.string.shared_string_cancel), R.drawable.ic_action_undo_dark);<NEW_LINE>BaseBottomSheetItem baseItem = new BaseBottomSheetItem.Builder().setCustomView(mainView).create();<NEW_LINE>items.add(baseItem);<NEW_LINE>}
() : newDirectory.getTitle();
295,785
protected void read(FileAccessor fa, DirectByteBuffer buffer, long position) throws FMFileManagerException {<NEW_LINE>int <MASK><NEW_LINE>try {<NEW_LINE>int len = original_limit - buffer.position(SS);<NEW_LINE>// System.out.println( "compact: read - " + position + "/" + len );<NEW_LINE>// deal with any read access to the first piece<NEW_LINE>if (position < first_piece_start + first_piece_length) {<NEW_LINE>int available = (int) (first_piece_start + first_piece_length - position);<NEW_LINE>if (available >= len) {<NEW_LINE>// all they require is in the first piece<NEW_LINE>// System.out.println( " all in first piece" );<NEW_LINE>delegate.read(fa, new DirectByteBuffer[] { buffer }, position);<NEW_LINE>position += len;<NEW_LINE>len = 0;<NEW_LINE>} else {<NEW_LINE>// read goes past end of first piece<NEW_LINE>// System.out.println( " part in first piece" );<NEW_LINE>buffer.limit(SS, buffer.position(SS) + available);<NEW_LINE>delegate.read(fa, new DirectByteBuffer[] { buffer }, position);<NEW_LINE>buffer.limit(SS, original_limit);<NEW_LINE>position += available;<NEW_LINE>len -= available;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (len == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// position is at start of gap between start and end - work out how much,<NEW_LINE>// if any, space has been requested<NEW_LINE>long space = last_piece_start - position;<NEW_LINE>if (space > 0) {<NEW_LINE>if (space >= len) {<NEW_LINE>// all they require is space<NEW_LINE>// System.out.println( " all in space" );<NEW_LINE>buffer.position(SS, original_limit);<NEW_LINE>position += len;<NEW_LINE>len = 0;<NEW_LINE>} else {<NEW_LINE>// read goes past end of space<NEW_LINE>// System.out.println( " part in space" );<NEW_LINE>buffer.position(SS, buffer.position(SS) + (int) space);<NEW_LINE>position += space;<NEW_LINE>len -= space;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (len == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// lastly read from last piece<NEW_LINE>// System.out.println( " some in last piece" );<NEW_LINE>delegate.read(fa, new DirectByteBuffer[] { buffer }, (position - last_piece_start) + first_piece_length);<NEW_LINE>} finally {<NEW_LINE>buffer.limit(SS, original_limit);<NEW_LINE>}<NEW_LINE>}
original_limit = buffer.limit(SS);
2,044
final CreateServiceResult executeCreateService(CreateServiceRequest createServiceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createServiceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateServiceRequest> request = null;<NEW_LINE>Response<CreateServiceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateServiceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createServiceRequest));<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, "ServiceDiscovery");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateService");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateServiceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateServiceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,061,016
public double[][] inverse() {<NEW_LINE><MASK><NEW_LINE>return new double[][] { { invDet3 * det2(m22, m23, m32, m33), invDet3 * det2(m13, m12, m33, m32), invDet3 * det2(m12, m13, m22, m23) }, { invDet3 * det2(m23, m21, m33, m31), invDet3 * det2(m11, m13, m31, m33), invDet3 * det2(m13, m11, m23, m21) }, { invDet3 * det2(m21, m22, m31, m32), invDet3 * det2(m12, m11, m32, m31), invDet3 * det2(m11, m12, m21, m22) } };<NEW_LINE>}
double invDet3 = 1 / determinant();
1,291,328
public void marshall(SimulationApplicationConfig simulationApplicationConfig, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (simulationApplicationConfig == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(simulationApplicationConfig.getApplication(), APPLICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(simulationApplicationConfig.getApplicationVersion(), APPLICATIONVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(simulationApplicationConfig.getLaunchConfig(), LAUNCHCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(simulationApplicationConfig.getUploadConfigurations(), UPLOADCONFIGURATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(simulationApplicationConfig.getWorldConfigs(), WORLDCONFIGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(simulationApplicationConfig.getUseDefaultUploadConfigurations(), USEDEFAULTUPLOADCONFIGURATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(simulationApplicationConfig.getTools(), TOOLS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
simulationApplicationConfig.getUseDefaultTools(), USEDEFAULTTOOLS_BINDING);
1,181,919
private static void insertTabletWithAlignedTimeseriesMethod2() throws IoTDBConnectionException, StatementExecutionException {<NEW_LINE>// The schema of measurements of one device<NEW_LINE>// only measurementId and data type in MeasurementSchema take effects in Tablet<NEW_LINE>List<MeasurementSchema> schemaList = new ArrayList<>();<NEW_LINE>schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));<NEW_LINE>schemaList.add(new MeasurementSchema("s2", TSDataType.INT32));<NEW_LINE>Tablet tablet = new Tablet(ROOT_SG1_D1_VECTOR2, schemaList);<NEW_LINE>long[] timestamps = tablet.timestamps;<NEW_LINE>Object[] values = tablet.values;<NEW_LINE>for (long time = 100; time < 200; time++) {<NEW_LINE>int row = tablet.rowSize++;<NEW_LINE>timestamps[row] = time;<NEW_LINE>long[] sensor1 = (long[]) values[0];<NEW_LINE>sensor1[row] = <MASK><NEW_LINE>int[] sensor2 = (int[]) values[1];<NEW_LINE>sensor2[row] = new SecureRandom().nextInt();<NEW_LINE>if (tablet.rowSize == tablet.getMaxRowNumber()) {<NEW_LINE>session.insertAlignedTablet(tablet, true);<NEW_LINE>tablet.reset();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tablet.rowSize != 0) {<NEW_LINE>session.insertAlignedTablet(tablet, true);<NEW_LINE>tablet.reset();<NEW_LINE>}<NEW_LINE>session.executeNonQueryStatement("flush");<NEW_LINE>}
new SecureRandom().nextLong();
119,599
private void _onActivityResultLocationPage(Bundle bundle) {<NEW_LINE>String callbackId = bundle.getString("callbackId");<NEW_LINE>CallbackContext callbackContext = new CallbackContext(callbackId, this.webView);<NEW_LINE>LocationManager locationManager = (LocationManager) this.<MASK><NEW_LINE>List<String> providers = locationManager.getAllProviders();<NEW_LINE>int availableProviders = 0;<NEW_LINE>// if (mPluginLayout != null && mPluginLayout.isDebug) {<NEW_LINE>Log.d(TAG, "---debug at getMyLocation(available providers)--");<NEW_LINE>// }<NEW_LINE>Iterator<String> iterator = providers.iterator();<NEW_LINE>String provider;<NEW_LINE>boolean isAvailable;<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>provider = iterator.next();<NEW_LINE>if ("passive".equals(provider)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>isAvailable = locationManager.isProviderEnabled(provider);<NEW_LINE>if (isAvailable) {<NEW_LINE>availableProviders++;<NEW_LINE>}<NEW_LINE>// if (mPluginLayout != null && mPluginLayout.isDebug) {<NEW_LINE>Log.d(TAG, " " + provider + " = " + (isAvailable ? "" : "not ") + "available");<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>if (availableProviders == 0) {<NEW_LINE>JSONObject result = new JSONObject();<NEW_LINE>try {<NEW_LINE>result.put("status", false);<NEW_LINE>result.put("error_code", "not_available");<NEW_LINE>result.put("error_message", PluginUtil.getPgmStrings(activity, "pgm_no_location_providers"));<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>callbackContext.error(result);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>_inviteLocationUpdateAfterActivityResult(bundle);<NEW_LINE>}
activity.getSystemService(Context.LOCATION_SERVICE);
1,200,548
public void combine(CRFClassifier<IN> crf, double weight) {<NEW_LINE>Timing timer = new Timing();<NEW_LINE>// Check the CRFClassifiers are compatible<NEW_LINE>if (!this.pad.equals(crf.pad)) {<NEW_LINE>throw new RuntimeException("Incompatible CRFClassifier: pad does not match");<NEW_LINE>}<NEW_LINE>if (this.windowSize != crf.windowSize) {<NEW_LINE>throw new RuntimeException("Incompatible CRFClassifier: windowSize does not match");<NEW_LINE>}<NEW_LINE>if (this.labelIndices.size() != crf.labelIndices.size()) {<NEW_LINE>// Should match since this should be same as the windowSize<NEW_LINE>throw new RuntimeException("Incompatible CRFClassifier: labelIndices length does not match");<NEW_LINE>}<NEW_LINE>this.classIndex.addAll(crf.classIndex.objectsList());<NEW_LINE>// Combine weights of the other classifier with this classifier,<NEW_LINE>// weighing the other classifier's weights by weight<NEW_LINE>// First merge the feature indices<NEW_LINE>int oldNumFeatures1 = this.featureIndex.size();<NEW_LINE>int oldNumFeatures2 = crf.featureIndex.size();<NEW_LINE>int oldNumWeights1 = this.getNumWeights();<NEW_LINE><MASK><NEW_LINE>this.featureIndex.addAll(crf.featureIndex.objectsList());<NEW_LINE>this.knownLCWords.addAll(crf.knownLCWords);<NEW_LINE>assert (weights.length == oldNumFeatures1);<NEW_LINE>// Combine weights of this classifier with other classifier<NEW_LINE>for (int i = 0; i < labelIndices.size(); i++) {<NEW_LINE>this.labelIndices.get(i).addAll(crf.labelIndices.get(i).objectsList());<NEW_LINE>}<NEW_LINE>log.info("Combining weights: will automatically match labelIndices");<NEW_LINE>combineWeights(crf, weight);<NEW_LINE>int numFeatures = featureIndex.size();<NEW_LINE>int numWeights = getNumWeights();<NEW_LINE>long elapsedMs = timer.stop();<NEW_LINE>log.info("numFeatures: orig1=" + oldNumFeatures1 + ", orig2=" + oldNumFeatures2 + ", combined=" + numFeatures);<NEW_LINE>log.info("numWeights: orig1=" + oldNumWeights1 + ", orig2=" + oldNumWeights2 + ", combined=" + numWeights);<NEW_LINE>log.info("Time to combine CRFClassifier: " + Timing.toSecondsString(elapsedMs) + " seconds");<NEW_LINE>}
int oldNumWeights2 = crf.getNumWeights();
1,203,460
public CreateEndOfMeetingReminder unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateEndOfMeetingReminder createEndOfMeetingReminder = new CreateEndOfMeetingReminder();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><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("ReminderAtMinutes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createEndOfMeetingReminder.setReminderAtMinutes(new ListUnmarshaller<Integer>(context.getUnmarshaller(Integer.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ReminderType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createEndOfMeetingReminder.setReminderType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Enabled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createEndOfMeetingReminder.setEnabled(context.getUnmarshaller(Boolean.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 createEndOfMeetingReminder;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
552,447
private static Object enumInitInOrder(Context cx, IdEnumeration x) {<NEW_LINE>if (!(x.obj instanceof SymbolScriptable) || !ScriptableObject.hasProperty(x.obj, SymbolKey.ITERATOR)) {<NEW_LINE>throw typeErrorById("msg.not.iterable", toString(x.obj));<NEW_LINE>}<NEW_LINE>Object iterator = ScriptableObject.getProperty(x.obj, SymbolKey.ITERATOR);<NEW_LINE>if (!(iterator instanceof Callable)) {<NEW_LINE>throw typeErrorById("msg.not.iterable", toString(x.obj));<NEW_LINE>}<NEW_LINE>Callable f = (Callable) iterator;<NEW_LINE>Scriptable scope = x.obj.getParentScope();<NEW_LINE>Object[] args = new Object[] {};<NEW_LINE>Object v = f.call(cx, scope, x.obj, args);<NEW_LINE>if (!(v instanceof Scriptable)) {<NEW_LINE>throw typeErrorById("msg.not.iterable"<MASK><NEW_LINE>}<NEW_LINE>x.iterator = (Scriptable) v;<NEW_LINE>return x;<NEW_LINE>}
, toString(x.obj));
148,476
public static boolean isValidCipherSuiteForSignatureAlgorithms(int cipherSuite, Vector sigAlgs) {<NEW_LINE><MASK><NEW_LINE>switch(keyExchangeAlgorithm) {<NEW_LINE>case KeyExchangeAlgorithm.DHE_DSS:<NEW_LINE>case KeyExchangeAlgorithm.DHE_RSA:<NEW_LINE>case KeyExchangeAlgorithm.ECDHE_ECDSA:<NEW_LINE>case KeyExchangeAlgorithm.ECDHE_RSA:<NEW_LINE>case KeyExchangeAlgorithm.NULL:<NEW_LINE>case KeyExchangeAlgorithm.SRP_RSA:<NEW_LINE>case KeyExchangeAlgorithm.SRP_DSS:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>int count = sigAlgs.size();<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>Short sigAlg = (Short) sigAlgs.elementAt(i);<NEW_LINE>if (null != sigAlg) {<NEW_LINE>short signatureAlgorithm = sigAlg.shortValue();<NEW_LINE>if (isValidSignatureAlgorithmForServerKeyExchange(signatureAlgorithm, keyExchangeAlgorithm)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
final int keyExchangeAlgorithm = getKeyExchangeAlgorithm(cipherSuite);
733,845
public static PluginBean unmarshallPlugin(Map<String, Object> source) {<NEW_LINE>if (source == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>PluginBean bean = new PluginBean();<NEW_LINE>bean.setId(asLong(source.get("id")));<NEW_LINE>bean.setName(asString(source.get("name")));<NEW_LINE>bean.setDescription(asString(source.get("description")));<NEW_LINE>bean.setCreatedBy(asString(source.get("createdBy")));<NEW_LINE>bean.setCreatedOn(asDate(source.get("createdOn")));<NEW_LINE>bean.setGroupId(asString(<MASK><NEW_LINE>bean.setArtifactId(asString(source.get("artifactId")));<NEW_LINE>bean.setVersion(asString(source.get("version")));<NEW_LINE>bean.setType(asString(source.get("type")));<NEW_LINE>bean.setClassifier(asString(source.get("classifier")));<NEW_LINE>bean.setDeleted(asBoolean(source.get("deleted")));<NEW_LINE>postMarshall(bean);<NEW_LINE>return bean;<NEW_LINE>}
source.get("groupId")));
1,302,792
public static DescribeWebsiteStatResponse unmarshall(DescribeWebsiteStatResponse describeWebsiteStatResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeWebsiteStatResponse.setRequestId(_ctx.stringValue("DescribeWebsiteStatResponse.RequestId"));<NEW_LINE>describeWebsiteStatResponse.setTotalCount(_ctx.integerValue("DescribeWebsiteStatResponse.TotalCount"));<NEW_LINE>List<WebsiteStat> websiteStatList = new ArrayList<WebsiteStat>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeWebsiteStatResponse.WebsiteStatList.Length"); i++) {<NEW_LINE>WebsiteStat websiteStat = new WebsiteStat();<NEW_LINE>websiteStat.setSubServiceModule(_ctx.stringValue("DescribeWebsiteStatResponse.WebsiteStatList[" + i + "].SubServiceModule"));<NEW_LINE>websiteStat.setInstanceCount(_ctx.integerValue("DescribeWebsiteStatResponse.WebsiteStatList[" + i + "].InstanceCount"));<NEW_LINE>websiteStat.setScanCount(_ctx.integerValue("DescribeWebsiteStatResponse.WebsiteStatList[" + i + "].ScanCount"));<NEW_LINE>websiteStat.setRiskCount(_ctx.integerValue<MASK><NEW_LINE>websiteStatList.add(websiteStat);<NEW_LINE>}<NEW_LINE>describeWebsiteStatResponse.setWebsiteStatList(websiteStatList);<NEW_LINE>return describeWebsiteStatResponse;<NEW_LINE>}
("DescribeWebsiteStatResponse.WebsiteStatList[" + i + "].RiskCount"));
908,679
private // already hold the lock.<NEW_LINE>void checkPrimitiveType(int accessor, int typeCode) throws JMFUninitializedAccessException, JMFSchemaViolationException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.entry(this, tc, "checkPrimitiveType", new Object[] { Integer.valueOf(accessor), Integer.valueOf(typeCode) });<NEW_LINE>JSField field = getFieldDef(accessor, true);<NEW_LINE>if (field == null) {<NEW_LINE>JMFUninitializedAccessException e = new JMFUninitializedAccessException("Value at accessor " + accessor + " should not be present");<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.exit(this, tc, "checkPrimitiveType", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>if (field instanceof JSPrimitive) {<NEW_LINE>if (((JSPrimitive) field).getTypeCode() != typeCode) {<NEW_LINE>JMFSchemaViolationException e = new <MASK><NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.exit(this, tc, "checkPrimitiveType", e);<NEW_LINE>throw e;<NEW_LINE>} else {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.exit(this, tc, "checkPrimitiveType");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (field instanceof JSEnum && (typeCode == JMFPrimitiveType.INT)) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.exit(this, tc, "checkPrimitiveType");<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>JMFSchemaViolationException e = new JMFSchemaViolationException("Value at accessor " + accessor + " is incorrect");<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.exit(this, tc, "checkPrimitiveType", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
JMFSchemaViolationException("Value at accessor " + accessor + " is incorrect type");
1,851,717
public double[] transformToDoubleValuesSV(ProjectionBlock projectionBlock) {<NEW_LINE>if (_resultMetadata.getDataType().getStoredType() != DataType.DOUBLE) {<NEW_LINE>return super.transformToDoubleValuesSV(projectionBlock);<NEW_LINE>}<NEW_LINE>int[] selected = getSelectedArray(projectionBlock);<NEW_LINE>int numDocs = projectionBlock.getNumDocs();<NEW_LINE>if (_doubleResults == null || _doubleResults.length < numDocs) {<NEW_LINE>_doubleResults = new double[numDocs];<NEW_LINE>}<NEW_LINE>int numElseThenStatements = _elseThenStatements.size();<NEW_LINE>for (int i = 0; i < numElseThenStatements; i++) {<NEW_LINE>if (_selections[i]) {<NEW_LINE>TransformFunction transformFunction = _elseThenStatements.get(i);<NEW_LINE>double[] doubleValues = transformFunction.transformToDoubleValuesSV(projectionBlock);<NEW_LINE>if (_numSelections == 1) {<NEW_LINE>System.arraycopy(doubleValues, <MASK><NEW_LINE>} else {<NEW_LINE>for (int j = 0; j < numDocs; j++) {<NEW_LINE>if (selected[j] == i) {<NEW_LINE>_doubleResults[j] = doubleValues[j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return _doubleResults;<NEW_LINE>}
0, _doubleResults, 0, numDocs);
103,249
public void initialize(WizardDescriptor wizardDescriptor) {<NEW_LINE>wiz = wizardDescriptor;<NEW_LINE>Project project = Templates.getProject(wiz);<NEW_LINE>Sources sources = ProjectUtils.getSources(project);<NEW_LINE>sourceGroups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);<NEW_LINE>ejbPanel = new EntityWizardDescriptor();<NEW_LINE>WizardDescriptor.Panel targetChooserPanel;<NEW_LINE>// Need to check if there are any Java Source group. See issue 139851<NEW_LINE>if (sourceGroups.length == 0) {<NEW_LINE>sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC);<NEW_LINE>targetChooserPanel = new ValidatingPanel(Templates.buildSimpleTargetChooser(project, sourceGroups).bottomPanel(ejbPanel).create());<NEW_LINE>} else {<NEW_LINE>targetChooserPanel = new ValidatingPanel(JavaTemplates.createPackageChooser(project, sourceGroups, ejbPanel, true));<NEW_LINE>}<NEW_LINE>//<NEW_LINE>boolean noPuNeeded = true;<NEW_LINE>try {<NEW_LINE>noPuNeeded = ProviderUtil.persistenceExists(project, Templates.getTargetFolder(wiz)) || !ProviderUtil.isValidServerInstanceOrNone(project);<NEW_LINE>} catch (InvalidPersistenceXmlException ex) {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger(EntityWizard.class.getName()).log(Level.FINE, "Invalid persistence.xml");<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger(EntityWizard.class.getName()).log(Level.FINE, "Invalid persistence.xml");<NEW_LINE>}<NEW_LINE>if (noPuNeeded) {<NEW_LINE>panels = new <MASK><NEW_LINE>} else {<NEW_LINE>puPanel = new PersistenceUnitWizardDescriptor(project);<NEW_LINE>panels = new WizardDescriptor.Panel[] { targetChooserPanel, puPanel };<NEW_LINE>}<NEW_LINE>Wizards.mergeSteps(wiz, panels, null);<NEW_LINE>}
WizardDescriptor.Panel[] { targetChooserPanel };
386,228
private void computeLastStatementSelected() {<NEW_LINE>ASTNode[] nodes = getSelectedNodes();<NEW_LINE>if (nodes.length == 0) {<NEW_LINE>fIsLastStatementSelected = false;<NEW_LINE>} else {<NEW_LINE>Block body = null;<NEW_LINE>LambdaExpression enclosingLambdaExpr = ASTResolving.findEnclosingLambdaExpression(getFirstSelectedNode());<NEW_LINE>if (enclosingLambdaExpr != null) {<NEW_LINE><MASK><NEW_LINE>if (lambdaBody instanceof Block) {<NEW_LINE>body = (Block) lambdaBody;<NEW_LINE>} else {<NEW_LINE>fIsLastStatementSelected = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (fEnclosingBodyDeclaration instanceof MethodDeclaration) {<NEW_LINE>body = ((MethodDeclaration) fEnclosingBodyDeclaration).getBody();<NEW_LINE>} else if (fEnclosingBodyDeclaration instanceof Initializer) {<NEW_LINE>body = ((Initializer) fEnclosingBodyDeclaration).getBody();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (body != null) {<NEW_LINE>List<Statement> statements = body.statements();<NEW_LINE>if (statements.size() > 0) {<NEW_LINE>fIsLastStatementSelected = nodes[nodes.length - 1] == statements.get(statements.size() - 1);<NEW_LINE>} else {<NEW_LINE>fIsLastStatementSelected = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ASTNode lambdaBody = enclosingLambdaExpr.getBody();
569,614
public void configurarCores() {<NEW_LINE>mainpanel.setBackground(ColorController.FUNDO_MEDIO);<NEW_LINE>paineInferior.setBackground(ColorController.FUNDO_ESCURO);<NEW_LINE>painelTitleIssue.setBackground(ColorController.FUNDO_MEDIO);<NEW_LINE>labelTitleIssue.setForeground(ColorController.COR_LETRA);<NEW_LINE>painelTxtIssue.setBackground(ColorController.FUNDO_CLARO);<NEW_LINE>painelDescIssue.setBackground(ColorController.FUNDO_CLARO);<NEW_LINE>labelDescIssue.setForeground(ColorController.COR_LETRA);<NEW_LINE>painelBotaoIssue.setBackground(ColorController.FUNDO_CLARO);<NEW_LINE>jLabel1.setForeground(ColorController.COR_LETRA_TITULO);<NEW_LINE>if (WeblafUtils.weblafEstaInstalado()) {<NEW_LINE>WeblafUtils.configurarBotao(webButton2, ColorController.AMARELO, ColorController.FUNDO_ESCURO, ColorController.FUNDO_MEDIO, ColorController.COR_LETRA, 2, true);<NEW_LINE>WeblafUtils.configurarBotao(webButton1, ColorController.AMARELO, ColorController.FUNDO_ESCURO, ColorController.FUNDO_MEDIO, <MASK><NEW_LINE>}<NEW_LINE>}
ColorController.COR_LETRA, 2, true);
1,180,949
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject().field("state", state()).field("primary", primary()).field("node", currentNodeId()).field("relocating_node", relocatingNodeId()).field("shard", id()).<MASK><NEW_LINE>if (tokenRanges != null && tokenRanges.size() > 0) {<NEW_LINE>builder.field("token_ranges", tokenRanges);<NEW_LINE>}<NEW_LINE>if (expectedShardSize != UNAVAILABLE_EXPECTED_SHARD_SIZE) {<NEW_LINE>builder.field("expected_shard_size_in_bytes", expectedShardSize);<NEW_LINE>}<NEW_LINE>if (recoverySource != null) {<NEW_LINE>builder.field("recovery_source", recoverySource);<NEW_LINE>}<NEW_LINE>if (allocationId != null) {<NEW_LINE>builder.field("allocation_id");<NEW_LINE>allocationId.toXContent(builder, params);<NEW_LINE>}<NEW_LINE>if (unassignedInfo != null) {<NEW_LINE>unassignedInfo.toXContent(builder, params);<NEW_LINE>}<NEW_LINE>return builder.endObject();<NEW_LINE>}
field("index", getIndexName());
970,767
default void updateOrInsert(Map<String, List<String>> values, int ticketId, int eventId) {<NEW_LINE>Map<String, TicketFieldValue> toUpdate = findAllByTicketIdGroupedByName(ticketId);<NEW_LINE>values = Optional.ofNullable(values<MASK><NEW_LINE>var additionalFieldsForEvent = findAdditionalFieldsForEvent(eventId);<NEW_LINE>var readOnlyFields = additionalFieldsForEvent.stream().filter(TicketFieldConfiguration::isReadOnly).map(TicketFieldConfiguration::getName).collect(Collectors.toSet());<NEW_LINE>Map<String, Integer> fieldNameToId = additionalFieldsForEvent.stream().collect(Collectors.toMap(TicketFieldConfiguration::getName, TicketFieldConfiguration::getId));<NEW_LINE>values.forEach((fieldName, fieldValues) -> {<NEW_LINE>String fieldValue;<NEW_LINE>if (fieldValues.size() == 1) {<NEW_LINE>fieldValue = fieldValues.get(0);<NEW_LINE>} else if (fieldValues.stream().anyMatch(StringUtils::isNotBlank)) {<NEW_LINE>fieldValue = Json.toJson(fieldValues);<NEW_LINE>} else {<NEW_LINE>fieldValue = "";<NEW_LINE>}<NEW_LINE>boolean isNotBlank = StringUtils.isNotBlank(fieldValue);<NEW_LINE>if (toUpdate.containsKey(fieldName)) {<NEW_LINE>if (!readOnlyFields.contains(fieldName)) {<NEW_LINE>TicketFieldValue field = toUpdate.get(fieldName);<NEW_LINE>if (isNotBlank) {<NEW_LINE>updateValue(field.getTicketId(), field.getTicketFieldConfigurationId(), fieldValue);<NEW_LINE>} else {<NEW_LINE>deleteValue(field.getTicketId(), field.getTicketFieldConfigurationId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (fieldNameToId.containsKey(fieldName) && isNotBlank) {<NEW_LINE>insertValue(ticketId, fieldNameToId.get(fieldName), fieldValue);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
).orElseGet(Collections::emptyMap);
232,298
public void process(Page page) {<NEW_LINE>// http://progressdaily.diandian.com/post/2013-01-24/40046867275<NEW_LINE>List<String> requests = page.getHtml().xpath("//a[@class=\"area_link flat_btn\"]/@href").all();<NEW_LINE>if (requests.size() > 2) {<NEW_LINE>requests = requests.subList(0, 2);<NEW_LINE>}<NEW_LINE>page.addTargetRequests(requests);<NEW_LINE>page.addTargetRequests(page.getHtml().links().regex("(.*/restaurant/[^#]+)").all());<NEW_LINE>page.putField("items", page.getHtml<MASK><NEW_LINE>page.putField("prices", page.getHtml().xpath("//ul[@class=\"dishes menu_dishes\"]/li/span[@class=\"price_outer\"]/span[@class=\"price\"]/text()"));<NEW_LINE>}
().xpath("//ul[@class=\"dishes menu_dishes\"]/li/span[@class=\"name\"]/text()"));
251,174
public final AnyCharContext anyChar() throws RecognitionException {<NEW_LINE>AnyCharContext _localctx = new AnyCharContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 20, RULE_anyChar);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(97);<NEW_LINE><MASK><NEW_LINE>if (!((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << Backslash) | (1L << Colon) | (1L << Equals) | (1L << Exclamation) | (1L << Number) | (1L << LineBreak) | (1L << Space) | (1L << IdentifierChar))) != 0))) {<NEW_LINE>_errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_la = _input.LA(1);
1,777,698
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE><MASK><NEW_LINE>builder.xContentList(Fields.BOUND_ADDRESS, address.boundAddresses());<NEW_LINE>builder.field(Fields.PUBLISH_ADDRESS, formatPublishAddressString("transport.publish_address", address.publishAddress()));<NEW_LINE>builder.startObject(Fields.PROFILES);<NEW_LINE>if (profileAddresses != null && profileAddresses.size() > 0) {<NEW_LINE>for (Map.Entry<String, BoundTransportAddress> entry : profileAddresses.entrySet()) {<NEW_LINE>builder.startObject(entry.getKey());<NEW_LINE>builder.array(Fields.BOUND_ADDRESS, (Object[]) entry.getValue().boundAddresses());<NEW_LINE>String propertyName = "transport." + entry.getKey() + ".publish_address";<NEW_LINE>builder.field(Fields.PUBLISH_ADDRESS, formatPublishAddressString(propertyName, entry.getValue().publishAddress()));<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>}
builder.startObject(Fields.TRANSPORT);
477,012
// Treat Emacs profile specially in order to fix #191895<NEW_LINE>private void emacsProfileFix(final JTextComponent incSearchTextField) {<NEW_LINE>class JumpOutOfSearchAction extends AbstractAction {<NEW_LINE><NEW_LINE>private final String actionName;<NEW_LINE><NEW_LINE>public JumpOutOfSearchAction(String n) {<NEW_LINE>actionName = n;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>looseFocus();<NEW_LINE>if (getActualTextComponent() != null) {<NEW_LINE>ActionEvent ev = new ActionEvent(getActualTextComponent(), e.getID(), e.getActionCommand(), e.getModifiers());<NEW_LINE>Action action = getActualTextComponent().getActionMap().get(actionName);<NEW_LINE>action.actionPerformed(ev);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>String actionName = "caret-begin-line";<NEW_LINE>Action a1 = new JumpOutOfSearchAction(actionName);<NEW_LINE>incSearchTextField.getActionMap().put(actionName, a1);<NEW_LINE>// NOI18N<NEW_LINE>actionName = "caret-end-line";<NEW_LINE>Action a2 = new JumpOutOfSearchAction(actionName);<NEW_LINE>incSearchTextField.getActionMap().put(actionName, a2);<NEW_LINE>// NOI18N<NEW_LINE>incSearchTextField.getInputMap().// NOI18N<NEW_LINE>put(// NOI18N<NEW_LINE>KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent<MASK><NEW_LINE>// NOI18N<NEW_LINE>actionName = "caret-up";<NEW_LINE>Action a3 = new JumpOutOfSearchAction(actionName);<NEW_LINE>// NOI18N<NEW_LINE>incSearchTextField.getActionMap().put("caret-up-alt", a3);<NEW_LINE>// NOI18N<NEW_LINE>incSearchTextField.getInputMap().// NOI18N<NEW_LINE>put(// NOI18N<NEW_LINE>KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK, false), "caret-down-alt");<NEW_LINE>// NOI18N<NEW_LINE>actionName = "caret-down";<NEW_LINE>Action a4 = new JumpOutOfSearchAction(actionName);<NEW_LINE>// NOI18N<NEW_LINE>incSearchTextField.getActionMap().put("caret-down-alt", a4);<NEW_LINE>}
.CTRL_MASK, false), "caret-up-alt");
1,424,947
private void proposeMove() {<NEW_LINE>Integer action;<NEW_LINE>int time = (timeCombo.getSelectedIndex() + 1) * 5;<NEW_LINE>AdversarialSearch<ConnectFourState, Integer> search;<NEW_LINE>switch(strategyCombo.getSelectedIndex()) {<NEW_LINE>case 0:<NEW_LINE>search = MinimaxSearch.createFor(game);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>search = AlphaBetaSearch.createFor(game);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>search = IterativeDeepeningAlphaBetaSearch.createFor(<MASK><NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>search = new ConnectFourAIPlayer(game, time);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>search = new ConnectFourAIPlayer(game, time);<NEW_LINE>((ConnectFourAIPlayer) search).setLogEnabled(true);<NEW_LINE>}<NEW_LINE>action = search.makeDecision(currState);<NEW_LINE>searchMetrics = search.getMetrics();<NEW_LINE>currState = game.getResult(currState, action);<NEW_LINE>}
game, 0.0, 1.0, time);
1,235,511
public NestedSet<Artifact> discoverInputs(ActionExecutionContext actionExecutionContext) throws ActionExecutionException, InterruptedException {<NEW_LINE>// If the Starlark action shadows another action and the shadowed action discovers its inputs,<NEW_LINE>// we get the shadowed action's discovered inputs and append it to the Starlark action inputs.<NEW_LINE>if (shadowedAction.isPresent() && shadowedAction.get().discoversInputs()) {<NEW_LINE>Action shadowedActionObj = shadowedAction.get();<NEW_LINE>NestedSet<Artifact> oldInputs = getInputs();<NEW_LINE>NestedSet<Artifact> inputFilesForExtraAction = shadowedActionObj.getInputFilesForExtraAction(actionExecutionContext);<NEW_LINE>if (inputFilesForExtraAction == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>updateInputs(createInputs(shadowedActionObj.getInputs<MASK><NEW_LINE>return NestedSetBuilder.wrap(Order.STABLE_ORDER, Sets.<Artifact>difference(getInputs().toSet(), oldInputs.toSet()));<NEW_LINE>}<NEW_LINE>// Otherwise, we need to "re-discover" all the original inputs: the unused ones that were<NEW_LINE>// removed might now be needed.<NEW_LINE>updateInputs(allStarlarkActionInputs);<NEW_LINE>return allStarlarkActionInputs;<NEW_LINE>}
(), inputFilesForExtraAction, allStarlarkActionInputs));
945,430
private void handleErrorsOnSave(@Nonnull Map<Document, IOException> failures) {<NEW_LINE>if (ApplicationManager.getApplication().isUnitTestMode()) {<NEW_LINE>IOException ioException = ContainerUtil.getFirstItem(failures.values());<NEW_LINE>if (ioException != null) {<NEW_LINE>throw new RuntimeException(ioException);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (IOException exception : failures.values()) {<NEW_LINE>LOG.warn(exception);<NEW_LINE>}<NEW_LINE>final String text = StringUtil.join(failures.values(), Throwable::getMessage, "\n");<NEW_LINE>final DialogWrapper dialog = new DialogWrapper(null) {<NEW_LINE><NEW_LINE>{<NEW_LINE>init();<NEW_LINE>setTitle<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void createDefaultActions() {<NEW_LINE>super.createDefaultActions();<NEW_LINE>myOKAction.putValue(Action.NAME, UIBundle.message(myOnClose ? "cannot.save.files.dialog.ignore.changes" : "cannot.save.files.dialog.revert.changes"));<NEW_LINE>myOKAction.putValue(DEFAULT_ACTION, null);<NEW_LINE>if (!myOnClose) {<NEW_LINE>myCancelAction.putValue(Action.NAME, CommonBundle.getCloseButtonText());<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected JComponent createCenterPanel() {<NEW_LINE>final JPanel panel = new JPanel(new BorderLayout(0, 5));<NEW_LINE>panel.add(new JLabel(UIBundle.message("cannot.save.files.dialog.message")), BorderLayout.NORTH);<NEW_LINE>final JTextPane area = new JTextPane();<NEW_LINE>area.setText(text);<NEW_LINE>area.setEditable(false);<NEW_LINE>area.setMinimumSize(new Dimension(area.getMinimumSize().width, 50));<NEW_LINE>panel.add(new JBScrollPane(area, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER), BorderLayout.CENTER);<NEW_LINE>return panel;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (dialog.showAndGet()) {<NEW_LINE>for (Document document : failures.keySet()) {<NEW_LINE>reloadFromDisk(document);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(UIBundle.message("cannot.save.files.dialog.title"));
1,513,725
private void stageIndex(BlockingQueue<List<Tuple<NodeId>>> pipe, TupleIndex idx) {<NEW_LINE>TransactionCoordinator coordinator = CoLib.newCoordinator();<NEW_LINE>CoLib.add(coordinator, idx);<NEW_LINE>CoLib.start(coordinator);<NEW_LINE>Transaction transaction = coordinator.begin(TxnType.WRITE);<NEW_LINE>boolean workHasBeenDone;<NEW_LINE>try {<NEW_LINE>Destination<Tuple<NodeId>> loader = loadTuples(idx);<NEW_LINE>for (; ; ) {<NEW_LINE>List<Tuple<NodeId>> tuples = pipe.take();<NEW_LINE>if (tuples.isEmpty())<NEW_LINE>break;<NEW_LINE>loader.deliver(tuples);<NEW_LINE>}<NEW_LINE>workHasBeenDone = !idx.isEmpty();<NEW_LINE>transaction.commit();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Log.error(this, "Interrupted", ex);<NEW_LINE>transaction.abort();<NEW_LINE>workHasBeenDone = false;<NEW_LINE>}<NEW_LINE>CoLib.finish(coordinator);<NEW_LINE>if (workHasBeenDone)<NEW_LINE>output.print(<MASK><NEW_LINE>termination.release();<NEW_LINE>}
"Finish - index %s", idx.getName());
1,522,683
final ModifySecurityGroupRulesResult executeModifySecurityGroupRules(ModifySecurityGroupRulesRequest modifySecurityGroupRulesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifySecurityGroupRulesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifySecurityGroupRulesRequest> request = null;<NEW_LINE>Response<ModifySecurityGroupRulesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifySecurityGroupRulesRequestMarshaller().marshall(super.beforeMarshalling(modifySecurityGroupRulesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifySecurityGroupRules");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifySecurityGroupRulesResult> responseHandler = new StaxResponseHandler<ModifySecurityGroupRulesResult>(new ModifySecurityGroupRulesResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,771,959
public <T> void transitionLock(String topologyId, boolean errorOnNoTransition, StatusType changeStatus, T... args) throws Exception {<NEW_LINE>// get ZK's topology node's data, which is StormBase<NEW_LINE>StormBase stormbase = data.getStormClusterState(<MASK><NEW_LINE>if (stormbase == null) {<NEW_LINE>LOG.error("Cannot apply event: changing status " + topologyId + " -> " + changeStatus.getStatus() + ", cause: failed to get StormBase from ZK");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StormStatus currentStatus = stormbase.getStatus();<NEW_LINE>if (currentStatus == null) {<NEW_LINE>LOG.error("Cannot apply event: changing status " + topologyId + " -> " + changeStatus.getStatus() + ", cause: topologyStatus is null in ZK");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// <currentStatus, Map<changingStatus, callback>><NEW_LINE>Map<StatusType, Map<StatusType, Callback>> callbackMap = stateTransitions(topologyId, currentStatus);<NEW_LINE>// get current changingCallbacks<NEW_LINE>Map<StatusType, Callback> changingCallbacks = callbackMap.get(currentStatus.getStatusType());<NEW_LINE>if (changingCallbacks == null || !changingCallbacks.containsKey(changeStatus) || changingCallbacks.get(changeStatus) == null) {<NEW_LINE>String msg = "No transition for event: changing status:" + changeStatus.getStatus() + ", current status: " + currentStatus.getStatusType() + ", topology-id: " + topologyId;<NEW_LINE>LOG.info(msg);<NEW_LINE>if (errorOnNoTransition) {<NEW_LINE>throw new RuntimeException(msg);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Callback callback = changingCallbacks.get(changeStatus);<NEW_LINE>Object obj = callback.execute(args);<NEW_LINE>if (obj != null && obj instanceof StormStatus) {<NEW_LINE>StormStatus newStatus = (StormStatus) obj;<NEW_LINE>// update status to ZK<NEW_LINE>data.getStormClusterState().update_storm(topologyId, newStatus);<NEW_LINE>LOG.info("Successfully updated " + topologyId + " to status " + newStatus);<NEW_LINE>}<NEW_LINE>LOG.info("Successfully apply event: changing status " + topologyId + " -> " + changeStatus.getStatus());<NEW_LINE>}
).storm_base(topologyId, null);
1,081,304
public void clusterChanged(ClusterChangedEvent event) {<NEW_LINE>if (event.localNodeMaster() && refreshAndRescheduleRunnable.get() == null) {<NEW_LINE>LOGGER.trace("elected as master, scheduling cluster info update tasks");<NEW_LINE>executeRefresh(event.state(), "became master");<NEW_LINE>final RefreshAndRescheduleRunnable newRunnable = new RefreshAndRescheduleRunnable();<NEW_LINE>refreshAndRescheduleRunnable.set(newRunnable);<NEW_LINE>threadPool.scheduleUnlessShuttingDown(updateFrequency, REFRESH_EXECUTOR, newRunnable);<NEW_LINE>} else if (event.localNodeMaster() == false) {<NEW_LINE>refreshAndRescheduleRunnable.set(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (enabled == false) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Refresh if a data node was added<NEW_LINE>for (DiscoveryNode addedNode : event.nodesDelta().addedNodes()) {<NEW_LINE>if (addedNode.isDataNode()) {<NEW_LINE>executeRefresh(event.state(), "data node added");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Clean up info for any removed nodes<NEW_LINE>for (DiscoveryNode removedNode : event.nodesDelta().removedNodes()) {<NEW_LINE>if (removedNode.isDataNode()) {<NEW_LINE>LOGGER.trace(<MASK><NEW_LINE>if (leastAvailableSpaceUsages.containsKey(removedNode.getId())) {<NEW_LINE>ImmutableOpenMap.Builder<String, DiskUsage> newMaxUsages = ImmutableOpenMap.builder(leastAvailableSpaceUsages);<NEW_LINE>newMaxUsages.remove(removedNode.getId());<NEW_LINE>leastAvailableSpaceUsages = newMaxUsages.build();<NEW_LINE>}<NEW_LINE>if (mostAvailableSpaceUsages.containsKey(removedNode.getId())) {<NEW_LINE>ImmutableOpenMap.Builder<String, DiskUsage> newMinUsages = ImmutableOpenMap.builder(mostAvailableSpaceUsages);<NEW_LINE>newMinUsages.remove(removedNode.getId());<NEW_LINE>mostAvailableSpaceUsages = newMinUsages.build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Removing node from cluster info: {}", removedNode.getId());
569,745
public final MapIndexInfo createMapIndexInfo() {<NEW_LINE>MapContainer mapContainer = recordStore.getMapContainer();<NEW_LINE>Set<IndexConfig> indexConfigs = new HashSet<>();<NEW_LINE>if (mapContainer.isGlobalIndexEnabled()) {<NEW_LINE>// global-index<NEW_LINE>final Indexes indexes = mapContainer.getIndexes();<NEW_LINE>for (Index index : indexes.getIndexes()) {<NEW_LINE>indexConfigs.add(index.getConfig());<NEW_LINE>}<NEW_LINE>indexConfigs.<MASK><NEW_LINE>} else {<NEW_LINE>// partitioned-index<NEW_LINE>final Indexes indexes = mapContainer.getIndexes(partitionId);<NEW_LINE>if (indexes != null && indexes.haveAtLeastOneIndexOrDefinition()) {<NEW_LINE>for (Index index : indexes.getIndexes()) {<NEW_LINE>indexConfigs.add(index.getConfig());<NEW_LINE>}<NEW_LINE>indexConfigs.addAll(indexes.getIndexDefinitions());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new MapIndexInfo(mapName).addIndexCofigs(indexConfigs);<NEW_LINE>}
addAll(indexes.getIndexDefinitions());
328,683
private static String compressImgAndroid(Bitmap bitmap, String filePath, CompressFormat compressFormat) throws IOException {<NEW_LINE>Logger.D(TAG, "compressImgAndroid+");<NEW_LINE>Exception throwing = null;<NEW_LINE>OutputStream output = null;<NEW_LINE>try {<NEW_LINE>Logger.<MASK><NEW_LINE>output = getOutputStream(filePath);<NEW_LINE>bitmap.compress(compressFormat, 100, output);<NEW_LINE>output.flush();<NEW_LINE>} catch (InvalidParameterException e) {<NEW_LINE>Logger.W(TAG, e.getMessage());<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Logger.W(TAG, "Cannot create file");<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Logger.W(TAG, "Error in compressing signature image");<NEW_LINE>throwing = e;<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Logger.W(TAG, "Error in creating signature image file");<NEW_LINE>throwing = e;<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (output != null)<NEW_LINE>output.close();<NEW_LINE>} catch (IOException e) {
D(TAG, "saving image to: " + filePath);
1,179,066
private // throws<NEW_LINE>// throws<NEW_LINE>SupertypeQueryResults // throws<NEW_LINE>computeSupertypes(// ClassNotFoundException<NEW_LINE>ClassDescriptor classDescriptor) {<NEW_LINE>if (DEBUG_QUERIES) {<NEW_LINE>System.out.println("Computing supertypes for " + classDescriptor.toDottedClassName());<NEW_LINE>}<NEW_LINE>// Try to fully resolve the class and its superclasses/superinterfaces.<NEW_LINE>ClassVertex typeVertex = optionallyResolveClassVertex(classDescriptor);<NEW_LINE>// Create new empty SupertypeQueryResults.<NEW_LINE>SupertypeQueryResults supertypeSet = new SupertypeQueryResults();<NEW_LINE>// Add all known superclasses/superinterfaces.<NEW_LINE>// The ClassVertexes for all of them should be in the<NEW_LINE>// InheritanceGraph by now.<NEW_LINE>LinkedList<ClassVertex> workList = new LinkedList<>();<NEW_LINE>workList.addLast(typeVertex);<NEW_LINE>while (!workList.isEmpty()) {<NEW_LINE>ClassVertex vertex = workList.removeFirst();<NEW_LINE>supertypeSet.addSupertype(vertex.getClassDescriptor());<NEW_LINE>if (vertex.isResolved()) {<NEW_LINE>if (DEBUG_QUERIES) {<NEW_LINE>System.out.println(" Adding supertype " + vertex.getClassDescriptor().toDottedClassName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (DEBUG_QUERIES) {<NEW_LINE>System.out.println(" Encountered unresolved class " + vertex.getClassDescriptor(<MASK><NEW_LINE>}<NEW_LINE>supertypeSet.setEncounteredMissingClasses(true);<NEW_LINE>}<NEW_LINE>Iterator<InheritanceEdge> i = graph.outgoingEdgeIterator(vertex);<NEW_LINE>while (i.hasNext()) {<NEW_LINE>InheritanceEdge edge = i.next();<NEW_LINE>workList.addLast(edge.getTarget());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return supertypeSet;<NEW_LINE>}
).toDottedClassName() + " in supertype query");
721,919
private <T> void evaluateBundle(final AppliedPTransform<?, ?, ?> transform, final CommittedBundle<T> bundle, final CompletionCallback onComplete) {<NEW_LINE>TransformExecutorService transformExecutor;<NEW_LINE>if (isKeyed(bundle.getPCollection())) {<NEW_LINE>final StepAndKey stepAndKey = StepAndKey.of(<MASK><NEW_LINE>// This executor will remain reachable until it has executed all scheduled transforms.<NEW_LINE>// The TransformExecutors keep a strong reference to the Executor, the ExecutorService keeps<NEW_LINE>// a reference to the scheduled DirectTransformExecutor callable. Follow-up TransformExecutors<NEW_LINE>// (scheduled due to the completion of another DirectTransformExecutor) are provided to the<NEW_LINE>// ExecutorService before the Earlier DirectTransformExecutor callable completes.<NEW_LINE>transformExecutor = serialExecutorServices.getUnchecked(stepAndKey);<NEW_LINE>} else {<NEW_LINE>transformExecutor = parallelExecutorService;<NEW_LINE>}<NEW_LINE>TransformExecutor callable = executorFactory.create(bundle, transform, onComplete, transformExecutor);<NEW_LINE>if (!pipelineState.get().isTerminal()) {<NEW_LINE>transformExecutor.schedule(callable);<NEW_LINE>}<NEW_LINE>}
transform, bundle.getKey());
1,699,472
final ListExperimentTemplatesResult executeListExperimentTemplates(ListExperimentTemplatesRequest listExperimentTemplatesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listExperimentTemplatesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListExperimentTemplatesRequest> request = null;<NEW_LINE>Response<ListExperimentTemplatesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListExperimentTemplatesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listExperimentTemplatesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "fis");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListExperimentTemplates");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListExperimentTemplatesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListExperimentTemplatesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,762,087
private Expression<?> castIfNeeded(Type elementType, Expression<?> symb_value) {<NEW_LINE>// cast integer to real if needed<NEW_LINE>if ((TypeUtil.isFp32(elementType) || TypeUtil.isFp64(elementType)) && symb_value instanceof IntegerValue) {<NEW_LINE>IntegerValue intExpr = (IntegerValue) symb_value;<NEW_LINE>double concValue = intExpr.getConcreteValue().doubleValue();<NEW_LINE>symb_value = new IntegerToRealCast(intExpr, concValue);<NEW_LINE>} else if ((TypeUtil.isBv32(elementType) || TypeUtil.isBv64(elementType)) && symb_value instanceof RealValue) {<NEW_LINE>RealValue realExpr = (RealValue) symb_value;<NEW_LINE>long concValue = realExpr.getConcreteValue().longValue();<NEW_LINE>symb_value <MASK><NEW_LINE>}<NEW_LINE>return symb_value;<NEW_LINE>}
= new RealToIntegerCast(realExpr, concValue);
1,553,858
public void initParam(Object obj) {<NEW_LINE>OptionsParam optionsParam = (OptionsParam) obj;<NEW_LINE>ConnectionParam connectionParam = optionsParam.getConnectionParam();<NEW_LINE>this.spinnerTimeoutInSecs.<MASK><NEW_LINE>checkBoxHttpStateEnabled.setSelected(connectionParam.isHttpStateEnabled());<NEW_LINE>getProxyExcludedDomainsTableModel().setExcludedDomains(connectionParam.getProxyExcludedDomains());<NEW_LINE>getProxyExcludedDomainsPanel().setRemoveWithoutConfirmation(!connectionParam.isConfirmRemoveProxyExcludedDomain());<NEW_LINE>chkUseProxyChain.setSelected(connectionParam.isUseProxyChain());<NEW_LINE>// set Proxy Chain parameters<NEW_LINE>txtProxyChainName.setText(connectionParam.getProxyChainName());<NEW_LINE>txtProxyChainName.discardAllEdits();<NEW_LINE>// ZAP: Do not allow invalid port numbers<NEW_LINE>spinnerProxyChainPort.setValue(connectionParam.getProxyChainPort());<NEW_LINE>chkProxyChainAuth.setSelected(connectionParam.isUseProxyChainAuth());<NEW_LINE>txtProxyChainRealm.setText(connectionParam.getProxyChainRealm());<NEW_LINE>txtProxyChainRealm.discardAllEdits();<NEW_LINE>txtProxyChainUserName.setText(connectionParam.getProxyChainUserName());<NEW_LINE>txtProxyChainUserName.discardAllEdits();<NEW_LINE>chkProxyChainPrompt.setSelected(connectionParam.isProxyChainPrompt());<NEW_LINE>// Default don't show (everytime)<NEW_LINE>chkShowPassword.setSelected(false);<NEW_LINE>// Default mask (everytime)<NEW_LINE>txtProxyChainPassword.setEchoChar('*');<NEW_LINE>setProxyChainEnabled(connectionParam.isUseProxyChain());<NEW_LINE>if (!connectionParam.isProxyChainPrompt()) {<NEW_LINE>txtProxyChainPassword.setText(connectionParam.getProxyChainPassword());<NEW_LINE>}<NEW_LINE>dnsTtlSuccessfulQueriesNumberSpinner.setValue(connectionParam.getDnsTtlSuccessfulQueries());<NEW_LINE>securityProtocolsPanel.setSecurityProtocolsEnabled(connectionParam.getSecurityProtocolsEnabled());<NEW_LINE>defaultUserAgent.setText(connectionParam.getDefaultUserAgent());<NEW_LINE>setUaFromString();<NEW_LINE>socksProxyPanel.initParam(connectionParam);<NEW_LINE>}
setValue(connectionParam.getTimeoutInSecs());
507,631
protected static void open(final String[] args, final TerminalPreferences defaults) {<NEW_LINE>// Register preferences<NEW_LINE>PreferencesFactory.set(defaults);<NEW_LINE>final <MASK><NEW_LINE>final Console console = new Console();<NEW_LINE>try {<NEW_LINE>final CommandLineParser parser = new DefaultParser();<NEW_LINE>final CommandLine input = parser.parse(options, args);<NEW_LINE>final Terminal terminal = new Terminal(defaults, options, input);<NEW_LINE>switch(terminal.execute()) {<NEW_LINE>case success:<NEW_LINE>console.printf("%s%n", StringUtils.EMPTY);<NEW_LINE>System.exit(0);<NEW_LINE>case failure:<NEW_LINE>console.printf("%s%n", StringUtils.EMPTY);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>} catch (ParseException e) {<NEW_LINE>console.printf("%s%n", e.getMessage());<NEW_LINE>console.printf("Try '%s' for more options.%n", "duck --help");<NEW_LINE>System.exit(1);<NEW_LINE>} catch (FactoryException e) {<NEW_LINE>console.printf("%s%n", e.getMessage());<NEW_LINE>System.exit(1);<NEW_LINE>} catch (Throwable error) {<NEW_LINE>error.printStackTrace(System.err);<NEW_LINE>System.exit(1);<NEW_LINE>} finally {<NEW_LINE>// Clear temporary files<NEW_LINE>TemporaryFileServiceFactory.get().shutdown();<NEW_LINE>}<NEW_LINE>}
Options options = TerminalOptionsBuilder.options();
1,490,413
private boolean assertConsistentWithClusterState(ClusterState state) {<NEW_LINE>final SnapshotsInProgress snapshotsInProgress = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY);<NEW_LINE>if (snapshotsInProgress.isEmpty() == false) {<NEW_LINE>synchronized (endingSnapshots) {<NEW_LINE>final Set<Snapshot> runningSnapshots = Stream.concat(snapshotsInProgress.asStream().map(SnapshotsInProgress.Entry::snapshot), endingSnapshots.stream()).collect(Collectors.toSet());<NEW_LINE>final Set<Snapshot> snapshotListenerKeys = snapshotCompletionListeners.keySet();<NEW_LINE>assert runningSnapshots.containsAll(snapshotListenerKeys) <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>final SnapshotDeletionsInProgress snapshotDeletionsInProgress = state.custom(SnapshotDeletionsInProgress.TYPE, SnapshotDeletionsInProgress.EMPTY);<NEW_LINE>if (snapshotDeletionsInProgress.hasDeletionsInProgress()) {<NEW_LINE>synchronized (repositoryOperations.runningDeletions) {<NEW_LINE>final Set<String> runningDeletes = Stream.concat(snapshotDeletionsInProgress.getEntries().stream().map(SnapshotDeletionsInProgress.Entry::uuid), repositoryOperations.runningDeletions.stream()).collect(Collectors.toSet());<NEW_LINE>final Set<String> deleteListenerKeys = snapshotDeletionListeners.keySet();<NEW_LINE>assert runningDeletes.containsAll(deleteListenerKeys) : "Saw deletions listeners for unknown uuids in " + deleteListenerKeys + " but running deletes are " + runningDeletes;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
: "Saw completion listeners for unknown snapshots in " + snapshotListenerKeys + " but running snapshots are " + runningSnapshots;
579,966
protected void applySettingsInternal(Element element, boolean presentationSettings) {<NEW_LINE>if (!isSettingsEnabled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (defaultSettings == null) {<NEW_LINE>// save default view before apply custom<NEW_LINE>defaultSettings = DocumentHelper.createDocument();<NEW_LINE>defaultSettings.setRootElement(defaultSettings.addElement("presentation"));<NEW_LINE>saveSettings(defaultSettings.getRootElement());<NEW_LINE>}<NEW_LINE>String textSelection = element.attributeValue("textSelection");<NEW_LINE>if (StringUtils.isNotEmpty(textSelection)) {<NEW_LINE>component.setTextSelectionEnabled<MASK><NEW_LINE>if (component.getPresentations() != null) {<NEW_LINE>((TablePresentations) component.getPresentations()).updateTextSelection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Element columnsElem = getColumnsElement(element);<NEW_LINE>boolean refreshWasEnabled = component.disableContentBufferRefreshing();<NEW_LINE>Collection<String> modelIds = new ArrayList<>();<NEW_LINE>for (Object column : component.getVisibleColumns()) {<NEW_LINE>modelIds.add(String.valueOf(column));<NEW_LINE>}<NEW_LINE>Collection<String> loadedIds = new ArrayList<>();<NEW_LINE>for (Element colElem : columnsElem.elements("columns")) {<NEW_LINE>loadedIds.add(colElem.attributeValue("id"));<NEW_LINE>}<NEW_LINE>ClientConfig clientConfig = configuration.getConfig(ClientConfig.class);<NEW_LINE>if (clientConfig.getLoadObsoleteSettingsForTable() || CollectionUtils.isEqualCollection(modelIds, loadedIds)) {<NEW_LINE>applyColumnSettings(element, presentationSettings);<NEW_LINE>}<NEW_LINE>component.enableContentBufferRefreshing(refreshWasEnabled);<NEW_LINE>}
(Boolean.parseBoolean(textSelection));
1,072,690
public RepositoryData addSnapshot(final SnapshotId snapshotId, final SnapshotState snapshotState, final List<IndexId> snapshottedIndices) {<NEW_LINE>if (snapshotIds.containsKey(snapshotId.getUUID())) {<NEW_LINE>// if the snapshot id already exists in the repository data, it means an old master<NEW_LINE>// that is blocked from the cluster is trying to finalize a snapshot concurrently with<NEW_LINE>// the new master, so we make the operation idempotent<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>Map<String, SnapshotId> snapshots <MASK><NEW_LINE>snapshots.put(snapshotId.getUUID(), snapshotId);<NEW_LINE>Map<String, SnapshotState> newSnapshotStates = new HashMap<>(snapshotStates);<NEW_LINE>newSnapshotStates.put(snapshotId.getUUID(), snapshotState);<NEW_LINE>Map<IndexId, Set<SnapshotId>> allIndexSnapshots = new HashMap<>(indexSnapshots);<NEW_LINE>for (final IndexId indexId : snapshottedIndices) {<NEW_LINE>if (allIndexSnapshots.containsKey(indexId)) {<NEW_LINE>Set<SnapshotId> ids = allIndexSnapshots.get(indexId);<NEW_LINE>if (ids == null) {<NEW_LINE>ids = new LinkedHashSet<>();<NEW_LINE>allIndexSnapshots.put(indexId, ids);<NEW_LINE>}<NEW_LINE>ids.add(snapshotId);<NEW_LINE>} else {<NEW_LINE>Set<SnapshotId> ids = new LinkedHashSet<>();<NEW_LINE>ids.add(snapshotId);<NEW_LINE>allIndexSnapshots.put(indexId, ids);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new RepositoryData(genId, snapshots, newSnapshotStates, allIndexSnapshots, incompatibleSnapshotIds);<NEW_LINE>}
= new HashMap<>(snapshotIds);
164,700
private synchronized void initializeIfNeeded() throws MinecraftInterfaceException {<NEW_LINE>if (isInitialized) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Since 21w14a, the registry classes check that the game is bootstrapped,<NEW_LINE>// so toggle the relevant flag to make it so.<NEW_LINE>// If this cause issues, we may need to actually bootstrap the game instead of faking it.<NEW_LINE>bootstrapClass.getField(SymbolicNames.FIELD_BOOTSTRAP_IS_BOOTSTRAPPED).getRawField().setBoolean(null, true);<NEW_LINE>// Also since 21w14a, the Minecraft version needs to be detected manually.<NEW_LINE>if (sharedConstantsClass != null) {<NEW_LINE>sharedConstantsClass.callStaticMethod(SymbolicNames.METHOD_SHARED_CONSTANTS_DETECT_VERSION);<NEW_LINE>}<NEW_LINE>if (registryAccessClass == null) {<NEW_LINE>registryAccess = null;<NEW_LINE>biomeRegistry = getLegacyBiomeRegistry();<NEW_LINE>} else {<NEW_LINE>Object key = ((SymbolicObject) registryClass.callStaticMethod(SymbolicNames.METHOD_REGISTRY_CREATE_KEY, "worldgen/biome")).getObject();<NEW_LINE>// We don't use symbolic calls, because they are inconsistently wrapped in SymbolicObject.<NEW_LINE>if (registryAccessClass.hasMethod(SymbolicNames.METHOD_REGISTRY_ACCESS_BUILTIN)) {<NEW_LINE>registryAccess = registryAccessClass.getMethod(SymbolicNames.METHOD_REGISTRY_ACCESS_BUILTIN).getRawMethod().invoke(null);<NEW_LINE>} else {<NEW_LINE>registryAccess = registryAccessClass.getMethod(SymbolicNames.METHOD_REGISTRY_ACCESS_BUILTIN2).<MASK><NEW_LINE>}<NEW_LINE>biomeRegistry = registryAccessClass.getMethod(SymbolicNames.METHOD_REGISTRY_ACCESS_GET_REGISTRY).getRawMethod().invoke(registryAccess, key);<NEW_LINE>biomeRegistry = Objects.requireNonNull(biomeRegistry);<NEW_LINE>}<NEW_LINE>stopAllExecutors();<NEW_LINE>registryGetIdMethod = ReflectionUtils.getMethodHandle(registryClass, SymbolicNames.METHOD_REGISTRY_GET_ID);<NEW_LINE>biomeProviderGetBiomeMethod = ReflectionUtils.getMethodHandle(noiseBiomeProviderClass, SymbolicNames.METHOD_NOISE_BIOME_PROVIDER_GET_BIOME);<NEW_LINE>biomeZoomerGetBiomeMethod = ReflectionUtils.getMethodHandle(biomeZoomerClass, SymbolicNames.METHOD_BIOME_ZOOMER_GET_BIOME);<NEW_LINE>overworldResourceKey = createResourceKey("overworld");<NEW_LINE>netherResourceKey = createResourceKey("the_nether");<NEW_LINE>} catch (IllegalArgumentException | IllegalAccessException | InstantiationException | InvocationTargetException e) {<NEW_LINE>throw new MinecraftInterfaceException("unable to initialize the MinecraftInterface", e);<NEW_LINE>}<NEW_LINE>isInitialized = true;<NEW_LINE>}
getRawMethod().invoke(null);
1,833,562
protected void startUp() throws Exception {<NEW_LINE>shell.execute(adbCommand("start-server")).orThrow();<NEW_LINE>String selector = nullToEmpty(config().options().get("selector"));<NEW_LINE>ImmutableList<String> getSerialNumber = adbCommand(Iterables.concat(Splitter.on(' ').omitEmptyStrings().split(selector), ImmutableList.of("get-serialno")));<NEW_LINE>String deviceSerialNumber = shell.execute(getSerialNumber).orThrow().stdout();<NEW_LINE>selectDevice(deviceSerialNumber);<NEW_LINE>install(getWorkerApk());<NEW_LINE>// This method waits for the server to be running. We need to get it here rather than injecting<NEW_LINE>// the port since both the AdbDevice and the ServerSocketService need to be started up by the<NEW_LINE>// same ServiceManager and we'd deadlock trying to get the port if we tried to inject it.<NEW_LINE>this<MASK><NEW_LINE>setReversePortForwarding();<NEW_LINE>startActivity("com.google.caliper/.worker.CaliperProxyActivity", ImmutableMap.of("com.google.caliper.runner_port", "" + port, "com.google.caliper.proxy_id", proxyConnection.proxyId().toString()));<NEW_LINE>try {<NEW_LINE>proxyConnection.startAsync().awaitRunning(30, SECONDS);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>throw new DeviceException("Timed out waiting for a connection from the Caliper proxy app on the device. It may " + "have failed to start.", e);<NEW_LINE>}<NEW_LINE>this.remoteClasspath = proxyConnection.getRemoteClasspath();<NEW_LINE>this.remoteNativeLibraryDir = proxyConnection.getRemoteNativeLibraryDir();<NEW_LINE>}
.port = server.getPort();
702,235
public void build(LiteralArgumentBuilder<CommandSource> builder) {<NEW_LINE>builder.executes(context -> {<NEW_LINE>// Modules<NEW_LINE>List<Module> modules = Modules.get().getAll().stream().filter(module -> module.keybind.isSet()).collect(Collectors.toList());<NEW_LINE>ChatUtils.info("--- Bound Modules ((highlight)%d(default)) ---", modules.size());<NEW_LINE>for (Module module : modules) {<NEW_LINE>HoverEvent hoverEvent = new HoverEvent(HoverEvent.Action<MASK><NEW_LINE>MutableText text = new LiteralText(module.title).formatted(Formatting.WHITE);<NEW_LINE>text.setStyle(text.getStyle().withHoverEvent(hoverEvent));<NEW_LINE>MutableText sep = new LiteralText(" - ");<NEW_LINE>sep.setStyle(sep.getStyle().withHoverEvent(hoverEvent));<NEW_LINE>text.append(sep.formatted(Formatting.GRAY));<NEW_LINE>MutableText key = new LiteralText(module.keybind.toString());<NEW_LINE>key.setStyle(key.getStyle().withHoverEvent(hoverEvent));<NEW_LINE>text.append(key.formatted(Formatting.GRAY));<NEW_LINE>ChatUtils.sendMsg(text);<NEW_LINE>}<NEW_LINE>return SINGLE_SUCCESS;<NEW_LINE>});<NEW_LINE>}
.SHOW_TEXT, getTooltip(module));
1,335,377
public void appLoaded(String applicationName, SipAppDesc desc) {<NEW_LINE>ApplicationModuleInterface application = getAppObj(desc.getAppIndexForPmi());<NEW_LINE>if (application == null) {<NEW_LINE>application = PerformanceMgr.getInstance().getApplicationsPMIListener().getApplicationModule(applicationName);<NEW_LINE>// Timer thread can access the _appTable<NEW_LINE>synchronized (_appTable) {<NEW_LINE>Integer index = new Integer(c_lastPMIIndex++);<NEW_LINE>_appTable.put(index, application);<NEW_LINE>desc.setAppIndexForPmi(index);<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE><MASK><NEW_LINE>buff.append("Application loaded name < ");<NEW_LINE>buff.append(applicationName);<NEW_LINE>buff.append("> index < ");<NEW_LINE>buff.append(index);<NEW_LINE>buff.append(">");<NEW_LINE>c_logger.traceDebug(this, "appLoaded", buff.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (c_logger.isWarnEnabled()) {<NEW_LINE>Object[] args = { applicationName };<NEW_LINE>c_logger.error("warn.server.application.exist", Situation.SITUATION_REPORT, args);<NEW_LINE>}<NEW_LINE>}
StringBuffer buff = new StringBuffer(100);
953,610
private void showAuthorNotice() {<NEW_LINE>FirebaseRemoteConfig mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();<NEW_LINE>FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder().setMinimumFetchIntervalInSeconds(3600).build();<NEW_LINE>mFirebaseRemoteConfig.setConfigSettingsAsync(configSettings);<NEW_LINE>mFirebaseRemoteConfig.setDefaultsAsync(R.xml.remote_config);<NEW_LINE>mFirebaseRemoteConfig.fetchAndActivate().addOnCompleteListener(this, new OnCompleteListener<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete(@NonNull Task<Boolean> task) {<NEW_LINE>if (task.isSuccessful()) {<NEW_LINE>boolean updated = task.getResult();<NEW_LINE>Log.d("FireBase_FirstOpenMsg", "Config params updated: " + updated);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String showMsg = mFirebaseRemoteConfig.getString("first_open_msg");<NEW_LINE>if (!mPreference.getBoolean(PreferenceManager.PREF_MAIN_NOTICE, false) || showMsg.compareTo(mPreference.getString(PreferenceManager.PREF_MAIN_NOTICE_LAST, "")) != 0) {<NEW_LINE>mPreference.putString(PreferenceManager.PREF_MAIN_NOTICE_LAST, showMsg);<NEW_LINE>MessageDialogFragment fragment = MessageDialogFragment.newInstance(R.string.main_notice, showMsg, false, DIALOG_REQUEST_NOTICE);<NEW_LINE>fragment.show(getSupportFragmentManager(), null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
Log.d("FireBase_FirstOpenMsg", "Config params updated Failed. ");
423,918
private synchronized int _put(int key, MODE m) {<NEW_LINE>IntLinkedSetry[] buk = table;<NEW_LINE>int index = hash(key) % buk.length;<NEW_LINE>for (IntLinkedSetry e = buk[index]; e != null; e = e.next) {<NEW_LINE>if (CompareUtil.equals(e.key, key)) {<NEW_LINE>switch(m) {<NEW_LINE>case FORCE_FIRST:<NEW_LINE>if (header.link_next != e) {<NEW_LINE>unchain(e);<NEW_LINE>chain(header, header.link_next, e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FORCE_LAST:<NEW_LINE>if (header.link_prev != e) {<NEW_LINE>unchain(e);<NEW_LINE>chain(header.link_prev, header, e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return key;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (max > 0) {<NEW_LINE>switch(m) {<NEW_LINE>case FORCE_FIRST:<NEW_LINE>case FIRST:<NEW_LINE>while (count >= max) {<NEW_LINE>int v = header.link_prev.key;<NEW_LINE>remove(v);<NEW_LINE>overflowed(v);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FORCE_LAST:<NEW_LINE>case LAST:<NEW_LINE>while (count >= max) {<NEW_LINE>int v = header.link_next.key;<NEW_LINE>remove(v);<NEW_LINE>overflowed(v);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (count >= threshold) {<NEW_LINE>rehash();<NEW_LINE>buk = table;<NEW_LINE>index = hash(key) % buk.length;<NEW_LINE>}<NEW_LINE>IntLinkedSetry e = new IntLinkedSetry(key, buk[index]);<NEW_LINE>buk[index] = e;<NEW_LINE>switch(m) {<NEW_LINE>case FORCE_FIRST:<NEW_LINE>case FIRST:<NEW_LINE>chain(header, header.link_next, e);<NEW_LINE>break;<NEW_LINE>case FORCE_LAST:<NEW_LINE>case LAST:<NEW_LINE>chain(<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>return NONE;<NEW_LINE>}
header.link_prev, header, e);
1,837,028
private void checkValidity() {<NEW_LINE>if (booleanReleaseCalled.get()) {<NEW_LINE>String id = "none";<NEW_LINE>if ((wsBBRoot != null) && (wsBBRoot.pool != null)) {<NEW_LINE>id = Integer.toString(wsBBRoot.getID());<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Attempt to access WsByteBuffer that was already released." + "\nWsByteBuffer: ID: " + <MASK><NEW_LINE>}<NEW_LINE>RuntimeException iae = new RuntimeException("Invalid call to WsByteBuffer method. Buffer has already been released." + "\nWsByteBuffer: ID: " + id + "\nBuffer: " + this.oByteBuffer);<NEW_LINE>FFDCFilter.processException(iae, getClass().getName() + ".checkValidity", "1", this);<NEW_LINE>throw iae;<NEW_LINE>}<NEW_LINE>if (ownerID != null) {<NEW_LINE>// if there is a ownerID, then leak detection is on, so record<NEW_LINE>// that the buffer has been accessed.<NEW_LINE>this.lastAccessTime = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>}
id + " Sub ID: " + this.oByteBuffer);
568,185
private void createMQLinkEngineResources(MQLinkDefinition mqld, MQLinkHandler mqLinkHandler) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "createMQLinkEngineResources", new Object[] { mqld, mqLinkHandler });<NEW_LINE>// Call the MQLinkManager to create the MQLink infrastructure.<NEW_LINE>MQLinkManager mqlinkManager = getMQLinkManager();<NEW_LINE>// Call MQLink Component<NEW_LINE>MQLinkObject mqlinkObj = null;<NEW_LINE>try {<NEW_LINE>// MQLinkDefinition is a new Admin wrapper class<NEW_LINE>mqlinkObj = // MQLinkDefinition is a new Admin wrapper class<NEW_LINE>mqlinkManager.// MQLinkDefinition is a new Admin wrapper class<NEW_LINE>create(// Create full "live" link<NEW_LINE>mqld, // Create full "live" link<NEW_LINE>(MQLinkLocalization) mqLinkHandler, // Create full "live" link<NEW_LINE>(ControllableRegistrationService) messageProcessor.getMEInstance(SIMPConstants.JS_MBEAN_FACTORY), false);<NEW_LINE>// Notify the MQLink component that mp has already started in the dynamic case<NEW_LINE>// but not if this is part of startup processing<NEW_LINE>if (messageProcessor.isStarted())<NEW_LINE>mqlinkObj.mpStarted(JsConstants.ME_START_DEFAULT, messageProcessor.getMessagingEngine());<NEW_LINE>} catch (SIResourceException e) {<NEW_LINE>// No FFDC code needed<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>} catch (SIException e) {<NEW_LINE>// No FFDC code needed<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>}<NEW_LINE>// Store mqlinkObj in the handler<NEW_LINE>mqLinkHandler.setMQLinkObject(mqlinkObj);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE><MASK><NEW_LINE>}
SibTr.exit(tc, "createMQLinkEngineResources");
1,236,873
public void createWorkflowDef(WorkflowDef workflowDef) {<NEW_LINE>try {<NEW_LINE>String workflowDefinition = toJson(workflowDef);<NEW_LINE>if (!session.execute(insertWorkflowDefStatement.bind(workflowDef.getName(), workflowDef.getVersion(), workflowDefinition)).wasApplied()) {<NEW_LINE>throw new ApplicationException(Code.CONFLICT, String.format("Workflow: %s, version: %s already exists!", workflowDef.getName(), workflowDef.getVersion()));<NEW_LINE>}<NEW_LINE>String workflowDefIndex = getWorkflowDefIndexValue(workflowDef.getName(), workflowDef.getVersion());<NEW_LINE>session.execute(insertWorkflowDefVersionIndexStatement<MASK><NEW_LINE>recordCassandraDaoRequests("createWorkflowDef");<NEW_LINE>recordCassandraDaoPayloadSize("createWorkflowDef", workflowDefinition.length(), "n/a", workflowDef.getName());<NEW_LINE>} catch (ApplicationException ae) {<NEW_LINE>throw ae;<NEW_LINE>} catch (Exception e) {<NEW_LINE>Monitors.error(CLASS_NAME, "createWorkflowDef");<NEW_LINE>String errorMsg = String.format("Error creating workflow definition: %s/%d", workflowDef.getName(), workflowDef.getVersion());<NEW_LINE>LOGGER.error(errorMsg, e);<NEW_LINE>throw new ApplicationException(ApplicationException.Code.BACKEND_ERROR, errorMsg, e);<NEW_LINE>}<NEW_LINE>}
.bind(workflowDefIndex, workflowDefIndex));
836,614
public synchronized void generatePluginConfig(String root, String serverName, boolean utilityRequest, File writeDirectory) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(tc, "generatePluginConfig", "server is stopping = " + serverIsStopping);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Method is synchronized so only one generate can be in progress at a time.<NEW_LINE>generateInProgress = true;<NEW_LINE>if (!serverIsStopping) {<NEW_LINE>PluginGenerator generator = pluginGenerator;<NEW_LINE>if (generator == null) {<NEW_LINE>// Process the updated configuration<NEW_LINE>generator = pluginGenerator = new PluginGenerator(this.config, locMgr, bundleContext);<NEW_LINE>}<NEW_LINE>// Only 1 thread should generate the plugin-cfg at a time<NEW_LINE>synchronized (pluginGeneratorLock) {<NEW_LINE>generator.generateXML(root, serverName, (WebContainer) webContainer, smgr, dynVhostMgr, locMgr, utilityRequest, writeDirectory);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>FFDCFilter.processException(t, getClass().getName(), "generatePluginConfig");<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, <MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>generateInProgress = false;<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(tc, "generatePluginConfig", "server is stopping = " + serverIsStopping);<NEW_LINE>}<NEW_LINE>}
"Error generate plugin xml: " + t.getMessage());
388,054
private GeneralPath createShape(GeneralPath out, double x, double y, double width, double height) {<NEW_LINE>if (hasBorderRadius()) {<NEW_LINE>out.reset();<NEW_LINE>out.moveTo(borderRadius.topLeftRadiusX(), 0);<NEW_LINE>out.lineTo(width - borderRadius.topRightRadiusX(), 0);<NEW_LINE>// out.arcTo(width-borderRadius.topRightRadiusX(), borderRadius.topRightRadiusY(), width, borderRadius.topRightRadiusY(), true);<NEW_LINE>out.quadTo(width, 0, width, borderRadius.topRightRadiusY());<NEW_LINE>out.lineTo(width, height - borderRadius.bottomRightY());<NEW_LINE>// out.arcTo(width-borderRadius.bottomRightX(), height-borderRadius.bottomRightY(), width-borderRadius.bottomRightX(), height, true);<NEW_LINE>out.quadTo(width, height, width - borderRadius.bottomRightX(), height);<NEW_LINE>out.lineTo(borderRadius.bottomLeftX(), height);<NEW_LINE>// out.arcTo(borderRadius.bottomLeftX(), height-borderRadius.bottomLeftY(), 0, height-borderRadius.bottomLeftY(), true);<NEW_LINE>out.quadTo(0, height, 0, height - borderRadius.bottomLeftY());<NEW_LINE>out.lineTo(0, borderRadius.topLeftRadiusY());<NEW_LINE>// out.arcTo(borderRadius.topLeftRadiusX(), borderRadius.topLeftRadiusY(), borderRadius.topLeftRadiusX(), 0, true);<NEW_LINE>out.quadTo(0, 0, borderRadius.topLeftRadiusX(), 0);<NEW_LINE>out.closePath();<NEW_LINE>} else {<NEW_LINE>out.reset();<NEW_LINE>out.moveTo(0, 0);<NEW_LINE><MASK><NEW_LINE>out.lineTo(width, height);<NEW_LINE>out.lineTo(0, height);<NEW_LINE>out.closePath();<NEW_LINE>}<NEW_LINE>out.transform(Transform.makeTranslation((float) x, (float) y));<NEW_LINE>return out;<NEW_LINE>}
out.lineTo(width, 0);
1,108,434
public Map<String, RollupTask> read() throws RollUpException {<NEW_LINE>try {<NEW_LINE>Map<String, RollupTask> tasks = new HashMap<>();<NEW_LINE>Iterable<String> keys = keyStore.listKeys(SERVICE, SERVICE_KEY_CONFIG);<NEW_LINE>for (String key : keys) {<NEW_LINE>ServiceKeyValue serviceKeyValue = keyStore.getValue(SERVICE, SERVICE_KEY_CONFIG, key);<NEW_LINE>String value = serviceKeyValue.getValue();<NEW_LINE>if (!StringUtils.isNullOrEmpty(value)) {<NEW_LINE>RollupTask task = parser.parseRollupTask(value);<NEW_LINE>task.setLastModified(serviceKeyValue.<MASK><NEW_LINE>tasks.put(key, task);<NEW_LINE>} else {<NEW_LINE>logger.error("Null or empty rollup key");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tasks;<NEW_LINE>} catch (DatastoreException e) {<NEW_LINE>throw new RollUpException("Failed to read roll-up tasks from the service keystore", e);<NEW_LINE>} catch (BeanValidationException | QueryException e) {<NEW_LINE>throw new RollUpException("Failed to read rollups from the keystore", e);<NEW_LINE>}<NEW_LINE>}
getLastModified().getTime());
1,832,201
public void run() {<NEW_LINE>if (followersAdapter == null) {<NEW_LINE>if (followingIds == null) {<NEW_LINE>// we will do a normal array adapter<NEW_LINE>followersAdapter = new PeopleArrayAdapter(context, followers);<NEW_LINE>} else {<NEW_LINE>followersAdapter = new FollowersArrayAdapter(context, followers, followingIds);<NEW_LINE>}<NEW_LINE>listView.setAdapter(followersAdapter);<NEW_LINE>} else {<NEW_LINE>followersAdapter.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>if (settings.roundContactImages) {<NEW_LINE>ImageUtils.loadSizedCircleImage(context, profilePicture, thisUser.getOriginalProfileImageURL(), mCache, 96);<NEW_LINE>} else {<NEW_LINE>ImageUtils.loadImage(context, profilePicture, thisUser.getOriginalProfileImageURL(), mCache);<NEW_LINE>}<NEW_LINE>String url = user.getProfileBannerURL();<NEW_LINE>ImageUtils.loadImage(<MASK><NEW_LINE>canRefresh = true;<NEW_LINE>spinner.setVisibility(View.GONE);<NEW_LINE>}
context, background, url, mCache);
71,518
public Image find(String id) throws IOException {<NEW_LINE>ByteBuffer buf = findMetadataFor(toByteArray(id));<NEW_LINE>if (buf == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>IntBuffer ibuf = buf.asIntBuffer();<NEW_LINE>int[<MASK><NEW_LINE>ibuf.get(intEntries);<NEW_LINE>assert id.length() == intEntries[0];<NEW_LINE>int width = intEntries[1];<NEW_LINE>int height = intEntries[2];<NEW_LINE>long[] longEntries = new long[2];<NEW_LINE>buf.position(buf.position() + 12);<NEW_LINE>LongBuffer lbuf = buf.asLongBuffer();<NEW_LINE>lbuf.get(longEntries);<NEW_LINE>// The cast to int is safe, the writer will never write a cache file<NEW_LINE>// bigger than Integer.MAX_VALUE<NEW_LINE>int start = (int) longEntries[0];<NEW_LINE>int end = (int) longEntries[1];<NEW_LINE>ByteBuffer cache = getBuffer().asReadOnlyBuffer();<NEW_LINE>cache.position(start);<NEW_LINE>System.err.println("Cache position is " + cache.position());<NEW_LINE>IntBuffer databuffer = cache.asIntBuffer();<NEW_LINE>System.err.println("IntBuffer position is " + databuffer.position());<NEW_LINE>return createImageFrom(databuffer, width, height);<NEW_LINE>}
] intEntries = new int[3];
424,754
private void toggleStarringState() {<NEW_LINE>StarringService service = ServiceFactory.get(StarringService.class, false);<NEW_LINE>Single<Response<Void>> responseSingle = mIsStarring ? service.unstarRepository(mRepository.owner().login(), mRepository.name()) : service.starRepository(mRepository.owner().login(), mRepository.name());<NEW_LINE>responseSingle.map(ApiHelpers::mapToBooleanOrThrowOnFailure).compose(RxUtils::doInBackground).subscribe(result -> {<NEW_LINE>if (mIsStarring != null) {<NEW_LINE>mIsStarring = !mIsStarring;<NEW_LINE>mRepository = mRepository.toBuilder().stargazersCount(mRepository.stargazersCount() + (mIsStarring ? 1 : <MASK><NEW_LINE>updateStargazerUi();<NEW_LINE>}<NEW_LINE>}, error -> {<NEW_LINE>handleActionFailure("Updating repo starring state failed", error);<NEW_LINE>updateStargazerUi();<NEW_LINE>});<NEW_LINE>}
-1)).build();
1,770,493
private CodeBlock serviceSpecificHttpConfigMethodBody(String serviceDefaultFqcn, boolean supportsH2) {<NEW_LINE>CodeBlock.Builder builder = CodeBlock.builder();<NEW_LINE>if (serviceDefaultFqcn != null) {<NEW_LINE>builder.addStatement("$T result = $T.defaultHttpConfig()", AttributeMap.class, PoetUtils.classNameFromFqcn(model.getCustomizationConfig<MASK><NEW_LINE>} else {<NEW_LINE>builder.addStatement("$1T result = $1T.empty()", AttributeMap.class);<NEW_LINE>}<NEW_LINE>if (supportsH2) {<NEW_LINE>builder.addStatement("return result.merge(AttributeMap.builder()" + ".put($T.PROTOCOL, $T.HTTP2)" + ".build())", SdkHttpConfigurationOption.class, Protocol.class);<NEW_LINE>} else {<NEW_LINE>builder.addStatement("return result");<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
().getServiceSpecificHttpConfig()));
1,541,178
protected void createTfhd(StreamingTrack streamingTrack, TrackFragmentBox parent) {<NEW_LINE>TrackFragmentHeaderBox tfhd = new TrackFragmentHeaderBox();<NEW_LINE>SampleFlags sf = new SampleFlags();<NEW_LINE>DefaultSampleFlagsTrackExtension defaultSampleFlagsTrackExtension = streamingTrack.getTrackExtension(DefaultSampleFlagsTrackExtension.class);<NEW_LINE>// I don't like the idea of using sampleflags in trex as it breaks the "self-contained" property of a fragment<NEW_LINE>if (defaultSampleFlagsTrackExtension != null) {<NEW_LINE>sf.setIsLeading(defaultSampleFlagsTrackExtension.getIsLeading());<NEW_LINE>sf.setSampleIsDependedOn(defaultSampleFlagsTrackExtension.getSampleIsDependedOn());<NEW_LINE>sf.<MASK><NEW_LINE>sf.setSampleHasRedundancy(defaultSampleFlagsTrackExtension.getSampleHasRedundancy());<NEW_LINE>sf.setSampleIsDifferenceSample(defaultSampleFlagsTrackExtension.isSampleIsNonSyncSample());<NEW_LINE>sf.setSamplePaddingValue(defaultSampleFlagsTrackExtension.getSamplePaddingValue());<NEW_LINE>sf.setSampleDegradationPriority(defaultSampleFlagsTrackExtension.getSampleDegradationPriority());<NEW_LINE>}<NEW_LINE>tfhd.setDefaultSampleFlags(sf);<NEW_LINE>tfhd.setBaseDataOffset(-1);<NEW_LINE>tfhd.setTrackId(streamingTrack.getTrackExtension(TrackIdTrackExtension.class).getTrackId());<NEW_LINE>tfhd.setDefaultBaseIsMoof(true);<NEW_LINE>parent.addBox(tfhd);<NEW_LINE>}
setSampleDependsOn(defaultSampleFlagsTrackExtension.getSampleDependsOn());
475,127
public void run() {<NEW_LINE>// remove "libs.XXX.classpath" from project.properties - not needed for shared project<NEW_LINE>AntProjectHelper helper = uiProperties.getProject().getAntProjectHelper();<NEW_LINE>EditableProperties ep = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);<NEW_LINE>List<String> l = new ArrayList<String>();<NEW_LINE>l.addAll(ep.keySet());<NEW_LINE>for (String key : l) {<NEW_LINE>if (key.startsWith("libs.") && key.endsWith(".classpath")) {<NEW_LINE>// NOI18N<NEW_LINE>ep.remove(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>helper.<MASK><NEW_LINE>// remove all libs.XXX.classpath.libfile.XXX props from private properties<NEW_LINE>EditableProperties privateProps = helper.getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH);<NEW_LINE>J2EEProjectProperties.removeObsoleteLibraryLocations(privateProps);<NEW_LINE>helper.putProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH, privateProps);<NEW_LINE>try {<NEW_LINE>ProjectManager.getDefault().saveProject(uiProperties.getProject());<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}
putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, ep);
129,152
@ApiResponses(value = { @ApiResponse(code = 201, message = "Indicates the content item data was saved and the result is returned."), @ApiResponse(code = 400, message = "Indicates required content item data is missing from the request.") })<NEW_LINE>@PostMapping(value = "/content-service/content-items/{contentItemId}/data", produces = "application/json", consumes = "multipart/form-data")<NEW_LINE>public ContentItemResponse saveContentItemData(@ApiParam(name = "contentItemId") @PathVariable("contentItemId") String contentItemId, HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>if (!(request instanceof MultipartHttpServletRequest)) {<NEW_LINE>throw new FlowableException("Multipart request required to save content item data");<NEW_LINE>}<NEW_LINE>ContentItem contentItem = getContentItemFromRequest(contentItemId);<NEW_LINE>MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;<NEW_LINE>MultipartFile file = multipartRequest.getFileMap().values().iterator().next();<NEW_LINE>if (file == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("Content item file is required.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>contentService.saveContentItem(contentItem, file.getInputStream());<NEW_LINE>response.setStatus(HttpStatus.CREATED.value());<NEW_LINE>return contentRestResponseFactory.createContentItemResponse(contentItem);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new FlowableException("Error creating content item response", e);
21,311
public Pair<List<? extends SSHKeyPair>, Integer> listSSHKeyPairs(final ListSSHKeyPairsCmd cmd) {<NEW_LINE>final Long id = cmd.getId();<NEW_LINE>final String name = cmd.getName();<NEW_LINE>final String fingerPrint = cmd.getFingerprint();<NEW_LINE>final <MASK><NEW_LINE>final Account caller = getCaller();<NEW_LINE>final List<Long> permittedAccounts = new ArrayList<Long>();<NEW_LINE>final Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject = new Ternary<Long, Boolean, ListProjectResourcesCriteria>(cmd.getDomainId(), cmd.isRecursive(), null);<NEW_LINE>_accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false);<NEW_LINE>final Long domainId = domainIdRecursiveListProject.first();<NEW_LINE>final Boolean isRecursive = domainIdRecursiveListProject.second();<NEW_LINE>final ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third();<NEW_LINE>final SearchBuilder<SSHKeyPairVO> sb = _sshKeyPairDao.createSearchBuilder();<NEW_LINE>_accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria);<NEW_LINE>final Filter searchFilter = new Filter(SSHKeyPairVO.class, "id", false, cmd.getStartIndex(), cmd.getPageSizeVal());<NEW_LINE>final SearchCriteria<SSHKeyPairVO> sc = sb.create();<NEW_LINE>_accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria);<NEW_LINE>if (id != null) {<NEW_LINE>sc.addAnd("id", SearchCriteria.Op.EQ, id);<NEW_LINE>}<NEW_LINE>if (name != null) {<NEW_LINE>sc.addAnd("name", SearchCriteria.Op.EQ, name);<NEW_LINE>}<NEW_LINE>if (fingerPrint != null) {<NEW_LINE>sc.addAnd("fingerprint", SearchCriteria.Op.EQ, fingerPrint);<NEW_LINE>}<NEW_LINE>if (keyword != null) {<NEW_LINE>final SearchCriteria<SSHKeyPairVO> ssc = _sshKeyPairDao.createSearchCriteria();<NEW_LINE>ssc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");<NEW_LINE>ssc.addOr("fingerprint", SearchCriteria.Op.LIKE, "%" + keyword + "%");<NEW_LINE>sc.addAnd("name", SearchCriteria.Op.SC, ssc);<NEW_LINE>}<NEW_LINE>final Pair<List<SSHKeyPairVO>, Integer> result = _sshKeyPairDao.searchAndCount(sc, searchFilter);<NEW_LINE>return new Pair<List<? extends SSHKeyPair>, Integer>(result.first(), result.second());<NEW_LINE>}
String keyword = cmd.getKeyword();
232,349
public static void migrate(File legacyModelFile, File destination) throws InvalidModelException, IOException {<NEW_LINE>boolean failed = true;<NEW_LINE>try (ZipFile zip = new ZipFile(legacyModelFile);<NEW_LINE>ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(destination))) {<NEW_LINE>ZipEntry manifestEntry = zip.getEntry(MANIFEST_FILE);<NEW_LINE>if (manifestEntry == null) {<NEW_LINE>throw new InvalidModelException("Missing manifest file in model archive.");<NEW_LINE>}<NEW_LINE>InputStream <MASK><NEW_LINE>Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8);<NEW_LINE>JsonParser parser = new JsonParser();<NEW_LINE>JsonObject json = (JsonObject) parser.parse(reader);<NEW_LINE>JsonPrimitive version = json.getAsJsonPrimitive("specificationVersion");<NEW_LINE>Manifest manifest;<NEW_LINE>if (version != null && "1.0".equals(version.getAsString())) {<NEW_LINE>throw new InvalidModelException("model archive is already in 1.0 version.");<NEW_LINE>}<NEW_LINE>LegacyManifest legacyManifest = GSON.fromJson(json, LegacyManifest.class);<NEW_LINE>manifest = legacyManifest.migrate();<NEW_LINE>zos.putNextEntry(new ZipEntry("MAR-INF/"));<NEW_LINE>zos.putNextEntry(new ZipEntry("MAR-INF/" + MANIFEST_FILE));<NEW_LINE>zos.write(GSON.toJson(manifest).getBytes(StandardCharsets.UTF_8));<NEW_LINE>Enumeration<? extends ZipEntry> en = zip.entries();<NEW_LINE>while (en.hasMoreElements()) {<NEW_LINE>ZipEntry entry = en.nextElement();<NEW_LINE>String name = entry.getName();<NEW_LINE>if (MANIFEST_FILE.equalsIgnoreCase(name) || name.startsWith(".")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>zos.putNextEntry(new ZipEntry(name));<NEW_LINE>if (!entry.isDirectory()) {<NEW_LINE>IOUtils.copy(zip.getInputStream(entry), zos);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>failed = false;<NEW_LINE>} finally {<NEW_LINE>if (failed) {<NEW_LINE>FileUtils.deleteQuietly(destination);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
is = zip.getInputStream(manifestEntry);
462,519
private boolean check(PeerConnection peer, InventoryMessage inventoryMessage) {<NEW_LINE>InventoryType type = inventoryMessage.getInventoryType();<NEW_LINE>int size = inventoryMessage.getHashList().size();<NEW_LINE>if (peer.isNeedSyncFromPeer() || peer.isNeedSyncFromUs()) {<NEW_LINE>logger.warn("Drop inv: {} size: {} from Peer {}, syncFromUs: {}, syncFromPeer: {}.", type, size, peer.getInetAddress(), peer.isNeedSyncFromUs(), peer.isNeedSyncFromPeer());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (type.equals(InventoryType.TRX)) {<NEW_LINE>int count = peer.getNodeStatistics().messageStatistics.tronInTrxInventoryElement.getCount(10);<NEW_LINE>if (count > maxCountIn10s) {<NEW_LINE>logger.warn("Drop inv: {} size: {} from Peer {}, Inv count: {} is overload.", type, size, <MASK><NEW_LINE>if (Args.getInstance().isOpenPrintLog()) {<NEW_LINE>logger.warn("[overload]Drop tx list is: {}", inventoryMessage.getHashList());<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (transactionsMsgHandler.isBusy()) {<NEW_LINE>logger.warn("Drop inv: {} size: {} from Peer {}, transactionsMsgHandler is busy.", type, size, peer.getInetAddress());<NEW_LINE>if (Args.getInstance().isOpenPrintLog()) {<NEW_LINE>logger.warn("[isBusy]Drop tx list is: {}", inventoryMessage.getHashList());<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
peer.getInetAddress(), count);
328,247
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "RAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,598,974
private void statInit() {<NEW_LINE>lDocumentNo.setLabelFor(fDocumentNo);<NEW_LINE>fDocumentNo.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDocumentNo.addActionListener(this);<NEW_LINE>lDescription.setLabelFor(fDescription);<NEW_LINE>fDescription.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDescription.addActionListener(this);<NEW_LINE>lPOReference.setLabelFor(fPOReference);<NEW_LINE>fPOReference.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fPOReference.addActionListener(this);<NEW_LINE>fIsSOTrx.setSelected(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx")));<NEW_LINE>fIsSOTrx.addActionListener(this);<NEW_LINE>//<NEW_LINE>fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInOut.Table_Name, MInOut.COLUMNNAME_C_BPartner_ID), DisplayType.Search));<NEW_LINE>lBPartner_ID.setLabelFor(fBPartner_ID);<NEW_LINE>fBPartner_ID.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fBPartner_ID.addActionListener(this);<NEW_LINE>//<NEW_LINE>fShipper_ID = new VLookup("M_Shipper_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInOut.Table_Name, MInOut.COLUMNNAME_M_Shipper_ID), DisplayType.TableDir));<NEW_LINE>lShipper_ID.setLabelFor(fShipper_ID);<NEW_LINE>fShipper_ID.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fShipper_ID.addActionListener(this);<NEW_LINE>//<NEW_LINE>lDateFrom.setLabelFor(fDateFrom);<NEW_LINE>fDateFrom.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDateFrom.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom"));<NEW_LINE>fDateFrom.addActionListener(this);<NEW_LINE>lDateTo.setLabelFor(fDateTo);<NEW_LINE>fDateTo.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDateTo.setToolTipText(Msg.translate(Env.getCtx(), "DateTo"));<NEW_LINE>fDateTo.addActionListener(this);<NEW_LINE>//<NEW_LINE>CPanel datePanel = new CPanel();<NEW_LINE>datePanel.setLayout(new ALayout(0, 0, true));<NEW_LINE>datePanel.add(fDateFrom, new ALayoutConstraint(0, 0));<NEW_LINE>datePanel.add(lDateTo, null);<NEW_LINE>datePanel.add(fDateTo, null);<NEW_LINE>// First Row<NEW_LINE>p_criteriaGrid.add(lDocumentNo, new ALayoutConstraint(0, 0));<NEW_LINE>p_criteriaGrid.add(fDocumentNo, null);<NEW_LINE>p_criteriaGrid.add(lBPartner_ID, null);<NEW_LINE>p_criteriaGrid.add(fBPartner_ID, null);<NEW_LINE>p_criteriaGrid.add(fIsSOTrx, new ALayoutConstraint(0, 5));<NEW_LINE>// 2nd Row<NEW_LINE>p_criteriaGrid.add(lDescription, new ALayoutConstraint(1, 0));<NEW_LINE>p_criteriaGrid.add(fDescription, null);<NEW_LINE>p_criteriaGrid.add(lDateFrom, null);<NEW_LINE>p_criteriaGrid.add(datePanel, null);<NEW_LINE>// 3rd Row<NEW_LINE>p_criteriaGrid.add(lPOReference, <MASK><NEW_LINE>p_criteriaGrid.add(fPOReference, null);<NEW_LINE>p_criteriaGrid.add(lShipper_ID, null);<NEW_LINE>p_criteriaGrid.add(fShipper_ID, null);<NEW_LINE>}
new ALayoutConstraint(2, 0));
797,787
public static void verifyJavaCompatibility(String compiledVersion) {<NEW_LINE>String runtimeVersion = System.getProperty(JAVA_VERSION);<NEW_LINE>if (compiledVersion == null || runtimeVersion == null || compiledVersion.equals(runtimeVersion)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String[] compiledVersionParts = compiledVersion.split("\\.|_");<NEW_LINE>String[] runtimeVersionParts = runtimeVersion.split("\\.|_");<NEW_LINE>// check the major version.<NEW_LINE>if (!compiledVersionParts[0].equals(runtimeVersionParts[0])) {<NEW_LINE>String compiledMajorVersion = compiledVersionParts.length > 1 ? compiledVersionParts[1] : VERSION_ZERO;<NEW_LINE>logJavaVersionMismatchError(runtimeVersion, compiledVersionParts[0], compiledMajorVersion);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// if both have only major versions, then stop checking further.<NEW_LINE>if (compiledVersionParts.length == 1 && compiledVersionParts.length == 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// if only one of them have a minor version, check whether the other one has<NEW_LINE>// minor version as zero.<NEW_LINE>// eg: v9 Vs v9.0.x<NEW_LINE>if (compiledVersionParts.length == 1) {<NEW_LINE>if (!runtimeVersionParts[1].equals(VERSION_ZERO)) {<NEW_LINE>logJavaVersionMismatchError(runtimeVersion<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (runtimeVersionParts.length == 1) {<NEW_LINE>if (!compiledVersionParts[1].equals(VERSION_ZERO)) {<NEW_LINE>logJavaVersionMismatchError(runtimeVersion, compiledVersionParts[0], compiledVersionParts[1]);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// if both have minor versions, check for their equality.<NEW_LINE>if (!compiledVersionParts[1].equals(runtimeVersionParts[1])) {<NEW_LINE>logJavaVersionMismatchError(runtimeVersion, compiledVersionParts[0], compiledVersionParts[1]);<NEW_LINE>}<NEW_LINE>// ignore the patch versions.<NEW_LINE>}
, compiledVersionParts[0], VERSION_ZERO);