auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testMaxRequestsAndQueueCapacityDefaults() throws Exception { Configuration conf = getRawConfiguration(); final AzureBlobFileSystem fs = getFileSystem(conf); FSDataOutputStream out = fs.create(TEST_FILE_PATH); AbfsOutputStream stream = (AbfsOutputStream) out.getWrappedStream(); Assertions.assertThat(stream.getMaxConcurrentRequestCount()).describedAs( "maxConcurrentRequests should be " + getConfiguration() .getWriteMaxConcurrentRequestCount()) .isEqualTo(getConfiguration().getWriteMaxConcurrentRequestCount()); Assertions.assertThat(stream.getMaxRequestsThatCanBeQueued()).describedAs( "maxRequestsToQueue should be " + getConfiguration() .getMaxWriteRequestsToQueue()) .isEqualTo(getConfiguration().getMaxWriteRequestsToQueue()); }

Target:
public void testMaxRequestsAndQueueCapacityDefaults() throws Exception { Configuration conf = getRawConfiguration(); final AzureBlobFileSystem fs = getFileSystem(conf); try (FSDataOutputStream out = fs.create(TEST_FILE_PATH)) { AbfsOutputStream stream = (AbfsOutputStream) out.getWrappedStream(); Assertions.assertThat(stream.getMaxConcurrentRequestCount()).describedAs( "maxConcurrentRequests should be " + getConfiguration() .getWriteMaxConcurrentRequestCount()) .isEqualTo(getConfiguration().getWriteMaxConcurrentRequestCount()); Assertions.assertThat(stream.getMaxRequestsThatCanBeQueued()).describedAs( "maxRequestsToQueue should be " + getConfiguration() .getMaxWriteRequestsToQueue()) .isEqualTo(getConfiguration().getMaxWriteRequestsToQueue()); } }
Source:
protected Span getSpanFromContext(byte[] traceContext) { if (traceContext == null || traceContext.length == 0) { return BlankSpan.INSTANCE; } Tracer tracer = Tracing.getTracer(); BinaryFormat binaryFormat = Tracing.getPropagationComponent().getBinaryFormat(); try { SpanContext spanContext = binaryFormat.fromByteArray(traceContext); Span span = tracer.spanBuilderWithRemoteParent("work/" + getClass().getSimpleName(), spanContext) .startSpan(); span.addLink(Link.fromSpanContext(spanContext, Link.Type.PARENT_LINKED_SPAN)); HashMap<String, AttributeValue> map = new HashMap<>(); map.put("tx.thread", AttributeValue.stringAttributeValue(Thread.currentThread().getName())); map.put("work.id", AttributeValue.stringAttributeValue(getId())); map.put("work.category", AttributeValue.stringAttributeValue(getCategory())); map.put("work.title", AttributeValue.stringAttributeValue(getTitle())); map.put("work.parent_path", AttributeValue.stringAttributeValue(getSchedulePath().getParentPath())); map.put("work.caller_thread", AttributeValue.stringAttributeValue(callerThread)); map.put("work.to_string", AttributeValue.stringAttributeValue(toString())); if (docId != null) { map.put("work.doc_id", AttributeValue.stringAttributeValue(docId)); } if (docIds != null && !docIds.isEmpty()) { map.put("work.doc_count", AttributeValue.longAttributeValue(docIds.size())); } span.putAttributes(map); return span; } catch (SpanContextParseException e) { log.warn("No span context " + traceContext.length); } return BlankSpan.INSTANCE; }

Target:
protected Span getSpanFromContext(byte[] traceContext) { if (traceContext == null || traceContext.length == 0) { return BlankSpan.INSTANCE; } Tracer tracer = Tracing.getTracer(); BinaryFormat binaryFormat = Tracing.getPropagationComponent().getBinaryFormat(); try { SpanContext spanContext = binaryFormat.fromByteArray(traceContext); Span span = tracer.spanBuilderWithRemoteParent("work/" + getClass().getSimpleName(), spanContext) .startSpan(); span.addLink(Link.fromSpanContext(spanContext, Link.Type.PARENT_LINKED_SPAN)); HashMap<String, AttributeValue> map = new HashMap<>(); map.put("tx.thread", AttributeValue.stringAttributeValue(Thread.currentThread().getName())); map.put("work.id", AttributeValue.stringAttributeValue(getId())); map.put("work.category", AttributeValue.stringAttributeValue(getCategory())); map.put("work.title", AttributeValue.stringAttributeValue(getTitle())); map.put("work.parent_path", AttributeValue.stringAttributeValue(getSchedulePath().getParentPath())); map.put("work.caller_thread", AttributeValue.stringAttributeValue(callerThread)); map.put("work.to_string", AttributeValue.stringAttributeValue(toString())); if (docId != null) { map.put("work.doc_id", AttributeValue.stringAttributeValue(docId)); } if (docIds != null && !docIds.isEmpty()) { map.put("work.doc_count", AttributeValue.longAttributeValue(docIds.size())); } span.putAttributes(map); return span; } catch (SpanContextParseException e) { log.warn("No span context " + traceContext.length); return BlankSpan.INSTANCE; } }
Source:
public void init() { broker = LdapFactory.getInstance(getProfileName()); context.put(ExtensionProperties.AUTHOR, "The oVirt Project"); context.put(ExtensionProperties.EXTENSION_NAME, "Internal Kerberos/LDAP authentication (Built-in)"); context.put(ExtensionProperties.LICENSE, "ASL 2.0"); context.put(ExtensionProperties.HOME, "<LINK_0>"); context.put(ExtensionProperties.VERSION, "N/A"); if (passwordChangeMsgPerDomain == null) { synchronized (ProvisionalAuthenticator.class) { if (passwordChangeMsgPerDomain == null) { String changePasswordUrl = Config.<String> getValue(ConfigValues.ChangePasswordMsg); String[] pairs = changePasswordUrl.split(","); for (String pair : pairs) { String[] pairParts = pair.split(":", 2); if (pairParts.length >= 2) { try { passwordChangeMsgPerDomain.put(pairParts[0], URLDecoder.decode(pairParts[1], "UTF-8")); } catch (UnsupportedEncodingException e) { throw new AAAExtensionException(AAAExtensionError.INVALID_CONFIGURATION, "error in obtaining the password change message or url for " + pairParts[0]); } } } } } } passwordChangeMsgUrl = passwordChangeMsgPerDomain.get(getProfileName()); }

