auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Dialog createDialog(Activity activity, final Bundle args) { mapActivity = (MapActivity) activity; AlertDialog.Builder builder = new Builder(mapActivity); builder.setTitle(R.string.send_location_way_choose_title); builder.setItems(new String[]{ "Email", "SMS", "Clipboard", "geo:", "QR-Code" }, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { final double latitude = args.getDouble(MapActivityActions.KEY_LATITUDE); final double longitude = args.getDouble(MapActivityActions.KEY_LONGITUDE); final int zoom = args.getInt(MapActivityActions.KEY_ZOOM); try { final String shortOsmUrl = MapUtils.buildShortOsmUrl(latitude, longitude, zoom); final String geoUrl = MapUtils.buildGeoUrl(latitude, longitude, zoom); String sms = mapActivity.getString(R.string.send_location_sms_pattern, geoUrl, shortOsmUrl); if (which == 0) { sendEmail(shortOsmUrl, geoUrl); } else if (which == 1) { sendSms(sms); } else if (which == 2) { sendToClipboard(sms); } else if (which == 3) { sendGeoActivity(geoUrl); } else if (which == 4) { sendQRCode(latitude, longitude); } } catch (RuntimeException e) { Toast.makeText(mapActivity, R.string.input_output_error, Toast.LENGTH_SHORT).show(); } } }); return builder.create(); }

Target:
public Dialog createDialog(Activity activity, final Bundle args) { mapActivity = (MapActivity) activity; AlertDialog.Builder builder = new Builder(mapActivity); builder.setTitle(R.string.send_location_way_choose_title); builder.setItems(new String[]{ "Email", "SMS", "Clipboard", "geo:", "QR-Code" }, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { final double latitude = args.getDouble(MapActivityActions.KEY_LATITUDE); final double longitude = args.getDouble(MapActivityActions.KEY_LONGITUDE); final int zoom = args.getInt(MapActivityActions.KEY_ZOOM); try { final String geoUrl = MapUtils.buildGeoUrl(latitude, longitude, zoom); final String httpUrl = "<LINK_0>" + ((float) latitude) + "&lon=" + ((float) longitude) + "&z=" + zoom; String sms = mapActivity.getString(R.string.send_location_sms_pattern, geoUrl, httpUrl); if (which == 0) { sendEmail(httpUrl, geoUrl); } else if (which == 1) { sendSms(sms); } else if (which == 2) { sendToClipboard(sms); } else if (which == 3) { sendGeoActivity(geoUrl); } else if (which == 4) { sendQRCode(latitude, longitude); } } catch (RuntimeException e) { Toast.makeText(mapActivity, R.string.input_output_error, Toast.LENGTH_SHORT).show(); } } }); return builder.create(); }
Source:
public ZkCloudname connectWithTimeout(long waitTime, TimeUnit waitUnit) throws CloudnameException { try { zkObjectHandler = new ZkObjectHandler( new ZooKeeper(connectString, SESSION_TIMEOUT, this)); if (! connectedSignal.await(waitTime, waitUnit)) { zkObjectHandler.close(); throw new CloudnameException("Connecting to ZooKeeper timed out."); } log.fine("Connected to ZooKeeper " + connectString); } catch (IOException e) { zkObjectHandler.close(); throw new CloudnameException(e); } catch (InterruptedException e) { zkObjectHandler.close(); throw new CloudnameException(e); } resolver = new ZkResolver.Builder().addStrategy(new StrategyAll()) .addStrategy(new StrategyAny()).build(zkObjectHandler.getClient()); start(); return this; }

Target:
public ZkCloudname connectWithTimeout(long waitTime, TimeUnit waitUnit) throws CloudnameException { boolean connected = false; try { zkObjectHandler = new ZkObjectHandler( new ZooKeeper(connectString, SESSION_TIMEOUT, this)); if (! connectedSignal.await(waitTime, waitUnit)) { throw new CloudnameException("Connecting to ZooKeeper timed out."); } log.fine("Connected to ZooKeeper " + connectString); connected = true; } catch (IOException e) { throw new CloudnameException(e); } catch (InterruptedException e) { throw new CloudnameException(e); } finally { if (!connected) { zkObjectHandler.close(); } } resolver = new ZkResolver.Builder().addStrategy(new StrategyAll()) .addStrategy(new StrategyAny()).build(zkObjectHandler.getClient()); scheduler.scheduleWithFixedDelay(this, 1 , 1000 , TimeUnit.MILLISECONDS); return this; }
Source:
public String getUsage(ICommandSender sender) { return new TextComponentTranslation("commands.bloodmagic.orb." + getName() + ".usage").getFormattedText() + "\n" + help; }

Target:
public String getUsage(ICommandSender sender) { return "commands.bloodmagic.orb." + getName() + ".usage"; }
Source:
public WebSocketClientHandshaker07 setForceCloseTimeoutMillis(long forceCloseTimeoutMillis) { this.forceCloseTimeoutMillis = forceCloseTimeoutMillis; return this; }

Target:
public WebSocketClientHandshaker07 setForceCloseTimeoutMillis(long forceCloseTimeoutMillis) { super.setForceCloseTimeoutMillis(forceCloseTimeoutMillis); return this; }
Source:
private void doRequest(String url, String method, final OutputProvider output) throws IOException { try (HttpResponse conn = requestFactory.request(0, url, method, null, null, null)) { if (output instanceof HttpOutputMessage) { HttpOutputMessage httpOutput = (HttpOutputMessage)output; httpOutput.setStatus(conn.getResponseCode()); final String contentType = conn.getContentType(); if (contentType != null) { httpOutput.addHttpHeader(HttpHeaders.CONTENT_TYPE, contentType); } final String contentDisposition = conn.getHeaderField(HttpHeaders.CONTENT_DISPOSITION); if (contentDisposition != null) { httpOutput.addHttpHeader(HttpHeaders.CONTENT_DISPOSITION, contentDisposition); } } try (InputStream in = conn.getInputStream(); OutputStream out = output.getOutputStream()) { ByteStreams.copy(in, out); } } }

