idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,417,471
public static DescribeCdnDomainConfigsResponse unmarshall(DescribeCdnDomainConfigsResponse describeCdnDomainConfigsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeCdnDomainConfigsResponse.setRequestId(_ctx.stringValue("DescribeCdnDomainConfigsResponse.RequestId"));<NEW_LINE>List<DomainConfig> domainConfigs = new ArrayList<DomainConfig>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCdnDomainConfigsResponse.DomainConfigs.Length"); i++) {<NEW_LINE>DomainConfig domainConfig = new DomainConfig();<NEW_LINE>domainConfig.setFunctionName(_ctx.stringValue("DescribeCdnDomainConfigsResponse.DomainConfigs[" + i + "].FunctionName"));<NEW_LINE>domainConfig.setConfigId(_ctx.stringValue<MASK><NEW_LINE>domainConfig.setStatus(_ctx.stringValue("DescribeCdnDomainConfigsResponse.DomainConfigs[" + i + "].Status"));<NEW_LINE>List<FunctionArg> functionArgs = new ArrayList<FunctionArg>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCdnDomainConfigsResponse.DomainConfigs[" + i + "].FunctionArgs.Length"); j++) {<NEW_LINE>FunctionArg functionArg = new FunctionArg();<NEW_LINE>functionArg.setArgName(_ctx.stringValue("DescribeCdnDomainConfigsResponse.DomainConfigs[" + i + "].FunctionArgs[" + j + "].ArgName"));<NEW_LINE>functionArg.setArgValue(_ctx.stringValue("DescribeCdnDomainConfigsResponse.DomainConfigs[" + i + "].FunctionArgs[" + j + "].ArgValue"));<NEW_LINE>functionArgs.add(functionArg);<NEW_LINE>}<NEW_LINE>domainConfig.setFunctionArgs(functionArgs);<NEW_LINE>domainConfigs.add(domainConfig);<NEW_LINE>}<NEW_LINE>describeCdnDomainConfigsResponse.setDomainConfigs(domainConfigs);<NEW_LINE>return describeCdnDomainConfigsResponse;<NEW_LINE>}
("DescribeCdnDomainConfigsResponse.DomainConfigs[" + i + "].ConfigId"));
1,323,949
public Object appendChild(final Object childObject) {<NEW_LINE>Object appendedChild = null;<NEW_LINE>if (childObject instanceof Node) {<NEW_LINE><MASK><NEW_LINE>// is the node allowed here?<NEW_LINE>if (!isNodeInsertable(childNode)) {<NEW_LINE>throw asJavaScriptException(new DOMException("Node cannot be inserted at the specified point in the hierarchy", DOMException.HIERARCHY_REQUEST_ERR));<NEW_LINE>}<NEW_LINE>// Get XML node for the DOM node passed in<NEW_LINE>final DomNode childDomNode = childNode.getDomNodeOrDie();<NEW_LINE>// Get the parent XML node that the child should be added to.<NEW_LINE>final DomNode parentNode = getDomNodeOrDie();<NEW_LINE>// Append the child to the parent node<NEW_LINE>parentNode.appendChild(childDomNode);<NEW_LINE>appendedChild = childObject;<NEW_LINE>initInlineFrameIfNeeded(childDomNode);<NEW_LINE>for (final DomNode domNode : childDomNode.getDescendants()) {<NEW_LINE>initInlineFrameIfNeeded(domNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return appendedChild;<NEW_LINE>}
final Node childNode = (Node) childObject;
755,991
/* Called from within a catch block to skip forward to a known token,<NEW_LINE>and report the occurred exception as a problem. */<NEW_LINE>TokenRange recoverStatement(int recoveryTokenType, int lBraceType, int rBraceType, ParseException p) {<NEW_LINE>JavaToken begin = null;<NEW_LINE>if (p.currentToken != null) {<NEW_LINE>begin = token();<NEW_LINE>}<NEW_LINE>int level = 0;<NEW_LINE>Token t;<NEW_LINE>do {<NEW_LINE>Token nextToken = getToken(1);<NEW_LINE>if (nextToken != null && nextToken.kind == rBraceType && level == 0) {<NEW_LINE>TokenRange tokenRange = range(begin, token());<NEW_LINE>problems.add(new Problem(makeMessageForParseException(p), tokenRange, p));<NEW_LINE>return tokenRange;<NEW_LINE>}<NEW_LINE>t = getNextToken();<NEW_LINE>if (t.kind == lBraceType) {<NEW_LINE>level++;<NEW_LINE>} else if (t.kind == rBraceType) {<NEW_LINE>level--;<NEW_LINE>}<NEW_LINE>} while (!(t.kind == recoveryTokenType && level == 0) && t.kind != EOF);<NEW_LINE>JavaToken end = token();<NEW_LINE>TokenRange tokenRange = null;<NEW_LINE>if (begin != null && end != null) {<NEW_LINE>tokenRange = range(begin, end);<NEW_LINE>}<NEW_LINE>problems.add(new Problem(makeMessageForParseException(<MASK><NEW_LINE>return tokenRange;<NEW_LINE>}
p), tokenRange, p));
333,157
private void registerForgeCareer(final VillagerRegistry.VillagerCareer career, final CallbackInfo callbackInfo) {<NEW_LINE>if (this.spongeProfession == null) {<NEW_LINE>this.spongeProfession = SpongeForgeVillagerRegistry.fromNative((VillagerRegistry<MASK><NEW_LINE>}<NEW_LINE>final VillagerCareerBridge_Forge mixinCareer = (VillagerCareerBridge_Forge) career;<NEW_LINE>final int careerId = mixinCareer.forgeBridge$getId();<NEW_LINE>final SpongeCareer suggestedCareer = new SpongeCareer(careerId, career.getName(), this.spongeProfession, new SpongeTranslation("entity.Villager." + career.getName()));<NEW_LINE>mixinCareer.forgeBridge$setSpongeCareer(suggestedCareer);<NEW_LINE>this.spongeProfession.getUnderlyingCareers().add(suggestedCareer);<NEW_LINE>}
.VillagerProfession) (Object) this);
1,375,207
public Boolean doInTransaction(final TransactionStatus status) {<NEW_LINE>// delete vlans for this zone<NEW_LINE>final List<VlanVO> vlans = _vlanDao.listByZone(zoneId);<NEW_LINE>for (final VlanVO vlan : vlans) {<NEW_LINE>_vlanDao.remove(vlan.getId());<NEW_LINE>}<NEW_LINE>final boolean <MASK><NEW_LINE>if (success) {<NEW_LINE>// delete template refs for this zone<NEW_LINE>templateZoneDao.deleteByZoneId(zoneId);<NEW_LINE>// delete all capacity records for the zone<NEW_LINE>_capacityDao.removeBy(null, zoneId, null, null, null);<NEW_LINE>// remove from dedicated resources<NEW_LINE>final DedicatedResourceVO dr = _dedicatedDao.findByZoneId(zoneId);<NEW_LINE>if (dr != null) {<NEW_LINE>_dedicatedDao.remove(dr.getId());<NEW_LINE>// find the group associated and check if there are any more<NEW_LINE>// resources under that group<NEW_LINE>final List<DedicatedResourceVO> resourcesInGroup = _dedicatedDao.listByAffinityGroupId(dr.getAffinityGroupId());<NEW_LINE>if (resourcesInGroup.isEmpty()) {<NEW_LINE>// delete the group<NEW_LINE>_affinityGroupService.deleteAffinityGroup(dr.getAffinityGroupId(), null, null, null, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>annotationDao.removeByEntityType(AnnotationService.EntityType.ZONE.name(), zone.getUuid());<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}
success = _zoneDao.remove(zoneId);
1,242,849
public ResponseEntity<JsonAuthResponse> authenticate(@RequestBody @NonNull final JsonAuthRequest request) {<NEW_LINE>try {<NEW_LINE>final LoginContext loginCtx = new LoginContext(Env.newTemporaryCtx());<NEW_LINE>loginCtx.setWebui(true);<NEW_LINE>final Login loginService = new Login(loginCtx);<NEW_LINE>final LoginAuthenticateResponse loginAuthResult = loginService.authenticate(request.getUsername(), HashableString.ofPlainValue<MASK><NEW_LINE>final UserId userId = loginAuthResult.getUserId();<NEW_LINE>final RoleId roleId = loginAuthResult.getSingleRole().map(Role::getId).orElseThrow(() -> new AdempiereException("Multiple roles are not supported. Make sure user has only one role assigned"));<NEW_LINE>final ClientId clientId = getClientId(loginService, userId, roleId);<NEW_LINE>final OrgId orgId = getOrgId(loginService, userId, roleId, clientId);<NEW_LINE>final UserAuthToken userAuthToken = userAuthTokenService.getOrCreateNewToken(CreateUserAuthTokenRequest.builder().userId(userId).clientId(clientId).orgId(orgId).roleId(roleId).description("Created by " + AuthenticationRestController.class.getName()).build());<NEW_LINE>final Language userLanguage = userBL.getUserLanguage(userAuthToken.getUserId());<NEW_LINE>final String adLanguage = userLanguage.getAD_Language();<NEW_LINE>final JsonMessages messages = i18nRestController.getMessages(null, adLanguage);<NEW_LINE>return ResponseEntity.ok(JsonAuthResponse.ok(userAuthToken.getAuthToken()).userId(userId.getRepoId()).language(adLanguage).messages(messages.getMessages()).build());<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>// IMPORTANT: don't return 401 because the frontend + chrome + CORS + axios fuck it up<NEW_LINE>// and return an undefined response to their callers<NEW_LINE>if (AdempiereException.isUserValidationError(ex)) {<NEW_LINE>return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(JsonAuthResponse.error(AdempiereException.extractMessage(ex)));<NEW_LINE>} else {<NEW_LINE>logger.warn("Failed authenticating user {}", request.getUsername(), ex);<NEW_LINE>return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(JsonAuthResponse.error("Authentication error. Pls contact the system administrator."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(request.getPassword()));
1,085,961
public CaseInstanceResponse createCaseInstanceResponse(CaseInstance caseInstance, RestUrlBuilder urlBuilder) {<NEW_LINE>CaseInstanceResponse result = new CaseInstanceResponse();<NEW_LINE>result.setBusinessKey(caseInstance.getBusinessKey());<NEW_LINE>result.setBusinessStatus(caseInstance.getBusinessStatus());<NEW_LINE>result.setId(caseInstance.getId());<NEW_LINE>result.setName(caseInstance.getName());<NEW_LINE>result.setStartTime(caseInstance.getStartTime());<NEW_LINE>result.setStartUserId(caseInstance.getStartUserId());<NEW_LINE>result.setState(caseInstance.getState());<NEW_LINE>result.setCaseDefinitionId(caseInstance.getCaseDefinitionId());<NEW_LINE>result.setCaseDefinitionUrl(urlBuilder.buildUrl(CmmnRestUrls.URL_CASE_DEFINITION, caseInstance.getCaseDefinitionId()));<NEW_LINE>result.setUrl(urlBuilder.buildUrl(CmmnRestUrls.URL_CASE_INSTANCE, caseInstance.getId()));<NEW_LINE>result.setParentId(caseInstance.getParentId());<NEW_LINE>result.setCallbackId(caseInstance.getCallbackId());<NEW_LINE>result.setCallbackType(caseInstance.getCallbackType());<NEW_LINE>result.setReferenceId(caseInstance.getReferenceId());<NEW_LINE>result.<MASK><NEW_LINE>result.setTenantId(caseInstance.getTenantId());<NEW_LINE>for (String name : caseInstance.getCaseVariables().keySet()) {<NEW_LINE>result.addVariable(createRestVariable(name, caseInstance.getCaseVariables().get(name), RestVariableScope.LOCAL, caseInstance.getId(), VARIABLE_CASE, false, urlBuilder));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
setReferenceType(caseInstance.getReferenceType());
1,828,725
public void validate(Mesh mesh) {<NEW_LINE>if (!(mesh instanceof TriangleMesh)) {<NEW_LINE>throw new AssertionError("Mesh is not TriangleMesh: " + mesh.getClass() + ", mesh = " + mesh);<NEW_LINE>}<NEW_LINE>TriangleMesh tMesh = (TriangleMesh) mesh;<NEW_LINE>int numPoints = tMesh.getPoints().size() / tMesh.getPointElementSize();<NEW_LINE>int numTexCoords = tMesh.getTexCoords().size() / tMesh.getTexCoordElementSize();<NEW_LINE>int numFaces = tMesh.getFaces().size() / tMesh.getFaceElementSize();<NEW_LINE>if (numPoints == 0 || numPoints * tMesh.getPointElementSize() != tMesh.getPoints().size()) {<NEW_LINE>throw new AssertionError("Points array size is not correct: " + tMesh.getPoints().size());<NEW_LINE>}<NEW_LINE>if (numTexCoords == 0 || numTexCoords * tMesh.getTexCoordElementSize() != tMesh.getTexCoords().size()) {<NEW_LINE>throw new AssertionError("TexCoords array size is not correct: " + tMesh.getPoints().size());<NEW_LINE>}<NEW_LINE>if (numFaces == 0 || numFaces * tMesh.getFaceElementSize() != tMesh.getFaces().size()) {<NEW_LINE>throw new AssertionError("Faces array size is not correct: " + tMesh.getPoints().size());<NEW_LINE>}<NEW_LINE>if (numFaces != tMesh.getFaceSmoothingGroups().size() && tMesh.getFaceSmoothingGroups().size() > 0) {<NEW_LINE>throw new AssertionError("FaceSmoothingGroups array size is not correct: " + tMesh.getPoints().size() + ", numFaces = " + numFaces);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < faces.size(); i += 2) {<NEW_LINE>int pIndex = faces.get(i);<NEW_LINE>if (pIndex < 0 || pIndex > numPoints) {<NEW_LINE>throw new AssertionError("Incorrect point index: " + pIndex + ", numPoints = " + numPoints);<NEW_LINE>}<NEW_LINE>int tcIndex = faces.get(i + 1);<NEW_LINE>if (tcIndex < 0 || tcIndex > numTexCoords) {<NEW_LINE>throw new AssertionError("Incorrect texCoord index: " + tcIndex + ", numTexCoords = " + numTexCoords);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// System.out.println("Validation successfull of " + mesh);<NEW_LINE>}
ObservableIntegerArray faces = tMesh.getFaces();
906,863
public String format(final Correlation correlation, final HttpResponse response) throws IOException {<NEW_LINE>final String correlationId = correlation.getId();<NEW_LINE>final <MASK><NEW_LINE>final StringBuilder result = new StringBuilder(body.length() + 2048);<NEW_LINE>result.append(direction(response));<NEW_LINE>result.append(" Response: ");<NEW_LINE>result.append(correlationId);<NEW_LINE>result.append("\nDuration: ");<NEW_LINE>result.append(correlation.getDuration().toMillis());<NEW_LINE>result.append(" ms\n");<NEW_LINE>result.append(response.getProtocolVersion());<NEW_LINE>result.append(' ');<NEW_LINE>result.append(response.getStatus());<NEW_LINE>final String reasonPhrase = response.getReasonPhrase();<NEW_LINE>if (reasonPhrase != null) {<NEW_LINE>result.append(' ');<NEW_LINE>result.append(reasonPhrase);<NEW_LINE>}<NEW_LINE>result.append('\n');<NEW_LINE>writeHeaders(response.getHeaders(), result);<NEW_LINE>writeBody(body, result);<NEW_LINE>return result.toString();<NEW_LINE>}
String body = response.getBodyAsString();
1,041,108
private static Pair<String, String> postIndexedLSR(final long offset, final ITranslationEnvironment environment, final List<ReilInstruction> instructions, final String registerNodeValue1, final String registerNodeValue2, final String immediateNodeValue) {<NEW_LINE>final String address = environment.getNextVariableString();<NEW_LINE>final String tmpVar1 = environment.getNextVariableString();<NEW_LINE>final String tmpVar2 = environment.getNextVariableString();<NEW_LINE>final String index = environment.getNextVariableString();<NEW_LINE>long baseOffset = offset;<NEW_LINE>instructions.add(ReilHelpers.createStr(baseOffset++, dw, registerNodeValue1, dw, address));<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, registerNodeValue2, dw, "-" <MASK><NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, qw, tmpVar1, dw, dWordBitMask, dw, index));<NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset++, dw, registerNodeValue1, dw, index, dw, tmpVar2));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, dw, tmpVar2, dw, dWordBitMask, dw, registerNodeValue1));<NEW_LINE>return new Pair<String, String>(address, registerNodeValue1);<NEW_LINE>}
+ immediateNodeValue, qw, tmpVar1));
494,055
private void init_card_thumb_resourceURL_style() {<NEW_LINE>// Create a Card<NEW_LINE>Card card <MASK><NEW_LINE>// Create a CardHeader<NEW_LINE>CardHeader header = new CardHeader(getActivity());<NEW_LINE>// Set the header title<NEW_LINE>header.setTitle(getString(R.string.demo_header_basetitle));<NEW_LINE>card.addCardHeader(header);<NEW_LINE>// Create thumbnail<NEW_LINE>CustomThumbCard thumb = new CustomThumbCard(getActivity());<NEW_LINE>// Set URL resource<NEW_LINE>thumb.setUrlResource("https://lh5.googleusercontent.com/-N8bz9q4Kz0I/AAAAAAAAAAI/AAAAAAAAAAs/Icl2bQMyK7c/s265-c-k-no/photo.jpg");<NEW_LINE>// Error Resource ID<NEW_LINE>thumb.setErrorResource(R.drawable.ic_error_loadingorangesmall);<NEW_LINE>// Add thumbnail to a card<NEW_LINE>card.addCardThumbnail(thumb);<NEW_LINE>// Set card in the cardView<NEW_LINE>CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_thumb_style);<NEW_LINE>cardView.setCard(card);<NEW_LINE>}
= new Card(getActivity());
1,725,996
public D3DRTTexture createRTTexture(int width, int height, WrapMode wrapMode, boolean msaa) {<NEW_LINE>if (PrismSettings.verbose && context.isLost()) {<NEW_LINE>System.err.println("RT Texture allocation while the device is lost");<NEW_LINE>}<NEW_LINE>int createw = width;<NEW_LINE>int createh = height;<NEW_LINE>int cx = 0;<NEW_LINE>int cy = 0;<NEW_LINE>if (PrismSettings.forcePow2) {<NEW_LINE>createw = nextPowerOfTwo(createw, Integer.MAX_VALUE);<NEW_LINE>createh = nextPowerOfTwo(createh, Integer.MAX_VALUE);<NEW_LINE>}<NEW_LINE>D3DVramPool pool = D3DVramPool.instance;<NEW_LINE>int aaSamples;<NEW_LINE>if (msaa) {<NEW_LINE>int maxSamples = D3DPipeline.getInstance().getMaxSamples();<NEW_LINE>aaSamples = maxSamples < 2 ? 0 : (maxSamples < 4 ? 2 : 4);<NEW_LINE>} else {<NEW_LINE>aaSamples = 0;<NEW_LINE>}<NEW_LINE>// TODO: 3D - Improve estimate to include if multisample rtt<NEW_LINE>long size = pool.estimateRTTextureSize(width, height, false);<NEW_LINE>if (!pool.prepareForAllocation(size)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>long pResource = nCreateTexture(context.getContextHandle(), PixelFormat.INT_ARGB_PRE.ordinal(), Usage.DEFAULT.ordinal(), true, /*isRTT*/<NEW_LINE>createw, createh, aaSamples, false);<NEW_LINE>if (pResource == 0L) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int texw = nGetTextureWidth(pResource);<NEW_LINE>int texh = nGetTextureHeight(pResource);<NEW_LINE>D3DRTTexture rtt = new D3DRTTexture(context, wrapMode, pResource, texw, texh, cx, <MASK><NEW_LINE>// ensure the RTTexture is cleared to all zeros before returning<NEW_LINE>// (Decora relies on the Java2D behavior, where an image is expected<NEW_LINE>// to be fully transparent after initialization)<NEW_LINE>rtt.createGraphics().clear();<NEW_LINE>return rtt;<NEW_LINE>}
cy, width, height, aaSamples);
1,290,873
protected JFreeChart createGanttChart() throws JRException {<NEW_LINE>JFreeChart jfreeChart = super.createGanttChart();<NEW_LINE>CategoryPlot categoryPlot = (CategoryPlot) jfreeChart.getPlot();<NEW_LINE>categoryPlot.getDomainAxis(<MASK><NEW_LINE>categoryPlot.setDomainGridlinesVisible(true);<NEW_LINE>categoryPlot.setDomainGridlinePosition(CategoryAnchor.END);<NEW_LINE>categoryPlot.setDomainGridlineStroke(new BasicStroke(0.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 50, new float[] { 1 }, 0));<NEW_LINE>categoryPlot.setDomainGridlinePaint(ChartThemesConstants.GRAY_PAINT_134);<NEW_LINE>categoryPlot.setRangeGridlinesVisible(true);<NEW_LINE>categoryPlot.setRangeGridlineStroke(new BasicStroke(0.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 50, new float[] { 1 }, 0));<NEW_LINE>categoryPlot.setRangeGridlinePaint(ChartThemesConstants.GRAY_PAINT_134);<NEW_LINE>// barPlot.isShowTickLabels()<NEW_LINE>categoryPlot.getDomainAxis().// barPlot.isShowTickLabels()<NEW_LINE>setTickLabelsVisible(true);<NEW_LINE>CategoryItemRenderer categoryRenderer = categoryPlot.getRenderer();<NEW_LINE>categoryRenderer.setBaseItemLabelsVisible(true);<NEW_LINE>BarRenderer barRenderer = (BarRenderer) categoryRenderer;<NEW_LINE>barRenderer.setSeriesPaint(0, ChartThemesConstants.EYE_CANDY_SIXTIES_COLORS.get(3));<NEW_LINE>barRenderer.setSeriesPaint(1, ChartThemesConstants.EYE_CANDY_SIXTIES_COLORS.get(0));<NEW_LINE>CategoryDataset categoryDataset = categoryPlot.getDataset();<NEW_LINE>if (categoryDataset != null) {<NEW_LINE>for (int i = 0; i < categoryDataset.getRowCount(); i++) {<NEW_LINE>barRenderer.setSeriesItemLabelFont(i, categoryPlot.getDomainAxis().getTickLabelFont());<NEW_LINE>barRenderer.setSeriesItemLabelsVisible(i, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>categoryPlot.setOutlinePaint(Color.DARK_GRAY);<NEW_LINE>categoryPlot.setOutlineStroke(new BasicStroke(1.5f));<NEW_LINE>categoryPlot.setOutlineVisible(true);<NEW_LINE>return jfreeChart;<NEW_LINE>}
).setCategoryLabelPositions(CategoryLabelPositions.STANDARD);
1,509,984
protected static Processor handleAssetProcessingException(Logger logger) {<NEW_LINE>return exchange -> {<NEW_LINE>AttributeEvent event = exchange.getIn().getBody(AttributeEvent.class);<NEW_LINE>Exception exception = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);<NEW_LINE>StringBuilder error = new StringBuilder();<NEW_LINE>Source source = exchange.getIn().getHeader(HEADER_SOURCE, "unknown source", Source.class);<NEW_LINE>if (source != null) {<NEW_LINE>error.append("Error processing from ").append(source);<NEW_LINE>}<NEW_LINE>String protocolName = exchange.getIn().getHeader(Protocol.SENSOR_QUEUE_SOURCE_PROTOCOL, String.class);<NEW_LINE>if (protocolName != null) {<NEW_LINE>error.append(" (protocol: ").append(protocolName).append(")");<NEW_LINE>}<NEW_LINE>// TODO Better exception handling - dead letter queue?<NEW_LINE>if (exception instanceof AssetProcessingException) {<NEW_LINE>AssetProcessingException processingException = (AssetProcessingException) exception;<NEW_LINE>error.append(" - ").append(processingException.getMessage());<NEW_LINE>error.append(": ").append(event.toString());<NEW_LINE>logger.warning(error.toString());<NEW_LINE>} else {<NEW_LINE>error.append(": ").append(event.toString());<NEW_LINE>logger.log(Level.WARNING, error.toString(), exception);<NEW_LINE>}<NEW_LINE>// Make the exception available if MEP is InOut<NEW_LINE>exchange.<MASK><NEW_LINE>};<NEW_LINE>}
getOut().setBody(exception);
41,365
private String createQueryNewCoreFeature(Feature fp) {<NEW_LINE>StringBuilder cypherCreate = new StringBuilder("CREATE (");<NEW_LINE>cypherCreate.append("f:" + FF4jNeo4jLabels.FF4J_FEATURE + " { uid :'");<NEW_LINE>cypherCreate.append(fp.getUid());<NEW_LINE>cypherCreate.append("', enable:");<NEW_LINE>cypherCreate.<MASK><NEW_LINE>if (fp.getDescription() != null && fp.getDescription().length() > 0) {<NEW_LINE>cypherCreate.append(", description:'");<NEW_LINE>cypherCreate.append(fp.getDescription());<NEW_LINE>cypherCreate.append("'");<NEW_LINE>}<NEW_LINE>if (fp.getPermissions() != null && fp.getPermissions().size() > 0) {<NEW_LINE>cypherCreate.append(", roles: [");<NEW_LINE>boolean first = true;<NEW_LINE>for (String role : fp.getPermissions()) {<NEW_LINE>if (!first) {<NEW_LINE>cypherCreate.append(",");<NEW_LINE>}<NEW_LINE>cypherCreate.append("'" + role + "'");<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>cypherCreate.append("]");<NEW_LINE>}<NEW_LINE>cypherCreate.append("});");<NEW_LINE>return cypherCreate.toString();<NEW_LINE>}
append(fp.isEnable());
1,396,845
public void testObservableRxInvoker_postIbmReceiveTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>long timeout = messageTimeout;<NEW_LINE>if (isZOS()) {<NEW_LINE>timeout = zTimeout;<NEW_LINE>}<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>cb.property("com.ibm.ws.jaxrs.client.receive.timeout", TIMEOUT);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(ObservableRxInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/post/" + SLEEP);<NEW_LINE>Builder builder = t.request();<NEW_LINE>Observable<Response> observable = builder.rx(ObservableRxInvoker.class).post(Entity.xml(Long.toString(SLEEP)));<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>final Holder<Response> holder <MASK><NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>observable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>}, throwable -> {<NEW_LINE>if (throwable.getMessage().contains("SocketTimeoutException")) {<NEW_LINE>// OnError<NEW_LINE>ret.append("Timeout as expected");<NEW_LINE>} else {<NEW_LINE>ret.append("throwable");<NEW_LINE>throwable.printStackTrace();<NEW_LINE>}<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, // OnCompleted<NEW_LINE>() -> ret.append("OnCompleted"));<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(timeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testObservableRxInvoker_postIbmReceiveTimeout: Response took too long. Waited " + timeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>long elapsed = System.currentTimeMillis() - startTime;<NEW_LINE>System.out.println("testObservableRxInvoker_postIbmReceiveTimeout with TIMEOUT " + TIMEOUT + " OnError elapsed time " + elapsed);<NEW_LINE>c.close();<NEW_LINE>}
= new Holder<Response>();
1,661,206
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setResult(RESULT_CANCELED);<NEW_LINE>Bundle extras = getIntent().getExtras();<NEW_LINE>Bundle args = extras.getBundle(EXTRA_COMBO_ARGS);<NEW_LINE>String svStr = <MASK><NEW_LINE>ComboViews startingView = svStr != null ? ComboViews.valueOf(svStr) : ComboViews.Bookmarks;<NEW_LINE>mViewPager = new ViewPager(this);<NEW_LINE>mViewPager.setId(R.id.tab_view);<NEW_LINE>setContentView(mViewPager);<NEW_LINE>final ActionBar bar = getSupportActionBar();<NEW_LINE>bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);<NEW_LINE>if (BaseBrowserFragment.isTablet(this)) {<NEW_LINE>bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO);<NEW_LINE>bar.setHomeButtonEnabled(true);<NEW_LINE>} else {<NEW_LINE>bar.setDisplayOptions(0);<NEW_LINE>}<NEW_LINE>mTabsAdapter = new TabsAdapter(this, mViewPager);<NEW_LINE>mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_bookmarks), BrowserBookmarksPage.class, args);<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>bar.setSelectedNavigationItem(savedInstanceState.getInt(STATE_SELECTED_TAB, 0));<NEW_LINE>} else {<NEW_LINE>switch(startingView) {<NEW_LINE>case Bookmarks:<NEW_LINE>mViewPager.setCurrentItem(0);<NEW_LINE>break;<NEW_LINE>case History:<NEW_LINE>mViewPager.setCurrentItem(1);<NEW_LINE>break;<NEW_LINE>case Snapshots:<NEW_LINE>mViewPager.setCurrentItem(2);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
extras.getString(EXTRA_INITIAL_VIEW, null);
1,206,472
private soot.Value handleDFLCond(soot.jimple.ConditionExpr cond) {<NEW_LINE>soot.Local result = lg.generateLocal(soot.ByteType.v());<NEW_LINE><MASK><NEW_LINE>if (isDouble(cond.getOp1()) || isDouble(cond.getOp2()) || isFloat(cond.getOp1()) || isFloat(cond.getOp2())) {<NEW_LINE>// use cmpg and cmpl<NEW_LINE>if ((cond instanceof soot.jimple.GeExpr) || (cond instanceof soot.jimple.GtExpr)) {<NEW_LINE>// use cmpg<NEW_LINE>cmExpr = soot.jimple.Jimple.v().newCmpgExpr(cond.getOp1(), cond.getOp2());<NEW_LINE>} else {<NEW_LINE>// use cmpl<NEW_LINE>cmExpr = soot.jimple.Jimple.v().newCmplExpr(cond.getOp1(), cond.getOp2());<NEW_LINE>}<NEW_LINE>} else if (isLong(cond.getOp1()) || isLong(cond.getOp2())) {<NEW_LINE>// use cmp<NEW_LINE>cmExpr = soot.jimple.Jimple.v().newCmpExpr(cond.getOp1(), cond.getOp2());<NEW_LINE>} else {<NEW_LINE>return cond;<NEW_LINE>}<NEW_LINE>soot.jimple.Stmt assign = soot.jimple.Jimple.v().newAssignStmt(result, cmExpr);<NEW_LINE>body.getUnits().add(assign);<NEW_LINE>if (cond instanceof soot.jimple.EqExpr) {<NEW_LINE>cond = soot.jimple.Jimple.v().newEqExpr(result, soot.jimple.IntConstant.v(0));<NEW_LINE>} else if (cond instanceof soot.jimple.GeExpr) {<NEW_LINE>cond = soot.jimple.Jimple.v().newGeExpr(result, soot.jimple.IntConstant.v(0));<NEW_LINE>} else if (cond instanceof soot.jimple.GtExpr) {<NEW_LINE>cond = soot.jimple.Jimple.v().newGtExpr(result, soot.jimple.IntConstant.v(0));<NEW_LINE>} else if (cond instanceof soot.jimple.LeExpr) {<NEW_LINE>cond = soot.jimple.Jimple.v().newLeExpr(result, soot.jimple.IntConstant.v(0));<NEW_LINE>} else if (cond instanceof soot.jimple.LtExpr) {<NEW_LINE>cond = soot.jimple.Jimple.v().newLtExpr(result, soot.jimple.IntConstant.v(0));<NEW_LINE>} else if (cond instanceof soot.jimple.NeExpr) {<NEW_LINE>cond = soot.jimple.Jimple.v().newNeExpr(result, soot.jimple.IntConstant.v(0));<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unknown Comparison Expr");<NEW_LINE>}<NEW_LINE>return cond;<NEW_LINE>}
soot.jimple.Expr cmExpr = null;
1,707,791
public Notebook apply(EntityResponse response) {<NEW_LINE>final Notebook convertedNotebook = new Notebook();<NEW_LINE>convertedNotebook.setUrn(response.getUrn().toString());<NEW_LINE>convertedNotebook.setType(EntityType.NOTEBOOK);<NEW_LINE>EnvelopedAspectMap aspectMap = response.getAspects();<NEW_LINE>MappingHelper<Notebook> mappingHelper = new MappingHelper<>(aspectMap, convertedNotebook);<NEW_LINE>mappingHelper.mapToResult(NOTEBOOK_KEY_ASPECT_NAME, this::mapNotebookKey);<NEW_LINE>mappingHelper.mapToResult(NOTEBOOK_INFO_ASPECT_NAME, this::mapNotebookInfo);<NEW_LINE>mappingHelper.mapToResult(NOTEBOOK_CONTENT_ASPECT_NAME, this::mapNotebookContent);<NEW_LINE>mappingHelper.mapToResult(EDITABLE_NOTEBOOK_PROPERTIES_ASPECT_NAME, this::mapEditableNotebookProperties);<NEW_LINE>mappingHelper.mapToResult(OWNERSHIP_ASPECT_NAME, (notebook, dataMap) -> notebook.setOwnership(OwnershipMapper.map(new Ownership(dataMap))));<NEW_LINE>mappingHelper.mapToResult(STATUS_ASPECT_NAME, (notebook, dataMap) -> notebook.setStatus(StatusMapper.map(<MASK><NEW_LINE>mappingHelper.mapToResult(GLOBAL_TAGS_ASPECT_NAME, (notebook, dataMap) -> notebook.setTags(GlobalTagsMapper.map(new GlobalTags(dataMap))));<NEW_LINE>mappingHelper.mapToResult(INSTITUTIONAL_MEMORY_ASPECT_NAME, (notebook, dataMap) -> notebook.setInstitutionalMemory(InstitutionalMemoryMapper.map(new InstitutionalMemory(dataMap))));<NEW_LINE>mappingHelper.mapToResult(DOMAINS_ASPECT_NAME, this::mapDomains);<NEW_LINE>mappingHelper.mapToResult(SUB_TYPES_ASPECT_NAME, this::mapSubTypes);<NEW_LINE>mappingHelper.mapToResult(GLOSSARY_TERMS_ASPECT_NAME, (notebook, dataMap) -> notebook.setGlossaryTerms(GlossaryTermsMapper.map(new GlossaryTerms(dataMap))));<NEW_LINE>mappingHelper.mapToResult(DATA_PLATFORM_INSTANCE_ASPECT_NAME, this::mapDataPlatformInstance);<NEW_LINE>return mappingHelper.getResult();<NEW_LINE>}
new Status(dataMap))));
424,751
private static void demo_p2p_script_function() throws Exception {<NEW_LINE>StructTag.Builder builder = new StructTag.Builder();<NEW_LINE>builder.address = AccountAddress.valueOf(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0<MASK><NEW_LINE>builder.module = new Identifier("XDX");<NEW_LINE>builder.name = new Identifier("XDX");<NEW_LINE>builder.type_params = new ArrayList<com.diem.types.TypeTag>();<NEW_LINE>StructTag tag = builder.build();<NEW_LINE>TypeTag token = new TypeTag.Struct(tag);<NEW_LINE>AccountAddress payee = AccountAddress.valueOf(new byte[] { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 });<NEW_LINE>@Unsigned<NEW_LINE>Long amount = Long.valueOf(1234567);<NEW_LINE>TransactionPayload payload = Helpers.encode_peer_to_peer_with_metadata_script_function(token, payee, amount, Bytes.empty(), Bytes.empty());<NEW_LINE>ScriptFunctionCall.PeerToPeerWithMetadata call = (ScriptFunctionCall.PeerToPeerWithMetadata) Helpers.decode_script_function_payload(payload);<NEW_LINE>assert (call.amount.equals(amount));<NEW_LINE>assert (call.payee.equals(payee));<NEW_LINE>byte[] output = payload.bcsSerialize();<NEW_LINE>for (byte o : output) {<NEW_LINE>System.out.print(((int) o & 0xFF) + " ");<NEW_LINE>}<NEW_LINE>;<NEW_LINE>System.out.println();<NEW_LINE>}
, 0, 0, 1 });
832,352
void updateScrollPosition(int offsetX, int offsetY) {<NEW_LINE><MASK><NEW_LINE>int verticalVisibleLength = mRecyclerViewHeight;<NEW_LINE>mNeedVerticalScrollbar = verticalContentLength - verticalVisibleLength > 0 && mRecyclerViewHeight >= mScrollbarMinimumRange || mNeedHorizontalScrollbar;<NEW_LINE>int horizontalContentLength = mRecyclerView.computeHorizontalScrollRange();<NEW_LINE>int horizontalVisibleLength = mRecyclerViewWidth;<NEW_LINE>mNeedHorizontalScrollbar = horizontalContentLength - horizontalVisibleLength > 0 && mRecyclerViewWidth >= mScrollbarMinimumRange || mNeedHorizontalScrollbar;<NEW_LINE>if (!mNeedVerticalScrollbar && !mNeedHorizontalScrollbar) {<NEW_LINE>if (mState != STATE_HIDDEN && !mAlwaysVisible) {<NEW_LINE>setState(STATE_HIDDEN);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mNeedVerticalScrollbar) {<NEW_LINE>mVerticalThumbHeight = Math.max(mDefaultWidth * 4, Math.min(verticalVisibleLength, (verticalVisibleLength * verticalVisibleLength) / verticalContentLength));<NEW_LINE>mVerticalThumbCenterY = (int) ((verticalVisibleLength - mVerticalThumbHeight) * offsetY / ((float) verticalContentLength - verticalVisibleLength) + mVerticalThumbHeight / 2.0);<NEW_LINE>}<NEW_LINE>if (mNeedHorizontalScrollbar && horizontalContentLength > 0) {<NEW_LINE>mHorizontalThumbWidth = Math.max(mDefaultWidth * 4, Math.min(horizontalVisibleLength, (horizontalVisibleLength * horizontalVisibleLength) / horizontalContentLength));<NEW_LINE>mHorizontalThumbCenterX = (int) ((horizontalVisibleLength - mHorizontalThumbHeight) * offsetX / ((float) horizontalContentLength - horizontalVisibleLength) + mHorizontalThumbHeight / 2.0);<NEW_LINE>}<NEW_LINE>if (mState == STATE_HIDDEN || mState == STATE_VISIBLE) {<NEW_LINE>setState(STATE_VISIBLE);<NEW_LINE>}<NEW_LINE>}
int verticalContentLength = mRecyclerView.computeVerticalScrollRange();
434,303
public void updateComment(final RequestContext context) {<NEW_LINE>final String commentId = context.pathVar("commentId");<NEW_LINE>final <MASK><NEW_LINE>final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "admin/comment.ftl");<NEW_LINE>final Map<String, Object> dataModel = renderer.getDataModel();<NEW_LINE>JSONObject comment = commentQueryService.getComment(commentId);<NEW_LINE>final Iterator<String> parameterNames = request.getParameterNames().iterator();<NEW_LINE>while (parameterNames.hasNext()) {<NEW_LINE>final String name = parameterNames.next();<NEW_LINE>final String value = context.param(name);<NEW_LINE>if (name.equals(Comment.COMMENT_STATUS) || name.equals(Comment.COMMENT_THANK_CNT) || name.equals(Comment.COMMENT_GOOD_CNT) || name.equals(Comment.COMMENT_BAD_CNT)) {<NEW_LINE>comment.put(name, Integer.valueOf(value));<NEW_LINE>} else {<NEW_LINE>comment.put(name, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>commentMgmtService.updateCommentByAdmin(commentId, comment);<NEW_LINE>operationMgmtService.addOperation(Operation.newOperation(request, Operation.OPERATION_CODE_C_UPDATE_COMMENT, commentId));<NEW_LINE>comment = commentQueryService.getComment(commentId);<NEW_LINE>dataModel.put(Comment.COMMENT, comment);<NEW_LINE>dataModelService.fillHeaderAndFooter(context, dataModel);<NEW_LINE>}
Request request = context.getRequest();
470,775
void processExtends(HashMapWrappedVirtualObject minBounds, HashMapWrappedVirtualObject maxBounds, double[] transformationMatrix, DoubleBuffer vertices, int index, GenerateGeometryResult generateGeometryResult) throws BimserverDatabaseException {<NEW_LINE>double x = vertices.get(index);<NEW_LINE>double y = vertices.get(index + 1);<NEW_LINE>double z = vertices.get(index + 2);<NEW_LINE>double[] result = new double[4];<NEW_LINE>Matrix.multiplyMV(result, 0, transformationMatrix, 0, new double[] { x, y, z, 1 }, 0);<NEW_LINE>x = result[0];<NEW_LINE>y = result[1];<NEW_LINE>z = result[2];<NEW_LINE>minBounds.set("x", Math.min(x, (double) minBounds.eGet("x")));<NEW_LINE>minBounds.set("y", Math.min(y, (double) minBounds.eGet("y")));<NEW_LINE>minBounds.set("z", Math.min(z, (double) minBounds.eGet("z")));<NEW_LINE>maxBounds.set("x", Math.max(x, (double) maxBounds.eGet("x")));<NEW_LINE>maxBounds.set("y", Math.max(y, (double) maxBounds.eGet("y")));<NEW_LINE>maxBounds.set("z", Math.max(z, (double) <MASK><NEW_LINE>generateGeometryResult.setMinX(Math.min(x, generateGeometryResult.getMinX()));<NEW_LINE>generateGeometryResult.setMinY(Math.min(y, generateGeometryResult.getMinY()));<NEW_LINE>generateGeometryResult.setMinZ(Math.min(z, generateGeometryResult.getMinZ()));<NEW_LINE>generateGeometryResult.setMaxX(Math.max(x, generateGeometryResult.getMaxX()));<NEW_LINE>generateGeometryResult.setMaxY(Math.max(y, generateGeometryResult.getMaxY()));<NEW_LINE>generateGeometryResult.setMaxZ(Math.max(z, generateGeometryResult.getMaxZ()));<NEW_LINE>}
maxBounds.eGet("z")));
1,167,977
// metas-2009_0021_AP1_CR080<NEW_LINE>private Collection<MReportLine> includeLine(MReportLine line) {<NEW_LINE>final int included_reportLineSet_ID = line.getIncluded_ReportLineSet_ID();<NEW_LINE>// Insert Included Lines<NEW_LINE>StringBuilder sql = new StringBuilder("INSERT INTO T_Report " + "(AD_PInstance_ID, PA_ReportLine_ID, Record_ID,Fact_Acct_ID, SeqNo,LevelNo, Name,Description) " + "SELECT ?, PA_ReportLine_ID, 0,0, ?,0, Name,Description " + "FROM PA_ReportLine " + "WHERE IsActive='Y' AND PA_ReportLineSet_ID=?");<NEW_LINE>int no = DB.executeUpdateEx(sql.toString(), new Object[] { getAD_PInstance_ID(), line.getSeqNo(), included_reportLineSet_ID }, get_TrxName());<NEW_LINE>log.debug("Included report lines[" + line.getName() + "] #" + no);<NEW_LINE>// Delete old line<NEW_LINE>DB.executeUpdateEx("DELETE FROM T_Report WHERE AD_PInstance_ID=? AND PA_ReportLine_ID=?", new Object[] { getAD_PInstance_ID(), line.getPA_ReportLine_ID() }, get_TrxName());<NEW_LINE>//<NEW_LINE>MReportLineSet includedLineSet = new MReportLineSet(<MASK><NEW_LINE>return Arrays.asList(includedLineSet.getLiness());<NEW_LINE>}
getCtx(), included_reportLineSet_ID, null);
1,028,508
private JavaVersion findJavaVersion(TruffleObject libJava) {<NEW_LINE>// void JDK_GetVersionInfo0(jdk_version_info* info, size_t info_size);<NEW_LINE>TruffleObject jdkGetVersionInfo = getNativeAccess().lookupAndBindSymbol(libJava, "JDK_GetVersionInfo0", NativeSignature.create(NativeType.VOID, NativeType.POINTER, NativeType.LONG));<NEW_LINE>if (jdkGetVersionInfo != null) {<NEW_LINE>JdkVersionInfo.JdkVersionInfoWrapper wrapper = getStructs().jdkVersionInfo.allocate(getNativeAccess(), jni());<NEW_LINE>try {<NEW_LINE>getUncached().execute(jdkGetVersionInfo, wrapper.pointer(), getStructs(<MASK><NEW_LINE>} catch (UnsupportedTypeException | UnsupportedMessageException | ArityException e) {<NEW_LINE>throw EspressoError.shouldNotReachHere(e);<NEW_LINE>}<NEW_LINE>int versionInfo = wrapper.jdkVersion();<NEW_LINE>wrapper.free(getNativeAccess());<NEW_LINE>int major = (versionInfo & 0xFF000000) >> 24;<NEW_LINE>if (major == 1) {<NEW_LINE>// Version 1.X<NEW_LINE>int minor = (versionInfo & 0x00FF0000) >> 16;<NEW_LINE>return new JavaVersion(minor);<NEW_LINE>} else {<NEW_LINE>// Version X.Y<NEW_LINE>return new JavaVersion(major);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// JDK 14+<NEW_LINE>return new JavaVersion(JavaVersion.LATEST_SUPPORTED);<NEW_LINE>}<NEW_LINE>}
).jdkVersionInfo.structSize());
1,081,329
// index@3<NEW_LINE>public void loadAllKeys() {<NEW_LINE>if (cache != null)<NEW_LINE>return;<NEW_LINE>byte[][] buf = new byte[1000][];<NEW_LINE>int bufSize = (int) ((MAX_DIRECT_POS_SIZE / 1000) * POSITION_SIZE);<NEW_LINE>InputStream is = indexFile.getInputStream();<NEW_LINE>ObjectReader reader = new ObjectReader(is, BUFFER_SIZE);<NEW_LINE>try {<NEW_LINE>readHeader(reader);<NEW_LINE>if (!isDirectPos)<NEW_LINE>return;<NEW_LINE>long fileSize = indexFile.size() - reader.position();<NEW_LINE>int i = 0;<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>buf[i] = new byte[bufSize];<NEW_LINE>reader.readFully(buf[i]);<NEW_LINE>i++;<NEW_LINE>fileSize -= bufSize;<NEW_LINE>if (bufSize > fileSize) {<NEW_LINE>bufSize = (int) fileSize;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RowBufferWriter writer = new RowBufferWriter(null);<NEW_LINE>int maxLen = 0;<NEW_LINE>ICursor cs = srcTable.cursor();<NEW_LINE>Sequence table = cs.fetch(ICursor.FETCHCOUNT);<NEW_LINE>while (table != null && table.length() != 0) {<NEW_LINE>ListBase1 mems = table.getMems();<NEW_LINE>int size = mems.size();<NEW_LINE>for (int j = 1; j <= size; j++) {<NEW_LINE>Record r = (Record) mems.get(j);<NEW_LINE>Object[] vals = r.getFieldValues();<NEW_LINE>int len = 9;<NEW_LINE>writer.reset();<NEW_LINE>for (Object obj : vals) {<NEW_LINE>writer.writeObject(obj);<NEW_LINE>}<NEW_LINE>len += writer.getCount();<NEW_LINE>if (len > maxLen) {<NEW_LINE>maxLen = len;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>table = cs.fetch(ICursor.FETCHCOUNT);<NEW_LINE>}<NEW_LINE>cs.close();<NEW_LINE>maxRecordLen = maxLen;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RQException(e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>reader.close();<NEW_LINE>} catch (IOException ie) {<NEW_LINE>}<NEW_LINE>;<NEW_LINE>}<NEW_LINE>cache = buf;<NEW_LINE><MASK><NEW_LINE>EnvUtil.runGC(rt);<NEW_LINE>}
Runtime rt = Runtime.getRuntime();
957,776
public PointSensitivityBuilder presentValueSensitivityModelParamsVolatility(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionSmileVolatilities volatilities) {<NEW_LINE>validate(ratesProvider, volatilities);<NEW_LINE>double timeToExpiry = volatilities.relativeTime(option.getExpiry());<NEW_LINE>if (timeToExpiry <= 0d) {<NEW_LINE>return PointSensitivityBuilder.none();<NEW_LINE>}<NEW_LINE>ResolvedFxSingle underlyingFx = option.getUnderlying();<NEW_LINE>Currency ccyCounter = option.getCounterCurrency();<NEW_LINE>double df = ratesProvider.discountFactor(ccyCounter, underlyingFx.getPaymentDate());<NEW_LINE>FxRate forward = fxPricer.forwardFxRate(underlyingFx, ratesProvider);<NEW_LINE>CurrencyPair currencyPair = underlyingFx.getCurrencyPair();<NEW_LINE>double <MASK><NEW_LINE>double strikeRate = option.getStrike();<NEW_LINE>SmileDeltaParameters smileAtTime = volatilities.getSmile().smileForExpiry(timeToExpiry);<NEW_LINE>double[] strikes = smileAtTime.strike(forwardRate).toArray();<NEW_LINE>double[] vols = smileAtTime.getVolatility().toArray();<NEW_LINE>double volAtm = vols[1];<NEW_LINE>double[] x = vannaVolgaWeights(forwardRate, strikeRate, timeToExpiry, volAtm, strikes);<NEW_LINE>double vegaAtm = BlackFormulaRepository.vega(forwardRate, strikeRate, timeToExpiry, volAtm);<NEW_LINE>double signedNotional = signedNotional(option);<NEW_LINE>PointSensitivityBuilder sensiSmile = PointSensitivityBuilder.none();<NEW_LINE>for (int i = 0; i < 3; i += 2) {<NEW_LINE>double vegaFwdAtm = BlackFormulaRepository.vega(forwardRate, strikes[i], timeToExpiry, volAtm);<NEW_LINE>vegaAtm -= x[i] * vegaFwdAtm;<NEW_LINE>double vegaFwdSmile = BlackFormulaRepository.vega(forwardRate, strikes[i], timeToExpiry, vols[i]);<NEW_LINE>sensiSmile = sensiSmile.combinedWith(FxOptionSensitivity.of(volatilities.getName(), currencyPair, timeToExpiry, strikes[i], forwardRate, ccyCounter, df * signedNotional * x[i] * vegaFwdSmile));<NEW_LINE>}<NEW_LINE>FxOptionSensitivity sensiAtm = FxOptionSensitivity.of(volatilities.getName(), currencyPair, timeToExpiry, strikes[1], forwardRate, ccyCounter, df * signedNotional * vegaAtm);<NEW_LINE>return sensiAtm.combinedWith(sensiSmile);<NEW_LINE>}
forwardRate = forward.fxRate(currencyPair);
1,836,737
public void check() throws SQLException {<NEW_LINE>super.check();<NEW_LINE>originalPredicate = generatePredicate();<NEW_LINE>select.setWhereClause(originalPredicate);<NEW_LINE>String originalQueryString = CockroachDBVisitor.asString(select);<NEW_LINE>List<String> resultSet = ComparatorHelper.getResultSetFirstColumnAsString(originalQueryString, errors, state);<NEW_LINE>boolean allowOrderBy = Randomly.getBoolean();<NEW_LINE>if (allowOrderBy) {<NEW_LINE>select.setOrderByExpressions(gen.getOrderingTerms());<NEW_LINE>}<NEW_LINE>select.setWhereClause(combinePredicate(predicate));<NEW_LINE>String firstQueryString = CockroachDBVisitor.asString(select);<NEW_LINE>select.setWhereClause(combinePredicate(new CockroachDBNotOperation(predicate)));<NEW_LINE>String <MASK><NEW_LINE>select.setWhereClause(combinePredicate(new CockroachDBUnaryPostfixOperation(predicate, CockroachDBUnaryPostfixOperator.IS_NULL)));<NEW_LINE>String thirdQueryString = CockroachDBVisitor.asString(select);<NEW_LINE>List<String> combinedString = new ArrayList<>();<NEW_LINE>List<String> secondResultSet = ComparatorHelper.getCombinedResultSet(firstQueryString, secondQueryString, thirdQueryString, combinedString, !allowOrderBy, state, errors);<NEW_LINE>ComparatorHelper.assumeResultSetsAreEqual(resultSet, secondResultSet, originalQueryString, combinedString, state);<NEW_LINE>}
secondQueryString = CockroachDBVisitor.asString(select);
30,124
public static void syncVolumeToRootFolder(DatacenterMO dcMo, DatastoreMO ds, String vmdkName, String vmName, String excludeFolders) throws Exception {<NEW_LINE>String fileDsFullPath = ds.searchFileInSubFolders(vmdkName + ".vmdk", false, excludeFolders);<NEW_LINE>if (fileDsFullPath == null)<NEW_LINE>return;<NEW_LINE>String folderName = null;<NEW_LINE>if (ds.folderExists(String.format("[%s]", ds.getName()), vmName)) {<NEW_LINE>folderName = String.format("[%s] %s", ds.getName(), vmName);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>List<String> vSphereFileExtensions = new ArrayList<>(Arrays.asList(VsphereLinkedCloneExtensions.value().trim().split("\\s*,\\s*")));<NEW_LINE>// add flat file format to the above list<NEW_LINE>vSphereFileExtensions.add("flat.vmdk");<NEW_LINE>for (String linkedCloneExtension : vSphereFileExtensions) {<NEW_LINE>String companionFilePath = srcDsFile.getCompanionPath(String.format("%s-%s", vmdkName, linkedCloneExtension));<NEW_LINE>if (ds.fileExists(companionFilePath)) {<NEW_LINE>String targetPath = getDatastorePathBaseFolderFromVmdkFileName(ds, String.format("%s-%s", vmdkName, linkedCloneExtension));<NEW_LINE>s_logger.info("Fixup folder-synchronization. move " + companionFilePath + " -> " + targetPath);<NEW_LINE>ds.moveDatastoreFile(companionFilePath, dcMo.getMor(), ds.getMor(), targetPath, dcMo.getMor(), true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// move the identity VMDK file the last<NEW_LINE>String targetPath = getDatastorePathBaseFolderFromVmdkFileName(ds, vmdkName + ".vmdk");<NEW_LINE>s_logger.info("Fixup folder-synchronization. move " + fileDsFullPath + " -> " + targetPath);<NEW_LINE>ds.moveDatastoreFile(fileDsFullPath, dcMo.getMor(), ds.getMor(), targetPath, dcMo.getMor(), true);<NEW_LINE>if (folderName != null) {<NEW_LINE>String[] files = ds.listDirContent(folderName);<NEW_LINE>if (files == null || files.length == 0) {<NEW_LINE>ds.deleteFolder(folderName, dcMo.getMor());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
DatastoreFile srcDsFile = new DatastoreFile(fileDsFullPath);
1,384,246
public com.amazonaws.services.elasticfilesystem.model.DependencyTimeoutException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.elasticfilesystem.model.DependencyTimeoutException dependencyTimeoutException = new com.amazonaws.services.elasticfilesystem.model.DependencyTimeoutException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ErrorCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dependencyTimeoutException.setErrorCode(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return dependencyTimeoutException;<NEW_LINE>}
class).unmarshall(context));
853,503
protected void fillImporterInfo(Import theImport, String sourceSystemId) {<NEW_LINE>if (!xmlImporterMap.containsKey(theImport.getImportType())) {<NEW_LINE>if (theImport.getImportType().equals("http://schemas.xmlsoap.org/wsdl/")) {<NEW_LINE>Class<?> wsdlImporterClass;<NEW_LINE>try {<NEW_LINE>wsdlImporterClass = Class.forName("org.activiti.engine.impl.webservice.CxfWSDLImporter", true, Thread.currentThread().getContextClassLoader());<NEW_LINE>XMLImporter importerInstance = (XMLImporter) wsdlImporterClass.getDeclaredConstructor().newInstance();<NEW_LINE>xmlImporterMap.put(theImport.getImportType(), importerInstance);<NEW_LINE><MASK><NEW_LINE>structureDefinitionMap.putAll(importerInstance.getStructures());<NEW_LINE>wsServiceMap.putAll(importerInstance.getServices());<NEW_LINE>wsOperationMap.putAll(importerInstance.getOperations());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ActivitiException("Could not find importer for type " + theImport.getImportType());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new ActivitiException("Could not import item of type " + theImport.getImportType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
importerInstance.importFrom(theImport, sourceSystemId);
1,569,929
public boolean showLookup() {<NEW_LINE>ApplicationManager.getApplication().assertIsDispatchThread();<NEW_LINE>checkValid();<NEW_LINE>LOG.assertTrue(!myShown);<NEW_LINE>myShown = true;<NEW_LINE>myStampShown = System.currentTimeMillis();<NEW_LINE>fireLookupShown();<NEW_LINE>if (ApplicationManager.getApplication().isHeadlessEnvironment())<NEW_LINE>return true;<NEW_LINE>if (!myEditor.getContentComponent().isShowing()) {<NEW_LINE>hideLookup(false);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>myAdComponent.showRandomText();<NEW_LINE>if (Boolean.TRUE.equals(myEditor.getUserData(AutoPopupController.NO_ADS))) {<NEW_LINE>myAdComponent.clearAdvertisements();<NEW_LINE>}<NEW_LINE>// , myProject);<NEW_LINE>myUi = new LookupUi(this, myAdComponent, myList);<NEW_LINE>myUi.setCalculating(myCalculating);<NEW_LINE>Point p = myUi.calculatePosition().getLocation();<NEW_LINE>if (ScreenReader.isActive()) {<NEW_LINE>myList.setFocusable(true);<NEW_LINE>setFocusRequestor(myList);<NEW_LINE>AnActionEvent actionEvent = AnActionEvent.createFromDataContext(ActionPlaces.EDITOR_POPUP, null, ((DesktopEditorImpl) myEditor).getDataContext());<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_BACKSPACE, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_ESCAPE, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_TAB, () -> new <MASK><NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_ENTER, /* e.g. rename popup comes initially unfocused */<NEW_LINE>() -> getLookupFocusDegree() == LookupFocusDegree.UNFOCUSED ? new NextVariableAction() : new ChooseItemAction.FocusedOnly(), actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_MOVE_CARET_UP, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_MOVE_CARET_RIGHT, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_EDITOR_MOVE_CARET_LEFT, null, actionEvent);<NEW_LINE>delegateActionToEditor(IdeActions.ACTION_RENAME, null, actionEvent);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>HintManagerImpl.getInstanceImpl().showEditorHint(this, myEditor, p, HintManager.HIDE_BY_ESCAPE | HintManager.UPDATE_BY_SCROLLING, 0, false, HintManagerImpl.createHintHint(myEditor, p, this, HintManager.UNDER).setRequestFocus(ScreenReader.isActive()).setAwtTooltip(false));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e);<NEW_LINE>}<NEW_LINE>if (!isVisible() || !myList.isShowing()) {<NEW_LINE>hideLookup(false);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
ChooseItemAction.Replacing(), actionEvent);
852,843
private void renderTitleBarButton(MatrixStack matrixStack, int x1, int y1, int x2, int y2, boolean hovering) {<NEW_LINE>int x3 = x2 + 2;<NEW_LINE>Matrix4f matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>RenderSystem.setShader(GameRenderer::getPositionShader);<NEW_LINE>// button background<NEW_LINE>RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hovering ? opacity * 1.5F : opacity);<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, x1, y1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x1, y2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x2, y2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x2, y1, 0).next();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>// background between buttons<NEW_LINE>RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], opacity);<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, x2, y1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x2, y2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x3, y2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x3, <MASK><NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>// button outline<NEW_LINE>RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F);<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, x1, y1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x1, y2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x2, y2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x2, y1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x1, y1, 0).next();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>}
y1, 0).next();
1,095,067
static void vp8_dequant_idct_add_core(final int imax, final int jmax, PositionableIntArrPointer eobs, FullAccessIntArrPointer q, ReadOnlyIntArrPointer dq, FullAccessIntArrPointer dst, int stride) {<NEW_LINE>final int dstinc = (stride - jmax) << 2;<NEW_LINE>for (int i = 0; i < imax; ++i) {<NEW_LINE>for (int j = 0; j < jmax; ++j) {<NEW_LINE>if (eobs.get() > 1) {<NEW_LINE>Dequantize.vp8_dequant_idct_add(q, dq, dst, stride);<NEW_LINE>} else {<NEW_LINE>IDCTllm.vp8_dc_only_idct_add(q.get() * dq.get(), dst, stride, dst, stride);<NEW_LINE>q.memset(0<MASK><NEW_LINE>}<NEW_LINE>eobs.inc();<NEW_LINE>q.incBy(16);<NEW_LINE>dst.incBy(4);<NEW_LINE>}<NEW_LINE>dst.incBy(dstinc);<NEW_LINE>}<NEW_LINE>}
, (short) 0, 2);
1,619,389
private void processStatus() {<NEW_LINE>int count = 0;<NEW_LINE>// Requests with status with after timeout<NEW_LINE>String sql = "SELECT * FROM R_Request r WHERE EXISTS (" + "SELECT * FROM R_Status s " + "WHERE r.R_Status_ID=s.R_Status_ID" + " AND s.TimeoutDays > 0 AND s.Next_Status_ID > 0" + " AND r.DateLastAction+s.TimeoutDays < now()" + ") " + "ORDER BY R_Status_ID";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>MStatus status = null;<NEW_LINE>MStatus next = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>MRequest r = new MRequest(getCtx(), rs, null);<NEW_LINE>// Get/Check Status<NEW_LINE>if (status == null || status.getR_Status_ID() != r.getR_Status_ID()) {<NEW_LINE>status = MStatus.get(getCtx(), r.getR_Status_ID());<NEW_LINE>}<NEW_LINE>if (status.getTimeoutDays() <= 0 || status.getNext_Status_ID() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Next Status<NEW_LINE>if (next == null || next.getR_Status_ID() != status.getNext_Status_ID()) {<NEW_LINE>next = MStatus.get(getCtx(<MASK><NEW_LINE>}<NEW_LINE>//<NEW_LINE>String result = Msg.getMsg(getCtx(), "RequestStatusTimeout") + ": " + status.getName() + " -> " + next.getName();<NEW_LINE>r.setResult(result);<NEW_LINE>r.setR_Status_ID(status.getNext_Status_ID());<NEW_LINE>if (r.save()) {<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(pstmt);<NEW_LINE>}<NEW_LINE>m_summary.append("Status Timeout #").append(count).append(" - ");<NEW_LINE>}
), status.getNext_Status_ID());
584,245
public // JMSTimeStamp<NEW_LINE>void testJMSTimestamp_B_SecOff(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>boolean testFailed = false;<NEW_LINE>String msgText = "Hello this is a test case for TextMessage ";<NEW_LINE>JMSContext jmsContext = jmsQCFBindings.createContext();<NEW_LINE>emptyQueue(jmsQCFBindings, queue);<NEW_LINE>Message msg0 = jmsContext.createMessage();<NEW_LINE>TextMessage <MASK><NEW_LINE>msg1.setJMSTimestamp(1234567);<NEW_LINE>long beforeSend = System.currentTimeMillis();<NEW_LINE>JMSProducer jmsProducer = jmsContext.createProducer();<NEW_LINE>jmsProducer.send(queue, msg1);<NEW_LINE>long afterSend = System.currentTimeMillis();<NEW_LINE>JMSConsumer jmsConsumer = jmsContext.createConsumer(queue);<NEW_LINE>long timestamp0 = jmsConsumer.receive(30000).getJMSTimestamp();<NEW_LINE>if ((timestamp0 < beforeSend) || (timestamp0 > afterSend) || (timestamp0 == 1234567)) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>jmsProducer.setDisableMessageTimestamp(true);<NEW_LINE>jmsProducer.send(queue, msg1);<NEW_LINE>long timestamp1 = jmsConsumer.receive(30000).getJMSTimestamp();<NEW_LINE>if (timestamp1 != 0) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>jmsConsumer.close();<NEW_LINE>jmsContext.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testJMSTimestamp_B_SecOff failed");<NEW_LINE>}<NEW_LINE>}
msg1 = jmsContext.createTextMessage(msgText);
1,093,725
public void tick() {<NEW_LINE>if (gatesChanged) {<NEW_LINE>wireSystems.keySet().stream().filter(wireSystem -> {<NEW_LINE>boolean newPowered = wireSystem.update(this);<NEW_LINE>return wireSystems.<MASK><NEW_LINE>}).forEach(changedSystems::add);<NEW_LINE>}<NEW_LINE>world.getPlayers(EntityPlayerMP.class, Predicates.alwaysTrue()).forEach(player -> {<NEW_LINE>Map<Integer, WireSystem> changedWires = this.wireSystems.keySet().stream().filter(wireSystem -> wireSystem.isPlayerWatching(player) && (structureChanged || changedPlayers.contains(player))).collect(Collectors.toMap(WireSystem::getWiresHashCode, Function.identity()));<NEW_LINE>if (!changedWires.isEmpty()) {<NEW_LINE>MessageManager.sendTo(new MessageWireSystems(changedWires), player);<NEW_LINE>}<NEW_LINE>Map<Integer, Boolean> hashesPowered = this.wireSystems.entrySet().stream().filter(systemPower -> systemPower.getKey().isPlayerWatching(player) && (structureChanged || changedSystems.contains(systemPower.getKey()) || changedPlayers.contains(player))).map(systemPowered -> Pair.of(systemPowered.getKey().getWiresHashCode(), systemPowered.getValue())).collect(Collectors.toMap(Pair::getLeft, Pair::getRight));<NEW_LINE>if (!hashesPowered.isEmpty()) {<NEW_LINE>MessageManager.sendTo(new MessageWireSystemsPowered(hashesPowered), player);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (structureChanged || !changedSystems.isEmpty()) {<NEW_LINE>markDirty();<NEW_LINE>}<NEW_LINE>structureChanged = false;<NEW_LINE>changedSystems.clear();<NEW_LINE>changedPlayers.clear();<NEW_LINE>}
put(wireSystem, newPowered) != newPowered;
818,052
public static DescribeAvailableResourceInfoResponse unmarshall(DescribeAvailableResourceInfoResponse describeAvailableResourceInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeAvailableResourceInfoResponse.setRequestId(_ctx.stringValue("DescribeAvailableResourceInfoResponse.RequestId"));<NEW_LINE>List<Image> images = new ArrayList<Image>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.Images.Length"); i++) {<NEW_LINE>Image image = new Image();<NEW_LINE>image.setImageSize(_ctx.integerValue("DescribeAvailableResourceInfoResponse.Images[" + i + "].ImageSize"));<NEW_LINE>image.setImageName(_ctx.stringValue("DescribeAvailableResourceInfoResponse.Images[" + i + "].ImageName"));<NEW_LINE>image.setImageId(_ctx.stringValue("DescribeAvailableResourceInfoResponse.Images[" + i + "].ImageId"));<NEW_LINE>images.add(image);<NEW_LINE>}<NEW_LINE>describeAvailableResourceInfoResponse.setImages(images);<NEW_LINE>List<SupportResource> supportResources = new ArrayList<SupportResource>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.SupportResources.Length"); i++) {<NEW_LINE>SupportResource supportResource = new SupportResource();<NEW_LINE>supportResource.setDataDiskMaxSize(_ctx.integerValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].DataDiskMaxSize"));<NEW_LINE>supportResource.setSystemDiskMinSize(_ctx.integerValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].SystemDiskMinSize"));<NEW_LINE>supportResource.setSystemDiskMaxSize(_ctx.integerValue<MASK><NEW_LINE>supportResource.setDataDiskMinSize(_ctx.integerValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].DataDiskMinSize"));<NEW_LINE>List<String> bandwidthTypes = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].BandwidthTypes.Length"); j++) {<NEW_LINE>bandwidthTypes.add(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].BandwidthTypes[" + j + "]"));<NEW_LINE>}<NEW_LINE>supportResource.setBandwidthTypes(bandwidthTypes);<NEW_LINE>List<String> ensRegionIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].EnsRegionIds.Length"); j++) {<NEW_LINE>ensRegionIds.add(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].EnsRegionIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>supportResource.setEnsRegionIds(ensRegionIds);<NEW_LINE>List<String> instanceSpeces = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].InstanceSpeces.Length"); j++) {<NEW_LINE>instanceSpeces.add(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].InstanceSpeces[" + j + "]"));<NEW_LINE>}<NEW_LINE>supportResource.setInstanceSpeces(instanceSpeces);<NEW_LINE>List<EnsRegionId> ensRegionIdsExtends = new ArrayList<EnsRegionId>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].EnsRegionIdsExtends.Length"); j++) {<NEW_LINE>EnsRegionId ensRegionId = new EnsRegionId();<NEW_LINE>ensRegionId.setEnsRegionId(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].EnsRegionIdsExtends[" + j + "].EnsRegionId"));<NEW_LINE>ensRegionId.setEnName(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].EnsRegionIdsExtends[" + j + "].EnName"));<NEW_LINE>ensRegionId.setArea(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].EnsRegionIdsExtends[" + j + "].Area"));<NEW_LINE>ensRegionId.setName(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].EnsRegionIdsExtends[" + j + "].Name"));<NEW_LINE>ensRegionId.setProvince(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].EnsRegionIdsExtends[" + j + "].Province"));<NEW_LINE>ensRegionIdsExtends.add(ensRegionId);<NEW_LINE>}<NEW_LINE>supportResource.setEnsRegionIdsExtends(ensRegionIdsExtends);<NEW_LINE>supportResources.add(supportResource);<NEW_LINE>}<NEW_LINE>describeAvailableResourceInfoResponse.setSupportResources(supportResources);<NEW_LINE>return describeAvailableResourceInfoResponse;<NEW_LINE>}
("DescribeAvailableResourceInfoResponse.SupportResources[" + i + "].SystemDiskMaxSize"));
1,533,775
public synchronized void stop() throws IOException, InterruptedException {<NEW_LINE>if (executor == null) {<NEW_LINE>// keep repeated calls to stop() from failing<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MiniAccumuloClusterControl control = getClusterControl();<NEW_LINE>control.<MASK><NEW_LINE>control.stop(ServerType.MANAGER, null);<NEW_LINE>control.stop(ServerType.TABLET_SERVER, null);<NEW_LINE>control.stop(ServerType.ZOOKEEPER, null);<NEW_LINE>// ACCUMULO-2985 stop the ExecutorService after we finished using it to stop accumulo procs<NEW_LINE>if (executor != null) {<NEW_LINE>List<Runnable> tasksRemaining = executor.shutdownNow();<NEW_LINE>// the single thread executor shouldn't have any pending tasks, but check anyways<NEW_LINE>if (!tasksRemaining.isEmpty()) {<NEW_LINE>log.warn("Unexpectedly had {} task(s) remaining in threadpool for execution when being stopped", tasksRemaining.size());<NEW_LINE>}<NEW_LINE>executor = null;<NEW_LINE>}<NEW_LINE>if (config.useMiniDFS() && miniDFS != null) {<NEW_LINE>miniDFS.shutdown();<NEW_LINE>}<NEW_LINE>for (Process p : cleanup) {<NEW_LINE>p.destroy();<NEW_LINE>p.waitFor();<NEW_LINE>}<NEW_LINE>miniDFS = null;<NEW_LINE>}
stop(ServerType.GARBAGE_COLLECTOR, null);
1,305,326
protected void initForm() {<NEW_LINE>this.setHeight("100%");<NEW_LINE>Borderlayout layout = new Borderlayout();<NEW_LINE>layout.setStyle("width: 100%; height: 100%; position: absolute;");<NEW_LINE>appendChild(layout);<NEW_LINE>String sql = // all<NEW_LINE>MRole.getDefault().// all<NEW_LINE>addAccessSQL(// all<NEW_LINE>"SELECT AD_Workflow_ID, Name FROM AD_Workflow WHERE " + WF_WhereClause + " ORDER BY 2", // all<NEW_LINE>"AD_Workflow", // all<NEW_LINE>MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);<NEW_LINE>KeyNamePair[] pp = <MASK><NEW_LINE>workflowList = ListboxFactory.newDropdownListbox();<NEW_LINE>for (KeyNamePair knp : pp) {<NEW_LINE>workflowList.addItem(knp);<NEW_LINE>}<NEW_LINE>workflowList.addEventListener(Events.ON_SELECT, this);<NEW_LINE>North north = new North();<NEW_LINE>layout.appendChild(north);<NEW_LINE>north.appendChild(workflowList);<NEW_LINE>workflowList.setStyle("margin-left: 10px; margin-top: 5px;");<NEW_LINE>north.setHeight("30px");<NEW_LINE>imageMap = new Imagemap();<NEW_LINE>Center center = new Center();<NEW_LINE>layout.appendChild(center);<NEW_LINE>center.setAutoscroll(true);<NEW_LINE>// center.setFlex(true);<NEW_LINE>center.appendChild(imageMap);<NEW_LINE>ConfirmPanel confirmPanel = new ConfirmPanel(true);<NEW_LINE>confirmPanel.addActionListener(this);<NEW_LINE>South south = new South();<NEW_LINE>layout.appendChild(south);<NEW_LINE>south.appendChild(confirmPanel);<NEW_LINE>south.setHeight("36px");<NEW_LINE>}
DB.getKeyNamePairs(sql, true);
647,863
final DeleteFirewallManagerRuleGroupsResult executeDeleteFirewallManagerRuleGroups(DeleteFirewallManagerRuleGroupsRequest deleteFirewallManagerRuleGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteFirewallManagerRuleGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteFirewallManagerRuleGroupsRequest> request = null;<NEW_LINE>Response<DeleteFirewallManagerRuleGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteFirewallManagerRuleGroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteFirewallManagerRuleGroupsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAFV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteFirewallManagerRuleGroups");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteFirewallManagerRuleGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteFirewallManagerRuleGroupsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,744,494
public JobInvocation.Builder decode(@NonNull Bundle providedBundle) {<NEW_LINE>if (providedBundle == null) {<NEW_LINE>throw new IllegalArgumentException("Unexpected null Bundle provided");<NEW_LINE>}<NEW_LINE>// Copy to prevent modification<NEW_LINE>Bundle data = new Bundle(providedBundle);<NEW_LINE>boolean recur = data.getBoolean(prefix + BundleProtocol.PACKED_PARAM_RECURRING);<NEW_LINE>boolean replaceCur = data.getBoolean(prefix + BundleProtocol.PACKED_PARAM_REPLACE_CURRENT);<NEW_LINE>int lifetime = data.<MASK><NEW_LINE>int[] constraints = uncompact(data.getInt(prefix + BundleProtocol.PACKED_PARAM_CONSTRAINTS));<NEW_LINE>JobTrigger trigger = decodeTrigger(data);<NEW_LINE>RetryStrategy retryStrategy = decodeRetryStrategy(data);<NEW_LINE>String tag = data.getString(prefix + BundleProtocol.PACKED_PARAM_TAG);<NEW_LINE>String service = data.getString(prefix + BundleProtocol.PACKED_PARAM_SERVICE);<NEW_LINE>if (tag == null || service == null || trigger == null || retryStrategy == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>JobInvocation.Builder builder = new JobInvocation.Builder();<NEW_LINE>builder.setTag(tag);<NEW_LINE>builder.setService(service);<NEW_LINE>builder.setTrigger(trigger);<NEW_LINE>builder.setRetryStrategy(retryStrategy);<NEW_LINE>builder.setRecurring(recur);<NEW_LINE>// noinspection WrongConstant<NEW_LINE>builder.setLifetime(lifetime);<NEW_LINE>// noinspection WrongConstant<NEW_LINE>builder.setConstraints(constraints);<NEW_LINE>builder.setReplaceCurrent(replaceCur);<NEW_LINE>// remove any prefixed keys<NEW_LINE>if (!TextUtils.isEmpty(prefix)) {<NEW_LINE>Iterator<String> keyIterator = data.keySet().iterator();<NEW_LINE>while (keyIterator.hasNext()) {<NEW_LINE>String key = keyIterator.next();<NEW_LINE>if (key.startsWith(prefix)) {<NEW_LINE>keyIterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Assume anything that wasn't prefixed is a user-supplied extra<NEW_LINE>builder.addExtras(data);<NEW_LINE>return builder;<NEW_LINE>}
getInt(prefix + BundleProtocol.PACKED_PARAM_LIFETIME);
246,587
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>TranslationHelpers.checkTranslationArguments(<MASK><NEW_LINE>final IOperandTreeNode targetRegister = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode sourceRegister = instruction.getOperands().get(1).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode shiftRegister = instruction.getOperands().get(2).getRootNode().getChildren().get(0);<NEW_LINE>Long baseOffset = instruction.getAddress().toLong() * 0x100;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>final String shiftAmmount = environment.getNextVariableString();<NEW_LINE>final String oneComp = environment.getNextVariableString();<NEW_LINE>final String twoComp = environment.getNextVariableString();<NEW_LINE>// n <- rB[26-31]<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, dw, shiftRegister.getValue(), dw, String.valueOf(0x3FL), dw, shiftAmmount));<NEW_LINE>// computer two's complement for shift amount == - (original value)<NEW_LINE>instructions.add(ReilHelpers.createXor(baseOffset++, dw, shiftRegister.getValue(), dw, String.valueOf(0xFFFFFFFFL), dw, oneComp));<NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset++, dw, oneComp, dw, String.valueOf(1L), dw, twoComp));<NEW_LINE>// x >> n<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, sourceRegister.getValue(), dw, twoComp, dw, targetRegister.getValue()));<NEW_LINE>}
environment, instruction, instructions, "srw");
178,033
private <T extends Trait> void addOperationSecurity(Context<T> context, OperationObject.Builder builder, OperationShape shape, OpenApiMapper plugin) {<NEW_LINE><MASK><NEW_LINE>ServiceIndex serviceIndex = ServiceIndex.of(context.getModel());<NEW_LINE>Map<ShapeId, Trait> serviceSchemes = serviceIndex.getEffectiveAuthSchemes(service);<NEW_LINE>Map<ShapeId, Trait> operationSchemes = serviceIndex.getEffectiveAuthSchemes(service, shape);<NEW_LINE>// If the operation explicitly removes authentication, ensure that "security" is set to an empty<NEW_LINE>// list as opposed to simply being unset as unset will result in the operation inheriting global<NEW_LINE>// configuration.<NEW_LINE>if (shape.getTrait(AuthTrait.class).map(trait -> trait.getValueSet().isEmpty()).orElse(false)) {<NEW_LINE>builder.security(Collections.emptyList());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Add a security requirement for the operation if it differs from the service.<NEW_LINE>if (!operationSchemes.equals(serviceSchemes)) {<NEW_LINE>Collection<Class<? extends Trait>> authSchemeClasses = getTraitMapTypes(operationSchemes);<NEW_LINE>// Find all the converters with matching types of auth traits on the service.<NEW_LINE>Collection<SecuritySchemeConverter<? extends Trait>> converters = findMatchingConverters(context, authSchemeClasses);<NEW_LINE>for (SecuritySchemeConverter<? extends Trait> converter : converters) {<NEW_LINE>List<String> result = createSecurityRequirements(context, converter, service);<NEW_LINE>String openApiAuthName = converter.getOpenApiAuthSchemeName();<NEW_LINE>Map<String, List<String>> authMap = MapUtils.of(openApiAuthName, result);<NEW_LINE>Map<String, List<String>> requirement = plugin.updateSecurity(context, shape, converter, authMap);<NEW_LINE>if (requirement != null) {<NEW_LINE>builder.addSecurity(requirement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ServiceShape service = context.getService();
1,555,702
public void run() {<NEW_LINE>resultStatus = ExecutionStatus.RUNNING;<NEW_LINE>currentResultStatus = ExecutionStatus.RUNNING;<NEW_LINE>try {<NEW_LINE>// 1. init amClient<NEW_LINE>initAMClient();<NEW_LINE>checkEnd();<NEW_LINE>LOG.info("init amClient.");<NEW_LINE>// 2. get version from master<NEW_LINE>getCurrentJobVersion();<NEW_LINE>checkEnd();<NEW_LINE>LOG.info("get current job version.");<NEW_LINE>getTaskIndex();<NEW_LINE>LOG.info("get task index.");<NEW_LINE>// 3. register to master<NEW_LINE>registerNode();<NEW_LINE>checkEnd();<NEW_LINE>LOG.info("register node to application master.");<NEW_LINE>// 4. start heart beat<NEW_LINE>startHeartBeat();<NEW_LINE>LOG.info("start heart beat thread.");<NEW_LINE>// 5. wait for cluster running<NEW_LINE>waitClusterRunning();<NEW_LINE>LOG.info("wait for cluster to running status.");<NEW_LINE>// 6. get cluster<NEW_LINE>getClusterInfo();<NEW_LINE>Preconditions.checkNotNull(mlClusterDef, "Cannot get cluster def from AM");<NEW_LINE>checkEnd();<NEW_LINE>LOG.info("get cluster info.");<NEW_LINE>// 7. set machine learning context<NEW_LINE>resetMLContext();<NEW_LINE>checkEnd();<NEW_LINE>LOG.info("reset machine learning context.");<NEW_LINE>// 8. run python script<NEW_LINE>runScript();<NEW_LINE>checkEnd();<NEW_LINE>LOG.info("run script.");<NEW_LINE>currentResultStatus = ExecutionStatus.SUCCEED;<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (e instanceof FlinkKillException || e instanceof InterruptedException) {<NEW_LINE>LOG.info("{} killed by flink.", mlContext.getIdentity());<NEW_LINE>currentResultStatus = ExecutionStatus.KILLED_BY_FLINK;<NEW_LINE>} else {<NEW_LINE>// no one ask for this thread to stop, thus there must be some error occurs<NEW_LINE><MASK><NEW_LINE>mlContext.addFailNum();<NEW_LINE>currentResultStatus = ExecutionStatus.FAILED;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stopExecution(currentResultStatus == ExecutionStatus.SUCCEED);<NEW_LINE>// set resultStatus value after node notified to am.<NEW_LINE>resultStatus = currentResultStatus;<NEW_LINE>}<NEW_LINE>}
LOG.error("Got exception during python running", e);
398,832
public Segment createNonTerminalSegment(NonTerminalNode node) {<NEW_LINE>NodeFactoryMethodReference method = getNonTerminalNodeProcessMethod(node);<NEW_LINE>NodeFactorySegment root = method.toSegment();<NEW_LINE>// Get all the possible child names for the current node type<NEW_LINE>List<String> parameterName = childNamesCache.getChildNames(node.getClass().getSimpleName());<NEW_LINE>if (method.requiresSyntaxKind()) {<NEW_LINE>root.addParameter(SegmentFactory.createSyntaxKindSegment(node.kind()));<NEW_LINE>}<NEW_LINE>List<ChildNodeEntry> childNodeEntries = new ArrayList<>(node.childEntries());<NEW_LINE>// Current processing childNodeEntry<NEW_LINE>int childNodeEntriesIndex = 0;<NEW_LINE>for (int i = 0; i < parameterName.size(); i++) {<NEW_LINE>String childName = parameterName.get(i);<NEW_LINE>if (childNodeEntriesIndex < childNodeEntries.size()) {<NEW_LINE>ChildNodeEntry childNodeEntry = childNodeEntries.get(childNodeEntriesIndex);<NEW_LINE>if (childNodeEntry.name().equals(childName)) {<NEW_LINE>childNodeEntriesIndex++;<NEW_LINE>root.addParameter(createNodeOrNodeListSegment<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Not processed<NEW_LINE>root.addParameter(SegmentFactory.createNullSegment());<NEW_LINE>}<NEW_LINE>return root;<NEW_LINE>}
(childNodeEntry, method, i));
243,391
public void doAction() {<NEW_LINE>// get entity list<NEW_LINE>HashSet<Entity> entities = (HashSet<Entity>) sandbox.getSelector().getSelectedItems();<NEW_LINE>UILayerBoxMediator layerBoxMediator = facade.retrieveMediator(UILayerBoxMediator.NAME);<NEW_LINE>if (layersBackup == null) {<NEW_LINE>// backup layer data<NEW_LINE>layersBackup = new HashMap<>();<NEW_LINE>for (Entity entity : entities) {<NEW_LINE>ZIndexComponent zIndexComponent = ComponentRetriever.get(entity, ZIndexComponent.class);<NEW_LINE>int tmpId = EntityUtils.getEntityId(entity);<NEW_LINE>layersBackup.put(tmpId, zIndexComponent.layerName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// what will be the position of new composite?<NEW_LINE>Vector2 position = EntityUtils.getLeftBottomPoint(entities);<NEW_LINE>// create new entity<NEW_LINE>Entity entity = ItemFactory.get().createCompositeItem(position);<NEW_LINE>entityId = EntityUtils.getEntityId(entity);<NEW_LINE>sandbox.getEngine().addEntity(entity);<NEW_LINE>// what was the parent component of entities<NEW_LINE>parentEntityId = EntityUtils.getEntityId(sandbox.getCurrentViewingEntity());<NEW_LINE>// rebase children<NEW_LINE><MASK><NEW_LINE>// reposition children<NEW_LINE>for (Entity childEntity : entities) {<NEW_LINE>TransformComponent transformComponent = ComponentRetriever.get(childEntity, TransformComponent.class);<NEW_LINE>transformComponent.x -= position.x;<NEW_LINE>transformComponent.y -= position.y;<NEW_LINE>// put it on default layer<NEW_LINE>ZIndexComponent zIndexComponent = ComponentRetriever.get(childEntity, ZIndexComponent.class);<NEW_LINE>zIndexComponent.layerName = "Default";<NEW_LINE>}<NEW_LINE>// recalculate composite size<NEW_LINE>DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class);<NEW_LINE>Vector2 newSize = EntityUtils.getRightTopPoint(entities);<NEW_LINE>dimensionsComponent.width = newSize.x;<NEW_LINE>dimensionsComponent.height = newSize.y;<NEW_LINE>dimensionsComponent.boundBox.set(0, 0, newSize.x, newSize.y);<NEW_LINE>ZIndexComponent zIndexComponent = ComponentRetriever.get(entity, ZIndexComponent.class);<NEW_LINE>zIndexComponent.layerName = layerBoxMediator.getCurrentSelectedLayerName();<NEW_LINE>// let everyone know<NEW_LINE>Overlap2DFacade.getInstance().sendNotification(DONE);<NEW_LINE>Overlap2DFacade.getInstance().sendNotification(MsgAPI.NEW_ITEM_ADDED, entity);<NEW_LINE>sandbox.getSelector().setSelection(entity, true);<NEW_LINE>}
EntityUtils.changeParent(entities, entity);
1,229,483
public void contextInitialized(ServletContextEvent sce) {<NEW_LINE>WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();<NEW_LINE>ComponentEnvManager compEnvManager = wscImpl.getComponentEnvManager();<NEW_LINE><MASK><NEW_LINE>WebBundleDescriptor webBundle = null;<NEW_LINE>if (jndiNameEnv != null && jndiNameEnv instanceof BundleDescriptor && ((BundleDescriptor) jndiNameEnv).getModuleType().equals(DOLUtils.warType())) {<NEW_LINE>webBundle = ((WebBundleDescriptor) jndiNameEnv);<NEW_LINE>} else {<NEW_LINE>throw new WebServiceException("Cannot intialize the JAXWSServlet for " + jndiNameEnv);<NEW_LINE>}<NEW_LINE>contextRoot = webBundle.getContextRoot();<NEW_LINE>WebServicesDescriptor webServices = webBundle.getWebServices();<NEW_LINE>try {<NEW_LINE>for (WebServiceEndpoint endpoint : webServices.getEndpoints()) {<NEW_LINE>registerEndpoint(endpoint, sce.getServletContext());<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// TODO Fix Rama<NEW_LINE>logger.log(Level.WARNING, LogUtils.DEPLOYMENT_FAILED, t);<NEW_LINE>sce.getServletContext().removeAttribute("ADAPTER_LIST");<NEW_LINE>throw new RuntimeException("Servlet web service endpoint '" + "' failure", t);<NEW_LINE>}<NEW_LINE>}
JndiNameEnvironment jndiNameEnv = compEnvManager.getCurrentJndiNameEnvironment();
1,387,671
public Type struct(Types.StructType struct, List<Type> fieldResults) {<NEW_LINE>List<Types.NestedField<MASK><NEW_LINE>List<Types.NestedField> selectedFields = Lists.newArrayListWithExpectedSize(fields.size());<NEW_LINE>boolean sameTypes = true;<NEW_LINE>for (int i = 0; i < fieldResults.size(); i += 1) {<NEW_LINE>Types.NestedField field = fields.get(i);<NEW_LINE>Type projectedType = fieldResults.get(i);<NEW_LINE>if (field.type() == projectedType) {<NEW_LINE>// uses identity because there is no need to check structure. if identity doesn't match<NEW_LINE>// then structure should not either.<NEW_LINE>selectedFields.add(field);<NEW_LINE>} else if (projectedType != null) {<NEW_LINE>// signal that some types were altered<NEW_LINE>sameTypes = false;<NEW_LINE>if (field.isOptional()) {<NEW_LINE>selectedFields.add(Types.NestedField.optional(field.fieldId(), field.name(), projectedType, field.doc()));<NEW_LINE>} else {<NEW_LINE>selectedFields.add(Types.NestedField.required(field.fieldId(), field.name(), projectedType, field.doc()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!selectedFields.isEmpty()) {<NEW_LINE>if (selectedFields.size() == fields.size() && sameTypes) {<NEW_LINE>return struct;<NEW_LINE>} else {<NEW_LINE>return Types.StructType.of(selectedFields);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
> fields = struct.fields();
1,771,048
public static AnnotatedType completeGenerics(AnnotatedType type, AnnotatedType replacement) {<NEW_LINE>if (type.getType() instanceof Class) {<NEW_LINE>Class clazz = (Class) type.getType();<NEW_LINE>if (clazz.isArray()) {<NEW_LINE>return TypeFactory.arrayOf(completeGenerics(GenericTypeReflector.annotate(clazz.getComponentType()), replacement), type.getAnnotations());<NEW_LINE>} else {<NEW_LINE>if (isMissingTypeParameters(clazz)) {<NEW_LINE>if (replacement == null) {<NEW_LINE>throw TypeMappingException.ambiguousType(clazz);<NEW_LINE>}<NEW_LINE>AnnotatedType[] parameters = new AnnotatedType[clazz.getTypeParameters().length];<NEW_LINE>Arrays.fill(parameters, replacement);<NEW_LINE>return TypeFactory.parameterizedAnnotatedClass(clazz, type.getAnnotations(), parameters);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (type instanceof AnnotatedParameterizedType) {<NEW_LINE>AnnotatedParameterizedType parameterizedType = (AnnotatedParameterizedType) type;<NEW_LINE>AnnotatedType[] parameters = Arrays.stream(parameterizedType.getAnnotatedActualTypeArguments()).map(parameterType -> completeGenerics(parameterType, replacement)).toArray(AnnotatedType[]::new);<NEW_LINE>return GenericTypeReflector.replaceParameters(parameterizedType, parameters);<NEW_LINE>} else if (type instanceof AnnotatedArrayType) {<NEW_LINE>AnnotatedType componentType = completeGenerics(((AnnotatedArrayType) type<MASK><NEW_LINE>return TypeFactory.arrayOf(componentType, type.getAnnotations());<NEW_LINE>} else if (type instanceof AnnotatedWildcardType || type instanceof AnnotatedTypeVariable) {<NEW_LINE>// can only happen if bounds haven't been erased (via eraseBounds) prior to invoking this method<NEW_LINE>throw new TypeMappingException(type.getType().getTypeName() + " can not be completed. Call eraseBounds first?");<NEW_LINE>}<NEW_LINE>return type;<NEW_LINE>}
).getAnnotatedGenericComponentType(), replacement);
537,718
private PropertyNode createDefaultClassConstructor(int classLineNumber, long classToken, long lastToken, IdentNode className, boolean subclass) {<NEW_LINE>final int ctorFinish = finish;<NEW_LINE>final List<Statement> statements;<NEW_LINE>final List<IdentNode> parameters;<NEW_LINE>final long identToken = Token.recast(classToken, TokenType.IDENT);<NEW_LINE>if (subclass) {<NEW_LINE>IdentNode superIdent = createIdentNode(identToken, ctorFinish, SUPER.getName()).setIsDirectSuper();<NEW_LINE>IdentNode argsIdent = createIdentNode(identToken, ctorFinish, "args").setIsRestParameter();<NEW_LINE>Expression spreadArgs = new UnaryNode(Token.recast(classToken, TokenType.SPREAD_ARGUMENT), argsIdent);<NEW_LINE>CallNode superCall = new CallNode(classLineNumber, classToken, ctorFinish, superIdent, Collections<MASK><NEW_LINE>statements = Collections.singletonList(new ExpressionStatement(classLineNumber, classToken, ctorFinish, superCall));<NEW_LINE>parameters = Collections.singletonList(argsIdent);<NEW_LINE>} else {<NEW_LINE>statements = Collections.emptyList();<NEW_LINE>parameters = Collections.emptyList();<NEW_LINE>}<NEW_LINE>Block body = new Block(classToken, ctorFinish, Block.IS_BODY, statements);<NEW_LINE>IdentNode ctorName = className != null ? className : createIdentNode(identToken, ctorFinish, "constructor");<NEW_LINE>ParserContextFunctionNode function = createParserContextFunctionNode(ctorName, classToken, FunctionNode.Kind.NORMAL, classLineNumber, parameters);<NEW_LINE>function.setLastToken(lastToken);<NEW_LINE>function.setFlag(FunctionNode.IS_METHOD);<NEW_LINE>function.setFlag(FunctionNode.IS_CLASS_CONSTRUCTOR);<NEW_LINE>if (subclass) {<NEW_LINE>function.setFlag(FunctionNode.IS_SUBCLASS_CONSTRUCTOR);<NEW_LINE>function.setFlag(FunctionNode.HAS_DIRECT_SUPER);<NEW_LINE>}<NEW_LINE>if (className == null) {<NEW_LINE>function.setFlag(FunctionNode.IS_ANONYMOUS);<NEW_LINE>}<NEW_LINE>PropertyNode constructor = new PropertyNode(classToken, ctorFinish, ctorName, createFunctionNode(function, classToken, ctorName, parameters, FunctionNode.Kind.NORMAL, classLineNumber, body), null, null, false, false);<NEW_LINE>return constructor;<NEW_LINE>}
.singletonList(spreadArgs), false);
971,485
public void addMessage(String queue, Message message) {<NEW_LINE>try {<NEW_LINE>long startTime = Instant.now().toEpochMilli();<NEW_LINE>Map<String, Object> doc = new HashMap<>();<NEW_LINE>doc.put("messageId", message.getId());<NEW_LINE>doc.put("payload", message.getPayload());<NEW_LINE>doc.put("queue", queue);<NEW_LINE>doc.put("created", System.currentTimeMillis());<NEW_LINE>String docType = StringUtils.isBlank(docTypeOverride) ? MSG_DOC_TYPE : docTypeOverride;<NEW_LINE>indexObject(messageIndexName, docType, doc);<NEW_LINE>long endTime = Instant<MASK><NEW_LINE>LOGGER.debug("Time taken {} for indexing message: {}", endTime - startTime, message.getId());<NEW_LINE>Monitors.recordESIndexTime("add_message", MSG_DOC_TYPE, endTime - startTime);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Failed to index message: {}", message.getId(), e);<NEW_LINE>}<NEW_LINE>}
.now().toEpochMilli();
1,714,441
private void adjustViewPreferredSize(boolean onResize) {<NEW_LINE>JComponent <MASK><NEW_LINE>Dimension minimumSize = view.getMinimumSize();<NEW_LINE>Dimension preferredSize = null;<NEW_LINE>switch(scrollBarPolicy) {<NEW_LINE>case VERTICAL:<NEW_LINE>preferredSize = new Dimension(impl.getViewport().getWidth(), minimumSize.height);<NEW_LINE>break;<NEW_LINE>case HORIZONTAL:<NEW_LINE>preferredSize = new Dimension(minimumSize.width, impl.getViewport().getHeight());<NEW_LINE>break;<NEW_LINE>case NONE:<NEW_LINE>preferredSize = new Dimension(impl.getViewport().getWidth(), impl.getViewport().getHeight());<NEW_LINE>break;<NEW_LINE>case BOTH:<NEW_LINE>preferredSize = new Dimension(minimumSize.width, minimumSize.height);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>view.setPreferredSize(preferredSize);<NEW_LINE>if (onResize) {<NEW_LINE>ScrollBarPolicy scrollBarPolicy = getScrollBarPolicy();<NEW_LINE>if (scrollBarPolicy != ScrollBarPolicy.BOTH && preferredSize.width > 0 && preferredSize.height > 0) {<NEW_LINE>JViewport viewport = impl.getViewport();<NEW_LINE>if (viewport != null) {<NEW_LINE>// setting of the same preferred size has side-effects<NEW_LINE>if (!viewport.getViewSize().equals(preferredSize)) {<NEW_LINE>viewport.setViewSize(preferredSize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>requestRepaint();<NEW_LINE>}
view = DesktopComponentsHelper.getComposition(content);
1,524,990
public void compute(double[][] seasonMatrix, int sP, int sQ, int season) {<NEW_LINE>// step 1: find CSS result<NEW_LINE>SCSSEstimate scssEstimate = new SCSSEstimate();<NEW_LINE>scssEstimate.compute(seasonMatrix, sP, sQ, season);<NEW_LINE>ArrayList<double[]> initCoef = new ArrayList<>();<NEW_LINE>initCoef.add(scssEstimate.sARCoef);<NEW_LINE>initCoef.add(scssEstimate.sMACoef);<NEW_LINE>initCoef.add(new double[] { scssEstimate.variance });<NEW_LINE>// step 2: set residual[i]=0, if i<initPoint; set data[i]=0, if i<initPoint<NEW_LINE>double[] cResidual = new double[seasonMatrix[0].length];<NEW_LINE>SMLEGradientTarget smleGT = new SMLEGradientTarget();<NEW_LINE>smleGT.fit(<MASK><NEW_LINE>AbstractGradientTarget problem = BFGS.solve(smleGT, 1000, 0.01, 0.000001, new int[] { 1, 2, 3 }, -1);<NEW_LINE>this.sResidual = problem.getResidual();<NEW_LINE>this.logLikelihood = -problem.getMinValue();<NEW_LINE>DenseMatrix result = problem.getFinalCoef();<NEW_LINE>this.warn = problem.getWarn();<NEW_LINE>this.sARCoef = new double[sP];<NEW_LINE>this.sMACoef = new double[sQ];<NEW_LINE>for (int i = 0; i < sP; i++) {<NEW_LINE>this.sARCoef[i] = result.get(i, 0);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < sQ; i++) {<NEW_LINE>this.sMACoef[i] = result.get(i + sP, 0);<NEW_LINE>}<NEW_LINE>this.variance = result.get(sP + sQ, 0);<NEW_LINE>boolean gradientSuccess = Boolean.TRUE;<NEW_LINE>if (problem.getIter() < 2) {<NEW_LINE>gradientSuccess = Boolean.FALSE;<NEW_LINE>}<NEW_LINE>if (gradientSuccess) {<NEW_LINE>DenseMatrix information = problem.getH();<NEW_LINE>this.sArStdError = new double[sP];<NEW_LINE>this.sMaStdError = new double[sQ];<NEW_LINE>for (int i = 0; i < sP; i++) {<NEW_LINE>this.sArStdError[i] = Math.sqrt(information.get(i, i));<NEW_LINE>if (Double.isNaN(this.sArStdError[i])) {<NEW_LINE>this.sArStdError[i] = -99;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < sQ; i++) {<NEW_LINE>this.sMaStdError[i] = Math.sqrt(information.get(i + sP, i + sP));<NEW_LINE>if (Double.isNaN(this.sMaStdError[i])) {<NEW_LINE>this.sMaStdError[i] = -99;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.varianceStdError = Math.sqrt(information.get(sP + sQ, sP + sQ));<NEW_LINE>if (Double.isNaN(this.varianceStdError)) {<NEW_LINE>this.varianceStdError = -99;<NEW_LINE>} else {<NEW_LINE>this.sArStdError = scssEstimate.sArStdError;<NEW_LINE>this.sMaStdError = scssEstimate.sMaStdError;<NEW_LINE>this.varianceStdError = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
seasonMatrix, cResidual, initCoef, season);
591,405
private String certChainMessage(final X509Certificate[] chain, CertificateException cause) {<NEW_LINE>Throwable e = cause;<NEW_LINE>LOGGER.log(<MASK><NEW_LINE>final StringBuffer si = new StringBuffer();<NEW_LINE>if (e.getCause() != null) {<NEW_LINE>e = e.getCause();<NEW_LINE>// HACK: there is no sane way to check if the error is a "trust anchor<NEW_LINE>// not found", so we use string comparison.<NEW_LINE>if (NO_TRUST_ANCHOR.equals(e.getMessage())) {<NEW_LINE>si.append(master.getString(R.string.mtm_trust_anchor));<NEW_LINE>} else<NEW_LINE>si.append(e.getLocalizedMessage());<NEW_LINE>si.append("\n");<NEW_LINE>}<NEW_LINE>si.append("\n");<NEW_LINE>si.append(master.getString(R.string.mtm_connect_anyway));<NEW_LINE>si.append("\n\n");<NEW_LINE>si.append(master.getString(R.string.mtm_cert_details));<NEW_LINE>si.append('\n');<NEW_LINE>for (int i = 0; i < chain.length; ++i) {<NEW_LINE>certDetails(si, chain[i], i == 0);<NEW_LINE>}<NEW_LINE>return si.toString();<NEW_LINE>}
Level.FINE, "certChainMessage for " + e);
505,492
private void reloadBean(List<Command> mergedCommands, Map<String, String> oldFullSignatures, Map<String, String> oldSignatures) {<NEW_LINE>if (isDeleteEvent(mergedCommands)) {<NEW_LINE>LOGGER.trace("Skip WELD refresh bean class for delete event on class '{}'", className);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (className != null) {<NEW_LINE>try {<NEW_LINE>LOGGER.debug("Executing BeanClassRefreshAgent.reloadBean('{}')", className);<NEW_LINE>Class<?> bdaAgentClazz = Class.forName(BeanClassRefreshAgent.class.getName(), true, classLoader);<NEW_LINE>Method refreshBean = bdaAgentClazz.getDeclaredMethod("reloadBean", new Class[] { ClassLoader.class, String.class, String.class, Map.class, Map.class, String.class });<NEW_LINE>// passed as String since BeanClassRefreshAgent has different classloader<NEW_LINE>refreshBean.// passed as String since BeanClassRefreshAgent has different classloader<NEW_LINE>invoke(// passed as String since BeanClassRefreshAgent has different classloader<NEW_LINE>null, // passed as String since BeanClassRefreshAgent has different classloader<NEW_LINE>classLoader, // passed as String since BeanClassRefreshAgent has different classloader<NEW_LINE>archivePath, // passed as String since BeanClassRefreshAgent has different classloader<NEW_LINE>className, // passed as String since BeanClassRefreshAgent has different classloader<NEW_LINE>oldFullSignatures, // passed as String since BeanClassRefreshAgent has different classloader<NEW_LINE>oldSignatures, strBeanReloadStrategy);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new IllegalStateException("Plugin error, method not found", e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>LOGGER.error("Error reloadBean class '{}' in classLoader '{}'", e, className, classLoader);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE><MASK><NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new IllegalStateException("Plugin error, CDI class not found in classloader", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
throw new IllegalStateException("Plugin error, illegal access", e);
258,527
static Options parse(String[] args) throws ReflectiveOperationException {<NEW_LINE>Options options = new Options();<NEW_LINE>int index = 0;<NEW_LINE>while (index < args.length) {<NEW_LINE>if (!args[index].startsWith("-")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (args[index] == "--") {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(args[index]) {<NEW_LINE>case "-merge-policy":<NEW_LINE><MASK><NEW_LINE>Class<? extends MergePolicy> clazz = Class.forName(clazzName).asSubclass(MergePolicy.class);<NEW_LINE>options.config.setMergePolicy(clazz.getConstructor().newInstance());<NEW_LINE>break;<NEW_LINE>case "-max-segments":<NEW_LINE>options.maxSegments = Integer.parseInt(args[++index]);<NEW_LINE>break;<NEW_LINE>case "-verbose":<NEW_LINE>options.config.setInfoStream(System.err);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("unrecognized option: '" + args[index] + "'\n" + USAGE);<NEW_LINE>}<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>// process any remaining arguments as the target and source index paths.<NEW_LINE>int numPaths = args.length - index;<NEW_LINE>if (numPaths < 3) {<NEW_LINE>throw new IllegalArgumentException("not enough parameters.\n" + USAGE);<NEW_LINE>}<NEW_LINE>options.mergedIndexPath = args[index];<NEW_LINE>options.indexPaths = new String[numPaths - 1];<NEW_LINE>System.arraycopy(args, index + 1, options.indexPaths, 0, options.indexPaths.length);<NEW_LINE>return options;<NEW_LINE>}
String clazzName = args[++index];
1,039,597
public void print_info(ObjectInfoPanel p_window, java.util.Locale p_locale) {<NEW_LINE>java.util.ResourceBundle resources = java.util.ResourceBundle.getBundle("app.freerouting.board.ObjectInfoPanel", p_locale);<NEW_LINE>p_window.append_bold(resources.getString("pin") + ": ");<NEW_LINE>p_window.append(resources<MASK><NEW_LINE>Component component = board.components.get(this.get_component_no());<NEW_LINE>p_window.append(component.name, resources.getString("component_info"), component);<NEW_LINE>p_window.append(", " + resources.getString("pin_2") + " ");<NEW_LINE>p_window.append(component.get_package().get_pin(this.pin_no).name);<NEW_LINE>p_window.append(", " + resources.getString("padstack") + " ");<NEW_LINE>app.freerouting.library.Padstack padstack = this.get_padstack();<NEW_LINE>p_window.append(padstack.name, resources.getString("padstack_info"), padstack);<NEW_LINE>p_window.append(" " + resources.getString("at") + " ");<NEW_LINE>p_window.append(this.get_center().to_float());<NEW_LINE>this.print_connectable_item_info(p_window, p_locale);<NEW_LINE>p_window.newline();<NEW_LINE>}
.getString("component_2") + " ");
1,507,656
final DeleteTokenResult executeDeleteToken(DeleteTokenRequest deleteTokenRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTokenRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteTokenRequest> request = null;<NEW_LINE>Response<DeleteTokenResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteTokenRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTokenRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "License Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteToken");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteTokenResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTokenResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,201,695
public void createBindings() {<NEW_LINE>LengthConverter lengthConverter = new LengthConverter();<NEW_LINE>// IntegerConverter intConverter = new IntegerConverter();<NEW_LINE>DoubleConverter doubleConverter = new DoubleConverter(Configuration.get().getLengthDisplayFormat());<NEW_LINE>addWrappedBinding(feeder, "feederGroupName", feederGroupName, "selectedItem");<NEW_LINE>MutableLocationProxy location = new MutableLocationProxy();<NEW_LINE>bind(UpdateStrategy.READ_WRITE, feeder, "location", location, "location");<NEW_LINE>MutableLocationProxy fiducial1Location = new MutableLocationProxy();<NEW_LINE>bind(UpdateStrategy.READ_WRITE, feeder, "fiducial1Location", fiducial1Location, "location");<NEW_LINE>addWrappedBinding(fiducial1Location, "lengthX", textFieldFiducial1X, "text", lengthConverter);<NEW_LINE>addWrappedBinding(fiducial1Location, "lengthY", textFieldFiducial1Y, "text", lengthConverter);<NEW_LINE>MutableLocationProxy fiducial2Location = new MutableLocationProxy();<NEW_LINE>bind(UpdateStrategy.READ_WRITE, feeder, "fiducial2Location", fiducial2Location, "location");<NEW_LINE>addWrappedBinding(fiducial2Location, "lengthX", textFieldFiducial2X, "text", lengthConverter);<NEW_LINE>addWrappedBinding(fiducial2Location, <MASK><NEW_LINE>MutableLocationProxy fiducial3Location = new MutableLocationProxy();<NEW_LINE>bind(UpdateStrategy.READ_WRITE, feeder, "fiducial3Location", fiducial3Location, "location");<NEW_LINE>addWrappedBinding(fiducial3Location, "lengthX", textFieldFiducial3X, "text", lengthConverter);<NEW_LINE>addWrappedBinding(fiducial3Location, "lengthY", textFieldFiducial3Y, "text", lengthConverter);<NEW_LINE>addWrappedBinding(feeder, "normalize", chckbxNormalize, "selected");<NEW_LINE>addWrappedBinding(feeder, "visionEnabled", chckbxUseVision, "selected");<NEW_LINE>addWrappedBinding(feeder, "ocrAction", ocrAction, "selectedItem");<NEW_LINE>addWrappedBinding(feeder, "ocrMargin", ocrMargin, "text", lengthConverter);<NEW_LINE>addWrappedBinding(feeder, "ocrFontName", ocrFontName, "selectedItem");<NEW_LINE>addWrappedBinding(feeder, "ocrFontSizePt", ocrFontSizePt, "text", doubleConverter);<NEW_LINE>addWrappedBinding(feeder, "ocrTextOrientation", ocrTextOrientation, "selectedItem");<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(textFieldFiducial1X);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(textFieldFiducial1Y);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(textFieldFiducial2X);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(textFieldFiducial2Y);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(textFieldFiducial3X);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(textFieldFiducial3Y);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(ocrMargin);<NEW_LINE>adaptDialog();<NEW_LINE>}
"lengthY", textFieldFiducial2Y, "text", lengthConverter);
620,441
public static Class<?> loadClass(String className) {<NEW_LINE>Class<?> clazz = null;<NEW_LINE>ClassLoader classLoader = getCustomClassLoader();<NEW_LINE>// First exception in chain of classloaders will be used as cause when<NEW_LINE>// no class is found in any of them<NEW_LINE>Throwable throwable = null;<NEW_LINE>if (classLoader != null) {<NEW_LINE>try {<NEW_LINE>LOGGER.trace("Trying to load class with custom classloader: {}", className);<NEW_LINE>clazz = loadClass(classLoader, className);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throwable = t;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (clazz == null) {<NEW_LINE>try {<NEW_LINE>LOGGER.trace("Trying to load class with current thread context classloader: {}", className);<NEW_LINE>clazz = loadClass(Thread.currentThread().getContextClassLoader(), className);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (throwable == null) {<NEW_LINE>throwable = t;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (clazz == null) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>clazz = loadClass(ReflectUtil.class.getClassLoader(), className);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (throwable == null) {<NEW_LINE>throwable = t;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (clazz == null) {<NEW_LINE>throw new FlowableClassLoadingException(className, throwable);<NEW_LINE>}<NEW_LINE>return clazz;<NEW_LINE>}
LOGGER.trace("Trying to load class with local classloader: {}", className);
1,507,225
final DescribeRecoveryPointResult executeDescribeRecoveryPoint(DescribeRecoveryPointRequest describeRecoveryPointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRecoveryPointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRecoveryPointRequest> request = null;<NEW_LINE>Response<DescribeRecoveryPointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRecoveryPointRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRecoveryPointRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Backup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeRecoveryPoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeRecoveryPointResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new DescribeRecoveryPointResultJsonUnmarshaller());
1,562,543
final DescribeManagedRuleGroupResult executeDescribeManagedRuleGroup(DescribeManagedRuleGroupRequest describeManagedRuleGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeManagedRuleGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeManagedRuleGroupRequest> request = null;<NEW_LINE>Response<DescribeManagedRuleGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeManagedRuleGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeManagedRuleGroupRequest));<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, "WAFV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeManagedRuleGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeManagedRuleGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeManagedRuleGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,021,719
public String analyzeDoc(byte[] bytes) {<NEW_LINE>List myList = new ArrayList<String>();<NEW_LINE>try {<NEW_LINE>Region region = Region.US_EAST_2;<NEW_LINE>TextractClient textractClient = TextractClient.builder().region(region).build();<NEW_LINE>SdkBytes sourceBytes = SdkBytes.fromByteArray(bytes);<NEW_LINE>// Get the input Document object as bytes<NEW_LINE>Document myDoc = Document.builder().bytes(sourceBytes).build();<NEW_LINE>List<FeatureType> featureTypes = new ArrayList<FeatureType>();<NEW_LINE>featureTypes.add(FeatureType.FORMS);<NEW_LINE>featureTypes.add(FeatureType.TABLES);<NEW_LINE>AnalyzeDocumentRequest analyzeDocumentRequest = AnalyzeDocumentRequest.builder().featureTypes(featureTypes).document(myDoc).build();<NEW_LINE>AnalyzeDocumentResponse analyzeDocument = textractClient.analyzeDocument(analyzeDocumentRequest);<NEW_LINE>List<Block> docInfo = analyzeDocument.blocks();<NEW_LINE>Iterator<Block> blockIterator = docInfo.iterator();<NEW_LINE>while (blockIterator.hasNext()) {<NEW_LINE>Block block = blockIterator.next();<NEW_LINE>myList.add("The block type is " + block.blockType().toString());<NEW_LINE>}<NEW_LINE>return convertToString(toXml(myList));<NEW_LINE>} catch (TextractException e) {<NEW_LINE>System.err.<MASK><NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}
println(e.getMessage());
342,544
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {<NEW_LINE>if (!worldObj.isRemote)<NEW_LINE>return;<NEW_LINE>if (pkt.getNbtCompound() == null)<NEW_LINE>throw new RuntimeException("No NBTTag compound! This is a bug!");<NEW_LINE>NBTTagCompound nbt = pkt.getNbtCompound();<NEW_LINE>try {<NEW_LINE>if ("desc-packet".equals(nbt.getString("net-type"))) {<NEW_LINE>byte[] bytes = nbt.getByteArray("net-data");<NEW_LINE>ByteBuf data = Unpooled.wrappedBuffer(bytes);<NEW_LINE>PacketTileState p = new PacketTileState();<NEW_LINE>p.readData(data);<NEW_LINE>// The player is not used so its fine to pass null<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>BCLog.logger.warn("Recieved a packet with a different type that expected (" + nbt.getString("net-type") + ")");<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new RuntimeException("Failed to read a packet! (net-type=\"" + nbt.getTag("net-type") + "\", net-data=\"" + nbt.getTag("net-data") + "\")", t);<NEW_LINE>}<NEW_LINE>}
p.applyData(worldObj, null);
1,454,204
private MBeanServerConnection connect() {<NEW_LINE>MBeanServerConnection mbsc = null;<NEW_LINE>try {<NEW_LINE>String jmxURL = String.format(JMX_URL_FORMAT, host, port);<NEW_LINE>JMXServiceURL serviceURL = new JMXServiceURL(jmxURL);<NEW_LINE>Map<String, Object> environment = Collections.singletonMap(JMXConnector.CREDENTIALS, new String<MASK><NEW_LINE>JMXConnector connector = JMXConnectorFactory.connect(serviceURL, environment);<NEW_LINE>mbsc = connector.getMBeanServerConnection();<NEW_LINE>} catch (IOException e) {<NEW_LINE>Throwable rootCause = Throwables.getRootCause(e);<NEW_LINE>errPrintln(format("nodetool: Failed to connect to '%s:%s' - %s: '%s'.", host, port, rootCause.getClass().getSimpleName(), rootCause.getMessage()));<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>return mbsc;<NEW_LINE>}
[] { user, password });
1,056,522
public static DescribeNetworksResponse unmarshall(DescribeNetworksResponse describeNetworksResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeNetworksResponse.setRequestId(_ctx.stringValue("DescribeNetworksResponse.RequestId"));<NEW_LINE>describeNetworksResponse.setTotalCount(_ctx.integerValue("DescribeNetworksResponse.TotalCount"));<NEW_LINE>describeNetworksResponse.setPageSize(_ctx.integerValue("DescribeNetworksResponse.PageSize"));<NEW_LINE>describeNetworksResponse.setPageNumber(_ctx.integerValue("DescribeNetworksResponse.PageNumber"));<NEW_LINE>List<Network> networks = new ArrayList<Network>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeNetworksResponse.Networks.Length"); i++) {<NEW_LINE>Network network = new Network();<NEW_LINE>network.setEnsRegionId(_ctx.stringValue("DescribeNetworksResponse.Networks[" + i + "].EnsRegionId"));<NEW_LINE>network.setNetworkId(_ctx.stringValue("DescribeNetworksResponse.Networks[" + i + "].NetworkId"));<NEW_LINE>network.setNetworkName(_ctx.stringValue("DescribeNetworksResponse.Networks[" + i + "].NetworkName"));<NEW_LINE>network.setCidrBlock(_ctx.stringValue("DescribeNetworksResponse.Networks[" + i + "].CidrBlock"));<NEW_LINE>network.setStatus(_ctx.stringValue("DescribeNetworksResponse.Networks[" + i + "].Status"));<NEW_LINE>network.setDescription(_ctx.stringValue("DescribeNetworksResponse.Networks[" + i + "].Description"));<NEW_LINE>network.setCreatedTime(_ctx.stringValue("DescribeNetworksResponse.Networks[" + i + "].CreatedTime"));<NEW_LINE>List<String> vSwitchIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeNetworksResponse.Networks[" + i + "].VSwitchIds.Length"); j++) {<NEW_LINE>vSwitchIds.add(_ctx.stringValue("DescribeNetworksResponse.Networks[" + i <MASK><NEW_LINE>}<NEW_LINE>network.setVSwitchIds(vSwitchIds);<NEW_LINE>networks.add(network);<NEW_LINE>}<NEW_LINE>describeNetworksResponse.setNetworks(networks);<NEW_LINE>return describeNetworksResponse;<NEW_LINE>}
+ "].VSwitchIds[" + j + "]"));
321,863
public void parseAttributeClauses(IoTDBSqlParser.AttributeClausesContext ctx, CreateAlignedTimeSeriesStatement createAlignedTimeSeriesStatement) {<NEW_LINE>if (ctx.alias() != null) {<NEW_LINE>createAlignedTimeSeriesStatement.addAliasList(parseNodeName(ctx.alias().nodeNameCanInExpr().getText()));<NEW_LINE>} else {<NEW_LINE>createAlignedTimeSeriesStatement.addAliasList(null);<NEW_LINE>}<NEW_LINE>String dataTypeString = ctx.dataType.getText().toUpperCase();<NEW_LINE>TSDataType dataType = TSDataType.valueOf(dataTypeString);<NEW_LINE>createAlignedTimeSeriesStatement.addDataType(dataType);<NEW_LINE>TSEncoding encoding = IoTDBDescriptor.<MASK><NEW_LINE>if (Objects.nonNull(ctx.encoding)) {<NEW_LINE>String encodingString = ctx.encoding.getText().toUpperCase();<NEW_LINE>encoding = TSEncoding.valueOf(encodingString);<NEW_LINE>}<NEW_LINE>createAlignedTimeSeriesStatement.addEncoding(encoding);<NEW_LINE>CompressionType compressor = TSFileDescriptor.getInstance().getConfig().getCompressor();<NEW_LINE>if (ctx.compressor != null) {<NEW_LINE>String compressorString = ctx.compressor.getText().toUpperCase();<NEW_LINE>compressor = CompressionType.valueOf(compressorString);<NEW_LINE>}<NEW_LINE>createAlignedTimeSeriesStatement.addCompressor(compressor);<NEW_LINE>if (ctx.propertyClause(0) != null) {<NEW_LINE>throw new SQLParserException("create aligned timeseries: property is not supported yet.");<NEW_LINE>}<NEW_LINE>if (ctx.tagClause() != null) {<NEW_LINE>parseTagClause(ctx.tagClause(), createAlignedTimeSeriesStatement);<NEW_LINE>} else {<NEW_LINE>createAlignedTimeSeriesStatement.addTagsList(null);<NEW_LINE>}<NEW_LINE>if (ctx.attributeClause() != null) {<NEW_LINE>parseAttributeClause(ctx.attributeClause(), createAlignedTimeSeriesStatement);<NEW_LINE>} else {<NEW_LINE>createAlignedTimeSeriesStatement.addAttributesList(null);<NEW_LINE>}<NEW_LINE>}
getInstance().getDefaultEncodingByType(dataType);
864,332
private boolean optionsItemSelected(MenuItem item) {<NEW_LINE><MASK><NEW_LINE>if (itemId == R.id.action_send_file) {<NEW_LINE>containerActivity.getFileOperationsHelper().sendShareFile(getFile(), true);<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.action_open_file_with) {<NEW_LINE>containerActivity.getFileOperationsHelper().openFile(getFile());<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.action_remove_file) {<NEW_LINE>RemoveFilesDialogFragment dialog = RemoveFilesDialogFragment.newInstance(getFile());<NEW_LINE>dialog.show(getFragmentManager(), FTAG_CONFIRMATION);<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.action_rename_file) {<NEW_LINE>RenameFileDialogFragment dialog = RenameFileDialogFragment.newInstance(getFile());<NEW_LINE>dialog.show(getFragmentManager(), FTAG_RENAME_FILE);<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.action_cancel_sync) {<NEW_LINE>((FileDisplayActivity) containerActivity).cancelTransference(getFile());<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.action_download_file || itemId == R.id.action_sync_file) {<NEW_LINE>containerActivity.getFileOperationsHelper().syncFile(getFile());<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.action_set_as_wallpaper) {<NEW_LINE>containerActivity.getFileOperationsHelper().setPictureAs(getFile(), getView());<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.action_encrypted) {<NEW_LINE>// TODO implement or remove<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.action_unset_encrypted) {<NEW_LINE>// TODO implement or remove<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return super.onOptionsItemSelected(item);<NEW_LINE>}
int itemId = item.getItemId();
1,844,524
public void reduce(Iterable<Tuple2<Object, Integer>> values, Collector<Tuple2<Object, Integer>> out) throws Exception {<NEW_LINE>LOG.info("{} reduce start.", getRuntimeContext().getTaskName());<NEW_LINE>ArrayList<Tuple2<Object, Integer>> all = new ArrayList<>();<NEW_LINE>int instanceCount = -1;<NEW_LINE>for (Tuple2<Object, Integer> value : values) {<NEW_LINE>if (value.f1 < 0) {<NEW_LINE>instanceCount = (int) value.f0;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>all.add(Tuple2.of(value.f0, value.f1));<NEW_LINE>}<NEW_LINE>if (all.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int count = all.size();<NEW_LINE>all.sort(new SortUtils.PairComparator());<NEW_LINE>Set<Tuple2<Object, Integer>> split = new HashSet<>();<NEW_LINE>int splitPointSize = instanceCount - 1;<NEW_LINE>for (int i = 0; i < splitPointSize; ++i) {<NEW_LINE>int index = (int) genSampleIndex(i, count, splitPointSize);<NEW_LINE>if (index >= count) {<NEW_LINE>throw new Exception("Index error. index: " + index + ". totalCount: " + count);<NEW_LINE>}<NEW_LINE>split.add<MASK><NEW_LINE>}<NEW_LINE>for (Tuple2<Object, Integer> sSplit : split) {<NEW_LINE>out.collect(sSplit);<NEW_LINE>}<NEW_LINE>LOG.info("{} reduce end.", getRuntimeContext().getTaskName());<NEW_LINE>}
(all.get(index));
27,832
public Void visitLikePredicate(LikePredicate node, Scope scope) {<NEW_LINE>predicateBaseAndCheck(node);<NEW_LINE>Type type1 = node.getChild(0).getType();<NEW_LINE>Type type2 = node.getChild(1).getType();<NEW_LINE>if (!type1.isStringType() && !type1.isNull()) {<NEW_LINE>throw new SemanticException("left operand of " + node.getOp().toString() + " must be of type STRING: " + AST2SQL.toString(node));<NEW_LINE>}<NEW_LINE>if (!type2.isStringType() && !type2.isNull()) {<NEW_LINE>throw new SemanticException("right operand of " + node.getOp().toString() + " must be of type STRING: " + AST2SQL.toString(node));<NEW_LINE>}<NEW_LINE>// check pattern<NEW_LINE>if (LikePredicate.Operator.REGEXP.equals(node.getOp()) && !type2.isNull() && node.getChild(1).isLiteral()) {<NEW_LINE>try {<NEW_LINE>Pattern.compile(((StringLiteral) node.getChild(<MASK><NEW_LINE>} catch (PatternSyntaxException e) {<NEW_LINE>throw new SemanticException("Invalid regular expression in '" + AST2SQL.toString(node) + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
1)).getValue());
392,440
public List<ValidationResult> validate(OAuth2SchemeBuilder builder) {<NEW_LINE>List<ValidationResult> results = new ArrayList<>();<NEW_LINE>if (builder.name == null) {<NEW_LINE>results.add(new ValidationResult("OAuth2Scheme", "name", "Parameter name is required"));<NEW_LINE>}<NEW_LINE>if (builder.flowType == null) {<NEW_LINE>results.add(new ValidationResult("OAuth2Scheme", "flowType", "Flow type is required"));<NEW_LINE>}<NEW_LINE>switch(builder.flowType) {<NEW_LINE>case "implicit":<NEW_LINE>requiredAttribute(results, "authorizationUrl", builder.authorizationUrl);<NEW_LINE>break;<NEW_LINE>case "password":<NEW_LINE>case "clientCredentials":<NEW_LINE>requiredAttribute(results, "tokenUrl", builder.tokenUrl);<NEW_LINE>break;<NEW_LINE>case "authorizationCode":<NEW_LINE>requiredAttribute(results, "authorizationUrl", builder.authorizationUrl);<NEW_LINE>requiredAttribute(<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>results.add(new ValidationResult("OAuth2Scheme", "flowType", "Flow type should be one of (implicit, password, clientCredentials, authorizationCode)"));<NEW_LINE>}<NEW_LINE>if (builder.scopes.isEmpty()) {<NEW_LINE>results.add(new ValidationResult("OAuth2Scheme", "scopes", "Scopes are required"));<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
results, "tokenUrl", builder.tokenUrl);
706,315
public CreateInfrastructureConfigurationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateInfrastructureConfigurationResult createInfrastructureConfigurationResult = new CreateInfrastructureConfigurationResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return createInfrastructureConfigurationResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("requestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createInfrastructureConfigurationResult.setRequestId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("clientToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createInfrastructureConfigurationResult.setClientToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("infrastructureConfigurationArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createInfrastructureConfigurationResult.setInfrastructureConfigurationArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createInfrastructureConfigurationResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
159,656
public double modifiedDurationFromStandardYield(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield) {<NEW_LINE>int nbCoupon = bond.getPeriodicPayments().size();<NEW_LINE>double couponPerYear = bond.getFrequency().eventsPerYear();<NEW_LINE>double factorOnPeriod = 1d + yield / couponPerYear;<NEW_LINE>double mdAtFirstCoupon = 0d;<NEW_LINE>double pvAtFirstCoupon = 0d;<NEW_LINE>int pow = 0;<NEW_LINE>double factorToNext = factorToNextCoupon(bond, settlementDate);<NEW_LINE>for (int loopcpn = 0; loopcpn < nbCoupon; loopcpn++) {<NEW_LINE>CapitalIndexedBondPaymentPeriod period = bond.getPeriodicPayments().get(loopcpn);<NEW_LINE>if ((bond.hasExCouponPeriod() && !settlementDate.isAfter(period.getDetachmentDate())) || (!bond.hasExCouponPeriod() && period.getPaymentDate().isAfter(settlementDate))) {<NEW_LINE>mdAtFirstCoupon += period.getRealCoupon() / Math.pow(factorOnPeriod, pow + 1) * (pow + factorToNext) / couponPerYear;<NEW_LINE>pvAtFirstCoupon += period.getRealCoupon() / Math.pow(factorOnPeriod, pow);<NEW_LINE>++pow;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mdAtFirstCoupon += (pow - 1d + factorToNext) / (couponPerYear * Math.pow(factorOnPeriod, pow));<NEW_LINE>pvAtFirstCoupon += 1d / Math.pow(factorOnPeriod, pow - 1);<NEW_LINE>double dp = pvAtFirstCoupon * Math.pow(factorOnPeriod, -factorToNext);<NEW_LINE>double md = mdAtFirstCoupon * Math.pow<MASK><NEW_LINE>return md;<NEW_LINE>}
(factorOnPeriod, -factorToNext) / dp;
738,607
public boolean isLearnable(Object object) {<NEW_LINE>if (WrappedStack.canBeWrapped(object)) {<NEW_LINE>WrappedStack wrappedObject = <MASK><NEW_LINE>if (object instanceof ItemStack && ((ItemStack) object).isItemDamaged()) {<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>if (EnergyValueRegistryProxy.hasEnergyValue(wrappedObject)) {<NEW_LINE>if (knowledgeBlacklist.contains(wrappedObject)) {<NEW_LINE>return false;<NEW_LINE>} else if (object instanceof ItemStack) {<NEW_LINE>Collection<String> oreNames = OreDictionaryHelper.getOreNames((ItemStack) object);<NEW_LINE>for (String oreName : oreNames) {<NEW_LINE>if (knowledgeBlacklist.contains(WrappedStack.build(new OreStack(oreName)))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
WrappedStack.build(object, 1);
927,042
protected void onPostExecute(GpxDisplayItem gpxItem) {<NEW_LINE>if (progressDialog != null) {<NEW_LINE>progressDialog.dismiss();<NEW_LINE>}<NEW_LINE>if (gpxItem != null && gpxItem.analysis != null) {<NEW_LINE>ArrayList<GPXDataSetType> list = new ArrayList<>();<NEW_LINE>if (gpxItem.analysis.hasElevationData) {<NEW_LINE>list.add(GPXDataSetType.ALTITUDE);<NEW_LINE>}<NEW_LINE>if (gpxItem.analysis.hasSpeedData) {<NEW_LINE>list.add(GPXDataSetType.SPEED);<NEW_LINE>} else if (gpxItem.analysis.hasElevationData) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (list.size() > 0) {<NEW_LINE>gpxItem.chartTypes = list.toArray(new GPXDataSetType[0]);<NEW_LINE>}<NEW_LINE>final OsmandSettings settings = app.getSettings();<NEW_LINE>settings.setMapLocationToShow(gpxItem.locationStart.lat, gpxItem.locationStart.lon, settings.getLastKnownMapZoom(), new PointDescription(PointDescription.POINT_TYPE_WPT, gpxItem.name), false, gpxItem);<NEW_LINE>MapActivity.launchMapActivityMoveToTop(getActivity());<NEW_LINE>}<NEW_LINE>}
list.add(GPXDataSetType.SLOPE);
707,377
public ProgramDiagnosticDataType decode(SerializationContext context, UaDecoder decoder) {<NEW_LINE>NodeId createSessionId = decoder.readNodeId("CreateSessionId");<NEW_LINE>String createClientName = decoder.readString("CreateClientName");<NEW_LINE>DateTime invocationCreationTime = decoder.readDateTime("InvocationCreationTime");<NEW_LINE>DateTime lastTransitionTime = decoder.readDateTime("LastTransitionTime");<NEW_LINE>String lastMethodCall = decoder.readString("LastMethodCall");<NEW_LINE>NodeId lastMethodSessionId = decoder.readNodeId("LastMethodSessionId");<NEW_LINE>Argument[] lastMethodInputArguments = (Argument[]) decoder.readStructArray("LastMethodInputArguments", Argument.TYPE_ID);<NEW_LINE>Argument[] lastMethodOutputArguments = (Argument[]) decoder.readStructArray("LastMethodOutputArguments", Argument.TYPE_ID);<NEW_LINE>DateTime lastMethodCallTime = decoder.readDateTime("LastMethodCallTime");<NEW_LINE>StatusResult lastMethodReturnStatus = (StatusResult) decoder.<MASK><NEW_LINE>return new ProgramDiagnosticDataType(createSessionId, createClientName, invocationCreationTime, lastTransitionTime, lastMethodCall, lastMethodSessionId, lastMethodInputArguments, lastMethodOutputArguments, lastMethodCallTime, lastMethodReturnStatus);<NEW_LINE>}
readStruct("LastMethodReturnStatus", StatusResult.TYPE_ID);
320,970
private void prepare(final ResultSetMetaData metaData) throws SQLException {<NEW_LINE>Map<String, Object> m = new HashMap<String, Object>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>put("$meta.row.columnCount", metaData.getColumnCount());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>for (int i = 0; i < metaData.getColumnCount(); i++) {<NEW_LINE>m.put("$meta.rs.catalogname." + i, metaData.getCatalogName(i));<NEW_LINE>m.put("$meta.rs.columnclassname." + i<MASK><NEW_LINE>m.put("$meta.rs.columndisplaysize." + i, metaData.getColumnDisplaySize(i));<NEW_LINE>m.put("$meta.rs.columnlabel." + i, metaData.getColumnLabel(i));<NEW_LINE>m.put("$meta.rs.columnname." + i, metaData.getColumnName(i));<NEW_LINE>m.put("$meta.rs.columntype." + i, metaData.getColumnType(i));<NEW_LINE>m.put("$meta.rs.columntypename." + i, metaData.getColumnTypeName(i));<NEW_LINE>m.put("$meta.rs.precision." + i, metaData.getPrecision(i));<NEW_LINE>m.put("$meta.rs.scale." + i, metaData.getScale(i));<NEW_LINE>m.put("$meta.rs.schemaname." + i, metaData.getSchemaName(i));<NEW_LINE>m.put("$meta.rs.tablename." + i, metaData.getTableName(i));<NEW_LINE>m.put("$meta.rs.isautoincrement." + i, metaData.isAutoIncrement(i));<NEW_LINE>m.put("$meta.rs.iscasesensitive." + i, metaData.isCaseSensitive(i));<NEW_LINE>m.put("$meta.rs.iscurrency." + i, metaData.isCurrency(i));<NEW_LINE>m.put("$meta.rs.isdefinitelywritable." + i, metaData.isDefinitelyWritable(i));<NEW_LINE>m.put("$meta.rs.isnullable." + i, metaData.isNullable(i));<NEW_LINE>m.put("$meta.rs.isreadonly." + i, metaData.isReadOnly(i));<NEW_LINE>m.put("$meta.rs.issearchable." + i, metaData.isSearchable(i));<NEW_LINE>m.put("$meta.rs.issigned." + i, metaData.isSigned(i));<NEW_LINE>m.put("$meta.rs.iswritable." + i, metaData.isWritable(i));<NEW_LINE>}<NEW_LINE>setLastResultSetMetadata(m);<NEW_LINE>}
, metaData.getColumnClassName(i));
794,482
public Request<DeleteProjectRequest> marshall(DeleteProjectRequest deleteProjectRequest) {<NEW_LINE>if (deleteProjectRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DeleteProjectRequest)");<NEW_LINE>}<NEW_LINE>Request<DeleteProjectRequest> request = new DefaultRequest<DeleteProjectRequest>(deleteProjectRequest, "AmazonRekognition");<NEW_LINE>String target = "RekognitionService.DeleteProject";<NEW_LINE><MASK><NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (deleteProjectRequest.getProjectArn() != null) {<NEW_LINE>String projectArn = deleteProjectRequest.getProjectArn();<NEW_LINE>jsonWriter.name("ProjectArn");<NEW_LINE>jsonWriter.value(projectArn);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addHeader("X-Amz-Target", target);
1,258,181
public void changeFeedProcessorBuilderCodeSnippet() {<NEW_LINE>String hostName = "test-host-name";<NEW_LINE>CosmosAsyncClient cosmosAsyncClient = new CosmosClientBuilder().endpoint(TestConfigurations.HOST).key(TestConfigurations.MASTER_KEY).contentResponseOnWriteEnabled(true).consistencyLevel(ConsistencyLevel.SESSION).buildAsyncClient();<NEW_LINE>CosmosAsyncDatabase cosmosAsyncDatabase = cosmosAsyncClient.getDatabase("testDb");<NEW_LINE>CosmosAsyncContainer <MASK><NEW_LINE>CosmosAsyncContainer leaseContainer = cosmosAsyncDatabase.getContainer("leaseContainer");<NEW_LINE>// BEGIN: com.azure.cosmos.changeFeedProcessor.builder<NEW_LINE>ChangeFeedProcessor changeFeedProcessor = new ChangeFeedProcessorBuilder().hostName(hostName).feedContainer(feedContainer).leaseContainer(leaseContainer).handleChanges(docs -> {<NEW_LINE>for (JsonNode item : docs) {<NEW_LINE>// Implementation for handling and processing of each JsonNode item goes here<NEW_LINE>}<NEW_LINE>}).buildChangeFeedProcessor();<NEW_LINE>// END: com.azure.cosmos.changeFeedProcessor.builder<NEW_LINE>}
feedContainer = cosmosAsyncDatabase.getContainer("feedContainer");
703,629
public void createSite2SiteVpnCfgCommands(final Site2SiteVpnConnection conn, final boolean isCreate, final VirtualRouter router, final Commands cmds) {<NEW_LINE>final Site2SiteCustomerGatewayVO gw = _s2sCustomerGatewayDao.findById(conn.getCustomerGatewayId());<NEW_LINE>final Site2SiteVpnGatewayVO vpnGw = _s2sVpnGatewayDao.findById(conn.getVpnGatewayId());<NEW_LINE>final IpAddress ip = _ipAddressDao.findById(vpnGw.getAddrId());<NEW_LINE>final Vpc vpc = _vpcDao.findById(ip.getVpcId());<NEW_LINE>final String localPublicIp = ip<MASK><NEW_LINE>final String localGuestCidr = vpc.getCidr();<NEW_LINE>final String localPublicGateway = _vlanDao.findById(ip.getVlanId()).getVlanGateway();<NEW_LINE>final String peerGatewayIp = gw.getGatewayIp();<NEW_LINE>final String peerGuestCidrList = gw.getGuestCidrList();<NEW_LINE>final String ipsecPsk = gw.getIpsecPsk();<NEW_LINE>final String ikePolicy = gw.getIkePolicy();<NEW_LINE>final String espPolicy = gw.getEspPolicy();<NEW_LINE>final Long ikeLifetime = gw.getIkeLifetime();<NEW_LINE>final Long espLifetime = gw.getEspLifetime();<NEW_LINE>final Boolean dpd = gw.getDpd();<NEW_LINE>final Boolean encap = gw.getEncap();<NEW_LINE>final Boolean splitConnections = gw.getSplitConnections();<NEW_LINE>final String ikeVersion = gw.getIkeVersion();<NEW_LINE>final Site2SiteVpnCfgCommand cmd = new Site2SiteVpnCfgCommand(isCreate, localPublicIp, localPublicGateway, localGuestCidr, peerGatewayIp, peerGuestCidrList, ikePolicy, espPolicy, ipsecPsk, ikeLifetime, espLifetime, dpd, conn.isPassive(), encap, splitConnections, ikeVersion);<NEW_LINE>cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, _routerControlHelper.getRouterControlIp(router.getId()));<NEW_LINE>cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, _routerControlHelper.getRouterControlIp(router.getId()));<NEW_LINE>cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());<NEW_LINE>final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());<NEW_LINE>cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, dcVo.getNetworkType().toString());<NEW_LINE>cmds.addCommand("applyS2SVpn", cmd);<NEW_LINE>}
.getAddress().toString();
1,745,300
public MatrixResponse route(GHMRequest ghRequest) {<NEW_LINE>Collection<String> outArraysList = createOutArrayList(ghRequest);<NEW_LINE>JsonNode <MASK><NEW_LINE>boolean withTimes = outArraysList.contains("times");<NEW_LINE>boolean withDistances = outArraysList.contains("distances");<NEW_LINE>boolean withWeights = outArraysList.contains("weights");<NEW_LINE>final MatrixResponse matrixResponse = new MatrixResponse(ghRequest.getFromPoints().size(), ghRequest.getToPoints().size(), withTimes, withDistances, withWeights);<NEW_LINE>try {<NEW_LINE>String postUrl = buildURLNoHints("/", ghRequest);<NEW_LINE>JsonNode responseJson = fromStringToJSON(postUrl, postJson(postUrl, requestJson));<NEW_LINE>if (responseJson.has("message")) {<NEW_LINE>matrixResponse.addErrors(ResponsePathDeserializer.readErrors(objectMapper, responseJson));<NEW_LINE>return matrixResponse;<NEW_LINE>}<NEW_LINE>matrixResponse.addErrors(ResponsePathDeserializer.readErrors(objectMapper, responseJson));<NEW_LINE>if (!matrixResponse.hasErrors())<NEW_LINE>matrixResponse.addErrors(readUsableEntityError(outArraysList, responseJson));<NEW_LINE>if (!matrixResponse.hasErrors())<NEW_LINE>fillResponseFromJson(matrixResponse, responseJson, ghRequest.getFailFast());<NEW_LINE>return matrixResponse;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>}
requestJson = createPostRequest(ghRequest, outArraysList);
1,729,200
public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>String epl = "@name('s0') select symbol, theString, price from " + "SupportMarketDataBean#length(10) as one, " + "SupportBeanString#length(100) as two " + "where one.symbol = two.theString " + "order by price";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>sendJoinEvents(env, milestone);<NEW_LINE><MASK><NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>sendEvent(env, "IBM", 49);<NEW_LINE>sendEvent(env, "CAT", 15);<NEW_LINE>sendEvent(env, "IBM", 100);<NEW_LINE>env.assertPropsPerRowIterator("s0", new String[] { "symbol", "theString", "price" }, new Object[][] { { "CAT", "CAT", 15d }, { "IBM", "IBM", 49d }, { "CAT", "CAT", 50d }, { "IBM", "IBM", 100d } });<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>sendEvent(env, "KGB", 75);<NEW_LINE>env.assertPropsPerRowIterator("s0", new String[] { "symbol", "theString", "price" }, new Object[][] { { "CAT", "CAT", 15d }, { "IBM", "IBM", 49d }, { "CAT", "CAT", 50d }, { "KGB", "KGB", 75d }, { "IBM", "IBM", 100d } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
sendEvent(env, "CAT", 50);
653,477
public void run() throws CLIException {<NEW_LINE>try {<NEW_LINE>final double version = Double.parseDouble(System.getProperty("java.specification.version"));<NEW_LINE>if (version >= 11) {<NEW_LINE>int iVersion = (int) version;<NEW_LINE>// Collect the jmods used in the application<NEW_LINE>String mods = exec(javaHomePrefix() + "jdeps", "-q", "--multi-release", Integer.toString(iVersion), "--module-path", "node_modules/.lib", "--print-module-deps", "node_modules/.bin/es4x-launcher.jar");<NEW_LINE>// trim any new line<NEW_LINE>mods = mods.replaceAll("\r?\n", "");<NEW_LINE>// if (!mods.contains("java.naming.sql")) {<NEW_LINE>// // add the java.naming.sql module for DNS<NEW_LINE>// mods = mods + ",java.naming.sql";<NEW_LINE>// }<NEW_LINE>// enable jvmci if supported<NEW_LINE>String modules = exec(<MASK><NEW_LINE>if (modules.contains("jdk.internal.vm.ci")) {<NEW_LINE>if (!mods.contains("jdk.internal.vm.ci")) {<NEW_LINE>// add the jvmci module<NEW_LINE>mods = mods + ",jdk.internal.vm.ci";<NEW_LINE>}<NEW_LINE>// clean up<NEW_LINE>mods = mods.replaceAll(",,", ",");<NEW_LINE>}<NEW_LINE>warn("Linking: " + mods);<NEW_LINE>// jlink<NEW_LINE>exec(javaHomePrefix() + "jlink", "--no-header-files", "--no-man-pages", "--compress=2", "--strip-debug", "--add-modules", mods, "--output", target);<NEW_LINE>} else {<NEW_LINE>fatal("Your JDK version does not support jlink (< 11)");<NEW_LINE>}<NEW_LINE>} catch (IOException | InterruptedException e) {<NEW_LINE>fatal(e.getMessage());<NEW_LINE>}<NEW_LINE>}
javaHomePrefix() + "java", "--list-modules");
272,451
private void buildReadFromParcelFactoryMethod(JDefinedClass parcelableClass, JBlock parcelConstructorBody, JVar wrapped, ConstructorReference propertyAccessor, ASTType wrappedType, JVar parcelParam, JVar identity, JVar writeIdentityMap) {<NEW_LINE>ASTMethod factoryMethod = propertyAccessor.getFactoryMethod();<NEW_LINE>Map<ASTParameter, ASTType> converters = propertyAccessor.getConverters();<NEW_LINE>JInvocation invocation = generationUtil.ref(wrappedType).staticInvoke(factoryMethod.getName());<NEW_LINE>for (ASTParameter parameter : factoryMethod.getParameters()) {<NEW_LINE>ASTType type = propertyAccessor.getWriteReference(parameter).getType();<NEW_LINE>ASTType converter = converters.containsKey(parameter) ? converters.get(parameter) : null;<NEW_LINE>JVar var = parcelConstructorBody.decl(generationUtil.ref(type), variableNamer.generateName(type), buildReadFromParcelExpression(parcelConstructorBody, parcelParam, parcelableClass, type, converter, identity<MASK><NEW_LINE>invocation.arg(var);<NEW_LINE>}<NEW_LINE>parcelConstructorBody.assign(wrapped, invocation);<NEW_LINE>}
, writeIdentityMap).getExpression());
50,498
public void analyze() {<NEW_LINE>String[] line;<NEW_LINE>// Collect initial stats: sums (for means), highs, lows.<NEW_LINE>this.source.rewind();<NEW_LINE>int c = 0;<NEW_LINE>while ((line = this.source.readLine()) != null) {<NEW_LINE>c++;<NEW_LINE>for (int i = 0; i < this.helper.getSourceColumns().size(); i++) {<NEW_LINE>ColumnDefinition colDef = this.helper.getSourceColumns().get(i);<NEW_LINE>int index = findIndex(colDef);<NEW_LINE>String value = line[index];<NEW_LINE>colDef.analyze(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.analyzedRows = c;<NEW_LINE>// Calculate the means, and reset for sd calc.<NEW_LINE>for (ColumnDefinition colDef : this.helper.getSourceColumns()) {<NEW_LINE>// Only calculate mean/sd for continuous columns.<NEW_LINE>if (colDef.getDataType() == ColumnType.continuous) {<NEW_LINE>colDef.setMean(colDef.getMean() / colDef.getCount());<NEW_LINE>colDef.setSd(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Sum the standard deviation<NEW_LINE>this.source.rewind();<NEW_LINE>while ((line = this.source.readLine()) != null) {<NEW_LINE>for (int i = 0; i < this.helper.getSourceColumns().size(); i++) {<NEW_LINE>ColumnDefinition colDef = this.helper.getSourceColumns().get(i);<NEW_LINE>String value = line[colDef.getIndex()];<NEW_LINE>if (colDef.getDataType() == ColumnType.continuous) {<NEW_LINE>double d = this.helper.parseDouble(value);<NEW_LINE>d = colDef.getMean() - d;<NEW_LINE>d = d * d;<NEW_LINE>colDef.setSd(colDef.getSd() + d);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Calculate the standard deviations.<NEW_LINE>for (ColumnDefinition colDef : this.helper.getSourceColumns()) {<NEW_LINE>// Only calculate sd for continuous columns.<NEW_LINE>if (colDef.getDataType() == ColumnType.continuous) {<NEW_LINE>colDef.setSd(Math.sqrt(colDef.getSd() <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
/ colDef.getCount()));
724,249
private void convertArrowFunctionParameterList(Expression paramList, ParserContextFunctionNode function) {<NEW_LINE>Expression paramListExpr = paramList;<NEW_LINE>if (paramListExpr instanceof ExpressionList) {<NEW_LINE>// see parenthesizedExpressionAndArrowParameterList() and leftHandSideExpression()<NEW_LINE>paramListExpr = convertExpressionListToExpression((ExpressionList) paramListExpr);<NEW_LINE>}<NEW_LINE>if (paramListExpr == null) {<NEW_LINE>// empty parameter list, i.e. () =><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int functionLine = function.getLineNumber();<NEW_LINE>if (paramListExpr instanceof IdentNode || paramListExpr.isTokenType(ASSIGN) || isDestructuringLhs(paramListExpr) || paramListExpr.isTokenType(SPREAD_ARGUMENT)) {<NEW_LINE>convertArrowParameter(paramListExpr, 0, functionLine, function);<NEW_LINE>} else if (paramListExpr instanceof BinaryNode && Token.descType(paramListExpr.getToken()) == COMMARIGHT) {<NEW_LINE>List<Expression> params = new ArrayList<>();<NEW_LINE>Expression car = paramListExpr;<NEW_LINE>do {<NEW_LINE>Expression cdr = ((BinaryNode) car).getRhs();<NEW_LINE>params.add(cdr);<NEW_LINE>car = ((BinaryNode) car).getLhs();<NEW_LINE>} while (car instanceof BinaryNode && Token.descType(car.getToken()) == COMMARIGHT);<NEW_LINE>params.add(car);<NEW_LINE>for (int i = params.size() - 1, pos = 0; i >= 0; i--, pos++) {<NEW_LINE>Expression param = params.get(i);<NEW_LINE>if (i != 0 && param.isTokenType(SPREAD_ARGUMENT)) {<NEW_LINE>throw error(AbstractParser.message(MSG_INVALID_ARROW_PARAMETER), param.getToken());<NEW_LINE>} else {<NEW_LINE>convertArrowParameter(param, pos, functionLine, function);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw error(AbstractParser.message(MSG_EXPECTED_ARROW_PARAMETER<MASK><NEW_LINE>}<NEW_LINE>}
), paramListExpr.getToken());
698,221
public void caseIfStmt(IfStmt stmt) {<NEW_LINE>final ConditionExpr expr = (ConditionExpr) stmt.getCondition();<NEW_LINE>final Value lv = expr.getOp1();<NEW_LINE>final Value rv = expr.getOp2();<NEW_LINE>TypeNode lop;<NEW_LINE>TypeNode rop;<NEW_LINE>// ******** LEFT ********<NEW_LINE>if (lv instanceof Local) {<NEW_LINE>lop = hierarchy.typeNode(((Local) lv).getType());<NEW_LINE>} else if (lv instanceof DoubleConstant) {<NEW_LINE>lop = hierarchy.<MASK><NEW_LINE>} else if (lv instanceof FloatConstant) {<NEW_LINE>lop = hierarchy.typeNode(FloatType.v());<NEW_LINE>} else if (lv instanceof IntConstant) {<NEW_LINE>lop = hierarchy.typeNode(IntType.v());<NEW_LINE>} else if (lv instanceof LongConstant) {<NEW_LINE>lop = hierarchy.typeNode(LongType.v());<NEW_LINE>} else if (lv instanceof NullConstant) {<NEW_LINE>lop = hierarchy.typeNode(NullType.v());<NEW_LINE>} else if (lv instanceof StringConstant) {<NEW_LINE>lop = hierarchy.typeNode(RefType.v("java.lang.String"));<NEW_LINE>} else if (lv instanceof ClassConstant) {<NEW_LINE>lop = hierarchy.typeNode(RefType.v("java.lang.Class"));<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unhandled binary expression left operand type: " + lv.getClass());<NEW_LINE>}<NEW_LINE>// ******** RIGHT ********<NEW_LINE>if (rv instanceof Local) {<NEW_LINE>rop = hierarchy.typeNode(((Local) rv).getType());<NEW_LINE>} else if (rv instanceof DoubleConstant) {<NEW_LINE>rop = hierarchy.typeNode(DoubleType.v());<NEW_LINE>} else if (rv instanceof FloatConstant) {<NEW_LINE>rop = hierarchy.typeNode(FloatType.v());<NEW_LINE>} else if (rv instanceof IntConstant) {<NEW_LINE>rop = hierarchy.typeNode(IntType.v());<NEW_LINE>} else if (rv instanceof LongConstant) {<NEW_LINE>rop = hierarchy.typeNode(LongType.v());<NEW_LINE>} else if (rv instanceof NullConstant) {<NEW_LINE>rop = hierarchy.typeNode(NullType.v());<NEW_LINE>} else if (rv instanceof StringConstant) {<NEW_LINE>rop = hierarchy.typeNode(RefType.v("java.lang.String"));<NEW_LINE>} else if (rv instanceof ClassConstant) {<NEW_LINE>rop = hierarchy.typeNode(RefType.v("java.lang.Class"));<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unhandled binary expression right operand type: " + rv.getClass());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>lop.lca(rop);<NEW_LINE>} catch (TypeException e) {<NEW_LINE>error(e.getMessage());<NEW_LINE>}<NEW_LINE>}
typeNode(DoubleType.v());
1,627,638
private void populateBsqSwapTradeColumns(TradeInfo trade) {<NEW_LINE>colTradeId.addRow(trade.getShortId());<NEW_LINE>colRole.addRow(trade.getRole());<NEW_LINE>colPrice.addRow(trade.getTradePrice());<NEW_LINE>colAmount.addRow(toTradeAmount.apply(trade));<NEW_LINE>colMinerTxFee.addRow(toMyMinerTxFee.apply(trade));<NEW_LINE>colBisqTradeFee.addRow(toMyMakerOrTakerFee.apply(trade));<NEW_LINE>colTradeCost.addRow(toTradeVolumeAsString.apply(trade));<NEW_LINE>var isCompleted = isCompletedBsqSwap.test(trade);<NEW_LINE>status.addRow(isCompleted ? "COMPLETED" : "PENDING");<NEW_LINE>if (isCompleted) {<NEW_LINE>colTxId.addRow(trade.getBsqSwapTradeInfo().getTxId());<NEW_LINE>colNumConfirmations.addRow(trade.<MASK><NEW_LINE>}<NEW_LINE>}
getBsqSwapTradeInfo().getNumConfirmations());
649,077
protected void generateEvidence(IndentWriter writer) {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>writer.indent();<NEW_LINE>writer.println("id:" + getPluginID() + ",version:" + getPluginVersion());<NEW_LINE>String user_dir = FileUtil.getUserFile("plugins").toString();<NEW_LINE>String shared_dir = FileUtil.getApplicationFile("plugins").toString();<NEW_LINE>String plugin_dir = getPluginDirectoryName();<NEW_LINE>String type;<NEW_LINE>boolean built_in = false;<NEW_LINE>if (plugin_dir.startsWith(shared_dir)) {<NEW_LINE>type = "shared";<NEW_LINE>} else if (plugin_dir.startsWith(user_dir)) {<NEW_LINE>type = "per-user";<NEW_LINE>} else {<NEW_LINE>built_in = true;<NEW_LINE>type = "built-in";<NEW_LINE>}<NEW_LINE>PluginState ps = getPluginState();<NEW_LINE>String info = getPluginconfig().getPluginStringParameter("plugin.info");<NEW_LINE>writer.println("type:" + type + ",enabled=" + !ps.isDisabled() + ",load_at_start=" + ps.isLoadedAtStartup() + ",operational=" + ps.isOperational() + (info == null || info.length() == 0 ? "" : (",info=" + info)));<NEW_LINE>if (ps.isOperational()) {<NEW_LINE>Plugin plugin = getPlugin();<NEW_LINE>if (plugin instanceof AEDiagnosticsEvidenceGenerator) {<NEW_LINE>try {<NEW_LINE>writer.indent();<NEW_LINE>((AEDiagnosticsEvidenceGenerator) plugin).generate(writer);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>writer.println("Failed to generate plugin-specific info: " + Debug.getNestedExceptionMessage(e));<NEW_LINE>} finally {<NEW_LINE>writer.exdent();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!built_in) {<NEW_LINE>File dir = FileUtil.newFile(plugin_dir);<NEW_LINE>if (dir.exists()) {<NEW_LINE>String[] files = dir.list();<NEW_LINE>if (files != null) {<NEW_LINE>String files_str = "";<NEW_LINE>for (String f : files) {<NEW_LINE>files_str += (files_str.length() == 0 ? "" : ", ") + f;<NEW_LINE>}<NEW_LINE>writer.println(" files: " + files_str);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>writer.exdent();<NEW_LINE>}<NEW_LINE>}
writer.println(getPluginName());
1,237,765
public boolean goToExternalLocation(Navigatable nav, ExternalLocation externalLocation, boolean checkNavigationOption) {<NEW_LINE>if (checkNavigationOption && !navOptions.isGotoExternalProgramEnabled()) {<NEW_LINE>return goToExternalLinkage(nav, externalLocation, true);<NEW_LINE>}<NEW_LINE>Program externalProgram = openExternalProgram(externalLocation);<NEW_LINE>if (externalProgram == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// try the address first if it exists<NEW_LINE>Address addr = externalLocation.getAddress();<NEW_LINE>if (addr != null && externalProgram.getMemory().contains(addr)) {<NEW_LINE>goTo(nav, new AddressFieldLocation(externalProgram, addr), externalProgram);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// then try the symbol<NEW_LINE>Symbol symbol = getExternalSymbol(externalProgram, externalLocation);<NEW_LINE>if (symbol != null) {<NEW_LINE>goTo(nav, <MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>performDefaultExternalProgramNavigation(nav, externalLocation, externalProgram, addr);<NEW_LINE>// return false because we did not go to the requested address<NEW_LINE>return false;<NEW_LINE>}
symbol.getProgramLocation(), externalProgram);
616,807
public void onMessage(OrderCancelRequest message, SessionID sessionID) throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue {<NEW_LINE>String symbol = <MASK><NEW_LINE>char side = message.getChar(Side.FIELD);<NEW_LINE>String id = message.getString(OrigClOrdID.FIELD);<NEW_LINE>Order order = orderMatcher.find(symbol, side, id);<NEW_LINE>if (order != null) {<NEW_LINE>order.cancel();<NEW_LINE>cancelOrder(order);<NEW_LINE>orderMatcher.erase(order);<NEW_LINE>} else {<NEW_LINE>OrderCancelReject fixOrderReject = new OrderCancelReject(new OrderID("NONE"), new ClOrdID(message.getString(ClOrdID.FIELD)), new OrigClOrdID(message.getString(OrigClOrdID.FIELD)), new OrdStatus(OrdStatus.REJECTED), new CxlRejResponseTo(CxlRejResponseTo.ORDER_CANCEL_REQUEST));<NEW_LINE>String senderCompId = message.getHeader().getString(SenderCompID.FIELD);<NEW_LINE>String targetCompId = message.getHeader().getString(TargetCompID.FIELD);<NEW_LINE>fixOrderReject.getHeader().setString(SenderCompID.FIELD, targetCompId);<NEW_LINE>fixOrderReject.getHeader().setString(TargetCompID.FIELD, senderCompId);<NEW_LINE>try {<NEW_LINE>Session.sendToTarget(fixOrderReject, targetCompId, senderCompId);<NEW_LINE>} catch (SessionNotFound e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
message.getString(Symbol.FIELD);
1,303,614
public void execute(RenderHandler handler) throws IOException, Exception {<NEW_LINE>SysSite site = getSite(handler);<NEW_LINE>Date endPublishDate = handler.getDate("endPublishDate");<NEW_LINE>Date expiryDate = null;<NEW_LINE>String path = handler.getString("path");<NEW_LINE>Boolean disabled = false;<NEW_LINE>Integer[] status;<NEW_LINE>if (handler.getBoolean("advanced", false)) {<NEW_LINE>status = handler.getIntegerArray("status");<NEW_LINE>disabled = handler.getBoolean("disabled", false);<NEW_LINE>} else {<NEW_LINE>status = CmsPlaceService.STATUS_NORMAL_ARRAY;<NEW_LINE><MASK><NEW_LINE>if (null == endPublishDate || endPublishDate.after(now)) {<NEW_LINE>endPublishDate = now;<NEW_LINE>}<NEW_LINE>expiryDate = now;<NEW_LINE>}<NEW_LINE>if (CommonUtils.notEmpty(path)) {<NEW_LINE>path = path.replace("//", CommonConstants.SEPARATOR);<NEW_LINE>}<NEW_LINE>PageHandler page = service.getPage(site.getId(), handler.getLong("userId"), path, handler.getString("itemType"), handler.getLong("itemId"), handler.getDate("startPublishDate"), endPublishDate, expiryDate, status, disabled, handler.getString("orderField"), handler.getString("orderType"), handler.getInteger("pageIndex", 1), handler.getInteger("pageSize", handler.getInteger("count", 30)));<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<CmsPlace> list = (List<CmsPlace>) page.getList();<NEW_LINE>if (null != list) {<NEW_LINE>boolean absoluteURL = handler.getBoolean("absoluteURL", true);<NEW_LINE>list.forEach(e -> {<NEW_LINE>Integer clicks = statisticsComponent.getPlaceClicks(e.getId());<NEW_LINE>if (null != clicks) {<NEW_LINE>e.setClicks(e.getClicks() + clicks);<NEW_LINE>}<NEW_LINE>if (absoluteURL) {<NEW_LINE>templateComponent.initPlaceCover(site, e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>handler.put("page", page).render();<NEW_LINE>}
Date now = CommonUtils.getMinuteDate();
338,680
protected WeightedDiscreteUncertainObject filterSingleObject(NumberVector vec) {<NEW_LINE>final int dim = vec.getDimensionality();<NEW_LINE>if (dim % mod != 0) {<NEW_LINE>throw new AbortException("Vector length " + dim + " not divisible by the number of dimensions + 1 (for probability): " + mod);<NEW_LINE>}<NEW_LINE>final int num = dim / mod;<NEW_LINE>final DoubleVector[] samples = new DoubleVector[num];<NEW_LINE>final double[] weights = new double[dims];<NEW_LINE>final double[] buf = new double[dims];<NEW_LINE>for (int i = 0, j = 0, k = 0, l = 0; i < mod; i++) {<NEW_LINE>if (l++ == probcol) {<NEW_LINE>weights[k<MASK><NEW_LINE>} else {<NEW_LINE>buf[j++] = vec.doubleValue(i);<NEW_LINE>}<NEW_LINE>if (l == mod) {<NEW_LINE>samples[k] = DoubleVector.copy(buf);<NEW_LINE>j = 0;<NEW_LINE>l = 0;<NEW_LINE>k++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new WeightedDiscreteUncertainObject(samples, weights);<NEW_LINE>}
] = vec.doubleValue(i);
1,741,404
private void updateReceivedHUs(final IHUContext huContext, final Collection<I_M_HU> hus, @Nullable final PPOrderBOMLineId coByProductOrderBOMLineId) {<NEW_LINE>if (hus.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Modify the HU Attributes based on the attributes already existing from issuing (task 08177)<NEW_LINE>ppOrderProductAttributeBL.updateHUAttributes(hus, getPpOrderId(), coByProductOrderBOMLineId);<NEW_LINE>final IAttributeStorageFactory huAttributeStorageFactory = huContext.getHUAttributeStorageFactory();<NEW_LINE>for (final I_M_HU hu : hus) {<NEW_LINE>final IAttributeStorage <MASK><NEW_LINE>if (lotNumber != null && huAttributes.hasAttribute(AttributeConstants.ATTR_LotNumber)) {<NEW_LINE>huAttributes.setValue(AttributeConstants.ATTR_LotNumber, lotNumber);<NEW_LINE>}<NEW_LINE>if (bestBeforeDate != null && huAttributes.hasAttribute(AttributeConstants.ATTR_BestBeforeDate)) {<NEW_LINE>huAttributes.setValue(AttributeConstants.ATTR_BestBeforeDate, bestBeforeDate);<NEW_LINE>}<NEW_LINE>huAttributes.saveChangesIfNeeded();<NEW_LINE>huAttributesBL.updateHUAttributeRecursive(HuId.ofRepoId(hu.getM_HU_ID()), HUAttributeConstants.ATTR_PP_Order_ID, ppOrderId.getRepoId(), null);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Assign HUs to PP_Order/PP_Order_BOMLine<NEW_LINE>addAssignedHUs(hus);<NEW_LINE>}
huAttributes = huAttributeStorageFactory.getAttributeStorage(hu);
1,620,051
private <ExceptionT extends Exception> void collect(ArrayCollector<ExceptionT> collectArray, int length) throws ExceptionT {<NEW_LINE>if (length == 0) {<NEW_LINE>// Nothing to collect.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// We only need to process a subset of our arrays (since we may be sliced from the original array list).<NEW_LINE>int startId = getBufferId(0);<NEW_LINE>int endId = getBufferId(length - 1);<NEW_LINE>// The first ByteBuffer may need an offset, if this.startOffset > 0.<NEW_LINE>int bufferOffset = getBufferOffset(0);<NEW_LINE>for (int bufferId = startId; bufferId <= endId; bufferId++) {<NEW_LINE>int arrayLength = Math.min(length, this.bufferLayout.bufferSize - bufferOffset);<NEW_LINE>// Don't allocate array if not allocated yet.<NEW_LINE>ByteBuffer bb = getBuffer(bufferId, false);<NEW_LINE>if (bb == null) {<NEW_LINE>// Providing a dummy, empty array of the correct size is the easiest way to handle unallocated components<NEW_LINE>// for all the cases this method is used for.<NEW_LINE>collectArray.accept(new byte[arrayLength], 0, arrayLength);<NEW_LINE>} else {<NEW_LINE>collectArray.accept(bb.<MASK><NEW_LINE>}<NEW_LINE>length -= arrayLength;<NEW_LINE>// After processing the first array (handling this.startOffset), all other array offsets are 0.<NEW_LINE>bufferOffset = 0;<NEW_LINE>}<NEW_LINE>assert length == 0 : "Collection finished but " + length + " bytes remaining";<NEW_LINE>}
array(), bufferOffset, arrayLength);
302,941
protected void jbInit() throws Exception {<NEW_LINE>// this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);<NEW_LINE>mainPanel.setLayout(new java.awt.BorderLayout());<NEW_LINE>setLayout(new java.awt.BorderLayout());<NEW_LINE>southPanel.setLayout(southLayout);<NEW_LINE>southPanel.<MASK><NEW_LINE>southPanel.add(statusBar, BorderLayout.SOUTH);<NEW_LINE>mainPanel.add(southPanel, BorderLayout.SOUTH);<NEW_LINE>mainPanel.add(parameterPanel, BorderLayout.NORTH);<NEW_LINE>mainPanel.add(scrollPane, BorderLayout.CENTER);<NEW_LINE>scrollPane.getViewport().add(p_table, null);<NEW_LINE>//<NEW_LINE>confirmPanel.addActionListener(this);<NEW_LINE>confirmPanel.getResetButton().setVisible(hasReset());<NEW_LINE>confirmPanel.getCustomizeButton().setVisible(hasCustomize());<NEW_LINE>confirmPanel.getHistoryButton().setVisible(hasHistory());<NEW_LINE>confirmPanel.getZoomButton().setVisible(hasZoom());<NEW_LINE>//<NEW_LINE>JButton print = ConfirmPanel.createPrintButton(true);<NEW_LINE>print.addActionListener(this);<NEW_LINE>confirmPanel.addButton(print);<NEW_LINE>//<NEW_LINE>popup.add(calcMenu);<NEW_LINE>calcMenu.setText(Msg.getMsg(Env.getCtx(), "Calculator"));<NEW_LINE>calcMenu.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Calculator16.gif")));<NEW_LINE>calcMenu.addActionListener(this);<NEW_LINE>//<NEW_LINE>p_table.getSelectionModel().addListSelectionListener(this);<NEW_LINE>enableButtons();<NEW_LINE>}
add(confirmPanel, BorderLayout.CENTER);
555,653
public static ListApplicationsResponse unmarshall(ListApplicationsResponse listApplicationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listApplicationsResponse.setRequestId<MASK><NEW_LINE>listApplicationsResponse.setMessage(_ctx.stringValue("ListApplicationsResponse.Message"));<NEW_LINE>listApplicationsResponse.setErrorCode(_ctx.stringValue("ListApplicationsResponse.ErrorCode"));<NEW_LINE>listApplicationsResponse.setCode(_ctx.stringValue("ListApplicationsResponse.Code"));<NEW_LINE>listApplicationsResponse.setSuccess(_ctx.booleanValue("ListApplicationsResponse.Success"));<NEW_LINE>listApplicationsResponse.setCurrentPage(_ctx.integerValue("ListApplicationsResponse.CurrentPage"));<NEW_LINE>listApplicationsResponse.setTotalSize(_ctx.integerValue("ListApplicationsResponse.TotalSize"));<NEW_LINE>listApplicationsResponse.setPageSize(_ctx.integerValue("ListApplicationsResponse.PageSize"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCurrentPage(_ctx.integerValue("ListApplicationsResponse.Data.CurrentPage"));<NEW_LINE>data.setTotalSize(_ctx.integerValue("ListApplicationsResponse.Data.TotalSize"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListApplicationsResponse.Data.PageSize"));<NEW_LINE>List<Application> applications = new ArrayList<Application>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListApplicationsResponse.Data.Applications.Length"); i++) {<NEW_LINE>Application application = new Application();<NEW_LINE>application.setAppName(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].AppName"));<NEW_LINE>application.setNamespaceId(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].NamespaceId"));<NEW_LINE>application.setAppDeletingStatus(_ctx.booleanValue("ListApplicationsResponse.Data.Applications[" + i + "].AppDeletingStatus"));<NEW_LINE>application.setAppId(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].AppId"));<NEW_LINE>application.setScaleRuleEnabled(_ctx.booleanValue("ListApplicationsResponse.Data.Applications[" + i + "].ScaleRuleEnabled"));<NEW_LINE>application.setScaleRuleType(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].ScaleRuleType"));<NEW_LINE>application.setRunningInstances(_ctx.integerValue("ListApplicationsResponse.Data.Applications[" + i + "].RunningInstances"));<NEW_LINE>application.setInstances(_ctx.integerValue("ListApplicationsResponse.Data.Applications[" + i + "].Instances"));<NEW_LINE>application.setRegionId(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].RegionId"));<NEW_LINE>application.setAppDescription(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].AppDescription"));<NEW_LINE>List<TagsItem> tags = new ArrayList<TagsItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListApplicationsResponse.Data.Applications[" + i + "].Tags.Length"); j++) {<NEW_LINE>TagsItem tagsItem = new TagsItem();<NEW_LINE>tagsItem.setKey(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].Tags[" + j + "].Key"));<NEW_LINE>tagsItem.setValue(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].Tags[" + j + "].Value"));<NEW_LINE>tags.add(tagsItem);<NEW_LINE>}<NEW_LINE>application.setTags(tags);<NEW_LINE>applications.add(application);<NEW_LINE>}<NEW_LINE>data.setApplications(applications);<NEW_LINE>listApplicationsResponse.setData(data);<NEW_LINE>return listApplicationsResponse;<NEW_LINE>}
(_ctx.stringValue("ListApplicationsResponse.RequestId"));
672,356
static AuthInitiateMessage decode(byte[] wire) {<NEW_LINE>AuthInitiateMessage message = new AuthInitiateMessage();<NEW_LINE>int offset = 0;<NEW_LINE>byte[] r = new byte[32];<NEW_LINE>byte[] s = new byte[32];<NEW_LINE>System.arraycopy(wire, offset, r, 0, 32);<NEW_LINE>offset += 32;<NEW_LINE>System.arraycopy(wire, offset, s, 0, 32);<NEW_LINE>offset += 32;<NEW_LINE>int v = wire[offset] + 27;<NEW_LINE>offset += 1;<NEW_LINE>message.signature = ECDSASignature.fromComponents(r, s, (byte) v);<NEW_LINE>message.ephemeralPublicHash = new byte[32];<NEW_LINE>System.arraycopy(wire, offset, message.ephemeralPublicHash, 0, 32);<NEW_LINE>offset += 32;<NEW_LINE>byte[] bytes = new byte[65];<NEW_LINE>System.arraycopy(wire, <MASK><NEW_LINE>offset += 64;<NEW_LINE>// uncompressed<NEW_LINE>bytes[0] = 0x04;<NEW_LINE>message.publicKey = ECKey.CURVE.getCurve().decodePoint(bytes);<NEW_LINE>message.nonce = new byte[32];<NEW_LINE>System.arraycopy(wire, offset, message.nonce, 0, 32);<NEW_LINE>offset += message.nonce.length;<NEW_LINE>byte tokenUsed = wire[offset];<NEW_LINE>offset += 1;<NEW_LINE>if (tokenUsed != 0x00 && tokenUsed != 0x01) {<NEW_LINE>// TODO specific exception<NEW_LINE>throw new RuntimeException("invalid boolean");<NEW_LINE>}<NEW_LINE>message.isTokenUsed = (tokenUsed == 0x01);<NEW_LINE>return message;<NEW_LINE>}
offset, bytes, 1, 64);
894,698
private void defaultSubstituteText(final JTextComponent c, final int offset, final int len, String toAdd) {<NEW_LINE>final String template = item.getCustomInsertTemplate();<NEW_LINE>if (template != null) {<NEW_LINE>final BaseDocument doc = (BaseDocument) c.getDocument();<NEW_LINE>final CodeTemplateManager ctm = CodeTemplateManager.get(doc);<NEW_LINE>if (ctm != null) {<NEW_LINE>doc.runAtomic(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>doc.remove(offset, len);<NEW_LINE>c.getCaret().setDot(offset);<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>// Can't update<NEW_LINE>}<NEW_LINE>// SHOULD be run here:<NEW_LINE>// ctm.createTemporary(template).insert(c);<NEW_LINE>// (see issue 147494) but running code template inserts<NEW_LINE>// under a document writelock is risky (see issue 147657)<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ctm.createTemporary(template).insert(c);<NEW_LINE>// TODO - set the actual method to be used here so I don't have to<NEW_LINE>// work quite as hard...<NEW_LINE>// tipProposal = item;<NEW_LINE>Completion.get().showToolTip();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>super.substituteText(<MASK><NEW_LINE>}
c, offset, len, toAdd);