Target:
public void init() { broker = LdapFactory.getInstance(getProfileName()); context.put(ExtensionProperties.AUTHOR, "The oVirt Project"); context.put(ExtensionProperties.EXTENSION_NAME, "Internal Kerberos/LDAP authentication (Built-in)"); context.put(ExtensionProperties.LICENSE, "ASL 2.0"); context.put(ExtensionProperties.HOME, "<LINK_0>"); context.put(ExtensionProperties.VERSION, "N/A"); if (passwordChangeMsgPerDomain == null) { synchronized (ProvisionalAuthenticator.class) { if (passwordChangeMsgPerDomain == null) { String changePasswordUrl = Config.<String> getValue(ConfigValues.ChangePasswordMsg); String[] pairs = changePasswordUrl.split(","); for (String pair : pairs) { String[] pairParts = pair.split(":", 2); if (pairParts.length >= 2) { try { passwordChangeMsgPerDomain.put(pairParts[0], URLDecoder.decode(pairParts[1], "UTF-8")); } catch (UnsupportedEncodingException e) { throw new AAAExtensionException(AAAExtensionError.INVALID_CONFIGURATION, "error in obtaining the password change message or url for " + pairParts[0]); } } } } } } String changePasswordMsgOrUrl = passwordChangeMsgPerDomain.get(getProfileName()); if (changePasswordMsgOrUrl != null) { ExtensionProperties key = containsURL(changePasswordMsgOrUrl) ? ExtensionProperties.CHANGE_EXPIRED_PASSWORD_URL : ExtensionProperties.CHANGE_EXPIRED_PASSWORD_MSG; context.put(key, changePasswordMsgOrUrl); } }
Source:
public void itShouldSetOptionalAttributes() { try { final Set<Integer> zoneIds = new HashSet(Arrays.asList(10, 11, 12)); final int campaignId = 100; final int flightId = 3; final int adId = 42; final String clickUrl = "clickUrl"; final Set<Integer> eventIds = new HashSet(Arrays.asList(1, 2, 3)); Placement div1 = new Placement("div1", 9999, 77777, 5, 6); div1.setZoneIds(zoneIds); div1.setCampaignId(campaignId); div1.setFlightId(flightId); div1.setAdId(adId); div1.setClickUrl(clickUrl); div1.setEventIds(eventIds); assertThat(div1.getZoneIds()).containsAll(zoneIds); assertThat(div1.getCampaignId()).isEqualTo(campaignId); assertThat(div1.getFlightId()).isEqualTo(flightId); assertThat(div1.getAdId()).isEqualTo(adId); assertThat(div1.getClickUrl()).isEqualTo(clickUrl); assertThat(div1.getEventIds()).containsAll(eventIds); } catch(IllegalArgumentException e) { fail("Should not throw exception: " + e.getMessage()); } }

Target:
public void itShouldSetOptionalAttributes() { try { final Set<Integer> zoneIds = new HashSet(Arrays.asList(10, 11, 12)); final int campaignId = 100; final int flightId = 3; final int adId = 42; final String clickUrl = "clickUrl"; final Set<Integer> eventIds = new HashSet(Arrays.asList(1, 2, 3)); Placement div1 = new Placement("div1", 9999, 77777, 5, 6) .setZoneIds(zoneIds) .setCampaignId(campaignId) .setFlightId(flightId) .setAdId(adId) .setClickUrl(clickUrl) .setEventIds(eventIds); assertThat(div1.getZoneIds()).containsAll(zoneIds); assertThat(div1.getCampaignId()).isEqualTo(campaignId); assertThat(div1.getFlightId()).isEqualTo(flightId); assertThat(div1.getAdId()).isEqualTo(adId); assertThat(div1.getClickUrl()).isEqualTo(clickUrl); assertThat(div1.getEventIds()).containsAll(eventIds); } catch(IllegalArgumentException e) { fail("Should not throw exception: " + e.getMessage()); } }
Source:
private void loadCaCert() { InputStream inStream = null; try { String httpsCertPath = getFilesDir()+"/"+SyncthingService.HTTPS_CERT_FILE; inStream = new FileInputStream(httpsCertPath); CertificateFactory cf = CertificateFactory.getInstance("X.509"); mCaCert = (X509Certificate) cf.generateCertificate(inStream); } catch (Exception e) { throw new IllegalArgumentException("Untrusted Certificate!"); } finally { try { if (inStream != null) inStream.close(); } catch (IOException e) { e.printStackTrace(); } } }

Target:
private void loadCaCert() { InputStream inStream = null; try { String httpsCertPath = getFilesDir() + "/" + SyncthingService.HTTPS_CERT_FILE; inStream = new FileInputStream(httpsCertPath); CertificateFactory cf = CertificateFactory.getInstance("X.509"); mCaCert = (X509Certificate) cf.generateCertificate(inStream); } catch (FileNotFoundException|CertificateException e) { throw new IllegalArgumentException("Untrusted Certificate"); } finally { try { if (inStream != null) inStream.close(); } catch (IOException e) { Log.w(TAG, e); } } }
Source:
public void validate() throws ConfigurationException { verifyNotNull("name", _name); verifyNotNull("guid", _guid); verifyNotNull("zone", _zoneId); verifyNotNull("hostname", _hostName); verifyNotNull("CMS username", _cmsUser); verifyNotNull("CMS password", _cmsUserPassword); if (org.apache.commons.lang.StringUtils.isBlank(_apiVersion)) { throw new ConfigurationException("Unable to find API version"); } try { new NuageVspApiVersion(_apiVersion); } catch(IllegalArgumentException e) { throw new ConfigurationException("Incorrect API version"); } verifyNotEmpty("number of retries", _retryCount); verifyNotEmpty("retry interval", _retryInterval); }

Target:
public void validate() throws ConfigurationException { verifyNotNull("name", _name); verifyNotNull("guid", _guid); verifyNotNull("zone", _zoneId); verifyNotNull("hostname", _hostName); verifyNotNull("CMS username", _cmsUser); verifyNotNull("CMS password", _cmsUserPassword); verifyNotEmpty("API version", _apiVersion); try { new NuageVspApiVersion(_apiVersion); } catch(IllegalArgumentException e) { throw new ConfigurationException("Incorrect API version"); } verifyNotEmpty("number of retries", _retryCount); verifyNotEmpty("retry interval", _retryInterval); }
Source:
public String toString() { return Objects.toStringHelper(this).omitNullValues().add("id", id).add("userId", userId).add("projectId", projectId).add("source", source).add("firstSanpleTimestamp", firstSanpleTimestamp) .add("lastSanpleTimestamp", lastSampleTimeStamp).toString(); }

