auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public PageForm(final String themeId, final String title, final String hostId, final TemplateLayout layout, final Map<String, ContainerUUIDChanged> changes, Map<String, String> newlyContainersUUID) { this.themeId = themeId; this.title = title; this.hostId = hostId; this.layout = layout; this.changes = ImmutableMap.<String, ContainerUUIDChanged> builder().putAll(changes).build(); this.newlyContainersUUID = ImmutableMap.<String, String> builder().putAll(newlyContainersUUID).build(); }

Target:
public PageForm(final String themeId, final String title, final String hostId, final TemplateLayout layout, final Map<String, ContainerUUIDChanged> changes, Map<String, String> newlyContainersUUID) { this.themeId = themeId; this.title = title; this.hostId = hostId; this.layout = layout; this.changes = ImmutableMap.<String, ContainerUUIDChanged> builder().putAll(changes).build(); this.newlyContainersUUID = ImmutableMap.copyOf(newlyContainersUUID); }
Source:
protected void openIntentChooser() throws ActivityNotFoundException { Activity activity = this.reactContext.getCurrentActivity(); if (activity == null) { TargetChosenReceiver.sendCallback(false, "Something went wrong"); return; } Intent chooser; IntentSender intentSender = null; if (TargetChosenReceiver.isSupported()) { intentSender = TargetChosenReceiver.getSharingSenderIntent(this.reactContext); chooser = Intent.createChooser(this.getIntent(), this.chooserTitle, intentSender); } else { chooser = Intent.createChooser(this.getIntent(), this.chooserTitle); } chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); if (ShareIntent.hasValidKey("showAppsToView", options) && ShareIntent.hasValidKey("url", options)) { Intent viewIntent = new Intent(Intent.ACTION_VIEW); viewIntent.setType(this.fileShare.getType()); Intent[] viewIntents = this.getIntentsToViewFile(viewIntent, this.fileShare.getURI()); chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, viewIntents); } if (ShareIntent.hasValidKey("excludedActivityTypes", options)) { activity.startActivityForResult(excludeChooserIntent(this.getIntent(),options), RNShareModule.SHARE_REQUEST_CODE); } else { activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); } if (intentSender == null) { TargetChosenReceiver.sendCallback(true, true, "OK"); } }

Target:
protected void openIntentChooser() throws ActivityNotFoundException { Activity activity = this.reactContext.getCurrentActivity(); if (activity == null) { TargetChosenReceiver.sendCallback(false, "Something went wrong"); return; } Intent chooser; IntentSender intentSender = null; if (TargetChosenReceiver.isSupported()) { intentSender = TargetChosenReceiver.getSharingSenderIntent(this.reactContext); chooser = Intent.createChooser(this.getIntent(), this.chooserTitle, intentSender); } else { chooser = Intent.createChooser(this.getIntent(), this.chooserTitle); } chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); if (ShareIntent.hasValidKey("showAppsToView", options) && ShareIntent.hasValidKey("url", options)) { Intent viewIntent = new Intent(Intent.ACTION_VIEW); viewIntent.setType(this.fileShare.getType()); Intent[] viewIntents = this.getIntentsToViewFile(viewIntent, this.fileShare.getURI()); chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, viewIntents); } if (ShareIntent.hasValidKey("excludedActivityTypes", options)) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { chooser.putExtra(Intent.EXTRA_EXCLUDE_COMPONENTS, options.getArray("excludedActivityTypes").toString()); activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); }else { activity.startActivityForResult(excludeChooserIntent(this.getIntent(),options), RNShareModule.SHARE_REQUEST_CODE); } } else { activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); } if (intentSender == null) { TargetChosenReceiver.sendCallback(true, true, "OK"); } }
Source:
public Collection<Team> getCurrentTeams(Authentication auth) { User currentUser = (User) auth.getPrincipal(); return teamService.getTeamsByEmail(currentUser.getEmail()); }

Target:
public Collection<Team> getCurrentTeams(Authentication auth) { User currentUser = (User) auth.getPrincipal(); return teamService.getTeamsByMemberEmail(currentUser.getEmail()); }
Source:
protected void doExtraDependenciesProcessing(T o) { for (Dependency dependency : dependencies) { try { Field field = ClassReflection.getDeclaredField(o.getClass(), dependency.getField()); field.setAccessible(true); String fileValue = (String) field.get(o); if (fileValue != null) { assets.addDependency(fileValue, dependency.getClazz()); } } catch (ReflectionException e) { e.printStackTrace(); } } }

Target:
protected void doExtraDependenciesProcessing(T o) { for (Dependency dependency : dependencies) { try { Field field = ClassReflection.getDeclaredField(o.getClass(), dependency.getField()); field.setAccessible(true); String fileValue = (String) field.get(o); if (fileValue != null) { assets.addDependency(fileValue, dependency.getClazz()); } } catch (ReflectionException e) { Gdx.app.error( "SimpleSerializer", "Reflection exception on #doExtraDependenciesProcessing: Object class=" + o.getClass() + " List of dependencies=" + Dependency .dependencyListToString(dependencies), e); } } }
Source:
public static QueryInfo parseQuery(String sql) { Pattern insertIntoSqlPattern = Pattern.compile("insert into (.*) (select .* from (.*))", Pattern.CASE_INSENSITIVE); Matcher m = insertIntoSqlPattern.matcher(sql); if (!m.matches()) { throw new SamzaException("Invalid query format"); } Planner planner = createPlanner(); SqlNode sqlNode; try { sqlNode = planner.parse(sql); } catch (SqlParseException e) { throw new SamzaException(e); } String outputSource; String selectQuery; ArrayList<String> inputSources; if (sqlNode instanceof SqlInsert) { SqlInsert sqlInsert = ((SqlInsert) sqlNode); outputSource = sqlInsert.getTargetTable().toString(); if (sqlInsert.getSource() instanceof SqlSelect) { SqlSelect sqlSelect = (SqlSelect) sqlInsert.getSource(); selectQuery = m.group(2); inputSources = getInputFromSelectQuery(sqlSelect); } else { throw new SamzaException("Sql query is not of the expected format"); } } else { throw new SamzaException("Sql query is not of the expected format"); } return new QueryInfo(selectQuery, inputSources, outputSource); }

