auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { try { final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { description.setStorageResourceId(storageResourceId); } description.setCreationTime(System.currentTimeMillis()); if (description.getDataMovementInterfaces() != null) { description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); } StorageResourceDescription storageResourceDescription = create(description); return storageResourceDescription.getStorageResourceId(); } catch (Exception e) { logger.error("Error while saving storage resource...", e); throw new AppCatalogException(e); } }

Target:
public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { try { final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); if ("".equals(description.getStorageResourceId()) || airavata_commonsConstants.DEFAULT_ID.equals(description.getStorageResourceId())) { description.setStorageResourceId(storageResourceId); } description.setCreationTime(System.currentTimeMillis()); if (description.getDataMovementInterfaces() != null) { description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); } StorageResourceDescription storageResourceDescription = create(description); return storageResourceDescription.getStorageResourceId(); } catch (Exception e) { logger.error("Error while saving storage resource. StorageResourceId : " + description.getStorageResourceId() + "" + " HostName : " + description.getHostName(), e); throw new AppCatalogException("Error while saving storage resource. StorageResourceId : " + description.getStorageResourceId() + "" + " HostName : " + description.getHostName(), e); } }
Source:
public Object get(ByteBuffer buf, int position) { int size = card.sizeof(); byte[] bytes = new byte[size]; for (int i = 0; i < size; i++) { bytes[i] = buf.get(position + i); } ICardinality cardinalityCounter = new AdaptiveCounting(bytes); return cardinalityCounter; }

Target:
public Object get(ByteBuffer buf, int position) { int size = card.sizeof(); byte[] bytes = new byte[size]; ByteBuffer copy = buf.duplicate(); copy.position(position); copy.get(bytes, 0, size); ICardinality cardinalityCounter = new AdaptiveCounting(bytes); return cardinalityCounter; }
Source:
public void burn() { int ogLogAmount = ctx.inventory.select().id(logChoiceID).count(); Item tinder = ctx.inventory.select().id(tinder_id).poll(); Item log = ctx.inventory.select().id(logChoiceID).poll(); log.interact("Use"); tinder.interact(("Use")); Condition.wait(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return ctx.players.local().animation() == -1; } }); Condition.wait(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return ctx.players.local().animation() == -1; } }); int newLogAmount = ctx.inventory.select().id(logChoiceID).count(); if (ogLogAmount == newLogAmount) { int randomX = org.powerbot.script.Random.nextInt(0,5); int randomY = org.powerbot.script.Random.nextInt(-2, 2); Tile randomTile = ctx.players.local().tile().derive(randomX,randomY); ctx.movement.step(randomTile); } }

Target:
public void burn() { int ogLogAmount = ctx.inventory.select().id(logChoiceID).count(); Item tinder = ctx.inventory.select().id(tinder_id).poll(); Item log = ctx.inventory.select().id(logChoiceID).poll(); log.interact("Use"); Condition.sleep(100); tinder.interact(("Use")); Condition.sleep(700); ctx.inventory.select().id(logChoiceID).peek().hover(); Condition.wait(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return ctx.players.local().animation() == -1 && !ctx.players.local().inMotion(); } }); int newLogAmount = ctx.inventory.select().id(logChoiceID).count(); if (ogLogAmount == newLogAmount) { Tile bestOption = calcBestNewStartingSpot(); ctx.movement.step(bestOption); Condition.wait(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return !ctx.players.local().inMotion(); } }); } }
Source:
private void translateV1VolumesToV2(Map<String, Object> cattleServiceData, Map<String, Object> composeServiceData, Map<String, Object> volumesData) { String volumeDriver = String.valueOf(cattleServiceData.get(ComposeExportConfigItem.VOLUME_DRIVER .getCattleName())); if (StringUtils.isEmpty(volumeDriver)) { return; } if ("null".equals(volumeDriver)) { volumeDriver = VolumeConstants.LOCAL_DRIVER; } composeServiceData.remove(ComposeExportConfigItem.VOLUME_DRIVER .getDockerName()); Object dataVolumes = cattleServiceData.get(InstanceConstants.FIELD_DATA_VOLUMES); if (dataVolumes == null) { return; } for (String dataVolume : (List<String>) dataVolumes) { String[] splitted = dataVolume.split(":"); if (splitted.length < 2) { continue; } String dataVolumeName = splitted[0]; Path p = Paths.get(dataVolumeName); if (p.isAbsolute()) { continue; } if (volumesData.containsKey(dataVolumeName)) { continue; } Map<String, Object> cattleVolumeData = new HashMap<>(); cattleVolumeData.put(ServiceConstants.FIELD_VOLUME_EXTERNAL, true); cattleVolumeData.put(ServiceConstants.FIELD_VOLUME_DRIVER, volumeDriver); Map<String, Object> composeVolumeData = new HashMap<>(); for (String cattleVolume : cattleVolumeData.keySet()) { translateRancherToCompose(true, cattleVolumeData, composeVolumeData, cattleVolume, null, true); } if (!composeVolumeData.isEmpty()) { volumesData.put(dataVolumeName, composeVolumeData); } } }

Target:
private void translateV1VolumesToV2(Map<String, Object> cattleServiceData, Map<String, Object> composeServiceData, Map<String, Object> volumesData) { String volumeDriver = ObjectUtils.toString((cattleServiceData.get(ComposeExportConfigItem.VOLUME_DRIVER .getCattleName()))); if (StringUtils.isBlank(volumeDriver)) { return; } composeServiceData.remove(ComposeExportConfigItem.VOLUME_DRIVER .getDockerName()); Object dataVolumes = cattleServiceData.get(InstanceConstants.FIELD_DATA_VOLUMES); if (dataVolumes == null) { return; } for (String dataVolume : (List<String>) dataVolumes) { String[] splitted = dataVolume.split(":"); if (splitted.length < 2) { continue; } String dataVolumeName = splitted[0]; Path p = Paths.get(dataVolumeName); if (p.isAbsolute()) { continue; } if (volumesData.containsKey(dataVolumeName)) { continue; } Map<String, Object> cattleVolumeData = new HashMap<>(); cattleVolumeData.put(ServiceConstants.FIELD_VOLUME_EXTERNAL, true); cattleVolumeData.put(ServiceConstants.FIELD_VOLUME_DRIVER, volumeDriver); Map<String, Object> composeVolumeData = new HashMap<>(); for (String cattleVolume : cattleVolumeData.keySet()) { translateRancherToCompose(true, cattleVolumeData, composeVolumeData, cattleVolume, null, true); } if (!composeVolumeData.isEmpty()) { volumesData.put(dataVolumeName, composeVolumeData); } } }
Source:
private boolean containsAny(List<? extends EObject> sequence1, List<? extends EObject> sequence2) { for (EObject o2 : sequence2) { if (sequence1.contains(o2)) { return true; } } return false; }

