idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
89,541
public void begin(InterpretationContext ec, String localName, Attributes attributes) throws ActionException {<NEW_LINE>// reset variables<NEW_LINE>scopeStr = null;<NEW_LINE>scope = null;<NEW_LINE>propertyName = null;<NEW_LINE>definer = null;<NEW_LINE>inError = false;<NEW_LINE>// read future property name<NEW_LINE>propertyName = attributes.getValue(NAME_ATTRIBUTE);<NEW_LINE>scopeStr = attributes.getValue(SCOPE_ATTRIBUTE);<NEW_LINE>scope = ActionUtil.stringToScope(scopeStr);<NEW_LINE>if (OptionHelper.isEmpty(propertyName)) {<NEW_LINE>addError("Missing property name for property definer. Near [" + localName + "] line " + getLineNumber(ec));<NEW_LINE>inError = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// read property definer class name<NEW_LINE>String className = attributes.getValue(CLASS_ATTRIBUTE);<NEW_LINE>if (OptionHelper.isEmpty(className)) {<NEW_LINE>addError("Missing class name for property definer. Near [" + localName + "] line " + getLineNumber(ec));<NEW_LINE>inError = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// try to instantiate property definer<NEW_LINE>try {<NEW_LINE>addInfo("About to instantiate property definer of type [" + className + "]");<NEW_LINE>definer = (PropertyDefiner) OptionHelper.instantiateByClassName(<MASK><NEW_LINE>definer.setContext(context);<NEW_LINE>if (definer instanceof LifeCycle) {<NEW_LINE>((LifeCycle) definer).start();<NEW_LINE>}<NEW_LINE>ec.pushObject(definer);<NEW_LINE>} catch (Exception oops) {<NEW_LINE>inError = true;<NEW_LINE>addError("Could not create an PropertyDefiner of type [" + className + "].", oops);<NEW_LINE>throw new ActionException(oops);<NEW_LINE>}<NEW_LINE>}
className, PropertyDefiner.class, context);
1,478,248
public static CheckUpgradeVersionResponse unmarshall(CheckUpgradeVersionResponse checkUpgradeVersionResponse, UnmarshallerContext _ctx) {<NEW_LINE>checkUpgradeVersionResponse.setRequestId(_ctx.stringValue("CheckUpgradeVersionResponse.RequestId"));<NEW_LINE>checkUpgradeVersionResponse.setMessage(_ctx.stringValue("CheckUpgradeVersionResponse.Message"));<NEW_LINE>checkUpgradeVersionResponse.setLatestVersion(_ctx.stringValue("CheckUpgradeVersionResponse.LatestVersion"));<NEW_LINE>checkUpgradeVersionResponse.setOption<MASK><NEW_LINE>checkUpgradeVersionResponse.setCode(_ctx.stringValue("CheckUpgradeVersionResponse.Code"));<NEW_LINE>checkUpgradeVersionResponse.setSuccess(_ctx.booleanValue("CheckUpgradeVersionResponse.Success"));<NEW_LINE>List<Patch> patches = new ArrayList<Patch>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CheckUpgradeVersionResponse.Patches.Length"); i++) {<NEW_LINE>Patch patch = new Patch();<NEW_LINE>patch.setInternalUrl(_ctx.stringValue("CheckUpgradeVersionResponse.Patches[" + i + "].InternalUrl"));<NEW_LINE>patch.setUrl(_ctx.stringValue("CheckUpgradeVersionResponse.Patches[" + i + "].Url"));<NEW_LINE>patch.setName(_ctx.stringValue("CheckUpgradeVersionResponse.Patches[" + i + "].Name"));<NEW_LINE>patch.setMD5(_ctx.stringValue("CheckUpgradeVersionResponse.Patches[" + i + "].MD5"));<NEW_LINE>patches.add(patch);<NEW_LINE>}<NEW_LINE>checkUpgradeVersionResponse.setPatches(patches);<NEW_LINE>return checkUpgradeVersionResponse;<NEW_LINE>}
(_ctx.stringValue("CheckUpgradeVersionResponse.Option"));
1,117,725
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, "DLM");<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,819,460
private Table build(Composite parent) {<NEW_LINE>final Table table = new Table(parent, SWT.BORDER | SWT.WRAP | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL);<NEW_LINE>table.setHeaderVisible(true);<NEW_LINE>table.setLinesVisible(true);<NEW_LINE>cols = new TableColumn[4];<NEW_LINE>cols[0] = UIUtil.create(table, SWT.CENTER, "No", cols.length, <MASK><NEW_LINE>cols[1] = UIUtil.create(table, SWT.LEFT, "Name", cols.length, 1, false, 250, this);<NEW_LINE>cols[2] = UIUtil.create(table, SWT.CENTER, "Stat", cols.length, 2, false, 100, this);<NEW_LINE>cols[3] = UIUtil.create(table, SWT.RIGHT, "Cpu", cols.length, 3, true, 60, this);<NEW_LINE>return table;<NEW_LINE>}
0, true, 40, this);
800,512
// Substitute for FormattingUtils if there is no dependency to core<NEW_LINE>public static String formatDurationAsWords(long durationMillis) {<NEW_LINE>String format = "";<NEW_LINE>String second = "second";<NEW_LINE>String minute = "minute";<NEW_LINE>String hour = "hour";<NEW_LINE>String day = "day";<NEW_LINE>String days = "days";<NEW_LINE>String hours = "hours";<NEW_LINE>String minutes = "minutes";<NEW_LINE>String seconds = "seconds";<NEW_LINE>if (durationMillis >= TimeUnit.DAYS.toMillis(1)) {<NEW_LINE>format = "d\' " + days + ", \'";<NEW_LINE>}<NEW_LINE>format += "H\' " + hours + ", \'m\' " + minutes + ", \'s\'.\'S\' " + seconds + "\'";<NEW_LINE>String duration = durationMillis > 0 ? DurationFormatUtils.formatDuration(durationMillis, format) : "";<NEW_LINE>duration = StringUtils.replacePattern(duration, "^1 " + seconds + <MASK><NEW_LINE>duration = StringUtils.replacePattern(duration, "^1 " + minutes + "|\\b1 " + minutes, "1 " + minute);<NEW_LINE>duration = StringUtils.replacePattern(duration, "^1 " + hours + "|\\b1 " + hours, "1 " + hour);<NEW_LINE>duration = StringUtils.replacePattern(duration, "^1 " + days + "|\\b1 " + days, "1 " + day);<NEW_LINE>duration = duration.replace(", 0 seconds", "");<NEW_LINE>duration = duration.replace(", 0 minutes", "");<NEW_LINE>duration = duration.replace(", 0 hours", "");<NEW_LINE>duration = StringUtils.replacePattern(duration, "^0 days, ", "");<NEW_LINE>duration = StringUtils.replacePattern(duration, "^0 hours, ", "");<NEW_LINE>duration = StringUtils.replacePattern(duration, "^0 minutes, ", "");<NEW_LINE>duration = StringUtils.replacePattern(duration, "^0 seconds, ", "");<NEW_LINE>String result = duration.trim();<NEW_LINE>if (result.isEmpty()) {<NEW_LINE>result = "0.000 seconds";<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
"|\\b1 " + seconds, "1 " + second);
1,795,278
private void addAccountApiRoles(RealmModel realm) {<NEW_LINE>ClientModel accountClient = realm.getClientByClientId(Constants.ACCOUNT_MANAGEMENT_CLIENT_ID);<NEW_LINE>RoleModel viewAppRole = <MASK><NEW_LINE>viewAppRole.setDescription("${role_" + AccountRoles.VIEW_APPLICATIONS + "}");<NEW_LINE>LOG.debugf("Added the role %s to the '%s' client.", AccountRoles.VIEW_APPLICATIONS, Constants.ACCOUNT_MANAGEMENT_CLIENT_ID);<NEW_LINE>RoleModel viewConsentRole = accountClient.addRole(AccountRoles.VIEW_CONSENT);<NEW_LINE>viewConsentRole.setDescription("${role_" + AccountRoles.VIEW_CONSENT + "}");<NEW_LINE>LOG.debugf("Added the role %s to the '%s' client.", AccountRoles.VIEW_CONSENT, Constants.ACCOUNT_MANAGEMENT_CLIENT_ID);<NEW_LINE>RoleModel manageConsentRole = accountClient.addRole(AccountRoles.MANAGE_CONSENT);<NEW_LINE>manageConsentRole.setDescription("${role_" + AccountRoles.MANAGE_CONSENT + "}");<NEW_LINE>LOG.debugf("Added the role %s to the '%s' client.", AccountRoles.MANAGE_CONSENT, Constants.ACCOUNT_MANAGEMENT_CLIENT_ID);<NEW_LINE>manageConsentRole.addCompositeRole(viewConsentRole);<NEW_LINE>LOG.debugf("Added the %s role as a composite role to %s", AccountRoles.VIEW_CONSENT, AccountRoles.MANAGE_CONSENT);<NEW_LINE>}
accountClient.addRole(AccountRoles.VIEW_APPLICATIONS);
1,069,704
public UpdateStreamResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateStreamResult updateStreamResult = new UpdateStreamResult();<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("streamId")) {<NEW_LINE>updateStreamResult.setStreamId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("streamArn")) {<NEW_LINE>updateStreamResult.setStreamArn(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("description")) {<NEW_LINE>updateStreamResult.setDescription(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("streamVersion")) {<NEW_LINE>updateStreamResult.setStreamVersion(IntegerJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return updateStreamResult;<NEW_LINE>}
().unmarshall(context));
1,662,228
protected LLVMDebugValue fromManagedPointer(LLVMManagedPointer value) {<NEW_LINE>final Object target = value.getObject();<NEW_LINE>if (target instanceof LLVMGlobalContainer) {<NEW_LINE>return fromGlobalContainer((LLVMGlobalContainer) target);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>InteropLibrary interop = InteropLibrary.getFactory().getUncached();<NEW_LINE>if (interop.isBoolean(target)) {<NEW_LINE>return new LLDBBoxedPrimitive(interop.asBoolean(target));<NEW_LINE>} else if (interop.isNumber(target)) {<NEW_LINE>Object unboxedValue;<NEW_LINE>if (interop.fitsInByte(target)) {<NEW_LINE>unboxedValue = interop.asByte(target);<NEW_LINE>} else if (interop.fitsInShort(target)) {<NEW_LINE>unboxedValue = interop.asShort(target);<NEW_LINE>} else if (interop.fitsInInt(target)) {<NEW_LINE>unboxedValue = interop.asInt(target);<NEW_LINE>} else if (interop.fitsInLong(target)) {<NEW_LINE>unboxedValue = interop.asLong(target);<NEW_LINE>} else if (interop.fitsInFloat(target)) {<NEW_LINE>unboxedValue = interop.asFloat(target);<NEW_LINE>} else if (interop.fitsInDouble(target)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>return LLVMDebugValue.UNAVAILABLE;<NEW_LINE>}<NEW_LINE>return new LLDBBoxedPrimitive(unboxedValue);<NEW_LINE>}<NEW_LINE>} catch (UnsupportedMessageException ignored) {<NEW_LINE>// the default case is a sensible fallback for this<NEW_LINE>}<NEW_LINE>return new LLDBConstant.Pointer(value);<NEW_LINE>}
unboxedValue = interop.asDouble(target);
1,562,295
public static String concat(String... dbColumns) throws DotRuntimeException {<NEW_LINE>if (dbColumns == null) {<NEW_LINE>throw new DotRuntimeException("the column list being concated are null");<NEW_LINE>}<NEW_LINE>StringBuilder bob = new StringBuilder();<NEW_LINE>boolean first = true;<NEW_LINE>for (String col : dbColumns) {<NEW_LINE>if (DbConnectionFactory.isMsSql()) {<NEW_LINE>if (!first) {<NEW_LINE>bob.append(" + ");<NEW_LINE>}<NEW_LINE>bob.append("cast( ").append<MASK><NEW_LINE>} else if (DbConnectionFactory.isMySql()) {<NEW_LINE>if (first) {<NEW_LINE>bob.append("CONCAT(");<NEW_LINE>} else {<NEW_LINE>bob.append(",");<NEW_LINE>}<NEW_LINE>bob.append(col);<NEW_LINE>} else {<NEW_LINE>if (!first) {<NEW_LINE>bob.append(" || ");<NEW_LINE>}<NEW_LINE>bob.append(col);<NEW_LINE>}<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>if (DbConnectionFactory.isMySql()) {<NEW_LINE>bob.append(")");<NEW_LINE>}<NEW_LINE>return bob.toString();<NEW_LINE>}
(col).append(" as varchar(512))");
643,652
public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>shutdownTabletServer_result result = new shutdownTabletServer_result();<NEW_LINE>if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) {<NEW_LINE>result.sec = (org.apache.accumulo.core<MASK><NEW_LINE>result.setSecIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) {<NEW_LINE>result.tnase = (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) e;<NEW_LINE>result.setTnaseIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>}
.clientImpl.thrift.ThriftSecurityException) e;
731,360
/* Sample generated code:<NEW_LINE>*<NEW_LINE>* @com.ibm.j9ddr.GeneratedFieldAccessor(offsetFieldName="_refOffset_", declaredType="fj9object_t")<NEW_LINE>* public J9ObjectPointer ref() throws CorruptDataException {<NEW_LINE>* return getObjectReferenceAtOffset(Example._refOffset_);<NEW_LINE>* }<NEW_LINE>*/<NEW_LINE>private void doFJ9ObjectMethod(FieldDescriptor field) {<NEW_LINE>Type objectType = Type.getObjectType(qualifyPointerType("J9Object"));<NEW_LINE>String returnDesc = Type.getMethodDescriptor(objectType);<NEW_LINE>String accessorDesc = Type.getMethodDescriptor(objectType, Type.LONG_TYPE);<NEW_LINE>MethodVisitor method = beginAnnotatedMethod(field, field.getName(), returnDesc);<NEW_LINE>method.visitCode();<NEW_LINE>if (checkPresent(field, method)) {<NEW_LINE>method.visitVarInsn(ALOAD, 0);<NEW_LINE>loadLong(method, field.getOffset());<NEW_LINE>method.visitMethodInsn(INVOKEVIRTUAL, className, "getObjectReferenceAtOffset", accessorDesc, false);<NEW_LINE>method.visitInsn(ARETURN);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>method.visitEnd();<NEW_LINE>doEAMethod("ObjectReference", field);<NEW_LINE>}
method.visitMaxs(3, 1);
1,112,767
public String delete(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, String path, HttpServletRequest request, ModelMap model) {<NEW_LINE>if (ControllerUtils.verifyCustom("noright", null != site.getParentId(), model)) {<NEW_LINE>return CommonConstants.TEMPLATE_ERROR;<NEW_LINE>}<NEW_LINE>if (CommonUtils.notEmpty(path)) {<NEW_LINE>String filePath = siteComponent.getWebTemplateFilePath(site, path);<NEW_LINE>CmsPageMetadata metadata = metadataComponent.getTemplateMetadata(filePath);<NEW_LINE>if (CommonUtils.notEmpty(metadata.getCacheTime()) && metadata.getCacheTime() > 0) {<NEW_LINE>templateCacheComponent.deleteCachedFile(SiteComponent.getFullTemplatePath(site, path));<NEW_LINE>}<NEW_LINE>String backupFilePath = <MASK><NEW_LINE>if (ControllerUtils.verifyCustom("notExist.template", !CmsFileUtils.moveFile(filePath, backupFilePath), model)) {<NEW_LINE>return CommonConstants.TEMPLATE_ERROR;<NEW_LINE>}<NEW_LINE>metadataComponent.deleteTemplateMetadata(filePath);<NEW_LINE>metadataComponent.deleteTemplateData(filePath);<NEW_LINE>sysDeptPageService.delete(null, path);<NEW_LINE>templateComponent.clearTemplateCache();<NEW_LINE>cacheComponent.clearViewCache();<NEW_LINE>logOperateService.save(new LogOperate(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, "delete.web.template", RequestUtils.getIpAddress(request), CommonUtils.getDate(), path));<NEW_LINE>}<NEW_LINE>return CommonConstants.TEMPLATE_DONE;<NEW_LINE>}
siteComponent.getWebTemplateBackupFilePath(site, path);
884,996
public static FabOptions parse(Context context, JSONObject json) {<NEW_LINE>FabOptions options = new FabOptions();<NEW_LINE>if (json == null)<NEW_LINE>return options;<NEW_LINE>options.id = TextParser.parse(json, "id");<NEW_LINE>options.backgroundColor = ThemeColour.parse(context, json.optJSONObject("backgroundColor"));<NEW_LINE>options.clickColor = ThemeColour.parse(context, json.optJSONObject("clickColor"));<NEW_LINE>options.rippleColor = ThemeColour.parse(context, json.optJSONObject("rippleColor"));<NEW_LINE>options.visible = BoolParser.parse(json, "visible");<NEW_LINE>if (json.has("icon")) {<NEW_LINE>options.icon = TextParser.parse(json.optJSONObject("icon"), "uri");<NEW_LINE>}<NEW_LINE>options.iconColor = ThemeColour.parse(context, json.optJSONObject("iconColor"));<NEW_LINE>if (json.has("actions")) {<NEW_LINE>JSONArray fabsArray = json.optJSONArray("actions");<NEW_LINE>for (int i = 0; i < fabsArray.length(); i++) {<NEW_LINE>options.actionsArray.add(FabOptions.parse(context, fabsArray.optJSONObject(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>options.alignHorizontally = TextParser.parse(json, "alignHorizontally");<NEW_LINE>options.alignVertically = TextParser.parse(json, "alignVertically");<NEW_LINE>options.hideOnScroll = BoolParser.parse(json, "hideOnScroll");<NEW_LINE>options.size = <MASK><NEW_LINE>return options;<NEW_LINE>}
TextParser.parse(json, "size");
824,443
protected void onResume() {<NEW_LINE>super.onResume();<NEW_LINE>if (needManualOrientationHandling()) {<NEW_LINE>// Register our content observer for the auto-rotate setting.<NEW_LINE>android.net.Uri autoRotateSetting = android.provider.Settings.System.getUriFor(android.provider.Settings.System.ACCELEROMETER_ROTATION);<NEW_LINE>getContentResolver().<MASK><NEW_LINE>// Lock our orientation if auto-rotate has been disabled.<NEW_LINE>if (android.provider.Settings.System.getInt(getContentResolver(), android.provider.Settings.System.ACCELEROMETER_ROTATION, 0) == 0) {<NEW_LINE>// Check that the current orientation of the screen is supported by this app.<NEW_LINE>// It may not be if we're coming back to the activity from the screen lock screen.<NEW_LINE>if ((isAtPortraitOrientation() && !supportsPortraitOrientation()) || (isAtLandscapeOrientation() && !supportsLandscapeOrientation())) {<NEW_LINE>// Lock in the last known orientation that's supported and lock it in.<NEW_LINE>lockOrientation(getLoggedOrientation());<NEW_LINE>} else {<NEW_LINE>// We're safe to lock the current orientation<NEW_LINE>lockCurrentOrientation();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Auto-rotate has been turned on. Restore the old orientation setting.<NEW_LINE>restoreInitialOrientationSetting();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Start or resume the Corona runtime.<NEW_LINE>myIsActivityResumed = true;<NEW_LINE>requestResumeCoronaRuntime();<NEW_LINE>// Resume this activity's views if they were suspended.<NEW_LINE>if (fCoronaRuntime != null) {<NEW_LINE>fCoronaRuntime.updateViews();<NEW_LINE>}<NEW_LINE>}
registerContentObserver(autoRotateSetting, false, fAutoRotateObserver);
456,280
protected // Contrib Manager was opened.) [fry 220311]<NEW_LINE>void updateContributionListing() {<NEW_LINE>Editor editor = base.getActiveEditor();<NEW_LINE>if (editor != null) {<NEW_LINE>List<Library> libraries = new ArrayList<>(editor.getMode().contribLibraries);<NEW_LINE>// Only add Foundation libraries that are installed in the sketchbook<NEW_LINE>// https://github.com/processing/processing/issues/3688<NEW_LINE>final String sketchbookPath = Base.getSketchbookLibrariesFolder().getAbsolutePath();<NEW_LINE>for (Library lib : editor.getMode().coreLibraries) {<NEW_LINE>if (lib.getLibraryPath().startsWith(sketchbookPath)) {<NEW_LINE>libraries.add(lib);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Contribution> contributions = new ArrayList<>(libraries);<NEW_LINE>// List<ToolContribution> tools = base.getToolContribs();<NEW_LINE>// contributions.addAll(tools);<NEW_LINE>contributions.addAll(base.getToolContribs());<NEW_LINE>// List<ModeContribution> modes = base.getModeContribs();<NEW_LINE>// contributions.addAll(modes);<NEW_LINE>contributions.addAll(base.getModeContribs());<NEW_LINE>// List<ExamplesContribution> examples = base.getExampleContribs();<NEW_LINE>// contributions.addAll(examples);<NEW_LINE>contributions.addAll(base.getContribExamples());<NEW_LINE>ContributionListing.<MASK><NEW_LINE>// listPanel.filterLibraries(category, new ArrayList<>());<NEW_LINE>// listPanel.filterDummy(category);<NEW_LINE>}<NEW_LINE>}
getInstance().updateInstalledList(contributions);
716,213
protected void applyOptions(Workbook wb, DataTable table, Sheet sheet, ExporterOptions options) {<NEW_LINE>Font font = getFont(wb, options);<NEW_LINE>facetStyle = wb.createCellStyle();<NEW_LINE>facetStyle.setFont(font);<NEW_LINE>facetStyle.setAlignment(HorizontalAlignment.CENTER);<NEW_LINE>facetStyle.setVerticalAlignment(VerticalAlignment.CENTER);<NEW_LINE>facetStyle.setWrapText(true);<NEW_LINE>applyFacetOptions(wb, options, facetStyle);<NEW_LINE>cellStyleLeftAlign = wb.createCellStyle();<NEW_LINE>cellStyleLeftAlign.setFont(font);<NEW_LINE>cellStyleLeftAlign.setAlignment(HorizontalAlignment.LEFT);<NEW_LINE>applyCellOptions(wb, options, cellStyleLeftAlign);<NEW_LINE>cellStyleCenterAlign = wb.createCellStyle();<NEW_LINE>cellStyleCenterAlign.setFont(font);<NEW_LINE>cellStyleCenterAlign.setAlignment(HorizontalAlignment.CENTER);<NEW_LINE>applyCellOptions(wb, options, cellStyleCenterAlign);<NEW_LINE>cellStyleRightAlign = wb.createCellStyle();<NEW_LINE>cellStyleRightAlign.setFont(font);<NEW_LINE>cellStyleRightAlign.setAlignment(HorizontalAlignment.RIGHT);<NEW_LINE>applyCellOptions(wb, options, cellStyleRightAlign);<NEW_LINE>if (stronglyTypedCells) {<NEW_LINE>currencyStyle = wb.createCellStyle();<NEW_LINE>currencyStyle.setFont(font);<NEW_LINE>currencyStyle.setAlignment(HorizontalAlignment.RIGHT);<NEW_LINE>String pattern = CurrencyValidator.getInstance().getPattern(locale);<NEW_LINE>short currencyPattern = wb.getCreationHelper().<MASK><NEW_LINE>currencyStyle.setDataFormat(currencyPattern);<NEW_LINE>applyCellOptions(wb, options, currencyStyle);<NEW_LINE>}<NEW_LINE>PrintSetup printSetup = sheet.getPrintSetup();<NEW_LINE>printSetup.setLandscape(true);<NEW_LINE>printSetup.setPaperSize(PrintSetup.A4_PAPERSIZE);<NEW_LINE>sheet.setPrintGridlines(true);<NEW_LINE>}
createDataFormat().getFormat(pattern);
1,565,353
public void renderTo(ClassExtensionDoc extension, Element parent) {<NEW_LINE>if (extension.getExtensionProperties().isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Document document = parent.getOwnerDocument();<NEW_LINE>Element section = document.createElement("section");<NEW_LINE>parent.appendChild(section);<NEW_LINE>Element title = document.createElement("title");<NEW_LINE>section.appendChild(title);<NEW_LINE>title.appendChild(document.createTextNode("Properties added by the "));<NEW_LINE>Element literal = document.createElement("literal");<NEW_LINE>title.appendChild(literal);<NEW_LINE>literal.appendChild(document.createTextNode(extension.getPluginId()));<NEW_LINE>title.appendChild<MASK><NEW_LINE>Element titleabbrev = document.createElement("titleabbrev");<NEW_LINE>section.appendChild(titleabbrev);<NEW_LINE>literal = document.createElement("literal");<NEW_LINE>titleabbrev.appendChild(literal);<NEW_LINE>literal.appendChild(document.createTextNode(extension.getPluginId()));<NEW_LINE>titleabbrev.appendChild(document.createTextNode(" plugin"));<NEW_LINE>Element table = document.createElement("table");<NEW_LINE>section.appendChild(table);<NEW_LINE>title = document.createElement("title");<NEW_LINE>table.appendChild(title);<NEW_LINE>title.appendChild(document.createTextNode("Properties - "));<NEW_LINE>literal = document.createElement("literal");<NEW_LINE>title.appendChild(literal);<NEW_LINE>literal.appendChild(document.createTextNode(extension.getPluginId()));<NEW_LINE>title.appendChild(document.createTextNode(" plugin"));<NEW_LINE>propertyTableRenderer.renderTo(extension.getExtensionProperties(), table);<NEW_LINE>}
(document.createTextNode(" plugin"));
546,146
public // -------------------------------------------------------------<NEW_LINE>boolean loadGraph(String name) {<NEW_LINE>// Make sure index ID values are set as LONG values.<NEW_LINE>// If this is not done, when we try to sort results by vertex<NEW_LINE>// ID later it will not sort the way you would expect it to.<NEW_LINE>BaseConfiguration conf = new BaseConfiguration();<NEW_LINE>conf.setProperty("gremlin.tinkergraph.vertexIdManager", "LONG");<NEW_LINE>conf.setProperty("gremlin.tinkergraph.edgeIdManager", "LONG");<NEW_LINE>conf.setProperty("gremlin.tinkergraph.vertexPropertyIdManager", "LONG");<NEW_LINE>// Create a new instance that uses this configuration.<NEW_LINE>tg = TinkerGraph.open(conf);<NEW_LINE>// Load the graph and time how long it takes.<NEW_LINE>System.out.println("Loading " + name);<NEW_LINE><MASK><NEW_LINE>System.out.println(t1);<NEW_LINE>try {<NEW_LINE>tg.io(IoCore.graphml()).readGraph(name);<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.out.println("ERROR - GraphML file not found or invalid.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>long t2 = System.currentTimeMillis();<NEW_LINE>System.out.println(t2 + "(" + (t2 - t1) + ")");<NEW_LINE>System.out.println("Graph loaded\n");<NEW_LINE>g = tg.traversal();<NEW_LINE>return true;<NEW_LINE>}
long t1 = System.currentTimeMillis();
1,795,741
public void onScriptPostFired(ScriptPostFired event) {<NEW_LINE>if (event.getScriptId() == ScriptID.FRIENDS_UPDATE) {<NEW_LINE>final int world = client.getWorld();<NEW_LINE>final boolean isMember = client.getVar(VarPlayer.MEMBERSHIP_DAYS) > 0;<NEW_LINE>final NameableContainer<Friend> friendContainer = client.getFriendContainer();<NEW_LINE>final int friendCount = friendContainer.getCount();<NEW_LINE>if (friendCount >= 0) {<NEW_LINE>final int limit = isMember ? MAX_FRIENDS_P2P : MAX_FRIENDS_F2P;<NEW_LINE>final String title = "Friends - W" + world + " (" + friendCount + "/" + limit + ")";<NEW_LINE>setFriendsListTitle(title);<NEW_LINE>}<NEW_LINE>} else if (event.getScriptId() == ScriptID.IGNORE_UPDATE) {<NEW_LINE>final <MASK><NEW_LINE>final boolean isMember = client.getVar(VarPlayer.MEMBERSHIP_DAYS) > 0;<NEW_LINE>final NameableContainer<Ignore> ignoreContainer = client.getIgnoreContainer();<NEW_LINE>final int ignoreCount = ignoreContainer.getCount();<NEW_LINE>if (ignoreCount >= 0) {<NEW_LINE>final int limit = isMember ? MAX_IGNORES_P2P : MAX_IGNORES_F2P;<NEW_LINE>final String title = "Ignores - W" + world + " (" + ignoreCount + "/" + limit + ")";<NEW_LINE>setIgnoreListTitle(title);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int world = client.getWorld();
1,682,338
final GetMeetingResult executeGetMeeting(GetMeetingRequest getMeetingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getMeetingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetMeetingRequest> request = null;<NEW_LINE>Response<GetMeetingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetMeetingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMeetingRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMeeting");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetMeetingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetMeetingResultJsonUnmarshaller());<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);
689,394
private static void verifyRuntime(boolean fatal) {<NEW_LINE>if (GraalVMVersion.isGraalVM()) {<NEW_LINE>// graalvm version should be aligned with the dependencies<NEW_LINE>// used on the application, otherwise it introduces some<NEW_LINE>// unwanted side effects<NEW_LINE>try (InputStream is = PM.class.getClassLoader().getResourceAsStream("META-INF/es4x-commands/VERSIONS.properties")) {<NEW_LINE>if (is != null) {<NEW_LINE>final Properties versions = new Properties();<NEW_LINE>versions.load(is);<NEW_LINE>String <MASK><NEW_LINE>if (!GraalVMVersion.isGreaterOrEqual(wanted)) {<NEW_LINE>String msg = "Runtime GraalVM version mismatch { wanted: [%s], provided: [%s] }%sFor installation help see: https://www.graalvm.org/docs/getting-started-with-graalvm/";<NEW_LINE>if (fatal) {<NEW_LINE>fatal(String.format(msg, wanted, GraalVMVersion.version(), System.lineSeparator()));<NEW_LINE>} else {<NEW_LINE>warn(String.format(msg, wanted, GraalVMVersion.version(), System.lineSeparator()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>fatal(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
wanted = versions.getProperty("graalvm");
560,312
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {<NEW_LINE>CommonLayoutParams.adjustChildrenLayoutParams(this, widthMeasureSpec, heightMeasureSpec);<NEW_LINE>int measureWidth = 0;<NEW_LINE>int measureHeight = 0;<NEW_LINE>int width = MeasureSpec.getSize(widthMeasureSpec);<NEW_LINE>int widthMode = MeasureSpec.getMode(widthMeasureSpec);<NEW_LINE>int height = MeasureSpec.getSize(heightMeasureSpec);<NEW_LINE>int heightMode = MeasureSpec.getMode(heightMeasureSpec);<NEW_LINE>int verticalPadding = this.getPaddingTop() + this.getPaddingBottom();<NEW_LINE>int horizontalPadding = this.getPaddingLeft() + this.getPaddingRight();<NEW_LINE>int remainingWidth = widthMode == MeasureSpec.UNSPECIFIED ? 0 : width - horizontalPadding;<NEW_LINE>int remainingHeight = heightMode == MeasureSpec.UNSPECIFIED ? 0 : height - verticalPadding;<NEW_LINE>int tempHeight = 0;<NEW_LINE>int tempWidth = 0;<NEW_LINE>int childWidthMeasureSpec = 0;<NEW_LINE>int childHeightMeasureSpec = 0;<NEW_LINE>int count = this.getChildCount();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>View child = this.getChildAt(i);<NEW_LINE>if (child.getVisibility() == View.GONE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (this._stretchLastChild && (i == (count - 1))) {<NEW_LINE>childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(remainingWidth, widthMode);<NEW_LINE>childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(remainingHeight, heightMode);<NEW_LINE>} else {<NEW_LINE>// Measure children with AT_MOST even if our mode is EXACT<NEW_LINE>childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(remainingWidth, widthMode == MeasureSpec.EXACTLY ? MeasureSpec.AT_MOST : widthMode);<NEW_LINE>childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(remainingHeight, heightMode == MeasureSpec.EXACTLY ? MeasureSpec.AT_MOST : heightMode);<NEW_LINE>}<NEW_LINE>CommonLayoutParams.<MASK><NEW_LINE>final int childMeasuredWidth = CommonLayoutParams.getDesiredWidth(child);<NEW_LINE>final int childMeasuredHeight = CommonLayoutParams.getDesiredHeight(child);<NEW_LINE>CommonLayoutParams childLayoutParams = (CommonLayoutParams) child.getLayoutParams();<NEW_LINE>Dock dock = childLayoutParams.dock;<NEW_LINE>switch(dock) {<NEW_LINE>case top:<NEW_LINE>case bottom:<NEW_LINE>remainingHeight = Math.max(0, remainingHeight - childMeasuredHeight);<NEW_LINE>tempHeight += childMeasuredHeight;<NEW_LINE>measureWidth = Math.max(measureWidth, tempWidth + childMeasuredWidth);<NEW_LINE>measureHeight = Math.max(measureHeight, tempHeight);<NEW_LINE>break;<NEW_LINE>case left:<NEW_LINE>case right:<NEW_LINE>default:<NEW_LINE>remainingWidth = Math.max(0, remainingWidth - childMeasuredWidth);<NEW_LINE>tempWidth += childMeasuredWidth;<NEW_LINE>measureWidth = Math.max(measureWidth, tempWidth);<NEW_LINE>measureHeight = Math.max(measureHeight, tempHeight + childMeasuredHeight);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add in our padding<NEW_LINE>measureWidth += horizontalPadding;<NEW_LINE>measureHeight += verticalPadding;<NEW_LINE>// Check against our minimum sizes<NEW_LINE>measureWidth = Math.max(measureWidth, this.getSuggestedMinimumWidth());<NEW_LINE>measureHeight = Math.max(measureHeight, this.getSuggestedMinimumHeight());<NEW_LINE>int widthSizeAndState = resolveSizeAndState(measureWidth, widthMeasureSpec, 0);<NEW_LINE>int heightSizeAndState = resolveSizeAndState(measureHeight, heightMeasureSpec, 0);<NEW_LINE>this.setMeasuredDimension(widthSizeAndState, heightSizeAndState);<NEW_LINE>}
measureChild(child, childWidthMeasureSpec, childHeightMeasureSpec);
608,193
public ConfigOrError parseLoadBalancingPolicyConfig(Map<String, ?> rawConfig) {<NEW_LINE>Map<String, PolicySelection> parsedChildPolicies = new LinkedHashMap<>();<NEW_LINE>try {<NEW_LINE>Map<String, ?> childPolicies = JsonUtil.getObject(rawConfig, "childPolicy");<NEW_LINE>if (childPolicies == null || childPolicies.isEmpty()) {<NEW_LINE>return ConfigOrError.fromError(Status.INTERNAL.withDescription("No child policy provided for cluster_manager LB policy: " + rawConfig));<NEW_LINE>}<NEW_LINE>for (String name : childPolicies.keySet()) {<NEW_LINE>Map<String, ?> childPolicy = JsonUtil.getObject(childPolicies, name);<NEW_LINE>if (childPolicy == null) {<NEW_LINE>return ConfigOrError.fromError(Status.INTERNAL.withDescription("No config for child " + name + " in cluster_manager LB policy: " + rawConfig));<NEW_LINE>}<NEW_LINE>List<LbConfig> childConfigCandidates = ServiceConfigUtil.unwrapLoadBalancingConfigList(JsonUtil.getListOfObjects(childPolicy, "lbPolicy"));<NEW_LINE>if (childConfigCandidates == null || childConfigCandidates.isEmpty()) {<NEW_LINE>return ConfigOrError.fromError(Status.INTERNAL.withDescription("No config specified for child " <MASK><NEW_LINE>}<NEW_LINE>LoadBalancerRegistry registry = lbRegistry != null ? lbRegistry : LoadBalancerRegistry.getDefaultRegistry();<NEW_LINE>ConfigOrError selectedConfig = ServiceConfigUtil.selectLbPolicyFromList(childConfigCandidates, registry);<NEW_LINE>if (selectedConfig.getError() != null) {<NEW_LINE>Status error = selectedConfig.getError();<NEW_LINE>return ConfigOrError.fromError(Status.INTERNAL.withCause(error.getCause()).withDescription(error.getDescription()).augmentDescription("Failed to select config for child " + name));<NEW_LINE>}<NEW_LINE>parsedChildPolicies.put(name, (PolicySelection) selectedConfig.getConfig());<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>return ConfigOrError.fromError(Status.fromThrowable(e).withDescription("Failed to parse cluster_manager LB config: " + rawConfig));<NEW_LINE>}<NEW_LINE>return ConfigOrError.fromConfig(new ClusterManagerConfig(parsedChildPolicies));<NEW_LINE>}
+ name + " in cluster_manager Lb policy: " + rawConfig));
1,198,803
public String generate() {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>appendPackageAndCommonImports(builder, apiClassname, Arrays.<HollowSchema>asList(schema));<NEW_LINE>builder.append("import " + HollowList.class.getName() + ";\n");<NEW_LINE>builder.append("import " + HollowListSchema.class.getName() + ";\n");<NEW_LINE>builder.append("import " + HollowListDelegate.<MASK><NEW_LINE>builder.append("import " + GenericHollowRecordHelper.class.getName() + ";\n\n");<NEW_LINE>builder.append("@SuppressWarnings(\"all\")\n");<NEW_LINE>if (parameterize)<NEW_LINE>builder.append("public class " + className + "<T> extends HollowList<T> {\n\n");<NEW_LINE>else<NEW_LINE>builder.append("public class " + className + " extends HollowList<" + elementClassName + "> {\n\n");<NEW_LINE>appendConstructor(builder);<NEW_LINE>appendInstantiateMethod(builder);<NEW_LINE>appendEqualityMethod(builder);<NEW_LINE>appendAPIAccessor(builder);<NEW_LINE>appendTypeAPIAccessor(builder);<NEW_LINE>builder.append("}");<NEW_LINE>return builder.toString();<NEW_LINE>}
class.getName() + ";\n");
754,630
private static boolean isSignatureValid(byte[] signatureFromMerit, String pubKeyAsHex, String blindVoteTxId) {<NEW_LINE>// We verify if signature of hash of blindVoteTxId is correct. EC key from first input for blind vote tx is<NEW_LINE>// used for signature.<NEW_LINE>if (pubKeyAsHex == null) {<NEW_LINE>log.error("Error at isSignatureValid: pubKeyAsHex is null");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean result = false;<NEW_LINE>try {<NEW_LINE>ECKey pubKey = ECKey.fromPublicOnly(Utilities.decodeFromHex(pubKeyAsHex));<NEW_LINE>ECKey.ECDSASignature signature = ECKey.ECDSASignature.decodeFromDER(signatureFromMerit).toCanonicalised();<NEW_LINE>Sha256Hash msg = Sha256Hash.wrap(blindVoteTxId);<NEW_LINE>result = pubKey.verify(msg, signature);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.error(<MASK><NEW_LINE>}<NEW_LINE>if (!result) {<NEW_LINE>log.error("Signature verification of issuance failed: blindVoteTxId={}, pubKeyAsHex={}", blindVoteTxId, pubKeyAsHex);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
"Signature verification of issuance failed: " + t.toString());
451,878
/* package */<NEW_LINE>void parseKml() throws XmlPullParserException, IOException {<NEW_LINE>int eventType = mParser.getEventType();<NEW_LINE>while (eventType != XmlPullParser.END_DOCUMENT) {<NEW_LINE>if (eventType == XmlPullParser.START_TAG) {<NEW_LINE>if (mParser.getName().matches(UNSUPPORTED_REGEX)) {<NEW_LINE>skip(mParser);<NEW_LINE>}<NEW_LINE>if (mParser.getName().matches(CONTAINER_REGEX)) {<NEW_LINE>mContainers.add(KmlContainerParser.createContainer(mParser));<NEW_LINE>}<NEW_LINE>if (mParser.getName().equals(STYLE)) {<NEW_LINE>KmlStyle style = KmlStyleParser.createStyle(mParser);<NEW_LINE>mStyles.put(style.getStyleId(), style);<NEW_LINE>}<NEW_LINE>if (mParser.getName().equals(STYLE_MAP)) {<NEW_LINE>mStyleMaps.putAll<MASK><NEW_LINE>}<NEW_LINE>if (mParser.getName().equals(PLACEMARK)) {<NEW_LINE>mPlacemarks.put(KmlFeatureParser.createPlacemark(mParser), null);<NEW_LINE>}<NEW_LINE>if (mParser.getName().equals(GROUND_OVERLAY)) {<NEW_LINE>mGroundOverlays.put(KmlFeatureParser.createGroundOverlay(mParser), null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>eventType = mParser.next();<NEW_LINE>}<NEW_LINE>// Need to put an empty new style<NEW_LINE>mStyles.put(null, new KmlStyle());<NEW_LINE>}
(KmlStyleParser.createStyleMap(mParser));
875,325
public Object doQuery(Object[] objs) {<NEW_LINE>Object[] os = new Object[1];<NEW_LINE>os[0] = objs[0];<NEW_LINE>// for columns<NEW_LINE>super.doQuery(os);<NEW_LINE>if (objs.length != 3) {<NEW_LINE>throw new RQException("redis getRange param size " + objs.length + " is not 3");<NEW_LINE>} else {<NEW_LINE>List<String> ls = m_jedisTool.lRange(objs[0].toString(), Integer.parseInt(objs[1].toString()), Integer.parseInt(objs[2].toString()));<NEW_LINE>if (ls.size() > 0) {<NEW_LINE>List<Object[]> list = new ArrayList<Object[]>();<NEW_LINE>for (Iterator<String> it = ls.iterator(); it.hasNext(); ) {<NEW_LINE>os = new Object[1];<NEW_LINE>os[0] = it<MASK><NEW_LINE>list.add(os);<NEW_LINE>}<NEW_LINE>return toTable(list);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.next().toString();
126,058
public void serialize(final T t, final BufferAllocator allocator, final Buffer buffer) {<NEW_LINE>if (compressor == null) {<NEW_LINE>final int writerIndexBefore = buffer.writerIndex();<NEW_LINE>buffer.writerIndex(writerIndexBefore + METADATA_SIZE);<NEW_LINE>serializer.<MASK><NEW_LINE>buffer.setByte(writerIndexBefore, FLAG_UNCOMPRESSED);<NEW_LINE>buffer.setInt(writerIndexBefore + 1, buffer.writerIndex() - writerIndexBefore - METADATA_SIZE);<NEW_LINE>} else {<NEW_LINE>// First do the serialization.<NEW_LINE>final int sizeEstimate = serializedBytesEstimator.applyAsInt(t);<NEW_LINE>Buffer serializedBuffer = allocator.newBuffer(sizeEstimate);<NEW_LINE>serializer.serialize(t, allocator, serializedBuffer);<NEW_LINE>// Compress into the same buffer that we return, so advance the writer index metadata<NEW_LINE>// bytes and then we fill in the meta data after compression is done and the final size is known.<NEW_LINE>final int writerIndexBefore = buffer.writerIndex();<NEW_LINE>buffer.writerIndex(writerIndexBefore + METADATA_SIZE);<NEW_LINE>compressor.encoder().serialize(serializedBuffer, allocator, buffer);<NEW_LINE>buffer.setByte(writerIndexBefore, FLAG_COMPRESSED);<NEW_LINE>buffer.setInt(writerIndexBefore + 1, buffer.writerIndex() - writerIndexBefore - METADATA_SIZE);<NEW_LINE>}<NEW_LINE>}
serialize(t, allocator, buffer);
1,049,540
private void createLoggingSelectorGroup() {<NEW_LINE>Group loggingButtonGroup = new Group(this, SWT.NONE);<NEW_LINE>loggingButtonGroup.setText(Messages.CONFIGURATION_TAB_LOGGER_GROUP_TITLE);<NEW_LINE>GridLayout groupLayout = new GridLayout(LoggingButtonData.values().length, false);<NEW_LINE>loggingButtonGroup.setLayout(groupLayout);<NEW_LINE>loggingButtonGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));<NEW_LINE>loggingButtonGroup.setFont(this.getFont());<NEW_LINE>SelectionListener listener = new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>Button button = (Button) e.widget;<NEW_LINE>if (button.getSelection()) {<NEW_LINE>updateLaunchConfigurationDialog();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>for (LoggingButtonData data : LoggingButtonData.values()) {<NEW_LINE>Button b = new <MASK><NEW_LINE>b.setText(data.displayText());<NEW_LINE>b.setData(data);<NEW_LINE>b.addSelectionListener(listener);<NEW_LINE>loggingButtonMap.put(data, b);<NEW_LINE>}<NEW_LINE>}
Button(loggingButtonGroup, SWT.RADIO);
30,421
public void addJMSHeaderExpansions(PropertyExpansionsResult result, JMSHeaderConfig jmsHeaderConfig, ModelItem modelItem) {<NEW_LINE>result.addAll(PropertyExpansionUtils.extractPropertyExpansions(modelItem, jmsHeaderConfig, JMSHeader.JMSCORRELATIONID));<NEW_LINE>result.addAll(PropertyExpansionUtils.extractPropertyExpansions(modelItem, jmsHeaderConfig, JMSHeader.JMSREPLYTO));<NEW_LINE>result.addAll(PropertyExpansionUtils.extractPropertyExpansions(modelItem, jmsHeaderConfig, JMSHeader.JMSTYPE));<NEW_LINE>result.addAll(PropertyExpansionUtils.extractPropertyExpansions(modelItem<MASK><NEW_LINE>result.addAll(PropertyExpansionUtils.extractPropertyExpansions(modelItem, jmsHeaderConfig, JMSHeader.DURABLE_SUBSCRIPTION_NAME));<NEW_LINE>result.addAll(PropertyExpansionUtils.extractPropertyExpansions(modelItem, jmsHeaderConfig, JMSHeader.CLIENT_ID));<NEW_LINE>result.addAll(PropertyExpansionUtils.extractPropertyExpansions(modelItem, jmsHeaderConfig, JMSHeader.SEND_AS_BYTESMESSAGE));<NEW_LINE>result.addAll(PropertyExpansionUtils.extractPropertyExpansions(modelItem, jmsHeaderConfig, JMSHeader.SOAP_ACTION_ADD));<NEW_LINE>}
, jmsHeaderConfig, JMSHeader.JMSPRIORITY));
1,449,638
public void doReportStat(SofaTracerSpan sofaTracerSpan) {<NEW_LINE>Map<String, String> tagsWithStr = sofaTracerSpan.getTagsWithStr();<NEW_LINE>StatMapKey statKey = new StatMapKey();<NEW_LINE>statKey.addKey(CommonSpanTags.LOCAL_APP, tagsWithStr.get(CommonSpanTags.LOCAL_APP));<NEW_LINE>statKey.addKey(CommonSpanTags.REQUEST_URL, tagsWithStr.get(CommonSpanTags.REQUEST_URL));<NEW_LINE>statKey.addKey(CommonSpanTags.METHOD, tagsWithStr.get(CommonSpanTags.METHOD));<NEW_LINE>// pressure mark<NEW_LINE>statKey.setLoadTest(TracerUtils.isLoadTest(sofaTracerSpan));<NEW_LINE>// success<NEW_LINE>String resultCode = tagsWithStr.get(CommonSpanTags.RESULT_CODE);<NEW_LINE>boolean success = isWebHttpClientSuccess(resultCode);<NEW_LINE>statKey.setResult(success ? SofaTracerConstant.STAT_FLAG_SUCCESS : SofaTracerConstant.STAT_FLAG_FAILS);<NEW_LINE>// end<NEW_LINE>statKey.setEnd(TracerUtils.getLoadTestMark(sofaTracerSpan));<NEW_LINE>// value the count and duration<NEW_LINE>long duration = sofaTracerSpan.getEndTime() - sofaTracerSpan.getStartTime();<NEW_LINE>long[] values = new <MASK><NEW_LINE>// reserve<NEW_LINE>this.addStat(statKey, values);<NEW_LINE>}
long[] { 1, duration };
1,386,413
final UpdateRecipeJobResult executeUpdateRecipeJob(UpdateRecipeJobRequest updateRecipeJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateRecipeJobRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateRecipeJobRequest> request = null;<NEW_LINE>Response<UpdateRecipeJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateRecipeJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateRecipeJobRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataBrew");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateRecipeJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateRecipeJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateRecipeJobResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,793,689
public void printImageFromFile(String path, int x, int y, Map<String, Object> options, IPrinterResponce result) {<NEW_LINE>Utils.platformLog("ZEBRA_PRINTER", "@@@@ printImageFromFile !!!");<NEW_LINE>int width = -1;<NEW_LINE>int height = -1;<NEW_LINE>boolean isInsideFormat = false;<NEW_LINE>if (path.toLowerCase().endsWith(".gif") || path.toLowerCase().endsWith(".bmp")) {<NEW_LINE>result.onError("unsupported image format");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (options != null) {<NEW_LINE>Object obj = options.get(IZebraPrinter.HK_WIDTH);<NEW_LINE>if ((obj != null) && (obj instanceof Integer)) {<NEW_LINE>width = ((Integer) obj).intValue();<NEW_LINE>}<NEW_LINE>obj = options.get(IZebraPrinter.HK_HEIGHT);<NEW_LINE>if ((obj != null) && (obj instanceof Integer)) {<NEW_LINE>height = ((Integer) obj).intValue();<NEW_LINE>}<NEW_LINE>obj = options.get(IZebraPrinter.HK_IS_INSIDE_FORMAT);<NEW_LINE>if ((obj != null) && (obj instanceof Boolean)) {<NEW_LINE>isInsideFormat = ((<MASK><NEW_LINE>}<NEW_LINE>if ((width == 0) || (height == 0)) {<NEW_LINE>result.onError("invalid image size");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ZebraTransactionManager.addCommand(new PrintPrinImageFromFileCommand(path, x, y, width, height, isInsideFormat, result));<NEW_LINE>}
Boolean) obj).booleanValue();
1,038,880
protected void fillTable(Listbox cb) {<NEW_LINE>ValueNamePair select = null;<NEW_LINE>String sql = "SELECT AD_Table_ID, TableName FROM AD_Table t " + "WHERE EXISTS (SELECT * FROM AD_Column c" + " WHERE t.AD_Table_ID=c.AD_Table_ID AND c.ColumnName='Posted')" + " AND IsView='N'";<NEW_LINE>try {<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(sql, null);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>int id = rs.getInt(1);<NEW_LINE>String <MASK><NEW_LINE>String name = Msg.translate(Env.getCtx(), tableName + "_ID");<NEW_LINE>ValueNamePair pp = new ValueNamePair(tableName, name);<NEW_LINE>cb.appendItem(pp.getName(), pp);<NEW_LINE>tableInfo.put(tableName, new Integer(id));<NEW_LINE>if (id == AD_Table_ID)<NEW_LINE>select = pp;<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>}<NEW_LINE>if (select != null)<NEW_LINE>// cb.setSelectedItem(select);<NEW_LINE>;<NEW_LINE>}
tableName = rs.getString(2);
1,329,018
static FileObject copyBuildNativeTemplate(@NonNull final Project project) throws IOException {<NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("project", project);<NEW_LINE>final FileObject buildExFoBack = project.getProjectDirectory().getFileObject(// NOI18N<NEW_LINE>String.// NOI18N<NEW_LINE>format("%s~", EXTENSION_BUILD_SCRIPT_PATH));<NEW_LINE>if (buildExFoBack != null) {<NEW_LINE>closeInEditor(buildExFoBack);<NEW_LINE>buildExFoBack.delete();<NEW_LINE>}<NEW_LINE>FileObject buildExFo = project.getProjectDirectory().getFileObject(EXTENSION_BUILD_SCRIPT_PATH);<NEW_LINE>FileLock lock;<NEW_LINE>if (buildExFo != null) {<NEW_LINE>closeInEditor(buildExFo);<NEW_LINE>lock = buildExFo.lock();<NEW_LINE>try {<NEW_LINE>buildExFo.rename(lock, buildExFo.getName(), // NOI18N<NEW_LINE>String.// NOI18N<NEW_LINE>format("%s~", buildExFo.getExt()));<NEW_LINE>} finally {<NEW_LINE>lock.releaseLock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buildExFo = FileUtil.createData(project.getProjectDirectory(), EXTENSION_BUILD_SCRIPT_PATH);<NEW_LINE>lock = buildExFo.lock();<NEW_LINE>try (final InputStream in = J2SEDeployProperties.class.<MASK><NEW_LINE>final OutputStream out = buildExFo.getOutputStream(lock)) {<NEW_LINE>FileUtil.copy(in, out);<NEW_LINE>} finally {<NEW_LINE>lock.releaseLock();<NEW_LINE>}<NEW_LINE>return buildExFo;<NEW_LINE>}
getClassLoader().getResourceAsStream(BUILD_SCRIPT_PROTOTYPE);
777,672
public OutputStream writeResponseStatusAndHeaders(final long contentLength, final ContainerResponse context) throws ContainerException {<NEW_LINE>final javax.ws.rs.core.Response.StatusType statusInfo = context.getStatusInfo();<NEW_LINE>final int code = statusInfo.getStatusCode();<NEW_LINE>final String reason = statusInfo.getReasonPhrase() == null ? HttpStatus.getMessage(code) : statusInfo.getReasonPhrase();<NEW_LINE><MASK><NEW_LINE>if (contentLength != -1 && contentLength < Integer.MAX_VALUE) {<NEW_LINE>response.setContentLength((int) contentLength);<NEW_LINE>}<NEW_LINE>for (final Map.Entry<String, List<String>> e : context.getStringHeaders().entrySet()) {<NEW_LINE>for (final String value : e.getValue()) {<NEW_LINE>response.addHeader(e.getKey(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return response.getOutputStream();<NEW_LINE>} catch (final IOException ioe) {<NEW_LINE>throw new ContainerException("Error during writing out the response headers.", ioe);<NEW_LINE>}<NEW_LINE>}
response.setStatusWithReason(code, reason);
150,190
public void onSuspendEvent(SuspendInfo info) {<NEW_LINE>if (!isDebugging()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (info.isTerminated()) {<NEW_LINE>debuggerPanel.log("Debugger exited.");<NEW_LINE>setDebuggerState(true, true);<NEW_LINE>debugger = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>setDebuggerState(true, false);<NEW_LINE>long threadID = info.getThreadID();<NEW_LINE>// update all threads, stack frames, registers and fields.<NEW_LINE>int refreshLevel = 2;<NEW_LINE>if (cur.frame != null) {<NEW_LINE>if (threadID == cur.frame.getThreadID() && info.getClassID() == cur.frame.getClsID() && info.getMethodID() == cur.frame.getMthID()) {<NEW_LINE>// relevant registers or fields.<NEW_LINE>refreshLevel = 1;<NEW_LINE>} else {<NEW_LINE>cur.frame.getClsID();<NEW_LINE>}<NEW_LINE>setRegsNotUpdated();<NEW_LINE>}<NEW_LINE>if (refreshLevel == 2) {<NEW_LINE>updateAllInfo(threadID, info.getOffset());<NEW_LINE>} else {<NEW_LINE>if (cur.smali != null && cur.frame != null) {<NEW_LINE>refreshRegInfo(info.getOffset());<NEW_LINE>refreshCurFrame(threadID, info.getOffset());<NEW_LINE>if (updateAllFldAndReg) {<NEW_LINE>debuggerPanel.resetRegTreeNodes();<NEW_LINE>updateAllRegisters(cur.frame);<NEW_LINE>} else if (toBeUpdatedTreeNode != null) {<NEW_LINE>lazyQueue.execute(<MASK><NEW_LINE>}<NEW_LINE>markCodeOffset(info.getOffset());<NEW_LINE>} else {<NEW_LINE>debuggerPanel.resetRegTreeNodes();<NEW_LINE>}<NEW_LINE>if (cur.frame != null) {<NEW_LINE>// update current code offset in stack frame.<NEW_LINE>cur.frame.updateCodeOffset(info.getOffset());<NEW_LINE>debuggerPanel.refreshStackFrameList(Collections.emptyList());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
() -> updateRegOrField(toBeUpdatedTreeNode));
1,804,203
private void encryptParameters(final StandardParameterBuilder parameterBuilder, final String tableName, final AssignmentSegment assignmentSegment, final List<Object> parameters) {<NEW_LINE>String columnName = assignmentSegment.getColumns().get(0).getIdentifier().getValue();<NEW_LINE>int parameterMarkerIndex = ((ParameterMarkerExpressionSegment) assignmentSegment.getValue()).getParameterMarkerIndex();<NEW_LINE>Object originalValue = parameters.get(parameterMarkerIndex);<NEW_LINE>Object cipherValue = encryptRule.getEncryptValues(schemaName, tableName, columnName, Collections.singletonList(originalValue)).iterator().next();<NEW_LINE>parameterBuilder.addReplacedParameters(parameterMarkerIndex, cipherValue);<NEW_LINE>Collection<Object> addedParameters = new LinkedList<>();<NEW_LINE>if (encryptRule.findAssistedQueryColumn(tableName, columnName).isPresent()) {<NEW_LINE>Object assistedQueryValue = encryptRule.getEncryptAssistedQueryValues(schemaName, tableName, columnName, Collections.singletonList(originalValue))<MASK><NEW_LINE>addedParameters.add(assistedQueryValue);<NEW_LINE>}<NEW_LINE>if (encryptRule.findPlainColumn(tableName, columnName).isPresent()) {<NEW_LINE>addedParameters.add(originalValue);<NEW_LINE>}<NEW_LINE>if (!addedParameters.isEmpty()) {<NEW_LINE>parameterBuilder.addAddedParameters(parameterMarkerIndex + 1, addedParameters);<NEW_LINE>}<NEW_LINE>}
.iterator().next();
1,524,998
private List<Candidate> createCandidatesForPPOrder(@NonNull final AbstractTransactionEvent event) {<NEW_LINE>final List<Candidate> candidates;<NEW_LINE>final TransactionDetail transactionDetailOfEvent = createTransactionDetail(event);<NEW_LINE>final int ppOrderLineIdForQuery = event.getPpOrderLineId() > 0 ? event.getPpOrderLineId() : ProductionDetailsQuery.NO_PP_ORDER_LINE_ID;<NEW_LINE>final ProductionDetailsQuery productionDetailsQuery = ProductionDetailsQuery.builder().ppOrderId(event.getPpOrderId()).<MASK><NEW_LINE>final CandidatesQuery query = // don't search via material descriptor ..what we have is precise enough; the product and warehouse will also match, but e.g. the date might not!<NEW_LINE>CandidatesQuery.builder().// without it, we might get other transaction-based ("UNEXPECTED_") candidates<NEW_LINE>businessCase(CandidateBusinessCase.PRODUCTION).productionDetailsQuery(productionDetailsQuery).build();<NEW_LINE>final Candidate existingCandidate = retrieveBestMatchingCandidateOrNull(query, event);<NEW_LINE>final boolean unrelatedNewTransaction = existingCandidate == null && event instanceof TransactionCreatedEvent;<NEW_LINE>if (unrelatedNewTransaction) {<NEW_LINE>final ProductionDetail productionDetail = productionDetailsQuery.toProductionDetailBuilder().advised(Flag.FALSE_DONT_UPDATE).pickDirectlyIfFeasible(Flag.FALSE_DONT_UPDATE).qty(event.getQuantity()).build();<NEW_LINE>final Candidate candidate = createBuilderForNewUnrelatedCandidate((TransactionCreatedEvent) event, event.getQuantity()).businessCase(CandidateBusinessCase.PRODUCTION).businessCaseDetail(productionDetail).transactionDetail(transactionDetailOfEvent).build();<NEW_LINE>candidates = ImmutableList.of(candidate);<NEW_LINE>} else if (existingCandidate != null) {<NEW_LINE>candidates = createOneOrTwoCandidatesWithChangedTransactionDetailAndQuantity(existingCandidate, transactionDetailOfEvent);<NEW_LINE>} else {<NEW_LINE>throw createExceptionForUnexpectedEvent(event);<NEW_LINE>}<NEW_LINE>return candidates;<NEW_LINE>}
ppOrderLineId(ppOrderLineIdForQuery).build();
1,605,255
public Container.ExecResult execInContainer(InspectContainerResponse containerInfo, Charset outputCharset, String... command) throws UnsupportedOperationException, IOException, InterruptedException {<NEW_LINE>if (!TestEnvironment.dockerExecutionDriverSupportsExec()) {<NEW_LINE>// at time of writing, this is the expected result in CircleCI.<NEW_LINE>throw new UnsupportedOperationException("Your docker daemon is running the \"lxc\" driver, which doesn't support \"docker exec\".");<NEW_LINE>}<NEW_LINE>if (!isRunning(containerInfo)) {<NEW_LINE>throw new IllegalStateException("execInContainer can only be used while the Container is running");<NEW_LINE>}<NEW_LINE>String containerId = containerInfo.getId();<NEW_LINE>String containerName = containerInfo.getName();<NEW_LINE>DockerClient dockerClient = DockerClientFactory.instance().client();<NEW_LINE>log.debug("{}: Running \"exec\" command: {}", containerName, String.join(" ", command));<NEW_LINE>final ExecCreateCmdResponse execCreateCmdResponse = dockerClient.execCreateCmd(containerId).withAttachStdout(true).withAttachStderr(true).<MASK><NEW_LINE>final ToStringConsumer stdoutConsumer = new ToStringConsumer();<NEW_LINE>final ToStringConsumer stderrConsumer = new ToStringConsumer();<NEW_LINE>try (FrameConsumerResultCallback callback = new FrameConsumerResultCallback()) {<NEW_LINE>callback.addConsumer(OutputFrame.OutputType.STDOUT, stdoutConsumer);<NEW_LINE>callback.addConsumer(OutputFrame.OutputType.STDERR, stderrConsumer);<NEW_LINE>dockerClient.execStartCmd(execCreateCmdResponse.getId()).exec(callback).awaitCompletion();<NEW_LINE>}<NEW_LINE>Integer exitCode = dockerClient.inspectExecCmd(execCreateCmdResponse.getId()).exec().getExitCode();<NEW_LINE>final Container.ExecResult result = new Container.ExecResult(exitCode, stdoutConsumer.toString(outputCharset), stderrConsumer.toString(outputCharset));<NEW_LINE>log.trace("{}: stdout: {}", containerName, result.getStdout());<NEW_LINE>log.trace("{}: stderr: {}", containerName, result.getStderr());<NEW_LINE>return result;<NEW_LINE>}
withCmd(command).exec();
971,751
private void tableswitch(Locatable locatable, SortedMap<Integer, CodeContext.Offset> caseLabelMap, Offset switchOffset, Offset defaultLabelOffset) {<NEW_LINE>final int low = (Integer) caseLabelMap.firstKey();<NEW_LINE>final int high = (Integer) caseLabelMap.lastKey();<NEW_LINE>this.addLineNumberOffset(locatable);<NEW_LINE>this.getCodeContext().popIntOperand();<NEW_LINE>this.write(Opcode.TABLESWITCH);<NEW_LINE>new Padder(this.<MASK><NEW_LINE>this.writeOffset(switchOffset, defaultLabelOffset);<NEW_LINE>this.writeInt(low);<NEW_LINE>this.writeInt(high);<NEW_LINE>int cur = low;<NEW_LINE>for (Map.Entry<Integer, CodeContext.Offset> me : caseLabelMap.entrySet()) {<NEW_LINE>int caseLabelValue = (Integer) me.getKey();<NEW_LINE>CodeContext.Offset caseLabelOffset = (CodeContext.Offset) me.getValue();<NEW_LINE>while (cur < caseLabelValue) {<NEW_LINE>this.writeOffset(switchOffset, defaultLabelOffset);<NEW_LINE>++cur;<NEW_LINE>}<NEW_LINE>this.writeOffset(switchOffset, caseLabelOffset);<NEW_LINE>++cur;<NEW_LINE>}<NEW_LINE>}
getCodeContext()).set();
666,578
public JasperPrint fill(Map<String, Object> parameterValues) throws JRException {<NEW_LINE>// FIXMEBOOK copied from JRBaseFiller<NEW_LINE>if (parameterValues == null) {<NEW_LINE>parameterValues = new HashMap<>();<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.<MASK><NEW_LINE>}<NEW_LINE>setParametersToContext(parameterValues);<NEW_LINE>fillingThread = Thread.currentThread();<NEW_LINE>JRResourcesFillUtil.ResourcesFillContext resourcesContext = JRResourcesFillUtil.setResourcesFillContext(parameterValues);<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>createBoundElemementMaps();<NEW_LINE>setParameters(parameterValues);<NEW_LINE>setBookmarkHelper();<NEW_LINE>// loadStyles();<NEW_LINE>jasperPrint.setName(jasperReport.getName());<NEW_LINE>jasperPrint.setPageWidth(jasperReport.getPageWidth());<NEW_LINE>jasperPrint.setPageHeight(jasperReport.getPageHeight());<NEW_LINE>jasperPrint.setTopMargin(jasperReport.getTopMargin());<NEW_LINE>jasperPrint.setLeftMargin(jasperReport.getLeftMargin());<NEW_LINE>jasperPrint.setBottomMargin(jasperReport.getBottomMargin());<NEW_LINE>jasperPrint.setRightMargin(jasperReport.getRightMargin());<NEW_LINE>jasperPrint.setOrientation(jasperReport.getOrientationValue());<NEW_LINE>jasperPrint.setFormatFactoryClass(jasperReport.getFormatFactoryClass());<NEW_LINE>jasperPrint.setLocaleCode(JRDataUtils.getLocaleCode(getLocale()));<NEW_LINE>jasperPrint.setTimeZoneId(JRDataUtils.getTimeZoneId(getTimeZone()));<NEW_LINE>propertiesUtil.transferProperties(mainDataset, jasperPrint, JasperPrint.PROPERTIES_PRINT_TRANSFER_PREFIX);<NEW_LINE>fillReport();<NEW_LINE>if (bookmarkHelper != null) {<NEW_LINE>jasperPrint.setBookmarks(bookmarkHelper.getRootBookmarks());<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Fill " + fillerId + ": ended");<NEW_LINE>}<NEW_LINE>success = true;<NEW_LINE>return jasperPrint;<NEW_LINE>} finally {<NEW_LINE>mainDataset.closeDatasource();<NEW_LINE>mainDataset.disposeParameterContributors();<NEW_LINE>if (success && parent == null) {<NEW_LINE>// commit the cached data<NEW_LINE>fillContext.cacheDone();<NEW_LINE>}<NEW_LINE>delayedActions.dispose();<NEW_LINE>fillingThread = null;<NEW_LINE>// kill the subreport filler threads<NEW_LINE>// killSubfillerThreads();<NEW_LINE>if (parent == null) {<NEW_LINE>fillContext.dispose();<NEW_LINE>}<NEW_LINE>JRResourcesFillUtil.revertResourcesFillContext(resourcesContext);<NEW_LINE>}<NEW_LINE>}
debug("Fill " + fillerId + ": filling report");
981,590
public synchronized void createTweet(Status status, int account) {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>String originalName = "";<NEW_LINE>long time = status.getCreatedAt().getTime();<NEW_LINE>long id = status.getId();<NEW_LINE>if (status.isRetweet()) {<NEW_LINE>originalName = status.getUser().getScreenName();<NEW_LINE>status = status.getRetweetedStatus();<NEW_LINE>}<NEW_LINE>String[] <MASK><NEW_LINE>String text = html[0];<NEW_LINE>String media = html[1];<NEW_LINE>String url = html[2];<NEW_LINE>String hashtags = html[3];<NEW_LINE>String users = html[4];<NEW_LINE>if (media.contains("/tweet_video/")) {<NEW_LINE>media = media.replace("tweet_video", "tweet_video_thumb").replace(".mp4", ".png").replace(".m3u8", ".png");<NEW_LINE>;<NEW_LINE>}<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_TEXT, text);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_TWEET_ID, id);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_NAME, status.getUser().getName());<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_PRO_PIC, status.getUser().getOriginalProfileImageURL());<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_SCREEN_NAME, status.getUser().getScreenName());<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_TIME, time);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_RETWEETER, originalName);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_PIC_URL, media);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_URL, url);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_USERS, users);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_HASHTAGS, hashtags);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_ANIMATED_GIF, TweetLinkUtils.getGIFUrl(status, url));<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_ACCOUNT, account);<NEW_LINE>try {<NEW_LINE>database.insert(SavedTweetSQLiteHelper.TABLE_HOME, null, values);<NEW_LINE>} catch (Exception e) {<NEW_LINE>open();<NEW_LINE>database.insert(SavedTweetSQLiteHelper.TABLE_HOME, null, values);<NEW_LINE>}<NEW_LINE>}
html = TweetLinkUtils.getLinksInStatus(status);
1,001,832
private void sendFiles(Session sess, String[] files, String mode) throws IOException {<NEW_LINE>byte[] buffer = new byte[8192];<NEW_LINE>OutputStream os = new BufferedOutputStream(sess.getStdin(), 40000);<NEW_LINE>InputStream is = new BufferedInputStream(sess.getStdout(), 512);<NEW_LINE>readResponse(is);<NEW_LINE>for (int i = 0; i < files.length; i++) {<NEW_LINE>File f = new File(files[i]);<NEW_LINE>long remain = f.length();<NEW_LINE>String cline = "C" + mode + " " + remain + " " <MASK><NEW_LINE>os.write(cline.getBytes());<NEW_LINE>os.flush();<NEW_LINE>readResponse(is);<NEW_LINE>FileInputStream fis = null;<NEW_LINE>try {<NEW_LINE>fis = new FileInputStream(f);<NEW_LINE>while (remain > 0) {<NEW_LINE>int trans;<NEW_LINE>if (remain > buffer.length)<NEW_LINE>trans = buffer.length;<NEW_LINE>else<NEW_LINE>trans = (int) remain;<NEW_LINE>if (fis.read(buffer, 0, trans) != trans)<NEW_LINE>throw new IOException("Cannot read enough from local file " + files[i]);<NEW_LINE>os.write(buffer, 0, trans);<NEW_LINE>remain -= trans;<NEW_LINE>}<NEW_LINE>fis.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>if (fis != null) {<NEW_LINE>fis.close();<NEW_LINE>}<NEW_LINE>throw (e);<NEW_LINE>}<NEW_LINE>os.write(0);<NEW_LINE>os.flush();<NEW_LINE>readResponse(is);<NEW_LINE>}<NEW_LINE>os.write("E\n".getBytes());<NEW_LINE>os.flush();<NEW_LINE>}
+ f.getName() + "\n";
962,907
public void sync(Storage.Schema schemaStorage, Storage.Data dataStorage) {<NEW_LINE>Encoding.Vertex.Thing[] thingsWithGeneratedIID = new Encoding.Vertex.Thing[] { ENTITY, RELATION, ROLE };<NEW_LINE>for (Encoding.Vertex.Thing thingEncoding : thingsWithGeneratedIID) {<NEW_LINE>FunctionalIterator<VertexIID.Type> typeIterator = schemaStorage.iterate(VertexIID.Type.prefix(Encoding.Vertex.Type.of(thingEncoding))).mapSorted(KeyValue::key, ASC).distinct();<NEW_LINE>while (typeIterator.hasNext()) {<NEW_LINE>VertexIID.<MASK><NEW_LINE>VertexIID.Thing lastIID = dataStorage.getLastKey(VertexIID.Thing.prefix(typeIID));<NEW_LINE>AtomicLong nextValue = lastIID != null ? new AtomicLong(lastIID.bytes().view(PREFIX_W_TYPE_LENGTH, DEFAULT_LENGTH).decodeSortedAsLong() + delta) : new AtomicLong(initialValue);<NEW_LINE>thingKeys.put(typeIID, nextValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Type typeIID = typeIterator.next();
829,522
static int nextBitSet(int bitIndex, int bitTableBytes, FST.BytesReader reader) throws IOException {<NEW_LINE>assert bitIndex >= -1 && bitIndex < bitTableBytes * Byte.SIZE <MASK><NEW_LINE>int byteIndex = bitIndex / Byte.SIZE;<NEW_LINE>int mask = -1 << ((bitIndex + 1) & (Byte.SIZE - 1));<NEW_LINE>int i;<NEW_LINE>if (mask == -1 && bitIndex != -1) {<NEW_LINE>reader.skipBytes(byteIndex + 1);<NEW_LINE>i = 0;<NEW_LINE>} else {<NEW_LINE>reader.skipBytes(byteIndex);<NEW_LINE>i = (reader.readByte() & 0xFF) & mask;<NEW_LINE>}<NEW_LINE>while (i == 0) {<NEW_LINE>if (++byteIndex == bitTableBytes) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>i = reader.readByte() & 0xFF;<NEW_LINE>}<NEW_LINE>return Integer.numberOfTrailingZeros(i) + (byteIndex << 3);<NEW_LINE>}
: "bitIndex=" + bitIndex + " bitTableBytes=" + bitTableBytes;
350,736
public void createItem(Item item, int page, Definitions.ItemPosition itemPosition) {<NEW_LINE>Log.i(this.getClass().getName(), String.format("createItem: %s (ID: %d)", item.getLabel(), item.getId()));<NEW_LINE>ContentValues itemValues = new ContentValues();<NEW_LINE>itemValues.put(COLUMN_TIME, item.getId());<NEW_LINE>itemValues.put(COLUMN_TYPE, item.<MASK><NEW_LINE>itemValues.put(COLUMN_LABEL, item.getLabel());<NEW_LINE>itemValues.put(COLUMN_X_POS, item.getX());<NEW_LINE>itemValues.put(COLUMN_Y_POS, item.getY());<NEW_LINE>String concat = "";<NEW_LINE>switch(item.getType()) {<NEW_LINE>case APP:<NEW_LINE>case SHORTCUT:<NEW_LINE>Tool.saveIcon(_context, Tool.drawableToBitmap(item.getIcon()), Integer.toString(item.getId()));<NEW_LINE>itemValues.put(COLUMN_DATA, Tool.getIntentAsString(item.getIntent()));<NEW_LINE>break;<NEW_LINE>case GROUP:<NEW_LINE>for (Item tmp : item.getItems()) {<NEW_LINE>if (tmp != null) {<NEW_LINE>concat += tmp.getId() + Definitions.DELIMITER;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>itemValues.put(COLUMN_DATA, concat);<NEW_LINE>break;<NEW_LINE>case ACTION:<NEW_LINE>itemValues.put(COLUMN_DATA, item.getActionValue());<NEW_LINE>break;<NEW_LINE>case WIDGET:<NEW_LINE>concat = item.getWidgetValue() + Definitions.DELIMITER + item.getSpanX() + Definitions.DELIMITER + item.getSpanY();<NEW_LINE>itemValues.put(COLUMN_DATA, concat);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>itemValues.put(COLUMN_PAGE, page);<NEW_LINE>itemValues.put(COLUMN_DESKTOP, itemPosition.ordinal());<NEW_LINE>// item will always be visible when first added<NEW_LINE>itemValues.put(COLUMN_STATE, 1);<NEW_LINE>_db.insert(TABLE_HOME, null, itemValues);<NEW_LINE>}
getType().toString());
1,483,007
public void refresh() {<NEW_LINE>ScouterUtil.collectGroupObjcts(grpName, serverObjMap);<NEW_LINE>isActive = false;<NEW_LINE>Iterator<Integer> serverIds = serverObjMap.keySet().iterator();<NEW_LINE>final List<Pack> result <MASK><NEW_LINE>while (serverIds.hasNext()) {<NEW_LINE>int serverId = serverIds.next();<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("counter", counter);<NEW_LINE>param.put("objHash", serverObjMap.get(serverId));<NEW_LINE>tcp.process(RequestCmd.COUNTER_TODAY_GROUP, param, new INetReader() {<NEW_LINE><NEW_LINE>public void process(DataInputX in) throws IOException {<NEW_LINE>Pack p = in.readPack();<NEW_LINE>if (p != null) {<NEW_LINE>result.add(p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final long[] values = new long[(int) (DateUtil.MILLIS_PER_DAY / DateUtil.MILLIS_PER_HOUR)];<NEW_LINE>if (result.size() > 0) {<NEW_LINE>Map<Long, Double> valueMap = ScouterUtil.getLoadTotalMap(counter, result, mode, TimeTypeEnum.FIVE_MIN);<NEW_LINE>Iterator<Long> itr = valueMap.keySet().iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>long time = itr.next();<NEW_LINE>int index = (int) (DateUtil.getDateMillis(time) / DateUtil.MILLIS_PER_HOUR);<NEW_LINE>values[index] += valueMap.get(time);<NEW_LINE>}<NEW_LINE>isActive = true;<NEW_LINE>}<NEW_LINE>ExUtil.exec(this.canvas, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (isActive == true) {<NEW_LINE>setActive();<NEW_LINE>} else {<NEW_LINE>setInactive();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>double max = 0;<NEW_LINE>traceDataProvider.clearTrace();<NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>traceDataProvider.addSample(new Sample(CastUtil.cdouble(i) + 0.5d, CastUtil.cdouble(values[i])));<NEW_LINE>}<NEW_LINE>max = Math.max(ChartUtil.getMax(traceDataProvider.iterator()), max);<NEW_LINE>if (CounterUtil.isPercentValue(objType, counter)) {<NEW_LINE>xyGraph.primaryYAxis.setRange(0, 100);<NEW_LINE>} else {<NEW_LINE>xyGraph.primaryYAxis.setRange(0, max);<NEW_LINE>}<NEW_LINE>canvas.redraw();<NEW_LINE>xyGraph.repaint();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
= new ArrayList<Pack>();
365,657
private void guessDelegate() {<NEW_LINE>// https://issues.apache.org/jira/browse/SIRONA-44<NEW_LINE>// https://github.com/javamelody/javamelody/issues/460<NEW_LINE>final List<PersistenceProvider> persistenceProviders = PersistenceProviderResolverHolder.getPersistenceProviderResolver().getPersistenceProviders();<NEW_LINE>for (final PersistenceProvider persistenceProvider : persistenceProviders) {<NEW_LINE>if (!getClass().isInstance(persistenceProvider)) {<NEW_LINE>delegate = persistenceProvider;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (delegate == null) {<NEW_LINE>for (final String provider : PROVIDERS) {<NEW_LINE>try {<NEW_LINE>delegate = newPersistence(provider);<NEW_LINE>break;<NEW_LINE>} catch (final Throwable th2) {<NEW_LINE>// NOPMD<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (delegate == null) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
IllegalStateException(new ClassNotFoundException("Can't find a delegate"));
391,097
// Remove a consumer for a topic<NEW_LINE>public CompletableFuture<Void> removeConsumerAsync(String topicName) {<NEW_LINE>checkArgument(TopicName.isValid(topicName), "Invalid topic name:" + topicName);<NEW_LINE>if (getState() == State.Closing || getState() == State.Closed) {<NEW_LINE>return FutureUtil.failedFuture(new PulsarClientException.AlreadyClosedException("Topics Consumer was already closed"));<NEW_LINE>}<NEW_LINE>CompletableFuture<Void> unsubscribeFuture = new CompletableFuture<>();<NEW_LINE>String topicPartName = TopicName.get(topicName).getPartitionedTopicName();<NEW_LINE>List<ConsumerImpl<T>> consumersToClose = consumers.values().stream().filter(consumer -> {<NEW_LINE>String consumerTopicName = consumer.getTopic();<NEW_LINE>return TopicName.get(consumerTopicName).getPartitionedTopicName().equals(topicPartName);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>List<CompletableFuture<Void>> futureList = consumersToClose.stream().map(ConsumerImpl::closeAsync).collect(Collectors.toList());<NEW_LINE>FutureUtil.waitForAll(futureList).whenComplete((r, ex) -> {<NEW_LINE>if (ex == null) {<NEW_LINE>consumersToClose.forEach(consumer1 -> {<NEW_LINE>consumers.remove(consumer1.getTopic());<NEW_LINE>pausedConsumers.remove(consumer1);<NEW_LINE>allTopicPartitionsNumber.decrementAndGet();<NEW_LINE>});<NEW_LINE>removeTopic(topicName);<NEW_LINE>((UnAckedTopicMessageTracker) unAckedMessageTracker).removeTopicMessages(topicName);<NEW_LINE>unsubscribeFuture.complete(null);<NEW_LINE>log.info("[{}] [{}] [{}] Removed Topics Consumer, allTopicPartitionsNumber: {}", topicName, subscription, consumerName, allTopicPartitionsNumber);<NEW_LINE>} else {<NEW_LINE>unsubscribeFuture.completeExceptionally(ex);<NEW_LINE>setState(State.Failed);<NEW_LINE>log.error("[{}] [{}] [{}] Could not remove Topics Consumer", topicName, subscription, <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return unsubscribeFuture;<NEW_LINE>}
consumerName, ex.getCause());
748,081
protected void wrapUpOutputs(File classes2Folder, File classes3Folder) throws IOException {<NEW_LINE>// the transform can set the verifier status to failure in some corner cases, in that<NEW_LINE>// case, make sure we delete our classes.3<NEW_LINE>// if (!transformScope.getInstantRunBuildContext().hasPassedVerification()) {<NEW_LINE>// FileUtils.cleanOutputDir(classes3Folder);<NEW_LINE>// return;<NEW_LINE>// }<NEW_LINE>// otherwise, generate the patch file and add it to the list of files to process next.<NEW_LINE>ImmutableList<String> generatedClassNames = generatedClasses3Names.build();<NEW_LINE>if (!generatedClassNames.isEmpty()) {<NEW_LINE>File patchClassInfo = new File(variantContext.getProject().getBuildDir(), "outputs/patchClassInfo.json");<NEW_LINE>org.apache.commons.io.FileUtils.writeStringToFile(patchClassInfo, JSON.toJSONString(modifyClasses));<NEW_LINE>modifyClasses.entrySet().forEach(stringStringEntry -> LOGGER.warning(stringStringEntry.getKey() + ":" <MASK><NEW_LINE>writePatchFileContents(generatedClassNames, classes3Folder, transformScope.getInstantRunBuildContext().getBuildId());<NEW_LINE>}<NEW_LINE>}
+ stringStringEntry.getValue()));
846,943
public static Date parseDate(@Nonnull String s) {<NEW_LINE>// SimpleDateFormat prior JDK7 doesn't support 'X' specifier for ISO 8601 timezone format.<NEW_LINE>// Because some bug trackers and task servers e.g. send dates ending with 'Z' (that stands for UTC),<NEW_LINE>// dates should be preprocessed before parsing.<NEW_LINE>Matcher <MASK><NEW_LINE>if (!m.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String datePart = m.group(1).replace('/', '-');<NEW_LINE>String timePart = m.group(2);<NEW_LINE>if (timePart == null) {<NEW_LINE>timePart = "00:00:00";<NEW_LINE>}<NEW_LINE>String milliseconds = m.group(3);<NEW_LINE>milliseconds = milliseconds == null ? "000" : milliseconds.substring(1, 4);<NEW_LINE>String timezone = m.group(4);<NEW_LINE>if (timezone == null || timezone.equals("Z")) {<NEW_LINE>timezone = "+0000";<NEW_LINE>} else if (timezone.length() == 3) {<NEW_LINE>// [+-]HH<NEW_LINE>timezone += "00";<NEW_LINE>} else if (timezone.length() == 6) {<NEW_LINE>// [+-]HH:MM<NEW_LINE>timezone = timezone.substring(0, 3) + timezone.substring(4, 6);<NEW_LINE>}<NEW_LINE>String canonicalForm = String.format("%sT%s.%s%s", datePart, timePart, milliseconds, timezone);<NEW_LINE>try {<NEW_LINE>return DateFormatUtil.getIso8601Format().parse(canonicalForm);<NEW_LINE>} catch (ParseException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
m = ISO8601_DATE_PATTERN.matcher(s);
1,423,135
public void createShieldedTransactionWithoutSpendAuthSig(PrivateParametersWithoutAsk request, StreamObserver<TransactionExtention> responseObserver) {<NEW_LINE>TransactionExtention.Builder trxExtBuilder = TransactionExtention.newBuilder();<NEW_LINE>Return.Builder retBuilder = Return.newBuilder();<NEW_LINE>try {<NEW_LINE>checkSupportShieldedTransaction();<NEW_LINE>TransactionCapsule trx = wallet.createShieldedTransactionWithoutSpendAuthSig(request);<NEW_LINE>trxExtBuilder.<MASK><NEW_LINE>trxExtBuilder.setTxid(trx.getTransactionId().getByteString());<NEW_LINE>retBuilder.setResult(true).setCode(response_code.SUCCESS);<NEW_LINE>} catch (ContractValidateException | ZksnarkException e) {<NEW_LINE>retBuilder.setResult(false).setCode(response_code.CONTRACT_VALIDATE_ERROR).setMessage(ByteString.copyFromUtf8(Wallet.CONTRACT_VALIDATE_ERROR + e.getMessage()));<NEW_LINE>logger.debug(CONTRACT_VALIDATE_EXCEPTION, e.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>retBuilder.setResult(false).setCode(response_code.OTHER_ERROR).setMessage(ByteString.copyFromUtf8(e.getClass() + " : " + e.getMessage()));<NEW_LINE>logger.info("createShieldedTransactionWithoutSpendAuthSig exception caught: " + e.getMessage());<NEW_LINE>}<NEW_LINE>trxExtBuilder.setResult(retBuilder);<NEW_LINE>responseObserver.onNext(trxExtBuilder.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>}
setTransaction(trx.getInstance());
1,794,084
private void showContentRenamePopup(Component baseLabel, Content content) {<NEW_LINE>JBTextField textField = new JBTextField(content.getDisplayName());<NEW_LINE>textField.getEmptyText().<MASK><NEW_LINE>textField.putClientProperty("StatusVisibleFunction", (BooleanFunction<JBTextField>) o -> o.getText().isEmpty());<NEW_LINE>textField.selectAll();<NEW_LINE>JBLabel label = new JBLabel(myLabeltext);<NEW_LINE>label.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));<NEW_LINE>JPanel panel = new JPanel(new VerticalFlowLayout());<NEW_LINE>panel.addFocusListener(new FocusAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusGained(FocusEvent e) {<NEW_LINE>IdeFocusManager.findInstance().requestFocus(textField, false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>panel.add(label);<NEW_LINE>panel.add(textField);<NEW_LINE>Balloon balloon = JBPopupFactory.getInstance().createDialogBalloonBuilder(panel, null).setShowCallout(true).setCloseButtonEnabled(false).setAnimationCycle(0).setDisposable(content).setHideOnKeyOutside(true).setHideOnClickOutside(true).setRequestFocus(true).setBlockClicksThroughBalloon(true).createBalloon();<NEW_LINE>textField.addKeyListener(new KeyAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void keyPressed(KeyEvent e) {<NEW_LINE>if (e.getKeyCode() == KeyEvent.VK_ENTER) {<NEW_LINE>if (!Disposer.isDisposed(content)) {<NEW_LINE>String text = textField.getText();<NEW_LINE>if (!text.isEmpty()) {<NEW_LINE>content.setDisplayName(text);<NEW_LINE>}<NEW_LINE>balloon.hide();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>balloon.show(new RelativePoint(baseLabel, new Point(baseLabel.getWidth() / 2, 0)), Balloon.Position.above);<NEW_LINE>}
setText(content.getDisplayName());
165,097
final NativeInvoker compile(RubyModule implementationClass, com.kenai.jffi.Function function, Signature signature, String methodName) {<NEW_LINE>if (compilationFailed || (counter.incrementAndGet() < THRESHOLD && Options.COMPILE_MODE.load() != RubyInstanceConfig.CompileMode.FORCE)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Class<? extends NativeInvoker> compiledClass;<NEW_LINE>synchronized (this) {<NEW_LINE>if (compiledClassRef == null || (compiledClass = compiledClassRef.get()) == null) {<NEW_LINE>compiledClass = newInvokerClass(jitSignature, methodName);<NEW_LINE>if (compiledClass == null) {<NEW_LINE>compilationFailed = true;<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>compiler.registerClass(this, compiledClass);<NEW_LINE>compiledClassRef = new WeakReference<Class<? extends NativeInvoker>>(compiledClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Constructor<? extends NativeInvoker> cons = compiledClass.getDeclaredConstructor(RubyModule.class, com.kenai.jffi.Function.class, Signature.class);<NEW_LINE>return cons.<MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new RuntimeException(t);<NEW_LINE>}<NEW_LINE>}
newInstance(implementationClass, function, signature);
51,865
public List<PropertyDeclaration> buildDeclarations(CSSName cssName, List<PropertyValue> values, int origin, boolean important, boolean inheritAllowed) {<NEW_LINE>checkValueCount(cssName, 1, values.size());<NEW_LINE>PropertyValue <MASK><NEW_LINE>checkInheritAllowed(value, inheritAllowed);<NEW_LINE>if (value.getCssValueType() != CSSValue.CSS_INHERIT) {<NEW_LINE>checkIdentLengthOrPercentType(cssName, value);<NEW_LINE>if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {<NEW_LINE>IdentValue ident = checkIdent(cssName, value);<NEW_LINE>checkValidity(cssName, getAllowed(), ident);<NEW_LINE>} else if (!isNegativeValuesAllowed() && value.getFloatValue() < 0.0f) {<NEW_LINE>throw new CSSParseException(cssName + " may not be negative", -1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));<NEW_LINE>}
value = values.get(0);
821,570
private void loadCacertsAndCustomCerts() {<NEW_LINE>try {<NEW_LINE>KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());<NEW_LINE>InputStream keystoreStream = NzbHydra.class.getResource("/cacerts").openStream();<NEW_LINE>keystore.load(keystoreStream, null);<NEW_LINE>final File certificatesFolder = new File(NzbHydra.getDataFolder(), "certificates");<NEW_LINE>if (certificatesFolder.exists()) {<NEW_LINE>final File[] files = certificatesFolder.listFiles();<NEW_LINE>logger.info("Loading {} custom certificates", files.length);<NEW_LINE>for (File file : files) {<NEW_LINE>try (FileInputStream fileInputStream = new FileInputStream(file)) {<NEW_LINE>final Certificate certificate = CertificateFactory.getInstance("X.509").generateCertificate(fileInputStream);<NEW_LINE>logger.debug("Loading certificate in file {}", file);<NEW_LINE>keystore.setCertificateEntry(file.getName(), certificate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TrustManagerFactory customTrustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());<NEW_LINE>customTrustManagerFactory.init(keystore);<NEW_LINE>TrustManager[] trustManagers = customTrustManagerFactory.getTrustManagers();<NEW_LINE>caCertsContext = SSLContext.getInstance("SSL");<NEW_LINE>caCertsContext.<MASK><NEW_LINE>SSLContext.setDefault(caCertsContext);<NEW_LINE>SSLSocketFactory sslSocketFactory = caCertsContext.getSocketFactory();<NEW_LINE>defaultTrustManager = (X509TrustManager) trustManagers[0];<NEW_LINE>defaultSslSocketFactory = new SniWhitelistingSocketFactory(sslSocketFactory);<NEW_LINE>} catch (IOException | GeneralSecurityException e) {<NEW_LINE>logger.error("Unable to load packaged cacerts file", e);<NEW_LINE>}<NEW_LINE>}
init(null, trustManagers, null);
1,600,471
public CodegenExpression codegen(EnumForgeCodegenParams premade, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {<NEW_LINE>ExprForgeCodegenSymbol scope <MASK><NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChildWithScope(returnTypeOfMethod(), getClass(), scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMSCOLLBEAN);<NEW_LINE>CodegenBlock block = methodNode.getBlock();<NEW_LINE>CodegenExpression returnEmpty = returnIfEmptyOptional();<NEW_LINE>if (returnEmpty != null) {<NEW_LINE>block.ifCondition(exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "isEmpty")).blockReturn(returnEmpty);<NEW_LINE>}<NEW_LINE>initBlock(block, methodNode, scope, codegenClassScope);<NEW_LINE>if (hasForEachLoop()) {<NEW_LINE>CodegenBlock forEach = block.forEach(EventBean.EPTYPE, "next", EnumForgeCodegenNames.REF_ENUMCOLL).assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(getStreamNumLambda()), ref("next"));<NEW_LINE>forEachBlock(forEach, methodNode, scope, codegenClassScope);<NEW_LINE>}<NEW_LINE>returnResult(block);<NEW_LINE>return localMethod(methodNode, premade.getEps(), premade.getEnumcoll(), premade.getIsNewData(), premade.getExprCtx());<NEW_LINE>}
= new ExprForgeCodegenSymbol(false, null);
1,273,476
private List<NameValueCountPair> listWorkStatus(Business business, Application application) throws Exception {<NEW_LINE>List<NameValueCountPair> wos = new ArrayList<>();<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Work.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<WorkStatus> cq = cb.createQuery(WorkStatus.class);<NEW_LINE>Root<Work> root = cq.from(Work.class);<NEW_LINE>Predicate p = cb.equal(root.get(Work_.application), application.getId());<NEW_LINE>cq.select(root.get(Work_.workStatus)).where(p);<NEW_LINE>List<WorkStatus> list = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>for (WorkStatus status : list) {<NEW_LINE>NameValueCountPair o = new NameValueCountPair();<NEW_LINE>o.setValue(status);<NEW_LINE>o.setName(status);<NEW_LINE>wos.add(o);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return wos;<NEW_LINE>}
SortTools.asc(wos, "name");
1,095,866
protected Drive connect(final Proxy proxy, final HostKeyCallback callback, final LoginCallback prompt, final CancelCallback cancel) throws HostParserException {<NEW_LINE>final HttpClientBuilder configuration = builder.build(proxy, this, prompt);<NEW_LINE>authorizationService = new OAuth2RequestInterceptor(builder.build(ProxyFactory.get().find(host.getProtocol().getOAuthAuthorizationUrl()), this, prompt).build(), host.getProtocol()).withRedirectUri(host.<MASK><NEW_LINE>configuration.addInterceptorLast(authorizationService);<NEW_LINE>configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(host, authorizationService, prompt));<NEW_LINE>configuration.addInterceptorLast(new RateLimitingHttpRequestInterceptor(new DefaultHttpRateLimiter(new HostPreferences(host).getInteger("googledrive.limit.requests.second"))));<NEW_LINE>this.transport = new ApacheHttpTransport(configuration.build());<NEW_LINE>final UseragentProvider ua = new PreferencesUseragentProvider();<NEW_LINE>return new Drive.Builder(transport, new GsonFactory(), new UserAgentHttpRequestInitializer(ua)).setApplicationName(ua.get()).build();<NEW_LINE>}
getProtocol().getOAuthRedirectUrl());
1,224,331
public void marshall(FileSystemAssociationInfo fileSystemAssociationInfo, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (fileSystemAssociationInfo == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(fileSystemAssociationInfo.getLocationARN(), LOCATIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystemAssociationInfo.getFileSystemAssociationStatus(), FILESYSTEMASSOCIATIONSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystemAssociationInfo.getAuditDestinationARN(), AUDITDESTINATIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystemAssociationInfo.getGatewayARN(), GATEWAYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystemAssociationInfo.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystemAssociationInfo.getCacheAttributes(), CACHEATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystemAssociationInfo.getEndpointNetworkConfiguration(), ENDPOINTNETWORKCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystemAssociationInfo.getFileSystemAssociationStatusDetails(), FILESYSTEMASSOCIATIONSTATUSDETAILS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
fileSystemAssociationInfo.getFileSystemAssociationARN(), FILESYSTEMASSOCIATIONARN_BINDING);
1,354,852
public static MediaType produceType(RequestHeaders headers) {<NEW_LINE>final <MASK><NEW_LINE>if (HttpMethod.POST == headers.method() && contentType != null && contentType.is(MediaType.GRAPHQL)) {<NEW_LINE>return MediaType.GRAPHQL_JSON;<NEW_LINE>}<NEW_LINE>final List<MediaType> acceptTypes = headers.accept();<NEW_LINE>if (acceptTypes.isEmpty()) {<NEW_LINE>// If there is no Accept header in the request, the response MUST include<NEW_LINE>// a Content-Type: application/graphql+json header<NEW_LINE>return MediaType.GRAPHQL_JSON;<NEW_LINE>}<NEW_LINE>for (MediaType accept : acceptTypes) {<NEW_LINE>if (MediaType.ANY_TYPE.is(accept) || MediaType.ANY_APPLICATION_TYPE.is(accept)) {<NEW_LINE>return MediaType.GRAPHQL_JSON;<NEW_LINE>}<NEW_LINE>if (accept.is(MediaType.GRAPHQL_JSON) || accept.is(MediaType.JSON)) {<NEW_LINE>return accept;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Not acceptable<NEW_LINE>return null;<NEW_LINE>}
MediaType contentType = headers.contentType();
944,594
ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String appInfoFlag) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = null;<NEW_LINE>Cache.CacheKey cacheKey = new Cache.CacheKey(this.getClass(), flag, appInfoFlag);<NEW_LINE>Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>wo = ((Wo) optional.get());<NEW_LINE>} else {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>AppInfo appInfo = business.getAppInfoFactory().pick(appInfoFlag);<NEW_LINE>if (null == appInfo) {<NEW_LINE>throw new ExceptionEntityNotExist(appInfoFlag, AppInfo.class);<NEW_LINE>}<NEW_LINE>String id = this.get(business, appInfo, flag);<NEW_LINE>if (StringUtils.isEmpty(id)) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>File file = business.fileFactory().pick(id);<NEW_LINE>byte[] bs = new byte[] {};<NEW_LINE>if (StringUtils.isNotEmpty(file.getData())) {<NEW_LINE>bs = Base64.decodeBase64(file.getData());<NEW_LINE>}<NEW_LINE>wo = new Wo(bs, this.contentType(false, file.getFileName()), this.contentDisposition(false, file.getFileName()));<NEW_LINE>CacheManager.put(cacheCategory, cacheKey, wo);<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
ExceptionEntityNotExist(flag, File.class);
69,111
public BatchModifyClusterSnapshotsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>BatchModifyClusterSnapshotsResult batchModifyClusterSnapshotsResult = new BatchModifyClusterSnapshotsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return batchModifyClusterSnapshotsResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Resources", targetDepth)) {<NEW_LINE>batchModifyClusterSnapshotsResult.withResources(new ArrayList<String>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Resources/String", targetDepth)) {<NEW_LINE>batchModifyClusterSnapshotsResult.withResources(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Errors", targetDepth)) {<NEW_LINE>batchModifyClusterSnapshotsResult.withErrors(new ArrayList<SnapshotErrorMessage>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Errors/SnapshotErrorMessage", targetDepth)) {<NEW_LINE>batchModifyClusterSnapshotsResult.withErrors(SnapshotErrorMessageStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return batchModifyClusterSnapshotsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
1,644,494
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {<NEW_LINE>String text = req.getParameter("text") != null ? req.getParameter("text") : "Hello World";<NEW_LINE>try (Context ic = new InitialContext();<NEW_LINE>ConnectionFactory cf = (ConnectionFactory) ic.lookup("/ConnectionFactory");<NEW_LINE>Queue queue = (Queue) ic.lookup("queue/tutorialQueue");<NEW_LINE>Connection connection = cf.createConnection()) {<NEW_LINE>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);<NEW_LINE>MessageProducer publisher = session.createProducer(queue);<NEW_LINE>connection.start();<NEW_LINE>TextMessage message = session.createTextMessage(text);<NEW_LINE>publisher.send(message);<NEW_LINE>} catch (NamingException | JMSException e) {<NEW_LINE>res.getWriter().println("Error while trying to send <" + text + <MASK><NEW_LINE>}<NEW_LINE>res.getWriter().println("Message sent: " + text);<NEW_LINE>}
"> message: " + e.getMessage());
665,597
private void add() {<NEW_LINE>if (fileChooser == null) {<NEW_LINE>fileChooser = new GhidraFileChooser(panel);<NEW_LINE>fileChooser.setMultiSelectionEnabled(allowMultiFileSelection);<NEW_LINE>fileChooser.setFileSelectionMode(fileChooserMode);<NEW_LINE>fileChooser.setTitle(title);<NEW_LINE>fileChooser.setApproveButtonToolTipText(title);<NEW_LINE>if (filter != null) {<NEW_LINE>fileChooser.addFileFilter(new GhidraFileFilter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getDescription() {<NEW_LINE>return filter.getDescription();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean accept(File f, GhidraFileChooserModel l_model) {<NEW_LINE>return filter.accept(f, l_model);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String dir = Preferences.getProperty(preferenceForLastSelectedDir);<NEW_LINE>if (dir != null) {<NEW_LINE>fileChooser.setCurrentDirectory(new File(dir));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>fileChooser.rescanCurrentDirectory();<NEW_LINE>}<NEW_LINE>List<File> files = fileChooser.getSelectedFiles();<NEW_LINE>if (!files.isEmpty()) {<NEW_LINE>if (allowMultiFileSelection) {<NEW_LINE>String parent = files.get(0).getParent();<NEW_LINE>Preferences.setProperty(preferenceForLastSelectedDir, parent);<NEW_LINE>for (File element : files) {<NEW_LINE>Path p = new <MASK><NEW_LINE>pathModel.addPath(p, addToTop);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String path = files.get(0).getAbsolutePath();<NEW_LINE>Path p = new Path(path);<NEW_LINE>pathModel.addPath(p, addToTop);<NEW_LINE>Preferences.setProperty(preferenceForLastSelectedDir, path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Path(element.getAbsolutePath());
237,383
public void extract(byte[] segmentBytes, Metadata metadata, JpegSegmentType segmentType) {<NEW_LINE>JpegDirectory directory = metadata.getFirstDirectoryOfType(JpegDirectory.class);<NEW_LINE>if (directory == null) {<NEW_LINE>ErrorDirectory errorDirectory = new ErrorDirectory();<NEW_LINE>metadata.addDirectory(errorDirectory);<NEW_LINE>errorDirectory.addError("DNL segment found without SOFx - illegal JPEG format");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SequentialReader reader = new SequentialByteArrayReader(segmentBytes);<NEW_LINE>try {<NEW_LINE>// Only set height from DNL if it's not already defined<NEW_LINE>Integer i = directory.getInteger(JpegDirectory.TAG_IMAGE_HEIGHT);<NEW_LINE>if (i == null || i == 0) {<NEW_LINE>directory.setInt(JpegDirectory.<MASK><NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>directory.addError(ex.getMessage());<NEW_LINE>}<NEW_LINE>}
TAG_IMAGE_HEIGHT, reader.getUInt16());
1,075,197
private void synchronizeTables() {<NEW_LINE>// TODO synchronize tables - identify renamed tables<NEW_LINE>// we need to identify tables which have been renamed.<NEW_LINE>// normally we would check the PK's ad_element_id, but in the<NEW_LINE>// past, when C_Allocation was renamed to C_AllocationLine,<NEW_LINE>// C_Allocation_ID (Element 1380) became C_AllocationHdr_ID,<NEW_LINE>// and new C_AllocationLine_ID (Element 2534) was created as<NEW_LINE>// PK for renamed table.<NEW_LINE>// So identifying renamed tables by PK's ad_element_id fails,<NEW_LINE>// and we need to think of a different method<NEW_LINE>resetDBObjects(DBObject_Table.class);<NEW_LINE>s_logger.log(Level.CONFIG, "");<NEW_LINE>s_logger.log(Level.CONFIG, "synchronizeTables", new Object[] { m_objectTypes, m_direction });<NEW_LINE>m_counterDrp = new Integer(0);<NEW_LINE>m_counterAdd = new Integer(0);<NEW_LINE>m_counterUpd = new Integer(0);<NEW_LINE>m_totalDrp = new Integer(0);<NEW_LINE>m_totalAdd = new Integer(0);<NEW_LINE>m_totalUpd = new Integer(0);<NEW_LINE>for (Iterator<String> tableIterator = m_objectList.iterator(); tableIterator.hasNext(); ) {<NEW_LINE>String key = tableIterator.next();<NEW_LINE>DBObject sourceObj = m_sourceMap.get(key);<NEW_LINE>DBObject targetObj = m_targetMap.get(key);<NEW_LINE>// non-customized tables existing in target but not in source should<NEW_LINE>// be dropped<NEW_LINE>if (targetObj != null && sourceObj == null) {<NEW_LINE>if (targetObj.getCustomizationLevel() == s_parameters.CUSTOMNONE) {<NEW_LINE>if (targetObj.drop()) {<NEW_LINE>m_counterDrp = new Integer(m_counterDrp.intValue() + 1);<NEW_LINE>s_logger.log(Level.WARNING, "droppingCustomizedTable", new Object[] { m_objectType, targetObj.getName() });<NEW_LINE>}<NEW_LINE>m_totalDrp = new Integer(m_totalDrp.intValue() + 1);<NEW_LINE>} else {<NEW_LINE>s_logger.log(Level.WARNING, "notDroppingCustomizedTable", new Object[] { m_objectType, targetObj.getName() });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// tables existing in both target and source should be synchronized<NEW_LINE>if (targetObj != null && sourceObj != null) {<NEW_LINE>if (targetObj.update(sourceObj))<NEW_LINE>m_counterUpd = new Integer(m_counterUpd.intValue() + 1);<NEW_LINE>m_totalUpd = new Integer(<MASK><NEW_LINE>}<NEW_LINE>// tables existing in source but not in target should be created<NEW_LINE>if (targetObj == null && sourceObj != null) {<NEW_LINE>if (sourceObj.create(m_target))<NEW_LINE>m_counterAdd = new Integer(m_counterAdd.intValue() + 1);<NEW_LINE>m_totalAdd = new Integer(m_totalAdd.intValue() + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logResults();<NEW_LINE>}
m_totalUpd.intValue() + 1);
1,418,074
// get first element<NEW_LINE>private static void testGetFirst() {<NEW_LINE>Collection<String> collection = Lists.newArrayList("a1", "a2", "a3", "a1");<NEW_LINE>OrderedIterable<String> orderedIterable = FastList.newListWith("a1", "a2", "a3", "a1");<NEW_LINE>Iterable<String> iterable = collection;<NEW_LINE>// get first element<NEW_LINE>// using JDK<NEW_LINE>Iterator<String> iterator = collection.iterator();<NEW_LINE>String jdk = iterator.hasNext() ? iterator.next() : "1";<NEW_LINE>// using guava<NEW_LINE>String guava = <MASK><NEW_LINE>// using Apache<NEW_LINE>String apache = CollectionUtils.get(iterable, 0);<NEW_LINE>// using GS<NEW_LINE>String gs = orderedIterable.getFirst();<NEW_LINE>// using Stream API<NEW_LINE>String stream = collection.stream().findFirst().orElse("1");<NEW_LINE>// print first = a1:a1:a1:a1:a1<NEW_LINE>System.out.println("first = " + jdk + ":" + guava + ":" + apache + ":" + gs + ":" + stream);<NEW_LINE>}
Iterables.getFirst(iterable, "1");
789,722
public static void cloneControlElements(List<TransitionElement> controlElements, List<TransitionElement> newControlElements) {<NEW_LINE>newControlElements.clear();<NEW_LINE>for (TransitionElement controlElement : controlElements) {<NEW_LINE>ObjectFactory jslFactory = objectFactoryMap.get(controlElement.getClass().getPackage().getName());<NEW_LINE>if (controlElement instanceof End) {<NEW_LINE>End endElement = (End) controlElement;<NEW_LINE>End newEnd = jslFactory.createEnd();<NEW_LINE>newEnd.setExitStatus(endElement.getExitStatus());<NEW_LINE>newEnd.setOn(endElement.getOn());<NEW_LINE>newControlElements.add(newEnd);<NEW_LINE>} else if (controlElement instanceof Fail) {<NEW_LINE>Fail failElement = (Fail) controlElement;<NEW_LINE>Fail newFail = jslFactory.createFail();<NEW_LINE>newFail.setExitStatus(failElement.getExitStatus());<NEW_LINE>newFail.setOn(failElement.getOn());<NEW_LINE>newControlElements.add(newFail);<NEW_LINE>} else if (controlElement instanceof Next) {<NEW_LINE>Next nextElement = (Next) controlElement;<NEW_LINE>Next newNext = jslFactory.createNext();<NEW_LINE>newNext.<MASK><NEW_LINE>newNext.setTo(nextElement.getTo());<NEW_LINE>newControlElements.add(newNext);<NEW_LINE>} else if (controlElement instanceof Stop) {<NEW_LINE>Stop stopElement = (Stop) controlElement;<NEW_LINE>Stop newStop = jslFactory.createStop();<NEW_LINE>newStop.setExitStatus(stopElement.getExitStatus());<NEW_LINE>newStop.setOn(stopElement.getOn());<NEW_LINE>newStop.setRestart(stopElement.getRestart());<NEW_LINE>newControlElements.add(newStop);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setOn(nextElement.getOn());
1,157,836
public void sendAAAA() {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled())<NEW_LINE>c_logger.traceEntry(this, "StateMachine: sendAAAA: entry: id=" + hashCode());<NEW_LINE>if (haveSRVResponses()) {<NEW_LINE>for (int i = 0; i < _SRVResponses.length; i++) {<NEW_LINE>Vector vector2 = _SRVResponses[i];<NEW_LINE>for (Enumeration e = vector2.elements(); e.hasMoreElements(); ) {<NEW_LINE>SRVRecord srv = (SRVRecord) e.nextElement();<NEW_LINE>DnsMessage req = new DnsMessage(Dns.AAAA, srv.<MASK><NEW_LINE>sendReq(req);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>DnsMessage request = new DnsMessage(Dns.AAAA, _simpl._target);<NEW_LINE>sendReq(request);<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceEntryExitEnabled())<NEW_LINE>c_logger.traceExit(this, "StateMachine: sendAAAA: exit: id=" + hashCode());<NEW_LINE>}
getTarget().toString());
814,101
public List<? extends Token> tokenize(String pattern) {<NEW_LINE>// split pattern into chunks: sea (raw input) and islands (<ID>, <expr>)<NEW_LINE>List<Chunk> chunks = split(pattern);<NEW_LINE>// create token stream from text and tags<NEW_LINE>List<Token> tokens = new ArrayList<Token>();<NEW_LINE>for (Chunk chunk : chunks) {<NEW_LINE>if (chunk instanceof TagChunk) {<NEW_LINE>TagChunk tagChunk = (TagChunk) chunk;<NEW_LINE>// add special rule token or conjure up new token from name<NEW_LINE>if (Character.isUpperCase(tagChunk.getTag().charAt(0))) {<NEW_LINE>Integer ttype = parser.<MASK><NEW_LINE>if (ttype == Token.INVALID_TYPE) {<NEW_LINE>throw new IllegalArgumentException("Unknown token " + tagChunk.getTag() + " in pattern: " + pattern);<NEW_LINE>}<NEW_LINE>TokenTagToken t = new TokenTagToken(tagChunk.getTag(), ttype, tagChunk.getLabel());<NEW_LINE>tokens.add(t);<NEW_LINE>} else if (Character.isLowerCase(tagChunk.getTag().charAt(0))) {<NEW_LINE>int ruleIndex = parser.getRuleIndex(tagChunk.getTag());<NEW_LINE>if (ruleIndex == -1) {<NEW_LINE>throw new IllegalArgumentException("Unknown rule " + tagChunk.getTag() + " in pattern: " + pattern);<NEW_LINE>}<NEW_LINE>int ruleImaginaryTokenType = parser.getATNWithBypassAlts().ruleToTokenType[ruleIndex];<NEW_LINE>tokens.add(new RuleTagToken(tagChunk.getTag(), ruleImaginaryTokenType, tagChunk.getLabel()));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("invalid tag: " + tagChunk.getTag() + " in pattern: " + pattern);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>TextChunk textChunk = (TextChunk) chunk;<NEW_LINE>ANTLRInputStream in = new ANTLRInputStream(textChunk.getText());<NEW_LINE>lexer.setInputStream(in);<NEW_LINE>Token t = lexer.nextToken();<NEW_LINE>while (t.getType() != Token.EOF) {<NEW_LINE>tokens.add(t);<NEW_LINE>t = lexer.nextToken();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// System.out.println("tokens="+tokens);<NEW_LINE>return tokens;<NEW_LINE>}
getTokenType(tagChunk.getTag());
945,311
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String createEpl = "@public create window MyWindow#keepall as select * from SupportBean";<NEW_LINE>if (indexShare) {<NEW_LINE>createEpl = "@Hint('enable_window_subquery_indexshare') " + createEpl;<NEW_LINE>}<NEW_LINE>env.compileDeploy(createEpl, path);<NEW_LINE>if (buildIndex) {<NEW_LINE>env.compileDeploy("create index idx1 on MyWindow(theString hash, intPrimitive btree)", path);<NEW_LINE>}<NEW_LINE>env.compileDeploy("insert into MyWindow select * from SupportBean", path);<NEW_LINE>// preload<NEW_LINE>for (int i = 0; i < 10000; i++) {<NEW_LINE>String theString = i < 5000 ? "A" : "B";<NEW_LINE>env.sendEventBean(new SupportBean(theString, i));<NEW_LINE>}<NEW_LINE>String[] fields = "cols.mini,cols.maxi".split(",");<NEW_LINE>String queryEpl = "@name('s0') select (select min(intPrimitive) as mini, max(intPrimitive) as maxi from MyWindow where theString = sbr.key and intPrimitive between sbr.rangeStart and sbr.rangeEnd) as cols from SupportBeanRange sbr";<NEW_LINE>env.compileDeploy(queryEpl, path).addListener("s0");<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < 1000; i++) {<NEW_LINE>env.sendEventBean(new SupportBeanRange("R1", "A", 300, 312));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 300, 312 });<NEW_LINE>}<NEW_LINE>long delta = System.currentTimeMillis() - startTime;<NEW_LINE>assertTrue("delta=" + delta, delta < 500);<NEW_LINE>env.undeployAll();<NEW_LINE>}
long startTime = System.currentTimeMillis();
1,332,674
Station map(StopPlace stopPlace) {<NEW_LINE>final I18NString name;<NEW_LINE>if (stopPlace.getName() == null) {<NEW_LINE>name = new NonLocalizedString("N/A");<NEW_LINE>} else if (stopPlace.getAlternativeNames() != null) {<NEW_LINE>Map<String, String> translations = new HashMap<>();<NEW_LINE>translations.put(null, stopPlace.getName().getValue());<NEW_LINE>for (var translation : stopPlace.getAlternativeNames().getAlternativeName()) {<NEW_LINE>if (translation.getNameType().equals(NameTypeEnumeration.TRANSLATION)) {<NEW_LINE>String lang = translation.getLang() != null ? translation.getLang() : translation.getName().getLang();<NEW_LINE>translations.put(lang, translation.getName().getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>name = TranslatedString.getI18NString(translations);<NEW_LINE>} else {<NEW_LINE>name = new NonLocalizedString(stopPlace.<MASK><NEW_LINE>}<NEW_LINE>Station station = new Station(idFactory.createId(stopPlace.getId()), name, WgsCoordinateMapper.mapToDomain(stopPlace.getCentroid()), null, stopPlace.getDescription() != null ? stopPlace.getDescription().getValue() : null, null, null, StopTransferPriorityMapper.mapToDomain(stopPlace.getWeighting()));<NEW_LINE>if (station.getCoordinate() == null) {<NEW_LINE>issueStore.add("StationWithoutCoordinates", "Station %s does not contain any coordinates.", station.getId());<NEW_LINE>}<NEW_LINE>return station;<NEW_LINE>}
getName().getValue());
922,380
private List<JSONObject> fillRelation(List<JSONObject> relation) throws Exception {<NEW_LINE>checkRelation(relation);<NEW_LINE>String id = relation.get(0).getString(Constant.INNER_ID) + Constant.RELATION_META_SEPARATOR + relation.get(1).getString(Constant.INNER_ID);<NEW_LINE>String type = relation.get(0).getString(Constant.INNER_TYPE) + Constant.RELATION_META_SEPARATOR + relation.get(1<MASK><NEW_LINE>relation.get(2).put(Constant.INNER_ID, id);<NEW_LINE>relation.get(2).put(Constant.INNER_TYPE, type);<NEW_LINE>relation.get(0).remove(Constant.UPSERT_TIME_FIELD);<NEW_LINE>relation.get(1).remove(Constant.UPSERT_TIME_FIELD);<NEW_LINE>relation.get(2).remove(Constant.UPSERT_TIME_FIELD);<NEW_LINE>return relation;<NEW_LINE>}
).getString(Constant.INNER_TYPE);
560,420
public static String base64Encode(byte[] bytes) {<NEW_LINE>if (bytes == null) {<NEW_LINE>throw new IllegalArgumentException("Input bytes must not be null.");<NEW_LINE>}<NEW_LINE>if (bytes.length >= BASE64_UPPER_BOUND) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Every three bytes is encoded into four characters.<NEW_LINE>//<NEW_LINE>// Example:<NEW_LINE>// input |0 1 0 1 0 0 1 0|0 1 1 0 1 1 1 1|0 1 1 0 0 0 1 0|<NEW_LINE>// encode grouping |0 1 0 1 0 0|1 0 0 1 1 0|1 1 1 1 0 1|1 0 0 0 1 0|<NEW_LINE>// encoded ascii | U | m | 9 | i |<NEW_LINE>int triples = bytes.length / 3;<NEW_LINE>// If the number of input bytes is not a multiple of three, padding characters will be added.<NEW_LINE>if (bytes.length % 3 != 0) {<NEW_LINE>triples += 1;<NEW_LINE>}<NEW_LINE>// The encoded string will have four characters for every three bytes.<NEW_LINE>char[] encoding = new char[triples << 2];<NEW_LINE>for (int in = 0, out = 0; in < bytes.length; in += 3, out += 4) {<NEW_LINE>int triple = (bytes[in] & 0xff) << 16;<NEW_LINE>if (in + 1 < bytes.length) {<NEW_LINE>triple |= ((bytes[in + 1] & 0xff) << 8);<NEW_LINE>}<NEW_LINE>if (in + 2 < bytes.length) {<NEW_LINE>triple |= (bytes[in + 2] & 0xff);<NEW_LINE>}<NEW_LINE>encoding[out] = BASE64_CHARS.charAt((triple >> 18) & 0x3f);<NEW_LINE>encoding[out + 1] = BASE64_CHARS.charAt((triple >> 12) & 0x3f);<NEW_LINE>encoding[out + 2] = BASE64_CHARS.charAt((triple >> 6) & 0x3f);<NEW_LINE>encoding[out + 3] = BASE64_CHARS.charAt(triple & 0x3f);<NEW_LINE>}<NEW_LINE>// Add padding characters if needed.<NEW_LINE>for (int i = encoding.length - (triples * 3 - bytes.length); i < encoding.length; i++) {<NEW_LINE>encoding[i] = '=';<NEW_LINE>}<NEW_LINE>return String.valueOf(encoding);<NEW_LINE>}
throw new IllegalArgumentException("Input bytes length must not exceed " + BASE64_UPPER_BOUND);
74,430
public DataCatalogConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DataCatalogConfig dataCatalogConfig = new DataCatalogConfig();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("TableName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dataCatalogConfig.setTableName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Catalog", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dataCatalogConfig.setCatalog(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Database", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dataCatalogConfig.setDatabase(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return dataCatalogConfig;<NEW_LINE>}
class).unmarshall(context));
547,280
public ListLicenseManagerReportGeneratorsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListLicenseManagerReportGeneratorsResult listLicenseManagerReportGeneratorsResult = new ListLicenseManagerReportGeneratorsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listLicenseManagerReportGeneratorsResult;<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("ReportGenerators", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listLicenseManagerReportGeneratorsResult.setReportGenerators(new ListUnmarshaller<ReportGenerator>(ReportGeneratorJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listLicenseManagerReportGeneratorsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listLicenseManagerReportGeneratorsResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
823,969
public void update(Cell cell, long ts, byte[] oldValue, byte[] newValue) {<NEW_LINE>Object[] args = new Object[] { cell.getRowName(), cell.getColumnName(), ts, newValue, cell.getRowName(), cell.getColumnName(), ts, oldValue };<NEW_LINE>String prefixedTableName = prefixedTableNames.get(tableRef, conns);<NEW_LINE>String sqlString = "/* UPDATE (" + prefixedTableName + ") */" + " UPDATE " + prefixedTableName + "" + " SET row_name = ?, col_name = ?, ts = ?, val = ?" <MASK><NEW_LINE>PalantirSqlConnection connection = (PalantirSqlConnection) conns.get();<NEW_LINE>while (true) {<NEW_LINE>int updated = connection.updateCountRowsUnregisteredQuery(sqlString, args);<NEW_LINE>if (updated != 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<byte[]> currentValue = getCurrentValue(connection, cell, ts, prefixedTableName);<NEW_LINE>byte[] onlyValue = Iterables.getOnlyElement(currentValue, null);<NEW_LINE>if (!Arrays.equals(onlyValue, oldValue)) {<NEW_LINE>throw new CheckAndSetException(cell, tableRef, oldValue, currentValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+ " WHERE row_name = ?" + " AND col_name = ?" + " AND ts = ?" + " AND val = ?";
1,551,428
private List<StaffPeak> groupOf(List<StaffPeak> peaks) {<NEW_LINE>if (peaks.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>final StaffPeak first = peaks.get(0);<NEW_LINE>// All peaks in staff<NEW_LINE>final List<StaffPeak> all = projectorOf(first.<MASK><NEW_LINE>final int i1 = all.indexOf(first);<NEW_LINE>int iMin = i1;<NEW_LINE>StaffPeak prevPeak = first;<NEW_LINE>for (int i = i1 - 1; i >= 0; i--) {<NEW_LINE>StaffPeak p = all.get(i);<NEW_LINE>int gap = prevPeak.getStart() - p.getStop() + 1;<NEW_LINE>if (gap > params.maxCloseGap) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>iMin = i;<NEW_LINE>prevPeak = p;<NEW_LINE>}<NEW_LINE>final StaffPeak last = peaks.get(peaks.size() - 1);<NEW_LINE>final int i2 = all.indexOf(last);<NEW_LINE>int iMax = i2;<NEW_LINE>for (int i = i2 + 1; i < all.size(); i++) {<NEW_LINE>StaffPeak p = all.get(i);<NEW_LINE>int gap = p.getStart() - prevPeak.getStop() + 1;<NEW_LINE>if (gap > params.maxCloseGap) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>iMax = i;<NEW_LINE>prevPeak = p;<NEW_LINE>}<NEW_LINE>return all.subList(iMin, iMax + 1);<NEW_LINE>}
getStaff()).getPeaks();
234,507
private static // super fields<NEW_LINE>EvpnAddressFamily // super fields<NEW_LINE>create(// local fields<NEW_LINE>@Nullable @JsonProperty(PROP_ADDRESS_FAMILY_CAPABILITIES) AddressFamilyCapabilities addressFamilyCapabilities, // local fields<NEW_LINE>@Nullable @JsonProperty(PROP_EXPORT_POLICY) String exportPolicy, // local fields<NEW_LINE>@Nullable @JsonProperty(PROP_EXPORT_POLICY_SOURCES) SortedSet<String> exportPolicySources, // local fields<NEW_LINE>@Nullable @JsonProperty(PROP_IMPORT_POLICY) String importPolicy, // local fields<NEW_LINE>@Nullable @JsonProperty(PROP_IMPORT_POLICY_SOURCES) SortedSet<String> importPolicySources, // local fields<NEW_LINE>@Nullable @JsonProperty(ROUTE_REFLECTOR_CLIENT) Boolean routeReflectorClient, @Nullable @JsonProperty(PROP_L2_VNIS) Set<Layer2VniConfig> l2Vnis, @Nullable @JsonProperty(PROP_L3_VNIS) Set<Layer3VniConfig> l3Vnis, @Nullable @JsonProperty(PROP_NVE_IP) Ip nveIp, @Nullable @JsonProperty(PROP_PROPAGATE_UNMATCHED) Boolean propagateUnmatched) {<NEW_LINE>checkArgument(<MASK><NEW_LINE>return new Builder().setAddressFamilyCapabilities(addressFamilyCapabilities).setExportPolicy(exportPolicy).setExportPolicySources(firstNonNull(exportPolicySources, ImmutableSortedSet.of())).setImportPolicy(importPolicy).setImportPolicySources(firstNonNull(importPolicySources, ImmutableSortedSet.of())).setRouteReflectorClient(firstNonNull(routeReflectorClient, Boolean.FALSE)).setL2Vnis(firstNonNull(l2Vnis, ImmutableSortedSet.of())).setL3Vnis(firstNonNull(l3Vnis, ImmutableSortedSet.of())).setNveIp(nveIp).setPropagateUnmatched(propagateUnmatched).build();<NEW_LINE>}
propagateUnmatched != null, "Missing %s", PROP_PROPAGATE_UNMATCHED);
1,329,838
public UpdateApprovalRuleTemplateDescriptionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateApprovalRuleTemplateDescriptionResult updateApprovalRuleTemplateDescriptionResult = new UpdateApprovalRuleTemplateDescriptionResult();<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 updateApprovalRuleTemplateDescriptionResult;<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("approvalRuleTemplate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateApprovalRuleTemplateDescriptionResult.setApprovalRuleTemplate(ApprovalRuleTemplateJsonUnmarshaller.getInstance().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 updateApprovalRuleTemplateDescriptionResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
290,989
public void draw(GL2 gl, final TextureCache cache) {<NEW_LINE>gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);<NEW_LINE>gl.glPushMatrix();<NEW_LINE>gl.glLoadIdentity();<NEW_LINE>gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);<NEW_LINE>gl.glPushMatrix();<NEW_LINE>gl.glLoadIdentity();<NEW_LINE>gl.glScaled(1, 1, -1);<NEW_LINE>Texture <MASK><NEW_LINE>gl.glColor3d(1, 1, 1);<NEW_LINE>sky.bind(gl);<NEW_LINE>sky.enable(gl);<NEW_LINE>gl.glBegin(GL.GL_TRIANGLE_STRIP);<NEW_LINE>gl.glNormal3f(0, 0, -1);<NEW_LINE>gl.glTexCoord2f(1, 1);<NEW_LINE>gl.glVertex3f(-1, -1, 1);<NEW_LINE>gl.glTexCoord2f(0, 1);<NEW_LINE>gl.glVertex3f(1, -1, 1);<NEW_LINE>gl.glTexCoord2f(1, 0);<NEW_LINE>gl.glVertex3f(-1, 1, 1);<NEW_LINE>gl.glTexCoord2f(0, 0);<NEW_LINE>gl.glVertex3f(1, 1, 1);<NEW_LINE>gl.glEnd();<NEW_LINE>sky.disable(gl);<NEW_LINE>gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);<NEW_LINE>gl.glPopMatrix();<NEW_LINE>gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);<NEW_LINE>gl.glPopMatrix();<NEW_LINE>}
sky = cache.getTexture(imageURL);
10,518
public J visitParameterizedType(ParameterizedTypeTree node, Space fmt) {<NEW_LINE>J.Identifier id = (J.Identifier) javaVisitor.scan(node.getType(), Space.EMPTY);<NEW_LINE>List<JRightPadded<Expression>> expressions = new ArrayList<>(node.getTypeArguments().size());<NEW_LINE>// skip '<', JavaDocVisitor does not interpret List <Integer> as Parameterized.<NEW_LINE>cursor += 1;<NEW_LINE>int argsSize = node.getTypeArguments().size();<NEW_LINE>for (int i = 0; i < argsSize; i++) {<NEW_LINE>Space space = Space.build(<MASK><NEW_LINE>JRightPadded<Expression> expression = JRightPadded.build((Expression) javaVisitor.scan(node.getTypeArguments().get(i), space));<NEW_LINE>Space after;<NEW_LINE>if (i == argsSize - 1) {<NEW_LINE>after = Space.build(sourceBeforeAsString(">"), emptyList());<NEW_LINE>} else {<NEW_LINE>after = Space.build(sourceBeforeAsString(","), emptyList());<NEW_LINE>}<NEW_LINE>expression = expression.withAfter(after);<NEW_LINE>expressions.add(expression);<NEW_LINE>}<NEW_LINE>return new J.ParameterizedType(randomId(), fmt, Markers.EMPTY, id, JContainer.build(expressions));<NEW_LINE>}
whitespaceBeforeAsString(), emptyList());
460,168
public void marshall(InsertableImage insertableImage, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (insertableImage == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(insertableImage.getDuration(), DURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(insertableImage.getFadeIn(), FADEIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(insertableImage.getFadeOut(), FADEOUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(insertableImage.getImageInserterInput(), IMAGEINSERTERINPUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(insertableImage.getImageX(), IMAGEX_BINDING);<NEW_LINE>protocolMarshaller.marshall(insertableImage.getImageY(), IMAGEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(insertableImage.getLayer(), LAYER_BINDING);<NEW_LINE>protocolMarshaller.marshall(insertableImage.getOpacity(), OPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(insertableImage.getStartTime(), STARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(insertableImage.getWidth(), WIDTH_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
insertableImage.getHeight(), HEIGHT_BINDING);
1,123,736
private void openNewObject() {<NEW_LINE>IWorkbenchWindow workbenchWindow = UIUtils.getActiveWorkbenchWindow();<NEW_LINE>try {<NEW_LINE>final DBNDatabaseNode newChild = DBWorkbench.getPlatform().getNavigatorModel().findNode(newObject);<NEW_LINE>if (newChild != null) {<NEW_LINE>DatabaseNavigatorView view = UIUtils.findView(workbenchWindow, DatabaseNavigatorView.class);<NEW_LINE>if (view != null) {<NEW_LINE>view.showNode(newChild);<NEW_LINE>}<NEW_LINE>final boolean openEditor = parentObject instanceof DBSObject && (objectMaker.getMakerOptions(((DBSObject) parentObject).getDataSource()) & DBEObjectMaker.FEATURE_EDITOR_ON_CREATE) != 0;<NEW_LINE>IDatabaseEditor editor = commandTarget.getEditor();<NEW_LINE>if (editor != null) {<NEW_LINE>// Just activate existing editor<NEW_LINE>workbenchWindow.getActivePage().activate(editor);<NEW_LINE>} else if (openEditor) {<NEW_LINE>// Open new one with existing context<NEW_LINE>DatabaseNodeEditorInput editorInput = new DatabaseNodeEditorInput(newChild, commandTarget.getContext());<NEW_LINE>// New object editors must open main editor<NEW_LINE><MASK><NEW_LINE>workbenchWindow.getActivePage().openEditor(editorInput, EntityEditor.class.getName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new DBException("Can't find node corresponding to new object");<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>DBWorkbench.getPlatformUI().showError("Create object", null, e);<NEW_LINE>}<NEW_LINE>}
editorInput.setDefaultPageId(EntityEditorDescriptor.DEFAULT_OBJECT_EDITOR_ID);
1,038,313
public ApplicationInfo queryApplicationInfo(String application, long start, long end) {<NEW_LINE>StopWatch stopWatch = new StopWatch();<NEW_LINE>stopWatch.start();<NEW_LINE>ApplicationStatisticsStorage applicationStatisticsStorage = APPLICATION_STORAGES.get(application);<NEW_LINE>ApplicationInfo applicationInfo = new ApplicationInfo();<NEW_LINE>applicationInfo.setApplicationName(applicationStatisticsStorage.getApplication());<NEW_LINE>applicationInfo.setApplicationType(applicationStatisticsStorage.getType());<NEW_LINE>Statistics concurrent = statisticsDao.queryMaxItemByService(application, null, "concurrent", start, end);<NEW_LINE>applicationInfo.setMaxConcurrent(concurrent == null ? 0 : concurrent.getConcurrent());<NEW_LINE>Statistics elapsed = statisticsDao.queryMaxItemByService(application, <MASK><NEW_LINE>applicationInfo.setMaxElapsed(elapsed == null ? 0 : elapsed.getElapsed());<NEW_LINE>Statistics failureCount = statisticsDao.queryMaxItemByService(application, null, "failureCount", start, end);<NEW_LINE>applicationInfo.setMaxFault(failureCount == null ? 0 : failureCount.getFailureCount());<NEW_LINE>Statistics successCount = statisticsDao.queryMaxItemByService(application, null, "successCount", start, end);<NEW_LINE>applicationInfo.setMaxSuccess(successCount == null ? 0 : successCount.getFailureCount());<NEW_LINE>stopWatch.stop();<NEW_LINE>LOGGER.info(String.format("Method:%s Time:%s Param:%s,%s,%s", "queryApplicationInfo", stopWatch.getTime(), application, start, end));<NEW_LINE>return applicationInfo;<NEW_LINE>}
null, "elapsed", start, end);
1,053,621
protected static Map<String, Object> fromAttributeValueMap(Map<String, AttributeValue> item) {<NEW_LINE>Map<String, Object> option = new LinkedHashMap<>();<NEW_LINE>option.put("engine", item.get("engine").s());<NEW_LINE>option.put("region", item.get("region").s());<NEW_LINE>Map<String, AttributeValue> optionAttributes = item.get("options").m();<NEW_LINE>option.put("name", optionAttributes.get("name").s());<NEW_LINE>option.put("description", optionAttributes.get("description").s());<NEW_LINE>List<Map<String, Object>> instances = new ArrayList<>();<NEW_LINE>for (Map.Entry<String, AttributeValue> optionAttribute : optionAttributes.get("instances").m().entrySet()) {<NEW_LINE>// build the instance entry<NEW_LINE>// Used a linked map so we can sort stuff<NEW_LINE>Map<String, Object> instance = new LinkedHashMap<>();<NEW_LINE>Map<String, AttributeValue> instanceAttributes = optionAttribute.getValue().m();<NEW_LINE>instance.put("instance", optionAttribute.getKey());<NEW_LINE>instance.put("class", instanceAttributes.get("class").s());<NEW_LINE>instance.put("description", instanceAttributes.get("description").s());<NEW_LINE>List<Map<String, String>> <MASK><NEW_LINE>List<AttributeValue> versionAttributes = instanceAttributes.get("versions").l();<NEW_LINE>for (AttributeValue versionAttribute : versionAttributes) {<NEW_LINE>versions.add(versionAttribute.m().entrySet().stream().collect(Collectors.toMap(entry -> entry.getKey(), entry -> entry.getValue().s())));<NEW_LINE>}<NEW_LINE>instance.put("versions", versions);<NEW_LINE>instances.add(instance);<NEW_LINE>}<NEW_LINE>Collections.sort(instances, RDS_INSTANCE_COMPARATOR);<NEW_LINE>option.put("instances", instances);<NEW_LINE>return option;<NEW_LINE>}
versions = new ArrayList<>();
1,057,971
public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>try {<NEW_LINE>assertArrayHasMinLengthAndAllElementsNotNull(sources, 1);<NEW_LINE>final String uri = sources[0].toString();<NEW_LINE>String contentType = "application/json";<NEW_LINE>// override default content type<NEW_LINE>if (sources.length >= 3 && sources[2] != null) {<NEW_LINE>contentType = sources[2].toString();<NEW_LINE>}<NEW_LINE>final Map<String, String> responseData = HttpHelper.delete(uri, null, null, ctx.getHeaders());<NEW_LINE>final int statusCode = Integer.parseInt(responseData.get("status"));<NEW_LINE>responseData.remove("status");<NEW_LINE>final String responseBody = responseData.get("body");<NEW_LINE>responseData.remove("body");<NEW_LINE>final GraphObjectMap response = new GraphObjectMap();<NEW_LINE>if ("application/json".equals(contentType)) {<NEW_LINE>final FromJsonFunction fromJsonFunction = new FromJsonFunction();<NEW_LINE>response.setProperty(new StringProperty("body"), fromJsonFunction.apply(ctx, caller, new <MASK><NEW_LINE>} else {<NEW_LINE>response.setProperty(new StringProperty("body"), responseBody);<NEW_LINE>}<NEW_LINE>response.setProperty(new IntProperty("status"), statusCode);<NEW_LINE>final GraphObjectMap map = new GraphObjectMap();<NEW_LINE>for (final Map.Entry<String, String> entry : responseData.entrySet()) {<NEW_LINE>map.put(new StringProperty(entry.getKey()), entry.getValue());<NEW_LINE>}<NEW_LINE>response.setProperty(new StringProperty("headers"), map);<NEW_LINE>return response;<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>logParameterError(caller, sources, e.getMessage(), ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>}
Object[] { responseBody }));
1,658,654
private void processServerHelloDone() throws HandshakeException {<NEW_LINE>flightNumber += 2;<NEW_LINE>flight5 = createFlight();<NEW_LINE>createCertificateMessage(flight5);<NEW_LINE>PskPublicInformation clientIdentity;<NEW_LINE>DTLSSession session = getSession();<NEW_LINE>KeyExchangeAlgorithm keyExchangeAlgorithm = session.getKeyExchange();<NEW_LINE>XECDHECryptography ecdhe = null;<NEW_LINE>SecretKey ecdheSecret = null;<NEW_LINE>byte[] encodedPoint = null;<NEW_LINE>if (KeyExchangeAlgorithm.ECDHE_PSK == keyExchangeAlgorithm || KeyExchangeAlgorithm.EC_DIFFIE_HELLMAN == keyExchangeAlgorithm) {<NEW_LINE>try {<NEW_LINE>SupportedGroup ecGroup = serverKeyExchange.getSupportedGroup();<NEW_LINE>if (supportedGroups.contains(ecGroup)) {<NEW_LINE>ecdhe = new XECDHECryptography(ecGroup);<NEW_LINE>ecdheSecret = ecdhe.<MASK><NEW_LINE>encodedPoint = ecdhe.getEncodedPoint();<NEW_LINE>session.setEcGroup(ecGroup);<NEW_LINE>} else {<NEW_LINE>AlertMessage alert = new AlertMessage(AlertLevel.FATAL, AlertDescription.ILLEGAL_PARAMETER);<NEW_LINE>throw new HandshakeException("Cannot process handshake message, ec-group not offered! ", alert);<NEW_LINE>}<NEW_LINE>} catch (GeneralSecurityException ex) {<NEW_LINE>AlertMessage alert = new AlertMessage(AlertLevel.FATAL, AlertDescription.ILLEGAL_PARAMETER);<NEW_LINE>throw new HandshakeException("Cannot process handshake message, caused by " + ex.getMessage(), alert, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ClientKeyExchange clientKeyExchange;<NEW_LINE>byte[] seed;<NEW_LINE>switch(keyExchangeAlgorithm) {<NEW_LINE>case EC_DIFFIE_HELLMAN:<NEW_LINE>clientKeyExchange = new ECDHClientKeyExchange(encodedPoint);<NEW_LINE>wrapMessage(flight5, clientKeyExchange);<NEW_LINE>seed = generateMasterSecretSeed();<NEW_LINE>SecretKey masterSecret = PseudoRandomFunction.generateMasterSecret(session.getCipherSuite().getThreadLocalPseudoRandomFunctionMac(), ecdheSecret, seed, session.useExtendedMasterSecret());<NEW_LINE>applyMasterSecret(masterSecret);<NEW_LINE>SecretUtil.destroy(masterSecret);<NEW_LINE>processMasterSecret();<NEW_LINE>break;<NEW_LINE>case PSK:<NEW_LINE>clientIdentity = getPskClientIdentity();<NEW_LINE>LOGGER.trace("Using PSK identity: {}", clientIdentity);<NEW_LINE>clientKeyExchange = new PSKClientKeyExchange(clientIdentity);<NEW_LINE>wrapMessage(flight5, clientKeyExchange);<NEW_LINE>seed = generateMasterSecretSeed();<NEW_LINE>requestPskSecretResult(clientIdentity, null, seed);<NEW_LINE>break;<NEW_LINE>case ECDHE_PSK:<NEW_LINE>clientIdentity = getPskClientIdentity();<NEW_LINE>LOGGER.trace("Using ECDHE PSK identity: {}", clientIdentity);<NEW_LINE>clientKeyExchange = new EcdhPskClientKeyExchange(clientIdentity, encodedPoint);<NEW_LINE>wrapMessage(flight5, clientKeyExchange);<NEW_LINE>seed = generateMasterSecretSeed();<NEW_LINE>requestPskSecretResult(clientIdentity, ecdheSecret, seed);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// already checked in HandshakeMessage.readClientKeyExchange<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>SecretUtil.destroy(ecdhe);<NEW_LINE>SecretUtil.destroy(ecdheSecret);<NEW_LINE>}
generateSecret(serverKeyExchange.getEncodedPoint());
903,204
public void populate(ChunkManager level, int chunkX, int chunkZ, NukkitRandom random) {<NEW_LINE>this.level = level;<NEW_LINE>BaseFullChunk chunk = level.getChunk(chunkX, chunkZ);<NEW_LINE>int bx = chunkX << 4;<NEW_LINE>int bz = chunkZ << 4;<NEW_LINE>int tx = bx + 15;<NEW_LINE>int tz = bz + 15;<NEW_LINE>ObjectOre ore = new ObjectOre(random, type, Block.AIR);<NEW_LINE>for (int i = 0; i < ore.type.clusterCount; ++i) {<NEW_LINE>int x = random.nextRange(0, 15);<NEW_LINE>int z = <MASK><NEW_LINE>int y = this.getHighestWorkableBlock(chunk, x, z);<NEW_LINE>if (y != -1) {<NEW_LINE>ore.placeObject(level, bx + x, y, bz + z);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
random.nextRange(0, 15);
504,218
final DeleteExplainabilityResult executeDeleteExplainability(DeleteExplainabilityRequest deleteExplainabilityRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteExplainabilityRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteExplainabilityRequest> request = null;<NEW_LINE>Response<DeleteExplainabilityResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteExplainabilityRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteExplainabilityRequest));<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, "forecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteExplainability");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteExplainabilityResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteExplainabilityResultJsonUnmarshaller());<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,544,947
private static boolean isEnabled(Preferences node, Element el) {<NEW_LINE>switch(el.getKind()) {<NEW_LINE>case ANNOTATION_TYPE:<NEW_LINE>case CLASS:<NEW_LINE>case ENUM:<NEW_LINE>case INTERFACE:<NEW_LINE>case // ???<NEW_LINE>TYPE_PARAMETER:<NEW_LINE>return node.getBoolean(MarkOccurencesSettingsNames.TYPES, true);<NEW_LINE>case CONSTRUCTOR:<NEW_LINE>case METHOD:<NEW_LINE>return node.<MASK><NEW_LINE>case ENUM_CONSTANT:<NEW_LINE>return node.getBoolean(MarkOccurencesSettingsNames.CONSTANTS, true);<NEW_LINE>case FIELD:<NEW_LINE>if (el.getModifiers().containsAll(EnumSet.of(Modifier.STATIC, Modifier.FINAL))) {<NEW_LINE>return node.getBoolean(MarkOccurencesSettingsNames.CONSTANTS, true);<NEW_LINE>} else {<NEW_LINE>return node.getBoolean(MarkOccurencesSettingsNames.FIELDS, true);<NEW_LINE>}<NEW_LINE>case LOCAL_VARIABLE:<NEW_LINE>case RESOURCE_VARIABLE:<NEW_LINE>case PARAMETER:<NEW_LINE>case EXCEPTION_PARAMETER:<NEW_LINE>return node.getBoolean(MarkOccurencesSettingsNames.LOCAL_VARIABLES, true);<NEW_LINE>case MODULE:<NEW_LINE>case PACKAGE:<NEW_LINE>// never mark occurrence modules and packages<NEW_LINE>return false;<NEW_LINE>default:<NEW_LINE>Logger.getLogger(MarkOccurrencesHighlighterBase.class.getName()).log(Level.INFO, "Unknown element type: {0}.", el.getKind());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}
getBoolean(MarkOccurencesSettingsNames.METHODS, true);
739,416
public void read(org.apache.thrift.protocol.TProtocol iprot, Log_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // MESSAGES<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();<NEW_LINE>struct.messages = new java.util.ArrayList<LogEntry>(_list0.size);<NEW_LINE>@org.apache.thrift.annotation.Nullable<NEW_LINE>LogEntry _elem1;<NEW_LINE>for (int _i2 = 0; _i2 < _list0.size; ++_i2) {<NEW_LINE>_elem1 = new LogEntry();<NEW_LINE>_elem1.read(iprot);<NEW_LINE>struct.messages.add(_elem1);<NEW_LINE>}<NEW_LINE>iprot.readListEnd();<NEW_LINE>}<NEW_LINE>struct.setMessagesIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>}
skip(iprot, schemeField.type);
1,149,474
private void safeAppendEntry(final long lowestPosition, final long highestPosition, final ByteBuffer data, final AppendListener appendListener) {<NEW_LINE>raft.checkThread();<NEW_LINE>final ApplicationEntry entry = new ApplicationEntry(lowestPosition, highestPosition, data);<NEW_LINE>if (!isRunning()) {<NEW_LINE>appendListener.onWriteError(new NoLeader("LeaderRole is closed and cannot be used as appender"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ValidationResult result = raft.getEntryValidator(<MASK><NEW_LINE>if (result.failed()) {<NEW_LINE>appendListener.onWriteError(new IllegalStateException(result.errorMessage()));<NEW_LINE>raft.transition(Role.FOLLOWER);<NEW_LINE>} else {<NEW_LINE>append(new RaftLogEntry(raft.getTerm(), entry)).whenComplete((indexed, error) -> {<NEW_LINE>if (error != null) {<NEW_LINE>appendListener.onWriteError(Throwables.getRootCause(error));<NEW_LINE>if (!(error instanceof JournalException)) {<NEW_LINE>// step down. Otherwise the following event can get appended resulting in gaps<NEW_LINE>log.info("Unexpected error occurred while appending to local log, stepping down");<NEW_LINE>raft.transition(Role.FOLLOWER);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (indexed.isApplicationEntry()) {<NEW_LINE>lastZbEntry = indexed.getApplicationEntry();<NEW_LINE>}<NEW_LINE>appendListener.onWrite(indexed);<NEW_LINE>replicate(indexed, appendListener);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
).validateEntry(lastZbEntry, entry);
728,155
final SuspendProcessesResult executeSuspendProcesses(SuspendProcessesRequest suspendProcessesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(suspendProcessesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SuspendProcessesRequest> request = null;<NEW_LINE>Response<SuspendProcessesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SuspendProcessesRequestMarshaller().marshall(super.beforeMarshalling(suspendProcessesRequest));<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, "Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SuspendProcesses");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<SuspendProcessesResult> responseHandler = new StaxResponseHandler<SuspendProcessesResult>(new SuspendProcessesResultStaxUnmarshaller());<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,853,670
public void execute() throws MojoExecutionException, MojoFailureException {<NEW_LINE>getLog().info("Going to measure the coverage of manually written test cases with EvoSuite");<NEW_LINE>Set<String> cp = new LinkedHashSet<>();<NEW_LINE>// Get compile elements (i.e., classes under /target/classes)<NEW_LINE>List<String> target = new ArrayList<>(ProjectUtils.getCompileClasspathElements(this.project));<NEW_LINE>// Get JUnit elements (i.e., classes under /target/test-classes) and compiled<NEW_LINE>// elements (i.e., classes under /target/classes)<NEW_LINE>cp.addAll(ProjectUtils.getTestClasspathElements(this.project));<NEW_LINE>// Get project's dependencies<NEW_LINE>cp.addAll(ProjectUtils.getDependencyPathElements(this.project));<NEW_LINE>// Get runtime elements<NEW_LINE>cp.addAll(ProjectUtils.getRuntimeClasspathElements(this.project));<NEW_LINE>if (target.isEmpty() || cp.isEmpty()) {<NEW_LINE>getLog().info("Nothing to measure coverage!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> params = new ArrayList<>();<NEW_LINE>params.add("-measureCoverage");<NEW_LINE>params.add("-target");<NEW_LINE>params.add(ProjectUtils.toClasspathString(target));<NEW_LINE>params.add("-DCP=" + ProjectUtils.toClasspathString(cp));<NEW_LINE>if (this.junit != null) {<NEW_LINE>params.add("-Djunit=" + this.junit);<NEW_LINE>}<NEW_LINE>params.add("-Dcriterion=" + this.criterion);<NEW_LINE>params.add("-Doutput_variables=" + this.output_variables);<NEW_LINE>params.add("-Dglobal_timeout=" + this.global_timeout);<NEW_LINE>// in theory should be safe to execute source-code<NEW_LINE>params.add("-Dsandbox=false");<NEW_LINE>params.add("-Dvirtual_fs=false");<NEW_LINE>params.add("-Dvirtual_net=false");<NEW_LINE>params.add("-Dreplace_calls=false");<NEW_LINE>params.add("-Dreplace_system_in=false");<NEW_LINE><MASK><NEW_LINE>for (String s : params) {<NEW_LINE>getLog().info(" " + s);<NEW_LINE>}<NEW_LINE>EvoSuiteRunner runner = new EvoSuiteRunner(getLog(), this.artifacts, this.projectBuilder, this.repoSession);<NEW_LINE>runner.registerShutDownHook();<NEW_LINE>boolean ok = runner.runEvoSuite(this.project.getBasedir().toString(), params);<NEW_LINE>if (!ok) {<NEW_LINE>throw new MojoFailureException("Failed to correctly execute EvoSuite");<NEW_LINE>}<NEW_LINE>}
getLog().info("Params:");
287,397
public static ErrorDescription switchExpression(HintContext ctx) {<NEW_LINE>TreePath select = ctx.getVariables().get("$select");<NEW_LINE>TypeMirror m = ctx.getInfo().getTrees().getTypeMirror(select);<NEW_LINE>if (m == null || m.getKind() != TypeKind.DECLARED) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>State r = computeExpressionsState(ctx).get(select.getLeaf());<NEW_LINE>if (r == NULL || r == NULL_HYPOTHETICAL) {<NEW_LINE>String displayName = NbBundle.getMessage(NPECheck.class, "ERR_DereferencingNull");<NEW_LINE>return ErrorDescriptionFactory.forName(ctx, ctx.getPath(), displayName);<NEW_LINE>}<NEW_LINE>if (r == State.POSSIBLE_NULL_REPORT || r == INSTANCE_OF_FALSE) {<NEW_LINE>String displayName = NbBundle.getMessage(NPECheck.class, "ERR_PossiblyDereferencingNull");<NEW_LINE>return ErrorDescriptionFactory.forName(ctx, <MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
ctx.getPath(), displayName);
220,049
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (retcode_ != 0) {<NEW_LINE>output.writeInt32(1, retcode_);<NEW_LINE>}<NEW_LINE>if (targetWeaponGuid_ != 0L) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (targetWeaponAwakenLevel_ != 0) {<NEW_LINE>output.writeUInt32(3, targetWeaponAwakenLevel_);<NEW_LINE>}<NEW_LINE>com.google.protobuf.GeneratedMessageV3.serializeIntegerMapTo(output, internalGetOldAffixLevelMap(), OldAffixLevelMapDefaultEntryHolder.defaultEntry, 4);<NEW_LINE>com.google.protobuf.GeneratedMessageV3.serializeIntegerMapTo(output, internalGetCurAffixLevelMap(), CurAffixLevelMapDefaultEntryHolder.defaultEntry, 5);<NEW_LINE>if (avatarGuid_ != 0L) {<NEW_LINE>output.writeUInt64(6, avatarGuid_);<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>}
output.writeUInt64(2, targetWeaponGuid_);
1,249,376
public void start() {<NEW_LINE>// set the LR for our utility object<NEW_LINE>renameUtil.setContext(this.context);<NEW_LINE>// find out period from the filename pattern<NEW_LINE>if (fileNamePatternStr != null) {<NEW_LINE>fileNamePattern = new <MASK><NEW_LINE>determineCompressionMode();<NEW_LINE>} else {<NEW_LINE>addWarn(FNP_NOT_SET);<NEW_LINE>addWarn(CoreConstants.SEE_FNP_NOT_SET);<NEW_LINE>throw new IllegalStateException(FNP_NOT_SET + CoreConstants.SEE_FNP_NOT_SET);<NEW_LINE>}<NEW_LINE>compressor = new Compressor(compressionMode);<NEW_LINE>compressor.setContext(context);<NEW_LINE>// wcs : without compression suffix<NEW_LINE>fileNamePatternWithoutCompSuffix = new FileNamePattern(Compressor.computeFileNameStrWithoutCompSuffix(fileNamePatternStr, compressionMode), this.context);<NEW_LINE>addInfo("Will use the pattern " + fileNamePatternWithoutCompSuffix + " for the active file");<NEW_LINE>if (compressionMode == CompressionMode.ZIP) {<NEW_LINE>String zipEntryFileNamePatternStr = transformFileNamePattern2ZipEntry(fileNamePatternStr);<NEW_LINE>zipEntryFileNamePattern = new FileNamePattern(zipEntryFileNamePatternStr, context);<NEW_LINE>}<NEW_LINE>if (timeBasedFileNamingAndTriggeringPolicy == null) {<NEW_LINE>timeBasedFileNamingAndTriggeringPolicy = new DefaultTimeBasedFileNamingAndTriggeringPolicy<E>();<NEW_LINE>}<NEW_LINE>timeBasedFileNamingAndTriggeringPolicy.setContext(context);<NEW_LINE>timeBasedFileNamingAndTriggeringPolicy.setTimeBasedRollingPolicy(this);<NEW_LINE>timeBasedFileNamingAndTriggeringPolicy.start();<NEW_LINE>if (!timeBasedFileNamingAndTriggeringPolicy.isStarted()) {<NEW_LINE>addWarn("Subcomponent did not start. TimeBasedRollingPolicy will not start.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// the maxHistory property is given to TimeBasedRollingPolicy instead of to<NEW_LINE>// the TimeBasedFileNamingAndTriggeringPolicy. This makes it more convenient<NEW_LINE>// for the user at the cost of inconsistency here.<NEW_LINE>if (maxHistory != UNBOUND_HISTORY) {<NEW_LINE>archiveRemover = timeBasedFileNamingAndTriggeringPolicy.getArchiveRemover();<NEW_LINE>archiveRemover.setMaxHistory(maxHistory);<NEW_LINE>archiveRemover.setTotalSizeCap(totalSizeCap.getSize());<NEW_LINE>if (cleanHistoryOnStart) {<NEW_LINE>addInfo("Cleaning on start up");<NEW_LINE>Date now = new Date(timeBasedFileNamingAndTriggeringPolicy.getCurrentTime());<NEW_LINE>cleanUpFuture = archiveRemover.cleanAsynchronously(now);<NEW_LINE>}<NEW_LINE>} else if (!isUnboundedTotalSizeCap()) {<NEW_LINE>addWarn("'maxHistory' is not set, ignoring 'totalSizeCap' option with value [" + totalSizeCap + "]");<NEW_LINE>}<NEW_LINE>super.start();<NEW_LINE>}
FileNamePattern(fileNamePatternStr, this.context);