Target:
public String toString() { return Objects.toStringHelper(this).omitNullValues().add("id", id).add("userId", userId).add("projectId", projectId).add("source", source).add("firstSanpleTimestamp", firstSampleTimestamp) .add("lastSanpleTimestamp", lastSampleTimeStamp).toString(); }
Source:
public void animateLayouts(View view){ if (view == null) { logger.warn("Null view cannot be animated!"); return; } ViewAnimationUtil messageController; ViewAnimationUtil.showMessageBar(view); }

Target:
public void animateLayouts(View view){ if (view == null) { logger.warn("Null view cannot be animated!"); return; } ViewAnimationUtil.showMessageBar(view); }
Source:
public static String getValueFromRowAsString(TelemetryBis.TelemetryField row, String name) { for (TelemetryBis.TelemetryField nestedField : row.getFieldsList()) { TelemetryBis.TelemetryField subField = findFieldWithName(nestedField, name); if (subField != null) { return subField.getStringValue(); } } return ""; }

Target:
public static String getValueFromRowAsString(TelemetryBis.TelemetryField row, String name) { if (Objects.isNull(row) || Objects.isNull(name)) { return null; } for (TelemetryBis.TelemetryField nestedField : row.getFieldsList()) { TelemetryBis.TelemetryField subField = findFieldWithName(nestedField, name); if (subField != null) { return getStringValue(subField); } } return null; }
Source:
public FeedbackResponseDetails getFeedbackResponseDetailsInstance(FeedbackQuestionDetails questionDetails, String[] answer, Map<String, String[]> requestParameters, int questionIndx, int responseIndx) { FeedbackResponseDetails feedbackResponseDetails = null; switch (this) { case TEXT: feedbackResponseDetails = new FeedbackTextResponseDetails(); break; case MCQ: feedbackResponseDetails = new FeedbackMcqResponseDetails(); answer = appendOtherOptionFlagToAnswer(answer, requestParameters, questionIndx, responseIndx); break; case MSQ: feedbackResponseDetails = new FeedbackMsqResponseDetails(); break; case NUMSCALE: feedbackResponseDetails = new FeedbackNumericalScaleResponseDetails(); break; case CONSTSUM: feedbackResponseDetails = new FeedbackConstantSumResponseDetails(); break; case CONTRIB: feedbackResponseDetails = new FeedbackContributionResponseDetails(); break; case RUBRIC: feedbackResponseDetails = new FeedbackRubricResponseDetails(); break; default: Assumption.fail("Failed to instantiate Feedback*ResponseDetails instance for " + this.toString() + " question type."); return null; } try { feedbackResponseDetails.extractResponseDetails(this, questionDetails, answer); } catch (Exception e) { e.printStackTrace(); Utils.getLogger().warning("Failed to extract response details.\n" + e.toString()); return null; } return feedbackResponseDetails; }

Target:
public FeedbackResponseDetails getFeedbackResponseDetailsInstance(FeedbackQuestionDetails questionDetails, String[] answer, Map<String, String[]> requestParameters, int questionIndx, int responseIndx) { FeedbackResponseDetails feedbackResponseDetails = null; switch (this) { case TEXT: feedbackResponseDetails = new FeedbackTextResponseDetails(); break; case MCQ: feedbackResponseDetails = new FeedbackMcqResponseDetails(); break; case MSQ: feedbackResponseDetails = new FeedbackMsqResponseDetails(); break; case NUMSCALE: feedbackResponseDetails = new FeedbackNumericalScaleResponseDetails(); break; case CONSTSUM: feedbackResponseDetails = new FeedbackConstantSumResponseDetails(); break; case CONTRIB: feedbackResponseDetails = new FeedbackContributionResponseDetails(); break; case RUBRIC: feedbackResponseDetails = new FeedbackRubricResponseDetails(); break; default: Assumption.fail("Failed to instantiate Feedback*ResponseDetails instance for " + this.toString() + " question type."); return null; } try { switch (this) { case MCQ: ((FeedbackMcqResponseDetails) feedbackResponseDetails).extractResponseDetails( this, questionDetails, answer, requestParameters, questionIndx, responseIndx); break; default: feedbackResponseDetails.extractResponseDetails(this, questionDetails, answer); } } catch (Exception e) { Utils.getLogger().warning("Failed to extract response details.\n" + e.toString()); return null; } return feedbackResponseDetails; }
Source:
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if(deploymentUnit.getParent() == null) { final EEResourceReferenceProcessorRegistry eeResourceReferenceProcessorRegistry = deploymentUnit.getAttachment(Attachments.RESOURCE_REFERENCE_PROCESSOR_REGISTRY); if (eeResourceReferenceProcessorRegistry != null) { final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if (eeModuleDescription != null && eeModuleDescription.getDefaultResourceJndiNames().getDataSource() != null) { eeResourceReferenceProcessorRegistry.registerResourceReferenceProcessor(RESOURCE_REFERENCE_PROCESSOR); } } } }

Target:
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if(deploymentUnit.getParent() == null) { final EEResourceReferenceProcessorRegistry eeResourceReferenceProcessorRegistry = deploymentUnit.getAttachment(Attachments.RESOURCE_REFERENCE_PROCESSOR_REGISTRY); if (eeResourceReferenceProcessorRegistry != null) { final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if (eeModuleDescription != null && eeModuleDescription.getDefaultResourceJndiNames().getJmsConnectionFactory() != null) { eeResourceReferenceProcessorRegistry.registerResourceReferenceProcessor(RESOURCE_REFERENCE_PROCESSOR); } } } }
Source:
public FakeLLRealtimeSegmentDataManager(RealtimeSegmentZKMetadata segmentZKMetadata, TableConfig tableConfig, RealtimeTableDataManager realtimeTableDataManager, String resourceDataDir, Schema schema, LLCSegmentName llcSegmentName, Map<Integer, Semaphore> semaphoreMap, ServerMetrics serverMetrics) throws Exception { super(segmentZKMetadata, tableConfig, realtimeTableDataManager, resourceDataDir, new IndexLoadingConfig(makeInstanceDataManagerConfig(), tableConfig), schema, llcSegmentName, semaphoreMap.get(llcSegmentName.getPartitionId()), serverMetrics, new PartitionUpsertMetadataManager("testTable", 0, Mockito.mock(ServerMetrics.class))); _state = LLRealtimeSegmentDataManager.class.getDeclaredField("_state"); _state.setAccessible(true); _shouldStop = LLRealtimeSegmentDataManager.class.getDeclaredField("_shouldStop"); _shouldStop.setAccessible(true); _stopReason = LLRealtimeSegmentDataManager.class.getDeclaredField("_stopReason"); _stopReason.setAccessible(true); _semaphoreMap = semaphoreMap; _streamMsgOffsetFactory = LLRealtimeSegmentDataManager.class.getDeclaredField("_streamPartitionMsgOffsetFactory"); _streamMsgOffsetFactory.setAccessible(true); _streamMsgOffsetFactory.set(this, new LongMsgOffsetFactory()); }