Target:
private boolean containsAny(List<? extends EObject> sequence1, List<? extends EObject> sequence2) { return Iterables.any(sequence2, Predicates.in(sequence1)); }
Source:
public static ParseResult<CompilationUnit> parse(final String code, final String encoding, boolean considerComments) throws ParseException { try { InputStream in = SourcesHelper.stringToStream(code, encoding); ASTParser astParser = new ASTParser(in, encoding); CompilationUnit cu = astParser.CompilationUnit(); if (considerComments) { insertComments(cu, code); } return new ParseResult<CompilationUnit>(cu, astParser.getTokens()); } catch (IOException ioe) { throw new ParseException(ioe.getMessage()); } }

Target:
public static CompilationUnit parse(final String code, final String encoding, boolean considerComments) throws ParseException { return parseToResult(code, encoding, considerComments).getNode(); }
Source:
private static <B extends Message.Builder> Class<B> getBuilderForType(TypeUrl typeUrl) { Class<B> builderClass; try { builderClass = (Class<B>) Class.forName(KnownTypes.getClassName(typeUrl).value()) .getClasses()[0]; } catch (ClassNotFoundException | ClassCastException e) { builderClass = null; } return builderClass; }

Target:
private static <B extends Message.Builder> Class<B> getBuilderForType(TypeUrl typeUrl) { Class<B> builderClass; final String className = KnownTypes.getClassName(typeUrl) .value(); try { builderClass = (Class<B>) Class.forName(className) .getClasses()[0]; } catch (ClassNotFoundException e) { final String message = String.format( BUILDER_CLASS_ERROR_LOGGING_PATTERN, className); log().warn(message, e); builderClass = null; } catch (ClassCastException e) { final String message = String.format( TYPE_CAST_ERROR_LOGGING_PATTERN, className); log().warn(message, e); builderClass = null; } return builderClass; }
Source:
public ResponseEntity<String> searchEvent(EventSearch eventSearch) { try { return getResponseHandler() .setDataAdapter(new EventSearchAdapter(userEventService)) .success(eventService.searchEvent(eventSearch)); } catch (final Exception e) { LOGGER.error(EGOV_API_ERROR, e); return getResponseHandler().error(getMessage(SERVER_ERROR_KEY)); } }

Target:
public ResponseEntity<String> searchEvent(EventSearch eventSearch) { return getResponseHandler() .setDataAdapter(new EventSearchAdapter(userEventService)) .success(eventService.searchEvent(eventSearch)); }
Source:
private static boolean mbusShortIdMatches(final MbusChannelElementsDto mbusChannelElements, final ChannelElementValuesDto channelElementValues) { final boolean hasMbusDeviceInfo = mbusChannelElements.hasMbusIdentificationNumber() && mbusChannelElements.hasMbusManufacturerIdentification() && mbusChannelElements.hasMbusVersion() && mbusChannelElements.hasMbusDeviceTypeIdentification(); final boolean hasMbusChannelElementMatch = Objects.equals(mbusChannelElements.getMbusIdentificationNumber(), channelElementValues.getIdentificationNumber()) && Objects.equals(mbusChannelElements.getMbusManufacturerIdentification(), channelElementValues.getManufacturerIdentification()) && Objects.equals(mbusChannelElements.getMbusVersion(), channelElementValues.getVersion()) && Objects.equals(mbusChannelElements.getMbusDeviceTypeIdentification(), channelElementValues.getDeviceTypeIdentification()); return hasMbusDeviceInfo && hasMbusChannelElementMatch; }

Target:
private static boolean mbusShortIdMatches(final MbusChannelElementsDto mbusChannelElements, final ChannelElementValuesDto channelElementValues) { return hasMbusDeviceInfo(mbusChannelElements) && hasMbusChannelElementMatch(mbusChannelElements, channelElementValues); }
Source:
public static void main(String[] args) { try { CommandLine cmd = argumentParser.parseCommandLine(args); if (argumentParser.shouldPrintHelp()) { argumentParser.printHelp(); System.exit(EXIT_SUCCESS); } String pathname = ""; if (cmd.getArgs().length >= 1) { pathname = cmd.getArgs()[0]; } if (cmd.getArgs().length < 1 || pathname.isEmpty()) { System.err.println("Swift source file must be provided."); argumentParser.printHelp(); System.exit(EXIT_FAILURE); } Severity maxSeverity = null; try { maxSeverity = argumentParser.getSeverityLevel(); } catch (Severity.IllegalSeverityException e) { System.err.println("Invalid value provided for option " + ArgumentParser.MAX_SEVERITY_OPT + "."); argumentParser.printHelp(); System.exit(1); } File inputFile = new File(pathname); FileInputStream inputStream = new FileInputStream(inputFile); SwiftLexer lexer = new SwiftLexer(new ANTLRInputStream(inputStream)); CommonTokenStream stream = new CommonTokenStream(lexer); SwiftParser swiftParser = new SwiftParser(stream); SwiftParser.TopLevelContext tree = swiftParser.topLevel(); MaxLengths maxLengths = argumentParser.parseMaxLengths(); try (Printer printer = new Printer(inputFile, maxSeverity)) { MainListener listener = new MainListener(printer, maxLengths); ParseTreeWalker walker = new ParseTreeWalker(); walker.walk(listener, tree); FileListener fileListener = new FileListener(printer, inputFile, maxLengths); fileListener.verify(); } } catch (ArgumentParserException | ParseException | IOException e) { System.err.println("Source file analysis failed. Reason: " + e.getMessage()); System.exit(EXIT_FAILURE); } }