Target:
private void doRequest(String url, String method, final OutputProvider output) throws IOException { try (HttpResponse conn = requestFactory.target(url).setTimeout(60 * 1000).setMethod(method).request()) { if (output instanceof HttpOutputMessage) { HttpOutputMessage httpOutput = (HttpOutputMessage)output; httpOutput.setStatus(conn.getResponseCode()); final String contentType = conn.getContentType(); if (contentType != null) { httpOutput.addHttpHeader(HttpHeaders.CONTENT_TYPE, contentType); } final String contentDisposition = conn.getHeaderField(HttpHeaders.CONTENT_DISPOSITION); if (contentDisposition != null) { httpOutput.addHttpHeader(HttpHeaders.CONTENT_DISPOSITION, contentDisposition); } } try (InputStream in = conn.getInputStream(); OutputStream out = output.getOutputStream()) { ByteStreams.copy(in, out); } } }
Source:
private void enqueueModuleBuild(GitInfo branch, RepositoryBuild branchBuild, Module module) throws IOException, NonRetryableBuildException { String sha = branchBuild.getCommitInfo().get().getCurrent().getId(); String folder = module.getFolder(); String configPath = folder + (folder.isEmpty() ? "" : "/") + ".blazar.yaml"; BuildConfig baseConfig = buildConfigUtils.getConfigAtRefOrDefault(branch, configPath, sha); final BuildConfig mergedConfig; if (baseConfig.getBuildpack().isPresent()) { BuildConfig buildpackConfig = buildConfigUtils.getConfigForBuildpackOnBranch(baseConfig.getBuildpack().get()); mergedConfig = buildConfigUtils.mergeConfig(baseConfig, buildpackConfig); } else if (module.getBuildpack().isPresent()) { BuildConfig buildpackConfig = buildConfigUtils.getConfigForBuildpackOnBranch(module.getBuildpack().get()); mergedConfig = buildConfigUtils.mergeConfig(baseConfig, buildpackConfig); } else { mergedConfig = baseConfig; } moduleBuildService.enqueue(branchBuild, module, baseConfig, buildConfigUtils.ensureDefaultConfigurationForBuild(mergedConfig)); }

Target:
private void enqueueModuleBuild(GitInfo branch, RepositoryBuild branchBuild, Module module) throws IOException, NonRetryableBuildException { String sha = branchBuild.getCommitInfo().get().getCurrent().getId(); String folder = module.getFolder(); String configPath = folder + (folder.isEmpty() ? "" : "/") + ".blazar.yaml"; BuildConfig buildConfig = buildConfigUtils.getConfigAtRefOrDefault(branch, configPath, sha); final BuildConfig mergedConfig; if (buildConfig.getBuildpack().isPresent()) { BuildConfig buildpackConfig = buildConfigUtils.getConfigForBuildpackOnBranch(buildConfig.getBuildpack().get()); mergedConfig = buildConfigUtils.mergeConfig(buildConfig, buildpackConfig); } else if (module.getBuildpack().isPresent()) { BuildConfig buildpackConfig = buildConfigUtils.getConfigForBuildpackOnBranch(module.getBuildpack().get()); mergedConfig = buildConfigUtils.mergeConfig(buildConfig, buildpackConfig); } else { mergedConfig = buildConfig; } moduleBuildService.enqueue(branchBuild, module, buildConfig, buildConfigUtils.addMissingBuildConfigSettings(mergedConfig)); }
Source:
public @Nullable StateDescription getStateDescription(@Nullable Locale locale) { return stateDescriptionService.getStateDescription(this.name, locale); }

Target:
public @Nullable StateDescription getStateDescription(@Nullable Locale locale) { if (stateDescriptionService != null) { return stateDescriptionService.getStateDescription(this.name, locale); } return null; }
Source:
public ParseFile(File file, String contentType) { this(null, file, contentType); }

Target:
public ParseFile(File file, String contentType) { this(new State.Builder().name(file.getName()).mimeType(contentType).build()); if (file.length() > MAX_FILE_SIZE) { throw new IllegalArgumentException(String.format("ParseFile must be less than %d bytes", MAX_FILE_SIZE)); } this.file = file; }
Source:
public DataFileWriter<D> appendTo(File file) throws IOException { SeekableInput input = new SeekableFileInput(file); OutputStream output = new SyncableFileOutputStream(file, true); try { return appendTo(input, output); } finally { input.close(); } }

Target:
public DataFileWriter<D> appendTo(File file) throws IOException { SeekableInput input = null; try { input = new SeekableFileInput(file); OutputStream output = new SyncableFileOutputStream(file, true); return appendTo(input, output); } finally { if (input != null) input.close(); } }
Source:
public CompositeFileListFilter<F> addFilters(Collection<? extends FileListFilter<F>> filtersToAdd) { for (FileListFilter<F> elf : filtersToAdd) { if (elf instanceof DiscardAwareFileListFilter) { ((DiscardAwareFileListFilter<F>) elf).addDiscardCallback(this.discardCallback); } if (elf instanceof InitializingBean) { try { ((InitializingBean) elf).afterPropertiesSet(); } catch (Exception e) { throw new IllegalStateException(e); } } } this.fileFilters.addAll(filtersToAdd); this.allSupportAccept &= filtersToAdd.stream().allMatch(f -> f.supportsSingleFileFiltering()); return this; }

Target:
public CompositeFileListFilter<F> addFilters(Collection<? extends FileListFilter<F>> filtersToAdd) { for (FileListFilter<F> elf : filtersToAdd) { if (elf instanceof DiscardAwareFileListFilter) { ((DiscardAwareFileListFilter<F>) elf).addDiscardCallback(this.discardCallback); } if (elf instanceof InitializingBean) { try { ((InitializingBean) elf).afterPropertiesSet(); } catch (Exception e) { throw new IllegalStateException(e); } } } this.fileFilters.addAll(filtersToAdd); this.allSupportAccept &= filtersToAdd.stream().allMatch(FileListFilter<F>::supportsSingleFileFiltering); return this; }
Source:
public void testCrcOutputStream() throws IOException { byte[] buf = new byte[4000]; ByteBufferOutputStream stream = new ByteBufferOutputStream(ByteBuffer.wrap(buf)); CrcOutputStream crcStream = new CrcOutputStream(stream); byte[] bufOutput = new byte[4000]; new Random().nextBytes(bufOutput); try { crcStream.write(bufOutput); } catch (IOException e) { Assert.assertTrue(false); } Assert.assertArrayEquals(buf, bufOutput); long value1 = crcStream.getValue(); stream = new ByteBufferOutputStream(ByteBuffer.wrap(buf)); crcStream = new CrcOutputStream(stream); try { crcStream.write(bufOutput[0]); crcStream.write(bufOutput, 1, 3999); } catch (IOException e) { Assert.assertTrue(false); } Assert.assertArrayEquals(buf, bufOutput); long value2 = crcStream.getValue(); Assert.assertEquals(value1, value2); crcStream.close(); }