Target:
public FakeLLRealtimeSegmentDataManager(RealtimeSegmentZKMetadata segmentZKMetadata, TableConfig tableConfig, RealtimeTableDataManager realtimeTableDataManager, String resourceDataDir, Schema schema, LLCSegmentName llcSegmentName, Map<Integer, Semaphore> semaphoreMap, ServerMetrics serverMetrics) throws Exception { super(segmentZKMetadata, tableConfig, realtimeTableDataManager, resourceDataDir, new IndexLoadingConfig(makeInstanceDataManagerConfig(), tableConfig), schema, llcSegmentName, semaphoreMap.get(llcSegmentName.getPartitionId()), serverMetrics, new PartitionUpsertMetadataManager("testTable_REALTIME", 0, serverMetrics)); _state = LLRealtimeSegmentDataManager.class.getDeclaredField("_state"); _state.setAccessible(true); _shouldStop = LLRealtimeSegmentDataManager.class.getDeclaredField("_shouldStop"); _shouldStop.setAccessible(true); _stopReason = LLRealtimeSegmentDataManager.class.getDeclaredField("_stopReason"); _stopReason.setAccessible(true); _semaphoreMap = semaphoreMap; _streamMsgOffsetFactory = LLRealtimeSegmentDataManager.class.getDeclaredField("_streamPartitionMsgOffsetFactory"); _streamMsgOffsetFactory.setAccessible(true); _streamMsgOffsetFactory.set(this, new LongMsgOffsetFactory()); }
Source:
public void loadStatistics() throws IOException, ParseException { String statisticsFilePath = getConfiguration().getStatisticsFilePath(); if(statisticsFilePath != null && !statisticsFilePath.isEmpty()){ File statisticsFile = new File(statisticsFilePath); if(statisticsFile != null && statisticsFile.exists()){ loadStatistics(statisticsFile); } } }

Target:
public void loadStatistics() throws IOException, ParseException { String statisticsFilePath = getConfiguration().getStatisticsFilePath(); if(statisticsFilePath == null) { throw new IOException("Statistics File path not found"); } loadStatistics(new File(statisticsFilePath)); }
Source:
public boolean visit(CssRule x, Context ctx) { List<CssProperty> properties = x.getProperties(); Set<String> duplicatePropertyNames = new HashSet<>(); Set<String> seenPropertyNames = new HashSet<>(); for (CssProperty cssProperty : properties) { String name = cssProperty.getName(); if(!seenPropertyNames.contains(name)) { seenPropertyNames.add(name); } else { duplicatePropertyNames.add(name); } } for (String dupName : duplicatePropertyNames) { boolean firstProperty = true; for (CssProperty cssProperty : properties) { String name = cssProperty.getName(); if(name.equals(dupName)) { if(firstProperty) { firstProperty = false; } else { cssProperty.setName(" " + name); } } } } return false; }

Target:
public boolean visit(CssRule x, Context ctx) { List<CssProperty> properties = x.getProperties(); Set<String> duplicatePropertyNames = new HashSet<String>(); Set<String> seenPropertyNames = new HashSet<String>(); for (CssProperty cssProperty : properties) { String name = cssProperty.getName(); if(!seenPropertyNames.contains(name)) { seenPropertyNames.add(name); } else { duplicatePropertyNames.add(name); } } for (String dupName : duplicatePropertyNames) { boolean firstProperty = true; for (CssProperty cssProperty : properties) { String name = cssProperty.getName(); if(name.equals(dupName)) { if(firstProperty) { firstProperty = false; } else { cssProperty.setName(" " + name); } } } } return false; }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Header header = (Header) o; return fileLength == header.fileLength && totalNumberOfRecords == header.totalNumberOfRecords && granularity == header.granularity && Arrays.equals(md5, header.md5) && Arrays.equals(uuid, header.uuid); }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final Header header = (Header) o; return fileLength == header.fileLength && totalNumberOfRecords == header.totalNumberOfRecords && granularity == header.granularity && Arrays.equals(md5, header.md5) && Arrays.equals(uuid, header.uuid); }
Source:
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { getPreferenceManager().setSharedPreferencesName(ADMIN_PREFERENCES); setPreferencesFromResource(R.xml.admin_preferences, rootKey); ((CollectAbstractActivity) getActivity()).initToolbar(getPreferenceScreen().getTitle()); findPreference("odk_preferences").setOnPreferenceClickListener(this); findPreference(KEY_CHANGE_ADMIN_PASSWORD).setOnPreferenceClickListener(this); findPreference(KEY_IMPORT_SETTINGS).setOnPreferenceClickListener(this); findPreference("main_menu").setOnPreferenceClickListener(this); findPreference("user_settings").setOnPreferenceClickListener(this); findPreference("form_entry").setOnPreferenceClickListener(this); findPreference("save_legacy_settings").setOnPreferenceClickListener(this); }