Target:
public static void main(String[] args) { try { CommandLine cmd = argumentParser.parseCommandLine(args); if (argumentParser.shouldPrintHelp()) { argumentParser.printHelp(); System.exit(EXIT_SUCCESS); } String pathname = ""; if (cmd.getArgs().length >= 1) { pathname = cmd.getArgs()[0]; } if (cmd.getArgs().length < 1 || pathname.isEmpty()) { System.err.println("Swift source file must be provided."); argumentParser.printHelp(); System.exit(EXIT_FAILURE); } MaxLengths maxLengths = argumentParser.parseMaxLengths(); Severity maxSeverity = argumentParser.getMaxSeverity(); File inputFile = new File(pathname); FileInputStream inputStream = new FileInputStream(inputFile); SwiftLexer lexer = new SwiftLexer(new ANTLRInputStream(inputStream)); CommonTokenStream stream = new CommonTokenStream(lexer); SwiftParser swiftParser = new SwiftParser(stream); SwiftParser.TopLevelContext tree = swiftParser.topLevel(); try (Printer printer = new Printer(inputFile, maxSeverity)) { MainListener listener = new MainListener(printer, maxLengths); ParseTreeWalker walker = new ParseTreeWalker(); walker.walk(listener, tree); FileListener fileListener = new FileListener(printer, inputFile, maxLengths); fileListener.verify(); } } catch (ParseException | IOException e) { System.err.println("Source file analysis failed. Reason: " + e.getMessage()); System.exit(EXIT_FAILURE); } catch (ArgumentParserException e) { System.err.println(e.getMessage()); argumentParser.printHelp(); System.exit(EXIT_FAILURE); } }
Source:
private static Color getColor(int type) { switch (type) { case FilterParserLexer.OP: return new Color(0, 1, 0, 1); case FilterParserLexer.TEXT: return new Color(0, 0, 0, 1); case FilterParserLexer.SEPARATOR: return new Color(0, 0, 1, 1); default: return new Color(0, 0, 0, 1); } }

Target:
private static Color getColor(int type) { switch (type) { case FilterParserLexer.OP: return OPERATION_COLOR; case FilterParserLexer.TEXT: return TEXT_COLOR; case FilterParserLexer.SEPARATOR: return SEPARATOR_COLOR; default: return TEXT_COLOR; } }
Source:
public static JobDetail scheduleImport(Owner owner, String storedFileId, String uploadedFileName, ConflictOverrides overrides) { JobDataMap map = new JobDataMap(); map.put(JobStatus.OWNER_ID, owner.getKey()); map.put(JobStatus.TARGET_TYPE, JobStatus.TargetType.OWNER); map.put(JobStatus.TARGET_ID, owner.getKey()); map.put(STORED_FILE_ID, storedFileId); map.put(UPLOADED_FILE_NAME, uploadedFileName); map.put(CONFLICT_OVERRIDES, overrides.asStringArray()); map.put(JobStatus.CORRELATION_ID, MDC.get("csid")); log.info("CSID: " + map.get(JobStatus.CORRELATION_ID)); JobDetail detail = newJob(ImportJob.class) .withIdentity("import_" + Util.generateUUID()) .usingJobData(map) .build(); return detail; }

Target:
public static JobDetail scheduleImport(Owner owner, String storedFileId, String uploadedFileName, ConflictOverrides overrides) { JobDataMap map = new JobDataMap(); map.put(JobStatus.OWNER_ID, owner.getKey()); map.put(JobStatus.TARGET_TYPE, JobStatus.TargetType.OWNER); map.put(JobStatus.TARGET_ID, owner.getKey()); map.put(STORED_FILE_ID, storedFileId); map.put(UPLOADED_FILE_NAME, uploadedFileName); map.put(CONFLICT_OVERRIDES, overrides.asStringArray()); map.put(JobStatus.CORRELATION_ID, MDC.get(LoggingFilter.CSID)); JobDetail detail = newJob(ImportJob.class) .withIdentity("import_" + Util.generateUUID()) .usingJobData(map) .build(); return detail; }
Source:
private VDS getVdsFromRunningVm(VM vm) { return DbFacade.getInstance().getVdsDao().get(vm.getRunOnVds()); }

Target:
private VDS getVdsFromRunningVm(VM vm) { return getVdsDAO().get(vm.getRunOnVds()); }
Source:
private void createVolume(final GlusterVolumeEntity volume) { if (volume.getBricks() == null) { log.warn("Bricks of volume '{}' were not fetched. " + "Hence will not add it to engine at this point.", volume.getName()); return; } for (GlusterBrickEntity brick : volume.getBricks()) { if (brick == null) { log.warn("Volume '{}' contains a apparently corrupt brick(s). " + "Hence will not add it to engine at this point.", volume.getName()); return; } else if (brick.getServerId() == null) { log.warn("Volume '{}' contains brick(s) from unknown hosts. " + "Hence will not add it to engine at this point.", volume.getName()); return; } brick.setStatus(volume.getStatus()); } logUtil.logVolumeMessage(volume, AuditLogType.GLUSTER_VOLUME_CREATED_FROM_CLI); log.debug("Volume '{}' has been created directly using the gluster CLI. Creating it in engine as well.", volume.getName()); getVolumeDao().save(volume); if (volume.getName().equals(Config.<String> getValue(ConfigValues.GlusterMetaVolumeName))) { log.debug("Mounting gluster meta volume on nodes of cluster '{}'", volume.getVdsGroupName()); mountMetaVolumeOnNodes(volume.getClusterId()); } }

Target:
private void createVolume(final GlusterVolumeEntity volume) { if (volume.getBricks() == null) { log.warn("Bricks of volume '{}' were not fetched. " + "Hence will not add it to engine at this point.", volume.getName()); return; } for (GlusterBrickEntity brick : volume.getBricks()) { if (brick == null) { log.warn("Volume '{}' contains a apparently corrupt brick(s). " + "Hence will not add it to engine at this point.", volume.getName()); return; } else if (brick.getServerId() == null) { log.warn("Volume '{}' contains brick(s) from unknown hosts. " + "Hence will not add it to engine at this point.", volume.getName()); return; } brick.setStatus(volume.getStatus()); } logUtil.logVolumeMessage(volume, AuditLogType.GLUSTER_VOLUME_CREATED_FROM_CLI); log.debug("Volume '{}' has been created directly using the gluster CLI. Creating it in engine as well.", volume.getName()); getVolumeDao().save(volume); }
Source:
public void testCreateInvalidConfigAeadWithAuthAndCrypt() throws Exception { IpSecConfig ipSecConfig = buildBasicIpSecConfig(); for (int direction : directions) { ipSecConfig.setAuthentication(direction, authAlgo); ipSecConfig.setEncryption(direction, encryptAlgo); try { ipSecConfig.setAuthenticatedEncryption(direction, aeadAlgo); } catch (IllegalArgumentException expected) { } } try { mIpSecService.createTransportModeTransform(ipSecConfig, new Binder()); fail( "IpSecService should have thrown an error on authentication and encryption being" + " enabled with authenticated encryption"); } catch (IllegalArgumentException expected) { } }

