auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void getLeaderReplicaList(List<RemoteReplicaInfo> remoteReplicaInfos, List<ExchangeMetadataResponse> exchangeMetadataResponseList, List<RemoteReplicaInfo> leaderReplicaInfosOutput, List<ExchangeMetadataResponse> exchangeMetadataResponseListForLeaderReplicaInfosOutput) throws IllegalArgumentException { if (replicatingFromRemoteColo && leaderBasedReplicationAdmin != null) { if (exchangeMetadataResponseList.size() != remoteReplicaInfos.size()) { throw new IllegalArgumentException("ExchangeMetadataResponseList size " + exchangeMetadataResponseList.size() + " and replicasToReplicatePerNode size " + remoteReplicaInfos.size() + " should be the same"); } for (int i = 0; i < remoteReplicaInfos.size(); i++) { RemoteReplicaInfo remoteReplicaInfo = remoteReplicaInfos.get(i); String partitionName = remoteReplicaInfo.getLocalReplicaId().getPartitionId().toPathString(); ReplicaId remoteReplicaId = remoteReplicaInfo.getReplicaId(); if (leaderBasedReplicationAdmin.isPeerReplicaLeaderForPartition(partitionName, remoteReplicaId)) { leaderReplicaInfosOutput.add(remoteReplicaInfo); exchangeMetadataResponseListForLeaderReplicaInfosOutput.add(exchangeMetadataResponseList.get(i)); } } } else { leaderReplicaInfosOutput.addAll(remoteReplicaInfos); exchangeMetadataResponseListForLeaderReplicaInfosOutput.addAll(exchangeMetadataResponseList); } }

Target:
void getLeaderReplicaList(List<RemoteReplicaInfo> remoteReplicaInfos, List<ExchangeMetadataResponse> exchangeMetadataResponseList, List<RemoteReplicaInfo> leaderReplicaInfosOutput, List<ExchangeMetadataResponse> exchangeMetadataResponseListForLeaderReplicaInfosOutput) throws IllegalArgumentException { if (exchangeMetadataResponseList.size() != remoteReplicaInfos.size()) { throw new IllegalArgumentException("ExchangeMetadataResponseList size " + exchangeMetadataResponseList.size() + " and replicasToReplicatePerNode size " + remoteReplicaInfos.size() + " should be the same"); } for (int i = 0; i < remoteReplicaInfos.size(); i++) { RemoteReplicaInfo remoteReplicaInfo = remoteReplicaInfos.get(i); ReplicaId localReplica = remoteReplicaInfo.getLocalReplicaId(); ReplicaId remoteReplica = remoteReplicaInfo.getReplicaId(); if (leaderBasedReplicationAdmin.isLeaderPair(localReplica, remoteReplica)) { leaderReplicaInfosOutput.add(remoteReplicaInfo); exchangeMetadataResponseListForLeaderReplicaInfosOutput.add(exchangeMetadataResponseList.get(i)); } } }
Source:
private Firmware getFirmware(FirmwareUID firmwareUID, String filename, Locale locale) throws IOException { ThingTypeUID thingTypeUID = firmwareUID.getThingTypeUID(); URL[] urls = { Paths.get(rootPath, thingTypeUID.getBindingId(), thingTypeUID.getId()).toUri().toURL() }; ResourceBundle rb = ResourceBundle.getBundle(filename, locale, new URLClassLoader(urls)); InputStream firmwareImage = getFirmwareImage(firmwareUID, rb.getString("image")); return new Firmware.Builder(firmwareUID).withDescription(getResourceAsString(rb, "description")) .withModel(getResourceAsString(rb, "model")) .withVendor(getResourceAsString(rb, "vendor")).withChangelog(getResourceAsString(rb, "changelog")) .withPrerequisiteVersion(getResourceAsString(rb, "prerequisiteVersion")) .withOnlineChangelog(new URL(getResourceAsString(rb, "onlineChangelog"))).withContent(firmwareImage) .build(); }

Target:
private Firmware getFirmware(FirmwareUID firmwareUID, String filename, Locale locale) throws IOException { ThingTypeUID thingTypeUID = firmwareUID.getThingTypeUID(); URL[] urls = { Paths.get(rootPath, thingTypeUID.getBindingId(), thingTypeUID.getId()).toUri().toURL() }; ResourceBundle rb = ResourceBundle.getBundle(filename, locale, new URLClassLoader(urls)); InputStream firmwareImage = getFirmwareImage(firmwareUID, rb.getString("image")); Firmware.Builder builder = new Firmware.Builder(firmwareUID) .withDescription(getResourceAsString(rb, "description")).withModel(getResourceAsString(rb, "model")) .withVendor(getResourceAsString(rb, "vendor")).withChangelog(getResourceAsString(rb, "changelog")) .withPrerequisiteVersion(getResourceAsString(rb, "prerequisiteVersion")).withInputStream(firmwareImage) .withMd5Hash(getResourceAsString(rb, "md5hash")); String onlineChangeLog = getResourceAsString(rb, "onlineChangelog"); if (onlineChangeLog != null) { builder.withOnlineChangelog(new URL(onlineChangeLog)); } return builder.build(); }
Source:
public Optional<String> getComponentId() { if (getIdentifier().equals(CONFIGURATION_IDENTIFIER)) { return of(OBJECT_MULE_CONFIGURATION); } else if (getModel(ConstructModel.class) .map(cm -> cm.getName().equals("object")) .orElse(getIdentifier().equals(ON_ERROR_CONTINE_IDENTIFIER) || getIdentifier().equals(ON_ERROR_PROPAGATE_IDENTIFIER))) { return ofNullable(getRawParameters().get(NAME_ATTRIBUTE_NAME)); } else if (getIdentifier().equals(ERROR_HANDLER_IDENTIFIER) && getRawParameters().get("ref") != null) { return empty(); } else if (getModel(ParameterizedModel.class).isPresent()) { populateParameterAsts(); return ofNullable(componentId); } else { return ofNullable(getRawParameters().get(NAME_ATTRIBUTE_NAME)); } }