Target:
public static QueryInfo parseQuery(String sql) { Pattern insertIntoSqlPattern = Pattern.compile("insert into (.*) (select .* from (.*))", Pattern.CASE_INSENSITIVE); Matcher m = insertIntoSqlPattern.matcher(sql); if (!m.matches()) { throw new SamzaException("Invalid query format"); } Planner planner = createPlanner(); SqlNode sqlNode; try { sqlNode = planner.parse(sql); } catch (SqlParseException e) { throw new SamzaException(e); } String outputSource; String selectQuery; ArrayList<String> inputSources; if (sqlNode instanceof SqlInsert) { SqlInsert sqlInsert = ((SqlInsert) sqlNode); outputSource = sqlInsert.getTargetTable().toString(); if (sqlInsert.getSource() instanceof SqlSelect) { SqlSelect sqlSelect = (SqlSelect) sqlInsert.getSource(); selectQuery = m.group(2); inputSources = getInputsFromSelectQuery(sqlSelect); } else { throw new SamzaException("Sql query is not of the expected format"); } } else { throw new SamzaException("Sql query is not of the expected format"); } return new QueryInfo(selectQuery, inputSources, outputSource); }
Source:
protected void executeCommand() { Guid macPoolId = getParameters().getId(); MacPool macPool = macPoolPerCluster.getMacPoolById(macPoolId, getContext()); org.ovirt.engine.core.common.businessentities.MacPool dbMacPool = macPoolDao.get(macPoolId); Collection<Pair<String, String>> dbRangePairs = dbMacPool.getRanges() .stream() .map(range -> new Pair<>(range.getMacFrom(), range.getMacTo())) .collect(Collectors.toList()); getReturnValue().setActionReturnValue(macPool.getAvailableMacsFromAllRanges(dbRangePairs)); getReturnValue().setSucceeded(true); }

Target:
protected void executeCommand() { Guid macPoolId = getParameters().getId(); MacPool macPool = macPoolPerCluster.getMacPoolById(macPoolId, getContext()); org.ovirt.engine.core.common.businessentities.MacPool dbMacPool = macPoolDao.get(macPoolId); getReturnValue().setActionReturnValue(macPool.getAvailableMacsFromAllRanges(dbMacPool.getRanges())); getReturnValue().setSucceeded(true); }
Source:
public void hflush() throws IOException { hsync(); }

Target:
public void hflush() throws IOException { long startTimeNs = System.nanoTime(); if (!options.isSyncOnFlushEnabled()) { logger.atWarning().log( "hflush(): No-op: readers will *not* yet see flushed data for %s", finalGcsPath); throwIfNotOpen(); return; } if (syncRateLimiter == null || syncRateLimiter.tryAcquire()) { logger.atFine().log("hflush() uses hsync() for %s", finalGcsPath); hsyncInternal(startTimeNs); return; } logger.atWarning().log( "hflush(): No-op due to rate limit (%s): readers will *not* yet see flushed data for %s", syncRateLimiter, finalGcsPath); throwIfNotOpen(); }
Source:
private LockService createStickyLockService() throws InterruptedException { AtomicLong lockToken = new AtomicLong(0); ConcurrentHashSet<LockRequest> requestedLocks = new ConcurrentHashSet<>(); LockService stickyLockService = mock(LockService.class); doAnswer((invocation) -> { LockRequest request = (LockRequest) invocation.getArguments()[1]; if (requestedLocks.add(request)) { return new LockRefreshToken(BigInteger.valueOf(lockToken.getAndIncrement()), 1L); } else { return null; } }).when(stickyLockService).lock(any(), any()); return stickyLockService; }

Target:
private TimelockService createStickyLockService() throws InterruptedException { AtomicLong lockToken = new AtomicLong(0); Set<LockDescriptor> requestedLocks = new ConcurrentHashSet<>(); TimelockService stickyLockService = mock(TimelockService.class); doAnswer((invocation) -> { LockRequest request = (LockRequest) invocation.getArguments()[0]; if (requestedLocks.add(Iterables.getOnlyElement(request.getLockDescriptors()))) { return (LockResponse) () -> Optional.of(LockToken.of(new UUID(lockToken.getAndIncrement(), 0L))); } else { return (LockResponse) Optional::empty; } }).when(stickyLockService).lock(any()); return stickyLockService; }
Source:
public void populateOptions(WidgetConfig config, CodedWidget widget) { List<PatientDataDefinition> l = null; String tag = config.getAttributeValue("tag", null); if (tag != null) { l = Context.getService(PatientDataService.class).getDefinitionsByTag(tag); } else { l = Context.getService(PatientDataService.class).getAllDefinitions(false); } for (PersonDataDefinition d : Context.getService(PersonDataService.class).getAllDefinitions(false)) { if (!isJoined(d)) { PatientDataDefinition pd = new PersonToPatientDataDefinition(d); Context.getService(PatientDataService.class).saveDefinition(pd); l.add(pd); } } for (PatientDataDefinition d : l) { widget.addOption(new Option(d.getUuid(), d.getName(), null, d), config); } }

Target:
public void populateOptions(WidgetConfig config, CodedWidget widget) { List<PatientDataDefinition> l = null; String tag = config.getAttributeValue("tag", null); if (tag != null) { l = Context.getService(PatientDataService.class).getDefinitionsByTag(tag); } else { l = Context.getService(PatientDataService.class).getAllDefinitions(false); } for (PatientDataDefinition d : l) { widget.addOption(new Option(d.getUuid(), d.getName(), null, d), config); } for (PersonDataDefinition d : Context.getService(PersonDataService.class).getAllDefinitions(false)) { if (!isJoined(d)) { widget.addOption(new Option(d.getUuid(), d.getName(), null, d), config); } } }
Source:
private Segment getAdapter(final DataSegment segment) throws SegmentLoadingException { final Segment adapter; synchronized (segmentLoader) { try { adapter = segmentLoader.getSegment(segment); } catch (SegmentLoadingException e) { segmentLoader.cleanup(segment); throw e; } } if (adapter == null) { throw new SegmentLoadingException("Null adapter from loadSpec[%s]", segment.getLoadSpec()); } return adapter; }