Target:
public void testCreateInvalidConfigAeadWithAuthAndCrypt() throws Exception { IpSecConfig ipSecConfig = new IpSecConfig(); addDefaultSpisAndRemoteAddrToIpSecConfig(ipSecConfig); for (int direction : DIRECTIONS) { ipSecConfig.setAuthentication(direction, AUTH_ALGO); ipSecConfig.setEncryption(direction, CRYPT_ALGO); try { ipSecConfig.setAuthenticatedEncryption(direction, AEAD_ALGO); } catch (IllegalArgumentException expected) { } } try { mIpSecService.createTransportModeTransform(ipSecConfig, new Binder()); fail( "IpSecService should have thrown an error on authentication and encryption being" + " enabled with authenticated encryption"); } catch (IllegalArgumentException expected) { } }
Source:
public List<Pattern> createPatternObjects(Map<String, Stop> stopById, SQLErrorStorage errorStorage) { int nextPatternId = 1; List<Pattern> patterns = new ArrayList<>(); for (TripPatternKey key : tripsForPattern.keySet()) { Collection<Trip> trips = tripsForPattern.get(key); Pattern pattern = new Pattern(key.stops, trips, null); pattern.pattern_id = Integer.toString(nextPatternId++); pattern.associatedShapes = new HashSet<>(); pattern.associatedShapes .addAll(trips.stream().map(trip -> trip.shape_id).collect(Collectors.toList())); if (pattern.associatedShapes.size() > 1) { errorStorage.storeError(NewGTFSError.forEntity( pattern, NewGTFSErrorType.MULTIPLE_SHAPES_FOR_PATTERN) .setBadValue(pattern.associatedShapes.toString())); } pattern.patternStops = new ArrayList<>(); for (int i = 0; i < key.stops.size(); i++) { int dwellTime = key.departureTimes.get(i) - key.arrivalTimes.get(i); int travelTime = 0; String stopId = key.stops.get(i); if (i > 0) travelTime = key.arrivalTimes.get(i) - key.departureTimes.get(i - 1); double shapeDistTraveled = key.shapeDistances.get(i); pattern.patternStops.add( new PatternStop( pattern.pattern_id, stopId, i, travelTime, dwellTime, shapeDistTraveled, key.pickupTypes.get(i), key.dropoffTypes.get(i))); } patterns.add(pattern); } renamePatterns(patterns, stopById); LOG.info("Total patterns: {}", tripsForPattern.keySet().size()); return patterns; }

Target:
public Map<TripPatternKey, Pattern> createPatternObjects(Map<String, Stop> stopById, SQLErrorStorage errorStorage) { int nextPatternId = 1; Map<TripPatternKey, Pattern> patterns = new HashMap<>(); for (TripPatternKey key : tripsForPattern.keySet()) { Collection<Trip> trips = tripsForPattern.get(key); Pattern pattern = new Pattern(key.stops, trips, null); pattern.pattern_id = Integer.toString(nextPatternId++); pattern.associatedShapes = new HashSet<>(); trips.stream().forEach(trip -> pattern.associatedShapes.add(trip.shape_id)); if (pattern.associatedShapes.size() > 1) { errorStorage.storeError(NewGTFSError.forEntity( pattern, NewGTFSErrorType.MULTIPLE_SHAPES_FOR_PATTERN) .setBadValue(pattern.associatedShapes.toString())); } patterns.put(key, pattern); } renamePatterns(patterns.values(), stopById); LOG.info("Total patterns: {}", tripsForPattern.keySet().size()); return patterns; }
Source:
protected void OnEntityChanged() { super.OnEntityChanged(); if (getEntity() != null) { final StorageDomain storageDomain = (StorageDomain) getEntity(); setIsNfs(storageDomain.getStorageType() == StorageType.NFS); setIsLocalS(storageDomain.getStorageType() == StorageType.LOCALFS); setIsPosix(storageDomain.getStorageType() == StorageType.POSIXFS); if (getIsNfs() || getIsLocalS() || getIsPosix()) { AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void OnSuccess(Object model, Object ReturnValue) { StorageServerConnections connection = (StorageServerConnections) ReturnValue; StorageGeneralModel generalModel = (StorageGeneralModel) model; generalModel.setPath(connection == null ? null : connection.getconnection()); if (isPosix) { generalModel.setVfsType(connection.getVfsType()); generalModel.setMountOptions(connection.getMountOptions()); } } }; AsyncDataProvider.GetStorageConnectionById(_asyncQuery, storageDomain.getStorage(), true); } else { setPath(null); } } }

Target:
protected void OnEntityChanged() { super.OnEntityChanged(); if (getEntity() != null) { StorageDomain storageDomain = (StorageDomain) getEntity(); setIsNfs(storageDomain.getStorageType() == StorageType.NFS); setIsLocalS(storageDomain.getStorageType() == StorageType.LOCALFS); setIsPosix(storageDomain.getStorageType() == StorageType.POSIXFS); if (getIsNfs() || getIsLocalS() || getIsPosix()) { AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void OnSuccess(Object model, Object ReturnValue) { StorageServerConnections connection = (StorageServerConnections) ReturnValue; StorageGeneralModel generalModel = (StorageGeneralModel) model; generalModel.setPath(connection == null ? null : connection.getconnection()); if (isPosix) { generalModel.setVfsType(connection.getVfsType()); generalModel.setMountOptions(connection.getMountOptions()); } } }; AsyncDataProvider.GetStorageConnectionById(_asyncQuery, storageDomain.getStorage(), true); } else { setPath(null); } } }
Source:
public DefaultJsr107SerializationProvider() { super(new DefaultSerializationProviderConfiguration().addSerializerFor(Object.class, (Class) JavaSerializer.class)); }

Target:
public DefaultJsr107SerializationProvider() { super(new DefaultSerializationProviderConfiguration() .addSerializerFor(Object.class, (Class) CompactJavaSerializer.class) .addSerializerFor(Object.class, (Class) CompactPersistentJavaSerializer.class)); }
Source:
public static XmlFile getConfigXml(String serverName) { File xmlFile = new File(Jenkins.getInstance().getRootDir() + GERRIT_SERVER_EVENT_DATA_FOLDER + serverName, GERRIT_TRIGGER_SERVER_TIMESTAMPS_XML); xmlFile.getParentFile().mkdirs(); return new XmlFile(Jenkins.XSTREAM, xmlFile); }

