auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void main(String[] args) { try { OptionParser parser = new OptionParser(); ArgumentAcceptingOptionSpec<String> accountJsonFilePathOpt = parser.accepts("jsonPath", "The path to the account json file to write to") .withRequiredArg() .describedAs("account_json_file_path") .ofType(String.class); ArgumentAcceptingOptionSpec<Short> firstAccountIdOpt = parser.accepts("firstAccountId", "The account ID to assign to the first account generated. " + "The account ID will be incremented by one for each additional account") .withRequiredArg() .describedAs("first_account_id") .ofType(Short.class); NonOptionArgumentSpec<String> serviceIdsArg = parser.nonOptions("The service IDs to create accounts for").ofType(String.class); parser.accepts("help", "print this help message."); parser.accepts("h", "print this help message."); OptionSet options = parser.parse(args); if (options.has("help") || options.has("h")) { parser.printHelpOn(System.out); System.exit(0); } ToolUtils.ensureOrExit(Arrays.asList(accountJsonFilePathOpt, firstAccountIdOpt, serviceIdsArg), options, parser); generateAccounts((List<String>) options.nonOptionArguments(), options.valueOf(accountJsonFilePathOpt), options.valueOf(firstAccountIdOpt)); } catch (Exception e) { e.printStackTrace(); } }

Target:
public static void main(String[] args) throws Exception { OptionParser parser = new OptionParser(); ArgumentAcceptingOptionSpec<String> accountJsonFilePathOpt = parser.accepts("jsonPath", "The path to the account json file to write to") .withRequiredArg() .describedAs("account_json_file_path") .ofType(String.class); ArgumentAcceptingOptionSpec<Short> firstAccountIdOpt = parser.accepts("firstAccountId", "The account ID to assign to the first account generated. " + "The account ID will be incremented by one for each additional account") .withRequiredArg() .describedAs("first_account_id") .ofType(Short.class); NonOptionArgumentSpec<String> serviceIdsArg = parser.nonOptions("The service IDs to create accounts for").ofType(String.class); parser.accepts("help", "print this help message."); parser.accepts("h", "print this help message."); OptionSet options = parser.parse(args); if (options.has("help") || options.has("h")) { parser.printHelpOn(System.out); System.exit(0); } ToolUtils.ensureOrExit(Arrays.asList(accountJsonFilePathOpt, firstAccountIdOpt, serviceIdsArg), options, parser); generateAccounts((List<String>) options.nonOptionArguments(), options.valueOf(accountJsonFilePathOpt), options.valueOf(firstAccountIdOpt)); }
Source:
public List<Identifier> getIdentifiers() { if (isValidPatientId()) { return loadTestDataService.getAllIdentiersBy(getPatientId()); } else { return new ArrayList<>(); } }

Target:
public List<Identifier> getIdentifiers() { return loadTestDataService.getAllIdentiersBy(getPatientId()); }
Source:
public synchronized void addAdditionalResult() throws IOException { if (mResult == null) { return; } Map<String, MethodStatistics> nameStatistics = processMethodProfiles(mResult.getRecordStartMs(), mResult.getEndMs(), javaAgentInput -> { if (javaAgentInput.getType().contains("RPC")) { final int classNameDivider = javaAgentInput.getMethod().lastIndexOf("."); javaAgentInput.setMethod( javaAgentInput.getMethod().substring(classNameDivider + 1)); } return javaAgentInput.getType() + ":" + javaAgentInput.getMethod(); }); for (Map.Entry<String, MethodStatistics> entry : nameStatistics.entrySet()) { final MasterBenchTaskResultStatistics stats = new MasterBenchTaskResultStatistics(); stats.encodeResponseTimeNsRaw(entry.getValue().getTimeNs()); stats.mNumSuccess = entry.getValue().getNumSuccess(); stats.mMaxResponseTimeNs = entry.getValue().getMaxTimeNs(); mResult.putStatisticsForMethod(entry.getKey(), stats); } }

Target:
public synchronized void addAdditionalResult() throws IOException { if (mResult == null) { return; } Map<String, MethodStatistics> nameStatistics = processMethodProfiles(mResult.getRecordStartMs(), mResult.getEndMs(), profileInput -> { String method = profileInput.getMethod(); if (profileInput.getType().contains("RPC")) { final int classNameDivider = profileInput.getMethod().lastIndexOf("."); method = profileInput.getMethod().substring(classNameDivider + 1); } return profileInput.getType() + ":" + method; }); for (Map.Entry<String, MethodStatistics> entry : nameStatistics.entrySet()) { final MasterBenchTaskResultStatistics stats = new MasterBenchTaskResultStatistics(); stats.encodeResponseTimeNsRaw(entry.getValue().getTimeNs()); stats.mNumSuccess = entry.getValue().getNumSuccess(); stats.mMaxResponseTimeNs = entry.getValue().getMaxTimeNs(); mResult.putStatisticsForMethod(entry.getKey(), stats); } }
Source:
protected Object decode( ChannelHandlerContext ctx, Channel channel, ChannelBuffer buf) throws Exception { if (buf.readableBytes() < KEEP_ALIVE_LENGTH) { return null; } if (buf.getUnsignedByte(buf.readerIndex()) == 0xD0) { ChannelBuffer frame = buf.readBytes(KEEP_ALIVE_LENGTH); if (channel != null) { channel.write(frame); } long deviceId = ((Long.reverseBytes((frame.getLong(0)))) >> 32) & 0xFFFFFFFFL; return ChannelBuffers.copiedBuffer("$ID:" + String.valueOf(deviceId), StandardCharsets.US_ASCII); } else { int index = buf.indexOf(buf.readerIndex(), buf.writerIndex(), new StringFinder("\r\n")); if (index != -1) { ChannelBuffer frame = buf.readBytes(index - buf.readerIndex()); buf.skipBytes(2); return frame; } } return null; }

Target:
protected Object decode( ChannelHandlerContext ctx, Channel channel, ChannelBuffer buf) throws Exception { if (buf.readableBytes() < KEEP_ALIVE_LENGTH) { return null; } if (buf.getUnsignedByte(buf.readerIndex()) == 0xD0) { ChannelBuffer frame = buf.readBytes(KEEP_ALIVE_LENGTH); if (channel != null) { channel.write(frame); } return frame; } else { int index = buf.indexOf(buf.readerIndex(), buf.writerIndex(), new StringFinder("\r\n")); if (index != -1) { ChannelBuffer frame = buf.readBytes(index - buf.readerIndex()); buf.skipBytes(2); return frame; } } return null; }
Source:
public void checkPermission(AuthorizationPermission perm) { checkPermission(null, perm, Optional.empty()); }

