idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
68,761
public boolean applyConfigTemplateForPackage(java.lang.String packageName, github.tornaco.android.thanos.core.profile.ConfigTemplate template) throws android.os.RemoteException {<NEW_LINE>android.os.Parcel _data = android.os.Parcel.obtain();<NEW_LINE>android.os.Parcel _reply = android.os.Parcel.obtain();<NEW_LINE>boolean _result;<NEW_LINE>try {<NEW_LINE>_data.writeInterfaceToken(DESCRIPTOR);<NEW_LINE>_data.writeString(packageName);<NEW_LINE>if ((template != null)) {<NEW_LINE>_data.writeInt(1);<NEW_LINE>template.writeToParcel(_data, 0);<NEW_LINE>} else {<NEW_LINE>_data.writeInt(0);<NEW_LINE>}<NEW_LINE>boolean _status = mRemote.transact(Stub.<MASK><NEW_LINE>if (!_status && getDefaultImpl() != null) {<NEW_LINE>return getDefaultImpl().applyConfigTemplateForPackage(packageName, template);<NEW_LINE>}<NEW_LINE>_reply.readException();<NEW_LINE>_result = (0 != _reply.readInt());<NEW_LINE>} finally {<NEW_LINE>_reply.recycle();<NEW_LINE>_data.recycle();<NEW_LINE>}<NEW_LINE>return _result;<NEW_LINE>}
TRANSACTION_applyConfigTemplateForPackage, _data, _reply, 0);
1,700,921
public void handlerSelector(final SelectorData selectorData) {<NEW_LINE>LOG.info("handler loggingRocketMQ selector data:{}", GsonUtils.getGson().toJson(selectorData));<NEW_LINE>String handleJson = selectorData.getHandle();<NEW_LINE>if (StringUtils.isEmpty(handleJson) || EMPTY_JSON.equals(handleJson.trim())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (selectorData.getType() != SelectorTypeEnum.CUSTOM_FLOW.getCode() || CollectionUtils.isEmpty(selectorData.getConditionList())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RocketMQLogCollectConfig.LogApiConfig logApiConfig = GsonUtils.getInstance().fromJson(handleJson, RocketMQLogCollectConfig.LogApiConfig.class);<NEW_LINE>if (StringUtils.isBlank(logApiConfig.getTopic()) || StringUtils.isBlank(logApiConfig.getSampleRate())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> <MASK><NEW_LINE>for (ConditionData conditionData : selectorData.getConditionList()) {<NEW_LINE>if ("uri".equals(conditionData.getParamType()) && StringUtils.isNotBlank(conditionData.getParamValue()) && ("match".equals(conditionData.getOperator()) || "=".equals(conditionData.getOperator()))) {<NEW_LINE>uriList.add(conditionData.getParamValue().trim());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SELECT_ID_URI_LIST_MAP.put(selectorData.getId(), uriList);<NEW_LINE>SELECT_API_CONFIG_MAP.put(selectorData.getId(), logApiConfig);<NEW_LINE>}
uriList = new ArrayList<>();
1,526,342
public List<ActionEntity> listForFile(String path, DateTime startAt, DateTime endAt, String display, String cursor, Integer perPage, Object sortBy) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'path' is set<NEW_LINE>if (path == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'path' when calling listForFile");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/history/files/{path}".replaceAll("\\{" + "path" + "\\}", apiClient.escapeString(path.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "start_at", startAt));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_at", endAt));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "display", display));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "cursor", cursor));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "per_page", perPage));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs<MASK><NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<List<ActionEntity>> localVarReturnType = new GenericType<List<ActionEntity>>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
("", "sort_by", sortBy));
1,613,404
public synchronized void addMeshModel(int address, int modelId, int appKeyIndex) {<NEW_LINE>MeshNetwork network = getMeshNetwork();<NEW_LINE>MeshModel model = SigModelParser.getSigModel(modelId);<NEW_LINE>if (model == null) {<NEW_LINE>LOG.severe("Bluetooth Mesh model with ID='" + String.format("0x%04X", modelId) + "' is not supported.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO: proper handling of unicast and group addresses<NEW_LINE>if (address < 0xC000) {<NEW_LINE>ProvisionedMeshNode node = getNode(address);<NEW_LINE>if (node == null) {<NEW_LINE>List<NetworkKey> networkKeys = new ArrayList<>(1);<NEW_LINE>networkKeys.add(networkKey);<NEW_LINE>List<ApplicationKey> applicationKeys = new ArrayList<>(applicationKeyMap.size());<NEW_LINE>applicationKeys.addAll(applicationKeyMap.values());<NEW_LINE>node = new ProvisionedMeshNode(network.getSelectedProvisioner(), networkKeys, applicationKeys);<NEW_LINE>node.setUnicastAddress(address);<NEW_LINE>}<NEW_LINE>Map<Integer, Element> oldElementMap = node.getElements();<NEW_LINE>Map<Integer, Element> newElementMap = new HashMap<>();<NEW_LINE>Map<Integer, MeshModel> newModelMap = new HashMap<>();<NEW_LINE>Element oldElement = oldElementMap.get(address);<NEW_LINE>if (oldElement != null) {<NEW_LINE>newModelMap.putAll(oldElement.getMeshModels());<NEW_LINE>}<NEW_LINE>int locationDescriptor = 0;<NEW_LINE>model.setBoundAppKeyIndex(appKeyIndex);<NEW_LINE>newModelMap.put(modelId, model);<NEW_LINE>Element newElement = new Element(address, locationDescriptor, newModelMap);<NEW_LINE>newElementMap.putAll(oldElementMap);<NEW_LINE>newElementMap.put(address, newElement);<NEW_LINE>node.setElements(newElementMap);<NEW_LINE>if (getNode(address) == null) {<NEW_LINE>network.nodes.add(node);<NEW_LINE>network.sequenceNumbers.put(node.getUnicastAddress(), node.getSequenceNumber());<NEW_LINE>network.unicastAddress = network.nextAvailableUnicastAddress(node.getNumberOfElements(<MASK><NEW_LINE>node.setMeshUuid(network.getMeshUUID());<NEW_LINE>network.loadSequenceNumbers();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addShadowModel(address, modelId, appKeyIndex);<NEW_LINE>}
), network.getSelectedProvisioner());
533,841
private int resolveConstructorArguments(String beanName, RootBeanDefinition mbd, BeanWrapper bw, ConstructorArgumentValues cargs, ConstructorArgumentValues resolvedValues) {<NEW_LINE>TypeConverter customConverter = this.beanFactory.getCustomTypeConverter();<NEW_LINE>TypeConverter converter = (customConverter != null ? customConverter : bw);<NEW_LINE>BeanDefinitionValueResolver valueResolver = new BeanDefinitionValueResolver(this.<MASK><NEW_LINE>int minNrOfArgs = cargs.getArgumentCount();<NEW_LINE>for (Map.Entry<Integer, ConstructorArgumentValues.ValueHolder> entry : cargs.getIndexedArgumentValues().entrySet()) {<NEW_LINE>int index = entry.getKey();<NEW_LINE>if (index < 0) {<NEW_LINE>throw new BeanCreationException(mbd.getResourceDescription(), beanName, "Invalid constructor argument index: " + index);<NEW_LINE>}<NEW_LINE>if (index + 1 > minNrOfArgs) {<NEW_LINE>minNrOfArgs = index + 1;<NEW_LINE>}<NEW_LINE>ConstructorArgumentValues.ValueHolder valueHolder = entry.getValue();<NEW_LINE>if (valueHolder.isConverted()) {<NEW_LINE>resolvedValues.addIndexedArgumentValue(index, valueHolder);<NEW_LINE>} else {<NEW_LINE>Object resolvedValue = valueResolver.resolveValueIfNecessary("constructor argument", valueHolder.getValue());<NEW_LINE>ConstructorArgumentValues.ValueHolder resolvedValueHolder = new ConstructorArgumentValues.ValueHolder(resolvedValue, valueHolder.getType(), valueHolder.getName());<NEW_LINE>resolvedValueHolder.setSource(valueHolder);<NEW_LINE>resolvedValues.addIndexedArgumentValue(index, resolvedValueHolder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (ConstructorArgumentValues.ValueHolder valueHolder : cargs.getGenericArgumentValues()) {<NEW_LINE>if (valueHolder.isConverted()) {<NEW_LINE>resolvedValues.addGenericArgumentValue(valueHolder);<NEW_LINE>} else {<NEW_LINE>Object resolvedValue = valueResolver.resolveValueIfNecessary("constructor argument", valueHolder.getValue());<NEW_LINE>ConstructorArgumentValues.ValueHolder resolvedValueHolder = new ConstructorArgumentValues.ValueHolder(resolvedValue, valueHolder.getType(), valueHolder.getName());<NEW_LINE>resolvedValueHolder.setSource(valueHolder);<NEW_LINE>resolvedValues.addGenericArgumentValue(resolvedValueHolder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return minNrOfArgs;<NEW_LINE>}
beanFactory, beanName, mbd, converter);
244,217
final CreateEdgePackagingJobResult executeCreateEdgePackagingJob(CreateEdgePackagingJobRequest createEdgePackagingJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createEdgePackagingJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateEdgePackagingJobRequest> request = null;<NEW_LINE>Response<CreateEdgePackagingJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateEdgePackagingJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createEdgePackagingJobRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateEdgePackagingJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateEdgePackagingJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateEdgePackagingJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
841,227
public void fetch() {<NEW_LINE>ScouterUtil.collectGroupObjcts(grpName, serverObjMap);<NEW_LINE>Iterator<Integer> itr = serverObjMap.keySet().iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>int serverId = itr.next();<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("objHash", serverObjMap.get(serverId));<NEW_LINE>tcp.process(RequestCmd.ACTIVESPEED_GROUP_REAL_TIME, param, new INetReader() {<NEW_LINE><NEW_LINE>public void process(DataInputX in) throws IOException {<NEW_LINE>MapPack m = (MapPack) in.readPack();<NEW_LINE>ActiveSpeedData asd = new ActiveSpeedData();<NEW_LINE>asd.act1 = CastUtil.cint(m.get("act1"));<NEW_LINE>asd.act2 = CastUtil.cint(m.get("act2"));<NEW_LINE>asd.act3 = CastUtil.cint<MASK><NEW_LINE>int objHash = CastUtil.cint(m.get("objHash"));<NEW_LINE>EqData data = new EqData();<NEW_LINE>data.objHash = objHash;<NEW_LINE>data.asd = asd;<NEW_LINE>data.displayName = ScouterUtil.getFullObjName(objHash);<NEW_LINE>data.isAlive = AgentModelThread.getInstance().getAgentObject(objHash).isAlive();<NEW_LINE>valueSet.add(data);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Throwable t) {<NEW_LINE>ConsoleProxy.errorSafe(t.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(m.get("act3"));
1,053,413
private void comboHandler(ActionEvent evt) {<NEW_LINE>String str = (String) ((JComboBox) evt.getSource()).getSelectedItem();<NEW_LINE>Locale oldLocale = locale;<NEW_LINE>Object source = evt.getSource();<NEW_LINE>if (source.equals(languageCombo)) {<NEW_LINE>// 99% trick to avoid unneccessary reset of the string (kind of event filter) ,<NEW_LINE>// e.g. when loosing the focus and was choosen item from list right before etc.<NEW_LINE>if (str.equals(locale.getLanguage()))<NEW_LINE>return;<NEW_LINE>locale = new Locale(str, locale.getCountry(<MASK><NEW_LINE>} else if (source.equals(countryCombo)) {<NEW_LINE>if (str.equals(locale.getCountry()))<NEW_LINE>return;<NEW_LINE>locale = new Locale(locale.getLanguage(), str, locale.getVariant());<NEW_LINE>} else if (source.equals(variantCombo)) {<NEW_LINE>if (str.equals(locale.getVariant()))<NEW_LINE>return;<NEW_LINE>locale = new Locale(locale.getLanguage(), locale.getCountry(), str);<NEW_LINE>}<NEW_LINE>localeText.setText(locale.toString());<NEW_LINE>firePropertyChange(PROP_CUSTOMIZED_LOCALE, oldLocale, locale);<NEW_LINE>}
), locale.getVariant());
1,328,523
private IProject createNewProject() {<NEW_LINE>if (newProject != null) {<NEW_LINE>return newProject;<NEW_LINE>}<NEW_LINE>// get a project handle<NEW_LINE>final IProject newProjectHandle = mainPage.getProjectHandle();<NEW_LINE>// get a project descriptor<NEW_LINE>URI location = null;<NEW_LINE>if (!mainPage.useDefaults()) {<NEW_LINE>location = mainPage.getLocationURI();<NEW_LINE>}<NEW_LINE>IProjectDescription description = ResourceUtil.getProjectDescription(mainPage.getLocationPath(), sample.getNatures(), ArrayUtil.NO_STRINGS);<NEW_LINE>description.<MASK><NEW_LINE>description.setLocationURI(location);<NEW_LINE>try {<NEW_LINE>if (sample.isRemote()) {<NEW_LINE>cloneFromGit(sample.getLocation(), newProjectHandle, description);<NEW_LINE>} else {<NEW_LINE>ProjectData projectData = mainPage.getProjectData();<NEW_LINE>// Initialize the basic project data<NEW_LINE>projectData.project = newProjectHandle;<NEW_LINE>projectData.directory = mainPage.getLocationURI().getRawPath();<NEW_LINE>// TODO: not used here. //$NON-NLS-1$<NEW_LINE>projectData.appURL = "http://";<NEW_LINE>doBasicCreateProject(newProjectHandle, description, sample, projectData);<NEW_LINE>doPostProjectCreation(newProjectHandle);<NEW_LINE>}<NEW_LINE>} catch (CoreException e) {<NEW_LINE>IdeLog.logError(SamplesUIPlugin.getDefault(), e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>newProject = newProjectHandle;<NEW_LINE>return newProject;<NEW_LINE>}
setName(newProjectHandle.getName());
682,888
public void run(Object[] args, ZContext ctx, Socket pipe) {<NEW_LINE>// Subscribe to everything<NEW_LINE>Socket subscriber = ctx.createSocket(SocketType.SUB);<NEW_LINE><MASK><NEW_LINE>subscriber.connect("tcp://localhost:5556");<NEW_LINE>// Get and process messages<NEW_LINE>while (true) {<NEW_LINE>String string = subscriber.recvStr();<NEW_LINE>System.out.printf("%s\n", string);<NEW_LINE>long clock = Long.parseLong(string);<NEW_LINE>// Suicide snail logic<NEW_LINE>if (System.currentTimeMillis() - clock > MAX_ALLOWED_DELAY) {<NEW_LINE>System.err.println("E: subscriber cannot keep up, aborting");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Work for 1 msec plus some random additional time<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000 + rand.nextInt(2000));<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pipe.send("gone and died");<NEW_LINE>}
subscriber.subscribe(ZMQ.SUBSCRIPTION_ALL);
888,499
public IBaseResource binaryAccessWrite(@IdParam IIdType theResourceId, @OperationParam(name = "path", min = 1, max = 1) IPrimitiveType<String> thePath, ServletRequestDetails theRequestDetails, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse) throws IOException {<NEW_LINE>String path = validateResourceTypeAndPath(theResourceId, thePath);<NEW_LINE>IFhirResourceDao dao = getDaoForRequest(theResourceId);<NEW_LINE>IBaseResource resource = dao.read(theResourceId, theRequestDetails, false);<NEW_LINE>IBinaryTarget target = findAttachmentForRequest(resource, path, theRequestDetails);<NEW_LINE>String requestContentType = theServletRequest.getContentType();<NEW_LINE>if (isBlank(requestContentType)) {<NEW_LINE>throw new InvalidRequestException(Msg.code(1333) + "No content-target supplied");<NEW_LINE>}<NEW_LINE>if (EncodingEnum.forContentTypeStrict(requestContentType) != null) {<NEW_LINE>throw new InvalidRequestException(Msg.code(1334) + "This operation is for binary content, got: " + requestContentType);<NEW_LINE>}<NEW_LINE>long size = theServletRequest.getContentLength();<NEW_LINE>ourLog.trace("Request specified content length: {}", size);<NEW_LINE>String blobId = null;<NEW_LINE>if (size > 0) {<NEW_LINE>if (myBinaryStorageSvc != null) {<NEW_LINE>InputStream inputStream = theRequestDetails.getInputStream();<NEW_LINE>if (inputStream.available() == 0) {<NEW_LINE>throw new IllegalStateException(Msg.code(2073) + "Input stream is empty! Ensure that you are uploading data, and if so, ensure that no interceptors are in use that may be consuming the input stream");<NEW_LINE>}<NEW_LINE>if (myBinaryStorageSvc.shouldStoreBlob(size, theResourceId, requestContentType)) {<NEW_LINE>StoredDetails storedDetails = myBinaryStorageSvc.storeBlob(theResourceId, null, requestContentType, inputStream);<NEW_LINE>size = storedDetails.getBytes();<NEW_LINE>blobId = storedDetails.getBlobId();<NEW_LINE>// should not happen<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (blobId == null) {<NEW_LINE>byte[] bytes = theRequestDetails.loadRequestContents();<NEW_LINE>size = bytes.length;<NEW_LINE>target.setData(bytes);<NEW_LINE>} else {<NEW_LINE>replaceDataWithExtension(target, blobId);<NEW_LINE>}<NEW_LINE>target.setContentType(requestContentType);<NEW_LINE>target.setSize(null);<NEW_LINE>if (size <= Integer.MAX_VALUE) {<NEW_LINE>target.setSize((int) size);<NEW_LINE>}<NEW_LINE>DaoMethodOutcome outcome = dao.update(resource, theRequestDetails);<NEW_LINE>return outcome.getResource();<NEW_LINE>}
Validate.notBlank(blobId, "BinaryStorageSvc returned a null blob ID");
971,662
public static GetJudicialFreezesResponse unmarshall(GetJudicialFreezesResponse getJudicialFreezesResponse, UnmarshallerContext _ctx) {<NEW_LINE>getJudicialFreezesResponse.setRequestId(_ctx.stringValue("GetJudicialFreezesResponse.RequestId"));<NEW_LINE>getJudicialFreezesResponse.setCode(_ctx.integerValue("GetJudicialFreezesResponse.Code"));<NEW_LINE>getJudicialFreezesResponse.setMessage(_ctx.stringValue("GetJudicialFreezesResponse.Message"));<NEW_LINE>getJudicialFreezesResponse.setTotal(_ctx.integerValue("GetJudicialFreezesResponse.Total"));<NEW_LINE>List<String> data <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetJudicialFreezesResponse.Data.Length"); i++) {<NEW_LINE>data.add(_ctx.stringValue("GetJudicialFreezesResponse.Data[" + i + "]"));<NEW_LINE>}<NEW_LINE>getJudicialFreezesResponse.setData(data);<NEW_LINE>return getJudicialFreezesResponse;<NEW_LINE>}
= new ArrayList<String>();
1,521,617
public Symbol createFunctionSymbol(Address addr, String name, Namespace namespace, SourceType source, String stringData) throws InvalidInputException {<NEW_LINE>namespace = validateNamespace(<MASK><NEW_LINE>source = validateSource(source, name, addr, SymbolType.FUNCTION);<NEW_LINE>name = validateName(name, source);<NEW_LINE>if (addr.isMemoryAddress()) {<NEW_LINE>return doCreateMemoryFunctionSymbol(addr, name, namespace, source, stringData);<NEW_LINE>} else if (addr.isExternalAddress()) {<NEW_LINE>// only one symbol per external address is allowed<NEW_LINE>Symbol primary = getPrimarySymbol(addr);<NEW_LINE>if (primary != null) {<NEW_LINE>throw new IllegalArgumentException("external address already used");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("bad function address");<NEW_LINE>}<NEW_LINE>return doCreateSymbol(name, addr, namespace, SymbolType.FUNCTION, stringData, null, null, source, true);<NEW_LINE>}
namespace, addr, SymbolType.FUNCTION);
615,448
private void computeProjectName(ObjectNode extObject) {<NEW_LINE>if (!extObject.has("name")) {<NEW_LINE>if (getProject().getName() != null) {<NEW_LINE>extObject.put("name", getProject().getName());<NEW_LINE>} else {<NEW_LINE>JsonNode node = extObject.get(ARTIFACT_ID);<NEW_LINE>String defaultName = node.asText();<NEW_LINE>int i = 0;<NEW_LINE>if (defaultName.startsWith("quarkus-")) {<NEW_LINE>i = "quarkus-".length();<NEW_LINE>}<NEW_LINE>final StringBuilder buf = new StringBuilder();<NEW_LINE>boolean startWord = true;<NEW_LINE>while (i < defaultName.length()) {<NEW_LINE>final char c = defaultName.charAt(i++);<NEW_LINE>if (c == '-') {<NEW_LINE>if (!startWord) {<NEW_LINE>buf.append(' ');<NEW_LINE>startWord = true;<NEW_LINE>}<NEW_LINE>} else if (startWord) {<NEW_LINE>buf.append<MASK><NEW_LINE>startWord = false;<NEW_LINE>} else {<NEW_LINE>buf.append(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>defaultName = buf.toString();<NEW_LINE>getLogger().warn("Extension name has not been provided for " + extObject.get(GROUP_ID).asText("") + ":" + extObject.get(ARTIFACT_ID).asText("") + "! Using '" + defaultName + "' as the default one.");<NEW_LINE>extObject.put("name", defaultName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(Character.toUpperCase(c));
1,639,639
protected static String performOSAScript(CharSequence[] cmds) throws IOException {<NEW_LINE>String[] cmdargs = new String[2 * cmds.length + 1];<NEW_LINE>cmdargs[0] = "osascript";<NEW_LINE>for (int i = 0; i < cmds.length; i++) {<NEW_LINE>cmdargs[<MASK><NEW_LINE>cmdargs[i * 2 + 2] = String.valueOf(cmds[i]);<NEW_LINE>}<NEW_LINE>Process osaProcess = performRuntimeExec(cmdargs);<NEW_LINE>BufferedReader reader = new BufferedReader(new InputStreamReader(osaProcess.getInputStream()));<NEW_LINE>String line = reader.readLine();<NEW_LINE>reader.close();<NEW_LINE>// Debug.outNoStack("OSAScript Output: " + line);<NEW_LINE>reader = new BufferedReader(new InputStreamReader(osaProcess.getErrorStream()));<NEW_LINE>String errorMsg = reader.readLine();<NEW_LINE>reader.close();<NEW_LINE>// Debug.outNoStack("OSAScript Error (if any): " + errorMsg);<NEW_LINE>// Debug.outNoStack(MessageFormat.format("OSAScript execution ended ({0}ms)", new Object[]{String.valueOf(System.currentTimeMillis() - start)}));<NEW_LINE>try {<NEW_LINE>osaProcess.destroy();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>if (errorMsg != null) {<NEW_LINE>throw new IOException(errorMsg);<NEW_LINE>}<NEW_LINE>return line;<NEW_LINE>}
i * 2 + 1] = "-e";
676,736
public default double explainRate(IborIndexObservation observation, ExplainMapBuilder builder, Consumer<ExplainMapBuilder> consumer) {<NEW_LINE>LocalDate fixingDate = observation.getFixingDate();<NEW_LINE>double rate = rate(observation);<NEW_LINE>ExplainMapBuilder child = builder.openListEntry(ExplainKey.OBSERVATIONS);<NEW_LINE>child.put(ExplainKey.ENTRY_TYPE, "IborIndexObservation");<NEW_LINE>child.put(ExplainKey.FIXING_DATE, fixingDate);<NEW_LINE>child.put(ExplainKey.<MASK><NEW_LINE>child.put(ExplainKey.FORWARD_RATE_START_DATE, observation.getEffectiveDate());<NEW_LINE>child.put(ExplainKey.FORWARD_RATE_END_DATE, observation.getMaturityDate());<NEW_LINE>child.put(ExplainKey.INDEX_VALUE, rate);<NEW_LINE>if (fixingDate.isBefore(getValuationDate()) || (fixingDate.equals(getValuationDate()) && getFixings().containsDate(fixingDate))) {<NEW_LINE>child.put(ExplainKey.FROM_FIXING_SERIES, true);<NEW_LINE>}<NEW_LINE>consumer.accept(child);<NEW_LINE>child.closeListEntry(ExplainKey.OBSERVATIONS);<NEW_LINE>return rate;<NEW_LINE>}
INDEX, observation.getIndex());
368,169
public static ThreadFactory[] createThreadFactories(Supplier<ThreadLocalStreamBufferPool> bufferPoolSupplier) {<NEW_LINE>List<ThreadFactory> <MASK><NEW_LINE>if (IS_BENCHMARK_DEBUG) {<NEW_LINE>// Simple threading for debug<NEW_LINE>System.out.println("\n\nWARNING: using debug mode so performance will suffer\n\n");<NEW_LINE>for (int i = 0; i < Runtime.getRuntime().availableProcessors(); i++) {<NEW_LINE>threadFactories.add((runnable) -> new Thread(() -> {<NEW_LINE>ThreadLocalStreamBufferPool bufferPool = bufferPoolSupplier.get();<NEW_LINE>try {<NEW_LINE>bufferPool.activeThreadLocalPooling();<NEW_LINE>runnable.run();<NEW_LINE>} finally {<NEW_LINE>bufferPool.threadComplete();<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Provide socket per thread with thread affinity<NEW_LINE>for (CpuCore cpuCore : CpuCore.getCores()) {<NEW_LINE>for (CpuCore.LogicalCpu logicalCpu : cpuCore.getCpus()) {<NEW_LINE>// Create thread factory for logical CPU<NEW_LINE>ThreadFactory boundThreadFactory = (runnable) -> new Thread(() -> {<NEW_LINE>ThreadLocalStreamBufferPool bufferPool = bufferPoolSupplier.get();<NEW_LINE>try {<NEW_LINE>// Bind thread to logical CPU<NEW_LINE>Affinity.setAffinity(logicalCpu.getCpuAffinity());<NEW_LINE>// Set up for thread local buffer pooling<NEW_LINE>bufferPool.activeThreadLocalPooling();<NEW_LINE>// Run logic for thread<NEW_LINE>runnable.run();<NEW_LINE>} finally {<NEW_LINE>bufferPool.threadComplete();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Add the thread factory<NEW_LINE>threadFactories.add(boundThreadFactory);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return threadFactories.toArray(new ThreadFactory[0]);<NEW_LINE>}
threadFactories = new LinkedList<>();
811,763
public void padding() {<NEW_LINE>if (// infer model<NEW_LINE>labelArray == null) {<NEW_LINE>labelArray = new int[imageArray.length * numOfClass / (IMAGE_SIZE * Float.BYTES)];<NEW_LINE>Arrays.fill(labelArray, 0);<NEW_LINE>}<NEW_LINE>int curSize = labelArray.length / numOfClass;<NEW_LINE>int modSize = curSize - curSize / batchSize * batchSize;<NEW_LINE>int padSize = modSize != 0 ? batchSize * numOfClass - modSize : 0;<NEW_LINE>if (padSize != 0) {<NEW_LINE>int[] padLabelArray = new int[labelArray.length + padSize * numOfClass];<NEW_LINE>byte[] padImageArray = new byte[imageArray.length + padSize * IMAGE_SIZE * Float.BYTES];<NEW_LINE>System.arraycopy(labelArray, 0, <MASK><NEW_LINE>System.arraycopy(imageArray, 0, padImageArray, 0, imageArray.length);<NEW_LINE>for (int i = 0; i < padSize; i++) {<NEW_LINE>int idx = (int) (Math.random() * curSize);<NEW_LINE>System.arraycopy(labelArray, idx * numOfClass, padLabelArray, labelArray.length + i * numOfClass, numOfClass);<NEW_LINE>System.arraycopy(imageArray, idx * IMAGE_SIZE * Float.BYTES, padImageArray, padImageArray.length + i * IMAGE_SIZE * Float.BYTES, IMAGE_SIZE * Float.BYTES);<NEW_LINE>}<NEW_LINE>labelArray = padLabelArray;<NEW_LINE>imageArray = padImageArray;<NEW_LINE>}<NEW_LINE>int padSampleSize = curSize + padSize;<NEW_LINE>batchNum = padSampleSize / batchSize;<NEW_LINE>setPredictLabels(labelArray);<NEW_LINE>LOGGER.info("total samples:" + padSampleSize);<NEW_LINE>LOGGER.info("total batchNum:" + batchNum);<NEW_LINE>}
padLabelArray, 0, labelArray.length);
956,472
private void handleDescribeModel(ChannelHandlerContext ctx, FullHttpRequest req, String modelName, String modelVersion, QueryStringDecoder decoder) throws ModelNotFoundException, ModelVersionNotFoundException {<NEW_LINE>boolean customizedMetadata = Boolean.parseBoolean(NettyUtils.getParameter(decoder, "customized", "false"));<NEW_LINE>if ("all".equals(modelVersion) || !customizedMetadata) {<NEW_LINE>ArrayList<DescribeModelResponse> resp = ApiUtils.getModelDescription(modelName, modelVersion);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>String requestId = NettyUtils.getRequestId(ctx.channel());<NEW_LINE>RequestInput input = new RequestInput(requestId);<NEW_LINE>for (Map.Entry<String, String> entry : req.headers().entries()) {<NEW_LINE>input.updateHeaders(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>input.updateHeaders("describe", "True");<NEW_LINE>RestJob job = new RestJob(ctx, modelName, modelVersion, WorkerCommands.DESCRIBE, input);<NEW_LINE>if (!ModelManager.getInstance().addJob(job)) {<NEW_LINE>String responseMessage = ApiUtils.getDescribeErrorResponseMessage(modelName);<NEW_LINE>throw new ServiceUnavailableException(responseMessage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
NettyUtils.sendJsonResponse(ctx, resp);
1,209,958
public static void addSessionKillsToBatch(PreparedStatement statement, FinishedSession session) throws SQLException {<NEW_LINE><MASK><NEW_LINE>ServerUUID serverUUID = session.getServerUUID();<NEW_LINE>Optional<PlayerKills> playerKills = session.getExtraData().get(PlayerKills.class);<NEW_LINE>if (!playerKills.isPresent())<NEW_LINE>return;<NEW_LINE>for (PlayerKill kill : playerKills.get().asList()) {<NEW_LINE>// Session ID select statement parameters<NEW_LINE>statement.setString(1, playerUUID.toString());<NEW_LINE>statement.setString(2, serverUUID.toString());<NEW_LINE>statement.setLong(3, session.getStart());<NEW_LINE>statement.setLong(4, session.getEnd());<NEW_LINE>// Kill data<NEW_LINE>statement.setString(5, playerUUID.toString());<NEW_LINE>statement.setString(6, kill.getVictim().getUuid().toString());<NEW_LINE>statement.setString(7, serverUUID.toString());<NEW_LINE>statement.setLong(8, kill.getDate());<NEW_LINE>statement.setString(9, StringUtils.truncate(kill.getWeapon(), WEAPON_COLUMN_LENGTH));<NEW_LINE>statement.addBatch();<NEW_LINE>}<NEW_LINE>}
UUID playerUUID = session.getPlayerUUID();
709,894
public J visitNewArray(J.NewArray newArray, P p) {<NEW_LINE>J.NewArray n = newArray;<NEW_LINE>n = n.withPrefix(visitSpace(n.getPrefix(), Space.Location.NEW_ARRAY_PREFIX, p));<NEW_LINE>n = n.withMarkers(visitMarkers(n<MASK><NEW_LINE>Expression temp = (Expression) visitExpression(n, p);<NEW_LINE>if (!(temp instanceof J.NewArray)) {<NEW_LINE>return temp;<NEW_LINE>} else {<NEW_LINE>n = (J.NewArray) temp;<NEW_LINE>}<NEW_LINE>n = n.withTypeExpression(visitAndCast(n.getTypeExpression(), p));<NEW_LINE>n = n.withTypeExpression(n.getTypeExpression() == null ? null : visitTypeName(n.getTypeExpression(), p));<NEW_LINE>n = n.withDimensions(ListUtils.map(n.getDimensions(), d -> visitAndCast(d, p)));<NEW_LINE>if (n.getPadding().getInitializer() != null) {<NEW_LINE>n = n.getPadding().withInitializer(visitContainer(n.getPadding().getInitializer(), JContainer.Location.NEW_ARRAY_INITIALIZER, p));<NEW_LINE>}<NEW_LINE>n = n.withType(visitType(n.getType(), p));<NEW_LINE>return n;<NEW_LINE>}
.getMarkers(), p));
1,515,684
private void updateBuildScript() throws IOException {<NEW_LINE>assert ProjectManager.mutex().isWriteAccess();<NEW_LINE>final AntBuildExtender extender = prj.getLookup().lookup(AntBuildExtender.class);<NEW_LINE>if (extender == null) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.WARNING, "No AntBuildExtender in project: {0}({1})", new Object[] { ProjectUtils.getInformation(prj).getDisplayName(), FileUtil.getFileDisplayName(prj.getProjectDirectory()) });<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!Utilities.hasRemoteExtension(prj)) {<NEW_LINE>if (LOG.isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.FINE, "The project: {0}({1}) does not have current remote platform extension", new Object[] { ProjectUtils.getInformation(prj).getDisplayName(), FileUtil.getFileDisplayName(<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Utilities.copyBuildScript(prj);<NEW_LINE>}
prj.getProjectDirectory()) });
642,025
private SpanEntry parseSpan(EnumConstantSource enumConstant, JavaEnumImpl myEnum) {<NEW_LINE>List<MemberSource<EnumConstantSource.Body, ?>> members = enumConstant.getBody().getMembers();<NEW_LINE>if (members.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String name = "";<NEW_LINE>String description = enumConstant.getJavaDoc().getText();<NEW_LINE>String prefix = "";<NEW_LINE>Collection<KeyValueEntry> tags = new TreeSet<>();<NEW_LINE>Collection<KeyValueEntry> events = new TreeSet<>();<NEW_LINE>for (MemberSource<EnumConstantSource.Body, ?> member : members) {<NEW_LINE>Object internal = member.getInternal();<NEW_LINE>if (!(internal instanceof MethodDeclaration)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>MethodDeclaration methodDeclaration = (MethodDeclaration) internal;<NEW_LINE>String methodName = methodDeclaration.getName().getIdentifier();<NEW_LINE>if ("getName".equals(methodName)) {<NEW_LINE>name = readStringReturnValue(methodDeclaration);<NEW_LINE>} else if ("getTagKeys".equals(methodName)) {<NEW_LINE>tags.addAll(keyValueEntries(myEnum<MASK><NEW_LINE>} else if ("getEvents".equals(methodName)) {<NEW_LINE>events.addAll(keyValueEntries(myEnum, methodDeclaration, EventValue.class));<NEW_LINE>} else if ("prefix".equals(methodName)) {<NEW_LINE>prefix = readStringReturnValue(methodDeclaration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SpanEntry(name, myEnum.getCanonicalName(), enumConstant.getName(), description, prefix, tags, events);<NEW_LINE>}
, methodDeclaration, TagKey.class));
18,885
protected Object sendSearchRequest(Query query, Object unusedContext) throws IOException {<NEW_LINE>this.query = query;<NEW_LINE>invokers.forEach(invoker -> invoker.setMonitor(this));<NEW_LINE>deadline = currentTime<MASK><NEW_LINE>int originalHits = query.getHits();<NEW_LINE>int originalOffset = query.getOffset();<NEW_LINE>int neededHits = originalHits + originalOffset;<NEW_LINE>int q = neededHits;<NEW_LINE>if (group.isBalanced() && !group.isSparse()) {<NEW_LINE>Double topkProbabilityOverrride = query.properties().getDouble(Dispatcher.topKProbability);<NEW_LINE>q = (topkProbabilityOverrride != null) ? searchCluster.estimateHitsToFetch(neededHits, invokers.size(), topkProbabilityOverrride) : searchCluster.estimateHitsToFetch(neededHits, invokers.size());<NEW_LINE>}<NEW_LINE>query.setHits(q);<NEW_LINE>query.setOffset(0);<NEW_LINE>Object context = null;<NEW_LINE>for (SearchInvoker invoker : invokers) {<NEW_LINE>context = invoker.sendSearchRequest(query, context);<NEW_LINE>askedNodes++;<NEW_LINE>}<NEW_LINE>query.setHits(originalHits);<NEW_LINE>query.setOffset(originalOffset);<NEW_LINE>return null;<NEW_LINE>}
() + query.getTimeLeft();
1,475,318
public void actionPerformed(ActionEvent e) {<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final String newOne = ServerManager.showAddServerInstanceWizard();<NEW_LINE>final String serverType = newOne != null ? obtainServerID(newOne) : null;<NEW_LINE>Utilities.performPOMModelOperations(prj.getProjectDirectory().getFileObject("pom.xml"), Collections.singletonList(new // NOI18N<NEW_LINE>ModelOperation<POMModel>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void performOperation(POMModel model) {<NEW_LINE>if (newOne != null) {<NEW_LINE>Properties props = model.getProject().getProperties();<NEW_LINE>if (props == null) {<NEW_LINE>props = model.getFactory().createProperties();<NEW_LINE>model.getProject().setProperties(props);<NEW_LINE>}<NEW_LINE>props.setProperty(MavenJavaEEConstants.HINT_DEPLOY_J2EE_SERVER, serverType);<NEW_LINE>} else {<NEW_LINE>Properties props = model<MASK><NEW_LINE>if (props != null) {<NEW_LINE>props.setProperty(MavenJavaEEConstants.HINT_DEPLOY_J2EE_SERVER, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>JavaEEProjectSettings.setServerInstanceID(prj, newOne);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.getProject().getProperties();
1,427,651
public void load() throws Exception {<NEW_LINE>LOGGER.info("Setting up config database and default workspace..");<NEW_LINE>try (final Database configDatabase = new ConfigsDatabaseInstance(configs.getConfigDatabaseUser(), configs.getConfigDatabasePassword(), configs.getConfigDatabaseUrl()).getAndInitialize();<NEW_LINE>final Database jobDatabase = new JobsDatabaseInstance(configs.getDatabaseUser(), configs.getDatabasePassword(), configs.getDatabaseUrl()).getAndInitialize()) {<NEW_LINE>LOGGER.info("Created initial jobs and configs database...");<NEW_LINE>final JobPersistence jobPersistence = new DefaultJobPersistence(jobDatabase);<NEW_LINE>final AirbyteVersion currAirbyteVersion = configs.getAirbyteVersion();<NEW_LINE>assertNonBreakingMigration(jobPersistence, currAirbyteVersion);<NEW_LINE>runFlywayMigration(configs, configDatabase, jobDatabase);<NEW_LINE>LOGGER.info("Ran Flyway migrations...");<NEW_LINE>final JsonSecretsProcessor jsonSecretsProcessor = JsonSecretsProcessor.builder().maskSecrets(!featureFlags.exposeSecretsInExport()).copySecrets(false).build();<NEW_LINE>final ConfigPersistence configPersistence = DatabaseConfigPersistence.createWithValidation(configDatabase, jsonSecretsProcessor);<NEW_LINE>final ConfigRepository configRepository = new ConfigRepository(configPersistence, configDatabase);<NEW_LINE>createWorkspaceIfNoneExists(configRepository);<NEW_LINE>LOGGER.info("Default workspace created..");<NEW_LINE>createDeploymentIfNoneExists(jobPersistence);<NEW_LINE>LOGGER.info("Default deployment created..");<NEW_LINE>jobPersistence.<MASK><NEW_LINE>LOGGER.info("Set version to {}", currAirbyteVersion);<NEW_LINE>}<NEW_LINE>if (postLoadExecution != null) {<NEW_LINE>postLoadExecution.run();<NEW_LINE>LOGGER.info("Finished running post load Execution..");<NEW_LINE>}<NEW_LINE>LOGGER.info("Finished bootstrapping Airbyte environment..");<NEW_LINE>}
setVersion(currAirbyteVersion.serialize());
526,212
public void initFreeStreamer(double tL, double tV, double tH) {<NEW_LINE>double tx = getFacing().getAxis() == Axis.X ? tL : tH;<NEW_LINE>double ty = getFacing().getAxis() == Axis.Y ? tL : tV;<NEW_LINE>double tz = getFacing().getAxis() == Axis.Y ? tV : getFacing().getAxis() == Axis.X ? tH : tL;<NEW_LINE>Direction f = null;<NEW_LINE>if (getFacing().getAxis() == Axis.Y) {<NEW_LINE>if (Math.abs(tz) > Math.abs(tx))<NEW_LINE>f = tz < 0 ? Direction.NORTH : Direction.SOUTH;<NEW_LINE>else<NEW_LINE>f = tx < 0 ? Direction.WEST : Direction.EAST;<NEW_LINE>} else if (getFacing().getAxis() == Axis.Z) {<NEW_LINE>if (Math.abs(ty) > Math.abs(tx))<NEW_LINE>f = ty < 0 ? Direction.DOWN : Direction.UP;<NEW_LINE>else<NEW_LINE>f = tx < 0 ? Direction.WEST : Direction.EAST;<NEW_LINE>} else {<NEW_LINE>if (Math.abs(ty) > Math.abs(tz))<NEW_LINE>f = ty < 0 ? Direction.DOWN : Direction.UP;<NEW_LINE>else<NEW_LINE>f = tz < 0 ? Direction.NORTH : Direction.SOUTH;<NEW_LINE>}<NEW_LINE>double verticalOffset = 1 + Utils.RAND.nextDouble() * .25;<NEW_LINE>Vec3 coilPos = Vec3.atCenterOf(getBlockPos());<NEW_LINE>// Vertical offset<NEW_LINE>coilPos = coilPos.add(getFacing().getStepX() * verticalOffset, getFacing().getStepY() * verticalOffset, getFacing().getStepZ() * verticalOffset);<NEW_LINE>// offset to direction<NEW_LINE>coilPos = coilPos.add(f.getStepX() * .375, f.getStepY() * .375, <MASK><NEW_LINE>// random side offset<NEW_LINE>f = DirectionUtils.rotateAround(f, getFacing().getAxis());<NEW_LINE>double dShift = (Utils.RAND.nextDouble() - .5) * .75;<NEW_LINE>coilPos = coilPos.add(f.getStepX() * dShift, f.getStepY() * dShift, f.getStepZ() * dShift);<NEW_LINE>addAnimation(new LightningAnimation(coilPos, Vec3.atLowerCornerOf(getBlockPos()).add(tx, ty, tz)));<NEW_LINE>// world.playSound(null, getPos(), IESounds.tesla, SoundCategory.BLOCKS,2.5f, .5f + Utils.RAND.nextFloat());<NEW_LINE>level.playLocalSound(getBlockPos().getX(), getBlockPos().getY(), getBlockPos().getZ(), IESounds.tesla, SoundSource.BLOCKS, 2.5F, 0.5F + Utils.RAND.nextFloat(), true);<NEW_LINE>}
f.getStepZ() * .375);
1,217,884
private static SummaryViewMaster createViewSummaryMaster(final SearchHistoryPanel master) {<NEW_LINE>final Map<String, String> colors = new HashMap<String, String>();<NEW_LINE>colors.put("A", SvnUtils.getColorString(AnnotationColorProvider.getInstance().ADDED_LOCALLY_FILE.getActualColor()));<NEW_LINE>colors.put("C", SvnUtils.getColorString(AnnotationColorProvider.getInstance().COPIED_LOCALLY_FILE.getActualColor()));<NEW_LINE>colors.put("R", SvnUtils.getColorString(AnnotationColorProvider.getInstance().COPIED_LOCALLY_FILE.getActualColor()));<NEW_LINE>colors.put("M", SvnUtils.getColorString(AnnotationColorProvider.getInstance().MODIFIED_LOCALLY_FILE.getActualColor()));<NEW_LINE>colors.put("D", SvnUtils.getColorString(AnnotationColorProvider.getInstance().REMOVED_LOCALLY_FILE.getActualColor()));<NEW_LINE>colors.put("?", SvnUtils.getColorString(AnnotationColorProvider.getInstance()<MASK><NEW_LINE>return new SummaryViewMaster() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public JComponent getComponent() {<NEW_LINE>return master;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public File[] getRoots() {<NEW_LINE>return master.getRoots();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Collection<SearchHighlight> getSearchHighlights() {<NEW_LINE>return master.getSearchHighlights();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, String> getActionColors() {<NEW_LINE>return colors;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void getMoreResults(PropertyChangeListener callback, int count) {<NEW_LINE>master.getMoreRevisions(callback, count);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasMoreResults() {<NEW_LINE>return master.hasMoreResults();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
.EXCLUDED_FILE.getActualColor()));
775,972
private BLangInvocation desugarStreamTypeInit(BLangTypeInit typeInitExpr) {<NEW_LINE>BInvokableSymbol symbol = (BInvokableSymbol) symTable.langInternalModuleSymbol.scope.<MASK><NEW_LINE>BType constraintType = ((BStreamType) typeInitExpr.getBType()).constraint;<NEW_LINE>BType constraintTdType = new BTypedescType(constraintType, symTable.typeDesc.tsymbol);<NEW_LINE>BLangTypedescExpr constraintTdExpr = new BLangTypedescExpr();<NEW_LINE>constraintTdExpr.resolvedType = constraintType;<NEW_LINE>constraintTdExpr.setBType(constraintTdType);<NEW_LINE>BType completionType = ((BStreamType) typeInitExpr.getBType()).completionType;<NEW_LINE>BType completionTdType = new BTypedescType(completionType, symTable.typeDesc.tsymbol);<NEW_LINE>BLangTypedescExpr completionTdExpr = new BLangTypedescExpr();<NEW_LINE>completionTdExpr.resolvedType = completionType;<NEW_LINE>completionTdExpr.setBType(completionTdType);<NEW_LINE>List<BLangExpression> args = new ArrayList<>(Lists.of(constraintTdExpr, completionTdExpr));<NEW_LINE>if (!typeInitExpr.argsExpr.isEmpty()) {<NEW_LINE>args.add(typeInitExpr.argsExpr.get(0));<NEW_LINE>}<NEW_LINE>BLangInvocation streamConstructInvocation = ASTBuilderUtil.createInvocationExprForMethod(typeInitExpr.pos, symbol, args, symResolver);<NEW_LINE>streamConstructInvocation.setBType(new BStreamType(TypeTags.STREAM, constraintType, completionType, null));<NEW_LINE>return streamConstructInvocation;<NEW_LINE>}
lookup(Names.CONSTRUCT_STREAM).symbol;
46,442
public void onCurrencyChange(final I_C_Payment payment) {<NEW_LINE>final int C_Invoice_ID = payment.getC_Invoice_ID();<NEW_LINE>final int C_Order_ID = payment.getC_Order_ID();<NEW_LINE>// Get Currency Info<NEW_LINE>final CurrencyId currencyId = CurrencyId.ofRepoIdOrNull(payment.getC_Currency_ID());<NEW_LINE>final CurrencyId invoiceCurrencyId = fetchC_Currency_Invoice_ID(payment);<NEW_LINE>final LocalDate convDate = TimeUtil.asLocalDate(payment.getDateTrx());<NEW_LINE>final CurrencyConversionTypeId conversionTypeId = CurrencyConversionTypeId.ofRepoIdOrNull(payment.getC_ConversionType_ID());<NEW_LINE>final ClientId clientId = ClientId.ofRepoId(payment.getAD_Client_ID());<NEW_LINE>final OrgId orgId = OrgId.ofRepoId(payment.getAD_Org_ID());<NEW_LINE>// Get Currency Rate<NEW_LINE>BigDecimal currencyRate = BigDecimal.ONE;<NEW_LINE>if (currencyId != null && invoiceCurrencyId != null && !currencyId.equals(invoiceCurrencyId)) {<NEW_LINE>currencyRate = currencyBL.getCurrencyRate(invoiceCurrencyId, currencyId, convDate, conversionTypeId, clientId, orgId).getConversionRate();<NEW_LINE>}<NEW_LINE>BigDecimal PayAmt = payment.getPayAmt();<NEW_LINE>BigDecimal DiscountAmt = payment.getDiscountAmt();<NEW_LINE>BigDecimal WriteOffAmt = payment.getWriteOffAmt();<NEW_LINE>BigDecimal OverUnderAmt = payment.getOverUnderAmt();<NEW_LINE>final CurrencyPrecision precision = currencyId != null ? currencyDAO.<MASK><NEW_LINE>PayAmt = precision.round(PayAmt.multiply(currencyRate));<NEW_LINE>payment.setPayAmt(PayAmt);<NEW_LINE>DiscountAmt = precision.round(DiscountAmt.multiply(currencyRate));<NEW_LINE>payment.setDiscountAmt(DiscountAmt);<NEW_LINE>WriteOffAmt = precision.round(WriteOffAmt.multiply(currencyRate));<NEW_LINE>payment.setWriteOffAmt(WriteOffAmt);<NEW_LINE>OverUnderAmt = precision.round(OverUnderAmt.multiply(currencyRate));<NEW_LINE>payment.setOverUnderAmt(OverUnderAmt);<NEW_LINE>// No Invoice or Order - Set Discount, Witeoff, Under/Over to 0<NEW_LINE>if (C_Invoice_ID <= 0 && C_Order_ID <= 0) {<NEW_LINE>if (ZERO.compareTo(DiscountAmt) != 0) {<NEW_LINE>payment.setDiscountAmt(ZERO);<NEW_LINE>}<NEW_LINE>if (ZERO.compareTo(WriteOffAmt) != 0) {<NEW_LINE>payment.setWriteOffAmt(ZERO);<NEW_LINE>}<NEW_LINE>if (ZERO.compareTo(OverUnderAmt) != 0) {<NEW_LINE>payment.setOverUnderAmt(ZERO);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getStdPrecision(currencyId) : CurrencyPrecision.TWO;
80,441
public static BaseBean findBeanByName(BaseBean parent, String beanProperty, String nameProperty, String value) {<NEW_LINE>Class c = parent.getClass();<NEW_LINE>Method getter;<NEW_LINE>Object result;<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>getter = c.getMethod("get" + getNameForMethod((CommonDDBean) parent, beanProperty));<NEW_LINE>result = getter.invoke(parent);<NEW_LINE>if (result == null) {<NEW_LINE>return null;<NEW_LINE>} else if (result instanceof BaseBean) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>BaseBean[] beans = (BaseBean[]) result;<NEW_LINE>for (int i = 0; i < beans.length; i++) {<NEW_LINE>Class c1 = beans[i].getClass();<NEW_LINE>Method getter1;<NEW_LINE>Object result1;<NEW_LINE>// NOI18N<NEW_LINE>getter1 = <MASK><NEW_LINE>result1 = getter1.invoke(beans[i]);<NEW_LINE>if (result1 instanceof String) {<NEW_LINE>if (value.equals((String) result1)) {<NEW_LINE>return beans[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// This is a programming error<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new RuntimeException(NbBundle.getMessage(CommonDDAccess.class, "MSG_COMMONDDACCESS_ERROR", "getBeanByName", "parent = " + parent + ", beanProperty = " + beanProperty + ", nameProperty = " + nameProperty + ", value = " + value, e + ": " + e.getMessage()));<NEW_LINE>}<NEW_LINE>}
c1.getMethod("get" + nameProperty);
1,646,131
private DdlJob buildTruncateTableWithGsiJob(LogicalTruncateTable logicalTruncateTable, boolean isNewPartDb, ExecutionContext executionContext) {<NEW_LINE>String tmpTableSuffix = TruncateUtil.generateTmpTableRandomSuffix();<NEW_LINE>TruncateTableWithGsiPreparedData truncateTableWithGsiPreparedData = logicalTruncateTable.getTruncateTableWithGsiPreparedData();<NEW_LINE>Map<String, String> <MASK><NEW_LINE>LogicalCreateTable logicalCreateTable = generateLogicalCreateTmpTable(logicalTruncateTable.getSchemaName(), logicalTruncateTable.getTableName(), tmpTableSuffix, tmpIndexTableMap, isNewPartDb, executionContext);<NEW_LINE>if (isNewPartDb) {<NEW_LINE>List<String> tmpIndexTableNames = new ArrayList<>(logicalCreateTable.getCreateTableWithGsiPreparedData().getIndexTablePreparedDataMap().keySet());<NEW_LINE>List<String> originIndexTableNames = new ArrayList<>(logicalTruncateTable.getTruncateTableWithGsiPreparedData().getIndexTablePreparedDataMap().keySet());<NEW_LINE>tmpIndexTableMap = TruncateUtil.generateTmpIndexTableMap(originIndexTableNames, tmpIndexTableNames, tmpTableSuffix, isNewPartDb);<NEW_LINE>}<NEW_LINE>truncateTableWithGsiPreparedData.setTmpIndexTableMap(tmpIndexTableMap);<NEW_LINE>truncateTableWithGsiPreparedData.setLogicalCreateTable(logicalCreateTable);<NEW_LINE>truncateTableWithGsiPreparedData.setTmpTableSuffix(tmpTableSuffix);<NEW_LINE>return new TruncateTableWithGsiJobFactory(truncateTableWithGsiPreparedData, executionContext).create();<NEW_LINE>}
tmpIndexTableMap = new HashMap<>();
652,416
private static void testCollection(EntityManagerFactory entityManagerFactory) {<NEW_LINE>// Collections not stored on cache on inserts<NEW_LINE>Map<String, Counts> counts = new TreeMap<>();<NEW_LINE>counts.put(Trainer.class.getName(), new Counts(1, 0, 0, 1));<NEW_LINE>counts.put(Trainer.class.getName() + ".pokemons", new Counts(0, 0, 0, 0));<NEW_LINE>storeTestPokemonTrainers(entityManagerFactory, counts);<NEW_LINE>counts = new TreeMap<>();<NEW_LINE>counts.put(Trainer.class.getName(), new Counts(0, 1, 0, 1));<NEW_LINE>counts.put(Trainer.class.getName() + ".pokemons", new Counts(1, 0, 1, 1));<NEW_LINE>verifyReadWriteCollection(entityManagerFactory, 3, counts);<NEW_LINE><MASK><NEW_LINE>counts.put(Trainer.class.getName(), new Counts(0, 1, 0, 1));<NEW_LINE>// Collections get evicted upon updates<NEW_LINE>counts.put(Trainer.class.getName() + ".pokemons", new Counts(0, 1, 0, 0));<NEW_LINE>addTestPokemonForTrainer(entityManagerFactory, counts);<NEW_LINE>counts = new TreeMap<>();<NEW_LINE>counts.put(Trainer.class.getName(), new Counts(0, 1, 0, 1));<NEW_LINE>counts.put(Trainer.class.getName() + ".pokemons", new Counts(1, 0, 1, 1));<NEW_LINE>verifyReadWriteCollection(entityManagerFactory, 4, counts);<NEW_LINE>}
counts = new TreeMap<>();
530,110
private void initialize() {<NEW_LINE>if (!configuration.dryrun() && configuration.randomStartupSleepMs() > 0) {<NEW_LINE>int delay = ThreadLocalRandom.current().nextInt(configuration.randomStartupSleepMs());<NEW_LINE>log.info("VespaStorage: Delaying startup by " + delay + " ms");<NEW_LINE>try {<NEW_LINE>Thread.sleep(delay);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ConnectionParams.Builder connParamsBuilder = configureConnectionParams();<NEW_LINE>FeedParams.Builder feedParamsBuilder = configureFeedParams();<NEW_LINE>SessionParams.Builder sessionParams = configureSessionParams();<NEW_LINE>sessionParams.setConnectionParams(connParamsBuilder.build());<NEW_LINE>sessionParams.setFeedParams(feedParamsBuilder.build());<NEW_LINE>String endpoints = configuration.endpoint();<NEW_LINE>StringTokenizer tokenizer <MASK><NEW_LINE>while (tokenizer.hasMoreTokens()) {<NEW_LINE>String endpoint = tokenizer.nextToken().trim();<NEW_LINE>sessionParams.addCluster(new Cluster.Builder().addEndpoint(Endpoint.create(endpoint, configuration.defaultPort(), configuration.useSSL().orElse(false))).build());<NEW_LINE>}<NEW_LINE>ResultCallback resultCallback = new ResultCallback(counters);<NEW_LINE>feedClient = com.yahoo.vespa.http.client.FeedClientFactory.create(sessionParams.build(), resultCallback);<NEW_LINE>initialized = true;<NEW_LINE>log.info("VespaStorage configuration:\n" + configuration.toString());<NEW_LINE>log.info(feedClient.getStatsAsJson());<NEW_LINE>}
= new StringTokenizer(endpoints, ",");
1,104,999
public Request<CreateCacheSecurityGroupRequest> marshall(CreateCacheSecurityGroupRequest createCacheSecurityGroupRequest) {<NEW_LINE>if (createCacheSecurityGroupRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreateCacheSecurityGroupRequest> request = new DefaultRequest<CreateCacheSecurityGroupRequest>(createCacheSecurityGroupRequest, "AmazonElastiCache");<NEW_LINE>request.addParameter("Action", "CreateCacheSecurityGroup");<NEW_LINE>request.addParameter("Version", "2015-02-02");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (createCacheSecurityGroupRequest.getCacheSecurityGroupName() != null) {<NEW_LINE>request.addParameter("CacheSecurityGroupName", StringUtils.fromString(createCacheSecurityGroupRequest.getCacheSecurityGroupName()));<NEW_LINE>}<NEW_LINE>if (createCacheSecurityGroupRequest.getDescription() != null) {<NEW_LINE>request.addParameter("Description", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (!createCacheSecurityGroupRequest.getTags().isEmpty() || !((com.amazonaws.internal.SdkInternalList<Tag>) createCacheSecurityGroupRequest.getTags()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<Tag> tagsList = (com.amazonaws.internal.SdkInternalList<Tag>) createCacheSecurityGroupRequest.getTags();<NEW_LINE>int tagsListIndex = 1;<NEW_LINE>for (Tag tagsListValue : tagsList) {<NEW_LINE>if (tagsListValue != null) {<NEW_LINE>if (tagsListValue.getKey() != null) {<NEW_LINE>request.addParameter("Tags.Tag." + tagsListIndex + ".Key", StringUtils.fromString(tagsListValue.getKey()));<NEW_LINE>}<NEW_LINE>if (tagsListValue.getValue() != null) {<NEW_LINE>request.addParameter("Tags.Tag." + tagsListIndex + ".Value", StringUtils.fromString(tagsListValue.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tagsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(createCacheSecurityGroupRequest.getDescription()));
521,777
static void backsubstitution0134(DMatrixRMaj P_plus, DMatrixRMaj P, DMatrixRMaj X, double[] H) {<NEW_LINE>final int N = P.numRows;<NEW_LINE>DMatrixRMaj tmp = new DMatrixRMaj(N * 2, 1);<NEW_LINE>double H6 = H[6];<NEW_LINE>double H7 = H[7];<NEW_LINE>double H8 = H[8];<NEW_LINE>for (int i = 0, index = 0; i < N; i++) {<NEW_LINE>double x = -X.data[index], y = -X.data[index + 1];<NEW_LINE>double sum = P.data[index++] * H6 + P.data[index++] * H7 + H8;<NEW_LINE>tmp.data[i] = x * sum;<NEW_LINE>tmp.data[i + N] = y * sum;<NEW_LINE>}<NEW_LINE>double h0 = 0, h1 = 0<MASK><NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>double P_pls_0 = P_plus.data[i];<NEW_LINE>double P_pls_1 = P_plus.data[i + N];<NEW_LINE>double tmp_i = tmp.data[i];<NEW_LINE>double tmp_j = tmp.data[i + N];<NEW_LINE>h0 += P_pls_0 * tmp_i;<NEW_LINE>h1 += P_pls_1 * tmp_i;<NEW_LINE>h3 += P_pls_0 * tmp_j;<NEW_LINE>h4 += P_pls_1 * tmp_j;<NEW_LINE>}<NEW_LINE>H[0] = -h0;<NEW_LINE>H[1] = -h1;<NEW_LINE>H[3] = -h3;<NEW_LINE>H[4] = -h4;<NEW_LINE>}
, h3 = 0, h4 = 0;
1,221,510
// Configure stage4<NEW_LINE>protected JobConf configStage4() throws Exception {<NEW_LINE>final JobConf conf = new JobConf(getConf(), ConCmpt.class);<NEW_LINE>conf.set("number_nodes", "" + number_nodes);<NEW_LINE>conf.set("cur_iter", "" + cur_iter);<NEW_LINE>conf.set("make_symmetric", "" + make_symmetric);<NEW_LINE>conf.setJobName("ConCmpt_Stage4");<NEW_LINE><MASK><NEW_LINE>conf.setReducerClass(RedStage4.class);<NEW_LINE>conf.setCombinerClass(RedStage4.class);<NEW_LINE>FileInputFormat.setInputPaths(conf, curbm_path);<NEW_LINE>FileOutputFormat.setOutputPath(conf, summaryout_path);<NEW_LINE>conf.setNumReduceTasks(nreducers);<NEW_LINE>conf.setOutputKeyClass(IntWritable.class);<NEW_LINE>conf.setOutputValueClass(IntWritable.class);<NEW_LINE>return conf;<NEW_LINE>}
conf.setMapperClass(MapStage4.class);
224,135
protected void aggregateOneAlignedSeries(AlignedPath alignedPath, List<List<Integer>> subIndexes, Set<String> allMeasurementsInDevice, Filter timeFilter) throws IOException, QueryProcessException, StorageEngineException {<NEW_LINE>List<List<AggregateResult>> ascAggregateResultList = new ArrayList<>();<NEW_LINE>List<List<AggregateResult>> descAggregateResultList = new ArrayList<>();<NEW_LINE>boolean[] isAsc = new boolean[aggregateResultList.length];<NEW_LINE>for (List<Integer> subIndex : subIndexes) {<NEW_LINE>TSDataType tsDataType = dataTypes.get<MASK><NEW_LINE>List<AggregateResult> subAscResultList = new ArrayList<>();<NEW_LINE>List<AggregateResult> subDescResultList = new ArrayList<>();<NEW_LINE>for (int i : subIndex) {<NEW_LINE>// construct AggregateResult<NEW_LINE>AggregateResult aggregateResult = AggregateResultFactory.getAggrResultByName(aggregations.get(i), tsDataType);<NEW_LINE>if (aggregateResult.isAscending()) {<NEW_LINE>subAscResultList.add(aggregateResult);<NEW_LINE>isAsc[i] = true;<NEW_LINE>} else {<NEW_LINE>subDescResultList.add(aggregateResult);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ascAggregateResultList.add(subAscResultList);<NEW_LINE>descAggregateResultList.add(subDescResultList);<NEW_LINE>}<NEW_LINE>aggregateOneAlignedSeries(alignedPath, allMeasurementsInDevice, context, timeFilter, TSDataType.VECTOR, ascAggregateResultList, descAggregateResultList, null, ascending);<NEW_LINE>for (int i = 0; i < subIndexes.size(); i++) {<NEW_LINE>List<Integer> subIndex = subIndexes.get(i);<NEW_LINE>List<AggregateResult> subAscResultList = ascAggregateResultList.get(i);<NEW_LINE>List<AggregateResult> subDescResultList = descAggregateResultList.get(i);<NEW_LINE>int ascIndex = 0;<NEW_LINE>int descIndex = 0;<NEW_LINE>for (int index : subIndex) {<NEW_LINE>aggregateResultList[index] = isAsc[index] ? subAscResultList.get(ascIndex++) : subDescResultList.get(descIndex++);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(subIndex.get(0));
1,300,613
public void addGetter(Class<?> getterClass, String fieldName) throws InstrumentException {<NEW_LINE>Objects.requireNonNull(getterClass, "getterClass");<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>final GetterAnalyzer.GetterDetails getterDetails = new GetterAnalyzer().analyze(getterClass);<NEW_LINE>final ASMFieldNodeAdapter fieldNode = this.classNode.getField(fieldName, null);<NEW_LINE>if (fieldNode == null) {<NEW_LINE>throw new IllegalArgumentException("Not found field. name=" + fieldName);<NEW_LINE>}<NEW_LINE>final String fieldTypeName = JavaAssistUtils.javaClassNameToObjectName(getterDetails.getFieldType().getName());<NEW_LINE>if (!fieldNode.getClassName().equals(fieldTypeName)) {<NEW_LINE>throw new IllegalArgumentException("different return type. return=" + fieldTypeName + ", field=" + fieldNode.getClassName());<NEW_LINE>}<NEW_LINE>this.classNode.addGetterMethod(getterDetails.getGetter().getName(), fieldNode);<NEW_LINE>this.classNode.addInterface(getterClass.getName());<NEW_LINE>setModified(true);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new InstrumentException("Failed to add getter: " + getterClass.getName(), e);<NEW_LINE>}<NEW_LINE>}
Objects.requireNonNull(fieldName, "fieldName");
834,450
public SubjectAreaOMASAPIResponse<Term> updateTerm(String serverName, String userId, String guid, Term suppliedTerm, boolean isReplace) {<NEW_LINE>final String methodName = "updateTerm";<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("==> Method: " + methodName + ",userId=" + userId + ",guid=" + guid);<NEW_LINE>}<NEW_LINE>SubjectAreaOMASAPIResponse<Term> response = new SubjectAreaOMASAPIResponse<>();<NEW_LINE>AuditLog auditLog = null;<NEW_LINE>try {<NEW_LINE>auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);<NEW_LINE>SubjectAreaTermHandler handler = instanceHandler.getSubjectAreaTermHandler(userId, serverName, methodName);<NEW_LINE>response = handler.updateTerm(userId, guid, suppliedTerm, instanceHandler.getSubjectAreaRelationshipHandler(userId, serverName, methodName), isReplace);<NEW_LINE>} catch (OCFCheckedExceptionBase e) {<NEW_LINE>response.setExceptionInfo(e, className);<NEW_LINE>} catch (Exception exception) {<NEW_LINE>response = getResponseForException(exception, auditLog, className, methodName);<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("<== successful method : " + methodName + <MASK><NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
",userId=" + userId + ", response =" + response);
119,065
public okhttp3.Call postPingCall(SomeObj someObj, final ApiCallback _callback) throws ApiException {<NEW_LINE>String basePath = null;<NEW_LINE>// Operation Servers<NEW_LINE>String[] <MASK><NEW_LINE>// Determine Base Path to Use<NEW_LINE>if (localCustomBaseUrl != null) {<NEW_LINE>basePath = localCustomBaseUrl;<NEW_LINE>} else if (localBasePaths.length > 0) {<NEW_LINE>basePath = localBasePaths[localHostIndex];<NEW_LINE>} else {<NEW_LINE>basePath = null;<NEW_LINE>}<NEW_LINE>Object localVarPostBody = someObj;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/ping";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>if (localVarContentType != null) {<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
localBasePaths = new String[] {};
666,821
public void configure(Map conf) {<NEW_LINE>this.stormConf = conf;<NEW_LINE>topic = getConfig("kafka.topic", "jstorm");<NEW_LINE>zkRoot = getConfig("storm.zookeeper.root", "/jstorm");<NEW_LINE>String zkHosts = getConfig("kafka.zookeeper.hosts", "127.0.0.1:2181");<NEW_LINE><MASK><NEW_LINE>String brokerHosts = getConfig("kafka.broker.hosts", "127.0.0.1:9092");<NEW_LINE>brokers = convertHosts(brokerHosts, 9092);<NEW_LINE>numPartitions = JStormUtils.parseInt(getConfig("kafka.broker.partitions"), 1);<NEW_LINE>fetchMaxBytes = JStormUtils.parseInt(getConfig("kafka.fetch.max.bytes"), 256 * 1024);<NEW_LINE>fetchWaitMaxMs = JStormUtils.parseInt(getConfig("kafka.fetch.wait.max.ms"), 10000);<NEW_LINE>socketTimeoutMs = JStormUtils.parseInt(getConfig("kafka.socket.timeout.ms"), 30 * 1000);<NEW_LINE>socketReceiveBufferBytes = JStormUtils.parseInt(getConfig("kafka.socket.receive.buffer.bytes"), 64 * 1024);<NEW_LINE>fromBeginning = JStormUtils.parseBoolean(getConfig("kafka.fetch.from.beginning"), false);<NEW_LINE>startOffsetTime = JStormUtils.parseInt(getConfig("kafka.start.offset.time"), -1);<NEW_LINE>offsetUpdateIntervalMs = JStormUtils.parseInt(getConfig("kafka.offset.update.interval.ms"), 2000);<NEW_LINE>clientId = getConfig("kafka.client.id", "jstorm");<NEW_LINE>batchSendCount = JStormUtils.parseInt(getConfig("kafka.spout.batch.send.count"), 1);<NEW_LINE>}
zkServers = convertHosts(zkHosts, 2181);
1,035,848
private ArrayList<FaceEdge> computeShortestPathInDualGraph(FaceVertex sourceVertex, FaceVertex destVertex, Collection<FaceVertex> visitedVertices, int minPathLength, Collection<Face> faces) {<NEW_LINE>ArrayList<FaceEdge> shortestPath = null;<NEW_LINE>visitedVertices.add(sourceVertex);<NEW_LINE>for (FaceEdge e : sourceVertex.getEdges()) {<NEW_LINE>if (e.contains(destVertex)) {<NEW_LINE>shortestPath = new ArrayList<FaceEdge>();<NEW_LINE>shortestPath.add(e);<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>FaceVertex oppositeVertex = e.getOppositeVertex(sourceVertex);<NEW_LINE>if (!faces.contains(oppositeVertex.getFace())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (visitedVertices.contains(oppositeVertex)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (visitedVertices.size() - 1 > minPathLength) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Collection<FaceEdge> path = computeShortestPathInDualGraph(oppositeVertex, destVertex, visitedVertices, minPathLength, faces);<NEW_LINE>if (path == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (shortestPath == null || path.size() < shortestPath.size() - 1) {<NEW_LINE>shortestPath <MASK><NEW_LINE>shortestPath.add(e);<NEW_LINE>shortestPath.addAll(path);<NEW_LINE>minPathLength = shortestPath.size();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>visitedVertices.remove(sourceVertex);<NEW_LINE>return shortestPath;<NEW_LINE>}
= new ArrayList<FaceEdge>();
246,662
/* (non-Javadoc)<NEW_LINE>* @see org.netbeans.modules.web.common.websocket.WebSocketChanelHandler#sendHandshake()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void sendHandshake() throws IOException {<NEW_LINE>String acceptKey = createAcceptKey(getKey());<NEW_LINE>if (acceptKey == null) {<NEW_LINE>close();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder builder = new StringBuilder(Utils.HTTP_RESPONSE);<NEW_LINE>builder.append(Utils.CRLF);<NEW_LINE>builder.append(Utils.WS_UPGRADE);<NEW_LINE>builder.append(Utils.CRLF);<NEW_LINE>builder.append(Utils.CONN_UPGRADE);<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>builder.append("Sec-WebSocket-Origin: ");<NEW_LINE>// NOI18N<NEW_LINE>String origin = getWebSocketPoint().getContext(myKey).getHeaders().get("Sec-WebSocket-Origin");<NEW_LINE>if (origin == null) {<NEW_LINE>// NOI18N<NEW_LINE>origin = getWebSocketPoint().getContext(myKey).getHeaders().get("Origin");<NEW_LINE>}<NEW_LINE>if (origin != null) {<NEW_LINE>builder.append(origin);<NEW_LINE>}<NEW_LINE>builder.append(Utils.CRLF);<NEW_LINE>builder.append(Utils.ACCEPT);<NEW_LINE>builder.append(": ");<NEW_LINE>builder.append(acceptKey);<NEW_LINE>builder.append(Utils.CRLF);<NEW_LINE>builder.append(Utils.CRLF);<NEW_LINE>getWebSocketPoint().send(builder.toString().getBytes(Charset.forName(Utils.UTF_8)), myKey);<NEW_LINE>}
builder.append(Utils.CRLF);
1,504,888
private boolean loadNextSkip(int level) throws IOException {<NEW_LINE>// we have to skip, the target document is greater than the current<NEW_LINE>// skip list entry<NEW_LINE>setLastSkipData(level);<NEW_LINE>numSkipped[level] += skipInterval[level];<NEW_LINE>// numSkipped may overflow a signed int, so compare as unsigned.<NEW_LINE>if (Integer.compareUnsigned(numSkipped[level], docCount) > 0) {<NEW_LINE>// this skip list is exhausted<NEW_LINE>skipDoc[level] = Integer.MAX_VALUE;<NEW_LINE>if (numberOfSkipLevels > level)<NEW_LINE>numberOfSkipLevels = level;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// read next skip entry<NEW_LINE>skipDoc[level] += readSkipData(level, skipStream[level]);<NEW_LINE>if (level != 0) {<NEW_LINE>// read the child pointer if we are not on the leaf level<NEW_LINE>childPointer[level] = readChildPointer(skipStream[level]<MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
) + skipPointer[level - 1];
870,021
public static boolean renameMasterDirInZK(ServerContext context) {<NEW_LINE>final ZooReaderWriter zoo = context.getZooReaderWriter();<NEW_LINE>final String mastersZooDir = context.getZooKeeperRoot() + "/masters";<NEW_LINE>final String managersZooDir = context.getZooKeeperRoot() + Constants.ZMANAGERS;<NEW_LINE>try {<NEW_LINE>boolean <MASK><NEW_LINE>if (mastersDirExists) {<NEW_LINE>LOG.info("Copying ZooKeeper directory {} to {}.", mastersZooDir, managersZooDir);<NEW_LINE>zoo.recursiveCopyPersistentOverwrite(mastersZooDir, managersZooDir);<NEW_LINE>LOG.info("Deleting ZooKeeper directory {}.", mastersZooDir);<NEW_LINE>zoo.recursiveDelete(mastersZooDir, ZooUtil.NodeMissingPolicy.SKIP);<NEW_LINE>}<NEW_LINE>return mastersDirExists;<NEW_LINE>} catch (KeeperException | InterruptedException e) {<NEW_LINE>throw new RuntimeException("Unable to rename " + mastersZooDir + " in ZooKeeper", e);<NEW_LINE>}<NEW_LINE>}
mastersDirExists = zoo.exists(mastersZooDir);
1,001,435
public static String sshPublicKey() {<NEW_LINE>if (sshPublicKey == null) {<NEW_LINE>try {<NEW_LINE>KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");<NEW_LINE>keyGen.initialize(1024);<NEW_LINE>KeyPair pair = keyGen.generateKeyPair();<NEW_LINE>PublicKey publicKey = pair.getPublic();<NEW_LINE>RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;<NEW_LINE>ByteArrayOutputStream byteOs = new ByteArrayOutputStream();<NEW_LINE>DataOutputStream dos = new DataOutputStream(byteOs);<NEW_LINE>dos.writeInt("ssh-rsa".getBytes(StandardCharsets.US_ASCII).length);<NEW_LINE>dos.write("ssh-rsa".getBytes(StandardCharsets.US_ASCII));<NEW_LINE>dos.writeInt(rsaPublicKey.getPublicExponent().toByteArray().length);<NEW_LINE>dos.write(rsaPublicKey.<MASK><NEW_LINE>dos.writeInt(rsaPublicKey.getModulus().toByteArray().length);<NEW_LINE>dos.write(rsaPublicKey.getModulus().toByteArray());<NEW_LINE>String publicKeyEncoded = new String(Base64.getEncoder().encode(byteOs.toByteArray()), StandardCharsets.US_ASCII);<NEW_LINE>sshPublicKey = "ssh-rsa " + publicKeyEncoded;<NEW_LINE>} catch (NoSuchAlgorithmException | IOException e) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalStateException("failed to generate ssh key", e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sshPublicKey;<NEW_LINE>}
getPublicExponent().toByteArray());
718,922
// Note: Ported from DataverseUserPage<NEW_LINE>public void validateNewPassword(FacesContext context, UIComponent toValidate, Object value) {<NEW_LINE>String password = (String) value;<NEW_LINE>if (StringUtils.isBlank(password)) {<NEW_LINE>logger.log(Level.WARNING<MASK><NEW_LINE>((UIInput) toValidate).setValid(false);<NEW_LINE>FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, BundleUtil.getStringFromBundle("passwdVal.passwdReset.valFacesError"), BundleUtil.getStringFromBundle("passwdVal.passwdReset.valFacesErrorDesc"));<NEW_LINE>context.addMessage(toValidate.getClientId(context), message);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<String> errors = passwordValidatorService.validate(password, new Date(), false);<NEW_LINE>this.passwordErrors = errors;<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>((UIInput) toValidate).setValid(false);<NEW_LINE>}<NEW_LINE>}
, BundleUtil.getStringFromBundle("passwdVal.passwdReset.valBlankLog"));
861,316
// supposed to replace all E with 10^num2 not sure if i used it though<NEW_LINE>public static String EP(String input) {<NEW_LINE>double num1 = 0, num2 = 0, ans = 0;<NEW_LINE>int b = 0, t1 = 0, t2 = 0;<NEW_LINE>String anstring = "";<NEW_LINE>String temp = "";<NEW_LINE>int count = 0;<NEW_LINE>while (b < input.length()) {<NEW_LINE>if ((input.charAt(b) == 'E') && (b > 0)) {<NEW_LINE>num1 = getbacknumber(input, (b - 1));<NEW_LINE>num2 = getfrontnumber(<MASK><NEW_LINE>ans = num1 * (Math.pow(10, num2));<NEW_LINE>t1 = getendex(input, (b - 1));<NEW_LINE>t2 = getfrontex(input, (b + 1));<NEW_LINE>if (ans >= 0) {<NEW_LINE>anstring = "+" + String.valueOf(ans);<NEW_LINE>temp = input.substring(0, t1) + anstring + input.substring(t2 + 1);<NEW_LINE>} else {<NEW_LINE>anstring = String.valueOf(ans);<NEW_LINE>temp = input.substring(0, t1) + anstring + input.substring(t2 + 1);<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>if ((count > 0) && (input != temp)) {<NEW_LINE>input = simplification1(temp);<NEW_LINE>}<NEW_LINE>b++;<NEW_LINE>}<NEW_LINE>return input;<NEW_LINE>}
input, (b + 1));
1,531,120
public boolean visit(MethodDeclaration node) {<NEW_LINE>if (!hasChildrenChanges(node)) {<NEW_LINE>return doVisitUnchangedChildren(node);<NEW_LINE>}<NEW_LINE>int pos = rewriteJavadoc(node, MethodDeclaration.JAVADOC_PROPERTY);<NEW_LINE>int apiLevel = node.getAST().apiLevel();<NEW_LINE>if (apiLevel == JLS2_INTERNAL) {<NEW_LINE>rewriteModifiers(node, INTERNAL_METHOD_MODIFIERS_PROPERTY2, pos);<NEW_LINE>} else {<NEW_LINE>pos = rewriteModifiers2(node, MethodDeclaration.MODIFIERS2_PROPERTY, pos);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>pos = rewriteOptionalTypeParameters(node, MethodDeclaration.TYPE_PARAMETERS_PROPERTY, pos, " ", true, pos != node.getStartPosition());<NEW_LINE>}<NEW_LINE>boolean isConstructorChange = isChanged(node, MethodDeclaration.CONSTRUCTOR_PROPERTY);<NEW_LINE>boolean isConstructor = ((Boolean) getOriginalValue(node, MethodDeclaration.CONSTRUCTOR_PROPERTY)).booleanValue();<NEW_LINE>if (!isConstructor || isConstructorChange) {<NEW_LINE>rewriteReturnType(node, isConstructor, isConstructorChange);<NEW_LINE>}<NEW_LINE>// method name<NEW_LINE>pos = rewriteRequiredNode(node, MethodDeclaration.NAME_PROPERTY);<NEW_LINE>// parameters<NEW_LINE>try {<NEW_LINE>pos = rewriteMethodReceiver(node, pos);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>pos = rewriteNodeList(node, MethodDeclaration.PARAMETERS_PROPERTY, <MASK><NEW_LINE>pos = getScanner().getTokenEndOffset(TerminalTokens.TokenNameRPAREN, pos);<NEW_LINE>ChildListPropertyDescriptor exceptionsProperty = apiLevel < JLS8_INTERNAL ? INTERNAL_METHOD_THROWN_EXCEPTIONS_PROPERTY : MethodDeclaration.THROWN_EXCEPTION_TYPES_PROPERTY;<NEW_LINE>if (apiLevel < JLS8_INTERNAL) {<NEW_LINE>int extraDims = rewriteExtraDimensions(node, INTERNAL_METHOD_EXTRA_DIMENSIONS_PROPERTY, pos);<NEW_LINE>boolean hasExceptionChanges = isChanged(node, exceptionsProperty);<NEW_LINE>int bodyChangeKind = getChangeKind(node, MethodDeclaration.BODY_PROPERTY);<NEW_LINE>if ((extraDims > 0) && (hasExceptionChanges || bodyChangeKind == RewriteEvent.INSERTED || bodyChangeKind == RewriteEvent.REMOVED)) {<NEW_LINE>int dim = ((Integer) getOriginalValue(node, INTERNAL_METHOD_EXTRA_DIMENSIONS_PROPERTY)).intValue();<NEW_LINE>while (dim > 0) {<NEW_LINE>pos = getScanner().getTokenEndOffset(TerminalTokens.TokenNameRBRACKET, pos);<NEW_LINE>dim--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>pos = rewriteExtraDimensionsInfo(node, pos, MethodDeclaration.EXTRA_DIMENSIONS2_PROPERTY);<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>pos = rewriteNodeList(node, exceptionsProperty, pos, " throws ", ", ");<NEW_LINE>rewriteMethodBody(node, pos);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
pos, Util.EMPTY_STRING, ", ");
1,705,538
public boolean seekExact(BytesRef text) throws IOException {<NEW_LINE>// Check cache<NEW_LINE>long currentTermOrd = cachedTermOrds.add(text);<NEW_LINE>if (currentTermOrd < 0) {<NEW_LINE>// already seen, initialize instance data with the cached frequencies<NEW_LINE>currentTermOrd = -1 - currentTermOrd;<NEW_LINE>boolean found = true;<NEW_LINE>if (needDocFreqs) {<NEW_LINE>currentDocFreq = termDocFreqs.get(currentTermOrd);<NEW_LINE>found = currentDocFreq != NOT_FOUND;<NEW_LINE>}<NEW_LINE>if (needTotalTermFreqs) {<NEW_LINE>currentTotalTermFreq = termsTotalFreqs.get(currentTermOrd);<NEW_LINE>found = currentTotalTermFreq != NOT_FOUND;<NEW_LINE>}<NEW_LINE>current = found ? text : null;<NEW_LINE>return found;<NEW_LINE>}<NEW_LINE>// Cache miss - gather stats<NEW_LINE>final boolean found = super.seekExact(text);<NEW_LINE>// Cache the result - found or not.<NEW_LINE>if (needDocFreqs) {<NEW_LINE>termDocFreqs = bigArrays.grow(termDocFreqs, currentTermOrd + 1);<NEW_LINE>termDocFreqs.set(currentTermOrd, currentDocFreq);<NEW_LINE>}<NEW_LINE>if (needTotalTermFreqs) {<NEW_LINE>termsTotalFreqs = bigArrays.<MASK><NEW_LINE>termsTotalFreqs.set(currentTermOrd, currentTotalTermFreq);<NEW_LINE>}<NEW_LINE>return found;<NEW_LINE>}
grow(termsTotalFreqs, currentTermOrd + 1);
737,674
private void fillGlobalTable(GlobalTable globalTable, int schemaSqlMaxLimit, Map<String, BaseTableConfig> tableConfigMap, Map<String, ShardingNodeConfig> shardingNodeConfigMap) {<NEW_LINE>String globalTableName = globalTable.getName();<NEW_LINE>String globalTableSqlMaxLimitStr = null == globalTable.getSqlMaxLimit() ? null : String.valueOf(globalTable.getSqlMaxLimit());<NEW_LINE>String globalTableShardingNode = globalTable.getShardingNode();<NEW_LINE>String globalTableCheckClass = Optional.ofNullable(globalTable.getCheckClass()).orElse(GLOBAL_TABLE_CHECK_DEFAULT);<NEW_LINE>String globalTableCron = Optional.ofNullable(globalTable.getCron()).orElse(GLOBAL_TABLE_CHECK_DEFAULT_CRON).toUpperCase();<NEW_LINE>boolean globalCheck = !StringUtil.isBlank(globalTable.getCheckClass());<NEW_LINE>if (StringUtil.isBlank(globalTableName)) {<NEW_LINE>throw new ConfigException("one of tables' name is empty");<NEW_LINE>}<NEW_LINE>// limit size of the table<NEW_LINE>int tableSqlMaxLimit = getSqlMaxLimit(globalTableSqlMaxLimitStr, schemaSqlMaxLimit);<NEW_LINE>if (StringUtil.isBlank(globalTableShardingNode)) {<NEW_LINE>throw new ConfigException("shardingNode of " + globalTableName + " is empty");<NEW_LINE>}<NEW_LINE>String[] theShardingNodes = SplitUtil.split(<MASK><NEW_LINE>final long distinctCount = Arrays.stream(theShardingNodes).distinct().count();<NEW_LINE>if (distinctCount != theShardingNodes.length) {<NEW_LINE>// detected repeat props;<NEW_LINE>throw new ConfigException("invalid shardingNode config: " + globalTableShardingNode + " for GlobalTableConfig " + globalTableName + ",the nodes duplicated!");<NEW_LINE>}<NEW_LINE>if (theShardingNodes.length <= 1) {<NEW_LINE>throw new ConfigException("invalid shardingNode config: " + globalTableShardingNode + " for GlobalTableConfig " + globalTableName + ", please use SingleTable");<NEW_LINE>}<NEW_LINE>String[] tableNames = globalTableName.split(",");<NEW_LINE>for (String tableName : tableNames) {<NEW_LINE>if (tableName.contains("`")) {<NEW_LINE>tableName = tableName.replaceAll("`", "");<NEW_LINE>}<NEW_LINE>if (StringUtil.isBlank(tableName)) {<NEW_LINE>throw new ConfigException("one of table name of " + globalTableName + " is empty");<NEW_LINE>}<NEW_LINE>GlobalTableConfig table = new GlobalTableConfig(tableName, tableSqlMaxLimit, Arrays.asList(theShardingNodes), globalTableCron, globalTableCheckClass, globalCheck);<NEW_LINE>checkShardingNodeExists(table.getShardingNodes(), shardingNodeConfigMap);<NEW_LINE>if (tableConfigMap.containsKey(table.getName())) {<NEW_LINE>throw new ConfigException("table " + tableName + " duplicated!");<NEW_LINE>}<NEW_LINE>table.setId(this.tableIndex.incrementAndGet());<NEW_LINE>tableConfigMap.put(table.getName(), table);<NEW_LINE>}<NEW_LINE>}
globalTableShardingNode, ',', '$', '-');
618,277
public void read(org.apache.thrift.protocol.TProtocol iprot, drainReplicationTable_result struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // SUCCESS<NEW_LINE>0:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {<NEW_LINE>struct.success = iprot.readBool();<NEW_LINE>struct.setSuccessIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case // TNASE<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {<NEW_LINE>struct.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException();<NEW_LINE>struct.tnase.read(iprot);<NEW_LINE>struct.setTnaseIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>}
skip(iprot, schemeField.type);
48,446
public void write(org.restlet.ext.xml.XmlWriter writer) throws IOException {<NEW_LINE>try {<NEW_LINE>// Start document<NEW_LINE>writer.startDocument();<NEW_LINE>// Append the root node<NEW_LINE>writer.startElement("mail");<NEW_LINE>// Append the child nodes and set their text content<NEW_LINE>writer.startElement("status");<NEW_LINE>writer.characters("received");<NEW_LINE>writer.endElement("status");<NEW_LINE>writer.startElement("subject");<NEW_LINE>writer.characters("Message to self");<NEW_LINE>writer.endElement("subject");<NEW_LINE>writer.startElement("content");<NEW_LINE>writer.characters("Doh!");<NEW_LINE>writer.endElement("content");<NEW_LINE>writer.startElement("accountRef");<NEW_LINE>writer.characters(new Reference(getReference(), "..").<MASK><NEW_LINE>writer.endElement("accountRef");<NEW_LINE>// End the root node<NEW_LINE>writer.endElement("mail");<NEW_LINE>// End the document<NEW_LINE>writer.endDocument();<NEW_LINE>} catch (SAXException e) {<NEW_LINE>throw new IOException(e.getMessage());<NEW_LINE>}<NEW_LINE>}
getTargetRef().toString());
464,006
private static <T extends Comparable<? super T>> void quickSelect(T[] arr, int left, int right, int k) {<NEW_LINE>if (left + CUTOFF <= right) {<NEW_LINE>// find the pivot<NEW_LINE>T pivot = median(arr, left, right);<NEW_LINE>int i = left, j = right - 1;<NEW_LINE>for (; ; ) {<NEW_LINE>while (arr[++i].compareTo(pivot) < 0) ;<NEW_LINE>while (arr[--j].compareTo(pivot) > 0) ;<NEW_LINE>if (i < j)<NEW_LINE><MASK><NEW_LINE>else<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// swap the pivot<NEW_LINE>swapReferences(arr, i, right - 1);<NEW_LINE>if (k <= i)<NEW_LINE>quickSelect(arr, left, i - 1, k);<NEW_LINE>else if (k > i + 1)<NEW_LINE>quickSelect(arr, i + 1, right, k);<NEW_LINE>} else {<NEW_LINE>insertionSort(arr, left, right);<NEW_LINE>}<NEW_LINE>}
swapReferences(arr, i, j);
1,659,551
public List<OrganizationModel> retrieveOrganizationInfo() {<NEW_LINE>try {<NEW_LINE>String accessToken = config.getCmsAccessToken();<NEW_LINE>String url = config.getCmsOrganizationUrl();<NEW_LINE>AccessBody accessBody = new AccessBody();<NEW_LINE>accessBody.setAccess_token(accessToken);<NEW_LINE>OrgResponseBody response = restTemplate.postForObject(url, accessBody, OrgResponseBody.class);<NEW_LINE>if (!response.isStatus()) {<NEW_LINE>logger.error("Could not get rest response from CMS system");<NEW_LINE>logger.debug("{}", response);<NEW_LINE>}<NEW_LINE>List<OrganizationModel> orgs = response.getData().stream().map(org -> {<NEW_LINE>OrganizationModel organizationModel = new OrganizationModel();<NEW_LINE>organizationModel.<MASK><NEW_LINE>organizationModel.setName(org.getName());<NEW_LINE>return organizationModel;<NEW_LINE>}).sorted(new OrgIdComparator()).collect(Collectors.toList());<NEW_LINE>return orgs;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e.getMessage());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
setId(org.getOrganizationId());
1,587,682
private void fetchSortingConfig() {<NEW_LINE>if (!_preprocessingOperations.contains(DataPreprocessingUtils.Operation.SORT)) {<NEW_LINE>LOGGER.info("Sorting is disabled.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Fetch sorting info from table config first.<NEW_LINE>List<String> sortingColumns = new ArrayList<>();<NEW_LINE>List<FieldConfig> fieldConfigs = _tableConfig.getFieldConfigList();<NEW_LINE>if (fieldConfigs != null && !fieldConfigs.isEmpty()) {<NEW_LINE>for (FieldConfig fieldConfig : fieldConfigs) {<NEW_LINE>if (fieldConfig.getIndexType() == FieldConfig.IndexType.SORTED) {<NEW_LINE>sortingColumns.add(fieldConfig.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!sortingColumns.isEmpty()) {<NEW_LINE>Preconditions.checkArgument(sortingColumns.size() == 1, "There should be at most 1 sorted column in the table.");<NEW_LINE>_sortingColumn = sortingColumns.get(0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// There is no sorted column specified in field configs, try to find sorted column from indexing config.<NEW_LINE>IndexingConfig indexingConfig = _tableConfig.getIndexingConfig();<NEW_LINE>List<String> sortedColumns = indexingConfig.getSortedColumn();<NEW_LINE>if (sortedColumns != null) {<NEW_LINE>Preconditions.checkArgument(sortedColumns.size() <= 1, "There should be at most 1 sorted column in the table.");<NEW_LINE>if (sortedColumns.size() == 1) {<NEW_LINE>_sortingColumn = sortedColumns.get(0);<NEW_LINE>FieldSpec <MASK><NEW_LINE>Preconditions.checkState(fieldSpec != null, "Failed to find sorting column: {} in the schema", _sortingColumn);<NEW_LINE>Preconditions.checkState(fieldSpec.isSingleValueField(), "Cannot sort on multi-value column: %s", _sortingColumn);<NEW_LINE>_sortingColumnType = fieldSpec.getDataType();<NEW_LINE>Preconditions.checkState(_sortingColumnType.canBeASortedColumn(), "Cannot sort on %s column: %s", _sortingColumnType, _sortingColumn);<NEW_LINE>LOGGER.info("Sorting the data with column: {} of type: {}", _sortingColumn, _sortingColumnType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (_sortingColumn != null) {<NEW_LINE>_sortingColumnDefaultNullValue = _pinotTableSchema.getFieldSpecFor(_sortingColumn).getDefaultNullValueString();<NEW_LINE>}<NEW_LINE>}
fieldSpec = _pinotTableSchema.getFieldSpecFor(_sortingColumn);
1,774,925
public PaginationContext createPaginationContext(final SelectStatement selectStatement, final ProjectionsContext projectionsContext, final List<Object> parameters, final Collection<WhereSegment> whereSegments) {<NEW_LINE>Optional<LimitSegment> limitSegment = SelectStatementHandler.getLimitSegment(selectStatement);<NEW_LINE>if (limitSegment.isPresent()) {<NEW_LINE>return new LimitPaginationContextEngine().createPaginationContext(limitSegment.get(), parameters);<NEW_LINE>}<NEW_LINE>Optional<TopProjectionSegment> topProjectionSegment = findTopProjection(selectStatement);<NEW_LINE>Collection<ExpressionSegment> expressions = new LinkedList<>();<NEW_LINE>for (WhereSegment each : whereSegments) {<NEW_LINE>expressions.add(each.getExpr());<NEW_LINE>}<NEW_LINE>if (topProjectionSegment.isPresent()) {<NEW_LINE>return new TopPaginationContextEngine().createPaginationContext(topProjectionSegment.<MASK><NEW_LINE>}<NEW_LINE>if (!expressions.isEmpty() && containsRowNumberPagination(selectStatement)) {<NEW_LINE>return new RowNumberPaginationContextEngine().createPaginationContext(expressions, projectionsContext, parameters);<NEW_LINE>}<NEW_LINE>return new PaginationContext(null, null, parameters);<NEW_LINE>}
get(), expressions, parameters);
1,635,647
public void performRecoverableFileDelete(String path) throws PlatformManagerException {<NEW_LINE>File file = new File(path);<NEW_LINE>if (!file.exists()) {<NEW_LINE>if (Logger.isEnabled())<NEW_LINE>Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Cannot find " + file.getName()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Class<?> claFileManager = getFileManagerClass();<NEW_LINE>if (claFileManager != null) {<NEW_LINE>Method methMoveToTrash = claFileManager.getMethod("moveToTrash", new Class[] { File.class });<NEW_LINE>if (methMoveToTrash != null) {<NEW_LINE>Object result = methMoveToTrash.invoke(null, new Object[] { file });<NEW_LINE>if (result instanceof Boolean) {<NEW_LINE>if (((Boolean) result).booleanValue()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>boolean useOSA = !NativeInvocationBridge.sharedInstance().isEnabled() || !NativeInvocationBridge.<MASK><NEW_LINE>if (useOSA) {<NEW_LINE>try {<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append("tell application \"");<NEW_LINE>sb.append("Finder");<NEW_LINE>sb.append("\" to move (posix file \"");<NEW_LINE>sb.append(path);<NEW_LINE>sb.append("\" as alias) to the trash");<NEW_LINE>performOSAScript(sb);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new PlatformManagerException("Failed to move file", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
sharedInstance().performRecoverableFileDelete(file);
1,498,254
private void onFrame(long frameTimeNanos) {<NEW_LINE><MASK><NEW_LINE>int drainingOffset;<NEW_LINE>if (nextPendingValue != null) {<NEW_LINE>mAnimationQueue.offer(nextPendingValue);<NEW_LINE>drainingOffset = 0;<NEW_LINE>} else {<NEW_LINE>drainingOffset = Math.max(mCallbacks.size() - mAnimationQueue.size(), 0);<NEW_LINE>}<NEW_LINE>// Copy the values into a temporary ArrayList for processing.<NEW_LINE>mTempValues.addAll(mAnimationQueue);<NEW_LINE>for (int i = mTempValues.size() - 1; i > -1; i--) {<NEW_LINE>Double val = mTempValues.get(i);<NEW_LINE>int cbIdx = mTempValues.size() - 1 - i + drainingOffset;<NEW_LINE>if (mCallbacks.size() > cbIdx) {<NEW_LINE>mCallbacks.get(cbIdx).onFrame(val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mTempValues.clear();<NEW_LINE>while (mAnimationQueue.size() + drainingOffset >= mCallbacks.size()) {<NEW_LINE>mAnimationQueue.poll();<NEW_LINE>}<NEW_LINE>if (mAnimationQueue.isEmpty() && mPendingQueue.isEmpty()) {<NEW_LINE>mRunning = false;<NEW_LINE>} else {<NEW_LINE>mChoreographer.postFrameCallback(mChoreographerCallback);<NEW_LINE>}<NEW_LINE>}
Double nextPendingValue = mPendingQueue.poll();
610,525
private static String resolveDownloadUrlFromUploader(JReleaserContext context, ExtraProperties props, Artifact artifact) {<NEW_LINE>Upload upload = context.getModel().getUpload();<NEW_LINE>String <MASK><NEW_LINE>if (isBlank(coords)) {<NEW_LINE>// search for "<uploaderType><uploaderName>Path"<NEW_LINE>for (Uploader up : upload.findAllActiveUploaders()) {<NEW_LINE>List<String> keys = up.resolveSkipKeys();<NEW_LINE>String key = up.getType() + capitalize(up.getName()) + "Path";<NEW_LINE>if (artifact.getExtraProperties().containsKey(key) && !isSkip(props, keys)) {<NEW_LINE>return up.getResolvedDownloadUrl(context, artifact);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String[] parts = coords.split(":");<NEW_LINE>if (parts.length != 2)<NEW_LINE>return null;<NEW_LINE>Optional<? extends Uploader> uploader = upload.getActiveUploader(parts[0], parts[1]);<NEW_LINE>if (uploader.isPresent()) {<NEW_LINE>List<String> keys = uploader.get().resolveSkipKeys();<NEW_LINE>if (!isSkip(props, keys)) {<NEW_LINE>return uploader.get().getResolvedDownloadUrl(context, artifact);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// search for "<uploaderType><uploaderName>Path"<NEW_LINE>for (Uploader up : upload.findAllActiveUploaders()) {<NEW_LINE>List<String> keys = up.resolveSkipKeys();<NEW_LINE>String key = up.getType() + capitalize(up.getName()) + "Path";<NEW_LINE>if (artifact.getExtraProperties().containsKey(key) && !isSkip(props, keys)) {<NEW_LINE>return up.getResolvedDownloadUrl(context, artifact);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
coords = props.getExtraProperty(DOWNLOAD_URL_FROM_KEY);
161,554
protected static SqlInsert buildLogicalPlanWithDistinctData(SqlInsert oldSqlInsert, List<Integer> selectedRowIndices, ExecutionContext executionContext) {<NEW_LINE>SqlCall values = (SqlCall) oldSqlInsert.getSource();<NEW_LINE>List<SqlNode> rows = values.getOperandList();<NEW_LINE>Parameters oldParameters = executionContext.getParams();<NEW_LINE>SqlNode[] selectedRows;<NEW_LINE>if (oldParameters.isBatch()) {<NEW_LINE>// select some rows to put into the new params<NEW_LINE>List<Map<Integer, ParameterContext>> newBatchParams = selectedRowIndices.stream().map(oldParameters.getBatchParameters()::get).collect(Collectors.toList());<NEW_LINE>Parameters newParameters = new Parameters(oldParameters.getCurrentParameter(), true);<NEW_LINE>newParameters.setBatchParams(newBatchParams);<NEW_LINE>executionContext.setParams(newParameters);<NEW_LINE>selectedRows = rows.toArray(new SqlNode[rows.size()]);<NEW_LINE>} else {<NEW_LINE>selectedRows = selectedRowIndices.stream().map(rows::get).toArray(SqlNode[]::new);<NEW_LINE>}<NEW_LINE>SqlNode newValues = new SqlBasicCall(values.getOperator(), <MASK><NEW_LINE>return new SqlInsert(oldSqlInsert.getParserPosition(), SqlNodeList.EMPTY, oldSqlInsert.getTargetTable(), newValues, oldSqlInsert.getTargetColumnList(), SqlNodeList.EMPTY, oldSqlInsert.getBatchSize(), oldSqlInsert.getHints());<NEW_LINE>}
selectedRows, values.getParserPosition());
1,205,733
public static final void writeStringArrayXml(String[] val, String name, XmlSerializer out) throws XmlPullParserException, java.io.IOException {<NEW_LINE>if (val == null) {<NEW_LINE>out.startTag(null, "null");<NEW_LINE>out.endTag(null, "null");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>out.startTag(null, "string-array");<NEW_LINE>if (name != null) {<NEW_LINE>out.attribute(null, "name", name);<NEW_LINE>}<NEW_LINE>final int n = val.length;<NEW_LINE>out.attribute(null, "num", Integer.toString(n));<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>if (val[i] == null) {<NEW_LINE>out.startTag(null, "null");<NEW_LINE>out.endTag(null, "null");<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>out.attribute(null, "value", val[i]);<NEW_LINE>out.endTag(null, "item");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.endTag(null, "string-array");<NEW_LINE>}
out.startTag(null, "item");
405,838
protected static void shutdown(final String[] args) {<NEW_LINE>if (FileUtils.getConfigurationFilePath(args) == null) {<NEW_LINE>LOGGER.info("Shutting down RESTHeart instance run without configuration file");<NEW_LINE>} else if (FileUtils.getPropertiesFilePath(args) == null) {<NEW_LINE>LOGGER.info("Shutting down RESTHeart instance run with configuration file {}", FileUtils.getConfigurationFilePath(args));<NEW_LINE>} else {<NEW_LINE>LOGGER.info("Shutting down RESTHeart instance run with configuration file {} and property file {}", FileUtils.getConfigurationFilePath(args), FileUtils.getPropertiesFilePath(args));<NEW_LINE>}<NEW_LINE>Path pidFilePath = FileUtils.getPidFilePath(FileUtils.getFileAbsolutePathHash(FileUtils.getConfigurationFilePath(args), <MASK><NEW_LINE>int pid = FileUtils.getPidFromFile(pidFilePath);<NEW_LINE>if (pid < 0) {<NEW_LINE>throw new IllegalStateException("RESTHeart instance pid file not found: " + pidFilePath.toString());<NEW_LINE>} else {<NEW_LINE>LOGGER.info("Pid file {}", pidFilePath);<NEW_LINE>}<NEW_LINE>// 15 is SIGTERM<NEW_LINE>CLibrary.LIBC.kill(pid, 15);<NEW_LINE>LOGGER.info("SIGTERM signal sent to RESTHeart instance with pid {} ", pid);<NEW_LINE>Configuration conf;<NEW_LINE>try {<NEW_LINE>conf = FileUtils.getConfiguration(args, true);<NEW_LINE>LOGGER.info("Check log file {}", conf.getLogFilePath());<NEW_LINE>} catch (ConfigurationException ex) {<NEW_LINE>LOGGER.warn(ex.getMessage());<NEW_LINE>}<NEW_LINE>}
FileUtils.getPropertiesFilePath(args)));
479,644
private Cursor handlePartitionedTable(PartitionInfo partitionInfo) {<NEW_LINE>ArrayResultCursor result = new ArrayResultCursor("TOPOLOGY");<NEW_LINE>result.addColumn("ID", DataTypes.IntegerType);<NEW_LINE>result.addColumn("GROUP_NAME", DataTypes.StringType);<NEW_LINE>result.addColumn("TABLE_NAME", DataTypes.StringType);<NEW_LINE>result.addColumn("PARTITION_NAME", DataTypes.StringType);<NEW_LINE>result.initMeta();<NEW_LINE>int index = 0;<NEW_LINE>Map<String, List<PhysicalPartitionInfo>> physicalPartitionInfos = partitionInfo.getPhysicalPartitionTopology<MASK><NEW_LINE>for (Map.Entry<String, List<PhysicalPartitionInfo>> phyPartItem : physicalPartitionInfos.entrySet()) {<NEW_LINE>String grpGroupKey = phyPartItem.getKey();<NEW_LINE>List<PhysicalPartitionInfo> phyPartList = phyPartItem.getValue();<NEW_LINE>for (int i = 0; i < phyPartList.size(); i++) {<NEW_LINE>result.addRow(new Object[] { index++, grpGroupKey, phyPartList.get(i).getPhyTable(), phyPartList.get(i).getPartName() });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(new ArrayList<>());
371,052
final ListDatasetLabelsResult executeListDatasetLabels(ListDatasetLabelsRequest listDatasetLabelsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDatasetLabelsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDatasetLabelsRequest> request = null;<NEW_LINE>Response<ListDatasetLabelsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDatasetLabelsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDatasetLabelsRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDatasetLabels");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDatasetLabelsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDatasetLabelsResultJsonUnmarshaller());<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>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
371,687
private // } // opArgsToArray<NEW_LINE>Selector genIdToSelector(SyntaxTreeNode genId) throws AbortException {<NEW_LINE>Selector retval = new Selector(genId);<NEW_LINE>TreeNode prefix = genId.heirs()[0];<NEW_LINE>TreeNode[] prefixElts = prefix.heirs();<NEW_LINE>SyntaxTreeNode lastOp = (SyntaxTreeNode) genId.heirs()[1];<NEW_LINE>for (int i = 0; i < prefixElts.length; i++) {<NEW_LINE>TreeNode[] pe = prefixElts[i].heirs();<NEW_LINE>if (pe.length == 0) {<NEW_LINE>errors.addError(<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>;<NEW_LINE>SyntaxTreeNode thisPrefix = (SyntaxTreeNode) pe[0];<NEW_LINE>switch(thisPrefix.getKind()) {<NEW_LINE>case N_OpArgs:<NEW_LINE>retval.addSelector(thisPrefix, thisPrefix);<NEW_LINE>break;<NEW_LINE>case N_StructOp:<NEW_LINE>retval.addSelector(thisPrefix, null);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (prefixElts[i].heirs().length == 2) {<NEW_LINE>retval.addSelector(thisPrefix, null);<NEW_LINE>} else {<NEW_LINE>if (prefixElts[i].heirs().length != 3) {<NEW_LINE>// Note added 13 April 2015 by LL:<NEW_LINE>// This error is caused by the spurious "(x)" in the leaf proof<NEW_LINE>// BY ... DEF A!foo(x)<NEW_LINE>// It would be nice if this produced a more helpful error<NEW_LINE>// message, but I have no idea if there are other bad inputs<NEW_LINE>// that can cause it.<NEW_LINE>errors.addAbort(prefixElts[i].getLocation(), "Internal error: " + "IdPrefixElement has other than 2 or 3 heirs.");<NEW_LINE>}<NEW_LINE>;<NEW_LINE>retval.addSelector(thisPrefix, (SyntaxTreeNode) prefixElts[i].heirs()[1]);<NEW_LINE>}<NEW_LINE>// if}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// switch<NEW_LINE>}<NEW_LINE>// for i<NEW_LINE>;<NEW_LINE>if (lastOp.getKind() == N_OpArgs) {<NEW_LINE>retval.addSelector(lastOp, lastOp);<NEW_LINE>} else {<NEW_LINE>retval.addSelector(lastOp, null);<NEW_LINE>}<NEW_LINE>;<NEW_LINE>retval.finish();<NEW_LINE>return retval;<NEW_LINE>}
genId.getLocation(), "Was expecting a GeneralId.");
560,312
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {<NEW_LINE>CommonLayoutParams.adjustChildrenLayoutParams(this, widthMeasureSpec, heightMeasureSpec);<NEW_LINE>int measureWidth = 0;<NEW_LINE>int measureHeight = 0;<NEW_LINE>int width = MeasureSpec.getSize(widthMeasureSpec);<NEW_LINE>int widthMode = MeasureSpec.getMode(widthMeasureSpec);<NEW_LINE>int height = MeasureSpec.getSize(heightMeasureSpec);<NEW_LINE>int heightMode = MeasureSpec.getMode(heightMeasureSpec);<NEW_LINE>int verticalPadding = this.getPaddingTop() + this.getPaddingBottom();<NEW_LINE>int horizontalPadding = this.getPaddingLeft() + this.getPaddingRight();<NEW_LINE>int remainingWidth = widthMode == MeasureSpec<MASK><NEW_LINE>int remainingHeight = heightMode == MeasureSpec.UNSPECIFIED ? 0 : height - verticalPadding;<NEW_LINE>int tempHeight = 0;<NEW_LINE>int tempWidth = 0;<NEW_LINE>int childWidthMeasureSpec = 0;<NEW_LINE>int childHeightMeasureSpec = 0;<NEW_LINE>int count = this.getChildCount();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>View child = this.getChildAt(i);<NEW_LINE>if (child.getVisibility() == View.GONE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (this._stretchLastChild && (i == (count - 1))) {<NEW_LINE>childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(remainingWidth, widthMode);<NEW_LINE>childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(remainingHeight, heightMode);<NEW_LINE>} else {<NEW_LINE>// Measure children with AT_MOST even if our mode is EXACT<NEW_LINE>childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(remainingWidth, widthMode == MeasureSpec.EXACTLY ? MeasureSpec.AT_MOST : widthMode);<NEW_LINE>childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(remainingHeight, heightMode == MeasureSpec.EXACTLY ? MeasureSpec.AT_MOST : heightMode);<NEW_LINE>}<NEW_LINE>CommonLayoutParams.measureChild(child, childWidthMeasureSpec, childHeightMeasureSpec);<NEW_LINE>final int childMeasuredWidth = CommonLayoutParams.getDesiredWidth(child);<NEW_LINE>final int childMeasuredHeight = CommonLayoutParams.getDesiredHeight(child);<NEW_LINE>CommonLayoutParams childLayoutParams = (CommonLayoutParams) child.getLayoutParams();<NEW_LINE>Dock dock = childLayoutParams.dock;<NEW_LINE>switch(dock) {<NEW_LINE>case top:<NEW_LINE>case bottom:<NEW_LINE>remainingHeight = Math.max(0, remainingHeight - childMeasuredHeight);<NEW_LINE>tempHeight += childMeasuredHeight;<NEW_LINE>measureWidth = Math.max(measureWidth, tempWidth + childMeasuredWidth);<NEW_LINE>measureHeight = Math.max(measureHeight, tempHeight);<NEW_LINE>break;<NEW_LINE>case left:<NEW_LINE>case right:<NEW_LINE>default:<NEW_LINE>remainingWidth = Math.max(0, remainingWidth - childMeasuredWidth);<NEW_LINE>tempWidth += childMeasuredWidth;<NEW_LINE>measureWidth = Math.max(measureWidth, tempWidth);<NEW_LINE>measureHeight = Math.max(measureHeight, tempHeight + childMeasuredHeight);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add in our padding<NEW_LINE>measureWidth += horizontalPadding;<NEW_LINE>measureHeight += verticalPadding;<NEW_LINE>// Check against our minimum sizes<NEW_LINE>measureWidth = Math.max(measureWidth, this.getSuggestedMinimumWidth());<NEW_LINE>measureHeight = Math.max(measureHeight, this.getSuggestedMinimumHeight());<NEW_LINE>int widthSizeAndState = resolveSizeAndState(measureWidth, widthMeasureSpec, 0);<NEW_LINE>int heightSizeAndState = resolveSizeAndState(measureHeight, heightMeasureSpec, 0);<NEW_LINE>this.setMeasuredDimension(widthSizeAndState, heightSizeAndState);<NEW_LINE>}
.UNSPECIFIED ? 0 : width - horizontalPadding;
1,821,297
private void initialize(final File file) {<NEW_LINE>bbIterator = MMapBackedIteratorFactory.getFloatIterator(HEADER_SIZE, file);<NEW_LINE>final ByteBuffer headerBuf = bbIterator.getHeaderBytes();<NEW_LINE>final int firstValue = headerBuf.getInt();<NEW_LINE>if (firstValue != BYTES_1_TO_4) {<NEW_LINE>throw new PicardException("First header byte of locs files should be " + BYTES_1_TO_4 + " value found(" + firstValue + ")");<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>if (versionNumber != VERSION) {<NEW_LINE>throw new PicardException("First header byte of locs files should be " + VERSION + " value found(" + firstValue + ")");<NEW_LINE>}<NEW_LINE>numClusters = UnsignedTypeUtil.uIntToLong(headerBuf.getInt());<NEW_LINE>bbIterator.assertTotalElementsEqual(numClusters * 2);<NEW_LINE>}
float versionNumber = headerBuf.getFloat();
1,156,902
public static <T> void iterate(final Collection<T> collection, final ValueMapper valueMapper, final OnMapperCompleteListener onMapperCompleteListener) {<NEW_LINE>final Mutable<Boolean> didReturnError = new Mutable<Boolean>(false);<NEW_LINE>final Mutable<Integer> pendingJobCount = new Mutable<Integer>(1);<NEW_LINE>final OnMapperCompleteListener jobCompleteListener = new OnMapperCompleteListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete() {<NEW_LINE>if (didReturnError.value) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (--pendingJobCount.value == 0) {<NEW_LINE>onMapperCompleteListener.onComplete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(FacebookException exception) {<NEW_LINE>if (didReturnError.value) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>didReturnError.value = true;<NEW_LINE>onMapperCompleteListener.onError(exception);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Iterator<T> keyIterator = collection.keyIterator();<NEW_LINE>List<T> keys = new LinkedList<>();<NEW_LINE>while (keyIterator.hasNext()) {<NEW_LINE>keys.add(keyIterator.next());<NEW_LINE>}<NEW_LINE>for (final T key : keys) {<NEW_LINE>final Object value = collection.get(key);<NEW_LINE>final OnMapValueCompleteListener onMapValueCompleteListener = new OnMapValueCompleteListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete(Object mappedValue) {<NEW_LINE>collection.set(key, mappedValue, jobCompleteListener);<NEW_LINE>jobCompleteListener.onComplete();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(FacebookException exception) {<NEW_LINE>jobCompleteListener.onError(exception);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>pendingJobCount.value++;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>jobCompleteListener.onComplete();<NEW_LINE>}
valueMapper.mapValue(value, onMapValueCompleteListener);
573,478
private void save(ServerLongLongRow row, PSMatrixSaveContext saveContext, MatrixPartitionMeta meta, DataOutputStream out) throws IOException {<NEW_LINE>long startCol = meta.getStartCol();<NEW_LINE>if (ServerRowUtils.getVector(row) instanceof IntLongVector) {<NEW_LINE>IntLongVector vector = (IntLongVector) ServerRowUtils.getVector(row);<NEW_LINE>if (vector.isDense()) {<NEW_LINE>long[] data = vector.getStorage().getValues();<NEW_LINE>for (int i = 0; i < data.length; i++) {<NEW_LINE>out.writeLong(data[i]);<NEW_LINE>}<NEW_LINE>} else if (vector.isSorted()) {<NEW_LINE>int[] indices = vector.getStorage().getIndices();<NEW_LINE>long[] values = vector.getStorage().getValues();<NEW_LINE>for (int i = 0; i < indices.length; i++) {<NEW_LINE>out.writeLong(indices[i] + startCol);<NEW_LINE>out.writeLong(values[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ObjectIterator<Int2LongMap.Entry> iter = vector.getStorage().entryIterator();<NEW_LINE>Int2LongMap.Entry entry;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>entry = iter.next();<NEW_LINE>out.writeLong(entry.getIntKey() + startCol);<NEW_LINE>out.writeLong(entry.getLongValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LongLongVector vector = (LongLongVector) ServerRowUtils.getVector(row);<NEW_LINE>if (vector.isSorted()) {<NEW_LINE>long[] indices = vector.getStorage().getIndices();<NEW_LINE>long[] values = vector.getStorage().getValues();<NEW_LINE>for (int i = 0; i < indices.length; i++) {<NEW_LINE>out.writeLong(indices[i] + startCol);<NEW_LINE>out<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ObjectIterator<Long2LongMap.Entry> iter = vector.getStorage().entryIterator();<NEW_LINE>Long2LongMap.Entry entry;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>entry = iter.next();<NEW_LINE>out.writeLong(entry.getLongKey() + startCol);<NEW_LINE>out.writeLong(entry.getLongValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.writeLong(values[i]);
670,006
public void updateCodegen(CodegenMethod method, CodegenClassScope classScope) {<NEW_LINE>method.getBlock().apply(instblock(classScope, "qOutputProcessNonBuffered", REF_NEWDATA, REF_OLDDATA));<NEW_LINE>generateRSPCall("processViewResult", method, classScope);<NEW_LINE>CodegenExpression newOldIsNull = and(equalsNull(exprDotMethod(ref("newOldEvents"), "getFirst")), equalsNull(exprDotMethod(ref("newOldEvents"), "getSecond")));<NEW_LINE>method.getBlock().declareVar(EPTypePremade.BOOLEANBOXED.getEPType(), "forceOutput", constant(false)).ifCondition(and(equalsNull(REF_NEWDATA), equalsNull(REF_OLDDATA))).ifCondition(or(equalsNull(ref("newOldEvents")), newOldIsNull)).assignRef("forceOutput", constantTrue());<NEW_LINE>method.getBlock().expression(localMethod(postProcess.postProcessCodegenMayNullMayForce(classScope, method), ref("forceOutput"), ref("newOldEvents"))).apply<MASK><NEW_LINE>}
(instblock(classScope, "aOutputProcessNonBuffered"));
878,082
public boolean action(Request request, Response response) {<NEW_LINE>if (request.getNettyRequest() instanceof FullHttpRequest) {<NEW_LINE>InputGetGroup inputGetGroup = getRequestBody(request.getNettyRequest(), InputGetGroup.class);<NEW_LINE>if (inputGetGroup != null && (!StringUtil.isNullOrEmpty(inputGetGroup.getGroupId()))) {<NEW_LINE>WFCMessage.GroupInfo groupInfo = messagesStore.getGroupInfo(inputGetGroup.getGroupId());<NEW_LINE>RestResult result;<NEW_LINE>if (groupInfo == null) {<NEW_LINE>result = RestResult.resultOf(ErrorCode.ERROR_CODE_NOT_EXIST);<NEW_LINE>} else {<NEW_LINE>PojoGroupInfo pojoGroupInfo = new PojoGroupInfo();<NEW_LINE>pojoGroupInfo.setExtra(groupInfo.getExtra());<NEW_LINE>pojoGroupInfo.setName(groupInfo.getName());<NEW_LINE>pojoGroupInfo.setOwner(groupInfo.getOwner());<NEW_LINE>pojoGroupInfo.setPortrait(groupInfo.getPortrait());<NEW_LINE>pojoGroupInfo.setTarget_id(groupInfo.getTargetId());<NEW_LINE>pojoGroupInfo.setType(groupInfo.getType());<NEW_LINE>pojoGroupInfo.setMute(groupInfo.getMute());<NEW_LINE>pojoGroupInfo.setJoin_type(groupInfo.getJoinType());<NEW_LINE>pojoGroupInfo.setPrivate_chat(groupInfo.getPrivateChat());<NEW_LINE>pojoGroupInfo.setSearchable(groupInfo.getSearchable());<NEW_LINE>result = RestResult.ok(pojoGroupInfo);<NEW_LINE>}<NEW_LINE>setResponseContent(result, response);<NEW_LINE>} else {<NEW_LINE>setResponseContent(RestResult.resultOf<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
(ErrorCode.INVALID_PARAMETER), response);
232,165
public void publish(RevoltReading reading) {<NEW_LINE>if (reading != null && getThing().getStatus() == ThingStatus.ONLINE) {<NEW_LINE>BigDecimal power = new BigDecimal(reading.getPower()).setScale(1, RoundingMode.HALF_UP);<NEW_LINE>BigDecimal powerFactor = new BigDecimal(reading.getPowerFactor()).setScale(2, RoundingMode.HALF_UP);<NEW_LINE>BigDecimal consumption = new BigDecimal(reading.getConsumption()).<MASK><NEW_LINE>BigDecimal current = new BigDecimal(reading.getCurrent()).setScale(2, RoundingMode.HALF_UP);<NEW_LINE>logger.debug("updating states for thing {}: power={}, powerFactor={}, consumption={}, current={}, voltage={}, frequency={} ", getThing().getUID().getId(), power, powerFactor, consumption, current, reading.getVoltage(), reading.getFrequency());<NEW_LINE>updateState(CURRENT_POWER_CHANNEL, new QuantityType<>(power, Units.WATT));<NEW_LINE>updateState(POWER_FACTOR_CHANNEL, new DecimalType(powerFactor));<NEW_LINE>updateState(CONSUMPTION_CHANNEL, new QuantityType<>(consumption, Units.WATT_HOUR));<NEW_LINE>updateState(ELECTRIC_CURRENT_CHANNEL, new QuantityType<>(current, Units.AMPERE));<NEW_LINE>updateState(ELECTRIC_POTENTIAL_CHANNEL, new QuantityType<>(reading.getVoltage(), Units.VOLT));<NEW_LINE>updateState(FREQUENCY_CHANNEL, new QuantityType<>(reading.getFrequency(), Units.HERTZ));<NEW_LINE>}<NEW_LINE>}
setScale(2, RoundingMode.HALF_UP);
440,516
public INDArray preOutput(boolean training, LayerWorkspaceMgr workspaceMgr) {<NEW_LINE>INDArray b = getParam(DefaultParamInitializer.BIAS_KEY);<NEW_LINE>INDArray <MASK><NEW_LINE>if (input.columns() != W.columns()) {<NEW_LINE>throw new DL4JInvalidInputException("Input size (" + input.columns() + " columns; shape = " + Arrays.toString(input.shape()) + ") is invalid: does not match layer input size (layer # inputs = " + W.shapeInfoToString() + ") " + layerId());<NEW_LINE>}<NEW_LINE>INDArray input = this.input.castTo(dataType);<NEW_LINE>applyDropOutIfNecessary(training, workspaceMgr);<NEW_LINE>INDArray ret = workspaceMgr.createUninitialized(ArrayType.ACTIVATIONS, input.dataType(), input.shape(), 'c');<NEW_LINE>ret.assign(input.mulRowVector(W).addiRowVector(b));<NEW_LINE>if (maskArray != null) {<NEW_LINE>applyMask(ret);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
W = getParam(DefaultParamInitializer.WEIGHT_KEY);
365,433
public void resolve(BlockScope skope) {<NEW_LINE>this.scope = isInsideTry() ? new BlockScope(skope) : skope;<NEW_LINE>super.resolve(this.scope);<NEW_LINE>if (this.expression == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.switchExpression != null || this.isImplicit) {<NEW_LINE>if (this.switchExpression == null && this.isImplicit && !this.expression.statementExpression()) {<NEW_LINE>if (this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK14) {<NEW_LINE>this.scope.problemReporter().invalidExpressionAsStatement(this.expression);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK14) {<NEW_LINE>this.scope.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>TypeBinding type = this.expression.resolveType(this.scope);<NEW_LINE>if (this.switchExpression != null && type != null)<NEW_LINE>this.switchExpression.originalTypeMap.put(this.expression, type);<NEW_LINE>}
problemReporter().switchExpressionsYieldOutsideSwitchExpression(this);
1,282,050
public ECPoint twicePlus(ECPoint b) {<NEW_LINE>if (this.isInfinity()) {<NEW_LINE>return b;<NEW_LINE>}<NEW_LINE>if (b.isInfinity()) {<NEW_LINE>return twice();<NEW_LINE>}<NEW_LINE>ECCurve curve = this.getCurve();<NEW_LINE>ECFieldElement X1 = this.x;<NEW_LINE>if (X1.isZero()) {<NEW_LINE>// A point with X == 0 is its own additive inverse<NEW_LINE>return b;<NEW_LINE>}<NEW_LINE>ECFieldElement X2 = b.getRawXCoord(), Z2 = b.getZCoord(0);<NEW_LINE>if (X2.isZero() || !Z2.isOne()) {<NEW_LINE>return twice().add(b);<NEW_LINE>}<NEW_LINE>ECFieldElement L1 = this.y, Z1 = this.zs[0];<NEW_LINE>ECFieldElement L2 = b.getRawYCoord();<NEW_LINE>ECFieldElement X1Sq = X1.square();<NEW_LINE>ECFieldElement L1Sq = L1.square();<NEW_LINE>ECFieldElement Z1Sq = Z1.square();<NEW_LINE>ECFieldElement <MASK><NEW_LINE>ECFieldElement T = Z1Sq.add(L1Sq).add(L1Z1);<NEW_LINE>ECFieldElement A = L2.multiply(Z1Sq).add(L1Sq).multiplyPlusProduct(T, X1Sq, Z1Sq);<NEW_LINE>ECFieldElement X2Z1Sq = X2.multiply(Z1Sq);<NEW_LINE>ECFieldElement B = X2Z1Sq.add(T).square();<NEW_LINE>if (B.isZero()) {<NEW_LINE>if (A.isZero()) {<NEW_LINE>return b.twice();<NEW_LINE>}<NEW_LINE>return curve.getInfinity();<NEW_LINE>}<NEW_LINE>if (A.isZero()) {<NEW_LINE>return new SecT409R1Point(curve, A, curve.getB().sqrt());<NEW_LINE>}<NEW_LINE>ECFieldElement X3 = A.square().multiply(X2Z1Sq);<NEW_LINE>ECFieldElement Z3 = A.multiply(B).multiply(Z1Sq);<NEW_LINE>ECFieldElement L3 = A.add(B).square().multiplyPlusProduct(T, L2.addOne(), Z3);<NEW_LINE>return new SecT409R1Point(curve, X3, L3, new ECFieldElement[] { Z3 });<NEW_LINE>}
L1Z1 = L1.multiply(Z1);
1,035,410
protected List<? extends OperatorFactory> createOperatorFactories() {<NEW_LINE>Metadata metadata = localQueryRunner.getMetadata();<NEW_LINE>OperatorFactory tableScanOperator = createTableScanOperator(0, new PlanNodeId("test"), "orders", "totalprice");<NEW_LINE>RowExpression filter = call(GREATER_THAN_OR_EQUAL.name(), metadata.getFunctionAndTypeManager().resolveOperator(GREATER_THAN_OR_EQUAL, fromTypes(DOUBLE, DOUBLE)), BOOLEAN, field(0, DOUBLE), constant(50000.0, DOUBLE));<NEW_LINE>ExpressionCompiler expressionCompiler = new ExpressionCompiler(metadata, new PageFunctionCompiler(metadata, 0));<NEW_LINE>Supplier<PageProcessor> pageProcessor = expressionCompiler.compilePageProcessor(localQueryRunner.getDefaultSession().getSqlFunctionProperties(), Optional.of(filter), ImmutableList.of(<MASK><NEW_LINE>FilterAndProjectOperator.FilterAndProjectOperatorFactory filterAndProjectOperator = new FilterAndProjectOperator.FilterAndProjectOperatorFactory(1, new PlanNodeId("test"), pageProcessor, ImmutableList.of(DOUBLE), new DataSize(0, BYTE), 0);<NEW_LINE>return ImmutableList.of(tableScanOperator, filterAndProjectOperator);<NEW_LINE>}
field(0, DOUBLE)));
127,779
private void changeTemperatureUnits(boolean isImperial, @NonNull Style loadedMapStyle) {<NEW_LINE>if (mapboxMap != null && this.isImperial != isImperial) {<NEW_LINE>this.isImperial = isImperial;<NEW_LINE>// Apply new units to the data displayed in text fields of SymbolLayers<NEW_LINE>SymbolLayer maxTempLayer = (SymbolLayer) loadedMapStyle.getLayer(MAX_TEMP_LAYER_ID);<NEW_LINE>if (maxTempLayer != null) {<NEW_LINE>maxTempLayer.withProperties(textField(getTemperatureValue()));<NEW_LINE>}<NEW_LINE>SymbolLayer minTempLayer = (SymbolLayer) loadedMapStyle.getLayer(MIN_TEMP_LAYER_ID);<NEW_LINE>if (minTempLayer != null) {<NEW_LINE>minTempLayer.withProperties(textField(getTemperatureValue()));<NEW_LINE>}<NEW_LINE>unitsText.<MASK><NEW_LINE>}<NEW_LINE>}
setText(isImperial ? DEGREES_C : DEGREES_F);
1,038,873
public ConfiguredTarget create(RuleContext context) throws InterruptedException, RuleErrorException, ActionConflictException {<NEW_LINE>// This rule doesn't produce any output when listed as a build target.<NEW_LINE>// Only when used via the --experimental_action_listener flag,<NEW_LINE>// this rule instructs the build system to add additional outputs.<NEW_LINE>List<Artifact> resolvedData = Lists.newArrayList();<NEW_LINE>CommandHelper commandHelper = CommandHelper.builder(context).<MASK><NEW_LINE>resolvedData.addAll(context.getPrerequisiteArtifacts("data").list());<NEW_LINE>List<String> outputTemplates = context.attributes().get("out_templates", Type.STRING_LIST);<NEW_LINE>String command = context.attributes().get("cmd", Type.STRING);<NEW_LINE>// This is a bit of a hack. We want to run the MakeVariableExpander first, so we expand $ on<NEW_LINE>// variables that are expanded below with $$, which gets reverted to $ by the<NEW_LINE>// MakeVariableExpander. This allows us to expand package-specific make variables in the<NEW_LINE>// package where the extra action is defined, and then later replace the owner-specific make<NEW_LINE>// variables when the extra action is instantiated.<NEW_LINE>command = command.replace("$(EXTRA_ACTION_FILE)", "$$(EXTRA_ACTION_FILE)");<NEW_LINE>command = command.replace("$(ACTION_ID)", "$$(ACTION_ID)");<NEW_LINE>command = command.replace("$(OWNER_LABEL_DIGEST)", "$$(OWNER_LABEL_DIGEST)");<NEW_LINE>command = command.replace("$(output ", "$$(output ");<NEW_LINE>ConfigurationMakeVariableContext makeVariableContext = new ConfigurationMakeVariableContext(context, context.getTarget().getPackage(), context.getConfiguration());<NEW_LINE>command = context.getExpander(makeVariableContext).withDataExecLocations().expand("cmd", command);<NEW_LINE>boolean requiresActionOutput = context.attributes().get("requires_action_output", Type.BOOLEAN);<NEW_LINE>PathFragment shExecutable = ShToolchain.getPathOrError(context);<NEW_LINE>if (context.hasErrors()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ExtraActionSpec spec = new ExtraActionSpec(shExecutable, commandHelper.getResolvedTools(), CompositeRunfilesSupplier.fromSuppliers(commandHelper.getToolsRunfilesSuppliers()), resolvedData, outputTemplates, command, context.getLabel(), TargetUtils.getExecutionInfo(context.getRule()), requiresActionOutput);<NEW_LINE>return new RuleConfiguredTargetBuilder(context).addProvider(ExtraActionSpec.class, spec).add(RunfilesProvider.class, RunfilesProvider.simple(Runfiles.EMPTY)).build();<NEW_LINE>}
addHostToolDependencies("tools").build();
206,393
public void run(final FlowTrigger trigger, Map data) {<NEW_LINE>FlatDhcpAcquireDhcpServerIpMsg msg = new FlatDhcpAcquireDhcpServerIpMsg();<NEW_LINE>msg.setL3NetworkUuid(struct.getL3NetworkUuid());<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(msg, FlatNetworkServiceConstant.<MASK><NEW_LINE>bus.send(msg, new CloudBusCallBack(trigger) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>trigger.fail(reply.getError());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FlatDhcpAcquireDhcpServerIpReply dreply = (FlatDhcpAcquireDhcpServerIpReply) reply;<NEW_LINE>if (dreply.getDhcpServerList() != null && !dreply.getDhcpServerList().isEmpty()) {<NEW_LINE>dhcpServerIp = dreply.getDhcpServerList().get(0).getIp();<NEW_LINE>}<NEW_LINE>trigger.next();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
SERVICE_ID, struct.getL3NetworkUuid());
1,382,050
private void addRelation(InternalRelationship layoutRelationship) {<NEW_LINE>if (layoutRelationship == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>throw new IllegalArgumentException("The arguments can not be null!");<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>weight = (weight <= 0 ? 0.1 : weight);<NEW_LINE>String key1 = layoutRelationship.getSource().toString() + layoutRelationship.getDestination().toString();<NEW_LINE>String key2 = layoutRelationship.getDestination().toString() + layoutRelationship.getSource().toString();<NEW_LINE>String[] keys = { key1, key2 };<NEW_LINE>for (int i = 0; i < keys.length; i++) {<NEW_LINE>String key = keys[i];<NEW_LINE>Integer count = (Integer) srcDestToNumRelsMap.get(key);<NEW_LINE>Double avgWeight = (Double) srcDestToRelsAvgWeightMap.get(key);<NEW_LINE>if (count == null) {<NEW_LINE>count = new Integer(1);<NEW_LINE>avgWeight = new Double(weight);<NEW_LINE>} else {<NEW_LINE>int newCount = count.intValue() + 1;<NEW_LINE>double newAverage = (avgWeight.doubleValue() * count.doubleValue() + weight) / newCount;<NEW_LINE>avgWeight = new Double(newAverage);<NEW_LINE>count = new Integer(newCount);<NEW_LINE>}<NEW_LINE>srcDestToNumRelsMap.put(key, count);<NEW_LINE>srcDestToRelsAvgWeightMap.put(key, avgWeight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
double weight = layoutRelationship.getWeight();
1,355,757
public Request<RemoveRoleFromDBInstanceRequest> marshall(RemoveRoleFromDBInstanceRequest removeRoleFromDBInstanceRequest) {<NEW_LINE>if (removeRoleFromDBInstanceRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<RemoveRoleFromDBInstanceRequest> request = new DefaultRequest<RemoveRoleFromDBInstanceRequest>(removeRoleFromDBInstanceRequest, "AmazonRDS");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2014-10-31");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (removeRoleFromDBInstanceRequest.getDBInstanceIdentifier() != null) {<NEW_LINE>request.addParameter("DBInstanceIdentifier", StringUtils.fromString(removeRoleFromDBInstanceRequest.getDBInstanceIdentifier()));<NEW_LINE>}<NEW_LINE>if (removeRoleFromDBInstanceRequest.getRoleArn() != null) {<NEW_LINE>request.addParameter("RoleArn", StringUtils.fromString(removeRoleFromDBInstanceRequest.getRoleArn()));<NEW_LINE>}<NEW_LINE>if (removeRoleFromDBInstanceRequest.getFeatureName() != null) {<NEW_LINE>request.addParameter("FeatureName", StringUtils.fromString(removeRoleFromDBInstanceRequest.getFeatureName()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Action", "RemoveRoleFromDBInstance");
163,612
public com.amazonaws.services.stepfunctions.model.InvalidLoggingConfigurationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.stepfunctions.model.InvalidLoggingConfigurationException invalidLoggingConfigurationException = new com.amazonaws.services.stepfunctions.model.InvalidLoggingConfigurationException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 invalidLoggingConfigurationException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
596,155
public boolean apply(Game game, Ability source) {<NEW_LINE>Player opponent = game.<MASK><NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (opponent == null || controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>opponent.revealCards(source, opponent.getHand(), game);<NEW_LINE>TargetCard targetThreeOrLess = new TargetCard(1, Zone.HAND, filterThreeOrLess);<NEW_LINE>TargetCard targetFourOrGreater = new TargetCard(1, Zone.HAND, filterFourOrGreater);<NEW_LINE>Cards toDiscard = new CardsImpl();<NEW_LINE>if (controller.chooseTarget(Outcome.Benefit, opponent.getHand(), targetThreeOrLess, source, game)) {<NEW_LINE>toDiscard.addAll(targetThreeOrLess.getTargets());<NEW_LINE>}<NEW_LINE>if (controller.chooseTarget(Outcome.Benefit, opponent.getHand(), targetFourOrGreater, source, game)) {<NEW_LINE>toDiscard.addAll(targetFourOrGreater.getTargets());<NEW_LINE>}<NEW_LINE>opponent.discard(toDiscard, false, source, game);<NEW_LINE>return true;<NEW_LINE>}
getPlayer(source.getFirstTarget());
1,831,925
public void serializeToResValuesXml(XmlSerializer serializer, ResResource res) throws IOException, AndrolibException {<NEW_LINE>serializer.startTag(null, "style");<NEW_LINE>serializer.attribute(null, "name", res.getResSpec().getName());<NEW_LINE>if (!mParent.isNull() && !mParent.referentIsNull()) {<NEW_LINE>serializer.attribute(null, "parent", mParent.encodeAsResXmlAttr());<NEW_LINE>} else if (res.getResSpec().getName().indexOf('.') != -1) {<NEW_LINE>serializer.attribute(null, "parent", "");<NEW_LINE>}<NEW_LINE>for (Duo<ResReferenceValue, ResScalarValue> mItem : mItems) {<NEW_LINE>ResResSpec spec = mItem.m1.getReferent();<NEW_LINE>if (spec == null) {<NEW_LINE>LOGGER.fine(String.format("null reference: m1=0x%08x(%s), m2=0x%08x(%s)", mItem.m1.getRawIntValue(), mItem.m1.getType(), mItem.m2.getRawIntValue(), mItem.m2.getType()));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String name;<NEW_LINE>String value = null;<NEW_LINE>ResValue resource = spec.getDefaultResource().getValue();<NEW_LINE>if (resource instanceof ResReferenceValue) {<NEW_LINE>continue;<NEW_LINE>} else if (resource instanceof ResAttr) {<NEW_LINE>ResAttr attr = (ResAttr) resource;<NEW_LINE>value = attr.convertToResXmlFormat(mItem.m2);<NEW_LINE>name = spec.getFullName(res.getResSpec().getPackage(), true);<NEW_LINE>} else {<NEW_LINE>name = "@" + spec.getFullName(res.getResSpec().getPackage(), false);<NEW_LINE>}<NEW_LINE>if (value == null) {<NEW_LINE>value = mItem.m2.encodeAsResXmlValue();<NEW_LINE>}<NEW_LINE>if (value == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>serializer.startTag(null, "item");<NEW_LINE>serializer.attribute(null, "name", name);<NEW_LINE>serializer.text(value);<NEW_LINE>serializer.endTag(null, "item");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
serializer.endTag(null, "style");
1,307,989
protected void onPaymentAccountsComboBoxSelected() {<NEW_LINE>// Temporary deactivate handler as the payment account change can populate a new currency list and causes<NEW_LINE>// unwanted selection events (item 0)<NEW_LINE>currencyComboBox.setOnAction(null);<NEW_LINE>PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem();<NEW_LINE>if (paymentAccount != null) {<NEW_LINE>// We represent BSQ swaps as payment method and switch to a new view if it is selected<NEW_LINE>if (paymentAccount.getPaymentMethod().isBsqSwap()) {<NEW_LINE>model.dataModel.resetAddressEntry();<NEW_LINE>close();<NEW_LINE>if (offerActionHandler != null) {<NEW_LINE>offerActionHandler.onCreateOffer(paymentAccount.getSelectedTradeCurrency(), paymentAccount.getPaymentMethod());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>maybeShowClearXchangeWarning(paymentAccount);<NEW_LINE>maybeShowFasterPaymentsWarning(paymentAccount);<NEW_LINE>maybeShowAccountWarning(paymentAccount, model.getDataModel().isBuyOffer());<NEW_LINE>currencySelection.setVisible(paymentAccount.hasMultipleCurrencies());<NEW_LINE>currencySelection.setManaged(paymentAccount.hasMultipleCurrencies());<NEW_LINE>currencyTextFieldBox.setVisible(!paymentAccount.hasMultipleCurrencies());<NEW_LINE>model.onPaymentAccountSelected(paymentAccount);<NEW_LINE>model.<MASK><NEW_LINE>if (paymentAccount.hasMultipleCurrencies()) {<NEW_LINE>final List<TradeCurrency> tradeCurrencies = paymentAccount.getTradeCurrencies();<NEW_LINE>currencyComboBox.setItems(FXCollections.observableArrayList(tradeCurrencies));<NEW_LINE>currencyComboBox.getSelectionModel().select(model.getTradeCurrency());<NEW_LINE>} else {<NEW_LINE>TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency();<NEW_LINE>if (singleTradeCurrency != null)<NEW_LINE>currencyTextField.setText(singleTradeCurrency.getNameAndCode());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>currencySelection.setVisible(false);<NEW_LINE>currencySelection.setManaged(false);<NEW_LINE>currencyTextFieldBox.setVisible(true);<NEW_LINE>currencyTextField.setText("");<NEW_LINE>}<NEW_LINE>currencyComboBox.setOnAction(currencyComboBoxSelectionHandler);<NEW_LINE>updatePriceToggle();<NEW_LINE>}
onCurrencySelected(model.getTradeCurrency());
511,757
public void seek(int offset) throws IOException {<NEW_LINE>boolean doReload;<NEW_LINE>if (offset > filePos) {<NEW_LINE>if (offset > fileLength) {<NEW_LINE>throw new IOException("Offset [ " + offset + " ]" + " past end [ " + fileLength + " ]" + " of [ " + path + " ]");<NEW_LINE>} else {<NEW_LINE>doReload = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int bufferStart = filePos - bufferFill;<NEW_LINE>if (offset < bufferStart) {<NEW_LINE>if (offset < 0) {<NEW_LINE>throw new IOException("Offset [ " + offset + " ]" + " past beginning of [ " + path + " ]");<NEW_LINE>} else {<NEW_LINE>doReload = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>bufferPos = offset - bufferStart;<NEW_LINE>bufferAvail = bufferFill - bufferPos;<NEW_LINE>doReload = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (doReload) {<NEW_LINE>file.seek(offset);<NEW_LINE>filePos = offset;<NEW_LINE>int fileRemaining = fileLength - offset;<NEW_LINE>if (fileRemaining > buffer.length) {<NEW_LINE>bufferFill = buffer.length;<NEW_LINE>} else {<NEW_LINE>bufferFill = fileRemaining;<NEW_LINE>}<NEW_LINE>if (bufferFill > 0) {<NEW_LINE>file.<MASK><NEW_LINE>filePos += bufferFill;<NEW_LINE>}<NEW_LINE>bufferPos = 0;<NEW_LINE>bufferAvail = bufferFill;<NEW_LINE>}<NEW_LINE>}
read(buffer, 0, bufferFill);
618,401
public void run() {<NEW_LINE>try {<NEW_LINE>System.out.println("Starting index read performance");<NEW_LINE>System.out.flush();<NEW_LINE>while (!isShutdown.get()) {<NEW_LINE>synchronized (hashes) {<NEW_LINE>// choose a random index<NEW_LINE>int indexToUse = new Random().nextInt(hashes.size());<NEW_LINE>IndexPayload index = (IndexPayload) hashes.values().toArray()[indexToUse];<NEW_LINE>if (index.getIds().size() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int idToUse = new Random().nextInt(index.getIds().size());<NEW_LINE>String idToLookup = (String) index.getIds().toArray()[idToUse];<NEW_LINE>if (index.getIndex().findKey(new BlobId(idToLookup, map)) == null) {<NEW_LINE>System.<MASK><NEW_LINE>} else {<NEW_LINE>System.out.println("found id " + idToLookup);<NEW_LINE>}<NEW_LINE>throttler.maybeThrottle(1);<NEW_LINE>}<NEW_LINE>Thread.sleep(1000);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.out.println("Exiting index read perf thread " + e.getCause());<NEW_LINE>} finally {<NEW_LINE>latch.countDown();<NEW_LINE>}<NEW_LINE>}
out.println("Error id not found in index " + idToLookup);
536,869
private static ModuleDBAdapter upgrade(ModuleManager moduleMgr, ModuleDBAdapter oldAdapter, TaskMonitor monitor) throws IOException, CancelledException {<NEW_LINE>long treeID = moduleMgr.getTreeID();<NEW_LINE>DBHandle handle = moduleMgr.getDatabaseHandle();<NEW_LINE>DBHandle tmpHandle = new DBHandle();<NEW_LINE>long id = tmpHandle.startTransaction();<NEW_LINE>ModuleDBAdapter tmpAdapter = null;<NEW_LINE>try {<NEW_LINE>tmpAdapter = new ModuleDBAdapterV1(tmpHandle, true, treeID);<NEW_LINE>RecordIterator it = oldAdapter.getRecords();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>DBRecord rec = it.next();<NEW_LINE>tmpAdapter.updateModuleRecord(rec);<NEW_LINE>}<NEW_LINE>handle.deleteTable(getTableName(treeID));<NEW_LINE>ModuleDBAdapter newAdapter = new <MASK><NEW_LINE>it = tmpAdapter.getRecords();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>DBRecord rec = it.next();<NEW_LINE>newAdapter.updateModuleRecord(rec);<NEW_LINE>}<NEW_LINE>return newAdapter;<NEW_LINE>} catch (VersionException e) {<NEW_LINE>// unexpected exception<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>tmpHandle.endTransaction(id, true);<NEW_LINE>tmpHandle.close();<NEW_LINE>}<NEW_LINE>}
ModuleDBAdapterV1(handle, true, treeID);
197,395
public static Map<String, Collection<String>> snippetsFromHighlighting(final NamedList<?> sorlHighlighting) {<NEW_LINE>final Map<String, Collection<String>> snippets = new HashMap<>();<NEW_LINE>if (sorlHighlighting == null) {<NEW_LINE>return snippets;<NEW_LINE>}<NEW_LINE>for (final Entry<String, ?> highlightingEntry : sorlHighlighting) {<NEW_LINE>final String urlHash = highlightingEntry.getKey();<NEW_LINE>final Object highlights = highlightingEntry.getValue();<NEW_LINE>if (highlights instanceof SimpleOrderedMap) {<NEW_LINE>final LinkedHashSet<String> urlSnippets = new LinkedHashSet<>();<NEW_LINE>for (final Entry<String, ?> entry : (SimpleOrderedMap<?>) highlights) {<NEW_LINE>final <MASK><NEW_LINE>if (texts instanceof String[]) {<NEW_LINE>Collections.addAll(urlSnippets, (String[]) texts);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>snippets.put(urlHash, urlSnippets);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return snippets;<NEW_LINE>}
Object texts = entry.getValue();
693,480
public void paint(Graphics g) {<NEW_LINE>GraphicsUtils.configureDefaultRenderingHints(g);<NEW_LINE><MASK><NEW_LINE>Color color = g.getColor();<NEW_LINE>if (selected) {<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("List.selectionBackground"));<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("List.background"));<NEW_LINE>}<NEW_LINE>g.fillRect(0, 0, rectangle.width - 1, rectangle.height - 1);<NEW_LINE>if (hasFocus) {<NEW_LINE>g.setColor(Color.black);<NEW_LINE>g.drawRect(0, 0, rectangle.width - 1, rectangle.height - 1);<NEW_LINE>}<NEW_LINE>g.setColor(Color.black);<NEW_LINE>g.drawRect(6, rectangle.height / 2 - 5, 10, 10);<NEW_LINE>g.setColor(colors[index]);<NEW_LINE>g.fillRect(7, rectangle.height / 2 - 4, 9, 9);<NEW_LINE>if (selected) {<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("List.selectionForeground"));<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("List.foreground"));<NEW_LINE>}<NEW_LINE>FontMetrics fm = g.getFontMetrics();<NEW_LINE>g.drawString(names[index], 22, (rectangle.height - fm.getHeight()) / 2 + fm.getAscent());<NEW_LINE>g.setColor(color);<NEW_LINE>}
Dimension rectangle = this.getSize();
1,539,412
private void generateSources(TreeMap<Key, String[]> properties, Map<GwtLocale, Set<GwtLocale>> parents) throws IOException {<NEW_LINE>Set<GwtLocale> locales = new HashSet<GwtLocale>();<NEW_LINE>// process sorted locales/keys, generating each locale on change<NEW_LINE>GwtLocale lastLocale = null;<NEW_LINE>Map<String, String[]> thisLocale = new HashMap<String, String[]>();<NEW_LINE>for (Entry<Key, String[]> entry : properties.entrySet()) {<NEW_LINE>if (lastLocale != null && lastLocale != entry.getKey().locale) {<NEW_LINE>GwtLocale parent = findEarliestAncestor(lastLocale, parents.get(lastLocale));<NEW_LINE>generateLocale(lastLocale, parent, thisLocale);<NEW_LINE>thisLocale.clear();<NEW_LINE>lastLocale = null;<NEW_LINE>}<NEW_LINE>if (lastLocale == null) {<NEW_LINE>lastLocale <MASK><NEW_LINE>locales.add(lastLocale);<NEW_LINE>}<NEW_LINE>thisLocale.put(entry.getKey().key, entry.getValue());<NEW_LINE>}<NEW_LINE>if (lastLocale != null) {<NEW_LINE>GwtLocale parent = findEarliestAncestor(lastLocale, parents.get(lastLocale));<NEW_LINE>generateLocale(lastLocale, parent, thisLocale);<NEW_LINE>}<NEW_LINE>Set<GwtLocale> seen = new HashSet<GwtLocale>(locales);<NEW_LINE>for (GwtLocale locale : locales) {<NEW_LINE>for (GwtLocale alias : locale.getAliases()) {<NEW_LINE>if (!seen.contains(alias)) {<NEW_LINE>seen.add(alias);<NEW_LINE>// generateAlias(alias, locale);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= entry.getKey().locale;
471,864
public ModelAndView save(HttpServletRequest request, @Valid SysDic dic) {<NEW_LINE>List<SysDic> sysDicList = sysDicRes.findByCodeOrName(dic.getCode(), dic.getName());<NEW_LINE>String msg = null;<NEW_LINE>String orgi = super.getOrgi(request);<NEW_LINE>if (sysDicList.size() == 0) {<NEW_LINE>dic.setParentid("0");<NEW_LINE>dic.setHaschild(true);<NEW_LINE>dic.setCreater(super.getUser(request).getId());<NEW_LINE>dic.setCreatetime(new Date());<NEW_LINE>sysDicRes.save(dic);<NEW_LINE>reloadSysDicItem(dic, orgi);<NEW_LINE>} else {<NEW_LINE>msg = "exist";<NEW_LINE>}<NEW_LINE>return request(super.createView("redirect:/admin/sysdic/index.html" + (msg != null ? <MASK><NEW_LINE>}
"?msg=" + msg : "")));
182,014
public final TextEdit rewriteImports(IProgressMonitor monitor) throws CoreException {<NEW_LINE>SubMonitor subMonitor = SubMonitor.convert(monitor, Messages.bind(Messages.importRewrite_processDescription), 2);<NEW_LINE>if (!hasRecordedChanges()) {<NEW_LINE>this.createdImports = CharOperation.NO_STRINGS;<NEW_LINE>this.createdStaticImports = CharOperation.NO_STRINGS;<NEW_LINE>return new MultiTextEdit();<NEW_LINE>}<NEW_LINE>CompilationUnit usedAstRoot = this.astRoot;<NEW_LINE>if (usedAstRoot == null) {<NEW_LINE>ASTParser parser = ASTParser.newParser(AST.JLS11);<NEW_LINE>parser.setSource(this.compilationUnit);<NEW_LINE>// reduced AST<NEW_LINE>parser.setFocalPosition(0);<NEW_LINE>parser.setResolveBindings(false);<NEW_LINE>usedAstRoot = (CompilationUnit) parser.createAST(subMonitor.split(1));<NEW_LINE>}<NEW_LINE>ImportRewriteConfiguration config = buildImportRewriteConfiguration();<NEW_LINE>ImportRewriteAnalyzer computer = new ImportRewriteAnalyzer(this.compilationUnit, usedAstRoot, config);<NEW_LINE>for (String addedImport : this.addedImports) {<NEW_LINE>boolean isStatic = STATIC_PREFIX == addedImport.charAt(0);<NEW_LINE>String qualifiedName = addedImport.substring(1);<NEW_LINE>computer.addImport(isStatic, qualifiedName);<NEW_LINE>}<NEW_LINE>for (String removedImport : this.removedImports) {<NEW_LINE>boolean isStatic = STATIC_PREFIX == removedImport.charAt(0);<NEW_LINE>String qualifiedName = removedImport.substring(1);<NEW_LINE>computer.removeImport(isStatic, qualifiedName);<NEW_LINE>}<NEW_LINE>for (String typeExplicitSimpleName : this.typeExplicitSimpleNames) {<NEW_LINE>computer.requireExplicitImport(false, typeExplicitSimpleName);<NEW_LINE>}<NEW_LINE>for (String staticExplicitSimpleName : this.staticExplicitSimpleNames) {<NEW_LINE>computer.requireExplicitImport(true, staticExplicitSimpleName);<NEW_LINE>}<NEW_LINE>ImportRewriteAnalyzer.RewriteResult result = computer.analyzeRewrite(subMonitor.split(1));<NEW_LINE>this<MASK><NEW_LINE>this.createdStaticImports = result.getCreatedStaticImports();<NEW_LINE>return result.getTextEdit();<NEW_LINE>}
.createdImports = result.getCreatedImports();
413,287
/*<NEW_LINE>* StringToSign = VERB + "\n" + Content-MD5 + "\n" + Content-Type + "\n" +<NEW_LINE>* Date + "\n" + CanonicalizedHeaders + CanonicalizedResource;<NEW_LINE>*/<NEW_LINE>public void sign(ClientRequest cr) {<NEW_LINE>// gather signed material<NEW_LINE>String requestMethod = cr.getMethod();<NEW_LINE>String contentMD5 = getHeader(cr, "Content-MD5");<NEW_LINE>String contentType = getHeader(cr, "Content-Type");<NEW_LINE>String date = getHeader(cr, "Date");<NEW_LINE>if (date == "") {<NEW_LINE>date = new RFC1123DateConverter()<MASK><NEW_LINE>cr.getHeaders().add("Date", date);<NEW_LINE>}<NEW_LINE>// build signed string<NEW_LINE>String stringToSign = requestMethod + "\n" + contentMD5 + "\n" + contentType + "\n" + date + "\n";<NEW_LINE>stringToSign += addCanonicalizedHeaders(cr);<NEW_LINE>stringToSign += addCanonicalizedResource(cr);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("String to sign: \"%s\"", stringToSign));<NEW_LINE>}<NEW_LINE>String signature = this.signer.sign(stringToSign);<NEW_LINE>cr.getHeaders().putSingle("Authorization", "SharedKeyLite " + this.accountName + ":" + signature);<NEW_LINE>}
.format(new Date());
1,732,681
protected void initData() {<NEW_LINE>if (illust != null) {<NEW_LINE>loadImage();<NEW_LINE>}<NEW_LINE>IntentFilter intentFilter = new IntentFilter();<NEW_LINE>mReceiver = new CallBackReceiver(new BaseReceiver.CallBack() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceive(Context context, Intent intent) {<NEW_LINE><MASK><NEW_LINE>if (bundle != null) {<NEW_LINE>int id = bundle.getInt(Params.ID);<NEW_LINE>if (illust.getId() == id) {<NEW_LINE>boolean isLiked = bundle.getBoolean(Params.IS_LIKED);<NEW_LINE>if (isLiked) {<NEW_LINE>illust.setIs_bookmarked(true);<NEW_LINE>baseBind.postLike.setImageResource(R.drawable.ic_favorite_red_24dp);<NEW_LINE>} else {<NEW_LINE>illust.setIs_bookmarked(false);<NEW_LINE>baseBind.postLike.setImageResource(R.drawable.ic_favorite_grey_24dp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>intentFilter.addAction(Params.LIKED_ILLUST);<NEW_LINE>LocalBroadcastManager.getInstance(mContext).registerReceiver(mReceiver, intentFilter);<NEW_LINE>}
Bundle bundle = intent.getExtras();
501,428
public void registerScriptPlugin(String type, String objectId) {<NEW_LINE>ScriptObject object = mObjects.get(objectId);<NEW_LINE>if (object == null) {<NEW_LINE>object = new ScriptObject(objectId, this);<NEW_LINE>mObjects.put(objectId, object);<NEW_LINE>}<NEW_LINE>switch(type) {<NEW_LINE>case ScriptObject.TYPE_RESOLVER:<NEW_LINE>mResolverPluginFactory.registerPlugin(object, this);<NEW_LINE>PipeLine.<MASK><NEW_LINE>break;<NEW_LINE>case ScriptObject.TYPE_COLLECTION:<NEW_LINE>mCollectionPluginFactory.registerPlugin(object, this);<NEW_LINE>break;<NEW_LINE>case ScriptObject.TYPE_INFOPLUGIN:<NEW_LINE>mInfoPluginFactory.registerPlugin(object, this);<NEW_LINE>break;<NEW_LINE>case ScriptObject.TYPE_CHARTSPROVIDER:<NEW_LINE>mChartsProviderPluginFactory.registerPlugin(object, this);<NEW_LINE>break;<NEW_LINE>case ScriptObject.TYPE_PLAYLISTGENERATOR:<NEW_LINE>mPlaylistGeneratorFactory.registerPlugin(object, this);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>Log.e(TAG, "registerScriptPlugin - ScriptAccount:" + mName + ", ScriptPlugin type not supported!");<NEW_LINE>}<NEW_LINE>}
get().onPluginLoaded(this);
1,719,498
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "s0,s1".split(",");<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public insert into ABCStreamUO select * from MyMapTypeUO", path);<NEW_LINE>env.compileDeploy("@Name('A') update istream ABCStreamUO set s0='A'", path);<NEW_LINE>env.compileDeploy("@Name('B') update istream ABCStreamUO set s0='B'", path);<NEW_LINE>env.compileDeploy("@Name('C') update istream ABCStreamUO set s0='C'", path);<NEW_LINE>env.compileDeploy("@Name('D') update istream ABCStreamUO set s0='D'", path);<NEW_LINE>env.compileDeploy("@name('s0') select * from ABCStreamUO"<MASK><NEW_LINE>env.sendEventMap(makeMap("s0", "", "s1", 1), "MyMapTypeUO");<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "D", 1 });<NEW_LINE>env.undeployAll();<NEW_LINE>}
, path).addListener("s0");
300,329
public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) {<NEW_LINE>return ConfigAwareRuleClassBuilder.of(builder).requiresHostConfigurationFragments(JavaConfiguration.class).originalBuilder().requiresConfigurationFragments(JavaConfiguration.class).advertiseProvider(TemplateVariableInfo.class).advertiseStarlarkProvider(JavaRuntimeInfo.PROVIDER.id())./* <!-- #BLAZE_RULE(java_runtime).ATTRIBUTE(srcs) --><NEW_LINE>All files in the runtime.<NEW_LINE><!-- #END_BLAZE_RULE.ATTRIBUTE --> */<NEW_LINE>add(attr("srcs", LABEL_LIST).allowedFileTypes(FileTypeSet.ANY_FILE))./* <!-- #BLAZE_RULE(java_runtime).ATTRIBUTE(java) --><NEW_LINE>The path to the java executable.<NEW_LINE><!-- #END_BLAZE_RULE.ATTRIBUTE --> */<NEW_LINE>add(attr("java", LABEL).singleArtifact().allowedFileTypes(FileTypeSet.ANY_FILE).exec())./* <!-- #BLAZE_RULE(java_runtime).ATTRIBUTE(java_home) --><NEW_LINE>The path to the root of the runtime.<NEW_LINE>Subject to <a href="${link make-variables}">"Make" variable</a> substitution.<NEW_LINE>If this path is absolute, the rule denotes a non-hermetic Java runtime with a well-known<NEW_LINE>path. In that case, the <code>srcs</code> and <code>java</code> attributes must be empty.<NEW_LINE><!-- #END_BLAZE_RULE.ATTRIBUTE --> */<NEW_LINE>add(attr("java_home", STRING)).add(attr("output_licenses"<MASK><NEW_LINE>}
, LICENSE)).build();