Target:
public static XmlFile getConfigXml(String serverName) throws IOException { Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { return null; } File dataDir = new File(jenkins.getRootDir(), GERRIT_SERVER_EVENT_DATA_FOLDER); File serverDataDir = new File(dataDir, serverName); serverDataDir.mkdirs(); File xmlFile = new File(serverDataDir, GERRIT_TRIGGER_SERVER_TIMESTAMPS_XML); return new XmlFile(Jenkins.XSTREAM, xmlFile); }
Source:
public void write(Text key, Text value) throws IOException { String solrFieldName; SolrInputDocument document = new SolrInputDocument(); Schema inputSchema = GSON.fromJson(key.toString(), SCHEMA_TYPE); StructuredRecord structuredRecord = StructuredRecordStringConverter.fromJsonString(value.toString(), inputSchema); for (Schema.Field field : structuredRecord.getSchema().getFields()) { solrFieldName = field.getName(); if (config.getOutputFieldMap().containsKey(solrFieldName)) { document.addField(config.getOutputFieldMap().get(solrFieldName), structuredRecord.get(solrFieldName)); } else { document.addField(solrFieldName, structuredRecord.get(solrFieldName)); } } documentList.add(document); try { if (documentList.size() == Integer.parseInt(conf.get(BATCH_SIZE))) { solrClient.add(documentList); solrClient.commit(); documentList.clear(); } } catch (SolrServerException e) { throw new IllegalArgumentException("Exception while indexing the documents to Solr. For more details, Please " + "check the logs.", e); } }

Target:
public void write(Text key, Text value) throws IOException { String solrFieldName; SolrInputDocument document = new SolrInputDocument(); Schema inputSchema = GSON.fromJson(key.toString(), SCHEMA_TYPE); StructuredRecord structuredRecord = StructuredRecordStringConverter.fromJsonString(value.toString(), inputSchema); for (Schema.Field field : structuredRecord.getSchema().getFields()) { solrFieldName = field.getName(); if (outputFieldMap.containsKey(solrFieldName)) { document.addField(outputFieldMap.get(solrFieldName), structuredRecord.get(solrFieldName)); } else { document.addField(solrFieldName, structuredRecord.get(solrFieldName)); } } documentList.add(document); try { if (documentList.size() == batchSize) { solrClient.add(documentList); solrClient.commit(); documentList.clear(); } } catch (SolrServerException e) { throw new IllegalArgumentException("Exception while indexing the documents to Solr. For more details, Please " + "check the logs.", e); } }
Source:
public void processEvent(final CloudTrailEvent event) { String roleName = getRoleName(event); String policy = policyProvider.getPolicy(roleName, getRegion(event), getAccountId(event)); String policyTemplate = policyTemplatesProvider.getPolicyTemplate(roleName); JsonNode policyJson = null; JsonNode templatePolicyJson = null; try { policyJson = objectMapper.readTree(policy); templatePolicyJson = objectMapper.readTree(policyTemplate); } catch (IOException e) { LOG.warn("Could not read policy tree! For policy: and policy template: {}", policy, policyTemplate); } if (policyJson != null && !policyJson.equals(templatePolicyJson)) { violationSink.put( new ViolationBuilder( format("Role: %s cannot be modified", roleName)).withEventId(getCloudTrailEventId(event)) .withRegion(getCloudTrailEventRegion(event)) .withAccountId( getCloudTrailEventAccountId( event)) .build()); } }

Target:
public void processEvent(final CloudTrailEvent event) { String roleName = getRoleName(event); String policy = policyProvider.getPolicy(roleName, getRegion(event), getAccountId(event)); String policyTemplate = policyTemplatesProvider.getPolicyTemplate(roleName); JsonNode policyJson = null; JsonNode templatePolicyJson = null; try { policyJson = objectMapper.readTree(policy); templatePolicyJson = objectMapper.readTree(policyTemplate); } catch (IOException e) { LOG.warn("Could not read policy tree! For policy: and policy template: {}", policy, policyTemplate); return; } if (!policyJson.equals(templatePolicyJson)) { violationSink.put( new ViolationBuilder( format("Role: %s must not be modified", roleName)).withEventId(getCloudTrailEventId(event)) .withRegion(getCloudTrailEventRegion(event)) .withAccountId( getCloudTrailEventAccountId( event)) .build()); } }
Source:
public void testSaveMany() { await(store.saveMany(Flowable.fromArray(new AbstractMap.SimpleEntry(1, "adios"), new AbstractMap.SimpleEntry(2, "agur"), new AbstractMap.SimpleEntry(3, "ciao")))); assertEquals("adios", await(store.get(1))); assertEquals("agur", await(store.get(2))); assertEquals("ciao", await(store.get(3))); }

Target:
public void testSaveMany() { Publisher<WriteResult<Integer>> publisher = store.saveMany(Flowable.fromArray(new AbstractMap.SimpleEntry(1, "adios"), new AbstractMap.SimpleEntry(2, "agur"), new AbstractMap.SimpleEntry(3, "ciao"))); TestSubscriber<WriteResult<Integer>> testSubscriber = new TestSubscriber<>(); publisher.subscribe(testSubscriber); testSubscriber.awaitCount(3); assertEquals("adios", await(store.get(1))); assertEquals("agur", await(store.get(2))); assertEquals("ciao", await(store.get(3))); }
Source:
public PostDonationCounselling updatePostDonationCounselling(long id, CounsellingStatus counsellingStatus, Date counsellingDate, String notes) { PostDonationCounselling postDonationCounselling = postDonationCounsellingRepository.findById(id); if (postDonationCounselling == null) { throw new IllegalArgumentException("Post donation counselling not found for id: " + id); } if (postDonationCounselling.getCounsellingStatus() == null) { LOGGER.info("is null" + postDonationCounselling.getCounsellingStatus()); } else { deletePostDonationCounselling(id); LOGGER.info("Deleted postDonationCounselling "); postDonationCounselling = createPostDonationCounsellingForDonation(postDonationCounselling.getDonation()); LOGGER.info("Created new postDonationCounselling "); } postDonationCounselling.setFlaggedForCounselling(false); postDonationCounselling.setCounsellingStatus(counsellingStatus); postDonationCounselling.setCounsellingDate(counsellingDate); postDonationCounselling.getDonation().setNotes(notes); postDonationCounselling.setLastUpdated(new Date()); postDonationCounselling.setLastUpdatedBy(utilController.getCurrentUser()); postDonationCounselling.setCreatedBy(utilController.getCurrentUser()); postDonationCounselling.setIsDeleted(false); return postDonationCounsellingRepository.update(postDonationCounselling); }