Target:
public void testCrcOutputStream() throws IOException { byte[] buf = new byte[4000]; ByteBufferOutputStream stream = new ByteBufferOutputStream(ByteBuffer.wrap(buf)); CrcOutputStream crcStream = new CrcOutputStream(stream); byte[] bufOutput = new byte[4000]; new Random().nextBytes(bufOutput); try { crcStream.write(bufOutput); } catch (IOException e) { Assert.assertTrue(false); } Assert.assertArrayEquals(buf, bufOutput); long value1 = crcStream.getValue(); stream = new ByteBufferOutputStream(ByteBuffer.wrap(buf)); crcStream = new CrcOutputStream(stream); try { crcStream.write(bufOutput[0]); crcStream.write(bufOutput, 1, 3999); } catch (IOException e) { Assert.assertTrue(false); } Assert.assertArrayEquals(buf, bufOutput); long value2 = crcStream.getValue(); Assert.assertEquals(value1, value2); bufOutput[0] = (byte) (~bufOutput[0]); stream = new ByteBufferOutputStream(ByteBuffer.wrap(buf)); crcStream = new CrcOutputStream(stream); try { crcStream.write(bufOutput[0]); crcStream.write(bufOutput, 1, 3999); } catch (IOException e) { Assert.assertTrue(false); } Assert.assertArrayEquals(buf, bufOutput); long value3 = crcStream.getValue(); Assert.assertFalse(value2 == value3); crcStream.close(); }
Source:
private String selectAll(CairoEngine engine, SqlCompiler compiler, SqlExecutionContext sqlExecutionContext, String tableName) throws Exception { CompiledQuery compiledQuery = compiler.compile("select * from " + tableName, sqlExecutionContext); try (RecordCursorFactory factory = compiledQuery.getRecordCursorFactory(); RecordCursor cursor = factory.getCursor(sqlExecutionContext)) { sink.clear(); printer.print(cursor, factory.getMetadata(), true); cursor.toTop(); Record record = cursor.getRecord(); while (cursor.hasNext()) { printer.print(record, factory.getMetadata()); } } return sink.toString(); }

Target:
private String selectAll(CairoEngine engine, SqlCompiler compiler, SqlExecutionContext sqlExecutionContext, String tableName) throws Exception { CompiledQuery compiledQuery = compiler.compile("select * from " + tableName, sqlExecutionContext); try (RecordCursorFactory factory = compiledQuery.getRecordCursorFactory(); RecordCursor cursor = factory.getCursor(sqlExecutionContext)) { sink.clear(); printer.print(cursor, factory.getMetadata(), true); } return sink.toString(); }
Source:
Set<Element> originatingElements() { return FluentIterable.from(body.nestedTypeWriters) .transformAndConcat(new Function<TypeWriter, Iterable<Element>>() { @Override public Iterable<Element> apply(TypeWriter input) { return input.originatingElements(); } }) .append(originatingElements) .toSet(); }

Target:
Set<Element> originatingElements() { ImmutableSet.Builder<Element> elements = ImmutableSet.builder(); elements.addAll(originatingElements); for (TypeWriter nestedTypeWriter : body.nestedTypeWriters) { elements.addAll(nestedTypeWriter.originatingElements()); } return elements.build(); }
Source:
public OWLOntology saveOntology( final OWLOntology ontology, OWLDocumentFormat format, IRI ontologyIRI, boolean checkOBO) throws IOException { logger.debug("Saving ontology as with to IRI {}", ontology, format, ontologyIRI); XMLWriterPreferences.getInstance().setUseNamespaceEntities(getXMLEntityFlag()); if (ontologyIRI.toString().endsWith("gz")) { byte[] data = getOntologyFileData(ontology, format, checkOBO); saveCompressedOntology(data, ontologyIRI); return ontology; } saveOntologyFile(ontology, format, ontologyIRI, checkOBO); return ontology; }

Target:
public OWLOntology saveOntology( final OWLOntology ontology, OWLDocumentFormat format, IRI ontologyIRI, boolean checkOBO) throws IOException { logger.debug("Saving ontology as with to IRI {}", ontology, format, ontologyIRI); XMLWriterPreferences.getInstance().setUseNamespaceEntities(getXMLEntityFlag()); if (ontologyIRI.toString().endsWith(".gz")) { byte[] data = getOntologyFileData(ontology, format, checkOBO); saveCompressedOntology(data, ontologyIRI); return ontology; } saveOntologyFile(ontology, format, ontologyIRI, checkOBO); return ontology; }
Source:
public static Properties loadTrimmedProperties(File propsFile) throws IOException { Properties props = new Properties(); String charset = checkFileCharset(propsFile); if (charset == null) throw new IOException("Can't identify input file charset"); try (InputStreamReader propsIS = new InputStreamReader(new FileInputStream(propsFile), charset)) { loadTrimmedProperties(props, propsIS); } return props; }

Target:
public static Properties loadTrimmedProperties(File propsFile) throws IOException { Properties props = new Properties(); Charset charset = checkFileCharset(propsFile); log.debug("Opening " + propsFile.getName() + " in " + charset.name()); if (charset == null) { throw new IOException("Can't identify input file charset"); } try (InputStreamReader propsIS = new InputStreamReader(new FileInputStream(propsFile), charset)) { loadTrimmedProperties(props, propsIS); } return props; }
Source:
public String docs() { return "boolean {locationArray, [cmd]} Sets a command to a Command Block at the given location." + "If no command is given, it sets the Command Block to an empty string."; }

Target:
public String docs() { return "void {locationArray, [cmd]} Sets a command to a Command Block at the given location." + "If no command is given or parameter is null, it clears the Command Block."; }
Source:
protected Iterable<Text> getLines(int page) throws CommandException { if (this.pages.size() == 0) { return Lists.newArrayList(); } else if (page < 1) { throw new CommandException(t("Page %s does not exist!", page)); } else if (page > this.pages.size()) { throw new CommandException(t("Page %s is too high", page)); } return this.pages.get(page - 1); }