Target:
public Optional<String> getComponentId() { if (getIdentifier().equals(CONFIGURATION_IDENTIFIER)) { return of(OBJECT_MULE_CONFIGURATION); } else if (getModel(ConstructModel.class) .map(cm -> cm.getName().equals("object")) .orElse(getIdentifier().equals(ON_ERROR_CONTINE_IDENTIFIER) || getIdentifier().equals(ON_ERROR_PROPAGATE_IDENTIFIER))) { return ofNullable(getRawParameters().get(NAME_ATTRIBUTE_NAME)); } else if (getIdentifier().equals(ERROR_HANDLER_IDENTIFIER) && getRawParameterValue("ref").isPresent()) { return empty(); } else if (getModel(ParameterizedModel.class).isPresent()) { populateParameterAsts(); return ofNullable(componentId); } else { return ofNullable(getRawParameters().get(NAME_ATTRIBUTE_NAME)); } }
Source:
public SSHLauncher(String host, int port, String username, String password, String privatekey, String jvmOptions, String javaPath, JDKInstaller jdkInstaller, String prefixStartSlaveCmd, String suffixStartSlaveCmd) { if (host != null) { this.host = host.trim(); } else { this.host = null; } this.jvmOptions = fixEmpty(jvmOptions); this.port = port == 0 ? 22 : port; this.username = fixEmpty(username); this.password = Secret.fromString(fixEmpty(password)); this.privatekey = fixEmpty(privatekey); this.credentials = null; this.credentialsId = null; this.javaPath = fixEmpty(javaPath); if (jdkInstaller != null) { this.jdk = jdkInstaller; } this.prefixStartSlaveCmd = fixEmpty(prefixStartSlaveCmd); this.suffixStartSlaveCmd = fixEmpty(suffixStartSlaveCmd); this.launchTimeoutSeconds = null; this.maxNumRetries = null; this.retryWaitTime = null; this.sshHostKeyVerificationStrategy = null; }

Target:
public SSHLauncher(String host, int port, String username, String password, String privatekey, String jvmOptions, String javaPath, JDKInstaller jdkInstaller, String prefixStartSlaveCmd, String suffixStartSlaveCmd) { this.host = Util.fixEmptyAndTrim(host); this.jvmOptions = fixEmpty(jvmOptions); this.port = port == 0 ? 22 : port; this.username = fixEmpty(username); this.password = Secret.fromString(fixEmpty(password)); this.privatekey = fixEmpty(privatekey); this.credentials = null; this.credentialsId = null; this.javaPath = fixEmpty(javaPath); if (jdkInstaller != null) { this.jdk = jdkInstaller; } this.prefixStartSlaveCmd = fixEmpty(prefixStartSlaveCmd); this.suffixStartSlaveCmd = fixEmpty(suffixStartSlaveCmd); this.launchTimeoutSeconds = null; this.maxNumRetries = null; this.retryWaitTime = null; this.sshHostKeyVerificationStrategy = null; }
Source:
public MessageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); return new MessageViewHolder((MessageView) inflater.inflate(R.layout.message_item_layout, parent, false)); }

Target:
public MessageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new MessageViewHolder((MessageView) inflater.inflate(R.layout.message_item_layout, parent, false)); }
Source:
public int executeBackendUpdateQuery(final BackendQuery<MongoDBQueryDescriptor> backendQuery, final QueryParameters queryParameters, final TupleContext tupleContext) { MongoDBQueryDescriptor queryDescriptor = backendQuery.getQuery(); EntityKeyMetadata entityKeyMetadata = backendQuery.getSingleEntityMetadataInformationOrNull() == null ? null : backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata(); String collectionName = getCollectionName( backendQuery, queryDescriptor, entityKeyMetadata ); MongoCollection<Document> collection = provider.getDatabase().getCollection( collectionName ); if ( !queryParameters.getPositionalParameters().isEmpty() ) { throw new UnsupportedOperationException( "Positional parameters are not yet supported for MongoDB native queries." ); } switch ( queryDescriptor.getOperation() ) { case INSERTMANY: case INSERTONE: case INSERT: return doInsert( queryDescriptor, collection ); case REMOVE: return (int) doRemove( queryDescriptor, collection ); case UPDATE: return (int) doUpdate( queryDescriptor, collection ); case FIND: case FINDONE: case FINDANDMODIFY: case AGGREGATE: case AGGREGATE_PIPELINE: case COUNT: case DISTINCT: throw log.readQueryMustBeExecutedViaGetResultList( queryDescriptor ); default: throw new IllegalArgumentException( "Unexpected query operation: " + queryDescriptor ); } }

Target:
public int executeBackendUpdateQuery(final BackendQuery<MongoDBQueryDescriptor> backendQuery, final QueryParameters queryParameters, final TupleContext tupleContext) { MongoDBQueryDescriptor queryDescriptor = backendQuery.getQuery(); EntityKeyMetadata entityKeyMetadata = backendQuery.getSingleEntityMetadataInformationOrNull() == null ? null : backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata(); String collectionName = getCollectionName( backendQuery, queryDescriptor, entityKeyMetadata ); MongoCollection<Document> collection = provider.getDatabase().getCollection( collectionName ); if ( !queryParameters.getPositionalParameters().isEmpty() ) { throw new UnsupportedOperationException( "Positional parameters are not yet supported for MongoDB native queries." ); } switch ( queryDescriptor.getOperation() ) { case INSERTMANY: case INSERTONE: case INSERT: return doInsert( queryDescriptor, collection ); case REMOVE: return doRemove( queryDescriptor, collection ); case UPDATE: return doUpdate( queryDescriptor, collection ); case FIND: case FINDONE: case FINDANDMODIFY: case AGGREGATE: case AGGREGATE_PIPELINE: case COUNT: case DISTINCT: throw log.readQueryMustBeExecutedViaGetResultList( queryDescriptor ); default: throw new IllegalArgumentException( "Unexpected query operation: " + queryDescriptor ); } }
Source:
public SimilarToGraphQuery querySimilarTo(Graph graph, String[] similarToFields, String similarToText, Authorizations authorizations) { return new ElasticSearchParentChildGraphQuery( getClient(), getConfig().getIndicesToQuery(), graph, similarToFields, similarToText, getAllPropertyDefinitions(), getConfig().getScoringStrategy(), getConfig().getNameSubstitutionStrategy(), authorizations); }

Target:
public SimilarToGraphQuery querySimilarTo(Graph graph, String[] similarToFields, String similarToText, Authorizations authorizations) { return new ElasticSearchParentChildGraphQuery( getClient(), getConfig().getIndicesToQuery(), graph, similarToFields, similarToText, getAllPropertyDefinitions(), getConfig().getScoringStrategy(), this.nameSubstitutionStrategy, authorizations); }
Source:
public boolean tick() { long time = this.world.getTotalWorldTime(); Random rand = this.world.rand; for (Cube cube : cubeMap) { cube.tickCubeServer(time, this.world, rand); } return false; }