Target:
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { getPreferenceManager().setSharedPreferencesName(ADMIN_PREFERENCES); setPreferencesFromResource(R.xml.admin_preferences, rootKey); findPreference("odk_preferences").setOnPreferenceClickListener(this); findPreference(KEY_CHANGE_ADMIN_PASSWORD).setOnPreferenceClickListener(this); findPreference(KEY_IMPORT_SETTINGS).setOnPreferenceClickListener(this); findPreference("main_menu").setOnPreferenceClickListener(this); findPreference("user_settings").setOnPreferenceClickListener(this); findPreference("form_entry").setOnPreferenceClickListener(this); findPreference("save_legacy_settings").setOnPreferenceClickListener(this); }
Source:
public BooleanWrapper shutdown(boolean preempt) { if (toShutDown) return new BooleanWrapper(false); logger.info("RMCore shutdown request"); this.monitoring.rmEvent(new RMEvent(RMEventType.SHUTTING_DOWN)); this.toShutDown = true; if (PAResourceManagerProperties.RM_PRESERVE_NODES_ON_SHUTDOWN.getValueAsBoolean() || this.deployedNodeSources.size() == 0) { finalizeShutdown(); } else { for (Entry<String, NodeSource> entry : this.deployedNodeSources.entrySet()) { removeAllNodes(entry.getKey(), preempt, true); entry.getValue().shutdown(caller); } boolean atLeastOneAlive = false; int millisBeforeHardShutdown = 0; do { millisBeforeHardShutdown++; try { Thread.sleep(100); } catch (InterruptedException e) { logger.warn("", e); } for (Entry<String, NodeSource> entry : this.deployedNodeSources.entrySet()) { atLeastOneAlive = atLeastOneAlive || PAActiveObject.pingActiveObject(entry.getValue()); } } while (atLeastOneAlive && millisBeforeHardShutdown < PAResourceManagerProperties.RM_SHUTDOWN_TIMEOUT.getValueAsInt()); finalizeShutdown(); } return new BooleanWrapper(true); }

Target:
public BooleanWrapper shutdown(boolean preempt) { if (toShutDown) return new BooleanWrapper(false); logger.info("RMCore shutdown request"); this.monitoring.rmEvent(new RMEvent(RMEventType.SHUTTING_DOWN)); this.toShutDown = true; if (PAResourceManagerProperties.RM_PRESERVE_NODES_ON_SHUTDOWN.getValueAsBoolean() || this.deployedNodeSources.size() == 0) { finalizeShutdown(); } else { for (Entry<String, NodeSource> entry : this.deployedNodeSources.entrySet()) { removeAllNodes(entry.getKey(), preempt, true); entry.getValue().shutdown(caller); } waitForAllNodeSourcesToBeShutdown(); finalizeShutdown(); } return new BooleanWrapper(true); }
Source:
public boolean requestRouteToHostAddress(int networkType, String hostAddress) { enforceChangePermission(); if (!ConnectivityManager.isNetworkTypeValid(networkType)) { return false; } NetworkStateTracker tracker = mNetTrackers[networkType]; if (!tracker.getNetworkInfo().isConnected() || tracker.isTeardownRequested()) { if (DBG) { Slog.d(TAG, "requestRouteToHostAddress on down network " + "(" + networkType + ") - dropped"); } return false; } try { InetAddress inetAddress = InetAddress.getByName(hostAddress); return tracker.requestRouteToHost(inetAddress); } catch (UnknownHostException e) { return false; } }

Target:
public boolean requestRouteToHostAddress(int networkType, String hostAddress) { enforceChangePermission(); if (!ConnectivityManager.isNetworkTypeValid(networkType)) { return false; } NetworkStateTracker tracker = mNetTrackers[networkType]; if (tracker == null || !tracker.getNetworkInfo().isConnected() || tracker.isTeardownRequested()) { if (DBG) { Slog.d(TAG, "requestRouteToHostAddress on down network " + "(" + networkType + ") - dropped"); } return false; } try { InetAddress inetAddress = InetAddress.getByName(hostAddress); return tracker.requestRouteToHost(inetAddress); } catch (UnknownHostException e) { return false; } }
Source:
public void nullToString() { try { assertEquals(new NullToString(), new NullToString()); } catch (AssertionError e) { assertEquals("expected: org.junit.tests.assertion.AssertionTest$NullToString<null> but " + "was: org.junit.tests.assertion.AssertionTest$NullToString<null>", e.getMessage()); return; } fail("Failed on assertion."); }

Target:
public void nullToString() { try { assertEquals(new NullToString(), new NullToString()); } catch (AssertionError e) { assertEquals("expected: org.junit.tests.assertion.AssertionTest$NullToString<null> but " + "was: org.junit.tests.assertion.AssertionTest$NullToString<null>", e.getMessage()); return; } fail("AssertionError expected"); }
Source:
public void _provlar(CommandInterpreter interpreter) { String urlString = processArgument(interpreter.nextArgument()); if (urlString == null) { URI[] repositories = ProvisioningHelper.getArtifactRepositories(agent); if (repositories == null) return; for (URI repositorie : repositories) { interpreter.println(repositorie); } return; } URI repoURL = toURI(interpreter, urlString); if (repoURL == null) return; IArtifactRepository repo = ProvisioningHelper.getArtifactRepository(agent, repoURL); IQueryResult<IArtifactKey> keys = null; try { keys = (repo != null) ? repo.query(ArtifactKeyQuery.ALL_KEYS, null) : null; } catch (UnsupportedOperationException e) { interpreter.println("Repository does not support queries."); return; } if (keys == null || keys.isEmpty()) { interpreter.println("Repository has no artifacts"); return; } IFileArtifactRepository fileRepo = repo.getAdapter(IFileArtifactRepository.class); for (Iterator<IArtifactKey> iterator = keys.iterator(); iterator.hasNext();) { IArtifactKey key = iterator.next(); IArtifactDescriptor[] descriptors = repo.getArtifactDescriptors(key); for (IArtifactDescriptor descriptor : descriptors) { File location = null; if (fileRepo != null) location = fileRepo.getArtifactFile(descriptor); println(interpreter, key, location); } } }

Target:
public void _provlar(CommandInterpreter interpreter) { String urlString = processArgument(interpreter.nextArgument()); if (urlString == null) { URI[] repositories = ProvisioningHelper.getArtifactRepositories(agent); if (repositories == null) return; for (URI repository : repositories) { interpreter.println(repository); } return; } URI repoURL = toURI(interpreter, urlString); if (repoURL == null) return; IArtifactRepository repo = ProvisioningHelper.getArtifactRepository(agent, repoURL); IQueryResult<IArtifactKey> keys = null; try { keys = (repo != null) ? repo.query(ArtifactKeyQuery.ALL_KEYS, null) : null; } catch (UnsupportedOperationException e) { interpreter.println("Repository does not support queries."); return; } if (keys == null || keys.isEmpty()) { interpreter.println("Repository has no artifacts"); return; } IFileArtifactRepository fileRepo = repo.getAdapter(IFileArtifactRepository.class); for (IArtifactKey key : keys) { IArtifactDescriptor[] descriptors = repo.getArtifactDescriptors(key); for (IArtifactDescriptor descriptor : descriptors) { File location = null; if (fileRepo != null) location = fileRepo.getArtifactFile(descriptor); println(interpreter, key, location); } } }
Source:
public MessageCodec<?> find(int opcode) { if (opcode < 0 || opcode > opcodeTable.length + 1) { throw new IllegalArgumentException("Opcode " + opcode + " is out of bounds"); } return opcodeTable[opcode]; }