Target:
protected Iterable<Text> getLines(int page) throws CommandException { if (this.pages.size() == 0) { return ImmutableList.of(); } else if (page < 1) { throw new CommandException(t("Page %s does not exist!", page)); } else if (page > this.pages.size()) { throw new CommandException(t("Page %s is too high", page)); } return this.pages.get(page - 1); }
Source:
private void updateFeedbackResponses() { Set<String> studentsEmails = new HashSet<>(testData.students.size()); for (StudentAttributes student : testData.students.values()) { studentsEmails.add(student.email); } Set<Integer> questionsNumbers = new HashSet<>(testData.feedbackQuestions.size()); for (FeedbackQuestionAttributes question : testData.feedbackQuestions.values()) { questionsNumbers.add(question.questionNumber); } Set<String> feedbackResponsesKeys = testDataMax.feedbackResponses.keySet(); String giver; String recipient; String questionId; for (String key : feedbackResponsesKeys) { giver = testDataMax.feedbackResponses.get(key).giver; recipient = testDataMax.feedbackResponses.get(key).recipient; questionId = testDataMax.feedbackResponses.get(key).feedbackQuestionId; if (studentsEmails.contains(giver) && studentsEmails.contains(recipient) && questionsNumbers.contains(questionId)) { if (!testData.feedbackResponses.containsKey(key)) { testData.feedbackResponses.put(key, testDataMax.feedbackResponses.get(key)); } } else if (testData.feedbackResponses.containsKey(key)) { testData.feedbackResponses.remove(key); } } }

Target:
private void updateFeedbackResponses() { Set<String> studentsEmails = new HashSet<>(testData.students.size()); for (StudentAttributes student : testData.students.values()) { studentsEmails.add(student.email); } Set<String> feedbackQuestionIds = new HashSet<>(testData.feedbackQuestions.size()); for (FeedbackQuestionAttributes question : testData.feedbackQuestions.values()) { feedbackQuestionIds.add(String.valueOf(question.questionNumber)); } List<String> keysOfFeedbackResponsesToDelete = new LinkedList<>(); for (String key : testDataMax.feedbackResponses.keySet()) { if (studentsEmails.contains(testDataMax.feedbackResponses.get(key).giver) && studentsEmails.contains(testDataMax.feedbackResponses.get(key).recipient) && feedbackQuestionIds.contains(testDataMax.feedbackResponses.get(key).feedbackQuestionId) && !testData.feedbackResponses.containsKey(key)) { testData.feedbackResponses.put(key, testDataMax.feedbackResponses.get(key)); } else if ((!studentsEmails.contains(testDataMax.feedbackResponses.get(key).giver) || !studentsEmails.contains(testDataMax.feedbackResponses.get(key).recipient) || !feedbackQuestionIds.contains(testDataMax.feedbackResponses.get(key).feedbackQuestionId)) && testData.feedbackResponses.containsKey(key)) { keysOfFeedbackResponsesToDelete.add(key); } } if (!keysOfFeedbackResponsesToDelete.isEmpty()) { for (String removeKey : keysOfFeedbackResponsesToDelete) { testData.feedbackResponses.remove(removeKey); } } }
Source:
public CropAndResizeDataSetPreProcessor(int originalHeight, int originalWidth, int cropYStart, int cropXStart, int resizedHeight, int resizedWidth, int numChannels, ResizeMethod resizeMethod) { Preconditions.checkArgument(originalHeight > 0, "originalHeight must be greater than 0"); Preconditions.checkArgument(originalWidth > 0, "originalWidth must be greater than 0"); Preconditions.checkArgument(cropYStart >= 0, "cropYStart must be positive"); Preconditions.checkArgument(cropXStart >= 0, "cropXStart must be positive"); Preconditions.checkArgument(resizedHeight > 0, "resizedHeight must be greater than 0"); Preconditions.checkArgument(resizedWidth > 0, "resizedWidth must be greater than 0"); Preconditions.checkArgument(numChannels > 0, "numChannels must be greater than 0"); resizedShape = new long[] { 1, resizedHeight, resizedWidth, numChannels }; boxes = Nd4j.create(new float[] { (float)cropYStart / (float)originalHeight, (float)cropXStart / (float)originalWidth, (float)(cropYStart + resizedHeight) / (float)originalHeight, (float)(cropXStart + resizedWidth) / (float)originalWidth }, new long[] { 1, 4 }, DataType.FLOAT); indices = Nd4j.create(new int[] { 0 }, new long[] { 1, 1 }, DataType.INT); resize = Nd4j.create(new int[] { resizedHeight, resizedWidth }, new long[] { 1, 2 }, DataType.INT); method = resizeMethod == ResizeMethod.Bilinear ? 0 : 1; }

Target:
public CropAndResizeDataSetPreProcessor(int originalHeight, int originalWidth, int cropYStart, int cropXStart, int resizedHeight, int resizedWidth, int numChannels, ResizeMethod resizeMethod) { Preconditions.checkArgument(originalHeight > 0, "originalHeight must be greater than 0, got %s", originalHeight); Preconditions.checkArgument(originalWidth > 0, "originalWidth must be greater than 0, got %s", originalWidth); Preconditions.checkArgument(cropYStart >= 0, "cropYStart must be greater or equal to 0, got %s", cropYStart); Preconditions.checkArgument(cropXStart >= 0, "cropXStart must be greater or equal to 0, got %s", cropXStart); Preconditions.checkArgument(resizedHeight > 0, "resizedHeight must be greater than 0, got %s", resizedHeight); Preconditions.checkArgument(resizedWidth > 0, "resizedWidth must be greater than 0, got %s", resizedWidth); Preconditions.checkArgument(numChannels > 0, "numChannels must be greater than 0, got %s", numChannels); resizedShape = new long[] { 1, resizedHeight, resizedWidth, numChannels }; boxes = Nd4j.create(new float[] { (float)cropYStart / (float)originalHeight, (float)cropXStart / (float)originalWidth, (float)(cropYStart + resizedHeight) / (float)originalHeight, (float)(cropXStart + resizedWidth) / (float)originalWidth }, new long[] { 1, 4 }, DataType.FLOAT); indices = Nd4j.create(new int[] { 0 }, new long[] { 1, 1 }, DataType.INT); resize = Nd4j.create(new int[] { resizedHeight, resizedWidth }, new long[] { 1, 2 }, DataType.INT); method = resizeMethod == ResizeMethod.Bilinear ? 0 : 1; }
Source:
void bindInfrastructure() { bindCommonInfrastructure(UserPortalPlaceManager.class); bind(LoggedInExtendedPlaceGatekeeper.class).in(Singleton.class); bind(ApplicationInit.class).asEagerSingleton(); bind(CurrentUserRole.class).to(UserPortalCurrentUserRole.class).in(Singleton.class); }