Target:
public boolean tick() { profiler.startSection("providerTick("+cubeMap.getSize()+")"); long time = this.world.getTotalWorldTime(); Random rand = this.world.rand; for (Cube cube : cubeMap) { cube.tickCubeServer(time, this.world, rand); } profiler.endSection(); return false; }
Source:
public void testAMeetingCanBeDeleted() { HomeTabletPage home = new HomeTabletPage(); home .clickScheduleBtn() .clickOverMeetingCreated(subject) .clickRemoveBtn() .setPasswordTxtBox(password) .clickOkButton(); Assert.assertTrue(schedule.isMessageMeetingDeletedDisplayed()); }

Target:
public void testAMeetingCanBeDeleted() { String subject = jsonReader.readJsonFile("title", filePath); HomeTabletPage homePage = new HomeTabletPage(); SchedulePage schedulePage = homePage.clickScheduleBtn() .clickOverMeetingCreated(subject) .clickRemoveBtn() .confirmCredentials(password); Assert.assertTrue(schedulePage.isMessageMeetingDeletedDisplayed()); }
Source:
public void verifyMoreInfoUrl(String expectedUrl) { String moreInfoUrl = moreInfoLink.getAttribute("href"); Assertion.assertEquals(expectedUrl, moreInfoUrl); }

Target:
public void verifyMoreInfoUrl(String expectedUrl) { String moreInfoUrl = moreInfoLink.getAttribute("href"); Assertion.assertEquals(expectedUrl, moreInfoUrl); PageObjectLogging.log("verifyMoreInfoUrl", "More Info URL is correct", true); }
Source:
public boolean checkSecurityInfo(String endpoint, Identity clientIdentity, SecurityInfo securityInfo) { if (clientIdentity.isSecure()) { if (securityInfo == null) { LOG.debug("Client '{}' without security info try to connect through the secure endpoint", endpoint); return false; } else if (clientIdentity.isPSK()) { return checkPskIdentity(endpoint, clientIdentity, securityInfo); } else if (clientIdentity.isRPK()) { return checkRpkIdentity(endpoint, clientIdentity, securityInfo); } else if (clientIdentity.isX509()) { return checkX509Identity(endpoint, clientIdentity, securityInfo); } else if (clientIdentity.isOSCORE()) { return checkOscoreIdentity(endpoint, clientIdentity, securityInfo); } else { LOG.debug("Unable to authenticate client '{}': unknown authentication mode", endpoint); return false; } } else { if (securityInfo != null) { LOG.debug("Client '{}' must connect using DTLS", endpoint); return false; } } return true; }

Target:
public boolean checkSecurityInfo(String endpoint, Identity clientIdentity, SecurityInfo securityInfo) { if (clientIdentity.isSecure()) { if (securityInfo == null) { LOG.debug("Client '{}' without security info try to connect through the secure endpoint", endpoint); return false; } else if (clientIdentity.isPSK()) { return checkPskIdentity(endpoint, clientIdentity, securityInfo); } else if (clientIdentity.isRPK()) { return checkRpkIdentity(endpoint, clientIdentity, securityInfo); } else if (clientIdentity.isX509()) { return checkX509Identity(endpoint, clientIdentity, securityInfo); } else { LOG.debug("Unable to authenticate client '{}': unknown authentication mode", endpoint); return false; } } else { if (clientIdentity.isOSCORE()) { return checkOscoreIdentity(endpoint, clientIdentity, securityInfo); } else if (securityInfo != null) { LOG.debug("Client '{}' must connect using DTLS", endpoint); return false; } } return true; }
Source:
public ResponseEntity<Counterparty> create(@RequestBody @Valid Counterparty counterparty) { try { Counterparty createdCounterparty = counterpartyDao.saveAndFlush(counterparty); return new ResponseEntity<>(createdCounterparty, HttpStatus.OK); } catch (DataIntegrityViolationException dive) { throw new ConflictException(dive.getMostSpecificCause().getMessage()); } }

Target:
public ResponseEntity<CounterpartyDTO> create(@RequestBody @Valid Counterparty counterparty) { try { counterparty.setUser(userUtil.extractLoggedAppUserFromDatabase()); Counterparty createdCounterparty = counterpartyDao.saveAndFlush(counterparty); return new ResponseEntity<>(counterpartyConverter.convertTo(createdCounterparty), HttpStatus.OK); } catch (DataIntegrityViolationException dive) { throw new ConflictException(dive.getMostSpecificCause().getMessage()); } }
Source:
public void testEncodeSpatial() throws Exception { Document doc = encode(FilterMockData.intersects(), FES.Filter); assertEquals("fes:Filter", doc.getDocumentElement().getNodeName()); Element e = getElementByQName(doc, FES.Intersects); assertNotNull(e); print(e); assertNotNull(getElementByQName(e, FES.ValueReference)); assertNotNull(getElementByQName(e, GML.Point)); }

Target:
public void testEncodeSpatial() throws Exception { Document doc = encode(FilterMockData.intersects(), FES.Filter); assertEquals("fes:Filter", doc.getDocumentElement().getNodeName()); Element e = getElementByQName(doc, FES.Intersects); assertNotNull(e); assertNotNull(getElementByQName(e, FES.ValueReference)); assertNotNull(getElementByQName(e, GML.Point)); }
Source:
static void fetchInputAndOutputStreamPartitions(JobGraph jobGraph, StreamManager streamManager) { Set<StreamEdge> existingStreams = new HashSet<>(); existingStreams.addAll(jobGraph.getInputStreams()); existingStreams.addAll(jobGraph.getOutputStreams()); Multimap<String, String> systemToStreams = HashMultimap.create(); Map<String, StreamEdge> streamToStreamEdge = new HashMap<>(); for (StreamEdge streamEdge : existingStreams) { SystemStream systemStream = streamEdge.getSystemStream(); String stream = systemStream.getStream(); systemToStreams.put(systemStream.getSystem(), stream); streamToStreamEdge.put(stream, streamEdge); } for (String system : systemToStreams.keySet()) { Collection<String> streams = systemToStreams.get(system); Map<String, Integer> streamToPartitionCount = streamManager.getStreamPartitionCounts(system, new HashSet<>(streams)); for (Map.Entry<String, Integer> entry : streamToPartitionCount.entrySet()) { String stream = entry.getKey(); Integer partitionCount = entry.getValue(); streamToStreamEdge.get(stream).setPartitionCount(partitionCount); log.info("Fetched partition count value of for stream {}", partitionCount, stream); } } }