Target:
public MessageCodec<?> find(int opcode) { if (opcode < 0 || opcode >= opcodeTable.length) { throw new IllegalArgumentException("Opcode " + opcode + " is out of bounds"); } return opcodeTable[opcode]; }
Source:
public <T> T readValue(@Nonnull final IMAPResponse[] content, @Nonnull final Class<T> valueType) throws ImapAsyncClientException, ProtocolException { if (valueType == Capability.class) { return (T) parser.parseToCapabilities(content); } if (valueType == AppendUID.class) { return (T) parser.parseToAppendUid(content); } if (valueType == CopyUID.class) { return (T) parser.parseToCopyUid(content); } if (valueType == ExtensionMailboxInfo.class) { return (T) parser.parseToExtensionMailboxInfo(content); } if (valueType == MailboxInfo.class) { return (T) parser.parseToMailboxInfo(content); } if (valueType == ListInfoList.class) { return (T) parser.parseToListInfoList(content); } if (valueType == Status.class) { return (T) parser.parseToStatus(content); } if (valueType == IdResult.class) { return (T) parser.parseToIdResult(content); } if (valueType == SearchResult.class) { return (T) parser.parseToSearchResult(content); } return readValue(content, valueType, EMPTY_FETCH_ITEMS); }

Target:
public <T> T readValue(@Nonnull final IMAPResponse[] content, @Nonnull final Class<T> valueType) throws ImapAsyncClientException, ParsingException { if (valueType == Capability.class) { return (T) parser.parseToCapabilities(content); } if (valueType == AppendUID.class) { return (T) parser.parseToAppendUid(content); } if (valueType == CopyUID.class) { return (T) parser.parseToCopyUid(content); } if (valueType == ExtensionMailboxInfo.class) { return (T) parser.parseToExtensionMailboxInfo(content); } if (valueType == MailboxInfo.class) { return (T) parser.parseToMailboxInfo(content); } if (valueType == ListInfoList.class) { return (T) parser.parseToListInfoList(content); } if (valueType == Status.class) { return (T) parser.parseToStatus(content); } if (valueType == IdResult.class) { return (T) parser.parseToIdResult(content); } if (valueType == SearchResult.class) { return (T) parser.parseToSearchResult(content); } if (valueType == FetchResult.class) { return (T) parser.parseToFetchResult(content, new FetchItem[0]); } if (valueType == StoreResult.class) { return (T) parser.parseToStoreResult(content); } throw new ImapAsyncClientException(FailureType.UNKNOWN_PARSE_RESULT_TYPE); }
Source:
public StoreConfig(VerifiableProperties verifiableProperties) { storeKeyFactory = verifiableProperties.getString("store.key.factory", "com.github.ambry.commons.BlobIdFactory"); storeDataFlushIntervalSeconds = verifiableProperties.getLong("store.data.flush.interval.seconds", 60); storeIndexMaxMemorySizeBytes = verifiableProperties.getInt("store.index.max.memory.size.bytes", 20 * 1024 * 1024); storeDataFlushDelaySeconds = verifiableProperties.getInt("store.data.flush.delay.seconds", 5); storeIndexMaxNumberOfInmemElements = verifiableProperties.getInt("store.index.max.number.of.inmem.elements", 10000); storeIndexBloomMaxFalsePositiveProbability = verifiableProperties.getDoubleInRange("store.index.bloom.max.false.positive.probability", 0.01, 0.0, 1.0); storeJournalFactory = verifiableProperties.getString("store.journal.factory", "com.github.ambry.store.InMemoryJournalFactory"); storeMaxNumberOfEntriesToReturnFromJournal = verifiableProperties.getIntInRange("store.max.number.of.entries.to.return.from.journal", 5000, 1, 10000); storeDeletedMessageRetentionDays = verifiableProperties.getIntInRange("store.deleted.message.retention.days", 7, (int) (storeDataFlushIntervalSeconds / (24 * 3600)) + 1, 365); storeHardDeleteBytesPerSec = verifiableProperties.getInt("store.hard.delete.bytes.per.sec", 1 * 1024 * 1024); storeEnableHardDelete = verifiableProperties.getBoolean("store.enable.hard.delete", false); }

Target:
public StoreConfig(VerifiableProperties verifiableProperties) { storeKeyFactory = verifiableProperties.getString("store.key.factory", "com.github.ambry.commons.BlobIdFactory"); storeDataFlushIntervalSeconds = verifiableProperties.getLong("store.data.flush.interval.seconds", 60); storeIndexMaxMemorySizeBytes = verifiableProperties.getInt("store.index.max.memory.size.bytes", 20 * 1024 * 1024); storeDataFlushDelaySeconds = verifiableProperties.getInt("store.data.flush.delay.seconds", 5); storeIndexMaxNumberOfInmemElements = verifiableProperties.getInt("store.index.max.number.of.inmem.elements", 10000); storeIndexBloomMaxFalsePositiveProbability = verifiableProperties.getDoubleInRange("store.index.bloom.max.false.positive.probability", 0.01, 0.0, 1.0); storeJournalFactory = verifiableProperties.getString("store.journal.factory", "com.github.ambry.store.InMemoryJournalFactory"); storeMaxNumberOfEntriesToReturnFromJournal = verifiableProperties.getIntInRange("store.max.number.of.entries.to.return.from.journal", 5000, 1, 10000); storeDeletedMessageRetentionDays = verifiableProperties.getInt("store.deleted.message.retention.days", 7); storeHardDeleteBytesPerSec = verifiableProperties.getInt("store.hard.delete.bytes.per.sec", 1 * 1024 * 1024); storeEnableHardDelete = verifiableProperties.getBoolean("store.enable.hard.delete", false); }
Source:
public void run() { logger.debug("Connecting to ipaddress on port {}", ipAddress, port, passwd); pluginReference.myPlant = new MyHomeJavaConnector(ipAddress, port, passwd); try { pluginReference.myPlant.startMonitoring(); while (!Thread.interrupted()) { try { String readFrame = pluginReference.myPlant.readMonitoring(); if (readFrame != null) { buildEventFromFrame(readFrame); } } catch (InterruptedException ex) { logger.error("MonitorSessionThread.run, exception : " + ex.getMessage()); } } } catch (IOException ex) { logger.error("MonitorSessionThread.run, exception : " + ex.getMessage()); } logger.info("Stopped MonitorSessionThread thread"); }

