idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
542,451
public boolean apply(Game game, Ability source) {<NEW_LINE>UUID opponentId = (UUID) this.getValue("PsychicSurgeryOpponent");<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Player opponent = game.getPlayer(opponentId);<NEW_LINE>if (controller != null && opponent != null) {<NEW_LINE>Cards cards = new CardsImpl(opponent.getLibrary().getTopCards(game, 2));<NEW_LINE>controller.lookAtCards(source, null, cards, game);<NEW_LINE>if (!cards.isEmpty() && controller.chooseUse(Outcome.Exile, "Exile a card?", source, game)) {<NEW_LINE>TargetCard target = new TargetCard(Zone.<MASK><NEW_LINE>if (controller.choose(Outcome.Exile, cards, target, game)) {<NEW_LINE>Card card = cards.get(target.getFirstTarget(), game);<NEW_LINE>if (card != null) {<NEW_LINE>controller.moveCards(card, Zone.EXILED, source, game);<NEW_LINE>cards.remove(card);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>controller.putCardsOnTopOfLibrary(cards, game, source, true);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
LIBRARY, new FilterCard("card to exile"));
216,717
// timeout property not supported in Rest Client 3.0 - use timeout method instead<NEW_LINE>@SkipForRepeat(MicroProfileActions.MP50_ID)<NEW_LINE>public void testReadTimeout(HttpServletRequest req, HttpServletResponse resp) throws Exception {<NEW_LINE>try {<NEW_LINE>builder.property("com.ibm.ws.jaxrs.client.receive.timeout", "5");<NEW_LINE>long startTime = System.nanoTime();<NEW_LINE>WaitServiceClient client = builder.build(WaitServiceClient.class);<NEW_LINE>try {<NEW_LINE>client.waitFor(20);<NEW_LINE>fail("Did not throw expected ProcessingException");<NEW_LINE>} catch (ProcessingException expected) {<NEW_LINE>LOG.info("Caught expected ProcessingException");<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOG.log(Level.SEVERE, "Caught unexpected exception", t);<NEW_LINE>fail("Caught unexpected exception: " + t);<NEW_LINE>}<NEW_LINE>long elapsedTime = System.nanoTime() - startTime;<NEW_LINE>long elapsedTimeSecs = TimeUnit.SECONDS.<MASK><NEW_LINE>LOG.info("waited >=" + elapsedTimeSecs + " seconds");<NEW_LINE>assertTrue("Did not time out when expected (5 secs) - instead waited at least 20 seconds.", elapsedTimeSecs < 20);<NEW_LINE>} finally {<NEW_LINE>builder.property("com.ibm.ws.jaxrs.client.receive.timeout", "120000");<NEW_LINE>}<NEW_LINE>}
convert(elapsedTime, TimeUnit.NANOSECONDS);
577,095
public void add(String groupKey, Object result) {<NEW_LINE>Comparable newKey = _aggregationFunction.extractFinalResult(result);<NEW_LINE>ImmutablePair<String, Object> groupKeyResultPair = new ImmutablePair<>(groupKey, result);<NEW_LINE>List<ImmutablePair<String, Object>> groupKeyResultPairs = _treeMap.get(newKey);<NEW_LINE>if (_numValuesAdded >= _trimSize) {<NEW_LINE>// Check whether the pair should be added<NEW_LINE>Map.Entry<Comparable, List<ImmutablePair<String, Object>>> maxEntry = _treeMap.lastEntry();<NEW_LINE>Comparable maxKey = maxEntry.getKey();<NEW_LINE>if (_comparator.compare(newKey, maxKey) < 0) {<NEW_LINE>// Add the pair into list of pairs<NEW_LINE>if (groupKeyResultPairs == null) {<NEW_LINE>groupKeyResultPairs = new ArrayList<>();<NEW_LINE>_treeMap.put(newKey, groupKeyResultPairs);<NEW_LINE>}<NEW_LINE>groupKeyResultPairs.add(groupKeyResultPair);<NEW_LINE>_numValuesAdded++;<NEW_LINE>// Check if the max key can be removed<NEW_LINE>if (maxEntry.getValue().size() + _trimSize == _numValuesAdded) {<NEW_LINE>_treeMap.remove(maxKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Pair should be added<NEW_LINE>if (groupKeyResultPairs == null) {<NEW_LINE>groupKeyResultPairs = new ArrayList<>();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>groupKeyResultPairs.add(groupKeyResultPair);<NEW_LINE>_numValuesAdded++;<NEW_LINE>}<NEW_LINE>}
_treeMap.put(newKey, groupKeyResultPairs);
4,462
protected WriteCellData<?> convert(CellWriteHandlerContext cellWriteHandlerContext) {<NEW_LINE>// This means that the user has defined the data.<NEW_LINE>if (cellWriteHandlerContext.getOriginalFieldClass() == WriteCellData.class) {<NEW_LINE>if (cellWriteHandlerContext.getOriginalValue() == null) {<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>WriteCellData<?> cellDataValue = (WriteCellData<?>) cellWriteHandlerContext.getOriginalValue();<NEW_LINE>if (cellDataValue.getType() != null) {<NEW_LINE>// Configuration information may not be read here<NEW_LINE>fillProperty(cellDataValue, cellWriteHandlerContext.getExcelContentProperty());<NEW_LINE>return cellDataValue;<NEW_LINE>} else {<NEW_LINE>if (cellDataValue.getData() == null) {<NEW_LINE>cellDataValue.setType(CellDataTypeEnum.EMPTY);<NEW_LINE>return cellDataValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>WriteCellData<?> cellDataReturn = doConvert(cellWriteHandlerContext);<NEW_LINE>if (cellDataValue.getImageDataList() != null) {<NEW_LINE>cellDataReturn.setImageDataList(cellDataValue.getImageDataList());<NEW_LINE>}<NEW_LINE>if (cellDataValue.getCommentData() != null) {<NEW_LINE>cellDataReturn.setCommentData(cellDataValue.getCommentData());<NEW_LINE>}<NEW_LINE>if (cellDataValue.getHyperlinkData() != null) {<NEW_LINE>cellDataReturn.setHyperlinkData(cellDataValue.getHyperlinkData());<NEW_LINE>}<NEW_LINE>// The formula information is subject to user input<NEW_LINE>if (cellDataValue.getFormulaData() != null) {<NEW_LINE>cellDataReturn.setFormulaData(cellDataValue.getFormulaData());<NEW_LINE>}<NEW_LINE>if (cellDataValue.getWriteCellStyle() != null) {<NEW_LINE>cellDataReturn.setWriteCellStyle(cellDataValue.getWriteCellStyle());<NEW_LINE>}<NEW_LINE>return cellDataReturn;<NEW_LINE>}<NEW_LINE>return doConvert(cellWriteHandlerContext);<NEW_LINE>}
WriteCellData<>(CellDataTypeEnum.EMPTY);
1,645,553
final GetContextKeysForCustomPolicyResult executeGetContextKeysForCustomPolicy(GetContextKeysForCustomPolicyRequest getContextKeysForCustomPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getContextKeysForCustomPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetContextKeysForCustomPolicyRequest> request = null;<NEW_LINE>Response<GetContextKeysForCustomPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetContextKeysForCustomPolicyRequestMarshaller().marshall(super.beforeMarshalling(getContextKeysForCustomPolicyRequest));<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, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetContextKeysForCustomPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetContextKeysForCustomPolicyResult> responseHandler = new StaxResponseHandler<GetContextKeysForCustomPolicyResult>(new GetContextKeysForCustomPolicyResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,280,322
protected Object doQuery(Object[] objs) {<NEW_LINE>List<String> result = null;<NEW_LINE>try {<NEW_LINE>if (objs == null || objs.length != 1) {<NEW_LINE>throw new Exception("chardet paramSize error!");<NEW_LINE>}<NEW_LINE>// check encoding for string<NEW_LINE>if (option != null && option.contains("v")) {<NEW_LINE>CharEncodingDetect detector = new CharEncodingDetect();<NEW_LINE>if (objs[0] instanceof String) {<NEW_LINE>String str = objs[0].toString();<NEW_LINE>result = detector.autoDetectEncoding(str.getBytes());<NEW_LINE>} else if (objs[0] instanceof byte[]) {<NEW_LINE>result = detector.autoDetectEncoding((byte[]) objs[0]);<NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (result.size() == 1) {<NEW_LINE>return result.get(0);<NEW_LINE>} else {<NEW_LINE>Sequence seq = new Sequence(result.toArray(new String[result.size()]));<NEW_LINE>return seq;<NEW_LINE>}<NEW_LINE>} else if (objs[0] instanceof String) {<NEW_LINE>String sTmp = objs[0].toString();<NEW_LINE>String reg = "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";<NEW_LINE>if (isMatch(sTmp, reg)) {<NEW_LINE>// for url<NEW_LINE>String encoding = detectEncoding(new URL(sTmp));<NEW_LINE>return encoding;<NEW_LINE>} else {<NEW_LINE>// for file<NEW_LINE>File file = new File(sTmp);<NEW_LINE>if (file.exists()) {<NEW_LINE>String <MASK><NEW_LINE>return encoding;<NEW_LINE>} else {<NEW_LINE>Logger.info("File: " + objs[0].toString() + " not existed.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (objs[0] instanceof FileObject) {<NEW_LINE>FileObject fo = (FileObject) objs[0];<NEW_LINE>// String charset = fo.getCharset();<NEW_LINE>IFile iff = fo.getFile();<NEW_LINE>if (iff.exists()) {<NEW_LINE>String encoding = UniversalDetector.detectCharset(iff.getInputStream());<NEW_LINE>return encoding;<NEW_LINE>} else {<NEW_LINE>Logger.info("File: " + objs[0].toString() + " not existed.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(e.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
encoding = UniversalDetector.detectCharset(file);
932,285
public void init() {<NEW_LINE>PendingWorkJobSearch = createSearchBuilder();<NEW_LINE>PendingWorkJobSearch.and("jobStatus", PendingWorkJobSearch.entity().getStatus(), Op.EQ);<NEW_LINE>PendingWorkJobSearch.and("vmType", PendingWorkJobSearch.entity().getVmType(), Op.EQ);<NEW_LINE>PendingWorkJobSearch.and("vmInstanceId", PendingWorkJobSearch.entity().getVmInstanceId(), Op.EQ);<NEW_LINE>PendingWorkJobSearch.done();<NEW_LINE>PendingWorkJobByCommandSearch = createSearchBuilder();<NEW_LINE>PendingWorkJobByCommandSearch.and("jobStatus", PendingWorkJobByCommandSearch.entity().<MASK><NEW_LINE>PendingWorkJobByCommandSearch.and("vmType", PendingWorkJobByCommandSearch.entity().getVmType(), Op.EQ);<NEW_LINE>PendingWorkJobByCommandSearch.and("vmInstanceId", PendingWorkJobByCommandSearch.entity().getVmInstanceId(), Op.EQ);<NEW_LINE>PendingWorkJobByCommandSearch.and("secondaryObjectIdentifier", PendingWorkJobByCommandSearch.entity().getSecondaryObjectIdentifier(), Op.EQ);<NEW_LINE>PendingWorkJobByCommandSearch.and("step", PendingWorkJobByCommandSearch.entity().getStep(), Op.NEQ);<NEW_LINE>PendingWorkJobByCommandSearch.and("cmd", PendingWorkJobByCommandSearch.entity().getCmd(), Op.EQ);<NEW_LINE>PendingWorkJobByCommandSearch.done();<NEW_LINE>ExpungingWorkJobSearch = createSearchBuilder();<NEW_LINE>ExpungingWorkJobSearch.and("jobStatus", ExpungingWorkJobSearch.entity().getStatus(), Op.NEQ);<NEW_LINE>ExpungingWorkJobSearch.and("cutDate", ExpungingWorkJobSearch.entity().getLastUpdated(), Op.LT);<NEW_LINE>ExpungingWorkJobSearch.and("dispatcher", ExpungingWorkJobSearch.entity().getDispatcher(), Op.EQ);<NEW_LINE>ExpungingWorkJobSearch.done();<NEW_LINE>}
getStatus(), Op.EQ);
199,235
final CreateTrustResult executeCreateTrust(CreateTrustRequest createTrustRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTrustRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTrustRequest> request = null;<NEW_LINE>Response<CreateTrustResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTrustRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTrustRequest));<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, "Directory Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTrust");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateTrustResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTrustResultJsonUnmarshaller());<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,362,414
private void initializeSystemMonitor(String variant) {<NEW_LINE>if (sigarImpl == null) {<NEW_LINE>Sigar.variant = variant;<NEW_LINE>sigarImpl = new Sigar();<NEW_LINE>}<NEW_LINE>if (sigar == null) {<NEW_LINE>sigar = SigarProxyCache.newInstance(sigarImpl, 1000);<NEW_LINE>}<NEW_LINE>logger.info("Using Sigar version {}", Sigar.VERSION_STRING);<NEW_LINE>logger.info("Using native version {}", Sigar.NATIVE_VERSION_STRING);<NEW_LINE>try {<NEW_LINE>String[] interfaces = sigar.getNetInterfaceList();<NEW_LINE>logger.debug("valid net interfaces: {}", Arrays.toString(interfaces));<NEW_LINE>FileSystem[] filesystems = sigar.getFileSystemList();<NEW_LINE>logger.debug("file systems: {}", Arrays.toString(filesystems));<NEW_LINE>List<String> disks = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < filesystems.length; i++) {<NEW_LINE>FileSystem fs = filesystems[i];<NEW_LINE>if (fs.getType() == FileSystem.TYPE_LOCAL_DISK) {<NEW_LINE>disks.add(fs.getDevName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.debug("valid disk names: {}", Arrays.toString<MASK><NEW_LINE>} catch (SigarException e) {<NEW_LINE>logger.error("System monitor error:", e);<NEW_LINE>}<NEW_LINE>}
(disks.toArray()));
1,833,764
public boolean executeCommand(final String args) {<NEW_LINE>// get filenames<NEW_LINE>final String sourceID = getProp().getPropertyString(ScriptProperties.SEGREGATE_CONFIG_SOURCE_FILE);<NEW_LINE>final File sourceFile = getScript().resolveFilename(sourceID);<NEW_LINE>EncogLogging.log(EncogLogging.LEVEL_DEBUG, "Beginning segregate");<NEW_LINE>EncogLogging.log(EncogLogging.LEVEL_DEBUG, "source file:" + sourceID);<NEW_LINE>// get formats<NEW_LINE>final CSVFormat format = getScript().determineFormat();<NEW_LINE>// prepare to segregate<NEW_LINE>final boolean headers = <MASK><NEW_LINE>final SegregateCSV seg = new SegregateCSV();<NEW_LINE>seg.setScript(getScript());<NEW_LINE>getAnalyst().setCurrentQuantTask(seg);<NEW_LINE>for (final AnalystSegregateTarget target : getScript().getSegregate().getSegregateTargets()) {<NEW_LINE>final File filename = getScript().resolveFilename(target.getFile());<NEW_LINE>seg.getTargets().add(new SegregateTargetPercent(filename, target.getPercent()));<NEW_LINE>// mark generated<NEW_LINE>getScript().markGenerated(target.getFile());<NEW_LINE>EncogLogging.log(EncogLogging.LEVEL_DEBUG, "target file:" + target.getFile() + ", Percent: " + Format.formatPercent(target.getPercent()));<NEW_LINE>}<NEW_LINE>seg.setReport(new AnalystReportBridge(getAnalyst()));<NEW_LINE>seg.analyze(sourceFile, headers, format);<NEW_LINE>seg.process();<NEW_LINE>getAnalyst().setCurrentQuantTask(null);<NEW_LINE>return seg.shouldStop();<NEW_LINE>}
getScript().expectInputHeaders(sourceID);
1,562,920
public static void main(String[] args) throws Exception {<NEW_LINE>print("Hello");<NEW_LINE>print("World");<NEW_LINE>System.out.println("Annotations: " + Foo.class.getDeclaredField("i"));<NEW_LINE>System.out.println("Annotations: " + Foo.class.getDeclaredField("i"));<NEW_LINE>System.out.println("Annotations: " + Foo<MASK><NEW_LINE>System.out.println("Annotations: " + Foo.class.getDeclaredField("i"));<NEW_LINE>System.out.println("Annotations: " + Foo.class.getDeclaredField("i").getAnnotation(Wiggle.class));<NEW_LINE>System.out.println("Annotations: " + Foo.class.getDeclaredField("i").getAnnotation(Wiggle.class));<NEW_LINE>System.out.println("Annotations: " + Foo.class.getDeclaredField("i").getAnnotation(Wiggle.class));<NEW_LINE>System.out.println("Annotations: " + Foo.class.getDeclaredField("i").getAnnotation(Wiggle.class));<NEW_LINE>System.out.println("Annotations: " + Foo.class.getDeclaredField("i").getAnnotation(Wiggle.class));<NEW_LINE>System.out.println("Annotations: " + Foo.class.getDeclaredField("i").getAnnotation(Wiggle.class));<NEW_LINE>}
.class.getDeclaredField("i"));
1,128,367
public Future<RowSet> query(String sql, List<Object> params) {<NEW_LINE>return Future.future(new Handler<Promise<RowSet>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(Promise<RowSet> rowSetPromise) {<NEW_LINE>prepareQuery(sql, params, new MysqlCollector() {<NEW_LINE><NEW_LINE>MycatRowMetaData mycatRowMetaData;<NEW_LINE><NEW_LINE>ArrayList<Object[]> <MASK><NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onColumnDef(MycatRowMetaData mycatRowMetaData) {<NEW_LINE>this.mycatRowMetaData = mycatRowMetaData;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRow(Object[] row) {<NEW_LINE>objects.add(row);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete() {<NEW_LINE>RowSet rowSet = new RowSet(mycatRowMetaData, objects);<NEW_LINE>rowSetPromise.tryComplete(rowSet);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable e) {<NEW_LINE>rowSetPromise.fail(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
objects = new ArrayList<>();
361,922
public com.amazonaws.services.memorydb.model.SubnetGroupNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.memorydb.model.SubnetGroupNotFoundException subnetGroupNotFoundException = new com.amazonaws.services.memorydb.model.SubnetGroupNotFoundException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return subnetGroupNotFoundException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,197,764
public Multimap<Node, Split> computeAssignments(List<Split> splits, List<RemoteTask> existingTasks) {<NEW_LINE>Multimap<Node, Split> assignment = HashMultimap.create();<NEW_LINE>NodeAssignmentStats assignmentStats = new NodeAssignmentStats(nodeTaskMap, workerNodes, existingTasks);<NEW_LINE>ResettableRandomizedIterator<Node> randomCandidates = new ResettableRandomizedIterator<>(workerNodes);<NEW_LINE>List<Node> candidateNodes = selectNodes(limitCandidates, randomCandidates, assignmentStats);<NEW_LINE>if (candidateNodes.isEmpty()) {<NEW_LINE>log.error(String.format("No nodes available to schedule."));<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_NO_NODES_AVAILABLE, "No nodes available to run query");<NEW_LINE>}<NEW_LINE>ResettableRandomizedIterator<Node> nodeIterator = new ResettableRandomizedIterator(candidateNodes);<NEW_LINE>for (Split split : splits) {<NEW_LINE>if (!nodeIterator.hasNext()) {<NEW_LINE>nodeIterator.reset();<NEW_LINE>}<NEW_LINE>Node chosenNode = nodeIterator.next();<NEW_LINE>if (chosenNode != null) {<NEW_LINE>assignment.put(chosenNode, split);<NEW_LINE>assignmentStats.addAssignedSplit(chosenNode);<NEW_LINE>} else {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return assignment;<NEW_LINE>}
TddlRuntimeException(ErrorCode.ERR_NO_NODES_AVAILABLE, "No nodes available to run query");
1,387,982
private void initPublicPackageTable() {<NEW_LINE>publicPkgsTable.setModel(getProperties().getPublicPackagesModel());<NEW_LINE>publicPkgsTable.getColumnModel().getColumn(0).setMaxWidth(CHECKBOX_WIDTH + 20);<NEW_LINE>publicPkgsTable.setRowHeight(publicPkgsTable.getFontMetrics(publicPkgsTable.getFont()).getHeight() + (2 * publicPkgsTable.getRowMargin()));<NEW_LINE>publicPkgsTable.setTableHeader(null);<NEW_LINE>publicPkgsTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);<NEW_LINE>publicPkgsSP.getViewport().setBackground(publicPkgsTable.getBackground());<NEW_LINE>final Action switchAction = new AbstractAction() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent e) {<NEW_LINE><MASK><NEW_LINE>if (row == -1) {<NEW_LINE>// Nothing selected; e.g. user has tabbed into the table but not pressed Down key.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Boolean b = (Boolean) publicPkgsTable.getValueAt(row, 0);<NEW_LINE>publicPkgsTable.setValueAt(Boolean.valueOf(!b.booleanValue()), row, 0);<NEW_LINE>checkValidity();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>publicPkgsTable.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>public void mouseClicked(MouseEvent e) {<NEW_LINE>switchAction.actionPerformed(null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// NOI18N<NEW_LINE>publicPkgsTable.getInputMap().// NOI18N<NEW_LINE>put(// NOI18N<NEW_LINE>KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "startEditing");<NEW_LINE>// NOI18N<NEW_LINE>publicPkgsTable.getActionMap().put("startEditing", switchAction);<NEW_LINE>checkPublicPackagesSelectionButtons();<NEW_LINE>}
int row = publicPkgsTable.getSelectedRow();
648,233
private static // #284<NEW_LINE>void // #284<NEW_LINE>checkTableID(// #284<NEW_LINE>Properties ctx, // #284<NEW_LINE>SvrProcess sp, boolean onlyADSequence) {<NEW_LINE>int IDRangeEnd = DB.getSQLValue(null, "SELECT IDRangeEnd FROM AD_System");<NEW_LINE>if (IDRangeEnd <= 0)<NEW_LINE>IDRangeEnd = DB.getSQLValue(null, "SELECT MIN(IDRangeStart)-1 FROM AD_Replication");<NEW_LINE>s_log.info("IDRangeEnd = " + IDRangeEnd);<NEW_LINE>//<NEW_LINE>String sql = "SELECT * FROM AD_Sequence " + "WHERE IsTableID='Y' ";<NEW_LINE>if (onlyADSequence) {<NEW_LINE>// HARDCODED: AD_Sequence #284<NEW_LINE>sql += " AND AD_Sequence_ID = 16 ";<NEW_LINE>}<NEW_LINE>sql += "ORDER BY Name";<NEW_LINE>int counter = 0;<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>String trxName = null;<NEW_LINE>if (sp != null)<NEW_LINE>trxName = sp.get_TrxName();<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, trxName);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>MSequence seq = new MSequence(ctx, rs, trxName);<NEW_LINE>int old = seq.getCurrentNext();<NEW_LINE>int oldSys = seq.getCurrentNextSys();<NEW_LINE>if (seq.validateTableIDValue()) {<NEW_LINE>if (seq.getCurrentNext() != old) {<NEW_LINE>String msg = seq.getName() + " ID " + old <MASK><NEW_LINE>if (sp != null)<NEW_LINE>sp.addLog(0, null, null, msg);<NEW_LINE>else<NEW_LINE>s_log.fine(msg);<NEW_LINE>}<NEW_LINE>if (seq.getCurrentNextSys() != oldSys) {<NEW_LINE>String msg = seq.getName() + " Sys " + oldSys + " -> " + seq.getCurrentNextSys();<NEW_LINE>if (sp != null)<NEW_LINE>sp.addLog(0, null, null, msg);<NEW_LINE>else<NEW_LINE>s_log.fine(msg);<NEW_LINE>}<NEW_LINE>if (seq.save())<NEW_LINE>counter++;<NEW_LINE>else<NEW_LINE>s_log.severe("Not updated: " + seq);<NEW_LINE>}<NEW_LINE>// else if (CLogMgt.isLevel(6))<NEW_LINE>// log.fine("checkTableID - skipped " + tableName);<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>pstmt = null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_log.log(Level.SEVERE, sql, e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (pstmt != null)<NEW_LINE>pstmt.close();<NEW_LINE>pstmt = null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>s_log.fine("#" + counter);<NEW_LINE>}
+ " -> " + seq.getCurrentNext();
528,898
private Jdk14HandlerAccessor wrapHandler(Object handler, int index) {<NEW_LINE>try {<NEW_LINE>if (handler == null) {<NEW_LINE>throw new IllegalArgumentException("handler is null");<NEW_LINE>}<NEW_LINE>Jdk14HandlerAccessor handlerAccessor = null;<NEW_LINE>String className = handler<MASK><NEW_LINE>if ("org.apache.juli.FileHandler".equals(className)) {<NEW_LINE>handlerAccessor = new JuliHandlerAccessor();<NEW_LINE>} else if ("java.util.logging.ConsoleHandler".equals(className)) {<NEW_LINE>handlerAccessor = new Jdk14HandlerAccessor();<NEW_LINE>} else if ("java.util.logging.FileHandler".equals(className)) {<NEW_LINE>handlerAccessor = new Jdk14FileHandlerAccessor();<NEW_LINE>}<NEW_LINE>if (handlerAccessor != null) {<NEW_LINE>handlerAccessor.setLoggerAccessor(this);<NEW_LINE>handlerAccessor.setTarget(handler);<NEW_LINE>handlerAccessor.setIndex(Integer.toString(index));<NEW_LINE>handlerAccessor.setApplication(getApplication());<NEW_LINE>}<NEW_LINE>return handlerAccessor;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Could not wrap handler: '{}'", handler, e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
.getClass().getName();
1,165,268
private void parseFolderArray(List<String> parentNames, String name, JsonArray arrayValue) {<NEW_LINE>if (name == null)<NEW_LINE>name = AppConstants.ROOT_FOLDER;<NEW_LINE>List<String> children = new ArrayList<String>();<NEW_LINE>List<String> feedIds = new ArrayList<String>();<NEW_LINE>for (JsonElement jsonElement : arrayValue) {<NEW_LINE>// a folder array contains either feed IDs or nested folder objects<NEW_LINE>if (jsonElement.isJsonPrimitive()) {<NEW_LINE>feedIds.add(jsonElement.getAsString());<NEW_LINE>} else if (jsonElement.isJsonObject()) {<NEW_LINE>// if it wasn't a feed ID, it is a nested folder object<NEW_LINE>Set<Entry<String, JsonElement>> entrySet = ((<MASK><NEW_LINE>// recurse - nested folders are just objects with (usually one) field named for the folder<NEW_LINE>// that is a list of contained feeds or additional folders<NEW_LINE>for (Entry<String, JsonElement> next : entrySet) {<NEW_LINE>String nextName = next.getKey();<NEW_LINE>children.add(nextName);<NEW_LINE>List<String> appendedParentList = new ArrayList<String>(parentNames);<NEW_LINE>appendedParentList.add(name);<NEW_LINE>parseFolderArray(appendedParentList, nextName, (JsonArray) next.getValue());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.w(this.getClass().getName(), "folder had null or malformed child: " + name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Folder folder = new Folder();<NEW_LINE>folder.name = name;<NEW_LINE>folder.parents = parentNames;<NEW_LINE>folder.children = children;<NEW_LINE>folder.feedIds = feedIds;<NEW_LINE>folders.add(folder);<NEW_LINE>}
JsonObject) jsonElement).entrySet();
710,790
private void bitrv216(float[] a, int offa) {<NEW_LINE>float x1r, x1i, x2r, x2i, x3r, x3i, x4r, x4i, x5r, x5i, x7r, x7i, x8r, x8i, x10r, x10i, x11r, x11i, x12r, x12i, x13r, x13i, x14r, x14i;<NEW_LINE>x1r = a[offa + 2];<NEW_LINE>x1i = a[offa + 3];<NEW_LINE><MASK><NEW_LINE>x2i = a[offa + 5];<NEW_LINE>x3r = a[offa + 6];<NEW_LINE>x3i = a[offa + 7];<NEW_LINE>x4r = a[offa + 8];<NEW_LINE>x4i = a[offa + 9];<NEW_LINE>x5r = a[offa + 10];<NEW_LINE>x5i = a[offa + 11];<NEW_LINE>x7r = a[offa + 14];<NEW_LINE>x7i = a[offa + 15];<NEW_LINE>x8r = a[offa + 16];<NEW_LINE>x8i = a[offa + 17];<NEW_LINE>x10r = a[offa + 20];<NEW_LINE>x10i = a[offa + 21];<NEW_LINE>x11r = a[offa + 22];<NEW_LINE>x11i = a[offa + 23];<NEW_LINE>x12r = a[offa + 24];<NEW_LINE>x12i = a[offa + 25];<NEW_LINE>x13r = a[offa + 26];<NEW_LINE>x13i = a[offa + 27];<NEW_LINE>x14r = a[offa + 28];<NEW_LINE>x14i = a[offa + 29];<NEW_LINE>a[offa + 2] = x8r;<NEW_LINE>a[offa + 3] = x8i;<NEW_LINE>a[offa + 4] = x4r;<NEW_LINE>a[offa + 5] = x4i;<NEW_LINE>a[offa + 6] = x12r;<NEW_LINE>a[offa + 7] = x12i;<NEW_LINE>a[offa + 8] = x2r;<NEW_LINE>a[offa + 9] = x2i;<NEW_LINE>a[offa + 10] = x10r;<NEW_LINE>a[offa + 11] = x10i;<NEW_LINE>a[offa + 14] = x14r;<NEW_LINE>a[offa + 15] = x14i;<NEW_LINE>a[offa + 16] = x1r;<NEW_LINE>a[offa + 17] = x1i;<NEW_LINE>a[offa + 20] = x5r;<NEW_LINE>a[offa + 21] = x5i;<NEW_LINE>a[offa + 22] = x13r;<NEW_LINE>a[offa + 23] = x13i;<NEW_LINE>a[offa + 24] = x3r;<NEW_LINE>a[offa + 25] = x3i;<NEW_LINE>a[offa + 26] = x11r;<NEW_LINE>a[offa + 27] = x11i;<NEW_LINE>a[offa + 28] = x7r;<NEW_LINE>a[offa + 29] = x7i;<NEW_LINE>}
x2r = a[offa + 4];
669,427
public <A, B> double dependence(NumberArrayAdapter<?, A> adapter1, A data1, NumberArrayAdapter<?, B> adapter2, B data2) {<NEW_LINE>final int len = Utils.size(adapter1, data1, adapter2, data2);<NEW_LINE>// Get attribute value range:<NEW_LINE>final double off1, scale1, off2, scale2;<NEW_LINE>{<NEW_LINE>double mi = adapter1.getDouble(data1, 0), ma = mi;<NEW_LINE>for (int i = 1; i < len; ++i) {<NEW_LINE>double v = adapter1.getDouble(data1, i);<NEW_LINE>mi = v < mi ? v : mi;<NEW_LINE>ma = v > ma ? v : ma;<NEW_LINE>}<NEW_LINE>off1 = mi;<NEW_LINE>scale1 = (ma > mi) ? (1. / (ma - mi)) : 1.;<NEW_LINE>// Second data<NEW_LINE>mi = ma = adapter2.getDouble(data2, 0);<NEW_LINE>for (int i = 1; i < len; ++i) {<NEW_LINE>double v = adapter2.getDouble(data2, i);<NEW_LINE>mi = v < mi ? v : mi;<NEW_LINE>ma = v > ma ? v : ma;<NEW_LINE>}<NEW_LINE>off2 = mi;<NEW_LINE>scale2 = (ma > mi) ? (1. / (ma - mi)) : 1.;<NEW_LINE>}<NEW_LINE>// Collect angular histograms.<NEW_LINE>// Note, we only fill half of the matrix<NEW_LINE>int[] angles = new int[PRECISION];<NEW_LINE>// Scratch buffer<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>double x = adapter1.getDouble(data1, i), y = adapter2.getDouble(data2, i);<NEW_LINE>x = (x - off1) * scale1;<NEW_LINE>y = (y - off2) * scale2;<NEW_LINE>final double delta = x - y + 1;<NEW_LINE>int div = (int) <MASK><NEW_LINE>// TODO: do we really need this check?<NEW_LINE>div = (div < 0) ? 0 : (div >= PRECISION) ? PRECISION - 1 : div;<NEW_LINE>angles[div] += 1;<NEW_LINE>}<NEW_LINE>// Compute entropy:<NEW_LINE>double entropy = 0.;<NEW_LINE>for (int l = 0; l < PRECISION; l++) {<NEW_LINE>if (angles[l] > 0) {<NEW_LINE>final double p = angles[l] / (double) len;<NEW_LINE>entropy += p * FastMath.log(p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 1 + entropy / LOG_PRECISION;<NEW_LINE>}
Math.round(delta * RESCALE);
778,301
protected void renderTransmissionDynamic(@Nonnull IConduit conduit, @Nonnull IConduitTexture tex, @Nullable Vector4f color, @Nonnull CollidableComponent component, float selfIllum) {<NEW_LINE>final float filledRatio = ((LiquidConduit) conduit).getTank().getFilledRatio();<NEW_LINE>if (filledRatio <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (component.isDirectional()) {<NEW_LINE>TextureAtlasSprite sprite = tex.getSprite();<NEW_LINE>BoundingBox[] cubes = toCubes(component.bound);<NEW_LINE>for (BoundingBox cube : cubes) {<NEW_LINE>if (cube != null) {<NEW_LINE>float shrink = 1 / 128f;<NEW_LINE>final EnumFacing componentDirection = component.getDirection();<NEW_LINE>float xLen = Math.abs(componentDirection.getFrontOffsetX()) == 1 ? 0 : shrink;<NEW_LINE>float yLen = Math.abs(componentDirection.getFrontOffsetY()) == 1 ? 0 : shrink;<NEW_LINE>float zLen = Math.abs(componentDirection.getFrontOffsetZ(<MASK><NEW_LINE>BoundingBox bb = cube.expand(-xLen, -yLen, -zLen);<NEW_LINE>// TODO: This leaves holes between conduits as it only render 4 sides instead of the needed 5-6 sides<NEW_LINE>drawDynamicSection(bb, sprite.getInterpolatedU(tex.getUv().x * 16), sprite.getInterpolatedU(tex.getUv().z * 16), sprite.getInterpolatedV(tex.getUv().y * 16), sprite.getInterpolatedV(tex.getUv().w * 16), color, componentDirection, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// TODO: HL: I commented this out because component.getDirection() (the second to last parameter) is always null in<NEW_LINE>// this else branch and drawDynamicSection() with isTransmission=true (last parameter) would NPE on it. (Not a<NEW_LINE>// mistake in the component.dir encapsulation, this was that way before.)<NEW_LINE>// drawDynamicSection(component.bound, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV(), color, component.getDir(), true);<NEW_LINE>}<NEW_LINE>}
)) == 1 ? 0 : shrink;
96,223
protected boolean applyInstallProperties(Map<String, List<String[]>> install_properties, String prefix, File to_file) {<NEW_LINE>boolean defer_restart = false;<NEW_LINE>if (to_file.isDirectory()) {<NEW_LINE>File[] files = to_file.listFiles();<NEW_LINE>if (files != null) {<NEW_LINE>for (int i = 0; i < files.length; i++) {<NEW_LINE>File file = files[i];<NEW_LINE><MASK><NEW_LINE>if (file_name.equals(".") || file_name.equals("..")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String new_prefix = prefix + "/" + file_name;<NEW_LINE>boolean match = false;<NEW_LINE>for (String s : install_properties.keySet()) {<NEW_LINE>if (s.startsWith(new_prefix)) {<NEW_LINE>match = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (match) {<NEW_LINE>if (applyInstallProperties(install_properties, new_prefix, files[i])) {<NEW_LINE>defer_restart = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>List<String[]> commands = install_properties.get(prefix);<NEW_LINE>if (commands != null) {<NEW_LINE>for (String[] command : commands) {<NEW_LINE>String cmd = command[1];<NEW_LINE>if (cmd.equals("chmod")) {<NEW_LINE>if (!Constants.isWindows) {<NEW_LINE>runCommand(new String[] { "chmod", command[2], to_file.getAbsolutePath().replaceAll(" ", "\\ ") });<NEW_LINE>}<NEW_LINE>} else if (cmd.equals("rm")) {<NEW_LINE>log.log("Deleting " + to_file);<NEW_LINE>to_file.delete();<NEW_LINE>} else if (cmd.equals("defer_restart")) {<NEW_LINE>defer_restart = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (defer_restart);<NEW_LINE>}
String file_name = file.getName();
344,980
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller != null) {<NEW_LINE>Set<Card> cardsToExile = new HashSet<>(this.getTargetPointer().getTargets(game, source).size());<NEW_LINE>for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {<NEW_LINE>Card card = controller.getGraveyard().get(targetId, game);<NEW_LINE>if (card != null) {<NEW_LINE>cardsToExile.add(card);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>controller.moveCardsToExile(cardsToExile, source, game, true, null, "");<NEW_LINE>for (Card card : cardsToExile) {<NEW_LINE>if (game.getState().getZone(card.getId()) == Zone.EXILED) {<NEW_LINE>// create token and modify all attributes permanently (without game usage)<NEW_LINE>EmptyToken token = new EmptyToken();<NEW_LINE>CardUtil.copyTo(token).from(card, game);<NEW_LINE>token.removePTCDA();<NEW_LINE>token.getPower().modifyBaseValue(4);<NEW_LINE>token.getToughness().modifyBaseValue(4);<NEW_LINE>token.getColor().setColor(ObjectColor.BLACK);<NEW_LINE>token.removeAllCreatureTypes();<NEW_LINE><MASK><NEW_LINE>token.putOntoBattlefield(1, game, source, source.getControllerId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
token.addSubType(SubType.ZOMBIE);
86,539
private void addTrainedModelStats(GetTrainedModelsAction.Response modelsResponse, GetTrainedModelsStatsAction.Response statsResponse, Map<String, Object> inferenceUsage) {<NEW_LINE>List<TrainedModelConfig> trainedModelConfigs = modelsResponse.getResources().results();<NEW_LINE>Map<String, GetTrainedModelsStatsAction.Response.TrainedModelStats> statsToModelId = statsResponse.getResources().results().stream().collect(Collectors.toMap(GetTrainedModelsStatsAction.Response.TrainedModelStats::getModelId, Function.identity()));<NEW_LINE>Map<String, Object> trainedModelsUsage = new HashMap<>();<NEW_LINE>trainedModelsUsage.put(MachineLearningFeatureSetUsage.ALL, createCountUsageEntry(trainedModelConfigs.size()));<NEW_LINE>StatsAccumulator estimatedOperations = new StatsAccumulator();<NEW_LINE>StatsAccumulator estimatedMemoryUsageBytes = new StatsAccumulator();<NEW_LINE>int createdByAnalyticsCount = 0;<NEW_LINE>Map<String, Counter> inferenceConfigCounts = new LinkedHashMap<>();<NEW_LINE>int prepackagedCount = 0;<NEW_LINE>for (TrainedModelConfig trainedModelConfig : trainedModelConfigs) {<NEW_LINE>if (trainedModelConfig.getTags().contains("prepackaged")) {<NEW_LINE>prepackagedCount++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>InferenceConfig inferenceConfig = trainedModelConfig.getInferenceConfig();<NEW_LINE>if (inferenceConfig != null) {<NEW_LINE>inferenceConfigCounts.computeIfAbsent(inferenceConfig.getName(), s -> Counter.newCounter()).addAndGet(1);<NEW_LINE>}<NEW_LINE>if (trainedModelConfig.getMetadata() != null && trainedModelConfig.getMetadata().containsKey("analytics_config")) {<NEW_LINE>createdByAnalyticsCount++;<NEW_LINE>}<NEW_LINE>estimatedOperations.add(trainedModelConfig.getEstimatedOperations());<NEW_LINE>if (statsToModelId.containsKey(trainedModelConfig.getModelId())) {<NEW_LINE>estimatedMemoryUsageBytes.add(statsToModelId.get(trainedModelConfig.getModelId()).getModelSizeStats().getModelSizeBytes());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, Object> counts = new HashMap<>();<NEW_LINE>counts.put("total", trainedModelConfigs.size());<NEW_LINE>inferenceConfigCounts.forEach((configName, count) -> counts.put(configName, count.get()));<NEW_LINE>counts.put("prepackaged", prepackagedCount);<NEW_LINE>counts.put("other", trainedModelConfigs.size() - createdByAnalyticsCount - prepackagedCount);<NEW_LINE>trainedModelsUsage.put("count", counts);<NEW_LINE>trainedModelsUsage.put(TrainedModelConfig.ESTIMATED_OPERATIONS.getPreferredName(), estimatedOperations.asMap());<NEW_LINE>trainedModelsUsage.put(TrainedModelConfig.MODEL_SIZE_BYTES.getPreferredName(<MASK><NEW_LINE>inferenceUsage.put("trained_models", trainedModelsUsage);<NEW_LINE>}
), estimatedMemoryUsageBytes.asMap());
673,952
public void actionPerformed(ActionEvent e) {<NEW_LINE>log.config("Action=" + e.getActionCommand());<NEW_LINE>if (m_actionActive)<NEW_LINE>return;<NEW_LINE>m_actionActive = true;<NEW_LINE>log.config("Action=" + e.getActionCommand());<NEW_LINE>// Order<NEW_LINE>if (e.getSource().equals(orderField)) {<NEW_LINE>KeyNamePair pp = (KeyNamePair) orderField.getSelectedItem();<NEW_LINE>int C_Order_ID = 0;<NEW_LINE>if (pp != null)<NEW_LINE>C_Order_ID = pp.getKey();<NEW_LINE>// set Invoice, RMA and Shipment to Null<NEW_LINE>rmaField.setSelectedIndex(-1);<NEW_LINE>invoiceField.setSelectedIndex(-1);<NEW_LINE>loadOrder(C_Order_ID, false, locatorField.getValue() != null ? ((Integer) locatorField.getValue()).intValue() : 0);<NEW_LINE>} else // Invoice<NEW_LINE>if (e.getSource().equals(invoiceField)) {<NEW_LINE>KeyNamePair pp = <MASK><NEW_LINE>int C_Invoice_ID = 0;<NEW_LINE>if (pp != null)<NEW_LINE>C_Invoice_ID = pp.getKey();<NEW_LINE>// set Order, RMA to Null<NEW_LINE>orderField.setSelectedIndex(-1);<NEW_LINE>rmaField.setSelectedIndex(-1);<NEW_LINE>loadInvoice(C_Invoice_ID, locatorField.getValue() != null ? ((Integer) locatorField.getValue()).intValue() : 0);<NEW_LINE>} else // RMA<NEW_LINE>if (e.getSource().equals(rmaField)) {<NEW_LINE>KeyNamePair pp = (KeyNamePair) rmaField.getSelectedItem();<NEW_LINE>int M_RMA_ID = 0;<NEW_LINE>if (pp != null)<NEW_LINE>M_RMA_ID = pp.getKey();<NEW_LINE>// set Order and Invoice to Null<NEW_LINE>orderField.setSelectedIndex(-1);<NEW_LINE>invoiceField.setSelectedIndex(-1);<NEW_LINE>loadRMA(M_RMA_ID, locatorField.getValue() != null ? ((Integer) locatorField.getValue()).intValue() : 0);<NEW_LINE>} else // sameWarehouseCb<NEW_LINE>if (e.getSource().equals(sameWarehouseCb)) {<NEW_LINE>initBPOrderDetails(((Integer) bPartnerField.getValue()).intValue(), false);<NEW_LINE>} else if (e.getSource().equals(upcField)) {<NEW_LINE>checkProductUsingUPC();<NEW_LINE>}<NEW_LINE>m_actionActive = false;<NEW_LINE>}
(KeyNamePair) invoiceField.getSelectedItem();
189,448
public void writeEntryHeader(byte[] outbuf) {<NEW_LINE>int offset = 0;<NEW_LINE>offset = TarHeader.getNameBytes(this.header.name, outbuf, offset, TarHeader.NAMELEN);<NEW_LINE>offset = Octal.getOctalBytes(this.header.mode, outbuf, offset, TarHeader.MODELEN);<NEW_LINE>offset = Octal.getOctalBytes(this.header.userId, outbuf, offset, TarHeader.UIDLEN);<NEW_LINE>offset = Octal.getOctalBytes(this.header.groupId, outbuf, offset, TarHeader.GIDLEN);<NEW_LINE>long size = this.header.size;<NEW_LINE>offset = Octal.getLongOctalBytes(size, <MASK><NEW_LINE>offset = Octal.getLongOctalBytes(this.header.modTime, outbuf, offset, TarHeader.MODTIMELEN);<NEW_LINE>int csOffset = offset;<NEW_LINE>for (int c = 0; c < TarHeader.CHKSUMLEN; ++c) outbuf[offset++] = (byte) ' ';<NEW_LINE>outbuf[offset++] = this.header.linkFlag;<NEW_LINE>offset = TarHeader.getNameBytes(this.header.linkName, outbuf, offset, TarHeader.NAMELEN);<NEW_LINE>offset = TarHeader.getNameBytes(this.header.magic, outbuf, offset, TarHeader.MAGICLEN);<NEW_LINE>offset = TarHeader.getNameBytes(this.header.userName, outbuf, offset, TarHeader.UNAMELEN);<NEW_LINE>offset = TarHeader.getNameBytes(this.header.groupName, outbuf, offset, TarHeader.GNAMELEN);<NEW_LINE>offset = Octal.getOctalBytes(this.header.devMajor, outbuf, offset, TarHeader.DEVLEN);<NEW_LINE>offset = Octal.getOctalBytes(this.header.devMinor, outbuf, offset, TarHeader.DEVLEN);<NEW_LINE>int oblen = outbuf.length;<NEW_LINE>for (; offset < oblen; ) outbuf[offset++] = 0;<NEW_LINE>long checkSum = this.computeCheckSum(outbuf);<NEW_LINE>Octal.getCheckSumOctalBytes(checkSum, outbuf, csOffset, TarHeader.CHKSUMLEN);<NEW_LINE>}
outbuf, offset, TarHeader.SIZELEN);
792,730
public static void interleavedToBuffered(InterleavedU8 src, DataBufferInt buffer, WritableRaster dst) {<NEW_LINE>if (src.getNumBands() != dst.getNumBands())<NEW_LINE>throw new IllegalArgumentException("Unequal number of bands src = " + src.getNumBands() + " dst = " + dst.getNumBands());<NEW_LINE>final int[] dstData = buffer.getData();<NEW_LINE>final int numBands = dst.getNumBands();<NEW_LINE>int dstStride = stride(dst);<NEW_LINE>int dstOffset = getOffset(dst);<NEW_LINE>if (numBands == 3) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, y -> {<NEW_LINE>for (int y = 0; y < src.height; y++) {<NEW_LINE>int indexSrc = src.startIndex + y * src.stride;<NEW_LINE>int indexDst = dstOffset + y * dstStride;<NEW_LINE>for (int x = 0; x < src.width; x++) {<NEW_LINE>int c1 = src.data[indexSrc++] & 0xFF;<NEW_LINE>int c2 = src.data[indexSrc++] & 0xFF;<NEW_LINE>int c3 = src.data[indexSrc++] & 0xFF;<NEW_LINE>dstData[indexDst++] = c1 <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else if (numBands == 4) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, y -> {<NEW_LINE>for (int y = 0; y < src.height; y++) {<NEW_LINE>int indexSrc = src.startIndex + y * src.stride;<NEW_LINE>int indexDst = dstOffset + y * dstStride;<NEW_LINE>for (int x = 0; x < src.width; x++) {<NEW_LINE>int c1 = src.data[indexSrc++] & 0xFF;<NEW_LINE>int c2 = src.data[indexSrc++] & 0xFF;<NEW_LINE>int c3 = src.data[indexSrc++] & 0xFF;<NEW_LINE>int c4 = src.data[indexSrc++] & 0xFF;<NEW_LINE>dstData[indexDst++] = c1 << 24 | c2 << 16 | c3 << 8 | c4;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Code more here");<NEW_LINE>}<NEW_LINE>}
<< 16 | c2 << 8 | c3;
302,664
private Mono<Response<Flux<ByteBuffer>>> assessPatchesWithResponseAsync(String resourceGroupName, String vmName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (vmName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.assessPatches(this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, this.client.<MASK><NEW_LINE>}
getSubscriptionId(), accept, context);
1,756,943
private void inflateRoutingParameter(final LocalRoutingParameter parameter) {<NEW_LINE>if (parameter != null) {<NEW_LINE>final BottomSheetItemWithCompoundButton[] item = new BottomSheetItemWithCompoundButton[1];<NEW_LINE>BottomSheetItemWithCompoundButton.Builder builder = new BottomSheetItemWithCompoundButton.Builder();<NEW_LINE>builder.setCompoundButtonColor(selectedModeColor);<NEW_LINE>int iconId = -1;<NEW_LINE>if (parameter.routingParameter != null || parameter instanceof RoutingOptionsHelper.OtherLocalRoutingParameter) {<NEW_LINE>builder.setTitle(parameter.getText(mapActivity));<NEW_LINE>iconId = parameter.isSelected(settings) ? parameter.getActiveIconId() : parameter.getDisabledIconId();<NEW_LINE>}<NEW_LINE>if (parameter instanceof LocalRoutingParameterGroup) {<NEW_LINE>final LocalRoutingParameterGroup group = (LocalRoutingParameterGroup) parameter;<NEW_LINE>LocalRoutingParameter selected = group.getSelected(settings);<NEW_LINE>iconId = selected != null ? parameter.getActiveIconId() : parameter.getDisabledIconId();<NEW_LINE>if (selected != null) {<NEW_LINE>builder.setTitle(group.getText(mapActivity));<NEW_LINE>builder.setDescription(selected.getText(mapActivity));<NEW_LINE>}<NEW_LINE>builder.setLayoutId(R.layout.bottom_sheet_item_with_descr_56dp);<NEW_LINE>builder.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>routingOptionsHelper.addNewRouteMenuParameter(applicationMode, parameter);<NEW_LINE>routingOptionsHelper.showLocalRoutingParameterGroupDialog(group, mapActivity, new RoutingOptionsHelper.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick() {<NEW_LINE>LocalRoutingParameter selected = group.getSelected(settings);<NEW_LINE>if (selected != null) {<NEW_LINE>item[0].setDescription(selected.getText(mapActivity));<NEW_LINE>}<NEW_LINE>updateMenu();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>builder.setLayoutId(R.layout.bottom_sheet_item_with_switch_56dp);<NEW_LINE>if (parameter.routingParameter != null && parameter.routingParameter.getId().equals(GeneralRouter.USE_SHORTEST_WAY)) {<NEW_LINE>// if short route settings - it should be inverse of fast_route_mode<NEW_LINE>builder.setChecked(!settings.FAST_ROUTE_MODE.getModeValue(applicationMode));<NEW_LINE>} else {<NEW_LINE>builder.setChecked(parameter.isSelected(settings));<NEW_LINE>}<NEW_LINE>builder.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>applyParameter(item[0], parameter);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (iconId != -1) {<NEW_LINE>builder<MASK><NEW_LINE>}<NEW_LINE>item[0] = builder.create();<NEW_LINE>items.add(item[0]);<NEW_LINE>}<NEW_LINE>}
.setIcon(getContentIcon(iconId));
1,183,391
public static void main(String[] args) throws IOException {<NEW_LINE>// Use the factory to get the version 1 Mercado Bitcoin exchange API using default settings<NEW_LINE>Exchange mercadoExchange = ExchangeFactory.INSTANCE.createExchange(MercadoBitcoinExchange.class);<NEW_LINE>// Interested in the public market data feed (no authentication)<NEW_LINE>MarketDataService marketDataService = mercadoExchange.getMarketDataService();<NEW_LINE>System.out.println("fetching data...");<NEW_LINE>// Get the current orderbook<NEW_LINE>OrderBook orderBook = marketDataService.getOrderBook(new CurrencyPair(Currency.LTC, Currency.BRL));<NEW_LINE>System.out.println("received data.");<NEW_LINE>System.out.println("plotting...");<NEW_LINE>// Create Chart<NEW_LINE>XYChart chart = new XYChartBuilder().width(800).height(600).title("Mercado Order Book").xAxisTitle("LTC").yAxisTitle("BRL").build();<NEW_LINE>// Customize Chart<NEW_LINE>chart.getStyler().setDefaultSeriesRenderStyle(XYSeriesRenderStyle.Area);<NEW_LINE>// BIDS<NEW_LINE>List<Number> xData = new ArrayList<>();<NEW_LINE>List<Number> yData = new ArrayList<>();<NEW_LINE>BigDecimal accumulatedBidUnits = new BigDecimal("0");<NEW_LINE>for (LimitOrder limitOrder : orderBook.getBids()) {<NEW_LINE>if (limitOrder.getLimitPrice().doubleValue() > 0) {<NEW_LINE>xData.add(limitOrder.getLimitPrice());<NEW_LINE>accumulatedBidUnits = accumulatedBidUnits.add(limitOrder.getOriginalAmount());<NEW_LINE>yData.add(accumulatedBidUnits);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.reverse(xData);<NEW_LINE>Collections.reverse(yData);<NEW_LINE>// Bids Series<NEW_LINE>XYSeries series = chart.addSeries("bids", xData, yData);<NEW_LINE><MASK><NEW_LINE>// ASKS<NEW_LINE>xData = new ArrayList<>();<NEW_LINE>yData = new ArrayList<>();<NEW_LINE>BigDecimal accumulatedAskUnits = new BigDecimal("0");<NEW_LINE>for (LimitOrder limitOrder : orderBook.getAsks()) {<NEW_LINE>if (limitOrder.getLimitPrice().doubleValue() < 200) {<NEW_LINE>xData.add(limitOrder.getLimitPrice());<NEW_LINE>accumulatedAskUnits = accumulatedAskUnits.add(limitOrder.getOriginalAmount());<NEW_LINE>yData.add(accumulatedAskUnits);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Asks Series<NEW_LINE>series = chart.addSeries("asks", xData, yData);<NEW_LINE>series.setMarker(SeriesMarkers.NONE);<NEW_LINE>new SwingWrapper(chart).displayChart();<NEW_LINE>}
series.setMarker(SeriesMarkers.NONE);
657,796
double leftLabelPadding() {<NEW_LINE>double leftPadding = super.leftLabelPadding();<NEW_LINE>// RT-27167: we must take into account the disclosure node and the<NEW_LINE>// indentation (which is not taken into account by the LabeledSkinBase.<NEW_LINE>final double height = getCellSize();<NEW_LINE>TreeTableCell<S, T> cell = getSkinnable();<NEW_LINE>TreeTableColumn<S, T> tableColumn = cell.getTableColumn();<NEW_LINE>if (tableColumn == null)<NEW_LINE>return leftPadding;<NEW_LINE>// check if this column is the TreeTableView treeColumn (i.e. the<NEW_LINE>// column showing the disclosure node and graphic).<NEW_LINE>TreeTableView<S> treeTable = cell.getTreeTableView();<NEW_LINE>if (treeTable == null)<NEW_LINE>return leftPadding;<NEW_LINE>int columnIndex = treeTable.getVisibleLeafIndex(tableColumn);<NEW_LINE>TreeTableColumn<S, ?> treeColumn = treeTable.getTreeColumn();<NEW_LINE>if ((treeColumn == null && columnIndex != 0) || (treeColumn != null && !tableColumn.equals(treeColumn))) {<NEW_LINE>return leftPadding;<NEW_LINE>}<NEW_LINE>TreeTableRow<S> treeTableRow = cell.getTreeTableRow();<NEW_LINE>if (treeTableRow == null)<NEW_LINE>return leftPadding;<NEW_LINE>TreeItem<S> treeItem = treeTableRow.getTreeItem();<NEW_LINE>if (treeItem == null)<NEW_LINE>return leftPadding;<NEW_LINE>int nodeLevel = treeTable.getTreeItemLevel(treeItem);<NEW_LINE>if (!treeTable.isShowRoot())<NEW_LINE>nodeLevel--;<NEW_LINE>double indentPerLevel = 13.0;<NEW_LINE>// if (treeTableRow.getSkin() instanceof javafx.scene.control.skin.TreeTableRowSkin) {<NEW_LINE>// indentPerLevel = ((javafx.scene.control.skin.TreeTableRowSkin<?>)treeTableRow.getSkin()).getIndentationPerLevel();<NEW_LINE>// }<NEW_LINE>leftPadding += 10 + nodeLevel * indentPerLevel;<NEW_LINE>// add in the width of the disclosure node, if one exists<NEW_LINE>Map<TableColumnBase<?, ?>, Double> mdwp = TableRowSkinBase.maxDisclosureWidthMap;<NEW_LINE>leftPadding += mdwp.containsKey(treeColumn) ? mdwp.get(treeColumn) : 0;<NEW_LINE>// adding in the width of the graphic on the tree item<NEW_LINE><MASK><NEW_LINE>leftPadding += graphic == null ? 0 : graphic.prefWidth(height);<NEW_LINE>return leftPadding;<NEW_LINE>}
Node graphic = treeItem.getGraphic();
748,612
public boolean hasPlayerFaceImage(String playername, FaceType facetype) {<NEW_LINE>String baseKey = prefix + "tiles/faces/" + facetype.id + "/" + playername + ".png";<NEW_LINE>boolean exists = false;<NEW_LINE>S3Client s3 = getConnection();<NEW_LINE>try {<NEW_LINE>ListObjectsV2Request req = ListObjectsV2Request.builder().bucketName(bucketname).prefix(baseKey).maxKeys(1).build();<NEW_LINE>ListObjectsV2Response rslt = s3.listObjectsV2(req);<NEW_LINE>if ((rslt != null) && (rslt.getKeyCount() > 0))<NEW_LINE>exists = true;<NEW_LINE>} catch (S3Exception x) {<NEW_LINE>if (!x.getCode().equals("SignatureDoesNotMatch")) {<NEW_LINE>// S3 behavior when no object match....<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releaseConnection(s3);<NEW_LINE>}<NEW_LINE>return exists;<NEW_LINE>}
Log.severe("AWS Exception", x);
583,284
/* This function check if parameter is of type oneOf, allOf, anyOf and return required type validators. It's<NEW_LINE>detached from below function to call it from "magic" workarounds functions */<NEW_LINE>private ParameterTypeValidator resolveAnyOfOneOfTypeValidator(Parameter parameter) {<NEW_LINE>ComposedSchema composedSchema;<NEW_LINE>if (parameter.getSchema() instanceof ComposedSchema)<NEW_LINE>composedSchema = (ComposedSchema) parameter.getSchema();<NEW_LINE>else<NEW_LINE>return null;<NEW_LINE>if (OpenApi3Utils.isAnyOfSchema(composedSchema)) {<NEW_LINE>return new AnyOfTypeValidator(this.resolveTypeValidatorsForAnyOfOneOf(new ArrayList<>(composedSchema.<MASK><NEW_LINE>} else if (OpenApi3Utils.isOneOfSchema(composedSchema)) {<NEW_LINE>return new OneOfTypeValidator(this.resolveTypeValidatorsForAnyOfOneOf(new ArrayList<>(composedSchema.getOneOf()), parameter));<NEW_LINE>} else<NEW_LINE>return null;<NEW_LINE>}
getAnyOf()), parameter));
1,839,201
public void updateViews() {<NEW_LINE>linearLayout.removeAllViews();<NEW_LINE>editPoiData.setIsInEdit(true);<NEW_LINE>PoiType pt = editPoiData.getCurrentPoiType();<NEW_LINE>String currentPoiTypeKey = "";<NEW_LINE>if (pt != null) {<NEW_LINE>currentPoiTypeKey = pt.getEditOsmTag();<NEW_LINE>}<NEW_LINE>for (Entry<String, String> tag : editPoiData.getTagValues().entrySet()) {<NEW_LINE>if (tag.getKey().equals(Entity.POI_TYPE_TAG) || tag.getKey().equals(OSMSettings.OSMTagKey.NAME.getValue()) || tag.getKey().startsWith(Entity.REMOVE_TAG_PREFIX) || tag.getKey().equals(currentPoiTypeKey)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>addTagView(tag.getKey(), tag.getValue());<NEW_LINE>}<NEW_LINE>if (editPoiData.hasEmptyValue() && linearLayout.findViewById(R.id.valueEditText) != null) {<NEW_LINE>linearLayout.findViewById(R.<MASK><NEW_LINE>}<NEW_LINE>editPoiData.setIsInEdit(false);<NEW_LINE>}
id.valueEditText).requestFocus();
768,578
public void asyncReadEntry(ReadHandle lh, long firstEntry, long lastEntry, boolean isSlowestReader, final ReadEntriesCallback callback, Object ctx) {<NEW_LINE>lh.readAsync(firstEntry, lastEntry).thenAcceptAsync(ledgerEntries -> {<NEW_LINE>List<Entry> entries = Lists.newArrayList();<NEW_LINE>long totalSize = 0;<NEW_LINE>try {<NEW_LINE>for (LedgerEntry e : ledgerEntries) {<NEW_LINE>// Insert the entries at the end of the list (they will be unsorted for now)<NEW_LINE>EntryImpl entry = create(e, interceptor);<NEW_LINE>entries.add(entry);<NEW_LINE>totalSize += entry.getLength();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>ledgerEntries.close();<NEW_LINE>}<NEW_LINE>mlFactoryMBean.recordCacheMiss(entries.size(), totalSize);<NEW_LINE>ml.mbean.addReadEntriesSample(<MASK><NEW_LINE>callback.readEntriesComplete(entries, ctx);<NEW_LINE>}, ml.getExecutor().chooseThread(ml.getName())).exceptionally(exception -> {<NEW_LINE>callback.readEntriesFailed(createManagedLedgerException(exception), ctx);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}
entries.size(), totalSize);
291,070
final CreateAuthorizerResult executeCreateAuthorizer(CreateAuthorizerRequest createAuthorizerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAuthorizerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateAuthorizerRequest> request = null;<NEW_LINE>Response<CreateAuthorizerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateAuthorizerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createAuthorizerRequest));<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, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAuthorizer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateAuthorizerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateAuthorizerResultJsonUnmarshaller());<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,511,578
public com.squareup.okhttp.Call apisApiIdDocumentsDocumentIdPutAsync(String apiId, String documentId, Document body, String contentType, String ifMatch, String ifUnmodifiedSince, final ApiCallback<Document> callback) throws ApiException {<NEW_LINE>ProgressResponseBody.ProgressListener progressListener = null;<NEW_LINE>ProgressRequestBody.ProgressRequestListener progressRequestListener = null;<NEW_LINE>if (callback != null) {<NEW_LINE>progressListener = new ProgressResponseBody.ProgressListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void update(long bytesRead, long contentLength, boolean done) {<NEW_LINE>callback.onDownloadProgress(bytesRead, contentLength, done);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {<NEW_LINE>callback.onUploadProgress(bytesWritten, contentLength, done);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>com.squareup.okhttp.Call call = apisApiIdDocumentsDocumentIdPutValidateBeforeCall(apiId, documentId, body, contentType, ifMatch, ifUnmodifiedSince, progressListener, progressRequestListener);<NEW_LINE>Type localVarReturnType = new TypeToken<Document>() {<NEW_LINE>}.getType();<NEW_LINE>apiClient.<MASK><NEW_LINE>return call;<NEW_LINE>}
executeAsync(call, localVarReturnType, callback);
1,007,451
public void terminateExecution(long jobId, long executionId, Address callerAddress, TerminationMode mode) {<NEW_LINE>failIfNotRunning();<NEW_LINE>ExecutionContext <MASK><NEW_LINE>if (executionContext == null) {<NEW_LINE>// If this happens after the execution terminated locally, ignore.<NEW_LINE>// If this happens before the execution was initialized locally, that means it's a light<NEW_LINE>// job. We ignore too and rely on the CheckLightJobsOperation.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!executionContext.isLightJob()) {<NEW_LINE>Address masterAddress = nodeEngine.getMasterAddress();<NEW_LINE>if (!callerAddress.equals(masterAddress)) {<NEW_LINE>failIfNotRunning();<NEW_LINE>throw new IllegalStateException(String.format("Caller %s cannot do '%s' for terminateExecution: it is not the master, the master is %s", callerAddress, jobIdAndExecutionId(jobId, executionId), masterAddress));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Address coordinator = executionContext.coordinator();<NEW_LINE>if (coordinator == null) {<NEW_LINE>// This can happen if ExecutionContext was created after a received data packet,<NEW_LINE>// either before the initialization or after a completion.<NEW_LINE>// The TerminateOp is always sent after InitOp on coordinator, but it can happen that it's handled<NEW_LINE>// first on the target member.<NEW_LINE>// We ignore this and rely on the CheckLightJobsOperation to clean up.<NEW_LINE>// It can't happen for normal jobs<NEW_LINE>assert executionContext.isLightJob() : "null coordinator for non-light job";<NEW_LINE>} else if (!coordinator.equals(callerAddress)) {<NEW_LINE>throw new IllegalStateException(String.format("%s, originally from coordinator %s, cannot do 'terminateExecution' by coordinator %s and execution %s", executionContext.jobNameAndExecutionId(), coordinator, callerAddress, idToString(executionId)));<NEW_LINE>}<NEW_LINE>Exception cause = mode == null ? new CancellationException() : new JobTerminateRequestedException(mode);<NEW_LINE>terminateExecution0(executionContext, mode, cause);<NEW_LINE>}
executionContext = executionContexts.get(executionId);
1,725,735
void updateValue(final Watch watch) {<NEW_LINE>RP.post(() -> {<NEW_LINE>if (!dbg.isSuspended()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CallFrame currentCallFrame = dbg.getCurrentCallFrame();<NEW_LINE>if (currentCallFrame == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VariablesModel.ScopedRemoteObject sv = Evaluator.evaluateExpression(currentCallFrame, <MASK><NEW_LINE>if (sv != null) {<NEW_LINE>ValueListeners vl;<NEW_LINE>synchronized (valueListeners) {<NEW_LINE>vl = valueListeners.get(watch);<NEW_LINE>}<NEW_LINE>if (vl != null) {<NEW_LINE>RemoteObject var = sv.getRemoteObject();<NEW_LINE>String value = ToolTipAnnotation.getStringValue(var);<NEW_LINE>Type type = var.getType();<NEW_LINE>if (type == Type.OBJECT) {<NEW_LINE>vl.value = sv;<NEW_LINE>// TODO: add obj ID<NEW_LINE>vl.hasChildren = !var.getProperties().isEmpty();<NEW_LINE>}<NEW_LINE>if (type != Type.UNDEFINED) {<NEW_LINE>vl.valueString = value;<NEW_LINE>if (type != Type.OBJECT && type != Type.FUNCTION) {<NEW_LINE>vl.valueOnlyString = var.getValueAsString();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>vl.valueString = var.getDescription();<NEW_LINE>}<NEW_LINE>vl.listener.valueChanged(watch);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
watch.getExpression(), true);
19,829
public List<QueryJobResults> dryRunQueries() throws IllegalArgumentException, InterruptedException {<NEW_LINE>List<Table> tables = getBigQueryTablesFromSchema();<NEW_LINE>// Create dry-run jobs<NEW_LINE>List<JobInfo> jobInfos = getJobInfosFromQuery(true);<NEW_LINE>// Store results for every successful dry-run<NEW_LINE>List<QueryJobResults> jobResults = new ArrayList<QueryJobResults>();<NEW_LINE>for (int i = 0; i < jobInfos.size(); i++) {<NEW_LINE>JobInfo jobInfo = jobInfos.get(i);<NEW_LINE>// Retrieve query<NEW_LINE><MASK><NEW_LINE>String statement = queryJobConfiguration.getQuery();<NEW_LINE>QueryJobResults jobResult;<NEW_LINE>try {<NEW_LINE>// Run dry-run<NEW_LINE>bigQuery.create(jobInfo);<NEW_LINE>// Store results from dry-run<NEW_LINE>jobResult = QueryJobResults.create(statement, query, null, null, null);<NEW_LINE>} catch (BigQueryException e) {<NEW_LINE>// Print out syntax/semantic errors returned from BQ<NEW_LINE>jobResult = QueryJobResults.create(statement, query, e.getMessage(), null, null);<NEW_LINE>}<NEW_LINE>jobResults.add(jobResult);<NEW_LINE>}<NEW_LINE>// Clear tables created<NEW_LINE>tables.forEach(table -> bigQuery.delete(table.getTableId()));<NEW_LINE>return jobResults;<NEW_LINE>}
QueryJobConfiguration queryJobConfiguration = jobInfo.getConfiguration();
535,288
public void batchInsert(String index, String type, List<?> objects) {<NEW_LINE>try {<NEW_LINE>BulkRequestBuilder bulkRequest = client.prepareBulk();<NEW_LINE>for (Object object : objects) {<NEW_LINE>XContentBuilder builder = jsonBuilder().startObject();<NEW_LINE>String[] fileNames = getFiledName(object);<NEW_LINE>for (String fileName : fileNames) {<NEW_LINE>Object value = getFieldValueByName(fileName, object);<NEW_LINE>builder.field(fileName, value);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>bulkRequest.add(client.prepareIndex(index, type).setSource(builder));<NEW_LINE>}<NEW_LINE>BulkResponse bulkResponse = bulkRequest.get();<NEW_LINE>if (bulkResponse.hasFailures()) {<NEW_LINE>// process failures by iterating through each bulk response item<NEW_LINE>log.error("ElasticOperation batchInsert failed. {}", bulkResponse.toString());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("ElasticOperation batchInsert error. ", e);<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}
ServerException(e.getMessage());
541,818
public void create(IProject project, CommandLine commandLine) {<NEW_LINE>String[] args = <MASK><NEW_LINE>DefaultParser parser = new DefaultParser();<NEW_LINE>org.apache.commons.cli.Options options = new org.apache.commons.cli.Options();<NEW_LINE>options.addOption(Option.builder().hasArg().required().longOpt("interpreter").build());<NEW_LINE>org.apache.commons.cli.CommandLine cli = null;<NEW_LINE>try {<NEW_LINE>cli = parser.parse(options, args);<NEW_LINE>} catch (ParseException pe) {<NEW_LINE>throw new RuntimeException(pe);<NEW_LINE>}<NEW_LINE>// remove the python nature added by ProjectManagement since pydev will<NEW_LINE>// skip all the other setup if the nature is already present.<NEW_LINE>try {<NEW_LINE>IProjectDescription desc = project.getDescription();<NEW_LINE>String[] natureIds = desc.getNatureIds();<NEW_LINE>ArrayList<String> modified = new ArrayList<String>();<NEW_LINE>CollectionUtils.addAll(modified, natureIds);<NEW_LINE>modified.remove(PythonNature.PYTHON_NATURE_ID);<NEW_LINE>desc.setNatureIds(modified.toArray(new String[modified.size()]));<NEW_LINE>project.setDescription(desc, new NullProgressMonitor());<NEW_LINE>String pythonPath = project.getFullPath().toString();<NEW_LINE>String interpreter = cli.getOptionValue("interpreter");<NEW_LINE>IInterpreterManager manager = InterpreterManagersAPI.getPythonInterpreterManager();<NEW_LINE>IInterpreterInfo info = manager.getInterpreterInfo(interpreter, null);<NEW_LINE>if (info == null) {<NEW_LINE>throw new RuntimeException("Python interpreter not found: " + interpreter);<NEW_LINE>}<NEW_LINE>// construct version from the interpreter chosen.<NEW_LINE>String version = "python " + IGrammarVersionProvider.grammarVersionToRep.get(info.getGrammarVersion());<NEW_LINE>// see src.org.python.pydev.plugin.PyStructureConfigHelpers<NEW_LINE>PythonNature.addNature(project, null, version, pythonPath, null, interpreter, null);<NEW_LINE>} catch (CoreException ce) {<NEW_LINE>throw new RuntimeException(ce);<NEW_LINE>} catch (MisconfigurationException me) {<NEW_LINE>throw new RuntimeException(me);<NEW_LINE>}<NEW_LINE>}
commandLine.getValues(Options.ARGS_OPTION);
1,355,016
public static String patch(String source, ShaderType type, boolean hasGeometry) {<NEW_LINE>if (source.contains("iris_")) {<NEW_LINE>throw new IllegalStateException("Shader is attempting to exploit internal Iris code!");<NEW_LINE>}<NEW_LINE>StringTransformations transformations = new StringTransformations(source);<NEW_LINE>// Add entity color -> overlay color attribute support.<NEW_LINE>if (type == ShaderType.VERTEX) {<NEW_LINE>// delete original declaration (fragile!!! we need glsl-transformer to do this robustly)<NEW_LINE>transformations.replaceRegex("uniform\\s+vec4\\s+entityColor;", "");<NEW_LINE>// add our own declarations<NEW_LINE>// TODO: We're exposing entityColor to this stage even if it isn't declared in this stage. But this is<NEW_LINE>// needed for the pass-through behavior.<NEW_LINE>transformations.injectLine(<MASK><NEW_LINE>transformations.injectLine(Transformations.InjectionPoint.BEFORE_CODE, "varying vec4 entityColor;");<NEW_LINE>// Create our own main function to wrap the existing main function, so that we can pass through the overlay color at the<NEW_LINE>// end to the geometry or fragment stage.<NEW_LINE>if (transformations.contains("irisMain")) {<NEW_LINE>throw new IllegalStateException("Shader already contains \"irisMain\"???");<NEW_LINE>}<NEW_LINE>transformations.replaceExact("main", "irisMain");<NEW_LINE>transformations.injectLine(Transformations.InjectionPoint.END, "void main() {\n" + " vec4 overlayColor = texture2D(iris_overlay, (gl_TextureMatrix[2] * gl_MultiTexCoord2).xy);\n" + " entityColor = vec4(overlayColor.rgb, 1.0 - overlayColor.a);\n" + "\n" + " irisMain();\n" + "}");<NEW_LINE>} else if (type == ShaderType.GEOMETRY) {<NEW_LINE>// delete original declaration (fragile!!! we need glsl-transformer to do this robustly)<NEW_LINE>transformations.replaceRegex("uniform\\s+vec4\\s+entityColor;", "");<NEW_LINE>// replace read references to grab the color from the first vertex.<NEW_LINE>transformations.replaceExact("entityColor", "entityColor[0]");<NEW_LINE>// add our own input and output declarations, after references have been replaced.<NEW_LINE>// TODO: We're exposing entityColor to this stage even if it isn't declared in this stage. But this is<NEW_LINE>// needed for the pass-through behavior.<NEW_LINE>transformations.injectLine(Transformations.InjectionPoint.BEFORE_CODE, "out vec4 entityColorGS;");<NEW_LINE>transformations.injectLine(Transformations.InjectionPoint.BEFORE_CODE, "in vec4 entityColor[];");<NEW_LINE>// Create our own main function to wrap the existing main function, so that we can pass through the overlay color at the<NEW_LINE>// end to the fragment stage.<NEW_LINE>if (transformations.contains("irisMain")) {<NEW_LINE>throw new IllegalStateException("Shader already contains \"irisMain\"???");<NEW_LINE>}<NEW_LINE>transformations.replaceExact("main", "irisMain");<NEW_LINE>transformations.injectLine(Transformations.InjectionPoint.END, "void main() {\n" + " entityColorGS = entityColor[0];\n" + " irisMain();\n" + "}");<NEW_LINE>} else if (type == ShaderType.FRAGMENT) {<NEW_LINE>// replace original declaration (fragile!!! we need glsl-transformer to do this robustly)<NEW_LINE>// if entityColor is not declared as a uniform, we don't make it available<NEW_LINE>transformations.replaceRegex("uniform\\s+vec4\\s+entityColor;", "varying vec4 entityColor;");<NEW_LINE>if (hasGeometry) {<NEW_LINE>// Different output name to avoid a name collision in the goemetry shader.<NEW_LINE>transformations.replaceExact("entityColor", "entityColorGS");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return transformations.toString();<NEW_LINE>}
Transformations.InjectionPoint.BEFORE_CODE, "uniform sampler2D iris_overlay;");
243,755
public Boolean update(TransformRequest request, String operator) {<NEW_LINE>LOGGER.info("begin to update transform info: {}", request);<NEW_LINE>this.checkParams(request);<NEW_LINE>// Check whether the transform can be modified<NEW_LINE>String groupId = request.getInlongGroupId();<NEW_LINE>groupCheckService.checkGroupStatus(groupId, operator);<NEW_LINE>Preconditions.checkNotNull(request.getId(), ErrorCodeEnum.ID_IS_EMPTY.getMessage());<NEW_LINE>StreamTransformEntity exist = transformMapper.selectById(request.getId());<NEW_LINE>if (exist == null) {<NEW_LINE>LOGGER.error("transform not found by id={}", request.getId());<NEW_LINE>throw new BusinessException(ErrorCodeEnum.TRANSFORM_NOT_FOUND);<NEW_LINE>}<NEW_LINE>String msg = String.format("transform has already updated with groupId=%s, streamId=%s, name=%s, curVersion=%s", request.getInlongGroupId(), request.getInlongStreamId(), request.getTransformName(), request.getVersion());<NEW_LINE>if (!exist.getVersion().equals(request.getVersion())) {<NEW_LINE>LOGGER.error(msg);<NEW_LINE>throw new BusinessException(ErrorCodeEnum.CONFIG_EXPIRED);<NEW_LINE>}<NEW_LINE>StreamTransformEntity transformEntity = CommonBeanUtils.copyProperties(request, StreamTransformEntity::new);<NEW_LINE>transformEntity.setModifier(operator);<NEW_LINE>int rowCount = transformMapper.updateByIdSelective(transformEntity);<NEW_LINE>if (rowCount != InlongConstants.AFFECTED_ONE_ROW) {<NEW_LINE>LOGGER.error(msg);<NEW_LINE>throw new BusinessException(ErrorCodeEnum.CONFIG_EXPIRED);<NEW_LINE>}<NEW_LINE>updateFieldOpt(<MASK><NEW_LINE>return true;<NEW_LINE>}
transformEntity, request.getFieldList());
1,144,793
public void handle(AnnotationValues<With> annotation, Annotation ast, EclipseNode annotationNode) {<NEW_LINE>handleFlagUsage(annotationNode, ConfigurationKeys.WITH_FLAG_USAGE, "@With");<NEW_LINE>EclipseNode node = annotationNode.up();<NEW_LINE>AccessLevel level = annotation<MASK><NEW_LINE>if (level == AccessLevel.NONE || node == null)<NEW_LINE>return;<NEW_LINE>List<Annotation> onMethod = unboxAndRemoveAnnotationParameter(ast, "onMethod", "@With(onMethod", annotationNode);<NEW_LINE>List<Annotation> onParam = unboxAndRemoveAnnotationParameter(ast, "onParam", "@With(onParam", annotationNode);<NEW_LINE>switch(node.getKind()) {<NEW_LINE>case FIELD:<NEW_LINE>createWithForFields(level, annotationNode.upFromAnnotationToFields(), annotationNode, true, onMethod, onParam);<NEW_LINE>break;<NEW_LINE>case TYPE:<NEW_LINE>if (!onMethod.isEmpty()) {<NEW_LINE>annotationNode.addError("'onMethod' is not supported for @With on a type.");<NEW_LINE>}<NEW_LINE>if (!onParam.isEmpty()) {<NEW_LINE>annotationNode.addError("'onParam' is not supported for @With on a type.");<NEW_LINE>}<NEW_LINE>generateWithForType(node, annotationNode, level, false);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
.getInstance().value();
495,125
private Cluster mapResource(ResultSet rs) throws SQLException {<NEW_LINE>Map<String, String> map = conformityMapFromJson(rs.getString("conformities"));<NEW_LINE>map.put(Cluster.CLUSTER, rs.getString(Cluster.CLUSTER));<NEW_LINE>map.put(Cluster.REGION, rs.getString(Cluster.REGION));<NEW_LINE>map.put(Cluster.IS_CONFORMING, rs.getString(Cluster.IS_CONFORMING));<NEW_LINE>map.put(Cluster.IS_OPTEDOUT, rs.getString(Cluster.IS_OPTEDOUT));<NEW_LINE>String email = <MASK><NEW_LINE>if (StringUtils.isBlank(email) || email.equals("0")) {<NEW_LINE>email = null;<NEW_LINE>}<NEW_LINE>map.put(Cluster.OWNER_EMAIL, email);<NEW_LINE>String updatedTimestamp = millisToFormattedDate(rs.getString(Cluster.UPDATE_TIMESTAMP));<NEW_LINE>if (updatedTimestamp != null) {<NEW_LINE>map.put(Cluster.UPDATE_TIMESTAMP, updatedTimestamp);<NEW_LINE>}<NEW_LINE>map.put(Cluster.EXCLUDED_RULES, rs.getString(Cluster.EXCLUDED_RULES));<NEW_LINE>map.put(Cluster.CONFORMITY_RULES, rs.getString(Cluster.CONFORMITY_RULES));<NEW_LINE>return Cluster.parseFieldToValueMap(map);<NEW_LINE>}
rs.getString(Cluster.OWNER_EMAIL);
1,600,181
public static Vector apply(LongFloatVector v1, LongDummyVector v2, Binary op) {<NEW_LINE>if (v1.isSparse()) {<NEW_LINE>if (op.isKeepStorage()) {<NEW_LINE>throw new AngelException("operation is not support!");<NEW_LINE>} else {<NEW_LINE>// multi-rehash<NEW_LINE>LongFloatVectorStorage newStorage = v1.getStorage().emptySparse((int) (v1.getDim()));<NEW_LINE>LongFloatVectorStorage v1Storage = v1.getStorage();<NEW_LINE>for (int i = 0; i < v1.getDim(); i++) {<NEW_LINE>if (v1Storage.hasKey(i)) {<NEW_LINE>newStorage.set(i, op.apply(v1.get(i), v2.get(i)));<NEW_LINE>} else {<NEW_LINE>newStorage.set(i, op.apply(0.0f, v2.get(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>v1.setStorage(newStorage);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// sorted<NEW_LINE>if (op.isKeepStorage()) {<NEW_LINE>throw new AngelException("operation is not support!");<NEW_LINE>} else {<NEW_LINE>LongFloatVectorStorage newStorage = new LongFloatSparseVectorStorage(v1.getDim());<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < v1.getDim(); i++) {<NEW_LINE>if (v1Storage.hasKey(i)) {<NEW_LINE>newStorage.set(i, op.apply(v1.get(i), v2.get(i)));<NEW_LINE>} else {<NEW_LINE>newStorage.set(i, op.apply(0.0f, v2.get(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>v1.setStorage(newStorage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return v1;<NEW_LINE>}
LongFloatVectorStorage v1Storage = v1.getStorage();
1,050,474
public void processMessage(final Capability cap, final Message message) {<NEW_LINE>final MessageData messageData = AbstractSnapMessageData.create(message);<NEW_LINE>final int code = messageData.getCode();<NEW_LINE>LOG.trace("Process snap message {}, {}", cap, code);<NEW_LINE>final EthPeer ethPeer = ethPeers.peer(message.getConnection());<NEW_LINE>if (ethPeer == null) {<NEW_LINE>LOG.debug("Ignoring message received from unknown peer connection: " + message.getConnection());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final EthMessage ethMessage = new EthMessage(ethPeer, messageData);<NEW_LINE>if (!ethPeer.validateReceivedMessage(ethMessage, getSupportedProtocol())) {<NEW_LINE>LOG.debug("Unsolicited message received from, disconnecting: {}", ethPeer);<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// This will handle responses<NEW_LINE>ethPeers.dispatchMessage(ethPeer, ethMessage, getSupportedProtocol());<NEW_LINE>// This will handle requests<NEW_LINE>Optional<MessageData> maybeResponseData = Optional.empty();<NEW_LINE>try {<NEW_LINE>final Map.Entry<BigInteger, MessageData> requestIdAndEthMessage = ethMessage.getData().unwrapMessageData();<NEW_LINE>maybeResponseData = snapMessages.dispatch(new EthMessage(ethPeer, requestIdAndEthMessage.getValue())).map(responseData -> responseData.wrapMessageData(requestIdAndEthMessage.getKey()));<NEW_LINE>} catch (final RLPException e) {<NEW_LINE>LOG.debug("Received malformed message {} , disconnecting: {}", messageData.getData(), ethPeer, e);<NEW_LINE>ethPeer.disconnect(DisconnectReason.BREACH_OF_PROTOCOL);<NEW_LINE>}<NEW_LINE>maybeResponseData.ifPresent(responseData -> {<NEW_LINE>try {<NEW_LINE>ethPeer.send(responseData, getSupportedProtocol());<NEW_LINE>} catch (final PeerConnection.PeerNotConnected error) {<NEW_LINE>// Peer disconnected before we could respond - nothing to do<NEW_LINE>LOG.trace("Peer disconnected before we could respond - nothing to do " + error.getMessage());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
ethPeer.disconnect(DisconnectReason.BREACH_OF_PROTOCOL);
1,478,310
private SettableFuture<PublishStatus> queuePublish(@NotNull final String client, @NotNull final PUBLISH publish, final int subscriptionQos, final boolean shared, final boolean retainAsPublished, @Nullable final ImmutableIntArray subscriptionIdentifier, @Nullable final Long queueLimit) {<NEW_LINE>final ListenableFuture<Void> future = clientQueuePersistence.add(client, shared, createPublish(publish, subscriptionQos, retainAsPublished, subscriptionIdentifier), false, Objects.requireNonNullElseGet(queueLimit, mqttConfigurationService::maxQueuedMessages));<NEW_LINE>final SettableFuture<PublishStatus<MASK><NEW_LINE>Futures.addCallback(future, new FutureCallback<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(final Void result) {<NEW_LINE>statusFuture.set(DELIVERED);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(final Throwable t) {<NEW_LINE>statusFuture.set(FAILED);<NEW_LINE>}<NEW_LINE>}, singleWriterService.callbackExecutor(client));<NEW_LINE>return statusFuture;<NEW_LINE>}
> statusFuture = SettableFuture.create();
1,760,056
public static QueryMqSofamqMessageByTopicResponse unmarshall(QueryMqSofamqMessageByTopicResponse queryMqSofamqMessageByTopicResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryMqSofamqMessageByTopicResponse.setRequestId(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.RequestId"));<NEW_LINE>queryMqSofamqMessageByTopicResponse.setResultCode(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.ResultCode"));<NEW_LINE>queryMqSofamqMessageByTopicResponse.setResultMessage(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.ResultMessage"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNum(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.PageNum"));<NEW_LINE>data.setPageSize(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.PageSize"));<NEW_LINE>data.setTaskId(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.TaskId"));<NEW_LINE>data.setTotal(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.Total"));<NEW_LINE>List<ContentItem> content = new ArrayList<ContentItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryMqSofamqMessageByTopicResponse.Data.Content.Length"); i++) {<NEW_LINE>ContentItem contentItem = new ContentItem();<NEW_LINE>contentItem.setBody(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].Body"));<NEW_LINE>contentItem.setBodyCrc(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].BodyCrc"));<NEW_LINE>contentItem.setBornHost(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].BornHost"));<NEW_LINE>contentItem.setBornTimestamp(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].BornTimestamp"));<NEW_LINE>contentItem.setInstanceId(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].InstanceId"));<NEW_LINE>contentItem.setMsgId(_ctx.stringValue<MASK><NEW_LINE>contentItem.setReconsumeTimes(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].ReconsumeTimes"));<NEW_LINE>contentItem.setStoreHost(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].StoreHost"));<NEW_LINE>contentItem.setStoreSize(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].StoreSize"));<NEW_LINE>contentItem.setStoreTimestamp(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].StoreTimestamp"));<NEW_LINE>contentItem.setTopic(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].Topic"));<NEW_LINE>List<PropertyListItem> propertyList = new ArrayList<PropertyListItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].PropertyList.Length"); j++) {<NEW_LINE>PropertyListItem propertyListItem = new PropertyListItem();<NEW_LINE>propertyListItem.setName(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].PropertyList[" + j + "].Name"));<NEW_LINE>propertyListItem.setValue(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].PropertyList[" + j + "].Value"));<NEW_LINE>propertyList.add(propertyListItem);<NEW_LINE>}<NEW_LINE>contentItem.setPropertyList(propertyList);<NEW_LINE>content.add(contentItem);<NEW_LINE>}<NEW_LINE>data.setContent(content);<NEW_LINE>queryMqSofamqMessageByTopicResponse.setData(data);<NEW_LINE>return queryMqSofamqMessageByTopicResponse;<NEW_LINE>}
("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].MsgId"));
1,757,244
final CreateRobotApplicationResult executeCreateRobotApplication(CreateRobotApplicationRequest createRobotApplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createRobotApplicationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateRobotApplicationRequest> request = null;<NEW_LINE>Response<CreateRobotApplicationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateRobotApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createRobotApplicationRequest));<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, "RoboMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateRobotApplication");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateRobotApplicationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateRobotApplicationResultJsonUnmarshaller());<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);
190,425
private static boolean scanForJars(ClusterizeInfo folder) throws InterruptedException {<NEW_LINE>File[] children = folder.jar.listFiles();<NEW_LINE>folder.getChildren().remove(folder.getChildren().getNodes());<NEW_LINE>if (children == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String pref = folder.path.length() == 0 ? "" : folder.path + '/';<NEW_LINE>List<Node> arr = new ArrayList<Node>();<NEW_LINE>for (File file : children) {<NEW_LINE>if (Thread.interrupted()) {<NEW_LINE>throw new InterruptedException();<NEW_LINE>}<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>ClusterizeInfo subdir = new ClusterizeInfo(pref + file.getName(), null, file);<NEW_LINE>if (scanForJars(subdir)) {<NEW_LINE>arr.add(subdir);<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!file.getName().endsWith(".jar")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ManifestManager mm = ManifestManager.getInstanceFromJAR(file);<NEW_LINE>if (mm != null && mm.getCodeNameBase() != null) {<NEW_LINE>arr.add(new ClusterizeInfo(pref + file.getName(), mm, file));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>folder.getChildren().add(arr.toArray(new Node[0]));<NEW_LINE>return folder.getChildren<MASK><NEW_LINE>}
().getNodesCount() > 0;
1,685,564
protected void drawFigure(Graphics graphics) {<NEW_LINE>graphics.pushState();<NEW_LINE>Rectangle bounds = getBounds().getCopy();<NEW_LINE>bounds.width--;<NEW_LINE>bounds.height--;<NEW_LINE>// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill<NEW_LINE>int lineWidth = 1;<NEW_LINE>setLineWidth(graphics, lineWidth, bounds);<NEW_LINE>int offset = 11;<NEW_LINE>int curve_y = bounds.y + bounds.height - offset;<NEW_LINE>graphics.setAlpha(getAlpha());<NEW_LINE>if (!isEnabled()) {<NEW_LINE>setDisabledState(graphics);<NEW_LINE>}<NEW_LINE>// Main Fill<NEW_LINE>Path path = new Path(null);<NEW_LINE>path.moveTo(bounds.x, bounds.y);<NEW_LINE>path.lineTo(bounds.x, curve_y - 1);<NEW_LINE>path.quadTo(bounds.x + (bounds.width / 4), bounds.y + bounds.height + offset, bounds.x + bounds.<MASK><NEW_LINE>path.quadTo(bounds.x + bounds.width - (bounds.width / 4), curve_y - offset - 1, bounds.x + bounds.width, curve_y);<NEW_LINE>path.lineTo(bounds.x + bounds.width, bounds.y);<NEW_LINE>graphics.setBackgroundColor(getFillColor());<NEW_LINE>Pattern gradient = applyGradientPattern(graphics, bounds);<NEW_LINE>graphics.fillPath(path);<NEW_LINE>disposeGradientPattern(graphics, gradient);<NEW_LINE>// Outline<NEW_LINE>graphics.setAlpha(getLineAlpha());<NEW_LINE>graphics.setForegroundColor(getLineColor());<NEW_LINE>float lineOffset = (float) lineWidth / 2;<NEW_LINE>path.lineTo(bounds.x - lineOffset, bounds.y);<NEW_LINE>graphics.drawPath(path);<NEW_LINE>path.dispose();<NEW_LINE>// Icon<NEW_LINE>// drawIconImage(graphics, bounds);<NEW_LINE>drawIconImage(graphics, bounds, 0, 0, -14, 0);<NEW_LINE>graphics.popState();<NEW_LINE>}
width / 2 + 1, curve_y);
1,687,180
public InteractionResult useOn(UseOnContext ctx) {<NEW_LINE>Player player = ctx.getPlayer();<NEW_LINE>ItemStack stack = ctx.getItemInHand();<NEW_LINE>if (player != null && player.isShiftKeyDown()) {<NEW_LINE>Level world = ctx.getLevel();<NEW_LINE>BlockPos pos = ctx.getClickedPos();<NEW_LINE>Direction side = ctx.getClickedFace();<NEW_LINE>BlockState state = world.getBlockState(pos);<NEW_LINE>BlockPlaceContext blockCtx = new BlockPlaceContext(ctx);<NEW_LINE>if (!state.canBeReplaced(blockCtx))<NEW_LINE>pos = pos.relative(side);<NEW_LINE>if (!stack.isEmpty() && player.mayUseItemAt(pos, side, stack) && world.getBlockState(pos).canBeReplaced(blockCtx)) {<NEW_LINE>BlockState coresample = StoneDecoration.coresample.defaultBlockState();<NEW_LINE>if (world.setBlock(pos, coresample, 3)) {<NEW_LINE>((IEBaseBlock) StoneDecoration.coresample<MASK><NEW_LINE>SoundType soundtype = world.getBlockState(pos).getBlock().getSoundType(world.getBlockState(pos), world, pos, player);<NEW_LINE>world.playSound(player, pos, soundtype.getPlaceSound(), SoundSource.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);<NEW_LINE>stack.shrink(1);<NEW_LINE>}<NEW_LINE>return InteractionResult.SUCCESS;<NEW_LINE>} else<NEW_LINE>return InteractionResult.FAIL;<NEW_LINE>}<NEW_LINE>return super.useOn(ctx);<NEW_LINE>}
).onIEBlockPlacedBy(blockCtx, coresample);
346,940
private static void collectKeyShares(TlsCrypto crypto, int[] supportedGroups, Vector keyShareGroups, Hashtable clientAgreements, Vector clientShares) throws IOException {<NEW_LINE>if (isNullOrEmpty(supportedGroups)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (null == keyShareGroups || keyShareGroups.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < supportedGroups.length; ++i) {<NEW_LINE>int supportedGroup = supportedGroups[i];<NEW_LINE>Integer supportedGroupElement = Integers.valueOf(supportedGroup);<NEW_LINE>if (!keyShareGroups.contains(supportedGroupElement) || clientAgreements.containsKey(supportedGroupElement) || !crypto.hasNamedGroup(supportedGroup)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>TlsAgreement agreement = null;<NEW_LINE>if (NamedGroup.refersToASpecificCurve(supportedGroup)) {<NEW_LINE>if (crypto.hasECDHAgreement()) {<NEW_LINE>agreement = crypto.createECDomain(new TlsECConfig(supportedGroup)).createECDH();<NEW_LINE>}<NEW_LINE>} else if (NamedGroup.refersToASpecificFiniteField(supportedGroup)) {<NEW_LINE>if (crypto.hasDHAgreement()) {<NEW_LINE>agreement = crypto.createDHDomain(new TlsDHConfig(supportedGroup<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null != agreement) {<NEW_LINE>byte[] key_exchange = agreement.generateEphemeral();<NEW_LINE>KeyShareEntry clientShare = new KeyShareEntry(supportedGroup, key_exchange);<NEW_LINE>clientShares.addElement(clientShare);<NEW_LINE>clientAgreements.put(supportedGroupElement, agreement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, true)).createDH();
1,846,556
private void openFileWriter() {<NEW_LINE>try {<NEW_LINE>temporaryFile = new File(Config.getStringProperty("org.dotcms.XMLSitemap.SITEMAP_XML_FILENAME", "XMLSitemap") + ".xml");<NEW_LINE>out = new OutputStreamWriter(Files.newOutputStream(temporaryFile.toPath()), "UTF-8");<NEW_LINE>out.write("<?xml version='1.0' encoding='UTF-8'?>\n");<NEW_LINE>out.write("<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\n");<NEW_LINE>out.flush();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this, <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
643,216
final GetAssociatedEnclaveCertificateIamRolesResult executeGetAssociatedEnclaveCertificateIamRoles(GetAssociatedEnclaveCertificateIamRolesRequest getAssociatedEnclaveCertificateIamRolesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAssociatedEnclaveCertificateIamRolesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetAssociatedEnclaveCertificateIamRolesRequest> request = null;<NEW_LINE>Response<GetAssociatedEnclaveCertificateIamRolesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAssociatedEnclaveCertificateIamRolesRequestMarshaller().marshall(super.beforeMarshalling(getAssociatedEnclaveCertificateIamRolesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetAssociatedEnclaveCertificateIamRoles");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetAssociatedEnclaveCertificateIamRolesResult> responseHandler = new StaxResponseHandler<GetAssociatedEnclaveCertificateIamRolesResult>(new GetAssociatedEnclaveCertificateIamRolesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
893,185
public void visitTry(STry userTryNode, SemanticScope semanticScope) {<NEW_LINE>SBlock userBlockNode = userTryNode.getBlockNode();<NEW_LINE>if (userBlockNode == null) {<NEW_LINE>throw userTryNode.createError(new IllegalArgumentException("extraneous try statement"));<NEW_LINE>}<NEW_LINE>semanticScope.replicateCondition(userTryNode, userBlockNode, LastSource.class);<NEW_LINE>semanticScope.replicateCondition(userTryNode, userBlockNode, InLoop.class);<NEW_LINE>semanticScope.replicateCondition(userTryNode, userBlockNode, LastLoop.class);<NEW_LINE>visit(userBlockNode, semanticScope.newLocalScope());<NEW_LINE>boolean methodEscape = semanticScope.getCondition(userBlockNode, MethodEscape.class);<NEW_LINE>boolean loopEscape = semanticScope.getCondition(userBlockNode, LoopEscape.class);<NEW_LINE>boolean allEscape = semanticScope.getCondition(userBlockNode, AllEscape.class);<NEW_LINE>boolean anyContinue = semanticScope.<MASK><NEW_LINE>boolean anyBreak = semanticScope.getCondition(userBlockNode, AnyBreak.class);<NEW_LINE>for (SCatch userCatchNode : userTryNode.getCatchNodes()) {<NEW_LINE>semanticScope.replicateCondition(userTryNode, userCatchNode, LastSource.class);<NEW_LINE>semanticScope.replicateCondition(userTryNode, userCatchNode, InLoop.class);<NEW_LINE>semanticScope.replicateCondition(userTryNode, userCatchNode, LastLoop.class);<NEW_LINE>visit(userCatchNode, semanticScope.newLocalScope());<NEW_LINE>methodEscape &= semanticScope.getCondition(userCatchNode, MethodEscape.class);<NEW_LINE>loopEscape &= semanticScope.getCondition(userCatchNode, LoopEscape.class);<NEW_LINE>allEscape &= semanticScope.getCondition(userCatchNode, AllEscape.class);<NEW_LINE>anyContinue |= semanticScope.getCondition(userCatchNode, AnyContinue.class);<NEW_LINE>anyBreak |= semanticScope.getCondition(userCatchNode, AnyBreak.class);<NEW_LINE>}<NEW_LINE>if (methodEscape) {<NEW_LINE>semanticScope.setCondition(userTryNode, MethodEscape.class);<NEW_LINE>}<NEW_LINE>if (loopEscape) {<NEW_LINE>semanticScope.setCondition(userTryNode, LoopEscape.class);<NEW_LINE>}<NEW_LINE>if (allEscape) {<NEW_LINE>semanticScope.setCondition(userTryNode, AllEscape.class);<NEW_LINE>}<NEW_LINE>if (anyContinue) {<NEW_LINE>semanticScope.setCondition(userTryNode, AnyContinue.class);<NEW_LINE>}<NEW_LINE>if (anyBreak) {<NEW_LINE>semanticScope.setCondition(userTryNode, AnyBreak.class);<NEW_LINE>}<NEW_LINE>}
getCondition(userBlockNode, AnyContinue.class);
1,421,011
public void onChanged(Change<? extends Toggle> c) {<NEW_LINE>// This change event happens when the toggles are added -- we don't need to inspect the change event<NEW_LINE>if (getItem() != null && getItem().getDecodeConfiguration() instanceof DecodeConfigNBFM) {<NEW_LINE>// Capture current modified state so that we can reapply after adjusting control states<NEW_LINE>boolean modified = modifiedProperty().get();<NEW_LINE>DecodeConfigNBFM config = (DecodeConfigNBFM) getItem().getDecodeConfiguration();<NEW_LINE>DecodeConfigNBFM.<MASK><NEW_LINE>if (bandwidth == null) {<NEW_LINE>bandwidth = DecodeConfigNBFM.Bandwidth.BW_12_5;<NEW_LINE>}<NEW_LINE>for (Toggle toggle : getBandwidthButton().getToggleGroup().getToggles()) {<NEW_LINE>toggle.setSelected(toggle.getUserData() == bandwidth);<NEW_LINE>}<NEW_LINE>modifiedProperty().set(modified);<NEW_LINE>}<NEW_LINE>}
Bandwidth bandwidth = config.getBandwidth();
1,437,345
private static void verifyEdgesConditionQuery(ConditionQuery query) {<NEW_LINE>assert query.resultType().isEdge();<NEW_LINE><MASK><NEW_LINE>if (total == 1) {<NEW_LINE>if (query.containsCondition(HugeKeys.LABEL) || query.containsCondition(HugeKeys.PROPERTIES) || query.containsScanRelation()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int matched = 0;<NEW_LINE>for (HugeKeys key : EdgeId.KEYS) {<NEW_LINE>Object value = query.condition(key);<NEW_LINE>if (value == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>matched++;<NEW_LINE>}<NEW_LINE>int count = matched;<NEW_LINE>if (query.containsCondition(HugeKeys.PROPERTIES)) {<NEW_LINE>matched++;<NEW_LINE>if (count < 3 && query.containsCondition(HugeKeys.LABEL)) {<NEW_LINE>matched++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matched != total) {<NEW_LINE>throw new HugeException("Not supported querying edges by %s, expect %s", query.conditions(), EdgeId.KEYS[count]);<NEW_LINE>}<NEW_LINE>}
int total = query.conditionsSize();
1,037,032
public void sync(DataModel dataModel) {<NEW_LINE>// Build named-based maps from ID-based maps<NEW_LINE>this.thermostats_by_name = new HashMap<String, Thermostat>();<NEW_LINE>if (this.thermostat_id_list != null) {<NEW_LINE>for (String id : this.thermostat_id_list) {<NEW_LINE>if (dataModel.getDevices() != null && dataModel.getDevices().getThermostats_by_id() != null) {<NEW_LINE>Thermostat th = dataModel.getDevices().getThermostats_by_id().get(id);<NEW_LINE>if (th != null) {<NEW_LINE>this.thermostats_by_name.put(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.smoke_co_alarms_by_name = new HashMap<String, SmokeCOAlarm>();<NEW_LINE>if (this.smoke_co_alarm_id_list != null) {<NEW_LINE>for (String id : this.smoke_co_alarm_id_list) {<NEW_LINE>if (dataModel.getDevices() != null && dataModel.getDevices().getSmoke_co_alarms_by_id() != null) {<NEW_LINE>SmokeCOAlarm sm = dataModel.getDevices().getSmoke_co_alarms_by_id().get(id);<NEW_LINE>if (sm != null) {<NEW_LINE>this.smoke_co_alarms_by_name.put(sm.getName(), sm);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.cameras_by_name = new HashMap<String, Camera>();<NEW_LINE>if (this.camera_id_list != null) {<NEW_LINE>for (String id : this.camera_id_list) {<NEW_LINE>if (dataModel.getDevices() != null && dataModel.getDevices().getCameras_by_id() != null) {<NEW_LINE>Camera cam = dataModel.getDevices().getCameras_by_id().get(id);<NEW_LINE>if (cam != null) {<NEW_LINE>this.cameras_by_name.put(cam.getName(), cam);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
th.getName(), th);
1,107,735
private void prefetchData(boolean firstTime) {<NEW_LINE>final OSBTreeBonsai<OIdentifiable, Integer> tree = loadTree();<NEW_LINE>if (tree == null) {<NEW_LINE>throw new IllegalStateException("RidBag is not properly initialized, can not load tree implementation");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>tree.loadEntriesMajor(firstKey, firstTime, true, entry -> {<NEW_LINE>preFetchedValues.add(new Entry<OIdentifiable, Integer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OIdentifiable getKey() {<NEW_LINE>return entry.getKey();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer getValue() {<NEW_LINE>return entry.getValue();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer setValue(Integer v) {<NEW_LINE>throw new UnsupportedOperationException("setValue");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return preFetchedValues.size() <= prefetchSize;<NEW_LINE>});<NEW_LINE>} finally {<NEW_LINE>releaseTree();<NEW_LINE>}<NEW_LINE>if (preFetchedValues.isEmpty()) {<NEW_LINE>preFetchedValues = null;<NEW_LINE>} else {<NEW_LINE>firstKey = preFetchedValues<MASK><NEW_LINE>}<NEW_LINE>}
.getLast().getKey();
1,553,585
public String validateGiverRecipientVisibility(FeedbackQuestionAttributes feedbackQuestionAttributes) {<NEW_LINE>String errorMsg = "";<NEW_LINE>// giver type can only be STUDENTS<NEW_LINE>if (feedbackQuestionAttributes.getGiverType() != FeedbackParticipantType.STUDENTS) {<NEW_LINE>log.severe("Unexpected giverType for contribution question: " + feedbackQuestionAttributes.getGiverType() + " (forced to :" + FeedbackParticipantType.STUDENTS + ")");<NEW_LINE><MASK><NEW_LINE>errorMsg = CONTRIB_ERROR_INVALID_FEEDBACK_PATH;<NEW_LINE>}<NEW_LINE>// recipient type can only be OWN_TEAM_MEMBERS_INCLUDING_SELF<NEW_LINE>if (feedbackQuestionAttributes.getRecipientType() != FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF) {<NEW_LINE>log.severe("Unexpected recipientType for contribution question: " + feedbackQuestionAttributes.getRecipientType() + " (forced to :" + FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF + ")");<NEW_LINE>feedbackQuestionAttributes.setRecipientType(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF);<NEW_LINE>errorMsg = CONTRIB_ERROR_INVALID_FEEDBACK_PATH;<NEW_LINE>}<NEW_LINE>// restrictions on visibility options<NEW_LINE>if (!(feedbackQuestionAttributes.getShowResponsesTo().contains(FeedbackParticipantType.RECEIVER) == feedbackQuestionAttributes.getShowResponsesTo().contains(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS) && feedbackQuestionAttributes.getShowResponsesTo().contains(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS) == feedbackQuestionAttributes.getShowResponsesTo().contains(FeedbackParticipantType.OWN_TEAM_MEMBERS))) {<NEW_LINE>log.severe("Unexpected showResponsesTo for contribution question: " + feedbackQuestionAttributes.getShowResponsesTo() + " (forced to :" + "Shown anonymously to recipient and team members, visible to instructors" + ")");<NEW_LINE>feedbackQuestionAttributes.setShowResponsesTo(Arrays.asList(FeedbackParticipantType.RECEIVER, FeedbackParticipantType.RECEIVER_TEAM_MEMBERS, FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.INSTRUCTORS));<NEW_LINE>errorMsg = CONTRIB_ERROR_INVALID_VISIBILITY_OPTIONS;<NEW_LINE>}<NEW_LINE>return errorMsg;<NEW_LINE>}
feedbackQuestionAttributes.setGiverType(FeedbackParticipantType.STUDENTS);
867,585
private void updateDynamicRecords(List<DynamicRecord> records, IdUpdateListener idUpdateListener, CursorContext cursorContext, StoreCursors storeCursors) {<NEW_LINE>PageCursor stringCursor = null;<NEW_LINE>PageCursor arrayCursor = null;<NEW_LINE>try {<NEW_LINE>for (DynamicRecord valueRecord : records) {<NEW_LINE>PropertyType recordType = valueRecord.getType();<NEW_LINE>if (recordType == PropertyType.STRING) {<NEW_LINE>if (stringCursor == null) {<NEW_LINE>stringCursor = storeCursors.writeCursor(DYNAMIC_STRING_STORE_CURSOR);<NEW_LINE>}<NEW_LINE>stringStore.updateRecord(valueRecord, idUpdateListener, stringCursor, cursorContext, storeCursors);<NEW_LINE>} else if (recordType == PropertyType.ARRAY) {<NEW_LINE>if (arrayCursor == null) {<NEW_LINE>arrayCursor = storeCursors.writeCursor(DYNAMIC_ARRAY_STORE_CURSOR);<NEW_LINE>}<NEW_LINE>arrayStore.updateRecord(valueRecord, idUpdateListener, arrayCursor, cursorContext, storeCursors);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>closeAllUnchecked(stringCursor, arrayCursor);<NEW_LINE>}<NEW_LINE>}
throw new InvalidRecordException("Unknown dynamic record" + valueRecord);
120,246
public void writePraatPitchTier(String fileName) throws IOException {<NEW_LINE>// initialize times and values:<NEW_LINE>ArrayList<Double> times = new ArrayList<Double>();<NEW_LINE>ArrayList<Double> values = new ArrayList<Double>();<NEW_LINE>// cumulative time pointer:<NEW_LINE>double time = 0;<NEW_LINE>// iterate over phones, skipping the initial silence:<NEW_LINE>ListIterator<Phone> <MASK><NEW_LINE>while (phoneIterator.hasNext()) {<NEW_LINE>Phone phone = phoneIterator.next();<NEW_LINE>double[] frameTimes = phone.getRealizedFrameDurations();<NEW_LINE>double[] frameF0s = phone.getUnitFrameF0s();<NEW_LINE>for (int f = 0; f < frameF0s.length; f++) {<NEW_LINE>time += frameTimes[f];<NEW_LINE>times.add(time);<NEW_LINE>values.add(frameF0s[f]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// open file for writing:<NEW_LINE>File durationTierFile = new File(fileName);<NEW_LINE>PrintWriter out = new PrintWriter(durationTierFile);<NEW_LINE>// print header:<NEW_LINE>out.println("\"ooTextFile\"");<NEW_LINE>out.println("\"PitchTier\"");<NEW_LINE>out.println(String.format("0 %f %d", time, times.size()));<NEW_LINE>// print points (times and values):<NEW_LINE>for (int i = 0; i < times.size(); i++) {<NEW_LINE>out.println(String.format("%.16f %f", times.get(i), values.get(i)));<NEW_LINE>}<NEW_LINE>// flush and close:<NEW_LINE>out.close();<NEW_LINE>}
phoneIterator = phones.listIterator(1);
1,354,329
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see javax.jms.JMSContext#createSharedConsumer(javax.jms.Topic, java.lang.String)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public JMSConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName) throws JMSRuntimeException, InvalidDestinationRuntimeException, InvalidSelectorRuntimeException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "createSharedConsumer", new Object[] { topic, sharedSubscriptionName });<NEW_LINE>JMSConsumer jmsConsumer = null;<NEW_LINE>try {<NEW_LINE>MessageConsumer messageConsumer = <MASK><NEW_LINE>jmsConsumer = new JmsJMSConsumerImpl(messageConsumer);<NEW_LINE>autoStartConsumer();<NEW_LINE>} catch (InvalidDestinationException ide) {<NEW_LINE>throw (InvalidDestinationRuntimeException) JmsErrorUtils.getJMS2Exception(ide, InvalidDestinationRuntimeException.class);<NEW_LINE>} catch (InvalidSelectorException ise) {<NEW_LINE>throw (InvalidSelectorRuntimeException) JmsErrorUtils.getJMS2Exception(ise, InvalidSelectorRuntimeException.class);<NEW_LINE>} catch (JMSException jmse) {<NEW_LINE>throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);<NEW_LINE>} finally {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "createSharedConsumer", new Object[] { jmsConsumer });<NEW_LINE>}<NEW_LINE>return jmsConsumer;<NEW_LINE>}
jmsSession.createSharedConsumer(topic, sharedSubscriptionName);
1,413,482
public void resolve() {<NEW_LINE>if (zone_letter == 'Z') {<NEW_LINE>mgrs = "Latitude limit exceeded";<NEW_LINE>} else {<NEW_LINE>StringBuffer sb = new StringBuffer(Integer.toString(zone_number)).append(zone_letter).append(get100kID(easting, northing, zone_number));<NEW_LINE>StringBuffer seasting = new StringBuffer(Integer.<MASK><NEW_LINE>StringBuffer snorthing = new StringBuffer(Integer.toString((int) northing));<NEW_LINE>while (accuracy + 1 > seasting.length()) {<NEW_LINE>seasting.insert(0, '0');<NEW_LINE>}<NEW_LINE>// We have to be careful here, the 100k values shouldn't<NEW_LINE>// be<NEW_LINE>// used for calculating stuff here.<NEW_LINE>while (accuracy + 1 > snorthing.length()) {<NEW_LINE>snorthing.insert(0, '0');<NEW_LINE>}<NEW_LINE>while (snorthing.length() > 6) {<NEW_LINE>snorthing.deleteCharAt(0);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>sb.append(seasting.substring(1, accuracy + 1)).append(snorthing.substring(1, accuracy + 1));<NEW_LINE>mgrs = sb.toString();<NEW_LINE>} catch (IndexOutOfBoundsException ioobe) {<NEW_LINE>mgrs = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
toString((int) easting));
1,448,447
private com.ning.http.client.Request translate(final ClientRequest requestContext) {<NEW_LINE>final String strMethod = requestContext.getMethod();<NEW_LINE>final URI uri = requestContext.getUri();<NEW_LINE>RequestBuilder builder = new RequestBuilder(strMethod).setUrl(uri.toString());<NEW_LINE>builder.setFollowRedirects(requestContext.resolveProperty(ClientProperties.FOLLOW_REDIRECTS, true));<NEW_LINE>if (requestContext.hasEntity()) {<NEW_LINE>final RequestEntityProcessing entityProcessing = requestContext.resolveProperty(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.class);<NEW_LINE>if (entityProcessing == RequestEntityProcessing.BUFFERED) {<NEW_LINE>byte[] entityBytes = bufferEntity(requestContext);<NEW_LINE>builder = builder.setBody(entityBytes);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>final Integer chunkSize = requestContext.resolveProperty(ClientProperties.CHUNKED_ENCODING_SIZE, ClientProperties.DEFAULT_CHUNK_SIZE);<NEW_LINE>bodyGenerator.setMaxPendingBytes(chunkSize);<NEW_LINE>final FeedableBodyGenerator.Feeder feeder = new FeedableBodyGenerator.SimpleFeeder(bodyGenerator) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void flush() throws IOException {<NEW_LINE>requestContext.writeEntity();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>requestContext.setStreamProvider(new OutboundMessageContext.StreamProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OutputStream getOutputStream(int contentLength) throws IOException {<NEW_LINE>return new FeederAdapter(feeder);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>bodyGenerator.setFeeder(feeder);<NEW_LINE>builder.setBody(bodyGenerator);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final GrizzlyConnectorProvider.RequestCustomizer requestCustomizer = requestContext.resolveProperty(GrizzlyConnectorProvider.REQUEST_CUSTOMIZER, GrizzlyConnectorProvider.RequestCustomizer.class);<NEW_LINE>if (requestCustomizer != null) {<NEW_LINE>builder = requestCustomizer.customize(requestContext, builder);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
final FeedableBodyGenerator bodyGenerator = new FeedableBodyGenerator();
1,499,751
private static void updatePermissions(IFileStore sourceFileStore, IFileStore targetFileStore, boolean isFile, PermissionDirection direction, IProgressMonitor monitor) {<NEW_LINE>if (PreferenceUtils.getUpdatePermissions(direction)) {<NEW_LINE>IFileInfo targetFileInfo = getFileInfo(targetFileStore, monitor);<NEW_LINE>long permissions = 0;<NEW_LINE>if (PreferenceUtils.getSpecificPermissions(direction)) {<NEW_LINE>// use specified permissions from preferences<NEW_LINE>permissions = isFile ? PreferenceUtils.getFilePermissions(direction) : PreferenceUtils.getFolderPermissions(direction);<NEW_LINE>} else {<NEW_LINE>// uses source's permissions<NEW_LINE>IFileInfo sourceFileInfo = getFileInfo(sourceFileStore, monitor);<NEW_LINE>if (sourceFileInfo != null) {<NEW_LINE>permissions = getPermissions(sourceFileInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (permissions > 0) {<NEW_LINE>if (targetFileInfo instanceof IExtendedFileInfo) {<NEW_LINE>((IExtendedFileInfo) targetFileInfo).setPermissions(permissions);<NEW_LINE>} else {<NEW_LINE>targetFileInfo.setAttribute(EFS.ATTRIBUTE_OWNER_READ, (permissions & IExtendedFileInfo.PERMISSION_OWNER_READ) != 0);<NEW_LINE>targetFileInfo.setAttribute(EFS.ATTRIBUTE_OWNER_WRITE, (permissions & IExtendedFileInfo.PERMISSION_OWNER_WRITE) != 0);<NEW_LINE>targetFileInfo.setAttribute(EFS.ATTRIBUTE_OWNER_EXECUTE, (permissions <MASK><NEW_LINE>targetFileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_READ, (permissions & IExtendedFileInfo.PERMISSION_GROUP_READ) != 0);<NEW_LINE>targetFileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_WRITE, (permissions & IExtendedFileInfo.PERMISSION_GROUP_WRITE) != 0);<NEW_LINE>targetFileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_EXECUTE, (permissions & IExtendedFileInfo.PERMISSION_GROUP_EXECUTE) != 0);<NEW_LINE>targetFileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_READ, (permissions & IExtendedFileInfo.PERMISSION_OTHERS_READ) != 0);<NEW_LINE>targetFileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_WRITE, (permissions & IExtendedFileInfo.PERMISSION_OTHERS_WRITE) != 0);<NEW_LINE>targetFileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_EXECUTE, (permissions & IExtendedFileInfo.PERMISSION_OTHERS_EXECUTE) != 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (targetFileInfo instanceof IExtendedFileInfo) {<NEW_LINE>targetFileStore.putInfo(targetFileInfo, IExtendedFileInfo.SET_PERMISSIONS, monitor);<NEW_LINE>} else {<NEW_LINE>targetFileStore.putInfo(targetFileInfo, EFS.SET_ATTRIBUTES, monitor);<NEW_LINE>}<NEW_LINE>} catch (CoreException e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.logWarning(SyncingPlugin.getDefault(), "Failed to update permissions for " + targetFileStore, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
& IExtendedFileInfo.PERMISSION_OWNER_EXECUTE) != 0);
1,203,249
public void start(BundleContext context) throws Exception {<NEW_LINE>// For test purposes, use a random port<NEW_LINE>Server server = new Server(0);<NEW_LINE>server.getConnectors()[0].addEventListener(new LifeCycle.Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void lifeCycleStarted(LifeCycle event) {<NEW_LINE>System.setProperty("bundle.server.port", String.valueOf(((ServerConnector) event).getLocalPort()));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ContextHandlerCollection contexts = new ContextHandlerCollection();<NEW_LINE>server.setHandler(contexts);<NEW_LINE>// server.setDumpAfterStart(true);<NEW_LINE>String[] list = new String[] { "org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration", "org.eclipse.jetty.webapp.WebXmlConfiguration", "org.eclipse.jetty.webapp.MetaInfConfiguration", "org.eclipse.jetty.webapp.FragmentConfiguration", "org.eclipse.jetty.webapp.JettyWebXmlConfiguration" };<NEW_LINE>server.setAttribute("org.eclipse.jetty.webapp.configuration", list);<NEW_LINE>Dictionary serverProps = new Hashtable();<NEW_LINE>// define the unique name of the server instance<NEW_LINE><MASK><NEW_LINE>// Could also instead call serverProps.put("jetty.http.port", "9999");<NEW_LINE>// register as an OSGi Service for Jetty to find<NEW_LINE>_sr = context.registerService(Server.class.getName(), server, serverProps);<NEW_LINE>}
serverProps.put("managedServerName", "fooServer");
1,219,522
public Response handle(Command command) {<NEW_LINE>Response response = new Response();<NEW_LINE>SessionId sessionId = command.getSessionId();<NEW_LINE>if (sessionId != null) {<NEW_LINE>response.setSessionId(sessionId.toString());<NEW_LINE>}<NEW_LINE>throwUpIfSessionTerminated(sessionId);<NEW_LINE>final RestishHandler<?> handler = handlerFactory.createHandler(sessionId);<NEW_LINE>try {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, Object> parameters = (Map<String, Object>) command.getParameters();<NEW_LINE>if (parameters != null && !parameters.isEmpty()) {<NEW_LINE>handler.setJsonParameters(parameters);<NEW_LINE>}<NEW_LINE>throwUpIfSessionTerminated(sessionId);<NEW_LINE>Consumer<String> logger = DriverCommand.STATUS.equals(command.getName()) ? log::fine : log::info;<NEW_LINE>logger.accept(String.format("Executing: %s)", handler));<NEW_LINE>Object value = handler.handle();<NEW_LINE>if (value instanceof Response) {<NEW_LINE>response = (Response) value;<NEW_LINE>} else {<NEW_LINE>response.setValue(value);<NEW_LINE>response.setState(ErrorCodes.SUCCESS_STRING);<NEW_LINE>response.setStatus(ErrorCodes.SUCCESS);<NEW_LINE>}<NEW_LINE>logger.accept("Done: " + handler);<NEW_LINE>} catch (UnreachableBrowserException e) {<NEW_LINE>throwUpIfSessionTerminated(sessionId);<NEW_LINE>return Responses.failure(sessionId, e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.WARNING, "Exception thrown", e);<NEW_LINE>Throwable toUse = getRootExceptionCause(e);<NEW_LINE>log.warning("Exception: " + toUse.getMessage());<NEW_LINE>Optional<String> screenshot = Optional.empty();<NEW_LINE>if (handler instanceof WebDriverHandler) {<NEW_LINE>screenshot = Optional.ofNullable(((WebDriverHandler<?>) handler).getScreenshot());<NEW_LINE>}<NEW_LINE>response = Responses.failure(sessionId, toUse, screenshot);<NEW_LINE>} catch (Error e) {<NEW_LINE>log.info(<MASK><NEW_LINE>response = Responses.failure(sessionId, e);<NEW_LINE>}<NEW_LINE>if (handler instanceof DeleteSession) {<NEW_LINE>// Yes, this is funky. See javadoc on cleatThreadTempLogs for details.<NEW_LINE>final PerSessionLogHandler logHandler = LoggingManager.perSessionLogHandler();<NEW_LINE>logHandler.transferThreadTempLogsToSessionLogs(sessionId);<NEW_LINE>logHandler.removeSessionLogs(sessionId);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
"Error: " + e.getMessage());
1,312,869
private void exportSites(final Path target) throws FrameworkException {<NEW_LINE>logger.info("Exporting sites");<NEW_LINE>final List<Map<String, Object>> sites = new LinkedList<>();<NEW_LINE>final App app = StructrApp.getInstance();<NEW_LINE>try (final Tx tx = app.tx()) {<NEW_LINE>for (final Site site : app.nodeQuery(Site.class).sort(Site.name).getAsList()) {<NEW_LINE>final Map<String, Object> entry = new TreeMap<>();<NEW_LINE>sites.add(entry);<NEW_LINE>entry.put("id", site.getProperty(Site.id));<NEW_LINE>entry.put("name", site.getName());<NEW_LINE>entry.put("hostname", site.getHostname());<NEW_LINE>entry.put("port", site.getPort());<NEW_LINE>entry.put("visibleToAuthenticatedUsers", site<MASK><NEW_LINE>entry.put("visibleToPublicUsers", site.getProperty(Site.visibleToPublicUsers));<NEW_LINE>final List<String> pageNames = new LinkedList<>();<NEW_LINE>for (final Page page : (Iterable<Page>) site.getProperty(StructrApp.key(Site.class, "pages"))) {<NEW_LINE>pageNames.add(page.getName());<NEW_LINE>}<NEW_LINE>entry.put("pages", pageNames);<NEW_LINE>exportOwnershipAndSecurity(site, entry);<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>}<NEW_LINE>writeJsonToFile(target, sites);<NEW_LINE>}
.getProperty(Site.visibleToAuthenticatedUsers));
1,112,068
public static Map<File, String> downloadFiles(@NonNull final String url, @NonNull final List<File> files, @NonNull final Map<String, String> parameters, @Nullable final OnFilesDownloadCallback callback) {<NEW_LINE>Map<File, String> <MASK><NEW_LINE>for (final File file : files) {<NEW_LINE>final int[] progressValue = { 0 };<NEW_LINE>publishFilesDownloadProgress(file, 0, callback);<NEW_LINE>IProgress progress = null;<NEW_LINE>if (callback != null) {<NEW_LINE>progress = new NetworkProgress() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void progress(int deltaWork) {<NEW_LINE>progressValue[0] += deltaWork;<NEW_LINE>publishFilesDownloadProgress(file, progressValue[0], callback);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Map<String, String> params = new HashMap<>(parameters);<NEW_LINE>if (callback != null) {<NEW_LINE>Map<String, String> additionalParams = callback.getAdditionalParams(file);<NEW_LINE>if (additionalParams != null) {<NEW_LINE>params.putAll(additionalParams);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean firstPrm = !url.contains("?");<NEW_LINE>StringBuilder sb = new StringBuilder(url);<NEW_LINE>for (Entry<String, String> entry : params.entrySet()) {<NEW_LINE>sb.append(firstPrm ? "?" : "&").append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(), "UTF-8"));<NEW_LINE>firstPrm = false;<NEW_LINE>}<NEW_LINE>String res = downloadFile(sb.toString(), file, true, progress);<NEW_LINE>if (res != null) {<NEW_LINE>errors.put(file, res);<NEW_LINE>} else {<NEW_LINE>if (callback != null) {<NEW_LINE>callback.onFileDownloadedAsync(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>errors.put(file, e.getMessage());<NEW_LINE>}<NEW_LINE>publishFilesDownloadProgress(file, -1, callback);<NEW_LINE>}<NEW_LINE>if (callback != null) {<NEW_LINE>callback.onFilesDownloadDone(errors);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>}
errors = new HashMap<>();
8,317
// This method spawns a mob at loc, owned by target<NEW_LINE>public static void spawnmob(final IEssentials ess, final Server server, final CommandSource sender, final User target, final Location loc, final List<String> parts, final List<String> data, int mobCount) throws Exception {<NEW_LINE>final Location sloc = LocationUtil.getSafeDestination(ess, loc);<NEW_LINE>for (final String part : parts) {<NEW_LINE>final Mob mob = Mob.fromName(part);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final int serverLimit = ess.getSettings().getSpawnMobLimit();<NEW_LINE>int effectiveLimit = serverLimit / parts.size();<NEW_LINE>if (effectiveLimit < 1) {<NEW_LINE>effectiveLimit = 1;<NEW_LINE>while (parts.size() > serverLimit) {<NEW_LINE>parts.remove(serverLimit);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mobCount > effectiveLimit) {<NEW_LINE>mobCount = effectiveLimit;<NEW_LINE>sender.sendMessage(tl("mobSpawnLimit"));<NEW_LINE>}<NEW_LINE>// Get the first mob<NEW_LINE>final Mob mob = Mob.fromName(parts.get(0));<NEW_LINE>try {<NEW_LINE>for (int i = 0; i < mobCount; i++) {<NEW_LINE>spawnMob(ess, server, sender, target, sloc, parts, data);<NEW_LINE>}<NEW_LINE>sender.sendMessage(mobCount * parts.size() + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + tl("spawned"));<NEW_LINE>} catch (final MobException e1) {<NEW_LINE>throw new Exception(tl("unableToSpawnMob"), e1);<NEW_LINE>} catch (final NumberFormatException e2) {<NEW_LINE>throw new Exception(tl("numberRequired"), e2);<NEW_LINE>} catch (final NullPointerException np) {<NEW_LINE>throw new Exception(tl("soloMob"), np);<NEW_LINE>}<NEW_LINE>}
checkSpawnable(ess, sender, mob);
434,514
Object strOneArg(VirtualFrame frame, Object strClass, Object obj, @SuppressWarnings("unused") PNone encoding, @SuppressWarnings("unused") PNone errors, @Cached PyObjectStrAsObjectNode strNode) {<NEW_LINE>Object result = strNode.execute(frame, obj);<NEW_LINE>// try to return a primitive if possible<NEW_LINE>if (getIsStringProfile().profile(result instanceof String)) {<NEW_LINE>return asPString<MASK><NEW_LINE>}<NEW_LINE>if (isPrimitiveProfile.profileClass(strClass, PythonBuiltinClassType.PString)) {<NEW_LINE>// PyObjectStrAsObjectNode guarantees that the returned object is an instanceof of<NEW_LINE>// 'str'<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>return asPString(strClass, getCastToJavaStringNode().execute(result));<NEW_LINE>} catch (CannotCastException e) {<NEW_LINE>CompilerDirectives.transferToInterpreterAndInvalidate();<NEW_LINE>throw new IllegalStateException("asPstring result not castable to String");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(strClass, (String) result);
639,651
private void initializeRingBufferTaskFactories() {<NEW_LINE>factories.put(RingbufferReadOneCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferReadOneMessageTask(cm, node, con));<NEW_LINE>factories.put(RingbufferAddAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferAddAllMessageTask(cm, node, con));<NEW_LINE>factories.put(RingbufferCapacityCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferCapacityMessageTask(cm, node, con));<NEW_LINE>factories.put(RingbufferTailSequenceCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferTailSequenceMessageTask(cm, node, con));<NEW_LINE>factories.put(RingbufferAddCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferAddMessageTask<MASK><NEW_LINE>factories.put(RingbufferRemainingCapacityCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferRemainingCapacityMessageTask(cm, node, con));<NEW_LINE>factories.put(RingbufferReadManyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferReadManyMessageTask(cm, node, con));<NEW_LINE>factories.put(RingbufferHeadSequenceCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferHeadSequenceMessageTask(cm, node, con));<NEW_LINE>factories.put(RingbufferSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferSizeMessageTask(cm, node, con));<NEW_LINE>}
(cm, node, con));
520,894
private static Set<String> toStrings(Glob_range_setContext ctx, long maxValue) {<NEW_LINE>if (ctx.unnumbered != null) {<NEW_LINE>return ImmutableSet.of(ctx.unnumbered.getText());<NEW_LINE>}<NEW_LINE>String baseWord = ctx.base_word.getText();<NEW_LINE>if (ctx.first_interval_end == null && ctx.other_numeric_ranges == null) {<NEW_LINE>return ImmutableSet.of(baseWord);<NEW_LINE>}<NEW_LINE>Matcher matcher = NUMBERED_WORD_PATTERN.matcher(baseWord);<NEW_LINE>// parser+lexer guarantee match<NEW_LINE>matcher.matches();<NEW_LINE>String prefix = matcher.group(1);<NEW_LINE>long firstIntervalStart = Long.parseLong(matcher<MASK><NEW_LINE>long firstIntervalEnd = ctx.first_interval_end != null ? Long.parseLong(ctx.first_interval_end.getText(), 10) : firstIntervalStart;<NEW_LINE>checkArgument(firstIntervalStart <= maxValue && firstIntervalEnd <= maxValue);<NEW_LINE>// attempt to add first interval<NEW_LINE>ImmutableRangeSet.Builder<Long> builder = ImmutableRangeSet.builder();<NEW_LINE>try {<NEW_LINE>// TODO have better parsing for globs: https://github.com/batfish/batfish/issues/4386<NEW_LINE>builder.add(Range.closed(firstIntervalStart, firstIntervalEnd));<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>return ImmutableSet.of();<NEW_LINE>}<NEW_LINE>// All good, proceed to numeric ranges<NEW_LINE>if (ctx.other_numeric_ranges != null) {<NEW_LINE>// add other intervals<NEW_LINE>RangeSet<Long> rangeSet = toRangeSet(ctx.other_numeric_ranges);<NEW_LINE>checkUpperBound(rangeSet, maxValue);<NEW_LINE>builder.addAll(rangeSet);<NEW_LINE>}<NEW_LINE>return builder.build().asRanges().stream().flatMapToLong(r -> {<NEW_LINE>assert r.lowerBoundType() == BoundType.CLOSED && r.upperBoundType() == BoundType.CLOSED;<NEW_LINE>return LongStream.rangeClosed(r.lowerEndpoint(), r.upperEndpoint());<NEW_LINE>}).mapToObj(i -> String.format("%s%d", prefix, i)).collect(ImmutableSet.toImmutableSet());<NEW_LINE>}
.group(2), 10);
1,832,966
public UpdateAccountSettingsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateAccountSettingsResult updateAccountSettingsResult = new UpdateAccountSettingsResult();<NEW_LINE>updateAccountSettingsResult.setStatus(context.<MASK><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 updateAccountSettingsResult;<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>updateAccountSettingsResult.setRequestId(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 updateAccountSettingsResult;<NEW_LINE>}
getHttpResponse().getStatusCode());
1,022,586
public void onPrepareSubMenu(final SubMenu subMenu) {<NEW_LINE>subMenu.removeGroup(MENU_GROUP);<NEW_LINE>if (mAccounts == null)<NEW_LINE>return;<NEW_LINE>for (int i = 0, j = mAccounts.length; i < j; i++) {<NEW_LINE>final AccountDetails account = mAccounts[i];<NEW_LINE>final MenuItem item = subMenu.add(MENU_GROUP, Menu.NONE, <MASK><NEW_LINE>final Intent intent = new Intent();<NEW_LINE>intent.putExtra(EXTRA_ACCOUNT, account);<NEW_LINE>item.setIntent(intent);<NEW_LINE>}<NEW_LINE>subMenu.setGroupCheckable(MENU_GROUP, true, mExclusive);<NEW_LINE>for (int i = 0, j = subMenu.size(); i < j; i++) {<NEW_LINE>final MenuItem item = subMenu.getItem(i);<NEW_LINE>if (mAccounts[i].activated) {<NEW_LINE>item.setChecked(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
i, account.user.name);
619,560
private static void addOrUpdateRemoteConfig(Environment env, boolean isUpdateOrNot) {<NEW_LINE>StandardEnvironment environment = (StandardEnvironment) env;<NEW_LINE>PropertySource propertySource = environment.getPropertySources().get("bootstrapProperties");<NEW_LINE>if (propertySource == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CompositePropertySource source = (CompositePropertySource) propertySource;<NEW_LINE>for (String key : source.getPropertyNames()) {<NEW_LINE>Object val = source.getProperty(key);<NEW_LINE>if (val == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (isUpdateOrNot) {<NEW_LINE>logger.info("update remote config => " + key + " = " + source.getProperty(key));<NEW_LINE>BDPConfiguration.set(<MASK><NEW_LINE>} else {<NEW_LINE>logger.info("add remote config => " + key + " = " + source.getProperty(key));<NEW_LINE>BDPConfiguration.setIfNotExists(key, val.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
key, val.toString());
407,140
public void testNew2Invocations(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>Client c = cb.build();<NEW_LINE>WebTarget t1 = c.target("http://" + serverIP + ":" + serverPort + "/" + moduleName + "/ComplexClientTest/ComplexResource");<NEW_LINE>WebTarget t2 = c.target("http://" + serverIP + ":" + serverPort + "/" + moduleName + "/ComplexClientTest/ComplexResource");<NEW_LINE>Builder ib = t1.path("echo1").<MASK><NEW_LINE>Invocation iv = ib.buildGet();<NEW_LINE>String res1 = iv.invoke(String.class);<NEW_LINE>Builder ib2 = t2.path("echo2").path("test4").request();<NEW_LINE>Invocation iv2 = ib2.buildGet();<NEW_LINE>String res2 = iv2.invoke(String.class);<NEW_LINE>c.close();<NEW_LINE>ret.append(res1 + "," + res2);<NEW_LINE>}
path("test3").request();
61,777
protected Object singleByteOptimizable(Rope stringRope, Rope patternRope, int offset, @Cached @Shared("stringBytesNode") BytesNode stringBytesNode, @Cached @Shared("patternBytesNode") BytesNode patternBytesNode, @Cached LoopConditionProfile loopProfile) {<NEW_LINE>assert offset >= 0;<NEW_LINE>int p = offset;<NEW_LINE>final <MASK><NEW_LINE>final int pe = patternRope.byteLength();<NEW_LINE>final int l = e - pe + 1;<NEW_LINE>final byte[] stringBytes = stringBytesNode.execute(stringRope);<NEW_LINE>final byte[] patternBytes = patternBytesNode.execute(patternRope);<NEW_LINE>try {<NEW_LINE>for (; loopProfile.inject(p < l); p++) {<NEW_LINE>if (ArrayUtils.regionEquals(stringBytes, p, patternBytes, 0, pe)) {<NEW_LINE>return p;<NEW_LINE>}<NEW_LINE>TruffleSafepoint.poll(this);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>profileAndReportLoopCount(loopProfile, p - offset);<NEW_LINE>}<NEW_LINE>return nil;<NEW_LINE>}
int e = stringRope.byteLength();
1,644,050
public static Dataset<Row> alignLinked(Dataset<Row> dupesActual, Arguments args) {<NEW_LINE>dupesActual = dupesActual.cache();<NEW_LINE>dupesActual = dupesActual.withColumnRenamed(ColName.ID_COL, ColName.CLUSTER_COLUMN);<NEW_LINE>List<Column> cols = new ArrayList<Column>();<NEW_LINE>cols.add(dupesActual<MASK><NEW_LINE>cols.add(dupesActual.col(ColName.SCORE_COL));<NEW_LINE>for (FieldDefinition def : args.getFieldDefinition()) {<NEW_LINE>cols.add(dupesActual.col(def.fieldName));<NEW_LINE>}<NEW_LINE>cols.add(dupesActual.col(ColName.SOURCE_COL));<NEW_LINE>Dataset<Row> dupes1 = dupesActual.select(JavaConverters.asScalaIteratorConverter(cols.iterator()).asScala().toSeq());<NEW_LINE>dupes1 = dupes1.dropDuplicates(ColName.CLUSTER_COLUMN, ColName.SOURCE_COL);<NEW_LINE>List<Column> cols1 = new ArrayList<Column>();<NEW_LINE>cols1.add(dupesActual.col(ColName.CLUSTER_COLUMN));<NEW_LINE>cols1.add(dupesActual.col(ColName.SCORE_COL));<NEW_LINE>for (FieldDefinition def : args.getFieldDefinition()) {<NEW_LINE>cols1.add(dupesActual.col(ColName.COL_PREFIX + def.fieldName));<NEW_LINE>}<NEW_LINE>cols1.add(dupesActual.col(ColName.COL_PREFIX + ColName.SOURCE_COL));<NEW_LINE>Dataset<Row> dupes2 = dupesActual.select(JavaConverters.asScalaIteratorConverter(cols1.iterator()).asScala().toSeq());<NEW_LINE>dupes2 = dupes2.toDF(dupes1.columns()).cache();<NEW_LINE>dupes1 = dupes1.union(dupes2);<NEW_LINE>return dupes1;<NEW_LINE>}
.col(ColName.CLUSTER_COLUMN));
622,286
private void nextAnswer(Request fromUpstream, CachingRequestState<?, ConceptMap> requestState, int iteration) {<NEW_LINE>Optional<Partial.Compound<?, ?>> upstreamAnswer = requestState.nextAnswer(<MASK><NEW_LINE>if (upstreamAnswer.isPresent()) {<NEW_LINE>answerFound(upstreamAnswer.get(), fromUpstream, iteration);<NEW_LINE>} else {<NEW_LINE>Exploration exploration;<NEW_LINE>if (requestState.isExploration() && !requestState.answerCache().isComplete()) {<NEW_LINE>if ((exploration = requestState.asExploration()).downstreamManager().hasDownstream()) {<NEW_LINE>requestFromDownstream(exploration.downstreamManager().nextDownstream(), fromUpstream, iteration);<NEW_LINE>} else {<NEW_LINE>// TODO: The cache should not be set as complete during recursion<NEW_LINE>requestState.answerCache().setComplete();<NEW_LINE>failToUpstream(fromUpstream, iteration);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>failToUpstream(fromUpstream, iteration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).map(Partial::asCompound);
849,594
public PsiElement restoreBySignature(@Nonnull PsiFile file, @Nonnull String signature, @Nullable StringBuilder processingInfoStorage) {<NEW_LINE>int semicolonIndex = signature.indexOf(ELEMENTS_SEPARATOR);<NEW_LINE>PsiElement parent;<NEW_LINE>if (semicolonIndex >= 0) {<NEW_LINE>String parentSignature = signature.substring(semicolonIndex + 1);<NEW_LINE>if (processingInfoStorage != null) {<NEW_LINE>processingInfoStorage.append(String.format("Provider '%s'. Restoring parent by signature '%s'...%n", getClass().getName(), parentSignature));<NEW_LINE>}<NEW_LINE>parent = restoreBySignature(file, parentSignature, processingInfoStorage);<NEW_LINE>if (processingInfoStorage != null) {<NEW_LINE>processingInfoStorage.append(String.format("Restored parent by signature '%s': %s%n", parentSignature, parent));<NEW_LINE>}<NEW_LINE>if (parent == null)<NEW_LINE>return null;<NEW_LINE>signature = signature.substring(0, semicolonIndex);<NEW_LINE>} else {<NEW_LINE>parent = file;<NEW_LINE>}<NEW_LINE>StringTokenizer tokenizer = new StringTokenizer(signature, ELEMENT_TOKENS_SEPARATOR);<NEW_LINE><MASK><NEW_LINE>if (processingInfoStorage != null) {<NEW_LINE>processingInfoStorage.append(String.format("Provider '%s'. Restoring target element by signature '%s'. Parent: %s, same as the given parent: %b%n", getClass().getName(), signature, parent, parent == file));<NEW_LINE>}<NEW_LINE>return restoreBySignatureTokens(file, parent, type, tokenizer, processingInfoStorage);<NEW_LINE>}
String type = tokenizer.nextToken();
145,376
public PutRecordsResultEntry unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PutRecordsResultEntry putRecordsResultEntry = new PutRecordsResultEntry();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("SequenceNumber", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>putRecordsResultEntry.setSequenceNumber(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ShardId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>putRecordsResultEntry.setShardId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ErrorCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>putRecordsResultEntry.setErrorCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ErrorMessage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>putRecordsResultEntry.setErrorMessage(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 putRecordsResultEntry;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
433,385
private void addToStatement(X_I_BankStatement toImport) {<NEW_LINE>// Get the bank account for the first statement<NEW_LINE>// New Statement<NEW_LINE>if (isToCreate(toImport)) {<NEW_LINE>try {<NEW_LINE>createStatement(toImport);<NEW_LINE>noInsert.updateAndGet(count -> count + 1);<NEW_LINE>} catch (Exception e) {<NEW_LINE>statement = null;<NEW_LINE>}<NEW_LINE>lineNo.updateAndGet(count -> count + 10);<NEW_LINE>}<NEW_LINE>// New StatementLine<NEW_LINE>if (statement != null) {<NEW_LINE>try {<NEW_LINE>MBankStatementLine line = new MBankStatementLine(statement, toImport, lineNo.get());<NEW_LINE>line.saveEx();<NEW_LINE>toImport.<MASK><NEW_LINE>toImport.setC_BankStatementLine_ID(line.getC_BankStatementLine_ID());<NEW_LINE>toImport.setI_IsImported(true);<NEW_LINE>toImport.setProcessed(true);<NEW_LINE>toImport.saveEx();<NEW_LINE>noInsertLine.updateAndGet(count -> count + 1);<NEW_LINE>lineNo.updateAndGet(count -> count + 10);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setC_BankStatement_ID(statement.getC_BankStatement_ID());
794,229
public void testCompletionStageRxInvoker_getIbmOverridesCbConnectionTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String target = null;<NEW_LINE>if (isZOS()) {<NEW_LINE>// https://stackoverflow.com/a/904609/6575578<NEW_LINE>target = "http://example.com:81";<NEW_LINE>} else {<NEW_LINE>// Connect to telnet port - which should be disabled on all non-Z test machines - so we should expect a timeout<NEW_LINE>target = "http://localhost:23/blah";<NEW_LINE>}<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>cb.connectTimeout(clientBuilderTimeout, TimeUnit.MILLISECONDS);<NEW_LINE>cb.property("com.ibm.ws.jaxrs.client.connection.timeout", TIMEOUT);<NEW_LINE>Client c = cb.build();<NEW_LINE>WebTarget t = c.target(target);<NEW_LINE>Builder builder = t.request();<NEW_LINE>CompletionStageRxInvoker completionStageRxInvoker = builder.rx();<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>CompletionStage<Response> completionStage = completionStageRxInvoker.get();<NEW_LINE>long elapsed = System.currentTimeMillis() - startTime;<NEW_LINE>System.out.println("testCompletionStageRxInvoker_getIbmOverridesCbConnectionTimeout with TIMEOUT " + TIMEOUT + " completionStageRxInvoker.get elapsed time " + elapsed);<NEW_LINE>CompletableFuture<Response> completableFuture = completionStage.toCompletableFuture();<NEW_LINE>long startTime2 = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>Response response = completableFuture.get();<NEW_LINE>// Did not time out as expected<NEW_LINE>ret.append(response.readEntity(String.class));<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>ret.append("InterruptedException");<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>if (e.getCause().toString().contains("ProcessingException")) {<NEW_LINE>ret.append("Timeout as expected");<NEW_LINE>} else {<NEW_LINE>ret.append("ExecutionException");<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long elapsed2 = System.currentTimeMillis() - startTime2;<NEW_LINE>System.out.println("testCompletionStageRxInvoker_getIbmOverridesCbConnectionTimeout with TIMEOUT " + TIMEOUT + " completableFuture.get() elapsed2 time " + elapsed2);<NEW_LINE>if (elapsed > clientBuilderTimeout) {<NEW_LINE>ret.setLength(0);<NEW_LINE>ret.append("Failure used clientBuilderTimeout ").append(clientBuilderTimeout).append(" instead of IBM timeout ").append(TIMEOUT).append(" as the elapsed time was ").append(elapsed);<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>c.close();<NEW_LINE>}
out.println("testCompletionStageRxInvoker_getIbmOverridesCbConnectionTimeout " + ret);
1,568,671
public static void unzip(File zipFile, File targetDirectory) throws IOException {<NEW_LINE>ZipInputStream zis = new ZipInputStream(new BufferedInputStream<MASK><NEW_LINE>try {<NEW_LINE>ZipEntry ze;<NEW_LINE>int count;<NEW_LINE>byte[] buffer = new byte[8192];<NEW_LINE>while ((ze = zis.getNextEntry()) != null) {<NEW_LINE>File file = new File(targetDirectory, ze.getName());<NEW_LINE>File dir = ze.isDirectory() ? file : file.getParentFile();<NEW_LINE>if (!dir.isDirectory() && !dir.mkdirs())<NEW_LINE>throw new FileNotFoundException("Failed to ensure directory: " + dir.getAbsolutePath());<NEW_LINE>if (ze.isDirectory())<NEW_LINE>continue;<NEW_LINE>FileOutputStream fout = new FileOutputStream(file);<NEW_LINE>try {<NEW_LINE>while ((count = zis.read(buffer)) != -1) fout.write(buffer, 0, count);<NEW_LINE>} finally {<NEW_LINE>fout.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>zis.close();<NEW_LINE>}<NEW_LINE>}
(new FileInputStream(zipFile)));
1,719,098
private void writeEmbeddedValue(int pid, int rid, Object value, ByteBuffer buffer, PackageMetaData packageMetaData) throws BimserverDatabaseException {<NEW_LINE>IdEObject wrappedValue = (IdEObject) value;<NEW_LINE>Short cid = database.getCidOfEClass(wrappedValue.eClass());<NEW_LINE>buffer.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>buffer.<MASK><NEW_LINE>buffer.order(ByteOrder.BIG_ENDIAN);<NEW_LINE>for (EStructuralFeature eStructuralFeature : wrappedValue.eClass().getEAllStructuralFeatures()) {<NEW_LINE>if (eStructuralFeature.isMany()) {<NEW_LINE>writeList(wrappedValue, buffer, packageMetaData, eStructuralFeature);<NEW_LINE>} else {<NEW_LINE>Object val = wrappedValue.eGet(eStructuralFeature);<NEW_LINE>if (eStructuralFeature.getEType() instanceof EClass) {<NEW_LINE>writeEmbeddedValue(pid, rid, val, buffer, packageMetaData);<NEW_LINE>} else {<NEW_LINE>writePrimitiveValue(eStructuralFeature, val, buffer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
putShort((short) -cid);
926,094
public int drainCipherBytes(ByteBuffer buffer) throws IOException {<NEW_LINE>try (AutoLock ignore = lock.lock()) {<NEW_LINE>if (quicheConn == null)<NEW_LINE>throw new IOException("Cannot send when not connected");<NEW_LINE>int prevPosition = buffer.position();<NEW_LINE>long written;<NEW_LINE>if (buffer.isDirect()) {<NEW_LINE>// If the ByteBuffer is direct, it can be used without any copy.<NEW_LINE>MemorySegment <MASK><NEW_LINE>written = quiche_h.quiche_conn_send(quicheConn, bufferSegment.address(), buffer.remaining(), sendInfo.address());<NEW_LINE>} else {<NEW_LINE>// If the ByteBuffer is heap-allocated, native memory must be copied to it.<NEW_LINE>try (ResourceScope scope = ResourceScope.newConfinedScope()) {<NEW_LINE>MemorySegment bufferSegment = MemorySegment.allocateNative(buffer.remaining(), scope);<NEW_LINE>written = quiche_h.quiche_conn_send(quicheConn, bufferSegment.address(), buffer.remaining(), sendInfo.address());<NEW_LINE>buffer.put(bufferSegment.asByteBuffer().slice().limit((int) written));<NEW_LINE>buffer.position(prevPosition);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (written == quiche_error.QUICHE_ERR_DONE)<NEW_LINE>return 0;<NEW_LINE>if (written < 0L)<NEW_LINE>throw new IOException("failed to send packet; err=" + quiche_error.errToString(written));<NEW_LINE>buffer.position((int) (prevPosition + written));<NEW_LINE>return (int) written;<NEW_LINE>}<NEW_LINE>}
bufferSegment = MemorySegment.ofByteBuffer(buffer);
458,151
public NType resolve(Scope s) throws Exception {<NEW_LINE>NClassType thisType = getType().asClassType();<NEW_LINE>List<NType> baseTypes = new ArrayList<NType>();<NEW_LINE>for (NNode base : bases) {<NEW_LINE>NType baseType = resolveExpr(base, s);<NEW_LINE>if (baseType.isClassType()) {<NEW_LINE>thisType.addSuper(baseType);<NEW_LINE>}<NEW_LINE>baseTypes.add(baseType);<NEW_LINE>}<NEW_LINE>Builtins builtins = Indexer.idx.builtins;<NEW_LINE>addSpecialAttribute("__bases__", new NTupleType(baseTypes));<NEW_LINE>addSpecialAttribute("__name__", builtins.BaseStr);<NEW_LINE>addSpecialAttribute("__module__", builtins.BaseStr);<NEW_LINE>addSpecialAttribute("__doc__", builtins.BaseStr);<NEW_LINE>addSpecialAttribute("__dict__", new NDictType(builtins.<MASK><NEW_LINE>resolveExpr(body, getTable());<NEW_LINE>return getType();<NEW_LINE>}
BaseStr, new NUnknownType()));
1,323,707
public void onClick(View v) {<NEW_LINE>new ColorsDialog((FragmentActivity) controller.getActivity(), (Boolean) t1Img.getTag(), (Integer) t3Text.getTag(), (Integer) t2BG.getTag(), true, true, new ColorsDialogResult() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onChooseColor(int colorText, int colorBg) {<NEW_LINE>t1Img.setTextColor(colorText);<NEW_LINE>t1Img.setBackgroundColor(colorBg);<NEW_LINE>t2BG.setText(TxtUtils.underline(MagicHelper.colorToString(colorBg)));<NEW_LINE>t3Text.setText(TxtUtils.underline(<MASK><NEW_LINE>t2BG.setTag(colorBg);<NEW_LINE>t3Text.setTag(colorText);<NEW_LINE>String line = name + "," + MagicHelper.colorToString(colorBg) + "," + MagicHelper.colorToString(colorText) + "," + split[3];<NEW_LINE>child.setTag(line);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
MagicHelper.colorToString(colorText)));
966,733
public void paint(Editor editor, Graphics g, Rectangle range) {<NEW_LINE>EditorGutterComponentEx gutter = ((EditorEx) editor).getGutterComponentEx();<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>int x1 = 0;<NEW_LINE>int x2 = x1 + gutter.getWidth();<NEW_LINE>int y1, y2;<NEW_LINE>if (myEmptyRange && myLastLine) {<NEW_LINE>y1 = DiffDrawUtil.lineToY(editor, DiffUtil.getLineCount(editor.getDocument()));<NEW_LINE>y2 = y1;<NEW_LINE>} else {<NEW_LINE>int startLine = editor.getDocument().<MASK><NEW_LINE>int endLine = editor.getDocument().getLineNumber(myHighlighter.getEndOffset()) + 1;<NEW_LINE>y1 = DiffDrawUtil.lineToY(editor, startLine);<NEW_LINE>y2 = myEmptyRange ? y1 : DiffDrawUtil.lineToY(editor, endLine);<NEW_LINE>}<NEW_LINE>if (myHideWithoutLineNumbers && !editor.getSettings().isLineNumbersShown()) {<NEW_LINE>x1 = gutter.getWhitespaceSeparatorOffset();<NEW_LINE>} else {<NEW_LINE>int annotationsOffset = gutter.getAnnotationsAreaOffset();<NEW_LINE>int annotationsWidth = gutter.getAnnotationsAreaWidth();<NEW_LINE>if (annotationsWidth != 0) {<NEW_LINE>drawMarker(editor, g2, x1, annotationsOffset, y1, y2, false);<NEW_LINE>x1 = annotationsOffset + annotationsWidth;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (myIgnoredFoldingOutline) {<NEW_LINE>int xOutline = gutter.getWhitespaceSeparatorOffset();<NEW_LINE>drawMarker(editor, g2, xOutline, x2, y1, y2, true);<NEW_LINE>drawMarker(editor, g2, x1, xOutline, y1, y2, false);<NEW_LINE>} else {<NEW_LINE>drawMarker(editor, g2, x1, x2, y1, y2, false);<NEW_LINE>}<NEW_LINE>}
getLineNumber(myHighlighter.getStartOffset());
1,625,911
private static void tryAssert(RegressionEnvironment env) {<NEW_LINE>// assert select result type<NEW_LINE>String[] fields = "mySum".split(",");<NEW_LINE>env.assertStatement("s0", statement -> assertEquals(Long.class, statement.getEventType().getPropertyType("mySum")));<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", new String[] { "mySum" }, new Object[]<MASK><NEW_LINE>sendTimerEvent(env, 0);<NEW_LINE>sendEvent(env, 10);<NEW_LINE>assertMySum(env, 10L);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", new String[] { "mySum" }, new Object[][] { { 10L } });<NEW_LINE>sendTimerEvent(env, 5000);<NEW_LINE>sendEvent(env, 15);<NEW_LINE>assertMySum(env, 25L);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", new String[] { "mySum" }, new Object[][] { { 25L } });<NEW_LINE>sendTimerEvent(env, 8000);<NEW_LINE>sendEvent(env, -5);<NEW_LINE>assertMySum(env, 20L);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", new String[] { "mySum" }, new Object[][] { { 20L } });<NEW_LINE>sendTimerEvent(env, 10000);<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { 10L }, new Object[] { 20L });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", new String[] { "mySum" }, new Object[][] { { 10L } });<NEW_LINE>sendTimerEvent(env, 15000);<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { -5L }, new Object[] { 10L });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", new String[] { "mySum" }, new Object[][] { { -5L } });<NEW_LINE>sendTimerEvent(env, 18000);<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { null }, new Object[] { -5L });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", new String[] { "mySum" }, new Object[][] { { null } });<NEW_LINE>}
[] { { null } });
1,210,636
public void run() {<NEW_LINE>Jep jep = JEPThreadPoolClassifier.getInstance().getJEPInstance();<NEW_LINE>try {<NEW_LINE>// load data<NEW_LINE>// to be reviewed for classification<NEW_LINE>jep.eval("x_all, y_all, f_all = load_data_and_labels_crf_file('" + this.trainPath.getAbsolutePath() + "')");<NEW_LINE>jep.eval("x_train, x_valid, y_train, y_valid = train_test_split(x_all, y_all, test_size=0.1)");<NEW_LINE>jep.eval("print(len(x_train), 'train sequences')");<NEW_LINE>jep.eval("print(len(x_valid), 'validation sequences')");<NEW_LINE>String useELMo = "False";<NEW_LINE>if (GrobidProperties.getInstance().useELMo(this.modelName)) {<NEW_LINE>useELMo = "True";<NEW_LINE>}<NEW_LINE>// init model to be trained<NEW_LINE>jep.eval("model = Classifier('" + this.modelName + "', max_epoch=100, recurrent_dropout=0.50, embeddings_name='glove-840B', use_ELMo=" + useELMo + ")");<NEW_LINE>// actual training<NEW_LINE>// start_time = time.time()<NEW_LINE>jep.eval("model.train(x_train, y_train, x_valid, y_valid)");<NEW_LINE>// runtime = round(time.time() - start_time, 3)<NEW_LINE>// print("training runtime: %s seconds " % (runtime))<NEW_LINE>// saving the model<NEW_LINE>System.out.println(<MASK><NEW_LINE>jep.eval("model.save('" + this.modelPath.getAbsolutePath() + "')");<NEW_LINE>// cleaning<NEW_LINE>jep.eval("del x_all");<NEW_LINE>jep.eval("del y_all");<NEW_LINE>jep.eval("del f_all");<NEW_LINE>jep.eval("del x_train");<NEW_LINE>jep.eval("del x_valid");<NEW_LINE>jep.eval("del y_train");<NEW_LINE>jep.eval("del y_valid");<NEW_LINE>jep.eval("del model");<NEW_LINE>} catch (JepException e) {<NEW_LINE>LOGGER.error("DeLFT classification model training via JEP failed", e);<NEW_LINE>}<NEW_LINE>}
this.modelPath.getAbsolutePath());
208,667
private Object apply(OExpression expression, Map<String, Object> input, OCommandContext ctx, int recursion) {<NEW_LINE>OResultInternal result = new OResultInternal();<NEW_LINE>if (starItem != null || includeItems.size() == 0) {<NEW_LINE>for (String property : input.keySet()) {<NEW_LINE>if (isExclude(property)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>result.setProperty(property, convert(tryExpand(expression, property, input.get(property), ctx, recursion)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (includeItems.size() > 0) {<NEW_LINE>// TODO manage wildcards!<NEW_LINE>for (ONestedProjectionItem item : includeItems) {<NEW_LINE>String alias = item.alias != null ? item.alias.getStringValue() : item.expression.getDefaultAlias().getStringValue();<NEW_LINE>OResultInternal elem = new OResultInternal();<NEW_LINE>input.entrySet().forEach(x -> elem.setProperty(x.getKey(), x.getValue()));<NEW_LINE>Object value = item.expression.execute(elem, ctx);<NEW_LINE>if (item.expansion != null) {<NEW_LINE>value = item.expand(expression, alias, value, ctx, recursion - 1);<NEW_LINE>}<NEW_LINE>result.setProperty<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(alias, convert(value));
435,671
public Mono<Layout> createLayout(String pageId, Layout layout) {<NEW_LINE>if (pageId == null) {<NEW_LINE>return Mono.error(new AppsmithException(AppsmithError.INVALID_PARAMETER, FieldName.PAGE_ID));<NEW_LINE>}<NEW_LINE>// fetch the unpublished page<NEW_LINE>Mono<PageDTO> pageMono = newPageService.findPageById(pageId, MANAGE_PAGES, false).switchIfEmpty(Mono.error(new AppsmithException(AppsmithError.INVALID_PARAMETER, FieldName.PAGE_ID)));<NEW_LINE>return pageMono.map(page -> {<NEW_LINE>List<Layout> layoutList = page.getLayouts();<NEW_LINE>if (layoutList == null) {<NEW_LINE>// no layouts exist for this page<NEW_LINE>layoutList <MASK><NEW_LINE>}<NEW_LINE>// Adding an Id to the layout to ensure that a layout can be referred to by its ID as well.<NEW_LINE>layout.setId(new ObjectId().toString());<NEW_LINE>layoutList.add(layout);<NEW_LINE>page.setLayouts(layoutList);<NEW_LINE>return page;<NEW_LINE>}).flatMap(newPageService::saveUnpublishedPage).then(Mono.just(layout));<NEW_LINE>}
= new ArrayList<Layout>();
974,851
private void export(XlsxBorderInfo info) {<NEW_LINE>// if(info.hasBorder())<NEW_LINE>{<NEW_LINE>write("<border");<NEW_LINE>if (info.getDirection() != null) {<NEW_LINE>write(info.getDirection().equals(LineDirectionEnum.TOP_DOWN) ? " diagonalDown=\"1\"" : " diagonalUp=\"1\"");<NEW_LINE>}<NEW_LINE>write(">");<NEW_LINE>exportBorder(info, XlsxBorderInfo.LEFT_BORDER);<NEW_LINE>exportBorder(info, XlsxBorderInfo.RIGHT_BORDER);<NEW_LINE>exportBorder(info, XlsxBorderInfo.TOP_BORDER);<NEW_LINE>exportBorder(info, XlsxBorderInfo.BOTTOM_BORDER);<NEW_LINE><MASK><NEW_LINE>write("</border>\n");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// write(" <w:tcMar>\n");<NEW_LINE>// exportPadding(info, BorderInfo.TOP_BORDER);<NEW_LINE>// exportPadding(info, BorderInfo.LEFT_BORDER);<NEW_LINE>// exportPadding(info, BorderInfo.BOTTOM_BORDER);<NEW_LINE>// exportPadding(info, BorderInfo.RIGHT_BORDER);<NEW_LINE>// write(" </w:tcMar>\n");<NEW_LINE>}
exportBorder(info, XlsxBorderInfo.DIAGONAL_BORDER);
440,150
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {<NEW_LINE>if (!ModelReturn.class.isAssignableFrom(type.getRawType())) {<NEW_LINE>// this class only serializes 'ModelReturn' and its subtypes<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final TypeAdapter<JsonElement> elementAdapter = <MASK><NEW_LINE>final TypeAdapter<ModelReturn> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(ModelReturn.class));<NEW_LINE>return (TypeAdapter<T>) new TypeAdapter<ModelReturn>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void write(JsonWriter out, ModelReturn value) throws IOException {<NEW_LINE>JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();<NEW_LINE>elementAdapter.write(out, obj);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ModelReturn read(JsonReader in) throws IOException {<NEW_LINE>JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();<NEW_LINE>validateJsonObject(jsonObj);<NEW_LINE>return thisAdapter.fromJsonTree(jsonObj);<NEW_LINE>}<NEW_LINE>}.nullSafe();<NEW_LINE>}
gson.getAdapter(JsonElement.class);