idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
946,439 | private void readBundles() {<NEW_LINE>assert registered.isEmpty();<NEW_LINE>try {<NEW_LINE>InputStream is = Stamps.getModulesJARs().asStream("netigso-bundles");<NEW_LINE>if (is == null) {<NEW_LINE>File f;<NEW_LINE>try {<NEW_LINE>f = getNetigsoCache();<NEW_LINE>} catch (IllegalStateException ex) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>deleteRec(f);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Properties p = new Properties();<NEW_LINE>p.load(is);<NEW_LINE>is.close();<NEW_LINE>for (Map.Entry<Object, Object> entry : p.entrySet()) {<NEW_LINE>String k = <MASK><NEW_LINE>String v = (String) entry.getValue();<NEW_LINE>registered.put(k, v.trim().isEmpty() ? EMPTY : v.split(","));<NEW_LINE>LOG.log(Level.FINE, "readBundle: {0}", k);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOG.log(Level.WARNING, "Cannot read cache", ex);<NEW_LINE>}<NEW_LINE>} | (String) entry.getKey(); |
1,195,565 | public static SearchApplicationScopesResponse unmarshall(SearchApplicationScopesResponse searchApplicationScopesResponse, UnmarshallerContext _ctx) {<NEW_LINE>searchApplicationScopesResponse.setRequestId(_ctx.stringValue("SearchApplicationScopesResponse.RequestId"));<NEW_LINE>searchApplicationScopesResponse.setMessage(_ctx.stringValue("SearchApplicationScopesResponse.Message"));<NEW_LINE>searchApplicationScopesResponse.setHttpStatusCode(_ctx.integerValue("SearchApplicationScopesResponse.HttpStatusCode"));<NEW_LINE>searchApplicationScopesResponse.setSuccess(_ctx.booleanValue("SearchApplicationScopesResponse.Success"));<NEW_LINE>searchApplicationScopesResponse.setCode(_ctx.stringValue("SearchApplicationScopesResponse.Code"));<NEW_LINE>List<UserApplication> content = new ArrayList<UserApplication>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("SearchApplicationScopesResponse.Content.Length"); i++) {<NEW_LINE>UserApplication userApplication = new UserApplication();<NEW_LINE>userApplication.setAppName(_ctx.stringValue("SearchApplicationScopesResponse.Content[" + i + "].AppName"));<NEW_LINE>userApplication.setNamespace(_ctx.stringValue("SearchApplicationScopesResponse.Content[" + i + "].Namespace"));<NEW_LINE>userApplication.setGroupName(_ctx.stringValue("SearchApplicationScopesResponse.Content[" + i + "].GroupName"));<NEW_LINE>userApplication.setDeviceName(_ctx.stringValue("SearchApplicationScopesResponse.Content[" + i + "].DeviceName"));<NEW_LINE>userApplication.setPrivateIp(_ctx.stringValue("SearchApplicationScopesResponse.Content[" + i + "].PrivateIp"));<NEW_LINE>userApplication.setPublicIp(_ctx.stringValue("SearchApplicationScopesResponse.Content[" + i + "].PublicIp"));<NEW_LINE>userApplication.setDeviceType(_ctx.integerValue("SearchApplicationScopesResponse.Content[" + i + "].DeviceType"));<NEW_LINE>userApplication.setHostConfigurationId(_ctx.stringValue("SearchApplicationScopesResponse.Content[" + i + "].HostConfigurationId"));<NEW_LINE>userApplication.setConfigurationId(_ctx.stringValue("SearchApplicationScopesResponse.Content[" + i + "].ConfigurationId"));<NEW_LINE>userApplication.setUserId(_ctx.stringValue("SearchApplicationScopesResponse.Content[" + i + "].UserId"));<NEW_LINE>userApplication.setClusterId(_ctx.stringValue("SearchApplicationScopesResponse.Content[" + i + "].ClusterId"));<NEW_LINE>userApplication.setAppId(_ctx.longValue<MASK><NEW_LINE>userApplication.setStatus(_ctx.integerValue("SearchApplicationScopesResponse.Content[" + i + "].Status"));<NEW_LINE>content.add(userApplication);<NEW_LINE>}<NEW_LINE>searchApplicationScopesResponse.setContent(content);<NEW_LINE>return searchApplicationScopesResponse;<NEW_LINE>} | ("SearchApplicationScopesResponse.Content[" + i + "].AppId")); |
1,359,419 | final DeletePatchBaselineResult executeDeletePatchBaseline(DeletePatchBaselineRequest deletePatchBaselineRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deletePatchBaselineRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeletePatchBaselineRequest> request = null;<NEW_LINE>Response<DeletePatchBaselineResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeletePatchBaselineRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deletePatchBaselineRequest));<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, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeletePatchBaseline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeletePatchBaselineResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeletePatchBaselineResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,001,964 | protected JComponent createCenterPanel() {<NEW_LINE>final JLabel selectText = new JLabel(VcsBundle.message("dialog.enable.version.control.integration.select.vcs.label.text"));<NEW_LINE>selectText.setUI(new MultiLineLabelUI());<NEW_LINE>final JPanel mainPanel = new JPanel(new GridBagLayout());<NEW_LINE>final GridBagConstraints gb = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);<NEW_LINE>mainPanel.add(selectText, gb);<NEW_LINE>++gb.gridx;<NEW_LINE>gb.anchor = GridBagConstraints.NORTHEAST;<NEW_LINE>List<Object> vcses = new ArrayList<>();<NEW_LINE>vcses.add(ObjectUtil.NULL);<NEW_LINE>List<AbstractVcs> sortedVcs = new ArrayList<>(AllVcses.getInstance(myProject).getSupportedVcses());<NEW_LINE>sortedVcs.sort((o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getDisplayName(), o2.getDisplayName()));<NEW_LINE>vcses.addAll(sortedVcs);<NEW_LINE>myVcsComboBox = new ComboBox<>(new CollectionComboBoxModel<>(vcses));<NEW_LINE>myVcsComboBox.setRenderer(new ColoredListCellRenderer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void customizeCellRenderer(@Nonnull JList list, Object value, int index, boolean selected, boolean hasFocus) {<NEW_LINE>if (value == ObjectUtil.NULL) {<NEW_LINE>append("");<NEW_LINE>} else {<NEW_LINE>append(((AbstractVcs) value).getDisplayName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mainPanel.add(myVcsComboBox, gb);<NEW_LINE>myVcsComboBox.addActionListener(e -> validateVcs());<NEW_LINE>validateVcs();<NEW_LINE>final JLabel helpText = new JLabel(VcsBundle.message("dialog.enable.version.control.integration.hint.text"));<NEW_LINE>helpText.setUI(new MultiLineLabelUI());<NEW_LINE>helpText.setForeground(UIUtil.getInactiveTextColor());<NEW_LINE>gb.anchor = GridBagConstraints.NORTHWEST;<NEW_LINE>gb.gridx = 0;<NEW_LINE>++gb.gridy;<NEW_LINE>gb.gridwidth = 2;<NEW_LINE><MASK><NEW_LINE>final JPanel wrapper = new JPanel(new GridBagLayout());<NEW_LINE>wrapper.add(mainPanel, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.emptyInsets(), 0, 0));<NEW_LINE>return wrapper;<NEW_LINE>} | mainPanel.add(helpText, gb); |
1,041,125 | synchronized public static org.omg.CORBA.TypeCode type() {<NEW_LINE>if (__typeCode == null) {<NEW_LINE>org.omg.CORBA.TypeCode _disTypeCode0;<NEW_LINE>_disTypeCode0 = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_short);<NEW_LINE>_disTypeCode0 = org.omg.CORBA.ORB.init().create_alias_tc(com.sun.corba.se.impl.protocol.giopmsgheaders.AddressingDispositionHelper.id(), "AddressingDisposition", _disTypeCode0);<NEW_LINE>org.omg.CORBA.UnionMember[] _members0 = new org.omg.CORBA.UnionMember[3];<NEW_LINE>org.omg.CORBA.TypeCode _tcOf_members0;<NEW_LINE>org.omg.CORBA.Any _anyOf_members0;<NEW_LINE>// Branch for object_key<NEW_LINE>_anyOf_members0 = org.omg.CORBA.ORB.init().create_any();<NEW_LINE>_anyOf_members0.insert_short((short) com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr.value);<NEW_LINE>_tcOf_members0 = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_octet);<NEW_LINE>_tcOf_members0 = org.omg.CORBA.ORB.init().create_sequence_tc(0, _tcOf_members0);<NEW_LINE>_members0[0] = new org.omg.CORBA.UnionMember("object_key", _anyOf_members0, _tcOf_members0, null);<NEW_LINE>// Branch for profile<NEW_LINE>_anyOf_members0 = org.omg.CORBA.ORB.init().create_any();<NEW_LINE>_anyOf_members0.insert_short((short) com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr.value);<NEW_LINE>_tcOf_members0 = org.omg<MASK><NEW_LINE>_members0[1] = new org.omg.CORBA.UnionMember("profile", _anyOf_members0, _tcOf_members0, null);<NEW_LINE>// Branch for ior<NEW_LINE>_anyOf_members0 = org.omg.CORBA.ORB.init().create_any();<NEW_LINE>_anyOf_members0.insert_short((short) com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr.value);<NEW_LINE>_tcOf_members0 = com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfoHelper.type();<NEW_LINE>_members0[2] = new org.omg.CORBA.UnionMember("ior", _anyOf_members0, _tcOf_members0, null);<NEW_LINE>__typeCode = org.omg.CORBA.ORB.init().create_union_tc(com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddressHelper.id(), "TargetAddress", _disTypeCode0, _members0);<NEW_LINE>}<NEW_LINE>return __typeCode;<NEW_LINE>} | .IOP.TaggedProfileHelper.type(); |
356,220 | public int compare(final SAMRecord samRecord1, final SAMRecord samRecord2) {<NEW_LINE>int cmp = compareCoordinates(samRecord1, samRecord2);<NEW_LINE>if (cmp != 0) {<NEW_LINE>return cmp;<NEW_LINE>}<NEW_LINE>// Test of negative strand flag is not really necessary, because it is tested<NEW_LINE>// via getFlags(), but it is left here because that is the way it is done<NEW_LINE>// in {@link htsjdk.samtools.SAMRecordCoordinateComparator}<NEW_LINE>if (samRecord1.getReadNegativeStrandFlag() == samRecord2.getReadNegativeStrandFlag()) {<NEW_LINE>cmp = samRecord1.getReadName().compareTo(samRecord2.getReadName());<NEW_LINE>if (cmp != 0) {<NEW_LINE>return cmp;<NEW_LINE>}<NEW_LINE>cmp = Integer.compare(samRecord1.getFlags(), samRecord2.getFlags());<NEW_LINE>if (cmp != 0) {<NEW_LINE>return cmp;<NEW_LINE>}<NEW_LINE>cmp = Integer.compare(samRecord1.getMappingQuality(), samRecord2.getMappingQuality());<NEW_LINE>if (cmp != 0) {<NEW_LINE>return cmp;<NEW_LINE>}<NEW_LINE>cmp = Integer.compare(header.getSequenceIndex(samRecord1.getMateReferenceName()), header.getSequenceIndex<MASK><NEW_LINE>if (cmp != 0) {<NEW_LINE>return cmp;<NEW_LINE>}<NEW_LINE>cmp = Integer.compare(samRecord1.getMateAlignmentStart(), samRecord2.getMateAlignmentStart());<NEW_LINE>if (cmp != 0) {<NEW_LINE>return cmp;<NEW_LINE>}<NEW_LINE>cmp = Integer.compare(samRecord1.getInferredInsertSize(), samRecord2.getInferredInsertSize());<NEW_LINE>return cmp;<NEW_LINE>} else {<NEW_LINE>return samRecord1.getReadNegativeStrandFlag() ? 1 : -1;<NEW_LINE>}<NEW_LINE>} | (samRecord2.getMateReferenceName())); |
509,961 | public static boolean isAjaxRequest(WebRequest request) {<NEW_LINE>String ajaxParameter = request.getParameter(BLC_AJAX_PARAMETER);<NEW_LINE>String requestedWithHeader = request.getHeader("X-Requested-With");<NEW_LINE>boolean result = (ajaxParameter != null && "true".equals(ajaxParameter)) || "XMLHttpRequest".equals(requestedWithHeader);<NEW_LINE>if (LOG.isTraceEnabled()) {<NEW_LINE>StringBuilder sb = new StringBuilder().append("Request URL: [").append(request.getContextPath()).append("]").append(" - ").append("ajaxParam: [").append(String.valueOf(ajaxParameter)).append("]").append(" - ").append("X-Requested-With: [").append(requestedWithHeader).append("]").append(" - ").append("Returning: [").append<MASK><NEW_LINE>LOG.trace(sb.toString());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (result).append("]"); |
1,481,795 | private boolean validateScheme(byte[] handshake, int scheme) {<NEW_LINE>int digestOffset = -1;<NEW_LINE>switch(scheme) {<NEW_LINE>case 0:<NEW_LINE>digestOffset = getDigestOffset1(handshake, 0);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>digestOffset = getDigestOffset2(handshake, 0);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>log.error("Unknown algorithm: {}", scheme);<NEW_LINE>}<NEW_LINE>log.debug("Algorithm: {} digest offset: {}", scheme, digestOffset);<NEW_LINE>byte[] tempBuffer = new byte[Constants.HANDSHAKE_SIZE - DIGEST_LENGTH];<NEW_LINE>System.arraycopy(handshake, 0, tempBuffer, 0, digestOffset);<NEW_LINE>System.arraycopy(handshake, digestOffset + DIGEST_LENGTH, tempBuffer, digestOffset, <MASK><NEW_LINE>byte[] tempHash = new byte[DIGEST_LENGTH];<NEW_LINE>calculateHMAC_SHA256(tempBuffer, 0, tempBuffer.length, GENUINE_FP_KEY, 30, tempHash, 0);<NEW_LINE>log.debug("Hash: {}", Hex.encodeHexString(tempHash));<NEW_LINE>boolean result = true;<NEW_LINE>for (int i = 0; i < DIGEST_LENGTH; i++) {<NEW_LINE>if (handshake[digestOffset + i] != tempHash[i]) {<NEW_LINE>result = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | Constants.HANDSHAKE_SIZE - digestOffset - DIGEST_LENGTH); |
403,334 | public static StringExpression format(final String format, final Object... args) {<NEW_LINE>if (format == null) {<NEW_LINE>throw new NullPointerException("Format cannot be null.");<NEW_LINE>}<NEW_LINE>if (extractDependencies(args).length == 0) {<NEW_LINE>return StringConstant.valueOf(String.format(format, args));<NEW_LINE>}<NEW_LINE>final StringFormatter formatter = new StringFormatter() {<NEW_LINE><NEW_LINE>{<NEW_LINE>super.bind(extractDependencies(args));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void dispose() {<NEW_LINE>super.unbind(extractDependencies(args));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected String computeValue() {<NEW_LINE>final Object[] values = extractValues(args);<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ObservableList<ObservableValue<?>> getDependencies() {<NEW_LINE>return FXCollections.unmodifiableObservableList(FXCollections.observableArrayList(extractDependencies(args)));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// Force calculation to check format<NEW_LINE>formatter.get();<NEW_LINE>return formatter;<NEW_LINE>} | String.format(format, values); |
1,231,668 | protected List<Broadcast> sortAndCropBroadcastList(List<Broadcast> broadcastList, int offset, int size, String sortBy, String orderBy) {<NEW_LINE>if (("name".equals(sortBy) || "date".equals(sortBy) || "status".equals(sortBy)) && orderBy != null) {<NEW_LINE>Collections.sort(broadcastList, new Comparator<Broadcast>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Broadcast broadcast1, Broadcast broadcast2) {<NEW_LINE>Comparable c1 = null;<NEW_LINE>Comparable c2 = null;<NEW_LINE>if (sortBy.equals("name")) {<NEW_LINE>c1 = broadcast1.getName().toLowerCase();<NEW_LINE>c2 = broadcast2.getName().toLowerCase();<NEW_LINE>} else if (sortBy.equals("date")) {<NEW_LINE>c1 = Long.<MASK><NEW_LINE>c2 = Long.valueOf(broadcast2.getDate());<NEW_LINE>} else if (sortBy.equals("status")) {<NEW_LINE>c1 = broadcast1.getStatus();<NEW_LINE>c2 = broadcast2.getStatus();<NEW_LINE>}<NEW_LINE>int result = 0;<NEW_LINE>if (c1 != null && c2 != null) {<NEW_LINE>if (orderBy.equals("desc")) {<NEW_LINE>result = c2.compareTo(c1);<NEW_LINE>} else {<NEW_LINE>result = c1.compareTo(c2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (size > MAX_ITEM_IN_ONE_LIST) {<NEW_LINE>size = MAX_ITEM_IN_ONE_LIST;<NEW_LINE>}<NEW_LINE>if (offset < 0) {<NEW_LINE>offset = 0;<NEW_LINE>}<NEW_LINE>int toIndex = Math.min(offset + size, broadcastList.size());<NEW_LINE>if (offset >= toIndex) {<NEW_LINE>return new ArrayList<>();<NEW_LINE>} else {<NEW_LINE>return broadcastList.subList(offset, toIndex);<NEW_LINE>}<NEW_LINE>} | valueOf(broadcast1.getDate()); |
556,851 | public void commonSetup(FMLCommonSetupEvent event) {<NEW_LINE>ChemthrowerHandler.registerFlammable(TinkerFluids.blazingBlood.getLocalTag());<NEW_LINE>registerChemEffect(TinkerFluids.earthSlime.getForgeTag(), MobEffects.MOVEMENT_SLOWDOWN, 140);<NEW_LINE>registerChemEffect(TinkerFluids.skySlime.getLocalTag(), MobEffects.JUMP, 200);<NEW_LINE>registerChemEffect(TinkerFluids.enderSlime.getLocalTag(), MobEffects.LEVITATION, 100);<NEW_LINE>registerChemEffect(TinkerFluids.blood.getLocalTag(<MASK><NEW_LINE>registerChemEffect(TinkerFluids.venom.getLocalTag(), MobEffects.POISON, 300);<NEW_LINE>registerChemEffect(TinkerFluids.magma.getForgeTag(), MobEffects.FIRE_RESISTANCE, 200);<NEW_LINE>registerChemEffect(TinkerFluids.liquidSoul.getForgeTag(), MobEffects.BLINDNESS, 100);<NEW_LINE>ChemthrowerHandler.registerEffect(TinkerFluids.moltenEnder.getForgeTag(), new ChemthrowerEffect_RandomTeleport(null, 0, 1));<NEW_LINE>registerChemEffect(TinkerFluids.moltenUranium.getLocalTag(), MobEffects.POISON, 200);<NEW_LINE>} | ), MobEffects.DIG_SLOWDOWN, 100); |
1,102,634 | public static String guessSimpleJavaType(GlobalElement element) {<NEW_LINE>String xsdType = null;<NEW_LINE>String javaType <MASK><NEW_LINE>if (element.getType() != null && element.getType().getEffectiveNamespace().equals(XMLConstants.W3C_XML_SCHEMA_NS_URI)) {<NEW_LINE>xsdType = element.getType().get().getName();<NEW_LINE>} else if (element.getInlineType() instanceof LocalSimpleType) {<NEW_LINE>LocalSimpleType lst = (LocalSimpleType) element.getInlineType();<NEW_LINE>if (lst.getDefinition() instanceof SimpleTypeRestriction) {<NEW_LINE>NamedComponentReference<GlobalSimpleType> ref = ((SimpleTypeRestriction) lst.getDefinition()).getBase();<NEW_LINE>if (ref.getEffectiveNamespace().equals(XMLConstants.W3C_XML_SCHEMA_NS_URI)) {<NEW_LINE>xsdType = ref.get().getName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (xsdType != null) {<NEW_LINE>javaType = toJavaType(xsdType);<NEW_LINE>}<NEW_LINE>return javaType;<NEW_LINE>} | = Object.class.getName(); |
1,183,726 | public static CommitNoteFragment newInstance(String repoOwner, String repoName, String commitSha, Commit commit, List<GitComment> allComments, IntentUtils.InitialCommentMarker initialComment) {<NEW_LINE>CommitNoteFragment f = new CommitNoteFragment();<NEW_LINE>ArrayList<GitComment> comments = new ArrayList<>();<NEW_LINE>// we're only interested in unpositional comments<NEW_LINE>for (GitComment comment : allComments) {<NEW_LINE>if (comment.position() == null) {<NEW_LINE>comments.add(comment);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Bundle args = new Bundle();<NEW_LINE>args.putString("owner", repoOwner);<NEW_LINE><MASK><NEW_LINE>args.putString("sha", commitSha);<NEW_LINE>args.putParcelable("commit_author", commit.author());<NEW_LINE>args.putParcelable("committer", commit.committer());<NEW_LINE>args.putParcelableArrayList("comments", comments);<NEW_LINE>args.putParcelable("initial_comment", initialComment);<NEW_LINE>f.setArguments(args);<NEW_LINE>return f;<NEW_LINE>} | args.putString("repo", repoName); |
1,529,118 | public int selectBeforePoint(Long knowledgeId, int... types) {<NEW_LINE>StringBuilder sql = new StringBuilder();<NEW_LINE>List<Object> <MASK><NEW_LINE>sql.append("SELECT SUM(POINT) FROM POINT_KNOWLEDGE_HISTORIES ");<NEW_LINE>sql.append("WHERE KNOWLEDGE_ID = ? ");<NEW_LINE>params.add(knowledgeId);<NEW_LINE>sql.append("AND TYPE IN (");<NEW_LINE>boolean appended = false;<NEW_LINE>for (int i : types) {<NEW_LINE>if (appended) {<NEW_LINE>sql.append(", ");<NEW_LINE>}<NEW_LINE>sql.append("?");<NEW_LINE>appended = true;<NEW_LINE>params.add(i);<NEW_LINE>}<NEW_LINE>sql.append(");");<NEW_LINE>Integer point = executeQuerySingle(sql.toString(), Integer.class, params.toArray(new Object[0]));<NEW_LINE>if (point == null) {<NEW_LINE>point = 0;<NEW_LINE>}<NEW_LINE>return point;<NEW_LINE>} | params = new ArrayList<>(); |
144,688 | private Optional<Object> executeQueryMethod(final RepositoryInvoker invoker, @RequestParam MultiValueMap<String, Object> parameters, Method method, DefaultedPageable pageable, Sort sort, PersistentEntityResourceAssembler assembler) {<NEW_LINE>MultiValueMap<String, Object> result = new LinkedMultiValueMap<String, Object>(parameters);<NEW_LINE>MethodParameters methodParameters = new MethodParameters(method, new AnnotationAttribute(Param.class));<NEW_LINE>List<MethodParameter<MASK><NEW_LINE>List<TypeInformation<?>> parameterTypeInformations = ClassTypeInformation.from(method.getDeclaringClass()).getParameterTypes(method);<NEW_LINE>parameters.entrySet().forEach(entry -> methodParameters.getParameter(entry.getKey()).ifPresent(parameter -> {<NEW_LINE>int parameterIndex = parameterList.indexOf(parameter);<NEW_LINE>TypeInformation<?> domainType = parameterTypeInformations.get(parameterIndex).getActualType();<NEW_LINE>ResourceMetadata metadata = mappings.getMetadataFor(domainType.getType());<NEW_LINE>if (metadata != null && metadata.isExported()) {<NEW_LINE>result.put(parameter.getParameterName(), prepareUris(entry.getValue()));<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>return invoker.invokeQueryMethod(method, result, pageable.getPageable(), sort);<NEW_LINE>} | > parameterList = methodParameters.getParameters(); |
1,065,177 | public void processIntent(@NonNull Intent intent) {<NEW_LINE>checkNotNull(intent);<NEW_LINE>if (!intent.hasExtra("serviceUriString")) {<NEW_LINE>Log.e(TAG, "No service uri defined");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!intent.hasExtra("listenerId")) {<NEW_LINE>Log.e(TAG, "No listener id defined");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String serviceUriString = intent.getStringExtra("serviceUriString");<NEW_LINE>int listenerId = intent.getIntExtra("listenerId", 0);<NEW_LINE>Uri serviceUri = Uri.parse(serviceUriString);<NEW_LINE>Fetcher<Uri> matchingFetcher = fetcherManager.findFetcher(serviceUri);<NEW_LINE>if (matchingFetcher != null) {<NEW_LINE>Log.v(TAG, "Fetcher found for " + serviceUri);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>Log.e(TAG, "Unknown Uri " + serviceUri);<NEW_LINE>}<NEW_LINE>} | matchingFetcher.fetch(intent, listenerId); |
1,375,975 | private static JSONArray dumpCollection(ParameterizedType pt, Stack<Class> hasDone) throws JSONException {<NEW_LINE>Type st = pt.getActualTypeArguments()[0];<NEW_LINE>JSONArray arr = new JSONArray();<NEW_LINE>if (st instanceof ParameterizedType) {<NEW_LINE>ParameterizedType spt = (ParameterizedType) st;<NEW_LINE>if (Collection.class.isAssignableFrom((Class<?>) spt.getRawType())) {<NEW_LINE>JSONArray oarr = dumpCollection(spt, hasDone);<NEW_LINE>arr.put(oarr);<NEW_LINE>} else if (Map.class.isAssignableFrom((Class<?>) spt.getRawType())) {<NEW_LINE>JSONObject moj = dumpMap(spt, hasDone);<NEW_LINE>arr.put(moj);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(String.format("nested generic type[%s] in type[%s], your structure is too complicated to dump, you have to write json template yourself! Again, why do you need so complicated structure??", spt.getRawType(), pt.getRawType()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Class<?> elementType = (Class<?>) pt.getActualTypeArguments()[0];<NEW_LINE>if (Collection.class.isAssignableFrom(elementType) || Map.class.isAssignableFrom(elementType)) {<NEW_LINE>throw new IllegalArgumentException(String.format("nested type[%s] in generic type[%s], the nested type has no generic type information, your structure is too complicated to dump, you have to write json template yourself! Again, why do you need so complicated structure??", elementType.getName(), pt.getRawType()));<NEW_LINE>}<NEW_LINE>if (isPrimitiveType(elementType)) {<NEW_LINE>arr.put(elementType.getName());<NEW_LINE>} else {<NEW_LINE>JSONObject <MASK><NEW_LINE>arr.put(oj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return arr;<NEW_LINE>} | oj = dumpObject(elementType, hasDone); |
851,130 | public void execute(ProcessEngine engine, String scenarioName) {<NEW_LINE>RuntimeService runtimeService = engine.getRuntimeService();<NEW_LINE>ProcessInstance processInstanceWithInitialVariables = runtimeService.createProcessInstanceQuery().processDefinitionKey("asyncBeforeStartProcess_712").processInstanceBusinessKey("712_ProcessIntanceExecuted").singleResult();<NEW_LINE>ManagementService managementService = engine.getManagementService();<NEW_LINE>Job firstJob = managementService.createJobQuery().processDefinitionKey("asyncBeforeStartProcess_712").processInstanceId(processInstanceWithInitialVariables.getId()).singleResult();<NEW_LINE>try {<NEW_LINE>managementService.executeJob(firstJob.getId());<NEW_LINE>} catch (Exception e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processDefinitionKey("asyncBeforeStartProcess_712").processInstanceBusinessKey("7120_ProcessIntanceWithoutExecute").singleResult();<NEW_LINE>runtimeService.setVariable(processInstance.getId(), "foo", "value");<NEW_LINE>runtimeService.setVariableLocal(processInstance.<MASK><NEW_LINE>} | getId(), "local", "foo1"); |
979,369 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {<NEW_LINE>super.onActivityResult(requestCode, resultCode, data);<NEW_LINE>if (requestCode == REQUEST_FAVORITE_SELECT && resultCode == FavoritesListFragment.SELECT_FAVORITE_POINT_RESULT_OK) {<NEW_LINE>FavouritePoint p = (FavouritePoint) data.getSerializableExtra(FavoritesListFragment.SELECT_FAVORITE_POINT_INTENT_KEY);<NEW_LINE>if (p != null) {<NEW_LINE>LatLon latLon = new LatLon(p.getLatitude(), p.getLongitude());<NEW_LINE>updateSearchPoint(latLon, getString(R.string.select_search_position) + " " + p.getName(), false);<NEW_LINE>}<NEW_LINE>} else if (requestCode == REQUEST_ADDRESS_SELECT && resultCode == SearchAddressFragment.SELECT_ADDRESS_POINT_RESULT_OK) {<NEW_LINE>String name = data.getStringExtra(SearchAddressFragment.SELECT_ADDRESS_POINT_INTENT_KEY);<NEW_LINE>LatLon latLon = new LatLon(data.getDoubleExtra(SearchAddressFragment.SELECT_ADDRESS_POINT_LAT, 0), data.getDoubleExtra<MASK><NEW_LINE>if (name != null) {<NEW_LINE>updateSearchPoint(latLon, getString(R.string.select_search_position) + " " + name, false);<NEW_LINE>} else {<NEW_LINE>updateSearchPoint(latLon, getString(R.string.select_search_position) + " ", true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (SearchAddressFragment.SELECT_ADDRESS_POINT_LON, 0)); |
298,523 | public void marshall(RDSDataSpec rDSDataSpec, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (rDSDataSpec == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(rDSDataSpec.getDatabaseInformation(), DATABASEINFORMATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(rDSDataSpec.getSelectSqlQuery(), SELECTSQLQUERY_BINDING);<NEW_LINE>protocolMarshaller.marshall(rDSDataSpec.getDatabaseCredentials(), DATABASECREDENTIALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(rDSDataSpec.getDataRearrangement(), DATAREARRANGEMENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(rDSDataSpec.getDataSchema(), DATASCHEMA_BINDING);<NEW_LINE>protocolMarshaller.marshall(rDSDataSpec.getDataSchemaUri(), DATASCHEMAURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(rDSDataSpec.getResourceRole(), RESOURCEROLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(rDSDataSpec.getServiceRole(), SERVICEROLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(rDSDataSpec.getSubnetId(), SUBNETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(rDSDataSpec.getSecurityGroupIds(), SECURITYGROUPIDS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | rDSDataSpec.getS3StagingLocation(), S3STAGINGLOCATION_BINDING); |
1,261,524 | // PMD does not understand Closer.<NEW_LINE>@SuppressWarnings("PMD.CloseResource")<NEW_LINE>private boolean debugPost(FileWriter outWriter, List<String> options, List<String> parameters) {<NEW_LINE>if (!isValidArgument(options, parameters, 2, 2, 2, Command.DEBUG_POST)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean file = false;<NEW_LINE>boolean raw = false;<NEW_LINE>for (String option : options) {<NEW_LINE>switch(option) {<NEW_LINE>case "-file":<NEW_LINE>file = true;<NEW_LINE>break;<NEW_LINE>case "-raw":<NEW_LINE>raw = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>_logger.errorf("Unknown option: %s\n", options.get(0));<NEW_LINE>printUsage(Command.DEBUG_POST);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String urlTail = parameters.get(0);<NEW_LINE>String entityParam = parameters.get(1);<NEW_LINE>MediaType mediaType;<NEW_LINE>Object entity;<NEW_LINE>try (Closer closer = Closer.create()) {<NEW_LINE>if (file) {<NEW_LINE>InputStream inputStream = closer.register(Files.newInputStream(Paths.get(entityParam)));<NEW_LINE>if (raw) {<NEW_LINE>mediaType = MediaType.APPLICATION_OCTET_STREAM_TYPE;<NEW_LINE>entity = inputStream;<NEW_LINE>} else {<NEW_LINE>mediaType = MediaType.APPLICATION_JSON_TYPE;<NEW_LINE>entity = <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mediaType = MediaType.APPLICATION_JSON_TYPE;<NEW_LINE>entity = BatfishObjectMapper.mapper().readTree(entityParam);<NEW_LINE>}<NEW_LINE>return _workHelper.debugV2(outWriter, HttpMethod.POST, urlTail, entity, mediaType);<NEW_LINE>} catch (IOException e) {<NEW_LINE>_logger.error(Throwables.getStackTraceAsString(e));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | IOUtils.toString(inputStream, UTF_8); |
131,541 | public UpdateContactFlowModuleContentResult updateContactFlowModuleContent(UpdateContactFlowModuleContentRequest updateContactFlowModuleContentRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateContactFlowModuleContentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateContactFlowModuleContentRequest> request = null;<NEW_LINE>Response<UpdateContactFlowModuleContentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateContactFlowModuleContentRequestMarshaller().marshall(updateContactFlowModuleContentRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Unmarshaller<UpdateContactFlowModuleContentResult, JsonUnmarshallerContext> unmarshaller = new UpdateContactFlowModuleContentResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<UpdateContactFlowModuleContentResult> responseHandler = new JsonResponseHandler<UpdateContactFlowModuleContentResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
246,835 | public static Building parseJSON(JSONObject json) throws IllegalArgumentException {<NEW_LINE>Building b = new Building();<NEW_LINE>MapObject.parseJSON(json, b);<NEW_LINE>if (json.has("postcode")) {<NEW_LINE>b.postcode = json.getString("postcode");<NEW_LINE>}<NEW_LINE>if (json.has("lat2") && json.has("lon2")) {<NEW_LINE>b.latLon2 = new LatLon(json.getDouble("lat2")<MASK><NEW_LINE>}<NEW_LINE>if (json.has("interpolationType")) {<NEW_LINE>b.interpolationType = BuildingInterpolation.valueOf(json.getString("interpolationType"));<NEW_LINE>}<NEW_LINE>if (json.has("interpolationInterval")) {<NEW_LINE>b.interpolationInterval = json.getInt("interpolationInterval");<NEW_LINE>}<NEW_LINE>if (json.has("name2")) {<NEW_LINE>b.name2 = json.getString("name2");<NEW_LINE>}<NEW_LINE>return b;<NEW_LINE>} | , json.getDouble("lon2")); |
1,220,162 | public void runInternal() {<NEW_LINE>try {<NEW_LINE>possiblyRegisterListener();<NEW_LINE>stateManager.maybeSetState(SeekableStreamSupervisorStateManager.SeekableStreamState.CONNECTING_TO_STREAM);<NEW_LINE>if (!updatePartitionDataFromStream() && !stateManager.isAtLeastOneSuccessfulRun()) {<NEW_LINE>// if we can't connect to the stream and this is the first run, stop and wait to retry the connection<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>stateManager.maybeSetState(SeekableStreamSupervisorStateManager.SeekableStreamState.DISCOVERING_INITIAL_TASKS);<NEW_LINE>discoverTasks();<NEW_LINE>updateTaskStatus();<NEW_LINE>checkTaskDuration();<NEW_LINE>checkPendingCompletionTasks();<NEW_LINE>checkCurrentTaskState();<NEW_LINE>synchronized (stateChangeLock) {<NEW_LINE>// if supervisor is not suspended, ensure required tasks are running<NEW_LINE>// if suspended, ensure tasks have been requested to gracefully stop<NEW_LINE>if (stateManager.getSupervisorState().getBasicState().equals(SupervisorStateManager.BasicState.STOPPING)) {<NEW_LINE>// if we're already terminating, don't do anything here, the terminate already handles shutdown<NEW_LINE>log.info("[%s] supervisor is already stopping.", dataSource);<NEW_LINE>} else if (!spec.isSuspended()) {<NEW_LINE>log.info("[%s] supervisor is running.", dataSource);<NEW_LINE>stateManager.maybeSetState(SeekableStreamSupervisorStateManager.SeekableStreamState.CREATING_TASKS);<NEW_LINE>createNewTasks();<NEW_LINE>} else {<NEW_LINE>log.info("[%s] supervisor is suspended.", dataSource);<NEW_LINE>gracefulShutdownInternal();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(generateReport<MASK><NEW_LINE>} else {<NEW_LINE>log.info(generateReport(false).toString());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>stateManager.recordThrowableEvent(e);<NEW_LINE>log.warn(e, "Exception in supervisor run loop for dataSource [%s]", dataSource);<NEW_LINE>} finally {<NEW_LINE>stateManager.markRunFinished();<NEW_LINE>}<NEW_LINE>} | (true).toString()); |
1,655,265 | private void createFavouritesPulldown(Composite parent, FavouritesPreference favouritePrefs, LiveVariable<String> searchBox) {<NEW_LINE>Button btn = new Button(parent, SWT.ARROW | SWT.DOWN);<NEW_LINE>btn.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>super.widgetSelected(e);<NEW_LINE>Menu menu = new Menu(btn);<NEW_LINE>// create item for each of the known favourites<NEW_LINE>Favourite[<MASK><NEW_LINE>Set<String> existingFavs = new HashSet<>();<NEW_LINE>for (Favourite f : favourites) {<NEW_LINE>MenuItem item = new MenuItem(menu, SWT.PUSH);<NEW_LINE>item.setText(f.toString());<NEW_LINE>item.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>searchBox.setValue(f.query);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>existingFavs.add(f.query);<NEW_LINE>}<NEW_LINE>// separator<NEW_LINE>new MenuItem(menu, SWT.SEPARATOR);<NEW_LINE>String currentSearch = searchBox.getValue();<NEW_LINE>if (StringUtil.hasText(currentSearch)) {<NEW_LINE>if (!existingFavs.contains(currentSearch)) {<NEW_LINE>// create a 'add favourite' menu item<NEW_LINE>MenuItem item = new MenuItem(menu, SWT.PUSH);<NEW_LINE>item.setText("Add Favourite...");<NEW_LINE>item.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>String name = inputDialog("Add '" + currentSearch + "' as a favourite", "Name:", "");<NEW_LINE>if (StringUtil.hasText(name)) {<NEW_LINE>favouritePrefs.add(name, currentSearch);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>// the currentSearch is already a favourite<NEW_LINE>// create a 'remove favourite' menu item<NEW_LINE>MenuItem item = new MenuItem(menu, SWT.PUSH);<NEW_LINE>item.setText("Remove '" + currentSearch + "' Favourite");<NEW_LINE>item.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>favouritePrefs.remove(currentSearch);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Point loc = btn.getLocation();<NEW_LINE>Rectangle rect = btn.getBounds();<NEW_LINE>Point mLoc = new Point(loc.x - 1, loc.y + rect.height);<NEW_LINE>menu.setLocation(btn.getDisplay().map(btn.getParent(), null, mLoc));<NEW_LINE>menu.setVisible(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ] favourites = favouritePrefs.getFavourites(); |
1,578,188 | private static void dispatchUnmatchedResponseListenerTasks(SipServletResponseImpl response, SipAppDesc appDescriptor, int taskNum) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceEntry(null, "dispatchUnmatchedRequestListenerTasks", new Object[] { response, appDescriptor, new Integer(taskNum) });<NEW_LINE>}<NEW_LINE>if (appDescriptor.getUnmatchedMessagesListeners().isEmpty()) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceExit(null, "dispatchUnmatchedResponseListenerTasks, no listeners to call");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>EventObject evt = new UnmatchedResponseEvent(response, appDescriptor.getServletContext());<NEW_LINE>Iterator<UnmatchedMessageListener> iter = appDescriptor.getUnmatchedMessagesListeners().iterator();<NEW_LINE>dispatchTasks(iter, evt, taskNum, appDescriptor);<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>StringBuffer buff = new StringBuffer(100);<NEW_LINE>buff.append("dispatchUnmatchedResponseListenerTasks sent: ");<NEW_LINE>buff.append(ListenerTask.getTaskName(taskNum));<NEW_LINE>buff.append("response = ");<NEW_LINE>buff.<MASK><NEW_LINE>buff.append("id = ");<NEW_LINE>buff.append(response.getCallId());<NEW_LINE>c_logger.traceDebug(null, "dispatchUnmatchedResponseListenerTasks", buff.toString());<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceExit(null, "dispatchUnmatchedResponseListenerTasks");<NEW_LINE>}<NEW_LINE>} | append(response.getMethod()); |
1,832,883 | public synchronized T read(@IdParam IIdType theId, RequestDetails theRequestDetails) {<NEW_LINE>TreeMap<Long, T> versions = myIdToVersionToResourceMap.get(theId.getIdPart());<NEW_LINE>if (versions == null || versions.isEmpty()) {<NEW_LINE>throw new ResourceNotFoundException(Msg<MASK><NEW_LINE>}<NEW_LINE>T retVal;<NEW_LINE>if (theId.hasVersionIdPart()) {<NEW_LINE>Long versionId = theId.getVersionIdPartAsLong();<NEW_LINE>if (!versions.containsKey(versionId)) {<NEW_LINE>throw new ResourceNotFoundException(Msg.code(1982) + theId);<NEW_LINE>} else {<NEW_LINE>T resource = versions.get(versionId);<NEW_LINE>if (resource == null) {<NEW_LINE>throw new ResourceGoneException(Msg.code(1983) + theId);<NEW_LINE>}<NEW_LINE>retVal = resource;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>retVal = versions.lastEntry().getValue();<NEW_LINE>}<NEW_LINE>myReadCount.incrementAndGet();<NEW_LINE>retVal = fireInterceptorsAndFilterAsNeeded(retVal, theRequestDetails);<NEW_LINE>if (retVal == null) {<NEW_LINE>throw new ResourceNotFoundException(Msg.code(1984) + theId);<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>} | .code(1981) + theId); |
672,066 | public CodecDocument openDocumentInner(String fileName, String password) {<NEW_LINE>if (!cacheFile.isFile()) {<NEW_LINE>LOG.d("Type no cache file");<NEW_LINE>try {<NEW_LINE>if (CbzCbrExtractor.isZip(fileName)) {<NEW_LINE>CacheZipUtils.copyFile(new File(fileName), cacheFile);<NEW_LINE>} else {<NEW_LINE>String extractDir = CacheZipUtils.CACHE_BOOK_DIR + "/" + "CBR_" + fileName.hashCode();<NEW_LINE>File cbrDir = new File(extractDir);<NEW_LINE>cbrDir.mkdirs();<NEW_LINE>try {<NEW_LINE>ExtractArchive.extractArchive(fileName, extractDir, password);<NEW_LINE>} catch (OutOfMemoryError e) {<NEW_LINE>LOG.e(e);<NEW_LINE>}<NEW_LINE>CacheZipUtils.zipFolder(extractDir, cacheFile.getPath());<NEW_LINE>CacheZipUtils.deleteDir(cbrDir);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.e(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MuPdfDocument muPdfDocument = new MuPdfDocument(this, MuPdfDocument.FORMAT_PDF, <MASK><NEW_LINE>return muPdfDocument;<NEW_LINE>} | cacheFile.getPath(), password); |
1,347,742 | public boolean execute(@Nonnull PsiFileSystemItem element) {<NEW_LINE>if (!filter.shouldShow(element)) {<NEW_LINE>// skip<NEW_LINE>} else if (element instanceof PsiDirectory) {<NEW_LINE>result.add(new PsiDirectoryNode(project, (PsiDirectory) element, settings, filter) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Collection<AbstractTreeNode> getChildrenImpl() {<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>return getDirectoryChildrenImpl(getProject(), getValue(), getSettings(), getFilter());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if (element instanceof PsiFile) {<NEW_LINE>result.add(new PsiFileNode(project, (PsiFile) element, settings) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Comparable<ExtensionSortKey> getTypeSortKey() {<NEW_LINE>PsiFile value = getValue();<NEW_LINE>Language language = value == null ? null : value.getLanguage();<NEW_LINE>LanguageFileType fileType = language == null <MASK><NEW_LINE>return fileType == null ? null : new ExtensionSortKey(fileType.getDefaultExtension());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | ? null : language.getAssociatedFileType(); |
603,079 | public void serialize(Point value, JsonGenerator jsonGenerator, SerializerProvider serializers) throws IOException {<NEW_LINE>String crsType = value<MASK><NEW_LINE>List<Double> coordinate = value.getCoordinate().getCoordinate();<NEW_LINE>if (crsType.startsWith(CoordinateReferenceSystem.Cartesian.toString())) {<NEW_LINE>if (coordinate.size() == 3) {<NEW_LINE>jsonGenerator.writeObject(new PointCartesian(crsType, coordinate.get(0), coordinate.get(1), coordinate.get(2)));<NEW_LINE>} else {<NEW_LINE>jsonGenerator.writeObject(new PointCartesian(crsType, coordinate.get(0), coordinate.get(1)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (coordinate.size() == 3) {<NEW_LINE>jsonGenerator.writeObject(new PointWgs(crsType, coordinate.get(0), coordinate.get(1), coordinate.get(2)));<NEW_LINE>} else {<NEW_LINE>jsonGenerator.writeObject(new PointWgs(crsType, coordinate.get(0), coordinate.get(1)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getCRS().getType(); |
907,696 | protected void createHandshakeBytes() {<NEW_LINE>handshakeBytes = new byte[Constants.HANDSHAKE_SIZE];<NEW_LINE>// timestamp<NEW_LINE>int time = (int) (Red5.getUpTime() / 1000);<NEW_LINE>handshakeBytes[0] = (byte) (time >>> 24);<NEW_LINE>handshakeBytes[1] = (byte) (time >>> 16);<NEW_LINE>handshakeBytes[2] = (byte) (time >>> 8);<NEW_LINE>handshakeBytes[3] = (byte) time;<NEW_LINE>// version 4<NEW_LINE>handshakeBytes[4] = 4;<NEW_LINE>handshakeBytes[5] = 0;<NEW_LINE>handshakeBytes[6] = 0;<NEW_LINE>handshakeBytes[7] = 1;<NEW_LINE>// fill the rest with random bytes<NEW_LINE>int randomHandshakeLength = (Constants.HANDSHAKE_SIZE - 8);<NEW_LINE>BigInteger bi = new BigInteger((randomHandshakeLength * 8), random);<NEW_LINE>byte[] rndBytes = BigIntegers.asUnsignedByteArray(bi);<NEW_LINE>// prevent AOOB error that can occur, sometimes<NEW_LINE>if (rndBytes.length == randomHandshakeLength) {<NEW_LINE>// copy random bytes into our handshake array<NEW_LINE>System.arraycopy(rndBytes, 0, handshakeBytes, 8, randomHandshakeLength);<NEW_LINE>} else {<NEW_LINE>// copy random bytes into our handshake array<NEW_LINE>ByteBuffer <MASK><NEW_LINE>b.put(rndBytes);<NEW_LINE>b.put((byte) 0x69);<NEW_LINE>b.flip();<NEW_LINE>// copy mostly random bytes into our handshake array<NEW_LINE>System.arraycopy(b.array(), 0, handshakeBytes, 8, randomHandshakeLength);<NEW_LINE>}<NEW_LINE>} | b = ByteBuffer.allocate(randomHandshakeLength); |
586,757 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setFadeAnimation();<NEW_LINE>setWizardMode(true);<NEW_LINE>setBackButtonVisibilityWithDone(true);<NEW_LINE>// Instead of fragments, you can also use our default slide<NEW_LINE>// Just set a title, description, background and image. AppIntro will do the rest.<NEW_LINE>addSlide(AppIntroFragment.newInstance(getString(R.string.intro1_title), getString(R.string.intro1_desc), R.drawable.web_hi_res_512, getResources().getColor(R.color.colorPrimaryDark)));<NEW_LINE>CustomSlideBigText cs1 = CustomSlideBigText.newInstance(R.layout.custom_slide_big_text);<NEW_LINE>cs1.setTitle(getString(R.string.intro2_title));<NEW_LINE>addSlide(cs1);<NEW_LINE>CustomSlideBigText cs2 = CustomSlideBigText.newInstance(R.layout.custom_slide_big_text);<NEW_LINE>cs2.setTitle(getString<MASK><NEW_LINE>cs2.showButton(getString(R.string.action_configure), new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>startActivity(new Intent(PPAppIntro.this, AccelConfigureActivity.class));<NEW_LINE>startActivity(new Intent(PPAppIntro.this, MicrophoneConfigureActivity.class));<NEW_LINE>startActivity(new Intent(PPAppIntro.this, CameraConfigureActivity.class));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>addSlide(cs2);<NEW_LINE>CustomSlideBigText cs3 = CustomSlideBigText.newInstance(R.layout.custom_slide_big_text);<NEW_LINE>cs3.setTitle(getString(R.string.intro4_desc));<NEW_LINE>addSlide(cs3);<NEW_LINE>final CustomSlideNotify cs4 = CustomSlideNotify.newInstance(R.layout.custom_slide_notify);<NEW_LINE>cs4.setSaveListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>PreferenceManager pm = new PreferenceManager(PPAppIntro.this);<NEW_LINE>pm.setRemotePhoneNumber(cs4.getPhoneNumber());<NEW_LINE>Toast.makeText(PPAppIntro.this, R.string.phone_saved, Toast.LENGTH_SHORT).show();<NEW_LINE>getPager().setCurrentItem(getPager().getCurrentItem() + 1);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>addSlide(cs4);<NEW_LINE>addSlide(AppIntroFragment.newInstance(getString(R.string.intro5_title), getString(R.string.intro5_desc), R.drawable.web_hi_res_512, getResources().getColor(R.color.colorPrimaryDark)));<NEW_LINE>setDoneText(getString(R.string.onboarding_action_end));<NEW_LINE>// Hide Skip/Done button.<NEW_LINE>showSkipButton(false);<NEW_LINE>// setProgressButtonEnabled(false);<NEW_LINE>} | (R.string.intro3_desc)); |
159,887 | public void postConfig() {<NEW_LINE>if (firstMean.length != 2) {<NEW_LINE>throw new PropertyException("", "firstMean", "firstMean is not the right length");<NEW_LINE>}<NEW_LINE>if (secondMean.length != 2) {<NEW_LINE>throw new PropertyException("", "secondMean", "secondMean is not the right length");<NEW_LINE>}<NEW_LINE>if (firstCovarianceMatrix.length != 4) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (secondCovarianceMatrix.length != 4) {<NEW_LINE>throw new PropertyException("", "secondCovarianceMatrix", "secondCovarianceMatrix is not the right length");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < firstCovarianceMatrix.length; i++) {<NEW_LINE>if (firstCovarianceMatrix[i] < 0) {<NEW_LINE>throw new PropertyException("", "firstCovarianceMatrix", "First covariance matrix is not positive semi-definite");<NEW_LINE>}<NEW_LINE>if (secondCovarianceMatrix[i] < 0) {<NEW_LINE>throw new PropertyException("", "secondCovarianceMatrix", "Second covariance matrix is not positive semi-definite");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (firstCovarianceMatrix[1] != firstCovarianceMatrix[2]) {<NEW_LINE>throw new PropertyException("", "firstCovarianceMatrix", "First covariance matrix is not a covariance matrix");<NEW_LINE>}<NEW_LINE>if (secondCovarianceMatrix[1] != secondCovarianceMatrix[2]) {<NEW_LINE>throw new PropertyException("", "secondCovarianceMatrix", "Second covariance matrix is not a covariance matrix");<NEW_LINE>}<NEW_LINE>firstCholesky = new double[3];<NEW_LINE>firstCholesky[0] = Math.sqrt(firstCovarianceMatrix[0]);<NEW_LINE>firstCholesky[1] = firstCovarianceMatrix[1] / Math.sqrt(firstCovarianceMatrix[0]);<NEW_LINE>firstCholesky[2] = Math.sqrt(firstCovarianceMatrix[3] * firstCovarianceMatrix[0] - firstCovarianceMatrix[1] * firstCovarianceMatrix[1]) / Math.sqrt(firstCovarianceMatrix[0]);<NEW_LINE>secondCholesky = new double[3];<NEW_LINE>secondCholesky[0] = Math.sqrt(secondCovarianceMatrix[0]);<NEW_LINE>secondCholesky[1] = secondCovarianceMatrix[1] / Math.sqrt(secondCovarianceMatrix[0]);<NEW_LINE>secondCholesky[2] = Math.sqrt(secondCovarianceMatrix[3] * secondCovarianceMatrix[0] - secondCovarianceMatrix[1] * secondCovarianceMatrix[1]) / Math.sqrt(secondCovarianceMatrix[0]);<NEW_LINE>super.postConfig();<NEW_LINE>} | PropertyException("", "firstCovarianceMatrix", "firstCovarianceMatrix is not the right length"); |
1,367,237 | public void typeAheadUntil(@Nonnull ActionCallback callback, @Nonnull String cause) {<NEW_LINE>if (!isTypeaheadEnabled())<NEW_LINE>return;<NEW_LINE>final long currentTime = System.currentTimeMillis();<NEW_LINE>final ActionCallback done;<NEW_LINE>if (!Registry.is("type.ahead.logging.enabled")) {<NEW_LINE>done = callback;<NEW_LINE>} else {<NEW_LINE>final String id = new Exception().getStackTrace()[2].getClassName();<NEW_LINE>// LOG.setLevel(Level.ALL);<NEW_LINE>final SimpleDateFormat dateFormat = new <MASK><NEW_LINE>LOG.info(dateFormat.format(System.currentTimeMillis()) + "\tStarted: " + id);<NEW_LINE>done = new ActionCallback();<NEW_LINE>callback.doWhenDone(() -> {<NEW_LINE>done.setDone();<NEW_LINE>LOG.info(dateFormat.format(System.currentTimeMillis()) + "\tDone: " + id);<NEW_LINE>});<NEW_LINE>callback.doWhenRejected(() -> {<NEW_LINE>done.setRejected();<NEW_LINE>LOG.info(dateFormat.format(System.currentTimeMillis()) + "\tRejected: " + id);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>assertDispatchThread();<NEW_LINE>myTypeAheadRequestors.add(done);<NEW_LINE>done.notify(new TimedOutCallback(Registry.intValue("actionSystem.commandProcessingTimeout"), "Typeahead request blocked", new Exception() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getMessage() {<NEW_LINE>return "Time: " + (System.currentTimeMillis() - currentTime) + "; cause: " + cause + "; runnable waiting for the focus change: " + IdeEventQueue.getInstance().runnablesWaitingForFocusChangeState();<NEW_LINE>}<NEW_LINE>}, true).doWhenProcessed(() -> myTypeAheadRequestors.remove(done)));<NEW_LINE>} | SimpleDateFormat("dd MMM yyyy HH:ss:SSS", Locale.US); |
480,529 | public void addFormForAddAccount() {<NEW_LINE>accountNrInputTextFieldEdited = false;<NEW_LINE>gridRowFrom = gridRow + 1;<NEW_LINE>Tuple2<ComboBox<TradeCurrency>, Integer> tuple = GUIUtil.addRegionCountryTradeCurrencyComboBoxes(gridPane, gridRow, this::onCountrySelected, this::onTradeCurrencySelected);<NEW_LINE>currencyComboBox = tuple.first;<NEW_LINE>gridRow = tuple.second;<NEW_LINE>addAcceptedBanksForAddAccount();<NEW_LINE>addHolderNameAndId();<NEW_LINE>nationalAccountIdInputTextField = addInputTextField(gridPane, ++gridRow, BankUtil.getNationalAccountIdLabel(""));<NEW_LINE>nationalAccountIdInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {<NEW_LINE>bankAccountPayload.setNationalAccountId(newValue);<NEW_LINE>updateFromInputs();<NEW_LINE>});<NEW_LINE>bankNameInputTextField = addInputTextField(gridPane, ++gridRow, Res.get("payment.bank.name"));<NEW_LINE>bankNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {<NEW_LINE>bankAccountPayload.<MASK><NEW_LINE>updateFromInputs();<NEW_LINE>});<NEW_LINE>bankIdInputTextField = addInputTextField(gridPane, ++gridRow, BankUtil.getBankIdLabel(""));<NEW_LINE>bankIdInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {<NEW_LINE>bankAccountPayload.setBankId(newValue.trim());<NEW_LINE>updateFromInputs();<NEW_LINE>});<NEW_LINE>branchIdInputTextField = addInputTextField(gridPane, ++gridRow, BankUtil.getBranchIdLabel(""));<NEW_LINE>branchIdInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {<NEW_LINE>bankAccountPayload.setBranchId(newValue.trim());<NEW_LINE>updateFromInputs();<NEW_LINE>});<NEW_LINE>accountNrInputTextField = addInputTextField(gridPane, ++gridRow, BankUtil.getAccountNrLabel(""));<NEW_LINE>accountNrInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {<NEW_LINE>bankAccountPayload.setAccountNr(newValue.trim());<NEW_LINE>updateFromInputs();<NEW_LINE>});<NEW_LINE>accountTypeComboBox = addComboBox(gridPane, ++gridRow, "");<NEW_LINE>accountTypeComboBox.setPromptText(Res.get("payment.select.account"));<NEW_LINE>accountTypeComboBox.setOnAction(e -> {<NEW_LINE>if (BankUtil.isAccountTypeRequired(bankAccountPayload.getCountryCode())) {<NEW_LINE>bankAccountPayload.setAccountType(accountTypeComboBox.getSelectionModel().getSelectedItem());<NEW_LINE>updateFromInputs();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>addLimitations(false);<NEW_LINE>addAccountNameTextFieldWithAutoFillToggleButton();<NEW_LINE>updateFromInputs();<NEW_LINE>} | setBankName(newValue.trim()); |
1,145,123 | private void doUnregisterHandler(final Thing thing, final ThingHandlerFactory thingHandlerFactory) {<NEW_LINE>logger.debug("Calling unregisterHandler handler for thing '{}' at '{}'.", <MASK><NEW_LINE>safeCaller.create(() -> {<NEW_LINE>ThingHandler thingHandler = thing.getHandler();<NEW_LINE>thingHandlerFactory.unregisterHandler(thing);<NEW_LINE>if (thingHandler != null) {<NEW_LINE>thingHandler.setCallback(null);<NEW_LINE>}<NEW_LINE>thing.setHandler(null);<NEW_LINE>boolean enabled = !isDisabledByStorage(thing.getUID());<NEW_LINE>ThingStatusDetail detail = enabled ? ThingStatusDetail.HANDLER_MISSING_ERROR : ThingStatusDetail.DISABLED;<NEW_LINE>setThingStatus(thing, buildStatusInfo(ThingStatus.UNINITIALIZED, detail));<NEW_LINE>thingHandlers.remove(thing.getUID());<NEW_LINE>synchronized (thingHandlersByFactory) {<NEW_LINE>final Set<ThingHandler> thingHandlers = thingHandlersByFactory.get(thingHandlerFactory);<NEW_LINE>if (thingHandlers != null) {<NEW_LINE>thingHandlers.remove(thingHandler);<NEW_LINE>if (thingHandlers.isEmpty()) {<NEW_LINE>thingHandlersByFactory.remove(thingHandlerFactory);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, Runnable.class).build().run();<NEW_LINE>} | thing.getUID(), thingHandlerFactory); |
549,798 | public void onDraw(Canvas canvas, RotatedTileBox tb, DrawSettings settings) {<NEW_LINE>if (isDrawingEnabled()) {<NEW_LINE>lineAttrs.updatePaints(view.getApplication(), settings, tb);<NEW_LINE>if (!editingCtx.isInApproximationMode()) {<NEW_LINE>drawBeforeAfterPath(canvas, tb);<NEW_LINE>}<NEW_LINE>if (editingCtx.getSelectedPointPosition() == -1) {<NEW_LINE>drawCenterIcon(canvas, tb, settings.isNightMode());<NEW_LINE>if (measureDistanceToCenterListener != null) {<NEW_LINE>float distance = 0;<NEW_LINE>float bearing = 0;<NEW_LINE>if (editingCtx.getPointsCount() > 0) {<NEW_LINE>WptPt lastPoint = editingCtx.getPoints().get(editingCtx.getPointsCount() - 1);<NEW_LINE>LatLon centerLatLon = tb.getCenterLatLon();<NEW_LINE>distance = (float) MapUtils.getDistance(lastPoint.lat, lastPoint.lon, centerLatLon.getLatitude(), centerLatLon.getLongitude());<NEW_LINE>bearing = getLocationFromLL(lastPoint.lat, lastPoint.lon).bearingTo(getLocationFromLL(centerLatLon.getLatitude(), centerLatLon.getLongitude()));<NEW_LINE>}<NEW_LINE>measureDistanceToCenterListener.onMeasure(distance, bearing);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<WptPt> beforePoints = editingCtx.getBeforePoints();<NEW_LINE>List<WptPt> afterPoints = editingCtx.getAfterPoints();<NEW_LINE>if (beforePoints.size() > 0) {<NEW_LINE>drawPointIcon(canvas, tb, beforePoints.get(beforePoints.size() - 1), true);<NEW_LINE>}<NEW_LINE>if (afterPoints.size() > 0) {<NEW_LINE>drawPointIcon(canvas, tb, afterPoints<MASK><NEW_LINE>}<NEW_LINE>if (editingCtx.getSelectedPointPosition() != -1) {<NEW_LINE>canvas.rotate(-tb.getRotate(), tb.getCenterPixelX(), tb.getCenterPixelY());<NEW_LINE>int locX = tb.getCenterPixelX();<NEW_LINE>int locY = tb.getCenterPixelY();<NEW_LINE>canvas.drawBitmap(applyingPointIcon, locX - marginApplyingPointIconX, locY - marginApplyingPointIconY, bitmapPaint);<NEW_LINE>canvas.rotate(tb.getRotate(), tb.getCenterPixelX(), tb.getCenterPixelY());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .get(0), true); |
400,977 | protected void attachAllCheckBoxListener(CheckBox checkBox, final PermissionVariant activeVariant) {<NEW_LINE>checkBox.addValueChangeListener(e -> {<NEW_LINE>if (itemChanging)<NEW_LINE>return;<NEW_LINE>if (entityPermissionsTable.getSelected().isEmpty())<NEW_LINE>return;<NEW_LINE>itemChanging = true;<NEW_LINE>PermissionVariant permissionVariant = PermissionUiHelper.getCheckBoxVariant(<MASK><NEW_LINE>if (isSingleSelection()) {<NEW_LINE>for (EntityOperationControl control : operationControls) {<NEW_LINE>OperationPermissionTarget target = entityPermissionsTable.getSingleSelected();<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>if (control.applicableToEntity(target.getEntityClass())) {<NEW_LINE>markItemPermission(control.getMetaProperty(), control.getOperation(), permissionVariant);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (EntityOperationControl control : operationControls) {<NEW_LINE>control.getAllowChecker().setValue(permissionVariant == PermissionVariant.ALLOWED);<NEW_LINE>control.getDenyChecker().setValue(permissionVariant == PermissionVariant.DISALLOWED);<NEW_LINE>}<NEW_LINE>allAllowCheck.setValue(permissionVariant == PermissionVariant.ALLOWED);<NEW_LINE>allDenyCheck.setValue(permissionVariant == PermissionVariant.DISALLOWED);<NEW_LINE>}<NEW_LINE>entityPermissionsTable.repaint();<NEW_LINE>itemChanging = false;<NEW_LINE>});<NEW_LINE>} | e.getValue(), activeVariant); |
174,390 | public void contribute(BuildContext context, AotOptions aotOptions) {<NEW_LINE>ResourceLoader resourceLoader = new DefaultResourceLoader(context.getClassLoader());<NEW_LINE>ClassLoader classLoader = context.getClassLoader();<NEW_LINE>Class<?> applicationClass;<NEW_LINE>String applicationClassName = context.getApplicationClass();<NEW_LINE>if (applicationClassName == null) {<NEW_LINE>logger.warn("No application class detected, skipping context bootstrap generation");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>logger.info("Detected application class: " + applicationClassName);<NEW_LINE>applicationClass = ClassUtils.forName(applicationClassName, classLoader);<NEW_LINE>} catch (ClassNotFoundException exc) {<NEW_LINE>throw new IllegalStateException("Could not load application class " + applicationClassName, exc);<NEW_LINE>}<NEW_LINE>StopWatch watch = new StopWatch();<NEW_LINE>logger.info("Processing application context");<NEW_LINE>watch.start();<NEW_LINE>GenericApplicationContext applicationContext = new AotApplicationContextFactory(resourceLoader).createApplicationContext(applicationClass);<NEW_LINE>configureEnvironment(applicationContext.getEnvironment());<NEW_LINE>ApplicationContextAotProcessor aotProcessor = new ApplicationContextAotProcessor(classLoader);<NEW_LINE>DefaultBootstrapWriterContext writerContext = new DefaultBootstrapWriterContext("org.springframework.aot", BOOTSTRAP_CLASS_NAME);<NEW_LINE>aotProcessor.process(applicationContext, writerContext);<NEW_LINE>watch.stop();<NEW_LINE>logger.info("Processed " + applicationContext.getBeanFactory().getBeanDefinitionNames().length + " bean definitions in " + watch.getTotalTimeMillis() + "ms");<NEW_LINE>writerContext.toJavaFiles().forEach(javaFile -> context.addSourceFiles(SourceFiles.fromJavaFile(javaFile)));<NEW_LINE><MASK><NEW_LINE>context.getOptions().addAll(nativeConfigurationRegistry.options());<NEW_LINE>context.describeReflection(reflectionDescriptor -> nativeConfigurationRegistry.reflection().toClassDescriptors().forEach(reflectionDescriptor::merge));<NEW_LINE>context.describeResources(resourcesDescriptor -> resourcesDescriptor.merge(nativeConfigurationRegistry.resources().toResourcesDescriptor()));<NEW_LINE>context.describeProxies(proxiesDescriptor -> proxiesDescriptor.merge(nativeConfigurationRegistry.proxy().toProxiesDescriptor()));<NEW_LINE>context.describeInitialization(initializationDescriptor -> initializationDescriptor.merge(nativeConfigurationRegistry.initialization().toInitializationDescriptor()));<NEW_LINE>context.describeSerialization(serializationDescriptor -> serializationDescriptor.merge(nativeConfigurationRegistry.serialization().toSerializationDescriptor()));<NEW_LINE>context.describeJNIReflection(reflectionDescriptor -> nativeConfigurationRegistry.jni().toClassDescriptors().forEach(reflectionDescriptor::merge));<NEW_LINE>} | NativeConfigurationRegistry nativeConfigurationRegistry = writerContext.getNativeConfigurationRegistry(); |
264,724 | protected void migrateRealm(KeycloakSession session, RealmModel realm, boolean json) {<NEW_LINE>MigrationProvider migrationProvider = session.getProvider(MigrationProvider.class);<NEW_LINE>// Create "roles" and "web-origins" clientScopes<NEW_LINE>ClientScopeModel rolesScope = migrationProvider.addOIDCRolesClientScope(realm);<NEW_LINE>ClientScopeModel webOriginsScope = migrationProvider.addOIDCWebOriginsClientScope(realm);<NEW_LINE>LOG.debugf("Added '%s' and '%s' default client scopes", rolesScope.getName(<MASK><NEW_LINE>// Assign "roles" and "web-origins" clientScopes to all the OIDC clients<NEW_LINE>realm.getClientsStream().filter(MigrationUtils::isOIDCNonBearerOnlyClient).forEach(c -> {<NEW_LINE>c.addClientScope(rolesScope, true);<NEW_LINE>c.addClientScope(webOriginsScope, true);<NEW_LINE>});<NEW_LINE>LOG.debugf("Client scope '%s' assigned to all the clients", rolesScope.getName());<NEW_LINE>} | ), webOriginsScope.getName()); |
998,602 | private void checkSyntaxOfFlags(ExecutionContext context, String flags) {<NEW_LINE>if (flags == null || flags.equals("")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < flags.length(); ++i) {<NEW_LINE>switch(flags.charAt(i)) {<NEW_LINE>case 'm':<NEW_LINE>case 'i':<NEW_LINE>case 'g':<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new ThrowException(context, context.createSyntaxError("invalid flag '" + flags.charAt(i) + "'"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int index = -1;<NEW_LINE>index = flags.indexOf('m');<NEW_LINE>if (index >= 0) {<NEW_LINE>if (flags.indexOf('m', index + 1) >= 0) {<NEW_LINE>throw new ThrowException(context, context.createSyntaxError("'m' flag specified more than once"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>index = flags.indexOf('i');<NEW_LINE>if (index >= 0) {<NEW_LINE>if (flags.indexOf('i', index + 1) >= 0) {<NEW_LINE>throw new ThrowException(context, context.createSyntaxError("'i' flag specified more than once"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (index >= 0) {<NEW_LINE>if (flags.indexOf('g', index + 1) >= 0) {<NEW_LINE>throw new ThrowException(context, context.createSyntaxError("'g' flag specified more than once"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | index = flags.indexOf('g'); |
1,552,254 | public Statement convert(org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall statement) {<NEW_LINE>Statement newStatement;<NEW_LINE>int sourceStart = statement.sourceStart;<NEW_LINE>if (statement.isSuperAccess() || statement.isSuper()) {<NEW_LINE>SuperConstructorInvocation superConstructorInvocation = new SuperConstructorInvocation(this.ast);<NEW_LINE>if (statement.qualification != null) {<NEW_LINE>superConstructorInvocation.setExpression(convert(statement.qualification));<NEW_LINE>}<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.Expression[] arguments = statement.arguments;<NEW_LINE>if (arguments != null) {<NEW_LINE>int length = arguments.length;<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>superConstructorInvocation.arguments().add(convert(arguments[i]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (statement.typeArguments != null) {<NEW_LINE>if (sourceStart > statement.typeArgumentsSourceStart) {<NEW_LINE>sourceStart = statement.typeArgumentsSourceStart;<NEW_LINE>}<NEW_LINE>switch(this.ast.apiLevel) {<NEW_LINE>case AST.JLS2_INTERNAL:<NEW_LINE>superConstructorInvocation.setFlags(superConstructorInvocation.getFlags() | ASTNode.MALFORMED);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>for (int i = 0, max = statement.typeArguments.length; i < max; i++) {<NEW_LINE>superConstructorInvocation.typeArguments().add(convertType(statement.typeArguments[i]));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newStatement = superConstructorInvocation;<NEW_LINE>} else {<NEW_LINE>ConstructorInvocation constructorInvocation = new ConstructorInvocation(this.ast);<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.Expression[] arguments = statement.arguments;<NEW_LINE>if (arguments != null) {<NEW_LINE>int length = arguments.length;<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>constructorInvocation.arguments().add(convert(arguments[i]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (statement.typeArguments != null) {<NEW_LINE>if (sourceStart > statement.typeArgumentsSourceStart) {<NEW_LINE>sourceStart = statement.typeArgumentsSourceStart;<NEW_LINE>}<NEW_LINE>switch(this.ast.apiLevel) {<NEW_LINE>case AST.JLS2_INTERNAL:<NEW_LINE>constructorInvocation.setFlags(constructorInvocation.getFlags() | ASTNode.MALFORMED);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>for (int i = 0, max = statement.typeArguments.length; i < max; i++) {<NEW_LINE>constructorInvocation.typeArguments().add(convertType(statement.typeArguments[i]));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (statement.qualification != null) {<NEW_LINE>// this is an error<NEW_LINE>constructorInvocation.setFlags(constructorInvocation.<MASK><NEW_LINE>}<NEW_LINE>newStatement = constructorInvocation;<NEW_LINE>}<NEW_LINE>newStatement.setSourceRange(sourceStart, statement.sourceEnd - sourceStart + 1);<NEW_LINE>if (this.resolveBindings) {<NEW_LINE>recordNodes(newStatement, statement);<NEW_LINE>}<NEW_LINE>return newStatement;<NEW_LINE>} | getFlags() | ASTNode.MALFORMED); |
949,963 | public DescribeDataSourcesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeDataSourcesResult describeDataSourcesResult = new DescribeDataSourcesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeDataSourcesResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Results", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeDataSourcesResult.setResults(new ListUnmarshaller<DataSource>(DataSourceJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeDataSourcesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeDataSourcesResult;<NEW_LINE>} | )).unmarshall(context)); |
1,389,827 | /* Build call for policiesMediationMediationPolicyIdDelete */<NEW_LINE>private com.squareup.okhttp.Call policiesMediationMediationPolicyIdDeleteCall(String mediationPolicyId, String ifMatch, String ifUnmodifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/policies/mediation/{mediationPolicyId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "mediationPolicyId" + "\\}", apiClient.escapeString(mediationPolicyId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (ifMatch != null)<NEW_LINE>localVarHeaderParams.put("If-Match", apiClient.parameterToString(ifMatch));<NEW_LINE>if (ifUnmodifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Unmodified-Since", apiClient.parameterToString(ifUnmodifiedSince));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final <MASK><NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | String[] localVarAccepts = { "application/json" }; |
1,787,074 | public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>final InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);<NEW_LINE>// Async Object<NEW_LINE>target.addField(AsyncContextAccessor.class);<NEW_LINE>target.addField(ReactorContextAccessor.class);<NEW_LINE>for (InstrumentMethod constructorMethod : target.getDeclaredConstructors()) {<NEW_LINE>final String[<MASK><NEW_LINE>if (parameterTypes != null || parameterTypes.length > 0) {<NEW_LINE>constructorMethod.addInterceptor(FluxDelaySubscriptionConstructorInterceptor.class);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final InstrumentMethod subscribeMethod = target.getDeclaredMethod("subscribe", "reactor.core.CoreSubscriber");<NEW_LINE>if (subscribeMethod != null) {<NEW_LINE>subscribeMethod.addInterceptor(FluxDelaySubscriptionSubscribeInterceptor.class, va(ReactorConstants.REACTOR_NETTY));<NEW_LINE>}<NEW_LINE>// since 3.3.0<NEW_LINE>final InstrumentMethod subscribeOrReturnMethod = target.getDeclaredMethod("subscribeOrReturn", "reactor.core.CoreSubscriber");<NEW_LINE>if (subscribeOrReturnMethod != null) {<NEW_LINE>subscribeOrReturnMethod.addInterceptor(FluxDelaySubscriptionSubscribeInterceptor.class, va(ReactorConstants.REACTOR_NETTY));<NEW_LINE>}<NEW_LINE>final InstrumentMethod acceptMethod = target.getDeclaredMethod("accept", "reactor.core.publisher.FluxDelaySubscription$DelaySubscriptionOtherSubscriber");<NEW_LINE>if (acceptMethod != null) {<NEW_LINE>acceptMethod.addInterceptor(FluxDelaySubscriptionSubscribeInterceptor.class, va(ReactorConstants.REACTOR_NETTY));<NEW_LINE>}<NEW_LINE>return target.toBytecode();<NEW_LINE>} | ] parameterTypes = constructorMethod.getParameterTypes(); |
875,764 | private Unit createUnit(Business business, PullResult result, Unit sup, Department org) throws Exception {<NEW_LINE>EntityManagerContainer emc = business.entityManagerContainer();<NEW_LINE>Unit unit = new Unit();<NEW_LINE>emc.beginTransaction(Unit.class);<NEW_LINE>unit.<MASK><NEW_LINE>unit.setUnique(org.getId().toString());<NEW_LINE>unit.setQiyeweixinId(org.getId().toString());<NEW_LINE>unit.setQiyeweixinHash(DigestUtils.sha256Hex(XGsonBuilder.toJson(org)));<NEW_LINE>if (null != sup) {<NEW_LINE>unit.setSuperior(sup.getId());<NEW_LINE>}<NEW_LINE>if (null != org.getOrder()) {<NEW_LINE>unit.setOrderNumber(org.getOrder().intValue());<NEW_LINE>}<NEW_LINE>business.unit().adjustInherit(unit);<NEW_LINE>emc.persist(unit);<NEW_LINE>emc.commit();<NEW_LINE>result.getCreateUnitList().add(unit.getDistinguishedName());<NEW_LINE>return unit;<NEW_LINE>} | setName(org.getName()); |
1,690,166 | public static double weightedCoefficient(NumberVector x, NumberVector y, NumberVector weights) {<NEW_LINE>final int xdim = x.getDimensionality(), ydim = y.getDimensionality();<NEW_LINE>if (xdim != ydim) {<NEW_LINE>throw new IllegalArgumentException("Invalid arguments: feature vectors differ in dimensionality.");<NEW_LINE>}<NEW_LINE>if (xdim != weights.getDimensionality()) {<NEW_LINE>throw new IllegalArgumentException("Dimensionality doesn't agree to weights.");<NEW_LINE>}<NEW_LINE>if (xdim == 0) {<NEW_LINE>throw new IllegalArgumentException("Empty vector.");<NEW_LINE>}<NEW_LINE>// Inlined computation of Pearson correlation, to avoid allocating objects!<NEW_LINE>// This is a numerically stabilized version, avoiding sum-of-squares.<NEW_LINE>double sumXX = 0., sumYY = 0., sumXY = 0., <MASK><NEW_LINE>double sumX = x.doubleValue(0) * sumWe, sumY = y.doubleValue(0) * sumWe;<NEW_LINE>for (int i = 1; i < xdim; ++i) {<NEW_LINE>final double xv = x.doubleValue(i), yv = y.doubleValue(i);<NEW_LINE>final double w = weights.doubleValue(i);<NEW_LINE>// Delta to previous mean<NEW_LINE>final double deltaX = xv * sumWe - sumX, deltaY = yv * sumWe - sumY;<NEW_LINE>// Increment count first<NEW_LINE>// Convert to double!<NEW_LINE>final double oldWe = sumWe;<NEW_LINE>sumWe += w;<NEW_LINE>final double f = w / (sumWe * oldWe);<NEW_LINE>// Update<NEW_LINE>sumXX += f * deltaX * deltaX;<NEW_LINE>sumYY += f * deltaY * deltaY;<NEW_LINE>// should equal deltaY * neltaX!<NEW_LINE>sumXY += f * deltaX * deltaY;<NEW_LINE>// Update sums<NEW_LINE>sumX += xv * w;<NEW_LINE>sumY += yv * w;<NEW_LINE>}<NEW_LINE>// One or both series were constant:<NEW_LINE>return //<NEW_LINE>//<NEW_LINE>!(sumXX > 0. && sumYY > 0.) ? sumXX == sumYY ? 1. : 0. : sumXY / Math.sqrt(sumXX * sumYY);<NEW_LINE>} | sumWe = weights.doubleValue(0); |
1,598,589 | protected static OutgoingSipServletResponse createOutgoingResponse(IncomingSipServletRequest origRequest, SipServletResponse response) {<NEW_LINE>// get the to tag so we can create a proper response<NEW_LINE>AddressImpl to = (AddressImpl) response.getTo();<NEW_LINE>String toTag = to.getTag();<NEW_LINE>TransactionUserWrapper transactionUser = ((<MASK><NEW_LINE>// create the response<NEW_LINE>OutgoingSipServletResponse outgoingResponse = origRequest.createResponse(response.getStatus(), response.getReasonPhrase(), toTag, transactionUser);<NEW_LINE>outgoingResponse.markAsProxyResponse();<NEW_LINE>// Copy content<NEW_LINE>copyContent(outgoingResponse, response);<NEW_LINE>// copy headers to the outgoing response<NEW_LINE>copyResponseHeaders(outgoingResponse, response, origRequest);<NEW_LINE>// TransactionUserWrapper origTU = origRequest.getTransactionUser();<NEW_LINE>// if (origTU != null && origTU != transactionUser) {<NEW_LINE>// outgoingResponse.setTransactionUser(transactionUser);<NEW_LINE>// if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>// c_logger.traceDebug(BranchManager.class, "createOutgoingResponse",<NEW_LINE>// "response TU was changed to: " + transactionUser);<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>if (origRequest.getTransaction().isTerminated()) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(BranchManager.class, "createOutgoingResponse", "This response will be sent directly over the SipStack.");<NEW_LINE>}<NEW_LINE>outgoingResponse.setShouldBeSentWithoutST(true);<NEW_LINE>}<NEW_LINE>return outgoingResponse;<NEW_LINE>} | IncomingSipServletResponse) response).getTransactionUser(); |
1,010,537 | private void loadParentAccountList(AccountType accountType) {<NEW_LINE>String condition = DatabaseSchema.SplitEntry.COLUMN_TYPE + " IN (" + getAllowedParentAccountTypes(accountType) + ") AND " <MASK><NEW_LINE>if (mAccount != null) {<NEW_LINE>// if editing an account<NEW_LINE>mDescendantAccountUIDs = mAccountsDbAdapter.getDescendantAccountUIDs(mAccount.getUID(), null, null);<NEW_LINE>String rootAccountUID = mAccountsDbAdapter.getOrCreateGnuCashRootAccountUID();<NEW_LINE>List<String> descendantAccountUIDs = new ArrayList<>(mDescendantAccountUIDs);<NEW_LINE>if (rootAccountUID != null)<NEW_LINE>descendantAccountUIDs.add(rootAccountUID);<NEW_LINE>// limit cyclic account hierarchies.<NEW_LINE>condition += " AND (" + DatabaseSchema.AccountEntry.COLUMN_UID + " NOT IN ( '" + TextUtils.join("','", descendantAccountUIDs) + "','" + mAccountUID + "' ) )";<NEW_LINE>}<NEW_LINE>// if we are reloading the list, close the previous cursor first<NEW_LINE>if (mParentAccountCursor != null)<NEW_LINE>mParentAccountCursor.close();<NEW_LINE>mParentAccountCursor = mAccountsDbAdapter.fetchAccountsOrderedByFullName(condition, null);<NEW_LINE>final View view = getView();<NEW_LINE>assert view != null;<NEW_LINE>if (mParentAccountCursor.getCount() <= 0) {<NEW_LINE>// disable before hiding, else we can still read it when saving<NEW_LINE>mParentCheckBox.setChecked(false);<NEW_LINE>view.findViewById(R.id.layout_parent_account).setVisibility(View.GONE);<NEW_LINE>view.findViewById(R.id.label_parent_account).setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>view.findViewById(R.id.layout_parent_account).setVisibility(View.VISIBLE);<NEW_LINE>view.findViewById(R.id.label_parent_account).setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>mParentAccountCursorAdapter = new QualifiedAccountNameCursorAdapter(getActivity(), mParentAccountCursor);<NEW_LINE>mParentAccountSpinner.setAdapter(mParentAccountCursorAdapter);<NEW_LINE>} | + DatabaseSchema.AccountEntry.COLUMN_HIDDEN + "!=1 "; |
1,415,666 | private void updateFlatView(boolean sync) {<NEW_LINE>if (!force_refresh) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!sync && Utils.isSWTThread()) {<NEW_LINE>Utils.getOffOfSWTThread(() -> updateFlatView(false));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>force_refresh = false;<NEW_LINE>List<DiskManagerFileInfo> files = getFileInfo();<NEW_LINE>if (files.size() == 0) {<NEW_LINE>tv.removeAllTableRows();<NEW_LINE>} else {<NEW_LINE>Collection<DiskManagerFileInfo> toRemove = tv.getDataSources(true);<NEW_LINE>// If we are removing a lot of rows, it's faster to clear and add<NEW_LINE>if (toRemove.size() - files.size() > 50000) {<NEW_LINE>// todo: restore selectedRows<NEW_LINE>tv.removeAllTableRows();<NEW_LINE>toRemove = new HashSet<>();<NEW_LINE>}<NEW_LINE>List<DiskManagerFileInfo> toAdd = new ArrayList<>();<NEW_LINE>for (DiskManagerFileInfo info : files) {<NEW_LINE>if (toRemove.contains(info)) {<NEW_LINE>toRemove.remove(info);<NEW_LINE>} else {<NEW_LINE>toAdd.add(info);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tv.removeDataSources(toRemove.toArray(new DiskManagerFileInfo[0]));<NEW_LINE>tv.addDataSources(toAdd.toArray<MASK><NEW_LINE>tv.tableInvalidate();<NEW_LINE>if (sync) {<NEW_LINE>tv.processDataSourceQueueSync();<NEW_LINE>} else {<NEW_LINE>tv.processDataSourceQueue();<NEW_LINE>}<NEW_LINE>AEThread2.createAndStartDaemon("TableSorter", () -> {<NEW_LINE>long start = SystemTime.getMonotonousTime();<NEW_LINE>// this has the added bonus of forcing a sort which we particularly need if the user<NEW_LINE>// has disabled automatic resorts - we want the initial view to at least be sorted<NEW_LINE>while (tv.hasChangesPending()) {<NEW_LINE>if (SystemTime.getMonotonousTime() - start > 5000) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(100);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | (new DiskManagerFileInfo[0])); |
1,406,217 | public void focusOnMarkers(MicrolocationClusterWrapper item) {<NEW_LINE>map.animateCamera(CameraUpdateFactory.newLatLngZoom(item.getPosition(), map.getMaxZoomLevel()), new GoogleMap.CancelableCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFinish() {<NEW_LINE>Handler handler = new Handler();<NEW_LINE>handler.postDelayed(() -> {<NEW_LINE>Marker marker = item.getMarker();<NEW_LINE>if (microlocationClusterWrapper != null)<NEW_LINE>getMarker(microlocationClusterWrapper).setIcon(ImageUtils.vectorToBitmap(context, R.drawable.map_marker<MASK><NEW_LINE>if (marker != null) {<NEW_LINE>microlocationClusterWrapper = item;<NEW_LINE>marker.showInfoWindow();<NEW_LINE>marker.setIcon(ImageUtils.vectorToBitmap(context, R.drawable.map_marker, R.color.color_primary));<NEW_LINE>}<NEW_LINE>}, 100);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCancel() {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | , R.color.dark_grey)); |
1,822,964 | protected void initializeConfiguration(SqlConnectOptions connectOptions) {<NEW_LINE>if (!(connectOptions instanceof MySQLConnectOptions)) {<NEW_LINE>throw new IllegalArgumentException("mismatched connect options type");<NEW_LINE>}<NEW_LINE>MySQLConnectOptions options = (MySQLConnectOptions) connectOptions;<NEW_LINE>MySQLCollation collation;<NEW_LINE>if (options.getCollation() != null) {<NEW_LINE>// override the collation if configured<NEW_LINE>collation = MySQLCollation.<MASK><NEW_LINE>charsetEncoding = Charset.forName(collation.mappedJavaCharsetName());<NEW_LINE>} else {<NEW_LINE>String charset = options.getCharset();<NEW_LINE>if (charset == null) {<NEW_LINE>collation = MySQLCollation.DEFAULT_COLLATION;<NEW_LINE>} else {<NEW_LINE>collation = MySQLCollation.valueOfName(MySQLCollation.getDefaultCollationFromCharsetName(charset));<NEW_LINE>}<NEW_LINE>String characterEncoding = options.getCharacterEncoding();<NEW_LINE>if (characterEncoding == null) {<NEW_LINE>charsetEncoding = Charset.defaultCharset();<NEW_LINE>} else {<NEW_LINE>charsetEncoding = Charset.forName(options.getCharacterEncoding());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.collation = collation;<NEW_LINE>this.useAffectedRows = options.isUseAffectedRows();<NEW_LINE>this.sslMode = options.isUsingDomainSocket() ? SslMode.DISABLED : options.getSslMode();<NEW_LINE>this.authenticationPlugin = options.getAuthenticationPlugin();<NEW_LINE>// server RSA public key<NEW_LINE>Buffer serverRsaPublicKey = null;<NEW_LINE>if (options.getServerRsaPublicKeyValue() != null) {<NEW_LINE>serverRsaPublicKey = options.getServerRsaPublicKeyValue();<NEW_LINE>} else {<NEW_LINE>if (options.getServerRsaPublicKeyPath() != null) {<NEW_LINE>serverRsaPublicKey = vertx.fileSystem().readFileBlocking(options.getServerRsaPublicKeyPath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.serverRsaPublicKey = serverRsaPublicKey;<NEW_LINE>// check the SSLMode here<NEW_LINE>switch(sslMode) {<NEW_LINE>case VERIFY_IDENTITY:<NEW_LINE>String hostnameVerificationAlgorithm = options.getHostnameVerificationAlgorithm();<NEW_LINE>if (hostnameVerificationAlgorithm == null || hostnameVerificationAlgorithm.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Host verification algorithm must be specified under VERIFY_IDENTITY ssl-mode.");<NEW_LINE>}<NEW_LINE>case VERIFY_CA:<NEW_LINE>TrustOptions trustOptions = options.getTrustOptions();<NEW_LINE>if (trustOptions == null) {<NEW_LINE>throw new IllegalArgumentException("Trust options must be specified under " + sslMode.name() + " ssl-mode.");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | valueOfName(options.getCollation()); |
1,273,292 | final RegisterConnectorResult executeRegisterConnector(RegisterConnectorRequest registerConnectorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(registerConnectorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RegisterConnectorRequest> request = null;<NEW_LINE>Response<RegisterConnectorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RegisterConnectorRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Appflow");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RegisterConnector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RegisterConnectorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RegisterConnectorResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(registerConnectorRequest)); |
1,629,035 | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {<NEW_LINE>_logger.debug("postHandle");<NEW_LINE>final Apps app = (Apps) WebContext.getAttribute(WebConstants.AUTHORIZE_SIGN_ON_APP);<NEW_LINE>String sessionId = (String) WebContext.getAttribute(WebConstants.CURRENT_USER_SESSION_ID);<NEW_LINE>final UserInfo userInfo = WebContext.getUserInfo();<NEW_LINE>_logger.debug("sessionId : " + sessionId + " ,appId : " + app.getId());<NEW_LINE>HistoryLoginApps historyLoginApps = new HistoryLoginApps();<NEW_LINE>historyLoginApps.setAppId(app.getId());<NEW_LINE>historyLoginApps.setSessionId(sessionId);<NEW_LINE>historyLoginApps.setAppName(app.getName());<NEW_LINE>historyLoginApps.<MASK><NEW_LINE>historyLoginApps.setUsername(userInfo.getUsername());<NEW_LINE>historyLoginApps.setDisplayName(userInfo.getDisplayName());<NEW_LINE>historyLoginApps.setInstId(userInfo.getInstId());<NEW_LINE>historyLoginAppsService.insert(historyLoginApps);<NEW_LINE>WebContext.removeAttribute(WebConstants.CURRENT_SINGLESIGNON_URI);<NEW_LINE>WebContext.removeAttribute(WebConstants.SINGLE_SIGN_ON_APP_ID);<NEW_LINE>} | setUserId(userInfo.getId()); |
1,476,032 | public GlmModelData deserializeModel(Params meta, Iterable<String> data) {<NEW_LINE>GlmModelData modelData = new GlmModelData();<NEW_LINE>modelData.featureColNames = meta.get(GlmTrainParams.FEATURE_COLS);<NEW_LINE>modelData.offsetColName = meta.get(GlmTrainParams.OFFSET_COL);<NEW_LINE>modelData.weightColName = meta.get(GlmTrainParams.WEIGHT_COL);<NEW_LINE>modelData.labelColName = meta.get(GlmTrainParams.LABEL_COL);<NEW_LINE>modelData.familyName = meta.get(GlmTrainParams.FAMILY);<NEW_LINE>modelData.variancePower = meta.get(GlmTrainParams.VARIANCE_POWER);<NEW_LINE>modelData.linkName = meta.get(GlmTrainParams.LINK);<NEW_LINE>modelData.linkPower = meta.get(GlmTrainParams.LINK_POWER);<NEW_LINE>modelData.fitIntercept = meta.get(GlmTrainParams.FIT_INTERCEPT);<NEW_LINE>modelData.regParam = meta.get(GlmTrainParams.REG_PARAM);<NEW_LINE>modelData.numIter = meta.get(GlmTrainParams.MAX_ITER);<NEW_LINE>modelData.epsilon = meta.get(GlmTrainParams.EPSILON);<NEW_LINE>Iterator<String> dataIterator = data.iterator();<NEW_LINE>modelData.coefficients = JsonConverter.fromJson(dataIterator.next(), double[].class);<NEW_LINE>modelData.intercept = JsonConverter.fromJson(dataIterator.<MASK><NEW_LINE>modelData.diagInvAtWA = JsonConverter.fromJson(dataIterator.next(), double[].class);<NEW_LINE>if (dataIterator.hasNext()) {<NEW_LINE>modelData.modelSummary = JsonConverter.fromJson(dataIterator.next(), GlmModelSummary.class);<NEW_LINE>}<NEW_LINE>return modelData;<NEW_LINE>} | next(), double.class); |
667,453 | protected Object solidBase(Object type, GetBaseClassNode getBaseClassNode, PythonContext context, ReadAttributeFromObjectNode readAttr, BranchProfile typeIsNotBase, BranchProfile hasBase, BranchProfile hasNoBase, int depth) {<NEW_LINE>CompilerAsserts.partialEvaluationConstant(depth);<NEW_LINE>Object base = getBaseClassNode.execute(type);<NEW_LINE>if (base != null) {<NEW_LINE>hasBase.enter();<NEW_LINE>if (depth > 3) {<NEW_LINE>base = solidBaseTB(base, getBaseClassNode, context, depth);<NEW_LINE>} else {<NEW_LINE>base = solidBase(base, getBaseClassNode, context, readAttr, typeIsNotBase, hasBase, hasNoBase, depth + 1);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>hasNoBase.enter();<NEW_LINE>base = context.lookupType(PythonBuiltinClassType.PythonObject);<NEW_LINE>}<NEW_LINE>if (type == base) {<NEW_LINE>return type;<NEW_LINE>}<NEW_LINE>typeIsNotBase.enter();<NEW_LINE>Object <MASK><NEW_LINE>if (extraivars(type, base, typeSlots)) {<NEW_LINE>return type;<NEW_LINE>} else {<NEW_LINE>return base;<NEW_LINE>}<NEW_LINE>} | typeSlots = getSlotsFromType(type, readAttr); |
1,425,474 | private void colourLine(LineStyleEvent event) {<NEW_LINE>if (theme == null)<NEW_LINE>return;<NEW_LINE>if (!mateText.shouldColour())<NEW_LINE>return;<NEW_LINE>int eventLine = mateText.getControl().getLineAtOffset(event.lineOffset);<NEW_LINE>// System.out.printf("c%d, ", eventLine);<NEW_LINE>// ArrayList<Scope> scopes = mateText.parser.root.scopesOnLine(eventLine);<NEW_LINE>int startLineOffset = event.lineOffset;<NEW_LINE>int endLineOffset;<NEW_LINE>if (eventLine >= mateText.getControl().getLineCount() - 1)<NEW_LINE>endLineOffset = mateText<MASK><NEW_LINE>else<NEW_LINE>endLineOffset = mateText.getControl().getOffsetAtLine(eventLine + 1);<NEW_LINE>ArrayList<Scope> scopes = mateText.parser.root.scopesBetween(startLineOffset, endLineOffset);<NEW_LINE>// System.out.printf("[Color] colouring %d (%d-%d) n%d\n", eventLine, startLineOffset, endLineOffset, scopes.size());<NEW_LINE>// System.out.printf("[Color] got to colour %d scopes\n", scopes.size());<NEW_LINE>ArrayList<StyleRange> styleRanges = new ArrayList<StyleRange>();<NEW_LINE>for (Scope scope : scopes) {<NEW_LINE>// System.out.printf("[Color] scope: %s\n", scope.name);<NEW_LINE>if (scope.parent == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (scope.name == null && scope.pattern != null && (scope.pattern instanceof SinglePattern || ((DoublePattern) scope.pattern).contentName == null)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>addStyleRangeForScope(styleRanges, scope, false, event);<NEW_LINE>if (scope.pattern instanceof DoublePattern && ((DoublePattern) scope.pattern).contentName != null && scope.isCapture == false)<NEW_LINE>addStyleRangeForScope(styleRanges, scope, true, event);<NEW_LINE>// printStyleRanges(styleRanges);<NEW_LINE>}<NEW_LINE>int tabWidth = mateText.getControl().getTabs();<NEW_LINE>addMarginColumnStyleRange(styleRanges, event, tabWidth);<NEW_LINE>event.styles = (StyleRange[]) styleRanges.toArray(new StyleRange[0]);<NEW_LINE>} | .getControl().getCharCount(); |
34,769 | public void saveParam(Object obj) throws Exception {<NEW_LINE>OptionsParam optionsParam = (OptionsParam) obj;<NEW_LINE>ConnectionParam connectionParam = optionsParam.getConnectionParam();<NEW_LINE>connectionParam.setProxyChainName(txtProxyChainName.getText());<NEW_LINE>// ZAP: Do not allow invalid port numbers<NEW_LINE>connectionParam.setProxyChainPort(spinnerProxyChainPort.getValue());<NEW_LINE>connectionParam.setProxyExcludedDomains(getProxyExcludedDomainsTableModel().getElements());<NEW_LINE>connectionParam.setConfirmRemoveProxyExcludedDomain(!getProxyExcludedDomainsPanel().isRemoveWithoutConfirmation());<NEW_LINE>connectionParam.setProxyChainRealm(txtProxyChainRealm.getText());<NEW_LINE>connectionParam.setProxyChainUserName(txtProxyChainUserName.getText());<NEW_LINE>connectionParam.setProxyChainPrompt(chkProxyChainPrompt.isSelected());<NEW_LINE>// ZAP: Added prompt option<NEW_LINE>if (chkUseProxyChain.isSelected() && chkProxyChainAuth.isSelected() && chkProxyChainPrompt.isSelected()) {<NEW_LINE>if (View.isInitialised()) {<NEW_LINE>// And prompt now<NEW_LINE>ProxyDialog dialog = new ProxyDialog(View.getSingleton(<MASK><NEW_LINE>dialog.init(Model.getSingleton().getOptionsParam());<NEW_LINE>dialog.setVisible(true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>connectionParam.setProxyChainPassword(new String(txtProxyChainPassword.getPassword()));<NEW_LINE>}<NEW_LINE>connectionParam.setTimeoutInSecs(spinnerTimeoutInSecs.getValue());<NEW_LINE>connectionParam.setHttpStateEnabled(checkBoxHttpStateEnabled.isSelected());<NEW_LINE>connectionParam.setUseProxyChain(chkUseProxyChain.isSelected());<NEW_LINE>connectionParam.setUseProxyChainAuth(chkProxyChainAuth.isSelected());<NEW_LINE>connectionParam.setDnsTtlSuccessfulQueries(dnsTtlSuccessfulQueriesNumberSpinner.getValue());<NEW_LINE>connectionParam.setSecurityProtocolsEnabled(securityProtocolsPanel.getSelectedProtocols());<NEW_LINE>connectionParam.setDefaultUserAgent(defaultUserAgent.getText());<NEW_LINE>socksProxyPanel.saveParam(connectionParam);<NEW_LINE>} | ).getMainFrame(), true); |
1,415,578 | public void deleteMonitoredItems(ServiceRequest service) throws UaException {<NEW_LINE>DeleteMonitoredItemsRequest request = <MASK><NEW_LINE>UInteger subscriptionId = request.getSubscriptionId();<NEW_LINE>Subscription subscription = subscriptions.get(subscriptionId);<NEW_LINE>List<UInteger> itemsToDelete = l(request.getMonitoredItemIds());<NEW_LINE>if (subscription == null) {<NEW_LINE>throw new UaException(StatusCodes.Bad_SubscriptionIdInvalid);<NEW_LINE>}<NEW_LINE>if (itemsToDelete.isEmpty()) {<NEW_LINE>throw new UaException(StatusCodes.Bad_NothingToDo);<NEW_LINE>}<NEW_LINE>StatusCode[] deleteResults = new StatusCode[itemsToDelete.size()];<NEW_LINE>List<BaseMonitoredItem<?>> deletedItems = newArrayListWithCapacity(itemsToDelete.size());<NEW_LINE>synchronized (subscription) {<NEW_LINE>for (int i = 0; i < itemsToDelete.size(); i++) {<NEW_LINE>UInteger itemId = itemsToDelete.get(i);<NEW_LINE>BaseMonitoredItem<?> item = subscription.getMonitoredItems().get(itemId);<NEW_LINE>if (item == null) {<NEW_LINE>deleteResults[i] = new StatusCode(StatusCodes.Bad_MonitoredItemIdInvalid);<NEW_LINE>} else {<NEW_LINE>deletedItems.add(item);<NEW_LINE>deleteResults[i] = StatusCode.GOOD;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>subscription.removeMonitoredItems(deletedItems);<NEW_LINE>}<NEW_LINE>byMonitoredItemType(deletedItems, dataItems -> server.getAddressSpaceManager().onDataItemsDeleted(dataItems), eventItems -> server.getAddressSpaceManager().onEventItemsDeleted(eventItems));<NEW_LINE>ResponseHeader header = service.createResponseHeader();<NEW_LINE>DeleteMonitoredItemsResponse response = new DeleteMonitoredItemsResponse(header, deleteResults, new DiagnosticInfo[0]);<NEW_LINE>service.setResponse(response);<NEW_LINE>} | (DeleteMonitoredItemsRequest) service.getRequest(); |
1,218,431 | public VirtualNetworkModel lookupPublicNetworkModel() {<NEW_LINE>List<TrafficType> types = new ArrayList<TrafficType>();<NEW_LINE>types.add(TrafficType.Public);<NEW_LINE>List<NetworkVO> dbNets = findManagedNetworks(types);<NEW_LINE>if (dbNets == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>NetworkVO net = dbNets.get(0);<NEW_LINE>VirtualNetworkModel vnModel = getDatabase().lookupVirtualNetwork(net.getUuid(), getCanonicalName(net), TrafficType.Public);<NEW_LINE>if (vnModel == null) {<NEW_LINE>vnModel = new VirtualNetworkModel(net, net.getUuid(), getCanonicalName(net), net.getTrafficType());<NEW_LINE>vnModel.<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!vnModel.verify(getModelController())) {<NEW_LINE>vnModel.update(getModelController());<NEW_LINE>}<NEW_LINE>getDatabase().getVirtualNetworks().add(vnModel);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>s_logger.warn("virtual-network update: ", ex);<NEW_LINE>}<NEW_LINE>return vnModel;<NEW_LINE>} | setProperties(getModelController(), net); |
1,485,422 | // Test that ensures unwrapping a DataSource backed by Driver to the underlying Driver interface is not possible<NEW_LINE>@Test<NEW_LINE>@ExpectedFFDC({ "java.sql.SQLException" })<NEW_LINE>public void testUnwrapDriver() throws Exception {<NEW_LINE>assertFalse("fatDriverDS should not wrap Driver", fatDriverDS<MASK><NEW_LINE>try {<NEW_LINE>fatDriverDS.unwrap(Driver.class);<NEW_LINE>fail("Should not be able to unwrap to the Driver interface");<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>if (!ex.getMessage().contains("DSRA9122E"))<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>// It should however still be able to be unwrapped to an interface impl'd by WsJdbcDataSource<NEW_LINE>assertTrue("fatDriverDS should wrap CommonDataSource", fatDriverDS.isWrapperFor(CommonDataSource.class));<NEW_LINE>CommonDataSource ds = fatDriverDS.unwrap(CommonDataSource.class);<NEW_LINE>assertSame("The WSJdbcDataSource instance should have been returned by the call to unwrap", fatDriverDS, ds);<NEW_LINE>} | .isWrapperFor(Driver.class)); |
1,128,407 | static String signCompletedOAuth(final String host, final String path, final String method, final boolean https, final Parameters params, final String tokenSecret, final String consumerSecret) {<NEW_LINE>params.sort();<NEW_LINE>// Twitter requires that the signature is generated from the raw data that is received in the query string.<NEW_LINE>// Opencaching sites require that the signature is generated from the percent-encoded versions of the parameters.<NEW_LINE>// As a consequence, we will always use percent-encoding for parameters during the OAuth signing process, which<NEW_LINE>// satisfies both constraints.<NEW_LINE>params.usePercentEncoding();<NEW_LINE>final String requestPacked = method + '&' + Parameters.percentEncode((https ? "https" : "http") + "://" + host + path) + '&' + Parameters.percentEncode(params.toString());<NEW_LINE>// both even if empty some of them!<NEW_LINE>final String keysPacked = Parameters.percentEncode(consumerSecret) + '&' + Parameters.percentEncode<MASK><NEW_LINE>return CryptUtils.base64Encode(CryptUtils.hashHmac(requestPacked, keysPacked));<NEW_LINE>} | (StringUtils.defaultString(tokenSecret)); |
1,570,466 | public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {<NEW_LINE>int oldSectionIndex = mOldSectionIndex.get(oldItemPosition);<NEW_LINE>int oldItemIndex = mOldItemIndex.get(oldItemPosition);<NEW_LINE>int newSectionIndex = mNewSectionIndex.get(newItemPosition);<NEW_LINE>int <MASK><NEW_LINE>if (oldSectionIndex < 0 || newSectionIndex < 0) {<NEW_LINE>return oldSectionIndex == newSectionIndex && oldItemIndex == newItemIndex;<NEW_LINE>}<NEW_LINE>QMUISection<H, T> oldModel = mOldList.get(oldSectionIndex);<NEW_LINE>QMUISection<H, T> newModel = mNewList.get(newSectionIndex);<NEW_LINE>if (!oldModel.getHeader().isSameItem(newModel.getHeader())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (oldItemIndex < 0 && oldItemIndex == newItemIndex) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (oldItemIndex < 0 || newItemIndex < 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>T oldItem = oldModel.getItemAt(oldItemIndex);<NEW_LINE>T newItem = newModel.getItemAt(newItemIndex);<NEW_LINE>return (oldItem == null && newItem == null) || (oldItem != null && newItem != null && oldItem.isSameItem(newItem));<NEW_LINE>} | newItemIndex = mNewItemIndex.get(newItemPosition); |
541,234 | private boolean initPlayout(int sampleRate, int channels, double bufferSizeFactor) {<NEW_LINE>threadChecker.checkIsOnValidThread();<NEW_LINE>this.sampleRate = sampleRate;<NEW_LINE>Logging.d(TAG, "initPlayout(sampleRate=" + sampleRate + ", channels=" + channels + ", bufferSizeFactor=" + bufferSizeFactor + ")");<NEW_LINE>final int bytesPerFrame = channels * (BITS_PER_SAMPLE / 8);<NEW_LINE>this.bytesPerSample = bytesPerFrame;<NEW_LINE>this.channels = channels;<NEW_LINE>byteBuffer = ByteBuffer.allocateDirect(bytesPerFrame * (sampleRate / BUFFERS_PER_SECOND));<NEW_LINE>Logging.d(TAG, <MASK><NEW_LINE>emptyBytes = new byte[byteBuffer.capacity()];<NEW_LINE>// Rather than passing the ByteBuffer with every callback (requiring<NEW_LINE>// the potentially expensive GetDirectBufferAddress) we simply have the<NEW_LINE>// the native class cache the address to the memory once.<NEW_LINE>nativeCacheDirectBufferAddress(nativeAudioTrack, byteBuffer);<NEW_LINE>return true;<NEW_LINE>} | "byteBuffer.capacity: " + byteBuffer.capacity()); |
1,623,364 | public void processNodes(@NotNull NodeMaker nodeMaker, boolean executable) {<NEW_LINE>if (restrictions != null) {<NEW_LINE>// Create a primitive array for mapping<NEW_LINE>DeclareCommandsPacket.Node[] nodes = new DeclareCommandsPacket.Node[this.restrictions.length];<NEW_LINE>// Create a node for each restrictions as literal<NEW_LINE>for (int i = 0; i < nodes.length; i++) {<NEW_LINE>DeclareCommandsPacket.Node argumentNode = new DeclareCommandsPacket.Node();<NEW_LINE>argumentNode.flags = DeclareCommandsPacket.getFlag(DeclareCommandsPacket.NodeType.<MASK><NEW_LINE>argumentNode.name = this.restrictions[i];<NEW_LINE>nodes[i] = argumentNode;<NEW_LINE>}<NEW_LINE>nodeMaker.addNodes(nodes);<NEW_LINE>} else {<NEW_LINE>// Can be any word, add only one argument node<NEW_LINE>DeclareCommandsPacket.Node argumentNode = simpleArgumentNode(this, executable, false, false);<NEW_LINE>argumentNode.parser = "brigadier:string";<NEW_LINE>argumentNode.properties = BinaryWriter.makeArray(packetWriter -> {<NEW_LINE>// Single word<NEW_LINE>packetWriter.writeVarInt(0);<NEW_LINE>});<NEW_LINE>nodeMaker.addNodes(new DeclareCommandsPacket.Node[] { argumentNode });<NEW_LINE>}<NEW_LINE>} | LITERAL, executable, false, false); |
688,051 | final GetServicesInScopeResult executeGetServicesInScope(GetServicesInScopeRequest getServicesInScopeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getServicesInScopeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetServicesInScopeRequest> request = null;<NEW_LINE>Response<GetServicesInScopeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetServicesInScopeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getServicesInScopeRequest));<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, "AuditManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetServicesInScope");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetServicesInScopeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetServicesInScopeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
420,229 | public static INDArray applyMask(INDArray input, INDArray mask, int axis) {<NEW_LINE>long[] maskShape = mask.shape();<NEW_LINE>long rank = maskShape.length;<NEW_LINE>long[] tensorShape = input.shape();<NEW_LINE>Preconditions.checkState(maskShape.length > 0, "Mask shape must not be scalar");<NEW_LINE>long leadingSize = 1;<NEW_LINE>for (int i = 0; i < axis + rank; i++) {<NEW_LINE>leadingSize *= tensorShape[i];<NEW_LINE>}<NEW_LINE>List<Long> retShape = new ArrayList<>();<NEW_LINE>for (int i = 0; i < axis; i++) {<NEW_LINE>retShape.add(tensorShape[i]);<NEW_LINE>}<NEW_LINE>retShape.add(leadingSize);<NEW_LINE>for (int i = axis; i < axis + rank; i++) {<NEW_LINE>retShape.add(tensorShape[i]);<NEW_LINE>}<NEW_LINE>INDArray retTensor = input.reshape(Longs.toArray(retShape));<NEW_LINE>mask = mask.reshape(-1);<NEW_LINE>INDArray whereMask = Nd4j.getExecutioner().exec(new Where(mask))[0];<NEW_LINE>INDArray indices = Nd4j.getExecutioner().exec(new Squeeze(<MASK><NEW_LINE>INDArray ret = Nd4j.getExecutioner().exec(new Gather(retTensor, indices, axis))[0];<NEW_LINE>return ret;<NEW_LINE>} | whereMask, 1))[0]; |
479,957 | private void invalidateDocumentsAndViews(final ViewId viewId, final TableRecordReference currentSingleSelectedDocumentRef, final ProcessExecutionResult processExecutionResult) {<NEW_LINE>final Supplier<IView> viewSupplier = Suppliers.memoize(() -> {<NEW_LINE>if (viewId == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final IView view = viewsRepo.getViewIfExists(viewId);<NEW_LINE>if (view == null) {<NEW_LINE>logger.warn("No view found for {}. View invalidation will be skipped for {}", viewId, processExecutionResult);<NEW_LINE>}<NEW_LINE>return view;<NEW_LINE>});<NEW_LINE>//<NEW_LINE>// Refresh all<NEW_LINE>boolean viewInvalidateAllCalled = false;<NEW_LINE>if (processExecutionResult.isRefreshAllAfterExecution()) {<NEW_LINE>final IView view = viewSupplier.get();<NEW_LINE>if (view != null) {<NEW_LINE>// multiple rows selected<NEW_LINE>view.invalidateAll();<NEW_LINE>ViewChangesCollector.getCurrentOrAutoflush().collectFullyChanged(view);<NEW_LINE>viewInvalidateAllCalled = true;<NEW_LINE>documentsCollection.invalidateDocumentsByWindowId(view.<MASK><NEW_LINE>} else if (currentSingleSelectedDocumentRef != null) {<NEW_LINE>// single row selected<NEW_LINE>documentsCollection.invalidateDocumentByRecordId(currentSingleSelectedDocumentRef.getTableName(), currentSingleSelectedDocumentRef.getRecord_ID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Refresh required document<NEW_LINE>final TableRecordReference recordToRefresh = processExecutionResult.getRecordToRefreshAfterExecution();<NEW_LINE>if (recordToRefresh != null) {<NEW_LINE>documentsCollection.invalidateDocumentByRecordId(recordToRefresh.getTableName(), recordToRefresh.getRecord_ID());<NEW_LINE>final IView view = viewSupplier.get();<NEW_LINE>if (!viewInvalidateAllCalled && view != null) {<NEW_LINE>final boolean watchedByFrontend = viewsRepo.isWatchedByFrontend(view.getViewId());<NEW_LINE>view.notifyRecordsChanged(TableRecordReferenceSet.of(recordToRefresh), watchedByFrontend);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getViewId().getWindowId()); |
758,690 | private void generateCoverage(Project project, JBallerinaBackend jBallerinaBackend) throws IOException {<NEW_LINE>// Generate code coverage<NEW_LINE>if (!coverage) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (testReport == null) {<NEW_LINE>// This to avoid the spotbugs failure.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, ModuleCoverage> moduleCoverageMap = initializeCoverageMap(project);<NEW_LINE>// Following lists will hold the coverage information needed for the coverage XML file generation.<NEW_LINE>List<ISourceFileCoverage> packageSourceCoverageList = new ArrayList();<NEW_LINE>List<<MASK><NEW_LINE>List<IClassCoverage> packageBalClassCoverageList = new ArrayList();<NEW_LINE>List<ExecutionData> packageExecData = new ArrayList();<NEW_LINE>List<SessionInfo> packageSessionInfo = new ArrayList();<NEW_LINE>for (ModuleId moduleId : project.currentPackage().moduleIds()) {<NEW_LINE>Module module = project.currentPackage().module(moduleId);<NEW_LINE>CoverageReport coverageReport = new CoverageReport(module, moduleCoverageMap, packageNativeClassCoverageList, packageBalClassCoverageList, packageSourceCoverageList, packageExecData, packageSessionInfo);<NEW_LINE>coverageReport.generateReport(jBallerinaBackend, this.includesInCoverage, this.coverageReportFormat);<NEW_LINE>}<NEW_LINE>// Traverse coverage map and add module wise coverage to test report<NEW_LINE>for (Map.Entry mapElement : moduleCoverageMap.entrySet()) {<NEW_LINE>String moduleName = (String) mapElement.getKey();<NEW_LINE>ModuleCoverage moduleCoverage = (ModuleCoverage) mapElement.getValue();<NEW_LINE>testReport.addCoverage(moduleName, moduleCoverage);<NEW_LINE>}<NEW_LINE>if (CodeCoverageUtils.isRequestedReportFormat(this.coverageReportFormat, TesterinaConstants.JACOCO_XML_FORMAT)) {<NEW_LINE>// Generate coverage XML report<NEW_LINE>CodeCoverageUtils.createXMLReport(project, packageExecData, packageNativeClassCoverageList, packageBalClassCoverageList, packageSourceCoverageList, packageSessionInfo);<NEW_LINE>}<NEW_LINE>} | IClassCoverage> packageNativeClassCoverageList = new ArrayList(); |
1,785,768 | public StreamEvent find(StateEvent matchingEvent, IndexedEventHolder indexedEventHolder, StreamEventCloner storeEventCloner) {<NEW_LINE>Collection<StreamEvent> leftStreamEvents = leftCollectionExecutor.findEvents(matchingEvent, indexedEventHolder);<NEW_LINE>if (leftStreamEvents == null) {<NEW_LINE>return exhaustiveCollectionExecutor.find(matchingEvent, indexedEventHolder, storeEventCloner);<NEW_LINE>} else {<NEW_LINE>Collection<StreamEvent> rightStreamEvents = rightCollectionExecutor.findEvents(matchingEvent, indexedEventHolder);<NEW_LINE>if (rightStreamEvents == null) {<NEW_LINE>return exhaustiveCollectionExecutor.find(matchingEvent, indexedEventHolder, storeEventCloner);<NEW_LINE>} else {<NEW_LINE>ComplexEventChunk<StreamEvent> returnEventChunk = new ComplexEventChunk<>();<NEW_LINE>for (StreamEvent resultEvent : leftStreamEvents) {<NEW_LINE>if (storeEventCloner != null) {<NEW_LINE>returnEventChunk.add(storeEventCloner.copyStreamEvent(resultEvent));<NEW_LINE>} else {<NEW_LINE>returnEventChunk.add(resultEvent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (StreamEvent resultEvent : rightStreamEvents) {<NEW_LINE>if (!leftStreamEvents.contains(resultEvent)) {<NEW_LINE>if (storeEventCloner != null) {<NEW_LINE>returnEventChunk.add<MASK><NEW_LINE>} else {<NEW_LINE>returnEventChunk.add(resultEvent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return returnEventChunk.getFirst();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (storeEventCloner.copyStreamEvent(resultEvent)); |
1,614,530 | private void assertX509Token(X509Token token) {<NEW_LINE>String namespace = token.getName().getNamespaceURI();<NEW_LINE>if (token.isRequireEmbeddedTokenReference()) {<NEW_LINE>assertPolicy(new QName(namespace, SPConstants.REQUIRE_EMBEDDED_TOKEN_REFERENCE));<NEW_LINE>}<NEW_LINE>if (token.isRequireIssuerSerialReference()) {<NEW_LINE>assertPolicy(new QName(namespace, SPConstants.REQUIRE_ISSUER_SERIAL_REFERENCE));<NEW_LINE>}<NEW_LINE>if (token.isRequireKeyIdentifierReference()) {<NEW_LINE>assertPolicy(new QName<MASK><NEW_LINE>}<NEW_LINE>if (token.isRequireThumbprintReference()) {<NEW_LINE>assertPolicy(new QName(namespace, SPConstants.REQUIRE_THUMBPRINT_REFERENCE));<NEW_LINE>}<NEW_LINE>if (token.getTokenType() != null) {<NEW_LINE>assertPolicy(new QName(namespace, token.getTokenType().name()));<NEW_LINE>}<NEW_LINE>} | (namespace, SPConstants.REQUIRE_KEY_IDENTIFIER_REFERENCE)); |
382,583 | public static void openInstaller(Context context, String url, String title, String config, String checksum, boolean testDebug) {<NEW_LINE>try {<NEW_LINE>Intent intent = new Intent(context, InstallerActivity.class);<NEW_LINE>intent.setAction(Constants.INTENT_INSTALL_INTERNAL);<NEW_LINE>MainApplication.addSecret(intent);<NEW_LINE>intent.putExtra(Constants.EXTRA_INSTALL_PATH, url);<NEW_LINE>intent.<MASK><NEW_LINE>if (config != null && !config.isEmpty())<NEW_LINE>intent.putExtra(Constants.EXTRA_INSTALL_CONFIG, config);<NEW_LINE>if (checksum != null && !checksum.isEmpty())<NEW_LINE>intent.putExtra(Constants.EXTRA_INSTALL_CHECKSUM, checksum);<NEW_LINE>if (testDebug && BuildConfig.DEBUG)<NEW_LINE>intent.putExtra(Constants.EXTRA_INSTALL_TEST_ROOTLESS, true);<NEW_LINE>startActivity(context, intent, true);<NEW_LINE>} catch (ActivityNotFoundException e) {<NEW_LINE>Toast.makeText(context, "Failed to launch markdown activity", Toast.LENGTH_SHORT).show();<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | putExtra(Constants.EXTRA_INSTALL_NAME, title); |
1,373,850 | public OSSAsyncTask<PutBucketRefererResult> putBucketReferer(PutBucketRefererRequest request, OSSCompletedCallback<PutBucketRefererRequest, PutBucketRefererResult> completedCallback) {<NEW_LINE>RequestMessage requestMessage = new RequestMessage();<NEW_LINE>Map<String, String> query = new LinkedHashMap<String, String>();<NEW_LINE>query.put("referer", "");<NEW_LINE>requestMessage.setIsAuthorizationRequired(request.isAuthorizationRequired());<NEW_LINE>requestMessage.setEndpoint(endpoint);<NEW_LINE>requestMessage.setMethod(HttpMethod.PUT);<NEW_LINE>requestMessage.<MASK><NEW_LINE>requestMessage.setParameters(query);<NEW_LINE>try {<NEW_LINE>requestMessage.putBucketRefererRequestBodyMarshall(request.getReferers(), request.isAllowEmpty());<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>canonicalizeRequestMessage(requestMessage, request);<NEW_LINE>ExecutionContext<PutBucketRefererRequest, PutBucketRefererResult> executionContext = new ExecutionContext(getInnerClient(), request, applicationContext);<NEW_LINE>if (completedCallback != null) {<NEW_LINE>executionContext.setCompletedCallback(completedCallback);<NEW_LINE>}<NEW_LINE>ResponseParser<PutBucketRefererResult> parser = new ResponseParsers.PutBucketRefererResponseParser();<NEW_LINE>Callable<PutBucketRefererResult> callable = new OSSRequestTask<PutBucketRefererResult>(requestMessage, parser, executionContext, maxRetryCount);<NEW_LINE>return OSSAsyncTask.wrapRequestTask(executorService.submit(callable), executionContext);<NEW_LINE>} | setBucketName(request.getBucketName()); |
1,782,067 | private void ensureProbs(int word, boolean subtractTagScore) {<NEW_LINE>if (word == lastWord) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lastWord = word;<NEW_LINE>if (functionWordTags.containsKey(wordIndex.get(word))) {<NEW_LINE>logProbs = new ClassicCounter<>();<NEW_LINE>String trueTag = functionWordTags.get(wordIndex.get(word));<NEW_LINE>for (String tag : tagIndex.objectsList()) {<NEW_LINE>if (ctlp.basicCategory(tag).equals(trueTag)) {<NEW_LINE>logProbs.setCount(tag, 0);<NEW_LINE>} else {<NEW_LINE>logProbs.setCount(tag, Double.NEGATIVE_INFINITY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Datum datum = new BasicDatum(featExtractor.makeFeatures(<MASK><NEW_LINE>logProbs = scorer.logProbabilityOf(datum);<NEW_LINE>if (subtractTagScore) {<NEW_LINE>Set<String> tagSet = logProbs.keySet();<NEW_LINE>for (String tag : tagSet) {<NEW_LINE>logProbs.incrementCount(tag, -Math.log(tagDist.probabilityOf(tag)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | wordIndex.get(word))); |
40,427 | public TaskResult run() {<NEW_LINE>HelixManager helixManager = context.getManager();<NEW_LINE>JobContext jobContext = TaskDriver.getJobContext(helixManager, context.getJobConfig().getJobId());<NEW_LINE>// jobContext.getStartTime() return the time in milliseconds of job being put into helix queue.<NEW_LINE>long jobInQueueTimeMs = jobContext.getStartTime();<NEW_LINE>long jobDequeueTimeMs = System.currentTimeMillis();<NEW_LINE>_minionMetrics.addPhaseTiming(taskType, MinionQueryPhase.TASK_QUEUEING, jobDequeueTimeMs - jobInQueueTimeMs, TimeUnit.MILLISECONDS);<NEW_LINE>try {<NEW_LINE>_minionMetrics.<MASK><NEW_LINE>return runInternal();<NEW_LINE>} finally {<NEW_LINE>_minionMetrics.addValueToGlobalGauge(MinionGauge.NUMBER_OF_TASKS, -1L);<NEW_LINE>long executionTimeMs = System.currentTimeMillis() - jobDequeueTimeMs;<NEW_LINE>_minionMetrics.addPhaseTiming(taskType, MinionQueryPhase.TASK_EXECUTION, executionTimeMs, TimeUnit.MILLISECONDS);<NEW_LINE>LOGGER.info("Task: {} completed in: {}ms", _taskConfig.getId(), executionTimeMs);<NEW_LINE>}<NEW_LINE>} | addValueToGlobalGauge(MinionGauge.NUMBER_OF_TASKS, 1L); |
374,062 | public static DevInterceptorInfo from(InterceptorInfo interceptor, CompletedApplicationClassPredicateBuildItem predicate) {<NEW_LINE>boolean isApplicationBean = predicate.test(interceptor.getBeanClass());<NEW_LINE>Set<Name> <MASK><NEW_LINE>for (AnnotationInstance binding : interceptor.getBindings()) {<NEW_LINE>bindings.add(Name.from(binding));<NEW_LINE>}<NEW_LINE>Map<InterceptionType, MethodInfo> intercepts = new HashMap<>();<NEW_LINE>if (interceptor.intercepts(InterceptionType.AROUND_INVOKE)) {<NEW_LINE>intercepts.put(InterceptionType.AROUND_INVOKE, interceptor.getAroundInvoke());<NEW_LINE>}<NEW_LINE>if (interceptor.intercepts(InterceptionType.AROUND_CONSTRUCT)) {<NEW_LINE>intercepts.put(InterceptionType.AROUND_CONSTRUCT, interceptor.getAroundConstruct());<NEW_LINE>}<NEW_LINE>if (interceptor.intercepts(InterceptionType.POST_CONSTRUCT)) {<NEW_LINE>intercepts.put(InterceptionType.POST_CONSTRUCT, interceptor.getPostConstruct());<NEW_LINE>}<NEW_LINE>if (interceptor.intercepts(InterceptionType.PRE_DESTROY)) {<NEW_LINE>intercepts.put(InterceptionType.PRE_DESTROY, interceptor.getPreDestroy());<NEW_LINE>}<NEW_LINE>return new DevInterceptorInfo(interceptor.getIdentifier(), Name.from(interceptor.getBeanClass()), bindings, interceptor.getPriority(), intercepts, isApplicationBean);<NEW_LINE>} | bindings = new HashSet<>(); |
465,533 | private void addDate_Timing(String theResourceType, Set<ResourceIndexedSearchParamDate> theParams, RuntimeSearchParam theSearchParam, IBase theValue) {<NEW_LINE>List<IPrimitiveType<Date>> <MASK><NEW_LINE>TreeSet<Date> dates = new TreeSet<>();<NEW_LINE>TreeSet<String> dateStrings = new TreeSet<>();<NEW_LINE>String firstValue = null;<NEW_LINE>String finalValue = null;<NEW_LINE>for (IPrimitiveType<Date> nextEvent : values) {<NEW_LINE>if (nextEvent.getValue() != null) {<NEW_LINE>dates.add(nextEvent.getValue());<NEW_LINE>if (firstValue == null) {<NEW_LINE>firstValue = nextEvent.getValueAsString();<NEW_LINE>}<NEW_LINE>finalValue = nextEvent.getValueAsString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Optional<IBase> repeat = myTimingRepeatValueChild.getAccessor().getFirstValueOrNull(theValue);<NEW_LINE>if (repeat.isPresent()) {<NEW_LINE>Optional<IBase> bounds = myTimingRepeatBoundsValueChild.getAccessor().getFirstValueOrNull(repeat.get());<NEW_LINE>if (bounds.isPresent()) {<NEW_LINE>String boundsType = toRootTypeName(bounds.get());<NEW_LINE>if ("Period".equals(boundsType)) {<NEW_LINE>Date start = extractValueAsDate(myPeriodStartValueChild, bounds.get());<NEW_LINE>Date end = extractValueAsDate(myPeriodEndValueChild, bounds.get());<NEW_LINE>String endString = extractValueAsString(myPeriodEndValueChild, bounds.get());<NEW_LINE>dates.add(start);<NEW_LINE>dates.add(end);<NEW_LINE>// TODO Check if this logic is valid. Does the start of the first period indicate a lower bound??<NEW_LINE>if (firstValue == null) {<NEW_LINE>firstValue = extractValueAsString(myPeriodStartValueChild, bounds.get());<NEW_LINE>}<NEW_LINE>finalValue = endString;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!dates.isEmpty()) {<NEW_LINE>ResourceIndexedSearchParamDate nextEntity = new ResourceIndexedSearchParamDate(myPartitionSettings, theResourceType, theSearchParam.getName(), dates.first(), firstValue, dates.last(), finalValue, firstValue);<NEW_LINE>theParams.add(nextEntity);<NEW_LINE>}<NEW_LINE>} | values = extractValuesAsFhirDates(myTimingEventValueChild, theValue); |
1,159,089 | private void createDefaultAttributes() {<NEW_LINE>createXSDAttribute(rootElement, RPL_Constants.XML_ATTR_AD_Client_Value, "xsd:string", null);<NEW_LINE>// 02596<NEW_LINE>createXSDAttribute(rootElement, RPL_Constants.XML_ATTR_SEQUENCE_NO, "xsd:integer", null);<NEW_LINE>// 06231<NEW_LINE>createXSDAttribute(rootElement, RPL_Constants.XML_ATTR_REPLICATION_TrxName, "xsd:string", null);<NEW_LINE>// 03132<NEW_LINE>createXSDAttribute(rootElement, <MASK><NEW_LINE>final HashMap<String, String> map = new HashMap<>();<NEW_LINE>map.put(Integer.toString(ModelValidator.TYPE_AFTER_CHANGE), "AfterChange");<NEW_LINE>map.put(Integer.toString(ModelValidator.TYPE_BEFORE_DELETE), "BeforeDelete");<NEW_LINE>map.put(Integer.toString(ModelValidator.TYPE_BEFORE_DELETE_REPLICATION), "BeforeDeleteReplication");<NEW_LINE>createXSDEnumeration("ReplicationEventEnum", map);<NEW_LINE>createXSDAttribute(rootElement, RPL_Constants.XML_ATTR_REPLICATION_EVENT, "ReplicationEventEnum", null);<NEW_LINE>map.clear();<NEW_LINE>map.put(Integer.toString(MReplicationStrategy.REPLICATION_DOCUMENT), "Document");<NEW_LINE>map.put(Integer.toString(MReplicationStrategy.REPLICATION_TABLE), "Table");<NEW_LINE>createXSDEnumeration("ReplicationModeEnum", map);<NEW_LINE>createXSDAttribute(rootElement, RPL_Constants.XML_ATTR_REPLICATION_MODE, "ReplicationModeEnum", null);<NEW_LINE>createXSDEnumeration("ReplicationTypeEnum", X_AD_ReplicationTable.REPLICATIONTYPE_AD_Reference_ID);<NEW_LINE>createXSDAttribute(rootElement, RPL_Constants.XML_ATTR_REPLICATION_TYPE, "ReplicationTypeEnum", null);<NEW_LINE>} | RPL_Constants.XML_ATTR_AD_SESSION_ID, "xsd:integer", null); |
394,050 | final CreateReservedInstancesListingResult executeCreateReservedInstancesListing(CreateReservedInstancesListingRequest createReservedInstancesListingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createReservedInstancesListingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateReservedInstancesListingRequest> request = null;<NEW_LINE>Response<CreateReservedInstancesListingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateReservedInstancesListingRequestMarshaller().marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateReservedInstancesListing");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateReservedInstancesListingResult> responseHandler = new StaxResponseHandler<CreateReservedInstancesListingResult>(new CreateReservedInstancesListingResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(createReservedInstancesListingRequest)); |
654,232 | protected void executeImpl() throws MojoExecutionException, MojoFailureException {<NEW_LINE>copyKotlinIncrementalCompileOutputToOutputDir();<NEW_LINE>if (!prepareTests()) {<NEW_LINE>getLog().info("No tests were found.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Java java = createJava();<NEW_LINE>Path cp = java.createClasspath();<NEW_LINE>cp.add(new Path(antProject, project.getBuild<MASK><NEW_LINE>cp.add(new Path(antProject, project.getBuild().getOutputDirectory()));<NEW_LINE>for (Artifact artifact : project.getArtifacts()) {<NEW_LINE>if ("provided".equals(artifact.getScope())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// if (artifact.getScope().equals("compile") || artifact.getScope().equals("system") || artifact.getScope().equals("test")) {<NEW_LINE>File jar = getJar(artifact);<NEW_LINE>if (jar != null) {<NEW_LINE>cp.add(new Path(antProject, jar.getAbsolutePath()));<NEW_LINE>} else {<NEW_LINE>getLog().warn("Failed to resolve artifact: " + artifact);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cp.add(new Path(antProject, getProjectInternalTmpJar().getAbsolutePath()));<NEW_LINE>if (!isCefSetup()) {<NEW_LINE>setupCef();<NEW_LINE>}<NEW_LINE>java.createJvmarg().setValue("-Dcef.dir=" + System.getProperty("cef.dir", System.getProperty("user.home") + File.separator + ".codenameone" + File.separator + "cef"));<NEW_LINE>java.setClassname("com.codename1.impl.javase.TestRunner");<NEW_LINE>java.createArg().setValue(properties.getProperty("codename1.packageName") + "." + properties.getProperty("codename1.mainName"));<NEW_LINE>// java.createArg().setValue("-quietMode");<NEW_LINE>java.setFork(true);<NEW_LINE>int result = java.executeJava();<NEW_LINE>if (result != 0) {<NEW_LINE>throw new MojoExecutionException("Tests failed");<NEW_LINE>}<NEW_LINE>} | ().getTestOutputDirectory())); |
485,779 | static void findAsciiEquivalentFromNoisyAndClean(Path cleanRoot, Path noisyRoot, Path outfile) throws IOException {<NEW_LINE>Histogram<String> correctFromClean = Histogram.loadFromUtf8File(cleanRoot.resolve("correct"), ' ');<NEW_LINE>Histogram<String> incorrectFromNoisy = Histogram.loadFromUtf8File(noisyRoot.resolve("incorrect"), ' ');<NEW_LINE>incorrectFromNoisy.removeSmaller(2);<NEW_LINE>HashMultimap<String, String> mmClean = HashMultimap.create();<NEW_LINE>for (String s : correctFromClean) {<NEW_LINE>String a = TurkishAlphabet.INSTANCE.toAscii(s);<NEW_LINE>if (a.equals(s)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (correctFromClean.contains(a)) {<NEW_LINE>mmClean.put(a, s);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>HashMultimap<String, String> mm = HashMultimap.create();<NEW_LINE>for (String s : correctFromClean) {<NEW_LINE>String a = TurkishAlphabet.INSTANCE.toAscii(s);<NEW_LINE>if (a.equals(s)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (incorrectFromNoisy.contains(a)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String s : incorrectFromNoisy) {<NEW_LINE>String a = TurkishAlphabet.INSTANCE.toAscii(s);<NEW_LINE>if (a.equals(s)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (mmClean.containsKey(a)) {<NEW_LINE>mm.putAll(a, mmClean.get(a));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> lines = new ArrayList<>();<NEW_LINE>for (String k : mm.keySet()) {<NEW_LINE>lines.add(k + "=" + String.join(",", mm.get(k)));<NEW_LINE>}<NEW_LINE>Files.write(outfile, lines, StandardCharsets.UTF_8);<NEW_LINE>} | mm.put(a, s); |
1,519,924 | private static void writeOffsetWeight(SliceHeader sliceHeader, BitWriter writer, int list) {<NEW_LINE>SeqParameterSet sps = sliceHeader.sps;<NEW_LINE>int defaultLW = 1 << sliceHeader.predWeightTable.lumaLog2WeightDenom;<NEW_LINE>int defaultCW = 1 << sliceHeader.predWeightTable.chromaLog2WeightDenom;<NEW_LINE>for (int i = 0; i < sliceHeader.predWeightTable.lumaWeight[list].length; i++) {<NEW_LINE>boolean flagLuma = sliceHeader.predWeightTable.lumaWeight[list][i] != defaultLW || sliceHeader.predWeightTable.lumaOffset[list][i] != 0;<NEW_LINE>writeBool(writer, flagLuma, "SH: luma_weight_l0_flag");<NEW_LINE>if (flagLuma) {<NEW_LINE>writeSEtrace(writer, sliceHeader.predWeightTable.lumaWeight[list][i], "SH: luma_weight_l" + list);<NEW_LINE>writeSEtrace(writer, sliceHeader.predWeightTable.lumaOffset[list][i], "SH: luma_offset_l" + list);<NEW_LINE>}<NEW_LINE>if (sps.chromaFormatIdc != MONO) {<NEW_LINE>boolean flagChroma = sliceHeader.predWeightTable.chromaWeight[list][0][i] != defaultCW || sliceHeader.predWeightTable.chromaOffset[list][0][i] != 0 || sliceHeader.predWeightTable.chromaWeight[list][1][i] != defaultCW || sliceHeader.predWeightTable.chromaOffset[list][1][i] != 0;<NEW_LINE><MASK><NEW_LINE>if (flagChroma)<NEW_LINE>for (int j = 0; j < 2; j++) {<NEW_LINE>writeSEtrace(writer, sliceHeader.predWeightTable.chromaWeight[list][j][i], "SH: chroma_weight_l" + list);<NEW_LINE>writeSEtrace(writer, sliceHeader.predWeightTable.chromaOffset[list][j][i], "SH: chroma_offset_l" + list);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | writeBool(writer, flagChroma, "SH: chroma_weight_l0_flag"); |
382,296 | private AuthenticationInfo doGetAuthenticationInfo(TypedBearerToken token) throws AuthenticationException {<NEW_LINE>log.debug(<MASK><NEW_LINE>try {<NEW_LINE>final AuthServiceResult result = authenticator.authenticate(AuthServiceToken.builder().token(token.getToken()).type(token.getType()).build());<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>log.debug("Successfully authenticated username <{}> for user profile <{}> with backend <{}/{}/{}>", result.username(), result.userProfileId(), result.backendTitle(), result.backendType(), result.backendId());<NEW_LINE>return toAuthenticationInfo(result);<NEW_LINE>} else {<NEW_LINE>log.warn("Failed to authenticate username <{}> with backend <{}/{}/{}>", result.username(), result.backendTitle(), result.backendType(), result.backendId());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (AuthServiceException e) {<NEW_LINE>throw new AuthenticationServiceUnavailableException(e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Unhandled authentication error", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | "Attempting authentication for bearer token of type <{}>.", token.getType()); |
1,094,804 | public void finished() {<NEW_LINE>ShowPreviewDialog previewDialog = showPreview;<NEW_LINE>// There is a race between the replacement worker and the<NEW_LINE>// ChatConversationPanel when it is (being) disposed of. Make sure<NEW_LINE>// we have an instance before continuing.<NEW_LINE>if (previewDialog == null) {<NEW_LINE>// Abort if dialog has been disposed of.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String newMessage = (String) get();<NEW_LINE>if (newMessage != null && !newMessage.equals(chatString)) {<NEW_LINE>previewDialog.getMsgIDToChatString().put(messageID, newMessage);<NEW_LINE>synchronized (scrollToBottomRunnable) {<NEW_LINE>scrollToBottomIsPending = true;<NEW_LINE>try {<NEW_LINE>Element elem = document.getElement(messageID);<NEW_LINE>document.setOuterHTML(elem, newMessage);<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>logger.error("Could not replace chat message", ex);<NEW_LINE>} catch (IOException ex) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | logger.error("Could not replace chat message", ex); |
58,313 | private static void logAcquireResult(AcquireResult acquireResult) {<NEW_LINE>try {<NEW_LINE>Lock lock = acquireResult.existingLock();<NEW_LINE>DateTime now = acquireResult.transactionTime();<NEW_LINE>switch(acquireResult.lockState()) {<NEW_LINE>case IN_USE:<NEW_LINE>logger.atInfo().log("Existing lock by request %s is still valid now %s (until %s) lock: %s", lock.requestLogId, now, lock.expirationTime, lock.lockId);<NEW_LINE>break;<NEW_LINE>case TIMED_OUT:<NEW_LINE>logger.atInfo().log("Existing lock by request %s is timed out now %s (was valid until %s) lock: %s", lock.requestLogId, now, lock.expirationTime, lock.lockId);<NEW_LINE>break;<NEW_LINE>case OWNER_DIED:<NEW_LINE>logger.atInfo().log("Existing lock is valid now %s (until %s), but owner (%s) isn't running lock: %s", now, lock.expirationTime, lock.requestLogId, lock.lockId);<NEW_LINE>break;<NEW_LINE>case FREE:<NEW_LINE>// There was no existing lock<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Lock newLock = acquireResult.newLock();<NEW_LINE>if (acquireResult.newLock() != null) {<NEW_LINE>logger.atInfo().log("acquire succeeded %s lock: %s", newLock, newLock.lockId);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// We might get here if there is a NullPointerException for example, if AcquireResult wasn't<NEW_LINE>// constructed correctly. Simply log it for debugging but continue as if nothing happened<NEW_LINE>logger.atWarning().withCause(e<MASK><NEW_LINE>}<NEW_LINE>} | ).log("Error while logging AcquireResult %s. Continuing.", acquireResult); |
1,787,485 | protected void dumpHeader(Writer writer) throws IOException {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("versionSignature: ");<NEW_LINE>builder.append(versionSignature);<NEW_LINE>builder.append("\nversionNumber: ");<NEW_LINE>builder.append(versionNumber);<NEW_LINE>builder.append("\nage: ");<NEW_LINE>builder.append(dbiAge);<NEW_LINE>builder.append("\nstreamNumberGlobalStaticSymbols: ");<NEW_LINE>builder.append(streamNumberGlobalStaticSymbolsHashMaybe);<NEW_LINE>builder.append(String.format("\nuniversalVersion: 0x%04x", universalVersion));<NEW_LINE>builder.append("\nstreamNumberPublicStaticSymbols: ");<NEW_LINE>builder.append(streamNumberPublicStaticSymbolsHashMaybe);<NEW_LINE>builder.append(String.format("\npdbDllBuildVersion: 0x%04x", pdbDllBuildVersion));<NEW_LINE>builder.append("\nstreamNumberSymbolRecords: ");<NEW_LINE>builder.append(streamNumberSymbolRecords);<NEW_LINE>builder.append(String.format("\npdbDllReleaseBuildVersion: 0x%04x", pdbDllReleaseBuildVersion));<NEW_LINE>builder.append("\nlengthModuleInformationSubstream: ");<NEW_LINE>builder.append(lengthModuleInformationSubstream);<NEW_LINE>builder.append("\nlengthSectionContributionSubstream: ");<NEW_LINE>builder.append(lengthSectionContributionSubstream);<NEW_LINE>builder.append("\nlengthSectionMap: ");<NEW_LINE>builder.append(lengthSectionMap);<NEW_LINE>builder.append("\nlengthFileInformation: ");<NEW_LINE>builder.append(lengthFileInformation);<NEW_LINE>builder.append("\nlengthTypeServerMapSubstream: ");<NEW_LINE>builder.append(lengthTypeServerMapSubstream);<NEW_LINE>builder.append("\nindexOfMicrosoftFoundationClassTypeServer: ");<NEW_LINE>builder.append(indexOfMicrosoftFoundationClassTypeServer);<NEW_LINE>builder.append("\nlengthOptionalDebugHeader: ");<NEW_LINE>builder.append(lengthOptionalDebugHeader);<NEW_LINE>builder.append("\nlengthEditAndContinueSubstream: ");<NEW_LINE>builder.append(lengthEditAndContinueSubstream);<NEW_LINE>builder.append(String<MASK><NEW_LINE>builder.append(String.format("\nmachineType: %s", machineType.toString()));<NEW_LINE>builder.append("\npadReserve: ");<NEW_LINE>builder.append(padReserve);<NEW_LINE>writer.write(builder.toString());<NEW_LINE>} | .format("\nflags: 0x%04x", flags)); |
715,189 | public void drawPatch(Canvas canvas) {<NEW_LINE>canvas.save();<NEW_LINE>Point[] cubics = new Point[] { new Point(30, 10), new Point(40, 20), new Point(50, 10), new Point(70, 30), /* new Point(70, 30), */<NEW_LINE>new Point(60, 40), new Point(70, 50), new Point(50, 70), /* new Point(50, 70), */<NEW_LINE>new Point(40, 60), new Point(30, 70), new Point(10, 50), /* new Point(10, 50), */<NEW_LINE>new Point(20, 40), new Point(10, 30) /* new Point(30, 10) */<NEW_LINE>};<NEW_LINE>int[] colors = new int[] { 0xFFFF0000, 0xFF0000FF, 0xFFFFFF00, 0xFF00FFFF };<NEW_LINE>try (var paint = new Paint();<NEW_LINE>var shader = Shader.makeLinearGradient(0, 0, 70, 0, new int[] { 0xFF277da1, 0xFFffba08 })) {<NEW_LINE>canvas.<MASK><NEW_LINE>canvas.translate(80, 0);<NEW_LINE>paint.setShader(shader);<NEW_LINE>canvas.drawPatch(cubics, colors, paint);<NEW_LINE>canvas.translate(80, 0);<NEW_LINE>canvas.drawPatch(cubics, colors, null, BlendMode.SRC_OVER, paint);<NEW_LINE>canvas.translate(80, 0);<NEW_LINE>colors = new int[] { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };<NEW_LINE>canvas.drawPatch(cubics, colors, paint);<NEW_LINE>canvas.translate(80, 0);<NEW_LINE>Point[] texCoords = new Point[] { new Point(0, 0), new Point(70, 0), new Point(70, 70), new Point(0, 70) };<NEW_LINE>canvas.drawPatch(cubics, colors, texCoords, paint);<NEW_LINE>canvas.translate(80, 0);<NEW_LINE>}<NEW_LINE>canvas.restore();<NEW_LINE>canvas.translate(0, 80);<NEW_LINE>} | drawPatch(cubics, colors, paint); |
639,064 | public static GetMeetingInternationalResponse unmarshall(GetMeetingInternationalResponse getMeetingInternationalResponse, UnmarshallerContext _ctx) {<NEW_LINE>getMeetingInternationalResponse.setRequestId(_ctx.stringValue("GetMeetingInternationalResponse.RequestId"));<NEW_LINE>getMeetingInternationalResponse.setErrorCode(_ctx.integerValue("GetMeetingInternationalResponse.ErrorCode"));<NEW_LINE>getMeetingInternationalResponse.setMessage(_ctx.stringValue("GetMeetingInternationalResponse.Message"));<NEW_LINE>getMeetingInternationalResponse.setSuccess(_ctx.booleanValue("GetMeetingInternationalResponse.Success"));<NEW_LINE>MeetingInfo meetingInfo = new MeetingInfo();<NEW_LINE>meetingInfo.setMeetingName(_ctx.stringValue("GetMeetingInternationalResponse.MeetingInfo.MeetingName"));<NEW_LINE>meetingInfo.setValidTime(_ctx.longValue("GetMeetingInternationalResponse.MeetingInfo.ValidTime"));<NEW_LINE>meetingInfo.setMeetingCode(_ctx.stringValue("GetMeetingInternationalResponse.MeetingInfo.MeetingCode"));<NEW_LINE>meetingInfo.setCreateTime<MASK><NEW_LINE>meetingInfo.setUserId(_ctx.stringValue("GetMeetingInternationalResponse.MeetingInfo.UserId"));<NEW_LINE>meetingInfo.setMeetingUUID(_ctx.stringValue("GetMeetingInternationalResponse.MeetingInfo.MeetingUUID"));<NEW_LINE>meetingInfo.setPassword(_ctx.stringValue("GetMeetingInternationalResponse.MeetingInfo.Password"));<NEW_LINE>List<MemberListItem> memberList = new ArrayList<MemberListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetMeetingInternationalResponse.MeetingInfo.MemberList.Length"); i++) {<NEW_LINE>MemberListItem memberListItem = new MemberListItem();<NEW_LINE>memberListItem.setUserAvatarUrl(_ctx.stringValue("GetMeetingInternationalResponse.MeetingInfo.MemberList[" + i + "].UserAvatarUrl"));<NEW_LINE>memberListItem.setMemberUUID(_ctx.stringValue("GetMeetingInternationalResponse.MeetingInfo.MemberList[" + i + "].MemberUUID"));<NEW_LINE>memberListItem.setUserName(_ctx.stringValue("GetMeetingInternationalResponse.MeetingInfo.MemberList[" + i + "].UserName"));<NEW_LINE>memberListItem.setUserId(_ctx.stringValue("GetMeetingInternationalResponse.MeetingInfo.MemberList[" + i + "].UserId"));<NEW_LINE>memberListItem.setStatus(_ctx.stringValue("GetMeetingInternationalResponse.MeetingInfo.MemberList[" + i + "].Status"));<NEW_LINE>memberList.add(memberListItem);<NEW_LINE>}<NEW_LINE>meetingInfo.setMemberList(memberList);<NEW_LINE>getMeetingInternationalResponse.setMeetingInfo(meetingInfo);<NEW_LINE>return getMeetingInternationalResponse;<NEW_LINE>} | (_ctx.longValue("GetMeetingInternationalResponse.MeetingInfo.CreateTime")); |
1,477,783 | public void onGroupExpand(final int groupPosition) {<NEW_LINE>if (!PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingMethodExpert, false)) {<NEW_LINE>AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(ActivityApp.this);<NEW_LINE>alertDialogBuilder.setTitle(R.string.app_name);<NEW_LINE>alertDialogBuilder.setIcon(getThemed<MASK><NEW_LINE>alertDialogBuilder.setMessage(R.string.msg_method_expert);<NEW_LINE>alertDialogBuilder.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>PrivacyManager.setSetting(userId, PrivacyManager.cSettingMethodExpert, Boolean.toString(true));<NEW_LINE>if (mPrivacyListAdapter != null)<NEW_LINE>mPrivacyListAdapter.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>alertDialogBuilder.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>elvRestriction.collapseGroup(groupPosition);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>alertDialogBuilder.setCancelable(false);<NEW_LINE>AlertDialog alertDialog = alertDialogBuilder.create();<NEW_LINE>alertDialog.show();<NEW_LINE>}<NEW_LINE>} | (R.attr.icon_launcher)); |
1,346,059 | public static void tick(Level world) {<NEW_LINE>List<UUID> toRemove = new ArrayList<>();<NEW_LINE>Map<UUID, MinecartController> carts = loadedMinecartsByUUID.get(world);<NEW_LINE>List<AbstractMinecart> queued = queuedAdditions.get(world);<NEW_LINE>List<UUID> queuedRemovals = queuedUnloads.get(world);<NEW_LINE>Set<UUID> cartsWithCoupling = loadedMinecartsWithCoupling.get(world);<NEW_LINE>Set<UUID> keySet = carts.keySet();<NEW_LINE>keySet.removeAll(queuedRemovals);<NEW_LINE>cartsWithCoupling.removeAll(queuedRemovals);<NEW_LINE>for (AbstractMinecart cart : queued) {<NEW_LINE>UUID uniqueID = cart.getUUID();<NEW_LINE>if (world.isClientSide && carts.containsKey(uniqueID)) {<NEW_LINE>MinecartController minecartController = carts.get(uniqueID);<NEW_LINE>if (minecartController != null) {<NEW_LINE>AbstractMinecart minecartEntity = minecartController.cart();<NEW_LINE>if (minecartEntity != null && minecartEntity.getId() != cart.getId())<NEW_LINE>// Away with you, Fake Entities!<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cartsWithCoupling.remove(uniqueID);<NEW_LINE>LazyOptional<MinecartController> capability = cart.getCapability(MINECART_CONTROLLER_CAPABILITY);<NEW_LINE>MinecartController <MASK><NEW_LINE>capability.addListener(new MinecartRemovalListener(world, cart));<NEW_LINE>carts.put(uniqueID, controller);<NEW_LINE>capability.ifPresent(mc -> {<NEW_LINE>if (mc.isLeadingCoupling())<NEW_LINE>cartsWithCoupling.add(uniqueID);<NEW_LINE>});<NEW_LINE>if (!world.isClientSide && controller != null)<NEW_LINE>controller.sendData();<NEW_LINE>}<NEW_LINE>queuedRemovals.clear();<NEW_LINE>queued.clear();<NEW_LINE>for (Entry<UUID, MinecartController> entry : carts.entrySet()) {<NEW_LINE>MinecartController controller = entry.getValue();<NEW_LINE>if (controller != null) {<NEW_LINE>if (controller.isPresent()) {<NEW_LINE>controller.tick();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>toRemove.add(entry.getKey());<NEW_LINE>}<NEW_LINE>cartsWithCoupling.removeAll(toRemove);<NEW_LINE>keySet.removeAll(toRemove);<NEW_LINE>} | controller = capability.orElse(null); |
999,302 | Answer processAnswerRows2(String rawAnswerStr, AnswerRowsOptions options) {<NEW_LINE>if (rawAnswerStr == null) {<NEW_LINE>Answer answer = <MASK><NEW_LINE>answer.setStatus(AnswerStatus.NOTFOUND);<NEW_LINE>return answer;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Answer rawAnswer = BatfishObjectMapper.mapper().readValue(rawAnswerStr, new TypeReference<Answer>() {<NEW_LINE>});<NEW_LINE>// If the AnswerStatus is not SUCCESS, the answer cannot have any AnswerElements related to<NEW_LINE>// actual answers (but, e.g., it might have a BatfishStackTrace). Return that as-is.<NEW_LINE>if (rawAnswer.getStatus() != AnswerStatus.SUCCESS) {<NEW_LINE>return rawAnswer;<NEW_LINE>}<NEW_LINE>return filterAnswer(rawAnswer, options);<NEW_LINE>} catch (Exception e) {<NEW_LINE>_logger.errorf("Failed to convert answer string to Answer: %s\n", Throwables.getStackTraceAsString(e));<NEW_LINE>return Answer.failureAnswer(e.getMessage(), null);<NEW_LINE>}<NEW_LINE>} | Answer.failureAnswer("Not found", null); |
43,579 | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {<NEW_LINE>// Since we use length based framing, any exception reading in TCP<NEW_LINE>// stream has the high likelihood of us getting out of sync on the<NEW_LINE>// stream, and not being able to recover. So close the connection and<NEW_LINE>// hope for the better luck next time.<NEW_LINE>try {<NEW_LINE>Throwable rootCause = cause;<NEW_LINE>while (null != rootCause.getCause()) {<NEW_LINE>rootCause = rootCause.getCause();<NEW_LINE>if (rootCause instanceof SSLException || rootCause instanceof GeneralSecurityException || rootCause instanceof RejectedExecutionException) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String error = rootCause.toString();<NEW_LINE>String remote = StringUtil.toString(ctx.channel().remoteAddress());<NEW_LINE>if (rootCause instanceof SSLException || rootCause instanceof GeneralSecurityException || rootCause instanceof RejectedExecutionException) {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.warn(<MASK><NEW_LINE>} else {<NEW_LINE>LOGGER.warn("{} in channel handler chain for endpoint {}. Closing connection.", error, remote);<NEW_LINE>}<NEW_LINE>} else if (rootCause instanceof IOException) {<NEW_LINE>LOGGER.warn("{} in channel handler chain for endpoint {}. Closing connection.", error, remote);<NEW_LINE>} else {<NEW_LINE>LOGGER.error("{} in channel handler chain for endpoint {}. Closing connection.", error, cause);<NEW_LINE>}<NEW_LINE>if (LOGGER_BAN.isInfoEnabled()) {<NEW_LINE>boolean ban = rootCause instanceof NotSslRecordException;<NEW_LINE>if (ban) {<NEW_LINE>SocketAddress remoteAddress = ctx.channel().remoteAddress();<NEW_LINE>if (remoteAddress instanceof InetSocketAddress) {<NEW_LINE>remote = ((InetSocketAddress) remoteAddress).getAddress().getHostAddress();<NEW_LINE>LOGGER_BAN.info("TLS Ban: {}", remote);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>ctx.close();<NEW_LINE>}<NEW_LINE>} | "{} in channel handler chain for endpoint {}. Closing connection.", error, remote, rootCause); |
1,388,331 | protected // -1 if not known<NEW_LINE>void // -1 if not known<NEW_LINE>removePeer(// -1 if not known<NEW_LINE>TRTrackerServerPeerImpl peer, // -1 if not known<NEW_LINE>int peer_list_index, // -1 if not known<NEW_LINE>int reason, String url_parameters) {<NEW_LINE>try {<NEW_LINE>this_mon.enter();<NEW_LINE>if (peer.isIPOverride()) {<NEW_LINE>ip_override_count--;<NEW_LINE>}<NEW_LINE>stats.removeLeft(peer.getAmountLeft());<NEW_LINE>if (peer_map.size() != peer_reuse_map.size()) {<NEW_LINE>if (!map_size_diff_reported) {<NEW_LINE>map_size_diff_reported = true;<NEW_LINE>Debug.out("TRTrackerServerTorrent::removePeer: maps size different ( " + peer_map.size() + "/" + peer_reuse_map.size() + ")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>{<NEW_LINE>Object o = peer_map.remove(peer.getPeerId());<NEW_LINE>if (o == null) {<NEW_LINE>Debug.out(" TRTrackerServerTorrent::removePeer: peer_map doesn't contain peer");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>peerEvent(peer, reason, url_parameters);<NEW_LINE>} catch (TRTrackerServerException e) {<NEW_LINE>// ignore during peer removal<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (peer_list_index == -1) {<NEW_LINE>int peer_index = peer_list.indexOf(peer);<NEW_LINE>if (peer_index == -1) {<NEW_LINE>Debug.out(" TRTrackerServerTorrent::removePeer: peer_list doesn't contain peer");<NEW_LINE>} else {<NEW_LINE>peer_list.set(peer_index, null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (peer_list.get(peer_list_index) == peer) {<NEW_LINE>peer_list.set(peer_list_index, null);<NEW_LINE>} else {<NEW_LINE>Debug.out(" TRTrackerServerTorrent::removePeer: peer_list doesn't contain peer at index");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>peer_list_hole_count++;<NEW_LINE>checkForPeerListCompaction(false);<NEW_LINE>String peerIPPortAddress = new String(peer.getIPAsRead(), Constants.BYTE_ENCODING_CHARSET) + ':' + peer.getTCPPort();<NEW_LINE>Object <MASK><NEW_LINE>if (o == null) {<NEW_LINE>Debug.out(" TRTrackerServerTorrent::removePeer: peer_reuse_map doesn't contain peer");<NEW_LINE>}<NEW_LINE>if (biased_peers != null) {<NEW_LINE>biased_peers.remove(peer);<NEW_LINE>}<NEW_LINE>if (peer.isSeed()) {<NEW_LINE>seed_count--;<NEW_LINE>}<NEW_LINE>removed_count++;<NEW_LINE>} finally {<NEW_LINE>this_mon.exit();<NEW_LINE>}<NEW_LINE>} | o = peer_reuse_map.remove(peerIPPortAddress); |
874,338 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>output.writeMessage(2, getObject());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>output.<MASK><NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>output.writeMessage(4, getResource());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>output.writeMessage(5, getExternal());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>output.writeMessage(7, getContainerResource());<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>} | writeMessage(3, getPods()); |
892,366 | private void parseInterfacesFile() {<NEW_LINE>int end = _text.indexOf(START_OF_PORTS_FILE);<NEW_LINE>String text = end > 0 ? _text.<MASK><NEW_LINE>CumulusInterfacesCombinedParser parser = new CumulusInterfacesCombinedParser(text, _grammarSettings, _line, _offset);<NEW_LINE>Cumulus_interfaces_configurationContext ctxt = parser.parse();<NEW_LINE>checkErrors(parser);<NEW_LINE>ParseTreeWalker walker = new BatfishParseTreeWalker(parser);<NEW_LINE>CumulusInterfacesConfigurationBuilder cb = new CumulusInterfacesConfigurationBuilder(_configuration, parser, _text, _w, _silentSyntax);<NEW_LINE>walker.walk(cb, ctxt);<NEW_LINE>mergeParseTree(ctxt, parser);<NEW_LINE>Token startOfFrrFile = ctxt.getStop();<NEW_LINE>_line = startOfFrrFile.getLine();<NEW_LINE>_offset = startOfFrrFile.getStartIndex();<NEW_LINE>} | substring(0, end) : _text; |
1,657,402 | protected void loadFromModelData(TFTableModelClassificationModelData modelData, TableSchema modelSchema) {<NEW_LINE>Params meta = modelData.getMeta();<NEW_LINE>String tfOutputSignatureDef = meta.get(TFModelDataConverterUtils.TF_OUTPUT_SIGNATURE_DEF);<NEW_LINE>TypeInformation<?> tfOutputSignatureType = AlinkTypes.FLOAT_TENSOR;<NEW_LINE>String[] reservedCols = null == params.get(HasReservedColsDefaultAsNull.RESERVED_COLS) ? getDataSchema().getFieldNames() : params.get(HasReservedColsDefaultAsNull.RESERVED_COLS);<NEW_LINE>TableSchema dataSchema = getDataSchema();<NEW_LINE>if (CollectionUtils.isNotEmpty(modelData.getPreprocessPipelineModelRows())) {<NEW_LINE>String preprocessPipelineModelSchemaStr = modelData.getPreprocessPipelineModelSchemaStr();<NEW_LINE>TableSchema pipelineModelSchema = TableUtil.schemaStr2Schema(preprocessPipelineModelSchemaStr);<NEW_LINE>MapperChain mapperList = ModelExporterUtils.loadMapperListFromStages(modelData.getPreprocessPipelineModelRows(), pipelineModelSchema, dataSchema);<NEW_LINE>mappers.addAll(Arrays.asList(mapperList.getMappers()));<NEW_LINE>dataSchema = mappers.get(mappers.size() - 1).getOutputSchema();<NEW_LINE>}<NEW_LINE>String[] tfInputCols = meta.get(TFModelDataConverterUtils.TF_INPUT_COLS);<NEW_LINE>String predCol = params.get(TFTableModelClassificationPredictParams.PREDICTION_COL);<NEW_LINE>Params tfModelMapperParams = new Params();<NEW_LINE>tfModelMapperParams.set(TFTableModelPredictParams.OUTPUT_SIGNATURE_DEFS, new String[] { tfOutputSignatureDef });<NEW_LINE>tfModelMapperParams.set(TFTableModelPredictParams.OUTPUT_SCHEMA_STR, TableUtil.schema2SchemaStr(TableSchema.builder().field(predCol, tfOutputSignatureType).build()));<NEW_LINE>tfModelMapperParams.set(TFTableModelPredictParams.SELECTED_COLS, tfInputCols);<NEW_LINE>tfModelMapperParams.set(TFTableModelPredictParams.RESERVED_COLS, reservedCols);<NEW_LINE>tfModelMapper = new TFTableModelPredictModelMapper(modelSchema, dataSchema, tfModelMapperParams, factory);<NEW_LINE>if (null != modelData.getTfModelZipPath()) {<NEW_LINE>tfModelMapper.<MASK><NEW_LINE>} else {<NEW_LINE>tfModelMapper.loadModel(modelData.getTfModelRows());<NEW_LINE>}<NEW_LINE>mappers.add(tfModelMapper);<NEW_LINE>predColId = TableUtil.findColIndex(tfModelMapper.getOutputSchema(), predCol);<NEW_LINE>sortedLabels = modelData.getSortedLabels();<NEW_LINE>isOutputLogits = meta.get(TFModelDataConverterUtils.IS_OUTPUT_LOGITS);<NEW_LINE>} | loadModelFromZipFile(modelData.getTfModelZipPath()); |
12,821 | public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {<NEW_LINE>final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();<NEW_LINE>if (Configuration.INSTANCE.getSecureDeployment(deploymentUnit) == null) {<NEW_LINE>WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY);<NEW_LINE>if (warMetaData == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData();<NEW_LINE>if (webMetaData == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (loginConfig == null)<NEW_LINE>return;<NEW_LINE>if (loginConfig.getAuthMethod() == null)<NEW_LINE>return;<NEW_LINE>if (!loginConfig.getAuthMethod().equals("KEYCLOAK-SAML"))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Next phase, need to detect if this is a Keycloak deployment. If not, don't add the modules.<NEW_LINE>final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);<NEW_LINE>final ModuleLoader moduleLoader = Module.getBootModuleLoader();<NEW_LINE>addCommonModules(moduleSpecification, moduleLoader);<NEW_LINE>addPlatformSpecificModules(phaseContext, moduleSpecification, moduleLoader);<NEW_LINE>} | LoginConfigMetaData loginConfig = webMetaData.getLoginConfig(); |
349,973 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create variable boolean queryvar_bool", path);<NEW_LINE>env.compileDeploy("@public create variable int lower", path);<NEW_LINE>env.compileDeploy("@public create variable int upper", path);<NEW_LINE>env.compileDeploy("on SupportBean set queryvar_bool=boolPrimitive, lower=intPrimitive,upper=intBoxed", path);<NEW_LINE>String stmtText = "@name('s0') select * from sql:MyDBWithLRU100000 ['select mybigint, mybool from mytesttable where ${queryvar_bool} = mytesttable.mybool and myint between ${lower} and ${upper} order by mybigint']";<NEW_LINE>String[] fields = new String[] { "mybigint", "mybool" };<NEW_LINE><MASK><NEW_LINE>sendSupportBeanEvent(env, true, 20, 60);<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>for (int i = 0; i < 10000; i++) {<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { 4L, true } });<NEW_LINE>}<NEW_LINE>long end = System.currentTimeMillis();<NEW_LINE>long delta = end - start;<NEW_LINE>assertTrue("delta=" + delta, delta < 1000);<NEW_LINE>env.undeployAll();<NEW_LINE>} | env.compileDeploy(stmtText, path); |
1,261,037 | public static byte[] calculateKeyBlockSSL3(byte[] masterSecret, byte[] random, int size) {<NEW_LINE>Digest md5 = TlsUtils.createHash(HashAlgorithm.md5);<NEW_LINE>Digest sha1 = TlsUtils.createHash(HashAlgorithm.sha1);<NEW_LINE>int md5Size = md5.getDigestSize();<NEW_LINE>byte[] shaTmp = new byte[sha1.getDigestSize()];<NEW_LINE>byte[] tmp = new byte[size + md5Size];<NEW_LINE>int i = 0;<NEW_LINE>int pos = 0;<NEW_LINE>while (pos < size) {<NEW_LINE>if (SSL3_CONST.length <= i) {<NEW_LINE>// This should not happen with a normal random value<NEW_LINE>i = 0;<NEW_LINE>}<NEW_LINE>byte[] ssl3Const = SSL3_CONST[i];<NEW_LINE>sha1.update(ssl3Const, 0, ssl3Const.length);<NEW_LINE>sha1.update(masterSecret, 0, masterSecret.length);<NEW_LINE>sha1.update(random, 0, random.length);<NEW_LINE>sha1.doFinal(shaTmp, 0);<NEW_LINE>md5.update(masterSecret, 0, masterSecret.length);<NEW_LINE>md5.update(<MASK><NEW_LINE>md5.doFinal(tmp, pos);<NEW_LINE>pos += md5Size;<NEW_LINE>++i;<NEW_LINE>}<NEW_LINE>return Arrays.copyOfRange(tmp, 0, size);<NEW_LINE>} | shaTmp, 0, shaTmp.length); |
1,342,981 | public void dumpSummary(PrintStream out) {<NEW_LINE>StringBuilder b = new StringBuilder();<NEW_LINE>for (int i = Math.max(0, versionList.length - 10); i < versionList.length; ++i) {<NEW_LINE>Version version = versionList[i];<NEW_LINE>int added = version.get(ADDED) + version.get(NEWCODE);<NEW_LINE>int removed = version.get(REMOVED) + version.get(REMOVEDCODE);<NEW_LINE>b.append(" ");<NEW_LINE>if (added > 0) {<NEW_LINE>b.append('+');<NEW_LINE>b.append(added);<NEW_LINE>}<NEW_LINE>if (removed > 0) {<NEW_LINE>b.append('-');<NEW_LINE>b.append(removed);<NEW_LINE>}<NEW_LINE>if (added == 0 && removed == 0) {<NEW_LINE>b.append('0');<NEW_LINE>}<NEW_LINE>int paddingNeeded = WIDTH <MASK><NEW_LINE>if (paddingNeeded > 0) {<NEW_LINE>b.append(" ".substring(0, paddingNeeded));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int errors = bugCollection.getErrors().size();<NEW_LINE>if (errors > 0) {<NEW_LINE>b.append(" ").append(errors).append(" errors");<NEW_LINE>}<NEW_LINE>out.println(b.toString());<NEW_LINE>} | - b.length() % WIDTH; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.