Target:
public void run() { logger.debug("Connecting to ipaddress on port with passord {}", ipAddress, port, passwd); pluginReference.myPlant = new MyHomeJavaConnector(ipAddress, port, passwd); try { pluginReference.myPlant.startMonitoring(); while (!Thread.interrupted()) { try { String readFrame = pluginReference.myPlant.readMonitoring(); if (readFrame != null) { buildEventFromFrame(readFrame); } } catch (InterruptedException ex) { logger.error("MonitorSessionThread.run, exception : " + ex.getMessage()); } } } catch (IOException ex) { logger.error("MonitorSessionThread.run, exception : " + ex.getMessage()); } logger.info("Stopped MonitorSessionThread thread"); }
Source:
public Object compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); final SummaryStatistics[] stats = new SummaryStatistics[sketch.getNumValues()]; for (int i = 0; i < stats.length; i++) { stats[i] = new SummaryStatistics(); } final ArrayOfDoublesSketchIterator it = sketch.iterator(); while (it.next()) { final double[] values = it.getValues(); for (int i = 0; i < values.length; i++) { stats[i].addValue(values[i]); } } final double[] variances = new double[sketch.getNumValues()]; for (int i = 0; i < variances.length; i++) { variances[i] = stats[i].getVariance(); } return variances; }

Target:
public double[] compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); final SummaryStatistics[] stats = new SummaryStatistics[sketch.getNumValues()]; Arrays.setAll(stats, i -> new SummaryStatistics()); final ArrayOfDoublesSketchIterator it = sketch.iterator(); while (it.next()) { final double[] values = it.getValues(); for (int i = 0; i < values.length; i++) { stats[i].addValue(values[i]); } } final double[] variances = new double[sketch.getNumValues()]; Arrays.setAll(variances, i -> stats[i].getVariance()); return variances; }
Source:
public RScheduledFuture<?> scheduleAsync(Runnable task, CronSchedule cronSchedule) { check(task); byte[] classBody = getClassBody(task); byte[] state = encode(task); final Date startDate = cronSchedule.getExpression().getNextValidTimeAfter(new Date()); if (startDate == null) { throw new IllegalArgumentException("Wrong cron expression! Unable to calculate start date"); } long startTime = startDate.getTime(); RemotePromise<Void> result = (RemotePromise<Void>) asyncScheduledServiceAtFixed.schedule(task.getClass().getName(), classBody, state, startTime, cronSchedule.getExpression(), executorId, null); addListener(result); RedissonScheduledFuture<Void> f = new RedissonScheduledFuture<Void>(result, startTime) { public long getDelay(TimeUnit unit) { return unit.convert(startDate.getTime() - System.currentTimeMillis(), TimeUnit.MILLISECONDS); }; }; storeReference(f, result.getRequestId()); return f; }

Target:
public RScheduledFuture<?> scheduleAsync(Runnable task, CronSchedule cronSchedule) { check(task); byte[] classBody = getClassBody(task); byte[] state = encode(task); final Date startDate = cronSchedule.getExpression().getNextValidTimeAfter(new Date()); if (startDate == null) { throw new IllegalArgumentException("Wrong cron expression! Unable to calculate start date"); } long startTime = startDate.getTime(); RemotePromise<Void> result = (RemotePromise<Void>) asyncScheduledServiceAtFixed.schedule(task.getClass().getName(), classBody, state, startTime, cronSchedule.getExpression().getCronExpression(),cronSchedule.getExpression().getTimeZone().getID(), executorId, null); addListener(result); RedissonScheduledFuture<Void> f = new RedissonScheduledFuture<Void>(result, startTime) { public long getDelay(TimeUnit unit) { return unit.convert(startDate.getTime() - System.currentTimeMillis(), TimeUnit.MILLISECONDS); }; }; storeReference(f, result.getRequestId()); return f; }
Source:
public void visitNewExpression(NewExpressionTree tree) { ExpressionTree expression = tree.expression(); if (expression.is(Tree.Kind.IDENTIFIER_REFERENCE)) { String next = ((IdentifierTree) expression).name(); if ("Array".equals(next)) { addIssue(tree, MESSAGE); } } super.visitNewExpression(tree); }

Target:
public void visitNewExpression(NewExpressionTree tree) { ExpressionTree expression = tree.expression(); if (expression.is(Tree.Kind.IDENTIFIER_REFERENCE)) { String constructorName = ((IdentifierTree) expression).name(); if ("Array".equals(constructorName)) { addIssue(tree, MESSAGE); } } super.visitNewExpression(tree); }
Source:
protected Set<TaskEditorPartDescriptor> createPartDescriptors() { Set<TaskEditorPartDescriptor> descriptors = super.createPartDescriptors(); for (TaskEditorPartDescriptor taskEditorPartDescriptor : descriptors) { if (taskEditorPartDescriptor.getId().equals(ID_PART_PEOPLE)) { descriptors.remove(taskEditorPartDescriptor); break; } } descriptors.add(new TaskEditorPartDescriptor(ID_PART_PEOPLE) { @Override public AbstractTaskEditorPart createPart() { return new BugzillaRestTaskEditorPeoplePart(); } }.setPath(PATH_PEOPLE)); TaskData data; try { data = TasksUi.getTaskDataManager().getTaskData(getTask()); if (data != null) { Map<String, TaskAttribute> attributes = data.getRoot().getAttributes(); for (TaskAttribute attribute : attributes.values()) { if (IBugzillaRestConstants.KIND_FLAG.equals(attribute.getMetaData().getKind())) { descriptors.add(new TaskEditorPartDescriptor(ID_PART_BUGZILLA_FLAGS) { @Override public AbstractTaskEditorPart createPart() { return new BugzillaRestFlagPart(); } }.setPath(ID_PART_ATTRIBUTES + "/" + PATH_FLAGS)); break; } } } } catch (CoreException e) { e.printStackTrace(); } return descriptors; }

