idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
180,542
private void initComponents() {<NEW_LINE>// GEN-BEGIN:initComponents<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>jLabel1 = new javax.swing.JLabel();<NEW_LINE>jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>jPanel1 = new MainClassChooser(sourcesRoots, org.openide.util.NbBundle.getBundle(MainClassWarning.class).getString("CTL_SelectAvaialableMainClasses"));<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(MainClassWarning.class).getString("AD_MainClassWarning"));<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabel1, this.message);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(12, 12, 6, 12);<NEW_LINE>add(jLabel1, gridBagConstraints);<NEW_LINE>jScrollPane1.setBorder(null);<NEW_LINE>jScrollPane1.setViewportView(jPanel1);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 1;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.gridheight <MASK><NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>add(jScrollPane1, gridBagConstraints);<NEW_LINE>}
= java.awt.GridBagConstraints.REMAINDER;
356,741
public void accept(ThreadContext context, SaveContextVisitor visitor) {<NEW_LINE>Document document = getDocument();<NEW_LINE>visitor.enter(document);<NEW_LINE>NodeList children = document.getChildNodes();<NEW_LINE>for (int i = 0; i < children.getLength(); i++) {<NEW_LINE>Node child = children.item(i);<NEW_LINE>short type = child.getNodeType();<NEW_LINE>if (type == Node.COMMENT_NODE) {<NEW_LINE>XmlComment xmlComment = (XmlComment) getCachedNodeOrCreate(context.runtime, child);<NEW_LINE>xmlComment.accept(context, visitor);<NEW_LINE>} else if (type == Node.DOCUMENT_TYPE_NODE) {<NEW_LINE>XmlDtd xmlDtd = (XmlDtd) getCachedNodeOrCreate(context.runtime, child);<NEW_LINE>xmlDtd.accept(context, visitor);<NEW_LINE>} else if (type == Node.PROCESSING_INSTRUCTION_NODE) {<NEW_LINE>XmlProcessingInstruction xmlProcessingInstruction = (XmlProcessingInstruction) getCachedNodeOrCreate(context.runtime, child);<NEW_LINE>xmlProcessingInstruction.accept(context, visitor);<NEW_LINE>} else if (type == Node.TEXT_NODE) {<NEW_LINE>XmlText xmlText = (XmlText) getCachedNodeOrCreate(context.runtime, child);<NEW_LINE>xmlText.accept(context, visitor);<NEW_LINE>} else if (type == Node.ELEMENT_NODE) {<NEW_LINE>XmlElement xmlElement = (XmlElement) <MASK><NEW_LINE>xmlElement.accept(context, visitor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>visitor.leave(document);<NEW_LINE>}
getCachedNodeOrCreate(context.runtime, child);
1,347,819
final DescribeRxNormInferenceJobResult executeDescribeRxNormInferenceJob(DescribeRxNormInferenceJobRequest describeRxNormInferenceJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRxNormInferenceJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRxNormInferenceJobRequest> request = null;<NEW_LINE>Response<DescribeRxNormInferenceJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRxNormInferenceJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRxNormInferenceJobRequest));<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, "ComprehendMedical");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeRxNormInferenceJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRxNormInferenceJobResultJsonUnmarshaller());<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.OPERATION_NAME, "DescribeRxNormInferenceJob");
438,834
protected boolean isWeaker(MutableRel rel0, MutableRel rel) {<NEW_LINE>if (rel0 == rel || equivalents.get(rel0).contains(rel)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!(rel0 instanceof MutableFilter) || !(rel instanceof MutableFilter)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!rel.rowType.equals(rel0.rowType)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final MutableRel rel0input = ((MutableFilter) rel0).getInput();<NEW_LINE>final MutableRel relinput = ((MutableFilter) rel).getInput();<NEW_LINE>if (rel0input != relinput && !equivalents.get(rel0input).contains(relinput)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>RexExecutorImpl rexImpl = (RexExecutorImpl) (rel.cluster.getPlanner().getExecutor());<NEW_LINE>RexImplicationChecker rexImplicationChecker = new RexImplicationChecker(rel.cluster.getRexBuilder(<MASK><NEW_LINE>return rexImplicationChecker.implies(((MutableFilter) rel0).condition, ((MutableFilter) rel).condition);<NEW_LINE>}
), rexImpl, rel.rowType);
1,186,401
public Mono<UserData> saveProfilePhoto(Part filePart) {<NEW_LINE>final Mono<String> prevAssetIdMono = getForCurrentUser().map(userData -> ObjectUtils.defaultIfNull(userData.getProfilePhotoAssetId(), ""));<NEW_LINE>final Mono<Asset> uploaderMono = assetService.upload(filePart, MAX_PROFILE_PHOTO_SIZE_KB, true);<NEW_LINE>return Mono.zip(prevAssetIdMono, uploaderMono).flatMap(tuple -> {<NEW_LINE>final <MASK><NEW_LINE>final Asset uploadedAsset = tuple.getT2();<NEW_LINE>final UserData updates = new UserData();<NEW_LINE>updates.setProfilePhotoAssetId(uploadedAsset.getId());<NEW_LINE>final Mono<UserData> updateMono = updateForCurrentUser(updates).map(userData -> {<NEW_LINE>userChangedHandler.publish(userData.getUserId(), uploadedAsset.getId());<NEW_LINE>return userData;<NEW_LINE>});<NEW_LINE>if (StringUtils.isEmpty(oldAssetId)) {<NEW_LINE>return updateMono;<NEW_LINE>} else {<NEW_LINE>return assetService.remove(oldAssetId).then(updateMono);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
String oldAssetId = tuple.getT1();
545,721
private List<City> fillWithCities(String name, final ResultMatcher<City> resultMatcher, final List<Integer> typeFilter) throws IOException {<NEW_LINE>List<City> result <MASK><NEW_LINE>ResultMatcher<MapObject> matcher = new ResultMatcher<MapObject>() {<NEW_LINE><NEW_LINE>List<City> cache = new ArrayList<City>();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean publish(MapObject o) {<NEW_LINE>City c = (City) o;<NEW_LINE>City.CityType type = c.getType();<NEW_LINE>if (type != null && type.ordinal() >= City.CityType.VILLAGE.ordinal()) {<NEW_LINE>if (c.getLocation() != null) {<NEW_LINE>City ct = getClosestCity(c.getLocation(), cache);<NEW_LINE>c.setClosestCity(ct);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resultMatcher.publish(c);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isCancelled() {<NEW_LINE>return resultMatcher.isCancelled();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>List<MapObject> foundCities = searchMapObjectsByName(name, matcher, typeFilter);<NEW_LINE>for (MapObject o : foundCities) {<NEW_LINE>result.add((City) o);<NEW_LINE>if (resultMatcher.isCancelled()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
= new ArrayList<City>();
1,256,143
public void to(WriteStream<T> ws, Handler<AsyncResult<Void>> completionHandler) {<NEW_LINE>if (ws == null) {<NEW_LINE>throw new NullPointerException();<NEW_LINE>}<NEW_LINE>boolean endOnSuccess;<NEW_LINE>boolean endOnFailure;<NEW_LINE>synchronized (PipeImpl.this) {<NEW_LINE>if (dst != null) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>dst = ws;<NEW_LINE>endOnSuccess = this.endOnSuccess;<NEW_LINE>endOnFailure = this.endOnFailure;<NEW_LINE>}<NEW_LINE>Handler<Void> drainHandler = v -> src.resume();<NEW_LINE>src.handler(item -> {<NEW_LINE>ws.<MASK><NEW_LINE>if (ws.writeQueueFull()) {<NEW_LINE>src.pause();<NEW_LINE>ws.drainHandler(drainHandler);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>src.resume();<NEW_LINE>result.future().onComplete(ar -> {<NEW_LINE>try {<NEW_LINE>src.handler(null);<NEW_LINE>} catch (Exception ignore) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>src.exceptionHandler(null);<NEW_LINE>} catch (Exception ignore) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>src.endHandler(null);<NEW_LINE>} catch (Exception ignore) {<NEW_LINE>}<NEW_LINE>if (ar.succeeded()) {<NEW_LINE>handleSuccess(completionHandler);<NEW_LINE>} else {<NEW_LINE>Throwable err = ar.cause();<NEW_LINE>if (err instanceof WriteException) {<NEW_LINE>src.resume();<NEW_LINE>err = err.getCause();<NEW_LINE>}<NEW_LINE>handleFailure(err, completionHandler);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
write(item, this::handleWriteResult);
293,567
protected static ExtractedInfo extractProvenanceInfo(Map<String, Provenance> map) {<NEW_LINE>Map<String, Provenance> configuredParameters = new HashMap<>(map);<NEW_LINE>String className = ObjectProvenance.checkAndExtractProvenance(configuredParameters, CLASS_NAME, StringProvenance.class, DirectoryFileSourceProvenance.class.getSimpleName()).getValue();<NEW_LINE>String hostTypeStringName = ObjectProvenance.checkAndExtractProvenance(configuredParameters, HOST_SHORT_NAME, StringProvenance.class, DirectoryFileSourceProvenance.class.getSimpleName()).getValue();<NEW_LINE>Map<String, PrimitiveProvenance<?>> instanceParameters = new HashMap<>();<NEW_LINE>instanceParameters.put(DATASOURCE_CREATION_TIME, ObjectProvenance.checkAndExtractProvenance(configuredParameters, DATASOURCE_CREATION_TIME, DateTimeProvenance.class, DirectoryFileSourceProvenance<MASK><NEW_LINE>return new ExtractedInfo(className, hostTypeStringName, configuredParameters, instanceParameters);<NEW_LINE>}
.class.getSimpleName()));
745,904
public String expandExpressions(String text, DatabaseChangeLog changeLog) {<NEW_LINE>if (text == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Matcher matcher = EXPRESSION_PATTERN.matcher(text);<NEW_LINE>String originalText = text;<NEW_LINE>while (matcher.find()) {<NEW_LINE>String expressionString = originalText.substring(matcher.start(<MASK><NEW_LINE>String valueTolookup = expressionString.replaceFirst("\\$\\{", "").replaceFirst("\\}$", "");<NEW_LINE>Object value = (enableEscaping && valueTolookup.startsWith(":")) ? null : changeLogParameters.getValue(valueTolookup, changeLog);<NEW_LINE>if (value != null) {<NEW_LINE>text = text.replace(expressionString, value.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// replace all escaped expressions with its literal<NEW_LINE>if (enableEscaping) {<NEW_LINE>text = text.replaceAll("\\$\\{:(.+?)}", "\\$\\{$1}");<NEW_LINE>}<NEW_LINE>return text;<NEW_LINE>}
), matcher.end());
1,697,204
public boolean processMarkers(Marker[] imagedBoardMarkers, Marker[] imagedProjectorMarkers, int cameraNumber) {<NEW_LINE>rmseBoardWarp[cameraNumber] = boardPlane.getTotalWarp(imagedBoardMarkers, boardWarp[cameraNumber]);<NEW_LINE>rmseProjWarp[cameraNumber] = projectorPlane.getTotalWarp(imagedProjectorMarkers, projWarp[cameraNumber]);<NEW_LINE>int imageSize = (cameraCalibrators[cameraNumber].getProjectiveDevice().imageWidth + cameraCalibrators[cameraNumber].<MASK><NEW_LINE>if (rmseBoardWarp[cameraNumber] <= settings.prewarpUpdateErrorMax * imageSize && rmseProjWarp[cameraNumber] <= settings.prewarpUpdateErrorMax * imageSize) {<NEW_LINE>updatePrewarp = true;<NEW_LINE>} else {<NEW_LINE>// not detected accurately enough..<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// First, check if we detected enough markers...<NEW_LINE>if (imagedBoardMarkers.length < boardPlane.getMarkers().length * settings.detectedBoardMin || imagedProjectorMarkers.length < projectorPlane.getMarkers().length * settings.detectedProjectorMin) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// then check by how much the corners of the calibration board moved<NEW_LINE>cvPerspectiveTransform(boardWarpSrcPts, tempPts1[cameraNumber], boardWarp[cameraNumber]);<NEW_LINE>cvPerspectiveTransform(boardWarpSrcPts, tempPts2[cameraNumber], prevBoardWarp[cameraNumber]);<NEW_LINE>double rmsePrev = cvNorm(tempPts1[cameraNumber], tempPts2[cameraNumber]);<NEW_LINE>cvPerspectiveTransform(boardWarpSrcPts, tempPts2[cameraNumber], lastBoardWarp[cameraNumber]);<NEW_LINE>double rmseLast = cvNorm(tempPts1[cameraNumber], tempPts2[cameraNumber]);<NEW_LINE>// System.out.println("rmsePrev = " + rmsePrev + " rmseLast = " + rmseLast + " cameraNumber = " + cameraNumber);<NEW_LINE>// save boardWarp for next iteration...<NEW_LINE>cvCopy(boardWarp[cameraNumber], prevBoardWarp[cameraNumber]);<NEW_LINE>// send upstream our recommendation for addition or not of these markers...<NEW_LINE>if (rmsePrev < settings.patternSteadySize * imageSize && rmseLast > settings.patternMovedSize * imageSize) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
getProjectiveDevice().imageHeight) / 2;
681,799
final ListDistributionsByKeyGroupResult executeListDistributionsByKeyGroup(ListDistributionsByKeyGroupRequest listDistributionsByKeyGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDistributionsByKeyGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDistributionsByKeyGroupRequest> request = null;<NEW_LINE>Response<ListDistributionsByKeyGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDistributionsByKeyGroupRequestMarshaller().marshall(super.beforeMarshalling(listDistributionsByKeyGroupRequest));<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, "ListDistributionsByKeyGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListDistributionsByKeyGroupResult> responseHandler = new StaxResponseHandler<ListDistributionsByKeyGroupResult>(new ListDistributionsByKeyGroupResultStaxUnmarshaller());<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, "CloudFront");
1,133,641
public void start(Stage stage) {<NEW_LINE>FlowPane main = new FlowPane();<NEW_LINE>main.setVgap(20);<NEW_LINE>main.setHgap(20);<NEW_LINE>main.getChildren().add(new Button("Java Button"));<NEW_LINE>JFXButton jfoenixButton = new JFXButton("JFoenix Button");<NEW_LINE>main.getChildren().add(jfoenixButton);<NEW_LINE>JFXButton button = new JFXButton("RAISED BUTTON");<NEW_LINE>button.getStyleClass().add("button-raised");<NEW_LINE>main.getChildren().add(button);<NEW_LINE>JFXButton button1 = new JFXButton("DISABLED");<NEW_LINE>button1.setDisable(true);<NEW_LINE>main.getChildren().add(button1);<NEW_LINE>StackPane pane = new StackPane();<NEW_LINE>pane.<MASK><NEW_LINE>StackPane.setMargin(main, new Insets(100));<NEW_LINE>pane.setStyle("-fx-background-color:WHITE");<NEW_LINE>final Scene scene = new Scene(pane, 800, 200);<NEW_LINE>scene.getStylesheets().add(ButtonDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());<NEW_LINE>stage.setTitle("JFX Button Demo");<NEW_LINE>stage.setScene(scene);<NEW_LINE>stage.show();<NEW_LINE>}
getChildren().add(main);
139,322
protected ErlangVisitor buildErlangVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) {<NEW_LINE>return new ErlangVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitFunctionCallExpression(@NotNull ErlangFunctionCallExpression o) {<NEW_LINE>if (o.getParent() instanceof ErlangGlobalFunctionCallExpression)<NEW_LINE>return;<NEW_LINE>if (o.getQAtom().getMacros() != null)<NEW_LINE>return;<NEW_LINE>String name = o.getName();<NEW_LINE>int arity = o.getArgumentList().getExpressionList().size();<NEW_LINE>ErlangBifDescriptor bifDescriptor = ErlangBifTable.<MASK><NEW_LINE>if (bifDescriptor == null || !bifDescriptor.isAutoImported() || ((ErlangFile) o.getContainingFile()).isNoAutoImport(name, arity) || ((ErlangFile) o.getContainingFile()).getFunction(name, arity) == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>holder.registerProblem(o.getNameIdentifier(), "Ambiguous call of overridden pre R14 auto-imported BIF " + "'" + name + "/" + arity + "'", ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new ErlangSpecifyModulePrefixFix("erlang"));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
getBif("erlang", name, arity);
292,608
public void addToContextMenu(ContextMenu menu) {<NEW_LINE>// --------------------------<NEW_LINE>// Dock<NEW_LINE>// --------------------------<NEW_LINE>menu.addCheckboxItem("dockToggleDocked", "Dock as tab", isDocked);<NEW_LINE>// --------------------------<NEW_LINE>// Channel Change<NEW_LINE>// --------------------------<NEW_LINE>if (channelChangeListener != null) {<NEW_LINE>String changeChanLabel = "Channel";<NEW_LINE>String openChansLabel = "Change to";<NEW_LINE>JMenu changeChanMenu = new JMenu(changeChanLabel);<NEW_LINE><MASK><NEW_LINE>openChansMenu.setToolTipText("All open chans, active tabs marked with *");<NEW_LINE>menu.registerSubmenu(changeChanMenu);<NEW_LINE>menu.registerSubmenu(openChansMenu);<NEW_LINE>List<Channel> open = channels.getChannelsOfType(Channel.Type.CHANNEL);<NEW_LINE>Collections.sort(open, (o1, o2) -> {<NEW_LINE>// Stream name should always be available for regular channels<NEW_LINE>return o1.getChannel().compareTo(o2.getChannel());<NEW_LINE>});<NEW_LINE>for (Channel chan : open) {<NEW_LINE>// Add menu item for each channel, mark visible with *<NEW_LINE>menu.addItem("dockChangeChannel." + chan.getChannel(), chan.getChannel() + (chan.getDockContent().isContentVisible() ? "*" : ""), openChansLabel);<NEW_LINE>}<NEW_LINE>if (!open.isEmpty()) {<NEW_LINE>changeChanMenu.add(openChansMenu);<NEW_LINE>menu.addSeparator(changeChanLabel);<NEW_LINE>}<NEW_LINE>menu.add(changeChanMenu);<NEW_LINE>menu.addCheckboxItem("dockToggleFixedChannel", "Fixed", changeChanLabel, fixedChannel);<NEW_LINE>menu.getItem("dockToggleFixedChannel").setToolTipText("Stay on the channel it was opened on (or the first channel joined if it was open on start)");<NEW_LINE>}<NEW_LINE>}
JMenu openChansMenu = new JMenu(openChansLabel);
250,674
public Object fromKV(byte[] key, byte[] value) {<NEW_LINE>String[] keyParts = new String(key).split(MetricUtils.DELIM);<NEW_LINE>if (keyParts.length >= 4) {<NEW_LINE>this.clusterName = keyParts[0];<NEW_LINE>this.topologyId = keyParts[1];<NEW_LINE>this.metaType = Integer.valueOf(keyParts[2]);<NEW_LINE>this.id = Long.valueOf(keyParts[3]);<NEW_LINE>this.sid = this.id + "";<NEW_LINE>}<NEW_LINE>String[] valueParts = new String(value).split(MetricUtils.DELIM);<NEW_LINE>if (valueParts.length >= 8) {<NEW_LINE>this.component = valueParts[0];<NEW_LINE>this.taskId = JStormUtils.parseInt<MASK><NEW_LINE>this.streamId = valueParts[2];<NEW_LINE>this.metricType = JStormUtils.parseInt(valueParts[3], 0);<NEW_LINE>this.host = valueParts[4];<NEW_LINE>this.port = JStormUtils.parseInt(valueParts[5], 0);<NEW_LINE>this.metricGroup = valueParts[6];<NEW_LINE>this.metricName = valueParts[7];<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
(valueParts[1], 0);
862,288
public void run(WorkingCopy workingCopy) throws java.io.IOException {<NEW_LINE><MASK><NEW_LINE>ClassTree javaClass = SourceUtils.getPublicTopLevelTree(workingCopy);<NEW_LINE>TypeElement classElement = SourceUtils.getPublicTopLevelElement(workingCopy);<NEW_LINE>List<? extends AnnotationMirror> anns = classElement.getAnnotationMirrors();<NEW_LINE>String pathValue = javaClass.getSimpleName().toString().toLowerCase();<NEW_LINE>AnnotationMirror pathAnn = JavaSourceHelper.findAnnotation(anns, RestConstants.PATH + "(\"" + pathValue + "\")");<NEW_LINE>if (pathAnn == null) {<NEW_LINE>addPathAnnotation(workingCopy, new String[] { javaClass.getSimpleName().toString().toLowerCase() });<NEW_LINE>}<NEW_LINE>if (!returnType.equals("void") && getPrimitiveType(returnType) == null) {<NEW_LINE>addQNameImport(workingCopy);<NEW_LINE>}<NEW_LINE>ClassTree finalJavaClass = addHttpMethod(returnType, workingCopy, javaClass);<NEW_LINE>workingCopy.rewrite(javaClass, finalJavaClass);<NEW_LINE>}
workingCopy.toPhase(Phase.ELEMENTS_RESOLVED);
327,626
private static Alias merge(Alias a1, String name, Function<String, Alias> findUnqualifiedAlias, HashSet<String> names) {<NEW_LINE>if (names.contains(name)) {<NEW_LINE>throw new RuntimeException("Encountered alias loop on '" + name + "'");<NEW_LINE>}<NEW_LINE>String[] <MASK><NEW_LINE>if (parts.length > 2 || parts[0].isEmpty()) {<NEW_LINE>throw new RuntimeException("Invalid alias name '" + name + "'");<NEW_LINE>}<NEW_LINE>Alias a2;<NEW_LINE>if (parts.length == 1) {<NEW_LINE>a2 = findUnqualifiedAlias.apply(name);<NEW_LINE>} else {<NEW_LINE>if (parts[1].isEmpty()) {<NEW_LINE>throw new RuntimeException("Invalid alias name '" + name + "'");<NEW_LINE>}<NEW_LINE>a2 = fromCatalog(parts[1], parts[0]);<NEW_LINE>}<NEW_LINE>if (a2 != null) {<NEW_LINE>names.add(name);<NEW_LINE>a2 = merge(a2, a2.scriptRef, findUnqualifiedAlias, names);<NEW_LINE>String desc = a1.description != null ? a1.description : a2.description;<NEW_LINE>List<String> args = a1.arguments != null && !a1.arguments.isEmpty() ? a1.arguments : a2.arguments;<NEW_LINE>List<String> opts = a1.javaOptions != null && !a1.javaOptions.isEmpty() ? a1.javaOptions : a2.javaOptions;<NEW_LINE>List<String> srcs = a1.sources != null && !a1.sources.isEmpty() ? a1.sources : a2.sources;<NEW_LINE>List<String> deps = a1.dependencies != null && !a1.dependencies.isEmpty() ? a1.dependencies : a2.dependencies;<NEW_LINE>List<String> repos = a1.repositories != null && !a1.repositories.isEmpty() ? a1.repositories : a2.repositories;<NEW_LINE>List<String> cpaths = a1.classpaths != null && !a1.classpaths.isEmpty() ? a1.classpaths : a2.classpaths;<NEW_LINE>Map<String, String> props = a1.properties != null && !a1.properties.isEmpty() ? a1.properties : a2.properties;<NEW_LINE>String javaVersion = a1.javaVersion != null ? a1.javaVersion : a2.javaVersion;<NEW_LINE>String mainClass = a1.mainClass != null ? a1.mainClass : a2.mainClass;<NEW_LINE>Catalog catalog = a2.catalog != null ? a2.catalog : a1.catalog;<NEW_LINE>return new Alias(a2.scriptRef, desc, args, opts, srcs, deps, repos, cpaths, props, javaVersion, mainClass, catalog);<NEW_LINE>} else {<NEW_LINE>return a1;<NEW_LINE>}<NEW_LINE>}
parts = name.split("@");
884,588
public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("workday" + mm.getMessage("function.missingParam"));<NEW_LINE>}<NEW_LINE>int size = param.getSubSize();<NEW_LINE>if (size != 2 && size != 3) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("workday" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>IParam sub1 = param.getSub(0);<NEW_LINE>IParam sub2 = param.getSub(1);<NEW_LINE>if (sub1 == null || sub2 == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("workday" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object result1 = sub1.getLeafExpression().calculate(ctx);<NEW_LINE>Object result2 = sub2.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(result1 instanceof Date) || !(result2 instanceof Number)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("workday" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>Sequence offDays = null;<NEW_LINE>if (size == 3) {<NEW_LINE>IParam sub3 = param.getSub(2);<NEW_LINE>if (sub3 != null) {<NEW_LINE>Object obj = sub3.getLeafExpression().calculate(ctx);<NEW_LINE>if (obj instanceof Sequence) {<NEW_LINE>offDays = (Sequence) obj;<NEW_LINE>} else if (obj != null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("workday" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Date date1 = (Date) result1;<NEW_LINE>Calendar calendar = Calendar.getInstance();<NEW_LINE>calendar.setTime(date1);<NEW_LINE>int diff = ((Number) result2).intValue();<NEW_LINE>int d = 1;<NEW_LINE>if (diff < 0) {<NEW_LINE>d = -1;<NEW_LINE>} else if (diff == 0) {<NEW_LINE>return date1;<NEW_LINE>}<NEW_LINE>while (diff != 0) {<NEW_LINE>calendar.add(Calendar.DATE, d);<NEW_LINE>if (isWorkDay(calendar, offDays))<NEW_LINE>diff -= d;<NEW_LINE>}<NEW_LINE>Date date = <MASK><NEW_LINE>date.setTime(calendar.getTimeInMillis());<NEW_LINE>return date;<NEW_LINE>}
(Date) date1.clone();
207,443
public void read(org.apache.thrift.protocol.TProtocol prot, SyncRequestMessage struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>struct.header = new AsyncMessageHeader();<NEW_LINE>struct.header.read(iprot);<NEW_LINE>struct.setHeaderIsSet(true);<NEW_LINE>struct.store = new Store();<NEW_LINE>struct.store.read(iprot);<NEW_LINE>struct.setStoreIsSet(true);<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(1);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list53 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);<NEW_LINE>struct.keys = new java.util.ArrayList<java.nio.ByteBuffer>(_list53.size);<NEW_LINE>@org.apache.thrift.annotation.Nullable<NEW_LINE>java.nio.ByteBuffer _elem54;<NEW_LINE>for (int _i55 = 0; _i55 < _list53.size; ++_i55) {<NEW_LINE>_elem54 = iprot.readBinary();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.setKeysIsSet(true);<NEW_LINE>}<NEW_LINE>}
struct.keys.add(_elem54);
1,015,774
public void insertSpace(AddrSpace spc) {<NEW_LINE>// Add new space to the list, verify name and id conventions<NEW_LINE>boolean nametype_mismatch = false;<NEW_LINE>boolean duplicatedefine = false;<NEW_LINE>switch(spc.getType()) {<NEW_LINE>case IPTR_CONSTANT:<NEW_LINE>if (!spc.getName().equals(SpaceNames.CONSTANT_SPACE_NAME)) {<NEW_LINE>nametype_mismatch = true;<NEW_LINE>}<NEW_LINE>if (baselist.size() != 0) {<NEW_LINE>throw new LowlevelError("const space must be initialized first");<NEW_LINE>}<NEW_LINE>constantspace = spc;<NEW_LINE>break;<NEW_LINE>case IPTR_INTERNAL:<NEW_LINE>if (!spc.getName().equals(SpaceNames.UNIQUE_SPACE_NAME)) {<NEW_LINE>nametype_mismatch = true;<NEW_LINE>}<NEW_LINE>if (uniqspace != null) {<NEW_LINE>duplicatedefine = true;<NEW_LINE>}<NEW_LINE>uniqspace = spc;<NEW_LINE>break;<NEW_LINE>case IPTR_FSPEC:<NEW_LINE>if (!spc.getName().equals(SpaceNames.FSPEC_SPACE_NAME)) {<NEW_LINE>nametype_mismatch = true;<NEW_LINE>}<NEW_LINE>if (fspecspace != null) {<NEW_LINE>duplicatedefine = true;<NEW_LINE>}<NEW_LINE>fspecspace = spc;<NEW_LINE>break;<NEW_LINE>case IPTR_IOP:<NEW_LINE>if (!spc.getName().equals(SpaceNames.IOP_SPACE_NAME)) {<NEW_LINE>nametype_mismatch = true;<NEW_LINE>}<NEW_LINE>if (iopspace != null) {<NEW_LINE>duplicatedefine = true;<NEW_LINE>}<NEW_LINE>iopspace = spc;<NEW_LINE>break;<NEW_LINE>case IPTR_SPACEBASE:<NEW_LINE>if (spc.getName().equals(SpaceNames.STACK_SPACE_NAME)) {<NEW_LINE>if (stackspace != null) {<NEW_LINE>duplicatedefine = true;<NEW_LINE>}<NEW_LINE>stackspace = spc;<NEW_LINE>}<NEW_LINE>// fallthru<NEW_LINE>case IPTR_PROCESSOR:<NEW_LINE>if (spc.isOtherSpace()) {<NEW_LINE>if (spc.getIndex() != SpaceNames.OTHER_SPACE_INDEX) {<NEW_LINE>throw new LowlevelError("OTHER space must be assigned index 1");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (AddrSpace space : baselist) {<NEW_LINE>if (space.getName().equals(spc.getName())) {<NEW_LINE>duplicatedefine = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (nametype_mismatch) {<NEW_LINE>throw new LowlevelError("Space " + <MASK><NEW_LINE>}<NEW_LINE>if (duplicatedefine) {<NEW_LINE>throw new LowlevelError("Space " + spc.getName() + " was initialized more than once");<NEW_LINE>}<NEW_LINE>if (baselist.size() != spc.getIndex()) {<NEW_LINE>throw new LowlevelError("Space " + spc.getName() + " was initialized with a bad id");<NEW_LINE>}<NEW_LINE>baselist.add(spc);<NEW_LINE>}
spc.getName() + " was initialized with wrong type");
1,302,484
public synchronized void paintComponent(Graphics g) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>g2.setStroke(new BasicStroke(5));<NEW_LINE>g2.setColor(Color.gray);<NEW_LINE>if (mode == Mode.PLACING_POINTS) {<NEW_LINE>if (numSelected == 1) {<NEW_LINE>drawCorner(g2, quad.a, Color.RED);<NEW_LINE>} else if (numSelected == 2) {<NEW_LINE>drawLine(g2, quad.a, quad.b);<NEW_LINE>drawCorner(g2, quad.a, Color.RED);<NEW_LINE>drawCorner(g2, quad.b, Color.ORANGE);<NEW_LINE>} else if (numSelected == 3) {<NEW_LINE>drawLine(g2, quad.a, quad.b);<NEW_LINE>drawLine(g2, quad.b, quad.c);<NEW_LINE>drawCorner(g2, quad.a, Color.RED);<NEW_LINE>drawCorner(g2, quad.b, Color.ORANGE);<NEW_LINE>drawCorner(g2, quad.c, Color.CYAN);<NEW_LINE>} else if (numSelected == 4) {<NEW_LINE>VisualizeShapes.drawQuad(quad, g2, scale, true, Color.gray, Color.CYAN);<NEW_LINE>drawCorner(g2, quad.a, Color.RED);<NEW_LINE>drawCorner(g2, quad.b, Color.ORANGE);<NEW_LINE>drawCorner(g2, quad.c, Color.CYAN);<NEW_LINE>drawCorner(g2, quad.d, Color.BLUE);<NEW_LINE>}<NEW_LINE>} else if (mode == Mode.DRAGGING_RECT) {<NEW_LINE>VisualizeShapes.drawQuad(quad, g2, scale, true, Color.gray, Color.gray);<NEW_LINE>drawCorner(g2, quad.a, Color.RED);<NEW_LINE>drawCorner(g2, quad.b, Color.RED);<NEW_LINE>drawCorner(g2, quad.c, Color.RED);<NEW_LINE>drawCorner(g2, quad.d, Color.RED);<NEW_LINE>} else if (mode == Mode.TRACKING) {<NEW_LINE>if (targetVisible) {<NEW_LINE>VisualizeShapes.drawQuad(quad, g2, scale, true, Color.gray, Color.CYAN);<NEW_LINE>drawCorner(g2, <MASK><NEW_LINE>drawCorner(g2, quad.b, Color.RED);<NEW_LINE>drawCorner(g2, quad.c, Color.RED);<NEW_LINE>drawCorner(g2, quad.d, Color.RED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
quad.a, Color.RED);
420,921
final DeletePipelineResult executeDeletePipeline(DeletePipelineRequest deletePipelineRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deletePipelineRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeletePipelineRequest> request = null;<NEW_LINE>Response<DeletePipelineResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeletePipelineRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deletePipelineRequest));<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, "Data Pipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeletePipeline");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeletePipelineResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeletePipelineResultJsonUnmarshaller());<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);
504,259
private I_PP_Cost_Collector createFinishedGoodsReceipt(@NonNull final ReceiptCostCollectorCandidate candidate) {<NEW_LINE>final I_PP_Order order = candidate.getOrder();<NEW_LINE>final <MASK><NEW_LINE>final Quantity qtyScrap = candidate.getQtyScrap();<NEW_LINE>final Quantity qtyReject = candidate.getQtyReject();<NEW_LINE>final ZonedDateTime movementDate = candidate.getMovementDate();<NEW_LINE>// Validate Product<NEW_LINE>final ProductId productId = candidate.getProductId();<NEW_LINE>if (productId == null || productId.getRepoId() != order.getM_Product_ID()) {<NEW_LINE>throw new LiberoException("@Invalid@ @M_Product_ID@: " + candidate + "\n Expected: " + order.getM_Product_ID());<NEW_LINE>}<NEW_LINE>final LocatorId locatorId = candidate.getLocatorId();<NEW_LINE>final AttributeSetInstanceId asiId = candidate.getAttributeSetInstanceId();<NEW_LINE>return createCollector(CostCollectorCreateRequest.builder().costCollectorType(CostCollectorType.MaterialReceipt).order(order).productId(productId).locatorId(locatorId).attributeSetInstanceId(asiId).resourceId(ResourceId.ofRepoId(order.getS_Resource_ID())).movementDate(movementDate).qty(qtyToDeliver).qtyScrap(qtyScrap).qtyReject(qtyReject).pickingCandidateId(candidate.getPickingCandidateId()).build());<NEW_LINE>}
Quantity qtyToDeliver = candidate.getQtyToReceive();
377,883
private static int subscribePlayer(CommandSourceStack source, String player_name, String logname, String option) {<NEW_LINE>Player player = source.getServer().getPlayerList().getPlayerByName(player_name);<NEW_LINE>if (player == null) {<NEW_LINE><MASK><NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (LoggerRegistry.getLogger(logname) == null) {<NEW_LINE>Messenger.m(source, "r Unknown logger: ", "rb " + logname);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (!LoggerRegistry.getLogger(logname).isOptionValid(option)) {<NEW_LINE>Messenger.m(source, "r Invalid option: ", "rb " + option);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>LoggerRegistry.subscribePlayer(player_name, logname, option);<NEW_LINE>if (option != null) {<NEW_LINE>Messenger.m(source, "gi Subscribed to " + logname + "(" + option + ")");<NEW_LINE>} else {<NEW_LINE>Messenger.m(source, "gi Subscribed to " + logname);<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}
Messenger.m(source, "r No player specified");
238,266
public static CellDataSet cellSet2Matrix(final CellSet cellSet, ICellSetFormatter formatter) {<NEW_LINE>if (cellSet == null) {<NEW_LINE>return new CellDataSet(0, 0);<NEW_LINE>}<NEW_LINE>final Matrix matrix = formatter.format(cellSet);<NEW_LINE>final CellDataSet cds = new CellDataSet(matrix.getMatrixWidth(), matrix.getMatrixHeight());<NEW_LINE>int z = 0;<NEW_LINE>final AbstractBaseCell[][] bodyvalues = new AbstractBaseCell[matrix.getMatrixHeight() - matrix.getOffset()][matrix.getMatrixWidth()];<NEW_LINE>for (int y = matrix.getOffset(); y < matrix.getMatrixHeight(); y++) {<NEW_LINE>for (int x = 0; x < matrix.getMatrixWidth(); x++) {<NEW_LINE>bodyvalues[z][x] = matrix.get(x, y);<NEW_LINE>}<NEW_LINE>z++;<NEW_LINE>}<NEW_LINE>cds.setCellSetBody(bodyvalues);<NEW_LINE>final AbstractBaseCell[][] headervalues = new AbstractBaseCell[matrix.getOffset()][matrix.getMatrixWidth()];<NEW_LINE>for (int y = 0; y < matrix.getOffset(); y++) {<NEW_LINE>for (int x = 0; x < matrix.getMatrixWidth(); x++) {<NEW_LINE>headervalues[y][x] = matrix.get(x, y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cds.setCellSetHeaders(headervalues);<NEW_LINE>cds.<MASK><NEW_LINE>return cds;<NEW_LINE>}
setOffset(matrix.getOffset());
745,331
private TypeUpdateResult applyInvokeTypes(TypeUpdateInfo updateInfo, BaseInvokeNode invoke, int argsCount, Set<ArgType> knownTypeVars, Supplier<ArgType> getReturnType, Function<Integer, ArgType> getArgType) {<NEW_LINE>boolean allSame = true;<NEW_LINE>RegisterArg resultArg = invoke.getResult();<NEW_LINE>if (resultArg != null && !resultArg.isTypeImmutable()) {<NEW_LINE>ArgType returnType = checkType(knownTypeVars, getReturnType.get());<NEW_LINE>if (returnType != null) {<NEW_LINE>TypeUpdateResult result = <MASK><NEW_LINE>if (result == REJECT) {<NEW_LINE>TypeCompareEnum compare = comparator.compareTypes(returnType, resultArg.getType());<NEW_LINE>if (compare.isWider()) {<NEW_LINE>return REJECT;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result == CHANGED) {<NEW_LINE>allSame = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int argOffset = invoke.getFirstArgOffset();<NEW_LINE>for (int i = 0; i < argsCount; i++) {<NEW_LINE>InsnArg invokeArg = invoke.getArg(argOffset + i);<NEW_LINE>if (!invokeArg.isTypeImmutable()) {<NEW_LINE>ArgType argType = checkType(knownTypeVars, getArgType.apply(i));<NEW_LINE>if (argType != null) {<NEW_LINE>TypeUpdateResult result = updateTypeChecked(updateInfo, invokeArg, argType);<NEW_LINE>if (result == REJECT) {<NEW_LINE>TypeCompareEnum compare = comparator.compareTypes(argType, invokeArg.getType());<NEW_LINE>if (compare.isNarrow()) {<NEW_LINE>return REJECT;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result == CHANGED) {<NEW_LINE>allSame = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return allSame ? SAME : CHANGED;<NEW_LINE>}
updateTypeChecked(updateInfo, resultArg, returnType);
647,332
public static Object buildType(ColumnDesc column, ClasspathImportServiceCompileTime classpathImportService, ClasspathExtensionClass classpathExtension) throws ExprValidationException {<NEW_LINE>if (column.getType() == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ClassDescriptor classIdent = ClassDescriptor.<MASK><NEW_LINE>EPTypeClass type = ClasspathImportEPTypeUtil.resolveClassIdentifierToEPType(classIdent, false, classpathImportService, ClasspathExtensionClassEmpty.INSTANCE);<NEW_LINE>if (type != null) {<NEW_LINE>return type;<NEW_LINE>}<NEW_LINE>// Event types fall into here<NEW_LINE>if (classIdent.getArrayDimensions() > 1) {<NEW_LINE>throw new EPException("Two-dimensional arrays are not supported for event-types (cannot find class '" + classIdent.getClassIdentifier() + "')");<NEW_LINE>}<NEW_LINE>if (classIdent.getArrayDimensions() == 1) {<NEW_LINE>return column.getType() + "[]";<NEW_LINE>}<NEW_LINE>return column.getType();<NEW_LINE>}
parseTypeText(column.getType());
159,683
private OvsVpcRoutingPolicyConfigCommand prepareVpcRoutingPolicyUpdate(long vpcId) {<NEW_LINE>List<OvsVpcRoutingPolicyConfigCommand.Acl> acls = new ArrayList<>();<NEW_LINE>List<OvsVpcRoutingPolicyConfigCommand.Tier> <MASK><NEW_LINE>VpcVO vpc = _vpcDao.findById(vpcId);<NEW_LINE>List<? extends Network> vpcNetworks = _vpcMgr.getVpcNetworks(vpcId);<NEW_LINE>assert (vpc != null && (vpcNetworks != null && !vpcNetworks.isEmpty())) : "invalid vpc id";<NEW_LINE>for (Network network : vpcNetworks) {<NEW_LINE>Long networkAclId = network.getNetworkACLId();<NEW_LINE>if (networkAclId == null)<NEW_LINE>continue;<NEW_LINE>NetworkACLVO networkAcl = _networkACLDao.findById(networkAclId);<NEW_LINE>List<OvsVpcRoutingPolicyConfigCommand.AclItem> aclItems = new ArrayList<>();<NEW_LINE>List<NetworkACLItemVO> aclItemVos = _networkACLItemDao.listByACL(networkAclId);<NEW_LINE>for (NetworkACLItemVO aclItem : aclItemVos) {<NEW_LINE>String[] sourceCidrs = aclItem.getSourceCidrList().toArray(new String[aclItem.getSourceCidrList().size()]);<NEW_LINE>aclItems.add(new OvsVpcRoutingPolicyConfigCommand.AclItem(aclItem.getNumber(), aclItem.getUuid(), aclItem.getAction().name(), aclItem.getTrafficType().name(), ((aclItem.getSourcePortStart() != null) ? aclItem.getSourcePortStart().toString() : null), ((aclItem.getSourcePortEnd() != null) ? aclItem.getSourcePortEnd().toString() : null), aclItem.getProtocol(), sourceCidrs));<NEW_LINE>}<NEW_LINE>OvsVpcRoutingPolicyConfigCommand.Acl acl = new OvsVpcRoutingPolicyConfigCommand.Acl(networkAcl.getUuid(), aclItems.toArray(new OvsVpcRoutingPolicyConfigCommand.AclItem[aclItems.size()]));<NEW_LINE>acls.add(acl);<NEW_LINE>OvsVpcRoutingPolicyConfigCommand.Tier tier = new OvsVpcRoutingPolicyConfigCommand.Tier(network.getUuid(), network.getCidr(), networkAcl.getUuid());<NEW_LINE>tiers.add(tier);<NEW_LINE>}<NEW_LINE>OvsVpcRoutingPolicyConfigCommand cmd = new OvsVpcRoutingPolicyConfigCommand(vpc.getUuid(), vpc.getCidr(), acls.toArray(new OvsVpcRoutingPolicyConfigCommand.Acl[acls.size()]), tiers.toArray(new OvsVpcRoutingPolicyConfigCommand.Tier[tiers.size()]));<NEW_LINE>return cmd;<NEW_LINE>}
tiers = new ArrayList<>();
1,625,147
static WebServer startServer() {<NEW_LINE>// load logging configuration<NEW_LINE>LogConfig.configureRuntime();<NEW_LINE>// By default this will pick up application.yaml from the classpath<NEW_LINE>Config config = Config.create();<NEW_LINE>SendingService sendingService = new SendingService(config);<NEW_LINE>WebServer server = WebServer.builder(createRouting(sendingService)).config(config.get("server")).build();<NEW_LINE>server.start().thenAccept(ws -> {<NEW_LINE>System.out.println("WEB server is up! http://localhost:" + ws.port());<NEW_LINE>ws.whenShutdown().thenRun(() -> {<NEW_LINE>// Stop messaging properly<NEW_LINE>sendingService.shutdown();<NEW_LINE>System.out.println("WEB server is DOWN. Good bye!");<NEW_LINE>});<NEW_LINE>}).exceptionally(t -> {<NEW_LINE>System.err.println("Startup failed: " + t.getMessage());<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>// Server threads are not daemon. No need to block. Just react.<NEW_LINE>return server;<NEW_LINE>}
t.printStackTrace(System.err);
1,366,858
static Errno writeFilestat(Node node, WasmMemory memory, int address, TruffleFile file) {<NEW_LINE>// Write filestat structure<NEW_LINE>// https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md#-filestat-struct<NEW_LINE>try {<NEW_LINE>Filestat.writeFiletype(node, memory, address, getType(file));<NEW_LINE>Filestat.writeSize(node, memory, address, file.getAttribute(TruffleFile.SIZE));<NEW_LINE>Filestat.writeAtim(node, memory, address, file.getAttribute(TruffleFile.LAST_ACCESS_TIME).to(TimeUnit.SECONDS));<NEW_LINE>Filestat.writeMtim(node, memory, address, file.getAttribute(TruffleFile.LAST_MODIFIED_TIME).to(TimeUnit.SECONDS));<NEW_LINE>try {<NEW_LINE>Filestat.writeDev(node, memory, address, file.getAttribute(TruffleFile.UNIX_DEV));<NEW_LINE>Filestat.writeIno(node, memory, address, file<MASK><NEW_LINE>Filestat.writeNlink(node, memory, address, file.getAttribute(TruffleFile.UNIX_NLINK));<NEW_LINE>Filestat.writeCtim(node, memory, address, file.getAttribute(TruffleFile.UNIX_CTIME).to(TimeUnit.SECONDS));<NEW_LINE>} catch (UnsupportedOperationException e) {<NEW_LINE>// GR-29297: these attributes are currently not supported on non-Unix platforms.<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>return Errno.Io;<NEW_LINE>}<NEW_LINE>return Errno.Success;<NEW_LINE>}
.getAttribute(TruffleFile.UNIX_INODE));
1,260,028
public AssociateUserSettingsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AssociateUserSettingsResult associateUserSettingsResult = new AssociateUserSettingsResult();<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 associateUserSettingsResult;<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("portalArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associateUserSettingsResult.setPortalArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("userSettingsArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associateUserSettingsResult.setUserSettingsArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return associateUserSettingsResult;<NEW_LINE>}
class).unmarshall(context));
201,102
private LocalDate next(LocalDate transactionDate) {<NEW_LINE>LocalDate previousDate = transactionDate;<NEW_LINE>// the transaction date might be edited (or moved to the next months b/c<NEW_LINE>// of public holidays) -> determine the "normalized" date by comparing<NEW_LINE>// the three months around the current transactionDate<NEW_LINE>if (transactionDate.getDayOfMonth() != start.getDayOfMonth()) {<NEW_LINE>int daysBetween = Integer.MAX_VALUE;<NEW_LINE>LocalDate testDate = transactionDate.minusMonths(1);<NEW_LINE>testDate = testDate.withDayOfMonth(Math.min(testDate.lengthOfMonth(), start.getDayOfMonth()));<NEW_LINE>for (int ii = 0; ii < 3; ii++) {<NEW_LINE>int d = Dates.daysBetween(transactionDate, testDate);<NEW_LINE>if (d < daysBetween) {<NEW_LINE>daysBetween = d;<NEW_LINE>previousDate = testDate;<NEW_LINE>}<NEW_LINE>testDate = testDate.plusMonths(1);<NEW_LINE>testDate = testDate.withDayOfMonth(Math.min(testDate.lengthOfMonth(), start.getDayOfMonth()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LocalDate next = previousDate.plusMonths(interval);<NEW_LINE>// correct day of month (say the transactions are to be generated on the<NEW_LINE>// 31st, but the month has only 30 days)<NEW_LINE>next = next.withDayOfMonth(Math.min(next.lengthOfMonth(), start.getDayOfMonth()));<NEW_LINE>if (next.isBefore(start.toLocalDate())) {<NEW_LINE>// start date was recently changed, use this value instead<NEW_LINE>next = start.toLocalDate();<NEW_LINE>}<NEW_LINE>// do not generate a investment plan transaction on a public holiday<NEW_LINE>TradeCalendar tradeCalendar = security != null ? TradeCalendarManager.getInstance(security) : TradeCalendarManager.getDefaultInstance();<NEW_LINE>while (tradeCalendar.isHoliday(next)) <MASK><NEW_LINE>return next;<NEW_LINE>}
next = next.plusDays(1);
1,084,708
static Mono<MemberUpdateEvent> guildMemberUpdate(DispatchContext<GuildMemberUpdate, MemberData> context) {<NEW_LINE>GatewayDiscordClient gateway = context.getGateway();<NEW_LINE>long guildId = Snowflake.asLong(context.getDispatch().guildId());<NEW_LINE>long memberId = Snowflake.asLong(context.getDispatch().user().id());<NEW_LINE>Set<Long> currentRoleIds = context.getDispatch().roles().stream().map(Snowflake::asLong).collect(Collectors.toSet());<NEW_LINE>String currentNick = Possible.flatOpt(context.getDispatch().nick()).orElse(null);<NEW_LINE>String currentAvatar = context.getDispatch().avatar().orElse(null);<NEW_LINE>String currentJoinedAt = context.getDispatch().joinedAt().orElse(null);<NEW_LINE>String currentPremiumSince = Possible.flatOpt(context.getDispatch().premiumSince()).orElse(null);<NEW_LINE>Boolean currentPending = context.getDispatch().pending().toOptional().orElse(null);<NEW_LINE>String communicationDisabledUntil = Possible.flatOpt(context.getDispatch().communicationDisabledUntil()).orElse(null);<NEW_LINE>Member oldMember = context.getOldState().map(data -> new Member(gateway, data, <MASK><NEW_LINE>return Mono.just(new MemberUpdateEvent(gateway, context.getShardInfo(), guildId, memberId, oldMember, currentRoleIds, currentNick, currentAvatar, currentJoinedAt, currentPremiumSince, currentPending, communicationDisabledUntil));<NEW_LINE>}
guildId)).orElse(null);
912,514
public boolean levelCheck(int iter) {<NEW_LINE>if (levelChecked < iter) {<NEW_LINE>levelChecked = iter;<NEW_LINE>boolean opDeclLevelCheck = opDeclNode.levelCheck(iter);<NEW_LINE>level = opDeclNode.getLevel();<NEW_LINE>if (set != null) {<NEW_LINE><MASK><NEW_LINE>level = Math.max(set.getLevel(), level);<NEW_LINE>if (level == TemporalLevel) {<NEW_LINE>levelCorrect = false;<NEW_LINE>errors.addError(this.stn.getLocation(), "Level error:\n" + "Temporal formula used as set.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>;<NEW_LINE>levelCorrect = levelCorrect && opDeclLevelCheck;<NEW_LINE>if (set != null) {<NEW_LINE>levelParams = set.getLevelParams();<NEW_LINE>allParams = set.getAllParams();<NEW_LINE>levelConstraints = set.getLevelConstraints();<NEW_LINE>argLevelConstraints = set.getArgLevelConstraints();<NEW_LINE>argLevelParams = set.getArgLevelParams();<NEW_LINE>}<NEW_LINE>// if (set != null)<NEW_LINE>;<NEW_LINE>}<NEW_LINE>// if (levelChecked < iter)<NEW_LINE>;<NEW_LINE>return levelCorrect;<NEW_LINE>}
levelCorrect = set.levelCheck(iter);
813,817
private ResponseHandler createResponseHandler(final String name, final Object value) {<NEW_LINE>if ("json".equalsIgnoreCase(name)) {<NEW_LINE>return with(json(value));<NEW_LINE>}<NEW_LINE>if (isResource(name) && value instanceof TextContainer) {<NEW_LINE>TextContainer container = (TextContainer) value;<NEW_LINE>return with(resourceFrom(name, container));<NEW_LINE>}<NEW_LINE>if (value instanceof Map) {<NEW_LINE>return createCompositeHandler(name, castToMap(value));<NEW_LINE>}<NEW_LINE>if ("status".equalsIgnoreCase(name)) {<NEW_LINE>return status(Integer.parseInt(value.toString()));<NEW_LINE>}<NEW_LINE>if ("latency".equalsIgnoreCase(name)) {<NEW_LINE>LatencyContainer container = (LatencyContainer) value;<NEW_LINE>return with(container.asProcedure());<NEW_LINE>}<NEW_LINE>if (value instanceof ProxyContainer) {<NEW_LINE>return ((ProxyContainer) value).asResponseHandler();<NEW_LINE>}<NEW_LINE>if ("attachment".equalsIgnoreCase(name)) {<NEW_LINE>AttachmentSetting attachment = (AttachmentSetting) value;<NEW_LINE>return attachment(attachment.getFilename(), resourceFrom(attachment));<NEW_LINE>}<NEW_LINE>if ("seq".equalsIgnoreCase(name)) {<NEW_LINE>CollectionContainer sequence = (CollectionContainer) value;<NEW_LINE>ResponseHandler[<MASK><NEW_LINE>return Moco.seq(head(responseHandlers), tail(responseHandlers));<NEW_LINE>}<NEW_LINE>if ("cycle".equalsIgnoreCase(name)) {<NEW_LINE>CollectionContainer sequence = (CollectionContainer) value;<NEW_LINE>ResponseHandler[] responseHandlers = sequence.toResponseHandlers();<NEW_LINE>return Moco.cycle(head(responseHandlers), tail(responseHandlers));<NEW_LINE>}<NEW_LINE>if ("record".equalsIgnoreCase(name)) {<NEW_LINE>ReplayContainer container = (ReplayContainer) value;<NEW_LINE>RecorderConfig[] configs = container.getConfigs();<NEW_LINE>return MocoRecorders.record(head(configs), tail(configs));<NEW_LINE>}<NEW_LINE>if ("replay".equalsIgnoreCase(name)) {<NEW_LINE>ReplayContainer container = (ReplayContainer) value;<NEW_LINE>RecorderConfig[] configs = container.getConfigs();<NEW_LINE>return MocoRecorders.replay(head(configs), tail(configs));<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(format("unknown field [%s]", name));<NEW_LINE>}
] responseHandlers = sequence.toResponseHandlers();
690,702
protected void masterOperation(final TypesExistsRequest request, final ClusterState state, final ActionListener<TypesExistsResponse> listener) {<NEW_LINE>String[] concreteIndices = indexNameExpressionResolver.concreteIndexNames(state, request.indicesOptions(), request.indices());<NEW_LINE>if (concreteIndices.length == 0) {<NEW_LINE>listener.onResponse(new TypesExistsResponse(false));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String concreteIndex : concreteIndices) {<NEW_LINE>if (!state.metadata().hasConcreteIndex(concreteIndex)) {<NEW_LINE>listener.onResponse(new TypesExistsResponse(false));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MappingMetadata mapping = state.metadata().getIndices().get(concreteIndex).mapping();<NEW_LINE>if (mapping == null) {<NEW_LINE>listener.onResponse(new TypesExistsResponse(false));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String type : request.types()) {<NEW_LINE>if (mapping.type().equals(type) == false) {<NEW_LINE>listener.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>listener.onResponse(new TypesExistsResponse(true));<NEW_LINE>}
onResponse(new TypesExistsResponse(false));
1,426,196
public ResultStream doGet(final SortOrder sortOrder, int pageSize, int page) throws FrameworkException {<NEW_LINE>final List<GraphObjectMap> <MASK><NEW_LINE>final GraphObjectMap info = new GraphObjectMap();<NEW_LINE>info.setProperty(new GenericProperty("modules"), VersionHelper.getModules());<NEW_LINE>info.setProperty(new GenericProperty("components"), VersionHelper.getComponents());<NEW_LINE>info.setProperty(new StringProperty("classPath"), VersionHelper.getClassPath());<NEW_LINE>info.setProperty(new StringProperty("instanceName"), VersionHelper.getInstanceName());<NEW_LINE>info.setProperty(new StringProperty("instanceStage"), VersionHelper.getInstanceStage());<NEW_LINE>info.setProperty(new ArrayProperty("mainMenu", String.class), VersionHelper.getMenuEntries());<NEW_LINE>final LicenseManager licenseManager = Services.getInstance().getLicenseManager();<NEW_LINE>if (licenseManager != null) {<NEW_LINE>info.setProperty(new StringProperty("edition"), licenseManager.getEdition());<NEW_LINE>info.setProperty(new StringProperty("licensee"), licenseManager.getLicensee());<NEW_LINE>info.setProperty(new StringProperty("hostId"), licenseManager.getHardwareFingerprint());<NEW_LINE>info.setProperty(new DateProperty("startDate"), licenseManager.getStartDate());<NEW_LINE>info.setProperty(new DateProperty("endDate"), licenseManager.getEndDate());<NEW_LINE>} else {<NEW_LINE>info.setProperty(new StringProperty("edition"), "Community");<NEW_LINE>info.setProperty(new StringProperty("licensee"), "Unlicensed");<NEW_LINE>}<NEW_LINE>info.setProperty(new GenericProperty("databaseService"), Services.getInstance().getDatabaseService().getClass().getSimpleName());<NEW_LINE>info.setProperty(new GenericProperty("resultCountSoftLimit"), Settings.ResultCountSoftLimit.getValue());<NEW_LINE>info.setProperty(new StringProperty("availableReleasesUrl"), Settings.ReleasesIndexUrl.getValue());<NEW_LINE>info.setProperty(new StringProperty("availableSnapshotsUrl"), Settings.SnapshotsIndexUrl.getValue());<NEW_LINE>info.setProperty(new StringProperty("maintenanceModeActive"), Settings.MaintenanceModeEnabled.getValue());<NEW_LINE>info.setProperty(new StringProperty("legacyRequestParameters"), Settings.RequestParameterLegacyMode.getValue());<NEW_LINE>resultList.add(info);<NEW_LINE>return new PagingIterable("/" + getUriPart(), resultList);<NEW_LINE>}
resultList = new LinkedList<>();
1,724,402
public void startSource() {<NEW_LINE>// setup Netty server<NEW_LINE>bootstrap = new Bootstrap();<NEW_LINE>logger.info("Set max workers : {} ;", maxThreads);<NEW_LINE>bootstrap.channel(NioDatagramChannel.class);<NEW_LINE>bootstrap.option(ChannelOption.SO_RCVBUF, receiveBufferSize);<NEW_LINE>bootstrap.option(ChannelOption.SO_SNDBUF, sendBufferSize);<NEW_LINE>ChannelInitializer fac = this.getChannelInitializerFactory();<NEW_LINE>bootstrap.handler(fac);<NEW_LINE>try {<NEW_LINE>if (host == null) {<NEW_LINE>channelFuture = bootstrap.bind(new InetSocketAddress<MASK><NEW_LINE>} else {<NEW_LINE>channelFuture = bootstrap.bind(new InetSocketAddress(host, port)).sync();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Simple UDP Source error bind host {} port {}, program will exit!", new Object[] { host, port });<NEW_LINE>System.exit(-1);<NEW_LINE>// throw new FlumeException(e.getMessage());<NEW_LINE>}<NEW_LINE>logger.info("Simple UDP Source started at host {}, port {}", host, port);<NEW_LINE>}
(port)).sync();
726,304
private void doDraw(Graphics2D g, float x, float y, int startColumn, int endColumn) {<NEW_LINE>updateStats(endColumn - startColumn, myCharPositions.length);<NEW_LINE>if (startColumn == 0 && endColumn == myCharPositions.length) {<NEW_LINE>g.drawGlyphVector(myGlyphVector, x, y);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>float startX = x - getX(startColumn);<NEW_LINE>// We define clip region here assuming that glyphs do not extend further than CLIP_MARGIN pixels from baseline<NEW_LINE>// vertically (both up and down) and horizontally (from the region defined by glyph vector's total advance)<NEW_LINE>double xMin = x - (startColumn == 0 ? CLIP_MARGIN : 0);<NEW_LINE>double xMax = startX + getX(endColumn) + (endColumn == myCharPositions.length ? CLIP_MARGIN : 0);<NEW_LINE>double yMin = y - CLIP_MARGIN;<NEW_LINE>double yMax = y + CLIP_MARGIN;<NEW_LINE>g.clip(new Rectangle2D.Double(xMin, yMin, xMax - xMin, yMax - yMin));<NEW_LINE>g.drawGlyphVector(myGlyphVector, startX, y);<NEW_LINE>g.setClip(savedClip);<NEW_LINE>}<NEW_LINE>}
Shape savedClip = g.getClip();
1,208,743
public void runSupport() {<NEW_LINE>if (allTags != null) {<NEW_LINE>boolean create_tabs = false;<NEW_LINE>List<Tag> <MASK><NEW_LINE>boolean filterOnly = COConfigurationManager.getBooleanParameter("Library.ShowTagButtons.FiltersOnly");<NEW_LINE>synchronized (pending_tag_changes) {<NEW_LINE>ourPendingTags.addAll(pending_tag_changes);<NEW_LINE>for (Tag t : pending_tag_changes) {<NEW_LINE>boolean manual = t.getTagType().getTagType() == TagType.TT_DOWNLOAD_MANUAL;<NEW_LINE>boolean should_be_visible = (manual && filterOnly ? t.getFlag(Tag.FL_IS_FILTER) : t.isVisible()) && !hiddenTags.contains(t);<NEW_LINE>boolean is_visible = allTags.contains(t);<NEW_LINE>if (should_be_visible != is_visible) {<NEW_LINE>create_tabs = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pending_tag_changes.clear();<NEW_LINE>}<NEW_LINE>if (create_tabs) {<NEW_LINE>createTabs();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (cTitleCategoriesAndTags == null || cTitleCategoriesAndTags.isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Control[] children = cTitleCategoriesAndTags.getChildren();<NEW_LINE>for (Control child : children) {<NEW_LINE>if (!(child instanceof TagCanvas)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>TagPainter painter = ((TagCanvas) child).getTagPainter();<NEW_LINE>if (ourPendingTags.remove(painter.getTag())) {<NEW_LINE>boolean selected = painter.isSelected();<NEW_LINE>painter.updateState(null);<NEW_LINE>painter.setSelected(selected);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ourPendingTags = new ArrayList<>();
1,778,038
public void run() {<NEW_LINE>FileDialog dialog2 = new FileDialog(shell, SWT.SYSTEM_MODAL | SWT.SAVE);<NEW_LINE>dialog2.<MASK><NEW_LINE>dialog2.setFilterExtensions(new String[] { "*.json" });<NEW_LINE>String str2 = dialog2.open();<NEW_LINE>if (str2 != null) {<NEW_LINE>if (!(str2.toLowerCase(Locale.US).endsWith(".json"))) {<NEW_LINE>str2 += ".json";<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!FileUtil.writeStringAsFile(new File(str2), json)) {<NEW_LINE>throw (new Exception("Failed to write output file"));<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>MessageBoxShell mb = new MessageBoxShell(SWT.ERROR, MessageText.getString("ConfigView.section.security.resetkey.error.title"), Debug.getNestedExceptionMessage(e));<NEW_LINE>mb.setParent(shell);<NEW_LINE>mb.open(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setFilterPath(TorrentOpener.getFilterPathTorrent());
954,854
private MPayment createPayment(String documentNo, int bankAccountId, boolean isReceipt, BigDecimal paymentAmount, String tenderType, int currencyId, int conversionTypeId) {<NEW_LINE>MBankAccount bankAccount = MBankAccount.get(getCtx(), bankAccountId);<NEW_LINE>MPayment payment = new MPayment(getCtx(), 0, get_TrxName());<NEW_LINE>// Set Value<NEW_LINE>payment.setC_BPartner_ID(getBPartnerId());<NEW_LINE>payment.setC_BankAccount_ID(bankAccountId);<NEW_LINE>payment.setIsReceipt(isReceipt);<NEW_LINE>payment.setTenderType(tenderType != <MASK><NEW_LINE>payment.setDateTrx(getDateTrx());<NEW_LINE>payment.setDateAcct(getDateTrx());<NEW_LINE>if (!Util.isEmpty(documentNo)) {<NEW_LINE>payment.setDocumentNo(documentNo);<NEW_LINE>}<NEW_LINE>if (currencyId != 0) {<NEW_LINE>payment.setC_Currency_ID(currencyId);<NEW_LINE>} else {<NEW_LINE>payment.setC_Currency_ID(bankAccount.getC_Currency_ID());<NEW_LINE>}<NEW_LINE>// Set conversion type for payment<NEW_LINE>if (conversionTypeId != 0) {<NEW_LINE>payment.setC_ConversionType_ID(conversionTypeId);<NEW_LINE>}<NEW_LINE>payment.setC_Charge_ID(getChargeId());<NEW_LINE>payment.setDocStatus(MPayment.DOCSTATUS_Drafted);<NEW_LINE>if (paymentAmount != null) {<NEW_LINE>payment.setPayAmt(paymentAmount);<NEW_LINE>}<NEW_LINE>if (isReceipt) {<NEW_LINE>if (getDepositDocumentTypeId() != 0) {<NEW_LINE>payment.setC_DocType_ID(getDepositDocumentTypeId());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (getWithdrawalDocumentTypeId() != 0) {<NEW_LINE>payment.setC_DocType_ID(getWithdrawalDocumentTypeId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>payment.saveEx();<NEW_LINE>return payment;<NEW_LINE>}
null ? tenderType : getTenderType());
1,511,365
private static void appendRepresentation(Representation oldRepresentation, Representation newRepresentation, long segmentNumShift) {<NEW_LINE>if (segmentNumShift <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MultiSegmentRepresentation oldMultiRepresentation = (MultiSegmentRepresentation) oldRepresentation;<NEW_LINE>MultiSegmentRepresentation newMultiRepresentation = (MultiSegmentRepresentation) newRepresentation;<NEW_LINE>// TODO: modified<NEW_LINE>// SegmentList oldSegmentList = (SegmentList) oldRepresentation.segmentBase;<NEW_LINE>SegmentList oldSegmentList = (SegmentList) Helpers.getField(oldMultiRepresentation, "segmentBase");<NEW_LINE>// TODO: modified<NEW_LINE>// SegmentList newSegmentList = (SegmentList) newRepresentation.segmentBase;<NEW_LINE>SegmentList newSegmentList = (SegmentList) Helpers.getField(newMultiRepresentation, "segmentBase");<NEW_LINE>// TODO: modified<NEW_LINE>// List<RangedUri> oldMediaSegments = oldSegmentList.mediaSegments;<NEW_LINE>List<RangedUri> oldMediaSegments = (List<RangedUri>) Helpers.getField(oldSegmentList, "mediaSegments");<NEW_LINE>// TODO: modified<NEW_LINE>// List<RangedUri> newMediaSegments = newSegmentList.mediaSegments;<NEW_LINE>List<RangedUri> newMediaSegments = (List<RangedUri>) Helpers.getField(newSegmentList, "mediaSegments");<NEW_LINE>oldMediaSegments.addAll(newMediaSegments.subList(newMediaSegments.size() - (int) segmentNumShift, newMediaSegments.size()));<NEW_LINE>// TODO: modified<NEW_LINE>// List<SegmentTimelineElement> oldSegmentTimeline = oldSegmentList.segmentTimeline;<NEW_LINE>List<SegmentTimelineElement> oldSegmentTimeline = (List<SegmentTimelineElement>) Helpers.getField(oldSegmentList, "segmentTimeline");<NEW_LINE>// segmentTimeline is the same for all segments<NEW_LINE>if (oldMediaSegments.size() != oldSegmentTimeline.size()) {<NEW_LINE>SegmentTimelineElement lastTimeline = oldSegmentTimeline.get(oldSegmentTimeline.size() - 1);<NEW_LINE>// TODO: modified<NEW_LINE>// long lastTimelineDuration = lastTimeline.duration;<NEW_LINE>long lastTimelineDuration = (Long) Helpers.getField(lastTimeline, "duration");<NEW_LINE>// TODO: modified<NEW_LINE>// long lastTimelineStartTime = lastTimeline.startTime;<NEW_LINE>long lastTimelineStartTime = (Long) <MASK><NEW_LINE>for (int i = 1; i <= segmentNumShift; i++) {<NEW_LINE>oldSegmentTimeline.add(new SegmentTimelineElement(lastTimelineStartTime + (lastTimelineDuration * i), lastTimelineDuration));<NEW_LINE>}<NEW_LINE>// oldSegmentTimeline.addAll(<NEW_LINE>// newSegmentList.segmentTimeline.subList(newSegmentList.segmentTimeline.size() - (int) segmentNumShift - 1, newSegmentList.segmentTimeline.size()));<NEW_LINE>}<NEW_LINE>}
Helpers.getField(lastTimeline, "startTime");
1,356,490
public Statement parseStatement() throws ParseException {<NEW_LINE>// look for any labels preceding statement<NEW_LINE>Mark m = tq.mark();<NEW_LINE>Token<JsTokenType> t = tq.peek();<NEW_LINE>if (JsTokenType.WORD == t.type) {<NEW_LINE>String label = parseIdentifier(false);<NEW_LINE>FilePosition labelPos = t.pos;<NEW_LINE>if (tq.checkToken(Punctuation.COLON)) {<NEW_LINE>t = tq.peek();<NEW_LINE>AbstractStatement s = null;<NEW_LINE>if (JsTokenType.KEYWORD == t.type) {<NEW_LINE>switch(Keyword.fromString(t.text)) {<NEW_LINE>case FOR:<NEW_LINE>case DO:<NEW_LINE>case WHILE:<NEW_LINE>case SWITCH:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == s) {<NEW_LINE>Statement labelless = parseStatementWithoutLabel();<NEW_LINE>s = new LabeledStmtWrapper(posFrom(m), label, labelless);<NEW_LINE>}<NEW_LINE>finish(s, m);<NEW_LINE>return s;<NEW_LINE>}<NEW_LINE>tq.rewind(m);<NEW_LINE>}<NEW_LINE>return parseStatementWithoutLabel();<NEW_LINE>}
s = parseLoopOrSwitch(labelPos, label);
480,573
public PTrailer loadTrailer(long position) {<NEW_LINE>PTrailer trailer = null;<NEW_LINE>try {<NEW_LINE>if (seekableInput != null) {<NEW_LINE>seekableInput.beginThreadAccess();<NEW_LINE>long savedPosition = seekableInput.getAbsolutePosition();<NEW_LINE>seekableInput.seekAbsolute(position);<NEW_LINE>Parser parser = new Parser(seekableInput);<NEW_LINE>Object obj = parser.getObject(library);<NEW_LINE>if (obj instanceof PObject)<NEW_LINE>obj = ((PObject) obj).getObject();<NEW_LINE>trailer = (PTrailer) obj;<NEW_LINE>if (trailer != null)<NEW_LINE>trailer.setPosition(position);<NEW_LINE>seekableInput.seekAbsolute(savedPosition);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.log(Level.<MASK><NEW_LINE>} finally {<NEW_LINE>if (seekableInput != null)<NEW_LINE>seekableInput.endThreadAccess();<NEW_LINE>}<NEW_LINE>return trailer;<NEW_LINE>}
FINE, "Error loading PTrailer instance: " + position, e);
1,853,240
public static Set<StreamCategory> parseCategorySearch(String json) {<NEW_LINE>Set<StreamCategory> result = new HashSet<>();<NEW_LINE>try {<NEW_LINE>JSONParser parser = new JSONParser();<NEW_LINE>JSONObject root = (JSONObject) parser.parse(json);<NEW_LINE>Object data = root.get("data");<NEW_LINE>if (!(data instanceof JSONArray)) {<NEW_LINE>LOGGER.warning("Error parsing game search: Should be array");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Iterator it = ((<MASK><NEW_LINE>while (it.hasNext()) {<NEW_LINE>Object obj = it.next();<NEW_LINE>if (obj instanceof JSONObject) {<NEW_LINE>JSONObject categoryData = (JSONObject) obj;<NEW_LINE>String id = JSONUtil.getString(categoryData, "id");<NEW_LINE>String name = JSONUtil.getString(categoryData, "name");<NEW_LINE>if (!StringUtil.isNullOrEmpty(id, name)) {<NEW_LINE>result.add(new StreamCategory(id, name));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (ParseException ex) {<NEW_LINE>LOGGER.warning("Error parsing game search.");<NEW_LINE>return null;<NEW_LINE>} catch (NullPointerException ex) {<NEW_LINE>LOGGER.warning("Error parsing game search: Unexpected null");<NEW_LINE>return null;<NEW_LINE>} catch (ClassCastException ex) {<NEW_LINE>LOGGER.warning("Error parsing game search: Unexpected type");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
JSONArray) data).iterator();
1,479,609
public boolean prepare(boolean reConnect) {<NEW_LINE>if (reConnect) {<NEW_LINE>close(false);<NEW_LINE>}<NEW_LINE>Configure conf = Configure.getInstance();<NEW_LINE>String host = conf.net_collector_ip;<NEW_LINE>int port = conf.net_collector_tcp_port;<NEW_LINE>int so_timeout = conf.net_collector_tcp_so_timeout_ms;<NEW_LINE>int connection_timeout = conf.net_collector_tcp_connection_timeout_ms;<NEW_LINE>socket = new Socket();<NEW_LINE>try {<NEW_LINE>socket.connect(new InetSocketAddress(host, port), connection_timeout);<NEW_LINE>socket.setSoTimeout(so_timeout);<NEW_LINE>if (!reConnect) {<NEW_LINE>LIVE.put(<MASK><NEW_LINE>}<NEW_LINE>in = new DataInputX(new BufferedInputStream(socket.getInputStream()));<NEW_LINE>out = new DataOutputX(new BufferedOutputStream(socket.getOutputStream()));<NEW_LINE>out.writeInt(NetCafe.TCP_AGENT_REQ);<NEW_LINE>out.writeInt(objHash);<NEW_LINE>out.flush();<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
this.hashCode(), this);
1,830,493
public static void main(String[] args) throws Exception {<NEW_LINE>Map<DataFieldName, String> map = new HashMap<DataFieldName, String>();<NEW_LINE>map.put(new DataFieldName("bm1"), "whale shark");<NEW_LINE>map.put(<MASK><NEW_LINE>WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new java.io.File(System.getProperty("user.dir") + "/bm1.docx"));<NEW_LINE>MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();<NEW_LINE>// Before..<NEW_LINE>// System.out.println(XmlUtils.marshaltoString(documentPart.getJaxbElement(), true, true));<NEW_LINE>org.docx4j.wml.Document wmlDocumentEl = (org.docx4j.wml.Document) documentPart.getJaxbElement();<NEW_LINE>Body body = wmlDocumentEl.getBody();<NEW_LINE>BookmarksReplaceWithText bti = new BookmarksReplaceWithText();<NEW_LINE>bti.replaceBookmarkContents(body.getContent(), map);<NEW_LINE>// After<NEW_LINE>// System.out.println(XmlUtils.marshaltoString(documentPart.getJaxbElement(), true, true));<NEW_LINE>// save the docx...<NEW_LINE>wordMLPackage.save(new java.io.File(System.getProperty("user.dir") + "/OUT_BookmarksTextInserter.docx"));<NEW_LINE>}
new DataFieldName("bm2"), "dolphin");
799,285
private void showResultsMessage(List<DomainFile> allFiles, List<DomainFile> failedFiles) {<NEW_LINE>int total = allFiles.size();<NEW_LINE>if (failedFiles.isEmpty()) {<NEW_LINE>String s = "Checkout completed for " + total + " file(s)";<NEW_LINE>tool.setStatusInfo(s);<NEW_LINE>Msg.info(this, s);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (failedFiles.size() == 1) {<NEW_LINE>DomainFile <MASK><NEW_LINE>String s = "Exclusive checkout failed for: " + df.getName() + "\nOne or more users have file checked out!";<NEW_LINE>Msg.showError(this, tool.getToolFrame(), "Checkout Failed", s);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String userMessage = "Multiple exclusive checkouts failed." + "\nOne or more users have file checked out!";<NEW_LINE>StringBuilder buffy = new StringBuilder(userMessage + '\n');<NEW_LINE>String message = "Exclusive checkout failed for: %s";<NEW_LINE>for (DomainFile df : failedFiles) {<NEW_LINE>String formatted = String.format(message, df.getName());<NEW_LINE>buffy.append(formatted).append('\n');<NEW_LINE>}<NEW_LINE>Msg.showError(this, tool.getToolFrame(), "Checkout Failed", userMessage + "\n(see log for list of failed files)");<NEW_LINE>}
df = failedFiles.get(0);
427,881
public void importBuild(Object antBuildFile, String baseDirectory, Transformer<? extends String, ? super String> taskNamer) {<NEW_LINE>File file = gradleProject.file(antBuildFile);<NEW_LINE>Optional<Object> baseDirectoryOptional = Optional.ofNullable(baseDirectory);<NEW_LINE>final File baseDir = gradleProject.file(baseDirectoryOptional.orElse(file.getParentFile().getAbsolutePath()));<NEW_LINE>Set<String> existingAntTargets = new HashSet<String>(getAntProject().getTargets().keySet());<NEW_LINE>File oldBaseDir = getAntProject().getBaseDir();<NEW_LINE>getAntProject().setBaseDir(baseDir);<NEW_LINE>try {<NEW_LINE>getAntProject().setUserProperty(MagicNames.ANT_FILE, file.getAbsolutePath());<NEW_LINE>ProjectHelper.configureProject(getAntProject(), file);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new GradleException("Could not import Ant build file '" + String.valueOf(file) + "'.", e);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Chuck away the implicit target. It has already been executed<NEW_LINE>getAntProject().getTargets().remove("");<NEW_LINE>// Add an adapter for each newly added target<NEW_LINE>Set<String> newAntTargets = new HashSet<String>(getAntProject().getTargets().keySet());<NEW_LINE>newAntTargets.removeAll(existingAntTargets);<NEW_LINE>for (String name : newAntTargets) {<NEW_LINE>final Target target = getAntProject().getTargets().get(name);<NEW_LINE>String taskName = taskNamer.transform(target.getName());<NEW_LINE>final AntTarget task = gradleProject.getTasks().create(taskName, AntTarget.class);<NEW_LINE>configureTask(target, task, baseDir, taskNamer);<NEW_LINE>}<NEW_LINE>}
getAntProject().setBaseDir(oldBaseDir);
349,807
public static QueryOperationAuditInfoListResponse unmarshall(QueryOperationAuditInfoListResponse queryOperationAuditInfoListResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryOperationAuditInfoListResponse.setRequestId(_ctx.stringValue("QueryOperationAuditInfoListResponse.RequestId"));<NEW_LINE>queryOperationAuditInfoListResponse.setTotalItemNum(_ctx.integerValue("QueryOperationAuditInfoListResponse.TotalItemNum"));<NEW_LINE>queryOperationAuditInfoListResponse.setCurrentPageNum(_ctx.integerValue("QueryOperationAuditInfoListResponse.CurrentPageNum"));<NEW_LINE>queryOperationAuditInfoListResponse.setTotalPageNum(_ctx.integerValue("QueryOperationAuditInfoListResponse.TotalPageNum"));<NEW_LINE>queryOperationAuditInfoListResponse.setPageSize(_ctx.integerValue("QueryOperationAuditInfoListResponse.PageSize"));<NEW_LINE>queryOperationAuditInfoListResponse.setPrePage(_ctx.booleanValue("QueryOperationAuditInfoListResponse.PrePage"));<NEW_LINE>queryOperationAuditInfoListResponse.setNextPage(_ctx.booleanValue("QueryOperationAuditInfoListResponse.NextPage"));<NEW_LINE>List<OperationAuditRecord> data = new ArrayList<OperationAuditRecord>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryOperationAuditInfoListResponse.Data.Length"); i++) {<NEW_LINE>OperationAuditRecord operationAuditRecord = new OperationAuditRecord();<NEW_LINE>operationAuditRecord.setId(_ctx.longValue("QueryOperationAuditInfoListResponse.Data[" + i + "].Id"));<NEW_LINE>operationAuditRecord.setCreateTime(_ctx.longValue<MASK><NEW_LINE>operationAuditRecord.setUpdateTime(_ctx.longValue("QueryOperationAuditInfoListResponse.Data[" + i + "].UpdateTime"));<NEW_LINE>operationAuditRecord.setBusinessName(_ctx.stringValue("QueryOperationAuditInfoListResponse.Data[" + i + "].BusinessName"));<NEW_LINE>operationAuditRecord.setDomainName(_ctx.stringValue("QueryOperationAuditInfoListResponse.Data[" + i + "].DomainName"));<NEW_LINE>operationAuditRecord.setAuditType(_ctx.integerValue("QueryOperationAuditInfoListResponse.Data[" + i + "].AuditType"));<NEW_LINE>operationAuditRecord.setAuditStatus(_ctx.integerValue("QueryOperationAuditInfoListResponse.Data[" + i + "].AuditStatus"));<NEW_LINE>operationAuditRecord.setAuditInfo(_ctx.stringValue("QueryOperationAuditInfoListResponse.Data[" + i + "].AuditInfo"));<NEW_LINE>operationAuditRecord.setRemark(_ctx.stringValue("QueryOperationAuditInfoListResponse.Data[" + i + "].Remark"));<NEW_LINE>data.add(operationAuditRecord);<NEW_LINE>}<NEW_LINE>queryOperationAuditInfoListResponse.setData(data);<NEW_LINE>return queryOperationAuditInfoListResponse;<NEW_LINE>}
("QueryOperationAuditInfoListResponse.Data[" + i + "].CreateTime"));
1,133,550
public void BALOAD(Object conc_array, int conc_index, String className, String methodName) {<NEW_LINE>// pop symbolic arguments<NEW_LINE>IntegerValue symb_index = env.topFrame().operandStack.popBv32();<NEW_LINE>ReferenceExpression array_ref = env.topFrame().operandStack.popRef();<NEW_LINE>if (nullReferenceViolation(array_ref, conc_array)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ReferenceExpression symb_array_reference = array_ref;<NEW_LINE>int conc_array_length = Array.getLength(conc_array);<NEW_LINE>IntegerValue symb_array_length = env.heap.getField("", ARRAY_LENGTH, conc_array, symb_array_reference, conc_array_length);<NEW_LINE>if (indexTooBigViolation(conc_index, symb_index, conc_array_length, symb_array_length, className, methodName))<NEW_LINE>return;<NEW_LINE>Object object = Array.get(conc_array, conc_index);<NEW_LINE>int intValue;<NEW_LINE>if (object instanceof Boolean) {<NEW_LINE>boolean booleanValue = (Boolean) object;<NEW_LINE>intValue = booleanValue ? 1 : 0;<NEW_LINE>} else {<NEW_LINE>assert object instanceof Byte;<NEW_LINE>intValue = ((Byte) object).shortValue();<NEW_LINE>}<NEW_LINE>IntegerValue c = env.heap.arrayLoad(symb_array_reference, <MASK><NEW_LINE>env.topFrame().operandStack.pushBv32(c);<NEW_LINE>}
symb_index, new IntegerConstant(intValue));
1,207,462
private void makePurchase(boolean isSubscription) {<NEW_LINE>try {<NEW_LINE>Bundle buyIntentBundle = inAppBillingService.getBuyIntent(3, getActivity().getPackageName(), TEST_SKU, <MASK><NEW_LINE>int response = getResponseCodeFromBundle(buyIntentBundle);<NEW_LINE>if (response != BILLING_RESPONSE_RESULT_OK) {<NEW_LINE>Log.e(TAG, "Unable to buy item, Error response: " + response);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PendingIntent pendingIntent = buyIntentBundle.getParcelable(BUY_INTENT);<NEW_LINE>getActivity().startIntentSenderForResult(pendingIntent.getIntentSender(), IN_APP_PURCHASE_RESULT, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));<NEW_LINE>} catch (IntentSender.SendIntentException e) {<NEW_LINE>Log.e(TAG, "In app purchase send intent exception.", e);<NEW_LINE>} catch (RemoteException e) {<NEW_LINE>Log.e(TAG, "In app purchase remote exception.", e);<NEW_LINE>}<NEW_LINE>}
isSubscription ? "subs" : "inapp", "this is a test");
1,600,161
public void connect() throws IOException, SlimVersionMismatch {<NEW_LINE><MASK><NEW_LINE>if (!isConnected(slimServerVersionMessage)) {<NEW_LINE>throw new SlimVersionMismatch("Got invalid slim header from client. Read the following: " + slimServerVersionMessage);<NEW_LINE>}<NEW_LINE>slimServerVersion = Double.parseDouble(slimServerVersionMessage.replace(SlimVersion.SLIM_HEADER, ""));<NEW_LINE>if (slimServerVersion == SlimCommandRunningClient.NO_SLIM_SERVER_CONNECTION_FLAG) {<NEW_LINE>throw new SlimVersionMismatch("Slim Protocol Version Error: Server did not respond with a valid version number.");<NEW_LINE>} else if (slimServerVersion < SlimCommandRunningClient.MINIMUM_REQUIRED_SLIM_VERSION) {<NEW_LINE>throw new SlimVersionMismatch(String.format("Slim Protocol Version Error: Expected V%s but was V%s", SlimCommandRunningClient.MINIMUM_REQUIRED_SLIM_VERSION, slimServerVersion));<NEW_LINE>}<NEW_LINE>}
String slimServerVersionMessage = reader.readLine();
1,131,851
public static void main(String[] args) {<NEW_LINE><MASK><NEW_LINE>ScriptEngineManager manager = new ScriptEngineManager();<NEW_LINE>for (ScriptEngineFactory factory : manager.getEngineFactories()) {<NEW_LINE>System.out.println(" engineName=" + factory.getEngineName() + " engineVersion=" + factory.getEngineVersion() + " languageName=" + factory.getLanguageName() + " languageVersion=" + factory.getLanguageVersion() + " names=" + factory.getNames() + " mimeTypes=" + factory.getMimeTypes() + " extensions=" + factory.getExtensions());<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("RSyntaxTextArea supported syntax languages:");<NEW_LINE>TokenMakerFactory f = TokenMakerFactory.getDefaultInstance();<NEW_LINE>List<String> list = new ArrayList<String>(f.keySet());<NEW_LINE>Collections.sort(list);<NEW_LINE>for (String type : list) {<NEW_LINE>System.out.println(" " + type);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}
System.out.println("Scripting APIs:");
1,597,411
private void receiveHandshakeResponse(String key) throws IOException {<NEW_LINE>BufferedReader in = new BufferedReader(new InputStreamReader(input));<NEW_LINE>ArrayList<String> responseLines = new ArrayList<String>();<NEW_LINE>String line = in.readLine();<NEW_LINE>if (line == null) {<NEW_LINE>throw new IOException("WebSocket Response header: Invalid response from Server, It may not support WebSockets.");<NEW_LINE>}<NEW_LINE>while (!line.equals(EMPTY)) {<NEW_LINE>responseLines.add(line);<NEW_LINE>line = in.readLine();<NEW_LINE>}<NEW_LINE>Map<String, <MASK><NEW_LINE>String connectionHeader = (String) headerMap.get(HTTP_HEADER_CONNECTION);<NEW_LINE>if (connectionHeader == null || connectionHeader.equalsIgnoreCase(HTTP_HEADER_CONNECTION_VALUE)) {<NEW_LINE>throw new IOException("WebSocket Response header: Incorrect connection header");<NEW_LINE>}<NEW_LINE>String upgradeHeader = (String) headerMap.get(HTTP_HEADER_UPGRADE);<NEW_LINE>if (upgradeHeader == null || !upgradeHeader.toLowerCase().contains(HTTP_HEADER_UPGRADE_WEBSOCKET)) {<NEW_LINE>throw new IOException("WebSocket Response header: Incorrect upgrade.");<NEW_LINE>}<NEW_LINE>String secWebsocketProtocolHeader = (String) headerMap.get(HTTP_HEADER_SEC_WEBSOCKET_PROTOCOL);<NEW_LINE>if (secWebsocketProtocolHeader == null) {<NEW_LINE>throw new IOException("WebSocket Response header: empty sec-websocket-protocol");<NEW_LINE>}<NEW_LINE>if (!headerMap.containsKey(HTTP_HEADER_SEC_WEBSOCKET_ACCEPT)) {<NEW_LINE>throw new IOException("WebSocket Response header: Missing Sec-WebSocket-Accept");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>verifyWebSocketKey(key, (String) headerMap.get(HTTP_HEADER_SEC_WEBSOCKET_ACCEPT));<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new IOException(e.getMessage());<NEW_LINE>} catch (HandshakeFailedException e) {<NEW_LINE>throw new IOException("WebSocket Response header: Incorrect Sec-WebSocket-Key");<NEW_LINE>}<NEW_LINE>}
String> headerMap = getHeaders(responseLines);
99,893
private static void optimizeOperator(int operator, ASTNode tk, ASTNode tkOp, ASTLinkedList astLinkedList, ASTLinkedList optimizedAst, ParserContext pCtx) {<NEW_LINE>switch(operator) {<NEW_LINE>case Operator.REGEX:<NEW_LINE>optimizedAst.addTokenNode(new RegExMatchNode(tk, astLinkedList.nextNode(), pCtx));<NEW_LINE>break;<NEW_LINE>case Operator.CONTAINS:<NEW_LINE>optimizedAst.addTokenNode(new Contains(tk, astLinkedList<MASK><NEW_LINE>break;<NEW_LINE>case Operator.INSTANCEOF:<NEW_LINE>optimizedAst.addTokenNode(new Instance(tk, astLinkedList.nextNode(), pCtx));<NEW_LINE>break;<NEW_LINE>case Operator.CONVERTABLE_TO:<NEW_LINE>optimizedAst.addTokenNode((new Convertable(tk, astLinkedList.nextNode(), pCtx)));<NEW_LINE>break;<NEW_LINE>case Operator.SIMILARITY:<NEW_LINE>optimizedAst.addTokenNode(new Strsim(tk, astLinkedList.nextNode(), pCtx));<NEW_LINE>break;<NEW_LINE>case Operator.SOUNDEX:<NEW_LINE>optimizedAst.addTokenNode(new Soundslike(tk, astLinkedList.nextNode(), pCtx));<NEW_LINE>break;<NEW_LINE>case TERNARY:<NEW_LINE>if (pCtx.isStrongTyping() && tk.getEgressType() != Boolean.class && tk.getEgressType() != Boolean.TYPE)<NEW_LINE>throw new RuntimeException("Condition of ternary operator is not of type boolean. Found " + tk.getEgressType());<NEW_LINE>default:<NEW_LINE>optimizedAst.addTokenNode(tk, tkOp);<NEW_LINE>}<NEW_LINE>}
.nextNode(), pCtx));
1,009,966
public void clearBits(int factor) {<NEW_LINE>if (factor < PATTERN_SIZE) {<NEW_LINE>Arrays.fill(firstPattern, 0);<NEW_LINE>Arrays.fill(pattern, 0);<NEW_LINE>int vs = factor << SHIFT_SIZE_ADD;<NEW_LINE>for (int num = factor * factor; num <= vs; num += factor * 2) {<NEW_LINE>firstPattern[num >> SHIFT_SIZE_ADD] |= (1l << (num >> 1));<NEW_LINE>}<NEW_LINE>for (int num = factor; num <= vs; num += factor * 2) {<NEW_LINE>pattern[num >> SHIFT_SIZE_ADD] |= (1l << (num >> 1));<NEW_LINE>}<NEW_LINE>int idxBase = ((factor * factor) >> SHIFT_SIZE_ADD);<NEW_LINE>int first = factor - idxBase;<NEW_LINE>for (int i = 0; i < first; i++) {<NEW_LINE>int patternIdx = (i + idxBase) % factor;<NEW_LINE>dataSet[i <MASK><NEW_LINE>}<NEW_LINE>for (int i = first; i < dataSet.length - idxBase; i++) {<NEW_LINE>int patternIdx = (i + idxBase) % factor;<NEW_LINE>dataSet[i + idxBase] |= pattern[patternIdx];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int num = factor * factor; num <= sieveSize; num += factor * 2) {<NEW_LINE>dataSet[num >> SHIFT_SIZE_ADD] = dataSet[num >> SHIFT_SIZE_ADD] | (1l << (num >> 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+ idxBase] |= firstPattern[patternIdx];
796,073
public GridBoundsChange performAction(GridManager gridManager, DesignerContext context) {<NEW_LINE>GridInfoProvider gridInfo = gridManager.getGridInfo();<NEW_LINE>boolean gapSupport = gridInfo.hasGaps();<NEW_LINE>int[] originalColumnBounds = gridInfo.getColumnBounds();<NEW_LINE>int[] originalRowBounds = gridInfo.getRowBounds();<NEW_LINE>GridUtils.removePaddingComponents(gridManager);<NEW_LINE>int row = context.getFocusedRow();<NEW_LINE>if (insertAfter) {<NEW_LINE>row += (gapSupport ? 2 : 1);<NEW_LINE>}<NEW_LINE>gridManager.insertRow(row);<NEW_LINE>GridUtils.addPaddingComponents(gridManager, originalColumnBounds.length - 1, originalRowBounds.length - 1 + (gapSupport ? 2 : 1));<NEW_LINE>GridUtils.revalidateGrid(gridManager);<NEW_LINE>int[] newColumnBounds = gridInfo.getColumnBounds();<NEW_LINE>int[] newRowBounds = gridInfo.getRowBounds();<NEW_LINE>int[] oldRowBounds = new int[originalRowBounds.length + <MASK><NEW_LINE>if (gapSupport) {<NEW_LINE>if (originalRowBounds.length == row) {<NEW_LINE>// inserting after bottommost row<NEW_LINE>System.arraycopy(originalRowBounds, 0, oldRowBounds, 0, row);<NEW_LINE>oldRowBounds[row] = oldRowBounds[row - 1];<NEW_LINE>oldRowBounds[row + 1] = oldRowBounds[row - 1];<NEW_LINE>} else {<NEW_LINE>System.arraycopy(originalRowBounds, 0, oldRowBounds, 0, row + 1);<NEW_LINE>oldRowBounds[row + 1] = oldRowBounds[row];<NEW_LINE>oldRowBounds[row + 2] = oldRowBounds[row];<NEW_LINE>System.arraycopy(originalRowBounds, row + 1, oldRowBounds, row + 3, originalRowBounds.length - row - 1);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.arraycopy(originalRowBounds, 0, oldRowBounds, 0, row + 1);<NEW_LINE>oldRowBounds[row + 1] = oldRowBounds[row];<NEW_LINE>System.arraycopy(originalRowBounds, row + 1, oldRowBounds, row + 2, originalRowBounds.length - row - 1);<NEW_LINE>}<NEW_LINE>return new GridBoundsChange(originalColumnBounds, oldRowBounds, newColumnBounds, newRowBounds);<NEW_LINE>}
(gapSupport ? 2 : 1)];
110,560
public static void patchRepositoryComponent(CtClass ctClass) throws CannotCompileException {<NEW_LINE>StringBuilder src = new StringBuilder("{");<NEW_LINE>src.append(PluginManagerInvoker.buildInitializePlugin(DeltaSpikePlugin.class));<NEW_LINE>src.append(PluginManagerInvoker.buildCallPluginMethod(DeltaSpikePlugin.class, "registerRepoComponent", "this", "java.lang.Object", "this.repoClass", "java.lang.Class"));<NEW_LINE>src.append("}");<NEW_LINE>for (CtConstructor constructor : ctClass.getDeclaredConstructors()) {<NEW_LINE>constructor.<MASK><NEW_LINE>}<NEW_LINE>ctClass.addMethod(CtNewMethod.make("public void " + REINITIALIZE_METHOD + "() {" + " this.methods.clear(); " + " initialize();" + "}", ctClass));<NEW_LINE>LOGGER.debug("org.apache.deltaspike.data.impl.meta.RepositoryComponent - registration hook and reinitialization method added.");<NEW_LINE>}
insertAfter(src.toString());
1,754,969
private void displayEmailMsg(MesssageArtifactData artifactData) {<NEW_LINE>enableCommonFields();<NEW_LINE>directionText.setEnabled(false);<NEW_LINE>ccLabel.setEnabled(true);<NEW_LINE>this.fromText.setText(artifactData.getAttributeDisplayString(TSK_EMAIL_FROM));<NEW_LINE>this.fromText.setToolTipText(artifactData.getAttributeDisplayString(TSK_EMAIL_FROM));<NEW_LINE>this.toText.setText(artifactData.getAttributeDisplayString(TSK_EMAIL_TO));<NEW_LINE>this.toText.setToolTipText(artifactData.getAttributeDisplayString(TSK_EMAIL_TO));<NEW_LINE>this.directionText.setText("");<NEW_LINE>this.ccText.setText(artifactData.getAttributeDisplayString(TSK_EMAIL_CC));<NEW_LINE>this.ccText.setToolTipText(artifactData.getAttributeDisplayString(TSK_EMAIL_CC));<NEW_LINE>this.subjectText.setText(artifactData.getAttributeDisplayString(TSK_SUBJECT));<NEW_LINE>this.datetimeText.setText(artifactData.getAttributeDisplayString(TSK_DATETIME_RCVD));<NEW_LINE>configureTextArea(artifactData.getAttributeDisplayString(TSK_HEADERS), HDR_TAB_INDEX);<NEW_LINE>configureTextArea(artifactData.getAttributeDisplayString(TSK_EMAIL_CONTENT_PLAIN), TEXT_TAB_INDEX);<NEW_LINE>configureTextArea(artifactData<MASK><NEW_LINE>configureTextArea(artifactData.getAttributeDisplayString(TSK_EMAIL_CONTENT_RTF), RTF_TAB_INDEX);<NEW_LINE>configureAttachments(artifactData.getAttachements());<NEW_LINE>}
.getAttributeDisplayString(TSK_EMAIL_CONTENT_HTML), HTML_TAB_INDEX);
1,660,629
void checkExtension(OCFPackage ocf, String extension) {<NEW_LINE>if (extension != null) {<NEW_LINE>if (!extension.equals("epub")) {<NEW_LINE>if (extension.matches("[Ee][Pp][Uu][Bb]")) {<NEW_LINE>report.message(MessageId.PKG_016, EPUBLocation.create(epubFile.getName()));<NEW_LINE>} else {<NEW_LINE>List<String> opfPaths = ocf.getOcfData().getEntries(OPFData.OPF_MIME_TYPE);<NEW_LINE>if (!opfPaths.isEmpty()) {<NEW_LINE>if (ocf.getOpfData().get(opfPaths.get(0)).getVersion() == EPUBVersion.VERSION_3) {<NEW_LINE>report.message(MessageId.PKG_024, EPUBLocation.create(epubFile.getName(), extension));<NEW_LINE>} else {<NEW_LINE>report.message(MessageId.PKG_017, EPUBLocation.create(epubFile<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getName(), extension));
1,567,914
public static List<TransportRouteResult> convertToTransportRoutingResult(NativeTransportRoutingResult[] res, TransportRoutingConfiguration cfg) {<NEW_LINE>// cache for converted TransportRoutes:<NEW_LINE>TLongObjectHashMap<TransportRoute> convertedRoutesCache = new TLongObjectHashMap<>();<NEW_LINE>TLongObjectHashMap<TransportStop> convertedStopsCache = new TLongObjectHashMap<>();<NEW_LINE>if (res.length == 0) {<NEW_LINE>return new ArrayList<TransportRouteResult>();<NEW_LINE>}<NEW_LINE>List<TransportRouteResult> convertedRes = new ArrayList<TransportRouteResult>();<NEW_LINE>for (NativeTransportRoutingResult ntrr : res) {<NEW_LINE><MASK><NEW_LINE>trr.setFinishWalkDist(ntrr.finishWalkDist);<NEW_LINE>trr.setRouteTime(ntrr.routeTime);<NEW_LINE>for (NativeTransportRouteResultSegment ntrs : ntrr.segments) {<NEW_LINE>TransportRouteResultSegment trs = new TransportRouteResultSegment();<NEW_LINE>trs.route = convertTransportRoute(ntrs.route, convertedRoutesCache, convertedStopsCache);<NEW_LINE>trs.walkTime = ntrs.walkTime;<NEW_LINE>trs.travelDistApproximate = ntrs.travelDistApproximate;<NEW_LINE>trs.travelTime = ntrs.travelTime;<NEW_LINE>trs.start = ntrs.start;<NEW_LINE>trs.end = ntrs.end;<NEW_LINE>trs.walkDist = ntrs.walkDist;<NEW_LINE>trs.depTime = ntrs.depTime;<NEW_LINE>trr.addSegment(trs);<NEW_LINE>}<NEW_LINE>convertedRes.add(trr);<NEW_LINE>}<NEW_LINE>convertedStopsCache.clear();<NEW_LINE>convertedRoutesCache.clear();<NEW_LINE>return convertedRes;<NEW_LINE>}
TransportRouteResult trr = new TransportRouteResult(cfg);
805,932
public void onViewCreated(View view, Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>final Activity activity = getActivity();<NEW_LINE>mToast = Toast.makeText(activity, "", Toast.LENGTH_SHORT);<NEW_LINE>mToast.setGravity(Gravity.CENTER, 0, 0);<NEW_LINE>mRecyclerView = (TwoWayView) view.findViewById(R.id.list);<NEW_LINE>mRecyclerView.setHasFixedSize(true);<NEW_LINE>mRecyclerView.setLongClickable(true);<NEW_LINE>mPositionText = (TextView) view.getRootView().findViewById(R.id.position);<NEW_LINE>mCountText = (TextView) view.getRootView().findViewById(R.id.count);<NEW_LINE>mStateText = (TextView) view.getRootView().findViewById(R.id.state);<NEW_LINE>updateState(SCROLL_STATE_IDLE);<NEW_LINE>final ItemClickSupport itemClick = ItemClickSupport.addTo(mRecyclerView);<NEW_LINE>itemClick.setOnItemClickListener(new OnItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemClick(RecyclerView parent, View child, int position, long id) {<NEW_LINE>mToast.setText("Item clicked: " + position);<NEW_LINE>mToast.show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>itemClick.setOnItemLongClickListener(new OnItemLongClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onItemLongClick(RecyclerView parent, View child, int position, long id) {<NEW_LINE>mToast.setText("Item long pressed: " + position);<NEW_LINE>mToast.show();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mRecyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onScrollStateChanged(RecyclerView recyclerView, int scrollState) {<NEW_LINE>updateState(scrollState);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onScrolled(RecyclerView recyclerView, int i, int i2) {<NEW_LINE>mPositionText.setText("First: " + mRecyclerView.getFirstVisiblePosition());<NEW_LINE>mCountText.setText("Count: " + mRecyclerView.getChildCount());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final Drawable divider = getResources().<MASK><NEW_LINE>mRecyclerView.addItemDecoration(new DividerItemDecoration(divider));<NEW_LINE>mRecyclerView.setAdapter(new LayoutAdapter(activity, mRecyclerView, mLayoutId));<NEW_LINE>}
getDrawable(R.drawable.divider);
1,634,276
public EPUBVersion retrieveOpfVersion(InputStream inputStream) throws InvalidVersionException {<NEW_LINE>SAXParserFactory factory = SAXParserFactory.newInstance();<NEW_LINE>factory.setNamespaceAware(true);<NEW_LINE>factory.setValidating(false);<NEW_LINE>try {<NEW_LINE>factory.setFeature("http://xml.org/sax/features/validation", false);<NEW_LINE>factory.setFeature("http://xml.org/sax/features/external-general-entities", false);<NEW_LINE>factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>SAXParser parser;<NEW_LINE>try {<NEW_LINE>parser = factory.newSAXParser();<NEW_LINE>parser.getXMLReader().setEntityResolver(this);<NEW_LINE>parser.getXMLReader().setErrorHandler(this);<NEW_LINE>parser.getXMLReader().setContentHandler(new OPFhandler());<NEW_LINE>parser.getXMLReader().parse(new InputSource(inputStream));<NEW_LINE>} catch (ParserConfigurationException e) {<NEW_LINE>report.message(MessageId.RSC_005, EPUBLocation.create(path), e.getMessage());<NEW_LINE>} catch (SAXException e) {<NEW_LINE>if (VERSION_3.equals(e.getMessage())) {<NEW_LINE>report.info(null, FeatureEnum.FORMAT_VERSION, EPUBVersion.VERSION_3.toString());<NEW_LINE>return EPUBVersion.VERSION_3;<NEW_LINE>} else if (VERSION_2.equals(e.getMessage())) {<NEW_LINE>report.info(null, FeatureEnum.FORMAT_VERSION, EPUBVersion.VERSION_2.toString());<NEW_LINE>return EPUBVersion.VERSION_2;<NEW_LINE>} else if (InvalidVersionException.UNSUPPORTED_VERSION.equals(e.getMessage())) {<NEW_LINE>throw new InvalidVersionException(InvalidVersionException.UNSUPPORTED_VERSION);<NEW_LINE>} else if (InvalidVersionException.VERSION_ATTRIBUTE_NOT_FOUND.equals(e.getMessage())) {<NEW_LINE>throw new InvalidVersionException(InvalidVersionException.VERSION_ATTRIBUTE_NOT_FOUND);<NEW_LINE>} else if (InvalidVersionException.PACKAGE_ELEMENT_NOT_FOUND.equals(e.getMessage())) {<NEW_LINE>throw new InvalidVersionException(InvalidVersionException.PACKAGE_ELEMENT_NOT_FOUND);<NEW_LINE>} else {<NEW_LINE>report.message(MessageId.RSC_005, EPUBLocation.create(path), e.getMessage());<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>report.message(MessageId.PKG_008, EPUBLocation<MASK><NEW_LINE>}<NEW_LINE>throw new InvalidVersionException(InvalidVersionException.VERSION_NOT_FOUND);<NEW_LINE>}
.create(path), path);
198,038
private int[] adaptFpsRange(int expectedFps, List<int[]> fpsRanges) {<NEW_LINE>expectedFps *= 1000;<NEW_LINE>int[] closestRange = fpsRanges.get(0);<NEW_LINE>int measure = Math.abs(closestRange[0] - expectedFps) + Math.abs(closestRange[1] - expectedFps);<NEW_LINE>for (int[] range : fpsRanges) {<NEW_LINE>if (range[0] <= expectedFps && range[1] >= expectedFps) {<NEW_LINE>int curMeasure = Math.abs(((range[0] + range[1<MASK><NEW_LINE>if (curMeasure < measure) {<NEW_LINE>closestRange = range;<NEW_LINE>measure = curMeasure;<NEW_LINE>} else if (curMeasure == measure) {<NEW_LINE>if (Math.abs(range[0] - expectedFps) < Math.abs(closestRange[1] - expectedFps)) {<NEW_LINE>closestRange = range;<NEW_LINE>measure = curMeasure;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return closestRange;<NEW_LINE>}
]) / 2) - expectedFps);
117,433
public void onError(Throwable e) {<NEW_LINE>// It is important here to retry the markDown for warm-up cluster.<NEW_LINE>// We cannot go ahead to markUp the regular cluster, as the warm-up cluster to uris association has not been deleted<NEW_LINE>// from the zookeeper store.<NEW_LINE>if (e instanceof KeeperException.ConnectionLossException || e instanceof KeeperException.SessionExpiredException) {<NEW_LINE>_log.warn("failed to markDown uri {} on warm-up cluster {} due to {}.", _uri, _warmupClusterName, e.getClass().getSimpleName());<NEW_LINE>// Setting to null because if that connection dies, we don't want to continue making operations before<NEW_LINE>// the connection is up again.<NEW_LINE>// When the connection will be up again, the ZKAnnouncer will be restarted and it will read the _isWarmingUp<NEW_LINE>// value and mark down warm-up cluster again if necessary<NEW_LINE>_nextOperation = null;<NEW_LINE>_isRunningMarkUpOrMarkDown = false;<NEW_LINE>} else {<NEW_LINE>// continue to mark up to the regular cluster<NEW_LINE>_server.markUp(_cluster, <MASK><NEW_LINE>}<NEW_LINE>}
_uri, _partitionDataMap, _uriSpecificProperties, markUpCallback);
433,099
static Context deleteContext(Map<String, String> config) {<NEW_LINE>// default delete config using data config<NEW_LINE>Context dataContext = dataContext(config);<NEW_LINE>int rowGroupSize = PropertyUtil.propertyAsInt(config, DELETE_PARQUET_ROW_GROUP_SIZE_BYTES, dataContext.rowGroupSize());<NEW_LINE>Preconditions.checkArgument(rowGroupSize > 0, "Row group size must be > 0");<NEW_LINE>int pageSize = PropertyUtil.propertyAsInt(config, DELETE_PARQUET_PAGE_SIZE_BYTES, dataContext.pageSize());<NEW_LINE>Preconditions.checkArgument(pageSize > 0, "Page size must be > 0");<NEW_LINE>int dictionaryPageSize = PropertyUtil.propertyAsInt(config, DELETE_PARQUET_DICT_SIZE_BYTES, dataContext.dictionaryPageSize());<NEW_LINE>Preconditions.checkArgument(dictionaryPageSize > 0, "Dictionary page size must be > 0");<NEW_LINE>String codecAsString = config.get(DELETE_PARQUET_COMPRESSION);<NEW_LINE>CompressionCodecName codec = codecAsString != null ? toCodec(codecAsString) : dataContext.codec();<NEW_LINE>String compressionLevel = config.getOrDefault(DELETE_PARQUET_COMPRESSION_LEVEL, dataContext.compressionLevel());<NEW_LINE>int rowGroupCheckMinRecordCount = PropertyUtil.propertyAsInt(config, DELETE_PARQUET_ROW_GROUP_CHECK_MIN_RECORD_COUNT, dataContext.rowGroupCheckMinRecordCount());<NEW_LINE>Preconditions.<MASK><NEW_LINE>int rowGroupCheckMaxRecordCount = PropertyUtil.propertyAsInt(config, DELETE_PARQUET_ROW_GROUP_CHECK_MAX_RECORD_COUNT, dataContext.rowGroupCheckMaxRecordCount());<NEW_LINE>Preconditions.checkArgument(rowGroupCheckMaxRecordCount > 0, "Row group check maximum record count must be > 0");<NEW_LINE>Preconditions.checkArgument(rowGroupCheckMaxRecordCount >= rowGroupCheckMinRecordCount, "Row group check maximum record count must be >= minimal record count");<NEW_LINE>return new Context(rowGroupSize, pageSize, dictionaryPageSize, codec, compressionLevel, rowGroupCheckMinRecordCount, rowGroupCheckMaxRecordCount);<NEW_LINE>}
checkArgument(rowGroupCheckMinRecordCount > 0, "Row group check minimal record count must be > 0");
1,512,220
public boolean useImageAsIs(final Uri uri) {<NEW_LINE>final String path = getOriginalPath(uri);<NEW_LINE>if (path == null || isPathBlacklisted(path)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final File file = new File(path);<NEW_LINE>long size = file.length();<NEW_LINE>if (size == 0 || size >= mXmppConnectionService.getResources().getInteger(R.integer.auto_accept_filesize)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>BitmapFactory.Options options = new BitmapFactory.Options();<NEW_LINE>options.inJustDecodeBounds = true;<NEW_LINE>try {<NEW_LINE>final InputStream inputStream = mXmppConnectionService.<MASK><NEW_LINE>BitmapFactory.decodeStream(inputStream, null, options);<NEW_LINE>close(inputStream);<NEW_LINE>if (options.outMimeType == null || options.outHeight <= 0 || options.outWidth <= 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return (options.outWidth <= Config.IMAGE_SIZE && options.outHeight <= Config.IMAGE_SIZE && options.outMimeType.contains(Config.IMAGE_FORMAT.name().toLowerCase()));<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>Log.d(Config.LOGTAG, "unable to get image dimensions", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
getContentResolver().openInputStream(uri);
1,622,331
public DatasetImageStats unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DatasetImageStats datasetImageStats = new DatasetImageStats();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Total", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>datasetImageStats.setTotal(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Labeled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>datasetImageStats.setLabeled(context.getUnmarshaller(Integer.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Normal", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>datasetImageStats.setNormal(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Anomaly", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>datasetImageStats.setAnomaly(context.getUnmarshaller(Integer.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 datasetImageStats;<NEW_LINE>}
class).unmarshall(context));
1,320,322
public ProcessInstanceMigrationBuilder fromProcessInstanceMigrationDocument(ProcessInstanceMigrationDocument document) {<NEW_LINE>migrationDocumentBuilder.setProcessDefinitionToMigrateTo(document.getMigrateToProcessDefinitionId());<NEW_LINE>migrationDocumentBuilder.setProcessDefinitionToMigrateTo(document.getMigrateToProcessDefinitionKey(), document.getMigrateToProcessDefinitionVersion());<NEW_LINE>migrationDocumentBuilder.setTenantId(document.getMigrateToProcessDefinitionTenantId());<NEW_LINE>migrationDocumentBuilder.addActivityMigrationMappings(document.getActivityMigrationMappings());<NEW_LINE>migrationDocumentBuilder.setPreUpgradeScript(document.getPreUpgradeScript());<NEW_LINE>migrationDocumentBuilder.setPreUpgradeJavaDelegate(document.getPreUpgradeJavaDelegate());<NEW_LINE>migrationDocumentBuilder.setPreUpgradeJavaDelegateExpression(document.getPreUpgradeJavaDelegateExpression());<NEW_LINE>migrationDocumentBuilder.setPostUpgradeScript(document.getPostUpgradeScript());<NEW_LINE>migrationDocumentBuilder.<MASK><NEW_LINE>migrationDocumentBuilder.setPostUpgradeJavaDelegateExpression(document.getPostUpgradeJavaDelegateExpression());<NEW_LINE>return this;<NEW_LINE>}
setPostUpgradeJavaDelegate(document.getPostUpgradeJavaDelegate());
919,466
protected Object convertFromInternal(org.springframework.messaging.Message<?> message, Class<?> targetClass, @Nullable Object conversionHint) {<NEW_LINE>MimeType contentType = getMimeType(message.getHeaders());<NEW_LINE>final <MASK><NEW_LINE>if (contentType == null) {<NEW_LINE>contentType = PROTOBUF;<NEW_LINE>}<NEW_LINE>Charset charset = contentType.getCharset();<NEW_LINE>if (charset == null) {<NEW_LINE>charset = DEFAULT_CHARSET;<NEW_LINE>}<NEW_LINE>Message.Builder builder = getMessageBuilder(targetClass);<NEW_LINE>try {<NEW_LINE>if (PROTOBUF.isCompatibleWith(contentType)) {<NEW_LINE>builder.mergeFrom((byte[]) payload, this.extensionRegistry);<NEW_LINE>} else if (this.protobufFormatSupport != null) {<NEW_LINE>this.protobufFormatSupport.merge(message, charset, contentType, this.extensionRegistry, builder);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new MessageConversionException(message, "Could not read proto message" + ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
Object payload = message.getPayload();
584,747
private int checkAndGetLongThreshold(String type, int duration) {<NEW_LINE>ClientConfigManager config = Cat.getManager().getConfigManager();<NEW_LINE>ProblemLongType longType = ProblemLongType.findByMessageType(type);<NEW_LINE>if (longType != null) {<NEW_LINE>switch(longType) {<NEW_LINE>case LONG_CACHE:<NEW_LINE>return config.getLongThresholdByDuration(ProblemLongType.LONG_CACHE.getName(), duration);<NEW_LINE>case LONG_CALL:<NEW_LINE>return config.getLongThresholdByDuration(ProblemLongType.<MASK><NEW_LINE>case LONG_SERVICE:<NEW_LINE>return config.getLongThresholdByDuration(ProblemLongType.LONG_SERVICE.getName(), duration);<NEW_LINE>case LONG_SQL:<NEW_LINE>return config.getLongThresholdByDuration(ProblemLongType.LONG_SQL.getName(), duration);<NEW_LINE>case LONG_URL:<NEW_LINE>return config.getLongThresholdByDuration(ProblemLongType.LONG_URL.getName(), duration);<NEW_LINE>case LONG_MQ:<NEW_LINE>return config.getLongThresholdByDuration(ProblemLongType.LONG_MQ.getName(), duration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}
LONG_CALL.getName(), duration);
1,033,606
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {<NEW_LINE>final String metricRegistryRef = element.getAttribute("metric-registry");<NEW_LINE>if (!StringUtils.hasText(metricRegistryRef)) {<NEW_LINE>parserContext.getReaderContext().error("Metric-registry id required for element '" + element.getLocalName() + "'", element);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final String <MASK><NEW_LINE>if (!StringUtils.hasText(type)) {<NEW_LINE>parserContext.getReaderContext().error("Type required for element '" + element.getLocalName() + "'", element);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>for (ReporterElementParser reporterElementParser : reporterElementParserLoader) {<NEW_LINE>if (type.equals(reporterElementParser.getType())) {<NEW_LINE>return reporterElementParser.parseReporter(element, parserContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ServiceConfigurationError ex) {<NEW_LINE>parserContext.getReaderContext().error("Error loading ReporterElementParsers", element, ex);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Unable to locate a ReporterElementParser for the given type.<NEW_LINE>// Check to see if we're in Spring Tool Suite and if so, we won't throw an error.<NEW_LINE>if (!isInvokedBySts()) {<NEW_LINE>parserContext.getReaderContext().error("No ReporterElementParser found for reporter type '" + type + "'", element);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
type = element.getAttribute("type");
1,668,063
public Map<String, Map<String, String>> previewNewNote(long mid, String[] flds) {<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M && !hasReadWritePermission()) {<NEW_LINE>// avoid situation where addNote will pass, but deleteNote will fail<NEW_LINE>throw new SecurityException("previewNewNote requires full read-write-permission");<NEW_LINE>}<NEW_LINE>Uri newNoteUri = addNoteInternal(mid, DEFAULT_DECK_ID, flds, Collections.singleton(TEST_TAG));<NEW_LINE>// Build map of HTML for each generated card<NEW_LINE>Map<String, Map<String, String>> cards = new HashMap<>();<NEW_LINE>Uri cardsUri = Uri.withAppendedPath(newNoteUri, "cards");<NEW_LINE>final Cursor cardsCursor = mResolver.query(cardsUri, null, null, null, null);<NEW_LINE>if (cardsCursor == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>while (cardsCursor.moveToNext()) {<NEW_LINE>// add question and answer for each card to map<NEW_LINE>final String n = cardsCursor.getString(cardsCursor.getColumnIndex(Card.CARD_NAME));<NEW_LINE>final String q = cardsCursor.getString(cardsCursor.getColumnIndex(Card.QUESTION));<NEW_LINE>final String a = cardsCursor.getString(cardsCursor.getColumnIndex(Card.ANSWER));<NEW_LINE>Map<String, String> html = new HashMap<>();<NEW_LINE><MASK><NEW_LINE>html.put("a", a);<NEW_LINE>cards.put(n, html);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>cardsCursor.close();<NEW_LINE>}<NEW_LINE>// Delete the note<NEW_LINE>mResolver.delete(newNoteUri, null, null);<NEW_LINE>return cards;<NEW_LINE>}
html.put("q", q);
1,552,553
protected int encodeLine(MessageTree tree, Message message, ByteBuf buf, char type, Policy policy, int level, LineCounter counter) {<NEW_LINE>BufferHelper helper = m_bufferHelper;<NEW_LINE>int count = 0;<NEW_LINE>if (counter != null) {<NEW_LINE>counter.inc();<NEW_LINE>count += helper.tr1(buf, counter.getCount() % 2 != 0 ? "odd" : "even");<NEW_LINE>} else {<NEW_LINE>count += helper.tr1(buf, null);<NEW_LINE>}<NEW_LINE>count += helper.td1(buf);<NEW_LINE>// 2 spaces per level<NEW_LINE>count += helper.nbsp(buf, level * 2);<NEW_LINE>count += helper.write(buf, (byte) type);<NEW_LINE>if (type == 'T' && message instanceof Transaction) {<NEW_LINE>long duration = ((Transaction) message).getDurationInMillis();<NEW_LINE>count += helper.write(buf, m_dateHelper.format(message.getTimestamp() + duration));<NEW_LINE>} else {<NEW_LINE>count += helper.write(buf, m_dateHelper.format(message.getTimestamp()));<NEW_LINE>}<NEW_LINE>count += helper.td2(buf);<NEW_LINE>count += helper.td(buf, message.getType());<NEW_LINE>count += helper.td(buf, message.getName());<NEW_LINE>if (policy != Policy.WITHOUT_STATUS) {<NEW_LINE>if (Message.SUCCESS.equals(message.getStatus())) {<NEW_LINE>// do not output "0"<NEW_LINE>count += helper.td(buf, "&nbsp;");<NEW_LINE>} else {<NEW_LINE>count += helper.td(buf, message.getStatus(), "class=\"error\"");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>count += helper.td1(buf);<NEW_LINE>if (policy == Policy.WITH_DURATION && message instanceof Transaction) {<NEW_LINE>long durationInMicro = ((Transaction) message).getDurationInMicros();<NEW_LINE>long durationInMillis = durationInMicro / 1000L;<NEW_LINE>if (durationInMicro < 100L) {<NEW_LINE>count += helper.write(buf, String.format("%.2f", durationInMicro / 1000.0));<NEW_LINE>} else if (durationInMicro < 10000L) {<NEW_LINE>// less than 10 ms<NEW_LINE>count += helper.write(buf, String.format("%.2f", durationInMicro / 1000.0));<NEW_LINE>} else {<NEW_LINE>// no fraction<NEW_LINE>count += helper.write(buf, Long.toString(durationInMillis));<NEW_LINE>}<NEW_LINE>count += helper.write(buf, "ms ");<NEW_LINE>}<NEW_LINE>count += helper.writeRaw(buf, String.valueOf(data));<NEW_LINE>count += helper.td2(buf);<NEW_LINE>} else {<NEW_LINE>count += helper.td(buf, "");<NEW_LINE>count += helper.td(buf, "");<NEW_LINE>}<NEW_LINE>count += helper.tr2(buf);<NEW_LINE>count += helper.crlf(buf);<NEW_LINE>return count;<NEW_LINE>}
Object data = message.getData();
165,814
protected void execute(Terminal terminal, OptionSet options, Environment env) throws Exception {<NEW_LINE>String username = parseUsername(arguments.values(options), env.settings());<NEW_LINE>char[] passwordHash = getPasswordHash(terminal, env, passwordOption.value(options));<NEW_LINE>Path file = FileUserPasswdStore.resolveFile(env);<NEW_LINE>FileAttributesChecker attributesChecker = new FileAttributesChecker(file);<NEW_LINE>Map<String, char[]> users = FileUserPasswdStore.parseFile(file, null, env.settings());<NEW_LINE>if (users == null) {<NEW_LINE>throw new UserException(ExitCodes.CONFIG, "Configuration file [" + file + "] is missing");<NEW_LINE>}<NEW_LINE>if (users.containsKey(username) == false) {<NEW_LINE>throw new UserException(ExitCodes.NO_USER, "User [" + username + "] doesn't exist");<NEW_LINE>}<NEW_LINE>// make modifiable<NEW_LINE>users <MASK><NEW_LINE>users.put(username, passwordHash);<NEW_LINE>FileUserPasswdStore.writeFile(users, file);<NEW_LINE>attributesChecker.check(terminal);<NEW_LINE>}
= new HashMap<>(users);
1,361,703
public int update(Uri uri, ContentValues values, String where, String[] whereArgs) {<NEW_LINE>deferDaggerInit();<NEW_LINE>String projectId = getProjectId(uri);<NEW_LINE>logServerEvent(projectId, AnalyticsEvents.FORMS_PROVIDER_UPDATE);<NEW_LINE>FormsRepository formsRepository = getFormsRepository(projectId);<NEW_LINE>String formsPath = storagePathProvider.getOdkDirPath(StorageSubdirectory.FORMS, projectId);<NEW_LINE>String cachePath = storagePathProvider.getOdkDirPath(StorageSubdirectory.CACHE, projectId);<NEW_LINE>int count;<NEW_LINE>switch(URI_MATCHER.match(uri)) {<NEW_LINE>case FORMS:<NEW_LINE>try (Cursor cursor = databaseQuery(projectId, null, where, whereArgs, null, null, null)) {<NEW_LINE>while (cursor.moveToNext()) {<NEW_LINE>Form form = getFormFromCurrentCursorPosition(cursor, formsPath, cachePath);<NEW_LINE>ContentValues existingValues = getValuesFromForm(form, formsPath);<NEW_LINE>existingValues.putAll(values);<NEW_LINE>formsRepository.save(getFormFromValues(existingValues, formsPath, cachePath));<NEW_LINE>}<NEW_LINE>count = cursor.getCount();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FORM_ID:<NEW_LINE>Form form = formsRepository.get(ContentUriHelper.getIdFromUri(uri));<NEW_LINE>if (form != null) {<NEW_LINE>ContentValues existingValues = getValuesFromForm(form, formsPath);<NEW_LINE>existingValues.putAll(values);<NEW_LINE>formsRepository.save(getFormFromValues<MASK><NEW_LINE>count = 1;<NEW_LINE>} else {<NEW_LINE>count = 0;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown URI " + uri);<NEW_LINE>}<NEW_LINE>getContext().getContentResolver().notifyChange(uri, null);<NEW_LINE>return count;<NEW_LINE>}
(existingValues, formsPath, cachePath));
984,440
public static void handle(String stmt, ManagerConnection c) {<NEW_LINE>ByteBuffer buffer = c.allocate();<NEW_LINE>// write header<NEW_LINE>buffer = header.write(buffer, c, true);<NEW_LINE>// write fields<NEW_LINE>for (FieldPacket field : fields) {<NEW_LINE>buffer = field.write(buffer, c, true);<NEW_LINE>}<NEW_LINE>// write eof<NEW_LINE>buffer = eof.write(buffer, c, true);<NEW_LINE>// write rows<NEW_LINE>byte packetId = eof.packetId;<NEW_LINE>PackageBufINf bufInf = null;<NEW_LINE>// show log key=warn limit=0,30<NEW_LINE>Map<String, String> condPairMap = getCondPair(stmt);<NEW_LINE>if (condPairMap.isEmpty()) {<NEW_LINE>bufInf = showLogSum(c, buffer, packetId);<NEW_LINE>} else {<NEW_LINE>String logFile = condPairMap.get("file");<NEW_LINE>if (logFile == null) {<NEW_LINE>logFile = DEFAULT_LOGFILE;<NEW_LINE>}<NEW_LINE>String limitStr = condPairMap.get("limit");<NEW_LINE>limitStr = (limitStr != null) ? limitStr : "0," + 100000;<NEW_LINE>String[] limtArry = limitStr.split("\\s|,");<NEW_LINE>int start = Integer.parseInt(limtArry[0]);<NEW_LINE>int page = Integer.parseInt(limtArry[1]);<NEW_LINE>int end = Integer.valueOf(start + page);<NEW_LINE>String key = condPairMap.get("key");<NEW_LINE>String regex = condPairMap.get("regex");<NEW_LINE>bufInf = showLogRange(c, buffer, packetId, key, regex, start, end, logFile);<NEW_LINE>}<NEW_LINE>packetId = bufInf.packetId;<NEW_LINE>buffer = bufInf.buffer;<NEW_LINE>EOFPacket lastEof = new EOFPacket();<NEW_LINE>lastEof.packetId = ++packetId;<NEW_LINE>buffer = lastEof.<MASK><NEW_LINE>// write buffer<NEW_LINE>c.write(buffer);<NEW_LINE>}
write(buffer, c, true);
505,325
public static QueryFaceUserByNameResponse unmarshall(QueryFaceUserByNameResponse queryFaceUserByNameResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryFaceUserByNameResponse.setRequestId(_ctx.stringValue("QueryFaceUserByNameResponse.RequestId"));<NEW_LINE>queryFaceUserByNameResponse.setSuccess(_ctx.booleanValue("QueryFaceUserByNameResponse.Success"));<NEW_LINE>queryFaceUserByNameResponse.setErrorMessage(_ctx.stringValue("QueryFaceUserByNameResponse.ErrorMessage"));<NEW_LINE>queryFaceUserByNameResponse.setCode(_ctx.stringValue("QueryFaceUserByNameResponse.Code"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.integerValue("QueryFaceUserByNameResponse.Data.Total"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QueryFaceUserByNameResponse.Data.PageSize"));<NEW_LINE>data.setPage(_ctx.integerValue("QueryFaceUserByNameResponse.Data.Page"));<NEW_LINE>List<PageData> list = new ArrayList<PageData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryFaceUserByNameResponse.Data.List.Length"); i++) {<NEW_LINE>PageData pageData = new PageData();<NEW_LINE>pageData.setUserId(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i + "].UserId"));<NEW_LINE>pageData.setCustomUserId(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i + "].CustomUserId"));<NEW_LINE>pageData.setName(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i + "].Name"));<NEW_LINE>pageData.setParams(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i + "].Params"));<NEW_LINE>pageData.setCreateTime(_ctx.longValue("QueryFaceUserByNameResponse.Data.List[" + i + "].CreateTime"));<NEW_LINE>pageData.setModifyTime(_ctx.longValue("QueryFaceUserByNameResponse.Data.List[" + i + "].ModifyTime"));<NEW_LINE>List<FacePicListItem> facePicList = new ArrayList<FacePicListItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryFaceUserByNameResponse.Data.List[" + i + "].FacePicList.Length"); j++) {<NEW_LINE>FacePicListItem facePicListItem = new FacePicListItem();<NEW_LINE>facePicListItem.setFaceMd5(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i <MASK><NEW_LINE>facePicListItem.setFaceUrl(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i + "].FacePicList[" + j + "].FaceUrl"));<NEW_LINE>List<FeatureDTO> featureDTOList = new ArrayList<FeatureDTO>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("QueryFaceUserByNameResponse.Data.List[" + i + "].FacePicList[" + j + "].FeatureDTOList.Length"); k++) {<NEW_LINE>FeatureDTO featureDTO = new FeatureDTO();<NEW_LINE>featureDTO.setAlgorithmName(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].AlgorithmName"));<NEW_LINE>featureDTO.setAlgorithmProvider(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].AlgorithmProvider"));<NEW_LINE>featureDTO.setAlgorithmVersion(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].AlgorithmVersion"));<NEW_LINE>featureDTO.setFaceMd5(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].FaceMd5"));<NEW_LINE>featureDTO.setErrorCode(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].ErrorCode"));<NEW_LINE>featureDTO.setErrorMessage(_ctx.stringValue("QueryFaceUserByNameResponse.Data.List[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].ErrorMessage"));<NEW_LINE>featureDTOList.add(featureDTO);<NEW_LINE>}<NEW_LINE>facePicListItem.setFeatureDTOList(featureDTOList);<NEW_LINE>facePicList.add(facePicListItem);<NEW_LINE>}<NEW_LINE>pageData.setFacePicList(facePicList);<NEW_LINE>list.add(pageData);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>queryFaceUserByNameResponse.setData(data);<NEW_LINE>return queryFaceUserByNameResponse;<NEW_LINE>}
+ "].FacePicList[" + j + "].FaceMd5"));
274,764
public void attachInfo(Context context, ProviderInfo info) {<NEW_LINE>// super.attachInfo calls onCreate(). Fail as early as possible.<NEW_LINE>checkContentProviderAuthority(info);<NEW_LINE>super.attachInfo(context, info);<NEW_LINE>// Initialize ConfigResolver early for accessing device caching layer.<NEW_LINE><MASK><NEW_LINE>configResolver.setContentProviderContext(getContext());<NEW_LINE>AppStateMonitor appStateMonitor = AppStateMonitor.getInstance();<NEW_LINE>appStateMonitor.registerActivityLifecycleCallbacks(getContext());<NEW_LINE>appStateMonitor.registerForAppColdStart(new FirebasePerformanceInitializer());<NEW_LINE>AppStartTrace appStartTrace = AppStartTrace.getInstance();<NEW_LINE>appStartTrace.registerActivityLifecycleCallbacks(getContext());<NEW_LINE>mainHandler.post(new AppStartTrace.StartFromBackgroundRunnable(appStartTrace));<NEW_LINE>// In the case of cold start, we create a session and start collecting gauges as early as<NEW_LINE>// possible.<NEW_LINE>// There is code in SessionManager that prevents us from resetting the session twice in case<NEW_LINE>// of app cold start.<NEW_LINE>SessionManager.getInstance().initializeGaugeCollection();<NEW_LINE>}
ConfigResolver configResolver = ConfigResolver.getInstance();
1,146,301
public void printTopicDocuments(PrintWriter out, int max) {<NEW_LINE>out.println("#topic doc name proportion ...");<NEW_LINE>ArrayList<TreeSet<IDSorter<MASK><NEW_LINE>for (int topic = 0; topic < numTopics; topic++) {<NEW_LINE>TreeSet<IDSorter> sortedDocuments = topicSortedDocuments.get(topic);<NEW_LINE>@Var<NEW_LINE>int i = 0;<NEW_LINE>for (IDSorter sorter : sortedDocuments) {<NEW_LINE>if (i == max) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int doc = sorter.getID();<NEW_LINE>double proportion = sorter.getWeight();<NEW_LINE>@Var<NEW_LINE>String name = data.get(doc).instance.getName().toString();<NEW_LINE>if (name == null) {<NEW_LINE>name = "no-name";<NEW_LINE>}<NEW_LINE>out.format("%d %d %s %f\n", topic, doc, name, proportion);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
>> topicSortedDocuments = getTopicDocuments(10.0);
1,788,272
public boolean handle(ResourcePackRequest packet) {<NEW_LINE>ResourcePackInfo.Builder builder = new VelocityResourcePackInfo.BuilderImpl(Preconditions.checkNotNull(packet.getUrl())).setPrompt(packet.getPrompt()).setShouldForce(packet.isRequired()).<MASK><NEW_LINE>String hash = packet.getHash();<NEW_LINE>if (hash != null && !hash.isEmpty()) {<NEW_LINE>if (PLAUSIBLE_SHA1_HASH.matcher(hash).matches()) {<NEW_LINE>builder.setHash(ByteBufUtil.decodeHexDump(hash));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ServerResourcePackSendEvent event = new ServerResourcePackSendEvent(builder.build(), this.serverConn);<NEW_LINE>server.getEventManager().fire(event).thenAcceptAsync(serverResourcePackSendEvent -> {<NEW_LINE>if (playerConnection.isClosed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (serverResourcePackSendEvent.getResult().isAllowed()) {<NEW_LINE>ResourcePackInfo toSend = serverResourcePackSendEvent.getProvidedResourcePack();<NEW_LINE>if (toSend != serverResourcePackSendEvent.getReceivedResourcePack()) {<NEW_LINE>((VelocityResourcePackInfo) toSend).setOriginalOrigin(ResourcePackInfo.Origin.DOWNSTREAM_SERVER);<NEW_LINE>}<NEW_LINE>serverConn.getPlayer().queueResourcePack(toSend);<NEW_LINE>} else if (serverConn.getConnection() != null) {<NEW_LINE>serverConn.getConnection().write(new ResourcePackResponse(packet.getHash(), PlayerResourcePackStatusEvent.Status.DECLINED));<NEW_LINE>}<NEW_LINE>}, playerConnection.eventLoop()).exceptionally((ex) -> {<NEW_LINE>if (serverConn.getConnection() != null) {<NEW_LINE>serverConn.getConnection().write(new ResourcePackResponse(packet.getHash(), PlayerResourcePackStatusEvent.Status.DECLINED));<NEW_LINE>}<NEW_LINE>logger.error("Exception while handling resource pack send for {}", playerConnection, ex);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>}
setOrigin(ResourcePackInfo.Origin.DOWNSTREAM_SERVER);
1,830,699
public String saveAsFile(boolean accessingAsFile) throws IOException {<NEW_LINE>File file = new SikulixFileChooser(<MASK><NEW_LINE>if (file == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String bundlePath = FileManager.slashify(file.getAbsolutePath(), false);<NEW_LINE>if (!file.getAbsolutePath().endsWith(".sikuli")) {<NEW_LINE>bundlePath += ".sikuli";<NEW_LINE>}<NEW_LINE>if (FileManager.exists(bundlePath)) {<NEW_LINE>int res = JOptionPane.showConfirmDialog(null, SikuliIDEI18N._I("msgFileExists", bundlePath), SikuliIDEI18N._I("dlgFileExists"), JOptionPane.YES_NO_OPTION);<NEW_LINE>if (res != JOptionPane.YES_OPTION) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FileManager.deleteFileOrFolder(bundlePath);<NEW_LINE>}<NEW_LINE>FileManager.mkdir(bundlePath);<NEW_LINE>try {<NEW_LINE>saveAsBundle(bundlePath, (sikuliIDE.getCurrentFileTabTitle()));<NEW_LINE>if (Settings.isMac()) {<NEW_LINE>if (!Settings.handlesMacBundles) {<NEW_LINE>makeBundle(bundlePath, accessingAsFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException iOException) {<NEW_LINE>}<NEW_LINE>return getCurrentShortFilename();<NEW_LINE>}
sikuliIDE, accessingAsFile).save();
176,433
final DescribeDocumentResult executeDescribeDocument(DescribeDocumentRequest describeDocumentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDocumentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDocumentRequest> request = null;<NEW_LINE>Response<DescribeDocumentResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeDocumentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDocumentRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDocument");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDocumentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDocumentResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
515,804
public okhttp3.Call connectOptionsNodeProxyCall(String name, String path, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/nodes/{name}/proxy".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (path != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new <MASK><NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "*/*" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "OPTIONS", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
HashMap<String, String>();
858,276
public CompletableFuture<NIVariable> evaluateAsync(String expression, String resultName) {<NEW_LINE>String resultVarName = (resultName != null) ? resultName : expression;<NEW_LINE>CompletableFuture<NIVariable> result = new CompletableFuture<>();<NEW_LINE>NIVariable value = getVariables().get(expression);<NEW_LINE>if (value != null) {<NEW_LINE>result.complete(value);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>thread.getDebugger().send(new Command("-var-create --thread " + thread.getId() + " --frame " + level + " - * " + expression) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onDone(MIRecord record) {<NEW_LINE><MASK><NEW_LINE>String varName = results.valueOf("name").asConst().value();<NEW_LINE>MIValue typeValue = results.valueOf("type");<NEW_LINE>String type = typeValue != null ? typeValue.asConst().value() : null;<NEW_LINE>MIValue resultValue = results.valueOf("value");<NEW_LINE>int numChildren;<NEW_LINE>MIValue numchildValue = results.valueOf("numchild");<NEW_LINE>if (numchildValue != null) {<NEW_LINE>numChildren = Integer.parseInt(numchildValue.asConst().value());<NEW_LINE>} else {<NEW_LINE>numChildren = retrieveNumChildren(CPPFrame.this, varName);<NEW_LINE>}<NEW_LINE>result.complete(new CPPVariable(CPPFrame.this, null, varName, resultVarName, type, resultValue, numChildren));<NEW_LINE>// thread.getDebugger().send(new Command("-var-delete " + varName));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onError(MIRecord record) {<NEW_LINE>String error = record.error();<NEW_LINE>if (error.startsWith(MI_ERROR)) {<NEW_LINE>error = error.substring(MI_ERROR.length());<NEW_LINE>result.completeExceptionally(new EvaluateException(error));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result;<NEW_LINE>}
MITList results = record.results();
1,526,501
public void process(final Exchange exchange) throws Exception {<NEW_LINE>final Patient patient = exchange.getIn().getBody(Patient.class);<NEW_LINE>final String orgCode = ProcessorHelper.getPropertyOrThrowError(exchange, <MASK><NEW_LINE>final GetPatientsRouteContext routeContext = ProcessorHelper.getPropertyOrThrowError(exchange, GetPatientsRouteConstants.ROUTE_PROPERTY_GET_PATIENTS_CONTEXT, GetPatientsRouteContext.class);<NEW_LINE>final AlbertaConnectionDetails connectionDetails = routeContext.getAlbertaConnectionDetails();<NEW_LINE>final Doctor doctorOrNull = getDoctorOrNull(routeContext.getDoctorApi(), connectionDetails, patient.getPrimaryDoctorId());<NEW_LINE>final NursingHome nursingHomeOrNull = getNursingHomeOrNull(routeContext.getNursingHomeApi(), connectionDetails, patient.getNursingHomeId());<NEW_LINE>final NursingService nursingServiceOrNull = getNursingServiceOrNull(routeContext.getNursingServiceApi(), connectionDetails, patient.getNursingServiceId());<NEW_LINE>final Hospital hospital = getHospital(routeContext.getHospitalApi(), connectionDetails, patient.getHospital());<NEW_LINE>final Payer payerOrNull = getPayerOrNull(routeContext.getPayerApi(), connectionDetails, patient.getPayer());<NEW_LINE>final Pharmacy pharmacyOrNull = getPharmacyOrNull(routeContext.getPharmacyApi(), connectionDetails, patient.getPharmacyId());<NEW_LINE>final Users createdBy = getUserOrNull(routeContext.getUserApi(), connectionDetails, patient.getCreatedBy());<NEW_LINE>final Users updatedBy = getUserOrNull(routeContext.getUserApi(), connectionDetails, patient.getUpdatedBy());<NEW_LINE>final BPartnerUpsertRequestProducer bPartnerUpsertRequestProducer = BPartnerUpsertRequestProducer.builder().patient(patient).orgCode(orgCode).doctor(doctorOrNull).nursingHome(nursingHomeOrNull).nursingService(nursingServiceOrNull).hospital(hospital).payer(payerOrNull).pharmacy(pharmacyOrNull).createdBy(createdBy).updatedBy(updatedBy).rootBPartnerIdForUsers(routeContext.getRootBPartnerIdForUsers()).build();<NEW_LINE>final BPartnerUpsertRequestProducer.BPartnerRequestProducerResult result = bPartnerUpsertRequestProducer.run();<NEW_LINE>final BPartnerRoleInfoProvider bPartnerRoleInfoProvider = BPartnerRoleInfoProvider.builder().sourceBPartnerIdentifier(result.getPatientBPartnerIdentifier()).bpIdentifier2Role(result.getBPartnerIdentifier2RelationRole()).sourceBPartnerLocationIdentifier(result.getPatientMainAddressIdentifier()).build();<NEW_LINE>exchange.getIn().setBody(result.getJsonRequestBPartnerUpsert());<NEW_LINE>exchange.setProperty(GetPatientsRouteConstants.ROUTE_PROPERTY_BP_IDENTIFIER_TO_ROLE, bPartnerRoleInfoProvider);<NEW_LINE>routeContext.setUpdatedAfterValue(AlbertaUtil.asInstant(patient.getCreatedAt()));<NEW_LINE>}
GetPatientsRouteConstants.ROUTE_PROPERTY_ORG_CODE, String.class);
1,228,335
public static void applyCommonConfiguration(Config config, HttpClient.Builder builder, HttpClient.Factory factory) {<NEW_LINE>builder.followAllRedirects();<NEW_LINE>if (config.getConnectionTimeout() > 0) {<NEW_LINE>builder.connectTimeout(config.getConnectionTimeout(), TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>if (config.getRequestTimeout() > 0) {<NEW_LINE>builder.readTimeout(config.getRequestTimeout(), TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>if (config.isHttp2Disable()) {<NEW_LINE>builder.preferHttp11();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Only check proxy if it's a full URL with protocol<NEW_LINE>if (config.getMasterUrl().toLowerCase(Locale.ROOT).startsWith(Config.HTTP_PROTOCOL_PREFIX) || config.getMasterUrl().startsWith(Config.HTTPS_PROTOCOL_PREFIX)) {<NEW_LINE>try {<NEW_LINE>URL proxyUrl = HttpClientUtils.getProxyUrl(config);<NEW_LINE>if (proxyUrl != null) {<NEW_LINE>builder.proxyAddress(new InetSocketAddress(proxyUrl.getHost(), proxyUrl.getPort()));<NEW_LINE>if (config.getProxyUsername() != null) {<NEW_LINE>builder.proxyAuthorization(basicCredentials(config.getProxyUsername(), config.getProxyPassword()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>builder.proxyAddress(null);<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new KubernetesClientException("Invalid proxy server configuration", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TrustManager[] trustManagers = SSLUtils.trustManagers(config);<NEW_LINE>KeyManager[] keyManagers = SSLUtils.keyManagers(config);<NEW_LINE>builder.sslContext(keyManagers, trustManagers);<NEW_LINE>if (config.getTlsVersions() != null && config.getTlsVersions().length > 0) {<NEW_LINE>builder.<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw KubernetesClientException.launderThrowable(e);<NEW_LINE>}<NEW_LINE>HttpClientUtils.createApplicableInterceptors(config, factory).forEach(builder::addOrReplaceInterceptor);<NEW_LINE>}
tlsVersions(config.getTlsVersions());
955,643
public ModelAndView profile(ModelMap map, HttpServletRequest request, @Valid String snsid) {<NEW_LINE>CousultInvite coultInvite = OnlineUserProxy.consult(snsid, super.getOrgi(request));<NEW_LINE>logger.info("[profile] snsaccount Id {}, Ai {}, Aifirst {}, Ainame {}, Aisuccess {}, Aiid {}", coultInvite.getSnsaccountid(), coultInvite.isAi(), coultInvite.isAifirst(), coultInvite.getAiname(), coultInvite.getAisuccesstip(<MASK><NEW_LINE>if (coultInvite != null) {<NEW_LINE>map.addAttribute("inviteData", coultInvite);<NEW_LINE>map.addAttribute("skillGroups", getSkillGroups(request));<NEW_LINE>}<NEW_LINE>map.addAttribute("import", request.getServerPort());<NEW_LINE>map.addAttribute("snsAccount", snsAccountRes.findBySnsidAndOrgi(snsid, super.getOrgi(request)));<NEW_LINE>map.put("serviceAiList", serviceAiRes.findByOrgi(super.getOrgi(request)));<NEW_LINE>return request(super.createView("/admin/webim/profile"));<NEW_LINE>}
), coultInvite.getAiid());
461,583
public static LiveChannelStat parseGetLiveChannelStat(InputStream responseBody) throws ResponseParseException {<NEW_LINE>try {<NEW_LINE>Element root = getXmlRootElement(responseBody);<NEW_LINE>LiveChannelStat result = new LiveChannelStat();<NEW_LINE>result.setPushflowStatus(PushflowStatus.parse(root.getChildText("Status")));<NEW_LINE>if (root.getChild("ConnectedTime") != null) {<NEW_LINE>result.setConnectedDate(DateUtil.parseIso8601Date(root.getChildText("ConnectedTime")));<NEW_LINE>}<NEW_LINE>if (root.getChild("RemoteAddr") != null) {<NEW_LINE>result.setRemoteAddress(root.getChildText("RemoteAddr"));<NEW_LINE>}<NEW_LINE>Element videoElem = root.getChild("Video");<NEW_LINE>if (videoElem != null) {<NEW_LINE>VideoStat videoStat = new VideoStat();<NEW_LINE>videoStat.setWidth(Integer.parseInt(<MASK><NEW_LINE>videoStat.setHeight(Integer.parseInt(videoElem.getChildText("Height")));<NEW_LINE>videoStat.setFrameRate(Integer.parseInt(videoElem.getChildText("FrameRate")));<NEW_LINE>videoStat.setBandWidth(Integer.parseInt(videoElem.getChildText("Bandwidth")));<NEW_LINE>videoStat.setCodec(videoElem.getChildText("Codec"));<NEW_LINE>result.setVideoStat(videoStat);<NEW_LINE>}<NEW_LINE>Element audioElem = root.getChild("Audio");<NEW_LINE>if (audioElem != null) {<NEW_LINE>AudioStat audioStat = new AudioStat();<NEW_LINE>audioStat.setBandWidth(Integer.parseInt(audioElem.getChildText("Bandwidth")));<NEW_LINE>audioStat.setSampleRate(Integer.parseInt(audioElem.getChildText("SampleRate")));<NEW_LINE>audioStat.setCodec(audioElem.getChildText("Codec"));<NEW_LINE>result.setAudioStat(audioStat);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (JDOMParseException e) {<NEW_LINE>throw new ResponseParseException(e.getPartialDocument() + ": " + e.getMessage(), e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ResponseParseException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
videoElem.getChildText("Width")));
1,019,777
public boolean handleOnActivityResult(int requestCode, int resultCode, Intent data) {<NEW_LINE>if (this.requestCode != requestCode) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final Callback<TwitterSession> callback = getCallback();<NEW_LINE>if (callback != null) {<NEW_LINE>if (resultCode == Activity.RESULT_OK) {<NEW_LINE>final String token = data.getStringExtra(EXTRA_TOKEN);<NEW_LINE>final String tokenSecret = data.getStringExtra(EXTRA_TOKEN_SECRET);<NEW_LINE>final String <MASK><NEW_LINE>final long userId = data.getLongExtra(EXTRA_USER_ID, 0L);<NEW_LINE>callback.success(new Result<>(new TwitterSession(new TwitterAuthToken(token, tokenSecret), userId, screenName), null));<NEW_LINE>} else if (data != null && data.hasExtra(EXTRA_AUTH_ERROR)) {<NEW_LINE>callback.failure((TwitterAuthException) data.getSerializableExtra(EXTRA_AUTH_ERROR));<NEW_LINE>} else {<NEW_LINE>callback.failure(new TwitterAuthException("Authorize failed."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
screenName = data.getStringExtra(EXTRA_SCREEN_NAME);
1,624,556
public Response<Void> deleteByIdWithResponse(String id, String ifMatch, Boolean deleteSubscriptions, Boolean notify, AppType appType, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String serviceName = Utils.getValueFromIdByName(id, "service");<NEW_LINE>if (serviceName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id)));<NEW_LINE>}<NEW_LINE>String userId = Utils.getValueFromIdByName(id, "users");<NEW_LINE>if (userId == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id)));<NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroupName, serviceName, userId, ifMatch, <MASK><NEW_LINE>}
deleteSubscriptions, notify, appType, context);
1,778,617
public void run() {<NEW_LINE>CommandLine parent = self == null ? null : self.getParent();<NEW_LINE>if (parent == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Help.ColorScheme colors = colorScheme != null ? colorScheme : Help.defaultColorScheme(ansi);<NEW_LINE>if (commands != null) {<NEW_LINE>Map<String, CommandLine> parentSubcommands = parent.getCommandSpec().subcommands();<NEW_LINE>CommandLine subcommand = parentSubcommands.get(commands);<NEW_LINE>if (subcommand == null && parent.isAbbreviatedSubcommandsAllowed()) {<NEW_LINE>subcommand = AbbreviationMatcher.match(parentSubcommands, commands, parent.isSubcommandsCaseInsensitive(), self).getValue();<NEW_LINE>}<NEW_LINE>if (subcommand != null) {<NEW_LINE>if (outWriter != null) {<NEW_LINE>subcommand.usage(outWriter, colors);<NEW_LINE>} else {<NEW_LINE>// for compatibility with pre-4.0 clients<NEW_LINE>subcommand.usage(out, colors);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new ParameterException(parent, "Unknown subcommand '" + commands + "'.", null, commands);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (outWriter != null) {<NEW_LINE>parent.usage(outWriter, colors);<NEW_LINE>} else {<NEW_LINE>// for compatibility with pre-4.0 clients<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
parent.usage(out, colors);
1,713,177
public Response<Void> deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String environmentName = Utils.getValueFromIdByName(id, "environments");<NEW_LINE>if (environmentName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id)));<NEW_LINE>}<NEW_LINE>String referenceDataSetName = <MASK><NEW_LINE>if (referenceDataSetName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'referenceDataSets'.", id)));<NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroupName, environmentName, referenceDataSetName, context);<NEW_LINE>}
Utils.getValueFromIdByName(id, "referenceDataSets");
610,797
public static void main(String[] args) {<NEW_LINE>System.setProperty("az.factory.internat.bundle", "com.biglybt.ui.none.internat.MessagesBundle");<NEW_LINE>COConfigurationManager.initialise();<NEW_LINE>if (System.getProperty(SystemProperties.SYSPROP_LOW_RESOURCE_MODE, "false").equals("true")) {<NEW_LINE>System.out.println("Low resource mode enabled");<NEW_LINE>COConfigurationManager.setParameter("Start In Low Resource Mode", true);<NEW_LINE>COConfigurationManager.setParameter("DHT.protocol.version.min", 51);<NEW_LINE>COConfigurationManager.<MASK><NEW_LINE>COConfigurationManager.setParameter(TransferSpeedValidator.AUTO_UPLOAD_SEEDING_ENABLED_CONFIGKEY, false);<NEW_LINE>COConfigurationManager.setParameter("dht.net.cvs_v4.enable", false);<NEW_LINE>COConfigurationManager.setParameter("dht.net.main_v6.enable", false);<NEW_LINE>COConfigurationManager.setParameter("network.tcp.read.select.time", 500);<NEW_LINE>COConfigurationManager.setParameter("network.tcp.read.select.min.time", 500);<NEW_LINE>COConfigurationManager.setParameter("network.tcp.write.select.time", 500);<NEW_LINE>COConfigurationManager.setParameter("network.tcp.write.select.min.time", 500);<NEW_LINE>COConfigurationManager.setParameter("network.tcp.connect.select.time", 500);<NEW_LINE>COConfigurationManager.setParameter("network.tcp.connect.select.min.time", 500);<NEW_LINE>COConfigurationManager.setParameter("network.udp.poll.time", 100);<NEW_LINE>COConfigurationManager.setParameter("network.utp.poll.time", 100);<NEW_LINE>COConfigurationManager.setParameter("network.control.read.idle.time", 100);<NEW_LINE>COConfigurationManager.setParameter("network.control.write.idle.time", 100);<NEW_LINE>COConfigurationManager.setParameter("diskmanager.perf.cache.enable", true);<NEW_LINE>COConfigurationManager.setParameter("diskmanager.perf.cache.size", 4);<NEW_LINE>COConfigurationManager.setParameter("diskmanager.perf.cache.enable.read", false);<NEW_LINE>COConfigurationManager.setParameter("peermanager.schedule.time", 500);<NEW_LINE>PluginManagerDefaults defaults = PluginManager.getDefaults();<NEW_LINE>defaults.setDefaultPluginEnabled(PluginManagerDefaults.PID_BUDDY, false);<NEW_LINE>defaults.setDefaultPluginEnabled(PluginManagerDefaults.PID_SHARE_HOSTER, false);<NEW_LINE>defaults.setDefaultPluginEnabled(PluginManagerDefaults.PID_RSS, false);<NEW_LINE>defaults.setDefaultPluginEnabled(PluginManagerDefaults.PID_NET_STATUS, false);<NEW_LINE>}<NEW_LINE>String download_dir = System.getProperty(SystemProperties.SYSPROP_FOLDER_DOWNLOAD, "");<NEW_LINE>if (download_dir.length() > 0) {<NEW_LINE>File dir = new File(download_dir);<NEW_LINE>dir.mkdirs();<NEW_LINE>System.out.println("Download directory set to '" + dir + "'");<NEW_LINE>COConfigurationManager.setParameter("Default save path", dir.getAbsolutePath());<NEW_LINE>}<NEW_LINE>String torrent_dir = System.getProperty(SystemProperties.SYSPROP_FOLDER_TORRENT, "");<NEW_LINE>if (torrent_dir.length() > 0) {<NEW_LINE>File dir = new File(torrent_dir);<NEW_LINE>dir.mkdirs();<NEW_LINE>System.out.println("Torrent directory set to '" + dir + "'");<NEW_LINE>COConfigurationManager.setParameter("Save Torrent Files", true);<NEW_LINE>COConfigurationManager.setParameter("General_sDefaultTorrent_Directory", dir.getAbsolutePath());<NEW_LINE>}<NEW_LINE>Core core = CoreFactory.create();<NEW_LINE>core.start();<NEW_LINE>}
setParameter(TransferSpeedValidator.AUTO_UPLOAD_ENABLED_CONFIGKEY, false);
1,478,453
protected LeafNode createStringAndFloatLeafNode(String line) {<NEW_LINE>// Note: this code is identical to createIntAndFloatArrayLeafNode(),<NEW_LINE>// except for the last line.<NEW_LINE>StringTokenizer tok = new StringTokenizer(line, " ");<NEW_LINE>// read the indices from the tokenized String<NEW_LINE>int numTokens = tok.countTokens();<NEW_LINE>int index = 0;<NEW_LINE>// The data to be saved in the leaf node:<NEW_LINE>int[] indices;<NEW_LINE>// The floats to be saved in the leaf node:<NEW_LINE>float[] probs;<NEW_LINE>// System.out.println("Line: "+line+", numTokens: "+numTokens);<NEW_LINE>if (numTokens == 2) {<NEW_LINE>// we do not have any indices<NEW_LINE>// discard useless token<NEW_LINE>tok.nextToken();<NEW_LINE>indices = new int[0];<NEW_LINE>probs = new float[0];<NEW_LINE>} else {<NEW_LINE>indices = new int[(numTokens - 1) / 2];<NEW_LINE>// same length<NEW_LINE>probs = new float[indices.length];<NEW_LINE>while (index * 2 < numTokens - 1) {<NEW_LINE>String token = tok.nextToken();<NEW_LINE>if (index == 0) {<NEW_LINE>token = token.substring(4);<NEW_LINE>} else {<NEW_LINE>token = token.substring(1);<NEW_LINE>}<NEW_LINE>// System.out.println("int-token: "+token);<NEW_LINE>indices[index] = Integer.parseInt(token);<NEW_LINE>token = tok.nextToken();<NEW_LINE>int lastIndex = token.length() - 1;<NEW_LINE>if ((index * 2) == (numTokens - 3)) {<NEW_LINE>token = token.<MASK><NEW_LINE>if (token.equals("inf")) {<NEW_LINE>probs[index] = 10000;<NEW_LINE>index++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (token.equals("nan")) {<NEW_LINE>probs[index] = -1;<NEW_LINE>index++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>token = token.substring(0, lastIndex);<NEW_LINE>if (token.equals("inf")) {<NEW_LINE>probs[index] = 1000000;<NEW_LINE>index++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (token.equals("nan")) {<NEW_LINE>probs[index] = -1;<NEW_LINE>index++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// System.out.println("float-token: "+token);<NEW_LINE>probs[index] = Float.parseFloat(token);<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>// end while<NEW_LINE>}<NEW_LINE>// end if<NEW_LINE>return new LeafNode.StringAndFloatLeafNode(indices, probs);<NEW_LINE>}
substring(0, lastIndex - 1);
1,004,149
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_microphone_configure);<NEW_LINE>mPrefManager = new PreferenceManager(this.getApplicationContext());<NEW_LINE>Toolbar toolbar = findViewById(R.id.toolbar);<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>setTitle("");<NEW_LINE>getSupportActionBar().setDisplayHomeAsUpEnabled(true);<NEW_LINE>mTextLevel = findViewById(R.id.text_display_level);<NEW_LINE>mNumberTrigger = findViewById(R.id.number_trigger_level);<NEW_LINE>mWaveform = findViewById(R.id.simplewaveform);<NEW_LINE>mWaveform.setMaxVal(100);<NEW_LINE>mNumberTrigger.setMinValue(0);<NEW_LINE>mNumberTrigger.setMaxValue(MAX_SLIDER_VALUE);<NEW_LINE>if (!mPrefManager.getMicrophoneSensitivity().equals(PreferenceManager.MEDIUM))<NEW_LINE>mNumberTrigger.setValue(Integer.parseInt(mPrefManager.getMicrophoneSensitivity()));<NEW_LINE>else<NEW_LINE>mNumberTrigger.setValue(60);<NEW_LINE>mNumberTrigger.setListener((oldValue, newValue) -> {<NEW_LINE>mWaveform.setThreshold(newValue);<NEW_LINE><MASK><NEW_LINE>});<NEW_LINE>initWave();<NEW_LINE>startMic();<NEW_LINE>}
mPrefManager.setMicrophoneSensitivity(newValue + "");
1,650,283
public void uncaughtException(Thread thread, final Throwable throwable) {<NEW_LINE>System.err.println("In thread '" + thread + "' uncaught exception: " + throwable);<NEW_LINE>throwable.printStackTrace(System.err);<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>errorWindow.getContentPane().removeAll();<NEW_LINE>JTextArea textArea = new JTextArea();<NEW_LINE>textArea.setEditable(false);<NEW_LINE>StringBuilder text = new StringBuilder();<NEW_LINE>text.append("An exceptional error occurred!\nYou can try to continue or exit the application.\n\n");<NEW_LINE>text.append("Please tell us about this here:\nhttp://www.4thline.org/projects/mailinglists-cling.html\n\n");<NEW_LINE>text.append("-------------------------------------------------------------------------------------------------------------\n\n");<NEW_LINE>Writer stackTrace = new StringWriter();<NEW_LINE>throwable.printStackTrace(new PrintWriter(stackTrace));<NEW_LINE>text.append(stackTrace.toString());<NEW_LINE>textArea.<MASK><NEW_LINE>JScrollPane pane = new JScrollPane(textArea);<NEW_LINE>errorWindow.getContentPane().add(pane, BorderLayout.CENTER);<NEW_LINE>JButton exitButton = new JButton("Exit Application");<NEW_LINE>exitButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>errorWindow.getContentPane().add(exitButton, BorderLayout.SOUTH);<NEW_LINE>errorWindow.pack();<NEW_LINE>Application.center(errorWindow);<NEW_LINE>textArea.setCaretPosition(0);<NEW_LINE>errorWindow.setVisible(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
setText(text.toString());
293,978
public void paint(Graphics g, JComponent c) {<NEW_LINE>JBTabsImpl tabs = (JBTabsImpl) c;<NEW_LINE>if (tabs.getVisibleInfos().isEmpty())<NEW_LINE>return;<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE>final GraphicsConfig config = new GraphicsConfig(g2d);<NEW_LINE>config.setAntialiasing(true);<NEW_LINE>try {<NEW_LINE>final Rectangle clip = g2d.getClipBounds();<NEW_LINE>Runnable tabLineRunner = doPaintBackground(tabs, g2d, clip);<NEW_LINE>final TabInfo selected = tabs.getSelectedInfo();<NEW_LINE>if (selected != null) {<NEW_LINE>Rectangle compBounds = selected.getComponent().getBounds();<NEW_LINE>if (compBounds.contains(clip) && !compBounds.intersects(clip))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>tabLineRunner.run();<NEW_LINE>if (!tabs.isStealthModeEffective() && !tabs.isHideTabs()) {<NEW_LINE>paintNonSelectedTabs(tabs, g2d);<NEW_LINE>}<NEW_LINE>doPaintActive(tabs, (Graphics2D) g);<NEW_LINE>final TabLabel selectedLabel = tabs.getSelectedLabel();<NEW_LINE>if (selected != null) {<NEW_LINE>selectedLabel.paintImage(g);<NEW_LINE>}<NEW_LINE>tabs.getSingleRowLayoutInternal().<MASK><NEW_LINE>if (tabs.isSideComponentVertical()) {<NEW_LINE>JBTabsImpl.Toolbar toolbarComp = tabs.myInfo2Toolbar.get(tabs.getSelectedInfoInternal());<NEW_LINE>if (toolbarComp != null && !toolbarComp.isEmpty()) {<NEW_LINE>Rectangle toolBounds = toolbarComp.getBounds();<NEW_LINE>g2d.setColor(JBColor.border());<NEW_LINE>LinePainter2D.paint(g2d, toolBounds.getMaxX(), toolBounds.y, toolBounds.getMaxX(), toolBounds.getMaxY() - 1);<NEW_LINE>}<NEW_LINE>} else if (!tabs.isSideComponentOnTabs()) {<NEW_LINE>JBTabsImpl.Toolbar toolbarComp = tabs.myInfo2Toolbar.get(tabs.getSelectedInfoInternal());<NEW_LINE>if (toolbarComp != null && !toolbarComp.isEmpty()) {<NEW_LINE>Rectangle toolBounds = toolbarComp.getBounds();<NEW_LINE>g2d.setColor(JBColor.border());<NEW_LINE>LinePainter2D.paint(g2d, toolBounds.x, toolBounds.getMaxY(), toolBounds.getMaxX() - 1, toolBounds.getMaxY());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>config.restore();<NEW_LINE>}<NEW_LINE>}
myMoreIcon.paintIcon(tabs, g);