Target:
void bindInfrastructure() { bindCommonInfrastructure(UserPortalPlaceManager.class); bind(LoggedInExtendedPlaceGatekeeper.class).in(Singleton.class); bind(CurrentUserRole.class).in(Singleton.class); bind(ApplicationInit.class).asEagerSingleton(); bindTypeAndImplAsSingleton(CurrentUserRole.class, UserPortalCurrentUserRole.class); }
Source:
public CompletionStage<Void> preload() { if (!enabled) return CompletableFutures.completedNull(); AdvancedCacheLoader<Object, Object> preloadCl = null; storesMutex.readLock().lock(); try { for (CacheLoader l : loaders) { if (getStoreConfig(l).preload()) { if (!(l instanceof AdvancedCacheLoader)) { throw new PersistenceException("Cannot preload from cache loader '" + l.getClass().getName() + "' as it doesn't implement '" + AdvancedCacheLoader.class.getName() + "'"); } preloadCl = (AdvancedCacheLoader) l; if (preloadCl instanceof AdvancedAsyncCacheLoader) preloadCl = (AdvancedCacheLoader) ((AdvancedAsyncCacheLoader) preloadCl).undelegate(); break; } } } finally { storesMutex.readLock().unlock(); } if (preloadCl == null) { return CompletableFutures.completedNull(); } long start = timeService.time(); final long maxEntries = getMaxEntries(); final AdvancedCache<Object, Object> flaggedCache = getCacheForStateInsertion(); return Flowable.fromPublisher(preloadCl.entryPublisher(null, true, true)) .take(maxEntries) .observeOn(blockingScheduler) .doOnNext(me -> preloadKey(flaggedCache, me)) .count() .subscribeOn(blockingScheduler) .to(RxJavaInterop.singleToCompletionStage()) .thenAccept(insertAmount -> { this.preloaded = insertAmount < maxEntries; log.debugf("Preloaded %d keys in %s", insertAmount, Util.prettyPrintTime(timeService.timeDuration(start, MILLISECONDS))); }); }

Target:
public CompletionStage<Void> preload() { if (!enabled) return CompletableFutures.completedNull(); AdvancedCacheLoader<Object, Object> preloadCl = null; storesMutex.readLock().lock(); try { for (CacheLoader l : loaders) { if (getStoreConfig(l).preload()) { if (!(l instanceof AdvancedCacheLoader)) { throw new PersistenceException("Cannot preload from cache loader '" + l.getClass().getName() + "' as it doesn't implement '" + AdvancedCacheLoader.class.getName() + "'"); } preloadCl = (AdvancedCacheLoader) l; if (preloadCl instanceof AdvancedAsyncCacheLoader) preloadCl = (AdvancedCacheLoader) ((AdvancedAsyncCacheLoader) preloadCl).undelegate(); break; } } } finally { storesMutex.readLock().unlock(); } if (preloadCl == null) { return CompletableFutures.completedNull(); } long start = timeService.time(); final long maxEntries = getMaxEntries(); final AdvancedCache<Object, Object> flaggedCache = getCacheForStateInsertion(); return Flowable.fromPublisher(preloadCl.entryPublisher(null, true, true)) .take(maxEntries) .doOnNext(me -> preloadKey(flaggedCache, me)) .count() .observeOn(nonBlockingScheduler) .subscribeOn(blockingScheduler) .to(RxJavaInterop.singleToCompletionStage()) .thenAccept(insertAmount -> { this.preloaded = insertAmount < maxEntries; log.debugf("Preloaded %d keys in %s", insertAmount, Util.prettyPrintTime(timeService.timeDuration(start, MILLISECONDS))); }); }
Source:
private IAtsTeamWorkflow createSafetyAction(TransactionReadable tx, WordUpdateChange updateChange, IAtsTeamWorkflow teamWf, ArtifactReadable userArt) { IAtsTeamWorkflow teamWorkflow = null; try { IAtsActionableItem ai = atsServer.getConfig().getSoleByUuid(AtsArtifactToken.SafetyActionableItem.getUuid(), IAtsActionableItem.class); IAtsTeamDefinition teamDef = atsServer.getConfig().getSoleByUuid(AtsArtifactToken.SafetyTeamDefinition.getUuid(), IAtsTeamDefinition.class); IAtsUser createdBy = AtsCoreUsers.SYSTEM_USER; IAtsChangeSet changes = atsServer.getStoreService().createAtsChangeSet("Create System Safety Workflow", atsServer.getUserService().getUserById(userArt.getSoleAttributeAsString(CoreAttributeTypes.UserId))); teamWorkflow = atsServer.getActionFactory().createTeamWorkflow(atsServer.getActionFactory().getAction(teamWf), teamDef, java.util.Collections.singleton(ai), null, changes, new Date(), createdBy, new NewActionAdapter() { @Override public void teamCreated(IAtsAction action, IAtsTeamWorkflow teamWf, IAtsChangeSet changes) throws OseeCoreException { changes.setSoleAttributeValue(teamWf, AtsAttributeTypes.Description, "Review System Safety Changes for the associated RPCR to Complete the Workflow"); } }); changes.setSoleAttributeValue(teamWorkflow, CoreAttributeTypes.Name, "Safety Workflow for " + teamWf.getAtsId()); changes.execute(); } catch (Exception ex) { } return teamWorkflow; }