Target:
private Segment getAdapter(final DataSegment segment) throws SegmentLoadingException { final Segment adapter; try { adapter = segmentLoader.getSegment(segment); } catch (SegmentLoadingException e) { segmentLoader.cleanup(segment); throw e; } if (adapter == null) { throw new SegmentLoadingException("Null adapter from loadSpec[%s]", segment.getLoadSpec()); } return adapter; }
Source:
public static List<String> filterDataOnRetentionHCat(int time, String interval, String dataType, DateTime endDate, List<String> inputData) throws JAXBException { String locationType = ""; String appender = ""; DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy/MM/dd/HH/mm"); List<String> finalData = new ArrayList<String>(); if (dataType.equalsIgnoreCase("monthly")) { appender = "/01/00/01"; } else if (locationType .equalsIgnoreCase("daily")) { appender = "/01"; } else if (locationType .equalsIgnoreCase("hourly")) { appender = "/01"; } else if (locationType.equalsIgnoreCase("yearly")) { appender = "/01/01/00/01"; } formatter.print(endDate); String startLimit = ""; if (interval.equalsIgnoreCase("minutes")) { startLimit = formatter.print(new DateTime(endDate, DateTimeZone.UTC).minusMinutes(time)); } else if (interval.equalsIgnoreCase("hours")) { startLimit = formatter.print(new DateTime(endDate, DateTimeZone.UTC).minusHours(time)); } else if (interval.equalsIgnoreCase("days")) { startLimit = formatter.print(new DateTime(endDate, DateTimeZone.UTC).minusDays(time)); } else if (interval.equalsIgnoreCase("months")) { startLimit = formatter.print(new DateTime(endDate, DateTimeZone.UTC).minusDays(31 * time)); } for (String testDate : inputData) { if (!testDate.equalsIgnoreCase("somethingRandom")) { if ((testDate + appender).compareTo(startLimit) > 0) { finalData.add(testDate); } } else { finalData.add(testDate); } } return finalData; }

Target:
public static List<String> filterDataOnRetentionHCat(int time, String interval, String dataType, DateTime endDate, List<String> inputData) throws JAXBException { String locationType = ""; String appender = ""; DateTime today; DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy/MM/dd/HH/mm"); List<String> finalData = new ArrayList<String>(); if (dataType.equalsIgnoreCase("monthly")) { appender = "/01/00/01"; } else if (locationType .equalsIgnoreCase("daily")) { appender = "/01"; } else if (locationType .equalsIgnoreCase("hourly")) { appender = "/01"; } else if (locationType.equalsIgnoreCase("yearly")) { appender = "/01/01/00/01"; } formatter.print(endDate); String startLimit = ""; today = new DateTime(endDate, DateTimeZone.UTC); if (interval.equalsIgnoreCase("minutes")) { startLimit = formatter.print(today.minusMinutes(time)); } else if (interval.equalsIgnoreCase("hours")) { startLimit = formatter.print(today.minusHours(time)); } else if (interval.equalsIgnoreCase("days")) { startLimit = formatter.print(today.minusDays(time)); } else if (interval.equalsIgnoreCase("months")) { startLimit = formatter.print(today.minusDays(31 * time)); } for (String testDate : inputData) { if (!testDate.equalsIgnoreCase("somethingRandom")) { if ((testDate + appender).compareTo(startLimit) > 0) { finalData.add(testDate); } } else { finalData.add(testDate); } } return finalData; }
Source:
@Override public <T> T service(String name) { if (!enterBusy()) return null; try { ctx.security().authorize(name, SecurityPermission.SERVICE_INVOKE, null); Collection<ServiceContextImpl> ctxs = serviceContexts(name); if (F.isEmpty(ctxs)) return null; synchronized (ctxs) { for (ServiceContextImpl ctx : ctxs) { Service srvc = ctx.service(); if (srvc != null) return (T)srvc; } return null; } } finally { leaveBusy(); } }

Target:
@Override public <T> T service(String name) { if (!enterBusy()) return null; try { ctx.security().authorize(name, SecurityPermission.SERVICE_INVOKE, null); Collection<ServiceContextImpl> ctxs = serviceContexts(name); if (ctxs == null) return null; synchronized (ctxs) { if (F.isEmpty(ctxs)) return null; for (ServiceContextImpl ctx : ctxs) { Service srvc = ctx.service(); if (srvc != null) return (T)srvc; } return null; } } finally { leaveBusy(); } }
Source:
public RepositoryFile getFile(String filePath, Integer projectId, String ref) throws GitLabApiException { if (isApiVersion(ApiVersion.V3)) { return (getFileV3(filePath, projectId, ref)); } Form form = new Form(); addFormParam(form, "ref", ref, true); Response response = get(Response.Status.OK, form.asMap(), "projects", projectId, "repository", "files", urlEncodeForPath(filePath)); return (response.readEntity(RepositoryFile.class)); }

Target:
public RepositoryFile getFile(String filePath, Integer projectId, String ref) throws GitLabApiException { if (isApiVersion(ApiVersion.V3)) { return (getFileV3(filePath, projectId, ref)); } Form form = new Form(); addFormParam(form, "ref", ref, true); Response response = get(Response.Status.OK, form.asMap(), "projects", projectId, "repository", "files", urlEncode(filePath)); return (response.readEntity(RepositoryFile.class)); }
Source:
public void testEndToEnd() throws IOException { final File tempFile = File.createTempFile("IntervalListWriterTest.", ".interval_list"); tempFile.deleteOnExit(); final IntervalList expectedList = new IntervalList(this.dict); expectedList.add(new Interval("chr1", 50, 150)); expectedList.add(new Interval("chr1", 150, 250)); expectedList.add(new Interval("chr2", 50, 150)); expectedList.add(new Interval("chr3", 50, 150)); expectedList.add(new Interval("chr1", 50, 150, true, "number-5")); expectedList.add(new Interval("chr1", 150, 250, false, "number-6")); final IntervalListWriter writer = new IntervalListWriter(tempFile, new SAMFileHeader(this.dict)); for (final Interval interval : expectedList.getIntervals()) { writer.write(interval); } writer.close(); final IntervalList actualList = IntervalList.fromFile(tempFile); Assert.assertEquals( actualList.getIntervals(), expectedList.getIntervals() ); }

Target:
public void testEndToEnd() throws IOException { final File tempFile = File.createTempFile("IntervalListWriterTest.", ".interval_list"); tempFile.deleteOnExit(); final IntervalList expectedList = new IntervalList(this.dict); expectedList.add(new Interval("chr1", 50, 150)); expectedList.add(new Interval("chr1", 150, 250)); expectedList.add(new Interval("chr2", 50, 150)); expectedList.add(new Interval("chr3", 50, 150)); expectedList.add(new Interval("chr1", 50, 150, true, "number-5")); expectedList.add(new Interval("chr1", 150, 250, false, "number-6")); final IntervalListWriter writer = new IntervalListWriter(tempFile.toPath(), new SAMFileHeader(this.dict)); for (final Interval interval : expectedList.getIntervals()) { writer.write(interval); } writer.close(); final IntervalList actualList = IntervalList.fromFile(tempFile); final SAMSequenceDictionary actualDict = actualList.getHeader().getSequenceDictionary(); final SAMSequenceDictionary expectedDict = expectedList.getHeader().getSequenceDictionary(); Assert.assertTrue(actualDict.isSameDictionary(expectedDict)); Assert.assertEquals( actualList.getIntervals(), expectedList.getIntervals() ); }
Source:
public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == REQUEST_FILE) { if (resultCode == RESULT_OK && intent != null) { Uri uri = intent.getData(); String filePath = UriToFilePath.getPathFromUri(CommCareApplication.instance(), uri); if (filePath != null) { File f = new File(filePath); if (f != null && f.exists()) { mEditText.setText(filePath); } else { Toast.makeText(getActivity(), "File does not exit", Toast.LENGTH_SHORT).show(); } } } else { Toast.makeText(getActivity(), "No file selected...", Toast.LENGTH_SHORT).show(); } } }