Target:
public void checkPermission(AuthorizationPermission perm) { checkPermission(null, perm, null); }
Source:
public void testStaticHeader() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(HeaderCheck.class); checkConfig.addAttribute("headerFile", getPath("inputheaderjava.header")); checkConfig.addAttribute("ignoreLines", ""); final String[] expected = { "1: " + getCheckMessage(MSG_MISSING), }; verify(checkConfig, getPath("InputHeader.java"), expected); }

Target:
public void testStaticHeader() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(HeaderCheck.class); checkConfig.addAttribute("headerFile", getPath("InputHeaderjava.header")); checkConfig.addAttribute("ignoreLines", ""); final String[] expected = { "1: " + getCheckMessage(MSG_MISSING), }; verify(checkConfig, getPath("InputHeader.java"), expected); }
Source:
protected void addAllExpectedMsgs() { addExpectedNameMsg(1, 7, Severity.WARNING, Messages.CLASS + Messages.NAME, 2, NAME_LENGTH_LIMIT); addExpectedNameMsg(7, 54, Severity.WARNING, Messages.ENUM_CASE + Messages.NAME, 1, NAME_LENGTH_LIMIT); addExpectedNameMsg(10, 6, Severity.WARNING, Messages.FUNCTION + Messages.NAME, 1, NAME_LENGTH_LIMIT); addExpectedNameMsg(10, 9, Severity.WARNING, Messages.CONSTANT + Messages.NAME, 2, NAME_LENGTH_LIMIT); addExpectedNameMsg(10, 12, Severity.WARNING, Messages.CONSTANT + Messages.NAME, 2, NAME_LENGTH_LIMIT); addExpectedNameMsg(15, 1, Severity.WARNING, Messages.LABEL + Messages.NAME, 2, NAME_LENGTH_LIMIT); addExpectedNameMsg(24, 10, Severity.WARNING, Messages.PROTOCOL + Messages.NAME, 1, NAME_LENGTH_LIMIT); addExpectedNameMsg(27, 8, Severity.WARNING, Messages.STRUCT + Messages.NAME, 1, NAME_LENGTH_LIMIT); addExpectedNameMsg(38, 11, Severity.WARNING, Messages.TYPEALIAS + Messages.NAME, 2, NAME_LENGTH_LIMIT); addExpectedNameMsg(41, 9, Severity.WARNING, Messages.VARIABLE + Messages.NAME, 1, NAME_LENGTH_LIMIT); addExpectedNameMsg(48, 86, Severity.WARNING, Messages.TYPE + Messages.NAME, 2, NAME_LENGTH_LIMIT); addExpectedNameMsg(52, 5, Severity.WARNING, Messages.CONSTANT + Messages.NAME, 1, NAME_LENGTH_LIMIT); addExpectedNameMsg(56, 10, Severity.WARNING, Messages.ENUM_CASE + Messages.NAME, 1, NAME_LENGTH_LIMIT); }

Target:
protected void addAllExpectedMsgs() { addExpectedNameMsg(1, 7, Messages.CLASS + Messages.NAME, 2); addExpectedNameMsg(7, 54, Messages.ENUM_CASE + Messages.NAME, 1); addExpectedNameMsg(10, 6, Messages.FUNCTION + Messages.NAME, 1); addExpectedNameMsg(10, 9, Messages.CONSTANT + Messages.NAME, 2); addExpectedNameMsg(10, 12, Messages.CONSTANT + Messages.NAME, 2); addExpectedNameMsg(15, 1, Messages.LABEL + Messages.NAME, 2); addExpectedNameMsg(24, 10, Messages.PROTOCOL + Messages.NAME, 1); addExpectedNameMsg(27, 8, Messages.STRUCT + Messages.NAME, 1); addExpectedNameMsg(38, 11, Messages.TYPEALIAS + Messages.NAME, 2); addExpectedNameMsg(41, 9, Messages.VARIABLE + Messages.NAME, 1); addExpectedNameMsg(48, 86, Messages.TYPE + Messages.NAME, 2); addExpectedNameMsg(52, 5, Messages.CONSTANT + Messages.NAME, 1); addExpectedNameMsg(56, 10, Messages.ENUM_CASE + Messages.NAME, 1); }
Source:
private void loadLFN(String lfn) { VisualizationServiceAsync vs = VisualizationService.Util.getInstance(); Layout.getInstance().setNoticeMessage( "Downloading file " + lfn.substring(lfn.lastIndexOf('/') + 1) + " from storage element. Please wait …", 0); vs.getVisualizationItemFromLFN( lfn, new AsyncCallback<VisualizationItem>() { @Override public void onFailure(Throwable caught) { Layout.getInstance().setWarningMessage( "Cannot load file: " + caught.getMessage()); } @Override public void onSuccess(VisualizationItem result) { displayFile(result); } }); }

Target:
private void loadLFN(String lfn) { VisualizationServiceAsync vs = VisualizationService.Util.getInstance(); Layout.getInstance().setNoticeMessage( "Downloading file " + lfn.substring(lfn.lastIndexOf('/') + 1) + " from storage element. Please wait, this may take a while …", 0); vs.getVisualizationItemFromLFN( lfn, new AsyncCallback<VisualizationItem>() { @Override public void onFailure(Throwable caught) { Layout.getInstance().setWarningMessage( "Cannot load file: " + caught.getMessage()); } @Override public void onSuccess(VisualizationItem result) { displayFile(result); } }); }
Source:
protected void initialize(Map conf, String localDir) throws Exception { _conf = new HashMap(); _conf.putAll(conf); _state = new LocalState(localDir); _allowedHosts = listIntoSet((List<String>) conf.get(CONF_MESOS_ALLOWED_HOSTS)); _disallowedHosts = listIntoSet((List<String>) conf.get(CONF_MESOS_DISALLOWED_HOSTS)); Boolean preferReservedResources = (Boolean) conf.get(CONF_MESOS_PREFER_RESERVED_RESOURCES); if (preferReservedResources != null) { _preferReservedResources = preferReservedResources; } _container = Optional.fromNullable((String) conf.get(CONF_MESOS_CONTAINER_DOCKER_IMAGE)); _scheduler = new NimbusScheduler(this); _generatedConfPath = Paths.get( Optional.fromNullable((String) conf.get(Config.STORM_LOCAL_DIR)).or("./"), "generated-conf"); if (!_generatedConfPath.toFile().exists() && !_generatedConfPath.toFile().mkdirs()) { throw new RuntimeException("Couldn't create generated-conf dir"); } createLocalServerPort(); setupHttpServer(); _conf.put(Config.NIMBUS_HOST, _configUrl.getHost()); File generatedConf = Paths.get(_generatedConfPath.toString(), "storm.yaml").toFile(); Yaml yaml = new Yaml(); FileWriter writer = new FileWriter(generatedConf); yaml.dump(_conf, writer); }