Target:
private IAtsTeamWorkflow createSafetyAction(TransactionReadable tx, WordUpdateChange updateChange, IAtsTeamWorkflow teamWf, ArtifactReadable userArt) { IAtsTeamWorkflow teamWorkflow = null; try { IAtsActionableItem ai = atsServer.getConfig().getSoleByUuid(AtsArtifactToken.SafetyActionableItem.getUuid(), IAtsActionableItem.class); if (ai == null) { throw new OseeCoreException("Safety Actionable Item not configured"); } IAtsTeamDefinition teamDef = atsServer.getConfig().getSoleByUuid(AtsArtifactToken.SafetyTeamDefinition.getUuid(), IAtsTeamDefinition.class); if (teamDef == null) { throw new OseeCoreException("Safety Team Definition not configured"); } IAtsUser createdBy = AtsCoreUsers.SYSTEM_USER; IAtsChangeSet changes = atsServer.getStoreService().createAtsChangeSet("Create System Safety Workflow", atsServer.getUserService().getUserById(userArt.getSoleAttributeAsString(CoreAttributeTypes.UserId))); teamWorkflow = atsServer.getActionFactory().createTeamWorkflow(atsServer.getActionFactory().getAction(teamWf), teamDef, java.util.Collections.singleton(ai), null, changes, new Date(), createdBy, new NewActionAdapter() { @Override public void teamCreated(IAtsAction action, IAtsTeamWorkflow teamWf, IAtsChangeSet changes) throws OseeCoreException { changes.setSoleAttributeValue(teamWf, AtsAttributeTypes.Description, "Review System Safety Changes for the associated RPCR to Complete the Workflow"); } }); changes.setSoleAttributeValue(teamWorkflow, CoreAttributeTypes.Name, "Safety Workflow for " + teamWf.getAtsId()); changes.execute(); } catch (Exception ex) { logger.error(ex, "WordUpdateData Safety Action creation"); } return teamWorkflow; }
Source:
private void addParentheses(IASTNode node) throws BadLocationException{ IASTNode[] children = node.getChildren(); if(children.length > 0 && !children[0].getRawSignature().contains("(")) { IASTNode childNode = children[0]; int childNodeLength = childNode.getFileLocation().getNodeLength(); int childNodeOffset = childNode.getFileLocation().getNodeOffset(); String childContent = document.get(childNodeOffset, childNodeLength); String newChild = "(".concat(childContent).concat(")"); document.replace(childNodeOffset, childNodeLength, newChild); } }

Target:
private void addParentheses(IASTNode node) throws BadLocationException{ IASTNode[] children = node.getChildren(); if(children.length > 0 && !children[0].getRawSignature().contains("(")) { IASTNode childNode = children[0]; int childNodeLength = childNode.getFileLocation().getNodeLength(); int childNodeOffset = childNode.getFileLocation().getNodeOffset(); String childContent = document.get(childNodeOffset, childNodeLength); String newChild = "(".concat(childContent).concat(")"); document.replace(childNodeOffset - 1, childNodeLength + 1, newChild); } }
Source:
public Result invoke(Invoker<?> invoker, Invocation inv) throws RpcException { try { String accesslog = invoker.getUrl().getParameter(Constants.ACCESS_LOG_KEY); if (ConfigUtils.isNotEmpty(accesslog)) { RpcContext context = RpcContext.getContext(); String serviceName = invoker.getInterface().getName(); String version = invoker.getUrl().getParameter(Constants.VERSION_KEY); String group = invoker.getUrl().getParameter(Constants.GROUP_KEY); StringBuilder sn = new StringBuilder(); sn.append("[").append(MESSAGE_DATE_FORMATTER.get().format(new Date())).append("] ").append(context.getRemoteHost()).append(":").append(context.getRemotePort()) .append(" -> ").append(context.getLocalHost()).append(":").append(context.getLocalPort()) .append(" - "); if (null != group && group.length() > 0) { sn.append(group).append("/"); } sn.append(serviceName); if (null != version && version.length() > 0) { sn.append(":").append(version); } sn.append(" "); sn.append(inv.getMethodName()); sn.append("("); Class<?>[] types = inv.getParameterTypes(); if (types != null && types.length > 0) { boolean first = true; for (Class<?> type : types) { if (first) { first = false; } else { sn.append(","); } sn.append(type.getName()); } } sn.append(") "); Object[] args = inv.getArguments(); if (args != null && args.length > 0) { sn.append(JSON.toJSONString(args)); } String msg = sn.toString(); if (ConfigUtils.isDefault(accesslog)) { LoggerFactory.getLogger(ACCESS_LOG_KEY + "." + invoker.getInterface().getName()).info(msg); } else { log(accesslog, msg); } } } catch (Throwable t) { logger.warn("Exception in AcessLogFilter of service(" + invoker + " -> " + inv + ")", t); } return invoker.invoke(inv); }

Target:
public Result invoke(Invoker<?> invoker, Invocation inv) throws RpcException { try { String accessLogKey = invoker.getUrl().getParameter(Constants.ACCESS_LOG_KEY); if (ConfigUtils.isNotEmpty(accessLogKey)) { AccessLogData logData = buildAccessLogData(invoker, inv); log(accessLogKey, logData); } } catch (Throwable t) { logger.warn("Exception in AcessLogFilter of service(" + invoker + " -> " + inv + ")", t); } return invoker.invoke(inv); }
Source:
public void startStatementWithinTransaction(Command command) { Transaction transaction = getTransaction(); if (transaction != null) { HashSet<MVMap<?, ?>> maps = new HashSet<>(); if (command != null) { Set<DbObject> dependencies = command.getDependencies(); switch (transaction.getIsolationLevel()) { case SNAPSHOT: case SERIALIZABLE: if (!transaction.hasStatementDependencies()) { for (Table table : database.getAllTablesAndViews(false)) { if (table instanceof MVTable) { addTableToDependencies((MVTable)table, maps); } } } case REPEATABLE_READ: HashSet<MVTable> processed = new HashSet<>(); for (DbObject dependency : dependencies) { if (dependency instanceof MVTable) { addTableToDependencies((MVTable)dependency, maps, processed); } } break; case READ_COMMITTED: for (DbObject dependency : dependencies) { if (dependency instanceof MVTable) { addTableToDependencies((MVTable)dependency, maps); } } break; } } transaction.markStatementStart(maps); } startStatement = -1; if (command != null) { setCurrentCommand(command); } }