Target:
public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == REQUEST_FILE) { if (resultCode == RESULT_OK && intent != null) { Uri uri = intent.getData(); String filePath = UriToFilePath.getPathFromUri(CommCareApplication.instance(), uri); validateFile(filePath); } else { Toast.makeText(getActivity(), Localization.get("file.not.selected"), Toast.LENGTH_LONG).show(); } } }
Source:
public ClientAuthProvider newProvider(ClientConnectionPeer connection, AuthCallbacks.GenericCallback<Void> completeCb) { return new ClientAuthProvider() { @Override public void process(AuthToken m, AuthCallbacks.GenericCallback<AuthToken> cb) { } @Override public void close() { closeCountersOnConnections.incrementAndGet(); } public void init(AuthCallbacks.GenericCallback<AuthToken> cb) { initCountersOnConnections.incrementAndGet(); completeCb.operationComplete(BKException.Code.OK, null); } }; }

Target:
public ClientAuthProvider newProvider(ClientConnectionPeer connection, AuthCallbacks.GenericCallback<Void> completeCb) { return new ClientAuthProvider() { @Override public void process(AuthToken m, AuthCallbacks.GenericCallback<AuthToken> cb) { } @Override public void close() { closeCountersOnConnections.incrementAndGet(); } @Override public void init(AuthCallbacks.GenericCallback<AuthToken> cb) { initCountersOnConnections.incrementAndGet(); completeCb.operationComplete(BKException.Code.OK, null); } }; }
Source:
public String getBlobUrl() { if (!this.isSnapshot()) { return azureBlobStorage.getUrl(); } else { return String.format("%s?snapshot=%s", azureBlobStorage.getUrl(), snapshot); } }

Target:
public String getBlobUrl() { if (!this.isSnapshot()) { return azureBlobStorage.getUrl(); } else { if (azureBlobStorage.getUrl().contains("?")) { return String.format("%s&snapshot=%s", azureBlobStorage.getUrl(), snapshot); } else { return String.format("%s?snapshot=%s", azureBlobStorage.getUrl(), snapshot); } } }
Source:
private void applyNextRunConfiguration() { Snapshot runSnap = snapshotDao.get(getVmId(), SnapshotType.NEXT_RUN); if (runSnap != null) { log.debug("Attempt to apply NEXT_RUN snapshot for VM '{}'", getVmId()); EngineLock updateVmLock = createUpdateVmLock(); if (lockManager.acquireLock(updateVmLock).getFirst()) { try { snapshotDao.remove(runSnap.getId()); Date originalCreationDate = getVm().getVmCreationDate(); snapshotsManager.updateVmFromConfiguration(getVm(), runSnap.getVmConfiguration()); getVm().setVmCreationDate(originalCreationDate); VdcReturnValueBase result = runInternalAction(VdcActionType.UpdateVm, createUpdateVmParameters(), ExecutionHandler.createInternalJobContext(updateVmLock)); if (result.getActionReturnValue() != null && result.getActionReturnValue() .equals(VdcActionType.UpdateVmVersion)) { templateVersionChanged = true; } } finally { lockManager.releaseLock(updateVmLock); } } else { log.warn("Could not acquire lock for UpdateVmCommand to apply Next Run Config of VM '{}'", getVmId()); } } }

Target:
private void applyNextRunConfiguration() { Snapshot runSnap = snapshotDao.get(getVmId(), SnapshotType.NEXT_RUN); if (runSnap != null) { log.debug("Attempt to apply NEXT_RUN snapshot for VM '{}'", getVmId()); EngineLock updateVmLock = createUpdateVmLock(); if (lockManager.acquireLock(updateVmLock).getFirst()) { snapshotDao.remove(runSnap.getId()); Date originalCreationDate = getVm().getVmCreationDate(); snapshotsManager.updateVmFromConfiguration(getVm(), runSnap.getVmConfiguration()); getVm().setVmCreationDate(originalCreationDate); VdcReturnValueBase result = runInternalAction(VdcActionType.UpdateVm, createUpdateVmParameters(), ExecutionHandler.createInternalJobContext(updateVmLock)); if (result.getActionReturnValue() != null && result.getActionReturnValue() .equals(VdcActionType.UpdateVmVersion)) { templateVersionChanged = true; } } else { log.warn("Could not acquire lock for UpdateVmCommand to apply Next Run Config of VM '{}'", getVmId()); } } }
Source:
void coordinates(CoordinateSequence coordinates, char cs, char ts, StringBuffer sb) { sb.setLength(0); int n = coordinates.size(); int dim = CoordinateSequences.coordinateDimension(coordinates); for (int i = 0; i < n; i++) { coordFormatter.format(coordinates.getX(i), sb).append(cs); coordFormatter.format(coordinates.getY(i), sb); if (dim > 2) { int totalDimensions = encodeCoordinatesMeasures ? dim : dim - coordinates.getMeasures(); for (int j = 2; j < totalDimensions; j++) { sb.append(cs); coordFormatter.format(coordinates.getOrdinate(i, j), sb); } } sb.append(ts); } sb.setLength(sb.length() - 1); }

