idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
203,271
public void configure(Context context) {<NEW_LINE>this.context = context;<NEW_LINE>this.reloadInterval = context.getLong(RELOAD_INTERVAL, 60000L);<NEW_LINE>String loaderType = context.getString(IDTOPIC_CONFIG_TYPE, ContextIdTopicConfigLoader.class.getName());<NEW_LINE>LOG.info("Init IdTopicConfigLoader,loaderType:{}", loaderType);<NEW_LINE>try {<NEW_LINE>Class<?> <MASK><NEW_LINE>Object loaderObject = loaderClass.getDeclaredConstructor().newInstance();<NEW_LINE>if (loaderObject instanceof IdTopicConfigLoader) {<NEW_LINE>this.loader = (IdTopicConfigLoader) loaderObject;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOG.error("Fail to init loader,loaderType:{},error:{}", loaderType, t.getMessage());<NEW_LINE>LOG.error(t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (this.loader == null) {<NEW_LINE>this.loader = new ContextIdTopicConfigLoader();<NEW_LINE>}<NEW_LINE>this.loader.configure(context);<NEW_LINE>}
loaderClass = ClassUtils.getClass(loaderType);
1,498,863
private static void tryAssertionSum(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "symbol", "volume", "mySum" };<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, null);<NEW_LINE>// assert select result type<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>assertEquals(String.class, statement.getEventType().getPropertyType("symbol"));<NEW_LINE>assertEquals(Long.class, statement.getEventType().getPropertyType("volume"));<NEW_LINE>assertEquals(Double.class, statement.getEventType().getPropertyType("mySum"));<NEW_LINE>});<NEW_LINE>sendEvent(env, SYMBOL_DELL, 10000, 51);<NEW_LINE>assertEvents(env, SYMBOL_DELL, 10000, 51);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "DELL", 10000L, 51d } });<NEW_LINE>env.milestone(0);<NEW_LINE>sendEvent(<MASK><NEW_LINE>assertEvents(env, SYMBOL_DELL, 20000, 103);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "DELL", 10000L, 103d }, { "DELL", 20000L, 103d } });<NEW_LINE>sendEvent(env, SYMBOL_IBM, 30000, 70);<NEW_LINE>assertEvents(env, SYMBOL_IBM, 30000, 70);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "DELL", 10000L, 103d }, { "DELL", 20000L, 103d }, { "IBM", 30000L, 70d } });<NEW_LINE>env.milestone(1);<NEW_LINE>sendEvent(env, SYMBOL_IBM, 10000, 20);<NEW_LINE>assertEvents(env, SYMBOL_DELL, 10000, 52, SYMBOL_IBM, 10000, 90);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "DELL", 20000L, 52d }, { "IBM", 30000L, 90d }, { "IBM", 10000L, 90d } });<NEW_LINE>sendEvent(env, SYMBOL_DELL, 40000, 45);<NEW_LINE>assertEvents(env, SYMBOL_DELL, 20000, 45, SYMBOL_DELL, 40000, 45);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "IBM", 10000L, 90d }, { "IBM", 30000L, 90d }, { "DELL", 40000L, 45d } });<NEW_LINE>}
env, SYMBOL_DELL, 20000, 52);
998,549
protected void contentsCreated() {<NEW_LINE>super.contentsCreated();<NEW_LINE>if (fPane == null) {<NEW_LINE>try {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Field f = CompareEditorInput.class.getDeclaredField("fContentInputPane");<NEW_LINE>f.setAccessible(true);<NEW_LINE>fPane = (CompareViewerSwitchingPane) f.get(this);<NEW_LINE>} catch (Exception e) {<NEW_LINE>IdeLog.logError(GitUIPlugin.getDefault(), e, IDebugScopes.DEBUG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fPane != null && (fPane.getViewer() instanceof TextMergeViewer)) {<NEW_LINE>// TODO Set up source viewer in way so we actually get syntax coloring. We'd need to be able to grab one by<NEW_LINE>// the file's content type!<NEW_LINE>((TextMergeViewer) fPane.getViewer()).setBackgroundColor(ThemePlugin.getDefault().getThemeManager().getCurrentTheme().getBackground());<NEW_LINE>((TextMergeViewer) fPane.getViewer()).setForegroundColor(ThemePlugin.getDefault().getThemeManager().<MASK><NEW_LINE>}<NEW_LINE>}
getCurrentTheme().getForeground());
1,854,360
final DescribeTargetGroupAttributesResult executeDescribeTargetGroupAttributes(DescribeTargetGroupAttributesRequest describeTargetGroupAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeTargetGroupAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeTargetGroupAttributesRequest> request = null;<NEW_LINE>Response<DescribeTargetGroupAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeTargetGroupAttributesRequestMarshaller().marshall(super.beforeMarshalling(describeTargetGroupAttributesRequest));<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, "Elastic Load Balancing v2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeTargetGroupAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeTargetGroupAttributesResult> responseHandler = new StaxResponseHandler<<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
DescribeTargetGroupAttributesResult>(new DescribeTargetGroupAttributesResultStaxUnmarshaller());
802,046
public void marshall(CreateApplicationRequest createApplicationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createApplicationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getDisplayName(), DISPLAYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getIconS3Location(), ICONS3LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getLaunchPath(), LAUNCHPATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getWorkingDirectory(), WORKINGDIRECTORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getLaunchParameters(), LAUNCHPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getInstanceFamilies(), INSTANCEFAMILIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getAppBlockArn(), APPBLOCKARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createApplicationRequest.getPlatforms(), PLATFORMS_BINDING);
1,164,358
public void connect() throws IOException {<NEW_LINE>channel = new OChannelBinarySynchClient(remoteHost, remotePort, null, contextConfig, OChannelBinaryProtocol.CURRENT_PROTOCOL_VERSION);<NEW_LINE>networkOperation(OChannelBinaryProtocol.DISTRIBUTED_CONNECT, () -> {<NEW_LINE>ODistributedConnectRequest request = new ODistributedConnectRequest(protocolVersion, userName, userPassword);<NEW_LINE><MASK><NEW_LINE>channel.flush();<NEW_LINE>channel.beginResponse(true);<NEW_LINE>ODistributedConnectResponse response = request.createResponse();<NEW_LINE>response.read(channel, null);<NEW_LINE>sessionId = response.getSessionId();<NEW_LINE>if (response.getToken() != null) {<NEW_LINE>sessionToken = response.getToken();<NEW_LINE>tokenInstance = tokenDeserializer.deserialize(new ByteArrayInputStream(sessionToken));<NEW_LINE>}<NEW_LINE>// SET THE PROTOCOL TO THE MINIMUM NUMBER TO SUPPORT BACKWARD COMPATIBILITY<NEW_LINE>protocolVersion = response.getDistributedProtocolVersion();<NEW_LINE>return null;<NEW_LINE>}, "Cannot connect to the remote server '" + url + "'", MAX_RETRY, false);<NEW_LINE>}
request.write(channel, null);
831,871
public void dispatchResourceLoadEvent(long frame, int state, String url, String contentType, double progress, int errorCode) {<NEW_LINE>final Settings settings = SettingsManager.settings();<NEW_LINE>if (settings == null) {<NEW_LINE>throw new RuntimeException("Request made after browser closed. Ignoring...");<NEW_LINE>}<NEW_LINE>synchronized (statusCode) {<NEW_LINE>if (url.startsWith("http://") || url.startsWith("https://")) {<NEW_LINE>if (state == LoadListenerClient.RESOURCE_STARTED) {<NEW_LINE>resources.put(frame + url, System.currentTimeMillis());<NEW_LINE>} else if (state == LoadListenerClient.RESOURCE_FINISHED || state == LoadListenerClient.RESOURCE_FAILED) {<NEW_LINE>String original = null;<NEW_LINE>original = statusMonitor.originalFromRedirect(url);<NEW_LINE>resources.remove(frame + url);<NEW_LINE>if (original != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((settings.logTrace()) && (url.startsWith("http://") || url.startsWith("https://"))) {<NEW_LINE>trace("Rsrc", frame, state, url, contentType, progress, errorCode);<NEW_LINE>}<NEW_LINE>}
resources.remove(frame + original);
529,618
private void initializePlainTCPTransport(NewNettyMQTTHandler handler, IConfig props) {<NEW_LINE>LOG.debug("Configuring TCP MQTT transport");<NEW_LINE><MASK><NEW_LINE>String host = props.getProperty(BrokerConstants.HOST_PROPERTY_NAME);<NEW_LINE>String tcpPortProp = props.getProperty(PORT_PROPERTY_NAME, DISABLED_PORT_BIND);<NEW_LINE>if (DISABLED_PORT_BIND.equals(tcpPortProp)) {<NEW_LINE>LOG.info("Property {} has been set to {}. TCP MQTT will be disabled", BrokerConstants.PORT_PROPERTY_NAME, DISABLED_PORT_BIND);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int port = Integer.parseInt(tcpPortProp);<NEW_LINE>initFactory(host, port, PLAIN_MQTT_PROTO, new PipelineInitializer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>void init(SocketChannel channel) {<NEW_LINE>ChannelPipeline pipeline = channel.pipeline();<NEW_LINE>configureMQTTPipeline(pipeline, timeoutHandler, handler);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
final MoquetteIdleTimeoutHandler timeoutHandler = new MoquetteIdleTimeoutHandler();
1,415,723
public void run() {<NEW_LINE>try {<NEW_LINE>File file = new File(query.getDescription());<NEW_LINE>if (file.isFile() && !file.canWrite()) {<NEW_LINE>ProfilerDialogs.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Files.write(file.toPath(), query.getScript().getBytes());<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (handler != null)<NEW_LINE>handler.querySelected(query);<NEW_LINE>if (externalQueries == null)<NEW_LINE>externalQueries = new ArrayList(EXTERNAL_QUERIES_CACHE);<NEW_LINE>if (containsQuery(externalQueries, query))<NEW_LINE>return;<NEW_LINE>if (externalQueries.size() == EXTERNAL_QUERIES_CACHE)<NEW_LINE>externalQueries.remove(externalQueries.size() - 1);<NEW_LINE>externalQueries.add(0, query);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException ex) {<NEW_LINE>ProfilerDialogs.displayError(Bundle.OQLQueries_SaveFailed());<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}
displayError(Bundle.OQLQueries_InvalidScript());
925,049
private void initComponentsI18n() {<NEW_LINE>// JFormDesigner - Component i18n initialization - DO NOT MODIFY //GEN-BEGIN:initI18n<NEW_LINE>DefaultComponentFactory.setTextAndMnemonic(_titleAppearance, SikuliIDEI18N._I("PreferencesWin.titleAppearance.textWithMnemonic"));<NEW_LINE>DefaultComponentFactory.setTextAndMnemonic(_titleIndentation, SikuliIDEI18N._I("PreferencesWin.titleIndentation.textWithMnemonic"));<NEW_LINE>_lblHotkey.setText<MASK><NEW_LINE>_lblDelay.setText(SikuliIDEI18N._I("prefCaptureDelay"));<NEW_LINE>_lblDelaySecs.setText(SikuliIDEI18N._I("prefSeconds"));<NEW_LINE>_lblNaming.setText(SikuliIDEI18N._I("prefAutoNaming"));<NEW_LINE>_radTimestamp.setText(SikuliIDEI18N._I("prefTimestamp"));<NEW_LINE>_radOCR.setText(SikuliIDEI18N._I("prefRecognizedText"));<NEW_LINE>_radOff.setText(SikuliIDEI18N._I("prefManualInput"));<NEW_LINE>_tabPane.setTitleAt(0, SikuliIDEI18N._I("prefTabScreenCapturing"));<NEW_LINE>chkExpandTab.setText(SikuliIDEI18N._I("PreferencesWin.chkExpandTab.text"));<NEW_LINE>_lblTabWidth.setText(SikuliIDEI18N._I("PreferencesWin.lblTabWidth.text"));<NEW_LINE>_lblFont.setText(SikuliIDEI18N._I("PreferencesWin.lblFont.text"));<NEW_LINE>_lblFontSize.setText(SikuliIDEI18N._I("PreferencesWin.lblFontSize.text"));<NEW_LINE>_tabPane.setTitleAt(1, SikuliIDEI18N._I("PreferencesWin.paneTextEditing.tab.title"));<NEW_LINE>chkAutoUpdate.setText(SikuliIDEI18N._I("prefGeneralAutoCheck"));<NEW_LINE>// _lblUpdates.setText(SikuliIDEI18N._I("PreferencesWin.lblUpdates.text"));<NEW_LINE>_lblUpdates.setText("Check for Updates (ignored - not implemented)");<NEW_LINE>_lblLanguage.setText(SikuliIDEI18N._I("PreferencesWin.lblLanguage.text"));<NEW_LINE>_tabPane.setTitleAt(2, SikuliIDEI18N._I("prefTabGeneralSettings"));<NEW_LINE>_btnMore.setText(SikuliIDEI18N._I("more"));<NEW_LINE>_btnOk.setText(SikuliIDEI18N._I("ok"));<NEW_LINE>_btnApply.setText(SikuliIDEI18N._I("apply"));<NEW_LINE>_btnCancel.setText(SikuliIDEI18N._I("cancel"));<NEW_LINE>// JFormDesigner - End of component i18n initialization //GEN-END:initI18n<NEW_LINE>}
(SikuliIDEI18N._I("prefCaptureHotkey"));
1,640,627
public ResponseEntity<? extends Object> torznabapi(NewznabParameters params) throws Exception {<NEW_LINE>if (params.getT() == ActionAttribute.CAPS) {<NEW_LINE>return new ResponseEntity<Object>(NewznabMockBuilder.<MASK><NEW_LINE>}<NEW_LINE>String titleBase = params.getQ() + "_" + params.getApikey();<NEW_LINE>if (!params.getCat().isEmpty()) {<NEW_LINE>titleBase += params.getCat().get(0);<NEW_LINE>}<NEW_LINE>if ("samenames".equals(params.getQ())) {<NEW_LINE>titleBase = "";<NEW_LINE>}<NEW_LINE>NewznabXmlRoot rssRoot = NewznabMockBuilder.generateResponse(0, API_MAX, titleBase, false, Collections.emptyList(), true, 0);<NEW_LINE>rssRoot.getRssChannel().setNewznabResponse(null);<NEW_LINE>Random random = new Random();<NEW_LINE>for (NewznabXmlItem item : rssRoot.getRssChannel().getItems()) {<NEW_LINE>item.setNewznabAttributes(new ArrayList<>());<NEW_LINE>item.getTorznabAttributes().add(new NewznabAttribute("seeders", String.valueOf(random.nextInt(30000))));<NEW_LINE>item.getTorznabAttributes().add(new NewznabAttribute("peers", String.valueOf(random.nextInt(30000))));<NEW_LINE>item.getTorznabAttributes().add(new NewznabAttribute("uploadvolumefactor", "1.0"));<NEW_LINE>if (random.nextInt(5) == 3) {<NEW_LINE>item.getTorznabAttributes().add(new NewznabAttribute("downloadvolumefactor", "0"));<NEW_LINE>} else {<NEW_LINE>item.getTorznabAttributes().add(new NewznabAttribute("downloadvolumefactor", String.valueOf(random.nextFloat())));<NEW_LINE>}<NEW_LINE>if (random.nextInt(5) > 3) {<NEW_LINE>item.getTorznabAttributes().add(new NewznabAttribute("grabs", String.valueOf(random.nextInt(30000))));<NEW_LINE>}<NEW_LINE>item.setCategory("5000");<NEW_LINE>item.setGrabs(null);<NEW_LINE>// item.getNewznabAttributes().clear();<NEW_LINE>}<NEW_LINE>return new ResponseEntity<Object>(rssRoot, HttpStatus.OK);<NEW_LINE>}
getCaps(), HttpStatus.OK);
1,623,003
private void markEndpointUnavailable(URI unavailableEndpoint, OperationType unavailableOperationType) {<NEW_LINE><MASK><NEW_LINE>LocationUnavailabilityInfo updatedInfo = this.locationUnavailabilityInfoByEndpoint.compute(unavailableEndpoint, new BiFunction<URI, LocationUnavailabilityInfo, LocationUnavailabilityInfo>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public LocationUnavailabilityInfo apply(URI url, LocationUnavailabilityInfo info) {<NEW_LINE>if (info == null) {<NEW_LINE>// not already present, add<NEW_LINE>return new LocationUnavailabilityInfo(currentTime, unavailableOperationType);<NEW_LINE>} else {<NEW_LINE>// already present, update<NEW_LINE>info.LastUnavailabilityCheckTimeStamp = currentTime;<NEW_LINE>info.UnavailableOperations = OperationType.combine(info.UnavailableOperations, unavailableOperationType);<NEW_LINE>return info;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>this.updateLocationCache();<NEW_LINE>logger.debug("Endpoint [{}] unavailable for [{}] added/updated to unavailableEndpoints with timestamp [{}]", unavailableEndpoint, unavailableOperationType, updatedInfo.LastUnavailabilityCheckTimeStamp);<NEW_LINE>}
Instant currentTime = Instant.now();
957,792
private // converts them to proto, then exports them to OC-Agent.<NEW_LINE>void export() {<NEW_LINE>if (exportRpcHandler == null || exportRpcHandler.isCompleted()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ArrayList<Metric> metricsList = Lists.newArrayList();<NEW_LINE>for (MetricProducer metricProducer : metricProducerManager.getAllMetricProducer()) {<NEW_LINE>metricsList.<MASK><NEW_LINE>}<NEW_LINE>List<io.opencensus.proto.metrics.v1.Metric> metricProtos = Lists.newArrayList();<NEW_LINE>for (Metric metric : metricsList) {<NEW_LINE>// TODO(songya): determine if we should make the optimization on not sending already-existed<NEW_LINE>// MetricDescriptors.<NEW_LINE>// boolean registered = true;<NEW_LINE>// if (!registeredDescriptors.contains(metric.getMetricDescriptor())) {<NEW_LINE>// registered = false;<NEW_LINE>// registeredDescriptors.add(metric.getMetricDescriptor());<NEW_LINE>// }<NEW_LINE>metricProtos.add(MetricsProtoUtils.toMetricProto(metric, null));<NEW_LINE>}<NEW_LINE>// For now don't include Resource in the following messages, i.e don't allow Resource to<NEW_LINE>exportRpcHandler.// For now don't include Resource in the following messages, i.e don't allow Resource to<NEW_LINE>onExport(// mutate after the initial message.<NEW_LINE>ExportMetricsServiceRequest.newBuilder().addAllMetrics(metricProtos).build());<NEW_LINE>}
addAll(metricProducer.getMetrics());
1,001,179
private void revokeInternal(UserIdentity userIdent, String role, ResourcePattern resourcePattern, PrivBitSet privs, boolean errOnNonExist, boolean isReplay) throws DdlException {<NEW_LINE>writeLock();<NEW_LINE>try {<NEW_LINE>if (role != null) {<NEW_LINE>// revoke privs from role<NEW_LINE>PaloRole existingRole = roleManager.revokePrivs(role, resourcePattern, privs, errOnNonExist);<NEW_LINE>if (existingRole != null) {<NEW_LINE>// revoke privs from users of this role<NEW_LINE>for (UserIdentity user : existingRole.getUsers()) {<NEW_LINE>revokePrivs(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>revokePrivs(userIdent, resourcePattern, privs, errOnNonExist);<NEW_LINE>}<NEW_LINE>if (!isReplay) {<NEW_LINE>PrivInfo info = new PrivInfo(userIdent, resourcePattern, privs, null, role);<NEW_LINE>Env.getCurrentEnv().getEditLog().logRevokePriv(info);<NEW_LINE>}<NEW_LINE>LOG.info("finished to revoke privilege. is replay: {}", isReplay);<NEW_LINE>} finally {<NEW_LINE>writeUnlock();<NEW_LINE>}<NEW_LINE>}
user, resourcePattern, privs, false);
1,463,171
protected void init_unixsock(Ruby runtime, IRubyObject _path, boolean server) {<NEW_LINE>RubyString strPath = unixsockPathValue(runtime, _path);<NEW_LINE>ByteList path = strPath.getByteList();<NEW_LINE>String fpath = Helpers.decodeByteList(runtime, path);<NEW_LINE>// Max size from Darwin, lowest common value we know of<NEW_LINE>int maxSize = 103;<NEW_LINE>if (fpath.length() > 103) {<NEW_LINE>throw runtime.newArgumentError("too long unix socket path (max: " + maxSize + "bytes)");<NEW_LINE>}<NEW_LINE>Closeable closeable = null;<NEW_LINE>try {<NEW_LINE>if (server) {<NEW_LINE>UnixServerSocketChannel channel = UnixServerSocketChannel.open();<NEW_LINE>UnixServerSocket socket = channel.socket();<NEW_LINE>closeable = channel;<NEW_LINE>// TODO: listen backlog<NEW_LINE>socket.bind(new UnixSocketAddress<MASK><NEW_LINE>init_sock(runtime, channel, fpath);<NEW_LINE>} else {<NEW_LINE>File fpathFile = new File(fpath);<NEW_LINE>if (!fpathFile.exists()) {<NEW_LINE>throw runtime.newErrnoENOENTError("unix socket");<NEW_LINE>}<NEW_LINE>UnixSocketChannel channel = UnixSocketChannel.open();<NEW_LINE>closeable = channel;<NEW_LINE>channel.connect(new UnixSocketAddress(fpathFile));<NEW_LINE>init_sock(runtime, channel);<NEW_LINE>}<NEW_LINE>// initialized cleanly, clear closeable<NEW_LINE>closeable = null;<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw runtime.newIOErrorFromException(ioe);<NEW_LINE>} finally {<NEW_LINE>if (closeable != null) {<NEW_LINE>try {<NEW_LINE>closeable.close();<NEW_LINE>} catch (IOException ioe2) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(new File(fpath)));
1,174,496
private static Event ionStreamToEvent(IonReader ionReader) throws IllegalStateException {<NEW_LINE>if (ionReader.getType() == null)<NEW_LINE>throw new IllegalStateException("Can't convert ionReader null type to Event");<NEW_LINE>IonType ionType = ionReader.getType();<NEW_LINE>SymbolToken fieldName = ionReader.getFieldNameSymbol();<NEW_LINE>SymbolToken[] annotations = ionReader.getTypeAnnotationSymbols();<NEW_LINE><MASK><NEW_LINE>ImportDescriptor[] imports = null;<NEW_LINE>EventType eventType;<NEW_LINE>IonValue value = null;<NEW_LINE>if (IonType.isContainer(ionType)) {<NEW_LINE>eventType = EventType.CONTAINER_START;<NEW_LINE>} else {<NEW_LINE>eventType = EventType.SCALAR;<NEW_LINE>value = ION_SYSTEM.newValue(ionReader);<NEW_LINE>value.clearTypeAnnotations();<NEW_LINE>if (isIonVersionMarker(value.toString())) {<NEW_LINE>value.setTypeAnnotationSymbols(_Private_Utils.newSymbolToken("$ion_user_value", 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Event(eventType, ionType, fieldName, annotations, value, imports, depth);<NEW_LINE>}
int depth = ionReader.getDepth();
1,642,003
public void onResume() {<NEW_LINE>super.onResume();<NEW_LINE>if (thermoSensor.playingData) {<NEW_LINE>sensorLabel.setText(getResources().getString(R.string.thermometer));<NEW_LINE>recordedThermoArray = new ArrayList<>();<NEW_LINE>resetInstrumentData();<NEW_LINE>playRecordedData();<NEW_LINE>} else if (thermoSensor.viewingData) {<NEW_LINE>sensorLabel.setText(getResources().getString<MASK><NEW_LINE>recordedThermoArray = new ArrayList<>();<NEW_LINE>resetInstrumentData();<NEW_LINE>plotAllRecordedData();<NEW_LINE>} else if (!thermoSensor.isRecording) {<NEW_LINE>updateGraphs();<NEW_LINE>sum = 0;<NEW_LINE>count = 0;<NEW_LINE>setUnit();<NEW_LINE>entries.clear();<NEW_LINE>mChart.clear();<NEW_LINE>mChart.invalidate();<NEW_LINE>initiateThermoSensor(sensorType);<NEW_LINE>} else if (returningFromPause) {<NEW_LINE>updateGraphs();<NEW_LINE>}<NEW_LINE>}
(R.string.thermometer));
1,264,134
public void accept(SnippetRun snippetRun) throws PolyglotException {<NEW_LINE>List<? extends Value> parameters = snippetRun.getParameters();<NEW_LINE><MASK><NEW_LINE>Value par0 = parameters.get(0);<NEW_LINE>Value par1 = parameters.get(1);<NEW_LINE>if (isStringMul(par0, par1) || isStringMul(par1, par0)) {<NEW_LINE>// string * number => string<NEW_LINE>assert snippetRun.getException() == null;<NEW_LINE>TypeDescriptor resultType = TypeDescriptor.forValue(snippetRun.getResult());<NEW_LINE>assert STRING.isAssignable(resultType);<NEW_LINE>} else if ((par0.isNumber() || par0.isBoolean()) && (par1.isNumber() || par1.isBoolean())) {<NEW_LINE>// number * number has greater precendence than array * number<NEW_LINE>assert snippetRun.getException() == null;<NEW_LINE>TypeDescriptor resultType = TypeDescriptor.forValue(snippetRun.getResult());<NEW_LINE>assert NUMBER.isAssignable(resultType) : resultType.toString();<NEW_LINE>} else if (isArrayMul(par0, par1) || isArrayMul(par1, par0)) {<NEW_LINE>// array * number => array<NEW_LINE>assert snippetRun.getException() == null;<NEW_LINE>TypeDescriptor resultType = TypeDescriptor.forValue(snippetRun.getResult());<NEW_LINE>assert array(ANY).isAssignable(resultType);<NEW_LINE>} else {<NEW_LINE>assert snippetRun.getException() != null;<NEW_LINE>TypeDescriptor argType = union(STRING, BOOLEAN, NUMBER, array(ANY));<NEW_LINE>TypeDescriptor par0Type = TypeDescriptor.forValue(par0);<NEW_LINE>TypeDescriptor par1Type = TypeDescriptor.forValue(par1);<NEW_LINE>if (!argType.isAssignable(par0Type) || !argType.isAssignable(par1Type)) {<NEW_LINE>// argument type error, rethrow<NEW_LINE>throw snippetRun.getException();<NEW_LINE>} else {<NEW_LINE>// arguments are ok, just don't work in this combination<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
assert parameters.size() == 2;
344,868
private void configureMQTTPipeline(ChannelPipeline pipeline, MoquetteIdleTimeoutHandler timeoutHandler, NewNettyMQTTHandler handler) {<NEW_LINE>pipeline.addFirst("idleStateHandler", new IdleStateHandler(nettyChannelTimeoutSeconds, 0, 0));<NEW_LINE>pipeline.addAfter("idleStateHandler", "idleEventHandler", timeoutHandler);<NEW_LINE>// pipeline.addLast("logger", new LoggingHandler("Netty", LogLevel.ERROR));<NEW_LINE>if (errorsCather.isPresent()) {<NEW_LINE>pipeline.addLast("bugsnagCatcher", errorsCather.get());<NEW_LINE>}<NEW_LINE>pipeline.addFirst("bytemetrics", new BytesMetricsHandler(bytesMetricsCollector));<NEW_LINE>pipeline.addLast("autoflush", new AutoFlushHandler(1, TimeUnit.SECONDS));<NEW_LINE>pipeline.addLast("decoder", new MqttDecoder(maxBytesInMessage));<NEW_LINE>pipeline.addLast("encoder", MqttEncoder.INSTANCE);<NEW_LINE>pipeline.addLast("metrics", new MessageMetricsHandler(metricsCollector));<NEW_LINE>pipeline.addLast("messageLogger", new MQTTMessageLogger());<NEW_LINE>if (metrics.isPresent()) {<NEW_LINE>pipeline.addLast(<MASK><NEW_LINE>}<NEW_LINE>pipeline.addLast("handler", handler);<NEW_LINE>}
"wizardMetrics", metrics.get());
1,426,565
public static void main(String[] args) {<NEW_LINE>serverStartTime = System.currentTimeMillis();<NEW_LINE>HealthSupport health = HealthSupport.builder().addLiveness(HealthChecks.healthChecks()).addReadiness(() -> HealthCheckResponse.named("exampleHealthCheck").up().withData("time", System.currentTimeMillis()).build()).addStartup(() -> HealthCheckResponse.named("exampleStartCheck").status(isStarted()).withData("time", System.currentTimeMillis()).build()).build();<NEW_LINE>Routing routing = Routing.builder().register(health).get("/hello", (req, res) -> res.send<MASK><NEW_LINE>WebServer ws = WebServer.create(routing);<NEW_LINE>ws.start().thenApply(webServer -> {<NEW_LINE>String endpoint = "http://localhost:" + webServer.port();<NEW_LINE>System.out.println("Hello World started on " + endpoint + "/hello");<NEW_LINE>System.out.println("Health checks available on " + endpoint + "/health");<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}
("Hello World!")).build();
1,119,847
private void onTick(TickEvent.Post event) {<NEW_LINE>voidHoles.clear();<NEW_LINE>if (PlayerUtils.getDimension() == Dimension.End)<NEW_LINE>return;<NEW_LINE>int px = mc.player.getBlockPos().getX();<NEW_LINE>int pz = mc.player.getBlockPos().getZ();<NEW_LINE>int radius = horizontalRadius.get();<NEW_LINE>for (int x = px - radius; x <= px + radius; x++) {<NEW_LINE>for (int z = pz - radius; z <= pz + radius; z++) {<NEW_LINE>blockPos.set(x, mc.world.getBottomY(), z);<NEW_LINE>if (isHole(blockPos, false))<NEW_LINE>voidHoles.add(voidHolePool.get().set(blockPos.set(x, mc.world.getBottomY(<MASK><NEW_LINE>// Check for nether roof<NEW_LINE>if (netherRoof.get() && PlayerUtils.getDimension() == Dimension.Nether) {<NEW_LINE>blockPos.set(x, 127, z);<NEW_LINE>if (isHole(blockPos, true))<NEW_LINE>voidHoles.add(voidHolePool.get().set(blockPos.set(x, 127, z), true));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), z), false));
1,417,243
public boolean process(List<Point2D_F64> observations, List<Se3_F64> listWorldToView, Point4D_F64 worldPt, Point4D_F64 refinedPt) {<NEW_LINE>cameras.resize(listWorldToView.size());<NEW_LINE>for (int i = 0; i < cameras.size; i++) {<NEW_LINE>PerspectiveOps.convertToMatrix(listWorldToView.get(i), cameras.get(i));<NEW_LINE>}<NEW_LINE>func.setObservations(observations, cameras.toList());<NEW_LINE>minimizer.setFunction(func, null);<NEW_LINE>param[0] = worldPt.x;<NEW_LINE>param[1] = worldPt.y;<NEW_LINE>param[2] = worldPt.z;<NEW_LINE><MASK><NEW_LINE>minimizer.initialize(param, 0, convergenceTol * observations.size());<NEW_LINE>for (int i = 0; i < maxIterations; i++) {<NEW_LINE>if (minimizer.iterate())<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>double[] found = minimizer.getParameters();<NEW_LINE>refinedPt.x = found[0];<NEW_LINE>refinedPt.y = found[1];<NEW_LINE>refinedPt.z = found[2];<NEW_LINE>refinedPt.w = found[3];<NEW_LINE>return true;<NEW_LINE>}
param[3] = worldPt.w;
1,599,795
public static DescribeReservedInstancesResponse unmarshall(DescribeReservedInstancesResponse describeReservedInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeReservedInstancesResponse.setRequestId(_ctx.stringValue("DescribeReservedInstancesResponse.RequestId"));<NEW_LINE>describeReservedInstancesResponse.setPageSize<MASK><NEW_LINE>describeReservedInstancesResponse.setPageNumber(_ctx.integerValue("DescribeReservedInstancesResponse.PageNumber"));<NEW_LINE>describeReservedInstancesResponse.setTotalCount(_ctx.integerValue("DescribeReservedInstancesResponse.TotalCount"));<NEW_LINE>List<ReservedInstance> reservedInstances = new ArrayList<ReservedInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeReservedInstancesResponse.ReservedInstances.Length"); i++) {<NEW_LINE>ReservedInstance reservedInstance = new ReservedInstance();<NEW_LINE>reservedInstance.setStatus(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].Status"));<NEW_LINE>reservedInstance.setCreationTime(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].CreationTime"));<NEW_LINE>reservedInstance.setReservedInstanceName(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].ReservedInstanceName"));<NEW_LINE>reservedInstance.setReservedInstanceId(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].ReservedInstanceId"));<NEW_LINE>reservedInstance.setInstanceType(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].InstanceType"));<NEW_LINE>reservedInstance.setInstanceAmount(_ctx.integerValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].InstanceAmount"));<NEW_LINE>reservedInstance.setRegionId(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].RegionId"));<NEW_LINE>reservedInstance.setOfferingType(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].OfferingType"));<NEW_LINE>reservedInstance.setStartTime(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].StartTime"));<NEW_LINE>reservedInstance.setDescription(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].Description"));<NEW_LINE>reservedInstance.setAllocationStatus(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].AllocationStatus"));<NEW_LINE>reservedInstance.setExpiredTime(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].ExpiredTime"));<NEW_LINE>reservedInstance.setResourceGroupId(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].ResourceGroupId"));<NEW_LINE>reservedInstance.setZoneId(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].ZoneId"));<NEW_LINE>reservedInstance.setPlatform(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].Platform"));<NEW_LINE>reservedInstance.setScope(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].Scope"));<NEW_LINE>List<OperationLock> operationLocks = new ArrayList<OperationLock>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].OperationLocks.Length"); j++) {<NEW_LINE>OperationLock operationLock = new OperationLock();<NEW_LINE>operationLock.setLockReason(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].OperationLocks[" + j + "].LockReason"));<NEW_LINE>operationLocks.add(operationLock);<NEW_LINE>}<NEW_LINE>reservedInstance.setOperationLocks(operationLocks);<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setTagValue(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].Tags[" + j + "].TagValue"));<NEW_LINE>tag.setTagKey(_ctx.stringValue("DescribeReservedInstancesResponse.ReservedInstances[" + i + "].Tags[" + j + "].TagKey"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>reservedInstance.setTags(tags);<NEW_LINE>reservedInstances.add(reservedInstance);<NEW_LINE>}<NEW_LINE>describeReservedInstancesResponse.setReservedInstances(reservedInstances);<NEW_LINE>return describeReservedInstancesResponse;<NEW_LINE>}
(_ctx.integerValue("DescribeReservedInstancesResponse.PageSize"));
1,132,095
private static Map<String, List<CardInfo>> generateBasicLands(List<String> setsToUse) {<NEW_LINE>Set<String> landSets = TournamentUtil.getLandSetCodeForDeckSets(setsToUse);<NEW_LINE>CardCriteria criteria = new CardCriteria();<NEW_LINE>if (!landSets.isEmpty()) {<NEW_LINE>criteria.setCodes(landSets.toArray(new String[landSets.size()]));<NEW_LINE>}<NEW_LINE>criteria.ignoreSetsWithSnowLands();<NEW_LINE>Map<String, List<CardInfo>> basicLandMap = new HashMap<>();<NEW_LINE>for (ColoredManaSymbol c : ColoredManaSymbol.values()) {<NEW_LINE>String landName = DeckGeneratorPool.getBasicLandName(c.toString());<NEW_LINE>criteria.rarities(Rarity<MASK><NEW_LINE>List<CardInfo> cards = CardRepository.instance.findCards(criteria);<NEW_LINE>if (cards.isEmpty()) {<NEW_LINE>// Workaround to get basic lands if lands are not available for the given sets<NEW_LINE>criteria.setCodes("M15");<NEW_LINE>cards = CardRepository.instance.findCards(criteria);<NEW_LINE>}<NEW_LINE>basicLandMap.put(landName, cards);<NEW_LINE>}<NEW_LINE>return basicLandMap;<NEW_LINE>}
.LAND).name(landName);
1,638,367
static private void loadStackAnalyzedInfo(StackFileInfo stackFileInfo) {<NEW_LINE>File file = null;<NEW_LINE>StackAnalyzedInfo analyzedInfo = null;<NEW_LINE>try {<NEW_LINE>analyzedInfo = readStackAnalyzedInfo(stackFileInfo, file, StackParser.TOP_NAME, StackParser.TOP_EXT);<NEW_LINE>if (analyzedInfo != null)<NEW_LINE>stackFileInfo.addStackAnalyzedInfo(analyzedInfo);<NEW_LINE>analyzedInfo = readStackAnalyzedInfo(stackFileInfo, file, StackParser.SQL_NAME, StackParser.SQL_EXT);<NEW_LINE>if (analyzedInfo != null)<NEW_LINE>stackFileInfo.addStackAnalyzedInfo(analyzedInfo);<NEW_LINE>analyzedInfo = readStackAnalyzedInfo(stackFileInfo, file, StackParser.SERVICE_NAME, StackParser.SERVICE_EXT);<NEW_LINE>if (analyzedInfo != null)<NEW_LINE>stackFileInfo.addStackAnalyzedInfo(analyzedInfo);<NEW_LINE>analyzedInfo = readStackAnalyzedInfo(stackFileInfo, file, StackParser.LOG_NAME, StackParser.LOG_EXT);<NEW_LINE>if (analyzedInfo != null)<NEW_LINE>stackFileInfo.addStackAnalyzedInfo(analyzedInfo);<NEW_LINE>ArrayList<AnalyzerValue> list = stackFileInfo.getParserConfig().getAnalyzerList();<NEW_LINE>if (list != null) {<NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>analyzedInfo = readStackAnalyzedInfo(stackFileInfo, file, list.get(i).getName(), list.get(i).getExtension());<NEW_LINE>if (analyzedInfo != null)<NEW_LINE>stackFileInfo.addStackAnalyzedInfo(analyzedInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>analyzedInfo = readStackAnalyzedInfo(stackFileInfo, file, <MASK><NEW_LINE>readUniqueStackExtraInfo(analyzedInfo, stackFileInfo, file, StackParser.UNIQUE_NAME, StackParser.UNIQUE_EXT);<NEW_LINE>if (analyzedInfo != null)<NEW_LINE>stackFileInfo.addStackAnalyzedInfo(analyzedInfo);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>}
StackParser.UNIQUE_NAME, StackParser.UNIQUE_EXT);
845,558
private RemotingCommand queryCorrectionOffset(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException {<NEW_LINE>final RemotingCommand response = RemotingCommand.createResponseCommand(null);<NEW_LINE>QueryCorrectionOffsetHeader requestHeader = (QueryCorrectionOffsetHeader) request.decodeCommandCustomHeader(QueryCorrectionOffsetHeader.class);<NEW_LINE>Map<Integer, Long> correctionOffset = this.brokerController.getConsumerOffsetManager().queryMinOffsetInAllGroup(requestHeader.getTopic(), requestHeader.getFilterGroups());<NEW_LINE>Map<Integer, Long> compareOffset = this.brokerController.getConsumerOffsetManager().queryOffset(requestHeader.getTopic(), requestHeader.getCompareGroup());<NEW_LINE>if (compareOffset != null && !compareOffset.isEmpty()) {<NEW_LINE>for (Map.Entry<Integer, Long> entry : compareOffset.entrySet()) {<NEW_LINE><MASK><NEW_LINE>correctionOffset.put(queueId, correctionOffset.get(queueId) > entry.getValue() ? Long.MAX_VALUE : correctionOffset.get(queueId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>QueryCorrectionOffsetBody body = new QueryCorrectionOffsetBody();<NEW_LINE>body.setCorrectionOffsets(correctionOffset);<NEW_LINE>response.setBody(body.encode());<NEW_LINE>response.setCode(ResponseCode.SUCCESS);<NEW_LINE>response.setRemark(null);<NEW_LINE>return response;<NEW_LINE>}
Integer queueId = entry.getKey();
1,216,562
// -----------------------------------------------------<NEW_LINE>// Actually Crud<NEW_LINE>// -------------<NEW_LINE>@Execute<NEW_LINE>@Secured({ ROLE })<NEW_LINE>public HtmlResponse create(final CreateForm form) {<NEW_LINE>verifyCrudMode(form.crudMode, CrudMode.CREATE, form.dictId);<NEW_LINE>validate(form, messages -> {<NEW_LINE>}, this::asEditHtml);<NEW_LINE>verifyToken(this::asEditHtml);<NEW_LINE>createSynonymItem(form, this::asEditHtml).ifPresent(entity -> {<NEW_LINE>try {<NEW_LINE>synonymService.<MASK><NEW_LINE>saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)), this::asEditHtml);<NEW_LINE>}<NEW_LINE>}).orElse(() -> {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL), this::asEditHtml);<NEW_LINE>});<NEW_LINE>return redirectWith(getClass(), moreUrl("list/1").params("dictId", form.dictId));<NEW_LINE>}
store(form.dictId, entity);
68,357
private void drawBackground(MatrixStack matrixStack, int x2, int x3, int y1, int y2) {<NEW_LINE>float[] bgColor = GUI.getBgColor();<NEW_LINE><MASK><NEW_LINE>Matrix4f matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity);<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, x3, y1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x3, y2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x2, y2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, x2, y1, 0).next();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>}
float opacity = GUI.getOpacity();
1,344,595
private void singleLine(float x1, float y1, float x2, float y2, int color) {<NEW_LINE>float r = strokeWeight * 0.5f;<NEW_LINE>float dx = x2 - x1;<NEW_LINE>float dy = y2 - y1;<NEW_LINE>float d = PApplet.sqrt(dx * dx + dy * dy);<NEW_LINE>float tx = dy / d * r;<NEW_LINE>float ty = dx / d * r;<NEW_LINE>if (strokeCap == PROJECT) {<NEW_LINE>x1 -= ty;<NEW_LINE>x2 += ty;<NEW_LINE>y1 -= tx;<NEW_LINE>y2 += tx;<NEW_LINE>}<NEW_LINE>triangle(x1 - tx, y1 + ty, x1 + tx, y1 - ty, x2 - tx, y2 + ty, color);<NEW_LINE>triangle(x2 + tx, y2 - ty, x2 - tx, y2 + ty, x1 + tx, y1 - ty, color);<NEW_LINE>if (r >= LINE_DETAIL_LIMIT && strokeCap == ROUND) {<NEW_LINE>int segments = circleDetail(r, HALF_PI);<NEW_LINE>float step = HALF_PI / segments;<NEW_LINE>float <MASK><NEW_LINE>float s = PApplet.sin(step);<NEW_LINE>for (int i = 0; i < segments; ++i) {<NEW_LINE>// this is the equivalent of multiplying the vector <tx, ty> by the 2x2 rotation matrix [[c -s] [s c]]<NEW_LINE>float nx = c * tx - s * ty;<NEW_LINE>float ny = s * tx + c * ty;<NEW_LINE>triangle(x2, y2, x2 + ty, y2 + tx, x2 + ny, y2 + nx, color);<NEW_LINE>triangle(x2, y2, x2 - tx, y2 + ty, x2 - nx, y2 + ny, color);<NEW_LINE>triangle(x1, y1, x1 - ty, y1 - tx, x1 - ny, y1 - nx, color);<NEW_LINE>triangle(x1, y1, x1 + tx, y1 - ty, x1 + nx, y1 - ny, color);<NEW_LINE>tx = nx;<NEW_LINE>ty = ny;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
c = PApplet.cos(step);
616,121
public boolean onCreateOptionsMenu(Menu menu) {<NEW_LINE>MenuInflater inflater = getMenuInflater();<NEW_LINE>inflater.inflate(R.menu.search_activity, menu);<NEW_LINE>// Get the SearchView and set the searchable configuration<NEW_LINE>SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);<NEW_LINE>searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();<NEW_LINE>// Assumes current activity is the searchable activity<NEW_LINE>searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));<NEW_LINE>// Do not iconify the widget; expand it by default<NEW_LINE>searchView.setIconifiedByDefault(true);<NEW_LINE>int searchImgId = getResources().getIdentifier("android:id/search_button", null, null);<NEW_LINE>ImageView view = (<MASK><NEW_LINE>view.setImageResource(settings.theme == AppSettings.THEME_LIGHT ? R.drawable.ic_action_search_light : R.drawable.ic_action_search_dark);<NEW_LINE>return true;<NEW_LINE>}
ImageView) searchView.findViewById(searchImgId);
285,250
public Request<UntagServerCertificateRequest> marshall(UntagServerCertificateRequest untagServerCertificateRequest) {<NEW_LINE>if (untagServerCertificateRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<UntagServerCertificateRequest> request = new DefaultRequest<UntagServerCertificateRequest>(untagServerCertificateRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "UntagServerCertificate");<NEW_LINE><MASK><NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (untagServerCertificateRequest.getServerCertificateName() != null) {<NEW_LINE>request.addParameter("ServerCertificateName", StringUtils.fromString(untagServerCertificateRequest.getServerCertificateName()));<NEW_LINE>}<NEW_LINE>if (!untagServerCertificateRequest.getTagKeys().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) untagServerCertificateRequest.getTagKeys()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> tagKeysList = (com.amazonaws.internal.SdkInternalList<String>) untagServerCertificateRequest.getTagKeys();<NEW_LINE>int tagKeysListIndex = 1;<NEW_LINE>for (String tagKeysListValue : tagKeysList) {<NEW_LINE>if (tagKeysListValue != null) {<NEW_LINE>request.addParameter("TagKeys.member." + tagKeysListIndex, StringUtils.fromString(tagKeysListValue));<NEW_LINE>}<NEW_LINE>tagKeysListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Version", "2010-05-08");
452,038
public static KeyValuePart[] split(MatrixMeta matrixMeta, Vector vector) {<NEW_LINE>KeyHash hasher = HasherFactory.getHasher(matrixMeta.getRouterHash());<NEW_LINE>PartitionKey[] matrixParts = matrixMeta.getPartitionKeys();<NEW_LINE>KeyValuePart[] dataParts = new KeyValuePart[matrixParts.length];<NEW_LINE>int estSize = (int) (vector.getSize() / matrixMeta.getPartitionNum());<NEW_LINE>for (int i = 0; i < dataParts.length; i++) {<NEW_LINE>dataParts[i] = generateDataPart(vector.getRowId(), <MASK><NEW_LINE>}<NEW_LINE>switch(vector.getType()) {<NEW_LINE>case T_DOUBLE_DENSE:<NEW_LINE>case T_DOUBLE_SPARSE:<NEW_LINE>{<NEW_LINE>splitIntDoubleVector(hasher, matrixMeta, (IntDoubleVector) vector, dataParts);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case T_FLOAT_DENSE:<NEW_LINE>case T_FLOAT_SPARSE:<NEW_LINE>{<NEW_LINE>splitIntFloatVector(hasher, matrixMeta, (IntFloatVector) vector, dataParts);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case T_INT_DENSE:<NEW_LINE>case T_INT_SPARSE:<NEW_LINE>{<NEW_LINE>splitIntIntVector(hasher, matrixMeta, (IntIntVector) vector, dataParts);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case T_LONG_DENSE:<NEW_LINE>case T_LONG_SPARSE:<NEW_LINE>{<NEW_LINE>splitIntLongVector(hasher, matrixMeta, (IntLongVector) vector, dataParts);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case T_DOUBLE_SPARSE_LONGKEY:<NEW_LINE>{<NEW_LINE>splitLongDoubleVector(hasher, matrixMeta, (LongDoubleVector) vector, dataParts);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case T_FLOAT_SPARSE_LONGKEY:<NEW_LINE>{<NEW_LINE>splitLongFloatVector(hasher, matrixMeta, (LongFloatVector) vector, dataParts);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case T_INT_SPARSE_LONGKEY:<NEW_LINE>{<NEW_LINE>splitLongIntVector(hasher, matrixMeta, (LongIntVector) vector, dataParts);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case T_LONG_SPARSE_LONGKEY:<NEW_LINE>{<NEW_LINE>splitLongLongVector(hasher, matrixMeta, (LongLongVector) vector, dataParts);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new UnsupportedOperationException("Unsupport vector type " + vector.getType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < dataParts.length; i++) {<NEW_LINE>if (dataParts[i] != null) {<NEW_LINE>dataParts[i].setRowId(vector.getRowId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dataParts;<NEW_LINE>}
vector.getType(), estSize);
1,711,219
public static String prettyPrint2D(Edit[][] m) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>int rows = m.length;<NEW_LINE>int columns = m[0].length;<NEW_LINE>// ins(1,2,3,4) --> size is 12<NEW_LINE>int size = 12 + 4;<NEW_LINE>for (int i = 0; i < size / 2; i++) sb.append(" ");<NEW_LINE>String spaces = sb.toString();<NEW_LINE>sb = new StringBuilder();<NEW_LINE>for (int i = 0; i < size / 2; i++) sb.append("_");<NEW_LINE>String underscores = sb.toString();<NEW_LINE>sb = new StringBuilder();<NEW_LINE>sb.append(" |");<NEW_LINE>for (int i = 0; i < columns; i++) {<NEW_LINE>sb.<MASK><NEW_LINE>}<NEW_LINE>sb.append("\n____");<NEW_LINE>for (int i = 0; i < columns; i++) {<NEW_LINE>sb.append(underscores + underscores + "_");<NEW_LINE>}<NEW_LINE>sb.append("\n");<NEW_LINE>for (int i = 0; i < rows; i++) {<NEW_LINE>sb.append(" " + i + " |");<NEW_LINE>for (int j = 0; j < columns; j++) {<NEW_LINE>sb.append(String.format("%16s", m[i][j] == null ? "" : m[i][j].toString()));<NEW_LINE>}<NEW_LINE>sb.append("\n");<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
append(spaces + i + spaces);
312,223
public static org.osmdroid.views.overlay.Polygon addPolygonToMap(MapView map, List<GeoPoint> pts, List<List<GeoPoint>> holes, PolygonOptions options) {<NEW_LINE>org.osmdroid.views.overlay.Polygon polygon1 = new org.osmdroid.views.overlay.Polygon(map);<NEW_LINE>polygon1.setPoints(pts);<NEW_LINE>polygon1.<MASK><NEW_LINE>if (options != null) {<NEW_LINE>polygon1.getFillPaint().setColor(options.getFillColor());<NEW_LINE>polygon1.setTitle(options.getTitle());<NEW_LINE>polygon1.getOutlinePaint().setColor(options.getStrokeColor());<NEW_LINE>polygon1.getOutlinePaint().setStrokeWidth(options.getStrokeWidth());<NEW_LINE>polygon1.setSubDescription(options.getSubtitle());<NEW_LINE>polygon1.setInfoWindow(new BasicInfoWindow(R.layout.bonuspack_bubble, map));<NEW_LINE>}<NEW_LINE>map.getOverlayManager().add(polygon1);<NEW_LINE>return polygon1;<NEW_LINE>}
getHoles().addAll(holes);
501,812
final GetWorkingLocationResult executeGetWorkingLocation(GetWorkingLocationRequest getWorkingLocationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getWorkingLocationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetWorkingLocationRequest> request = null;<NEW_LINE>Response<GetWorkingLocationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetWorkingLocationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getWorkingLocationRequest));<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, "finspace data");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetWorkingLocation");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetWorkingLocationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetWorkingLocationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,122,077
public void run() {<NEW_LINE>Preferences p = NbPreferences.forModule(InstallLibraryTask.class);<NEW_LINE>if (p.getBoolean(KEY, false)) {<NEW_LINE>// Only check once (i.e. on first start for a fresh user dir).<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>p.putBoolean(KEY, true);<NEW_LINE>// find licenseAcceptedFile<NEW_LINE>// NOI18N<NEW_LINE>File licenseAcceptedFile = InstalledFileLocator.getDefault().locate("var/license_accepted", null, false);<NEW_LINE>if (licenseAcceptedFile == null) {<NEW_LINE>LOG.info("$userdir/var/license_accepted not found => skipping install JUnit.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// read content of file<NEW_LINE>String content = FileUtil.<MASK><NEW_LINE>LOG.fine("Content of $userdir/var/license_accepted: " + content);<NEW_LINE>if (content != null && content.indexOf(JUNIT_APPROVED) != -1) {<NEW_LINE>// IDE license accepted, JUnit accpeted => let's install silently<NEW_LINE>LOG.fine(" IDE license accepted, JUnit accepted => let's install silently");<NEW_LINE>JUnitLibraryInstaller.install(true);<NEW_LINE>} else if (content != null && content.indexOf(JUNIT_DENIED) != -1) {<NEW_LINE>// IDE license accepted but JUnit disapproved => do nothing<NEW_LINE>LOG.fine("IDE license accepted but JUnit disapproved => do nothing");<NEW_LINE>} else {<NEW_LINE>// IDE license accepted, JUnit N/A => use prompt & wizard way<NEW_LINE>LOG.fine("IDE license accepted, JUnit N/A => use prompt & wizard way");<NEW_LINE>RP.post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>JUnitLibraryInstaller.install(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOG.log(Level.INFO, "while reading " + licenseAcceptedFile, ex);<NEW_LINE>}<NEW_LINE>}
toFileObject(licenseAcceptedFile).asText();
484,513
public static void createAndRegister() {<NEW_LINE>SubstrateTargetDescription target = ConfigurationValues.getTarget();<NEW_LINE>SubstrateRegisterConfig registerConfig = new SubstrateAArch64RegisterConfig(SubstrateRegisterConfig.ConfigKind.NORMAL, null, target, SubstrateOptions.PreserveFramePointer.getValue());<NEW_LINE>Register frameRegister = registerConfig.getFrameRegister();<NEW_LINE>List<Register> calleeSavedRegisters = new ArrayList<>(registerConfig.getAllocatableRegisters().asList());<NEW_LINE>calleeSavedRegisters.remove(AArch64.lr);<NEW_LINE>Collections.reverse(calleeSavedRegisters);<NEW_LINE>int offset = 0;<NEW_LINE>Map<Register, Integer> <MASK><NEW_LINE>for (Register register : calleeSavedRegisters) {<NEW_LINE>int regByteSize = register.getRegisterCategory().equals(CPU) ? 8 : 16;<NEW_LINE>offset += offset % regByteSize;<NEW_LINE>calleeSavedRegisterOffsets.put(register, offset);<NEW_LINE>offset += regByteSize;<NEW_LINE>}<NEW_LINE>int calleeSavedRegistersSizeInBytes = offset;<NEW_LINE>int saveAreaOffsetInFrame = -(// slot is always reserved for frame pointer<NEW_LINE>FrameAccess.returnAddressSize() + FrameAccess.wordSize() + calleeSavedRegistersSizeInBytes);<NEW_LINE>ImageSingletons.add(CalleeSavedRegisters.class, new AArch64CalleeSavedRegisters(frameRegister, calleeSavedRegisters, calleeSavedRegisterOffsets, calleeSavedRegistersSizeInBytes, saveAreaOffsetInFrame));<NEW_LINE>}
calleeSavedRegisterOffsets = new HashMap<>();
134,552
private Person parsePerson(final String baseURI, final Element ePerson, final Locale locale) {<NEW_LINE>final Person person = new Person();<NEW_LINE>final Element name = ePerson.getChild("name", getAtomNamespace());<NEW_LINE>if (name != null) {<NEW_LINE>person.setName(name.getText());<NEW_LINE>}<NEW_LINE>final Element uri = ePerson.getChild("uri", getAtomNamespace());<NEW_LINE>if (uri != null) {<NEW_LINE>person.setUri(uri.getText());<NEW_LINE>if (isRelativeURI(uri.getText())) {<NEW_LINE>person.setUriResolved(resolveURI(baseURI, ePerson, uri.getText()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Element email = ePerson.<MASK><NEW_LINE>if (email != null) {<NEW_LINE>person.setEmail(email.getText());<NEW_LINE>}<NEW_LINE>person.setModules(parsePersonModules(ePerson, locale));<NEW_LINE>return person;<NEW_LINE>}
getChild("email", getAtomNamespace());
1,062,338
public static String diagramToXml(Diagram diagram) {<NEW_LINE>Document doc = XMLParser.createDocument();<NEW_LINE>Element diagramElement = doc.createElement(DIAGRAM);<NEW_LINE>diagramElement.setAttribute(ATTR_PROGRAM, "umletino");<NEW_LINE>diagramElement.setAttribute(ATTR_VERSION, BuildInfoProperties.getVersion());<NEW_LINE>diagramElement.appendChild(create(doc, ZOOM_LEVEL, doc.createTextNode(String.valueOf(diagram<MASK><NEW_LINE>String helpText = diagram.getPanelAttributes();<NEW_LINE>if (helpText != null) {<NEW_LINE>diagramElement.appendChild(create(doc, HELP_TEXT, doc.createTextNode(helpText)));<NEW_LINE>}<NEW_LINE>doc.appendChild(diagramElement);<NEW_LINE>for (GridElement ge : diagram.getGridElements()) {<NEW_LINE>diagramElement.appendChild(create(doc, ELEMENT, create(doc, ID, doc.createTextNode(ge.getId().toString())), create(doc, COORDINATES, create(doc, X, doc.createTextNode(ge.getRectangle().getX() + "")), create(doc, Y, doc.createTextNode(ge.getRectangle().getY() + "")), create(doc, W, doc.createTextNode(ge.getRectangle().getWidth() + "")), create(doc, H, doc.createTextNode(ge.getRectangle().getHeight() + ""))), create(doc, PANEL_ATTRIBUTES, doc.createTextNode(ge.getPanelAttributes())), create(doc, ADDITIONAL_ATTRIBUTES, doc.createTextNode(ge.getAdditionalAttributes()))));<NEW_LINE>}<NEW_LINE>String xml = doc.toString();<NEW_LINE>log.debug("Deserializing to " + xml);<NEW_LINE>return xml;<NEW_LINE>}
.getZoomLevel()))));
5,723
private void updateColumnItem(TableItem attrItem) {<NEW_LINE>DBDAttributeBinding attr = (DBDAttributeBinding) attrItem.getData();<NEW_LINE>String transformStr = "";<NEW_LINE>DBVEntityAttribute vAttr = vEntity.getVirtualAttribute(attr, false);<NEW_LINE>if (vAttr != null) {<NEW_LINE>DBVTransformSettings transformSettings = vAttr.getTransformSettings();<NEW_LINE>if (transformSettings != null) {<NEW_LINE>if (!CommonUtils.isEmpty(transformSettings.getIncludedTransformers())) {<NEW_LINE>transformStr = String.join(",", transformSettings.getIncludedTransformers());<NEW_LINE>} else if (!CommonUtils.isEmpty(transformSettings.getCustomTransformer())) {<NEW_LINE>DBDAttributeTransformerDescriptor td = DBWorkbench.getPlatform().getValueHandlerRegistry().getTransformer(transformSettings.getCustomTransformer());<NEW_LINE>if (td != null) {<NEW_LINE>transformStr = td.getName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>String colorSettings = "";<NEW_LINE>{<NEW_LINE>java.util.List<DBVColorOverride> coList = vEntity.getColorOverrides(attr.getName());<NEW_LINE>if (!coList.isEmpty()) {<NEW_LINE>java.util.List<String> coStrings = new ArrayList<>();<NEW_LINE>for (DBVColorOverride co : coList) {<NEW_LINE>if (co.getAttributeValues() != null) {<NEW_LINE>for (Object value : co.getAttributeValues()) {<NEW_LINE>coStrings.add(CommonUtils.toString(value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>colorSettings = String.join(",", coStrings);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>attrItem.setText(2, colorSettings);<NEW_LINE>}
attrItem.setText(1, transformStr);
1,056,641
private Map<String, AccessElements> findMatchingResult(Map<String, ExecutableElement> setters, Map<String, ExecutableElement> getters, Map<String, VariableElement> arguments, Map<String, AccessElements> fieldDetails) {<NEW_LINE>Map<String, AccessElements> result = new HashMap<String, AccessElements>();<NEW_LINE>for (Map.Entry<String, ExecutableElement> kv : getters.entrySet()) {<NEW_LINE>ExecutableElement setter = setters.get(kv.getKey());<NEW_LINE>VariableElement setterArgument = setter == null ? null : setter.getParameters().get(0);<NEW_LINE>VariableElement arg = arguments.get(kv.getKey());<NEW_LINE>String returnType = typeWithoutAnnotations(kv.getValue().getReturnType().toString());<NEW_LINE>String setterType = setterArgument != null ? typeWithoutAnnotations(setterArgument.asType().toString()) : null;<NEW_LINE>AnnotationMirror actualAnnotation = annotation(kv.getValue(), setter, null, arg);<NEW_LINE>AccessElements field = fieldDetails.get(kv.getKey());<NEW_LINE>AnnotationMirror annotation = actualAnnotation != null ? actualAnnotation : field <MASK><NEW_LINE>if (setterType != null && setterType.equals(returnType)) {<NEW_LINE>result.put(kv.getKey(), AccessElements.readWrite(kv.getValue(), setter, annotation));<NEW_LINE>} else if (setterType != null && (setterType + "<").startsWith(returnType)) {<NEW_LINE>result.put(kv.getKey(), AccessElements.readWrite(kv.getValue(), setter, annotation));<NEW_LINE>} else if (!onlyBasicFeatures && arg != null && isCompatibileType(arg.asType(), kv.getValue().getReturnType())) {<NEW_LINE>result.put(kv.getKey(), AccessElements.readOnly(kv.getValue(), arg, annotation));<NEW_LINE>} else if (arg == null && setterArgument == null && isAppendableCollection(kv.getValue())) {<NEW_LINE>boolean hasMarker = annotation != null || hasCustomMarker(kv.getValue()) || field != null && field.field != null && hasCustomMarker(field.field);<NEW_LINE>if (!hasMarker)<NEW_LINE>continue;<NEW_LINE>if (hasNonNullable(kv.getValue(), field != null ? field.field : null, annotation)) {<NEW_LINE>result.put(kv.getKey(), AccessElements.collection(kv.getValue(), annotation));<NEW_LINE>} else {<NEW_LINE>messager.printMessage(Diagnostic.Kind.WARNING, attributeType + " detected on collection property, but non-nullable marker is missing. Property will be ignored.", kv.getValue(), annotation);<NEW_LINE>}<NEW_LINE>} else if (!onlyBasicFeatures && arg == null && field != null && setterType != null && field.field != null && setterType.equals(typeWithoutAnnotations(field.field.asType().toString())) && isCompatibileType(setterArgument.asType(), kv.getValue().getReturnType())) {<NEW_LINE>result.put(kv.getKey(), AccessElements.readWrite(kv.getValue(), setter, annotation));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
!= null ? field.annotation : null;
218,525
public static byte[] decode(CharSequence in) {<NEW_LINE>int inLength = in.length();<NEW_LINE>int nGroups = inLength / 4;<NEW_LINE>if (inLength != 4 * nGroups) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int missingBytesInLastGroup = 0;<NEW_LINE>int nFullGroups = nGroups;<NEW_LINE>if (inLength != 0) {<NEW_LINE>if (in.charAt(inLength - 1) == '=') {<NEW_LINE>missingBytesInLastGroup++;<NEW_LINE>nFullGroups--;<NEW_LINE>}<NEW_LINE>if (in.charAt(inLength - 2) == '=') {<NEW_LINE>missingBytesInLastGroup++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte[] result = new byte[3 * nGroups - missingBytesInLastGroup];<NEW_LINE>int inIndex = 0;<NEW_LINE>int outIndex = 0;<NEW_LINE>for (int i = 0; i < nFullGroups; i++) {<NEW_LINE>int ch0 = s_decodeTable[in.charAt(inIndex++)];<NEW_LINE>int ch1 = s_decodeTable[<MASK><NEW_LINE>int ch2 = s_decodeTable[in.charAt(inIndex++)];<NEW_LINE>int ch3 = s_decodeTable[in.charAt(inIndex++)];<NEW_LINE>if (ch0 < 0 || ch1 < 0 || ch2 < 0 || ch3 < 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>result[outIndex++] = (byte) ((ch0 << 2) | (ch1 >> 4));<NEW_LINE>result[outIndex++] = (byte) ((ch1 << 4) | (ch2 >> 2));<NEW_LINE>result[outIndex++] = (byte) ((ch2 << 6) | ch3);<NEW_LINE>}<NEW_LINE>if (missingBytesInLastGroup != 0) {<NEW_LINE>int ch0 = s_decodeTable[in.charAt(inIndex++)];<NEW_LINE>int ch1 = s_decodeTable[in.charAt(inIndex++)];<NEW_LINE>if (ch0 < 0 || ch1 < 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>result[outIndex++] = (byte) ((ch0 << 2) | (ch1 >> 4));<NEW_LINE>if (missingBytesInLastGroup == 1) {<NEW_LINE>int ch2 = s_decodeTable[in.charAt(inIndex++)];<NEW_LINE>if (ch2 < 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>result[outIndex++] = (byte) ((ch1 << 4) | (ch2 >> 2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
in.charAt(inIndex++)];
877,415
public GetTargetResourceTypeResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetTargetResourceTypeResult getTargetResourceTypeResult = new GetTargetResourceTypeResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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 getTargetResourceTypeResult;<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("targetResourceType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getTargetResourceTypeResult.setTargetResourceType(TargetResourceTypeJsonUnmarshaller.getInstance().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 getTargetResourceTypeResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,646,697
public RegexMatchTuple unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RegexMatchTuple regexMatchTuple = new RegexMatchTuple();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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("FieldToMatch", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>regexMatchTuple.setFieldToMatch(FieldToMatchJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TextTransformation", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>regexMatchTuple.setTextTransformation(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RegexPatternSetId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>regexMatchTuple.setRegexPatternSetId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return regexMatchTuple;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
827,997
public static void load() throws FileNotFoundException, IOException, NumberFormatException {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.<MASK><NEW_LINE>if (properties.containsKey("KALDI_HOST"))<NEW_LINE>KALDI_HOST = properties.getProperty("KALDI_HOST");<NEW_LINE>if (properties.containsKey("KALDI_PORT"))<NEW_LINE>KALDI_PORT = Integer.parseInt(properties.getProperty("KALDI_PORT"));<NEW_LINE>if (properties.containsKey("KALDI_ENCODING"))<NEW_LINE>KALDI_ENCODING = properties.getProperty("KALDI_ENCODING");<NEW_LINE>if (properties.containsKey("AUDIO_PACKET_SIZE"))<NEW_LINE>AUDIO_PACKET_SIZE = Integer.parseInt(properties.getProperty("AUDIO_PACKET_SIZE"));<NEW_LINE>if (properties.containsKey("MLF_FILENAME"))<NEW_LINE>MLF_FILENAME = properties.getProperty("MLF_FILENAME");<NEW_LINE>if (properties.containsKey("SUBTITLES_CHARS_PER_CUE"))<NEW_LINE>SUBTITLES_CHARS_PER_CUE = Integer.parseInt(properties.getProperty("SUBTITLES_CHARS_PER_CUE"));<NEW_LINE>if (properties.containsKey("SUBTITLES_TIME_DIFF"))<NEW_LINE>SUBTITLES_TIME_DIFF = Float.parseFloat(properties.getProperty("SUBTITLES_TIME_DIFF"));<NEW_LINE>if (properties.containsKey("SUBTITLES_KEEP_ALIVE"))<NEW_LINE>SUBTITLES_KEEP_ALIVE = Float.parseFloat(properties.getProperty("SUBTITLES_KEEP_ALIVE"));<NEW_LINE>if (properties.containsKey("SUBTITLES_WORD_BY_WORD")) {<NEW_LINE>if (properties.getProperty("SUBTITLES_WORD_BY_WORD").equals("TRUE"))<NEW_LINE>SUBTITLES_WORD_BY_WORD = true;<NEW_LINE>else<NEW_LINE>SUBTITLES_WORD_BY_WORD = false;<NEW_LINE>}<NEW_LINE>}
loadFromXML(new FileInputStream(PROPERTY_FILE));
1,707,867
final MoveAddressToVpcResult executeMoveAddressToVpc(MoveAddressToVpcRequest moveAddressToVpcRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(moveAddressToVpcRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<MoveAddressToVpcRequest> request = null;<NEW_LINE>Response<MoveAddressToVpcResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new MoveAddressToVpcRequestMarshaller().marshall(super.beforeMarshalling(moveAddressToVpcRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "MoveAddressToVpc");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<MoveAddressToVpcResult> responseHandler = new StaxResponseHandler<MoveAddressToVpcResult>(new MoveAddressToVpcResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
613,081
void finishCleanup() {<NEW_LINE>ExecutorService localCleanupService;<NEW_LINE>synchronized (this) {<NEW_LINE>if (isActive(Thread.currentThread())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>localCleanupService = cleanupExecutorService;<NEW_LINE>}<NEW_LINE>if (localCleanupService != null) {<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>cleanupFuture.get();<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>engine.getEngineLogger().log(<MASK><NEW_LINE>} catch (ExecutionException ee) {<NEW_LINE>assert !(ee.getCause() instanceof AbstractTruffleException);<NEW_LINE>throw sneakyThrow(ee.getCause());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>localCleanupService.shutdownNow();<NEW_LINE>while (!localCleanupService.isTerminated()) {<NEW_LINE>try {<NEW_LINE>if (!localCleanupService.awaitTermination(1, TimeUnit.MINUTES)) {<NEW_LINE>throw new IllegalStateException("Context cleanup service timeout!");<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>engine.getEngineLogger().log(Level.INFO, "Waiting for polyglot context cleanup was interrupted!", ie);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Level.INFO, "Waiting for polyglot context cleanup was interrupted!", ie);
672,112
private void drawShadow(Canvas canvas, View child) {<NEW_LINE>int <MASK><NEW_LINE>if ((movingEdge & EDGE_LEFT) != 0) {<NEW_LINE>mShadowLeft.setBounds(child.getLeft() - mShadowLeft.getIntrinsicWidth(), child.getTop(), child.getLeft(), child.getBottom());<NEW_LINE>mShadowLeft.setAlpha((int) (mScrimOpacity * FULL_ALPHA));<NEW_LINE>mShadowLeft.draw(canvas);<NEW_LINE>} else if ((movingEdge & EDGE_RIGHT) != 0) {<NEW_LINE>mShadowRight.setBounds(child.getRight(), child.getTop(), child.getRight() + mShadowRight.getIntrinsicWidth(), child.getBottom());<NEW_LINE>mShadowRight.setAlpha((int) (mScrimOpacity * FULL_ALPHA));<NEW_LINE>mShadowRight.draw(canvas);<NEW_LINE>} else if ((movingEdge & EDGE_BOTTOM) != 0) {<NEW_LINE>mShadowBottom.setBounds(child.getLeft(), child.getBottom(), child.getRight(), child.getBottom() + mShadowBottom.getIntrinsicHeight());<NEW_LINE>mShadowBottom.setAlpha((int) (mScrimOpacity * FULL_ALPHA));<NEW_LINE>mShadowBottom.draw(canvas);<NEW_LINE>} else if ((movingEdge & EDGE_TOP) != 0) {<NEW_LINE>mShadowTop.setBounds(child.getLeft(), child.getTop() - mShadowTop.getIntrinsicHeight(), child.getRight(), child.getTop());<NEW_LINE>mShadowTop.setAlpha((int) (mScrimOpacity * FULL_ALPHA));<NEW_LINE>mShadowTop.draw(canvas);<NEW_LINE>}<NEW_LINE>}
movingEdge = mViewMoveAction.getEdge(mCurrentDragDirection);
1,067,872
private ImmutableList<BakedQuad> buildQuads(IModelData data) {<NEW_LINE>List<BakedQuad<MASK><NEW_LINE>ItemStack shader = ItemStack.EMPTY;<NEW_LINE>ShaderCase sCase = null;<NEW_LINE>IOBJModelCallback callback = null;<NEW_LINE>Object callbackObject = null;<NEW_LINE>LazyOptional<ShaderWrapper> shaderOpt = tempStack.getCapability(CapabilityShader.SHADER_CAPABILITY);<NEW_LINE>if (shaderOpt.isPresent()) {<NEW_LINE>ShaderWrapper wrapper = shaderOpt.orElseThrow(NullPointerException::new);<NEW_LINE>shader = wrapper.getShaderItem();<NEW_LINE>if (!shader.isEmpty() && shader.getItem() instanceof IShaderItem)<NEW_LINE>sCase = ((IShaderItem) shader.getItem()).getShaderCase(shader, tempStack, wrapper.getShaderType());<NEW_LINE>} else if (data.hasProperty(CapabilityShader.MODEL_PROPERTY)) {<NEW_LINE>ShaderWrapper wrapper = data.getData(CapabilityShader.MODEL_PROPERTY);<NEW_LINE>if (wrapper != null) {<NEW_LINE>shader = wrapper.getShaderItem();<NEW_LINE>if (!shader.isEmpty() && shader.getItem() instanceof IShaderItem)<NEW_LINE>sCase = ((IShaderItem) shader.getItem()).getShaderCase(shader, null, wrapper.getShaderType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!this.tempStack.isEmpty() && tempStack.getItem() instanceof IOBJModelCallback) {<NEW_LINE>callback = (IOBJModelCallback) tempStack.getItem();<NEW_LINE>callbackObject = this.tempStack;<NEW_LINE>} else if (data.hasProperty(IOBJModelCallback.PROPERTY)) {<NEW_LINE>callback = data.getData(IOBJModelCallback.PROPERTY);<NEW_LINE>callbackObject = this.tempState;<NEW_LINE>}<NEW_LINE>for (String groupName : OBJHelper.getGroups(baseModel).keySet()) {<NEW_LINE>List<ShadedQuads> temp = addQuadsForGroup(callback, callbackObject, groupName, sCase, true);<NEW_LINE>quads.addAll(temp.stream().map(s -> s.quadsInLayer).flatMap(List::stream).filter(Objects::nonNull).collect(Collectors.toList()));<NEW_LINE>}<NEW_LINE>if (callback != null)<NEW_LINE>quads = callback.modifyQuads(callbackObject, quads);<NEW_LINE>return ImmutableList.copyOf(quads);<NEW_LINE>}
> quads = Lists.newArrayList();
420,014
public static void applySortOrder(final Set<String> view, final String orderString) {<NEW_LINE>final List<String> <MASK><NEW_LINE>if ("alphabetic".equals(orderString)) {<NEW_LINE>// copy elements to list for sorting<NEW_LINE>list.addAll(view);<NEW_LINE>// sort alphabetically<NEW_LINE>Collections.sort(list);<NEW_LINE>} else {<NEW_LINE>// sort according to comma-separated list of property names<NEW_LINE>final String[] order = orderString.split("[, ]+");<NEW_LINE>for (final String property : order) {<NEW_LINE>if (StringUtils.isNotEmpty(property.trim())) {<NEW_LINE>// SchemaProperty instances are suffixed with "Property"<NEW_LINE>final String suffixedProperty = property + "Property";<NEW_LINE>if (view.contains(property)) {<NEW_LINE>// move property from view to list<NEW_LINE>list.add(property);<NEW_LINE>view.remove(property);<NEW_LINE>} else if (view.contains(suffixedProperty)) {<NEW_LINE>// move property from view to list<NEW_LINE>list.add(suffixedProperty);<NEW_LINE>view.remove(suffixedProperty);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// append the rest<NEW_LINE>list.addAll(view);<NEW_LINE>}<NEW_LINE>// clear source view, add sorted list contents<NEW_LINE>view.clear();<NEW_LINE>view.addAll(list);<NEW_LINE>}
list = new LinkedList<>();
729,892
public ItemStack assemble(CraftingContainer inv) {<NEW_LINE>int[] colourArray = new int[3];<NEW_LINE>int j = 0;<NEW_LINE>int totalColourSets = 0;<NEW_LINE>ItemStack bullet = ItemStack.EMPTY;<NEW_LINE>for (int i = 0; i < inv.getContainerSize(); i++) {<NEW_LINE>ItemStack stackInSlot = inv.getItem(i);<NEW_LINE>if (!stackInSlot.isEmpty())<NEW_LINE>if (bullet.isEmpty() && isFlareBullet(stackInSlot)) {<NEW_LINE>bullet = stackInSlot;<NEW_LINE>int colour = ((IColouredItem) bullet.getItem()).getColourForIEItem(bullet, 1);<NEW_LINE>float r = (float) (colour >> 16 & 255) / 255.0F;<NEW_LINE>float g = (float) (colour >> 8 & 255) / 255.0F;<NEW_LINE>float b = (float) (colour & 255) / 255.0F;<NEW_LINE>j = (int) ((float) j + Math.max(r, Math.max(g, b)) * 255.0F);<NEW_LINE>colourArray[0] = (int) ((float) colourArray[0] + r * 255.0F);<NEW_LINE>colourArray[1] = (int) ((float) colourArray[1] + g * 255.0F);<NEW_LINE>colourArray[2] = (int) ((float) colourArray[2] + b * 255.0F);<NEW_LINE>++totalColourSets;<NEW_LINE>} else if (Utils.isDye(stackInSlot)) {<NEW_LINE>float[] afloat = Utils.getDye(stackInSlot).getTextureDiffuseColors();<NEW_LINE>int r = (int) (afloat[0] * 255.0F);<NEW_LINE>int g = (int) (afloat[1] * 255.0F);<NEW_LINE>int b = (int) (afloat[2] * 255.0F);<NEW_LINE>j += Math.max(r, Math<MASK><NEW_LINE>colourArray[0] += r;<NEW_LINE>colourArray[1] += g;<NEW_LINE>colourArray[2] += b;<NEW_LINE>++totalColourSets;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!bullet.isEmpty()) {<NEW_LINE>ItemStack newBullet = ItemHandlerHelper.copyStackWithSize(bullet, 1);<NEW_LINE>int r = colourArray[0] / totalColourSets;<NEW_LINE>int g = colourArray[1] / totalColourSets;<NEW_LINE>int b = colourArray[2] / totalColourSets;<NEW_LINE>float colourMod = (float) j / (float) totalColourSets;<NEW_LINE>float highestColour = (float) Math.max(r, Math.max(g, b));<NEW_LINE>r = (int) ((float) r * colourMod / highestColour);<NEW_LINE>g = (int) ((float) g * colourMod / highestColour);<NEW_LINE>b = (int) ((float) b * colourMod / highestColour);<NEW_LINE>int newColour = (r << 8) + g;<NEW_LINE>newColour = (newColour << 8) + b;<NEW_LINE>ItemNBTHelper.putInt(newBullet, "flareColour", newColour);<NEW_LINE>return newBullet;<NEW_LINE>}<NEW_LINE>return ItemStack.EMPTY;<NEW_LINE>}
.max(g, b));
245,250
private boolean maybeWriteResponseMetadata(HttpResponse responseMetadata, GenericFutureListener<ChannelFuture> listener) {<NEW_LINE>long writeProcessingStartTime = System.currentTimeMillis();<NEW_LINE>boolean writtenThisTime = false;<NEW_LINE>if (ctx.channel().isActive() && responseMetadataWriteInitiated.compareAndSet(false, true)) {<NEW_LINE>// we do some manipulation here for chunking. According to the HTTP spec, we can have either a Content-Length<NEW_LINE>// or Transfer-Encoding:chunked, never both. So we check for Content-Length - if it is not there, we add<NEW_LINE>// Transfer-Encoding:chunked on 200 response. Note that sending HttpContent chunks data anyway - we are just<NEW_LINE>// explicitly specifying this in the header.<NEW_LINE>if (!HttpUtil.isContentLengthSet(responseMetadata) && (responseMetadata.status().equals(HttpResponseStatus.OK) || responseMetadata.status().equals(HttpResponseStatus.PARTIAL_CONTENT))) {<NEW_LINE>// This makes sure that we don't stomp on any existing transfer-encoding.<NEW_LINE>HttpUtil.setTransferEncodingChunked(responseMetadata, true);<NEW_LINE>} else if (HttpUtil.isContentLengthSet(responseMetadata) && HttpUtil.getContentLength(responseMetadata) == 0 && !(responseMetadata instanceof FullHttpResponse)) {<NEW_LINE>// if the Content-Length is 0, we can send a FullHttpResponse since there is no content expected.<NEW_LINE>FullHttpResponse fullHttpResponse = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, responseMetadata.status());<NEW_LINE>fullHttpResponse.headers().set(responseMetadata.headers());<NEW_LINE>responseMetadata = fullHttpResponse;<NEW_LINE>}<NEW_LINE>logger.trace("Sending response with status {} on channel {}", responseMetadata.status(), ctx.channel());<NEW_LINE>finalResponseMetadata = responseMetadata;<NEW_LINE>ChannelPromise writePromise = ctx.newPromise().addListener(listener);<NEW_LINE>ctx.writeAndFlush(responseMetadata, writePromise);<NEW_LINE>writtenThisTime = true;<NEW_LINE>long writeProcessingTime <MASK><NEW_LINE>nettyMetrics.responseMetadataProcessingTimeInMs.update(writeProcessingTime);<NEW_LINE>if (request != null) {<NEW_LINE>request.getMetricsTracker().nioMetricsTracker.markFirstByteSent();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return writtenThisTime;<NEW_LINE>}
= System.currentTimeMillis() - writeProcessingStartTime;
1,661,560
public static CreateDataModelResponse unmarshall(CreateDataModelResponse createDataModelResponse, UnmarshallerContext _ctx) {<NEW_LINE>createDataModelResponse.setRequestId(_ctx.stringValue("CreateDataModelResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCreateTime(_ctx.stringValue("CreateDataModelResponse.Data.CreateTime"));<NEW_LINE>data.setModelType(_ctx.stringValue("CreateDataModelResponse.Data.ModelType"));<NEW_LINE>data.setSubType(_ctx.stringValue("CreateDataModelResponse.Data.SubType"));<NEW_LINE>data.setRevision(_ctx.integerValue("CreateDataModelResponse.Data.Revision"));<NEW_LINE>data.setModifiedTime(_ctx.stringValue("CreateDataModelResponse.Data.ModifiedTime"));<NEW_LINE>data.setDescription(_ctx.stringValue("CreateDataModelResponse.Data.Description"));<NEW_LINE>data.setSchemaVersion(_ctx.stringValue("CreateDataModelResponse.Data.SchemaVersion"));<NEW_LINE>data.setAppId(_ctx.stringValue("CreateDataModelResponse.Data.AppId"));<NEW_LINE>data.setProps<MASK><NEW_LINE>data.setModelStatus(_ctx.stringValue("CreateDataModelResponse.Data.ModelStatus"));<NEW_LINE>data.setModelName(_ctx.stringValue("CreateDataModelResponse.Data.ModelName"));<NEW_LINE>data.setContent(_ctx.mapValue("CreateDataModelResponse.Data.Content"));<NEW_LINE>data.setId(_ctx.stringValue("CreateDataModelResponse.Data.Id"));<NEW_LINE>data.setModelId(_ctx.stringValue("CreateDataModelResponse.Data.ModelId"));<NEW_LINE>List<Map<Object, Object>> attributes = _ctx.listMapValue("CreateDataModelResponse.Data.Attributes");<NEW_LINE>data.setAttributes(attributes);<NEW_LINE>createDataModelResponse.setData(data);<NEW_LINE>return createDataModelResponse;<NEW_LINE>}
(_ctx.mapValue("CreateDataModelResponse.Data.Props"));
1,034,805
private void updateParameters() {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("Hummer SDK Version: ");<NEW_LINE>builder.append(BuildConfig.VERSION_NAME);<NEW_LINE>builder.append("\n\n\n");<NEW_LINE>Object env = hummerContext.<MASK><NEW_LINE>if (env != null) {<NEW_LINE>builder.append("Hummer.env: ");<NEW_LINE>builder.append(JSONFormat.format(String.valueOf(env)));<NEW_LINE>builder.append("\n\n\n");<NEW_LINE>}<NEW_LINE>Object pageInfo = hummerContext.getJsContext().evaluateJavaScript("JSON.stringify(Hummer.pageInfo)");<NEW_LINE>if (pageInfo != null) {<NEW_LINE>builder.append("Hummer.pageInfo: ");<NEW_LINE>builder.append(JSONFormat.format(String.valueOf(pageInfo)));<NEW_LINE>builder.append("\n\n\n");<NEW_LINE>}<NEW_LINE>Object pageResult = hummerContext.getJsContext().evaluateJavaScript("JSON.stringify(Hummer.pageResult)");<NEW_LINE>if (pageResult != null) {<NEW_LINE>builder.append("Hummer.pageResult: ");<NEW_LINE>builder.append(JSONFormat.format(String.valueOf(pageResult)));<NEW_LINE>builder.append("\n\n\n");<NEW_LINE>}<NEW_LINE>if (mInjector != null) {<NEW_LINE>mInjector.injectParameter(builder);<NEW_LINE>}<NEW_LINE>tvInfo.setText(builder.toString());<NEW_LINE>}
getJsContext().evaluateJavaScript("JSON.stringify(Hummer.env)");
140,168
public io.kubernetes.client.proto.V1Scheduling.PriorityClassList buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1Scheduling.PriorityClassList result = new io.kubernetes.client.proto.V1Scheduling.PriorityClassList(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>if (metadataBuilder_ == null) {<NEW_LINE>result.metadata_ = metadata_;<NEW_LINE>} else {<NEW_LINE>result.metadata_ = metadataBuilder_.build();<NEW_LINE>}<NEW_LINE>if (itemsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>items_ = java.<MASK><NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.items_ = items_;<NEW_LINE>} else {<NEW_LINE>result.items_ = itemsBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
util.Collections.unmodifiableList(items_);
1,819,589
private static boolean validQueryConditionValues(HugeGraph graph, ConditionQuery query) {<NEW_LINE>Set<Id> keys = query.userpropKeys();<NEW_LINE>for (Id key : keys) {<NEW_LINE>PropertyKey pk = graph.propertyKey(key);<NEW_LINE>Set<Object> values = query.userpropValues(key);<NEW_LINE>E.checkState(!values.isEmpty(), "Expect user property values for key '%s', " + "but got none", pk);<NEW_LINE>boolean hasContains = query.containsContainsCondition(key);<NEW_LINE>if (pk.cardinality().multiple()) {<NEW_LINE>// If contains collection index, relation should be contains<NEW_LINE>E.checkState(hasContains, "The relation of property '%s' must be " + "CONTAINS or TEXT_CONTAINS, but got %s", pk.name(), query.relation<MASK><NEW_LINE>}<NEW_LINE>for (Object value : values) {<NEW_LINE>if (hasContains) {<NEW_LINE>value = toCollectionIfNeeded(pk, value);<NEW_LINE>}<NEW_LINE>if (!pk.checkValueType(value)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
(key).relation());
1,674,349
public static DescribeLiveDomainTimeShiftDataResponse unmarshall(DescribeLiveDomainTimeShiftDataResponse describeLiveDomainTimeShiftDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLiveDomainTimeShiftDataResponse.setRequestId(_ctx.stringValue("DescribeLiveDomainTimeShiftDataResponse.RequestId"));<NEW_LINE>List<DataModule> timeShiftData <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLiveDomainTimeShiftDataResponse.TimeShiftData.Length"); i++) {<NEW_LINE>DataModule dataModule = new DataModule();<NEW_LINE>dataModule.setType(_ctx.stringValue("DescribeLiveDomainTimeShiftDataResponse.TimeShiftData[" + i + "].Type"));<NEW_LINE>dataModule.setTimeStamp(_ctx.stringValue("DescribeLiveDomainTimeShiftDataResponse.TimeShiftData[" + i + "].TimeStamp"));<NEW_LINE>dataModule.setSize(_ctx.stringValue("DescribeLiveDomainTimeShiftDataResponse.TimeShiftData[" + i + "].Size"));<NEW_LINE>timeShiftData.add(dataModule);<NEW_LINE>}<NEW_LINE>describeLiveDomainTimeShiftDataResponse.setTimeShiftData(timeShiftData);<NEW_LINE>return describeLiveDomainTimeShiftDataResponse;<NEW_LINE>}
= new ArrayList<DataModule>();
371,670
public static byte[] toJson(OsVersionChange change) {<NEW_LINE>var slime = new Slime();<NEW_LINE><MASK><NEW_LINE>var targetsObject = object.setArray(TARGETS_FIELD);<NEW_LINE>change.targets().forEach((nodeType, target) -> {<NEW_LINE>var targetObject = targetsObject.addObject();<NEW_LINE>targetObject.setString(NODE_TYPE_FIELD, NodeSerializer.toString(nodeType));<NEW_LINE>targetObject.setString(VERSION_FIELD, target.version().toFullString());<NEW_LINE>targetObject.setLong(UPGRADE_BUDGET_FIELD, target.upgradeBudget().toMillis());<NEW_LINE>target.lastRetiredAt().ifPresent(instant -> targetObject.setLong(LAST_RETIRED_AT_FIELD, instant.toEpochMilli()));<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>return SlimeUtils.toJsonBytes(slime);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>}
var object = slime.setObject();
509,701
public void runChecks() {<NEW_LINE>CssSource source = null;<NEW_LINE>try {<NEW_LINE>if (this.mode == Mode.FILE && !context.ocf.get().hasEntry(path)) {<NEW_LINE>report.message(MessageId.RSC_001, EPUBLocation.create(context.ocf.get().getName()), path);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CSSHandler handler = new CSSHandler(context);<NEW_LINE>if (this.mode == Mode.STRING && this.line > -1) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>source = getCssSource();<NEW_LINE>parseItem(source, handler);<NEW_LINE>handler.setStartingLineNumber(-1);<NEW_LINE>this.line = -1;<NEW_LINE>} catch (Exception e) {<NEW_LINE>report.message(MessageId.PKG_008, EPUBLocation.create(path), e.getMessage());<NEW_LINE>} finally {<NEW_LINE>if (source != null) {<NEW_LINE>try {<NEW_LINE>InputStream iStream = source.getInputStream();<NEW_LINE>if (iStream != null) {<NEW_LINE>iStream.close();<NEW_LINE>}<NEW_LINE>} catch (IOException ignored) {<NEW_LINE>// eat it<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
handler.setStartingLineNumber(this.line);
365,432
public void configure(Map<String, ?> configs) {<NEW_LINE>super.configure(configs);<NEW_LINE>_violatedGoalsByFixability = new HashMap<>();<NEW_LINE>_optimizationResult = null;<NEW_LINE>KafkaCruiseControl kafkaCruiseControl = extractKafkaCruiseControlObjectFromConfig(configs, GOAL_VIOLATION);<NEW_LINE>KafkaCruiseControlConfig config = kafkaCruiseControl.config();<NEW_LINE>boolean <MASK><NEW_LINE>_excludeRecentlyDemotedBrokers = config.getBoolean(SELF_HEALING_EXCLUDE_RECENTLY_DEMOTED_BROKERS_CONFIG);<NEW_LINE>_excludeRecentlyRemovedBrokers = config.getBoolean(SELF_HEALING_EXCLUDE_RECENTLY_REMOVED_BROKERS_CONFIG);<NEW_LINE>_rebalanceRunnable = new RebalanceRunnable(kafkaCruiseControl, getSelfHealingGoalNames(config), allowCapacityEstimation, _excludeRecentlyDemotedBrokers, _excludeRecentlyRemovedBrokers, _anomalyId.toString(), reasonSupplier(), stopOngoingExecution());<NEW_LINE>}
allowCapacityEstimation = config.getBoolean(ANOMALY_DETECTION_ALLOW_CAPACITY_ESTIMATION_CONFIG);
1,192,738
public OrderedCollection<PortChangeEvent> handlePortStatusMessage(OFPortStatus ps) {<NEW_LINE>if (ps == null) {<NEW_LINE>throw new NullPointerException("OFPortStatus message must " + "not be null");<NEW_LINE>}<NEW_LINE>lock.writeLock().lock();<NEW_LINE>try {<NEW_LINE>OFPortDesc port = ps.getDesc();<NEW_LINE><MASK><NEW_LINE>if (reason == null) {<NEW_LINE>throw new IllegalArgumentException("Unknown PortStatus " + "reason code " + ps.getReason());<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Handling OFPortStatus: {} for {}", reason, String.format("%s (%d)", port.getName(), port.getPortNo().getPortNumber()));<NEW_LINE>}<NEW_LINE>if (reason == OFPortReason.DELETE)<NEW_LINE>return handlePortStatusDelete(port);<NEW_LINE>// We handle ADD and MODIFY the same way. Since OpenFlow<NEW_LINE>// doesn't specify what uniquely identifies a port the<NEW_LINE>// notion of ADD vs. MODIFY can also be hazy. So we just<NEW_LINE>// compare the new port to the existing ones.<NEW_LINE>Map<OFPort, OFPortDesc> newPortByNumber = new HashMap<>(portsByNumber);<NEW_LINE>OrderedCollection<PortChangeEvent> events = getSinglePortChanges(port);<NEW_LINE>for (PortChangeEvent e : events) {<NEW_LINE>switch(e.type) {<NEW_LINE>case DELETE:<NEW_LINE>newPortByNumber.remove(e.port.getPortNo());<NEW_LINE>break;<NEW_LINE>case ADD:<NEW_LINE>if (reason != OFPortReason.ADD) {<NEW_LINE>// weird case<NEW_LINE>}<NEW_LINE>// fall through<NEW_LINE>case DOWN:<NEW_LINE>case OTHER_UPDATE:<NEW_LINE>case UP:<NEW_LINE>// update or add the port in the map<NEW_LINE>newPortByNumber.put(e.port.getPortNo(), e.port);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updatePortsWithNewPortsByNumber(newPortByNumber);<NEW_LINE>return events;<NEW_LINE>} finally {<NEW_LINE>lock.writeLock().unlock();<NEW_LINE>}<NEW_LINE>}
OFPortReason reason = ps.getReason();
1,703,801
private BlockParsedResult parseNumericBlock() throws FormatException {<NEW_LINE>while (isStillNumeric(current.getPosition())) {<NEW_LINE>DecodedNumeric numeric = decodeNumeric(current.getPosition());<NEW_LINE>current.setPosition(numeric.getNewPosition());<NEW_LINE>if (numeric.isFirstDigitFNC1()) {<NEW_LINE>DecodedInformation information;<NEW_LINE>if (numeric.isSecondDigitFNC1()) {<NEW_LINE>information = new DecodedInformation(current.getPosition(), buffer.toString());<NEW_LINE>} else {<NEW_LINE>information = new DecodedInformation(current.getPosition(), buffer.toString(), numeric.getSecondDigit());<NEW_LINE>}<NEW_LINE>return new BlockParsedResult(information, true);<NEW_LINE>}<NEW_LINE>buffer.append(numeric.getFirstDigit());<NEW_LINE>if (numeric.isSecondDigitFNC1()) {<NEW_LINE>DecodedInformation information = new DecodedInformation(current.getPosition(), buffer.toString());<NEW_LINE>return new BlockParsedResult(information, true);<NEW_LINE>}<NEW_LINE>buffer.<MASK><NEW_LINE>}<NEW_LINE>if (isNumericToAlphaNumericLatch(current.getPosition())) {<NEW_LINE>current.setAlpha();<NEW_LINE>current.incrementPosition(4);<NEW_LINE>}<NEW_LINE>return new BlockParsedResult();<NEW_LINE>}
append(numeric.getSecondDigit());
1,634,081
public void testTransferWithMBean(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>String jndiName = request.getParameter("jndiName");<NEW_LINE>String[] <MASK><NEW_LINE>PersistentExecutor executor = InitialContext.doLookup(jndiName);<NEW_LINE>DataSource ds = InitialContext.doLookup("java:comp/DefaultDataSource");<NEW_LINE>MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();<NEW_LINE>ObjectName obn = new ObjectName("WebSphere:type=PersistentExecutorMBean,jndiName=" + jndiName + ",*");<NEW_LINE>Set<ObjectInstance> s = mbs.queryMBeans(obn, null);<NEW_LINE>if (s.size() != 1) {<NEW_LINE>for (ObjectInstance i : s) System.out.println(" Found MBean: " + i.getObjectName());<NEW_LINE>throw new Exception("Expected to find exactly 1 MBean, instead found " + s.size());<NEW_LINE>}<NEW_LINE>ObjectInstance mbean = s.iterator().next();<NEW_LINE>String[] paramTypes = { "java.lang.Long", "long" };<NEW_LINE>for (String taskIdString : taskIds) {<NEW_LINE>long taskId = Long.valueOf(taskIdString);<NEW_LINE>// The only way to find the value stored in a task's PARTN column is to query the database<NEW_LINE>long oldValue;<NEW_LINE>try (Connection con = ds.getConnection()) {<NEW_LINE>PreparedStatement st = con.prepareStatement("SELECT PARTN FROM WLPTASK WHERE ID=?");<NEW_LINE>st.setLong(1, taskId);<NEW_LINE>ResultSet result = st.executeQuery();<NEW_LINE>if (!result.next())<NEW_LINE>throw new Exception("Task " + taskId + " is not found.");<NEW_LINE>oldValue = result.getLong(1);<NEW_LINE>}<NEW_LINE>// Reassign using the mbean<NEW_LINE>int tasksTransferred = (Integer) mbs.invoke(mbean.getObjectName(), "transfer", new Long[] { taskId, oldValue }, new String[] { "java.lang.Long", "long" });<NEW_LINE>if (tasksTransferred < 1)<NEW_LINE>throw new Exception("Task " + taskId + " with " + oldValue + " is not found by mbean " + mbean);<NEW_LINE>}<NEW_LINE>}
taskIds = request.getParameterValues("taskId");
187,305
private static String createJavapTaskFromArguments(String fqClassName, String[] args) throws Exception {<NEW_LINE>String byteCodeString = null;<NEW_LINE>if (classJavapTask != null) {<NEW_LINE>Constructor<?> constructor = classJavapTask.getDeclaredConstructor();<NEW_LINE><MASK><NEW_LINE>Method methodSetLog = classJavapTask.getMethod("setLog", new Class[] { OutputStream.class });<NEW_LINE>Method methodHandleOptions = classJavapTask.getMethod("handleOptions", new Class[] { String[].class });<NEW_LINE>Method methodCall = classJavapTask.getMethod("call", new Class[] {});<NEW_LINE>try (ByteArrayOutputStream baos = new ByteArrayOutputStream(BUFFER_SIZE)) {<NEW_LINE>methodSetLog.invoke(javapObject, baos);<NEW_LINE>methodHandleOptions.invoke(javapObject, new Object[] { args });<NEW_LINE>methodCall.invoke(javapObject);<NEW_LINE>byteCodeString = baos.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return byteCodeString;<NEW_LINE>}
Object javapObject = constructor.newInstance();
752,481
public static BatchInsertItemsResponse unmarshall(BatchInsertItemsResponse batchInsertItemsResponse, UnmarshallerContext _ctx) {<NEW_LINE>batchInsertItemsResponse.setRequestId(_ctx.stringValue("BatchInsertItemsResponse.RequestId"));<NEW_LINE>batchInsertItemsResponse.setErrorMessage(_ctx.stringValue("BatchInsertItemsResponse.ErrorMessage"));<NEW_LINE>batchInsertItemsResponse.setSuccess(_ctx.booleanValue("BatchInsertItemsResponse.Success"));<NEW_LINE>batchInsertItemsResponse.setErrorCode(_ctx.stringValue("BatchInsertItemsResponse.ErrorCode"));<NEW_LINE>batchInsertItemsResponse.setCode<MASK><NEW_LINE>batchInsertItemsResponse.setMessage(_ctx.stringValue("BatchInsertItemsResponse.Message"));<NEW_LINE>batchInsertItemsResponse.setDynamicMessage(_ctx.stringValue("BatchInsertItemsResponse.DynamicMessage"));<NEW_LINE>batchInsertItemsResponse.setDynamicCode(_ctx.stringValue("BatchInsertItemsResponse.DynamicCode"));<NEW_LINE>List<BatchResult> batchResults = new ArrayList<BatchResult>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("BatchInsertItemsResponse.BatchResults.Length"); i++) {<NEW_LINE>BatchResult batchResult = new BatchResult();<NEW_LINE>batchResult.setIndex(_ctx.integerValue("BatchInsertItemsResponse.BatchResults[" + i + "].Index"));<NEW_LINE>batchResult.setMessage(_ctx.stringValue("BatchInsertItemsResponse.BatchResults[" + i + "].Message"));<NEW_LINE>batchResult.setSuccess(_ctx.booleanValue("BatchInsertItemsResponse.BatchResults[" + i + "].Success"));<NEW_LINE>batchResult.setErrorCode(_ctx.stringValue("BatchInsertItemsResponse.BatchResults[" + i + "].ErrorCode"));<NEW_LINE>batchResults.add(batchResult);<NEW_LINE>}<NEW_LINE>batchInsertItemsResponse.setBatchResults(batchResults);<NEW_LINE>return batchInsertItemsResponse;<NEW_LINE>}
(_ctx.stringValue("BatchInsertItemsResponse.Code"));
362,476
private boolean visit(List<SQLInsertStatement.ValuesClause> valuesList) {<NEW_LINE>boolean isBatch = false;<NEW_LINE>List<SQLInsertStatement.ValuesClause> newValuesList = convertToSingleValuesIfNeed(valuesList);<NEW_LINE>if (newValuesList.size() < valuesList.size()) {<NEW_LINE>isBatch = true;<NEW_LINE>valuesList = newValuesList;<NEW_LINE>}<NEW_LINE>SqlNode[] rows = new SqlNode[valuesList.size()];<NEW_LINE>for (int j = 0; j < valuesList.size(); j++) {<NEW_LINE>List<SQLExpr> values = valuesList.<MASK><NEW_LINE>SqlNode[] valueNodes = new SqlNode[values.size()];<NEW_LINE>for (int i = 0; i < values.size(); i++) {<NEW_LINE>SqlNode valueNode = convertToSqlNode(values.get(i));<NEW_LINE>valueNodes[i] = valueNode;<NEW_LINE>}<NEW_LINE>SqlBasicCall row = new SqlBasicCall(SqlStdOperatorTable.ROW, valueNodes, SqlParserPos.ZERO);<NEW_LINE>rows[j] = row;<NEW_LINE>}<NEW_LINE>this.sqlNode = new SqlBasicCall(SqlStdOperatorTable.VALUES, rows, SqlParserPos.ZERO);<NEW_LINE>return isBatch;<NEW_LINE>}
get(j).getValues();
1,018,978
public void run() {<NEW_LINE>long lastTime = Long.MIN_VALUE + 1;<NEW_LINE>for (final Memory record : records) {<NEW_LINE>long time = jfrModel.nsToAbsoluteMillis(record.time);<NEW_LINE>if (time <= lastTime)<NEW_LINE>time = lastTime + 1;<NEW_LINE>chartSupport.addValues(time, new long<MASK><NEW_LINE>lastTime = time;<NEW_LINE>}<NEW_LINE>if (!records.isEmpty()) {<NEW_LINE>records.clear();<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>long usedSize = lastEvent.getLong("usedSize");<NEW_LINE>// NOI18N<NEW_LINE>long totalSize = lastEvent.getLong("totalSize");<NEW_LINE>chartSupport.updateDetails(new String[] { chartSupport.formatBytes(usedSize), chartSupport.formatBytes(totalSize) });<NEW_LINE>} catch (JFRPropertyNotAvailableException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>records = null;<NEW_LINE>lastEvent = null;<NEW_LINE>records = null;<NEW_LINE>}
[] { record.value });
834,236
private void updateView() {<NEW_LINE>controlsMap.clear();<NEW_LINE>MonthView view = getSkinnable();<NEW_LINE>gridPane.getChildren().clear();<NEW_LINE>displayedYearMonth = view.getYearMonth();<NEW_LINE>WeekFields weekFields = view.getWeekFields();<NEW_LINE>DayOfWeek dayOfWeek = weekFields.getFirstDayOfWeek();<NEW_LINE>if (view.isShowWeekdays()) {<NEW_LINE>for (int i = 0; i < 7; i++) {<NEW_LINE>Label dayOfWeekLabel = new Label(dayOfWeek.getDisplayName(TextStyle.SHORT_STANDALONE, Locale.getDefault()));<NEW_LINE>dayOfWeekLabel.setAlignment(Pos.CENTER_RIGHT);<NEW_LINE>dayOfWeekLabel.setMaxSize(MAX_VALUE, MAX_VALUE);<NEW_LINE>dayOfWeekLabel.getStyleClass().add(DAY_OF_WEEK_LABEL);<NEW_LINE>if (view.isShowWeekends() && view.getWeekendDays().contains(dayOfWeek)) {<NEW_LINE>dayOfWeekLabel.getStyleClass().add(DAY_OF_WEEKEND_LABEL);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>gridPane.add(dayOfWeekLabel, i, 0);<NEW_LINE>dayOfWeek = dayOfWeek.plus(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LocalDate date = view.getDate().with(TemporalAdjusters.firstDayOfMonth());<NEW_LINE>date = Util.adjustToFirstDayOfWeek(date, getSkinnable().getFirstDayOfWeek());<NEW_LINE>for (int week = 0; week < 6; week++) {<NEW_LINE>for (int day = 0; day < 7; day++) {<NEW_LINE>// TODO: this should be done via a factory (cell factory already defined on MonthViewBase<NEW_LINE>MonthDayView dayOfMonthLabel = new MonthDayView(date, week, day);<NEW_LINE>controlsMap.put(date, dayOfMonthLabel);<NEW_LINE>GridPane.setHgrow(dayOfMonthLabel, ALWAYS);<NEW_LINE>GridPane.setVgrow(dayOfMonthLabel, ALWAYS);<NEW_LINE>gridPane.add(dayOfMonthLabel, day, week + 1);<NEW_LINE>date = date.plusDays(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateDaySelection();<NEW_LINE>updateEntries("view was updated after a view property change");<NEW_LINE>}
GridPane.setHgrow(dayOfWeekLabel, ALWAYS);
93,145
private void editValues(PlayerProfile profile) {<NEW_LINE>mcMMO.p.debug("========================================================================");<NEW_LINE>mcMMO.p.debug("Conversion report for " + <MASK><NEW_LINE>for (PrimarySkillType primarySkillType : SkillTools.NON_CHILD_SKILLS) {<NEW_LINE>int oldLevel = profile.getSkillLevel(primarySkillType);<NEW_LINE>int oldXPLevel = profile.getSkillXpLevel(primarySkillType);<NEW_LINE>int totalOldXP = mcMMO.getFormulaManager().calculateTotalExperience(oldLevel, oldXPLevel);<NEW_LINE>if (totalOldXP == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int[] newExperienceValues = mcMMO.getFormulaManager().calculateNewLevel(primarySkillType, (int) Math.floor(totalOldXP / ExperienceConfig.getInstance().getExpModifier()), formulaType);<NEW_LINE>int newLevel = newExperienceValues[0];<NEW_LINE>int newXPlevel = newExperienceValues[1];<NEW_LINE>mcMMO.p.debug(" Skill: " + primarySkillType.toString());<NEW_LINE>mcMMO.p.debug(" OLD:");<NEW_LINE>mcMMO.p.debug(" Level: " + oldLevel);<NEW_LINE>mcMMO.p.debug(" XP " + oldXPLevel);<NEW_LINE>mcMMO.p.debug(" Total XP " + totalOldXP);<NEW_LINE>mcMMO.p.debug(" NEW:");<NEW_LINE>mcMMO.p.debug(" Level " + newLevel);<NEW_LINE>mcMMO.p.debug(" XP " + newXPlevel);<NEW_LINE>mcMMO.p.debug("------------------------------------------------------------------------");<NEW_LINE>profile.modifySkill(primarySkillType, newLevel);<NEW_LINE>profile.setSkillXpLevel(primarySkillType, newXPlevel);<NEW_LINE>}<NEW_LINE>}
profile.getPlayerName() + ":");
357,716
public void bindingChanged(BindingProvider provider, String itemName) {<NEW_LINE>if (provider instanceof DigitalSTROMBindingProvider) {<NEW_LINE>// remove device associated with the item<NEW_LINE>Device device = deviceMap.get(itemName);<NEW_LINE>if (device != null) {<NEW_LINE>List<String> itemNamesForDsid = getItemNamesForDsid(device.getDSID().getValue());<NEW_LINE>if (itemNamesForDsid.size() == 1) {<NEW_LINE>device.removeDeviceListener(this);<NEW_LINE>removeSensorJobs(device.getDSID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>deviceMap.remove(itemName);<NEW_LINE>// initialize the device<NEW_LINE>DigitalSTROMBindingConfig confItem = getConfigForItemName(itemName);<NEW_LINE>if (confItem != null && confItem.dsid != null) {<NEW_LINE>if (rawDsidToDeviceMap.size() == 0 && serverIsFound()) {<NEW_LINE>rawDsidToDeviceMap = getAllDigitalSTROMDevicesMap();<NEW_LINE>}<NEW_LINE>device = rawDsidToDeviceMap.get(<MASK><NEW_LINE>if (device != null) {<NEW_LINE>addDevice(itemName, device);<NEW_LINE>updateItemState(confItem.item);<NEW_LINE>handleStructure(digitalSTROM.getApartmentStructure(getSessionToken()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
confItem.dsid.getValue());
322,691
private void fillSegment(FillBlock filler, Position position) {<NEW_LINE>Block addressBlock = null, inputBlock = null;<NEW_LINE>boolean dataIndependentAddressing = isDataIndependentAddressing(position);<NEW_LINE>int startingIndex = getStartingIndex(position);<NEW_LINE>int currentOffset = position.lane * laneLength <MASK><NEW_LINE>int prevOffset = getPrevOffset(currentOffset);<NEW_LINE>if (dataIndependentAddressing) {<NEW_LINE>addressBlock = filler.addressBlock.clear();<NEW_LINE>inputBlock = filler.inputBlock.clear();<NEW_LINE>initAddressBlocks(filler, position, inputBlock, addressBlock);<NEW_LINE>}<NEW_LINE>final boolean withXor = isWithXor(position);<NEW_LINE>for (int index = startingIndex; index < segmentLength; ++index) {<NEW_LINE>long pseudoRandom = getPseudoRandom(filler, index, addressBlock, inputBlock, prevOffset, dataIndependentAddressing);<NEW_LINE>int refLane = getRefLane(position, pseudoRandom);<NEW_LINE>int refColumn = getRefColumn(position, index, pseudoRandom, refLane == position.lane);
+ position.slice * segmentLength + startingIndex;
1,660,433
public Object calculate(Context ctx) {<NEW_LINE>IParam param = this.param;<NEW_LINE>Expression[] exps = null;<NEW_LINE>String[] names = null;<NEW_LINE>String[] removeCols = null;<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("alter" + mm.getMessage("function.invalidParam"));<NEW_LINE>} else if (param.getType() == IParam.Colon) {<NEW_LINE>ParamInfo2 pi = ParamInfo2.parse(param, "alter", false, false);<NEW_LINE>exps = pi.getExpressions2();<NEW_LINE>names = pi.getExpressionStrs1();<NEW_LINE>} else if (param.getType() == IParam.Comma) {<NEW_LINE>ParamInfo2 pi = ParamInfo2.parse(<MASK><NEW_LINE>exps = pi.getExpressions2();<NEW_LINE>names = pi.getExpressionStrs1();<NEW_LINE>} else if (param.getType() == IParam.Semicolon) {<NEW_LINE>int size = param.getSubSize();<NEW_LINE>if (size != 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("alter" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>IParam newColParam = param.getSub(0);<NEW_LINE>if (newColParam != null) {<NEW_LINE>ParamInfo2 pi = ParamInfo2.parse(newColParam, "alter", false, false);<NEW_LINE>exps = pi.getExpressions2();<NEW_LINE>names = pi.getExpressionStrs1();<NEW_LINE>}<NEW_LINE>IParam removeParam = param.getSub(1);<NEW_LINE>if (removeParam == null) {<NEW_LINE>} else if (removeParam.isLeaf()) {<NEW_LINE>removeCols = new String[] { removeParam.getLeafExpression().getIdentifierName() };<NEW_LINE>} else {<NEW_LINE>int fcount = removeParam.getSubSize();<NEW_LINE>removeCols = new String[fcount];<NEW_LINE>for (int i = 0; i < fcount; ++i) {<NEW_LINE>IParam sub = removeParam.getSub(i);<NEW_LINE>if (sub == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("alter" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>removeCols[i] = sub.getLeafExpression().getIdentifierName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (removeCols != null) {<NEW_LINE>for (String col : removeCols) {<NEW_LINE>table.deleteColumn(col);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (names != null) {<NEW_LINE>int count = names.length;<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>table.addColumn(names[i], exps[i], ctx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return table;<NEW_LINE>}
param, "alter", false, false);
8,347
final ListIdentityProvidersResult executeListIdentityProviders(ListIdentityProvidersRequest listIdentityProvidersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listIdentityProvidersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListIdentityProvidersRequest> request = null;<NEW_LINE>Response<ListIdentityProvidersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListIdentityProvidersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listIdentityProvidersRequest));<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, "ListIdentityProviders");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListIdentityProvidersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListIdentityProvidersResultJsonUnmarshaller());<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, "WorkSpaces Web");
1,002,248
private TargetModuleID[] translateForUndeploy(TargetModuleID[] ids) {<NEW_LINE>final String deployDir = getInstanceProperties().getProperty(JBPluginProperties.PROPERTY_DEPLOY_DIR);<NEW_LINE>if (deployDir != null) {<NEW_LINE>TargetModuleID[] ret <MASK><NEW_LINE>for (int i = 0; i < ids.length; i++) {<NEW_LINE>File testFile = new File(deployDir, ids[i].getModuleID());<NEW_LINE>// if (testFile.exists()) {<NEW_LINE>// XXX is this needed ?<NEW_LINE>// File markFile = new File(deployDir, ids[i].getModuleID() + ".deployed"); // NOI18N<NEW_LINE>// if (markFile.isFile()) {<NEW_LINE>try {<NEW_LINE>ret[i] = new WrappedTargetModuleID(ids[i], null, testFile.toURI().toURL().toString(), null);<NEW_LINE>continue;<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>LOGGER.log(Level.FINE, null, ex);<NEW_LINE>}<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>ret[i] = ids[i];<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>return ids;<NEW_LINE>}
= new TargetModuleID[ids.length];
57,993
public Media findMatchingMedia(Model model, Media media) {<NEW_LINE>assert media.getModel() == model;<NEW_LINE>if (media.getParent() == null) {<NEW_LINE>// detached or not attached yet rule<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// find id of the given rule in the given model<NEW_LINE>final MediaRefModelVisitor ruleRef = new MediaRefModelVisitor(model, media);<NEW_LINE>model.runReadTask(new Model.ModelTask() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(StyleSheet styleSheet) {<NEW_LINE>styleSheet.accept(ruleRef);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int mediaIndex = ruleRef.getMediaIndex();<NEW_LINE>// the rule must be found<NEW_LINE>assert mediaIndex != -1;<NEW_LINE>CharSequence ruleId = LexerUtils.trim(ruleRef.getMediaId());<NEW_LINE>// now resolve the rule ref to the current model<NEW_LINE>final ResolveMediaRefModelVisitor resolveRuleRef = new ResolveMediaRefModelVisitor(this.model, ruleId, mediaIndex);<NEW_LINE>// we are under lock already, at least should be<NEW_LINE><MASK><NEW_LINE>return resolveRuleRef.getResolvedMedia();<NEW_LINE>}
this.styleSheet.accept(resolveRuleRef);
1,846,086
private void run() {<NEW_LINE>if (badOptions || helpRequested || blobFile == null || outDir == null) {<NEW_LINE>System.out.printf("Usage: java %s [options]%n", getClass().getName());<NEW_LINE><MASK><NEW_LINE>System.out.printf(" --blob=<blob file>%n");<NEW_LINE>System.out.printf(" --debug%n");<NEW_LINE>System.out.printf(" --help%n");<NEW_LINE>System.out.printf(" --out=<output directory>%n");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>StructureReader reader = readBlob(blobFile);<NEW_LINE>checkAndFilterFields(reader);<NEW_LINE>writeTo(reader, outDir);<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.out.printf("Can't read blob: %s%n", e.getLocalizedMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
System.out.printf(" options:%n");
1,206,611
public Metric deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {<NEW_LINE>JsonObject jsonObject = jsonElement.getAsJsonObject();<NEW_LINE>String name = null;<NEW_LINE>if (jsonObject.get("name") != null)<NEW_LINE>name = jsonObject.get("name").getAsString();<NEW_LINE>boolean exclude_tags = false;<NEW_LINE>if (jsonObject.get("exclude_tags") != null)<NEW_LINE>exclude_tags = jsonObject.get("exclude_tags").getAsBoolean();<NEW_LINE>TreeMultimap<String, String> tags = TreeMultimap.create();<NEW_LINE>JsonElement jeTags = jsonObject.get("tags");<NEW_LINE>if (jeTags != null) {<NEW_LINE>JsonObject joTags = jeTags.getAsJsonObject();<NEW_LINE>int count = 0;<NEW_LINE>for (Map.Entry<String, JsonElement> tagEntry : joTags.entrySet()) {<NEW_LINE>String context = "tags[" + count + "]";<NEW_LINE>if (tagEntry.getKey().isEmpty())<NEW_LINE>throw new ContextualJsonSyntaxException(context, "name must not be empty");<NEW_LINE>if (tagEntry.getValue().isJsonArray()) {<NEW_LINE>for (JsonElement element : tagEntry.getValue().getAsJsonArray()) {<NEW_LINE>if (element.isJsonNull() || element.getAsString().isEmpty())<NEW_LINE>throw new ContextualJsonSyntaxException(context + "." + <MASK><NEW_LINE>tags.put(tagEntry.getKey(), element.getAsString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (tagEntry.getValue().isJsonNull() || tagEntry.getValue().getAsString().isEmpty())<NEW_LINE>throw new ContextualJsonSyntaxException(context + "." + tagEntry.getKey(), "value must not be null or empty");<NEW_LINE>tags.put(tagEntry.getKey(), tagEntry.getValue().getAsString());<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Metric ret = new Metric(name, exclude_tags, tags);<NEW_LINE>JsonElement limit = jsonObject.get("limit");<NEW_LINE>if (limit != null)<NEW_LINE>ret.setLimit(limit.getAsInt());<NEW_LINE>return (ret);<NEW_LINE>}
tagEntry.getKey(), "value must not be null or empty");
973,711
public int apply(MethodVisitor methodVisitor, Method method) {<NEW_LINE>Class<?>[] source = method.getParameterTypes(), target = this.method.getParameterTypes();<NEW_LINE>int offset = 1;<NEW_LINE>for (int index = 0; index < source.length; index++) {<NEW_LINE>Type type = Type.getType(source[index]);<NEW_LINE>methodVisitor.visitVarInsn(type.getOpcode<MASK><NEW_LINE>if (source[index] != target[index]) {<NEW_LINE>methodVisitor.visitTypeInsn(Opcodes.CHECKCAST, Type.getInternalName(target[index]));<NEW_LINE>}<NEW_LINE>offset += type.getSize();<NEW_LINE>}<NEW_LINE>methodVisitor.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(this.method.getDeclaringClass()), this.method.getName(), Type.getMethodDescriptor(this.method), this.method.getDeclaringClass().isInterface());<NEW_LINE>methodVisitor.visitInsn(Type.getReturnType(this.method).getOpcode(Opcodes.IRETURN));<NEW_LINE>return Math.max(offset - 1, Type.getReturnType(this.method).getSize());<NEW_LINE>}
(Opcodes.ILOAD), offset);
493,564
public int compareTo(drainReplicationTable_result other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSuccess()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTnase(), other.isSetTnase());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTnase()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tnase, other.tnase);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
this.success, other.success);
1,683,849
private Object resolveSourceValue(MappingContextImpl<?, ?> context, Mapping mapping) {<NEW_LINE>Object source = context.getSource();<NEW_LINE>if (mapping instanceof PropertyMappingImpl) {<NEW_LINE>StringBuilder destPathBuilder = new StringBuilder().append(context.destinationPath);<NEW_LINE>for (Accessor accessor : (List<Accessor>) ((PropertyMapping) mapping).getSourceProperties()) {<NEW_LINE>destPathBuilder.append(accessor.getName()).append('.');<NEW_LINE>source = accessor.getValue(source);<NEW_LINE>context.addParentSource(destPathBuilder.toString(), source);<NEW_LINE>if (source == null)<NEW_LINE>return null;<NEW_LINE>if (!Iterables.isIterable(source.getClass())) {<NEW_LINE>Object circularDest = context.sourceToDestination.get(source);<NEW_LINE>if (circularDest != null)<NEW_LINE>context.intermediateDestinations.put(destPathBuilder.toString(), circularDest);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (mapping instanceof ConstantMapping) {<NEW_LINE>source = ((<MASK><NEW_LINE>context.addParentSource("", source);<NEW_LINE>}<NEW_LINE>return source;<NEW_LINE>}
ConstantMapping) mapping).getConstant();
1,005,337
public void connectionsAdded(int start, ConnectionDescriptor[] conns) {<NEW_LINE>synchronized (this) {<NEW_LINE>// Save the latest port->ID mapping<NEW_LINE>for (ConnectionDescriptor conn : conns) {<NEW_LINE>// Log.d(TAG, "[+] port " + conn.local_port);<NEW_LINE>mPortToConnId.put(<MASK><NEW_LINE>// Check if the payload has already been received<NEW_LINE>int pending_idx = mPendingPayloads.indexOfKey(conn.local_port);<NEW_LINE>if (pending_idx >= 0) {<NEW_LINE>ArrayList<PendingPayload> pp = mPendingPayloads.valueAt(pending_idx);<NEW_LINE>mPendingPayloads.removeAt(pending_idx);<NEW_LINE>for (PendingPayload pending : pp) {<NEW_LINE>// Log.d(TAG, "(pending) PAYLOAD." + pending.pType.name() + "[" + pending.payload.length + " B]: port=" + pending.port);<NEW_LINE>handlePayload(conn, pending.pType, pending.payload, pending.when);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
conn.local_port, conn.incr_id);
1,621,289
protected Control createDialogArea(Composite parent) {<NEW_LINE>setMessage(DEFAULT_TASKNAME, false);<NEW_LINE>createMessageArea(parent);<NEW_LINE>// Only set for backwards compatibility<NEW_LINE>taskLabel = messageLabel;<NEW_LINE>// progress indicator<NEW_LINE>progressIndicator = new ProgressIndicator(parent);<NEW_LINE>GridData gd = new GridData();<NEW_LINE>gd.heightHint = convertVerticalDLUsToPixels(BAR_DLUS);<NEW_LINE>gd.horizontalAlignment = GridData.FILL;<NEW_LINE>gd.grabExcessHorizontalSpace = true;<NEW_LINE>gd.horizontalSpan = 2;<NEW_LINE>progressIndicator.setLayoutData(gd);<NEW_LINE>// label showing current task<NEW_LINE>subTaskLabel = new Label(parent, SWT.LEFT | SWT.WRAP);<NEW_LINE>gd = new GridData(GridData.FILL_HORIZONTAL);<NEW_LINE><MASK><NEW_LINE>gd.horizontalSpan = 2;<NEW_LINE>subTaskLabel.setLayoutData(gd);<NEW_LINE>subTaskLabel.setFont(parent.getFont());<NEW_LINE>return parent;<NEW_LINE>}
gd.heightHint = convertVerticalDLUsToPixels(LABEL_DLUS);
1,084,757
public ExpectedAttributeValue unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ExpectedAttributeValue expectedAttributeValue = new ExpectedAttributeValue();<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("Value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>expectedAttributeValue.setValue(AttributeValueJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Exists", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>expectedAttributeValue.setExists(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ComparisonOperator", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>expectedAttributeValue.setComparisonOperator(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("AttributeValueList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>expectedAttributeValue.setAttributeValueList(new ListUnmarshaller<AttributeValue>(AttributeValueJsonUnmarshaller.getInstance()).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 expectedAttributeValue;<NEW_LINE>}
class).unmarshall(context));
1,185,848
protected void doConnect(String operator, DataSource dataSource) throws ErrorException {<NEW_LINE>if (dataSource.getConnectParams().containsKey("envId")) {<NEW_LINE>try {<NEW_LINE>dataSourceInfoService.addEnvParamsToDataSource(Long.parseLong((String) dataSource.getConnectParams().get("envId")), dataSource);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ParameterValidateException("envId atypical" + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<DataSourceParamKeyDefinition> keyDefinitionList = dataSourceRelateService.<MASK><NEW_LINE>dataSource.setKeyDefinitions(keyDefinitionList);<NEW_LINE>Map<String, Object> connectParams = dataSource.getConnectParams();<NEW_LINE>parameterValidator.validate(keyDefinitionList, connectParams);<NEW_LINE>// For connecting, also need to handle the parameters<NEW_LINE>for (DataSourceParamsHook hook : dataSourceParamsHooks) {<NEW_LINE>hook.beforePersist(connectParams, keyDefinitionList);<NEW_LINE>}<NEW_LINE>DataSourceType dataSourceType = dataSourceRelateService.getDataSourceType(dataSource.getDataSourceTypeId());<NEW_LINE>metadataOperateService.doRemoteConnect(MdmConfiguration.METADATA_SERVICE_APPLICATION.getValue(), dataSourceType.getName().toLowerCase(), operator, dataSource.getConnectParams());<NEW_LINE>}
getKeyDefinitionsByType(dataSource.getDataSourceTypeId());
1,336,163
private void updateSortOrderDots(int sortPos) {<NEW_LINE>double arrowWidth = arrow.prefWidth(-1);<NEW_LINE>sortOrderDots.getChildren().clear();<NEW_LINE>for (int i = 0; i <= sortPos; i++) {<NEW_LINE>Region r = new Region();<NEW_LINE>r.getStyleClass().add("sort-order-dot");<NEW_LINE>String sortTypeName = getSortTypeName(getTableColumn());<NEW_LINE>if (sortTypeName != null && !sortTypeName.isEmpty()) {<NEW_LINE>r.getStyleClass().add(sortTypeName.toLowerCase(Locale.ROOT));<NEW_LINE>}<NEW_LINE>sortOrderDots.<MASK><NEW_LINE>// RT-34914: fine tuning the placement of the sort dots. We could have gone to a custom layout, but for now<NEW_LINE>// this works fine.<NEW_LINE>if (i < sortPos) {<NEW_LINE>Region spacer = new Region();<NEW_LINE>double lp = sortPos == 1 ? 1 : 0;<NEW_LINE>spacer.setPadding(new Insets(0, 1, 0, lp));<NEW_LINE>sortOrderDots.getChildren().add(spacer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sortOrderDots.setAlignment(Pos.TOP_CENTER);<NEW_LINE>sortOrderDots.setMaxWidth(arrowWidth);<NEW_LINE>}
getChildren().add(r);
383,517
public void validate(ValidationContext validationContext) {<NEW_LINE>List<CaseInsensitiveString> allEnvironmentNames = new ArrayList<>();<NEW_LINE>Map<CaseInsensitiveString, CaseInsensitiveString> pipelineToEnvMap = new HashMap<>();<NEW_LINE>List<CaseInsensitiveString> allPipelineNames = validationContext.getCruiseConfig().getAllPipelineNames();<NEW_LINE>for (EnvironmentConfig envConfig : this) {<NEW_LINE>if (allEnvironmentNames.contains(envConfig.name())) {<NEW_LINE>envConfig.addError("name", String.format("Environment with name '%s' already exists.", envConfig.name()));<NEW_LINE>} else {<NEW_LINE>allEnvironmentNames.add(envConfig.name());<NEW_LINE>}<NEW_LINE>for (EnvironmentPipelineConfig pipeline : envConfig.getPipelines()) {<NEW_LINE>if (!allPipelineNames.contains(pipeline.getName())) {<NEW_LINE>envConfig.addError("pipeline", String.format("Environment '%s' refers to an unknown pipeline '%s'.", envConfig.name(), pipeline.getName()));<NEW_LINE>}<NEW_LINE>if (pipelineToEnvMap.containsKey(pipeline.getName())) {<NEW_LINE>envConfig.addError("pipeline", "Associating pipeline(s) which is already part of " + pipelineToEnvMap.get(pipeline<MASK><NEW_LINE>} else {<NEW_LINE>pipelineToEnvMap.put(pipeline.getName(), envConfig.name());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getName()) + " environment");
433,979
final void ensureSubDecor() {<NEW_LINE>if (mHasActionBar && !mSubDecorInstalled) {<NEW_LINE>if (mOverlayActionBar) {<NEW_LINE>mActivity.superSetContentView(R.layout.abc_action_bar_decor_overlay);<NEW_LINE>} else {<NEW_LINE>mActivity.<MASK><NEW_LINE>}<NEW_LINE>mActionBarView = (ActionBarView) mActivity.findViewById(R.id.action_bar);<NEW_LINE>mActionBarView.setWindowCallback(mActivity);<NEW_LINE>if (mFeatureProgress) {<NEW_LINE>mActionBarView.initProgress();<NEW_LINE>}<NEW_LINE>if (mFeatureIndeterminateProgress) {<NEW_LINE>mActionBarView.initIndeterminateProgress();<NEW_LINE>}<NEW_LINE>boolean splitWhenNarrow = UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW.equals(getUiOptionsFromMetadata());<NEW_LINE>boolean splitActionBar;<NEW_LINE>if (splitWhenNarrow) {<NEW_LINE>splitActionBar = mActivity.getResources().getBoolean(R.bool.abc_split_action_bar_is_narrow);<NEW_LINE>} else {<NEW_LINE>TypedArray a = mActivity.obtainStyledAttributes(R.styleable.ActionBarWindow);<NEW_LINE>splitActionBar = a.getBoolean(R.styleable.ActionBarWindow_windowSplitActionBar, false);<NEW_LINE>a.recycle();<NEW_LINE>}<NEW_LINE>final ActionBarContainer splitView = (ActionBarContainer) mActivity.findViewById(R.id.split_action_bar);<NEW_LINE>if (splitView != null) {<NEW_LINE>mActionBarView.setSplitView(splitView);<NEW_LINE>mActionBarView.setSplitActionBar(splitActionBar);<NEW_LINE>mActionBarView.setSplitWhenNarrow(splitWhenNarrow);<NEW_LINE>final ActionBarContextView cab = (ActionBarContextView) mActivity.findViewById(R.id.action_context_bar);<NEW_LINE>cab.setSplitView(splitView);<NEW_LINE>cab.setSplitActionBar(splitActionBar);<NEW_LINE>cab.setSplitWhenNarrow(splitWhenNarrow);<NEW_LINE>}<NEW_LINE>mSubDecorInstalled = true;<NEW_LINE>supportInvalidateOptionsMenu();<NEW_LINE>}<NEW_LINE>}
superSetContentView(R.layout.abc_action_bar_decor);
817,542
void drain() {<NEW_LINE>if (WIP.getAndIncrement(this) != 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Subscriber<? super R> a = actual;<NEW_LINE>Queue<Object> q = queue;<NEW_LINE>int missed = 1;<NEW_LINE>for (; ; ) {<NEW_LINE>long r = requested;<NEW_LINE>long e = 0L;<NEW_LINE>while (r != e) {<NEW_LINE>boolean d = active == 0;<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>SwitchMapInner<R> si = (SwitchMapInner<R>) q.poll();<NEW_LINE>boolean empty = si == null;<NEW_LINE>if (checkTerminated(d, empty, a, q)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (empty) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Object second;<NEW_LINE>while ((second = q.poll()) == null) {<NEW_LINE>}<NEW_LINE>if (index == si.index) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>R v = (R) second;<NEW_LINE>a.onNext(v);<NEW_LINE>si.requestOne();<NEW_LINE>e++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (r == e) {<NEW_LINE>if (checkTerminated(active == 0, q.isEmpty(), a, q)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e != 0 && r != Long.MAX_VALUE) {<NEW_LINE>REQUESTED<MASK><NEW_LINE>}<NEW_LINE>missed = WIP.addAndGet(this, -missed);<NEW_LINE>if (missed == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.addAndGet(this, -e);
459,274
private void saveVisualComponent(RADVisualComponent component, StringBuffer buf, String indent) {<NEW_LINE>saveComponent(component, buf, indent);<NEW_LINE>if (component.isInLayeredPane()) {<NEW_LINE>formModel.raiseVersionLevel(FormModel.FormVersion.NB74, FormModel.FormVersion.NB74);<NEW_LINE>formModel.setMaxVersionLevel(FormModel.LATEST_VERSION);<NEW_LINE>}<NEW_LINE>RADVisualContainer container = component.getParentContainer();<NEW_LINE>if (container == null || container.getLayoutSupport() == null)<NEW_LINE>return;<NEW_LINE>int componentIndex = container.getIndexOf(component);<NEW_LINE>LayoutConstraints constr = container.getLayoutSupport().getConstraints(componentIndex);<NEW_LINE>if (constr == null)<NEW_LINE>// no constraints<NEW_LINE>return;<NEW_LINE>// [might be not used at all]<NEW_LINE>StringBuffer buf2 = new StringBuffer();<NEW_LINE>int convIndex = saveConstraints(constr, buf2, indent + ONE_INDENT + ONE_INDENT);<NEW_LINE>if (convIndex >= 0) {<NEW_LINE>// standard constraints (saved in buf2)<NEW_LINE>buf.append(indent);<NEW_LINE>addElementOpen(buf, XML_CONSTRAINTS);<NEW_LINE>buf.append(indent).append(ONE_INDENT);<NEW_LINE>addElementOpenAttr(buf, XML_CONSTRAINT, new String[] { ATTR_CONSTRAINT_LAYOUT, ATTR_CONSTRAINT_VALUE }, new String[] { PersistenceObjectRegistry.getPrimaryName(layout31Names[convIndex]), PersistenceObjectRegistry.getPrimaryName<MASK><NEW_LINE>buf.append(buf2);<NEW_LINE>buf.append(indent).append(ONE_INDENT);<NEW_LINE>addElementClose(buf, XML_CONSTRAINT);<NEW_LINE>buf.append(indent);<NEW_LINE>addElementClose(buf, XML_CONSTRAINTS);<NEW_LINE>}<NEW_LINE>}
(layout31ConstraintsNames[convIndex]) });
1,707,969
public void collect(MonitoringDataCollector collector) {<NEW_LINE>if (hzCore.isEnabled()) {<NEW_LINE>try (Context ctx = ctxUtil.empty().pushContext()) {<NEW_LINE>HazelcastInstance hz = hzCore.getInstance();<NEW_LINE>for (DistributedObject obj : hz.getDistributedObjects()) {<NEW_LINE>if (MapService.SERVICE_NAME.equals(obj.getServiceName())) {<NEW_LINE>MapConfig config = hz.getConfig().getMapConfig(obj.getName());<NEW_LINE>if (config.isStatisticsEnabled()) {<NEW_LINE>IMap<Object, Object> map = hz.getMap(obj.getName());<NEW_LINE>if (map != null) {<NEW_LINE><MASK><NEW_LINE>collector.in("map").group(map.getName()).collect("GetCount", stats.getGetOperationCount()).collect("PutCount", stats.getPutOperationCount()).collect("EntryCount", stats.getOwnedEntryCount());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
LocalMapStats stats = map.getLocalMapStats();
984,524
public static List<RegressionExecution> executions() {<NEW_LINE>List<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new EPLInsertIntoColBeanFromSubquerySingle("objectarray", false));<NEW_LINE>execs.add(<MASK><NEW_LINE>execs.add(new EPLInsertIntoColBeanFromSubquerySingle("map", false));<NEW_LINE>execs.add(new EPLInsertIntoColBeanFromSubquerySingle("map", true));<NEW_LINE>execs.add(new EPLInsertIntoColBeanFromSubqueryMulti("objectarray", false));<NEW_LINE>execs.add(new EPLInsertIntoColBeanFromSubqueryMulti("objectarray", true));<NEW_LINE>execs.add(new EPLInsertIntoColBeanFromSubqueryMulti("map", false));<NEW_LINE>execs.add(new EPLInsertIntoColBeanFromSubqueryMulti("map", true));<NEW_LINE>execs.add(new EPLInsertIntoColBeanSingleToMulti());<NEW_LINE>execs.add(new EPLInsertIntoColBeanMultiToSingle());<NEW_LINE>execs.add(new EPLInsertIntoColBeanInvalid());<NEW_LINE>return execs;<NEW_LINE>}
new EPLInsertIntoColBeanFromSubquerySingle("objectarray", true));
326,103
private Page<TaskInfoVO> sortAndPage(int pageNum, int pageSize, String sortType, String sortField, List<TaskInfoVO> tasks) {<NEW_LINE>if (!Sort.Direction.ASC.name().equalsIgnoreCase(sortType)) {<NEW_LINE>sortType = Sort.Direction.DESC.name();<NEW_LINE>}<NEW_LINE>ListSortUtil.sort(tasks, sortField, sortType);<NEW_LINE>int totalPageNum = 0;<NEW_LINE>int total = tasks.size();<NEW_LINE>pageNum = pageNum - 1 < 0 ? 0 : pageNum - 1;<NEW_LINE>pageSize = pageSize <= 0 ? 10 : pageSize;<NEW_LINE>if (total > 0) {<NEW_LINE>totalPageNum = (<MASK><NEW_LINE>}<NEW_LINE>int subListBeginIdx = pageNum * pageSize;<NEW_LINE>int subListEndIdx = subListBeginIdx + pageSize;<NEW_LINE>if (subListBeginIdx > total) {<NEW_LINE>subListBeginIdx = 0;<NEW_LINE>}<NEW_LINE>List<TaskInfoVO> taskInfoVoList = tasks.subList(subListBeginIdx, subListEndIdx > total ? total : subListEndIdx);<NEW_LINE>return new Page<>(total, pageNum == 0 ? 1 : pageNum, pageSize, totalPageNum, taskInfoVoList);<NEW_LINE>}
total + pageSize - 1) / pageSize;
1,460,874
public void nullityMismatchingTypeAnnotation(Expression expression, TypeBinding providedType, TypeBinding requiredType, NullAnnotationMatching status) {<NEW_LINE>// $IDENTITY-COMPARISON$<NEW_LINE>if (providedType == requiredType)<NEW_LINE>return;<NEW_LINE>// try to improve nonnull vs. null:<NEW_LINE>if (providedType.id == TypeIds.T_null || status.nullStatus == FlowInfo.NULL) {<NEW_LINE>nullityMismatchIsNull(expression, requiredType);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// try to improve nonnull vs. nullable:<NEW_LINE>if (status.isPotentiallyNullMismatch() && (requiredType.tagBits & TagBits.AnnotationNonNull) != 0 && (providedType.tagBits & TagBits.AnnotationNullable) == 0) {<NEW_LINE>if (this.options.pessimisticNullAnalysisForFreeTypeVariablesEnabled && providedType.isTypeVariable() && !providedType.hasNullTypeAnnotations()) {<NEW_LINE>nullityMismatchIsFreeTypeVariable(providedType, expression.sourceStart, expression.sourceEnd);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>nullityMismatchPotentiallyNull(expression, requiredType, this.options.nonNullAnnotationName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String[] arguments;<NEW_LINE>String[] shortArguments;<NEW_LINE>int problemId = 0;<NEW_LINE>String superHint = null;<NEW_LINE>String superHintShort = null;<NEW_LINE>if (status.superTypeHint != null && requiredType.isParameterizedType()) {<NEW_LINE>problemId = (status.isUnchecked() ? IProblem.NullityUncheckedTypeAnnotationDetailSuperHint : IProblem.NullityMismatchingTypeAnnotationSuperHint);<NEW_LINE>superHint = status.superTypeHintName(this.options, false);<NEW_LINE>superHintShort = status.superTypeHintName(this.options, true);<NEW_LINE>} else {<NEW_LINE>problemId = (status.isUnchecked() ? IProblem.NullityUncheckedTypeAnnotationDetail : (requiredType.isTypeVariable() && !requiredType.hasNullTypeAnnotations()) ? <MASK><NEW_LINE>if (problemId == IProblem.NullityMismatchAgainstFreeTypeVariable) {<NEW_LINE>// don't show bounds here<NEW_LINE>arguments = new String[] { null, null, new String(requiredType.sourceName()) };<NEW_LINE>shortArguments = new String[] { null, null, new String(requiredType.sourceName()) };<NEW_LINE>} else {<NEW_LINE>arguments = new String[2];<NEW_LINE>shortArguments = new String[2];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String requiredName;<NEW_LINE>String requiredNameShort;<NEW_LINE>if (problemId == IProblem.NullityMismatchAgainstFreeTypeVariable) {<NEW_LINE>// don't show bounds here<NEW_LINE>requiredName = new String(requiredType.sourceName());<NEW_LINE>// don't show bounds here<NEW_LINE>requiredNameShort = new String(requiredType.sourceName());<NEW_LINE>} else {<NEW_LINE>requiredName = new String(requiredType.nullAnnotatedReadableName(this.options, false));<NEW_LINE>requiredNameShort = new String(requiredType.nullAnnotatedReadableName(this.options, true));<NEW_LINE>}<NEW_LINE>String providedName = String.valueOf(providedType.nullAnnotatedReadableName(this.options, false));<NEW_LINE>String providedNameShort = String.valueOf(providedType.nullAnnotatedReadableName(this.options, true));<NEW_LINE>// assemble arguments:<NEW_LINE>if (superHint != null) {<NEW_LINE>arguments = new String[] { requiredName, providedName, superHint };<NEW_LINE>shortArguments = new String[] { requiredNameShort, providedNameShort, superHintShort };<NEW_LINE>} else {<NEW_LINE>arguments = new String[] { requiredName, providedName };<NEW_LINE>shortArguments = new String[] { requiredNameShort, providedNameShort };<NEW_LINE>}<NEW_LINE>this.handle(problemId, arguments, shortArguments, expression.sourceStart, expression.sourceEnd);<NEW_LINE>}
IProblem.NullityMismatchAgainstFreeTypeVariable : IProblem.NullityMismatchingTypeAnnotation);
1,139,193
public void generate() {<NEW_LINE>Stack<TypeElement> q = new Stack<TypeElement>();<NEW_LINE>Set<TypeElement> visited = new HashSet<TypeElement>();<NEW_LINE>q.push(clz);<NEW_LINE>while (!q.isEmpty()) {<NEW_LINE>TypeElement t = q.pop();<NEW_LINE>// been here already<NEW_LINE>if (!visited.add(t))<NEW_LINE>continue;<NEW_LINE>for (javax.lang.model.element.Element child : t.getEnclosedElements()) {<NEW_LINE>switch(child.getKind()) {<NEW_LINE>case FIELD:<NEW_LINE>{<NEW_LINE>// ElementFilter.fieldsIn<NEW_LINE>generate(new Property.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case METHOD:<NEW_LINE>{<NEW_LINE>generate(new Property.Method((ExecutableElement) child));<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (TypeMirror it : clz.getInterfaces()) q.add((TypeElement) ((DeclaredType) it).asElement());<NEW_LINE>if (ElementKind.CLASS.equals(t.getKind())) {<NEW_LINE>TypeMirror sc = t.getSuperclass();<NEW_LINE>if (!TypeKind.NONE.equals(sc.getKind()))<NEW_LINE>q.add((TypeElement) ((DeclaredType) sc).asElement());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>service.param("metadata", toCommaSeparatedString(metadata));<NEW_LINE>}
Field((VariableElement) child));
1,048,058
private ExtractConstantDescriptor createRefactoringDescriptor() {<NEW_LINE>final Map<String, String> arguments = new HashMap<>();<NEW_LINE>String project = null;<NEW_LINE>IJavaProject javaProject = fCu.getJavaProject();<NEW_LINE>if (javaProject != null) {<NEW_LINE>project = javaProject.getElementName();<NEW_LINE>}<NEW_LINE>int flags = JavaRefactoringDescriptor.JAR_REFACTORING | JavaRefactoringDescriptor.JAR_SOURCE_ATTACHMENT;<NEW_LINE>if (JdtFlags.getVisibilityCode(fVisibility) != Modifier.PRIVATE) {<NEW_LINE>flags |= RefactoringDescriptor.STRUCTURAL_CHANGE;<NEW_LINE>}<NEW_LINE>final String expression = ASTNodes.asString(fSelectedExpression.getAssociatedExpression());<NEW_LINE>final String description = Messages.format(RefactoringCoreMessages.ExtractConstantRefactoring_descriptor_description_short, BasicElementLabels.getJavaElementName(fConstantName));<NEW_LINE>final String header = Messages.format(RefactoringCoreMessages.ExtractConstantRefactoring_descriptor_description, new String[] { BasicElementLabels.getJavaElementName(fConstantName), BasicElementLabels.getJavaCodeString(expression) });<NEW_LINE>final JDTRefactoringDescriptorComment comment = new JDTRefactoringDescriptorComment(project, this, header);<NEW_LINE>comment.addSetting(Messages.format(RefactoringCoreMessages.ExtractConstantRefactoring_constant_name_pattern, BasicElementLabels.getJavaElementName(fConstantName)));<NEW_LINE>comment.addSetting(Messages.format(RefactoringCoreMessages.ExtractConstantRefactoring_constant_expression_pattern, BasicElementLabels.getJavaCodeString(expression)));<NEW_LINE>String visibility = fVisibility;<NEW_LINE>if ("".equals(visibility)) {<NEW_LINE>visibility = RefactoringCoreMessages.ExtractConstantRefactoring_default_visibility;<NEW_LINE>}<NEW_LINE>comment.addSetting(Messages.format(RefactoringCoreMessages.ExtractConstantRefactoring_visibility_pattern, visibility));<NEW_LINE>if (fReplaceAllOccurrences) {<NEW_LINE>comment.addSetting(RefactoringCoreMessages.ExtractConstantRefactoring_replace_occurrences);<NEW_LINE>}<NEW_LINE>if (fQualifyReferencesWithDeclaringClassName) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT, JavaRefactoringDescriptorUtil.elementToHandle(project, fCu));<NEW_LINE>arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME, fConstantName);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION, new Integer(fSelectionStart).toString() + " " + new Integer(fSelectionLength).toString());<NEW_LINE>arguments.put(ATTRIBUTE_REPLACE, Boolean.valueOf(fReplaceAllOccurrences).toString());<NEW_LINE>arguments.put(ATTRIBUTE_QUALIFY, Boolean.valueOf(fQualifyReferencesWithDeclaringClassName).toString());<NEW_LINE>arguments.put(ATTRIBUTE_VISIBILITY, new Integer(JdtFlags.getVisibilityCode(fVisibility)).toString());<NEW_LINE>ExtractConstantDescriptor descriptor = RefactoringSignatureDescriptorFactory.createExtractConstantDescriptor(project, description, comment.asString(), arguments, flags);<NEW_LINE>return descriptor;<NEW_LINE>}
comment.addSetting(RefactoringCoreMessages.ExtractConstantRefactoring_qualify_references);
1,226,474
public void update() {<NEW_LINE>super.update();<NEW_LINE>if (worldObj.isRemote) {<NEW_LINE>simpleAnimationIterate();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (updateNetworkTime.markTimeIfDelay(worldObj)) {<NEW_LINE>sendNetworkUpdate();<NEW_LINE>}<NEW_LINE>isActive = false;<NEW_LINE>if (currentRecipe == null) {<NEW_LINE>decreaseAnimation();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (result.fill(craftingResult.crafted.copy(), false) != craftingResult.crafted.amount) {<NEW_LINE>decreaseAnimation();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>isActive = true;<NEW_LINE>if (getBattery().getEnergyStored() >= craftingResult.energyCost) {<NEW_LINE>increaseAnimation();<NEW_LINE>} else {<NEW_LINE>decreaseAnimation();<NEW_LINE>}<NEW_LINE>if (!time.markTimeIfDelay(worldObj, craftingResult.craftingTime)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getBattery().useEnergy(craftingResult.energyCost, craftingResult.energyCost, false) > 0) {<NEW_LINE>CraftingResult<FluidStack> r = currentRecipe.craft(this, false);<NEW_LINE>if (r != null && r.crafted != null) {<NEW_LINE>// Shouldn't really happen, but its not properly documented<NEW_LINE>result.fill(r.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
crafted.copy(), true);
150,174
private static void printHelpExit(CmdLineParser parser) {<NEW_LINE>parser.getProperties().withUsageWidth(120);<NEW_LINE>parser.printUsage(System.out);<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Target Types");<NEW_LINE>for (CalibrationPatterns p : CalibrationPatterns.values()) {<NEW_LINE>System.out.println(" " + p);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Document Types");<NEW_LINE>for (PaperSize p : PaperSize.values()) {<NEW_LINE>System.out.printf(" %12s %5.0f %5.0f %s\n", p.getName(), p.width, p.height, p.getUnit().abbreviation);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Units");<NEW_LINE>for (Unit u : Unit.values()) {<NEW_LINE>System.out.printf(" %12s %3s\n", u, u.abbreviation);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Examples:");<NEW_LINE>System.out.println("-r 24 -c 28 -o target -t CIRCLE_HEXAGONAL -u cm -w 1 -d 1.2 -p LETTER");<NEW_LINE><MASK><NEW_LINE>System.out.println();<NEW_LINE>System.out.println("-r 16 -c 12 -o target -t CIRCLE_GRID -u cm -w 1 -d 1.5 -p LETTER");<NEW_LINE>System.out.println(" circle grid, grid 16x12, 1cm diameter, 1.5cm distance, on letter paper");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("-r 4 -c 3 -o target -t SQUARE_GRID -u cm -w 3 -s 3 -p LETTER");<NEW_LINE>System.out.println(" square grid, grid 4x3, 3cm squares, 3cm space, on letter paper");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("-r 7 -c 5 -o target -t CHESSBOARD -u cm -w 3 -p LETTER");<NEW_LINE>System.out.println(" chessboard, grid 7x5, 3cm squares, on letter paper");<NEW_LINE>System.out.println();<NEW_LINE>System.exit(1);<NEW_LINE>}
System.out.println(" circle hexagonal, grid 24x28, 1cm diameter, 1.2cm separation, on letter paper");
1,375,776
public void conf(JobConf job) {<NEW_LINE>super.configure(job);<NEW_LINE>this.conf = job;<NEW_LINE>this.position = new int[getNumChunks()];<NEW_LINE>this.outputDir = job.get("final.output.dir");<NEW_LINE>this.taskId = job.get("mapred.task.id");<NEW_LINE>this.checkSumType = CheckSum.fromString(job.get(VoldemortBuildAndPushJob.CHECKSUM_TYPE));<NEW_LINE>// These arrays are sparse if reducer.per.bucket is false and num.chunks > 1<NEW_LINE>this.checkSumDigestIndex = new CheckSum[getNumChunks()];<NEW_LINE>this.checkSumDigestValue = new CheckSum[getNumChunks()];<NEW_LINE>this.taskIndexFileName = new Path[getNumChunks()];<NEW_LINE>this.taskValueFileName = new Path[getNumChunks()];<NEW_LINE>this.indexFileStream = new DataOutputStream[getNumChunks()];<NEW_LINE>this.valueFileStream <MASK><NEW_LINE>this.indexFileSizeInBytes = new long[getNumChunks()];<NEW_LINE>this.valueFileSizeInBytes = new long[getNumChunks()];<NEW_LINE>String compressionCodec = conf.get(VoldemortBuildAndPushJob.REDUCER_OUTPUT_COMPRESS_CODEC, NO_COMPRESSION_CODEC);<NEW_LINE>if (conf.getBoolean(VoldemortBuildAndPushJob.REDUCER_OUTPUT_COMPRESS, false) && compressionCodec.toUpperCase(Locale.ENGLISH).equals(this.COMPRESSION_CODEC)) {<NEW_LINE>this.fileExtension = GZIP_FILE_EXTENSION;<NEW_LINE>this.isValidCompressionEnabled = true;<NEW_LINE>} else {<NEW_LINE>this.fileExtension = "";<NEW_LINE>this.isValidCompressionEnabled = false;<NEW_LINE>}<NEW_LINE>}
= new DataOutputStream[getNumChunks()];
1,273,438
public void inASTSwitchNode(ASTSwitchNode node) {<NEW_LINE>Object obj = cp.getBeforeSet(node);<NEW_LINE>if (obj == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!(obj instanceof CPFlowSet)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// before set is a non null CPFlowSet<NEW_LINE>CPFlowSet beforeSet = (CPFlowSet) obj;<NEW_LINE>Value key = node.get_Key();<NEW_LINE>if (key instanceof Local) {<NEW_LINE>Local useLocal = (Local) key;<NEW_LINE>// System.out.println("switch key is a local: "+useLocal);<NEW_LINE>Object value = beforeSet.contains(<MASK><NEW_LINE>if (value != null) {<NEW_LINE>// System.out.println("switch key Local "+useLocal+"is present in before set with value"+value);<NEW_LINE>// create constant value for the value and replace this local<NEW_LINE>// use with the constant value use<NEW_LINE>Value newValue = CPHelper.createConstant(value);<NEW_LINE>if (newValue != null) {<NEW_LINE>// System.out.println("Substituted the switch key local use with the constant value"+newValue);<NEW_LINE>node.set_Key(newValue);<NEW_LINE>} else {<NEW_LINE>// System.out.println("FAILED TO Substitute the local use with the constant value");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (key instanceof FieldRef) {<NEW_LINE>FieldRef useField = (FieldRef) key;<NEW_LINE>// System.out.println("switch key is a FieldRef which is: "+useField);<NEW_LINE>SootField usedSootField = useField.getField();<NEW_LINE>Object value = beforeSet.contains(usedSootField.getDeclaringClass().getName(), usedSootField.getName().toString());<NEW_LINE>if (value != null) {<NEW_LINE>// System.out.println("FieldRef "+usedSootField+"is present in before set with value"+value);<NEW_LINE>// create constant value for the value and replace this local<NEW_LINE>// use with the constant value use<NEW_LINE>Value newValue = CPHelper.createConstant(value);<NEW_LINE>if (newValue != null) {<NEW_LINE>// System.out.println("Substituted the constant field ref use with the constant value"+newValue);<NEW_LINE>node.set_Key(newValue);<NEW_LINE>} else {<NEW_LINE>// System.out.println("FAILED TO Substitute the constant field ref use with the constant value");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
className, useLocal.toString());
1,548,006
public HttpResponseOutputStream<StorageObject> write(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException {<NEW_LINE>final S3Object object = new S3WriteFeature(session).getDetails(file, status);<NEW_LINE>// ID for the initiated multipart upload.<NEW_LINE>final MultipartUpload multipart;<NEW_LINE>try {<NEW_LINE>final Path bucket = containerService.getContainer(file);<NEW_LINE>multipart = session.getClient().multipartStartUpload(bucket.isRoot() ? StringUtils.EMPTY : <MASK><NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Multipart upload started for %s with ID %s", multipart.getObjectKey(), multipart.getUploadId()));<NEW_LINE>}<NEW_LINE>} catch (ServiceException e) {<NEW_LINE>throw new S3ExceptionMappingService().map("Upload {0} failed", e, file);<NEW_LINE>}<NEW_LINE>final MultipartOutputStream proxy = new MultipartOutputStream(multipart, file, status);<NEW_LINE>return new HttpResponseOutputStream<StorageObject>(new MemorySegementingOutputStream(proxy, new HostPreferences(session.getHost()).getInteger("s3.upload.multipart.size")), new S3AttributesAdapter(), status) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public StorageObject getStatus() {<NEW_LINE>if (proxy.getResponse() != null) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Received response %s", proxy.getResponse()));<NEW_LINE>}<NEW_LINE>object.setContentLength(proxy.getOffset());<NEW_LINE>object.setETag(proxy.getResponse().getEtag());<NEW_LINE>if (proxy.getResponse().getVersionId() != null) {<NEW_LINE>object.addMetadata(S3Object.S3_VERSION_ID, proxy.getResponse().getVersionId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return object;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
bucket.getName(), object);