Target:
public void startStatementWithinTransaction(Command command) { Transaction transaction = getTransaction(); if (transaction != null) { HashSet<MVMap<?, ?>> maps = new HashSet<>(); if (command != null) { Set<DbObject> dependencies = command.getDependencies(); switch (transaction.getIsolationLevel()) { case SNAPSHOT: case SERIALIZABLE: if (!transaction.hasStatementDependencies()) { for (Table table : database.getAllTablesAndViews(false)) { if (table instanceof MVTable) { addTableToDependencies((MVTable)table, maps); } } break; } case READ_COMMITTED: case READ_UNCOMMITTED: for (DbObject dependency : dependencies) { if (dependency instanceof MVTable) { addTableToDependencies((MVTable)dependency, maps); } } break; case REPEATABLE_READ: HashSet<MVTable> processed = new HashSet<>(); for (DbObject dependency : dependencies) { if (dependency instanceof MVTable) { addTableToDependencies((MVTable)dependency, maps, processed); } } break; } } transaction.markStatementStart(maps); } startStatement = -1; if (command != null) { setCurrentCommand(command); } }
Source:
public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); try { nextStatement.evaluate(); } catch (Throwable e) { errors.add(e); } IAfterTest after = null; log.debug("Run after class extensions for test class " + testClass.getJavaClass().getName()); afters.sort(new PriorityComparator()); for (IAfterTest each : afters) { after = each; try { if (after.hasToRun()){ log.debug("Run method runAfterTestClass() of class " + after.getClass().getCanonicalName()); after.runAfterTestClass(config, testClass); } } catch (Throwable e) { log.error("Run method runAfterTestClass() of class " + after.getClass().getCanonicalName() + " failed", e); if (isScreenshotRequired(e)) { createScreenshot("AfterClassExt", after.getClass()); } errors.add(e); } } MultipleFailureException.assertEmpty(errors); }

Target:
public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); try { nextStatement.evaluate(); } catch (Throwable e) { errors.add(e); } IAfterTest after = null; log.debug("Run after class extensions for test class " + testClass.getJavaClass().getName()); afters.sort(new PriorityComparator()); for (IAfterTest each : afters) { after = each; try { if (after.hasToRun()){ log.debug("Run method runAfterTestClass() of class " + after.getClass().getCanonicalName()); after.runAfterTestClass(config, testClass); } } catch (Throwable e) { if(ScreenshotCapturer.shouldCaptureScreenshotOnException(e)){ log.error("Run method runAfterTestClass() of class " + after.getClass().getCanonicalName() + " failed", e); createScreenshot("AfterClassExt", after.getClass()); } errors.add(e); } } MultipleFailureException.assertEmpty(errors); }
Source:
public void onSearchedEvent(String search) { DivElement listContainer = view.getListContainer(); int children = listContainer.getChildCount(); for (int i = 0; i < children; i ++) { DivElement child = (DivElement) listContainer.getChild(i); String factName = child.getAttribute("id").replace("listGroupItem-", "").toLowerCase(); if (factName.contains(search.toLowerCase())) { child.removeAttribute("style"); } else { child.setAttribute("style", "display: none;"); } } }

Target:
public void onSearchedEvent(String search) { clearList(); if(factTypeFieldsMap.isEmpty()) { return; } factTypeFieldsMap .entrySet() .stream() .filter(entry -> entry.getKey().toLowerCase().contains(search.toLowerCase())) .forEach(filteredEntry -> addListGroupItemView(filteredEntry.getKey(), filteredEntry.getValue())); }
Source:
public S3CmdPut( @NotNull(message = "name can't be NULL") final String label, @NotNull(message = "path can't be NULL") final String pth, @NotNull(message = "bucket can't be NULL") final String bkt, @NotNull(message = "prefix can't be NULL") final String pfx, @NotNull(message = "key can't be NULL") final String akey, @NotNull(message = "secret can't be NULL") final String scrt) { this(label, pth, bkt, pfx, akey, scrt, "binary/octet-stream", "UTF-8"); }

Target:
public S3CmdPut( @NotNull(message = "name can't be NULL") final String label, @NotNull(message = "path can't be NULL") final String pth, @NotNull(message = "bucket can't be NULL") final String bkt, @NotNull(message = "prefix can't be NULL") final String pfx, @NotNull(message = "key can't be NULL") final String akey, @NotNull(message = "secret can't be NULL") final String scrt) { this(label, pth, bkt, pfx, akey, scrt, "text/plain", "UTF-8"); }
Source:
public boolean isDslCompatibleWith(ElasticsearchFieldSortBuilderFactory obj) { if ( this == obj ) { return true; } if ( obj.getClass() != StandardFieldSortBuilderFactory.class ) { return false; } StandardFieldSortBuilderFactory other = (StandardFieldSortBuilderFactory) obj; return converter.isDslCompatibleWith( other.converter ); }

Target:
public boolean isDslCompatibleWith(ElasticsearchFieldSortBuilderFactory obj) { if ( this == obj ) { return true; } if ( obj.getClass() != StandardFieldSortBuilderFactory.class ) { return false; } StandardFieldSortBuilderFactory other = (StandardFieldSortBuilderFactory) obj; return sortable == other.sortable && converter.isDslCompatibleWith( other.converter ); }
Source:
public ProviderSqlSource(Configuration configuration, Object provider, Class<?> mapperType, Method mapperMethod) { this(configuration, provider instanceof Annotation ? (Annotation) provider : (Annotation) Proxy.newProxyInstance(SelectProvider.class.getClassLoader(), new Class<?>[]{SelectProvider.class}, (proxy, method, args) -> { if (method.getName().equals("annotationType")) { return SelectProvider.class; } return provider.getClass().getMethod(method.getName()).invoke(provider); }), mapperType, mapperMethod); }

Target:
public ProviderSqlSource(Configuration configuration, Object provider, Class<?> mapperType, Method mapperMethod) { this(configuration, (Annotation) provider , mapperType, mapperMethod); }
Source:
String key() { return "temporal"; }

Target:
String key() { return "number"; }
Source:
private void validateThreadLocal(OperatorMeta om) { Integer oioRoot = null; if (om.oioRoot != null) { return; } for (StreamMeta sm: om.inputStreams.values()){ if (sm.locality != Locality.THREAD_LOCAL){ String msg = String.format("Locality %s invalid for operator %s with multiple input streams as at least one of the input streams is not %s", Locality.THREAD_LOCAL, om, Locality.THREAD_LOCAL); throw new ValidationException(msg); } if (sm.source.operatorMeta.getOperator() instanceof Operator.DelayOperator) { String msg = String.format("Locality %s invalid for delay operator %s", Locality.THREAD_LOCAL, sm.source.operatorMeta); throw new ValidationException(msg); } if (om.getOperator() instanceof Operator.DelayOperator) { String msg = String.format("Locality %s invalid for delay operator %s", Locality.THREAD_LOCAL, om); throw new ValidationException(msg); } Integer oioStreamRoot = getOioRoot(sm.source.operatorMeta); if (om.oioRoot != null && oioStreamRoot != om.oioRoot){ String msg = String.format("Locality %s invalid for operator %s with multiple input streams as at least one of the input streams is not originating from common OIO owner node", Locality.THREAD_LOCAL, om, Locality.THREAD_LOCAL); throw new ValidationException(msg); } if (oioRoot == null) { oioRoot = oioStreamRoot; } else if (oioRoot.intValue() != oioStreamRoot.intValue()) { String msg = String.format("Locality %s invalid for operator %s with multiple input streams as they origin from different owner OIO operators", sm.locality, om); throw new ValidationException(msg); } } om.oioRoot = oioRoot; }