Target:
void coordinates(CoordinateSequence coordinates, char cs, char ts, StringBuffer sb) { sb.setLength(0); int n = coordinates.size(); int dim = CoordinateSequences.coordinateDimension(coordinates); for (int i = 0; i < n; i++) { coordFormatter.format(coordinates.getX(i), sb).append(cs); coordFormatter.format(coordinates.getY(i), sb); if (dim > 2) { int totalDimensions = encodeMeasures ? dim : dim - coordinates.getMeasures(); for (int j = 2; j < totalDimensions; j++) { sb.append(cs); coordFormatter.format(coordinates.getOrdinate(i, j), sb); } } sb.append(ts); } sb.setLength(sb.length() - 1); }
Source:
public static RequiredShuffle hash(int[] keys) { if (keys.length == 0) { return new RequiredShuffle(ShuffleType.ANY, keys); } else { return new RequiredShuffle(ShuffleType.HASH, keys); } }

Target:
public static RequiredShuffle hash(int[] keys) { Preconditions.checkArgument(keys.length > 0, "Hash keys must no be empty."); return new RequiredShuffle(ShuffleType.HASH, keys); }
Source:
private static String getRulesForCommitMessageFormatting() { return "Proper commit message should adhere to the following rules:\n" + "\t1) Must match one of the following patterns:\n" + "\t\t" + ISSUE_COMMIT_MESSAGE_REGEX_PATTERN + "\n" + "\t\t" + PR_COMMIT_MESSAGE_REGEX_PATTERN + "\n" + "\t\t" + OTHER_COMMIT_MESSAGE_REGEXPATTERN + "\n" + "\t2) It contains only one line"; }

Target:
private static String getRulesForCommitMessageFormatting() { return "Proper commit message should adhere to the following rules:\n" + " 1) Must match one of the following patterns:\n" + " " + ISSUE_COMMIT_MESSAGE_REGEX_PATTERN + "\n" + " " + PR_COMMIT_MESSAGE_REGEX_PATTERN + "\n" + " " + OTHER_COMMIT_MESSAGE_REGEXPATTERN + "\n" + " 2) It contains only one line"; }
Source:
private static Field getFieldByReflection(Class cls, String fieldName) { Field field = null; try { field = cls.getDeclaredField(fieldName); field.setAccessible(true); } catch (Exception e) { log.error("Unable to read [%s] field from [%s]", fieldName, cls.getName()); } return field; }

Target:
private static Field getFieldByReflection(Class cls, String fieldName) { Field field = null; try { field = cls.getDeclaredField(fieldName); field.setAccessible(true); } catch (Exception e) { log.warn("Unable to read [%s] field from [%s]", fieldName, cls.getName()); } return field; }
Source:
private FaultResponseDto faultResponseForException(final Exception exception, final List<FaultResponseParameterDto> parameters, final String defaultMessage) { if (exception instanceof FunctionalException || exception instanceof TechnicalException) { return this.faultResponseForFunctionalOrTechnicalException((OsgpException) exception, parameters); } return new FaultResponseDto(null, defaultMessage, ComponentType.DOMAIN_SMART_METERING.name(), exception.getClass().getName(), exception.getMessage(), new FaultResponseParametersDto(parameters)); }

Target:
protected FaultResponseDto faultResponseForException(final Exception exception, final List<FaultResponseParameterDto> parameters, final String defaultMessage) { final FaultResponseParametersDto faultResponseParameters = this.faultResponseParametersForList(parameters); if (exception instanceof FunctionalException || exception instanceof TechnicalException) { return this.faultResponseForFunctionalOrTechnicalException((OsgpException) exception, faultResponseParameters, defaultMessage); } return new FaultResponseDto(null, defaultMessage, ComponentType.DOMAIN_SMART_METERING.name(), exception.getClass().getName(), exception.getMessage(), faultResponseParameters); }
Source:
private void createRefreshJob() { refreshJob = new WorkbenchJob("filter") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (filterText.isDisposed()) { return Status.CANCEL_STATUS; } String text = filterText.getText(); text = text.trim(); if (!previousFilterText.equals(text)) { previousFilterText = text; filterPattern = createPattern(previousFilterText); if (clearFilterTextControl != null) { clearFilterTextControl.setVisible(previousFilterText.trim() != null && !previousFilterText.isEmpty()); } createBodyContents(); } return Status.OK_STATUS; } }; refreshJob.setSystem(true); }

Target:
private void createRefreshJob() { refreshJob = new WorkbenchJob("filter") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (filterText.isDisposed()) { return Status.CANCEL_STATUS; } String text = filterText.getText(); text = text.trim(); if (!previousFilterText.equals(text)) { previousFilterText = text; filterPattern = createPattern(previousFilterText); if (clearFilterTextControl != null) { clearFilterTextControl.setVisible(previousFilterText != null && !previousFilterText.isEmpty()); } createBodyContents(); } return Status.OK_STATUS; } }; refreshJob.setSystem(true); }
Source:
private static LinkAttributes parseLinkNode(final Node node) { final Element elem = (Element)node; NamedNodeMap attributes = elem.getAttributes(); URI href = null; Map<String, String> params = new HashMap<>(attributes.getLength()-1); if (attributes != null) { for (int i = 0; i < attributes.getLength(); i++) { final Node attribute = attributes.item(i); final String name = attribute.getNodeName(); final String value = attribute.getNodeValue(); if ("href".equalsIgnoreCase(name)) { if (value != null) { try { href = new URI(value); } catch (URISyntaxException e) { LOGGER.warn("Invalid URI in link href attribute: " + value); } } else { LOGGER.warn("Unexpected null value for Link href attribute"); } } else { if (name != null && value != null) { params.put(name, value); } } } LinkAttributes linkAttributes = new LinkAttributes(href); linkAttributes.setParams(params); return linkAttributes; } else { return null; } }