Target:
static void fetchInputAndOutputStreamPartitions(JobGraph jobGraph, StreamManager streamManager) { Set<StreamEdge> existingStreams = new HashSet<>(); existingStreams.addAll(jobGraph.getInputStreams()); existingStreams.addAll(jobGraph.getOutputStreams()); Multimap<String, StreamEdge> systemToStreamEdges = HashMultimap.create(); for (StreamEdge streamEdge : existingStreams) { String system = streamEdge.getSystemStream().getSystem(); systemToStreamEdges.put(system, streamEdge); } for (String system : systemToStreamEdges.keySet()) { Collection<StreamEdge> streamEdges = systemToStreamEdges.get(system); Map<String, StreamEdge> streamToStreamEdge = new HashMap<>(); for (StreamEdge streamEdge : streamEdges) { streamToStreamEdge.put(streamEdge.getSystemStream().getStream(), streamEdge); } Set<String> streams = streamToStreamEdge.keySet(); Map<String, Integer> streamToPartitionCount = streamManager.getStreamPartitionCounts(system, streams); for (Map.Entry<String, Integer> entry : streamToPartitionCount.entrySet()) { String stream = entry.getKey(); Integer partitionCount = entry.getValue(); streamToStreamEdge.get(stream).setPartitionCount(partitionCount); log.info("Fetched partition count value for stream {}", partitionCount, stream); } } }
Source:
public void testToString() throws CalendarParserException { Assert.assertTrue(invoke("toString") instanceof EvalError); Assert.assertEquals(invoke("toString", (Object) null), "null"); Assert.assertEquals(invoke("toString", Long.valueOf(100)),"100"); Assert.assertEquals(invoke("toString", Double.valueOf(100.0)),"100.0"); Assert.assertEquals(invoke("toString", Double.valueOf(100.0),"%.0f"),"100"); String expectedDate = "2013-06-01T00:00:00Z"; Assert.assertEquals(invoke("toString", CalenderParser.parseAsOffsetDateTime("2013-06-01")), expectedDate); Assert.assertEquals(invoke("toString", CalenderParser.parseAsOffsetDateTime("2013-06-01"),"yyyy-MM-dd"),expectedDate); }

Target:
public void testToString() throws CalendarParserException { Assert.assertTrue(invoke("toString") instanceof EvalError); Assert.assertEquals(invoke("toString", (Object) null), "null"); Assert.assertEquals(invoke("toString", Long.valueOf(100)),"100"); Assert.assertEquals(invoke("toString", Double.valueOf(100.0)),"100.0"); Assert.assertEquals(invoke("toString", Double.valueOf(100.0),"%.0f"),"100"); String inputDate = "2013-06-01"; Assert.assertEquals(invoke("toString", CalendarParser.parseAsOffsetDateTime(inputDate)), "01-Jun-2013"); Assert.assertEquals(invoke("toString", CalendarParser.parseAsOffsetDateTime(inputDate), "yyyy-MM-dd"), "2013-06-01"); Assert.assertEquals(invoke("toString", CalendarParser.parseAsOffsetDateTime(inputDate), "yyyy/dd/MM"), "2013/01/06"); Assert.assertEquals(invoke("toString", CalendarParser.parseAsOffsetDateTime(inputDate), "yyyy-MMM"), "2013-Jun"); Assert.assertEquals(invoke("toString", CalendarParser.parseAsOffsetDateTime(inputDate), "yyyy-MM-dd hh:mm:ss"), "2013-06-01 12:00:00"); String inputDateTime = "2013-06-01 13:12:11"; Assert.assertEquals(invoke("toString", CalendarParser.parseAsOffsetDateTime(inputDateTime)), "01-Jun-2013"); Assert.assertEquals(invoke("toString", CalendarParser.parseAsOffsetDateTime(inputDateTime), "yyyy-MM-dd"), "2013-06-01"); Assert.assertEquals(invoke("toString", CalendarParser.parseAsOffsetDateTime(inputDateTime), "yyyy-MM-dd hh:mm:ss"),"2013-06-01 01:12:11"); Assert.assertEquals(invoke("toString", CalendarParser.parseAsOffsetDateTime(inputDateTime), "yyyy-MM-dd HH:mm:ss"),"2013-06-01 13:12:11"); }
Source:
private static Boolean checkCacheForMatches(String inputText, TypeReferenceLocation location) { String key = location + "_" + inputText; Boolean cachedResult = (Boolean) resultsCache.get(key); Long lookupCount = cacheLookupCount.incrementAndGet(); Long hitCount = cacheHitCount.get(); if (cachedResult != null) { hitCount = cacheHitCount.incrementAndGet(); } if (lookupCount % 100000L == 0) { long hitPercentage = Math.round(((double) hitCount / (double) lookupCount) * 100); LOG.info("There have been " + lookupCount + " lookups with " + hitCount + " hits, for a hit percentage of: " + hitPercentage); } return cachedResult; }

Target:
private static Boolean checkCacheForMatches(String inputText, TypeReferenceLocation location) { String key = getCacheKey(location, inputText); Boolean cachedResult = (Boolean) resultsCache.get(key); Long lookupCount = cacheLookupCount.incrementAndGet(); Long hitCount = cacheHitCount.get(); if (cachedResult != null) { hitCount = cacheHitCount.incrementAndGet(); } if (lookupCount % 100000L == 0) { long hitPercentage = Math.round(((double) hitCount / (double) lookupCount) * 100); LOG.info("There have been " + lookupCount + " lookups with " + hitCount + " hits, for a hit percentage of: " + hitPercentage); } return cachedResult; }
Source:
public final Response toResponse(T exception) { String exceptionMessage = Objects.toString(exception.getMessage()); String errorId = UUID.randomUUID().toString(); StatusType status = this.getStatus(exception); if (status.getFamily().equals(Response.Status.Family.CLIENT_ERROR)) { log.info("Error handling request {}", errorId, exception); } else { log.error("Error handling request {}", errorId, exception); } ResponseBuilder builder = Response.status(status); try { final SerializableError error; if (includeStackTrace) { StackTraceElement[] stackTrace = exception.getStackTrace(); error = SerializableError.of(exceptionMessage, exception.getClass(), Arrays.asList(stackTrace)); } else { error = SerializableError.of("Refer to the server logs with this errorId: " + errorId, exception.getClass()); } builder.type(MediaType.APPLICATION_JSON); String json = MAPPER.writeValueAsString(error); builder.entity(json); } catch (RuntimeException | JsonProcessingException e) { log.warn("Unable to translate exception to json for request {}", errorId, e); builder = Response.status(status); builder.type(MediaType.TEXT_PLAIN); builder.entity(exceptionMessage); } return builder.build(); }