Target:
private void validateThreadLocal(OperatorMeta om) { Integer oioRoot = null; if (om.oioRoot != null) { return; } if (om.getOperator() instanceof Operator.DelayOperator) { String msg = String.format("Locality %s invalid for delay operator %s", Locality.THREAD_LOCAL, om); throw new ValidationException(msg); } for (StreamMeta sm: om.inputStreams.values()){ if (sm.locality != Locality.THREAD_LOCAL){ String msg = String.format("Locality %s invalid for operator %s with multiple input streams as at least one of the input streams is not %s", Locality.THREAD_LOCAL, om, Locality.THREAD_LOCAL); throw new ValidationException(msg); } if (sm.source.operatorMeta.getOperator() instanceof Operator.DelayOperator) { String msg = String.format("Locality %s invalid for delay operator %s", Locality.THREAD_LOCAL, sm.source.operatorMeta); throw new ValidationException(msg); } Integer oioStreamRoot = getOioRoot(sm.source.operatorMeta); if (om.oioRoot != null && oioStreamRoot != om.oioRoot){ String msg = String.format("Locality %s invalid for operator %s with multiple input streams as at least one of the input streams is not originating from common OIO owner node", Locality.THREAD_LOCAL, om, Locality.THREAD_LOCAL); throw new ValidationException(msg); } if (oioRoot == null) { oioRoot = oioStreamRoot; } else if (oioRoot.intValue() != oioStreamRoot.intValue()) { String msg = String.format("Locality %s invalid for operator %s with multiple input streams as they origin from different owner OIO operators", sm.locality, om); throw new ValidationException(msg); } } om.oioRoot = oioRoot; }
Source:
public void hoverClickAndViewPhotoOnTableCell(int questionBodyIndex, int tableRow, int tableCol, String urlRegex) throws Exception { String idOfQuestionBody = "questionBody-" + questionBodyIndex; JavascriptExecutor jsExecutor = (JavascriptExecutor) browser.driver; jsExecutor.executeScript("arguments[0].scrollIntoView(true); window.scrollBy(0, -200);", browser.driver.findElement(By.id(idOfQuestionBody))); jsExecutor.executeScript("$(document.getElementById('" + idOfQuestionBody + "')" + ".querySelectorAll('.dataTable tbody tr')['" + tableRow + "']" + ".querySelectorAll('td')['" + tableCol + "']" + ".getElementsByClassName('profile-pic-icon-hover')).mouseenter()"); waitForElementPresence(By.cssSelector(".popover-content")); jsExecutor.executeScript("document.getElementsByClassName('popover-content')[0]" + ".getElementsByTagName('a')[0].click();"); waitForElementPresence(By.cssSelector(".popover-content > img")); AssertHelper.assertContainsRegex(urlRegex, browser.driver.findElements(By.cssSelector(".popover-content > img")) .get(0) .getAttribute("src")); jsExecutor.executeScript("document.getElementsByClassName('popover')[0].parentNode.removeChild(document.getElementsByClassName('popover')[0])"); }

Target:
public void hoverClickAndViewPhotoOnTableCell(int questionBodyIndex, int tableRow, int tableCol, String urlRegex) throws Exception { String idOfQuestionBody = "questionBody-" + questionBodyIndex; JavascriptExecutor jsExecutor = (JavascriptExecutor) browser.driver; jsExecutor.executeScript("$(document.getElementById('" + idOfQuestionBody + "')" + ".querySelectorAll('.dataTable tbody tr')['" + tableRow + "']" + ".querySelectorAll('td')['" + tableCol + "']" + ".getElementsByClassName('profile-pic-icon-hover')).mouseenter()"); waitForElementPresence(By.cssSelector(".popover-content")); jsExecutor.executeScript("document.getElementsByClassName('popover-content')[0]" + ".getElementsByTagName('a')[0].click();"); waitForElementPresence(By.cssSelector(".popover-content > img")); AssertHelper.assertContainsRegex(urlRegex, browser.driver.findElements(By.cssSelector(".popover-content > img")) .get(0) .getAttribute("src")); jsExecutor.executeScript("document.getElementsByClassName('popover')[0].parentNode.removeChild(document.getElementsByClassName('popover')[0])"); }
Source:
public OnLoadHeaderItem setNonce(String nonce) { Args.notNull(nonce, "nonce"); this.nonce = nonce; return this; }

Target:
public OnLoadHeaderItem setNonce(String nonce) { this.nonce = nonce; return this; }
Source:
private static AuditStrategy initializeAuditStrategy( String auditStrategyName, Class<?> revisionInfoClass, PropertyData revisionInfoTimestampData, ServiceRegistry serviceRegistry) { AuditStrategy strategy; try { final Class<?> auditStrategyClass = loadClass( auditStrategyName, serviceRegistry ); strategy = (AuditStrategy) ReflectHelper.getDefaultConstructor( auditStrategyClass ).newInstance(); } catch (Exception e) { throw new MappingException( String.format( "Unable to create AuditStrategy [%s] instance.", auditStrategyName ), e ); } strategy.initializeAdditional(revisionInfoClass, revisionInfoTimestampData, serviceRegistry); return strategy; }

Target:
private static AuditStrategy initializeAuditStrategy( String auditStrategyName, Class<?> revisionInfoClass, PropertyData revisionInfoTimestampData, ServiceRegistry serviceRegistry) { AuditStrategy strategy; try { final Class<?> auditStrategyClass = loadClass( auditStrategyName, serviceRegistry ); strategy = (AuditStrategy) ReflectHelper.getDefaultConstructor( auditStrategyClass ).newInstance(); } catch (Exception e) { throw new MappingException( String.format( "Unable to create AuditStrategy [%s] instance.", auditStrategyName ), e ); } strategy.postInitialize( revisionInfoClass, revisionInfoTimestampData, serviceRegistry ); return strategy; }