Target:
public PostDonationCounselling updatePostDonationCounselling(long id, CounsellingStatus counsellingStatus, Date counsellingDate, String notes) { PostDonationCounselling postDonationCounselling = postDonationCounsellingRepository.findById(id); if (postDonationCounselling == null) { throw new IllegalArgumentException("Post donation counselling not found for id: " + id); } postDonationCounselling.setFlaggedForCounselling(Boolean.FALSE); postDonationCounselling.setCounsellingStatus(counsellingStatus); postDonationCounselling.setCounsellingDate(counsellingDate); postDonationCounselling.getDonation().setNotes(notes); postDonationCounselling.setLastUpdated(dateGeneratorService.generateDate()); postDonationCounselling.setLastUpdatedBy(utilController.getCurrentUser()); postDonationCounselling.setIsDeleted(Boolean.FALSE); return postDonationCounsellingRepository.update(postDonationCounselling); }
Source:
public void convertAutoIncrementToSequence(Session session, Schema schema, int id, boolean temporary) { if (autoIncrementOptions == null) { DbException.throwInternalError(); } if ("IDENTITY".equals(originalSQL)) { originalSQL = "BIGINT"; } else if ("SERIAL".equals(originalSQL)) { originalSQL = "INT"; } String sequenceName; do { ValueUuid uuid = ValueUuid.getNewRandom(); String s = uuid.getString(); s = StringUtils.toUpperEnglish(s.replace('-', '_')); sequenceName = "SYSTEM_SEQUENCE_" + s; } while (schema.findSequence(sequenceName) != null); Sequence seq = new Sequence(session, schema, id, sequenceName, autoIncrementOptions, true); seq.setTemporary(temporary); session.getDatabase().addSchemaObject(session, seq); setAutoIncrementOptions(null); Mode mode = session.getDatabase().getMode(); SequenceValue seqValue = new SequenceValue(seq); setDefaultExpression(session, seqValue); setSequence(seq); }

Target:
public void convertAutoIncrementToSequence(Session session, Schema schema, int id, boolean temporary) { if (autoIncrementOptions == null) { DbException.throwInternalError(); } if ("IDENTITY".equals(originalSQL)) { originalSQL = "BIGINT"; } else if ("SERIAL".equals(originalSQL)) { originalSQL = "INT"; } String sequenceName; do { ValueUuid uuid = ValueUuid.getNewRandom(); String s = uuid.getString(); s = StringUtils.toUpperEnglish(s.replace('-', '_')); sequenceName = "SYSTEM_SEQUENCE_" + s; } while (schema.findSequence(sequenceName) != null); Sequence seq = new Sequence(session, schema, id, sequenceName, autoIncrementOptions, true); seq.setTemporary(temporary); session.getDatabase().addSchemaObject(session, seq); setAutoIncrementOptions(null); SequenceValue seqValue = new SequenceValue(seq); setDefaultExpression(session, seqValue); setSequence(seq); }
Source:
public BooleanWrapper mapOnNodeUrlSet(Set<String> nodeUrls, Predicate<RMNode> operation, String operationName) { boolean result = true; for (String url : nodeUrls) { try { RMNode rmnode = getNodeByUrlIncludingDeployingNodes(url); if (rmnode == null) { logger.warn("Cannot " + operationName + ", unknown node: " + url); result = false; continue; } result &= operation.apply(rmnode); } catch (Exception e) { logger.error("Exception during mapOnNodeUrlSet.", e); result = false; } } return new BooleanWrapper(result); }

Target:
public BooleanWrapper mapOnNodeUrlSet(Set<String> nodeUrls, Predicate<RMNode> operation, String operationName) { boolean result = true; for (String url : nodeUrls) { try { RMNode rmnode = getNodeByUrlIncludingDeployingNodes(url); if (rmnode == null) { logger.warn("Cannot " + operationName + ", unknown node: " + url); result = false; continue; } result &= operation.apply(rmnode); } catch (Exception e) { logger.error("Error during " + operationName + " on node " + url, e); result = false; } } return new BooleanWrapper(result); }
Source:
public void work() { openUserSession(); AutomationService as = Framework.getLocalService(AutomationService.class); try (OperationContext oc = new OperationContext(session)) { oc.push("filename", StringUtils.isNotBlank(this.filename) ? this.filename : this.id); oc.setInput(blobList); Blob blob = (Blob) as.run(oc, CreateZip.ID); List<Blob> blobs = new ArrayList<Blob>(); blobs.add(blob); updateAndCompleteStoreEntry(blobs); } catch (Exception e) { TransientStore ts = getTransientStore(); ts.putParameter(key, DownloadService.ERROR, e); throw new NuxeoException("Exception while zipping blob list", e); } }

Target:
public void work() { openUserSession(); AutomationService as = Framework.getLocalService(AutomationService.class); try (OperationContext oc = new OperationContext(session)) { Blob blob; if (blobList.size() == 1) { blob = blobList.get(0); } else { oc.push("filename", StringUtils.isNotBlank(this.filename) ? this.filename : this.id); oc.setInput(new BlobList(blobList)); blob = (Blob) as.run(oc, CreateZip.ID); } updateAndCompleteStoreEntry(Collections.singletonList(blob)); } catch (OperationException e) { TransientStore ts = getTransientStore(); ts.putParameter(key, DownloadService.TRANSIENT_STORE_PARAM_ERROR, e.getMessage()); throw new NuxeoException("Exception while zipping blob list", e); } }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BackgroundRepository that = (BackgroundRepository) o; return delegatedRepository != null ? delegatedRepository.equals(that.delegatedRepository) : that.delegatedRepository == null; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BackgroundRepository that = (BackgroundRepository) o; EqualsBuilder builder = new EqualsBuilder(); builder.append(delegatedRepository, that.delegatedRepository); return builder.isEquals(); }
Source:
public void setUpFuseki() throws Exception { final String fusekiBase = "http://localhost:" + FUSEKI_PORT + "/test"; final FcrepoClient client = new FcrepoClient(null, null, null, true); final FcrepoResponse res = client.post( URI.create("http://localhost:" + FCREPO_PORT + "/fcrepo/rest"), ObjectHelper.loadResourceAsStream("container.ttl"), "text/turtle"); fullPath = res.getLocation().toString(); logger.info("Starting EmbeddedFusekiServer on port {}", FUSEKI_PORT); server = EmbeddedFusekiServer.mem(Integer.parseInt(FUSEKI_PORT, 10), "/test") ; server.start(); }