Target:
private static LinkAttributes parseLinkNode(final Node node) { final Element elem = (Element)node; NamedNodeMap attributes = elem.getAttributes(); URI href = null; Map<String, String> params = new HashMap<>(attributes.getLength()); if (attributes != null) { for (int i = 0; i < attributes.getLength(); i++) { final Node attribute = attributes.item(i); final String name = attribute.getNodeName(); final String value = attribute.getNodeValue(); if ("href".equalsIgnoreCase(name)) { if (value != null) { try { href = new URI(value); } catch (URISyntaxException e) { LOGGER.warn("Invalid URI in link href attribute: " + value); } } else { LOGGER.warn("Unexpected null value for Link href attribute"); } } else { if (name != null && value != null) { params.put(name, value); } } } LinkAttributes linkAttributes = new LinkAttributes(href); linkAttributes.setParams(params); return linkAttributes; } else { return null; } }
Source:
private void setDeletable() { getListView().setOnItemLongClickListener( new LongClickDeleteListener(this, new LongClickDeleteListener.OnDeleteListener() { @Override public void onDelete(int position) { if (getListView().getItemAtPosition(position) == null) return; longPressedItemPosition = itemPositionForListViewPosition(position); ExpenseClaimDetailController.DetailItem.ItemType type = controller.getItemType(longPressedItemPosition); startDeleteAlertDialog(type); } }, new LongClickDeleteListener.SetStatus() { @Override public boolean set(int position) { longPressedItemPosition = itemPositionForListViewPosition(position); ExpenseClaimDetailController.DetailItem.ItemType type = controller.getItemType(longPressedItemPosition); if (editable ||type == ExpenseClaimDetailController.DetailItem.ItemType.TAG) { return true; } return false; } } )); }

Target:
private void setDeletable() { getListView().setOnItemLongClickListener(new LongClickDeleteListener(this, new LongClickDeleteListener.OnDeleteListener() { @Override public void onDelete(int position) { if (getListView().getItemAtPosition(position) == null) return; ExpenseClaimDetailController.DetailItem.ItemType type = getTypeAt(position); startDeleteAlertDialog(type); } @Override public boolean shouldDelete(int position) { ExpenseClaimDetailController.DetailItem.ItemType type = getTypeAt(position); if (editable ||type == ExpenseClaimDetailController.DetailItem.ItemType.TAG) { return true; } return false; } })); }
Source:
protected static Optional<StandardUsernamePasswordCredentials> findCredentials( Item item, String credentialsId, String uri) { if (StringUtils.isEmpty(credentialsId)) { return null; } return Optional.ofNullable( CredentialsMatchers.firstOrNull( CredentialsProvider.lookupCredentials( StandardUsernamePasswordCredentials.class, item, item instanceof Queue.Task ? Tasks.getAuthenticationOf( (Queue.Task) item) : ACL.SYSTEM, URIRequirementBuilder.fromUri(uri).build()), CredentialsMatchers.withId(credentialsId) )); }

Target:
protected static Optional<StandardUsernamePasswordCredentials> findCredentials( Item item, String credentialsId, String uri) { return Optional.ofNullable( CredentialsMatchers.firstOrNull( CredentialsProvider.lookupCredentials( StandardUsernamePasswordCredentials.class, item, item instanceof Queue.Task ? Tasks.getAuthenticationOf( (Queue.Task) item) : ACL.SYSTEM, URIRequirementBuilder.fromUri(uri).build()), CredentialsMatchers.withId(credentialsId) )); }
Source:
protected void readTextValueFromXml(EwsServiceXmlReader reader) throws XMLStreamException, ServiceXmlDeserializationException { boolean keepWhiteSpace = this.getBodyType() == BodyType.Text; this.text = reader.readValue(keepWhiteSpace); }

Target:
protected void readTextValueFromXml(EwsServiceXmlReader reader) throws XMLStreamException, ServiceXmlDeserializationException { if (log.isDebugEnabled()) { log.debug("Reading text value from XML. BodyType = " + this.getBodyType() + ", keepWhiteSpace = " + ((this.getBodyType() == BodyType.Text) ? "true." : "false.")); } this.text = reader.readValue(this.getBodyType() == BodyType.Text); if (log.isDebugEnabled()) { log.debug("Text value read:\n---\n" + this.text + "\n---"); } }
Source:
public CompletionStage<MetricsQueryResponse> queryMetrics(final MetricsQuery metricsQuery) { final Metrics metrics = _metricsFactory.create(); final Timer timer = metrics.createTimer("kairosService/queryMetrics/request"); final ImmutableSet<String> requestedTags = metricsQuery.getMetrics() .stream() .flatMap(m -> m.getTags().keySet().stream()) .collect(ImmutableSet.toImmutableSet()); return getMetricNames(metrics) .thenApply(names -> useAvailableRollups(names, metricsQuery, _metricsQueryConfig, metrics)) .whenComplete((query, throwable) -> { if (throwable != null) { return; } _rewrittenQueryConsumer.accept(query); }) .thenCompose(_kairosDbClient::queryMetrics) .thenApply(response -> filterExcludedTags(response, requestedTags)) .whenComplete((result, error) -> { timer.stop(); metrics.incrementCounter("kairosService/queryMetrics/success", error == null ? 1 : 0); metrics.close(); }); }

Target:
public CompletionStage<MetricsQueryResponse> queryMetrics(final MetricsQuery metricsQuery) { final Metrics metrics = _metricsFactory.create(); final Timer timer = metrics.createTimer("kairosService/queryMetrics/request"); final ImmutableSet<String> requestedTags = metricsQuery.getMetrics() .stream() .flatMap(m -> m.getTags().keySet().stream()) .collect(ImmutableSet.toImmutableSet()); return getMetricNames(metrics) .thenApply(names -> useAvailableRollups(names, metricsQuery, _metricsQueryConfig, metrics)) .whenComplete((query, throwable) -> { if (throwable == null) { _rewrittenQueryConsumer.accept(query); } }) .thenCompose(_kairosDbClient::queryMetrics) .thenApply(response -> filterExcludedTags(response, requestedTags)) .whenComplete((result, error) -> { timer.stop(); metrics.incrementCounter("kairosService/queryMetrics/success", error == null ? 1 : 0); metrics.close(); }); }
Source:
protected Session doCreateSession( SessionContext context ) { Session session = newSessionInstance( context ); if ( log.isTraceEnabled() ) { log.trace( "Creating session for host {}", session.getHost() ); } if( WebUtils.isHttp( context ) ) { HttpServletRequest request = WebUtils.getHttpRequest( context ); if ( isStatelessClient( request ) ) { ( (SimpleSession) session ).setId( fakeSessionIdGenerator.generateId( session ) ); log.debug( "Stateless client sesion is not persisted.", session.getId() ); } else { create( session ); } if ( log.isTraceEnabled() ) { log.trace( "Session was created for User-Agent {}", session.getId(), getUserAgent( request ) ); } } return session; }