Target:
public final Response toResponse(T exception) { String exceptionMessage = Objects.toString(exception.getMessage()); String errorId = UUID.randomUUID().toString(); StatusType status = this.getStatus(exception); if (status.getFamily().equals(Response.Status.Family.CLIENT_ERROR)) { log.info("Error handling request {}", SafeArg.of("errorId", errorId), exception); } else { log.error("Error handling request {}", SafeArg.of("errorId", errorId), exception); } ResponseBuilder builder = Response.status(status); try { final SerializableError error; if (includeStackTrace) { StackTraceElement[] stackTrace = exception.getStackTrace(); error = SerializableError.of(exceptionMessage, exception.getClass(), Arrays.asList(stackTrace)); } else { error = SerializableError.of("Refer to the server logs with this errorId: " + errorId, exception.getClass()); } builder.type(MediaType.APPLICATION_JSON); String json = MAPPER.writeValueAsString(error); builder.entity(json); } catch (RuntimeException | JsonProcessingException e) { log.warn("Unable to translate exception to json for request {}", SafeArg.of("errorId", errorId), e); builder = Response.status(status); builder.type(MediaType.TEXT_PLAIN); builder.entity(exceptionMessage); } return builder.build(); }
Source:
public void asyncWriteWithPersistWaitTime() throws Exception { AlluxioURI filePath = new AlluxioURI(PathUtils.uniqPath()); createTwoBytesFile(mFileSystem, filePath, 2000); CommonUtils.sleepMs(500); IntegrationTestUtils .checkPersistStateAndWaitForPersist(sLocalAlluxioClusterResource, mFileSystem, filePath, 2); }

Target:
public void asyncWriteWithPersistWaitTime() throws Exception { AlluxioURI filePath = new AlluxioURI(PathUtils.uniqPath()); createTwoBytesFile(mFileSystem, filePath, 2000); IntegrationTestUtils .checkPersistStateAndWaitForPersist(sLocalAlluxioClusterResource, mFileSystem, filePath, 2); }
Source:
public void appendTo(ExpressionBuilder builder, boolean useQuotes) { appendTo(builder, QuoteMethod.ALWAYS); }

Target:
public void appendTo(ExpressionBuilder builder, boolean useQuotes) { appendTo(builder, useQuotes ? QuoteMethod.ALWAYS : QuoteMethod.NEVER); }
Source:
public void navigate() { FinderNavigation navigation; if (ConfigUtils.isDomain()) { navigation = new FinderNavigation(browser, DomainConfigEntryPoint.class); navigation.step(FinderNames.CONFIGURATION, FinderNames.PROFILES) .step(FinderNames.PROFILE, ConfigUtils.getDefaultProfile()) .step(FinderNames.SUBSYSTEM, "EE"); } else { navigation = new FinderNavigation(browser, StandaloneConfigEntryPoint.class); navigation.step(FinderNames.CONFIGURATION, FinderNames.SUBSYSTEMS) .step(FinderNames.SUBSYSTEM, "EE"); } navigation.selectRow().invoke(FinderNames.VIEW); Application.waitUntilVisible(); }

Target:
public void navigate() { FinderNavigation navigation; if (ConfigUtils.isDomain()) { navigation = new FinderNavigation(browser, DomainConfigEntryPoint.class) .step(FinderNames.CONFIGURATION, FinderNames.PROFILES) .step(FinderNames.PROFILE, ConfigUtils.getDefaultProfile()); } else { navigation = new FinderNavigation(browser, StandaloneConfigEntryPoint.class) .step(FinderNames.CONFIGURATION, FinderNames.SUBSYSTEMS); } navigation.step(FinderNames.SUBSYSTEM, "EE") .selectRow() .invoke(FinderNames.VIEW); Application.waitUntilVisible(); }
Source:
public DocComparator.Difference<Object> compareNodesWithFallback(DBObject oldDoc,DBObject newDoc) throws Exception { while(true) { try { return compareNodes(oldDoc,newDoc); } catch(DocComparator.DuplicateArrayIdentity dai) { LOGGER.debug("Duplicate ID:{}"); Path p=dai.getPath(); ignoredIdentities.add(getArray(p)); LOGGER.debug("Ignored paths:{}",ignoredIdentities); } catch(DocComparator.InvalidArrayIdentity iai) { LOGGER.debug("Invalid ID:{}"); Path p=iai.getPath(); ignoredIdentities.add(getArray(p)); LOGGER.debug("Ignored paths:{}",ignoredIdentities); } } }

Target:
public DocComparator.Difference<Object> compareNodesWithFallback(DBObject oldDoc,DBObject newDoc) throws Exception { int n=getArrayIdentities().size()+1; for(int i=0;i<n;i++) { try { return compareNodes(oldDoc,newDoc); } catch(DocComparator.DuplicateArrayIdentity dai) { LOGGER.warn("Duplicate array element id for doc._id:{}, field:{}",oldDoc.get("_id"),dai.getPath()); Path p=dai.getPath(); ignoredIdentities.add(getArray(p)); LOGGER.debug("Ignored paths:{}",ignoredIdentities); } catch(DocComparator.InvalidArrayIdentity iai) { LOGGER.warn("Invalid array element id for doc._id:{}, field:{}",oldDoc.get("_id"),iai.getPath()); Path p=iai.getPath(); ignoredIdentities.add(getArray(p)); LOGGER.debug("Ignored paths:{}",ignoredIdentities); } } throw new RuntimeException("Cannot compute document diffs even with ignored identities:"+ignoredIdentities); }
Source:
public void testCustomSerializerWithSerializableSillyManagementExample() throws IOException { ManagementContext mgmt = LocalManagementContextForTests.newInstance(); try { ObjectMapper mapper = BrooklynJacksonJsonProvider.newPrivateObjectMapper(mgmt); SillyClassWithManagementContext silly = new SillyClassWithManagementContext("123", mgmt); log.info("silly is: "+silly); String sillyS = mapper.writeValueAsString(silly); log.info("silly json is: "+sillyS); SillyClassWithManagementContext silly2 = mapper.readValue(sillyS, SillyClassWithManagementContext.class); log.info("silly2 is: "+silly2); Assert.assertEquals(silly.id, silly2.id); } finally { Entities.destroyAll(mgmt); } }