Target:
public void setUpFuseki() throws Exception { final FcrepoClient client = new FcrepoClient(null, null, null, true); final FcrepoResponse res = client.post( URI.create("http://localhost:" + FCREPO_PORT + "/fcrepo/rest"), ObjectHelper.loadResourceAsStream("container.ttl"), "text/turtle"); fullPath = res.getLocation().toString(); logger.info("Starting EmbeddedFusekiServer on port {}", FUSEKI_PORT); server = EmbeddedFusekiServer.mem(Integer.parseInt(FUSEKI_PORT, 10), "/test") ; server.start(); }
Source:
public void testWeakCounter() throws Exception { String url = String.format("http://localhost:%d/rest/v2/counters/weak", restServer().getPort()); ContentResponse response = client.newRequest(url) .method(HttpMethod.DELETE).send(); ResponseAssertion.assertThat(response).isOk(); response = client.newRequest(url) .method(HttpMethod.GET).send(); ResponseAssertion.assertThat(response).isOk(); assertEquals(0, Long.parseLong(response.getContentAsString())); response = client.newRequest(url) .method(HttpMethod.POST).content(new StringContentProvider("10")).send(); ResponseAssertion.assertThat(response).isOk(); for(int i = 0; i < 10; i++) { response = client.newRequest(url) .method(HttpMethod.GET).send(); ResponseAssertion.assertThat(response).isOk(); long value = Long.parseLong(response.getContentAsString()); if (value == 10) return; assertEquals(0, value); Thread.sleep(100); } }

Target:
public void testWeakCounter() throws Exception { String url = String.format("http://localhost:%d/rest/v2/counters/weak", restServer().getPort()); ContentResponse response = client.newRequest(url) .method(HttpMethod.POST).content(new StringContentProvider("10")).send(); ResponseAssertion.assertThat(response).isOk(); eventually(() -> { ContentResponse r = client.newRequest(url) .method(HttpMethod.GET).send(); ResponseAssertion.assertThat(r).isOk(); long value = Long.parseLong(r.getContentAsString()); return value == 10; }); response = client.newRequest(url) .method(HttpMethod.DELETE).send(); ResponseAssertion.assertThat(response).isOk(); response = client.newRequest(url) .method(HttpMethod.GET).send(); ResponseAssertion.assertThat(response).isOk(); assertEquals(0, Long.parseLong(response.getContentAsString())); }
Source:
public String toString() { return "CopyRatioCallingMetadata{" + "sampleName='" + sampleName + '\'' + ", sampleIndex=" + sampleIndex + ", sampleSexGenotypeData=" + sampleSexGenotypeData + ", sampleCoverageDepth=" + sampleCoverageDepth + ", emissionCalculationStrategy=" + emissionCalculationStrategy + '}'; }

Target:
public String toString() { return "CopyRatioCallingMetadata{" + "sampleName='" + sampleName + '\'' + ", sampleSexGenotypeData=" + sampleSexGenotypeData + ", sampleCoverageDepth=" + sampleCoverageDepth + ", emissionCalculationStrategy=" + emissionCalculationStrategy + ", sampleAverageMappingErrorProbability=" + sampleAverageMappingErrorProbability + '}'; }
Source:
public void testImporterDeploymentChanges() throws Exception { System.out.println("Removing and re-adding importers should cause them to restart"); ImporterConnector testConnector = new ImporterConnector("localhost", 7001, '\t'); testConnector.tryPush(5); updateDeploymentFile(false, false); Thread.sleep(1000); try { testConnector.tryPush(5); fail("Importer is still running even though it is no longer configured"); } catch (IOException expected) { } updateDeploymentFile(true, false); Thread.sleep(1000); testConnector.tryPush(5); }

Target:
public void testImporterDeploymentChanges() throws Exception { System.out.println("Removing and re-adding importers should cause them to restart"); ImporterConnector testConnector = new ImporterConnector(SERVER, SOCKET_IMPORTER_PORT, DELIMITER); testConnector.tryPush(5); updateDeploymentFile(false, false); try { testConnector.tryPush(5); fail("Importer is still running even though it is no longer configured"); } catch (IOException expected) { } updateDeploymentFile(true, false); testConnector.tryPush(5); }
Source:
private static PrepareCallback preparePaxos(Commit toPrepare, ReplicaList replicas, int requiredParticipants, ConsistencyLevel consistencyForPaxos, long queryStartNanoTime) throws WriteTimeoutException { PrepareCallback callback = new PrepareCallback(toPrepare.update.partitionKey(), toPrepare.update.metadata(), requiredParticipants, consistencyForPaxos, queryStartNanoTime); MessageOut<Commit> message = new MessageOut<Commit>(MessagingService.Verb.PAXOS_PREPARE, toPrepare, Commit.serializer); for (InetAddressAndPort target : replicas.asEndpoints()) { if (canDoLocalRequest(target)) { StageManager.getStage(MessagingService.verbStages.get(MessagingService.Verb.PAXOS_PREPARE)).execute(new Runnable() { public void run() { try { MessageIn<PrepareResponse> message = MessageIn.create(FBUtilities.getBroadcastAddressAndPort(), PrepareVerbHandler.doPrepare(toPrepare), Collections.emptyMap(), MessagingService.Verb.INTERNAL_RESPONSE, MessagingService.current_version); callback.response(message); } catch (Exception ex) { logger.error("Failed paxos prepare locally", ex); } } }); } else { MessagingService.instance().sendRR(message, target, callback); } } callback.await(); return callback; }