Target:
protected Session doCreateSession( SessionContext context ) { Session session = newSessionInstance( context ); if ( log.isTraceEnabled() ) { log.trace( "Creating session for host {}", session.getHost() ); } if( WebUtils.isHttp( context ) ) { HttpServletRequest request = WebUtils.getHttpRequest( context ); if ( isStatelessClient( request ) ) { ( (SimpleSession) session ).setId( fakeSessionIdGenerator.generateId( session ) ); log.debug( "Stateless client session is not persisted.", session.getId() ); } else { create( session ); } if ( log.isTraceEnabled() ) { log.trace( "Session was created for User-Agent {}", session.getId(), getUserAgent( request ) ); } } return session; }
Source:
public String getMessage() { return getCause().getMessage() + "\n Please verify the property: " + prop.getName() + " is correct."; }

Target:
public String getMessage() { return getCause().getMessage() + " needed by property " + prop.getName(); }
Source:
private void updateLastBuild(final RefreshRequest request, IBuildPlan plan, IBuild build, Date refreshDate) { if (plan.getLastBuild() != null) { request.getModel() .getBuilds() .stream() .filter(b -> b.getId().equals(plan.getLastBuild().getId())) .findFirst() .ifPresent(remove -> request.getModel().getBuilds().remove(remove)); } plan.setLastBuild(build); build.setPlan(plan); if (plan.getServer() == null && plan.getParent() != null) { plan.setServer(plan.getParent().getServer()); } build.setServer(plan.getServer()); build.setRefreshDate(refreshDate); request.getModel().getBuilds().add(build); }

Target:
private void updateLastBuild(final RefreshRequest request, IBuildPlan plan, IBuild build, Date refreshDate) { if (plan.getLastBuild() != null) { request.getModel() .getBuilds() .stream() .filter(b -> b.getId().equals(plan.getLastBuild().getId())) .findFirst() .ifPresent(remove -> request.getModel().getBuilds().remove(remove)); } plan.setLastBuild(build); build.setPlan(plan); build.setServer(plan.getServer()); build.setRefreshDate(refreshDate); request.getModel().getBuilds().add(build); plan.getChildren().forEach(child -> { updateLastBuild(request, child, child.getLastBuild(), refreshDate); }); }
Source:
PRED_commit_author_3(Term a1, Term a2, Term a3, Operation n) { super(a1, a2, a3, n); }

Target:
public PRED_commit_author_3(Term a1, Term a2, Term a3, Operation n) { super(a1, a2, a3, n); }
Source:
public final void authenticateURNWithEmptyUser() { final AuthKeys authKeys = new AuthKeys(); final String user = ""; final String password = ""; MatcherAssert.assertThat( authKeys.authenticate(user, password) .name(), Matchers.equalTo(Identity.ANONYMOUS.name()) ); }

Target:
public final void authenticateURNWithEmptyUser() throws Exception { final AuthKeys authKeys = new AuthKeys(); MatcherAssert.assertThat( authKeys.authenticate("", "").name(), Matchers.equalTo(Identity.ANONYMOUS.name()) ); }
Source:
public String saveToFile(String content, String label) { FileOutputStream fop = null; File file; String fileName = null; try { file = new File(getFilePath(label)); fop = new FileOutputStream(file); if (!file.exists()) { file.createNewFile(); } fileName = file.getName(); byte[] contentInBytes = content.getBytes(); fop.write(contentInBytes); fop.flush(); fop.close(); } catch (IOException e) { System.out.println("=== Error create file : " + e.getMessage()); e.printStackTrace(); } finally { try { if (fop != null) { fop.close(); } } catch (IOException e) { e.printStackTrace(); } return fileName; } }

Target:
public String saveToFile(String content, String label) { FileOutputStream fop = null; File file; String fileName = null; try { file = new File(getFilePath(label)); fop = new FileOutputStream(file); if (!file.exists()) { file.createNewFile(); } fileName = file.getName(); byte[] contentInBytes = content.getBytes(); fop.write(contentInBytes); fop.flush(); fop.close(); } catch (IOException e) { logger.error("Error creating file : ", e); } finally { try { if (fop != null) { fop.close(); } } catch (IOException e) { logger.error("Error closing output stream : ", e); } return fileName; } }
Source:
public void close() { if (isClosed()) { return; } LOG.info("Closing {}.", FEDERATED_ZK_CLIENT); synchronized (_zkRealmToZkClientMap) { _zkRealmToZkClientMap.values().forEach(ZkClient::close); _zkRealmToZkClientMap.clear(); _isClosed = true; } }

Target:
public void close() { if (isClosed()) { return; } _isClosed = true; synchronized (_zkRealmToZkClientMap) { Iterator<Map.Entry<String, ZkClient>> iterator = _zkRealmToZkClientMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<String, ZkClient> entry = iterator.next(); String zkRealm = entry.getKey(); ZkClient zkClient = entry.getValue(); try { zkClient.close(); } catch (Exception e) { LOG.error("Exception thrown when closing ZkClient for ZkRealm: {}!", zkRealm, e); } iterator.remove(); } } LOG.info("{} is successfully closed.", FEDERATED_ZK_CLIENT); }
Source:
public AggregateServerConnectionDialogForm() { $$$setupUI$$$(); setContentPane(dialog); setModal(true); pack(); setLocationRelativeTo(null); setTitle("Aggregate Server Configuration"); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapterBuilder().onClosing(e -> dispose()).build()); dialog.registerKeyboardAction(e -> dispose(), getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); cancelButton.addActionListener(e -> dispose()); connectButton.addActionListener(__ -> { connectButton.setEnabled(false); cancelButton.setEnabled(false); Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR); triggerConnect(); }); }