Target:
protected Set<TaskEditorPartDescriptor> createPartDescriptors() { Set<TaskEditorPartDescriptor> descriptors = super.createPartDescriptors(); for (TaskEditorPartDescriptor taskEditorPartDescriptor : descriptors) { if (taskEditorPartDescriptor.getId().equals(ID_PART_PEOPLE)) { descriptors.remove(taskEditorPartDescriptor); break; } } descriptors.add(new TaskEditorPartDescriptor(ID_PART_PEOPLE) { @Override public AbstractTaskEditorPart createPart() { return new BugzillaRestTaskEditorPeoplePart(); } }.setPath(PATH_PEOPLE)); descriptors.add(new TaskEditorPartDescriptor(ID_PART_BUGZILLA_FLAGS) { @Override public AbstractTaskEditorPart createPart() { return new BugzillaRestFlagPart(); } }.setPath(ID_PART_ATTRIBUTES + "/" + PATH_FLAGS)); return descriptors; }
Source:
public static void executeScriptResources( File scriptsDir) throws IOException { if( scriptsDir.isDirectory()) { List<File> scriptFiles = Utils.listAllFiles( scriptsDir ); Logger logger = Logger.getLogger( AgentUtils.class.getName()); if( ! scriptFiles.isEmpty()) { for( File script : scriptFiles) { if( script.getName().contains(Constants.EXEC_SCRIPT)) { if( ! script.canExecute()) script.setExecutable(true); String[] command = { script.getAbsolutePath() }; try { ExecutionResult result = ProgramUtils.executeCommandWithResult( logger, command, script.getParentFile(), null, null, null); if( ! Utils.isEmptyOrWhitespaces( result.getNormalOutput())) logger.fine( result.getNormalOutput()); if( ! Utils.isEmptyOrWhitespaces( result.getErrorOutput())) logger.warning( result.getErrorOutput()); } catch (InterruptedException e) { e.printStackTrace(); } } } } } }

Target:
public static void executeScriptResources( File scriptsDir) throws IOException { if( scriptsDir.isDirectory()) { List<File> scriptFiles = Utils.listAllFiles( scriptsDir ); Logger logger = Logger.getLogger( AgentUtils.class.getName()); for( File script : scriptFiles) { if( script.getName().contains(Constants.SCOPED_SCRIPT_SUFFIX)) { if( ! script.canExecute()) script.setExecutable(true); String[] command = { script.getAbsolutePath() }; try { ExecutionResult result = ProgramUtils.executeCommandWithResult( logger, command, script.getParentFile(), null, null, null); if( ! Utils.isEmptyOrWhitespaces( result.getNormalOutput())) logger.fine( result.getNormalOutput()); if( ! Utils.isEmptyOrWhitespaces( result.getErrorOutput())) logger.warning( result.getErrorOutput()); } catch (InterruptedException e) { Utils.logException( logger, e ); } } } } }
Source:
public static Optional<Rectangle> getUsableScreenDimensions() { try { if (PlatformSpecific.isOnLinux()) { UIManager.setLookAndFeel( UIManager.getCrossPlatformLookAndFeelClassName()); } else { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); } GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); return Optional.of(ge.getMaximumWindowBounds()); } catch (Exception e) { logger.error(e.getLocalizedMessage(), e); } return Optional.empty(); }

Target:
public static Optional<Rectangle> getUsableScreenDimensions() { try { if (PlatformSpecific.isOnLinux()) { UIManager.setLookAndFeel( UIManager.getCrossPlatformLookAndFeelClassName()); } else { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); } GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); return Optional.of(ge.getMaximumWindowBounds()); } catch (Exception e) { logger.error(e.getLocalizedMessage(), e); return Optional.empty(); } }
Source:
public ServiceMetricEvent.Builder makeMetricBuilder(TimeBoundaryQuery query) { return new ServiceMetricEvent.Builder() .setDimension("dataSource", DataSourceUtil.getMetricName(query.getDataSource())) .setDimension("type", query.getType()); }

Target:
public ServiceMetricEvent.Builder makeMetricBuilder(TimeBoundaryQuery query) { return new ServiceMetricEvent.Builder() .setDimension(DruidMetrics.DATASOURCE, DataSourceUtil.getMetricName(query.getDataSource())) .setDimension(DruidMetrics.TYPE, query.getType()); }
Source:
public List<AccountInfo> members(boolean recursive) throws RestApiException { String restPath = getRequestPath() + "/members/?recursive"; JsonElement result = gerritRestClient.getRequest(restPath); return groupsParser.parseGroupMembers(result); }

Target:
public List<AccountInfo> members(boolean recursive) throws RestApiException { String restPath = null; if (recursive) { restPath = getRequestPath() + "/members/?recursive"; } else { restPath = getRequestPath() + "/members"; } JsonElement result = gerritRestClient.getRequest(restPath); return groupsParser.parseGroupMembers(result); }
Source:
public void shouldThrowIfIncompatibleSerdeForValue() throws ClassNotFoundException { final Class myClass = Class.forName("java.lang.String"); final StateSerdes<Object, Object> stateSerdes = new StateSerdes<Object, Object>("anyName", Serdes.serdeFrom(myClass), Serdes.serdeFrom(myClass)); final Integer myInt = 123; final Exception e = assertThrows(StreamsException.class, () -> stateSerdes.rawValue(myInt)); assertThat( e.getMessage(), equalTo( "A serializer (value: org.apache.kafka.common.serialization.StringSerializer) " + "is not compatible to the actual value type (value type: java.lang.Integer). " + "Change the default Serdes in StreamConfig or provide correct Serdes via method parameters.")); }

Target:
public void shouldThrowIfIncompatibleSerdeForValue() throws ClassNotFoundException { final Class myClass = Class.forName("java.lang.String"); final StateSerdes<Object, Object> stateSerdes = new StateSerdes<Object, Object>("anyName", Serdes.serdeFrom(myClass), Serdes.serdeFrom(myClass)); final Integer myInt = 123; final Exception e = assertThrows(StreamsException.class, () -> stateSerdes.rawValue(myInt)); assertThat( e.getMessage(), equalTo( "A serializer (org.apache.kafka.common.serialization.StringSerializer) " + "is not compatible to the actual value type (value type: java.lang.Integer). " + "Change the default Serdes in StreamConfig or provide correct Serdes via method parameters.")); }