Target:
protected void initialize(Map conf, String localDir) throws Exception { _conf = new HashMap(); _conf.putAll(conf); _state = new LocalState(localDir); _allowedHosts = listIntoSet((List<String>) conf.get(CONF_MESOS_ALLOWED_HOSTS)); _disallowedHosts = listIntoSet((List<String>) conf.get(CONF_MESOS_DISALLOWED_HOSTS)); Boolean preferReservedResources = (Boolean) conf.get(CONF_MESOS_PREFER_RESERVED_RESOURCES); if (preferReservedResources != null) { _preferReservedResources = preferReservedResources; } _container = Optional.fromNullable((String) conf.get(CONF_MESOS_CONTAINER_DOCKER_IMAGE)); _scheduler = new NimbusScheduler(this); _generatedConfPath = Paths.get( Optional.fromNullable((String) conf.get(Config.STORM_LOCAL_DIR)).or("./"), "generated-conf"); if (!_generatedConfPath.toFile().exists() && !_generatedConfPath.toFile().mkdirs()) { throw new RuntimeException("Couldn't create generated-conf dir, _generatedConfPath=" + _generatedConfPath.toString()); } createLocalServerPort(); setupHttpServer(); _conf.put(Config.NIMBUS_HOST, _configUrl.getHost()); File generatedConf = Paths.get(_generatedConfPath.toString(), "storm.yaml").toFile(); Yaml yaml = new Yaml(); FileWriter writer = new FileWriter(generatedConf); yaml.dump(_conf, writer); }
Source:
public PortletLifecycleState getLifecycleState() { PortletLifecycleState rslt = null; final Date now = new Date(); for (IPortletLifecycleEntry entry : lifecycleEntries) { if (entry.getDate().before(now)) { rslt = entry.getLifecycleState(); } else { break; } } return rslt; }

Target:
public PortletLifecycleState getLifecycleState() { final Date now = new Date(); final IPortletLifecycleEntry currentEntry = lifecycleEntries .stream() .filter(entry -> entry.getDate().before(now)) .reduce( (e1, e2) -> e1.getDate().after(e2.getDate()) ? e1 : e2) .orElse(null); return currentEntry != null ? currentEntry.getLifecycleState() : null; }
Source:
protected boolean validateOptionsGroup() { if (fCreateExperimentCheckbox != null && fCreateExperimentCheckbox.getSelection()) { String name = fExperimentNameText.getText(); if ((fTraceExperimentElement != null) && (name != null)) { TmfExperimentElement element = fTraceExperimentElement.getExperiment(name); if (element != null) { setMessage(null); setErrorMessage(NLS.bind(Messages.ImportTraceWizard_ErrorExperimentAlreadyExists, name)); return false; } } } setErrorMessage(null); return true; }