Target:
public void testCustomSerializerWithSerializableSillyManagementExample() throws Exception { ManagementContext mgmt = LocalManagementContextForTests.newInstance(); try { ObjectMapper mapper = BrooklynJacksonJsonProvider.newPrivateObjectMapper(mgmt); SillyClassWithManagementContext silly = new SillyClassWithManagementContext("123", mgmt); log.info("silly is: "+silly); String sillyS = mapper.writeValueAsString(silly); log.info("silly json is: "+sillyS); SillyClassWithManagementContext silly2 = mapper.readValue(sillyS, SillyClassWithManagementContext.class); log.info("silly2 is: "+silly2); Assert.assertEquals(silly.id, silly2.id); } finally { Entities.destroyAll(mgmt); } }
Source:
private boolean unplugPassthroughNics() { if (passthroughNicsUnplugged) { return true; } passthroughNicsUnplugged = true; List<ActivateDeactivateVmNicParameters> parametersList = createActivateDeactivateVmNicParameters( getAllVmPassthroughNics(), PlugAction.UNPLUG); log.debug("About to call with parameters: {}", VdcActionType.ActivateDeactivateVmNic, Arrays.toString(parametersList.toArray())); for (ActivateDeactivateVmNicParameters parameter : parametersList) { VdcReturnValueBase returnValue = runInternalAction(VdcActionType.ActivateDeactivateVmNic, parameter); if (!returnValue.getSucceeded()) { returnValue.getValidationMessages().forEach(this::addValidationMessage); return false; } } return true; }

Target:
private boolean unplugPassthroughNics() { if (passthroughNicsUnplugged) { return true; } List<ActivateDeactivateVmNicParameters> parametersList = createActivateDeactivateVmNicParameters( getAllVmPassthroughNics(), PlugAction.UNPLUG); log.debug("About to call with parameters: {}", VdcActionType.ActivateDeactivateVmNic, Arrays.toString(parametersList.toArray())); for (ActivateDeactivateVmNicParameters parameter : parametersList) { VdcReturnValueBase returnValue = runInternalAction(VdcActionType.ActivateDeactivateVmNic, parameter); if (!returnValue.getSucceeded()) { returnValue.getValidationMessages().forEach(this::addValidationMessage); return false; } } passthroughNicsUnplugged = true; return true; }
Source:
public FunctionImplementationType getFunctionImplementationType() { checkState(LANGUAGE_TO_IMPLEMENTATION_MAP.containsKey(routineCharacteristics.getLanguage()), "Does not support language %s", routineCharacteristics.getLanguage()); return LANGUAGE_TO_IMPLEMENTATION_MAP.get(routineCharacteristics.getLanguage()); }

