idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
526,410 | public static DescribeDtsServiceLogResponse unmarshall(DescribeDtsServiceLogResponse describeDtsServiceLogResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDtsServiceLogResponse.setRequestId(_ctx.stringValue("DescribeDtsServiceLogResponse.RequestId"));<NEW_LINE>describeDtsServiceLogResponse.setHttpStatusCode(_ctx.integerValue("DescribeDtsServiceLogResponse.HttpStatusCode"));<NEW_LINE>describeDtsServiceLogResponse.setErrCode(_ctx.stringValue("DescribeDtsServiceLogResponse.ErrCode"));<NEW_LINE>describeDtsServiceLogResponse.setSuccess(_ctx.booleanValue("DescribeDtsServiceLogResponse.Success"));<NEW_LINE>describeDtsServiceLogResponse.setPageRecordCount(_ctx.integerValue("DescribeDtsServiceLogResponse.PageRecordCount"));<NEW_LINE>describeDtsServiceLogResponse.setTotalRecordCount(_ctx.longValue("DescribeDtsServiceLogResponse.TotalRecordCount"));<NEW_LINE>describeDtsServiceLogResponse.setErrMessage(_ctx.stringValue("DescribeDtsServiceLogResponse.ErrMessage"));<NEW_LINE>describeDtsServiceLogResponse.setDynamicMessage(_ctx.stringValue("DescribeDtsServiceLogResponse.DynamicMessage"));<NEW_LINE>describeDtsServiceLogResponse.setPageNumber<MASK><NEW_LINE>describeDtsServiceLogResponse.setDynamicCode(_ctx.stringValue("DescribeDtsServiceLogResponse.DynamicCode"));<NEW_LINE>List<ServiceLogContext> serviceLogContexts = new ArrayList<ServiceLogContext>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDtsServiceLogResponse.ServiceLogContexts.Length"); i++) {<NEW_LINE>ServiceLogContext serviceLogContext = new ServiceLogContext();<NEW_LINE>serviceLogContext.setContext(_ctx.stringValue("DescribeDtsServiceLogResponse.ServiceLogContexts[" + i + "].Context"));<NEW_LINE>serviceLogContext.setTime(_ctx.stringValue("DescribeDtsServiceLogResponse.ServiceLogContexts[" + i + "].Time"));<NEW_LINE>serviceLogContext.setState(_ctx.stringValue("DescribeDtsServiceLogResponse.ServiceLogContexts[" + i + "].State"));<NEW_LINE>serviceLogContexts.add(serviceLogContext);<NEW_LINE>}<NEW_LINE>describeDtsServiceLogResponse.setServiceLogContexts(serviceLogContexts);<NEW_LINE>return describeDtsServiceLogResponse;<NEW_LINE>} | (_ctx.integerValue("DescribeDtsServiceLogResponse.PageNumber")); |
499,276 | public ParcelFileDescriptor openFileDescriptor(@NonNull String mode, @NonNull HandlerThread callbackThread) throws FileNotFoundException {<NEW_LINE>if (mDocumentFile instanceof ProxyDocumentFile) {<NEW_LINE>File file = Objects.requireNonNull(getFile());<NEW_LINE>int modeBits = ParcelFileDescriptor.parseMode(mode);<NEW_LINE>if (file instanceof ProxyFile && ((ProxyFile) file).isRemote()) {<NEW_LINE>try {<NEW_LINE>return StorageManagerCompat.openProxyFileDescriptor(modeBits, new ProxyStorageCallback(file.getAbsolutePath(), mode, callbackThread));<NEW_LINE>} catch (RemoteException | IOException e) {<NEW_LINE>throw (FileNotFoundException) new FileNotFoundException(e.getMessage()).initCause(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>return StorageManagerCompat.openProxyFileDescriptor(modeBits, new ProxyStorageCallback(FileDescriptorImpl.getInstance(file.getAbsolutePath(<MASK><NEW_LINE>} catch (IOException | ErrnoException e) {<NEW_LINE>throw (FileNotFoundException) new FileNotFoundException(e.getMessage()).initCause(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (mDocumentFile instanceof VirtualDocumentFile) {<NEW_LINE>if (!mDocumentFile.isFile())<NEW_LINE>return null;<NEW_LINE>int modeBits = ParcelFileDescriptor.parseMode(mode);<NEW_LINE>if ((modeBits & ParcelFileDescriptor.MODE_READ_ONLY) == 0) {<NEW_LINE>throw new FileNotFoundException("Read-only file");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return StorageManagerCompat.openProxyFileDescriptor(modeBits, new VirtualStorageCallback((VirtualDocumentFile<?>) mDocumentFile, callbackThread));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw (FileNotFoundException) new FileNotFoundException(e.getMessage()).initCause(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mContext.getContentResolver().openFileDescriptor(mDocumentFile.getUri(), mode);<NEW_LINE>} | ), mode), callbackThread)); |
1,442,100 | public ApiScenarioWithBLOBs buildSaveScenario(SaveApiScenarioRequest request) {<NEW_LINE>ApiScenarioWithBLOBs scenario = new ApiScenarioWithBLOBs();<NEW_LINE>scenario.setId(request.getId());<NEW_LINE>scenario.setName(request.getName());<NEW_LINE>scenario.setProjectId(request.getProjectId());<NEW_LINE>scenario.setCustomNum(request.getCustomNum());<NEW_LINE>if (StringUtils.equals(request.getTags(), "[]")) {<NEW_LINE>scenario.setTags("");<NEW_LINE>} else {<NEW_LINE>scenario.setTags(request.getTags());<NEW_LINE>}<NEW_LINE>scenario.setApiScenarioModuleId(request.getApiScenarioModuleId());<NEW_LINE>scenario.setModulePath(request.getModulePath());<NEW_LINE>scenario.setLevel(request.getLevel());<NEW_LINE>scenario.setPrincipal(request.getPrincipal());<NEW_LINE>scenario.setStepTotal(request.getStepTotal());<NEW_LINE>scenario.setUpdateTime(System.currentTimeMillis());<NEW_LINE>scenario.setDescription(request.getDescription());<NEW_LINE>scenario.setCreateUser(SessionUtils.getUserId());<NEW_LINE>scenario.setScenarioDefinition(JSON.toJSONString(request.getScenarioDefinition()));<NEW_LINE>Boolean isValidEnum = EnumUtils.isValidEnum(EnvironmentType.class, request.getEnvironmentType());<NEW_LINE>if (BooleanUtils.isTrue(isValidEnum)) {<NEW_LINE>scenario.setEnvironmentType(request.getEnvironmentType());<NEW_LINE>} else {<NEW_LINE>scenario.setEnvironmentType(EnvironmentType.JSON.toString());<NEW_LINE>}<NEW_LINE>scenario.setEnvironmentJson(request.getEnvironmentJson());<NEW_LINE>scenario.setEnvironmentGroupId(request.getEnvironmentGroupId());<NEW_LINE>if (StringUtils.isNotEmpty(request.getStatus())) {<NEW_LINE>scenario.<MASK><NEW_LINE>} else {<NEW_LINE>scenario.setStatus(ScenarioStatus.Underway.name());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(request.getUserId())) {<NEW_LINE>scenario.setUserId(request.getUserId());<NEW_LINE>} else {<NEW_LINE>scenario.setUserId(SessionUtils.getUserId());<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(request.getApiScenarioModuleId()) || "default-module".equals(request.getApiScenarioModuleId())) {<NEW_LINE>replenishScenarioModuleIdPath(request.getProjectId(), apiScenarioModuleMapper, scenario);<NEW_LINE>}<NEW_LINE>saveFollows(scenario.getId(), request.getFollows());<NEW_LINE>if (StringUtils.isEmpty(request.getVersionId())) {<NEW_LINE>scenario.setVersionId(extProjectVersionMapper.getDefaultVersion(request.getProjectId()));<NEW_LINE>} else {<NEW_LINE>scenario.setVersionId(request.getVersionId());<NEW_LINE>}<NEW_LINE>return scenario;<NEW_LINE>} | setStatus(request.getStatus()); |
656,146 | public void configurarCores() {<NEW_LINE>setBackground(ColorController.FUNDO_MEDIO);<NEW_LINE>setForeground(ColorController.COR_LETRA);<NEW_LINE>labelEditor.setForeground(ColorController.COR_LETRA);<NEW_LINE><MASK><NEW_LINE>listaTemas.setBackground(ColorController.FUNDO_ESCURO);<NEW_LINE>listaTemas.setSelectionBackground(ColorController.FUNDO_CLARO);<NEW_LINE>if (WeblafUtils.weblafEstaInstalado()) {<NEW_LINE>WeblafUtils.configuraWebLaf(variavelScrollPane);<NEW_LINE>WeblafUtils.configurarBotao(botaoNovoTema, ColorController.FUNDO_ESCURO, ColorController.COR_LETRA_TITULO, ColorController.FUNDO_CLARO, ColorController.COR_LETRA, 5, true);<NEW_LINE>WeblafUtils.configurarBotao(botaoAplicarTema, ColorController.FUNDO_ESCURO, ColorController.COR_LETRA_TITULO, ColorController.FUNDO_CLARO, ColorController.COR_LETRA, 5, true);<NEW_LINE>WeblafUtils.configurarBotao(botaoCancelar, ColorController.FUNDO_ESCURO, ColorController.COR_LETRA_TITULO, ColorController.FUNDO_CLARO, ColorController.COR_LETRA, 5, true);<NEW_LINE>WeblafUtils.configurarBotao(botaoRemoverTema, ColorController.FUNDO_ESCURO, ColorController.COR_LETRA_TITULO, ColorController.FUNDO_CLARO, ColorController.COR_LETRA, 5, true);<NEW_LINE>WeblafUtils.configurarBotao(botaoRenomear, ColorController.FUNDO_ESCURO, ColorController.COR_LETRA_TITULO, ColorController.FUNDO_CLARO, ColorController.COR_LETRA, 5, true);<NEW_LINE>}<NEW_LINE>} | labelPS.setForeground(ColorController.COR_LETRA); |
1,313,902 | void resolve() throws InjectionException {<NEW_LINE>Map<String, Object> props = new HashMap<String, Object>();<NEW_LINE>if (properties != null) {<NEW_LINE>props.putAll(properties);<NEW_LINE>}<NEW_LINE>addOrRemoveProperty(props, KEY_NAME, name);<NEW_LINE>addOrRemoveProperty(props, KEY_INTERFACE_NAME, (interfaceName == null || interfaceName.isEmpty()) ? JMSResourceDefinitionConstants.JMS_QUEUE_INTERFACE : interfaceName);<NEW_LINE><MASK><NEW_LINE>addOrRemoveProperty(props, KEY_RESOURCE_ADAPTER, (resourceAdapter == null || resourceAdapter.isEmpty()) ? JMSResourceDefinitionConstants.DEFAULT_JMS_RESOURCE_ADAPTER : resourceAdapter);<NEW_LINE>addOrRemoveProperty(props, KEY_DESTINATION_NAME, destinationName);<NEW_LINE>addOrRemoveProperty(props, KEY_DESCRIPTION, description);<NEW_LINE>setObjects(null, createDefinitionReference(null, DEFAULT_DESTINATION_INTERFACE, props));<NEW_LINE>} | addOrRemoveProperty(props, KEY_CLASS_NAME, className); |
1,753,453 | public AnnotatedProxy configure(AtmosphereConfig config, Object c) {<NEW_LINE>this.proxiedInstance = c;<NEW_LINE>this.onRuntimeMethod = populateMessage(c);<NEW_LINE>this.onHeartbeatMethod = populate(c, Heartbeat.class);<NEW_LINE>this.onDisconnectMethod = populate(c, Disconnect.class);<NEW_LINE>this.onTimeoutMethod = populate(c, Resume.class);<NEW_LINE>this.onGetMethod = <MASK><NEW_LINE>this.onPostMethod = populate(c, Post.class);<NEW_LINE>this.onPutMethod = populate(c, Put.class);<NEW_LINE>this.onDeleteMethod = populate(c, Delete.class);<NEW_LINE>this.onReadyMethod = populate(c, Ready.class);<NEW_LINE>this.onResumeMethod = populate(c, Resume.class);<NEW_LINE>this.config = config;<NEW_LINE>this.pathParams = pathParams(c);<NEW_LINE>this.resourcesFactory = config.resourcesFactory();<NEW_LINE>scanForReaderOrInputStream();<NEW_LINE>populateEncoders();<NEW_LINE>populateDecoders();<NEW_LINE>return this;<NEW_LINE>} | populate(c, Get.class); |
1,205,503 | public void selectVoiceGuidance(final MapActivity mapActivity, final CallbackWithObject<String> callback, ApplicationMode applicationMode) {<NEW_LINE>final ContextMenuAdapter adapter = new ContextMenuAdapter(app);<NEW_LINE>String[] entries;<NEW_LINE>final String[] entrieValues;<NEW_LINE>Set<String> voiceFiles = getVoiceFiles(mapActivity);<NEW_LINE>entries = new String[voiceFiles.size() + 2];<NEW_LINE>entrieValues = new String[voiceFiles.size() + 2];<NEW_LINE>int k = 0;<NEW_LINE>int selected = -1;<NEW_LINE>String selectedValue = mapActivity.getMyApplication().getSettings().VOICE_PROVIDER.getModeValue(applicationMode);<NEW_LINE>entrieValues[k] = OsmandSettings.VOICE_PROVIDER_NOT_USE;<NEW_LINE>entries[k] = mapActivity.getResources().getString(R.string.shared_string_do_not_use);<NEW_LINE>adapter.addItem(new ContextMenuItem(null).setTitle(entries[k]));<NEW_LINE>if (OsmandSettings.VOICE_PROVIDER_NOT_USE.equals(selectedValue)) {<NEW_LINE>selected = k;<NEW_LINE>}<NEW_LINE>k++;<NEW_LINE>for (String s : voiceFiles) {<NEW_LINE>entries[k] = (s.contains("tts") ? mapActivity.getResources().getString(R.string.ttsvoice) + " " : "") + FileNameTranslationHelper.getVoiceName(mapActivity, s);<NEW_LINE>entrieValues[k] = s;<NEW_LINE>adapter.addItem(new ContextMenuItem(null).setTitle(entries[k]));<NEW_LINE>if (s.equals(selectedValue)) {<NEW_LINE>selected = k;<NEW_LINE>}<NEW_LINE>k++;<NEW_LINE>}<NEW_LINE>entrieValues[k] = MORE_VALUE;<NEW_LINE>entries[k] = mapActivity.getResources().getString(R.string.install_more);<NEW_LINE>adapter.addItem(new ContextMenuItem(null).setTitle(entries[k]));<NEW_LINE>boolean nightMode = isNightMode(app);<NEW_LINE>Context themedContext = UiUtilities.getThemedContext(mapActivity, nightMode);<NEW_LINE>int themeRes = getThemeRes(app);<NEW_LINE>ApplicationMode selectedAppMode = app.getRoutingHelper().getAppMode();<NEW_LINE>int <MASK><NEW_LINE>DialogListItemAdapter dialogAdapter = DialogListItemAdapter.createSingleChoiceAdapter(entries, nightMode, selected, app, selectedModeColor, themeRes, new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>int which = (int) v.getTag();<NEW_LINE>String value = entrieValues[which];<NEW_LINE>if (MORE_VALUE.equals(value)) {<NEW_LINE>final Intent intent = new Intent(mapActivity, DownloadActivity.class);<NEW_LINE>intent.putExtra(DownloadActivity.TAB_TO_OPEN, DownloadActivity.DOWNLOAD_TAB);<NEW_LINE>intent.putExtra(DownloadActivity.FILTER_CAT, DownloadActivityType.VOICE_FILE.getTag());<NEW_LINE>mapActivity.startActivity(intent);<NEW_LINE>} else {<NEW_LINE>if (callback != null) {<NEW_LINE>callback.processResult(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>AlertDialog.Builder bld = new AlertDialog.Builder(themedContext);<NEW_LINE>bld.setAdapter(dialogAdapter, null);<NEW_LINE>dialogAdapter.setDialog(bld.show());<NEW_LINE>} | selectedModeColor = selectedAppMode.getProfileColor(nightMode); |
1,831,123 | public SRevision convertToSObject(Revision input) {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SRevision result = new SRevision();<NEW_LINE>result.setOid(input.getOid());<NEW_LINE>result.setUuid(input.getUuid());<NEW_LINE>result.setRid(input.getRid());<NEW_LINE>result.setId(input.getId());<NEW_LINE>result.setDate(input.getDate());<NEW_LINE>result.setComment(input.getComment());<NEW_LINE>result.setSize(input.getSize());<NEW_LINE>result.setTag(input.getTag());<NEW_LINE>result.setLastError(input.getLastError());<NEW_LINE>result.setBmi(input.getBmi());<NEW_LINE>result.setHasGeometry(input.isHasGeometry());<NEW_LINE>result.setNrPrimitives(input.getNrPrimitives());<NEW_LINE>User userVal = input.getUser();<NEW_LINE>result.setUserId(userVal == null ? -1 : userVal.getOid());<NEW_LINE>List<Long> listconcreteRevisions = new ArrayList<Long>();<NEW_LINE>for (ConcreteRevision v : input.getConcreteRevisions()) {<NEW_LINE>listconcreteRevisions.add(v.getOid());<NEW_LINE>}<NEW_LINE>result.setConcreteRevisions(listconcreteRevisions);<NEW_LINE>ConcreteRevision lastConcreteRevisionVal = input.getLastConcreteRevision();<NEW_LINE>result.setLastConcreteRevisionId(lastConcreteRevisionVal == null ? -1 : lastConcreteRevisionVal.getOid());<NEW_LINE>List<Long> listcheckouts = new ArrayList<Long>();<NEW_LINE>for (Checkout v : input.getCheckouts()) {<NEW_LINE>listcheckouts.add(v.getOid());<NEW_LINE>}<NEW_LINE>result.setCheckouts(listcheckouts);<NEW_LINE>Project projectVal = input.getProject();<NEW_LINE>result.setProjectId(projectVal == null ? -1 : projectVal.getOid());<NEW_LINE>List<Long> listextendedData = new ArrayList<Long>();<NEW_LINE>for (ExtendedData v : input.getExtendedData()) {<NEW_LINE>listextendedData.add(v.getOid());<NEW_LINE>}<NEW_LINE>result.setExtendedData(listextendedData);<NEW_LINE>List<Long> listlogs = new ArrayList<Long>();<NEW_LINE>for (RevisionRelated v : input.getLogs()) {<NEW_LINE>listlogs.add(v.getOid());<NEW_LINE>}<NEW_LINE>result.setLogs(listlogs);<NEW_LINE>Service serviceVal = input.getService();<NEW_LINE>result.setServiceId(serviceVal == null ? -1 : serviceVal.getOid());<NEW_LINE><MASK><NEW_LINE>result.setBounds(convertToSObject(boundsVal));<NEW_LINE>Bounds boundsUntransformedVal = input.getBoundsUntransformed();<NEW_LINE>result.setBoundsUntransformed(convertToSObject(boundsUntransformedVal));<NEW_LINE>Bounds boundsMmVal = input.getBoundsMm();<NEW_LINE>result.setBoundsMm(convertToSObject(boundsMmVal));<NEW_LINE>Bounds boundsUntransformedMmVal = input.getBoundsUntransformedMm();<NEW_LINE>result.setBoundsUntransformedMm(convertToSObject(boundsUntransformedMmVal));<NEW_LINE>List<Long> listservicesLinked = new ArrayList<Long>();<NEW_LINE>for (NewService v : input.getServicesLinked()) {<NEW_LINE>listservicesLinked.add(v.getOid());<NEW_LINE>}<NEW_LINE>result.setServicesLinked(listservicesLinked);<NEW_LINE>DensityCollection densityCollectionVal = input.getDensityCollection();<NEW_LINE>result.setDensityCollectionId(densityCollectionVal == null ? -1 : densityCollectionVal.getOid());<NEW_LINE>return result;<NEW_LINE>} | Bounds boundsVal = input.getBounds(); |
1,231,808 | private void renderAxes(GLAutoDrawable drawable) {<NEW_LINE>final GL2 gl = drawable.getGL().getGL2();<NEW_LINE>gl.glBegin(GL_LINES);<NEW_LINE>// X-Axis<NEW_LINE>gl.glColor3f(1, 0, 0);<NEW_LINE>gl.glVertex3f(0, 0, 0);<NEW_LINE>gl.<MASK><NEW_LINE>// Y-Axis<NEW_LINE>gl.glColor3f(0, 1, 0);<NEW_LINE>gl.glVertex3f(0, 0, 0);<NEW_LINE>gl.glVertex3f(0, 50, 0);<NEW_LINE>// Z-Axis<NEW_LINE>gl.glColor3f(0, 0, 1);<NEW_LINE>gl.glVertex3f(0, 0, 0);<NEW_LINE>gl.glVertex3f(0, 0, 50);<NEW_LINE>gl.glEnd();<NEW_LINE>// # Draw number 50 on x/y-axis line.<NEW_LINE>// glRasterPos2f(50,-5)<NEW_LINE>// glutInit()<NEW_LINE>// A = 53<NEW_LINE>// glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, A)<NEW_LINE>// glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, 48)<NEW_LINE>// glRasterPos2f(-5,50)<NEW_LINE>// glutInit()<NEW_LINE>// A = 53<NEW_LINE>// glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, A)<NEW_LINE>// glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, 48)<NEW_LINE>} | glVertex3f(50, 0, 0); |
1,600,609 | private MJournalBatch createJournalBatch(MAcctSchema accountingSchema, String trxName) {<NEW_LINE>if (journalBatches.containsKey(accountingSchema.get_ID()))<NEW_LINE>return journalBatches.get(accountingSchema.get_ID());<NEW_LINE>Timestamp today = new Timestamp(System.currentTimeMillis());<NEW_LINE>MJournalBatch journalBatch = new MJournalBatch(getCtx(), 0, trxName);<NEW_LINE>StringBuilder journalBatchDescription = new StringBuilder();<NEW_LINE>Optional.ofNullable(getBatchDescription()).ifPresent(batchDescription -> journalBatchDescription.append(batchDescription).append(" "));<NEW_LINE>journalBatchDescription.append(getName()).append(" @DateAcct@ ").append(getDateReval());<NEW_LINE>journalBatch.setDateAcct(getDateReval());<NEW_LINE>journalBatch.setDateDoc(getDateReval());<NEW_LINE>journalBatch.setDescription(Msg.parseTranslation(getCtx(), journalBatchDescription.toString()));<NEW_LINE>journalBatch.setC_DocType_ID(getDocTypeRevalId());<NEW_LINE>journalBatch.setDateDoc(today);<NEW_LINE><MASK><NEW_LINE>journalBatch.setC_Currency_ID(accountingSchema.getC_Currency_ID());<NEW_LINE>journalBatch.saveEx();<NEW_LINE>journalBatches.put(accountingSchema.get_ID(), journalBatch);<NEW_LINE>return journalBatch;<NEW_LINE>} | journalBatch.setDateAcct(getDateReval()); |
1,586,925 | public ConstructorDeclaration createDefaultConstructorForRecord(boolean needExplicitConstructorCall, boolean needToInsert) {<NEW_LINE>// Add to method'set, the default constuctor that just recall the<NEW_LINE>// super constructor with no arguments<NEW_LINE>// The arguments' type will be positionned by the TC so just use<NEW_LINE>// the default int instead of just null (consistency purpose)<NEW_LINE>ConstructorDeclaration constructor = new ConstructorDeclaration(this.compilationResult);<NEW_LINE>constructor.bits |= ASTNode.IsCanonicalConstructor | ASTNode.IsImplicit;<NEW_LINE>constructor.selector = this.name;<NEW_LINE>// constructor.modifiers = this.modifiers & ExtraCompilerModifiers.AccVisibilityMASK;<NEW_LINE>constructor.modifiers = this.modifiers & ClassFileConstants.AccPublic;<NEW_LINE>// JLS 14 8.10.5<NEW_LINE>constructor.modifiers |= ClassFileConstants.AccPublic;<NEW_LINE>constructor.arguments = getArgumentsFromComponents(this.recordComponents);<NEW_LINE>constructor.declarationSourceStart = constructor.sourceStart = constructor.bodyStart = this.sourceStart;<NEW_LINE>constructor.declarationSourceEnd = constructor.sourceEnd = constructor.bodyEnd = this.sourceStart - 1;<NEW_LINE>// the super call inside the constructor<NEW_LINE>if (needExplicitConstructorCall) {<NEW_LINE>constructor.constructorCall = SuperReference.implicitSuperConstructorCall();<NEW_LINE>constructor.constructorCall.sourceStart = this.sourceStart;<NEW_LINE>constructor.constructorCall.sourceEnd = this.sourceEnd;<NEW_LINE>}<NEW_LINE>List<Statement> statements = new ArrayList<>();<NEW_LINE>int l = this.recordComponents != null ? this.recordComponents.length : 0;<NEW_LINE>if (l > 0 && this.fields != null) {<NEW_LINE>List<String> fNames = Arrays.stream(this.fields).filter(f -> f.isARecordComponent).map(f -> new String(f.name)).collect(Collectors.toList());<NEW_LINE>for (int i = 0; i < l; ++i) {<NEW_LINE>RecordComponent component = this.recordComponents[i];<NEW_LINE>if (!fNames.contains(new String(component.name)))<NEW_LINE>continue;<NEW_LINE>FieldReference lhs = new FieldReference(component.name, 0);<NEW_LINE>lhs.receiver = ThisReference.implicitThis();<NEW_LINE>statements.add(new Assignment(lhs, new SingleNameReference(component.name, 0), 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>constructor.statements = statements.<MASK><NEW_LINE>// adding the constructor in the methods list: rank is not critical since bindings will be sorted<NEW_LINE>if (needToInsert) {<NEW_LINE>if (this.methods == null) {<NEW_LINE>this.methods = new AbstractMethodDeclaration[] { constructor };<NEW_LINE>} else {<NEW_LINE>AbstractMethodDeclaration[] newMethods;<NEW_LINE>System.arraycopy(this.methods, 0, newMethods = new AbstractMethodDeclaration[this.methods.length + 1], 1, this.methods.length);<NEW_LINE>newMethods[0] = constructor;<NEW_LINE>this.methods = newMethods;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return constructor;<NEW_LINE>} | toArray(new Statement[0]); |
506,341 | private StoredJSON readStoredJSON(File from) {<NEW_LINE>Matcher timestampMatch = timestampRegex.matcher(from.getName());<NEW_LINE>if (timestampMatch.find()) {<NEW_LINE>try (Stream<String> lines = Files.lines(from.toPath())) {<NEW_LINE>long timestamp = Long.parseLong(timestampMatch.group(1));<NEW_LINE>StringBuilder json = new StringBuilder();<NEW_LINE>lines.forEach(json::append);<NEW_LINE>return new StoredJSON(<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.warn(jsonDirectory.toFile().getAbsolutePath() + " file '" + from.getName() + "' could not be read: " + e.getMessage());<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>logger.warn(jsonDirectory.toFile().getAbsolutePath() + " contained a file '" + from.getName() + "' with improperly formatted -timestamp (could not parse number). This file was not placed there by Plan!");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn(jsonDirectory.toFile().getAbsolutePath() + " contained a file '" + from.getName() + "' that has no -timestamp. This file was not placed there by Plan!");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | json.toString(), timestamp); |
1,523,009 | private void handle(TreePath path) {<NEW_LINE>MemberSelectTree tree = (MemberSelectTree) path.getLeaf();<NEW_LINE>if (!isFullyQualified(tree)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (BadImport.BAD_NESTED_CLASSES.contains(tree.getIdentifier().toString())) {<NEW_LINE>if (tree.getExpression() instanceof MemberSelectTree && getSymbol(tree.getExpression()) instanceof ClassSymbol) {<NEW_LINE>handle(new TreePath(path, tree.getExpression()));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Symbol symbol = getSymbol(tree);<NEW_LINE>if (!(symbol instanceof ClassSymbol)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (state.getEndPosition(tree) == Position.NOPOS) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<TreePath> treePaths = table.get(tree.getIdentifier(), symbol.type.tsym);<NEW_LINE>if (treePaths == null) {<NEW_LINE><MASK><NEW_LINE>table.put(tree.getIdentifier(), symbol.type.tsym, treePaths);<NEW_LINE>}<NEW_LINE>treePaths.add(path);<NEW_LINE>} | treePaths = new ArrayList<>(); |
1,854,559 | void findEntityResources(CombinedIndexBuildItem index, BuildProducer<GeneratedBeanBuildItem> implementationsProducer, BuildProducer<RestDataResourceBuildItem> restDataResourceProducer) {<NEW_LINE>ResourceImplementor resourceImplementor = new ResourceImplementor(new EntityClassHelper(index.getIndex()));<NEW_LINE>ClassOutput classOutput = new GeneratedBeanGizmoAdaptor(implementationsProducer);<NEW_LINE>for (ClassInfo classInfo : index.getIndex().getKnownDirectImplementors(PANACHE_ENTITY_RESOURCE_INTERFACE)) {<NEW_LINE>validateResource(index.getIndex(), classInfo);<NEW_LINE>List<Type> generics = getGenericTypes(classInfo);<NEW_LINE>String resourceInterface = classInfo.name().toString();<NEW_LINE>String entityType = generics.get(0).name().toString();<NEW_LINE>String idType = generics.get(1).name().toString();<NEW_LINE>DataAccessImplementor dataAccessImplementor = new EntityDataAccessImplementor(entityType);<NEW_LINE>String resourceClass = resourceImplementor.implement(classOutput, dataAccessImplementor, resourceInterface, entityType);<NEW_LINE>restDataResourceProducer.produce(new RestDataResourceBuildItem(new ResourceMetadata(resourceClass, <MASK><NEW_LINE>}<NEW_LINE>} | resourceInterface, entityType, idType))); |
1,338,381 | private void generatePreviewValue() {<NEW_LINE><MASK><NEW_LINE>if (viewer == null) {<NEW_LINE>try {<NEW_LINE>DBVUtils.parseExpression(expression);<NEW_LINE>previewText.setText(ResultSetMessages.virtual_edit_attribute_preview_message_editor);<NEW_LINE>} catch (Exception e) {<NEW_LINE>previewText.setText(GeneralUtils.getExpressionParseMessage(e));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ResultSetRow currentRow = viewer.getCurrentRow();<NEW_LINE>if (currentRow == null) {<NEW_LINE>previewText.setText(ResultSetMessages.virtual_edit_attribute_preview_message_current_text);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>JexlExpression parsedExpression = DBVUtils.parseExpression(expression);<NEW_LINE>Object result = DBVUtils.evaluateDataExpression(viewer.getModel().getAttributes(), currentRow.values, parsedExpression, nameText.getText());<NEW_LINE>previewText.setText(CommonUtils.toString(result));<NEW_LINE>} catch (Exception e) {<NEW_LINE>previewText.setText(GeneralUtils.getExpressionParseMessage(e));<NEW_LINE>}<NEW_LINE>} | String expression = expressionText.getText(); |
241,616 | public void insertUpdate(DocumentEvent evt) {<NEW_LINE>clearIncomingEvent(evt);<NEW_LINE>if (docView.lock()) {<NEW_LINE>docView.checkDocumentLockedIfLogging();<NEW_LINE>try {<NEW_LINE>// No return prior this "try" to properly unset incomingModification<NEW_LINE>if (!docView.op.isUpdatable()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Document doc = docView.getDocument();<NEW_LINE>assert (doc == <MASK><NEW_LINE>int insertOffset = evt.getOffset();<NEW_LINE>int insertLength = evt.getLength();<NEW_LINE>if (LOG.isLoggable(Level.FINER)) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.// NOI18N<NEW_LINE>finer(// NOI18N<NEW_LINE>"\nDOCUMENT-INSERT-evt: offset=" + insertOffset + ", length=" + insertLength + ", cRegion=" + charRebuildRegion + ", current-docViewEndOffset=" + // NOI18N<NEW_LINE>(evt.getDocument().getLength() + 1) + '\n');<NEW_LINE>}<NEW_LINE>updateViewsByModification(insertOffset, insertLength, evt);<NEW_LINE>} finally {<NEW_LINE>docView.op.clearIncomingModification();<NEW_LINE>docView.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | evt.getDocument()) : "Invalid document"; |
438,857 | private BufferedImage printToImage(int dpi, final MapView view, final Rectangle innerBounds) {<NEW_LINE>double scaleFactor = (double) dpi / (double) (UITools.FONT_SCALE_FACTOR * 72);<NEW_LINE>int imageWidth = (int) Math.ceil(innerBounds.width * scaleFactor);<NEW_LINE>int imageHeight = (int) Math.ceil(innerBounds.height * scaleFactor);<NEW_LINE>final BufferedImage myImage = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);<NEW_LINE>final Graphics2D g = <MASK><NEW_LINE>Color background = view.getBackground();<NEW_LINE>if (background == null) {<NEW_LINE>background = SystemColor.window;<NEW_LINE>}<NEW_LINE>g.setBackground(background);<NEW_LINE>g.clearRect(0, 0, imageWidth, imageHeight);<NEW_LINE>g.scale(scaleFactor, scaleFactor);<NEW_LINE>g.translate(-innerBounds.x, -innerBounds.y);<NEW_LINE>g.setRenderingHint(GraphicsHints.CACHE_ICONS, Boolean.TRUE);<NEW_LINE>view.print(g);<NEW_LINE>return myImage;<NEW_LINE>} | (Graphics2D) myImage.getGraphics(); |
147,601 | // adjustable date, defaulting business day convention and holiday calendar<NEW_LINE>private static Optional<AdjustableDate> parseAdjustableDate(CsvRow row, String leg, String dateField, String cnvField, String calField) {<NEW_LINE>Optional<LocalDate> dateOpt = findValue(row, leg, dateField).map(s -> LoaderUtils.parseDate(s));<NEW_LINE>if (!dateOpt.isPresent()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>BusinessDayConvention dateCnv = findValue(row, leg, cnvField).map(s -> LoaderUtils.parseBusinessDayConvention(s)).orElse(BusinessDayConventions.MODIFIED_FOLLOWING);<NEW_LINE>HolidayCalendarId cal = findValue(row, leg, calField).map(s -> HolidayCalendarId.of(s)<MASK><NEW_LINE>return Optional.of(AdjustableDate.of(dateOpt.get(), BusinessDayAdjustment.of(dateCnv, cal)));<NEW_LINE>} | ).orElse(HolidayCalendarIds.NO_HOLIDAYS); |
1,604,462 | public static PostResult copyThreatDescriptor(DescriptorPostParameters overrideParams, boolean verbose, boolean showURLs, boolean dryRun) {<NEW_LINE>String validationErrorMessage = overrideParams.validateForCopyWithReport();<NEW_LINE>if (validationErrorMessage != null) {<NEW_LINE>return new PostResult(false, null, validationErrorMessage);<NEW_LINE>}<NEW_LINE>// Get source descriptor<NEW_LINE>String sourceID = overrideParams.getDescriptorID();<NEW_LINE>ThreatDescriptor sourceDescriptor = getInfoForID(sourceID, verbose, showURLs, false);<NEW_LINE>if (sourceDescriptor == null) {<NEW_LINE>return new PostResult(false, null, "Could not load copy-from descriptor with ID \"" + sourceID + "\".");<NEW_LINE>}<NEW_LINE>// Take the source-descriptor values and overwrite any post-params fields<NEW_LINE>// supplied by the caller.<NEW_LINE>DescriptorPostParameters postParams = new DescriptorPostParameters();<NEW_LINE>// Copy source-descriptor values to the post-params.<NEW_LINE><MASK><NEW_LINE>postParams.setIndicatorType(sourceDescriptor.td_indicator_type);<NEW_LINE>postParams.setDescription(sourceDescriptor.td_description);<NEW_LINE>postParams.setShareLevel(sourceDescriptor.td_share_level);<NEW_LINE>postParams.setStatus(sourceDescriptor.td_status);<NEW_LINE>// The following are not currently retrievable in the Graph API from the source descriptor:<NEW_LINE>// postParams.setPrivacyType(sourceDescriptor.td_visibility);<NEW_LINE>// postParams.setPrivacyMembers(sourceDescriptor.td_privacy_members);<NEW_LINE>postParams.setConfidence(sourceDescriptor.td_confidence);<NEW_LINE>postParams.setReviewStatus(sourceDescriptor.td_review_status);<NEW_LINE>postParams.setSeverity(sourceDescriptor.td_severity);<NEW_LINE>postParams.ifNotNullSetFirstActive(sourceDescriptor.td_first_active);<NEW_LINE>postParams.ifNotNullSetLastActive(sourceDescriptor.td_last_active);<NEW_LINE>postParams.ifNotNullSetExpiredOn(sourceDescriptor.td_expired_on);<NEW_LINE>if (sourceDescriptor.td_subjective_tags != null && sourceDescriptor.td_subjective_tags.size() > 0) {<NEW_LINE>postParams.setTagsToSet(String.join(",", sourceDescriptor.td_subjective_tags));<NEW_LINE>}<NEW_LINE>// The following are not currently retrievable in the Graph API from the source descriptor:<NEW_LINE>// postParams.setRelatedIDsForUpload(sourceDescriptor.xxx);<NEW_LINE>// postParams.setRelatedTriplesForUploadAsJSON(sourceDescriptor.xxx);<NEW_LINE>// Overwrite override values to the post-params.<NEW_LINE>postParams.ifNotNullSetIndicatorText(overrideParams.getIndicatorText());<NEW_LINE>postParams.ifNotNullSetIndicatorType(overrideParams.getIndicatorType());<NEW_LINE>postParams.ifNotNullSetDescription(overrideParams.getDescription());<NEW_LINE>postParams.ifNotNullSetShareLevel(overrideParams.getShareLevel());<NEW_LINE>postParams.ifNotNullSetStatus(overrideParams.getStatus());<NEW_LINE>postParams.ifNotNullSetPrivacyType(overrideParams.getPrivacyType());<NEW_LINE>postParams.ifNotNullSetPrivacyMembers(overrideParams.getPrivacyMembers());<NEW_LINE>postParams.ifNotNullSetConfidence(overrideParams.getConfidence());<NEW_LINE>postParams.ifNotNullSetReviewStatus(overrideParams.getReviewStatus());<NEW_LINE>postParams.ifNotNullSetSeverity(overrideParams.getSeverity());<NEW_LINE>postParams.ifNotNullSetExpiredOn(overrideParams.getExpiredOn());<NEW_LINE>postParams.ifNotNullSetFirstActive(overrideParams.getFirstActive());<NEW_LINE>postParams.ifNotNullSetLastActive(overrideParams.getLastActive());<NEW_LINE>postParams.ifNotNullSetTagsToSet(overrideParams.getTagsToSet());<NEW_LINE>postParams.ifNotNullSetRelatedIDsForUpload(overrideParams.getRelatedIDsForUpload());<NEW_LINE>postParams.ifNotNullSetRelatedTriplesForUploadAsJSON(overrideParams.getRelatedTriplesForUploadAsJSON());<NEW_LINE>// Post the new descriptor<NEW_LINE>String urlString = TE_BASE_URL + "/threat_descriptors" + "/?access_token=" + APP_TOKEN;<NEW_LINE>return postThreatDescriptor(urlString, postParams, showURLs, dryRun);<NEW_LINE>} | postParams.setIndicatorText(sourceDescriptor.td_raw_indicator); |
390,657 | public DruidExpression toDruidExpression(final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode) {<NEW_LINE>return OperatorConversions.convertDirectCallWithExtraction(plannerContext, rowSignature, rexNode, StringUtils.toLowerCase(calciteOperator().getName()), inputExpressions -> {<NEW_LINE>final DruidExpression arg = inputExpressions.get(0);<NEW_LINE>final Expr patternExpr = inputExpressions.get(1).parse(plannerContext.getExprMacroTable());<NEW_LINE>final Expr indexExpr = inputExpressions.size() > 2 ? inputExpressions.get(2).parse(plannerContext.getExprMacroTable()) : null;<NEW_LINE>if (arg.isSimpleExtraction() && patternExpr.isLiteral() && (indexExpr == null || indexExpr.isLiteral())) {<NEW_LINE>final String pattern = (String) patternExpr.getLiteralValue();<NEW_LINE>return arg.getSimpleExtraction().cascade(new // Undo the empty-to-null conversion from patternExpr parsing (patterns cannot be null, even in<NEW_LINE>RegexDimExtractionFn(// non-SQL-compliant null handling mode).<NEW_LINE>StringUtils.nullToEmptyNonDruidDataString(pattern), indexExpr == null ? DEFAULT_INDEX : ((Number) indexExpr.getLiteralValue()).intValue<MASK><NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (), true, null)); |
8,192 | public com.amazonaws.services.appstream.model.ResourceNotAvailableException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.appstream.model.ResourceNotAvailableException resourceNotAvailableException = new com.amazonaws.services.appstream.model.ResourceNotAvailableException(null);<NEW_LINE><MASK><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>} 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 resourceNotAvailableException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,099,565 | public static void openBrowser(HttpRootPathBuildItem rp, NonApplicationRootPathBuildItem np, String path, String host, String port) {<NEW_LINE>if (path.startsWith("/q")) {<NEW_LINE>path = np.resolvePath(path.substring(3));<NEW_LINE>} else {<NEW_LINE>path = rp.resolvePath(path.substring(1));<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder("http://");<NEW_LINE>Config c = ConfigProvider.getConfig();<NEW_LINE>sb.append(host);<NEW_LINE>sb.append(":");<NEW_LINE>sb.append(port);<NEW_LINE>sb.append(path);<NEW_LINE>String url = sb.toString();<NEW_LINE>Runtime rt = Runtime.getRuntime();<NEW_LINE>OS os = OS.determineOS();<NEW_LINE>String[] command = null;<NEW_LINE>try {<NEW_LINE>switch(os) {<NEW_LINE>case MAC:<NEW_LINE>command = new <MASK><NEW_LINE>break;<NEW_LINE>case LINUX:<NEW_LINE>command = new String[] { "xdg-open", url };<NEW_LINE>break;<NEW_LINE>case WINDOWS:<NEW_LINE>command = new String[] { "rundll32", "url.dll,FileProtocolHandler", url };<NEW_LINE>break;<NEW_LINE>case OTHER:<NEW_LINE>log.error("Cannot launch browser on this operating system");<NEW_LINE>}<NEW_LINE>if (command != null) {<NEW_LINE>rt.exec(command);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.debug("Failed to launch browser", e);<NEW_LINE>if (command != null) {<NEW_LINE>log.warn("Unable to open browser using command: '" + String.join(" ", command) + "'. Failure is: '" + e.getMessage() + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String[] { "open", url }; |
718,655 | void processChildNode(WatchedEvent event) throws KeeperException, InterruptedException {<NEW_LINE>final String path = event.getPath();<NEW_LINE>switch(event.getType()) {<NEW_LINE>case NodeDeleted:<NEW_LINE>// Key expired<NEW_LINE>if (path == null) {<NEW_LINE>log.error("Got null path for NodeDeleted event");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Pull off the base ZK path and the '/' separator<NEW_LINE>String childName = path.substring(<MASK><NEW_LINE>secretManager.removeKey(Integer.parseInt(childName));<NEW_LINE>break;<NEW_LINE>case None:<NEW_LINE>// Not connected, don't care. We'll update when we're reconnected<NEW_LINE>break;<NEW_LINE>case NodeCreated:<NEW_LINE>// New key created<NEW_LINE>if (path == null) {<NEW_LINE>log.error("Got null path for NodeCreated event");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get the data and reset the watcher<NEW_LINE>AuthenticationKey key = deserializeKey(zk.getData(path, this));<NEW_LINE>log.debug("Adding AuthenticationKey with keyId {}", key.getKeyId());<NEW_LINE>secretManager.addKey(key);<NEW_LINE>break;<NEW_LINE>case NodeDataChanged:<NEW_LINE>// Key changed, could happen on restart after not running Accumulo.<NEW_LINE>if (path == null) {<NEW_LINE>log.error("Got null path for NodeDataChanged event");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get the data and reset the watcher<NEW_LINE>AuthenticationKey newKey = deserializeKey(zk.getData(path, this));<NEW_LINE>// Will overwrite the old key if one exists<NEW_LINE>secretManager.addKey(newKey);<NEW_LINE>break;<NEW_LINE>case NodeChildrenChanged:<NEW_LINE>// no children for the children..<NEW_LINE>log.warn("Unexpected NodeChildrenChanged event for authentication key node {}", path);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>log.warn("Unsupported event type: {}", event.getType());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | baseNode.length() + 1); |
454,165 | public static void stopBuzzerSound(Component comp, CircuitState circState) {<NEW_LINE>// static method, have to check if the comp parameter is a Buzzer or contains it<NEW_LINE>final var compFact = comp.getFactory();<NEW_LINE>// if it is a buzzer, stop its sound thread<NEW_LINE>if (compFact instanceof Buzzer) {<NEW_LINE>final var d = (Data) circState.getData(comp);<NEW_LINE>if (d != null && d.thread.isAlive()) {<NEW_LINE>d.isOn.set(false);<NEW_LINE>}<NEW_LINE>} else if (compFact instanceof SubcircuitFactory) {<NEW_LINE>// if it's a subcircuit search other buzzer's instances inside it and stop all sound threads<NEW_LINE>for (final var subComponent : ((SubcircuitFactory) comp.getFactory()).getSubcircuit().getComponents()) {<NEW_LINE>// recursive if there are other subcircuits<NEW_LINE>stopBuzzerSound(subComponent, ((SubcircuitFactory) compFact)<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getSubstate(circState, comp)); |
465,820 | private SegmentCompletionProtocol.Response commitSegment(SegmentCompletionProtocol.Request.Params reqParams, boolean isSplitCommit, CommittingSegmentDescriptor committingSegmentDescriptor) {<NEW_LINE>String instanceId = reqParams.getInstanceId();<NEW_LINE>StreamPartitionMsgOffset offset = _streamPartitionMsgOffsetFactory.create(reqParams.getStreamPartitionMsgOffset());<NEW_LINE>if (!_state.equals(State.COMMITTER_UPLOADING)) {<NEW_LINE>// State changed while we were out of sync. return a failed commit.<NEW_LINE>_logger.warn("State change during upload: state={} segment={} winner={} winningOffset={}", _state, _segmentName.getSegmentName(), _winner, _winningOffset);<NEW_LINE>return SegmentCompletionProtocol.RESP_FAILED;<NEW_LINE>}<NEW_LINE>_logger.info("Committing segment {} at offset {} winner {}", _segmentName.getSegmentName(), offset, instanceId);<NEW_LINE>_state = State.COMMITTING;<NEW_LINE>// In case of splitCommit, the segment is uploaded to a unique file name indicated by segmentLocation,<NEW_LINE>// so we need to move the segment file to its permanent location first before committing the metadata.<NEW_LINE>// The committingSegmentDescriptor is then updated with the permanent segment location to be saved in metadata<NEW_LINE>// store.<NEW_LINE>if (isSplitCommit) {<NEW_LINE>try {<NEW_LINE>_segmentManager.commitSegmentFile(_realtimeTableName, committingSegmentDescriptor);<NEW_LINE>} catch (Exception e) {<NEW_LINE>_logger.error("Caught exception while committing segment file for segment: {}", <MASK><NEW_LINE>return SegmentCompletionProtocol.RESP_FAILED;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Convert to a controller uri if the segment location uses local file scheme.<NEW_LINE>if (CommonConstants.Segment.LOCAL_SEGMENT_SCHEME.equalsIgnoreCase(URIUtils.getUri(committingSegmentDescriptor.getSegmentLocation()).getScheme())) {<NEW_LINE>committingSegmentDescriptor.setSegmentLocation(URIUtils.constructDownloadUrl(_controllerVipUrl, TableNameBuilder.extractRawTableName(_realtimeTableName), _segmentName.getSegmentName()));<NEW_LINE>}<NEW_LINE>_segmentManager.commitSegmentMetadata(_realtimeTableName, committingSegmentDescriptor);<NEW_LINE>} catch (Exception e) {<NEW_LINE>_logger.error("Caught exception while committing segment metadata for segment: {}", _segmentName.getSegmentName(), e);<NEW_LINE>return SegmentCompletionProtocol.RESP_FAILED;<NEW_LINE>}<NEW_LINE>_state = State.COMMITTED;<NEW_LINE>_logger.info("Committed segment {} at offset {} winner {}", _segmentName.getSegmentName(), offset, instanceId);<NEW_LINE>return SegmentCompletionProtocol.RESP_COMMIT_SUCCESS;<NEW_LINE>} | _segmentName.getSegmentName(), e); |
924,367 | public VectorTypeInformation<?> fromByteBuffer(ByteBuffer buffer) throws IOException {<NEW_LINE>try {<NEW_LINE>// Factory type!<NEW_LINE>String typename = <MASK><NEW_LINE>NumberVector.Factory<NumberVector> factory = (NumberVector.Factory<NumberVector>) ELKIServiceRegistry.findImplementation(NumberVector.Factory.class, typename).getDeclaredConstructor().newInstance();<NEW_LINE>String label = ByteArrayUtil.STRING_SERIALIZER.fromByteBuffer(buffer);<NEW_LINE>label = ("".equals(label)) ? null : label;<NEW_LINE>String sername = ByteArrayUtil.STRING_SERIALIZER.fromByteBuffer(buffer);<NEW_LINE>ByteBufferSerializer<NumberVector> serializer = (ByteBufferSerializer<NumberVector>) Class.forName(sername).getDeclaredConstructor().newInstance();<NEW_LINE>int mindim = ByteArrayUtil.readSignedVarint(buffer);<NEW_LINE>int maxdim = ByteArrayUtil.readSignedVarint(buffer);<NEW_LINE>return new VectorTypeInformation<>(factory, serializer, mindim, maxdim);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new UnsupportedOperationException("Cannot deserialize - class not found: " + e, e);<NEW_LINE>} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {<NEW_LINE>throw new UnsupportedOperationException("Cannot deserialize - cannot instantiate serializer: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | ByteArrayUtil.STRING_SERIALIZER.fromByteBuffer(buffer); |
1,484,586 | public void paintIcon(Component c, Graphics g, int x, int y) {<NEW_LINE>// If the previous icon was an AnimatedIcon, stop the animation<NEW_LINE>if (c instanceof JAnimatedButton) {<NEW_LINE>if (((JAnimatedButton) c).getCurrentIcon() != this) {<NEW_LINE>if (((JAnimatedButton) c).getCurrentIcon() != null) {<NEW_LINE>((JAnimatedButton) c).getCurrentIcon().pause();<NEW_LINE>}<NEW_LINE>((JAnimatedButton) c).setCurrentIcon(this);<NEW_LINE>resume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Saving the x, y coordinates allows us to only repaint the icon and<NEW_LINE>// not the entire component for each animation<NEW_LINE>if (c == component) {<NEW_LINE>iconX = x;<NEW_LINE>iconY = y;<NEW_LINE>}<NEW_LINE>// Determine the proper alignment of the Icon, then paint it<NEW_LINE>Icon icon = frames.get(currentFrameIndex).icon;<NEW_LINE>int width = getIconWidth();<NEW_LINE>int height = getIconHeight();<NEW_LINE>int offsetX = getOffset(width, <MASK><NEW_LINE>int offsetY = getOffset(height, icon.getIconHeight(), alignmentY);<NEW_LINE>icon.paintIcon(c, g, x + offsetX, y + offsetY);<NEW_LINE>} | icon.getIconWidth(), alignmentX); |
1,825,413 | private static Map<String, Object> list2map_string(List<Object> valueList, String key, Udf convert, Hints hints) throws Throwable {<NEW_LINE>return list2map_udf(valueList, (readOnly, params) -> {<NEW_LINE>int rowNumber = (int) params[0];<NEW_LINE>if (params[1] == null) {<NEW_LINE>throw new NullPointerException("element " + rowNumber + " data is null");<NEW_LINE>}<NEW_LINE>DataModel rowData = DomainHelper.convertTo(params[1]);<NEW_LINE>if (!rowData.isObject()) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>DataModel keyValue = ((ObjectModel) rowData).get(key);<NEW_LINE>if (keyValue == null) {<NEW_LINE>throw new NullPointerException("element " + rowNumber + " key '" + key + "' is not exist");<NEW_LINE>}<NEW_LINE>if (!keyValue.isValue()) {<NEW_LINE>throw new NullPointerException("element " + rowNumber + " key '" + key + "' type must primary");<NEW_LINE>}<NEW_LINE>return String.valueOf(keyValue.unwrap());<NEW_LINE>}, convert, hints);<NEW_LINE>} | NullPointerException("element " + rowNumber + " type is not Object"); |
790,461 | public final void visit(NodeTraversal t, Node n, Node parent) {<NEW_LINE>if (n.isScript()) {<NEW_LINE>checkCanonical(t);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Node callNode = null;<NEW_LINE>if (n.isExprResult()) {<NEW_LINE>callNode = n.getFirstChild();<NEW_LINE>} else if (NodeUtil.isNameDeclaration(n)) {<NEW_LINE>callNode = n<MASK><NEW_LINE>}<NEW_LINE>if (callNode != null && isValidImportCall(callNode)) {<NEW_LINE>ImportStatement stmt = parseImport(callNode);<NEW_LINE>originalImports.add(stmt);<NEW_LINE>importsByNamespace.put(stmt.namespace(), stmt);<NEW_LINE>if (firstNode == null) {<NEW_LINE>firstNode = lastNode = n;<NEW_LINE>} else {<NEW_LINE>lastNode = n;<NEW_LINE>}<NEW_LINE>} else if (!importsByNamespace.isEmpty()) {<NEW_LINE>finished = true;<NEW_LINE>}<NEW_LINE>} | .getFirstChild().getLastChild(); |
1,800,109 | public com.amazonaws.services.codecommit.model.FileDoesNotExistException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codecommit.model.FileDoesNotExistException fileDoesNotExistException = new com.amazonaws.services.codecommit.model.FileDoesNotExistException(null);<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 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>} 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 fileDoesNotExistException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,372,027 | public boolean addConstraintMapping(HttpContext httpContext, WebContainer service, Object cm) {<NEW_LINE>if (cm instanceof PaxWebSecurityConstraintMapping) {<NEW_LINE>PaxWebSecurityConstraintMapping constraintMapping = (PaxWebSecurityConstraintMapping) cm;<NEW_LINE>String name = constraintMapping.getConstraintName();<NEW_LINE>if (name == null) {<NEW_LINE>name = "Constraint-" + new SecureRandom(<MASK><NEW_LINE>}<NEW_LINE>log.debug("Adding security constraint name=" + name + ", url=" + constraintMapping.getUrl() + ", dataConstraint=" + constraintMapping.getDataConstraint() + ", canAuthenticate=" + constraintMapping.isAuthentication() + ", roles=" + constraintMapping.getRoles());<NEW_LINE>service.registerConstraintMapping(name, constraintMapping.getMapping(), constraintMapping.getUrl(), constraintMapping.getDataConstraint(), constraintMapping.isAuthentication(), constraintMapping.getRoles(), httpContext);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ).nextInt(Integer.MAX_VALUE); |
1,200,355 | final CreateLicenseManagerReportGeneratorResult executeCreateLicenseManagerReportGenerator(CreateLicenseManagerReportGeneratorRequest createLicenseManagerReportGeneratorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLicenseManagerReportGeneratorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateLicenseManagerReportGeneratorRequest> request = null;<NEW_LINE>Response<CreateLicenseManagerReportGeneratorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLicenseManagerReportGeneratorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLicenseManagerReportGeneratorRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLicenseManagerReportGenerator");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateLicenseManagerReportGeneratorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLicenseManagerReportGeneratorResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "License Manager"); |
1,131,493 | private boolean equalConstants(Constant c1, Constant c2) {<NEW_LINE><MASK><NEW_LINE>if (t != c2.getType()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (t instanceof IntType) {<NEW_LINE>return ((IntConstant) c1).value == ((IntConstant) c2).value;<NEW_LINE>}<NEW_LINE>if (t instanceof FloatType) {<NEW_LINE>return ((FloatConstant) c1).value == ((FloatConstant) c2).value;<NEW_LINE>}<NEW_LINE>if (t instanceof LongType) {<NEW_LINE>return ((LongConstant) c1).value == ((LongConstant) c2).value;<NEW_LINE>}<NEW_LINE>if (t instanceof DoubleType) {<NEW_LINE>return ((DoubleConstant) c1).value == ((DoubleConstant) c2).value;<NEW_LINE>}<NEW_LINE>if (c1 instanceof StringConstant && c2 instanceof StringConstant) {<NEW_LINE>return ((StringConstant) c1).value == ((StringConstant) c2).value;<NEW_LINE>}<NEW_LINE>return c1 instanceof NullConstant && c2 instanceof NullConstant;<NEW_LINE>} | Type t = c1.getType(); |
103,156 | public static DescribeClusterDetailResponse unmarshall(DescribeClusterDetailResponse describeClusterDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeClusterDetailResponse.setResource_group_id(_ctx.stringValue("DescribeClusterDetailResponse.resource_group_id"));<NEW_LINE>describeClusterDetailResponse.setVpc_id(_ctx.stringValue("DescribeClusterDetailResponse.vpc_id"));<NEW_LINE>describeClusterDetailResponse.setDeletion_protection(_ctx.booleanValue("DescribeClusterDetailResponse.deletion_protection"));<NEW_LINE>describeClusterDetailResponse.setCreated(_ctx.stringValue("DescribeClusterDetailResponse.created"));<NEW_LINE>describeClusterDetailResponse.setNetwork_mode(_ctx.stringValue("DescribeClusterDetailResponse.network_mode"));<NEW_LINE>describeClusterDetailResponse.setRegion_id(_ctx.stringValue("DescribeClusterDetailResponse.region_id"));<NEW_LINE>describeClusterDetailResponse.setSecurity_group_id(_ctx.stringValue("DescribeClusterDetailResponse.security_group_id"));<NEW_LINE>describeClusterDetailResponse.setCurrent_version(_ctx.stringValue("DescribeClusterDetailResponse.current_version"));<NEW_LINE>describeClusterDetailResponse.setCluster_type(_ctx.stringValue("DescribeClusterDetailResponse.cluster_type"));<NEW_LINE>describeClusterDetailResponse.setDocker_version(_ctx.stringValue("DescribeClusterDetailResponse.docker_version"));<NEW_LINE>describeClusterDetailResponse.setVswitch_cidr(_ctx.stringValue("DescribeClusterDetailResponse.vswitch_cidr"));<NEW_LINE>describeClusterDetailResponse.setZone_id(_ctx.stringValue("DescribeClusterDetailResponse.zone_id"));<NEW_LINE>describeClusterDetailResponse.setCluster_id(_ctx.stringValue("DescribeClusterDetailResponse.cluster_id"));<NEW_LINE>describeClusterDetailResponse.setSize(_ctx.integerValue("DescribeClusterDetailResponse.size"));<NEW_LINE>describeClusterDetailResponse.setExternal_loadbalancer_id(_ctx.stringValue("DescribeClusterDetailResponse.external_loadbalancer_id"));<NEW_LINE>describeClusterDetailResponse.setVswitch_id(_ctx.stringValue("DescribeClusterDetailResponse.vswitch_id"));<NEW_LINE>describeClusterDetailResponse.setName(_ctx.stringValue("DescribeClusterDetailResponse.name"));<NEW_LINE>describeClusterDetailResponse.setMeta_data(_ctx.stringValue("DescribeClusterDetailResponse.meta_data"));<NEW_LINE>describeClusterDetailResponse.setState(_ctx.stringValue("DescribeClusterDetailResponse.state"));<NEW_LINE>describeClusterDetailResponse.setUpdated(_ctx.stringValue("DescribeClusterDetailResponse.updated"));<NEW_LINE>describeClusterDetailResponse.setInstance_type(_ctx.stringValue("DescribeClusterDetailResponse.instance_type"));<NEW_LINE>List<TagsItem> tags = new ArrayList<TagsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeClusterDetailResponse.tags.Length"); i++) {<NEW_LINE>TagsItem tagsItem = new TagsItem();<NEW_LINE>tagsItem.setValue(_ctx.stringValue<MASK><NEW_LINE>tagsItem.setKey(_ctx.stringValue("DescribeClusterDetailResponse.tags[" + i + "].key"));<NEW_LINE>tags.add(tagsItem);<NEW_LINE>}<NEW_LINE>describeClusterDetailResponse.setTags(tags);<NEW_LINE>return describeClusterDetailResponse;<NEW_LINE>} | ("DescribeClusterDetailResponse.tags[" + i + "].value")); |
1,648,013 | final DescribeUserResult executeDescribeUser(DescribeUserRequest describeUserRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeUserRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeUserRequest> request = null;<NEW_LINE>Response<DescribeUserResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeUserRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeUserRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeUser");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeUserResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeUserResultJsonUnmarshaller());<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); |
806,407 | public void handle(GlowSession session, TabCompleteMessage message) {<NEW_LINE>GlowPlayer sender = session.getPlayer();<NEW_LINE><MASK><NEW_LINE>List<String> completions = new ArrayList<>();<NEW_LINE>// complete command or username<NEW_LINE>if (!buffer.isEmpty() && buffer.charAt(0) == '/') {<NEW_LINE>List<String> items;<NEW_LINE>if (!buffer.isEmpty() && buffer.charAt(0) == '/') {<NEW_LINE>items = session.getServer().getCommandMap().tabComplete(sender, buffer.substring(1));<NEW_LINE>} else {<NEW_LINE>items = session.getServer().getCommandMap().tabComplete(sender, buffer);<NEW_LINE>}<NEW_LINE>if (items != null) {<NEW_LINE>completions.addAll(items);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int space = buffer.lastIndexOf(' ');<NEW_LINE>String lastWord;<NEW_LINE>if (space == -1) {<NEW_LINE>lastWord = buffer;<NEW_LINE>} else {<NEW_LINE>lastWord = buffer.substring(space + 1);<NEW_LINE>}<NEW_LINE>// from Command<NEW_LINE>for (Player player : session.getServer().getOnlinePlayers()) {<NEW_LINE>String name = player.getName();<NEW_LINE>if (sender.canSee(player) && StringUtil.startsWithIgnoreCase(name, lastWord)) {<NEW_LINE>completions.add(name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>completions.sort(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>}<NEW_LINE>// call event and send response<NEW_LINE>EventFactory.getInstance().callEvent(new PlayerChatTabCompleteEvent(sender, buffer, completions));<NEW_LINE>// TODO: 1.13, properly implement tab-completion<NEW_LINE>session.send(new TabCompleteResponseMessage(0, 0, 0, completions.stream().map(str -> new TabCompleteResponseMessage.Completion(str, null)).collect(Collectors.toList())));<NEW_LINE>} | String buffer = message.getText(); |
521,011 | private Uri createOutputUri(@NonNull Uri outputUri, @NonNull String contentType, @NonNull String fileName) throws IOException {<NEW_LINE>String[] fileParts = getFileNameParts(fileName);<NEW_LINE>String base = fileParts[0];<NEW_LINE>String extension = fileParts[1];<NEW_LINE>String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);<NEW_LINE>if (MediaUtil.isOctetStream(mimeType) && MediaUtil.isImageVideoOrAudioType(contentType)) {<NEW_LINE>Log.d(TAG, "MimeTypeMap returned octet stream for media, changing to provided content type [" + contentType + "] instead.");<NEW_LINE>mimeType = contentType;<NEW_LINE>}<NEW_LINE>ContentValues contentValues = new ContentValues();<NEW_LINE>contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, fileName);<NEW_LINE>contentValues.put(MediaStore.MediaColumns.MIME_TYPE, mimeType);<NEW_LINE>contentValues.put(MediaStore.MediaColumns.DATE_ADDED, TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()));<NEW_LINE>contentValues.put(MediaStore.MediaColumns.DATE_MODIFIED, TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()));<NEW_LINE>if (Build.VERSION.SDK_INT > 28) {<NEW_LINE>contentValues.put(MediaStore.MediaColumns.IS_PENDING, 1);<NEW_LINE>} else if (Util.equals(outputUri.getScheme(), ContentResolver.SCHEME_FILE)) {<NEW_LINE>File outputDirectory = new File(outputUri.getPath());<NEW_LINE>File outputFile = new File(outputDirectory, base + "." + extension);<NEW_LINE>int i = 0;<NEW_LINE>while (outputFile.exists()) {<NEW_LINE>outputFile = new File(outputDirectory, base + "-" + (++i) + "." + extension);<NEW_LINE>}<NEW_LINE>if (outputFile.isHidden()) {<NEW_LINE>throw new IOException("Specified name would not be visible");<NEW_LINE>}<NEW_LINE>return Uri.fromFile(outputFile);<NEW_LINE>} else {<NEW_LINE>String dir = getExternalPathForType(contentType);<NEW_LINE>if (dir == null) {<NEW_LINE>throw new IOException(String.format(Locale<MASK><NEW_LINE>}<NEW_LINE>String outputFileName = fileName;<NEW_LINE>String dataPath = String.format("%s/%s", dir, outputFileName);<NEW_LINE>int i = 0;<NEW_LINE>while (pathTaken(outputUri, dataPath)) {<NEW_LINE>Log.d(TAG, "The content exists. Rename and check again.");<NEW_LINE>outputFileName = base + "-" + (++i) + "." + extension;<NEW_LINE>dataPath = String.format("%s/%s", dir, outputFileName);<NEW_LINE>}<NEW_LINE>contentValues.put(MediaStore.MediaColumns.DATA, dataPath);<NEW_LINE>}<NEW_LINE>return getContext().getContentResolver().insert(outputUri, contentValues);<NEW_LINE>} | .US, "Path for type: %s was not available", contentType)); |
414,551 | final GetDeploymentsResult executeGetDeployments(GetDeploymentsRequest getDeploymentsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDeploymentsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDeploymentsRequest> request = null;<NEW_LINE>Response<GetDeploymentsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDeploymentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDeploymentsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDeployments");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDeploymentsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDeploymentsResultJsonUnmarshaller());<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); |
712,654 | public void testPersistTaskWithNonSerializableResult(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>String taskName = "TaskWithNonSerializableResult-" + VNEXT;<NEW_LINE>NonSerializableResultTask task = new NonSerializableResultTask();<NEW_LINE>TaskStatus<ThreadGroup> status = executor.submit(task);<NEW_LINE>long taskId = status.getTaskId();<NEW_LINE>// wait for task to fail<NEW_LINE>for (long start = System.nanoTime(); !status.hasResult() && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(POLL_INTERVAL)) status = executor.getStatus(taskId);<NEW_LINE>if (!status.isDone())<NEW_LINE>throw new Exception("Task did not execute within allotted interval. " + status);<NEW_LINE>try {<NEW_LINE>ThreadGroup result = status.get();<NEW_LINE>throw new Exception("Unexpected result: " + result);<NEW_LINE>} catch (Exception x) {<NEW_LINE>if (!(x.getCause() instanceof NotSerializableException))<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>saveTaskEntry(executor, taskId, taskName);<NEW_LINE>} | throw new Exception("Unexpected failure. See cause.", x); |
1,133,122 | private void writeCFG(RecordArray mapping) throws IOException {<NEW_LINE>if (mapping == null) {<NEW_LINE>writeUnsignedNumber(0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>writeUnsignedNumber(mapping.size());<NEW_LINE>writeRle(mapping.cut(0));<NEW_LINE>IntegerArray sizes = new IntegerArray(1);<NEW_LINE>IntegerArray files = new IntegerArray(1);<NEW_LINE>IntegerArray lines = new IntegerArray(1);<NEW_LINE>int lastFile = 0;<NEW_LINE>int lastLine = 0;<NEW_LINE>for (int i = 0; i < mapping.size(); ++i) {<NEW_LINE>int type = mapping.get(i).get(0);<NEW_LINE>if (type == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int[] data = mapping.get(i).getArray(0);<NEW_LINE>sizes.add(data.length / 2);<NEW_LINE>for (int j = 0; j < data.length; j += 2) {<NEW_LINE>int file = data[j];<NEW_LINE>int line = data[j + 1];<NEW_LINE>files.add(convertToSigned(file - lastFile));<NEW_LINE>lines.add<MASK><NEW_LINE>lastFile = file;<NEW_LINE>lastLine = line;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writeRle(sizes.getAll());<NEW_LINE>writeRle(files.getAll());<NEW_LINE>writeRle(lines.getAll());<NEW_LINE>} | (convertToSigned(line - lastLine)); |
571,408 | public void onClick(View v) {<NEW_LINE>if (v.getTag() instanceof Boolean && (Boolean) v.getTag()) {<NEW_LINE>onColorSelected(ColorPickerDialog.this.color);<NEW_LINE>dismiss();<NEW_LINE>// already selected<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ColorPickerDialog.this.color = colorPanelView.getColor();<NEW_LINE>adapter.selectNone();<NEW_LINE>for (int i = 0; i < shadesLayout.getChildCount(); i++) {<NEW_LINE>FrameLayout layout = (FrameLayout) shadesLayout.getChildAt(i);<NEW_LINE>ColorPanelView cpv = (ColorPanelView) layout.<MASK><NEW_LINE>ImageView iv = (ImageView) layout.findViewById(R.id.cpv_color_image_view);<NEW_LINE>iv.setImageResource(cpv == v ? R.drawable.cpv_preset_checked : 0);<NEW_LINE>if (cpv == v && ColorUtils.calculateLuminance(cpv.getColor()) >= 0.65 || Color.alpha(cpv.getColor()) <= ALPHA_THRESHOLD) {<NEW_LINE>iv.setColorFilter(Color.BLACK, PorterDuff.Mode.SRC_IN);<NEW_LINE>} else {<NEW_LINE>iv.setColorFilter(null);<NEW_LINE>}<NEW_LINE>cpv.setTag(cpv == v);<NEW_LINE>}<NEW_LINE>} | findViewById(R.id.cpv_color_panel_view); |
201,415 | public StringAggState removeFromAggregatedState(RamAccounting ramAccounting, StringAggState previousAggState, Input[] stateToRemove) {<NEW_LINE>String expression = (String) stateToRemove[0].value();<NEW_LINE>if (expression == null) {<NEW_LINE>return previousAggState;<NEW_LINE>}<NEW_LINE>String delimiter = (String) stateToRemove[1].value();<NEW_LINE>int indexOfExpression = previousAggState.values.indexOf(expression);<NEW_LINE>if (indexOfExpression > -1) {<NEW_LINE>ramAccounting.addBytes(-LIST_ENTRY_OVERHEAD + StringSizeEstimator.estimate(expression));<NEW_LINE>if (delimiter != null) {<NEW_LINE>String elementNextToExpression = previousAggState.<MASK><NEW_LINE>if (elementNextToExpression.equalsIgnoreCase(delimiter)) {<NEW_LINE>previousAggState.values.remove(indexOfExpression + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>previousAggState.values.remove(indexOfExpression);<NEW_LINE>}<NEW_LINE>return previousAggState;<NEW_LINE>} | values.get(indexOfExpression + 1); |
934,075 | private void fillMinusHitsFromOneField(String fieldName, Set<Object> fieldValues, SearchHit someHit) {<NEW_LINE>List<SearchHit> minusHitsList = new ArrayList<>();<NEW_LINE>int currentId = 1;<NEW_LINE>for (Object result : fieldValues) {<NEW_LINE>Map<String, DocumentField> fields = new HashMap<>();<NEW_LINE>ArrayList<Object> values = new ArrayList<Object>();<NEW_LINE>values.add(result);<NEW_LINE>fields.put(fieldName, <MASK><NEW_LINE>SearchHit searchHit = new SearchHit(currentId, currentId + "", new Text(someHit.getType()), fields, null);<NEW_LINE>searchHit.sourceRef(someHit.getSourceRef());<NEW_LINE>searchHit.getSourceAsMap().clear();<NEW_LINE>Map<String, Object> sourceAsMap = new HashMap<>();<NEW_LINE>sourceAsMap.put(fieldName, result);<NEW_LINE>searchHit.getSourceAsMap().putAll(sourceAsMap);<NEW_LINE>currentId++;<NEW_LINE>minusHitsList.add(searchHit);<NEW_LINE>}<NEW_LINE>int totalSize = currentId - 1;<NEW_LINE>SearchHit[] unionHitsArr = minusHitsList.toArray(new SearchHit[totalSize]);<NEW_LINE>this.minusHits = new SearchHits(unionHitsArr, new TotalHits(totalSize, TotalHits.Relation.EQUAL_TO), 1.0f);<NEW_LINE>} | new DocumentField(fieldName, values)); |
707,342 | public DataRecord deserialize(final DataInput source, @NonNegative final long recordID, final SirixDeweyID deweyID, final PageReadOnlyTrx pageReadTrx) throws IOException {<NEW_LINE>final byte valueType = source.readByte();<NEW_LINE>final Number number;<NEW_LINE>switch(valueType) {<NEW_LINE>case 0:<NEW_LINE>number = source.readDouble();<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>number = source.readFloat();<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>number = source.readInt();<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>number = source.readLong();<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>number = deserializeBigInteger(source);<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>final BigInteger bigInt = deserializeBigInteger(source);<NEW_LINE>final int scale = source.readInt();<NEW_LINE>number = new BigDecimal(bigInt, scale);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new AssertionError("Type not known.");<NEW_LINE>}<NEW_LINE>// Node delegate.<NEW_LINE>final NodeDelegate nodeDel = deserializeNodeDelegate(<MASK><NEW_LINE>// Struct delegate.<NEW_LINE>final StructNodeDelegate structDel = deserializeStructDel(this, nodeDel, source, pageReadTrx.getResourceManager().getResourceConfig());<NEW_LINE>// Returning an instance.<NEW_LINE>return new NumberNode(number, structDel);<NEW_LINE>} | source, recordID, deweyID, pageReadTrx); |
1,098,552 | public static void allowNetworkPolicySettingsForEntityOperator(ExtensionContext extensionContext, String clusterName, String namespace) {<NEW_LINE>LabelSelector labelSelector = new LabelSelectorBuilder().addToMatchLabels(Constants.KAFKA_CLIENTS_LABEL_KEY, Constants.KAFKA_CLIENTS_LABEL_VALUE).build();<NEW_LINE>String eoDeploymentName = KafkaResources.entityOperatorDeploymentName(clusterName);<NEW_LINE>LOGGER.info("Apply NetworkPolicy access to {} from pods with LabelSelector {}", eoDeploymentName, labelSelector);<NEW_LINE>NetworkPolicy networkPolicy = NetworkPolicyTemplates.networkPolicyBuilder(namespace, eoDeploymentName, labelSelector).editSpec().editFirstIngress().addNewPort().withNewPort(Constants.TOPIC_OPERATOR_METRICS_PORT).withProtocol("TCP").endPort().addNewPort().withNewPort(Constants.USER_OPERATOR_METRICS_PORT).withProtocol("TCP").endPort().endIngress().withNewPodSelector().addToMatchLabels("strimzi.io/cluster", clusterName).addToMatchLabels("strimzi.io/kind", Kafka.RESOURCE_KIND).addToMatchLabels("strimzi.io/name", eoDeploymentName).endPodSelector().endSpec().build();<NEW_LINE>LOGGER.debug("Creating NetworkPolicy: {}", networkPolicy.toString());<NEW_LINE>ResourceManager.getInstance(<MASK><NEW_LINE>LOGGER.info("Network policy for LabelSelector {} successfully created", labelSelector);<NEW_LINE>} | ).createResource(extensionContext, networkPolicy); |
137,372 | private void send_to_port(ByteBuffer[] ev, EHandle sender) throws Pausable {<NEW_LINE>// Either send to port, or enqueue...:<NEW_LINE>EInternalPort port;<NEW_LINE>synchronized (this) {<NEW_LINE>// get port; enqueue if necessary<NEW_LINE>port = this.port;<NEW_LINE>if (port == null) {<NEW_LINE>// In queueing mode<NEW_LINE>assert (port_queue != null);<NEW_LINE>port_queue.addLast(ev);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// In direct-to-port mode<NEW_LINE>assert (port != null);<NEW_LINE><MASK><NEW_LINE>if (task != null) {<NEW_LINE>try {<NEW_LINE>task.outputv(null, ev);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>close_and_finish(port);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.warning("sending cast to dead task (port=" + port + ", this=" + this + ", sender=" + sender + ")");<NEW_LINE>}<NEW_LINE>} | EDriverTask task = port.task(); |
230,262 | private static Pair<ExprNode, ExprTableAccessNode> handleTableSubchain(List<ExprNode> tableKeys, List<Chainable> chain, TableMetaData table, Function<List<Chainable>, ExprDotNodeImpl> dotNodeFunction) {<NEW_LINE>if (chain.isEmpty()) {<NEW_LINE>ExprTableAccessNodeTopLevel node = new <MASK><NEW_LINE>node.addChildNodes(tableKeys);<NEW_LINE>return new Pair<>(node, node);<NEW_LINE>}<NEW_LINE>// We make an exception when the table is keyed and the column is found and there are no table keys provided.<NEW_LINE>// This accommodates the case "select MyTable.a from MyTable".<NEW_LINE>String columnOrOtherName = chain.get(0).getRootNameOrEmptyString();<NEW_LINE>TableMetadataColumn tableColumn = table.getColumns().get(columnOrOtherName);<NEW_LINE>if (tableColumn != null && table.isKeyed() && tableKeys.isEmpty()) {<NEW_LINE>// let this be resolved as an identifier<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (chain.size() == 1) {<NEW_LINE>if (chain.get(0) instanceof ChainableName) {<NEW_LINE>ExprTableAccessNodeSubprop node = new ExprTableAccessNodeSubprop(table.getTableName(), columnOrOtherName);<NEW_LINE>node.addChildNodes(tableKeys);<NEW_LINE>return new Pair<>(node, node);<NEW_LINE>}<NEW_LINE>if (columnOrOtherName.toLowerCase(Locale.ENGLISH).equals("keys")) {<NEW_LINE>ExprTableAccessNodeKeys node = new ExprTableAccessNodeKeys(table.getTableName());<NEW_LINE>node.addChildNodes(tableKeys);<NEW_LINE>return new Pair<>(node, node);<NEW_LINE>} else {<NEW_LINE>throw new ValidationException("Invalid use of table '" + table.getTableName() + "', unrecognized use of function '" + columnOrOtherName + "', expected 'keys()'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ExprTableAccessNodeSubprop node = new ExprTableAccessNodeSubprop(table.getTableName(), columnOrOtherName);<NEW_LINE>node.addChildNodes(tableKeys);<NEW_LINE>List<Chainable> subchain = chain.subList(1, chain.size());<NEW_LINE>ExprNode exprNode = dotNodeFunction.apply(subchain);<NEW_LINE>exprNode.addChildNode(node);<NEW_LINE>return new Pair<>(exprNode, node);<NEW_LINE>} | ExprTableAccessNodeTopLevel(table.getTableName()); |
1,092,838 | private void printErrorText(VirtualFrame frame, Object out, SyntaxErrData syntaxErrData) {<NEW_LINE>String text = castToString(objectStr(frame, syntaxErrData.text));<NEW_LINE>int offset = syntaxErrData.offset;<NEW_LINE>if (offset >= 0) {<NEW_LINE>if (offset > 0 && offset == text.length() && text.charAt(offset - 1) == '\n') {<NEW_LINE>offset--;<NEW_LINE>}<NEW_LINE>int nl;<NEW_LINE>while (true) {<NEW_LINE>nl = PythonUtils.lastIndexOf(text, '\n');<NEW_LINE>if (nl == -1 || nl >= offset) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>offset -= nl + 1;<NEW_LINE>text = PythonUtils.substring(text, nl + 1);<NEW_LINE>}<NEW_LINE>int idx = 0;<NEW_LINE>while (text.charAt(idx) == ' ' || text.charAt(idx) == '\t' || text.charAt(idx) == '\f') {<NEW_LINE>idx++;<NEW_LINE>offset--;<NEW_LINE>}<NEW_LINE>text = PythonUtils.substring(text, idx);<NEW_LINE>}<NEW_LINE>fileWriteString(frame, out, " ");<NEW_LINE>fileWriteString(frame, out, text);<NEW_LINE>if (text.charAt(0) == '\0' || text.charAt(text.length() - 1) != '\n') {<NEW_LINE>fileWriteString(frame, out, NEW_LINE);<NEW_LINE>}<NEW_LINE>if (offset == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>fileWriteString(frame, out, " ");<NEW_LINE>while (--offset > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>fileWriteString(frame, out, "^\n");<NEW_LINE>} | fileWriteString(frame, out, " "); |
1,321,022 | public static DescribeDcdnHttpsDomainListResponse unmarshall(DescribeDcdnHttpsDomainListResponse describeDcdnHttpsDomainListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDcdnHttpsDomainListResponse.setRequestId(_ctx.stringValue("DescribeDcdnHttpsDomainListResponse.RequestId"));<NEW_LINE>describeDcdnHttpsDomainListResponse.setTotalCount(_ctx.integerValue("DescribeDcdnHttpsDomainListResponse.TotalCount"));<NEW_LINE>List<CertInfo> certInfos = new ArrayList<CertInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDcdnHttpsDomainListResponse.CertInfos.Length"); i++) {<NEW_LINE>CertInfo certInfo = new CertInfo();<NEW_LINE>certInfo.setCertCommonName(_ctx.stringValue("DescribeDcdnHttpsDomainListResponse.CertInfos[" + i + "].CertCommonName"));<NEW_LINE>certInfo.setCertName(_ctx.stringValue("DescribeDcdnHttpsDomainListResponse.CertInfos[" + i + "].CertName"));<NEW_LINE>certInfo.setCertStartTime(_ctx.stringValue("DescribeDcdnHttpsDomainListResponse.CertInfos[" + i + "].CertStartTime"));<NEW_LINE>certInfo.setCertExpireTime(_ctx.stringValue("DescribeDcdnHttpsDomainListResponse.CertInfos[" + i + "].CertExpireTime"));<NEW_LINE>certInfo.setCertStatus(_ctx.stringValue<MASK><NEW_LINE>certInfo.setCertType(_ctx.stringValue("DescribeDcdnHttpsDomainListResponse.CertInfos[" + i + "].CertType"));<NEW_LINE>certInfo.setDomainName(_ctx.stringValue("DescribeDcdnHttpsDomainListResponse.CertInfos[" + i + "].DomainName"));<NEW_LINE>certInfo.setCertUpdateTime(_ctx.stringValue("DescribeDcdnHttpsDomainListResponse.CertInfos[" + i + "].CertUpdateTime"));<NEW_LINE>certInfos.add(certInfo);<NEW_LINE>}<NEW_LINE>describeDcdnHttpsDomainListResponse.setCertInfos(certInfos);<NEW_LINE>return describeDcdnHttpsDomainListResponse;<NEW_LINE>} | ("DescribeDcdnHttpsDomainListResponse.CertInfos[" + i + "].CertStatus")); |
1,524,504 | private void propagateRelationships(HeadChordInter... pair) {<NEW_LINE>Set<AbstractChordInter> stdChords = measure.getStandardChords();<NEW_LINE>stdChords.removeAll(Arrays.asList(pair));<NEW_LINE>for (AbstractChordInter ch : stdChords) {<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>HeadChordInter one = pair[i];<NEW_LINE>HeadChordInter two = pair[(i + 1) % 2];<NEW_LINE>Rel rel;<NEW_LINE>rel = getRel(ch, one);<NEW_LINE>if ((rel != null) && (getRel(ch, two) == null)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>rel = getRel(one, ch);<NEW_LINE>if ((rel != null) && (getRel(two, ch) == null)) {<NEW_LINE>setRel(two, ch, rel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setRel(ch, two, rel); |
595,294 | public void initialize() {<NEW_LINE>keyEventEventHandler = event -> {<NEW_LINE>if (Utilities.isCtrlShiftPressed(KeyCode.L, event)) {<NEW_LINE>accountAgeWitnessService.getAccountAgeWitnessUtils().logSignedWitnesses();<NEW_LINE>} else if (Utilities.isCtrlShiftPressed(KeyCode.S, event)) {<NEW_LINE>accountAgeWitnessService.getAccountAgeWitnessUtils().logSigners();<NEW_LINE>} else if (Utilities.isCtrlShiftPressed(KeyCode.U, event)) {<NEW_LINE>accountAgeWitnessService<MASK><NEW_LINE>} else if (Utilities.isCtrlShiftPressed(KeyCode.C, event)) {<NEW_LINE>copyAccount();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>buildForm();<NEW_LINE>paymentAccountChangeListener = (observable, oldValue, newValue) -> {<NEW_LINE>if (newValue != null)<NEW_LINE>onSelectAccount(oldValue, newValue);<NEW_LINE>};<NEW_LINE>Label placeholder = new AutoTooltipLabel(Res.get("shared.noAccountsSetupYet"));<NEW_LINE>placeholder.setWrapText(true);<NEW_LINE>paymentAccountsListView.setPlaceholder(placeholder);<NEW_LINE>} | .getAccountAgeWitnessUtils().logUnsignedSignerPubKeys(); |
587,166 | protected void updateBeforeRender() {<NEW_LINE>super.updateBeforeRender();<NEW_LINE>// Update the dialog title with an ETA if possible<NEW_LINE>Component title = this.getGuiDisplayName(<MASK><NEW_LINE>if (status != null) {<NEW_LINE>final long elapsedTime = status.getElapsedTime();<NEW_LINE>final double remainingItems = status.getRemainingItemCount();<NEW_LINE>final double startItems = status.getStartItemCount();<NEW_LINE>final long eta = (long) (elapsedTime / Math.max(1d, startItems - remainingItems) * remainingItems);<NEW_LINE>if (eta > 0 && !getVisualEntries().isEmpty()) {<NEW_LINE>final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert(eta, TimeUnit.NANOSECONDS);<NEW_LINE>final String etaTimeText = DurationFormatUtils.formatDuration(etaInMilliseconds, GuiText.ETAFormat.getLocal());<NEW_LINE>title = title.copy().append(" - " + etaTimeText);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setTextContent(TEXT_ID_DIALOG_TITLE, title);<NEW_LINE>final int size = this.status != null ? this.status.getEntries().size() : 0;<NEW_LINE>scrollbar.setRange(0, CraftingStatusTableRenderer.getScrollableRows(size), 1);<NEW_LINE>this.schedulingModeButton.set(this.menu.getSchedulingMode());<NEW_LINE>} | GuiText.CraftingStatus.text()); |
849,899 | private LexerAction createLexerAction(GrammarAST ID, GrammarAST arg) {<NEW_LINE><MASK><NEW_LINE>checkCommands(command, ID.getToken());<NEW_LINE>if ("skip".equals(command) && arg == null) {<NEW_LINE>return LexerSkipAction.INSTANCE;<NEW_LINE>} else if ("more".equals(command) && arg == null) {<NEW_LINE>return LexerMoreAction.INSTANCE;<NEW_LINE>} else if ("popMode".equals(command) && arg == null) {<NEW_LINE>return LexerPopModeAction.INSTANCE;<NEW_LINE>} else if ("mode".equals(command) && arg != null) {<NEW_LINE>String modeName = arg.getText();<NEW_LINE>Integer mode = getModeConstantValue(modeName, arg.getToken());<NEW_LINE>if (mode == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new LexerModeAction(mode);<NEW_LINE>} else if ("pushMode".equals(command) && arg != null) {<NEW_LINE>String modeName = arg.getText();<NEW_LINE>Integer mode = getModeConstantValue(modeName, arg.getToken());<NEW_LINE>if (mode == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new LexerPushModeAction(mode);<NEW_LINE>} else if ("type".equals(command) && arg != null) {<NEW_LINE>String typeName = arg.getText();<NEW_LINE>Integer type = getTokenConstantValue(typeName, arg.getToken());<NEW_LINE>if (type == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new LexerTypeAction(type);<NEW_LINE>} else if ("channel".equals(command) && arg != null) {<NEW_LINE>String channelName = arg.getText();<NEW_LINE>Integer channel = getChannelConstantValue(channelName, arg.getToken());<NEW_LINE>if (channel == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new LexerChannelAction(channel);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | String command = ID.getText(); |
571,491 | public void run(ApplicationArguments args) throws Exception {<NEW_LINE>if (args.containsOption("import")) {<NEW_LINE>if (!args.containsOption("collection"))<NEW_LINE>throw new IllegalArgumentException("required option: --collection with collection name when using --import");<NEW_LINE>String collection = args.getOptionValues("collection").get(0);<NEW_LINE>List<String> sources = args.getOptionValues("import");<NEW_LINE>for (String source : sources) {<NEW_LINE>List<String> jsonLines = new ArrayList<>();<NEW_LINE>if (source.startsWith(RESOURCE_PREFIX)) {<NEW_LINE>String resource = source.substring(RESOURCE_PREFIX.length());<NEW_LINE>jsonLines = ImportUtils.linesFromResource(resource);<NEW_LINE>} else {<NEW_LINE>jsonLines = ImportUtils.lines(new File(source));<NEW_LINE>}<NEW_LINE>if (jsonLines == null || jsonLines.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// ImportJsonService importService = context.getBean(ImportJsonService.class);<NEW_LINE>String result = importService.importTo(collection, jsonLines);<NEW_LINE>log.info(source + " - import result: " + result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | log.warn(source + " - no input to import"); |
462,867 | protected Object peekAtInfo(IJavaElement element) {<NEW_LINE>switch(element.getElementType()) {<NEW_LINE>case IJavaElement.JAVA_MODEL:<NEW_LINE>return this.modelInfo;<NEW_LINE>case IJavaElement.JAVA_PROJECT:<NEW_LINE>return this.projectCache.get(element);<NEW_LINE>case IJavaElement.PACKAGE_FRAGMENT_ROOT:<NEW_LINE>return this.rootCache.peek((IPackageFragmentRoot) element);<NEW_LINE>case IJavaElement.PACKAGE_FRAGMENT:<NEW_LINE>return this.pkgCache.peek((IPackageFragment) element);<NEW_LINE>case IJavaElement.COMPILATION_UNIT:<NEW_LINE>case IJavaElement.CLASS_FILE:<NEW_LINE>return this.openableCache.peek((ITypeRoot) element);<NEW_LINE>case IJavaElement.TYPE:<NEW_LINE>Object result = this.jarTypeCache.peek(element);<NEW_LINE>if (result != null)<NEW_LINE>return result;<NEW_LINE>else<NEW_LINE>return <MASK><NEW_LINE>default:<NEW_LINE>return this.childrenCache.get(element);<NEW_LINE>}<NEW_LINE>} | this.childrenCache.get(element); |
1,117,322 | public Object calculate(Context ctx) {<NEW_LINE>if (left == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("\"\\=\"" + mm.getMessage("operator.missingLeftOperation"));<NEW_LINE>}<NEW_LINE>if (right == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("\"\\=\"" + mm.getMessage("operator.missingRightOperation"));<NEW_LINE>}<NEW_LINE>Object o1 = left.calculate(ctx);<NEW_LINE>Object o2 = right.calculate(ctx);<NEW_LINE>Object result = null;<NEW_LINE>if (o1 == null) {<NEW_LINE>if (o2 != null && !(o2 instanceof Sequence) && !(o2 instanceof Number)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("\"\\\"" <MASK><NEW_LINE>}<NEW_LINE>} else if (o1 instanceof Sequence) {<NEW_LINE>if (o2 == null) {<NEW_LINE>result = o1;<NEW_LINE>} else {<NEW_LINE>if (o2 instanceof Sequence) {<NEW_LINE>result = ((Sequence) o1).diff((Sequence) o2, false);<NEW_LINE>} else {<NEW_LINE>Sequence s2 = new Sequence(1);<NEW_LINE>s2.add(o2);<NEW_LINE>result = ((Sequence) o1).diff(s2, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result = Variant.intDivide(o1, o2);<NEW_LINE>}<NEW_LINE>return left.assign(result, ctx);<NEW_LINE>} | + mm.getMessage("function.paramTypeError")); |
245,751 | private void generateSimpleSetterMethodForBuilder(BuilderJob job, boolean deprecate, EclipseNode fieldNode, char[] paramName, char[] nameOfSetFlag, TypeReference returnType, Statement returnStatement, Annotation[] annosOnParam, EclipseNode originalFieldNode, String setterPrefix) {<NEW_LINE>TypeDeclaration td = (TypeDeclaration) job.builderType.get();<NEW_LINE>AbstractMethodDeclaration[] existing = td.methods;<NEW_LINE>if (existing == null)<NEW_LINE>existing = EMPTY_METHODS;<NEW_LINE>int len = existing.length;<NEW_LINE>String setterName = HandlerUtil.buildAccessorName(job.sourceNode, setterPrefix, new String(paramName));<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>if (!(existing[i] instanceof MethodDeclaration))<NEW_LINE>continue;<NEW_LINE>char[] <MASK><NEW_LINE>if (Arrays.equals(setterName.toCharArray(), existingName) && !isTolerate(fieldNode, existing[i]))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Annotation> methodAnnsList = Arrays.asList(EclipseHandlerUtil.findCopyableToSetterAnnotations(originalFieldNode));<NEW_LINE>addCheckerFrameworkReturnsReceiver(returnType, job.source, job.checkerFramework);<NEW_LINE>MethodDeclaration setter = HandleSetter.createSetter(td, deprecate, fieldNode, setterName, paramName, nameOfSetFlag, returnType, returnStatement, ClassFileConstants.AccPublic, job.sourceNode, methodAnnsList, annosOnParam != null ? Arrays.asList(copyAnnotations(job.source, annosOnParam)) : Collections.<Annotation>emptyList());<NEW_LINE>injectMethod(job.builderType, setter);<NEW_LINE>} | existingName = existing[i].selector; |
1,453,359 | private void processOpenFileQueue() {<NEW_LINE>// no work to do<NEW_LINE>if (openFileQueue_.isEmpty())<NEW_LINE>return;<NEW_LINE>// find the first work unit<NEW_LINE>final OpenFileEntry entry = openFileQueue_.peek();<NEW_LINE>// define command to advance queue<NEW_LINE>final Command processNextEntry = new Command() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute() {<NEW_LINE>openFileQueue_.remove();<NEW_LINE>if (!openFileQueue_.isEmpty())<NEW_LINE>processOpenFileQueue();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>openFile(entry.file, entry.fileType, entry.targetColumn, new ResultCallback<EditingTarget, ServerError>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(EditingTarget target) {<NEW_LINE>processNextEntry.execute();<NEW_LINE>if (entry.executeOnSuccess != null)<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCancelled() {<NEW_LINE>super.onCancelled();<NEW_LINE>processNextEntry.execute();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(ServerError error) {<NEW_LINE>String message = error.getUserMessage();<NEW_LINE>// see if a special message was provided<NEW_LINE>JSONValue errValue = error.getClientInfo();<NEW_LINE>if (errValue != null) {<NEW_LINE>JSONString errMsg = errValue.isString();<NEW_LINE>if (errMsg != null)<NEW_LINE>message = errMsg.stringValue();<NEW_LINE>}<NEW_LINE>globalDisplay_.showMessage(GlobalDisplay.MSG_ERROR, constants_.errorWhileOpeningFile(), message);<NEW_LINE>processNextEntry.execute();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | entry.executeOnSuccess.execute(target); |
555,050 | public static void loadNativeLibrary(@NonNull Context context, @NonNull String library, @NonNull String libraryVersion) {<NEW_LINE>try {<NEW_LINE>ReLinker.loadLibrary(context, library, libraryVersion);<NEW_LINE>} catch (MissingLibraryException e) {<NEW_LINE>Log.e(TAG, "******** Failed relink native library " + library + " ********");<NEW_LINE>Log.e(TAG, <MASK><NEW_LINE>Log.e(TAG, "******** Failed relink native library " + library + " ********");<NEW_LINE>fallbackLoading(library);<NEW_LINE>} catch (UnsatisfiedLinkError ule) {<NEW_LINE>Log.e(TAG, "******** Could not load native library " + library + " ********");<NEW_LINE>Log.e(TAG, "******** Could not load native library " + library + " ********", ule);<NEW_LINE>Log.e(TAG, "******** Could not load native library " + library + " ********");<NEW_LINE>fallbackLoading(library);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>Log.e(TAG, "******** Failed to load native library " + library + " ********");<NEW_LINE>Log.e(TAG, "******** Failed to load native library " + library + " ********", t);<NEW_LINE>Log.e(TAG, "******** Failed to load native library " + library + " ********");<NEW_LINE>fallbackLoading(library);<NEW_LINE>}<NEW_LINE>} | "******** Failed relink native library " + library + " ********", e); |
267,042 | private static String createIdFieldInitialization(String idPropertyType, String valueVar) {<NEW_LINE>String idField;<NEW_LINE>// PENDING cannot assume that key type is Integer, Long, String, int or long<NEW_LINE>if ("char".equals(idPropertyType)) {<NEW_LINE>idField = valueVar + ".charAt(0);";<NEW_LINE>} else if (PRIMITIVE_TYPES.containsKey(idPropertyType)) {<NEW_LINE>String objectType = PRIMITIVE_TYPES.get(idPropertyType);<NEW_LINE>String methodName = "parse" + idPropertyType.substring(0, 1).toUpperCase() + idPropertyType.substring(1);<NEW_LINE>idField = objectType + "." <MASK><NEW_LINE>} else if (idPropertyType.equals("java.math.BigInteger") || "BigInteger".equals(idPropertyType)) {<NEW_LINE>idField = "new java.math.BigInteger(" + valueVar + ")";<NEW_LINE>} else if (idPropertyType.equals("java.math.BigDecimal") || "BigDecimal".equals(idPropertyType)) {<NEW_LINE>idField = "new java.math.BigDecimal(" + valueVar + ")";<NEW_LINE>} else if (idPropertyType.equals("java.lang.String") || "String".equals(idPropertyType)) {<NEW_LINE>idField = valueVar;<NEW_LINE>} else if (idPropertyType.equals("java.lang.Character") || "Character".equals(idPropertyType)) {<NEW_LINE>idField = "new Character(" + valueVar + ".charAt(0))";<NEW_LINE>} else if (idPropertyType.startsWith("java.lang.")) {<NEW_LINE>String shortName = idPropertyType.substring(10);<NEW_LINE>idField = "new " + shortName + "(" + valueVar + ")";<NEW_LINE>} else if (CONVERTED_TYPES.contains(idPropertyType)) {<NEW_LINE>idField = "new " + idPropertyType + "(" + valueVar + ")";<NEW_LINE>} else {<NEW_LINE>idField = "(" + idPropertyType + ") javax.faces.context.FacesContext.getCurrentInstance().getApplication().\n" + "createConverter(" + idPropertyType + ".class).getAsObject(FacesContext.\n" + "getCurrentInstance(), null, " + valueVar + ")";<NEW_LINE>}<NEW_LINE>return idField;<NEW_LINE>} | + methodName + "(" + valueVar + ")"; |
1,771,650 | public Map<String, String> tableOptions() {<NEW_LINE>Map<String, String> map = super.tableOptions();<NEW_LINE>map.put("connector", "hive");<NEW_LINE>map.put("default-database", database);<NEW_LINE>if (null != hiveVersion) {<NEW_LINE>map.put("hive-version", hiveVersion);<NEW_LINE>}<NEW_LINE>if (null != hadoopConfDir) {<NEW_LINE>map.put("hadoop-conf-dir", hadoopConfDir);<NEW_LINE>}<NEW_LINE>if (null != hiveConfDir) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (null != partitionFields) {<NEW_LINE>Map<String, String> properties = super.getProperties();<NEW_LINE>if (null == properties || !properties.containsKey(trigger)) {<NEW_LINE>map.put(trigger, "process-time");<NEW_LINE>}<NEW_LINE>if (null == properties || !properties.containsKey(timestampPattern)) {<NEW_LINE>map.put(timestampPattern, "yyyy-MM-dd");<NEW_LINE>}<NEW_LINE>if (null == properties || !properties.containsKey(delay)) {<NEW_LINE>map.put(delay, "10s");<NEW_LINE>}<NEW_LINE>if (null == properties || !properties.containsKey(policyKind)) {<NEW_LINE>map.put(policyKind, "metastore,success-file");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} | map.put("hive-conf-dir", hiveConfDir); |
1,671,832 | // Must already have started a transaction<NEW_LINE>protected void writeDown(Trace trace, long snap, TraceThread thread, int frame) {<NEW_LINE>if (space.isUniqueSpace()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>byte[] data = new byte[4096];<NEW_LINE>ByteBuffer <MASK><NEW_LINE>TraceMemorySpace mem = TraceSleighUtils.getSpaceForExecution(space, trace, thread, frame, true);<NEW_LINE>for (Range<UnsignedLong> range : written.asRanges()) {<NEW_LINE>assert range.lowerBoundType() == BoundType.CLOSED;<NEW_LINE>assert range.upperBoundType() == BoundType.OPEN;<NEW_LINE>long lower = range.lowerEndpoint().longValue();<NEW_LINE>long fullLen = range.upperEndpoint().longValue() - lower;<NEW_LINE>while (fullLen > 0) {<NEW_LINE>int len = MathUtilities.unsignedMin(data.length, fullLen);<NEW_LINE>cache.getData(lower, data, 0, len);<NEW_LINE>buf.position(0);<NEW_LINE>buf.limit(len);<NEW_LINE>mem.putBytes(snap, space.getAddress(lower), buf);<NEW_LINE>lower += len;<NEW_LINE>fullLen -= len;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | buf = ByteBuffer.wrap(data); |
55,286 | public void runTask() throws RocksDBException {<NEW_LINE>if (numEntries_ != DbBenchmark.this.num_) {<NEW_LINE>stats_.message_.append(String.format(" (%d ops)", numEntries_));<NEW_LINE>}<NEW_LINE>byte[] key = new byte[keySize_];<NEW_LINE>byte[] value = new byte[valueSize_];<NEW_LINE>try {<NEW_LINE>if (entriesPerBatch_ == 1) {<NEW_LINE>for (long i = 0; i < numEntries_; ++i) {<NEW_LINE>getKey(key, i, keyRange_);<NEW_LINE>DbBenchmark.<MASK><NEW_LINE>db_.put(writeOpt_, key, value);<NEW_LINE>stats_.finishedSingleOp(keySize_ + valueSize_);<NEW_LINE>writeRateControl(i);<NEW_LINE>if (isFinished()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (long i = 0; i < numEntries_; i += entriesPerBatch_) {<NEW_LINE>WriteBatch batch = new WriteBatch();<NEW_LINE>for (long j = 0; j < entriesPerBatch_; j++) {<NEW_LINE>getKey(key, i + j, keyRange_);<NEW_LINE>DbBenchmark.this.gen_.generate(value);<NEW_LINE>batch.put(key, value);<NEW_LINE>stats_.finishedSingleOp(keySize_ + valueSize_);<NEW_LINE>}<NEW_LINE>db_.write(writeOpt_, batch);<NEW_LINE>batch.dispose();<NEW_LINE>writeRateControl(i);<NEW_LINE>if (isFinished()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// thread has been terminated.<NEW_LINE>}<NEW_LINE>} | this.gen_.generate(value); |
58,630 | protected Map<KafkaTopicPartition, Long> fetchOffsetsWithTimestamp(Collection<KafkaTopicPartition> partitions, long timestamp) {<NEW_LINE>Map<TopicPartition, Long> partitionOffsetsRequest = new HashMap<>(partitions.size());<NEW_LINE>for (KafkaTopicPartition partition : partitions) {<NEW_LINE>partitionOffsetsRequest.put(new TopicPartition(partition.getTopic(), partition.getPartition()), timestamp);<NEW_LINE>}<NEW_LINE>final Map<KafkaTopicPartition, Long> result = new HashMap<<MASK><NEW_LINE>// use a short-lived consumer to fetch the offsets;<NEW_LINE>// this is ok because this is a one-time operation that happens only on startup<NEW_LINE>try (KafkaConsumer<?, ?> consumer = new KafkaConsumer(properties)) {<NEW_LINE>for (Map.Entry<TopicPartition, OffsetAndTimestamp> partitionToOffset : consumer.offsetsForTimes(partitionOffsetsRequest).entrySet()) {<NEW_LINE>result.put(new KafkaTopicPartition(partitionToOffset.getKey().topic(), partitionToOffset.getKey().partition()), (partitionToOffset.getValue() == null) ? null : partitionToOffset.getValue().offset());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | >(partitions.size()); |
1,177,631 | public void marshall(DataRepositoryTask dataRepositoryTask, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (dataRepositoryTask == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getTaskId(), TASKID_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getLifecycle(), LIFECYCLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getStartTime(), STARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getEndTime(), ENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getResourceARN(), RESOURCEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getFileSystemId(), FILESYSTEMID_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getPaths(), PATHS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getFailureDetails(), FAILUREDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataRepositoryTask.getReport(), REPORT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | dataRepositoryTask.getCreationTime(), CREATIONTIME_BINDING); |
1,636,443 | protected void onFinishInflate() {<NEW_LINE>super.onFinishInflate();<NEW_LINE>inflate(getContext(), R.layout.message_request_bottom_bar, this);<NEW_LINE>question = findViewById(R.id.message_request_question);<NEW_LINE>accept = findViewById(R.id.message_request_accept);<NEW_LINE>block = findViewById(R.id.message_request_block);<NEW_LINE>delete = findViewById(R.id.message_request_delete);<NEW_LINE>bigDelete = findViewById(R.id.message_request_big_delete);<NEW_LINE>bigUnblock = findViewById(R.id.message_request_big_unblock);<NEW_LINE>gv1Continue = findViewById(R.id.message_request_gv1_migration);<NEW_LINE>normalButtons = findViewById(R.id.message_request_normal_buttons);<NEW_LINE>blockedButtons = <MASK><NEW_LINE>gv1MigrationButtons = findViewById(R.id.message_request_gv1_migration_buttons);<NEW_LINE>busyIndicator = findViewById(R.id.message_request_busy_indicator);<NEW_LINE>} | findViewById(R.id.message_request_blocked_buttons); |
1,524,173 | private static List<Path> searchJavaHomeInDir(Path dir) throws IOException {<NEW_LINE>final List<Path> <MASK><NEW_LINE>final boolean jdk = isJDK(dir);<NEW_LINE>if (isJavaHome(dir))<NEW_LINE>homes.add(dir.toAbsolutePath());<NEW_LINE>try (DirectoryStream<Path> fs = Files.newDirectoryStream(dir)) {<NEW_LINE>for (Path f : fs) {<NEW_LINE>if (Files.isDirectory(f)) {<NEW_LINE>if (isJavaHome(f))<NEW_LINE>homes.add(f.toAbsolutePath());<NEW_LINE>if (homes.size() >= 2 || (homes.size() >= 1 && !(jdk || isJDK(f))))<NEW_LINE>break;<NEW_LINE>final List<Path> rec = searchJavaHomeInDir(f);<NEW_LINE>if (rec != null)<NEW_LINE>homes.addAll(rec);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return homes;<NEW_LINE>} | homes = new ArrayList<>(); |
902,076 | protected void doWork() {<NEW_LINE>if (isProcessRunning) {<NEW_LINE>// process is already started successfully!<NEW_LINE>} else {<NEW_LINE>// process is not started!<NEW_LINE>m_summary = new StringBuffer();<NEW_LINE>String trxName = mImportProcessor.get_TrxName();<NEW_LINE>if (trxName == null || "".equals(trxName)) {<NEW_LINE>// trxName = "ImportProcessor-" + System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>log.fine("trxName = " + trxName);<NEW_LINE>log.fine("ImportProcessor = " + mImportProcessor);<NEW_LINE>int IMP_ProcessorType_ID = 0;<NEW_LINE>IMP_ProcessorType_ID = mImportProcessor.getIMP_Processor_Type_ID();<NEW_LINE>X_IMP_Processor_Type impProcessor_Type = new X_IMP_Processor_Type(mImportProcessor.getCtx(), IMP_ProcessorType_ID, trxName);<NEW_LINE>// TODO --- REMOVE<NEW_LINE>log.fine("impProcessor_Type = " + impProcessor_Type);<NEW_LINE>String javaClass = impProcessor_Type.getJavaClass();<NEW_LINE>IImportProcessor importProcessor = null;<NEW_LINE>try {<NEW_LINE>Class clazz = Class.forName(javaClass);<NEW_LINE>importProcessor = (IImportProcessor) clazz.newInstance();<NEW_LINE>importProcessor.process(mImportProcessor.getCtx(), this, trxName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>isProcessRunning = false;<NEW_LINE>log.fine("ReplicationProcessor caught an exception !!!");<NEW_LINE>e.printStackTrace();<NEW_LINE>log.severe(e.getMessage());<NEW_LINE>MIMPProcessorLog processorLog = new MIMPProcessorLog(mImportProcessor, e.getMessage(), trxName);<NEW_LINE>processorLog.setReference("#" + String.valueOf(p_runCount) + " - " + TimeUtil.formatElapsed(new Timestamp(p_startWork)));<NEW_LINE>processorLog.saveEx();<NEW_LINE>try {<NEW_LINE>importProcessor.stop();<NEW_LINE>} catch (Exception e1) {<NEW_LINE>e1.printStackTrace();<NEW_LINE>MIMPProcessorLog pLog2 = new MIMPProcessorLog(mImportProcessor, e1.getMessage(), trxName);<NEW_LINE>pLog2.saveEx();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE><MASK><NEW_LINE>m_summary.append("Logs Records deleted=").append(no).append("; ");<NEW_LINE>//<NEW_LINE>MIMPProcessorLog processorLog = new MIMPProcessorLog(mImportProcessor, m_summary.toString(), trxName);<NEW_LINE>processorLog.setReference("#" + p_runCount + " - " + TimeUtil.formatElapsed(new Timestamp(p_startWork)));<NEW_LINE>processorLog.saveEx();<NEW_LINE>}<NEW_LINE>} | int no = mImportProcessor.deleteLog(); |
406,085 | public Pair<Boolean, byte[]> execute(byte[] data) {<NEW_LINE>if (data == null) {<NEW_LINE>return Pair.of(true, DataWord.ZERO().getData());<NEW_LINE>}<NEW_LINE>if (data.length != SIZE) {<NEW_LINE>return Pair.of(true, DataWord.ZERO().getData());<NEW_LINE>}<NEW_LINE>boolean result;<NEW_LINE>long ctx = JLibrustzcash.librustzcashSaplingVerificationCtxInit();<NEW_LINE>try {<NEW_LINE>byte[] nullifier = new byte[32];<NEW_LINE>byte[] anchor = new byte[32];<NEW_LINE>byte[] cv = new byte[32];<NEW_LINE>byte[] rk = new byte[32];<NEW_LINE>byte[] proof = new byte[192];<NEW_LINE>byte[] spendAuthSig = new byte[64];<NEW_LINE>byte[] bindingSig = new byte[64];<NEW_LINE>byte[] signHash = new byte[32];<NEW_LINE>// spend<NEW_LINE>System.arraycopy(data, <MASK><NEW_LINE>System.arraycopy(data, 32, anchor, 0, 32);<NEW_LINE>System.arraycopy(data, 64, cv, 0, 32);<NEW_LINE>System.arraycopy(data, 96, rk, 0, 32);<NEW_LINE>System.arraycopy(data, 128, proof, 0, 192);<NEW_LINE>System.arraycopy(data, 320, spendAuthSig, 0, 64);<NEW_LINE>long value = parseLong(data, 384);<NEW_LINE>System.arraycopy(data, 416, bindingSig, 0, 64);<NEW_LINE>System.arraycopy(data, 480, signHash, 0, 32);<NEW_LINE>result = JLibrustzcash.librustzcashSaplingCheckSpend(new LibrustzcashParam.CheckSpendParams(ctx, cv, anchor, nullifier, rk, proof, spendAuthSig, signHash));<NEW_LINE>result = result && JLibrustzcash.librustzcashSaplingFinalCheck(new LibrustzcashParam.FinalCheckParams(ctx, value, bindingSig, signHash));<NEW_LINE>} catch (Throwable any) {<NEW_LINE>result = false;<NEW_LINE>String errorMsg = any.getMessage();<NEW_LINE>if (errorMsg == null && any.getCause() != null) {<NEW_LINE>errorMsg = any.getCause().getMessage();<NEW_LINE>}<NEW_LINE>logger.info("VerifyBurnProof exception " + errorMsg);<NEW_LINE>} finally {<NEW_LINE>JLibrustzcash.librustzcashSaplingVerificationCtxFree(ctx);<NEW_LINE>}<NEW_LINE>return Pair.of(true, dataBoolean(result));<NEW_LINE>} | 0, nullifier, 0, 32); |
882,127 | public boolean compress() {<NEW_LINE>if (!palette.compress()) {<NEW_LINE>if (blockLight != null) {<NEW_LINE>byte[] arr1 = blockLight;<NEW_LINE>hasBlockLight <MASK><NEW_LINE>byte[] arr2;<NEW_LINE>if (skyLight != null) {<NEW_LINE>arr2 = skyLight;<NEW_LINE>hasSkyLight = !Utils.isByteArrayEmpty(skyLight);<NEW_LINE>} else {<NEW_LINE>arr2 = EmptyChunkSection.EMPTY_LIGHT_ARR;<NEW_LINE>hasSkyLight = false;<NEW_LINE>}<NEW_LINE>blockLight = null;<NEW_LINE>skyLight = null;<NEW_LINE>if (hasBlockLight && hasSkyLight) {<NEW_LINE>try {<NEW_LINE>compressedLight = Zlib.deflate(Binary.appendBytes(arr1, arr2), 1);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | = !Utils.isByteArrayEmpty(arr1); |
932,643 | public static byte[] computeSharedSecret(NamedGroup group, BigInteger privateKey, byte[] publicKey) {<NEW_LINE>switch(group) {<NEW_LINE>case ECDH_X25519:<NEW_LINE>return ForgivingX25519Curve.computeSharedSecret(privateKey, publicKey);<NEW_LINE>case ECDH_X448:<NEW_LINE>return ForgivingX448Curve.computeSharedSecret(privateKey, publicKey);<NEW_LINE>case SECP160K1:<NEW_LINE>case SECP160R1:<NEW_LINE>case SECP160R2:<NEW_LINE>case SECP192K1:<NEW_LINE>case SECP192R1:<NEW_LINE>case SECP224K1:<NEW_LINE>case SECP224R1:<NEW_LINE>case SECP256K1:<NEW_LINE>case SECP256R1:<NEW_LINE>case SECP384R1:<NEW_LINE>case SECP521R1:<NEW_LINE>case SECT163K1:<NEW_LINE>case SECT163R1:<NEW_LINE>case SECT163R2:<NEW_LINE>case SECT193R1:<NEW_LINE>case SECT193R2:<NEW_LINE>case SECT233K1:<NEW_LINE>case SECT233R1:<NEW_LINE>case SECT239K1:<NEW_LINE>case SECT283K1:<NEW_LINE>case SECT283R1:<NEW_LINE>case SECT409K1:<NEW_LINE>case SECT409R1:<NEW_LINE>case SECT571K1:<NEW_LINE>case SECT571R1:<NEW_LINE>EllipticCurve curve = CurveFactory.getCurve(group);<NEW_LINE>Point publicPoint = PointFormatter.formatFromByteArray(group, publicKey);<NEW_LINE>Point sharedPoint = curve.mult(privateKey, publicPoint);<NEW_LINE>int elementLength = ArrayConverter.bigIntegerToByteArray(sharedPoint.getFieldX().getModulus()).length;<NEW_LINE>return ArrayConverter.bigIntegerToNullPaddedByteArray(sharedPoint.getFieldX(<MASK><NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("KeyShare type " + group + " is unsupported");<NEW_LINE>}<NEW_LINE>} | ).getData(), elementLength); |
1,718,413 | public TransitGatewayMulticastDomainAssociation unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>TransitGatewayMulticastDomainAssociation transitGatewayMulticastDomainAssociation = new TransitGatewayMulticastDomainAssociation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return transitGatewayMulticastDomainAssociation;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("transitGatewayAttachmentId", targetDepth)) {<NEW_LINE>transitGatewayMulticastDomainAssociation.setTransitGatewayAttachmentId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("resourceId", targetDepth)) {<NEW_LINE>transitGatewayMulticastDomainAssociation.setResourceId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("resourceType", targetDepth)) {<NEW_LINE>transitGatewayMulticastDomainAssociation.setResourceType(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("resourceOwnerId", targetDepth)) {<NEW_LINE>transitGatewayMulticastDomainAssociation.setResourceOwnerId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("subnet", targetDepth)) {<NEW_LINE>transitGatewayMulticastDomainAssociation.setSubnet(SubnetAssociationStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return transitGatewayMulticastDomainAssociation;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
399,166 | public Observable<ServiceResponseWithHeaders<Page<CloudJob>, JobListHeaders>> listSinglePageAsync() {<NEW_LINE>if (this.client.batchUrl() == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter this.client.batchUrl() is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (this.client.apiVersion() == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");<NEW_LINE>}<NEW_LINE>final JobListOptions jobListOptions = null;<NEW_LINE>String filter = null;<NEW_LINE>String select = null;<NEW_LINE>String expand = null;<NEW_LINE>Integer maxResults = null;<NEW_LINE>Integer timeout = null;<NEW_LINE>UUID clientRequestId = null;<NEW_LINE>Boolean returnClientRequestId = null;<NEW_LINE>DateTime ocpDate = null;<NEW_LINE>String parameterizedHost = Joiner.on(", ").join("{batchUrl}", <MASK><NEW_LINE>DateTimeRfc1123 ocpDateConverted = null;<NEW_LINE>if (ocpDate != null) {<NEW_LINE>ocpDateConverted = new DateTimeRfc1123(ocpDate);<NEW_LINE>}<NEW_LINE>return service.list(this.client.apiVersion(), this.client.acceptLanguage(), filter, select, expand, maxResults, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, parameterizedHost, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<Page<CloudJob>, JobListHeaders>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<ServiceResponseWithHeaders<Page<CloudJob>, JobListHeaders>> call(Response<ResponseBody> response) {<NEW_LINE>try {<NEW_LINE>ServiceResponseWithHeaders<PageImpl<CloudJob>, JobListHeaders> result = listDelegate(response);<NEW_LINE>return Observable.just(new ServiceResponseWithHeaders<Page<CloudJob>, JobListHeaders>(result.body(), result.headers(), result.response()));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>return Observable.error(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | this.client.batchUrl()); |
291,720 | private Animator morphPassword(CharSequence pw, float fromProgress, float toProgress, long duration) {<NEW_LINE>password = pw;<NEW_LINE>updateBounds();<NEW_LINE>characters = new PasswordCharacter[pw.length()];<NEW_LINE>String passStr = pw.toString();<NEW_LINE>for (int i = 0; i < pw.length(); i++) {<NEW_LINE>characters[i] = new PasswordCharacter(passStr, <MASK><NEW_LINE>}<NEW_LINE>ValueAnimator anim = ValueAnimator.ofFloat(fromProgress, toProgress);<NEW_LINE>anim.addUpdateListener(valueAnimator -> {<NEW_LINE>morphProgress = (float) valueAnimator.getAnimatedValue();<NEW_LINE>invalidateSelf();<NEW_LINE>});<NEW_LINE>anim.setDuration(duration);<NEW_LINE>anim.setInterpolator(fastOutSlowIn);<NEW_LINE>anim.addListener(new AnimatorListenerAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationEnd(Animator animation) {<NEW_LINE>characters = null;<NEW_LINE>morphProgress = NO_PROGRESS;<NEW_LINE>password = null;<NEW_LINE>updateBounds();<NEW_LINE>invalidateSelf();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return anim;<NEW_LINE>} | i, paint, maskDiameter, maskCenterY); |
1,064,248 | final DeleteVolumeResult executeDeleteVolume(DeleteVolumeRequest deleteVolumeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteVolumeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteVolumeRequest> request = null;<NEW_LINE>Response<DeleteVolumeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteVolumeRequestMarshaller().marshall(super.beforeMarshalling(deleteVolumeRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteVolume");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteVolumeResult> responseHandler = new StaxResponseHandler<DeleteVolumeResult>(new DeleteVolumeResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,391,538 | protected RelDataType deriveRowType() {<NEW_LINE>final RelDataTypeFactory typeFactory = getCluster().getTypeFactory();<NEW_LINE>List<RelDataTypeFieldImpl> columns = new ArrayList<>();<NEW_LINE>columns.add(new RelDataTypeFieldImpl("SCHEMA", 0, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("TABLE", 1, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("NON_UNIQUE", 2, typeFactory.createSqlType(SqlTypeName.INTEGER)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("KEY_NAME", 3, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("INDEX_NAMES", 4, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("COVERING_NAMES", 5, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("INDEX_TYPE", 6, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("DB_PARTITION_KEY", 7, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("DB_PARTITION_POLICY", 8, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("DB_PARTITION_COUNT", 9, typeFactory.createSqlType(SqlTypeName.INTEGER)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("TB_PARTITION_KEY", 10, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("TB_PARTITION_POLICY", 11, typeFactory.<MASK><NEW_LINE>columns.add(new RelDataTypeFieldImpl("TB_PARTITION_COUNT", 12, typeFactory.createSqlType(SqlTypeName.INTEGER)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("STATUS", 13, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("SIZE_IN_MB", 14, typeFactory.createSqlType(SqlTypeName.DOUBLE)));<NEW_LINE>return typeFactory.createStructType(columns);<NEW_LINE>} | createSqlType(SqlTypeName.VARCHAR))); |
47,904 | protected int createEditor(Composite parent, List<ICommandParameter> parameters, int currentIndex, List<IParameterEditor> editorList, boolean showLabel) {<NEW_LINE>if (parameters != null && currentIndex >= 0 && currentIndex < parameters.size()) {<NEW_LINE>ICommandParameter parameter = parameters.get(currentIndex);<NEW_LINE>IParameterEditor editor = null;<NEW_LINE>ParameterKind kind = parameter.getParameterDescriptor().getParameterKind();<NEW_LINE>switch(kind) {<NEW_LINE>case BOOLEAN:<NEW_LINE>// Add the boolean editors separately, as they are arranged<NEW_LINE>// differently<NEW_LINE>currentIndex = addBooleanEditors(parent, parameters, currentIndex, editorList);<NEW_LINE>break;<NEW_LINE>case BASE:<NEW_LINE>editor = getTextEditor(parameter, showLabel);<NEW_LINE>break;<NEW_LINE>case JAVA_TYPE:<NEW_LINE>editor = getJavaEditor(parameter, showLabel);<NEW_LINE>break;<NEW_LINE>case COMBO:<NEW_LINE>editor = getComboEditor(parameter, showLabel);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (editor != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return currentIndex;<NEW_LINE>} | addAndConfigureEditor(parent, editor, editorList); |
80,588 | public void testSlowReqMonitorIntervals() throws Exception {<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "-------> Setting slowRequestThreshold to 1 second");<NEW_LINE>server.setServerConfigurationFile("server_slowRequestThreshold1.xml");<NEW_LINE>server.waitForStringInLog("CWWKG0017I", 30000);<NEW_LINE>createRequest("");<NEW_LINE>server.waitForStringInLog("TRAS0112W", 30000);<NEW_LINE>List<String> lines = server.findStringsInFileInLibertyServerRoot("TRAS0112W", MESSAGE_LOG);<NEW_LINE>int records = lines.size();<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "-------> Slow request timing records : " + records);<NEW_LINE>String message = "This request will continue to be monitored, and a further warning will be logged should the request be running after another ";<NEW_LINE>lines = server.findStringsInFileInLibertyServerRoot(message, MESSAGE_LOG);<NEW_LINE>server.setMarkToEndOfLog();<NEW_LINE>int multiple = lines.size();<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "-------> Timing : " + multiple);<NEW_LINE>int expected;<NEW_LINE>int multiply = 2;<NEW_LINE>boolean reset = false;<NEW_LINE>for (String line : lines) {<NEW_LINE>String duration = line.substring(message.length()).replace("s.", "").trim();<NEW_LINE>int time = new Integer(duration);<NEW_LINE>expected = multiply;<NEW_LINE>if (time == expected) {<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, <MASK><NEW_LINE>} else if (time < expected) {<NEW_LINE>reset = true;<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, " ******** > New Request Starts here ********* ");<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, " ----> Expected Actual : " + time + " ***** Expected : 2");<NEW_LINE>} else {<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "******** > UNexpected Actual : " + time + " ***** > Expected : " + expected);<NEW_LINE>assertFalse("Slow Request Timer has jumped the multiple!", time > expected);<NEW_LINE>}<NEW_LINE>if (reset) {<NEW_LINE>multiply = 2;<NEW_LINE>reset = false;<NEW_LINE>}<NEW_LINE>multiply = multiply * 2;<NEW_LINE>}<NEW_LINE>} | " ----> Expected Actual : " + time + " ***** Expected : " + expected); |
379,233 | private synchronized URL[] checkShadedMultiJars() {<NEW_LINE>try {<NEW_LINE>List<Coordinates> coordinates = coorProvider.apply(Utilities.toFile(binary.toURI()));<NEW_LINE>File lrf = EmbedderFactory<MASK><NEW_LINE>List<URL> urls = new ArrayList<URL>();<NEW_LINE>if (coordinates != null) {<NEW_LINE>for (Coordinates coord : coordinates) {<NEW_LINE>File javadocJar = new File(lrf, coord.groupId.replace(".", File.separator) + File.separator + coord.artifactId + File.separator + coord.version + File.separator + coord.artifactId + "-" + coord.version + "-javadoc.jar");<NEW_LINE>URL[] fo = getJavadocJarRoot(javadocJar);<NEW_LINE>if (fo.length == 1) {<NEW_LINE>urls.add(fo[0]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (urls.size() > 1) {<NEW_LINE>URL[] shaded = urls.toArray(new URL[0]);<NEW_LINE>return shaded;<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.log(Level.INFO, "error while examining binary " + binary, ex);<NEW_LINE>}<NEW_LINE>return new URL[0];<NEW_LINE>} | .getProjectEmbedder().getLocalRepositoryFile(); |
146,090 | private LinkedHashMap<IVariable, IConstant> copyMinusErrors(final LinkedHashMap<IVariable, IConstant> src, final IVariable[] variablesToKeep) {<NEW_LINE>final LinkedHashMap<IVariable, IConstant> dst = new LinkedHashMap<IVariable, IConstant>(variablesToKeep != null ? variablesToKeep.length : src.size());<NEW_LINE>final Iterator<Map.Entry<IVariable, IConstant>> itr = src.entrySet().iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>final Map.Entry<IVariable, IConstant<MASK><NEW_LINE>if (e.getValue() == Constant.errorValue()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean keep = true;<NEW_LINE>if (variablesToKeep != null) {<NEW_LINE>keep = false;<NEW_LINE>for (IVariable<?> x : variablesToKeep) {<NEW_LINE>if (x == e.getKey()) {<NEW_LINE>keep = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (keep) {<NEW_LINE>dst.put(e.getKey(), e.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dst;<NEW_LINE>} | > e = itr.next(); |
450,492 | public static MethodHandle ofLoaded(Object methodHandle, Object lookup) {<NEW_LINE>if (!JavaType.METHOD_HANDLE.isInstance(methodHandle)) {<NEW_LINE>throw new IllegalArgumentException("Expected method handle object: " + methodHandle);<NEW_LINE>} else if (!JavaType.METHOD_HANDLES_LOOKUP.isInstance(lookup)) {<NEW_LINE>throw new IllegalArgumentException("Expected method handle lookup object: " + lookup);<NEW_LINE>}<NEW_LINE>Object methodHandleInfo = ClassFileVersion.ofThisVm(ClassFileVersion.JAVA_V8).isAtMost(ClassFileVersion.JAVA_V7) ? METHOD_HANDLE_INFO.revealDirect(methodHandle) : <MASK><NEW_LINE>Object methodType = METHOD_HANDLE_INFO.getMethodType(methodHandleInfo);<NEW_LINE>return new MethodHandle(HandleType.of(METHOD_HANDLE_INFO.getReferenceKind(methodHandleInfo)), TypeDescription.ForLoadedType.of(METHOD_HANDLE_INFO.getDeclaringClass(methodHandleInfo)), METHOD_HANDLE_INFO.getName(methodHandleInfo), TypeDescription.ForLoadedType.of(METHOD_TYPE.returnType(methodType)), new TypeList.ForLoadedTypes(METHOD_TYPE.parameterArray(methodType)));<NEW_LINE>} | METHOD_HANDLES_LOOKUP.revealDirect(lookup, methodHandle); |
860,776 | public Message newResponse(final Message parent, final int code, final String fmt, final Object... args) {<NEW_LINE>final RpcRequests.ErrorResponse.Builder eBuilder = RpcRequests.ErrorResponse.newBuilder();<NEW_LINE>eBuilder.setErrorCode(code);<NEW_LINE>if (fmt != null) {<NEW_LINE>eBuilder.setErrorMsg(String.format(fmt, args));<NEW_LINE>}<NEW_LINE>if (parent == null || parent instanceof RpcRequests.ErrorResponse) {<NEW_LINE>return eBuilder.build();<NEW_LINE>}<NEW_LINE>final //<NEW_LINE>Descriptors.FieldDescriptor //<NEW_LINE>errFd = //<NEW_LINE>parent.<MASK><NEW_LINE>Requires.requireNonNull(errFd, "errFd");<NEW_LINE>final Message.Builder builder = parent.toBuilder();<NEW_LINE>for (final Descriptors.FieldDescriptor fd : parent.getDescriptorForType().getFields()) {<NEW_LINE>builder.setField(fd, parent.getField(fd));<NEW_LINE>}<NEW_LINE>return //<NEW_LINE>//<NEW_LINE>builder.//<NEW_LINE>setField(//<NEW_LINE>errFd, eBuilder.build()).build();<NEW_LINE>} | getDescriptorForType().findFieldByNumber(ERROR_RESPONSE_NUM); |
471,867 | public void calc(ComContext context) {<NEW_LINE>Iterable<Tuple3<Double, Double, Vector>> labledVectors = context.getObj(OptimVariable.trainData);<NEW_LINE>// get iterative coefficient from static memory.<NEW_LINE>Tuple2<DenseVector, Double> state = context.getObj(OptimVariable.currentCoef);<NEW_LINE>int size = state.f0.size();<NEW_LINE>DenseVector coef = state.f0;<NEW_LINE>if (objFunc == null) {<NEW_LINE>objFunc = ((List<OptimObjFunc>) context.getObj(OptimVariable.objFunc)).get(0);<NEW_LINE>}<NEW_LINE>Tuple2<DenseVector, double[]> grad = context.getObj(OptimVariable.dir);<NEW_LINE>// calculate local gradient<NEW_LINE>Double weightSum = objFunc.calcGradient(<MASK><NEW_LINE>// prepare buffer vec for allReduce. the last element of vec is the weight Sum.<NEW_LINE>double[] buffer = context.getObj(OptimVariable.gradAllReduce);<NEW_LINE>if (buffer == null) {<NEW_LINE>buffer = new double[size + 1];<NEW_LINE>context.putObj(OptimVariable.gradAllReduce, buffer);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>buffer[i] = grad.f0.get(i) * weightSum;<NEW_LINE>} | labledVectors, coef, grad.f0); |
1,820,400 | private void newPostSetup() {<NEW_LINE>mIsNewPost = true;<NEW_LINE>if (mSite == null) {<NEW_LINE>showErrorAndFinish(R.string.blog_not_found);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!mSite.isVisible()) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Create a new post<NEW_LINE>mEditPostRepository.set(() -> {<NEW_LINE>PostModel post = mPostStore.instantiatePostModel(mSite, mIsPage, null, null);<NEW_LINE>post.setStatus(PostStatus.DRAFT.toString());<NEW_LINE>return post;<NEW_LINE>});<NEW_LINE>mEditPostRepository.savePostSnapshot();<NEW_LINE>EventBus.getDefault().postSticky(new PostEvents.PostOpenedInEditor(mEditPostRepository.getLocalSiteId(), mEditPostRepository.getId()));<NEW_LINE>mShortcutUtils.reportShortcutUsed(Shortcut.CREATE_NEW_POST);<NEW_LINE>} | showErrorAndFinish(R.string.error_blog_hidden); |
262,296 | private void loadNode362() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.CertificateGroupType_TrustList_Close_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupType_TrustList_Close_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupType_TrustList_Close_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupType_TrustList_Close_InputArguments, Identifiers.HasProperty, Identifiers.CertificateGroupType_TrustList_Close.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>FileHandle</Name><DataType><Identifier>i=7</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
1,425,213 | final UpdateAppInstanceResult executeUpdateAppInstance(UpdateAppInstanceRequest updateAppInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateAppInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateAppInstanceRequest> request = null;<NEW_LINE>Response<UpdateAppInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateAppInstanceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateAppInstanceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Chime SDK Identity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateAppInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateAppInstanceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateAppInstanceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
120,524 | public Float validateAndGetRate(int dayCount, Currency currencyFrom, Currency currencyTo, LocalDate date) throws AxelorException {<NEW_LINE>try {<NEW_LINE>HTTPResponse response = null;<NEW_LINE>if (dayCount < 8) {<NEW_LINE>response = callApiBaseEuru(currencyFrom, currencyTo, date);<NEW_LINE>LOG.trace("Webservice response code: {}, response message: {}", response.getStatusCode(), response.getStatusMessage());<NEW_LINE>if (response.getStatusCode() != 200)<NEW_LINE>return -1f;<NEW_LINE>if (response.getContentAsString().isEmpty()) {<NEW_LINE>return this.validateAndGetRate((dayCount + 1), currencyFrom, currencyTo, date.minus(Period.ofDays(1)));<NEW_LINE>} else {<NEW_LINE>return this.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, String.format(I18n.get(IExceptionMessage.CURRENCY_7), date.plus(Period.ofDays(1)), appBaseService.getTodayDate(Optional.ofNullable(AuthUtils.getUser()).map(User::getActiveCompany).orElse(null))));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.CURRENCY_6));<NEW_LINE>}<NEW_LINE>} | getRateFromJson(currencyFrom, currencyTo, response); |
1,318,040 | private boolean syncEpisodes(@NonNull Map<Integer, Long> tmdbIdsToShowIds, @NonNull LastActivityMore lastActivity, long currentTime) {<NEW_LINE>if (!TraktCredentials.get(context).hasCredentials()) {<NEW_LINE>// auth was removed<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// download flags<NEW_LINE>// if initial sync, upload any flags missing on trakt<NEW_LINE>// otherwise clear all local flags not on trakt<NEW_LINE>boolean isInitialSync = !TraktSettings.hasMergedEpisodes(context);<NEW_LINE>// watched episodes<NEW_LINE>TraktEpisodeSync episodeSync = new TraktEpisodeSync(context, traktSync);<NEW_LINE>if (!episodeSync.syncWatched(tmdbIdsToShowIds, lastActivity.watched_at, isInitialSync)) {<NEW_LINE>// failed, give up.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// collected episodes<NEW_LINE>if (!episodeSync.syncCollected(tmdbIdsToShowIds, lastActivity.collected_at, isInitialSync)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit();<NEW_LINE>if (isInitialSync) {<NEW_LINE>// success, set initial sync as complete<NEW_LINE>editor.putBoolean(TraktSettings.KEY_HAS_MERGED_EPISODES, true);<NEW_LINE>}<NEW_LINE>// success, set last sync time to now<NEW_LINE>editor.<MASK><NEW_LINE>editor.apply();<NEW_LINE>return true;<NEW_LINE>} | putLong(TraktSettings.KEY_LAST_FULL_EPISODE_SYNC, currentTime); |
311,617 | protected CheckFailedResult checkDirectory(String dirKey) {<NEW_LINE>String dir = AppContext.getProperty(dirKey);<NEW_LINE>if (dir != null) {<NEW_LINE>File dirFile = new File(dir);<NEW_LINE>boolean readable = Files.isReadable(dirFile.toPath());<NEW_LINE>boolean writable = Files.isWritable(dirFile.toPath());<NEW_LINE>boolean isDir = dirFile.isDirectory();<NEW_LINE>if (!writable && !isDir) {<NEW_LINE>try {<NEW_LINE>isDir = dirFile.mkdirs();<NEW_LINE>readable = Files.<MASK><NEW_LINE>writable = Files.isWritable(dirFile.toPath());<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>return new CheckFailedResult(String.format("Directory \'%s\' must have read and write permissions." + " Current permissions: Readable: %b, Writable: %b", dirKey, readable, writable), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!writable || !readable || !isDir) {<NEW_LINE>return new CheckFailedResult(String.format("Directory \'%s\' must have read and write permissions. " + "Current permissions: Readable: %b, Writable: %b, Is directory: %b", dirKey, readable, writable, isDir), null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return new CheckFailedResult(String.format("Unable to get directory path from \'%s\' property", dirKey), null);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | isReadable(dirFile.toPath()); |
1,827,409 | public String addLeg() {<NEW_LINE>// Default is not added<NEW_LINE>int status = NOT_ADDED;<NEW_LINE>if (!body) {<NEW_LINE>// No body, cannot add a leg<NEW_LINE>status = MISSING;<NEW_LINE>} else if (legs < MAX_LEGS) {<NEW_LINE>legs++;<NEW_LINE>status = ADDED;<NEW_LINE>}<NEW_LINE>String message = "";<NEW_LINE>// Create a string showing the result of the operation<NEW_LINE>switch(status) {<NEW_LINE>case ADDED:<NEW_LINE>// Replace # with number of legs<NEW_LINE>message = legMessages[status].replace("^^^"<MASK><NEW_LINE>// Add text S. if >1 leg, or just . if one leg.<NEW_LINE>if (legs > 1) {<NEW_LINE>message += "S.";<NEW_LINE>} else {<NEW_LINE>message += ".";<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case NOT_ADDED:<NEW_LINE>// Deliberate fall through to next case as its the<NEW_LINE>// same code to be executed<NEW_LINE>case MISSING:<NEW_LINE>message = legMessages[status];<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return message;<NEW_LINE>} | , String.valueOf(legs)); |
1,353,784 | public S3TagList requestRoomS3Tags(Long roomId, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'roomId' is set<NEW_LINE>if (roomId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'roomId' when calling requestRoomS3Tags");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/nodes/rooms/{room_id}/s3_tags".replaceAll("\\{" + "room_id" + "\\}", apiClient.escapeString(roomId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<S3TagList> localVarReturnType = new GenericType<S3TagList>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | HashMap<String, String>(); |
977,594 | public void appendColumns(final int count) {<NEW_LINE>// add the headers<NEW_LINE>final String[] newHeaders = new String[getHeaderCount() + count];<NEW_LINE>System.arraycopy(this.headers, 0, newHeaders, 0, getHeaderCount());<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>newHeaders[i + getHeaderCount()] = "new";<NEW_LINE>}<NEW_LINE>this.headers = newHeaders;<NEW_LINE>// add the data<NEW_LINE>for (int rowIndex = 0; rowIndex < size(); rowIndex++) {<NEW_LINE>final Object[] originalRow = this.data.get(rowIndex);<NEW_LINE>final Object[] newRow = new Object[getHeaderCount()];<NEW_LINE>System.arraycopy(originalRow, 0, newRow, 0, originalRow.length);<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>newRow[getHeaderCount() - 1 - i] = (double) 0;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>this.data.add(rowIndex, newRow);<NEW_LINE>}<NEW_LINE>} | this.data.remove(rowIndex); |
555,214 | private String adaptReplaceText(String text, int breaksToPreserve, boolean isRegionEnd, int regionEdge) {<NEW_LINE>int i = isRegionEnd ? 0 : text.length() - 1;<NEW_LINE>int direction = isRegionEnd ? 1 : -1;<NEW_LINE>int preservedBreaks = 0;<NEW_LINE>for (; i >= 0 && i < text.length(); i += direction) {<NEW_LINE>assert ScannerHelper.isWhitespace(text.charAt(i));<NEW_LINE>char c1 = text.charAt(i);<NEW_LINE>if (c1 == '\r' || c1 == '\n') {<NEW_LINE>if (preservedBreaks >= breaksToPreserve)<NEW_LINE>break;<NEW_LINE>preservedBreaks++;<NEW_LINE>int i2 = i + direction;<NEW_LINE>if (i2 >= 0 && i2 < text.length()) {<NEW_LINE>char c2 = text.charAt(i2);<NEW_LINE>if ((c2 == '\r' || c2 == '\n') && c2 != c1)<NEW_LINE>i = i2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>text = isRegionEnd ? text.substring(0, i) : <MASK><NEW_LINE>// cut out text if the source outside region is a matching whitespace<NEW_LINE>int textPos = isRegionEnd ? text.length() - 1 : 0;<NEW_LINE>int sourcePos = regionEdge;<NEW_LINE>theLoop: while (textPos >= 0 && textPos < text.length() && sourcePos >= 0 && sourcePos < this.source.length()) {<NEW_LINE>char c1 = text.charAt(textPos);<NEW_LINE>char c2 = this.source.charAt(sourcePos);<NEW_LINE>if (c1 == c2 && (c1 == ' ' || c1 == '\t')) {<NEW_LINE>textPos -= direction;<NEW_LINE>sourcePos += direction;<NEW_LINE>} else if (c1 == '\t' && c2 == ' ') {<NEW_LINE>for (i = 0; i < this.options.tab_size; i++) {<NEW_LINE>sourcePos += direction;<NEW_LINE>if (i < this.options.tab_size - 1 && (sourcePos < 0 || sourcePos >= this.source.length() || this.source.charAt(sourcePos) != ' '))<NEW_LINE>continue theLoop;<NEW_LINE>}<NEW_LINE>textPos -= direction;<NEW_LINE>} else if (c2 == '\t' && c1 == ' ') {<NEW_LINE>for (i = 0; i < this.options.tab_size; i++) {<NEW_LINE>textPos -= direction;<NEW_LINE>if (i < this.options.tab_size - 1 && (textPos < 0 || textPos >= text.length() || text.charAt(textPos) != ' '))<NEW_LINE>continue theLoop;<NEW_LINE>}<NEW_LINE>sourcePos += direction;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isRegionEnd) {<NEW_LINE>text = text.substring(0, textPos + 1);<NEW_LINE>} else {<NEW_LINE>text = text.substring(textPos);<NEW_LINE>}<NEW_LINE>return text;<NEW_LINE>} | text.substring(i + 1); |
1,841,946 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>mApplication = (TinkApplication) getApplicationContext();<NEW_LINE>mPlaintextView = (EditText) findViewById(R.id.plaintext);<NEW_LINE>mAssociatedDataView = (EditText) <MASK><NEW_LINE>mCiphertextView = (EditText) findViewById(R.id.ciphertext);<NEW_LINE>Button mEncryptButton = (Button) findViewById(R.id.encrypt_button);<NEW_LINE>mEncryptButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>attemptEncrypt();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Button mDecryptButton = (Button) findViewById(R.id.decrypt_button);<NEW_LINE>mDecryptButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>attemptDecrypt();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | findViewById(R.id.associated_data); |
1,792,340 | public int compareTo(removeTableProperty_result other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSec(), other.isSetSec());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSec()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTope(), other.isSetTope());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTope()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tope, other.tope);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTnase(), other.isSetTnase());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTnase()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tnase, other.tnase);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | this.sec, other.sec); |
911,422 | public RubyString inspect(ThreadContext context) {<NEW_LINE>int off = this.off;<NEW_LINE>int s = (dt.getHourOfDay() * 60 + dt.getMinuteOfHour()) * 60 + dt.getSecondOfMinute() - off;<NEW_LINE>long ns = (dt.getMillisOfSecond() * 1_000_000) + (subMillisNum * 1_000_000) / subMillisDen;<NEW_LINE>// e.g. #<Date: 2018-01-15 ((2458134j,0s,0n),+0s,2299161j)><NEW_LINE>ByteList str = new ByteList(54);<NEW_LINE>str.append('#').append('<');<NEW_LINE>str.append(((RubyString) getMetaClass().to_s()).getByteList());<NEW_LINE>str.append(':').append(' ');<NEW_LINE>// to_s<NEW_LINE>str.append(to_s(context).getByteList());<NEW_LINE>str.append(' ').append('(').append('(');<NEW_LINE>str.append(ConvertBytes.longToByteList(getJulianDayNumber(), 10));<NEW_LINE>str.append('j').append(',');<NEW_LINE>str.append(ConvertBytes.longToByteList(s, 10));<NEW_LINE>str.append('s').append(',');<NEW_LINE>str.append(ConvertBytes.longToByteList(ns, 10));<NEW_LINE>str.append('n').append(')');<NEW_LINE>str.append(',');<NEW_LINE>if (off >= 0)<NEW_LINE>str.append('+');<NEW_LINE>str.append(ConvertBytes.longToByteList(off, 10));<NEW_LINE>str.append('s').append(',');<NEW_LINE>if (start == GREGORIAN) {<NEW_LINE>str.append('-').append('I').append('n').append('f');<NEW_LINE>} else if (start == JULIAN) {<NEW_LINE>str.append('I').append('n').append('f');<NEW_LINE>} else {<NEW_LINE>str.append(ConvertBytes<MASK><NEW_LINE>}<NEW_LINE>str.append('j').append(')').append('>');<NEW_LINE>return RubyString.newUsAsciiStringNoCopy(context.runtime, str);<NEW_LINE>} | .longToByteList(start, 10)); |
230,948 | public static TruffleString toDisplayStringImpl(Object value, boolean allowSideEffects, ToDisplayStringFormat format, int depth, Object parent) {<NEW_LINE>CompilerAsserts.neverPartOfCompilation();<NEW_LINE>if (value == parent) {<NEW_LINE>return Strings.PARENS_THIS;<NEW_LINE>} else if (value == Undefined.instance) {<NEW_LINE>return Undefined.NAME;<NEW_LINE>} else if (value == Null.instance) {<NEW_LINE>return Null.NAME;<NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>return booleanToString((Boolean) value);<NEW_LINE>} else if (value instanceof TruffleString) {<NEW_LINE>return format.quoteString() ? quote((TruffleString<MASK><NEW_LINE>} else if (value instanceof String) {<NEW_LINE>return format.quoteString() ? quote(Strings.fromJavaString((String) value)) : Strings.fromJavaString((String) value);<NEW_LINE>} else if (JSDynamicObject.isJSDynamicObject(value)) {<NEW_LINE>return ((JSDynamicObject) value).toDisplayStringImpl(allowSideEffects, format, depth);<NEW_LINE>} else if (value instanceof Symbol) {<NEW_LINE>return ((Symbol) value).toTString();<NEW_LINE>} else if (value instanceof BigInt) {<NEW_LINE>return Strings.concat(((BigInt) value).toTString(), Strings.N);<NEW_LINE>} else if (isNumber(value)) {<NEW_LINE>Number number = (Number) value;<NEW_LINE>if (JSRuntime.isNegativeZero(number.doubleValue())) {<NEW_LINE>return Strings.NEGATIVE_ZERO;<NEW_LINE>} else {<NEW_LINE>return numberToString(number);<NEW_LINE>}<NEW_LINE>} else if (value instanceof InteropFunction) {<NEW_LINE>return toDisplayStringImpl(((InteropFunction) value).getFunction(), allowSideEffects, format, depth, parent);<NEW_LINE>} else if (value instanceof TruffleObject) {<NEW_LINE>assert !isJSNative(value) : value;<NEW_LINE>return foreignToString(value, allowSideEffects, format, depth);<NEW_LINE>} else {<NEW_LINE>return Strings.fromObject(value);<NEW_LINE>}<NEW_LINE>} | ) value) : (TruffleString) value; |
814,068 | public long prossesUASipRequest(Request sipRequest, SipProvider provider, long transactionId) throws SipParseException {<NEW_LINE>long retTidVal = 0;<NEW_LINE>SIPClientTranaction sipClientTransaction = null;<NEW_LINE>// the only Exception here is an ack sended<NEW_LINE>// in this state , there is not transaction to match to<NEW_LINE>// and no transaction is needed to be created , since there is<NEW_LINE>// no responce that should be arrived on this request<NEW_LINE>if (Request.ACK.equals(sipRequest.getMethod())) {<NEW_LINE>MessageContext messageContext = null;<NEW_LINE>// send to the transport with no transport<NEW_LINE>try {<NEW_LINE>messageContext = MessageContextFactory.instance().getMessageContext(sipRequest);<NEW_LINE>sendRequestToTransportCore(messageContext, provider, null);<NEW_LINE>} catch (SIPTransportException exp) {<NEW_LINE>// no transaction associated , egnor<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "processsUASipRequest", exp.getMessage());<NEW_LINE>}<NEW_LINE>if (messageContext != null) {<NEW_LINE>messageContext.writeError(exp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (sipRequest.getMethod().equals(Request.CANCEL)) {<NEW_LINE>// set timer per rfc3261 9.1<NEW_LINE>SIPInviteClientTransactionImpl original = m_transactionsModel.getInviteFromCancel(sipRequest);<NEW_LINE>if (original == null) {<NEW_LINE>// no matching INVITE found<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "processUASipRequest", "Cannot match INVITE transaction to CANCEL request");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>original.setCancelTimer();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BranchMethodKey <MASK><NEW_LINE>sipClientTransaction = createClientTransaction(sipRequest, provider, key, transactionId);<NEW_LINE>m_transactionsModel.putClientTransaction(sipClientTransaction);<NEW_LINE>sipClientTransaction.processRequest(sipRequest);<NEW_LINE>retTidVal = sipClientTransaction.getId();<NEW_LINE>}<NEW_LINE>return retTidVal;<NEW_LINE>} | key = m_transactionsModel.createTransactionId(sipRequest); |
886,139 | private <E> Object onPreChecks(E entity, PersistenceDelegator delegator) {<NEW_LINE>// pre validation.<NEW_LINE>// check if entity is Null or with Invalid meta data!<NEW_LINE>Object id = null;<NEW_LINE>EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(delegator.getKunderaMetadata(<MASK><NEW_LINE>id = PropertyAccessorHelper.getId(entity, entityMetadata);<NEW_LINE>// set id, in case of auto generation and still not set.<NEW_LINE>if (ObjectGraphUtils.onAutoGenerateId((Field) entityMetadata.getIdAttribute().getJavaMember(), id)) {<NEW_LINE>id = new IdGenerator().generateAndSetId(entity, entityMetadata, delegator, delegator.getKunderaMetadata());<NEW_LINE>}<NEW_LINE>// check if id is set or not.<NEW_LINE>new PrimaryKeyNullCheck<Object>().validate(id);<NEW_LINE>validator.validate(entity, delegator.getKunderaMetadata());<NEW_LINE>// }<NEW_LINE>return id;<NEW_LINE>} | ), entity.getClass()); |
666,382 | final GetMemberResult executeGetMember(GetMemberRequest getMemberRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getMemberRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetMemberRequest> request = null;<NEW_LINE>Response<GetMemberResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetMemberRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMemberRequest));<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, "ManagedBlockchain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMember");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetMemberResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetMemberResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.