Target:
protected boolean validateOptionsGroup() { if (fCreateExperimentCheckbox != null && fCreateExperimentCheckbox.getSelection()) { String name = fExperimentNameText.getText().trim(); if (name.isEmpty()) { setMessage(null); setErrorMessage(Messages.ImportTraceWizard_ErrorEmptyExperimentName); return false; } IWorkspace workspace = ResourcesPlugin.getWorkspace(); if ((workspace != null) && (!workspace.validateName(name, IResource.FILE).isOK())) { setMessage(null); setErrorMessage(NLS.bind(Messages.ImportTraceWizard_ErrorExperimentNameInvalid, name)); return false; } if (fExperimentFolderElement != null) { TmfExperimentElement element = fExperimentFolderElement.getExperiment(name); if (element != null) { setMessage(null); setErrorMessage(NLS.bind(Messages.ImportTraceWizard_ErrorExperimentAlreadyExists, name)); return false; } IFolder expResource = fExperimentFolderElement.getResource(); IResource res = expResource.findMember(name); if (res != null) { setMessage(null); setErrorMessage(NLS.bind(Messages.ImportTraceWizard_ErrorResourceAlreadyExists, name)); return false; } } } setErrorMessage(null); return true; }
Source:
public void doRssLatest( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { final List<Run> lastBuilds = new ArrayList<>(); for (AbstractProject<?, ?> p : Jenkins.get().allItems(AbstractProject.class)) { if (p.getLastBuild() != null) { lastBuilds.add(p.getLastBuild()); } } RSS.rss(req, rsp, getDisplayName() + " last builds only", getUrl(), RunList.fromRuns(lastBuilds)); }

Target:
public void doRssLatest( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { final List<Run> lastBuilds = new ArrayList<>(); for (AbstractProject<?, ?> p : Jenkins.get().allItems(AbstractProject.class)) { if (p.getLastBuild() != null) { for (AbstractBuild<?, ?> b = p.getLastBuild(); b != null; b = b.getPreviousBuild()) { if (b.getBuiltOn() == getNode()) { lastBuilds.add(b); break; } } } } RSS.rss(req, rsp, getDisplayName() + " last builds only", getUrl(), RunList.fromRuns(lastBuilds)); }
Source:
public static AvailableOfflineStatus fromValue(int value) { switch (value) { case 0: return NOT_AVAILABLE_OFFLINE; case 1: return AVAILABLE_OFFLINE; case 2: return AVAILABLE_OFFLINE_PARENT; } return null; }

Target:
public static AvailableOfflineStatus fromValue(int value) { if (value > -1 && value < values().length) { return values()[value]; } else { return null; } }
Source:
Map<String, FileInfo> toFileInfoMap(Change change, PatchSet patchSet, @Nullable PatchSet base) throws PatchListNotAvailableException { ObjectId a = (base == null) ? null : ObjectId.fromString(base.getRevision().get()); ObjectId b = ObjectId.fromString(patchSet.getRevision().get()); PatchListKey patchListKey = new PatchListKey(change.getProject(), a, b, Whitespace.IGNORE_NONE); if (base != null && patchSet != null) { patchListKey.setPatchSetIds(base.getId().get(), patchSet.getId().get()); } PatchList list = patchListCache.get(patchListKey); Map<String, FileInfo> files = Maps.newTreeMap(); for (PatchListEntry e : list.getPatches()) { FileInfo d = new FileInfo(); d.status = e.getChangeType() != Patch.ChangeType.MODIFIED ? e.getChangeType().getCode() : null; d.oldPath = e.getOldName(); if (e.getPatchType() == Patch.PatchType.BINARY) { d.binary = true; } else { d.linesInserted = e.getInsertions() > 0 ? e.getInsertions() : null; d.linesDeleted = e.getDeletions() > 0 ? e.getDeletions() : null; } FileInfo o = files.put(e.getNewName(), d); if (o != null) { d.status = Patch.ChangeType.REWRITE.getCode(); if (o.binary != null && o.binary) { d.binary = true; } if (o.linesInserted != null) { d.linesInserted = o.linesInserted; } if (o.linesDeleted != null) { d.linesDeleted = o.linesDeleted; } } } return files; }

Target:
Map<String, FileInfo> toFileInfoMap(Change change, PatchSet patchSet, @Nullable PatchSet base) throws PatchListNotAvailableException { ObjectId a = (base == null) ? null : ObjectId.fromString(base.getRevision().get()); ObjectId b = ObjectId.fromString(patchSet.getRevision().get()); PatchListKey patchListKey = null; if(base != null ) { patchListKey = new PatchListKey(change.getProject(), a, b, base.getId().get(), patchSet.getId().get(), Whitespace.IGNORE_NONE); } else { patchListKey = new PatchListKey(change.getProject(), a, b, Whitespace.IGNORE_NONE); } PatchList list = patchListCache.get(patchListKey); Map<String, FileInfo> files = Maps.newTreeMap(); for (PatchListEntry e : list.getPatches()) { FileInfo d = new FileInfo(); d.status = e.getChangeType() != Patch.ChangeType.MODIFIED ? e.getChangeType().getCode() : null; d.oldPath = e.getOldName(); if (e.getPatchType() == Patch.PatchType.BINARY) { d.binary = true; } else { d.linesInserted = e.getInsertions() > 0 ? e.getInsertions() : null; d.linesDeleted = e.getDeletions() > 0 ? e.getDeletions() : null; } FileInfo o = files.put(e.getNewName(), d); if (o != null) { d.status = Patch.ChangeType.REWRITE.getCode(); if (o.binary != null && o.binary) { d.binary = true; } if (o.linesInserted != null) { d.linesInserted = o.linesInserted; } if (o.linesDeleted != null) { d.linesDeleted = o.linesDeleted; } } } return files; }
Source:
public Object execute(K k, Rewriter rewriter, CompiledDefinition compiledDefinition) { if (kRunOptions.search()) { Rule pattern; if (kRunOptions.pattern != null) { pattern = KRun.compilePattern(files, kem, kRunOptions.pattern, kRunOptions, compiledDefinition, Source.apply("<command line>")); } else { pattern = KRun.compilePattern(files, kem, kRunOptions.DEFAULT_KORE_PATTERN, kRunOptions, compiledDefinition, Source.apply("<command line>")); } return new SearchResult(rewriter.search(k, Optional.ofNullable(kRunOptions.depth), Optional.ofNullable(kRunOptions.bound), pattern)); } if (kRunOptions.exitCodePattern != null) { Rule pattern = KRun.compilePattern(files, kem, kRunOptions.exitCodePattern, kRunOptions, compiledDefinition, Source.apply("<command line: --exit-code>")); Tuple2<K, List<? extends Map<? extends KVariable, ? extends K>>> res = rewriter.executeAndMatch(k, Optional.ofNullable(kRunOptions.depth), pattern); return Tuple2.apply(res._1(), KRun.getExitCode(kem, res._2())); } return rewriter.execute(k, Optional.ofNullable(kRunOptions.depth)).k(); }

Target:
public Object execute(K k, Rewriter rewriter, CompiledDefinition compiledDefinition) { Rule pattern = null, parsedPattern = null; if (kRunOptions.pattern != null) { parsedPattern = KRun.parsePattern(files, kem, kRunOptions.pattern, compiledDefinition, Source.apply("<command line>")); pattern = KRun.compilePattern(files, kem, kRunOptions.pattern, kRunOptions, compiledDefinition, Source.apply("<command line>")); } if (kRunOptions.search()) { if (pattern == null) { pattern = new Rule(KORE.KVariable("X"), BooleanUtils.TRUE, BooleanUtils.TRUE, KORE.Att()); parsedPattern = pattern; } return new SearchResult(rewriter.search(k, Optional.ofNullable(kRunOptions.depth), Optional.ofNullable(kRunOptions.bound), pattern, kRunOptions.searchType()), parsedPattern); } if (kRunOptions.exitCodePattern != null) { Rule exitCodePattern = KRun.compilePattern(files, kem, kRunOptions.exitCodePattern, kRunOptions, compiledDefinition, Source.apply("<command line: --exit-code>")); Tuple2<K, List<? extends Map<? extends KVariable, ? extends K>>> res; if (pattern != null) { res = rewriter.executeAndMatch(k, Optional.ofNullable(kRunOptions.depth), pattern); return new Tuple2<>(new SearchResult(res._2(), parsedPattern), KRun.getExitCode(kem, rewriter.match(res._1(), exitCodePattern))); } res = rewriter.executeAndMatch(k, Optional.ofNullable(kRunOptions.depth), exitCodePattern); return Tuple2.apply(res._1(), KRun.getExitCode(kem, res._2())); } if (pattern != null) { Tuple2<K, List<? extends Map<? extends KVariable, ? extends K>>> res = rewriter.executeAndMatch(k, Optional.ofNullable(kRunOptions.depth), pattern); return new SearchResult(res._2(), parsedPattern); } return rewriter.execute(k, Optional.ofNullable(kRunOptions.depth)).k(); }
Source:
public DtmfSinkFacade getDetector() { return this.detector; }

Target:
public DtmfEventSubject getDetector() { return this.detector; }
Source:
public ReportsOverview() { add(createHeader(), createMainContent(), createSelectionContent()); projectName.addChangeListener(evt -> { Project selectedProject = getSelectedProject(); numberOfReports.setText( String.valueOf(repository.countReports(selectedProject))); projectVersion.getElement().removeAllChildren(); getProjectVersionOptions().forEach(projectVersion::addOption); dataProvider.setData(new ArrayList<>( repository.findReports(buildReportsQuery()))); table.updateContent(); }); projectVersion.addChangeListener(evt -> { dataProvider.setData(new ArrayList<>( repository.findReports(buildReportsQuery()))); table.updateContent(); }); }

Target:
public ReportsOverview() { add(createHeader(), createMainContent(), createSelectionContent()); allVersions = new Option(); allVersions.setText("All versions"); allVersions.setValue(ALL_VERSIONS_KEY); projectName.addChangeListener(evt -> { Project selectedProject = getSelectedProject(); numberOfReports.setText( String.valueOf(repository.countReports(selectedProject))); projectVersion.getElement().removeAllChildren(); getProjectVersionOptions().forEach(projectVersion::addOption); table.setData(repository.findReports(getSelectedProject(), getSelectedProjectVersion())); }); projectVersion.addChangeListener(evt -> { table.setData(repository.findReports(getSelectedProject(), getSelectedProjectVersion())); }); }
Source:
private Action rejectExceptionalMessage(final long messageType, final int refTagId, final long position) { if (messageType == LOGON_MESSAGE_TYPE) { final Action action = onExceptionalMessage(logon.header(), refTagId, position); if (action != ABORT) { session.logoutAndDisconnect(); } } else if (messageType == LOGOUT_MESSAGE_TYPE) { return onExceptionalMessage(logout.header(), refTagId, position); } else if (messageType == HEARTBEAT_MESSAGE_TYPE) { return onExceptionalMessage(heartbeat.header(), refTagId, position); } else if (messageType == REJECT_MESSAGE_TYPE) { return onExceptionalMessage(reject.header(), refTagId, position); } else if (messageType == TEST_REQUEST_MESSAGE_TYPE) { return onExceptionalMessage(testRequest.header(), refTagId, position); } else if (messageType == SEQUENCE_RESET_MESSAGE_TYPE) { return onExceptionalMessage(sequenceReset.header(), refTagId, position); } return onExceptionalMessage(header, refTagId, position); }

Target:
private Action rejectExceptionalMessage(final long messageType, final int refTagId, final long position) { if (messageType == LOGON_MESSAGE_TYPE) { final Action action = onExceptionalMessage(logon.header(), refTagId, position); if (action != ABORT) { session.logoutAndDisconnect(); } return action; } else if (messageType == LOGOUT_MESSAGE_TYPE) { return onExceptionalMessage(logout.header(), refTagId, position); } else if (messageType == HEARTBEAT_MESSAGE_TYPE) { return onExceptionalMessage(heartbeat.header(), refTagId, position); } else if (messageType == REJECT_MESSAGE_TYPE) { return onExceptionalMessage(reject.header(), refTagId, position); } else if (messageType == TEST_REQUEST_MESSAGE_TYPE) { return onExceptionalMessage(testRequest.header(), refTagId, position); } else if (messageType == SEQUENCE_RESET_MESSAGE_TYPE) { return onExceptionalMessage(sequenceReset.header(), refTagId, position); } return onExceptionalMessage(header, refTagId, position); }
Source:
protected Predicate<String> provideServerStartedPredicate(final DimensionDataCloudControlApi api, final ComputeServiceConstants.Timeouts timeouts, final ComputeServiceConstants.PollPeriod pollPeriod) { return retry(new ServerStatus(api.getServerApi(), true, true), timeouts.imageAvailable, pollPeriod.pollInitialPeriod, pollPeriod.pollMaxPeriod); }

Target:
protected Predicate<String> provideServerStartedPredicate(final DimensionDataCloudControlApi api, final ComputeServiceConstants.Timeouts timeouts, final ComputeServiceConstants.PollPeriod pollPeriod) { return retry(new ServerStatus(api.getServerApi(), true, true), timeouts.nodeRunning, pollPeriod.pollInitialPeriod, pollPeriod.pollMaxPeriod); }
Source:
public boolean onLongClick(final View arg0) { if (progress.isShowing()) { showToast(res.getString(R.string.err_detail_still_working)); return false; } if (Settings.getChooseList()) { new StoredList.UserInterface(getActivity()).promptForListSelection(R.string.list_title, new Action1<Integer>() { @Override public void call(final Integer selectedListId) { storeCache(selectedListId); } }, true, cache.getLists()); } else { storeCache(StoredList.TEMPORARY_LIST.id); } return true; }

Target:
public boolean onLongClick(final View arg0) { manageLists(true); return true; }
Source:
private void monitorLocks() { lockMonitorFuture = Optional.of(lockMonitorScheduler.scheduleWithFixedDelay( () -> { try { Collection<LockId> locksWithExpiredLeases = lockStore.filterLocksWithExpiredLeases(locks.keySet()); for(LockId lockId : locksWithExpiredLeases) { log.debug("LockClient: lease revoked for lock {}", lockId.getLockName()); locks.get(lockId).input(LockEvent.LEASE_REVOKED); } } catch (WrongClusterException wce) { log.error("Lock client is connected to a wrong cluster:", clientId, wce); throw wce; } catch (Exception ex) { } }, DurationBetweenLockMonitorRuns, DurationBetweenLockMonitorRuns, TimeUnit.SECONDS )); }

Target:
private void monitorLocks() { lockMonitorFuture = Optional.of(lockMonitorScheduler.scheduleWithFixedDelay( () -> { try { Collection<LockId> locksWithExpiredLeases = lockStore.filterLocksWithExpiredLeases(locks.keySet()); for(LockId lockId : locksWithExpiredLeases) { log.debug("LockClient: lease revoked for lock {}", lockId.getLockName()); locks.get(lockId).input(LockEvent.LEASE_REVOKED); } } catch (Exception ex) { log.error("Caught exception while monitoring locks.", ex); } }, DurationBetweenLockMonitorRuns, DurationBetweenLockMonitorRuns, TimeUnit.SECONDS )); }
Source:
public void testEquals(){ VariableIdentifier v1 = getInstance(); assertEquals(v1, v1); VariableIdentifier v2 = new VariableIdentifier(getNamespaceIdentifierInstance(), "foo"); assertEquals(v1, v2); VariableIdentifier v3 = new VariableIdentifier(getNamespaceIdentifierInstance(), "bar"); assertNotEquals(v1, v3); ArrayList<String> name = new ArrayList<String>(1); name.add("bogus"); NamespaceIdentifier n4 = new NamespaceIdentifier(name); VariableIdentifier v4 = new VariableIdentifier(n4, "foo"); assertNotEquals(v1, v4); }

Target:
public void testEquals() { VariableIdentifier v = new VariableIdentifier( getNamespaceIdentifierInstance(), "foo" ); assertEquals(getInstance(), v); }
Source:
private String obtainFailureMessage(@Nullable GerritTriggeredEvent event, @Nonnull Run build, @Nullable TaskListener listener) throws IOException, InterruptedException { Job project = build.getParent(); String content = null; GerritTrigger trigger = GerritTrigger.getTrigger(project); if (trigger != null) { String filepath = trigger.getBuildUnsuccessfulFilepath(); logger.debug("Looking for failure message in file glob: {}", filepath); if (filepath != null && !filepath.isEmpty()) { EnvVars envVars; if (listener == null) { envVars = build.getEnvironment(); } else { envVars = build.getEnvironment(listener); } filepath = envVars.expand(filepath); if (build instanceof AbstractBuild) { FilePath[] matches = this.getMatchingWorkspaceFiles(((AbstractBuild)build).getWorkspace(), filepath); logger.debug("Found matching workspace files: {}", matches); if (matches.length > 0) { FilePath path = matches[0]; content = this.getExpandedContent(path, envVars); logger.info("Obtained failure message from file: {}", content); } } else { logger.info("Unable to find matching workspace files for job type {}", build.getClass().getName()); } } } return content; }

Target:
private String obtainFailureMessage(@Nullable GerritTriggeredEvent event, @Nonnull Run build, @Nullable TaskListener listener) throws IOException, InterruptedException { Job project = build.getParent(); String content = null; GerritTrigger trigger = GerritTrigger.getTrigger(project); if (trigger != null) { String filepath = trigger.getBuildUnsuccessfulFilepath(); logger.debug("Looking for failure message in file glob: {}", filepath); if (filepath != null && !filepath.isEmpty()) { EnvVars envVars; if (listener == null) { envVars = build.getEnvironment(); } else { envVars = build.getEnvironment(listener); } filepath = envVars.expand(filepath); if (build instanceof AbstractBuild) { FilePath[] matches = this.getMatchingWorkspaceFiles(((AbstractBuild)build).getWorkspace(), filepath); logger.debug("Found matching workspace files: {}", matches); if (matches.length > 0) { FilePath path = matches[0]; content = this.getExpandedContent(path, envVars); logger.info("Obtained failure message from file: {}", content); } } else { logger.warn("Unable to find matching workspace files for job {}, type {}", build.getDisplayName(), build.getClass().getName()); } } } return content; }
Source:
public String getPath() { try { return file.toURI().getPath(); } catch (URISyntaxException e) { return file.getFile(); } }

Target:
public String getPath() { try { return file.toURI().getPath(); } catch (URISyntaxException e) { return file.getPath(); } }
Source:
public void transform(StructuredRecord in, Emitter<StructuredRecord> emitter) throws Exception { StructuredRecord.Builder builder = StructuredRecord.builder(outSchema); Schema inSchema = in.getSchema(); List<Field> inFields = inSchema.getFields(); for (Field field : inFields) { String name = field.getName(); if (!outSchemaMap.containsKey(name)) { continue; } Schema.Type outFieldType = outSchemaMap. get(name); if (!deCompMap.containsKey(name) || deCompMap.get(name) == DecompressorType.NONE) { builder.set(name, in.get(name)); } else { byte[] obj = new byte[0]; if (field.getSchema().getType() == Schema.Type.BYTES){ obj = in.get(name); } else { LOG.error("Input field '" + name + "' should be of type BYTES to decompress. It's currently of type" + "'" + field.getSchema().getType().toString()); } byte[] outValue = new byte[0]; DecompressorType type = deCompMap.get(name); if (type == DecompressorType.SNAPPY) { outValue = Snappy.uncompress(obj); } else if (type == DecompressorType.ZIP) { outValue = unzip(obj); } else if (type == DecompressorType.GZIP) { outValue = ungzip(obj); } if (outValue != null) { if (outFieldType == Schema.Type.BYTES) { builder.set(name, outValue); } else if (outFieldType == Schema.Type.STRING) { builder.set(name, Bytes.toString(outValue)); } } } } emitter.emit(builder.build()); }

Target:
public void transform(StructuredRecord in, Emitter<StructuredRecord> emitter) throws Exception { StructuredRecord.Builder builder = StructuredRecord.builder(outSchema); Schema inSchema = in.getSchema(); List<Field> inFields = inSchema.getFields(); for (Field field : inFields) { String name = field.getName(); if (!outSchemaMap.containsKey(name)) { continue; } Schema.Type outFieldType = outSchemaMap.get(name); if (!deCompMap.containsKey(name) || deCompMap.get(name) == DecompressorType.NONE) { builder.set(name, in.get(name)); } else { byte[] obj = new byte[0]; if (field.getSchema().getType() == Schema.Type.BYTES){ obj = in.get(name); } else { LOG.error("Input field '" + name + "' should be of type BYTES to decompress. It's currently of type" + "'" + field.getSchema().getType().toString()); break; } byte[] outValue = new byte[0]; DecompressorType type = deCompMap.get(name); if (type == DecompressorType.SNAPPY) { outValue = Snappy.uncompress(obj); } else if (type == DecompressorType.ZIP) { outValue = unzip(obj); } else if (type == DecompressorType.GZIP) { outValue = ungzip(obj); } if (outValue != null) { if (outFieldType == Schema.Type.BYTES) { builder.set(name, outValue); } else if (outFieldType == Schema.Type.STRING) { builder.set(name, new String(outValue, "UTF-8")); } } } } emitter.emit(builder.build()); }
Source:
private void importFormList(CommcareFormList formList) { for (CommcareForm form : Lists.reverse(formList.getObjects())) { FullFormEvent formEvent = new FullFormEvent(form.getForm(), form.getReceivedOn(), form.getConfigName()); lastStartedImportingFormId = form.getId(); eventRelay.sendEventMessage(formEvent.toMotechEvent()); lastImportedDate = form.getReceivedOn(); lastImportedFormId = form.getId(); importCount++; LOGGER.info("Imported form with ID: {}, received on: {}", form.getId(), form.getReceivedOn()); } }

Target:
private void importFormList(CommcareFormList formList) { for (CommcareForm form : Lists.reverse(formList.getObjects())) { FullFormEvent formEvent = new FullFormEvent(form.getForm(), form.getReceivedOn(), form.getConfigName()); lastFormXMLNSToBeImported = formEvent.getAttributes().get("xmlns"); eventRelay.sendEventMessage(formEvent.toMotechEvent()); lastImportedDate = form.getReceivedOn(); lastImportedFormId = form.getId(); importCount++; LOGGER.info("Imported form with ID: {}, received on: {}", form.getId(), form.getReceivedOn()); } }
Source:
public void afterPropertiesSet() throws Exception { ThymeleafViewResolver viewResolver = applicationContext.getBean(ThymeleafViewResolver.class); if (viewResolver == null) { LOG.warn( "Cannot adjust ThymeleafViewResolver: " + "bean of this type wasn't found in application context" ); return; } boolean productionEnv = environment.acceptsProfiles("prod"); Boolean useCdn = environment.getProperty("app.use-cdn", Boolean.class, Boolean.TRUE); viewResolver.setStaticVariables(resourcesAsMap(productionEnv, useCdn)); }

Target:
public void afterPropertiesSet() throws Exception { ThymeleafViewResolver viewResolver = applicationContext.getBean(ThymeleafViewResolver.class); if (viewResolver == null) { LOG.warn( "Cannot adjust ThymeleafViewResolver: " + "bean of this type wasn't found in application context" ); return; } boolean productionEnv = environment.acceptsProfiles("prod"); boolean useCdn = environment.getProperty("app.use-cdn", Boolean.class, Boolean.TRUE); viewResolver.setStaticVariables(resourcesAsMap(productionEnv, useCdn)); }
Source:
private static List<String> findAppFiles(@NotNull Collection<String> removedFiles) { return ContainerUtil.filter(removedFiles, new Condition<String>() { @Override public boolean value(String filePath) { return isAppConfigFileName(filePath); } }); }

Target:
private static List<String> findAppFiles(@NotNull Collection<String> removedFiles) { return ContainerUtil.filter(removedFiles, new Condition<String>() { @Override public boolean value(String filePath) { return ErlangBuilderUtil.isAppConfigFileName(filePath); } }); }
Source:
protected void initMetadataStore() throws FormatException { super.initMetadataStore(); MetadataStore store = makeFilterMetadata(); MetadataTools.populatePixels(store, this); if (getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM) { Length sizeX = FormatTools.getPhysicalSizeX(pixelSizeX); Length sizeY = FormatTools.getPhysicalSizeY(pixelSizeY); Length sizeZ = FormatTools.getPhysicalSizeZ(pixelSizeZ); if (sizeX != null) { store.setPixelsPhysicalSizeX(sizeX, 0); } if (sizeY != null) { store.setPixelsPhysicalSizeY(sizeY, 0); } if (sizeZ != null) { store.setPixelsPhysicalSizeZ(sizeZ, 0); } store.setPixelsTimeIncrement(new Time(pixelSizeT / 1000000.0, UNITS.SECOND), 0); for (int i=0; i<getEffectiveSizeC(); i++) { if (cNames != null && i < cNames.length) { store.setChannelName(cNames[i], 0, i); } int index = getIndex(0, i, 0); if (index < channelColors.size()) { store.setChannelColor(channelColors.get(index), 0, i); } } store.setImageDescription("", 0); } }

Target:
protected void initMetadataStore() throws FormatException { super.initMetadataStore(); MetadataStore store = makeFilterMetadata(); MetadataTools.populatePixels(store, this); if (getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM) { Length sizeX = FormatTools.getPhysicalSizeX(pixelSizeX); Length sizeY = FormatTools.getPhysicalSizeY(pixelSizeY); Length sizeZ = FormatTools.getPhysicalSizeZ(pixelSizeZ); if (sizeX != null) { store.setPixelsPhysicalSizeX(sizeX, 0); } if (sizeY != null) { store.setPixelsPhysicalSizeY(sizeY, 0); } if (sizeZ != null) { store.setPixelsPhysicalSizeZ(sizeZ, 0); } store.setPixelsTimeIncrement(new Time(pixelSizeT / 1000000.0, UNITS.SECOND), 0); for (int i=0; i<getEffectiveSizeC(); i++) { if (cNames != null && i < cNames.length) { store.setChannelName(cNames[i], 0, i); } int index = getIndex(0, i, 0); if (index < channelColors.size() && channelColors.get(index) != null) { store.setChannelColor(channelColors.get(index), 0, i); } } store.setImageDescription("", 0); } }
Source:
public PartialRecordCleanupResult cleanupPartialRecord() { checkState(partialRecordLength >= 0, "Approximate local recovery does not yet work with unaligned checkpoint!"); if (partialRecordLength == 0 || !bufferConsumer.startOfDataBuffer()) { return new PartialRecordCleanupResult(build(), false); } checkState(partialRecordLength <= bufferConsumer.getBufferSize(), "Partial record length beyond max buffer capacity!"); if (partialRecordLength < bufferConsumer.getBufferSize()) { return new PartialRecordCleanupResult(bufferConsumer.skipBuild(partialRecordLength), false); } else { return new PartialRecordCleanupResult(bufferConsumer.skipBuild(partialRecordLength), true); } }

Target:
public boolean cleanupPartialRecord() { checkState(partialRecordLength >= 0, "Approximate local recovery does not yet work with unaligned checkpoint!"); if (partialRecordLength == 0 || !bufferConsumer.isStartOfDataBuffer()) { return true; } checkState(partialRecordLength <= bufferConsumer.getBufferSize(), "Partial record length beyond max buffer capacity!"); bufferConsumer.skip(partialRecordLength); if (partialRecordLength < bufferConsumer.getBufferSize()) { return true; } else { return false; } }
Source:
protected boolean canDoAction() { NetworkValidator validatorNew = new NetworkValidator(getNetwork()); NetworkValidator validatorOld = new NetworkValidator(getOldNetwork()); return validate(validatorNew.dataCenterExists()) && validate(validatorNew.vmNetworkSetCorrectly()) && validate(validatorNew.stpForVmNetworkOnly()) && validate(validatorNew.mtuValid()) && validate(validatorNew.networkPrefixValid()) && validate(validatorNew.vlanIdNotUsed()) && validate(validatorOld.networkExists()) && validate(validatorOld.notManagementNetwork()) && validate(validatorNew.networkNameNotUsed()) && validate(validatorOld.networkNotUsedByVms()) && validate(validatorOld.networkNotUsedByTemplates()) && validate(validatorOld.networkNotUsedByHosts()); }

Target:
protected boolean canDoAction() { Network newNetwork = getNetwork(); Network oldNetwork = getOldNetwork(); NetworkValidator validatorNew = new NetworkValidator(newNetwork); NetworkValidator validatorOld = new NetworkValidator(oldNetwork); UpdateNetworkValidator validatorCombined = new UpdateNetworkValidator(newNetwork, oldNetwork); return validate(validatorNew.dataCenterExists()) && validate(validatorNew.vmNetworkSetCorrectly()) && validate(validatorNew.stpForVmNetworkOnly()) && validate(validatorNew.mtuValid()) && validate(validatorNew.networkPrefixValid()) && validate(validatorNew.vlanIdNotUsed()) && validate(validatorOld.networkExists()) && validate(validatorCombined.notChangingManagementNetwork()) && validate(validatorNew.networkNameNotUsed()) && validate(validatorOld.networkNotUsedByVms()) && validate(validatorOld.networkNotUsedByTemplates()) && validate(validatorOld.networkNotUsedByHosts()); }
Source:
public void handleCustomEvent(UIEvent event) { EventType<UIEvent> eventType = (EventType<UIEvent>) event .getEventType(); }

Target:
public void handleCustomEvent(UIEvent event) { }
Source:
public boolean equals(Object obj) { if (obj != null && obj.getClass() == getClass()) { UserLibrary other = (UserLibrary) obj; if (this.entries.length == other.entries.length && attributes.size() == other.attributes.size()) { for (int i = 0; i < this.entries.length; i++) { if (!this.entries[i].equals(other.entries[i])) { return false; } } for (String key : this.attributes.keySet()) { String thisValue = this.attributes.get(key); String otherValue = other.attributes.get(key); if (!(thisValue == null ? otherValue == null : thisValue .equals(otherValue))) { return false; } } return true; } } return false; }

Target:
public boolean equals(Object obj) { if (obj != null && obj.getClass() == getClass()) { UserLibrary other = (UserLibrary) obj; if (this.entries.length == other.entries.length && this.isSystemLibrary == other.isSystemLibrary && attributes.size() == other.attributes.size()) { if (!Arrays.equals(this.entries, other.entries)) { return false; } if (!this.attributes.equals(other.attributes)) { return false; } return true; } } return false; }
Source:
private boolean checkIfParameterizedTypeReferenceShouldBeUsed(TypeMirror returnType) { switch (returnType.getKind()) { case DECLARED: return !((DeclaredType) returnType).getTypeArguments().isEmpty(); case ARRAY: ArrayType arrayType = (ArrayType) returnType; TypeMirror componentType = arrayType.getComponentType(); if (componentType.getKind() == TypeKind.DECLARED) { return !((DeclaredType) componentType).getTypeArguments().isEmpty(); } else { return checkIfParameterizedTypeReferenceShouldBeUsed(componentType); } } return false; }

Target:
private boolean checkIfParameterizedTypeReferenceShouldBeUsed(TypeMirror returnType) { switch (returnType.getKind()) { case DECLARED: return !((DeclaredType) returnType).getTypeArguments().isEmpty(); case ARRAY: ArrayType arrayType = (ArrayType) returnType; TypeMirror componentType = arrayType.getComponentType(); return checkIfParameterizedTypeReferenceShouldBeUsed(componentType); } return false; }
Source:
private static IndexQuery.ExactPredicate[] assertOnlyExactPredicates( IndexQuery[] predicates ) { IndexQuery.ExactPredicate[] exactPredicates; if ( predicates.getClass() == IndexQuery.ExactPredicate[].class ) { exactPredicates = (IndexQuery.ExactPredicate[]) predicates; } else { exactPredicates = new IndexQuery.ExactPredicate[predicates.length]; for ( int i = 0; i < predicates.length; i++ ) { if ( predicates[i] instanceof IndexQuery.ExactPredicate ) { exactPredicates[i] = (IndexQuery.ExactPredicate) predicates[i]; } else { throw new UnsupportedOperationException( "Query not supported: " + Arrays.toString( predicates ) ); } } } return exactPredicates; }

Target:
private static IndexQuery.ExactPredicate[] assertOnlyExactPredicates( IndexQuery[] predicates ) { IndexQuery.ExactPredicate[] exactPredicates; if ( predicates.getClass() == IndexQuery.ExactPredicate[].class ) { exactPredicates = (IndexQuery.ExactPredicate[]) predicates; } else { exactPredicates = new IndexQuery.ExactPredicate[predicates.length]; for ( int i = 0; i < predicates.length; i++ ) { if ( predicates[i] instanceof IndexQuery.ExactPredicate ) { exactPredicates[i] = (IndexQuery.ExactPredicate) predicates[i]; } else { throw new IllegalArgumentException( "Query not supported: " + Arrays.toString( predicates ) ); } } } return exactPredicates; }
Source:
private VirtualClassLoader getParentClassLoader(ClassLoaderIdentifier identifier) { final ClassLoaderIdentifier parentIdentifier = parentClassLoaderResolver.getParentClassLoaderIdentifier(identifier); VirtualClassLoader parent; if (ClassLoaderIdentifier.GLOBAL.equals(identifier) || parentIdentifier == null) { parent = getVirtualGlobalClassLoader(); } else { parent = getLocalClassLoader(parentIdentifier); } return parent; }

Target:
private VirtualClassLoader getParentClassLoader(ClassLoaderIdentifier identifier) { final ClassLoaderIdentifier parentIdentifier = parentClassLoaderResolver.getParentClassLoaderIdentifier(identifier); NullCheckingUtil.checkArgsNotNull(parentIdentifier); VirtualClassLoader parent; if (ClassLoaderIdentifier.GLOBAL.equals(parentIdentifier)) { parent = getVirtualGlobalClassLoader(); } else { parent = getLocalClassLoader(parentIdentifier); } return parent; }
Source:
public static boolean isEmpty( IBaseResultSet set ) throws BirtException { if ( set instanceof IQueryResultSet ) { return ( (IQueryResultSet) set ).isEmpty( ); } else if ( set instanceof ICubeResultSet ) { CubeCursor cursor = (( (ICubeResultSet) set ).getCubeCursor()); return cursor.getOrdinateEdge().size() != 0; } return false; }

Target:
public static boolean isEmpty( IBaseResultSet set ) throws BirtException { if ( set instanceof IQueryResultSet ) { return ( (IQueryResultSet) set ).isEmpty( ); } else if ( set instanceof ICubeResultSet ) { CubeCursor cursor = (( (ICubeResultSet) set ).getCubeCursor()); if(cursor != null) { List edges = cursor.getOrdinateEdge(); return edges != null && !edges.isEmpty(); } } return false; }
Source:
protected BaseReceivePack(final Repository into) { db = into; walk = new RevWalk(db); final ReceiveConfig cfg = db.getConfig().get(ReceiveConfig.KEY); objectChecker = cfg.newObjectChecker(); allowCreates = cfg.allowCreates; allowAnyDeletes = true; allowBranchDeletes = cfg.allowDeletes; allowNonFastForwards = cfg.allowNonFastForwards; allowOfsDelta = cfg.allowOfsDelta; advertiseRefsHook = AdvertiseRefsHook.DEFAULT; refFilter = RefFilter.DEFAULT; advertisedHaves = new HashSet<ObjectId>(); clientShallowCommits = new HashSet<ObjectId>(); certNonceSeed = cfg.certNonceSeed; if (!certNonceSeed.isEmpty()) pushCertNonce = preparePushCertNonce( into.getDirectory().getPath(), new Date(0).getTime() / milliSecondsPerSecond); certNonceSlopLimit = cfg.certNonceSlopLimit; }

Target:
protected BaseReceivePack(final Repository into) { db = into; walk = new RevWalk(db); final ReceiveConfig cfg = db.getConfig().get(ReceiveConfig.KEY); objectChecker = cfg.newObjectChecker(); allowCreates = cfg.allowCreates; allowAnyDeletes = true; allowBranchDeletes = cfg.allowDeletes; allowNonFastForwards = cfg.allowNonFastForwards; allowOfsDelta = cfg.allowOfsDelta; advertiseRefsHook = AdvertiseRefsHook.DEFAULT; refFilter = RefFilter.DEFAULT; advertisedHaves = new HashSet<ObjectId>(); clientShallowCommits = new HashSet<ObjectId>(); String dirPath = db.getDirectory() != null ? db.getDirectory().getPath() : "" ; pushCertificateParser = new PushCertificateParser(cfg, dirPath); }