Target:
public FunctionImplementationType getFunctionImplementationType() { checkState(LANGUAGE_TO_IMPLEMENTATION_MAP.containsKey(routineCharacteristics.getLanguage()), "Language is not supported: %s", routineCharacteristics.getLanguage()); return LANGUAGE_TO_IMPLEMENTATION_MAP.get(routineCharacteristics.getLanguage()); }
Source:
public void createManagementNetworkIfRequired() { if (host == null) { return; } final String managementNetworkName = resolveManagementNetworkName(); final String hostManagementNetworkAddress = resolveHostManagementNetworkAddress(managementNetworkName); final String hostIp = NetworkUtils.getHostByIp(host, log); if (hostManagementNetworkAddress != null && hostManagementNetworkAddress.equals(hostIp)) { log.info("The management network '{}' is already configured on host '{}'", managementNetworkName, host.getName()); return; } if (!FeatureSupported.setupManagementNetwork(host.getVdsGroupCompatibilityVersion())) { log.warn("Cluster of host '{}' does not support normalize management network feature", host.getName()); return; } VdsNetworkInterface nic = findNicToSetupManagementNetwork(); if (nic == null) { return; } List<VdsNetworkInterface> interfaces = filterBondsWithoutSlaves(host.getInterfaces()); if (interfaces.contains(nic)) { nic.setNetworkName(managementNetworkName); configureManagementNetwork(createSetupNetworkParams(interfaces)); } else { final AuditLogableBase event = createEvent(); event.addCustomValue("InterfaceName", nic.getName()); auditLogDirector.log(event, AuditLogType.INVALID_INTERFACE_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } }

Target:
public void createManagementNetworkIfRequired() { if (host == null) { return; } final String managementNetworkName = resolveManagementNetworkName(); final String hostManagementNetworkAddress = resolveHostManagementNetworkAddress(managementNetworkName); final String hostIp = NetworkUtils.getHostByIp(host); if (hostManagementNetworkAddress != null && hostManagementNetworkAddress.equals(hostIp)) { log.info("The management network '{}' is already configured on host '{}'", managementNetworkName, host.getName()); return; } if (!FeatureSupported.setupManagementNetwork(host.getVdsGroupCompatibilityVersion())) { log.warn("Cluster of host '{}' does not support normalize management network feature", host.getName()); return; } VdsNetworkInterface nic = findNicToSetupManagementNetwork(); if (nic == null) { return; } List<VdsNetworkInterface> interfaces = filterBondsWithoutSlaves(host.getInterfaces()); if (interfaces.contains(nic)) { nic.setNetworkName(managementNetworkName); configureManagementNetwork(createSetupNetworkParams(interfaces)); } else { final AuditLogableBase event = createEvent(); event.addCustomValue("InterfaceName", nic.getName()); auditLogDirector.log(event, AuditLogType.INVALID_INTERFACE_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } }
Source:
public void initRepo() throws Exception { src = session.createDocumentModel("/", "src", "Folder"); src.setPropertyValue("dc:title", "Source"); src = session.createDocument(src); session.save(); src = session.getDocument(src.getRef()); when(administratorGroupsProvider.getAdministratorsGroups()).thenReturn( Collections.singletonList("administrators")); DocumentModel testUser = userManager.getBareUserModel(); testUser.setProperty("user", "username", "existingUser"); testUserId = userManager.createUser(testUser).getId(); }

Target:
public void initRepo() throws Exception { src = session.createDocumentModel("/", "src", "Folder"); src.setPropertyValue("dc:title", "Source"); src = session.createDocument(src); session.save(); src = session.getDocument(src.getRef()); when(userManager.getUserModel("existingUser")).thenReturn(new DocumentModelImpl("user")); when(userManager.getGroup("existingGroup")).thenReturn(new NuxeoGroupImpl("existingGroup")); when(administratorGroupsProvider.getAdministratorsGroups()).thenReturn( Collections.singletonList("administrators")); }
Source:
public static Properties getConfiguration(String filename) { Properties props = new Properties(); InputStream in = null; try { in = ClientUtils.class.getClassLoader().getResourceAsStream(filename); } catch (Exception e) { } finally { try { props.load(in); if(in != null) { in.close(); } } catch (IOException ioe) { } } return props; }

Target:
public static Properties getConfiguration(String filename) { Properties props = new Properties(); try (InputStream in = ClientUtils.class.getClassLoader().getResourceAsStream(filename)) { props.load(in); } catch (IOException e) { logger.error(e.getMessage(), e); } return props; }
Source:
protected void updateSearchField() { if (!isNew() && !isAnyMappingChanged()) { return; } StringBuilder contentBuilder = new StringBuilder(); this.getDescriptor() .getProperties() .stream() .filter(p -> p.getAnnotation(SearchContent.class).isPresent()) .map(p -> p.getValue(this)) .filter(Objects::nonNull) .forEach(obj -> addContent(contentBuilder, obj)); searchField = contentBuilder.toString(); }

Target:
protected void updateSearchField() { if (!isNew() && !isAnyMappingChanged()) { return; } StringBuilder contentBuilder = new StringBuilder(); this.getDescriptor() .getProperties() .stream() .filter(p -> p.getAnnotation(SearchContent.class).isPresent()) .map(p -> p.getValue(this)) .filter(Strings::isFilled) .forEach(obj -> addContent(contentBuilder, obj)); searchField = contentBuilder.toString(); }
Source:
public HashedWheelTimer( ThreadFactory threadFactory, long tickDuration, TimeUnit unit, int ticksPerWheel, boolean leakDetection, long maxPendingTimeouts) { if (threadFactory == null) { throw new NullPointerException("threadFactory"); } if (unit == null) { throw new NullPointerException("unit"); } if (tickDuration <= 0) { throw new IllegalArgumentException("tickDuration must be greater than 0: " + tickDuration); } if (ticksPerWheel <= 0) { throw new IllegalArgumentException("ticksPerWheel must be greater than 0: " + ticksPerWheel); } wheel = createWheel(ticksPerWheel); mask = wheel.length - 1; long duration = unit.toNanos(tickDuration); if (duration >= Long.MAX_VALUE / wheel.length) { throw new IllegalArgumentException(String.format( "tickDuration: %d (expected: 0 < tickDuration in nanos < %d", tickDuration, Long.MAX_VALUE / wheel.length)); } if (duration < MILLISECOND_NANOS) { if (logger.isWarnEnabled()) { logger.warn(String.format("Configured tickDuration %d smaller then %d, using 1ms.", tickDuration, MILLISECOND_NANOS)); } this.tickDuration = MILLISECOND_NANOS; } else { this.tickDuration = duration; } workerThread = threadFactory.newThread(worker); leak = leakDetection || !workerThread.isDaemon() ? leakDetector.track(this) : null; this.maxPendingTimeouts = maxPendingTimeouts; if (INSTANCE_COUNTER.incrementAndGet() > INSTANCE_COUNT_LIMIT && WARNED_TOO_MANY_INSTANCES.compareAndSet(false, true)) { reportTooManyInstances(); } }

Target:
public HashedWheelTimer( ThreadFactory threadFactory, long tickDuration, TimeUnit unit, int ticksPerWheel, boolean leakDetection, long maxPendingTimeouts) { if (threadFactory == null) { throw new NullPointerException("threadFactory"); } if (unit == null) { throw new NullPointerException("unit"); } if (tickDuration <= 0) { throw new IllegalArgumentException("tickDuration must be greater than 0: " + tickDuration); } if (ticksPerWheel <= 0) { throw new IllegalArgumentException("ticksPerWheel must be greater than 0: " + ticksPerWheel); } wheel = createWheel(ticksPerWheel); mask = wheel.length - 1; long duration = unit.toNanos(tickDuration); if (duration >= Long.MAX_VALUE / wheel.length) { throw new IllegalArgumentException(String.format( "tickDuration: %d (expected: 0 < tickDuration in nanos < %d", tickDuration, Long.MAX_VALUE / wheel.length)); } if (duration < MILLISECOND_NANOS) { if (logger.isWarnEnabled()) { logger.warn("Configured tickDuration smaller then {}, using 1ms.", tickDuration, MILLISECOND_NANOS); } this.tickDuration = MILLISECOND_NANOS; } else { this.tickDuration = duration; } workerThread = threadFactory.newThread(worker); leak = leakDetection || !workerThread.isDaemon() ? leakDetector.track(this) : null; this.maxPendingTimeouts = maxPendingTimeouts; if (INSTANCE_COUNTER.incrementAndGet() > INSTANCE_COUNT_LIMIT && WARNED_TOO_MANY_INSTANCES.compareAndSet(false, true)) { reportTooManyInstances(); } }
Source:
public static <T extends ToolInstallation> void installTool(Jenkins jenkins, Class<T> type, String name, String version) { waitForUpdates(jenkins, type); jenkins.getPluginManager().checkForUpdates(); ConfigurablePageObject tools = ensureConfigPage(jenkins); T maven = addTool(jenkins, type); maven.name.set(name); maven.installVersion(version); tools.save(); }

Target:
public static <T extends ToolInstallation> void installTool(Jenkins jenkins, Class<T> type, String name, String version) { waitForUpdates(jenkins, type); ConfigurablePageObject tools = ensureConfigPage(jenkins); T toolInstallation = addTool(jenkins, type); toolInstallation.name.set(name); if(version != null) { toolInstallation.installVersion(version); } tools.save(); }
Source:
protected void updatePosition(final CharacterMovementComponent movementComp, final CharacterStateEvent state, CharacterMoveInputEvent input, EntityRef entity) { switch (state.getMode()) { case GHOSTING: ghost(movementComp, state, input, entity); break; case SWIMMING: swim(movementComp, state, input, entity); break; case WALKING: walk(movementComp, state, input, entity); break; case CLIMBING: climb(movementComp, state, input, entity); break; default: walk(movementComp, state, input, entity); break; } }

Target:
private void updatePosition(final CharacterMovementComponent movementComp, final CharacterStateEvent state, CharacterMoveInputEvent input, EntityRef entity) { switch (state.getMode()) { case GHOSTING: ghost(movementComp, state, input, entity); break; case SWIMMING: swim(movementComp, state, input, entity); break; case WALKING: walk(movementComp, state, input, entity); break; case CLIMBING: climb(movementComp, state, input, entity); break; default: walk(movementComp, state, input, entity); break; } }
Source:
public void applyParameters(Material program) { super.applyParameters(program); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = CoreRegistry.get(DisplayResolutionDependentFBOs.class); int texId = 0; GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId); displayResolutionDependentFBOs.bindFboColorTexture(new ResourceUrn("engine:sceneFinal")); program.setInt("texSceneFinal", texId, true); }

Target:
public void applyParameters(Material program) { super.applyParameters(program); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = CoreRegistry.get(DisplayResolutionDependentFBOs.class); int texId = 0; GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId); displayResolutionDependentFBOs.bindFboColorTexture(FINAL_BUFFER); program.setInt("texSceneFinal", texId, true); }
Source:
protected Set<IEclipsePreferences> getThemeRelatedPreferences() { if (prefs == null) { prefs = new HashSet<>(); final IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] elements = registry .getConfigurationElementsFor("org.eclipse.e4.ui.css.swt.theme"); Set<String> bundleIDs = new HashSet<>(); for (IConfigurationElement element : elements) { try { String nameSpace = element.getNamespaceIdentifier(); if (nameSpace != null) { bundleIDs.add(nameSpace); } } catch (InvalidRegistryObjectException e) { Activator.log(LogService.LOG_ERROR, e.getMessage(), e); } } elements = registry.getConfigurationElementsFor("org.eclipse.ui.themes"); for (IConfigurationElement element : elements) { try { String nameSpace = element.getNamespaceIdentifier(); if (nameSpace != null) { bundleIDs.add(nameSpace); } } catch (InvalidRegistryObjectException e) { Activator.log(LogService.LOG_ERROR, e.getMessage(), e); } } for (String bundleId : bundleIDs) { if (bundleId != null) { prefs.add(InstanceScope.INSTANCE.getNode(bundleId)); } } } return prefs; }