Target:
public AggregateServerConnectionDialogForm() { $$$setupUI$$$(); setContentPane(dialog); setPreferredSize(new Dimension(500, 175)); setModal(true); pack(); setLocationRelativeTo(null); setTitle("Aggregate Server Configuration"); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapterBuilder().onClosing(e -> dispose()).build()); dialog.registerKeyboardAction(e -> dispose(), getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); cancelButton.addActionListener(e -> dispose()); connectButton.addActionListener(__ -> { connectButton.setEnabled(false); cancelButton.setEnabled(false); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); triggerConnect(); }); getRootPane().setDefaultButton(connectButton); }
Source:
public SunPhaseJob(String thingUID, SunPhaseName sunPhaseName) { checkNotNull(thingUID, "Thing UID cannot be null"); checkNotNull(sunPhaseName, "Sun Phase Name cannot be null"); this.thingUID = thingUID; this.sunPhaseName = sunPhaseName; }

Target:
public SunPhaseJob(String thingUID, SunPhaseName sunPhaseName) { checkArgument(thingUID != null, "Thing UID cannot be null"); checkArgument(sunPhaseName != null, "Sun Phase Name cannot be null"); this.thingUID = thingUID; this.sunPhaseName = sunPhaseName; }
Source:
public static Properties defaultProperties() { Properties properties = new Properties(); properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS); properties.setProperty(SERVICE_TYPE, "networks"); properties.setProperty(PROPERTY_REGIONS, "ORD,DFW,IAD,SYD,HKG"); properties.setProperty(PROPERTY_REGIONS, "IAD"); properties.setProperty(PROPERTY_REGION + ".ORD." + ISO3166_CODES, "US-IL"); properties.setProperty(PROPERTY_REGION + ".DFW." + ISO3166_CODES, "US-TX"); properties.setProperty(PROPERTY_REGION + ".IAD." + ISO3166_CODES, "US-VA"); properties.setProperty(PROPERTY_REGION + ".SYD." + ISO3166_CODES, "AU-NSW"); properties.setProperty(PROPERTY_REGION + ".HKG." + ISO3166_CODES, "HK"); return properties; }

Target:
public static Properties defaultProperties() { Properties properties = new Properties(); properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS); properties.setProperty(SERVICE_TYPE, "networks"); properties.setProperty(PROPERTY_REGIONS, "ORD,DFW,IAD,SYD,HKG"); properties.setProperty(PROPERTY_REGION + ".ORD." + ISO3166_CODES, "US-IL"); properties.setProperty(PROPERTY_REGION + ".DFW." + ISO3166_CODES, "US-TX"); properties.setProperty(PROPERTY_REGION + ".IAD." + ISO3166_CODES, "US-VA"); properties.setProperty(PROPERTY_REGION + ".SYD." + ISO3166_CODES, "AU-NSW"); properties.setProperty(PROPERTY_REGION + ".HKG." + ISO3166_CODES, "HK"); return properties; }
Source:
public WriteBehindDecoratorLoaderWriterProvider create(ServiceConfiguration<WriteBehindDecoratorLoaderWriterProvider> serviceConfiguration, ServiceLocator serviceLocator) { return new WriteBehindDecoratorLoaderWriterProvider() { @Override public void stop() { } @Override public void start(ServiceConfiguration<?> config, ServiceProvider serviceProvider) { if (config != null) { throw new IllegalArgumentException("WriteBehind configuration must not be provided at CacheManager level"); } } @Override public <K, V> WriteBehindDecoratorLoaderWriter<K, V> createWriteBehindDecoratorLoaderWriter(CacheLoaderWriter<K, V> cacheLoaderWriter, WriteBehindConfiguration configuration) { if (cacheLoaderWriter == null) { throw new RuntimeException("WriteBehind requires non null CacheLoaderWriter."); } loaderWriter = new WriteBehindDecoratorLoaderWriter<K, V>(cacheLoaderWriter, configuration); return (WriteBehindDecoratorLoaderWriter<K, V>)loaderWriter; } @Override public void releaseWriteBehindDecoratorCacheLoaderWriter(CacheLoaderWriter<?, ?> cacheLoaderWriter) { if(loaderWriter != null) loaderWriter.getWriteBehindQueue().stop(); } }; }

Target:
public WriteBehindDecoratorLoaderWriterProvider create(ServiceConfiguration<WriteBehindDecoratorLoaderWriterProvider> serviceConfiguration, ServiceLocator serviceLocator) { return new WriteBehindDecoratorLoaderWriterProvider() { @Override public void stop() { } @Override public void start(ServiceConfiguration<?> config, ServiceProvider serviceProvider) { if (config != null) { throw new IllegalArgumentException("WriteBehind configuration must not be provided at CacheManager level"); } } @Override public <K, V> WriteBehindDecoratorLoaderWriter<K, V> createWriteBehindDecoratorLoaderWriter(CacheLoaderWriter<K, V> cacheLoaderWriter, WriteBehindConfiguration configuration) { if (cacheLoaderWriter == null) { throw new NullPointerException("WriteBehind requires non null CacheLoaderWriter."); } loaderWriter = new WriteBehindDecoratorLoaderWriter<K, V>(cacheLoaderWriter, configuration); return (WriteBehindDecoratorLoaderWriter<K, V>)loaderWriter; } @Override public void releaseWriteBehindDecoratorCacheLoaderWriter(CacheLoaderWriter<?, ?> cacheLoaderWriter) { if(loaderWriter != null) loaderWriter.getWriteBehindQueue().stop(); } }; }
Source:
protected void configure() { bind(ConnectorConfiguration.class).toInstance(configuration); bind(Environment.class).toInstance(environment); bind(CardExecutorService.class).in(Singleton.class); bind(NotifyClientProvider.class).in(Singleton.class); bind(PaymentProviders.class).in(Singleton.class); bind(EntityBuilder.class); bind(HashUtil.class); bind(RequestValidator.class).in(Singleton.class); bind(GatewayAccountRequestValidator.class).in(Singleton.class); install(jpaModule(configuration)); }

Target:
protected void configure() { bind(ConnectorConfiguration.class).toInstance(configuration); bind(Environment.class).toInstance(environment); bind(CardExecutorService.class).in(Singleton.class); bind(PaymentProviders.class).in(Singleton.class); bind(EntityBuilder.class); bind(HashUtil.class); bind(RequestValidator.class); bind(GatewayAccountRequestValidator.class).in(Singleton.class); install(jpaModule(configuration)); install(new FactoryModuleBuilder().build(NotifyClientFactoryProvider.class)); }