Target:
private static PrepareCallback preparePaxos(Commit toPrepare, ReplicaList replicas, int requiredParticipants, ConsistencyLevel consistencyForPaxos, long queryStartNanoTime) throws WriteTimeoutException { PrepareCallback callback = new PrepareCallback(toPrepare.update.partitionKey(), toPrepare.update.metadata(), requiredParticipants, consistencyForPaxos, queryStartNanoTime); MessageOut<Commit> message = new MessageOut<Commit>(MessagingService.Verb.PAXOS_PREPARE, toPrepare, Commit.serializer); for (Replica replica: replicas) { if (canDoLocalRequest(replica.getEndpoint())) { StageManager.getStage(MessagingService.verbStages.get(MessagingService.Verb.PAXOS_PREPARE)).execute(new Runnable() { public void run() { try { MessageIn<PrepareResponse> message = MessageIn.create(FBUtilities.getBroadcastAddressAndPort(), PrepareVerbHandler.doPrepare(toPrepare), Collections.emptyMap(), MessagingService.Verb.INTERNAL_RESPONSE, MessagingService.current_version); callback.response(message); } catch (Exception ex) { logger.error("Failed paxos prepare locally", ex); } } }); } else { MessagingService.instance().sendRR(message, replica.getEndpoint(), callback); } } callback.await(); return callback; }
Source:
public void setUp() { super.setUp(); try { calculation = calcFactory.create(); } catch (Throwable ex) { Logger.getLogger(CalculateInstallmentsTest.class.getName()).log(Level.SEVERE, null, ex); } }

Target:
public void setUp() { super.setUp(); calculation = new Calculation(); }
Source:
public void delete() { String sharePath = getPathOnShare(); try { if (isFile()) { logger.debug("deleting file {}", sharePath); getShare().rm(sharePath); } else { logger.debug("deleting directory {}", sharePath); getShare().rmdir(sharePath, false); } } catch (TransportException e) { throw new RuntimeIOException(format("Cannot delete %s: %s", sharePath, e.toString()), e); } catch (SMBApiException e) { throw new RuntimeIOException(format("Cannot delete %s: %s", sharePath, e.toString()), e); } }

Target:
public void delete() { delete(false); }
Source:
public static TailsResponse getAllTails(RuntimeLayout runtimeLayout) { Set<String> segmentsHeadNodes = getChainHeadFromAllSegments(runtimeLayout.getLayout()); long[] globalTail = {Address.NON_EXIST}; final Map<UUID, Long> streamTails = new HashMap<>(); segmentsHeadNodes.stream() .map(node -> runtimeLayout .getLogUnitClient(node) .getAllTails()) .map(CFUtils::getUninterruptibly) .forEach(resp -> { checkArgument(resp.getEpoch() == runtimeLayout.getLayout().getEpoch()); globalTail[0] = Long.max(resp.getLogTail(), globalTail[0]); resp.getStreamTails().forEach((k, v) -> streamTails.merge(k, v, Long::max)); }); log.debug("getAllTails: nodes selected stream tails {}", segmentsHeadNodes, streamTails); return new TailsResponse(runtimeLayout.getLayout().getEpoch(), globalTail[0], streamTails); }

Target:
public static TailsResponse getAllTails(RuntimeLayout runtimeLayout) { Set<String> segmentsHeadNodes = getChainHeadFromAllSegments(runtimeLayout.getLayout()); AtomicLong globalTail = new AtomicLong(Address.NON_EXIST); final Map<UUID, Long> streamTails = new HashMap<>(); List<CompletableFuture<TailsResponse>> cfs = segmentsHeadNodes.stream() .map(node -> runtimeLayout.getLogUnitClient(node).getAllTails()) .collect(Collectors.toList()); cfs.stream() .map(CFUtils::getUninterruptibly) .forEach( resp -> { epochCheck(resp.getEpoch(), runtimeLayout.getLayout().getEpoch()); globalTail.set(Long.max(resp.getLogTail(), globalTail.get())); resp.getStreamTails().forEach((k, v) -> streamTails.merge(k, v, Long::max)); }); log.debug("getAllTails: nodes selected stream tails {}", segmentsHeadNodes, streamTails); return new TailsResponse(runtimeLayout.getLayout().getEpoch(), globalTail.get(), streamTails); }
Source:
public synchronized Boolean addEventListener(final TimeyEventListener timeyEventListener) { this.listener.add(timeyEventListener); return Boolean.TRUE; }

Target:
public synchronized boolean addEventListener(final TimeyEventListener timeyEventListener) { boolean result = false; try { this.listener.add(timeyEventListener); result = true; } catch (final Exception e) { } return result; }
Source:
public void read( PropertyRecord record, PageCursor cursor, RecordLoad mode, int recordSize ) throws IOException { int offset = cursor.getOffset(); byte headerByte = cursor.getByte(); boolean inUse = isInUse( headerByte ); if ( mode.shouldLoad( inUse ) ) { int blockCount = headerByte >>> 4; long recordId = record.getId(); record.initialize( inUse, toAbsolute( Reference.decode( cursor ), recordId ), toAbsolute( Reference.decode( cursor ), recordId ) ); if ( (blockCount > record.getBlockCapacity()) || (RECORD_SIZE - (cursor.getOffset() - offset) < blockCount * Long.BYTES) ) { cursor.setCursorException( "PropertyRecord claims to contain more blocks than can fit in a record" ); return; } while ( blockCount-- > 0 ) { record.addLoadedBlock( cursor.getLong() ); } } }

Target:
public void read( PropertyRecord record, PageCursor cursor, RecordLoad mode, int recordSize ) { int offset = cursor.getOffset(); byte headerByte = cursor.getByte(); boolean inUse = isInUse( headerByte ); if ( mode.shouldLoad( inUse ) ) { int blockCount = headerByte >>> 4; long recordId = record.getId(); record.initialize( inUse, toAbsolute( Reference.decode( cursor ), recordId ), toAbsolute( Reference.decode( cursor ), recordId ) ); if ( (blockCount > record.getBlockCapacity()) | (RECORD_SIZE - (cursor.getOffset() - offset) < blockCount * Long.BYTES) ) { cursor.setCursorException( "PropertyRecord claims to contain more blocks than can fit in a record" ); return; } while ( blockCount-- > 0 ) { record.addLoadedBlock( cursor.getLong() ); } } }
Source:
public String getText() { if (this.textElements.size() == 0) { return ""; } StringBuilder sb = new StringBuilder(); for (TextElement te: this.textElements) { sb.append(te.getText()); } return Normalizer.normalize(sb.toString(), Normalizer.Form.NFKD); }

Target:
public String getText() { if (this.textElements.size() == 0) { return ""; } StringBuilder sb = new StringBuilder(); for (TextElement te: this.textElements) { sb.append(te.getText()); } return Normalizer.normalize(sb.toString(), Normalizer.Form.NFKC).trim(); }