Target:
protected Set<IEclipsePreferences> getThemeRelatedPreferences() { if (prefs == null) { prefs = new HashSet<>(); final IExtensionRegistry registry = Platform.getExtensionRegistry(); Set<String> bundleIDs = new HashSet<>(); String[] themeRelatedExtensionPoints = { "org.eclipse.e4.ui.css.swt.theme", "org.eclipse.ui.themes" }; for (String extensionPoint : themeRelatedExtensionPoints) { IConfigurationElement[] elements = registry.getConfigurationElementsFor(extensionPoint); for (IConfigurationElement element : elements) { try { String nameSpace = element.getNamespaceIdentifier(); if (nameSpace != null) { bundleIDs.add(nameSpace); } } catch (InvalidRegistryObjectException e) { Activator.log(LogService.LOG_ERROR, e.getMessage(), e); } } } for (String bundleId : bundleIDs) { if (bundleId != null) { prefs.add(InstanceScope.INSTANCE.getNode(bundleId)); } } } return prefs; }
Source:
public void createContainers(String path) throws Exception; public SyncBuilder sync(); public RemoveWatchesBuilder watches(); public Listenable<ConnectionStateListener> getConnectionStateListenable(); public Listenable<CuratorListener> getCuratorListenable(); public Listenable<UnhandledErrorListener> getUnhandledErrorListenable(); @Deprecated public CuratorFramework nonNamespaceView(); public CuratorFramework usingNamespace(String newNamespace); public String getNamespace(); public CuratorZookeeperClient getZookeeperClient(); @Deprecated public EnsurePath newNamespaceAwareEnsurePath(String path); @Deprecated public void clearWatcherReferences(Watcher watcher); public boolean blockUntilConnected(int maxWaitTime, TimeUnit units) throws InterruptedException; public void blockUntilConnected() throws InterruptedException; public WatcherRemoveCuratorFramework newWatcherRemoveCuratorFramework(); public ConnectionStateErrorPolicy getConnectionStateErrorPolicy(); public QuorumVerifier getCurrentConfig(); SchemaSet getSchemaSet(); boolean isZk34CompatibilityMode(); default void postSafeNotify(Object monitorHolder) { runSafe(() -> { synchronized(monitorHolder) { monitorHolder.notifyAll(); } }); }

Target:
public void createContainers(String path) throws Exception; public SyncBuilder sync(); public RemoveWatchesBuilder watches(); public Listenable<ConnectionStateListener> getConnectionStateListenable(); public Listenable<CuratorListener> getCuratorListenable(); public Listenable<UnhandledErrorListener> getUnhandledErrorListenable(); @Deprecated public CuratorFramework nonNamespaceView(); public CuratorFramework usingNamespace(String newNamespace); public String getNamespace(); public CuratorZookeeperClient getZookeeperClient(); @Deprecated public EnsurePath newNamespaceAwareEnsurePath(String path); @Deprecated public void clearWatcherReferences(Watcher watcher); public boolean blockUntilConnected(int maxWaitTime, TimeUnit units) throws InterruptedException; public void blockUntilConnected() throws InterruptedException; public WatcherRemoveCuratorFramework newWatcherRemoveCuratorFramework(); public ConnectionStateErrorPolicy getConnectionStateErrorPolicy(); public QuorumVerifier getCurrentConfig(); SchemaSet getSchemaSet(); boolean isZk34CompatibilityMode(); default CompletableFuture<Void> postSafeNotify(Object monitorHolder) { return runSafe(() -> { synchronized(monitorHolder) { monitorHolder.notifyAll(); } }); }
Source:
public ActionForward viewDescriptionCurricularPlan(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { String degreeCurricularPlanID = RequestUtils.getAndSetStringToRequest(request, "degreeCurricularPlanID"); DegreeCurricularPlan degreeCurricularPlan = FenixFramework.getDomainObject(degreeCurricularPlanID); if (degreeCurricularPlan == null) { addErrorMessage(request, "noDegreeCurricularPlan", "error.coordinator.chosenDegree"); return new ActionForward(mapping.getInput()); } request.setAttribute("degreeCurricularPlan", degreeCurricularPlan); request.setAttribute( "degreeCurricularPlanDescription", new LocalizedString().with(Locale.ENGLISH, degreeCurricularPlan.getDescriptionEn()).with(new Locale("pt", "PT"), degreeCurricularPlan.getDescription())); return mapping.findForward("viewDescriptionCurricularPlan"); }

Target:
public ActionForward viewDescriptionCurricularPlan(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { String degreeCurricularPlanID = RequestUtils.getAndSetStringToRequest(request, "degreeCurricularPlanID"); DegreeCurricularPlan degreeCurricularPlan = FenixFramework.getDomainObject(degreeCurricularPlanID); if (degreeCurricularPlan == null) { addErrorMessage(request, "noDegreeCurricularPlan", "error.coordinator.chosenDegree"); return new ActionForward(mapping.getInput()); } request.setAttribute("degreeCurricularPlan", degreeCurricularPlan); request.setAttribute( "degreeCurricularPlanDescription", new LocalizedString().with(MultiLanguageString.en, degreeCurricularPlan.getDescriptionEn()).with( MultiLanguageString.pt, degreeCurricularPlan.getDescription())); return mapping.findForward("viewDescriptionCurricularPlan"); }